From 132d3409f6098fdd70cc53c939615f4068d75eca Mon Sep 17 00:00:00 2001 From: RobbieMcKinstry Date: Tue, 9 Aug 2022 18:50:16 +0000 Subject: [PATCH] chore(dist): Update dist [automated commit] --- dist/index.js | 81416 ++++++++++++++++---------------------------- dist/index.js.map | 2 +- 2 files changed, 29611 insertions(+), 51807 deletions(-) diff --git a/dist/index.js b/dist/index.js index fbf061d5..f609f96f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 87351: +/***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(22037)); +const os = __importStar(__nccwpck_require__(2037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -100,7 +100,7 @@ function escapeProperty(s) { /***/ }), -/***/ 42186: +/***/ 2186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -135,13 +135,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(87351); +const command_1 = __nccwpck_require__(7351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(22037)); -const path = __importStar(__nccwpck_require__(71017)); -const uuid_1 = __nccwpck_require__(75840); -const oidc_utils_1 = __nccwpck_require__(98041); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const uuid_1 = __nccwpck_require__(5840); +const oidc_utils_1 = __nccwpck_require__(8041); /** * The code to exit an action */ @@ -426,12 +426,12 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(81327); +var summary_1 = __nccwpck_require__(1327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(81327); +var summary_2 = __nccwpck_require__(1327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports @@ -473,8 +473,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issueCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(57147)); -const os = __importStar(__nccwpck_require__(22037)); +const fs = __importStar(__nccwpck_require__(7147)); +const os = __importStar(__nccwpck_require__(2037)); const utils_1 = __nccwpck_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -493,7 +493,7 @@ exports.issueCommand = issueCommand; /***/ }), -/***/ 98041: +/***/ 8041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -509,9 +509,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(96255); -const auth_1 = __nccwpck_require__(35526); -const core_1 = __nccwpck_require__(42186); +const http_client_1 = __nccwpck_require__(6255); +const auth_1 = __nccwpck_require__(5526); +const core_1 = __nccwpck_require__(2186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -603,7 +603,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(71017)); +const path = __importStar(__nccwpck_require__(1017)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -642,7 +642,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 81327: +/***/ 1327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -658,8 +658,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; -const os_1 = __nccwpck_require__(22037); -const fs_1 = __nccwpck_require__(57147); +const os_1 = __nccwpck_require__(2037); +const fs_1 = __nccwpck_require__(7147); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -979,7 +979,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 71514: +/***/ 1514: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1014,8 +1014,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; -const string_decoder_1 = __nccwpck_require__(71576); -const tr = __importStar(__nccwpck_require__(88159)); +const string_decoder_1 = __nccwpck_require__(1576); +const tr = __importStar(__nccwpck_require__(8159)); /** * Exec a command. * Output will be streamed to the live console. @@ -1089,7 +1089,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 88159: +/***/ 8159: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1124,13 +1124,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.argStringToArray = exports.ToolRunner = void 0; -const os = __importStar(__nccwpck_require__(22037)); -const events = __importStar(__nccwpck_require__(82361)); -const child = __importStar(__nccwpck_require__(32081)); -const path = __importStar(__nccwpck_require__(71017)); -const io = __importStar(__nccwpck_require__(47351)); -const ioUtil = __importStar(__nccwpck_require__(81962)); -const timers_1 = __nccwpck_require__(39512); +const os = __importStar(__nccwpck_require__(2037)); +const events = __importStar(__nccwpck_require__(2361)); +const child = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const timers_1 = __nccwpck_require__(9512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* @@ -1714,15 +1714,15 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 74087: +/***/ 4087: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; -const fs_1 = __nccwpck_require__(57147); -const os_1 = __nccwpck_require__(22037); +const fs_1 = __nccwpck_require__(7147); +const os_1 = __nccwpck_require__(2037); class Context { /** * Hydrate the context from the environment @@ -1775,7 +1775,7 @@ exports.Context = Context; /***/ }), -/***/ 95438: +/***/ 5438: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1801,8 +1801,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokit = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(74087)); -const utils_1 = __nccwpck_require__(73030); +const Context = __importStar(__nccwpck_require__(4087)); +const utils_1 = __nccwpck_require__(3030); exports.context = new Context.Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -1818,7 +1818,7 @@ exports.getOctokit = getOctokit; /***/ }), -/***/ 47914: +/***/ 7914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1844,7 +1844,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__nccwpck_require__(96255)); +const httpClient = __importStar(__nccwpck_require__(6255)); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -1868,7 +1868,7 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ }), -/***/ 73030: +/***/ 3030: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1894,12 +1894,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokitOptions = exports.GitHub = exports.context = void 0; -const Context = __importStar(__nccwpck_require__(74087)); -const Utils = __importStar(__nccwpck_require__(47914)); +const Context = __importStar(__nccwpck_require__(4087)); +const Utils = __importStar(__nccwpck_require__(7914)); // octokit + plugins -const core_1 = __nccwpck_require__(76762); -const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); -const plugin_paginate_rest_1 = __nccwpck_require__(64193); +const core_1 = __nccwpck_require__(6762); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044); +const plugin_paginate_rest_1 = __nccwpck_require__(4193); exports.context = new Context.Context(); const baseUrl = Utils.getApiBaseUrl(); const defaults = { @@ -1929,7 +1929,7 @@ exports.getOctokitOptions = getOctokitOptions; /***/ }), -/***/ 35526: +/***/ 5526: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2017,7 +2017,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 96255: +/***/ 6255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2053,10 +2053,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(13685)); -const https = __importStar(__nccwpck_require__(95687)); -const pm = __importStar(__nccwpck_require__(19835)); -const tunnel = __importStar(__nccwpck_require__(74294)); +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(9835)); +const tunnel = __importStar(__nccwpck_require__(4294)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -2629,7 +2629,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 19835: +/***/ 9835: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -2697,7 +2697,7 @@ exports.checkBypass = checkBypass; /***/ }), -/***/ 81962: +/***/ 1962: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2733,8 +2733,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; -const fs = __importStar(__nccwpck_require__(57147)); -const path = __importStar(__nccwpck_require__(71017)); +const fs = __importStar(__nccwpck_require__(7147)); +const path = __importStar(__nccwpck_require__(1017)); _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === 'win32'; function exists(fsPath) { @@ -2881,7 +2881,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 47351: +/***/ 7436: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2916,11 +2916,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; -const assert_1 = __nccwpck_require__(39491); -const childProcess = __importStar(__nccwpck_require__(32081)); -const path = __importStar(__nccwpck_require__(71017)); -const util_1 = __nccwpck_require__(73837); -const ioUtil = __importStar(__nccwpck_require__(81962)); +const assert_1 = __nccwpck_require__(9491); +const childProcess = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const util_1 = __nccwpck_require__(3837); +const ioUtil = __importStar(__nccwpck_require__(1962)); const exec = util_1.promisify(childProcess.exec); const execFile = util_1.promisify(childProcess.execFile); /** @@ -3229,7 +3229,7 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 32473: +/***/ 2473: /***/ (function(module, exports, __nccwpck_require__) { "use strict"; @@ -3264,13 +3264,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0; -const semver = __importStar(__nccwpck_require__(70562)); -const core_1 = __nccwpck_require__(42186); +const semver = __importStar(__nccwpck_require__(562)); +const core_1 = __nccwpck_require__(2186); // needs to be require for core node modules to be mocked /* eslint @typescript-eslint/no-require-imports: 0 */ -const os = __nccwpck_require__(22037); -const cp = __nccwpck_require__(32081); -const fs = __nccwpck_require__(57147); +const os = __nccwpck_require__(2037); +const cp = __nccwpck_require__(2081); +const fs = __nccwpck_require__(7147); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter(this, void 0, void 0, function* () { const platFilter = os.platform(); @@ -3364,7 +3364,7 @@ exports._readLinuxVersionFile = _readLinuxVersionFile; /***/ }), -/***/ 38279: +/***/ 8279: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3399,7 +3399,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RetryHelper = void 0; -const core = __importStar(__nccwpck_require__(42186)); +const core = __importStar(__nccwpck_require__(2186)); /** * Internal class for retries */ @@ -3454,7 +3454,7 @@ exports.RetryHelper = RetryHelper; /***/ }), -/***/ 27784: +/***/ 7784: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3492,20 +3492,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0; -const core = __importStar(__nccwpck_require__(42186)); -const io = __importStar(__nccwpck_require__(47351)); -const fs = __importStar(__nccwpck_require__(57147)); -const mm = __importStar(__nccwpck_require__(32473)); -const os = __importStar(__nccwpck_require__(22037)); -const path = __importStar(__nccwpck_require__(71017)); -const httpm = __importStar(__nccwpck_require__(96255)); -const semver = __importStar(__nccwpck_require__(70562)); -const stream = __importStar(__nccwpck_require__(12781)); -const util = __importStar(__nccwpck_require__(73837)); -const assert_1 = __nccwpck_require__(39491); -const v4_1 = __importDefault(__nccwpck_require__(17468)); -const exec_1 = __nccwpck_require__(71514); -const retry_helper_1 = __nccwpck_require__(38279); +const core = __importStar(__nccwpck_require__(2186)); +const io = __importStar(__nccwpck_require__(7436)); +const fs = __importStar(__nccwpck_require__(7147)); +const mm = __importStar(__nccwpck_require__(2473)); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); +const httpm = __importStar(__nccwpck_require__(6255)); +const semver = __importStar(__nccwpck_require__(562)); +const stream = __importStar(__nccwpck_require__(2781)); +const util = __importStar(__nccwpck_require__(3837)); +const assert_1 = __nccwpck_require__(9491); +const v4_1 = __importDefault(__nccwpck_require__(7468)); +const exec_1 = __nccwpck_require__(1514); +const retry_helper_1 = __nccwpck_require__(8279); class HTTPError extends Error { constructor(httpStatusCode) { super(`Unexpected HTTP response: ${httpStatusCode}`); @@ -4126,7 +4126,7 @@ function _unique(values) { /***/ }), -/***/ 70562: +/***/ 562: /***/ ((module, exports) => { exports = module.exports = SemVer @@ -5762,7 +5762,7 @@ module.exports = bytesToUuid; /***/ }), -/***/ 37269: +/***/ 7269: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Unique ID creation requires a high quality random # generator. In node.js @@ -5777,10 +5777,10 @@ module.exports = function nodeRNG() { /***/ }), -/***/ 17468: +/***/ 7468: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var rng = __nccwpck_require__(37269); +var rng = __nccwpck_require__(7269); var bytesToUuid = __nccwpck_require__(7701); function v4(options, buf, offset) { @@ -5813,7 +5813,7 @@ module.exports = v4; /***/ }), -/***/ 34186: +/***/ 4186: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -5926,7 +5926,7 @@ exports.BackoffTimeout = BackoffTimeout; /***/ }), -/***/ 86380: +/***/ 6380: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -5949,9 +5949,9 @@ exports.BackoffTimeout = BackoffTimeout; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CallCredentialsFilterFactory = exports.CallCredentialsFilter = void 0; -const filter_1 = __nccwpck_require__(43392); -const constants_1 = __nccwpck_require__(90634); -const uri_parser_1 = __nccwpck_require__(65974); +const filter_1 = __nccwpck_require__(3392); +const constants_1 = __nccwpck_require__(634); +const uri_parser_1 = __nccwpck_require__(5974); class CallCredentialsFilter extends filter_1.BaseFilter { constructor(channel, stream) { var _a, _b; @@ -6008,7 +6008,7 @@ exports.CallCredentialsFilterFactory = CallCredentialsFilterFactory; /***/ }), -/***/ 21426: +/***/ 1426: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -6031,7 +6031,7 @@ exports.CallCredentialsFilterFactory = CallCredentialsFilterFactory; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CallCredentials = void 0; -const metadata_1 = __nccwpck_require__(83665); +const metadata_1 = __nccwpck_require__(3665); function isCurrentOauth2Client(client) { return ('getRequestHeaders' in client && typeof client.getRequestHeaders === 'function'); @@ -6164,7 +6164,7 @@ class EmptyCallCredentials extends CallCredentials { /***/ }), -/***/ 78988: +/***/ 8988: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -6187,14 +6187,14 @@ class EmptyCallCredentials extends CallCredentials { */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Http2CallStream = exports.InterceptingListenerImpl = exports.isInterceptingListener = void 0; -const http2 = __nccwpck_require__(85158); -const os = __nccwpck_require__(22037); -const constants_1 = __nccwpck_require__(90634); -const filter_stack_1 = __nccwpck_require__(66450); -const metadata_1 = __nccwpck_require__(83665); -const stream_decoder_1 = __nccwpck_require__(16575); -const logging = __nccwpck_require__(35993); -const constants_2 = __nccwpck_require__(90634); +const http2 = __nccwpck_require__(5158); +const os = __nccwpck_require__(2037); +const constants_1 = __nccwpck_require__(634); +const filter_stack_1 = __nccwpck_require__(6450); +const metadata_1 = __nccwpck_require__(3665); +const stream_decoder_1 = __nccwpck_require__(6575); +const logging = __nccwpck_require__(5993); +const constants_2 = __nccwpck_require__(634); const TRACER_NAME = 'call_stream'; const { HTTP2_HEADER_STATUS, HTTP2_HEADER_CONTENT_TYPE, NGHTTP2_CANCEL, } = http2.constants; /** @@ -6794,7 +6794,7 @@ exports.Http2CallStream = Http2CallStream; /***/ }), -/***/ 97453: +/***/ 7453: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -6817,9 +6817,9 @@ exports.Http2CallStream = Http2CallStream; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ClientDuplexStreamImpl = exports.ClientWritableStreamImpl = exports.ClientReadableStreamImpl = exports.ClientUnaryCallImpl = exports.callErrorFromStatus = void 0; -const events_1 = __nccwpck_require__(82361); -const stream_1 = __nccwpck_require__(12781); -const constants_1 = __nccwpck_require__(90634); +const events_1 = __nccwpck_require__(2361); +const stream_1 = __nccwpck_require__(2781); +const constants_1 = __nccwpck_require__(634); /** * Construct a ServiceError from a StatusObject. This function exists primarily * as an attempt to make the error stack trace clearly communicate that the @@ -6935,7 +6935,7 @@ exports.ClientDuplexStreamImpl = ClientDuplexStreamImpl; /***/ }), -/***/ 44030: +/***/ 4030: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -6958,9 +6958,9 @@ exports.ClientDuplexStreamImpl = ClientDuplexStreamImpl; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ChannelCredentials = void 0; -const tls_1 = __nccwpck_require__(24404); -const call_credentials_1 = __nccwpck_require__(21426); -const tls_helpers_1 = __nccwpck_require__(86581); +const tls_1 = __nccwpck_require__(4404); +const call_credentials_1 = __nccwpck_require__(1426); +const tls_helpers_1 = __nccwpck_require__(6581); // eslint-disable-next-line @typescript-eslint/no-explicit-any function verifyIsBufferOrNull(obj, friendlyName) { if (obj && !(obj instanceof Buffer)) { @@ -7120,7 +7120,7 @@ class ComposedChannelCredentialsImpl extends ChannelCredentials { /***/ }), -/***/ 99810: +/***/ 9810: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -7186,7 +7186,7 @@ exports.channelOptionsEqual = channelOptionsEqual; /***/ }), -/***/ 13860: +/***/ 3860: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -7209,21 +7209,21 @@ exports.channelOptionsEqual = channelOptionsEqual; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ChannelImplementation = exports.ConnectivityState = void 0; -const call_stream_1 = __nccwpck_require__(78988); -const channel_credentials_1 = __nccwpck_require__(44030); -const resolving_load_balancer_1 = __nccwpck_require__(19192); -const subchannel_pool_1 = __nccwpck_require__(39780); -const picker_1 = __nccwpck_require__(81611); -const constants_1 = __nccwpck_require__(90634); -const filter_stack_1 = __nccwpck_require__(66450); -const call_credentials_filter_1 = __nccwpck_require__(86380); -const deadline_filter_1 = __nccwpck_require__(81217); -const compression_filter_1 = __nccwpck_require__(47616); -const resolver_1 = __nccwpck_require__(31594); -const logging_1 = __nccwpck_require__(35993); -const max_message_size_filter_1 = __nccwpck_require__(30659); -const http_proxy_1 = __nccwpck_require__(24000); -const uri_parser_1 = __nccwpck_require__(65974); +const call_stream_1 = __nccwpck_require__(8988); +const channel_credentials_1 = __nccwpck_require__(4030); +const resolving_load_balancer_1 = __nccwpck_require__(9192); +const subchannel_pool_1 = __nccwpck_require__(9780); +const picker_1 = __nccwpck_require__(1611); +const constants_1 = __nccwpck_require__(634); +const filter_stack_1 = __nccwpck_require__(6450); +const call_credentials_filter_1 = __nccwpck_require__(6380); +const deadline_filter_1 = __nccwpck_require__(1217); +const compression_filter_1 = __nccwpck_require__(7616); +const resolver_1 = __nccwpck_require__(1594); +const logging_1 = __nccwpck_require__(5993); +const max_message_size_filter_1 = __nccwpck_require__(659); +const http_proxy_1 = __nccwpck_require__(4000); +const uri_parser_1 = __nccwpck_require__(5974); var ConnectivityState; (function (ConnectivityState) { ConnectivityState[ConnectivityState["IDLE"] = 0] = "IDLE"; @@ -7615,7 +7615,7 @@ exports.ChannelImplementation = ChannelImplementation; /***/ }), -/***/ 82127: +/***/ 2127: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -7638,9 +7638,9 @@ exports.ChannelImplementation = ChannelImplementation; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getInterceptingCall = exports.InterceptingCall = exports.RequesterBuilder = exports.ListenerBuilder = exports.InterceptorConfigurationError = void 0; -const metadata_1 = __nccwpck_require__(83665); -const call_stream_1 = __nccwpck_require__(78988); -const constants_1 = __nccwpck_require__(90634); +const metadata_1 = __nccwpck_require__(3665); +const call_stream_1 = __nccwpck_require__(8988); +const constants_1 = __nccwpck_require__(634); /** * Error class associated with passing both interceptors and interceptor * providers to a client constructor or as call options. @@ -8026,7 +8026,7 @@ exports.getInterceptingCall = getInterceptingCall; /***/ }), -/***/ 87172: +/***/ 7172: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8049,11 +8049,11 @@ exports.getInterceptingCall = getInterceptingCall; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Client = void 0; -const call_1 = __nccwpck_require__(97453); -const channel_1 = __nccwpck_require__(13860); -const constants_1 = __nccwpck_require__(90634); -const metadata_1 = __nccwpck_require__(83665); -const client_interceptors_1 = __nccwpck_require__(82127); +const call_1 = __nccwpck_require__(7453); +const channel_1 = __nccwpck_require__(3860); +const constants_1 = __nccwpck_require__(634); +const metadata_1 = __nccwpck_require__(3665); +const client_interceptors_1 = __nccwpck_require__(2127); const CHANNEL_SYMBOL = Symbol(); const INTERCEPTOR_SYMBOL = Symbol(); const INTERCEPTOR_PROVIDER_SYMBOL = Symbol(); @@ -8432,7 +8432,7 @@ exports.Client = Client; /***/ }), -/***/ 47616: +/***/ 7616: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8455,8 +8455,8 @@ exports.Client = Client; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CompressionFilterFactory = exports.CompressionFilter = void 0; -const zlib = __nccwpck_require__(59796); -const filter_1 = __nccwpck_require__(43392); +const zlib = __nccwpck_require__(9796); +const filter_1 = __nccwpck_require__(3392); class CompressionHandler { /** * @param message Raw uncompressed message bytes @@ -8640,7 +8640,7 @@ exports.CompressionFilterFactory = CompressionFilterFactory; /***/ }), -/***/ 90634: +/***/ 634: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -8711,7 +8711,7 @@ exports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024; /***/ }), -/***/ 81217: +/***/ 1217: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8734,8 +8734,8 @@ exports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DeadlineFilterFactory = exports.DeadlineFilter = void 0; -const constants_1 = __nccwpck_require__(90634); -const filter_1 = __nccwpck_require__(43392); +const constants_1 = __nccwpck_require__(634); +const filter_1 = __nccwpck_require__(3392); const units = [ ['m', 1], ['S', 1000], @@ -8814,41 +8814,41 @@ exports.DeadlineFilterFactory = DeadlineFilterFactory; /***/ }), -/***/ 37626: +/***/ 7626: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var logging_1 = __nccwpck_require__(35993); +var logging_1 = __nccwpck_require__(5993); Object.defineProperty(exports, "trace", ({ enumerable: true, get: function () { return logging_1.trace; } })); -var resolver_1 = __nccwpck_require__(31594); +var resolver_1 = __nccwpck_require__(1594); Object.defineProperty(exports, "registerResolver", ({ enumerable: true, get: function () { return resolver_1.registerResolver; } })); -var uri_parser_1 = __nccwpck_require__(65974); +var uri_parser_1 = __nccwpck_require__(5974); Object.defineProperty(exports, "uriToString", ({ enumerable: true, get: function () { return uri_parser_1.uriToString; } })); -var backoff_timeout_1 = __nccwpck_require__(34186); +var backoff_timeout_1 = __nccwpck_require__(4186); Object.defineProperty(exports, "BackoffTimeout", ({ enumerable: true, get: function () { return backoff_timeout_1.BackoffTimeout; } })); -var load_balancer_1 = __nccwpck_require__(52680); +var load_balancer_1 = __nccwpck_require__(2680); Object.defineProperty(exports, "registerLoadBalancerType", ({ enumerable: true, get: function () { return load_balancer_1.registerLoadBalancerType; } })); Object.defineProperty(exports, "getFirstUsableConfig", ({ enumerable: true, get: function () { return load_balancer_1.getFirstUsableConfig; } })); Object.defineProperty(exports, "validateLoadBalancingConfig", ({ enumerable: true, get: function () { return load_balancer_1.validateLoadBalancingConfig; } })); -var subchannel_1 = __nccwpck_require__(84764); +var subchannel_1 = __nccwpck_require__(4764); Object.defineProperty(exports, "subchannelAddressToString", ({ enumerable: true, get: function () { return subchannel_1.subchannelAddressToString; } })); -var load_balancer_child_handler_1 = __nccwpck_require__(17559); +var load_balancer_child_handler_1 = __nccwpck_require__(7559); Object.defineProperty(exports, "ChildLoadBalancerHandler", ({ enumerable: true, get: function () { return load_balancer_child_handler_1.ChildLoadBalancerHandler; } })); -var picker_1 = __nccwpck_require__(81611); +var picker_1 = __nccwpck_require__(1611); Object.defineProperty(exports, "UnavailablePicker", ({ enumerable: true, get: function () { return picker_1.UnavailablePicker; } })); Object.defineProperty(exports, "QueuePicker", ({ enumerable: true, get: function () { return picker_1.QueuePicker; } })); Object.defineProperty(exports, "PickResultType", ({ enumerable: true, get: function () { return picker_1.PickResultType; } })); -var filter_1 = __nccwpck_require__(43392); +var filter_1 = __nccwpck_require__(3392); Object.defineProperty(exports, "BaseFilter", ({ enumerable: true, get: function () { return filter_1.BaseFilter; } })); -var filter_stack_1 = __nccwpck_require__(66450); +var filter_stack_1 = __nccwpck_require__(6450); Object.defineProperty(exports, "FilterStackFactory", ({ enumerable: true, get: function () { return filter_stack_1.FilterStackFactory; } })); //# sourceMappingURL=experimental.js.map /***/ }), -/***/ 66450: +/***/ 6450: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -8925,7 +8925,7 @@ exports.FilterStackFactory = FilterStackFactory; /***/ }), -/***/ 43392: +/***/ 3392: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -8970,7 +8970,7 @@ exports.BaseFilter = BaseFilter; /***/ }), -/***/ 24000: +/***/ 4000: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -8993,15 +8993,15 @@ exports.BaseFilter = BaseFilter; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getProxiedConnection = exports.mapProxyName = void 0; -const logging_1 = __nccwpck_require__(35993); -const constants_1 = __nccwpck_require__(90634); -const resolver_1 = __nccwpck_require__(31594); -const http = __nccwpck_require__(13685); -const tls = __nccwpck_require__(24404); -const logging = __nccwpck_require__(35993); -const subchannel_1 = __nccwpck_require__(84764); -const uri_parser_1 = __nccwpck_require__(65974); -const url_1 = __nccwpck_require__(57310); +const logging_1 = __nccwpck_require__(5993); +const constants_1 = __nccwpck_require__(634); +const resolver_1 = __nccwpck_require__(1594); +const http = __nccwpck_require__(3685); +const tls = __nccwpck_require__(4404); +const logging = __nccwpck_require__(5993); +const subchannel_1 = __nccwpck_require__(4764); +const uri_parser_1 = __nccwpck_require__(5974); +const url_1 = __nccwpck_require__(7310); const TRACER_NAME = 'proxy'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -9247,31 +9247,31 @@ exports.getProxiedConnection = getProxiedConnection; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.experimental = exports.StatusBuilder = exports.getClientChannel = exports.ServerCredentials = exports.Server = exports.setLogVerbosity = exports.setLogger = exports.load = exports.loadObject = exports.CallCredentials = exports.ChannelCredentials = exports.waitForClientReady = exports.closeClient = exports.Channel = exports.makeGenericClientConstructor = exports.makeClientConstructor = exports.loadPackageDefinition = exports.Client = exports.propagate = exports.connectivityState = exports.status = exports.logVerbosity = exports.Metadata = exports.credentials = void 0; -const call_credentials_1 = __nccwpck_require__(21426); +const call_credentials_1 = __nccwpck_require__(1426); Object.defineProperty(exports, "CallCredentials", ({ enumerable: true, get: function () { return call_credentials_1.CallCredentials; } })); -const channel_1 = __nccwpck_require__(13860); +const channel_1 = __nccwpck_require__(3860); Object.defineProperty(exports, "connectivityState", ({ enumerable: true, get: function () { return channel_1.ConnectivityState; } })); Object.defineProperty(exports, "Channel", ({ enumerable: true, get: function () { return channel_1.ChannelImplementation; } })); -const channel_credentials_1 = __nccwpck_require__(44030); +const channel_credentials_1 = __nccwpck_require__(4030); Object.defineProperty(exports, "ChannelCredentials", ({ enumerable: true, get: function () { return channel_credentials_1.ChannelCredentials; } })); -const client_1 = __nccwpck_require__(87172); +const client_1 = __nccwpck_require__(7172); Object.defineProperty(exports, "Client", ({ enumerable: true, get: function () { return client_1.Client; } })); -const constants_1 = __nccwpck_require__(90634); +const constants_1 = __nccwpck_require__(634); Object.defineProperty(exports, "logVerbosity", ({ enumerable: true, get: function () { return constants_1.LogVerbosity; } })); Object.defineProperty(exports, "status", ({ enumerable: true, get: function () { return constants_1.Status; } })); Object.defineProperty(exports, "propagate", ({ enumerable: true, get: function () { return constants_1.Propagate; } })); -const logging = __nccwpck_require__(35993); -const make_client_1 = __nccwpck_require__(38541); +const logging = __nccwpck_require__(5993); +const make_client_1 = __nccwpck_require__(8541); Object.defineProperty(exports, "loadPackageDefinition", ({ enumerable: true, get: function () { return make_client_1.loadPackageDefinition; } })); Object.defineProperty(exports, "makeClientConstructor", ({ enumerable: true, get: function () { return make_client_1.makeClientConstructor; } })); Object.defineProperty(exports, "makeGenericClientConstructor", ({ enumerable: true, get: function () { return make_client_1.makeClientConstructor; } })); -const metadata_1 = __nccwpck_require__(83665); +const metadata_1 = __nccwpck_require__(3665); Object.defineProperty(exports, "Metadata", ({ enumerable: true, get: function () { return metadata_1.Metadata; } })); -const server_1 = __nccwpck_require__(33389); +const server_1 = __nccwpck_require__(3389); Object.defineProperty(exports, "Server", ({ enumerable: true, get: function () { return server_1.Server; } })); -const server_credentials_1 = __nccwpck_require__(63828); +const server_credentials_1 = __nccwpck_require__(3828); Object.defineProperty(exports, "ServerCredentials", ({ enumerable: true, get: function () { return server_credentials_1.ServerCredentials; } })); -const status_builder_1 = __nccwpck_require__(73155); +const status_builder_1 = __nccwpck_require__(3155); Object.defineProperty(exports, "StatusBuilder", ({ enumerable: true, get: function () { return status_builder_1.StatusBuilder; } })); /**** Client Credentials ****/ // Using assign only copies enumerable properties, which is what we want @@ -9328,16 +9328,16 @@ exports.setLogVerbosity = (verbosity) => { exports.getClientChannel = (client) => { return client_1.Client.prototype.getChannel.call(client); }; -var client_interceptors_1 = __nccwpck_require__(82127); +var client_interceptors_1 = __nccwpck_require__(2127); Object.defineProperty(exports, "ListenerBuilder", ({ enumerable: true, get: function () { return client_interceptors_1.ListenerBuilder; } })); Object.defineProperty(exports, "RequesterBuilder", ({ enumerable: true, get: function () { return client_interceptors_1.RequesterBuilder; } })); Object.defineProperty(exports, "InterceptingCall", ({ enumerable: true, get: function () { return client_interceptors_1.InterceptingCall; } })); Object.defineProperty(exports, "InterceptorConfigurationError", ({ enumerable: true, get: function () { return client_interceptors_1.InterceptorConfigurationError; } })); -const experimental = __nccwpck_require__(37626); +const experimental = __nccwpck_require__(7626); exports.experimental = experimental; -const resolver = __nccwpck_require__(31594); -const load_balancer = __nccwpck_require__(52680); -const clientVersion = (__nccwpck_require__(56569)/* .version */ .i8); +const resolver = __nccwpck_require__(1594); +const load_balancer = __nccwpck_require__(2680); +const clientVersion = (__nccwpck_require__(6569)/* .version */ .i8); (() => { logging.trace(constants_1.LogVerbosity.DEBUG, 'index', 'Loading @grpc/grpc-js version ' + clientVersion); resolver.registerAll(); @@ -9347,7 +9347,7 @@ const clientVersion = (__nccwpck_require__(56569)/* .version */ .i8); /***/ }), -/***/ 17559: +/***/ 7559: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -9370,8 +9370,8 @@ const clientVersion = (__nccwpck_require__(56569)/* .version */ .i8); */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ChildLoadBalancerHandler = void 0; -const load_balancer_1 = __nccwpck_require__(52680); -const channel_1 = __nccwpck_require__(13860); +const load_balancer_1 = __nccwpck_require__(2680); +const channel_1 = __nccwpck_require__(3860); const TYPE_NAME = 'child_load_balancer_helper'; class ChildLoadBalancerHandler { constructor(channelControlHelper) { @@ -9489,7 +9489,7 @@ exports.ChildLoadBalancerHandler = ChildLoadBalancerHandler; /***/ }), -/***/ 38977: +/***/ 8977: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -9512,12 +9512,12 @@ exports.ChildLoadBalancerHandler = ChildLoadBalancerHandler; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = exports.PickFirstLoadBalancer = exports.PickFirstLoadBalancingConfig = void 0; -const load_balancer_1 = __nccwpck_require__(52680); -const channel_1 = __nccwpck_require__(13860); -const picker_1 = __nccwpck_require__(81611); -const subchannel_1 = __nccwpck_require__(84764); -const logging = __nccwpck_require__(35993); -const constants_1 = __nccwpck_require__(90634); +const load_balancer_1 = __nccwpck_require__(2680); +const channel_1 = __nccwpck_require__(3860); +const picker_1 = __nccwpck_require__(1611); +const subchannel_1 = __nccwpck_require__(4764); +const logging = __nccwpck_require__(5993); +const constants_1 = __nccwpck_require__(634); const TRACER_NAME = 'pick_first'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -9855,7 +9855,7 @@ exports.setup = setup; /***/ }), -/***/ 92787: +/***/ 2787: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -9878,12 +9878,12 @@ exports.setup = setup; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = exports.RoundRobinLoadBalancer = void 0; -const load_balancer_1 = __nccwpck_require__(52680); -const channel_1 = __nccwpck_require__(13860); -const picker_1 = __nccwpck_require__(81611); -const subchannel_1 = __nccwpck_require__(84764); -const logging = __nccwpck_require__(35993); -const constants_1 = __nccwpck_require__(90634); +const load_balancer_1 = __nccwpck_require__(2680); +const channel_1 = __nccwpck_require__(3860); +const picker_1 = __nccwpck_require__(1611); +const subchannel_1 = __nccwpck_require__(4764); +const logging = __nccwpck_require__(5993); +const constants_1 = __nccwpck_require__(634); const TRACER_NAME = 'round_robin'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -10043,7 +10043,7 @@ exports.setup = setup; /***/ }), -/***/ 52680: +/***/ 2680: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10066,8 +10066,8 @@ exports.setup = setup; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.registerAll = exports.validateLoadBalancingConfig = exports.getFirstUsableConfig = exports.isLoadBalancerNameRegistered = exports.createLoadBalancer = exports.registerLoadBalancerType = void 0; -const load_balancer_pick_first = __nccwpck_require__(38977); -const load_balancer_round_robin = __nccwpck_require__(92787); +const load_balancer_pick_first = __nccwpck_require__(8977); +const load_balancer_round_robin = __nccwpck_require__(2787); const registeredLoadBalancerTypes = {}; function registerLoadBalancerType(typeName, loadBalancerType, loadBalancingConfigType) { registeredLoadBalancerTypes[typeName] = { @@ -10130,7 +10130,7 @@ exports.registerAll = registerAll; /***/ }), -/***/ 35993: +/***/ 5993: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10154,7 +10154,7 @@ exports.registerAll = registerAll; var _a, _b, _c, _d; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.trace = exports.log = exports.setLoggerVerbosity = exports.setLogger = exports.getLogger = void 0; -const constants_1 = __nccwpck_require__(90634); +const constants_1 = __nccwpck_require__(634); let _logger = console; let _logVerbosity = constants_1.LogVerbosity.ERROR; const verbosityString = (_b = (_a = process.env.GRPC_NODE_VERBOSITY) !== null && _a !== void 0 ? _a : process.env.GRPC_VERBOSITY) !== null && _b !== void 0 ? _b : ''; @@ -10211,7 +10211,7 @@ exports.trace = trace; /***/ }), -/***/ 38541: +/***/ 8541: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10234,7 +10234,7 @@ exports.trace = trace; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.loadPackageDefinition = exports.makeClientConstructor = void 0; -const client_1 = __nccwpck_require__(87172); +const client_1 = __nccwpck_require__(7172); /** * Map with short names for each of the requester maker functions. Used in * makeClientConstructor @@ -10361,7 +10361,7 @@ exports.loadPackageDefinition = loadPackageDefinition; /***/ }), -/***/ 30659: +/***/ 659: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10384,8 +10384,8 @@ exports.loadPackageDefinition = loadPackageDefinition; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MaxMessageSizeFilterFactory = exports.MaxMessageSizeFilter = void 0; -const filter_1 = __nccwpck_require__(43392); -const constants_1 = __nccwpck_require__(90634); +const filter_1 = __nccwpck_require__(3392); +const constants_1 = __nccwpck_require__(634); class MaxMessageSizeFilter extends filter_1.BaseFilter { constructor(options, callStream) { super(); @@ -10449,7 +10449,7 @@ exports.MaxMessageSizeFilterFactory = MaxMessageSizeFilterFactory; /***/ }), -/***/ 83665: +/***/ 3665: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10472,8 +10472,8 @@ exports.MaxMessageSizeFilterFactory = MaxMessageSizeFilterFactory; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Metadata = void 0; -const logging_1 = __nccwpck_require__(35993); -const constants_1 = __nccwpck_require__(90634); +const logging_1 = __nccwpck_require__(5993); +const constants_1 = __nccwpck_require__(634); const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/; const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/; function isLegalKey(key) { @@ -10706,7 +10706,7 @@ exports.Metadata = Metadata; /***/ }), -/***/ 81611: +/***/ 1611: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10729,8 +10729,8 @@ exports.Metadata = Metadata; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.QueuePicker = exports.UnavailablePicker = exports.PickResultType = void 0; -const metadata_1 = __nccwpck_require__(83665); -const constants_1 = __nccwpck_require__(90634); +const metadata_1 = __nccwpck_require__(3665); +const constants_1 = __nccwpck_require__(634); var PickResultType; (function (PickResultType) { PickResultType[PickResultType["COMPLETE"] = 0] = "COMPLETE"; @@ -10800,7 +10800,7 @@ exports.QueuePicker = QueuePicker; /***/ }), -/***/ 54886: +/***/ 4886: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -10822,16 +10822,16 @@ exports.QueuePicker = QueuePicker; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = void 0; -const resolver_1 = __nccwpck_require__(31594); +const resolver_1 = __nccwpck_require__(1594); const dns = __nccwpck_require__(9523); -const util = __nccwpck_require__(73837); -const service_config_1 = __nccwpck_require__(21761); -const constants_1 = __nccwpck_require__(90634); -const metadata_1 = __nccwpck_require__(83665); -const logging = __nccwpck_require__(35993); -const constants_2 = __nccwpck_require__(90634); -const uri_parser_1 = __nccwpck_require__(65974); -const net_1 = __nccwpck_require__(41808); +const util = __nccwpck_require__(3837); +const service_config_1 = __nccwpck_require__(1761); +const constants_1 = __nccwpck_require__(634); +const metadata_1 = __nccwpck_require__(3665); +const logging = __nccwpck_require__(5993); +const constants_2 = __nccwpck_require__(634); +const uri_parser_1 = __nccwpck_require__(5974); +const net_1 = __nccwpck_require__(1808); const TRACER_NAME = 'dns_resolver'; function trace(text) { logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -11039,7 +11039,7 @@ exports.setup = setup; /***/ }), -/***/ 97902: +/***/ 7902: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -11061,12 +11061,12 @@ exports.setup = setup; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = void 0; -const net_1 = __nccwpck_require__(41808); -const constants_1 = __nccwpck_require__(90634); -const metadata_1 = __nccwpck_require__(83665); -const resolver_1 = __nccwpck_require__(31594); -const uri_parser_1 = __nccwpck_require__(65974); -const logging = __nccwpck_require__(35993); +const net_1 = __nccwpck_require__(1808); +const constants_1 = __nccwpck_require__(634); +const metadata_1 = __nccwpck_require__(3665); +const resolver_1 = __nccwpck_require__(1594); +const uri_parser_1 = __nccwpck_require__(5974); +const logging = __nccwpck_require__(5993); const TRACER_NAME = 'ip_resolver'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -11169,7 +11169,7 @@ exports.setup = setup; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = void 0; -const resolver_1 = __nccwpck_require__(31594); +const resolver_1 = __nccwpck_require__(1594); class UdsResolver { constructor(target, listener, channelOptions) { this.listener = listener; @@ -11201,7 +11201,7 @@ exports.setup = setup; /***/ }), -/***/ 31594: +/***/ 1594: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -11224,10 +11224,10 @@ exports.setup = setup; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.registerAll = exports.mapUriDefaultScheme = exports.getDefaultAuthority = exports.createResolver = exports.registerDefaultScheme = exports.registerResolver = void 0; -const resolver_dns = __nccwpck_require__(54886); +const resolver_dns = __nccwpck_require__(4886); const resolver_uds = __nccwpck_require__(5252); -const resolver_ip = __nccwpck_require__(97902); -const uri_parser_1 = __nccwpck_require__(65974); +const resolver_ip = __nccwpck_require__(7902); +const uri_parser_1 = __nccwpck_require__(5974); const registeredResolvers = {}; let defaultScheme = null; /** @@ -11305,7 +11305,7 @@ exports.registerAll = registerAll; /***/ }), -/***/ 19192: +/***/ 9192: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -11328,18 +11328,18 @@ exports.registerAll = registerAll; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ResolvingLoadBalancer = void 0; -const load_balancer_1 = __nccwpck_require__(52680); -const service_config_1 = __nccwpck_require__(21761); -const channel_1 = __nccwpck_require__(13860); -const resolver_1 = __nccwpck_require__(31594); -const picker_1 = __nccwpck_require__(81611); -const backoff_timeout_1 = __nccwpck_require__(34186); -const constants_1 = __nccwpck_require__(90634); -const metadata_1 = __nccwpck_require__(83665); -const logging = __nccwpck_require__(35993); -const constants_2 = __nccwpck_require__(90634); -const uri_parser_1 = __nccwpck_require__(65974); -const load_balancer_child_handler_1 = __nccwpck_require__(17559); +const load_balancer_1 = __nccwpck_require__(2680); +const service_config_1 = __nccwpck_require__(1761); +const channel_1 = __nccwpck_require__(3860); +const resolver_1 = __nccwpck_require__(1594); +const picker_1 = __nccwpck_require__(1611); +const backoff_timeout_1 = __nccwpck_require__(4186); +const constants_1 = __nccwpck_require__(634); +const metadata_1 = __nccwpck_require__(3665); +const logging = __nccwpck_require__(5993); +const constants_2 = __nccwpck_require__(634); +const uri_parser_1 = __nccwpck_require__(5974); +const load_balancer_child_handler_1 = __nccwpck_require__(7559); const TRACER_NAME = 'resolving_load_balancer'; function trace(text) { logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -11558,7 +11558,7 @@ exports.ResolvingLoadBalancer = ResolvingLoadBalancer; /***/ }), -/***/ 62533: +/***/ 2533: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -11581,13 +11581,13 @@ exports.ResolvingLoadBalancer = ResolvingLoadBalancer; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Http2ServerCallStream = exports.ServerDuplexStreamImpl = exports.ServerWritableStreamImpl = exports.ServerReadableStreamImpl = exports.ServerUnaryCallImpl = void 0; -const events_1 = __nccwpck_require__(82361); -const http2 = __nccwpck_require__(85158); -const stream_1 = __nccwpck_require__(12781); -const constants_1 = __nccwpck_require__(90634); -const metadata_1 = __nccwpck_require__(83665); -const stream_decoder_1 = __nccwpck_require__(16575); -const logging = __nccwpck_require__(35993); +const events_1 = __nccwpck_require__(2361); +const http2 = __nccwpck_require__(5158); +const stream_1 = __nccwpck_require__(2781); +const constants_1 = __nccwpck_require__(634); +const metadata_1 = __nccwpck_require__(3665); +const stream_decoder_1 = __nccwpck_require__(6575); +const logging = __nccwpck_require__(5993); const TRACER_NAME = 'server_call'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -12103,7 +12103,7 @@ function handleExpiredDeadline(call) { /***/ }), -/***/ 63828: +/***/ 3828: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -12126,7 +12126,7 @@ function handleExpiredDeadline(call) { */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ServerCredentials = void 0; -const tls_helpers_1 = __nccwpck_require__(86581); +const tls_helpers_1 = __nccwpck_require__(6581); class ServerCredentials { static createInsecure() { return new InsecureServerCredentials(); @@ -12191,7 +12191,7 @@ class SecureServerCredentials extends ServerCredentials { /***/ }), -/***/ 33389: +/***/ 3389: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -12214,14 +12214,14 @@ class SecureServerCredentials extends ServerCredentials { */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Server = void 0; -const http2 = __nccwpck_require__(85158); -const constants_1 = __nccwpck_require__(90634); -const metadata_1 = __nccwpck_require__(83665); -const server_call_1 = __nccwpck_require__(62533); -const resolver_1 = __nccwpck_require__(31594); -const logging = __nccwpck_require__(35993); -const subchannel_1 = __nccwpck_require__(84764); -const uri_parser_1 = __nccwpck_require__(65974); +const http2 = __nccwpck_require__(5158); +const constants_1 = __nccwpck_require__(634); +const metadata_1 = __nccwpck_require__(3665); +const server_call_1 = __nccwpck_require__(2533); +const resolver_1 = __nccwpck_require__(1594); +const logging = __nccwpck_require__(5993); +const subchannel_1 = __nccwpck_require__(4764); +const uri_parser_1 = __nccwpck_require__(5974); const TRACER_NAME = 'server'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -12680,7 +12680,7 @@ function handleBidiStreaming(call, handler, metadata) { /***/ }), -/***/ 21761: +/***/ 1761: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -12712,8 +12712,8 @@ exports.extractAndSelectServiceConfig = exports.validateServiceConfig = void 0; /* The any type is purposely used here. All functions validate their input at * runtime */ /* eslint-disable @typescript-eslint/no-explicit-any */ -const os = __nccwpck_require__(22037); -const load_balancer_1 = __nccwpck_require__(52680); +const os = __nccwpck_require__(2037); +const load_balancer_1 = __nccwpck_require__(2680); /** * Recognizes a number with up to 9 digits after the decimal point, followed by * an "s", representing a number of seconds. @@ -12951,7 +12951,7 @@ exports.extractAndSelectServiceConfig = extractAndSelectServiceConfig; /***/ }), -/***/ 73155: +/***/ 3155: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -13026,7 +13026,7 @@ exports.StatusBuilder = StatusBuilder; /***/ }), -/***/ 16575: +/***/ 6575: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -13129,7 +13129,7 @@ exports.StreamDecoder = StreamDecoder; /***/ }), -/***/ 39780: +/***/ 9780: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13152,9 +13152,9 @@ exports.StreamDecoder = StreamDecoder; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSubchannelPool = exports.SubchannelPool = void 0; -const channel_options_1 = __nccwpck_require__(99810); -const subchannel_1 = __nccwpck_require__(84764); -const uri_parser_1 = __nccwpck_require__(65974); +const channel_options_1 = __nccwpck_require__(9810); +const subchannel_1 = __nccwpck_require__(4764); +const uri_parser_1 = __nccwpck_require__(5974); // 10 seconds in milliseconds. This value is arbitrary. /** * The amount of time in between checks for dropping subchannels that have no @@ -13276,7 +13276,7 @@ exports.getSubchannelPool = getSubchannelPool; /***/ }), -/***/ 84764: +/***/ 4764: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13299,17 +13299,17 @@ exports.getSubchannelPool = getSubchannelPool; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Subchannel = exports.subchannelAddressToString = exports.subchannelAddressEqual = exports.isTcpSubchannelAddress = void 0; -const http2 = __nccwpck_require__(85158); -const tls_1 = __nccwpck_require__(24404); -const channel_1 = __nccwpck_require__(13860); -const backoff_timeout_1 = __nccwpck_require__(34186); -const resolver_1 = __nccwpck_require__(31594); -const logging = __nccwpck_require__(35993); -const constants_1 = __nccwpck_require__(90634); -const http_proxy_1 = __nccwpck_require__(24000); -const net = __nccwpck_require__(41808); -const uri_parser_1 = __nccwpck_require__(65974); -const clientVersion = (__nccwpck_require__(56569)/* .version */ .i8); +const http2 = __nccwpck_require__(5158); +const tls_1 = __nccwpck_require__(4404); +const channel_1 = __nccwpck_require__(3860); +const backoff_timeout_1 = __nccwpck_require__(4186); +const resolver_1 = __nccwpck_require__(1594); +const logging = __nccwpck_require__(5993); +const constants_1 = __nccwpck_require__(634); +const http_proxy_1 = __nccwpck_require__(4000); +const net = __nccwpck_require__(1808); +const uri_parser_1 = __nccwpck_require__(5974); +const clientVersion = (__nccwpck_require__(6569)/* .version */ .i8); const TRACER_NAME = 'subchannel'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); @@ -13905,7 +13905,7 @@ exports.Subchannel = Subchannel; /***/ }), -/***/ 86581: +/***/ 6581: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13928,7 +13928,7 @@ exports.Subchannel = Subchannel; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getDefaultRootsData = exports.CIPHER_SUITES = void 0; -const fs = __nccwpck_require__(57147); +const fs = __nccwpck_require__(7147); exports.CIPHER_SUITES = process.env.GRPC_SSL_CIPHER_SUITES; const DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH; let defaultRootsData = null; @@ -13946,7 +13946,7 @@ exports.getDefaultRootsData = getDefaultRootsData; /***/ }), -/***/ 65974: +/***/ 5974: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14070,20 +14070,20 @@ exports.uriToString = uriToString; "use strict"; -module.exports = __nccwpck_require__(73701) +module.exports = __nccwpck_require__(3701) /***/ }), -/***/ 73701: +/***/ 3701: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const {Readable} = __nccwpck_require__(12781) -const fs = __nccwpck_require__(57147) -const {once} = __nccwpck_require__(82361) +const {Readable} = __nccwpck_require__(2781) +const fs = __nccwpck_require__(7147) +const {once} = __nccwpck_require__(2361) const kOpts = Symbol('opts') const kFileName = Symbol('filename') @@ -14409,7 +14409,7 @@ module.exports = TailFile /***/ }), -/***/ 40334: +/***/ 334: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14472,7 +14472,7 @@ exports.createTokenAuth = createTokenAuth; /***/ }), -/***/ 76762: +/***/ 6762: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14480,11 +14480,11 @@ exports.createTokenAuth = createTokenAuth; Object.defineProperty(exports, "__esModule", ({ value: true })); -var universalUserAgent = __nccwpck_require__(45030); -var beforeAfterHook = __nccwpck_require__(83682); -var request = __nccwpck_require__(36234); -var graphql = __nccwpck_require__(88467); -var authToken = __nccwpck_require__(40334); +var universalUserAgent = __nccwpck_require__(5030); +var beforeAfterHook = __nccwpck_require__(3682); +var request = __nccwpck_require__(6234); +var graphql = __nccwpck_require__(8467); +var authToken = __nccwpck_require__(334); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; @@ -14656,7 +14656,7 @@ exports.Octokit = Octokit; /***/ }), -/***/ 59440: +/***/ 9440: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14664,8 +14664,8 @@ exports.Octokit = Octokit; Object.defineProperty(exports, "__esModule", ({ value: true })); -var isPlainObject = __nccwpck_require__(70558); -var universalUserAgent = __nccwpck_require__(45030); +var isPlainObject = __nccwpck_require__(558); +var universalUserAgent = __nccwpck_require__(5030); function lowercaseKeys(object) { if (!object) { @@ -15054,7 +15054,7 @@ exports.endpoint = endpoint; /***/ }), -/***/ 70558: +/***/ 558: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -15100,7 +15100,7 @@ exports.isPlainObject = isPlainObject; /***/ }), -/***/ 88467: +/***/ 8467: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15108,8 +15108,8 @@ exports.isPlainObject = isPlainObject; Object.defineProperty(exports, "__esModule", ({ value: true })); -var request = __nccwpck_require__(36234); -var universalUserAgent = __nccwpck_require__(45030); +var request = __nccwpck_require__(6234); +var universalUserAgent = __nccwpck_require__(5030); const VERSION = "4.8.0"; @@ -15226,7 +15226,7 @@ exports.withCustomRequest = withCustomRequest; /***/ }), -/***/ 64193: +/***/ 4193: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -15439,7 +15439,7 @@ exports.paginatingEndpoints = paginatingEndpoints; /***/ }), -/***/ 83044: +/***/ 3044: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -16554,7 +16554,7 @@ exports.restEndpointMethods = restEndpointMethods; /***/ }), -/***/ 10537: +/***/ 537: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16564,7 +16564,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __nccwpck_require__(58932); +var deprecation = __nccwpck_require__(8932); var once = _interopDefault(__nccwpck_require__(1223)); const logOnceCode = once(deprecation => console.warn(deprecation)); @@ -16636,7 +16636,7 @@ exports.RequestError = RequestError; /***/ }), -/***/ 36234: +/***/ 6234: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16646,11 +16646,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var endpoint = __nccwpck_require__(59440); -var universalUserAgent = __nccwpck_require__(45030); -var isPlainObject = __nccwpck_require__(49062); -var nodeFetch = _interopDefault(__nccwpck_require__(80467)); -var requestError = __nccwpck_require__(10537); +var endpoint = __nccwpck_require__(9440); +var universalUserAgent = __nccwpck_require__(5030); +var isPlainObject = __nccwpck_require__(9062); +var nodeFetch = _interopDefault(__nccwpck_require__(467)); +var requestError = __nccwpck_require__(537); const VERSION = "5.6.3"; @@ -16821,7 +16821,7 @@ exports.request = request; /***/ }), -/***/ 49062: +/***/ 9062: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -16867,7 +16867,7 @@ exports.isPlainObject = isPlainObject; /***/ }), -/***/ 36892: +/***/ 6892: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16886,7 +16886,7 @@ exports.isPlainObject = isPlainObject; // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(21888); +const utils = __nccwpck_require__(1888); /** * An Archive represents a collection of named assets. */ @@ -16945,7 +16945,7 @@ exports.RemoteArchive = RemoteArchive; /***/ }), -/***/ 33886: +/***/ 3886: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16964,7 +16964,7 @@ exports.RemoteArchive = RemoteArchive; // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(21888); +const utils = __nccwpck_require__(1888); /** * Asset represents a single blob of text or data that is managed as a first class entity. */ @@ -17032,7 +17032,7 @@ exports.RemoteAsset = RemoteAsset; /***/ }), -/***/ 83031: +/***/ 3031: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -17054,13 +17054,13 @@ function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", ({ value: true })); -__export(__nccwpck_require__(36892)); -__export(__nccwpck_require__(33886)); +__export(__nccwpck_require__(6892)); +__export(__nccwpck_require__(3886)); //# sourceMappingURL=index.js.map /***/ }), -/***/ 79586: +/***/ 9586: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -17079,8 +17079,8 @@ __export(__nccwpck_require__(33886)); // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __nccwpck_require__(32081); -const errors_1 = __nccwpck_require__(71369); +const childProcess = __nccwpck_require__(2081); +const errors_1 = __nccwpck_require__(1369); /** @internal */ class CommandResult { constructor(stdout, stderr, code, err) { @@ -17143,7 +17143,7 @@ exports.runPulumiCmd = runPulumiCmd; /***/ }), -/***/ 71369: +/***/ 1369: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -17262,7 +17262,7 @@ var DiffKind; /***/ }), -/***/ 34925: +/***/ 4925: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -17284,10 +17284,10 @@ function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", ({ value: true })); -__export(__nccwpck_require__(79586)); -__export(__nccwpck_require__(71369)); -__export(__nccwpck_require__(29010)); -__export(__nccwpck_require__(25973)); +__export(__nccwpck_require__(9586)); +__export(__nccwpck_require__(1369)); +__export(__nccwpck_require__(9010)); +__export(__nccwpck_require__(5973)); __export(__nccwpck_require__(5142)); __export(__nccwpck_require__(6568)); //# sourceMappingURL=index.js.map @@ -17322,15 +17322,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __nccwpck_require__(57147); -const yaml = __nccwpck_require__(21917); -const os = __nccwpck_require__(22037); -const semver = __nccwpck_require__(87486); +const fs = __nccwpck_require__(7147); +const yaml = __nccwpck_require__(1917); +const os = __nccwpck_require__(2037); +const semver = __nccwpck_require__(7486); const upath = __nccwpck_require__(8004); -const cmd_1 = __nccwpck_require__(79586); -const minimumVersion_1 = __nccwpck_require__(88410); -const stack_1 = __nccwpck_require__(29010); -const stackSettings_1 = __nccwpck_require__(25973); +const cmd_1 = __nccwpck_require__(9586); +const minimumVersion_1 = __nccwpck_require__(8410); +const stack_1 = __nccwpck_require__(9010); +const stackSettings_1 = __nccwpck_require__(5973); const SKIP_VERSION_CHECK_VAR = "PULUMI_AUTOMATION_API_SKIP_VERSION_CHECK"; /** * LocalWorkspace is a default implementation of the Workspace interface. @@ -17955,7 +17955,7 @@ exports.parseAndValidatePulumiVersion = parseAndValidatePulumiVersion; /***/ }), -/***/ 88410: +/***/ 8410: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -17974,18 +17974,18 @@ exports.parseAndValidatePulumiVersion = parseAndValidatePulumiVersion; // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -const semver = __nccwpck_require__(87486); +const semver = __nccwpck_require__(7486); exports.minimumVersion = new semver.SemVer("v3.2.0-alpha"); //# sourceMappingURL=minimumVersion.js.map /***/ }), -/***/ 63621: +/***/ 3621: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2020, Pulumi Corporation. +// Copyright 2016-2022, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18008,11 +18008,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const errors_1 = __nccwpck_require__(89693); -const log = __nccwpck_require__(80642); -const runtime = __nccwpck_require__(85022); -const langproto = __nccwpck_require__(53979); -const plugproto = __nccwpck_require__(38008); +const errors_1 = __nccwpck_require__(9693); +const log = __nccwpck_require__(642); +const settings = __nccwpck_require__(4530); +const stack = __nccwpck_require__(6664); +const runtimeConfig = __nccwpck_require__(7146); +const debuggable = __nccwpck_require__(257); +const langproto = __nccwpck_require__(3979); +const plugproto = __nccwpck_require__(8008); // maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) /** @internal */ exports.maxRPCMessageSize = 1024 * 1024 * 400; @@ -18023,18 +18026,18 @@ class LanguageServer { this.running = false; // set a bit in runtime settings to indicate that we're running in inline mode. // this allows us to detect and fail fast for side by side pulumi scenarios. - runtime.setInline(); + settings.setInline(); } onPulumiExit(hasError) { // check for leaks once the CLI exits but skip if the program otherwise errored to keep error output clean if (!hasError) { - const [leaks, leakMessage] = runtime.leakedPromises(); + const [leaks, leakMessage] = debuggable.leakedPromises(); if (leaks.size !== 0) { throw new Error(leakMessage); } } // these are globals and we need to clean up after ourselves - runtime.resetOptions("", "", -1, "", "", false); + settings.resetOptions("", "", -1, "", "", false); } getRequiredPlugins(call, callback) { const resp = new langproto.GetRequiredPluginsResponse(); @@ -18052,24 +18055,24 @@ class LanguageServer { try { const args = req.getArgsList(); const engineAddr = args && args.length > 0 ? args[0] : ""; - runtime.resetOptions(req.getProject(), req.getStack(), req.getParallel(), engineAddr, req.getMonitorAddress(), req.getDryrun()); + settings.resetOptions(req.getProject(), req.getStack(), req.getParallel(), engineAddr, req.getMonitorAddress(), req.getDryrun()); const config = {}; for (const [k, v] of ((_a = req.getConfigMap()) === null || _a === void 0 ? void 0 : _a.entries()) || []) { config[k] = v; } - runtime.setAllConfig(config, req.getConfigsecretkeysList() || []); + runtimeConfig.setAllConfig(config, req.getConfigsecretkeysList() || []); process.on("uncaughtException", uncaughtHandler); // @ts-ignore 'unhandledRejection' will almost always invoke uncaughtHandler with an Error. so // just suppress the TS strictness here. process.on("unhandledRejection", uncaughtHandler); try { - yield runtime.runInPulumiStack(this.program); - yield runtime.disconnect(); + yield stack.runInPulumiStack(this.program); + yield settings.disconnect(); process.off("uncaughtException", uncaughtHandler); process.off("unhandledRejection", uncaughtHandler); } catch (e) { - yield runtime.disconnect(); + yield settings.disconnect(); process.off("uncaughtException", uncaughtHandler); process.off("unhandledRejection", uncaughtHandler); if (!errors_1.isGrpcError(e)) { @@ -18133,7 +18136,7 @@ function newUncaughtHandler(errorSet) { /***/ }), -/***/ 29010: +/***/ 9010: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -18161,18 +18164,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const fs = __nccwpck_require__(57147); -const os = __nccwpck_require__(22037); -const path = __nccwpck_require__(71017); -const readline = __nccwpck_require__(14521); +const fs = __nccwpck_require__(7147); +const os = __nccwpck_require__(2037); +const path = __nccwpck_require__(1017); +const readline = __nccwpck_require__(4521); const upath = __nccwpck_require__(8004); const grpc = __nccwpck_require__(7025); const TailFile = __nccwpck_require__(725); -const log = __nccwpck_require__(80642); -const cmd_1 = __nccwpck_require__(79586); -const errors_1 = __nccwpck_require__(71369); -const server_1 = __nccwpck_require__(63621); -const langrpc = __nccwpck_require__(75628); +const log = __nccwpck_require__(642); +const cmd_1 = __nccwpck_require__(9586); +const errors_1 = __nccwpck_require__(1369); +const server_1 = __nccwpck_require__(3621); +const langrpc = __nccwpck_require__(5628); /** * Stack is an isolated, independently configurable instance of a Pulumi program. * Stack exposes methods for the full pulumi lifecycle (up/preview/refresh/destroy), as well as managing configuration. @@ -18842,7 +18845,7 @@ const cleanUp = (logFile, rl) => __awaiter(void 0, void 0, void 0, function* () /***/ }), -/***/ 25973: +/***/ 5973: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -18871,473 +18874,7 @@ exports.stackSettingsSerDeKeys = [ /***/ }), -/***/ 45178: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const errors_1 = __nccwpck_require__(89693); -const metadata_1 = __nccwpck_require__(8085); -const output_1 = __nccwpck_require__(43037); -const runtime_1 = __nccwpck_require__(85022); -function makeSecret(value) { - return new output_1.Output([], Promise.resolve(value), - /*isKnown:*/ Promise.resolve(true), /*isSecret:*/ Promise.resolve(true), Promise.resolve([])); -} -/** - * Config is a bag of related configuration state. Each bag contains any number of configuration variables, indexed by - * simple keys, and each has a name that uniquely identifies it; two bags with different names do not share values for - * variables that otherwise share the same key. For example, a bag whose name is `pulumi:foo`, with keys `a`, `b`, - * and `c`, is entirely separate from a bag whose name is `pulumi:bar` with the same simple key names. Each key has a - * fully qualified names, such as `pulumi:foo:a`, ..., and `pulumi:bar:a`, respectively. - */ -class Config { - constructor(name) { - if (name === undefined) { - name = metadata_1.getProject(); - } - if (name.endsWith(":config")) { - name = name.replace(/:config$/, ""); - } - this.name = name; - } - /** - * get loads an optional configuration value by its key, or undefined if it doesn't exist. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - getImpl(key, opts, use, insteadOf) { - const fullKey = this.fullKey(key); - const v = runtime_1.getConfig(fullKey); - if (v === undefined) { - return undefined; - } - // TODO[pulumi/pulumi#7127]: Re-enable the warning. - // Temporarily disabling the new warning. - // if (use && insteadOf && isConfigSecret(fullKey)) { - // log.warn(`Configuration '${fullKey}' value is a secret; ` + - // `use \`${use.name}\` instead of \`${insteadOf.name}\``); - // } - if (opts) { - // SAFETY: if allowedValues != null, verifying v ∈ K[] - if (opts.allowedValues !== undefined && opts.allowedValues.indexOf(v) === -1) { - throw new ConfigEnumError(fullKey, v, opts.allowedValues); - } - else if (opts.minLength !== undefined && v.length < opts.minLength) { - throw new ConfigRangeError(fullKey, v, opts.minLength, undefined); - } - else if (opts.maxLength !== undefined && v.length > opts.maxLength) { - throw new ConfigRangeError(fullKey, v, undefined, opts.maxLength); - } - else if (opts.pattern !== undefined) { - let pattern = opts.pattern; - if (typeof pattern === "string") { - pattern = new RegExp(pattern); - } - if (!pattern.test(v)) { - throw new ConfigPatternError(fullKey, v, pattern); - } - } - } - // SAFETY: - // allowedValues != null ⇒ v ∈ K[] - // allowedValues == null ⇒ K = string & v : string - return v; - } - /** - * get loads an optional configuration value by its key, or undefined if it doesn't exist. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - get(key, opts) { - return this.getImpl(key, opts, this.getSecret, this.get); - } - /** - * getSecret loads an optional configuration value by its key, marking it as a secret, or undefined if it - * doesn't exist. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - getSecret(key, opts) { - const v = this.getImpl(key, opts); - if (v === undefined) { - return undefined; - } - return makeSecret(v); - } - getBooleanImpl(key, use, insteadOf) { - const v = this.getImpl(key, undefined, use, insteadOf); - if (v === undefined) { - return undefined; - } - else if (v === "true") { - return true; - } - else if (v === "false") { - return false; - } - throw new ConfigTypeError(this.fullKey(key), v, "boolean"); - } - /** - * getBoolean loads an optional configuration value, as a boolean, by its key, or undefined if it doesn't exist. - * If the configuration value isn't a legal boolean, this function will throw an error. - * - * @param key The key to lookup. - */ - getBoolean(key) { - return this.getBooleanImpl(key, this.getSecretBoolean, this.getBoolean); - } - /** - * getSecretBoolean loads an optional configuration value, as a boolean, by its key, making it as a secret - * or undefined if it doesn't exist. If the configuration value isn't a legal boolean, this function will - * throw an error. - * - * @param key The key to lookup. - */ - getSecretBoolean(key) { - const v = this.getBooleanImpl(key); - if (v === undefined) { - return undefined; - } - return makeSecret(v); - } - getNumberImpl(key, opts, use, insteadOf) { - const v = this.getImpl(key, undefined, use, insteadOf); - if (v === undefined) { - return undefined; - } - const f = parseFloat(v); - if (isNaN(f)) { - throw new ConfigTypeError(this.fullKey(key), v, "number"); - } - if (opts) { - if (opts.min !== undefined && f < opts.min) { - throw new ConfigRangeError(this.fullKey(key), f, opts.min, undefined); - } - else if (opts.max !== undefined && f > opts.max) { - throw new ConfigRangeError(this.fullKey(key), f, undefined, opts.max); - } - } - return f; - } - /** - * getNumber loads an optional configuration value, as a number, by its key, or undefined if it doesn't exist. - * If the configuration value isn't a legal number, this function will throw an error. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - getNumber(key, opts) { - return this.getNumberImpl(key, opts, this.getSecretNumber, this.getNumber); - } - /** - * getSecretNumber loads an optional configuration value, as a number, by its key, marking it as a secret - * or undefined if it doesn't exist. - * If the configuration value isn't a legal number, this function will throw an error. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - getSecretNumber(key, opts) { - const v = this.getNumberImpl(key, opts); - if (v === undefined) { - return undefined; - } - return makeSecret(v); - } - getObjectImpl(key, use, insteadOf) { - const v = this.getImpl(key, undefined, use, insteadOf); - if (v === undefined) { - return undefined; - } - try { - return JSON.parse(v); - } - catch (err) { - throw new ConfigTypeError(this.fullKey(key), v, "JSON object"); - } - } - /** - * getObject loads an optional configuration value, as an object, by its key, or undefined if it doesn't exist. - * This routine simply JSON parses and doesn't validate the shape of the contents. - * - * @param key The key to lookup. - */ - getObject(key) { - return this.getObjectImpl(key, this.getSecretObject, this.getObject); - } - /** - * getSecretObject loads an optional configuration value, as an object, by its key, marking it as a secret - * or undefined if it doesn't exist. - * This routine simply JSON parses and doesn't validate the shape of the contents. - * - * @param key The key to lookup. - */ - getSecretObject(key) { - const v = this.getObjectImpl(key); - if (v === undefined) { - return undefined; - } - return makeSecret(v); - } - requireImpl(key, opts, use, insteadOf) { - const v = this.getImpl(key, opts, use, insteadOf); - if (v === undefined) { - throw new ConfigMissingError(this.fullKey(key)); - } - return v; - } - /** - * require loads a configuration value by its given key. If it doesn't exist, an error is thrown. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - require(key, opts) { - return this.requireImpl(key, opts, this.requireSecret, this.require); - } - /** - * require loads a configuration value by its given key, marking it as a secret. If it doesn't exist, an error - * is thrown. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - requireSecret(key, opts) { - return makeSecret(this.requireImpl(key, opts)); - } - requireBooleanImpl(key, use, insteadOf) { - const v = this.getBooleanImpl(key, use, insteadOf); - if (v === undefined) { - throw new ConfigMissingError(this.fullKey(key)); - } - return v; - } - /** - * requireBoolean loads a configuration value, as a boolean, by its given key. If it doesn't exist, or the - * configuration value is not a legal boolean, an error is thrown. - * - * @param key The key to lookup. - */ - requireBoolean(key) { - return this.requireBooleanImpl(key, this.requireSecretBoolean, this.requireBoolean); - } - /** - * requireSecretBoolean loads a configuration value, as a boolean, by its given key, marking it as a secret. - * If it doesn't exist, or the configuration value is not a legal boolean, an error is thrown. - * - * @param key The key to lookup. - */ - requireSecretBoolean(key) { - return makeSecret(this.requireBooleanImpl(key)); - } - requireNumberImpl(key, opts, use, insteadOf) { - const v = this.getNumberImpl(key, opts, use, insteadOf); - if (v === undefined) { - throw new ConfigMissingError(this.fullKey(key)); - } - return v; - } - /** - * requireNumber loads a configuration value, as a number, by its given key. If it doesn't exist, or the - * configuration value is not a legal number, an error is thrown. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - requireNumber(key, opts) { - return this.requireNumberImpl(key, opts, this.requireSecretNumber, this.requireNumber); - } - /** - * requireSecretNumber loads a configuration value, as a number, by its given key, marking it as a secret. - * If it doesn't exist, or the configuration value is not a legal number, an error is thrown. - * - * @param key The key to lookup. - * @param opts An options bag to constrain legal values. - */ - requireSecretNumber(key, opts) { - return makeSecret(this.requireNumberImpl(key, opts)); - } - requireObjectImpl(key, use, insteadOf) { - const v = this.getObjectImpl(key, use, insteadOf); - if (v === undefined) { - throw new ConfigMissingError(this.fullKey(key)); - } - return v; - } - /** - * requireObject loads a configuration value as a JSON string and deserializes the JSON into a JavaScript object. If - * it doesn't exist, or the configuration value is not a legal JSON string, an error is thrown. - * - * @param key The key to lookup. - */ - requireObject(key) { - return this.requireObjectImpl(key, this.requireSecretObject, this.requireObject); - } - /** - * requireSecretObject loads a configuration value as a JSON string and deserializes the JSON into a JavaScript - * object, marking it as a secret. If it doesn't exist, or the configuration value is not a legal JSON - * string, an error is thrown. - * - * @param key The key to lookup. - */ - requireSecretObject(key) { - return makeSecret(this.requireObjectImpl(key)); - } - /** - * fullKey turns a simple configuration key into a fully resolved one, by prepending the bag's name. - * - * @param key The key to lookup. - */ - fullKey(key) { - return `${this.name}:${key}`; - } -} -exports.Config = Config; -/** - * ConfigTypeError is used when a configuration value is of the wrong type. - */ -class ConfigTypeError extends errors_1.RunError { - constructor(key, v, expectedType) { - super(`Configuration '${key}' value '${v}' is not a valid ${expectedType}`); - } -} -/** - * ConfigEnumError is used when a configuration value isn't a correct enum value. - */ -class ConfigEnumError extends errors_1.RunError { - constructor(key, v, values) { - super(`Configuration '${key}' value '${v}' is not a legal enum value (${JSON.stringify(values)})`); - } -} -/** - * ConfigRangeError is used when a configuration value is outside of the range of legal sizes. - */ -class ConfigRangeError extends errors_1.RunError { - constructor(key, v, min, max) { - let range; - if (max === undefined) { - range = `min ${min}`; - } - else if (min === undefined) { - range = `max ${max}`; - } - else { - range = `${min}-${max}`; - } - if (typeof v === "string") { - range += " chars"; - } - super(`Configuration '${key}' value '${v}' is outside of the legal range (${range}, inclusive)`); - } -} -/** - * ConfigPatternError is used when a configuration value does not match the given regular expression. - */ -class ConfigPatternError extends errors_1.RunError { - constructor(key, v, regexp) { - super(`Configuration '${key}' value '${v}' does not match the regular expression ${regexp.toString()}`); - } -} -/** - * ConfigMissingError is used when a configuration value is completely missing. - */ -class ConfigMissingError extends errors_1.RunError { - constructor(key) { - super(`Missing required configuration variable '${key}'\n` + - `\tplease set a value using the command \`pulumi config set ${key} \``); - this.key = key; - } -} -//# sourceMappingURL=config.js.map - -/***/ }), - -/***/ 60686: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const resource = __nccwpck_require__(90796); -const runtime = __nccwpck_require__(85022); -const providerCache = new WeakMap(); -function serializeProvider(provider) { - let result; - // caching is enabled by default as of 3.0 - if (runtime.cacheDynamicProviders()) { - const cachedProvider = providerCache.get(provider); - if (cachedProvider) { - result = cachedProvider; - } - else { - result = runtime.serializeFunction(() => provider).then(sf => sf.text); - providerCache.set(provider, result); - } - } - else { - result = runtime.serializeFunction(() => provider).then(sf => sf.text); - } - return result; -} -/** - * Resource represents a Pulumi Resource that incorporates an inline implementation of the Resource's CRUD operations. - */ -class Resource extends resource.CustomResource { - /** - * Creates a new dynamic resource. - * - * @param provider The implementation of the resource's CRUD operations. - * @param name The name of the resource. - * @param props The arguments to use to populate the new resource. Must not define the reserved - * property "__provider". - * @param opts A bag of options that control this resource's behavior. - */ - constructor(provider, name, props, opts) { - const providerKey = "__provider"; - if (props[providerKey]) { - throw new Error("A dynamic resource must not define the __provider key"); - } - props[providerKey] = serializeProvider(provider); - super("pulumi-nodejs:dynamic:Resource", name, props, opts); - } -} -exports.Resource = Resource; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 89693: +/***/ 9693: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -19357,7 +18894,7 @@ exports.Resource = Resource; // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); const grpc = __nccwpck_require__(7025); -const utils = __nccwpck_require__(21888); +const utils = __nccwpck_require__(1888); /** * RunError can be used for terminating a program abruptly, but resulting in a clean exit rather * than the usual verbose unhandled error logic which emits the source program text and complete @@ -19419,153 +18956,7 @@ exports.isGrpcError = isGrpcError; /***/ }), -/***/ 9978: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", ({ value: true })); -// Enable source map support so we get good stack traces. -__nccwpck_require__(38224); -// Export top-level elements. -__export(__nccwpck_require__(45178)); -__export(__nccwpck_require__(89693)); -__export(__nccwpck_require__(8085)); -__export(__nccwpck_require__(43037)); -__export(__nccwpck_require__(90796)); -__export(__nccwpck_require__(74919)); -// Export submodules individually. -const asset = __nccwpck_require__(83031); -exports.asset = asset; -const automation = __nccwpck_require__(34925); -exports.automation = automation; -const dynamic = __nccwpck_require__(60686); -exports.dynamic = dynamic; -const iterable = __nccwpck_require__(36134); -exports.iterable = iterable; -const log = __nccwpck_require__(80642); -exports.log = log; -const provider = __nccwpck_require__(10142); -exports.provider = provider; -const runtime = __nccwpck_require__(85022); -exports.runtime = runtime; -const utils = __nccwpck_require__(21888); -exports.utils = utils; -// @pulumi is a deployment-only module. If someone tries to capture it, and we fail for some reason -// we want to give a good message about what the problem likely is. Note that capturing a -// deployment time module can be ok in some cases. For example, using "new pulumi.Config" is fine. -// However, in general, the majority of this API is not safe to use at 'run time' and will fail. -/** @internal */ -exports.deploymentOnlyModule = true; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 36134: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const output_1 = __nccwpck_require__(43037); -/** - * toObject takes an array of T values, and a selector that produces key/value pairs from those inputs, - * and converts this array into an output object with those keys and values. - * - * For instance, given an array as follows - * - * [{ s: "a", n: 1 }, { s: "b", n: 2 }, { s: "c", n: 3 }] - * - * and whose selector is roughly `(e) => [e.s, e.n]`, the resulting object will be - * - * { "a": 1, "b": 2, "c": 3 } - * - */ -function toObject(iter, selector) { - return output_1.Output.create(iter).apply(elems => { - const array = []; - for (const e of elems) { - array.push(selector(e)); - } - return output_1.Output.create(array).apply(kvps => { - const obj = {}; - for (const kvp of kvps) { - obj[kvp[0]] = kvp[1]; - } - return obj; - }); - }); -} -exports.toObject = toObject; -/** - * groupBy takes an array of T values, and a selector that prduces key/value pairs from those inputs, - * and converts this array into an output object, with those keys, and where each property is an array of values, - * in the case that the same key shows up multiple times in the input. - * - * For instance, given an array as follows - * - * [{ s: "a", n: 1 }, { s: "a", n: 2 }, { s: "b", n: 1 }] - * - * and whose selector is roughly `(e) => [e.s, e.n]`, the resulting object will be - * - * { "a": [1, 2], "b": [1] } - * - */ -function groupBy(iter, selector) { - return output_1.Output.create(iter).apply(elems => { - const array = []; - for (const e of elems) { - array.push(selector(e)); - } - return output_1.Output.create(array).apply(kvps => { - const obj = {}; - for (const kvp of kvps) { - let r = obj[kvp[0]]; - if (!r) { - r = []; - obj[kvp[0]] = r; - } - r.push(kvp[1]); - } - return obj; - }); - }); -} -exports.groupBy = groupBy; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 80642: +/***/ 642: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -19584,8 +18975,8 @@ exports.groupBy = groupBy; // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -const settings_1 = __nccwpck_require__(34530); -const engproto = __nccwpck_require__(10986); +const settings_1 = __nccwpck_require__(4530); +const engproto = __nccwpck_require__(986); let errcnt = 0; let lastLog = Promise.resolve(); const messageLevels = { @@ -19716,26 +19107,26 @@ function log(engine, sev, msg, resource, streamId, ephemeral) { // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); // This file exports metadata about the context in which a program is being run. -const runtime = __nccwpck_require__(85022); +const settings = __nccwpck_require__(4530); /** * getProject returns the current project name. It throws an exception if none is registered. */ function getProject() { - return runtime.getProject(); + return settings.getProject(); } exports.getProject = getProject; /** * getStack returns the current stack name. It throws an exception if none is registered. */ function getStack() { - return runtime.getStack(); + return settings.getStack(); } exports.getStack = getStack; //# sourceMappingURL=metadata.js.map /***/ }), -/***/ 87486: +/***/ 7486: /***/ ((module, exports) => { exports = module.exports = SemVer @@ -21338,7 +20729,7 @@ function coerce (version, options) { /***/ }), -/***/ 43037: +/***/ 3037: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -21366,9 +20757,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const resource_1 = __nccwpck_require__(90796); -const runtime = __nccwpck_require__(85022); -const utils = __nccwpck_require__(21888); +const resource_1 = __nccwpck_require__(796); +const settings = __nccwpck_require__(4530); +const utils = __nccwpck_require__(1888); /* eslint-disable no-shadow, @typescript-eslint/no-shadow */ /** * Output helps encode the relationship between Resources in a Pulumi application. Specifically an @@ -21571,7 +20962,7 @@ function liftInnerOutput(allResources, value, isKnown, isSecret) { /* eslint-disable max-len */ function applyHelperAsync(allResources, value, isKnown, isSecret, func, runWithUnknowns) { return __awaiter(this, void 0, void 0, function* () { - if (runtime.isDryRun()) { + if (settings.isDryRun()) { // During previews only perform the apply if the engine was able to give us an actual value // for this Output. const applyDuringPreview = isKnown || runWithUnknowns; @@ -21920,8 +21311,8 @@ exports.interpolate = interpolate; // var grpc = __nccwpck_require__(7025); -var pulumi_engine_pb = __nccwpck_require__(10986); -var google_protobuf_empty_pb = __nccwpck_require__(40291); +var pulumi_engine_pb = __nccwpck_require__(986); +var google_protobuf_empty_pb = __nccwpck_require__(291); function serialize_google_protobuf_Empty(arg) { if (!(arg instanceof google_protobuf_empty_pb.Empty)) { @@ -22038,7 +21429,7 @@ exports.EngineClient = grpc.makeGenericClientConstructor(EngineService); /***/ }), -/***/ 10986: +/***/ 986: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // source: pulumi/engine.proto @@ -22054,11 +21445,11 @@ exports.EngineClient = grpc.makeGenericClientConstructor(EngineService); /* eslint-disable */ // @ts-nocheck -var jspb = __nccwpck_require__(69917); +var jspb = __nccwpck_require__(9917); var goog = jspb; var proto = { pulumirpc: {} }, global = proto; -var google_protobuf_empty_pb = __nccwpck_require__(40291); +var google_protobuf_empty_pb = __nccwpck_require__(291); goog.object.extend(proto, google_protobuf_empty_pb); goog.exportSymbol('proto.pulumirpc.GetRootResourceRequest', null, global); goog.exportSymbol('proto.pulumirpc.GetRootResourceResponse', null, global); @@ -22898,7 +22289,7 @@ goog.object.extend(exports, proto.pulumirpc); /***/ }), -/***/ 75628: +/***/ 5628: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -22921,9 +22312,9 @@ goog.object.extend(exports, proto.pulumirpc); // var grpc = __nccwpck_require__(7025); -var pulumi_language_pb = __nccwpck_require__(53979); -var pulumi_plugin_pb = __nccwpck_require__(38008); -var google_protobuf_empty_pb = __nccwpck_require__(40291); +var pulumi_language_pb = __nccwpck_require__(3979); +var pulumi_plugin_pb = __nccwpck_require__(8008); +var google_protobuf_empty_pb = __nccwpck_require__(291); function serialize_google_protobuf_Empty(arg) { if (!(arg instanceof google_protobuf_empty_pb.Empty)) { @@ -22936,6 +22327,39 @@ function deserialize_google_protobuf_Empty(buffer_arg) { return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_pulumirpc_AboutResponse(arg) { + if (!(arg instanceof pulumi_language_pb.AboutResponse)) { + throw new Error('Expected argument of type pulumirpc.AboutResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_AboutResponse(buffer_arg) { + return pulumi_language_pb.AboutResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GetProgramDependenciesRequest(arg) { + if (!(arg instanceof pulumi_language_pb.GetProgramDependenciesRequest)) { + throw new Error('Expected argument of type pulumirpc.GetProgramDependenciesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GetProgramDependenciesRequest(buffer_arg) { + return pulumi_language_pb.GetProgramDependenciesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GetProgramDependenciesResponse(arg) { + if (!(arg instanceof pulumi_language_pb.GetProgramDependenciesResponse)) { + throw new Error('Expected argument of type pulumirpc.GetProgramDependenciesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GetProgramDependenciesResponse(buffer_arg) { + return pulumi_language_pb.GetProgramDependenciesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_pulumirpc_GetRequiredPluginsRequest(arg) { if (!(arg instanceof pulumi_language_pb.GetRequiredPluginsRequest)) { throw new Error('Expected argument of type pulumirpc.GetRequiredPluginsRequest'); @@ -23065,6 +22489,30 @@ installDependencies: { responseSerialize: serialize_pulumirpc_InstallDependenciesResponse, responseDeserialize: deserialize_pulumirpc_InstallDependenciesResponse, }, + // About returns information about the runtime for this language. +about: { + path: '/pulumirpc.LanguageRuntime/About', + requestStream: false, + responseStream: false, + requestType: google_protobuf_empty_pb.Empty, + responseType: pulumi_language_pb.AboutResponse, + requestSerialize: serialize_google_protobuf_Empty, + requestDeserialize: deserialize_google_protobuf_Empty, + responseSerialize: serialize_pulumirpc_AboutResponse, + responseDeserialize: deserialize_pulumirpc_AboutResponse, + }, + // GetProgramDependencies returns the set of dependencies required by the program. +getProgramDependencies: { + path: '/pulumirpc.LanguageRuntime/GetProgramDependencies', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.GetProgramDependenciesRequest, + responseType: pulumi_language_pb.GetProgramDependenciesResponse, + requestSerialize: serialize_pulumirpc_GetProgramDependenciesRequest, + requestDeserialize: deserialize_pulumirpc_GetProgramDependenciesRequest, + responseSerialize: serialize_pulumirpc_GetProgramDependenciesResponse, + responseDeserialize: deserialize_pulumirpc_GetProgramDependenciesResponse, + }, }; exports.LanguageRuntimeClient = grpc.makeGenericClientConstructor(LanguageRuntimeService); @@ -23072,7 +22520,7 @@ exports.LanguageRuntimeClient = grpc.makeGenericClientConstructor(LanguageRuntim /***/ }), -/***/ 53979: +/***/ 3979: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // source: pulumi/language.proto @@ -23088,20 +22536,108 @@ exports.LanguageRuntimeClient = grpc.makeGenericClientConstructor(LanguageRuntim /* eslint-disable */ // @ts-nocheck -var jspb = __nccwpck_require__(69917); +var jspb = __nccwpck_require__(9917); var goog = jspb; var proto = { pulumirpc: {} }, global = proto; -var pulumi_plugin_pb = __nccwpck_require__(38008); +var pulumi_plugin_pb = __nccwpck_require__(8008); goog.object.extend(proto, pulumi_plugin_pb); -var google_protobuf_empty_pb = __nccwpck_require__(40291); +var google_protobuf_empty_pb = __nccwpck_require__(291); goog.object.extend(proto, google_protobuf_empty_pb); +goog.exportSymbol('proto.pulumirpc.AboutResponse', null, global); +goog.exportSymbol('proto.pulumirpc.DependencyInfo', null, global); +goog.exportSymbol('proto.pulumirpc.GetProgramDependenciesRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GetProgramDependenciesResponse', null, global); goog.exportSymbol('proto.pulumirpc.GetRequiredPluginsRequest', null, global); goog.exportSymbol('proto.pulumirpc.GetRequiredPluginsResponse', null, global); goog.exportSymbol('proto.pulumirpc.InstallDependenciesRequest', null, global); goog.exportSymbol('proto.pulumirpc.InstallDependenciesResponse', null, global); goog.exportSymbol('proto.pulumirpc.RunRequest', null, global); goog.exportSymbol('proto.pulumirpc.RunResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.AboutResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.AboutResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.AboutResponse.displayName = 'proto.pulumirpc.AboutResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.GetProgramDependenciesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetProgramDependenciesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetProgramDependenciesRequest.displayName = 'proto.pulumirpc.GetProgramDependenciesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.DependencyInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.DependencyInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.DependencyInfo.displayName = 'proto.pulumirpc.DependencyInfo'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.GetProgramDependenciesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GetProgramDependenciesResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.GetProgramDependenciesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetProgramDependenciesResponse.displayName = 'proto.pulumirpc.GetProgramDependenciesResponse'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -23244,8 +22780,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.GetRequiredPluginsRequest.toObject(opt_includeInstance, this); +proto.pulumirpc.AboutResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.AboutResponse.toObject(opt_includeInstance, this); }; @@ -23254,15 +22790,15 @@ proto.pulumirpc.GetRequiredPluginsRequest.prototype.toObject = function(opt_incl * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.GetRequiredPluginsRequest} msg The msg instance to transform. + * @param {!proto.pulumirpc.AboutResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.GetRequiredPluginsRequest.toObject = function(includeInstance, msg) { +proto.pulumirpc.AboutResponse.toObject = function(includeInstance, msg) { var f, obj = { - project: jspb.Message.getFieldWithDefault(msg, 1, ""), - pwd: jspb.Message.getFieldWithDefault(msg, 2, ""), - program: jspb.Message.getFieldWithDefault(msg, 3, "") + executable: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] }; if (includeInstance) { @@ -23276,23 +22812,23 @@ proto.pulumirpc.GetRequiredPluginsRequest.toObject = function(includeInstance, m /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.GetRequiredPluginsRequest} + * @return {!proto.pulumirpc.AboutResponse} */ -proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinary = function(bytes) { +proto.pulumirpc.AboutResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.GetRequiredPluginsRequest; - return proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.AboutResponse; + return proto.pulumirpc.AboutResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.GetRequiredPluginsRequest} msg The message object to deserialize into. + * @param {!proto.pulumirpc.AboutResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.GetRequiredPluginsRequest} + * @return {!proto.pulumirpc.AboutResponse} */ -proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.AboutResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -23301,15 +22837,17 @@ proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader = function switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setProject(value); + msg.setExecutable(value); break; case 2: var value = /** @type {string} */ (reader.readString()); - msg.setPwd(value); + msg.setVersion(value); break; case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setProgram(value); + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); break; default: reader.skipField(); @@ -23324,9 +22862,9 @@ proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader = function * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.serializeBinary = function() { +proto.pulumirpc.AboutResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter(this, writer); + proto.pulumirpc.AboutResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -23334,97 +22872,91 @@ proto.pulumirpc.GetRequiredPluginsRequest.prototype.serializeBinary = function() /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.GetRequiredPluginsRequest} message + * @param {!proto.pulumirpc.AboutResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.AboutResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getProject(); + f = message.getExecutable(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getPwd(); + f = message.getVersion(); if (f.length > 0) { writer.writeString( 2, f ); } - f = message.getProgram(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } }; /** - * optional string project = 1; + * optional string executable = 1; * @return {string} */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProject = function() { +proto.pulumirpc.AboutResponse.prototype.getExecutable = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + * @return {!proto.pulumirpc.AboutResponse} returns this */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProject = function(value) { +proto.pulumirpc.AboutResponse.prototype.setExecutable = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional string pwd = 2; + * optional string version = 2; * @return {string} */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.getPwd = function() { +proto.pulumirpc.AboutResponse.prototype.getVersion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + * @return {!proto.pulumirpc.AboutResponse} returns this */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.setPwd = function(value) { +proto.pulumirpc.AboutResponse.prototype.setVersion = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** - * optional string program = 3; - * @return {string} + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProgram = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.pulumirpc.AboutResponse.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); }; /** - * @param {string} value - * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.AboutResponse} returns this */ -proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProgram = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - +proto.pulumirpc.AboutResponse.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.pulumirpc.GetRequiredPluginsResponse.repeatedFields_ = [1]; @@ -23441,8 +22973,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.GetRequiredPluginsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.GetRequiredPluginsResponse.toObject(opt_includeInstance, this); +proto.pulumirpc.GetProgramDependenciesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetProgramDependenciesRequest.toObject(opt_includeInstance, this); }; @@ -23451,14 +22983,16 @@ proto.pulumirpc.GetRequiredPluginsResponse.prototype.toObject = function(opt_inc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.GetRequiredPluginsResponse} msg The msg instance to transform. + * @param {!proto.pulumirpc.GetProgramDependenciesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.GetRequiredPluginsResponse.toObject = function(includeInstance, msg) { +proto.pulumirpc.GetProgramDependenciesRequest.toObject = function(includeInstance, msg) { var f, obj = { - pluginsList: jspb.Message.toObjectList(msg.getPluginsList(), - pulumi_plugin_pb.PluginDependency.toObject, includeInstance) + project: jspb.Message.getFieldWithDefault(msg, 1, ""), + pwd: jspb.Message.getFieldWithDefault(msg, 2, ""), + program: jspb.Message.getFieldWithDefault(msg, 3, ""), + transitivedependencies: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; if (includeInstance) { @@ -23472,23 +23006,23 @@ proto.pulumirpc.GetRequiredPluginsResponse.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.GetRequiredPluginsResponse} + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} */ -proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinary = function(bytes) { +proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.GetRequiredPluginsResponse; - return proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.GetProgramDependenciesRequest; + return proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.GetRequiredPluginsResponse} msg The message object to deserialize into. + * @param {!proto.pulumirpc.GetProgramDependenciesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.GetRequiredPluginsResponse} + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} */ -proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -23496,9 +23030,20 @@ proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader = functio var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new pulumi_plugin_pb.PluginDependency; - reader.readMessage(value,pulumi_plugin_pb.PluginDependency.deserializeBinaryFromReader); - msg.addPlugins(value); + var value = /** @type {string} */ (reader.readString()); + msg.setProject(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPwd(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProgram(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setTransitivedependencies(value); break; default: reader.skipField(); @@ -23513,9 +23058,9 @@ proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.GetRequiredPluginsResponse.prototype.serializeBinary = function() { +proto.pulumirpc.GetProgramDependenciesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter(this, writer); + proto.pulumirpc.GetProgramDependenciesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -23523,68 +23068,115 @@ proto.pulumirpc.GetRequiredPluginsResponse.prototype.serializeBinary = function( /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.GetRequiredPluginsResponse} message + * @param {!proto.pulumirpc.GetProgramDependenciesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.GetProgramDependenciesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPluginsList(); + f = message.getProject(); if (f.length > 0) { - writer.writeRepeatedMessage( + writer.writeString( 1, - f, - pulumi_plugin_pb.PluginDependency.serializeBinaryToWriter + f + ); + } + f = message.getPwd(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProgram(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getTransitivedependencies(); + if (f) { + writer.writeBool( + 4, + f ); } }; /** - * repeated PluginDependency plugins = 1; - * @return {!Array} + * optional string project = 1; + * @return {string} */ -proto.pulumirpc.GetRequiredPluginsResponse.prototype.getPluginsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, pulumi_plugin_pb.PluginDependency, 1)); +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {!Array} value - * @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this -*/ -proto.pulumirpc.GetRequiredPluginsResponse.prototype.setPluginsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); + * @param {string} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * @param {!proto.pulumirpc.PluginDependency=} opt_value - * @param {number=} opt_index - * @return {!proto.pulumirpc.PluginDependency} + * optional string pwd = 2; + * @return {string} */ -proto.pulumirpc.GetRequiredPluginsResponse.prototype.addPlugins = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.PluginDependency, opt_index); +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this + * @param {string} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this */ -proto.pulumirpc.GetRequiredPluginsResponse.prototype.clearPluginsList = function() { - return this.setPluginsList([]); +proto.pulumirpc.GetProgramDependenciesRequest.prototype.setPwd = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; +/** + * optional string program = 3; + * @return {string} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getProgram = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * @param {string} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this */ -proto.pulumirpc.RunRequest.repeatedFields_ = [5,11]; +proto.pulumirpc.GetProgramDependenciesRequest.prototype.setProgram = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool transitiveDependencies = 4; + * @return {boolean} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getTransitivedependencies = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.setTransitivedependencies = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + @@ -23601,8 +23193,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.RunRequest.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.RunRequest.toObject(opt_includeInstance, this); +proto.pulumirpc.DependencyInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.DependencyInfo.toObject(opt_includeInstance, this); }; @@ -23611,23 +23203,14 @@ proto.pulumirpc.RunRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.RunRequest} msg The msg instance to transform. + * @param {!proto.pulumirpc.DependencyInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.RunRequest.toObject = function(includeInstance, msg) { +proto.pulumirpc.DependencyInfo.toObject = function(includeInstance, msg) { var f, obj = { - project: jspb.Message.getFieldWithDefault(msg, 1, ""), - stack: jspb.Message.getFieldWithDefault(msg, 2, ""), - pwd: jspb.Message.getFieldWithDefault(msg, 3, ""), - program: jspb.Message.getFieldWithDefault(msg, 4, ""), - argsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, - configMap: (f = msg.getConfigMap()) ? f.toObject(includeInstance, undefined) : [], - dryrun: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), - parallel: jspb.Message.getFieldWithDefault(msg, 8, 0), - monitorAddress: jspb.Message.getFieldWithDefault(msg, 9, ""), - querymode: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), - configsecretkeysList: (f = jspb.Message.getRepeatedField(msg, 11)) == null ? undefined : f + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -23641,23 +23224,23 @@ proto.pulumirpc.RunRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.RunRequest} + * @return {!proto.pulumirpc.DependencyInfo} */ -proto.pulumirpc.RunRequest.deserializeBinary = function(bytes) { +proto.pulumirpc.DependencyInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.RunRequest; - return proto.pulumirpc.RunRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.DependencyInfo; + return proto.pulumirpc.DependencyInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.RunRequest} msg The message object to deserialize into. + * @param {!proto.pulumirpc.DependencyInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.RunRequest} + * @return {!proto.pulumirpc.DependencyInfo} */ -proto.pulumirpc.RunRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.DependencyInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -23666,49 +23249,11 @@ proto.pulumirpc.RunRequest.deserializeBinaryFromReader = function(msg, reader) { switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setProject(value); + msg.setName(value); break; case 2: var value = /** @type {string} */ (reader.readString()); - msg.setStack(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setPwd(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setProgram(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.addArgs(value); - break; - case 6: - var value = msg.getConfigMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 7: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDryrun(value); - break; - case 8: - var value = /** @type {number} */ (reader.readInt32()); - msg.setParallel(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setMonitorAddress(value); - break; - case 10: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setQuerymode(value); - break; - case 11: - var value = /** @type {string} */ (reader.readString()); - msg.addConfigsecretkeys(value); + msg.setVersion(value); break; default: reader.skipField(); @@ -23723,9 +23268,9 @@ proto.pulumirpc.RunRequest.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.RunRequest.prototype.serializeBinary = function() { +proto.pulumirpc.DependencyInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.RunRequest.serializeBinaryToWriter(this, writer); + proto.pulumirpc.DependencyInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -23733,326 +23278,222 @@ proto.pulumirpc.RunRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.RunRequest} message + * @param {!proto.pulumirpc.DependencyInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.RunRequest.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.DependencyInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getProject(); + f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getStack(); + f = message.getVersion(); if (f.length > 0) { writer.writeString( 2, f ); } - f = message.getPwd(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getProgram(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getArgsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 5, - f - ); - } - f = message.getConfigMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getDryrun(); - if (f) { - writer.writeBool( - 7, - f - ); - } - f = message.getParallel(); - if (f !== 0) { - writer.writeInt32( - 8, - f - ); - } - f = message.getMonitorAddress(); - if (f.length > 0) { - writer.writeString( - 9, - f - ); - } - f = message.getQuerymode(); - if (f) { - writer.writeBool( - 10, - f - ); - } - f = message.getConfigsecretkeysList(); - if (f.length > 0) { - writer.writeRepeatedString( - 11, - f - ); - } }; /** - * optional string project = 1; + * optional string name = 1; * @return {string} */ -proto.pulumirpc.RunRequest.prototype.getProject = function() { +proto.pulumirpc.DependencyInfo.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.RunRequest} returns this + * @return {!proto.pulumirpc.DependencyInfo} returns this */ -proto.pulumirpc.RunRequest.prototype.setProject = function(value) { +proto.pulumirpc.DependencyInfo.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional string stack = 2; + * optional string version = 2; * @return {string} */ -proto.pulumirpc.RunRequest.prototype.getStack = function() { +proto.pulumirpc.DependencyInfo.prototype.getVersion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.RunRequest} returns this + * @return {!proto.pulumirpc.DependencyInfo} returns this */ -proto.pulumirpc.RunRequest.prototype.setStack = function(value) { +proto.pulumirpc.DependencyInfo.prototype.setVersion = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; + /** - * optional string pwd = 3; - * @return {string} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.pulumirpc.RunRequest.prototype.getPwd = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; +proto.pulumirpc.GetProgramDependenciesResponse.repeatedFields_ = [1]; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * @param {string} value - * @return {!proto.pulumirpc.RunRequest} returns this + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.pulumirpc.RunRequest.prototype.setPwd = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); +proto.pulumirpc.GetProgramDependenciesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetProgramDependenciesResponse.toObject(opt_includeInstance, this); }; /** - * optional string program = 4; - * @return {string} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pulumirpc.GetProgramDependenciesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.RunRequest.prototype.getProgram = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.pulumirpc.GetProgramDependenciesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + dependenciesList: jspb.Message.toObjectList(msg.getDependenciesList(), + proto.pulumirpc.DependencyInfo.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * @param {string} value - * @return {!proto.pulumirpc.RunRequest} returns this + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pulumirpc.GetProgramDependenciesResponse} */ -proto.pulumirpc.RunRequest.prototype.setProgram = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); +proto.pulumirpc.GetProgramDependenciesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetProgramDependenciesResponse; + return proto.pulumirpc.GetProgramDependenciesResponse.deserializeBinaryFromReader(msg, reader); }; /** - * repeated string args = 5; - * @return {!Array} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetProgramDependenciesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetProgramDependenciesResponse} */ -proto.pulumirpc.RunRequest.prototype.getArgsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +proto.pulumirpc.GetProgramDependenciesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.pulumirpc.DependencyInfo; + reader.readMessage(value,proto.pulumirpc.DependencyInfo.deserializeBinaryFromReader); + msg.addDependencies(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * @param {!Array} value - * @return {!proto.pulumirpc.RunRequest} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.pulumirpc.RunRequest.prototype.setArgsList = function(value) { - return jspb.Message.setField(this, 5, value || []); +proto.pulumirpc.GetProgramDependenciesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetProgramDependenciesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.addArgs = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 5, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.clearArgsList = function() { - return this.setArgsList([]); -}; - - -/** - * map config = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.pulumirpc.RunRequest.prototype.getConfigMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.clearConfigMap = function() { - this.getConfigMap().clear(); - return this;}; - - -/** - * optional bool dryRun = 7; - * @return {boolean} - */ -proto.pulumirpc.RunRequest.prototype.getDryrun = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.setDryrun = function(value) { - return jspb.Message.setProto3BooleanField(this, 7, value); -}; - - -/** - * optional int32 parallel = 8; - * @return {number} - */ -proto.pulumirpc.RunRequest.prototype.getParallel = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.setParallel = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); -}; - - -/** - * optional string monitor_address = 9; - * @return {string} - */ -proto.pulumirpc.RunRequest.prototype.getMonitorAddress = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - - -/** - * @param {string} value - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.setMonitorAddress = function(value) { - return jspb.Message.setProto3StringField(this, 9, value); -}; - - -/** - * optional bool queryMode = 10; - * @return {boolean} - */ -proto.pulumirpc.RunRequest.prototype.getQuerymode = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.pulumirpc.RunRequest} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pulumirpc.GetProgramDependenciesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.RunRequest.prototype.setQuerymode = function(value) { - return jspb.Message.setProto3BooleanField(this, 10, value); +proto.pulumirpc.GetProgramDependenciesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDependenciesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.pulumirpc.DependencyInfo.serializeBinaryToWriter + ); + } }; /** - * repeated string configSecretKeys = 11; - * @return {!Array} + * repeated DependencyInfo dependencies = 1; + * @return {!Array} */ -proto.pulumirpc.RunRequest.prototype.getConfigsecretkeysList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 11)); +proto.pulumirpc.GetProgramDependenciesResponse.prototype.getDependenciesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.DependencyInfo, 1)); }; /** - * @param {!Array} value - * @return {!proto.pulumirpc.RunRequest} returns this - */ -proto.pulumirpc.RunRequest.prototype.setConfigsecretkeysList = function(value) { - return jspb.Message.setField(this, 11, value || []); + * @param {!Array} value + * @return {!proto.pulumirpc.GetProgramDependenciesResponse} returns this +*/ +proto.pulumirpc.GetProgramDependenciesResponse.prototype.setDependenciesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * @param {string} value + * @param {!proto.pulumirpc.DependencyInfo=} opt_value * @param {number=} opt_index - * @return {!proto.pulumirpc.RunRequest} returns this + * @return {!proto.pulumirpc.DependencyInfo} */ -proto.pulumirpc.RunRequest.prototype.addConfigsecretkeys = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 11, value, opt_index); +proto.pulumirpc.GetProgramDependenciesResponse.prototype.addDependencies = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.DependencyInfo, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.pulumirpc.RunRequest} returns this + * @return {!proto.pulumirpc.GetProgramDependenciesResponse} returns this */ -proto.pulumirpc.RunRequest.prototype.clearConfigsecretkeysList = function() { - return this.setConfigsecretkeysList([]); +proto.pulumirpc.GetProgramDependenciesResponse.prototype.clearDependenciesList = function() { + return this.setDependenciesList([]); }; @@ -24072,8 +23513,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.RunResponse.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.RunResponse.toObject(opt_includeInstance, this); +proto.pulumirpc.GetRequiredPluginsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetRequiredPluginsRequest.toObject(opt_includeInstance, this); }; @@ -24082,14 +23523,15 @@ proto.pulumirpc.RunResponse.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.RunResponse} msg The msg instance to transform. + * @param {!proto.pulumirpc.GetRequiredPluginsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.RunResponse.toObject = function(includeInstance, msg) { +proto.pulumirpc.GetRequiredPluginsRequest.toObject = function(includeInstance, msg) { var f, obj = { - error: jspb.Message.getFieldWithDefault(msg, 1, ""), - bail: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + project: jspb.Message.getFieldWithDefault(msg, 1, ""), + pwd: jspb.Message.getFieldWithDefault(msg, 2, ""), + program: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { @@ -24103,23 +23545,23 @@ proto.pulumirpc.RunResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.RunResponse} + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} */ -proto.pulumirpc.RunResponse.deserializeBinary = function(bytes) { +proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.RunResponse; - return proto.pulumirpc.RunResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.GetRequiredPluginsRequest; + return proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.RunResponse} msg The message object to deserialize into. + * @param {!proto.pulumirpc.GetRequiredPluginsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.RunResponse} + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} */ -proto.pulumirpc.RunResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24128,11 +23570,15 @@ proto.pulumirpc.RunResponse.deserializeBinaryFromReader = function(msg, reader) switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setError(value); + msg.setProject(value); break; case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setBail(value); + var value = /** @type {string} */ (reader.readString()); + msg.setPwd(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProgram(value); break; default: reader.skipField(); @@ -24147,9 +23593,9 @@ proto.pulumirpc.RunResponse.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.RunResponse.prototype.serializeBinary = function() { +proto.pulumirpc.GetRequiredPluginsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.RunResponse.serializeBinaryToWriter(this, writer); + proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24157,66 +23603,98 @@ proto.pulumirpc.RunResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.RunResponse} message + * @param {!proto.pulumirpc.GetRequiredPluginsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.RunResponse.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getError(); + f = message.getProject(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getBail(); - if (f) { - writer.writeBool( + f = message.getPwd(); + if (f.length > 0) { + writer.writeString( 2, f ); } + f = message.getProgram(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } }; /** - * optional string error = 1; + * optional string project = 1; * @return {string} */ -proto.pulumirpc.RunResponse.prototype.getError = function() { +proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProject = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.RunResponse} returns this + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this */ -proto.pulumirpc.RunResponse.prototype.setError = function(value) { +proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProject = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional bool bail = 2; - * @return {boolean} + * optional string pwd = 2; + * @return {string} */ -proto.pulumirpc.RunResponse.prototype.getBail = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +proto.pulumirpc.GetRequiredPluginsRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * @param {boolean} value - * @return {!proto.pulumirpc.RunResponse} returns this + * @param {string} value + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this */ -proto.pulumirpc.RunResponse.prototype.setBail = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); +proto.pulumirpc.GetRequiredPluginsRequest.prototype.setPwd = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string program = 3; + * @return {string} + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProgram = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProgram = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GetRequiredPluginsResponse.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -24232,8 +23710,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.InstallDependenciesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.InstallDependenciesRequest.toObject(opt_includeInstance, this); +proto.pulumirpc.GetRequiredPluginsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetRequiredPluginsResponse.toObject(opt_includeInstance, this); }; @@ -24242,14 +23720,14 @@ proto.pulumirpc.InstallDependenciesRequest.prototype.toObject = function(opt_inc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.InstallDependenciesRequest} msg The msg instance to transform. + * @param {!proto.pulumirpc.GetRequiredPluginsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.InstallDependenciesRequest.toObject = function(includeInstance, msg) { +proto.pulumirpc.GetRequiredPluginsResponse.toObject = function(includeInstance, msg) { var f, obj = { - directory: jspb.Message.getFieldWithDefault(msg, 1, ""), - isTerminal: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + pluginsList: jspb.Message.toObjectList(msg.getPluginsList(), + pulumi_plugin_pb.PluginDependency.toObject, includeInstance) }; if (includeInstance) { @@ -24263,23 +23741,23 @@ proto.pulumirpc.InstallDependenciesRequest.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.InstallDependenciesRequest} + * @return {!proto.pulumirpc.GetRequiredPluginsResponse} */ -proto.pulumirpc.InstallDependenciesRequest.deserializeBinary = function(bytes) { +proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.InstallDependenciesRequest; - return proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.GetRequiredPluginsResponse; + return proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.InstallDependenciesRequest} msg The message object to deserialize into. + * @param {!proto.pulumirpc.GetRequiredPluginsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.InstallDependenciesRequest} + * @return {!proto.pulumirpc.GetRequiredPluginsResponse} */ -proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24287,12 +23765,9 @@ proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader = functio var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDirectory(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsTerminal(value); + var value = new pulumi_plugin_pb.PluginDependency; + reader.readMessage(value,pulumi_plugin_pb.PluginDependency.deserializeBinaryFromReader); + msg.addPlugins(value); break; default: reader.skipField(); @@ -24307,9 +23782,9 @@ proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.InstallDependenciesRequest.prototype.serializeBinary = function() { +proto.pulumirpc.GetRequiredPluginsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter(this, writer); + proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24317,66 +23792,69 @@ proto.pulumirpc.InstallDependenciesRequest.prototype.serializeBinary = function( /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.InstallDependenciesRequest} message + * @param {!proto.pulumirpc.GetRequiredPluginsResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDirectory(); + f = message.getPluginsList(); if (f.length > 0) { - writer.writeString( + writer.writeRepeatedMessage( 1, - f - ); - } - f = message.getIsTerminal(); - if (f) { - writer.writeBool( - 2, - f + f, + pulumi_plugin_pb.PluginDependency.serializeBinaryToWriter ); } }; /** - * optional string directory = 1; - * @return {string} + * repeated PluginDependency plugins = 1; + * @return {!Array} */ -proto.pulumirpc.InstallDependenciesRequest.prototype.getDirectory = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.pulumirpc.GetRequiredPluginsResponse.prototype.getPluginsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_plugin_pb.PluginDependency, 1)); }; /** - * @param {string} value - * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this - */ -proto.pulumirpc.InstallDependenciesRequest.prototype.setDirectory = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); + * @param {!Array} value + * @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this +*/ +proto.pulumirpc.GetRequiredPluginsResponse.prototype.setPluginsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * optional bool is_terminal = 2; - * @return {boolean} + * @param {!proto.pulumirpc.PluginDependency=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.PluginDependency} */ -proto.pulumirpc.InstallDependenciesRequest.prototype.getIsTerminal = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +proto.pulumirpc.GetRequiredPluginsResponse.prototype.addPlugins = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.PluginDependency, opt_index); }; /** - * @param {boolean} value - * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this */ -proto.pulumirpc.InstallDependenciesRequest.prototype.setIsTerminal = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); +proto.pulumirpc.GetRequiredPluginsResponse.prototype.clearPluginsList = function() { + return this.setPluginsList([]); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.RunRequest.repeatedFields_ = [5,11]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -24392,8 +23870,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.InstallDependenciesResponse.toObject(opt_includeInstance, this); +proto.pulumirpc.RunRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RunRequest.toObject(opt_includeInstance, this); }; @@ -24402,14 +23880,23 @@ proto.pulumirpc.InstallDependenciesResponse.prototype.toObject = function(opt_in * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.InstallDependenciesResponse} msg The msg instance to transform. + * @param {!proto.pulumirpc.RunRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.InstallDependenciesResponse.toObject = function(includeInstance, msg) { +proto.pulumirpc.RunRequest.toObject = function(includeInstance, msg) { var f, obj = { - stdout: msg.getStdout_asB64(), - stderr: msg.getStderr_asB64() + project: jspb.Message.getFieldWithDefault(msg, 1, ""), + stack: jspb.Message.getFieldWithDefault(msg, 2, ""), + pwd: jspb.Message.getFieldWithDefault(msg, 3, ""), + program: jspb.Message.getFieldWithDefault(msg, 4, ""), + argsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + configMap: (f = msg.getConfigMap()) ? f.toObject(includeInstance, undefined) : [], + dryrun: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + parallel: jspb.Message.getFieldWithDefault(msg, 8, 0), + monitorAddress: jspb.Message.getFieldWithDefault(msg, 9, ""), + querymode: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + configsecretkeysList: (f = jspb.Message.getRepeatedField(msg, 11)) == null ? undefined : f }; if (includeInstance) { @@ -24423,23 +23910,23 @@ proto.pulumirpc.InstallDependenciesResponse.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.InstallDependenciesResponse} + * @return {!proto.pulumirpc.RunRequest} */ -proto.pulumirpc.InstallDependenciesResponse.deserializeBinary = function(bytes) { +proto.pulumirpc.RunRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.InstallDependenciesResponse; - return proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.RunRequest; + return proto.pulumirpc.RunRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.InstallDependenciesResponse} msg The message object to deserialize into. + * @param {!proto.pulumirpc.RunRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.InstallDependenciesResponse} + * @return {!proto.pulumirpc.RunRequest} */ -proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.RunRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24447,12 +23934,50 @@ proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader = functi var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStdout(value); + var value = /** @type {string} */ (reader.readString()); + msg.setProject(value); break; case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStderr(value); + var value = /** @type {string} */ (reader.readString()); + msg.setStack(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPwd(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setProgram(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addArgs(value); + break; + case 6: + var value = msg.getConfigMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDryrun(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt32()); + msg.setParallel(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setMonitorAddress(value); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setQuerymode(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.addConfigsecretkeys(value); break; default: reader.skipField(); @@ -24467,9 +23992,9 @@ proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader = functi * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.serializeBinary = function() { +proto.pulumirpc.RunRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter(this, writer); + proto.pulumirpc.RunRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24477,204 +24002,329 @@ proto.pulumirpc.InstallDependenciesResponse.prototype.serializeBinary = function /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.InstallDependenciesResponse} message + * @param {!proto.pulumirpc.RunRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.RunRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getStdout_asU8(); + f = message.getProject(); if (f.length > 0) { - writer.writeBytes( + writer.writeString( 1, f ); } - f = message.getStderr_asU8(); + f = message.getStack(); if (f.length > 0) { - writer.writeBytes( + writer.writeString( 2, f ); } + f = message.getPwd(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getProgram(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getArgsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getConfigMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getDryrun(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getParallel(); + if (f !== 0) { + writer.writeInt32( + 8, + f + ); + } + f = message.getMonitorAddress(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getQuerymode(); + if (f) { + writer.writeBool( + 10, + f + ); + } + f = message.getConfigsecretkeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 11, + f + ); + } }; /** - * optional bytes stdout = 1; - * @return {!(string|Uint8Array)} + * optional string project = 1; + * @return {string} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.pulumirpc.RunRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes stdout = 1; - * This is a type-conversion wrapper around `getStdout()` + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string stack = 2; * @return {string} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStdout())); +proto.pulumirpc.RunRequest.prototype.getStack = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional bytes stdout = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStdout()` - * @return {!Uint8Array} + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this */ -proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStdout())); +proto.pulumirpc.RunRequest.prototype.setStack = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.pulumirpc.InstallDependenciesResponse} returns this + * optional string pwd = 3; + * @return {string} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.setStdout = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.pulumirpc.RunRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * optional bytes stderr = 2; - * @return {!(string|Uint8Array)} + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this */ -proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.pulumirpc.RunRequest.prototype.setPwd = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); }; /** - * optional bytes stderr = 2; - * This is a type-conversion wrapper around `getStderr()` + * optional string program = 4; * @return {string} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStderr())); +proto.pulumirpc.RunRequest.prototype.getProgram = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** - * optional bytes stderr = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStderr()` - * @return {!Uint8Array} + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this */ -proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStderr())); +proto.pulumirpc.RunRequest.prototype.setProgram = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.pulumirpc.InstallDependenciesResponse} returns this + * repeated string args = 5; + * @return {!Array} */ -proto.pulumirpc.InstallDependenciesResponse.prototype.setStderr = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); +proto.pulumirpc.RunRequest.prototype.getArgsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); }; -goog.object.extend(exports, proto.pulumirpc); +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setArgsList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; -/***/ }), +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.addArgs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; -/***/ 38008: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// source: pulumi/plugin.proto /** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RunRequest} returns this */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck +proto.pulumirpc.RunRequest.prototype.clearArgsList = function() { + return this.setArgsList([]); +}; -var jspb = __nccwpck_require__(69917); -var goog = jspb; -var proto = { pulumirpc: {} }, global = proto; -goog.exportSymbol('proto.pulumirpc.PluginAttach', null, global); -goog.exportSymbol('proto.pulumirpc.PluginDependency', null, global); -goog.exportSymbol('proto.pulumirpc.PluginInfo', null, global); /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * map config = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} */ -proto.pulumirpc.PluginInfo = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.RunRequest.prototype.getConfigMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); }; -goog.inherits(proto.pulumirpc.PluginInfo, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.PluginInfo.displayName = 'proto.pulumirpc.PluginInfo'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.RunRequest} returns this */ -proto.pulumirpc.PluginDependency = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.RunRequest.prototype.clearConfigMap = function() { + this.getConfigMap().clear(); + return this;}; + + +/** + * optional bool dryRun = 7; + * @return {boolean} + */ +proto.pulumirpc.RunRequest.prototype.getDryrun = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); }; -goog.inherits(proto.pulumirpc.PluginDependency, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.PluginDependency.displayName = 'proto.pulumirpc.PluginDependency'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {boolean} value + * @return {!proto.pulumirpc.RunRequest} returns this */ -proto.pulumirpc.PluginAttach = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.RunRequest.prototype.setDryrun = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); }; -goog.inherits(proto.pulumirpc.PluginAttach, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.PluginAttach.displayName = 'proto.pulumirpc.PluginAttach'; -} + + +/** + * optional int32 parallel = 8; + * @return {number} + */ +proto.pulumirpc.RunRequest.prototype.getParallel = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setParallel = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional string monitor_address = 9; + * @return {string} + */ +proto.pulumirpc.RunRequest.prototype.getMonitorAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setMonitorAddress = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional bool queryMode = 10; + * @return {boolean} + */ +proto.pulumirpc.RunRequest.prototype.getQuerymode = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setQuerymode = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +/** + * repeated string configSecretKeys = 11; + * @return {!Array} + */ +proto.pulumirpc.RunRequest.prototype.getConfigsecretkeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 11)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setConfigsecretkeysList = function(value) { + return jspb.Message.setField(this, 11, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.addConfigsecretkeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 11, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.clearConfigsecretkeysList = function() { + return this.setConfigsecretkeysList([]); +}; + + @@ -24691,8 +24341,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.PluginInfo.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.PluginInfo.toObject(opt_includeInstance, this); +proto.pulumirpc.RunResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RunResponse.toObject(opt_includeInstance, this); }; @@ -24701,13 +24351,14 @@ proto.pulumirpc.PluginInfo.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.PluginInfo} msg The msg instance to transform. + * @param {!proto.pulumirpc.RunResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PluginInfo.toObject = function(includeInstance, msg) { +proto.pulumirpc.RunResponse.toObject = function(includeInstance, msg) { var f, obj = { - version: jspb.Message.getFieldWithDefault(msg, 1, "") + error: jspb.Message.getFieldWithDefault(msg, 1, ""), + bail: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -24721,23 +24372,23 @@ proto.pulumirpc.PluginInfo.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.PluginInfo} + * @return {!proto.pulumirpc.RunResponse} */ -proto.pulumirpc.PluginInfo.deserializeBinary = function(bytes) { +proto.pulumirpc.RunResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.PluginInfo; - return proto.pulumirpc.PluginInfo.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.RunResponse; + return proto.pulumirpc.RunResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.PluginInfo} msg The message object to deserialize into. + * @param {!proto.pulumirpc.RunResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.PluginInfo} + * @return {!proto.pulumirpc.RunResponse} */ -proto.pulumirpc.PluginInfo.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.RunResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24746,7 +24397,11 @@ proto.pulumirpc.PluginInfo.deserializeBinaryFromReader = function(msg, reader) { switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setVersion(value); + msg.setError(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setBail(value); break; default: reader.skipField(); @@ -24761,9 +24416,9 @@ proto.pulumirpc.PluginInfo.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.PluginInfo.prototype.serializeBinary = function() { +proto.pulumirpc.RunResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.PluginInfo.serializeBinaryToWriter(this, writer); + proto.pulumirpc.RunResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24771,40 +24426,65 @@ proto.pulumirpc.PluginInfo.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.PluginInfo} message + * @param {!proto.pulumirpc.RunResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PluginInfo.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.RunResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getVersion(); + f = message.getError(); if (f.length > 0) { writer.writeString( 1, f ); } + f = message.getBail(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; /** - * optional string version = 1; + * optional string error = 1; * @return {string} */ -proto.pulumirpc.PluginInfo.prototype.getVersion = function() { +proto.pulumirpc.RunResponse.prototype.getError = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.PluginInfo} returns this + * @return {!proto.pulumirpc.RunResponse} returns this */ -proto.pulumirpc.PluginInfo.prototype.setVersion = function(value) { +proto.pulumirpc.RunResponse.prototype.setError = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; +/** + * optional bool bail = 2; + * @return {boolean} + */ +proto.pulumirpc.RunResponse.prototype.getBail = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RunResponse} returns this + */ +proto.pulumirpc.RunResponse.prototype.setBail = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + @@ -24821,8 +24501,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.PluginDependency.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.PluginDependency.toObject(opt_includeInstance, this); +proto.pulumirpc.InstallDependenciesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.InstallDependenciesRequest.toObject(opt_includeInstance, this); }; @@ -24831,16 +24511,14 @@ proto.pulumirpc.PluginDependency.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.PluginDependency} msg The msg instance to transform. + * @param {!proto.pulumirpc.InstallDependenciesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PluginDependency.toObject = function(includeInstance, msg) { +proto.pulumirpc.InstallDependenciesRequest.toObject = function(includeInstance, msg) { var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - kind: jspb.Message.getFieldWithDefault(msg, 2, ""), - version: jspb.Message.getFieldWithDefault(msg, 3, ""), - server: jspb.Message.getFieldWithDefault(msg, 4, "") + directory: jspb.Message.getFieldWithDefault(msg, 1, ""), + isTerminal: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -24854,23 +24532,23 @@ proto.pulumirpc.PluginDependency.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.PluginDependency} + * @return {!proto.pulumirpc.InstallDependenciesRequest} */ -proto.pulumirpc.PluginDependency.deserializeBinary = function(bytes) { +proto.pulumirpc.InstallDependenciesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.PluginDependency; - return proto.pulumirpc.PluginDependency.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.InstallDependenciesRequest; + return proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.PluginDependency} msg The message object to deserialize into. + * @param {!proto.pulumirpc.InstallDependenciesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.PluginDependency} + * @return {!proto.pulumirpc.InstallDependenciesRequest} */ -proto.pulumirpc.PluginDependency.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -24879,19 +24557,11 @@ proto.pulumirpc.PluginDependency.deserializeBinaryFromReader = function(msg, rea switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setName(value); + msg.setDirectory(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKind(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setVersion(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setServer(value); + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsTerminal(value); break; default: reader.skipField(); @@ -24906,9 +24576,9 @@ proto.pulumirpc.PluginDependency.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.PluginDependency.prototype.serializeBinary = function() { +proto.pulumirpc.InstallDependenciesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.PluginDependency.serializeBinaryToWriter(this, writer); + proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -24916,112 +24586,62 @@ proto.pulumirpc.PluginDependency.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.PluginDependency} message + * @param {!proto.pulumirpc.InstallDependenciesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PluginDependency.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getName(); + f = message.getDirectory(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getKind(); - if (f.length > 0) { - writer.writeString( + f = message.getIsTerminal(); + if (f) { + writer.writeBool( 2, f ); } - f = message.getVersion(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getServer(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } }; /** - * optional string name = 1; + * optional string directory = 1; * @return {string} */ -proto.pulumirpc.PluginDependency.prototype.getName = function() { +proto.pulumirpc.InstallDependenciesRequest.prototype.getDirectory = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.pulumirpc.PluginDependency} returns this + * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this */ -proto.pulumirpc.PluginDependency.prototype.setName = function(value) { +proto.pulumirpc.InstallDependenciesRequest.prototype.setDirectory = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional string kind = 2; - * @return {string} - */ -proto.pulumirpc.PluginDependency.prototype.getKind = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.pulumirpc.PluginDependency} returns this - */ -proto.pulumirpc.PluginDependency.prototype.setKind = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string version = 3; - * @return {string} - */ -proto.pulumirpc.PluginDependency.prototype.getVersion = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.pulumirpc.PluginDependency} returns this - */ -proto.pulumirpc.PluginDependency.prototype.setVersion = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string server = 4; - * @return {string} + * optional bool is_terminal = 2; + * @return {boolean} */ -proto.pulumirpc.PluginDependency.prototype.getServer = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.pulumirpc.InstallDependenciesRequest.prototype.getIsTerminal = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** - * @param {string} value - * @return {!proto.pulumirpc.PluginDependency} returns this + * @param {boolean} value + * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this */ -proto.pulumirpc.PluginDependency.prototype.setServer = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); +proto.pulumirpc.InstallDependenciesRequest.prototype.setIsTerminal = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; @@ -25041,8 +24661,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.pulumirpc.PluginAttach.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.PluginAttach.toObject(opt_includeInstance, this); +proto.pulumirpc.InstallDependenciesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.InstallDependenciesResponse.toObject(opt_includeInstance, this); }; @@ -25051,13 +24671,14 @@ proto.pulumirpc.PluginAttach.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.pulumirpc.PluginAttach} msg The msg instance to transform. + * @param {!proto.pulumirpc.InstallDependenciesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PluginAttach.toObject = function(includeInstance, msg) { +proto.pulumirpc.InstallDependenciesResponse.toObject = function(includeInstance, msg) { var f, obj = { - address: jspb.Message.getFieldWithDefault(msg, 1, "") + stdout: msg.getStdout_asB64(), + stderr: msg.getStderr_asB64() }; if (includeInstance) { @@ -25071,23 +24692,23 @@ proto.pulumirpc.PluginAttach.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.PluginAttach} + * @return {!proto.pulumirpc.InstallDependenciesResponse} */ -proto.pulumirpc.PluginAttach.deserializeBinary = function(bytes) { +proto.pulumirpc.InstallDependenciesResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.PluginAttach; - return proto.pulumirpc.PluginAttach.deserializeBinaryFromReader(msg, reader); + var msg = new proto.pulumirpc.InstallDependenciesResponse; + return proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.pulumirpc.PluginAttach} msg The message object to deserialize into. + * @param {!proto.pulumirpc.InstallDependenciesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.PluginAttach} + * @return {!proto.pulumirpc.InstallDependenciesResponse} */ -proto.pulumirpc.PluginAttach.deserializeBinaryFromReader = function(msg, reader) { +proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -25095,8 +24716,12 @@ proto.pulumirpc.PluginAttach.deserializeBinaryFromReader = function(msg, reader) var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setAddress(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStdout(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStderr(value); break; default: reader.skipField(); @@ -25111,9 +24736,9 @@ proto.pulumirpc.PluginAttach.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.pulumirpc.PluginAttach.prototype.serializeBinary = function() { +proto.pulumirpc.InstallDependenciesResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.pulumirpc.PluginAttach.serializeBinaryToWriter(this, writer); + proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -25121,567 +24746,122 @@ proto.pulumirpc.PluginAttach.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.PluginAttach} message + * @param {!proto.pulumirpc.InstallDependenciesResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PluginAttach.serializeBinaryToWriter = function(message, writer) { +proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAddress(); + f = message.getStdout_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, f ); } + f = message.getStderr_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } }; /** - * optional string address = 1; - * @return {string} + * optional bytes stdout = 1; + * @return {!(string|Uint8Array)} */ -proto.pulumirpc.PluginAttach.prototype.getAddress = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.pulumirpc.PluginAttach} returns this + * optional bytes stdout = 1; + * This is a type-conversion wrapper around `getStdout()` + * @return {string} */ -proto.pulumirpc.PluginAttach.prototype.setAddress = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStdout())); }; -goog.object.extend(exports, proto.pulumirpc); - - -/***/ }), - -/***/ 18385: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -// GENERATED CODE -- DO NOT EDIT! - -// Original file comments: -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -var grpc = __nccwpck_require__(7025); -var pulumi_provider_pb = __nccwpck_require__(68870); -var pulumi_plugin_pb = __nccwpck_require__(38008); -var google_protobuf_empty_pb = __nccwpck_require__(40291); -var google_protobuf_struct_pb = __nccwpck_require__(68152); - -function serialize_google_protobuf_Empty(arg) { - if (!(arg instanceof google_protobuf_empty_pb.Empty)) { - throw new Error('Expected argument of type google.protobuf.Empty'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_google_protobuf_Empty(buffer_arg) { - return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_CallRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.CallRequest)) { - throw new Error('Expected argument of type pulumirpc.CallRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_CallRequest(buffer_arg) { - return pulumi_provider_pb.CallRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_CallResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.CallResponse)) { - throw new Error('Expected argument of type pulumirpc.CallResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_CallResponse(buffer_arg) { - return pulumi_provider_pb.CallResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_CheckRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.CheckRequest)) { - throw new Error('Expected argument of type pulumirpc.CheckRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_CheckRequest(buffer_arg) { - return pulumi_provider_pb.CheckRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_CheckResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.CheckResponse)) { - throw new Error('Expected argument of type pulumirpc.CheckResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_CheckResponse(buffer_arg) { - return pulumi_provider_pb.CheckResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_ConfigureRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.ConfigureRequest)) { - throw new Error('Expected argument of type pulumirpc.ConfigureRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_ConfigureRequest(buffer_arg) { - return pulumi_provider_pb.ConfigureRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_ConfigureResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.ConfigureResponse)) { - throw new Error('Expected argument of type pulumirpc.ConfigureResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_ConfigureResponse(buffer_arg) { - return pulumi_provider_pb.ConfigureResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_ConstructRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.ConstructRequest)) { - throw new Error('Expected argument of type pulumirpc.ConstructRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_ConstructRequest(buffer_arg) { - return pulumi_provider_pb.ConstructRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_ConstructResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.ConstructResponse)) { - throw new Error('Expected argument of type pulumirpc.ConstructResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_ConstructResponse(buffer_arg) { - return pulumi_provider_pb.ConstructResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_CreateRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.CreateRequest)) { - throw new Error('Expected argument of type pulumirpc.CreateRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_CreateRequest(buffer_arg) { - return pulumi_provider_pb.CreateRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_CreateResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.CreateResponse)) { - throw new Error('Expected argument of type pulumirpc.CreateResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_CreateResponse(buffer_arg) { - return pulumi_provider_pb.CreateResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_DeleteRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.DeleteRequest)) { - throw new Error('Expected argument of type pulumirpc.DeleteRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_DeleteRequest(buffer_arg) { - return pulumi_provider_pb.DeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_DiffRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.DiffRequest)) { - throw new Error('Expected argument of type pulumirpc.DiffRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_DiffRequest(buffer_arg) { - return pulumi_provider_pb.DiffRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_DiffResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.DiffResponse)) { - throw new Error('Expected argument of type pulumirpc.DiffResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_DiffResponse(buffer_arg) { - return pulumi_provider_pb.DiffResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_GetSchemaRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.GetSchemaRequest)) { - throw new Error('Expected argument of type pulumirpc.GetSchemaRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_GetSchemaRequest(buffer_arg) { - return pulumi_provider_pb.GetSchemaRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_GetSchemaResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.GetSchemaResponse)) { - throw new Error('Expected argument of type pulumirpc.GetSchemaResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_GetSchemaResponse(buffer_arg) { - return pulumi_provider_pb.GetSchemaResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_InvokeRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.InvokeRequest)) { - throw new Error('Expected argument of type pulumirpc.InvokeRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_InvokeRequest(buffer_arg) { - return pulumi_provider_pb.InvokeRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_InvokeResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.InvokeResponse)) { - throw new Error('Expected argument of type pulumirpc.InvokeResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_InvokeResponse(buffer_arg) { - return pulumi_provider_pb.InvokeResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_PluginAttach(arg) { - if (!(arg instanceof pulumi_plugin_pb.PluginAttach)) { - throw new Error('Expected argument of type pulumirpc.PluginAttach'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_PluginAttach(buffer_arg) { - return pulumi_plugin_pb.PluginAttach.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_pulumirpc_PluginInfo(arg) { - if (!(arg instanceof pulumi_plugin_pb.PluginInfo)) { - throw new Error('Expected argument of type pulumirpc.PluginInfo'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_pulumirpc_PluginInfo(buffer_arg) { - return pulumi_plugin_pb.PluginInfo.deserializeBinary(new Uint8Array(buffer_arg)); -} +/** + * optional bytes stdout = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStdout()` + * @return {!Uint8Array} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStdout())); +}; -function serialize_pulumirpc_ReadRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.ReadRequest)) { - throw new Error('Expected argument of type pulumirpc.ReadRequest'); - } - return Buffer.from(arg.serializeBinary()); -} -function deserialize_pulumirpc_ReadRequest(buffer_arg) { - return pulumi_provider_pb.ReadRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.InstallDependenciesResponse} returns this + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.setStdout = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; -function serialize_pulumirpc_ReadResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.ReadResponse)) { - throw new Error('Expected argument of type pulumirpc.ReadResponse'); - } - return Buffer.from(arg.serializeBinary()); -} -function deserialize_pulumirpc_ReadResponse(buffer_arg) { - return pulumi_provider_pb.ReadResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} +/** + * optional bytes stderr = 2; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; -function serialize_pulumirpc_UpdateRequest(arg) { - if (!(arg instanceof pulumi_provider_pb.UpdateRequest)) { - throw new Error('Expected argument of type pulumirpc.UpdateRequest'); - } - return Buffer.from(arg.serializeBinary()); -} -function deserialize_pulumirpc_UpdateRequest(buffer_arg) { - return pulumi_provider_pb.UpdateRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} +/** + * optional bytes stderr = 2; + * This is a type-conversion wrapper around `getStderr()` + * @return {string} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStderr())); +}; -function serialize_pulumirpc_UpdateResponse(arg) { - if (!(arg instanceof pulumi_provider_pb.UpdateResponse)) { - throw new Error('Expected argument of type pulumirpc.UpdateResponse'); - } - return Buffer.from(arg.serializeBinary()); -} -function deserialize_pulumirpc_UpdateResponse(buffer_arg) { - return pulumi_provider_pb.UpdateResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} +/** + * optional bytes stderr = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStderr()` + * @return {!Uint8Array} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStderr())); +}; -// ResourceProvider is a service that understands how to create, read, update, or delete resources for types defined -// within a single package. It is driven by the overall planning engine in response to resource diffs. -var ResourceProviderService = exports.ResourceProviderService = { - // GetSchema fetches the schema for this resource provider. -getSchema: { - path: '/pulumirpc.ResourceProvider/GetSchema', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.GetSchemaRequest, - responseType: pulumi_provider_pb.GetSchemaResponse, - requestSerialize: serialize_pulumirpc_GetSchemaRequest, - requestDeserialize: deserialize_pulumirpc_GetSchemaRequest, - responseSerialize: serialize_pulumirpc_GetSchemaResponse, - responseDeserialize: deserialize_pulumirpc_GetSchemaResponse, - }, - // CheckConfig validates the configuration for this resource provider. -checkConfig: { - path: '/pulumirpc.ResourceProvider/CheckConfig', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.CheckRequest, - responseType: pulumi_provider_pb.CheckResponse, - requestSerialize: serialize_pulumirpc_CheckRequest, - requestDeserialize: deserialize_pulumirpc_CheckRequest, - responseSerialize: serialize_pulumirpc_CheckResponse, - responseDeserialize: deserialize_pulumirpc_CheckResponse, - }, - // DiffConfig checks the impact a hypothetical change to this provider's configuration will have on the provider. -diffConfig: { - path: '/pulumirpc.ResourceProvider/DiffConfig', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.DiffRequest, - responseType: pulumi_provider_pb.DiffResponse, - requestSerialize: serialize_pulumirpc_DiffRequest, - requestDeserialize: deserialize_pulumirpc_DiffRequest, - responseSerialize: serialize_pulumirpc_DiffResponse, - responseDeserialize: deserialize_pulumirpc_DiffResponse, - }, - // Configure configures the resource provider with "globals" that control its behavior. -configure: { - path: '/pulumirpc.ResourceProvider/Configure', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.ConfigureRequest, - responseType: pulumi_provider_pb.ConfigureResponse, - requestSerialize: serialize_pulumirpc_ConfigureRequest, - requestDeserialize: deserialize_pulumirpc_ConfigureRequest, - responseSerialize: serialize_pulumirpc_ConfigureResponse, - responseDeserialize: deserialize_pulumirpc_ConfigureResponse, - }, - // Invoke dynamically executes a built-in function in the provider. -invoke: { - path: '/pulumirpc.ResourceProvider/Invoke', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.InvokeRequest, - responseType: pulumi_provider_pb.InvokeResponse, - requestSerialize: serialize_pulumirpc_InvokeRequest, - requestDeserialize: deserialize_pulumirpc_InvokeRequest, - responseSerialize: serialize_pulumirpc_InvokeResponse, - responseDeserialize: deserialize_pulumirpc_InvokeResponse, - }, - // StreamInvoke dynamically executes a built-in function in the provider, which returns a stream -// of responses. -streamInvoke: { - path: '/pulumirpc.ResourceProvider/StreamInvoke', - requestStream: false, - responseStream: true, - requestType: pulumi_provider_pb.InvokeRequest, - responseType: pulumi_provider_pb.InvokeResponse, - requestSerialize: serialize_pulumirpc_InvokeRequest, - requestDeserialize: deserialize_pulumirpc_InvokeRequest, - responseSerialize: serialize_pulumirpc_InvokeResponse, - responseDeserialize: deserialize_pulumirpc_InvokeResponse, - }, - // Call dynamically executes a method in the provider associated with a component resource. -call: { - path: '/pulumirpc.ResourceProvider/Call', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.CallRequest, - responseType: pulumi_provider_pb.CallResponse, - requestSerialize: serialize_pulumirpc_CallRequest, - requestDeserialize: deserialize_pulumirpc_CallRequest, - responseSerialize: serialize_pulumirpc_CallResponse, - responseDeserialize: deserialize_pulumirpc_CallResponse, - }, - // Check validates that the given property bag is valid for a resource of the given type and returns the inputs -// that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider -// inputs returned by a call to Check should preserve the original representation of the properties as present in -// the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact -// the end-user experience, as the provider inputs are using for detecting and rendering diffs. -check: { - path: '/pulumirpc.ResourceProvider/Check', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.CheckRequest, - responseType: pulumi_provider_pb.CheckResponse, - requestSerialize: serialize_pulumirpc_CheckRequest, - requestDeserialize: deserialize_pulumirpc_CheckRequest, - responseSerialize: serialize_pulumirpc_CheckResponse, - responseDeserialize: deserialize_pulumirpc_CheckResponse, - }, - // Diff checks what impacts a hypothetical update will have on the resource's properties. -diff: { - path: '/pulumirpc.ResourceProvider/Diff', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.DiffRequest, - responseType: pulumi_provider_pb.DiffResponse, - requestSerialize: serialize_pulumirpc_DiffRequest, - requestDeserialize: deserialize_pulumirpc_DiffRequest, - responseSerialize: serialize_pulumirpc_DiffResponse, - responseDeserialize: deserialize_pulumirpc_DiffResponse, - }, - // Create allocates a new instance of the provided resource and returns its unique ID afterwards. (The input ID -// must be blank.) If this call fails, the resource must not have been created (i.e., it is "transactional"). -create: { - path: '/pulumirpc.ResourceProvider/Create', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.CreateRequest, - responseType: pulumi_provider_pb.CreateResponse, - requestSerialize: serialize_pulumirpc_CreateRequest, - requestDeserialize: deserialize_pulumirpc_CreateRequest, - responseSerialize: serialize_pulumirpc_CreateResponse, - responseDeserialize: deserialize_pulumirpc_CreateResponse, - }, - // Read the current live state associated with a resource. Enough state must be include in the inputs to uniquely -// identify the resource; this is typically just the resource ID, but may also include some properties. -read: { - path: '/pulumirpc.ResourceProvider/Read', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.ReadRequest, - responseType: pulumi_provider_pb.ReadResponse, - requestSerialize: serialize_pulumirpc_ReadRequest, - requestDeserialize: deserialize_pulumirpc_ReadRequest, - responseSerialize: serialize_pulumirpc_ReadResponse, - responseDeserialize: deserialize_pulumirpc_ReadResponse, - }, - // Update updates an existing resource with new values. -update: { - path: '/pulumirpc.ResourceProvider/Update', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.UpdateRequest, - responseType: pulumi_provider_pb.UpdateResponse, - requestSerialize: serialize_pulumirpc_UpdateRequest, - requestDeserialize: deserialize_pulumirpc_UpdateRequest, - responseSerialize: serialize_pulumirpc_UpdateResponse, - responseDeserialize: deserialize_pulumirpc_UpdateResponse, - }, - // Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist. -delete: { - path: '/pulumirpc.ResourceProvider/Delete', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.DeleteRequest, - responseType: google_protobuf_empty_pb.Empty, - requestSerialize: serialize_pulumirpc_DeleteRequest, - requestDeserialize: deserialize_pulumirpc_DeleteRequest, - responseSerialize: serialize_google_protobuf_Empty, - responseDeserialize: deserialize_google_protobuf_Empty, - }, - // Construct creates a new instance of the provided component resource and returns its state. -construct: { - path: '/pulumirpc.ResourceProvider/Construct', - requestStream: false, - responseStream: false, - requestType: pulumi_provider_pb.ConstructRequest, - responseType: pulumi_provider_pb.ConstructResponse, - requestSerialize: serialize_pulumirpc_ConstructRequest, - requestDeserialize: deserialize_pulumirpc_ConstructRequest, - responseSerialize: serialize_pulumirpc_ConstructResponse, - responseDeserialize: deserialize_pulumirpc_ConstructResponse, - }, - // Cancel signals the provider to gracefully shut down and abort any ongoing resource operations. -// Operations aborted in this way will return an error (e.g., `Update` and `Create` will either return a -// creation error or an initialization error). Since Cancel is advisory and non-blocking, it is up -// to the host to decide how long to wait after Cancel is called before (e.g.) -// hard-closing any gRPC connection. -cancel: { - path: '/pulumirpc.ResourceProvider/Cancel', - requestStream: false, - responseStream: false, - requestType: google_protobuf_empty_pb.Empty, - responseType: google_protobuf_empty_pb.Empty, - requestSerialize: serialize_google_protobuf_Empty, - requestDeserialize: deserialize_google_protobuf_Empty, - responseSerialize: serialize_google_protobuf_Empty, - responseDeserialize: deserialize_google_protobuf_Empty, - }, - // GetPluginInfo returns generic information about this plugin, like its version. -getPluginInfo: { - path: '/pulumirpc.ResourceProvider/GetPluginInfo', - requestStream: false, - responseStream: false, - requestType: google_protobuf_empty_pb.Empty, - responseType: pulumi_plugin_pb.PluginInfo, - requestSerialize: serialize_google_protobuf_Empty, - requestDeserialize: deserialize_google_protobuf_Empty, - responseSerialize: serialize_pulumirpc_PluginInfo, - responseDeserialize: deserialize_pulumirpc_PluginInfo, - }, - // Attach sends the engine address to an already running plugin. -attach: { - path: '/pulumirpc.ResourceProvider/Attach', - requestStream: false, - responseStream: false, - requestType: pulumi_plugin_pb.PluginAttach, - responseType: google_protobuf_empty_pb.Empty, - requestSerialize: serialize_pulumirpc_PluginAttach, - requestDeserialize: deserialize_pulumirpc_PluginAttach, - responseSerialize: serialize_google_protobuf_Empty, - responseDeserialize: deserialize_google_protobuf_Empty, - }, +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.InstallDependenciesResponse} returns this + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.setStderr = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); }; -exports.ResourceProviderClient = grpc.makeGenericClientConstructor(ResourceProviderService); + +goog.object.extend(exports, proto.pulumirpc); /***/ }), -/***/ 68870: +/***/ 8008: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// source: pulumi/provider.proto +// source: pulumi/plugin.proto /** * @fileoverview * @enhanceable @@ -25694,48 +24874,13 @@ exports.ResourceProviderClient = grpc.makeGenericClientConstructor(ResourceProvi /* eslint-disable */ // @ts-nocheck -var jspb = __nccwpck_require__(69917); +var jspb = __nccwpck_require__(9917); var goog = jspb; var proto = { pulumirpc: {} }, global = proto; -var pulumi_plugin_pb = __nccwpck_require__(38008); -goog.object.extend(proto, pulumi_plugin_pb); -var google_protobuf_empty_pb = __nccwpck_require__(40291); -goog.object.extend(proto, google_protobuf_empty_pb); -var google_protobuf_struct_pb = __nccwpck_require__(68152); -goog.object.extend(proto, google_protobuf_struct_pb); -goog.exportSymbol('proto.pulumirpc.CallRequest', null, global); -goog.exportSymbol('proto.pulumirpc.CallRequest.ArgumentDependencies', null, global); -goog.exportSymbol('proto.pulumirpc.CallResponse', null, global); -goog.exportSymbol('proto.pulumirpc.CallResponse.ReturnDependencies', null, global); -goog.exportSymbol('proto.pulumirpc.CheckFailure', null, global); -goog.exportSymbol('proto.pulumirpc.CheckRequest', null, global); -goog.exportSymbol('proto.pulumirpc.CheckResponse', null, global); -goog.exportSymbol('proto.pulumirpc.ConfigureErrorMissingKeys', null, global); -goog.exportSymbol('proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey', null, global); -goog.exportSymbol('proto.pulumirpc.ConfigureRequest', null, global); -goog.exportSymbol('proto.pulumirpc.ConfigureResponse', null, global); -goog.exportSymbol('proto.pulumirpc.ConstructRequest', null, global); -goog.exportSymbol('proto.pulumirpc.ConstructRequest.PropertyDependencies', null, global); -goog.exportSymbol('proto.pulumirpc.ConstructResponse', null, global); -goog.exportSymbol('proto.pulumirpc.ConstructResponse.PropertyDependencies', null, global); -goog.exportSymbol('proto.pulumirpc.CreateRequest', null, global); -goog.exportSymbol('proto.pulumirpc.CreateResponse', null, global); -goog.exportSymbol('proto.pulumirpc.DeleteRequest', null, global); -goog.exportSymbol('proto.pulumirpc.DiffRequest', null, global); -goog.exportSymbol('proto.pulumirpc.DiffResponse', null, global); -goog.exportSymbol('proto.pulumirpc.DiffResponse.DiffChanges', null, global); -goog.exportSymbol('proto.pulumirpc.ErrorResourceInitFailed', null, global); -goog.exportSymbol('proto.pulumirpc.GetSchemaRequest', null, global); -goog.exportSymbol('proto.pulumirpc.GetSchemaResponse', null, global); -goog.exportSymbol('proto.pulumirpc.InvokeRequest', null, global); -goog.exportSymbol('proto.pulumirpc.InvokeResponse', null, global); -goog.exportSymbol('proto.pulumirpc.PropertyDiff', null, global); -goog.exportSymbol('proto.pulumirpc.PropertyDiff.Kind', null, global); -goog.exportSymbol('proto.pulumirpc.ReadRequest', null, global); -goog.exportSymbol('proto.pulumirpc.ReadResponse', null, global); -goog.exportSymbol('proto.pulumirpc.UpdateRequest', null, global); -goog.exportSymbol('proto.pulumirpc.UpdateResponse', null, global); +goog.exportSymbol('proto.pulumirpc.PluginAttach', null, global); +goog.exportSymbol('proto.pulumirpc.PluginDependency', null, global); +goog.exportSymbol('proto.pulumirpc.PluginInfo', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -25746,16 +24891,16 @@ goog.exportSymbol('proto.pulumirpc.UpdateResponse', null, global); * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.GetSchemaRequest = function(opt_data) { +proto.pulumirpc.PluginInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.GetSchemaRequest, jspb.Message); +goog.inherits(proto.pulumirpc.PluginInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.GetSchemaRequest.displayName = 'proto.pulumirpc.GetSchemaRequest'; + proto.pulumirpc.PluginInfo.displayName = 'proto.pulumirpc.PluginInfo'; } /** * Generated by JsPbCodeGenerator. @@ -25767,16 +24912,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.GetSchemaResponse = function(opt_data) { +proto.pulumirpc.PluginDependency = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.GetSchemaResponse, jspb.Message); +goog.inherits(proto.pulumirpc.PluginDependency, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.GetSchemaResponse.displayName = 'proto.pulumirpc.GetSchemaResponse'; + proto.pulumirpc.PluginDependency.displayName = 'proto.pulumirpc.PluginDependency'; } /** * Generated by JsPbCodeGenerator. @@ -25788,415 +24933,580 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.ConfigureRequest = function(opt_data) { +proto.pulumirpc.PluginAttach = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.ConfigureRequest, jspb.Message); +goog.inherits(proto.pulumirpc.PluginAttach, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ConfigureRequest.displayName = 'proto.pulumirpc.ConfigureRequest'; + proto.pulumirpc.PluginAttach.displayName = 'proto.pulumirpc.PluginAttach'; } + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.pulumirpc.ConfigureResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PluginInfo.toObject(opt_includeInstance, this); }; -goog.inherits(proto.pulumirpc.ConfigureResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.ConfigureResponse.displayName = 'proto.pulumirpc.ConfigureResponse'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pulumirpc.PluginInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.ConfigureErrorMissingKeys = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConfigureErrorMissingKeys.repeatedFields_, null); +proto.pulumirpc.PluginInfo.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; -goog.inherits(proto.pulumirpc.ConfigureErrorMissingKeys, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.ConfigureErrorMissingKeys.displayName = 'proto.pulumirpc.ConfigureErrorMissingKeys'; } + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pulumirpc.PluginInfo} */ -proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.PluginInfo; + return proto.pulumirpc.PluginInfo.deserializeBinaryFromReader(msg, reader); }; -goog.inherits(proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.displayName = 'proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.PluginInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.PluginInfo} */ -proto.pulumirpc.InvokeRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; -goog.inherits(proto.pulumirpc.InvokeRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.InvokeRequest.displayName = 'proto.pulumirpc.InvokeRequest'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.pulumirpc.InvokeResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.InvokeResponse.repeatedFields_, null); +proto.pulumirpc.PluginInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PluginInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; -goog.inherits(proto.pulumirpc.InvokeResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.InvokeResponse.displayName = 'proto.pulumirpc.InvokeResponse'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pulumirpc.PluginInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.CallRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallRequest.repeatedFields_, null); +proto.pulumirpc.PluginInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } }; -goog.inherits(proto.pulumirpc.CallRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CallRequest.displayName = 'proto.pulumirpc.CallRequest'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional string version = 1; + * @return {string} */ -proto.pulumirpc.CallRequest.ArgumentDependencies = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallRequest.ArgumentDependencies.repeatedFields_, null); +proto.pulumirpc.PluginInfo.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; -goog.inherits(proto.pulumirpc.CallRequest.ArgumentDependencies, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CallRequest.ArgumentDependencies.displayName = 'proto.pulumirpc.CallRequest.ArgumentDependencies'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {string} value + * @return {!proto.pulumirpc.PluginInfo} returns this */ -proto.pulumirpc.CallResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallResponse.repeatedFields_, null); +proto.pulumirpc.PluginInfo.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; -goog.inherits(proto.pulumirpc.CallResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CallResponse.displayName = 'proto.pulumirpc.CallResponse'; -} + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.pulumirpc.CallResponse.ReturnDependencies = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallResponse.ReturnDependencies.repeatedFields_, null); +proto.pulumirpc.PluginDependency.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PluginDependency.toObject(opt_includeInstance, this); }; -goog.inherits(proto.pulumirpc.CallResponse.ReturnDependencies, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CallResponse.ReturnDependencies.displayName = 'proto.pulumirpc.CallResponse.ReturnDependencies'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pulumirpc.PluginDependency} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.CheckRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginDependency.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + kind: jspb.Message.getFieldWithDefault(msg, 2, ""), + version: jspb.Message.getFieldWithDefault(msg, 3, ""), + server: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; -goog.inherits(proto.pulumirpc.CheckRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CheckRequest.displayName = 'proto.pulumirpc.CheckRequest'; } + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pulumirpc.PluginDependency} */ -proto.pulumirpc.CheckResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CheckResponse.repeatedFields_, null); +proto.pulumirpc.PluginDependency.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.PluginDependency; + return proto.pulumirpc.PluginDependency.deserializeBinaryFromReader(msg, reader); }; -goog.inherits(proto.pulumirpc.CheckResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CheckResponse.displayName = 'proto.pulumirpc.CheckResponse'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.PluginDependency} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.PluginDependency} */ -proto.pulumirpc.CheckFailure = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginDependency.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKind(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setServer(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; -goog.inherits(proto.pulumirpc.CheckFailure, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CheckFailure.displayName = 'proto.pulumirpc.CheckFailure'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.pulumirpc.DiffRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.DiffRequest.repeatedFields_, null); +proto.pulumirpc.PluginDependency.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PluginDependency.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; -goog.inherits(proto.pulumirpc.DiffRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.DiffRequest.displayName = 'proto.pulumirpc.DiffRequest'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pulumirpc.PluginDependency} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.pulumirpc.PropertyDiff = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginDependency.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKind(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getServer(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } }; -goog.inherits(proto.pulumirpc.PropertyDiff, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.PropertyDiff.displayName = 'proto.pulumirpc.PropertyDiff'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional string name = 1; + * @return {string} */ -proto.pulumirpc.DiffResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.DiffResponse.repeatedFields_, null); +proto.pulumirpc.PluginDependency.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; -goog.inherits(proto.pulumirpc.DiffResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.DiffResponse.displayName = 'proto.pulumirpc.DiffResponse'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {string} value + * @return {!proto.pulumirpc.PluginDependency} returns this */ -proto.pulumirpc.CreateRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginDependency.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; -goog.inherits(proto.pulumirpc.CreateRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CreateRequest.displayName = 'proto.pulumirpc.CreateRequest'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional string kind = 2; + * @return {string} */ -proto.pulumirpc.CreateResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginDependency.prototype.getKind = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; -goog.inherits(proto.pulumirpc.CreateResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.CreateResponse.displayName = 'proto.pulumirpc.CreateResponse'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {string} value + * @return {!proto.pulumirpc.PluginDependency} returns this */ -proto.pulumirpc.ReadRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.pulumirpc.PluginDependency.prototype.setKind = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; -goog.inherits(proto.pulumirpc.ReadRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.pulumirpc.ReadRequest.displayName = 'proto.pulumirpc.ReadRequest'; -} + + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional string version = 3; + * @return {string} */ -proto.pulumirpc.ReadResponse = function(opt_data) { +proto.pulumirpc.PluginDependency.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PluginDependency} returns this + */ +proto.pulumirpc.PluginDependency.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string server = 4; + * @return {string} + */ +proto.pulumirpc.PluginDependency.prototype.getServer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PluginDependency} returns this + */ +proto.pulumirpc.PluginDependency.prototype.setServer = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.pulumirpc.PluginAttach.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PluginAttach.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pulumirpc.PluginAttach} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PluginAttach.toObject = function(includeInstance, msg) { + var f, obj = { + address: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pulumirpc.PluginAttach} + */ +proto.pulumirpc.PluginAttach.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.PluginAttach; + return proto.pulumirpc.PluginAttach.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.PluginAttach} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.PluginAttach} + */ +proto.pulumirpc.PluginAttach.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.PluginAttach.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PluginAttach.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pulumirpc.PluginAttach} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PluginAttach.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string address = 1; + * @return {string} + */ +proto.pulumirpc.PluginAttach.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PluginAttach} returns this + */ +proto.pulumirpc.PluginAttach.prototype.setAddress = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 8870: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/provider.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = __nccwpck_require__(9917); +var goog = jspb; +var proto = { pulumirpc: {} }, global = proto; + +var pulumi_plugin_pb = __nccwpck_require__(8008); +goog.object.extend(proto, pulumi_plugin_pb); +var google_protobuf_empty_pb = __nccwpck_require__(291); +goog.object.extend(proto, google_protobuf_empty_pb); +var google_protobuf_struct_pb = __nccwpck_require__(8152); +goog.object.extend(proto, google_protobuf_struct_pb); +goog.exportSymbol('proto.pulumirpc.CallRequest', null, global); +goog.exportSymbol('proto.pulumirpc.CallRequest.ArgumentDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.CallResponse', null, global); +goog.exportSymbol('proto.pulumirpc.CallResponse.ReturnDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.CheckFailure', null, global); +goog.exportSymbol('proto.pulumirpc.CheckRequest', null, global); +goog.exportSymbol('proto.pulumirpc.CheckResponse', null, global); +goog.exportSymbol('proto.pulumirpc.ConfigureErrorMissingKeys', null, global); +goog.exportSymbol('proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey', null, global); +goog.exportSymbol('proto.pulumirpc.ConfigureRequest', null, global); +goog.exportSymbol('proto.pulumirpc.ConfigureResponse', null, global); +goog.exportSymbol('proto.pulumirpc.ConstructRequest', null, global); +goog.exportSymbol('proto.pulumirpc.ConstructRequest.PropertyDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.ConstructResponse', null, global); +goog.exportSymbol('proto.pulumirpc.ConstructResponse.PropertyDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.CreateRequest', null, global); +goog.exportSymbol('proto.pulumirpc.CreateResponse', null, global); +goog.exportSymbol('proto.pulumirpc.DeleteRequest', null, global); +goog.exportSymbol('proto.pulumirpc.DiffRequest', null, global); +goog.exportSymbol('proto.pulumirpc.DiffResponse', null, global); +goog.exportSymbol('proto.pulumirpc.DiffResponse.DiffChanges', null, global); +goog.exportSymbol('proto.pulumirpc.ErrorResourceInitFailed', null, global); +goog.exportSymbol('proto.pulumirpc.GetSchemaRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GetSchemaResponse', null, global); +goog.exportSymbol('proto.pulumirpc.InvokeRequest', null, global); +goog.exportSymbol('proto.pulumirpc.InvokeResponse', null, global); +goog.exportSymbol('proto.pulumirpc.PropertyDiff', null, global); +goog.exportSymbol('proto.pulumirpc.PropertyDiff.Kind', null, global); +goog.exportSymbol('proto.pulumirpc.ReadRequest', null, global); +goog.exportSymbol('proto.pulumirpc.ReadResponse', null, global); +goog.exportSymbol('proto.pulumirpc.UpdateRequest', null, global); +goog.exportSymbol('proto.pulumirpc.UpdateResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.GetSchemaRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.ReadResponse, jspb.Message); +goog.inherits(proto.pulumirpc.GetSchemaRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ReadResponse.displayName = 'proto.pulumirpc.ReadResponse'; + proto.pulumirpc.GetSchemaRequest.displayName = 'proto.pulumirpc.GetSchemaRequest'; } /** * Generated by JsPbCodeGenerator. @@ -26208,16 +25518,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.UpdateRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.UpdateRequest.repeatedFields_, null); +proto.pulumirpc.GetSchemaResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.UpdateRequest, jspb.Message); +goog.inherits(proto.pulumirpc.GetSchemaResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.UpdateRequest.displayName = 'proto.pulumirpc.UpdateRequest'; + proto.pulumirpc.GetSchemaResponse.displayName = 'proto.pulumirpc.GetSchemaResponse'; } /** * Generated by JsPbCodeGenerator. @@ -26229,16 +25539,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.UpdateResponse = function(opt_data) { +proto.pulumirpc.ConfigureRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.UpdateResponse, jspb.Message); +goog.inherits(proto.pulumirpc.ConfigureRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.UpdateResponse.displayName = 'proto.pulumirpc.UpdateResponse'; + proto.pulumirpc.ConfigureRequest.displayName = 'proto.pulumirpc.ConfigureRequest'; } /** * Generated by JsPbCodeGenerator. @@ -26250,16 +25560,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.DeleteRequest = function(opt_data) { +proto.pulumirpc.ConfigureResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.DeleteRequest, jspb.Message); +goog.inherits(proto.pulumirpc.ConfigureResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.DeleteRequest.displayName = 'proto.pulumirpc.DeleteRequest'; + proto.pulumirpc.ConfigureResponse.displayName = 'proto.pulumirpc.ConfigureResponse'; } /** * Generated by JsPbCodeGenerator. @@ -26271,16 +25581,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.ConstructRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConstructRequest.repeatedFields_, null); +proto.pulumirpc.ConfigureErrorMissingKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConfigureErrorMissingKeys.repeatedFields_, null); }; -goog.inherits(proto.pulumirpc.ConstructRequest, jspb.Message); +goog.inherits(proto.pulumirpc.ConfigureErrorMissingKeys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ConstructRequest.displayName = 'proto.pulumirpc.ConstructRequest'; + proto.pulumirpc.ConfigureErrorMissingKeys.displayName = 'proto.pulumirpc.ConfigureErrorMissingKeys'; } /** * Generated by JsPbCodeGenerator. @@ -26292,16 +25602,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.ConstructRequest.PropertyDependencies = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConstructRequest.PropertyDependencies.repeatedFields_, null); +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.ConstructRequest.PropertyDependencies, jspb.Message); +goog.inherits(proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ConstructRequest.PropertyDependencies.displayName = 'proto.pulumirpc.ConstructRequest.PropertyDependencies'; + proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.displayName = 'proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey'; } /** * Generated by JsPbCodeGenerator. @@ -26313,16 +25623,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.ConstructResponse = function(opt_data) { +proto.pulumirpc.InvokeRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.pulumirpc.ConstructResponse, jspb.Message); +goog.inherits(proto.pulumirpc.InvokeRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ConstructResponse.displayName = 'proto.pulumirpc.ConstructResponse'; + proto.pulumirpc.InvokeRequest.displayName = 'proto.pulumirpc.InvokeRequest'; } /** * Generated by JsPbCodeGenerator. @@ -26334,16 +25644,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.ConstructResponse.PropertyDependencies = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConstructResponse.PropertyDependencies.repeatedFields_, null); +proto.pulumirpc.InvokeResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.InvokeResponse.repeatedFields_, null); }; -goog.inherits(proto.pulumirpc.ConstructResponse.PropertyDependencies, jspb.Message); +goog.inherits(proto.pulumirpc.InvokeResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ConstructResponse.PropertyDependencies.displayName = 'proto.pulumirpc.ConstructResponse.PropertyDependencies'; + proto.pulumirpc.InvokeResponse.displayName = 'proto.pulumirpc.InvokeResponse'; } /** * Generated by JsPbCodeGenerator. @@ -26355,141 +25665,582 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.pulumirpc.ErrorResourceInitFailed = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ErrorResourceInitFailed.repeatedFields_, null); +proto.pulumirpc.CallRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallRequest.repeatedFields_, null); }; -goog.inherits(proto.pulumirpc.ErrorResourceInitFailed, jspb.Message); +goog.inherits(proto.pulumirpc.CallRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.pulumirpc.ErrorResourceInitFailed.displayName = 'proto.pulumirpc.ErrorResourceInitFailed'; + proto.pulumirpc.CallRequest.displayName = 'proto.pulumirpc.CallRequest'; } - - - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.prototype.toObject = function(opt_includeInstance) { - return proto.pulumirpc.GetSchemaRequest.toObject(opt_includeInstance, this); +proto.pulumirpc.CallRequest.ArgumentDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallRequest.ArgumentDependencies.repeatedFields_, null); }; - - +goog.inherits(proto.pulumirpc.CallRequest.ArgumentDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CallRequest.ArgumentDependencies.displayName = 'proto.pulumirpc.CallRequest.ArgumentDependencies'; +} /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.pulumirpc.GetSchemaRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.toObject = function(includeInstance, msg) { - var f, obj = { - version: jspb.Message.getFieldWithDefault(msg, 1, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.pulumirpc.CallResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallResponse.repeatedFields_, null); }; +goog.inherits(proto.pulumirpc.CallResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CallResponse.displayName = 'proto.pulumirpc.CallResponse'; } - - /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.pulumirpc.GetSchemaRequest} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.pulumirpc.GetSchemaRequest; - return proto.pulumirpc.GetSchemaRequest.deserializeBinaryFromReader(msg, reader); +proto.pulumirpc.CallResponse.ReturnDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallResponse.ReturnDependencies.repeatedFields_, null); }; - - +goog.inherits(proto.pulumirpc.CallResponse.ReturnDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CallResponse.ReturnDependencies.displayName = 'proto.pulumirpc.CallResponse.ReturnDependencies'; +} /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.pulumirpc.GetSchemaRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.pulumirpc.GetSchemaRequest} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setVersion(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.pulumirpc.CheckRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.pulumirpc.CheckRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CheckRequest.displayName = 'proto.pulumirpc.CheckRequest'; +} /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.pulumirpc.GetSchemaRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.pulumirpc.CheckResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CheckResponse.repeatedFields_, null); }; - - +goog.inherits(proto.pulumirpc.CheckResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CheckResponse.displayName = 'proto.pulumirpc.CheckResponse'; +} /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.pulumirpc.GetSchemaRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVersion(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } +proto.pulumirpc.CheckFailure = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.pulumirpc.CheckFailure, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CheckFailure.displayName = 'proto.pulumirpc.CheckFailure'; +} /** - * optional int32 version = 1; - * @return {number} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.pulumirpc.GetSchemaRequest.prototype.getVersion = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.pulumirpc.DiffRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.DiffRequest.repeatedFields_, null); }; - - -/** - * @param {number} value - * @return {!proto.pulumirpc.GetSchemaRequest} returns this +goog.inherits(proto.pulumirpc.DiffRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.DiffRequest.displayName = 'proto.pulumirpc.DiffRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.PropertyDiff = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.PropertyDiff, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.PropertyDiff.displayName = 'proto.pulumirpc.PropertyDiff'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.DiffResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.DiffResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.DiffResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.DiffResponse.displayName = 'proto.pulumirpc.DiffResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.CreateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.CreateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CreateRequest.displayName = 'proto.pulumirpc.CreateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.CreateResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.CreateResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CreateResponse.displayName = 'proto.pulumirpc.CreateResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ReadRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ReadRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ReadRequest.displayName = 'proto.pulumirpc.ReadRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ReadResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ReadResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ReadResponse.displayName = 'proto.pulumirpc.ReadResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.UpdateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.UpdateRequest.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.UpdateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.UpdateRequest.displayName = 'proto.pulumirpc.UpdateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.UpdateResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.UpdateResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.UpdateResponse.displayName = 'proto.pulumirpc.UpdateResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.DeleteRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.DeleteRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.DeleteRequest.displayName = 'proto.pulumirpc.DeleteRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ConstructRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConstructRequest.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ConstructRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ConstructRequest.displayName = 'proto.pulumirpc.ConstructRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConstructRequest.PropertyDependencies.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ConstructRequest.PropertyDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ConstructRequest.PropertyDependencies.displayName = 'proto.pulumirpc.ConstructRequest.PropertyDependencies'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ConstructResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ConstructResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ConstructResponse.displayName = 'proto.pulumirpc.ConstructResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConstructResponse.PropertyDependencies.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ConstructResponse.PropertyDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ConstructResponse.PropertyDependencies.displayName = 'proto.pulumirpc.ConstructResponse.PropertyDependencies'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pulumirpc.ErrorResourceInitFailed = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ErrorResourceInitFailed.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ErrorResourceInitFailed, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ErrorResourceInitFailed.displayName = 'proto.pulumirpc.ErrorResourceInitFailed'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.pulumirpc.GetSchemaRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetSchemaRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pulumirpc.GetSchemaRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetSchemaRequest.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pulumirpc.GetSchemaRequest} + */ +proto.pulumirpc.GetSchemaRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetSchemaRequest; + return proto.pulumirpc.GetSchemaRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetSchemaRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetSchemaRequest} + */ +proto.pulumirpc.GetSchemaRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetSchemaRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetSchemaRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pulumirpc.GetSchemaRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetSchemaRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 version = 1; + * @return {number} + */ +proto.pulumirpc.GetSchemaRequest.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.GetSchemaRequest} returns this */ proto.pulumirpc.GetSchemaRequest.prototype.setVersion = function(value) { return jspb.Message.setProto3IntField(this, 1, value); @@ -28936,7 +28687,7 @@ proto.pulumirpc.CheckRequest.toObject = function(includeInstance, msg) { urn: jspb.Message.getFieldWithDefault(msg, 1, ""), olds: (f = msg.getOlds()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), news: (f = msg.getNews()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), - sequencenumber: jspb.Message.getFieldWithDefault(msg, 4, 0) + randomseed: msg.getRandomseed_asB64() }; if (includeInstance) { @@ -28987,9 +28738,9 @@ proto.pulumirpc.CheckRequest.deserializeBinaryFromReader = function(msg, reader) reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); msg.setNews(value); break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setSequencenumber(value); + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRandomseed(value); break; default: reader.skipField(); @@ -29043,10 +28794,10 @@ proto.pulumirpc.CheckRequest.serializeBinaryToWriter = function(message, writer) google_protobuf_struct_pb.Struct.serializeBinaryToWriter ); } - f = message.getSequencenumber(); - if (f !== 0) { - writer.writeInt32( - 4, + f = message.getRandomseed_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, f ); } @@ -29146,20 +28897,44 @@ proto.pulumirpc.CheckRequest.prototype.hasNews = function() { /** - * optional int32 sequenceNumber = 4; - * @return {number} + * optional bytes randomSeed = 5; + * @return {!(string|Uint8Array)} */ -proto.pulumirpc.CheckRequest.prototype.getSequencenumber = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.pulumirpc.CheckRequest.prototype.getRandomseed = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** - * @param {number} value + * optional bytes randomSeed = 5; + * This is a type-conversion wrapper around `getRandomseed()` + * @return {string} + */ +proto.pulumirpc.CheckRequest.prototype.getRandomseed_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getRandomseed())); +}; + + +/** + * optional bytes randomSeed = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getRandomseed()` + * @return {!Uint8Array} + */ +proto.pulumirpc.CheckRequest.prototype.getRandomseed_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getRandomseed())); +}; + + +/** + * @param {!(string|Uint8Array)} value * @return {!proto.pulumirpc.CheckRequest} returns this */ -proto.pulumirpc.CheckRequest.prototype.setSequencenumber = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.pulumirpc.CheckRequest.prototype.setRandomseed = function(value) { + return jspb.Message.setProto3BytesField(this, 5, value); }; @@ -33589,7 +33364,7 @@ goog.object.extend(exports, proto.pulumirpc); /***/ }), -/***/ 25815: +/***/ 5815: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -33612,10 +33387,10 @@ goog.object.extend(exports, proto.pulumirpc); // var grpc = __nccwpck_require__(7025); -var pulumi_resource_pb = __nccwpck_require__(52480); -var google_protobuf_empty_pb = __nccwpck_require__(40291); -var google_protobuf_struct_pb = __nccwpck_require__(68152); -var pulumi_provider_pb = __nccwpck_require__(68870); +var pulumi_resource_pb = __nccwpck_require__(2480); +var google_protobuf_empty_pb = __nccwpck_require__(291); +var google_protobuf_struct_pb = __nccwpck_require__(8152); +var pulumi_provider_pb = __nccwpck_require__(8870); function serialize_google_protobuf_Empty(arg) { if (!(arg instanceof google_protobuf_empty_pb.Empty)) { @@ -33836,7 +33611,7 @@ exports.ResourceMonitorClient = grpc.makeGenericClientConstructor(ResourceMonito /***/ }), -/***/ 52480: +/***/ 2480: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { // source: pulumi/resource.proto @@ -33852,15 +33627,15 @@ exports.ResourceMonitorClient = grpc.makeGenericClientConstructor(ResourceMonito /* eslint-disable */ // @ts-nocheck -var jspb = __nccwpck_require__(69917); +var jspb = __nccwpck_require__(9917); var goog = jspb; var proto = { pulumirpc: {} }, global = proto; -var google_protobuf_empty_pb = __nccwpck_require__(40291); +var google_protobuf_empty_pb = __nccwpck_require__(291); goog.object.extend(proto, google_protobuf_empty_pb); -var google_protobuf_struct_pb = __nccwpck_require__(68152); +var google_protobuf_struct_pb = __nccwpck_require__(8152); goog.object.extend(proto, google_protobuf_struct_pb); -var pulumi_provider_pb = __nccwpck_require__(68870); +var pulumi_provider_pb = __nccwpck_require__(8870); goog.object.extend(proto, pulumi_provider_pb); goog.exportSymbol('proto.pulumirpc.ReadResourceRequest', null, global); goog.exportSymbol('proto.pulumirpc.ReadResourceResponse', null, global); @@ -37439,364 +37214,12 @@ goog.object.extend(exports, proto.pulumirpc); /***/ }), -/***/ 43690: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -// source: google/protobuf/status.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = __nccwpck_require__(69917); -var goog = jspb; -var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); - -var google_protobuf_any_pb = __nccwpck_require__(66432); -goog.object.extend(proto, google_protobuf_any_pb); -goog.exportSymbol('proto.google.rpc.Status', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.google.rpc.Status = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.google.rpc.Status.repeatedFields_, null); -}; -goog.inherits(proto.google.rpc.Status, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.google.rpc.Status.displayName = 'proto.google.rpc.Status'; -} - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.google.rpc.Status.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.google.rpc.Status.prototype.toObject = function(opt_includeInstance) { - return proto.google.rpc.Status.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.google.rpc.Status} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.rpc.Status.toObject = function(includeInstance, msg) { - var f, obj = { - code: jspb.Message.getFieldWithDefault(msg, 1, 0), - message: jspb.Message.getFieldWithDefault(msg, 2, ""), - detailsList: jspb.Message.toObjectList(msg.getDetailsList(), - google_protobuf_any_pb.Any.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.google.rpc.Status} - */ -proto.google.rpc.Status.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.google.rpc.Status; - return proto.google.rpc.Status.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.google.rpc.Status} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.google.rpc.Status} - */ -proto.google.rpc.Status.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setCode(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - case 3: - var value = new google_protobuf_any_pb.Any; - reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); - msg.addDetails(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.google.rpc.Status.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.google.rpc.Status.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.google.rpc.Status} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.rpc.Status.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCode(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDetailsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - google_protobuf_any_pb.Any.serializeBinaryToWriter - ); - } -}; - - -/** - * optional int32 code = 1; - * @return {number} - */ -proto.google.rpc.Status.prototype.getCode = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.google.rpc.Status} returns this - */ -proto.google.rpc.Status.prototype.setCode = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string message = 2; - * @return {string} - */ -proto.google.rpc.Status.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.rpc.Status} returns this - */ -proto.google.rpc.Status.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated google.protobuf.Any details = 3; - * @return {!Array} - */ -proto.google.rpc.Status.prototype.getDetailsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.google.rpc.Status} returns this -*/ -proto.google.rpc.Status.prototype.setDetailsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.google.protobuf.Any=} opt_value - * @param {number=} opt_index - * @return {!proto.google.protobuf.Any} - */ -proto.google.rpc.Status.prototype.addDetails = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Any, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.google.rpc.Status} returns this - */ -proto.google.rpc.Status.prototype.clearDetailsList = function() { - return this.setDetailsList([]); -}; - - -goog.object.extend(exports, proto.google.rpc); - - -/***/ }), - -/***/ 10142: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2020, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", ({ value: true })); -__export(__nccwpck_require__(61188)); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 1795: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// Copyright 2016-2021, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -// Functionality exported for unit testing. -// The parsing here is approximate for the moment. -// -// When Pulumi CLI decides how to structure command line arguments for -// plugins that will be parsed with this function, it uses the -// following code: -// -// https://github.com/pulumi/pulumi/blob/master/sdk/go/common/resource/plugin/plugin.go#L281 -// -// The code can prepend `--logtostderr` and verbosity e.g. `-v=9` -// arguments. We ignore these for the moment. -function parseArgs(args) { - const cleanArgs = []; - for (let i = 0; i < args.length; i++) { - const v = args[i]; - if (v === "--logtostderr") { - continue; - } - if (v.startsWith("-v=")) { - continue; - } - if (v === "--tracing") { - i += 1; - continue; - } - cleanArgs.push(v); - } - if (cleanArgs.length === 0) { - return undefined; - } - return { engineAddress: cleanArgs[0] }; -} -exports.parseArgs = parseArgs; -//# sourceMappingURL=internals.js.map - -/***/ }), - -/***/ 61188: +/***/ 796: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2020, Pulumi Corporation. +// Copyright 2016-2018, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37819,655 +37242,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const grpc = __nccwpck_require__(7025); -const log = __nccwpck_require__(80642); -const output_1 = __nccwpck_require__(43037); -const resource = __nccwpck_require__(90796); -const runtime = __nccwpck_require__(85022); -const internals_1 = __nccwpck_require__(1795); -const anyproto = __nccwpck_require__(66432); -const emptyproto = __nccwpck_require__(40291); -const structproto = __nccwpck_require__(68152); -const provproto = __nccwpck_require__(68870); -const provrpc = __nccwpck_require__(18385); -const plugproto = __nccwpck_require__(38008); -const statusproto = __nccwpck_require__(43690); -class Server { - constructor(engineAddr, provider, uncaughtErrors) { - /** Queue of construct calls. */ - this.constructCallQueue = Promise.resolve(); - this.engineAddr = engineAddr; - this.provider = provider; - this.uncaughtErrors = uncaughtErrors; - } - // Misc. methods - cancel(call, callback) { - callback(undefined, new emptyproto.Empty()); - } - attach(call, callback) { - const req = call.request; - const host = req.getAddress(); - this.engineAddr = host; - callback(undefined, new emptyproto.Empty()); - } - getPluginInfo(call, callback) { - const resp = new plugproto.PluginInfo(); - resp.setVersion(this.provider.version); - callback(undefined, resp); - } - getSchema(call, callback) { - const req = call.request; - if (req.getVersion() !== 0) { - callback(new Error(`unsupported schema version ${req.getVersion()}`), undefined); - } - const resp = new provproto.GetSchemaResponse(); - resp.setSchema(this.provider.schema || "{}"); - callback(undefined, resp); - } - // Config methods - checkConfig(call, callback) { - callback({ - code: grpc.status.UNIMPLEMENTED, - details: "Not yet implemented: CheckConfig", - }, undefined); - } - diffConfig(call, callback) { - callback({ - code: grpc.status.UNIMPLEMENTED, - details: "Not yet implemented: DiffConfig", - }, undefined); - } - configure(call, callback) { - const resp = new provproto.ConfigureResponse(); - resp.setAcceptsecrets(true); - resp.setAcceptresources(true); - resp.setAcceptoutputs(true); - callback(undefined, resp); - } - // CRUD resource methods - check(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - const resp = new provproto.CheckResponse(); - const olds = req.getOlds().toJavaScript(); - const news = req.getNews().toJavaScript(); - let inputs = news; - let failures = []; - if (this.provider.check) { - const result = yield this.provider.check(req.getUrn(), olds, news); - if (result.inputs) { - inputs = result.inputs; - } - if (result.failures) { - failures = result.failures; - } - } - else { - // If no check method was provided, propagate the new inputs as-is. - inputs = news; - } - resp.setInputs(structproto.Struct.fromJavaScript(inputs)); - if (failures.length !== 0) { - const failureList = []; - for (const f of failures) { - const failure = new provproto.CheckFailure(); - failure.setProperty(f.property); - failure.setReason(f.reason); - failureList.push(failure); - } - resp.setFailuresList(failureList); - } - callback(undefined, resp); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - }); - } - diff(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - const resp = new provproto.DiffResponse(); - const olds = req.getOlds().toJavaScript(); - const news = req.getNews().toJavaScript(); - if (this.provider.diff) { - const result = yield this.provider.diff(req.getId(), req.getUrn(), olds, news); - if (result.changes === true) { - resp.setChanges(provproto.DiffResponse.DiffChanges.DIFF_SOME); - } - else if (result.changes === false) { - resp.setChanges(provproto.DiffResponse.DiffChanges.DIFF_NONE); - } - else { - resp.setChanges(provproto.DiffResponse.DiffChanges.DIFF_UNKNOWN); - } - if (result.replaces && result.replaces.length !== 0) { - resp.setReplacesList(result.replaces); - } - if (result.deleteBeforeReplace) { - resp.setDeletebeforereplace(result.deleteBeforeReplace); - } - } - callback(undefined, resp); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - }); - } - create(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - if (!this.provider.create) { - callback(new Error(`unknown resource type ${req.getUrn()}`), undefined); - return; - } - const resp = new provproto.CreateResponse(); - const props = req.getProperties().toJavaScript(); - const result = yield this.provider.create(req.getUrn(), props); - resp.setId(result.id); - resp.setProperties(structproto.Struct.fromJavaScript(result.outs)); - callback(undefined, resp); - } - catch (e) { - const response = grpcResponseFromError(e); - return callback(/*err:*/ response, /*value:*/ null, /*metadata:*/ response.metadata); - } - }); - } - read(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - const resp = new provproto.ReadResponse(); - const id = req.getId(); - const props = req.getProperties().toJavaScript(); - if (this.provider.read) { - const result = yield this.provider.read(id, req.getUrn(), props); - resp.setId(result.id); - resp.setProperties(structproto.Struct.fromJavaScript(result.props)); - } - else { - // In the event of a missing read, simply return back the input state. - resp.setId(id); - resp.setProperties(req.getProperties()); - } - callback(undefined, resp); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - }); - } - update(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - const resp = new provproto.UpdateResponse(); - const olds = req.getOlds().toJavaScript(); - const news = req.getNews().toJavaScript(); - let result = {}; - if (this.provider.update) { - result = (yield this.provider.update(req.getId(), req.getUrn(), olds, news)) || {}; - } - resp.setProperties(structproto.Struct.fromJavaScript(result.outs)); - callback(undefined, resp); - } - catch (e) { - const response = grpcResponseFromError(e); - return callback(/*err:*/ response, /*value:*/ null, /*metadata:*/ response.metadata); - } - }); - } - delete(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - const props = req.getProperties().toJavaScript(); - if (this.provider.delete) { - yield this.provider.delete(req.getId(), req.getUrn(), props); - } - callback(undefined, new emptyproto.Empty()); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - }); - } - construct(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - // Serialize invocations of `construct` and `call` so that each call runs one after another, avoiding concurrent - // runs. We do this because `construct` and `call` modify global state to reset the SDK's runtime options. - // This is a short-term workaround to provide correctness, but likely isn't sustainable long-term due to the - // limits it places on parallelism. We will likely want to investigate if it's possible to run each invocation - // in its own context, possibly using Node's `createContext` API to avoid modifying global state: - // https://nodejs.org/api/vm.html#vm_vm_createcontext_contextobject_options - const res = this.constructCallQueue.then(() => this.constructImpl(call, callback)); - /* eslint-disable no-empty,no-empty-function,@typescript-eslint/no-empty-function */ - this.constructCallQueue = res.catch(() => { }); - return res; - }); - } - constructImpl(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - // given that construct calls are serialized, we can attach an uncaught handler to pick up exceptions - // in underlying user code. When we catch the error, we need to respond to the gRPC request with the error - // to avoid a hang. - const uncaughtHandler = (err) => { - if (!this.uncaughtErrors.has(err)) { - this.uncaughtErrors.add(err); - } - // bubble the uncaught error in the user code back and terminate the outstanding gRPC request. - callback(err, undefined); - }; - process.on("uncaughtException", uncaughtHandler); - // @ts-ignore 'unhandledRejection' will almost always invoke uncaughtHandler with an Error. so - // just suppress the TS strictness here. - process.on("unhandledRejection", uncaughtHandler); - try { - const req = call.request; - const type = req.getType(); - const name = req.getName(); - if (!this.provider.construct) { - callback(new Error(`unknown resource type ${type}`), undefined); - return; - } - configureRuntime(req, this.engineAddr); - const inputs = yield deserializeInputs(req.getInputs(), req.getInputdependenciesMap()); - // Rebuild the resource options. - const dependsOn = []; - for (const urn of req.getDependenciesList()) { - dependsOn.push(new resource.DependencyResource(urn)); - } - const providers = {}; - const rpcProviders = req.getProvidersMap(); - if (rpcProviders) { - for (const [pkg, ref] of rpcProviders.entries()) { - providers[pkg] = createProviderResource(ref); - } - } - const opts = { - aliases: req.getAliasesList(), - dependsOn: dependsOn, - protect: req.getProtect(), - providers: providers, - parent: req.getParent() ? new resource.DependencyResource(req.getParent()) : undefined, - }; - const result = yield this.provider.construct(name, type, inputs, opts); - const resp = new provproto.ConstructResponse(); - resp.setUrn(yield output_1.output(result.urn).promise()); - const [state, stateDependencies] = yield runtime.serializeResourceProperties(`construct(${type}, ${name})`, result.state); - const stateDependenciesMap = resp.getStatedependenciesMap(); - for (const [key, resources] of stateDependencies) { - const deps = new provproto.ConstructResponse.PropertyDependencies(); - deps.setUrnsList(yield Promise.all(Array.from(resources).map(r => r.urn.promise()))); - stateDependenciesMap.set(key, deps); - } - resp.setState(structproto.Struct.fromJavaScript(state)); - // Wait for RPC operations to complete. - yield runtime.waitForRPCs(); - callback(undefined, resp); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - finally { - // remove these uncaught handlers that are specific to this gRPC callback context - process.off("uncaughtException", uncaughtHandler); - process.off("unhandledRejection", uncaughtHandler); - } - }); - } - call(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - // Serialize invocations of `construct` and `call` so that each call runs one after another, avoiding concurrent - // runs. We do this because `construct` and `call` modify global state to reset the SDK's runtime options. - // This is a short-term workaround to provide correctness, but likely isn't sustainable long-term due to the - // limits it places on parallelism. We will likely want to investigate if it's possible to run each invocation - // in its own context, possibly using Node's `createContext` API to avoid modifying global state: - // https://nodejs.org/api/vm.html#vm_vm_createcontext_contextobject_options - const res = this.constructCallQueue.then(() => this.callImpl(call, callback)); - /* eslint-disable no-empty, no-empty-function, @typescript-eslint/no-empty-function */ - this.constructCallQueue = res.catch(() => { }); - return res; - }); - } - callImpl(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - // given that call calls are serialized, we can attach an uncaught handler to pick up exceptions - // in underlying user code. When we catch the error, we need to respond to the gRPC request with the error - // to avoid a hang. - const uncaughtHandler = (err) => { - if (!this.uncaughtErrors.has(err)) { - this.uncaughtErrors.add(err); - } - // bubble the uncaught error in the user code back and terminate the outstanding gRPC request. - callback(err, undefined); - }; - process.on("uncaughtException", uncaughtHandler); - // @ts-ignore 'unhandledRejection' will almost always invoke uncaughtHandler with an Error. so - // just suppress the TS strictness here. - process.on("unhandledRejection", uncaughtHandler); - try { - const req = call.request; - if (!this.provider.call) { - callback(new Error(`unknown function ${req.getTok()}`), undefined); - return; - } - configureRuntime(req, this.engineAddr); - const args = yield deserializeInputs(req.getArgs(), req.getArgdependenciesMap()); - const result = yield this.provider.call(req.getTok(), args); - const resp = new provproto.CallResponse(); - if (result.outputs) { - const [ret, retDependencies] = yield runtime.serializeResourceProperties(`call(${req.getTok()})`, result.outputs); - const returnDependenciesMap = resp.getReturndependenciesMap(); - for (const [key, resources] of retDependencies) { - const deps = new provproto.CallResponse.ReturnDependencies(); - deps.setUrnsList(yield Promise.all(Array.from(resources).map(r => r.urn.promise()))); - returnDependenciesMap.set(key, deps); - } - resp.setReturn(structproto.Struct.fromJavaScript(ret)); - } - if ((result.failures || []).length !== 0) { - const failureList = []; - for (const f of result.failures) { - const failure = new provproto.CheckFailure(); - failure.setProperty(f.property); - failure.setReason(f.reason); - failureList.push(failure); - } - resp.setFailuresList(failureList); - } - // Wait for RPC operations to complete. - yield runtime.waitForRPCs(); - callback(undefined, resp); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - finally { - // remove these uncaught handlers that are specific to this gRPC callback context - process.off("uncaughtException", uncaughtHandler); - process.off("unhandledRejection", uncaughtHandler); - } - }); - } - invoke(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const req = call.request; - if (!this.provider.invoke) { - callback(new Error(`unknown function ${req.getTok()}`), undefined); - return; - } - const args = req.getArgs().toJavaScript(); - const result = yield this.provider.invoke(req.getTok(), args); - const resp = new provproto.InvokeResponse(); - resp.setReturn(structproto.Struct.fromJavaScript(result.outputs)); - if ((result.failures || []).length !== 0) { - const failureList = []; - for (const f of result.failures) { - const failure = new provproto.CheckFailure(); - failure.setProperty(f.property); - failure.setReason(f.reason); - failureList.push(failure); - } - resp.setFailuresList(failureList); - } - callback(undefined, resp); - } - catch (e) { - console.error(`${e}: ${e.stack}`); - callback(e, undefined); - } - }); - } - streamInvoke(call, callback) { - return __awaiter(this, void 0, void 0, function* () { - callback({ - code: grpc.status.UNIMPLEMENTED, - details: "Not yet implemented: StreamInvoke", - }, undefined); - }); - } -} -function configureRuntime(req, engineAddr) { - // NOTE: these are globals! We should ensure that all settings are identical between calls, and eventually - // refactor so we can avoid the global state. - if (engineAddr === undefined) { - throw new Error("fatal: Missing address"); - } - runtime.resetOptions(req.getProject(), req.getStack(), req.getParallel(), engineAddr, req.getMonitorendpoint(), req.getDryrun()); - const pulumiConfig = {}; - const rpcConfig = req.getConfigMap(); - if (rpcConfig) { - for (const [k, v] of rpcConfig.entries()) { - pulumiConfig[k] = v; - } - } - runtime.setAllConfig(pulumiConfig, req.getConfigsecretkeysList()); -} -/** - * deserializeInputs deserializes the inputs struct and applies appropriate dependencies. - * @internal - */ -function deserializeInputs(inputsStruct, inputDependencies) { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - const result = {}; - const deserializedInputs = runtime.deserializeProperties(inputsStruct); - for (const k of Object.keys(deserializedInputs)) { - const input = deserializedInputs[k]; - const isSecret = runtime.isRpcSecret(input); - const depsUrns = (_b = (_a = inputDependencies.get(k)) === null || _a === void 0 ? void 0 : _a.getUrnsList(), (_b !== null && _b !== void 0 ? _b : [])); - if (!isSecret && (depsUrns.length === 0 || containsOutputs(input) || (yield isResourceReference(input, depsUrns)))) { - // If the input isn't a secret and either doesn't have any dependencies, already contains Outputs (from - // deserialized output values), or is a resource reference, then we can return it directly without - // wrapping it as an output. - result[k] = input; - } - else { - // Otherwise, wrap it in an output so we can handle secrets and/or track dependencies. - // Note: If the value is or contains an unknown value, the Output will mark its value as - // unknown automatically, so we just pass true for isKnown here. - const deps = depsUrns.map(depUrn => new resource.DependencyResource(depUrn)); - result[k] = new output_1.Output(deps, Promise.resolve(runtime.unwrapRpcSecret(input)), Promise.resolve(true), Promise.resolve(isSecret), Promise.resolve([])); - } - } - return result; - }); -} -exports.deserializeInputs = deserializeInputs; -/** - * Returns true if the input is a resource reference. - */ -function isResourceReference(input, deps) { - return __awaiter(this, void 0, void 0, function* () { - return resource.Resource.isInstance(input) - && deps.length === 1 - && deps[0] === (yield input.urn.promise()); - }); -} -/** - * Returns true if the deserialized input contains Outputs (deeply), excluding properties of Resources. - * @internal - */ -function containsOutputs(input) { - if (Array.isArray(input)) { - for (const e of input) { - if (containsOutputs(e)) { - return true; - } - } - } - else if (typeof input === "object") { - if (output_1.Output.isInstance(input)) { - return true; - } - else if (resource.Resource.isInstance(input)) { - // Do not drill into instances of Resource because they will have properties that are - // instances of Output (e.g. urn, id, etc.) and we're only looking for instances of - // Output that aren't associated with a Resource. - return false; - } - for (const k of Object.keys(input)) { - if (containsOutputs(input[k])) { - return true; - } - } - } - return false; -} -exports.containsOutputs = containsOutputs; -// grpcResponseFromError creates a gRPC response representing an error from a dynamic provider's -// resource. This is typically either a creation error, in which the API server has (virtually) -// rejected the resource, or an initialization error, where the API server has accepted the -// resource, but it failed to initialize (e.g., the app code is continually crashing and the -// resource has failed to become alive). -function grpcResponseFromError(e) { - // Create response object. - const resp = new statusproto.Status(); - resp.setCode(grpc.status.UNKNOWN); - resp.setMessage(e.message); - const metadata = new grpc.Metadata(); - if (e.id) { - // Object created successfully, but failed to initialize. Pack initialization failure into - // details. - const detail = new provproto.ErrorResourceInitFailed(); - detail.setId(e.id); - detail.setProperties(structproto.Struct.fromJavaScript(e.properties || {})); - detail.setReasonsList(e.reasons || []); - const details = new anyproto.Any(); - details.pack(detail.serializeBinary(), "pulumirpc.ErrorResourceInitFailed"); - // Add details to metadata. - resp.addDetails(details); - // NOTE: `grpc-status-details-bin` is a magic field that allows us to send structured - // protobuf data as an error back through gRPC. This notion of details is a first-class in - // the Go gRPC implementation, and the nodejs implementation has not quite caught up to it, - // which is why it's cumbersome here. - metadata.add("grpc-status-details-bin", Buffer.from(resp.serializeBinary())); - } - return { - code: grpc.status.UNKNOWN, - message: e.message, - metadata: metadata, - }; -} -function main(provider, args) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - // We track all uncaught errors here. If we have any, we will make sure we always have a non-0 exit - // code. - const uncaughtErrors = new Set(); - const uncaughtHandler = (err) => { - if (!uncaughtErrors.has(err)) { - uncaughtErrors.add(err); - // Use `pulumi.log.error` here to tell the engine there was a fatal error, which should - // stop processing subsequent resource operations. - log.error(err.stack || err.message || ("" + err)); - } - }; - process.on("uncaughtException", uncaughtHandler); - // @ts-ignore 'unhandledRejection' will almost always invoke uncaughtHandler with an Error. so just - // suppress the TS strictness here. - process.on("unhandledRejection", uncaughtHandler); - process.on("exit", (code) => { - // If there were any uncaught errors at all, we always want to exit with an error code. - if (code === 0 && uncaughtErrors.size > 0) { - process.exitCode = 1; - } - }); - const parsedArgs = internals_1.parseArgs(args); - // Finally connect up the gRPC client/server and listen for incoming requests. - const server = new grpc.Server({ - "grpc.max_receive_message_length": runtime.maxRPCMessageSize, - }); - // The program receives a single optional argument: the address of the RPC endpoint for the engine. It - // optionally also takes a second argument, a reference back to the engine, but this may be missing. - const engineAddr = (_a = parsedArgs) === null || _a === void 0 ? void 0 : _a.engineAddress; - server.addService(provrpc.ResourceProviderService, new Server(engineAddr, provider, uncaughtErrors)); - const port = yield new Promise((resolve, reject) => { - server.bindAsync(`0.0.0.0:0`, grpc.ServerCredentials.createInsecure(), (err, p) => { - if (err) { - reject(err); - } - else { - resolve(p); - } - }); - }); - server.start(); - // Emit the address so the monitor can read it to connect. The gRPC server will keep the message loop alive. - console.log(port); - }); -} -exports.main = main; -/** - * Rehydrate the provider reference into a registered ProviderResource, - * otherwise return an instance of DependencyProviderResource. - */ -function createProviderResource(ref) { - const [urn] = resource.parseResourceReference(ref); - const urnParts = urn.split("::"); - const qualifiedType = urnParts[2]; - const urnName = urnParts[3]; - const type = qualifiedType.split("$").pop(); - const typeParts = type.split(":"); - const typName = typeParts.length > 2 ? typeParts[2] : ""; - const resourcePackage = runtime.getResourcePackage(typName, /*version:*/ ""); - if (resourcePackage) { - return resourcePackage.constructProvider(urnName, type, urn); - } - return new resource.DependencyProviderResource(ref); -} -//# sourceMappingURL=server.js.map - -/***/ }), - -/***/ 90796: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const errors_1 = __nccwpck_require__(89693); -const output_1 = __nccwpck_require__(43037); -const runtime_1 = __nccwpck_require__(85022); -const resource_1 = __nccwpck_require__(30140); -const settings_1 = __nccwpck_require__(34530); -const utils = __nccwpck_require__(21888); -const log = __nccwpck_require__(80642); +const errors_1 = __nccwpck_require__(9693); +const output_1 = __nccwpck_require__(3037); +const resource_1 = __nccwpck_require__(140); +const settings_1 = __nccwpck_require__(4530); +const rpc_1 = __nccwpck_require__(60); +const utils = __nccwpck_require__(1888); +const log = __nccwpck_require__(642); /** * createUrn computes a URN from the combination of a resource name, resource type, optional parent, * optional project and optional stack. @@ -38596,7 +37377,7 @@ class Resource { } // Before anything else - if there are transformations registered, invoke them in order to transform the properties and // options assigned to this resource. - const parent = opts.parent || runtime_1.getStackResource(); + const parent = opts.parent || getStackResource(); this.__transformations = [...(opts.transformations || []), ...(((_a = parent) === null || _a === void 0 ? void 0 : _a.__transformations) || [])]; for (const transformation of this.__transformations) { const tres = transformation({ resource: this, type: t, name, props, opts }); @@ -38812,7 +37593,7 @@ class ProviderResource extends CustomResource { } if (!provider.__registrationId) { const providerURN = yield provider.urn.promise(); - const providerID = (yield provider.id.promise()) || runtime_1.unknownValue; + const providerID = (yield provider.id.promise()) || rpc_1.unknownValue; provider.__registrationId = `${providerURN}::${providerID}`; } return provider.__registrationId; @@ -39057,11 +37838,16 @@ function parseResourceReference(ref) { return [urn, id]; } exports.parseResourceReference = parseResourceReference; +function getStackResource() { + // break the module import cycle between this module and "./runtime/stack". + const stack = __nccwpck_require__(6664); + return stack.getStackResource(); +} //# sourceMappingURL=resource.js.map /***/ }), -/***/ 86358: +/***/ 6358: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -39162,8 +37948,8 @@ exports.PushableAsyncIterable = PushableAsyncIterable; /***/ }), -/***/ 50276: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 7146: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -39180,249 +37966,114 @@ exports.PushableAsyncIterable = PushableAsyncIterable; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -/* eslint-disable max-len */ -const fs = __nccwpck_require__(57147); -const normalize = __nccwpck_require__(53188); -const readPackageTree = __nccwpck_require__(94704); -const upath = __nccwpck_require__(8004); -const __1 = __nccwpck_require__(9978); -const asset = __nccwpck_require__(83031); -const errors_1 = __nccwpck_require__(89693); -function computeCodePaths(optionsOrExtraIncludePaths, extraIncludePackages, extraExcludePackages) { - return __awaiter(this, void 0, void 0, function* () { - let options; - if (Array.isArray(optionsOrExtraIncludePaths)) { - __1.log.warn("'function computeCodePaths(string[])' is deprecated. Use the [computeCodePaths] overload that takes a [CodePathOptions] instead."); - options = { - extraIncludePaths: optionsOrExtraIncludePaths, - extraIncludePackages, - extraExcludePackages, - }; - } - else { - options = optionsOrExtraIncludePaths || {}; - } - return computeCodePathsWorker(options); - }); -} -exports.computeCodePaths = computeCodePaths; -function computeCodePathsWorker(options) { - return __awaiter(this, void 0, void 0, function* () { - // Construct the set of paths to include in the archive for upload. - // Find folders for all packages requested by the user. Note: all paths in this should - // be normalized. - const normalizedPathSet = yield allFoldersForPackages(new Set(options.extraIncludePackages || []), new Set(options.extraExcludePackages || []), options.logResource); - // Add all paths explicitly requested by the user - const extraIncludePaths = options.extraIncludePaths || []; - for (const path of extraIncludePaths) { - normalizedPathSet.add(upath.normalize(path)); - } - const codePaths = new Map(); - // For each of the required paths, add the corresponding FileArchive or FileAsset to the - // AssetMap. - for (const normalizedPath of normalizedPathSet) { - // Don't include a path if there is another path higher up that will include this one. - if (isSubsumedByHigherPath(normalizedPath, normalizedPathSet)) { - continue; - } - // The Asset model does not support a consistent way to embed a file-or-directory into an - // `AssetArchive`, so we stat the path to figure out which it is and use the appropriate - // Asset constructor. - const stats = fs.statSync(normalizedPath); - if (stats.isDirectory()) { - codePaths.set(normalizedPath, new asset.FileArchive(normalizedPath)); - } - else { - codePaths.set(normalizedPath, new asset.FileAsset(normalizedPath)); - } - } - return codePaths; - }); +/** + * configEnvKey is the environment variable key that the language plugin uses to set configuration values. + */ +const configEnvKey = "PULUMI_CONFIG"; +/** + * configSecretKeysEnvKey is the environment variable key that the language plugin uses to set configuration keys that + * contain secrets. + */ +const configSecretKeysEnvKey = "PULUMI_CONFIG_SECRET_KEYS"; +/** + * allConfig returns a copy of the full config map. + */ +function allConfig() { + const config = parseConfig(); + return Object.assign({}, config); } -function isSubsumedByHigherPath(normalizedPath, normalizedPathSet) { - for (const otherNormalizedPath of normalizedPathSet) { - if (normalizedPath.length > otherNormalizedPath.length && - normalizedPath.startsWith(otherNormalizedPath)) { - // Have to make sure we're actually a sub-directory of that other path. For example, - // if we have: node_modules/mime-types, that's not subsumed by node_modules/mime - const nextChar = normalizedPath.charAt(otherNormalizedPath.length); - return nextChar === "/"; - } +exports.allConfig = allConfig; +/** + * setAllConfig overwrites the config map. + */ +function setAllConfig(c, secretKeys) { + const obj = {}; + for (const k of Object.keys(c)) { + obj[cleanKey(k)] = c[k]; } - return false; + persistConfig(obj, secretKeys); } -// allFolders computes the set of package folders that are transitively required by the root -// 'dependencies' node in the client's project.json file. -function allFoldersForPackages(includedPackages, excludedPackages, logResource) { - return new Promise((resolve, reject) => { - readPackageTree(".", undefined, (err, root) => { - try { - if (err) { - return reject(err); - } - // read-package-tree defers to read-package-json to parse the project.json file. If that - // fails, root.error is set to the underlying error. Unfortunately, read-package-json is - // very finicky and can fail for reasons that are not relevant to us. For example, it - // can fail if a "version" string is not a legal semver. We still want to proceed here - // as this is not an actual problem for determining the set of dependencies. - if (root.error) { - if (!root.realpath) { - throw new errors_1.ResourceError("Failed to parse package.json. Underlying issue:\n " + root.error.toString(), logResource); - } - // From: https://github.com/npm/read-package-tree/blob/5245c6e50d7f46ae65191782622ec75bbe80561d/rpt.js#L121 - root.package = computeDependenciesDirectlyFromPackageFile(upath.join(root.realpath, "package.json"), logResource); - } - // This is the core starting point of the algorithm. We use readPackageTree to get - // the package.json information for this project, and then we start by walking the - // .dependencies node in that package. Importantly, we do not look at things like - // .devDependencies or or .peerDependencies. These are not what are considered part - // of the final runtime configuration of the app and should not be uploaded. - const referencedPackages = new Set(includedPackages); - if (root.package && root.package.dependencies) { - for (const depName of Object.keys(root.package.dependencies)) { - referencedPackages.add(depName); - } - } - // package.json files can contain circularities. For example es6-iterator depends - // on es5-ext, which depends on es6-iterator, which depends on es5-ext: - // https://github.com/medikoo/es6-iterator/blob/0eac672d3f4bb3ccc986bbd5b7ffc718a0822b74/package.json#L20 - // https://github.com/medikoo/es5-ext/blob/792c9051e5ad9d7671dd4e3957eee075107e9e43/package.json#L29 - // - // So keep track of the paths we've looked and don't recurse if we hit something again. - const seenPaths = new Set(); - const normalizedPackagePaths = new Set(); - for (const pkg of referencedPackages) { - addPackageAndDependenciesToSet(root, pkg, seenPaths, normalizedPackagePaths, excludedPackages); - } - return resolve(normalizedPackagePaths); - } - catch (error) { - return reject(error); - } - }); - }); +exports.setAllConfig = setAllConfig; +/** + * setConfig sets a configuration variable. + */ +function setConfig(k, v) { + const config = parseConfig(); + config[cleanKey(k)] = v; + persistConfig(config, []); } -function computeDependenciesDirectlyFromPackageFile(path, logResource) { - // read the package.json file in directly. if any of these fail an error will be thrown - // and bubbled back out to user. - const contents = readFile(); - const data = parse(); - // 'normalize-package-data' can throw if 'version' isn't a valid string. We don't care about - // 'version' so just delete it. - // https://github.com/npm/normalize-package-data/blob/df8ea05b8cd38531e8b70ac7906f420344f55bab/lib/fixer.js#L191 - delete data.version; - // 'normalize-package-data' can throw if 'name' isn't a valid string. We don't care about - // 'name' so just delete it. - // https://github.com/npm/normalize-package-data/blob/df8ea05b8cd38531e8b70ac7906f420344f55bab/lib/fixer.js#L211 - delete data.name; - normalize(data); - return data; - function readFile() { - try { - return fs.readFileSync(path); - } - catch (err) { - throw new errors_1.ResourceError(`Error reading file '${path}' when computing package dependencies. ${err}`, logResource); - } - } - function parse() { - try { - return JSON.parse(contents.toString()); - } - catch (err) { - throw new errors_1.ResourceError(`Error parsing file '${path}' when computing package dependencies. ${err}`, logResource); +exports.setConfig = setConfig; +/** + * getConfig returns a configuration variable's value or undefined if it is unset. + */ +function getConfig(k) { + const config = parseConfig(); + return config[k]; +} +exports.getConfig = getConfig; +/** + * isConfigSecret returns true if the key contains a secret value. + * @internal + */ +function isConfigSecret(k) { + const envConfigSecretKeys = process.env[configSecretKeysEnvKey]; + if (envConfigSecretKeys) { + const envConfigSecretArray = JSON.parse(envConfigSecretKeys); + if (Array.isArray(envConfigSecretArray)) { + return envConfigSecretArray.includes(k); } } + return false; } -// addPackageAndDependenciesToSet adds all required dependencies for the requested pkg name from the given root package -// into the set. It will recurse into all dependencies of the package. -function addPackageAndDependenciesToSet(root, pkg, seenPaths, normalizedPackagePaths, excludedPackages) { - // Don't process this packages if it was in the set the user wants to exclude. - if (excludedPackages.has(pkg)) { - return; - } - const child = findDependency(root, pkg); - if (!child) { - console.warn(`Could not include required dependency '${pkg}' in '${upath.resolve(root.path)}'.`); - return; - } - // Don't process a child path if we've already encountered it. - const normalizedPath = upath.normalize(child.path); - if (seenPaths.has(normalizedPath)) { - return; - } - seenPaths.add(normalizedPath); - if (child.package.pulumi) { - // This was a pulumi deployment-time package. Check if it had a: - // - // `pulumi: { runtimeDependencies: ... }` - // - // section. In this case, we don't want to add this specific package, but we do want to - // include all the runtime dependencies it says are necessary. - recurse(child.package.pulumi.runtimeDependencies); - } - else if (pkg.startsWith("@pulumi")) { - // exclude it if it's an @pulumi package. These packages are intended for deployment - // time only and will only bloat up the serialized lambda package. Note: this code can - // be removed once all pulumi packages add a "pulumi" section to their package.json. - return; - } - else { - // Normal package. Add the normalized path to it, and all transitively add all of its - // dependencies. - normalizedPackagePaths.add(normalizedPath); - recurse(child.package.dependencies); - } - return; - function recurse(dependencies) { - if (dependencies) { - for (const dep of Object.keys(dependencies)) { - addPackageAndDependenciesToSet(child, dep, seenPaths, normalizedPackagePaths, excludedPackages); - } +exports.isConfigSecret = isConfigSecret; +/** + * parseConfig reads config from the source of truth, the environment. + * config must always be read this way because automation api introduces + * new program lifetime semantics where program lifetime != module lifetime. + */ +function parseConfig() { + const parsedConfig = {}; + const envConfig = process.env[configEnvKey]; + if (envConfig) { + const envObject = JSON.parse(envConfig); + for (const k of Object.keys(envObject)) { + parsedConfig[cleanKey(k)] = envObject[k]; } } + return parsedConfig; } -// findDependency searches the package tree starting at a root node (possibly a child) for a match -// for the given name. It is assumed that the tree was correctly constructed such that dependencies -// are resolved to compatible versions in the closest available match starting at the provided root -// and walking up to the head of the tree. -function findDependency(root, name) { - for (; root; root = root.parent) { - for (const child of root.children) { - let childName = child.name; - // Note: `read-package-tree` returns incorrect `.name` properties for packages in an - // organization - like `@types/express` or `@protobufjs/path`. Compute the correct name - // from the `path` property instead. Match any name that ends with something that looks - // like `@foo/bar`, such as `node_modules/@foo/bar` or - // `node_modules/baz/node_modules/@foo/bar. - const childFolderName = upath.basename(child.path); - const parentFolderName = upath.basename(upath.dirname(child.path)); - if (parentFolderName[0] === "@") { - childName = upath.join(parentFolderName, childFolderName); - } - if (childName === name) { - return child; - } - } +/** + * persistConfig writes config to the environment. + * config changes must always be persisted to the environment because automation api introduces + * new program lifetime semantics where program lifetime != module lifetime. + */ +function persistConfig(config, secretKeys) { + const serializedConfig = JSON.stringify(config); + const serializedSecretKeys = Array.isArray(secretKeys) ? JSON.stringify(secretKeys) : "[]"; + process.env[configEnvKey] = serializedConfig; + process.env[configSecretKeysEnvKey] = serializedSecretKeys; +} +/** + * cleanKey takes a configuration key, and if it is of the form ":config:" removes + * the ":config:" portion. Previously, our keys always had the string ":config:" in them, and we'd + * like to remove it. However, the language host needs to continue to set it so we can be compatible + * with older versions of our packages. Once we stop supporting older packages, we can change the + * language host to not add this :config: thing and remove this function. + */ +function cleanKey(key) { + const idx = key.indexOf(":"); + if (idx > 0 && key.startsWith("config:", idx + 1)) { + return key.substring(0, idx) + ":" + key.substring(idx + 1 + "config:".length); } - return undefined; + return key; } -//# sourceMappingURL=codePaths.js.map +//# sourceMappingURL=config.js.map /***/ }), -/***/ 1260: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 257: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -39439,1103 +38090,118 @@ function findDependency(root, name) { // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -/* eslint-disable max-len */ -const upath = __nccwpck_require__(8004); -const errors_1 = __nccwpck_require__(89693); -const output_1 = __nccwpck_require__(43037); -const utils_1 = __nccwpck_require__(21888); -const parseFunction_1 = __nccwpck_require__(48338); -const rewriteSuper_1 = __nccwpck_require__(96034); -const package_1 = __nccwpck_require__(44585); -const utils = __nccwpck_require__(21866); -const v8 = __nccwpck_require__(74552); -/* - * SerializedOutput is the type we convert real deployment time outputs to when we serialize them - * into the environment for a closure. The output will go from something you call 'apply' on to - * transform during deployment, to something you call .get on to get the raw underlying value from - * inside a cloud callback. - * - * IMPORTANT: Do not change the structure of this type. Closure serialization code takes a - * dependency on the actual shape (including the names of properties like 'value'). +const log = __nccwpck_require__(642); +/** + * debugPromiseLeaks can be set to enable promises leaks debugging. */ -class SerializedOutput { - constructor(value) { - this.value = value; - } - apply(func) { - throw new Error("'apply' is not allowed from inside a cloud-callback. Use 'get' to retrieve the value of this Output directly."); - } - get() { - return this.value; +const debugPromiseLeaks = !!process.env.PULUMI_DEBUG_PROMISE_LEAKS; +/** + * leakDetectorScheduled is true when the promise leak detector is scheduled for process exit. + */ +let leakDetectorScheduled = false; +/** + * leakCandidates tracks the list of potential leak candidates. + */ +let leakCandidates = new Set(); +function leakedPromises() { + const leaked = leakCandidates; + const promisePlural = leaked.size === 0 ? "promise was" : "promises were"; + const message = leaked.size === 0 ? "" : + `The Pulumi runtime detected that ${leaked.size} ${promisePlural} still active\n` + + "at the time that the process exited. There are a few ways that this can occur:\n" + + " * Not using `await` or `.then` on a Promise returned from a Pulumi API\n" + + " * Introducing a cyclic dependency between two Pulumi Resources\n" + + " * A bug in the Pulumi Runtime\n" + + "\n" + + "Leaving promises active is probably not what you want. If you are unsure about\n" + + "why you are seeing this message, re-run your program " + + "with the `PULUMI_DEBUG_PROMISE_LEAKS`\n" + + "environment variable. The Pulumi runtime will then print out additional\n" + + "debug information about the leaked promises."; + if (debugPromiseLeaks) { + for (const leak of leaked) { + console.error("Promise leak detected:"); + console.error(promiseDebugString(leak)); + } } + leakCandidates = new Set(); + return [leaked, message]; +} +exports.leakedPromises = leakedPromises; +function promiseDebugString(p) { + return `CONTEXT(${p._debugId}): ${p._debugCtx}\n` + + `STACK_TRACE:\n` + + `${p._debugStackTrace}`; } +exports.promiseDebugString = promiseDebugString; +let promiseId = 0; /** - * createFunctionInfo serializes a function and its closure environment into a form that is - * amenable to persistence as simple JSON. Like toString, it includes the full text of the - * function's source code, suitable for execution. Unlike toString, it actually includes information - * about the captured environment. - * + * debuggablePromise optionally wraps a promise with some goo to make it easier to debug common problems. * @internal */ -function createClosureInfoAsync(func, serialize, logResource) { - return __awaiter(this, void 0, void 0, function* () { - // Initialize our Context object. It is effectively used to keep track of the work we're doing - // as well as to keep track of the graph as we're walking it so we don't infinitely recurse. - const context = { - cache: new Map(), - classInstanceMemberToSuperEntry: new Map(), - classStaticMemberToSuperEntry: new Map(), - frames: [], - simpleFunctions: [], - logResource, - containsSecrets: false, - }; - // Pre-populate our context's cache with global well-known values. These are values for things - // like global.Number, or Function.prototype. Actually trying to serialize/deserialize these - // would be a bad idea as that would mean once deserialized the objects wouldn't point to the - // well known globals that were expected. Furthermore, most of these are almost certain to fail - // to serialize due to hitting things like native-builtins. - yield addEntriesForWellKnownGlobalObjectsAsync(); - // Make sure this func is in the cache itself as we may hit it again while recursing. - const entry = {}; - context.cache.set(func, entry); - entry.function = yield analyzeFunctionInfoAsync(func, context, serialize); - return { - func: entry.function, - containsSecrets: context.containsSecrets, - }; - function addEntriesForWellKnownGlobalObjectsAsync() { - return __awaiter(this, void 0, void 0, function* () { - const seenGlobalObjects = new Set(); - // Front load these guys so we prefer emitting code that references them directly, - // instead of in unexpected ways. i.e. we'd prefer to have Number.prototype vs - // Object.getPrototypeOf(Infinity) (even though they're the same thing.) - yield addGlobalInfoAsync("Object"); - yield addGlobalInfoAsync("Function"); - yield addGlobalInfoAsync("Array"); - yield addGlobalInfoAsync("Number"); - yield addGlobalInfoAsync("String"); - for (let current = global; current; current = Object.getPrototypeOf(current)) { - for (const key of Object.getOwnPropertyNames(current)) { - // "GLOBAL" and "root" are deprecated and give warnings if you try to access them. So - // just skip them. - if (key !== "GLOBAL" && key !== "root") { - yield addGlobalInfoAsync(key); - } - } - } - // Add information so that we can properly serialize over generators/iterators. - yield addGeneratorEntriesAsync(); - yield addEntriesAsync(Symbol.iterator, "Symbol.iterator"); - return; - function addEntriesAsync(val, emitExpr) { - return __awaiter(this, void 0, void 0, function* () { - if (val === undefined || val === null) { - return; - } - // No need to add values twice. Ths can happen as we walk the global namespace and - // sometimes run into multiple names aliasing to the same value. - if (seenGlobalObjects.has(val)) { - return; - } - seenGlobalObjects.add(val); - context.cache.set(val, { expr: emitExpr }); - }); - } - function addGlobalInfoAsync(key) { - return __awaiter(this, void 0, void 0, function* () { - const globalObj = global[key]; - const text = utils.isLegalMemberName(key) ? `global.${key}` : `global["${key}"]`; - if (globalObj !== undefined && globalObj !== null) { - yield addEntriesAsync(globalObj, text); - yield addEntriesAsync(Object.getPrototypeOf(globalObj), `Object.getPrototypeOf(${text})`); - yield addEntriesAsync(globalObj.prototype, `${text}.prototype`); - } - }); +function debuggablePromise(p, ctx) { + // Whack some stack onto the promise. Leave them non-enumerable to avoid awkward rendering. + Object.defineProperty(p, "_debugId", { writable: true, value: promiseId }); + Object.defineProperty(p, "_debugCtx", { writable: true, value: ctx }); + Object.defineProperty(p, "_debugStackTrace", { writable: true, value: new Error().stack }); + promiseId++; + if (!leakDetectorScheduled) { + process.on("exit", (code) => { + // Only print leaks if we're exiting normally. Otherwise, it could be a crash, which of + // course yields things that look like "leaks". + // + // process.exitCode is undefined unless set, in which case it's the exit code that was + // passed to process.exit. + if ((process.exitCode === undefined || process.exitCode === 0) && !log.hasErrors()) { + const [leaks, message] = leakedPromises(); + if (leaks.size === 0) { + // No leaks - proceed with the exit. + return; } - // A generator function ('f') has ends up creating two interesting objects in the js - // environment: - // - // 1. the generator function itself ('f'). This generator function has an __proto__ that is - // shared will all other generator functions. - // - // 2. a property 'prototype' on 'f'. This property's __proto__ will be shared will all other - // 'prototype' properties of other generator functions. - // - // So, to properly serialize a generator, we stash these special objects away so that we can - // refer to the well known instance on the other side when we desirialize. Otherwise, if we - // actually tried to deserialize the instances/prototypes we have we would end up failing when - // we hit native functions. - // - // see http://www.ecma-international.org/ecma-262/6.0/#sec-generatorfunction-objects and - // http://www.ecma-international.org/ecma-262/6.0/figure-2.png - function addGeneratorEntriesAsync() { - return __awaiter(this, void 0, void 0, function* () { - // eslint-disable-next-line no-empty,no-empty-function,@typescript-eslint/no-empty-function - const emptyGenerator = function* () { }; - yield addEntriesAsync(Object.getPrototypeOf(emptyGenerator), "Object.getPrototypeOf(function*(){})"); - yield addEntriesAsync(Object.getPrototypeOf(emptyGenerator.prototype), "Object.getPrototypeOf((function*(){}).prototype)"); - }); + // If we haven't opted-in to the debug error message, print a more user-friendly message. + if (!debugPromiseLeaks) { + console.error(message); } - }); - } - }); -} -exports.createClosureInfoAsync = createClosureInfoAsync; -// This function ends up capturing many external modules that cannot themselves be serialized. -// Do not allow it to be captured. -createClosureInfoAsync.doNotCapture = true; -/** - * analyzeFunctionInfoAsync does the work to create an asynchronous dataflow graph that resolves to a - * final FunctionInfo. - */ -function analyzeFunctionInfoAsync(func, context, serialize, logInfo) { - return __awaiter(this, void 0, void 0, function* () { - // logInfo = logInfo || func.name === "addHandler"; - const { file, line, column } = yield v8.getFunctionLocationAsync(func); - const functionString = func.toString(); - const frame = { functionLocation: { func, file, line, column, functionString, isArrowFunction: false } }; - context.frames.push(frame); - const result = yield serializeWorkerAsync(); - context.frames.pop(); - if (isSimple(result)) { - const existingSimpleFunction = findSimpleFunction(result); - if (existingSimpleFunction) { - return existingSimpleFunction; - } - context.simpleFunctions.push(result); - } - return result; - function isSimple(info) { - return info.capturedValues.size === 0 && info.env.size === 0 && !info.proto; - } - function findSimpleFunction(info) { - for (const other of context.simpleFunctions) { - if (other.code === info.code && other.usesNonLexicalThis === info.usesNonLexicalThis) { - return other; - } - } - return undefined; - } - function serializeWorkerAsync() { - return __awaiter(this, void 0, void 0, function* () { - const funcEntry = context.cache.get(func); - if (!funcEntry) { - throw new Error("Entry for this this function was not created by caller"); - } - // First, convert the js func object to a reasonable stringified version that we can operate on. - // Importantly, this function helps massage all the different forms that V8 can produce to - // either a "function (...) { ... }" form, or a "(...) => ..." form. In other words, all - // 'funky' functions (like classes and whatnot) will be transformed to reasonable forms we can - // process down the pipeline. - const [error, parsedFunction] = parseFunction_1.parseFunction(functionString); - if (error) { - throwSerializationError(func, context, error); - } - const funcExprWithName = parsedFunction.funcExprWithName; - const functionDeclarationName = parsedFunction.functionDeclarationName; - frame.functionLocation.isArrowFunction = parsedFunction.isArrowFunction; - const capturedValues = new Map(); - yield processCapturedVariablesAsync(parsedFunction.capturedVariables.required, /*throwOnFailure:*/ true); - yield processCapturedVariablesAsync(parsedFunction.capturedVariables.optional, /*throwOnFailure:*/ false); - const functionInfo = { - code: parsedFunction.funcExprWithoutName, - capturedValues: capturedValues, - env: new Map(), - usesNonLexicalThis: parsedFunction.usesNonLexicalThis, - name: functionDeclarationName, - paramCount: func.length, - }; - const proto = Object.getPrototypeOf(func); - const isAsyncFunction = yield computeIsAsyncFunction(func); - // Ensure that the prototype of this function is properly serialized as well. We only need to do - // this for functions with a custom prototype (like a derived class constructor, or a function - // that a user has explicit set the prototype for). Normal functions will pick up - // Function.prototype by default, so we don't need to do anything for them. - if (proto !== Function.prototype && - !isAsyncFunction && - !isDerivedNoCaptureConstructor(func)) { - const protoEntry = yield getOrCreateEntryAsync(proto, undefined, context, serialize, logInfo); - functionInfo.proto = protoEntry; - if (functionString.startsWith("class ")) { - // This was a class (which is effectively synonymous with a constructor-function). - // We also know that it's a derived class because of the `proto !== - // Function.prototype` check above. (The prototype of a non-derived class points at - // Function.prototype). - // - // they're a bit trickier to serialize than just a straight function. Specifically, - // we have to keep track of the inheritance relationship between classes. That way - // if any of the class members references 'super' we'll be able to rewrite it - // accordingly (since we emit classes as Functions) - yield processDerivedClassConstructorAsync(protoEntry); - // Because this was was class constructor function, rewrite any 'super' references - // in it do its derived type if it has one. - functionInfo.code = rewriteSuper_1.rewriteSuperReferences(funcExprWithName, /*isStatic*/ false); - } - } - // capture any properties placed on the function itself. Don't bother with - // "length/name" as those are not things we can actually change. - for (const descriptor of yield getOwnPropertyDescriptors(func)) { - if (descriptor.name === "length" || descriptor.name === "name") { - continue; - } - const funcProp = yield getOwnPropertyAsync(func, descriptor); - // We don't need to emit code to serialize this function's .prototype object - // unless that .prototype object was actually changed. - // - // In other words, in general, we will not emit the prototype for a normal - // 'function foo() {}' declaration. but we will emit the prototype for the - // constructor function of a class. - if (descriptor.name === "prototype" && - (yield isDefaultFunctionPrototypeAsync(func, funcProp))) { - continue; - } - const keyEntry = yield getOrCreateEntryAsync(getNameOrSymbol(descriptor), undefined, context, serialize, logInfo); - const valEntry = yield getOrCreateEntryAsync(funcProp, undefined, context, serialize, logInfo); - const propertyInfo = yield createPropertyInfoAsync(descriptor, context, serialize, logInfo); - functionInfo.env.set(keyEntry, { info: propertyInfo, entry: valEntry }); - } - const superEntry = context.classInstanceMemberToSuperEntry.get(func) || - context.classStaticMemberToSuperEntry.get(func); - if (superEntry) { - // this was a class constructor or method. We need to put a special __super - // entry into scope, and then rewrite any calls to super() to refer to it. - capturedValues.set(yield getOrCreateNameEntryAsync("__super", undefined, context, serialize, logInfo), { entry: superEntry }); - functionInfo.code = rewriteSuper_1.rewriteSuperReferences(funcExprWithName, context.classStaticMemberToSuperEntry.has(func)); - } - // If this was a named function (literally, only a named function-expr or function-decl), then - // place an entry in the environment that maps from this function name to the serialized - // function we're creating. This ensures that recursive functions will call the right method. - // i.e if we have "function f() { f(); }" this will get rewritten to: - // - // function __f() { - // with ({ f: __f }) { - // return function () { f(); } - // - // i.e. the inner call to "f();" will actually call the *outer* __f function, and not - // itself. - if (functionDeclarationName !== undefined) { - capturedValues.set(yield getOrCreateNameEntryAsync(functionDeclarationName, undefined, context, serialize, logInfo), { entry: funcEntry }); - } - return functionInfo; - function processCapturedVariablesAsync(capturedVariables, throwOnFailure) { - return __awaiter(this, void 0, void 0, function* () { - for (const name of capturedVariables.keys()) { - let value; - try { - value = yield v8.lookupCapturedVariableValueAsync(func, name, throwOnFailure); - } - catch (err) { - throwSerializationError(func, context, err.message); - } - const moduleName = yield findNormalizedModuleNameAsync(value); - const frameLength = context.frames.length; - if (moduleName) { - context.frames.push({ capturedModule: { name: moduleName, value: value } }); - } - else if (value instanceof Function) { - // Only bother pushing on context frame if the name of the variable - // we captured is different from the name of the function. If the - // names are the same, this is a direct reference, and we don't have - // to list both the name of the capture and of the function. if they - // are different, it's an indirect reference, and the name should be - // included for clarity. - if (name !== value.name) { - context.frames.push({ capturedFunctionName: name }); - } - } - else { - context.frames.push({ capturedVariableName: name }); - } - yield processCapturedVariableAsync(capturedVariables, name, value); - // Only if we pushed a frame on should we pop it off. - if (context.frames.length !== frameLength) { - context.frames.pop(); - } - } - }); - } - function processCapturedVariableAsync(capturedVariables, name, value) { - return __awaiter(this, void 0, void 0, function* () { - const properties = capturedVariables.get(name); - const serializedName = yield getOrCreateNameEntryAsync(name, undefined, context, serialize, logInfo); - // try to only serialize out the properties that were used by the user's code. - const serializedValue = yield getOrCreateEntryAsync(value, properties, context, serialize, logInfo); - capturedValues.set(serializedName, { entry: serializedValue }); - }); - } - }); - } - function processDerivedClassConstructorAsync(protoEntry) { - return __awaiter(this, void 0, void 0, function* () { - // Map from derived class' constructor and members, to the entry for the base class (i.e. - // the base class' constructor function). We'll use this when serializing out those members - // to rewrite any usages of 'super' appropriately. - // We're processing the derived class constructor itself. Just map it directly to the base - // class function. - context.classInstanceMemberToSuperEntry.set(func, protoEntry); - // Also, make sure our methods can also find this entry so they too can refer to - // 'super'. - for (const descriptor of yield getOwnPropertyDescriptors(func)) { - if (descriptor.name !== "length" && - descriptor.name !== "name" && - descriptor.name !== "prototype") { - // static method. - const classProp = yield getOwnPropertyAsync(func, descriptor); - addIfFunction(classProp, /*isStatic*/ true); - } - } - for (const descriptor of yield getOwnPropertyDescriptors(func.prototype)) { - // instance method. - const classProp = yield getOwnPropertyAsync(func.prototype, descriptor); - addIfFunction(classProp, /*isStatic*/ false); - } - return; - function addIfFunction(prop, isStatic) { - if (prop instanceof Function) { - const set = isStatic - ? context.classStaticMemberToSuperEntry - : context.classInstanceMemberToSuperEntry; - set.set(prop, protoEntry); - } - } - }); - } - }); -} -function computeIsAsyncFunction(func) { - return __awaiter(this, void 0, void 0, function* () { - // Note, i can't think of a better way to determine this. This is particularly hard because we - // can't even necessary refer to async function objects here as this code is rewritten by TS, - // converting all async functions to non async functions. - return func.constructor && func.constructor.name === "AsyncFunction"; - }); -} -function throwSerializationError(func, context, info) { - let message = ""; - const initialFuncLocation = getFunctionLocation(context.frames[0].functionLocation); - message += `Error serializing ${initialFuncLocation}\n\n`; - let i = 0; - const n = context.frames.length; - for (; i < n; i++) { - const frame = context.frames[i]; - const indentString = " ".repeat(i); - message += indentString; - if (frame.functionLocation) { - const funcLocation = getFunctionLocation(frame.functionLocation); - const nextFrameIsFunction = i < n - 1 && context.frames[i + 1].functionLocation !== undefined; - if (nextFrameIsFunction) { - if (i === 0) { - message += `${funcLocation}: referenced\n`; - } - else { - message += `${funcLocation}: which referenced\n`; - } - } - else { - if (i === n - 1) { - message += `${funcLocation}: which could not be serialized because\n`; - } - else if (i === 0) { - message += `${funcLocation}: captured\n`; - } - else { - message += `${funcLocation}: which captured\n`; - } - } - } - else if (frame.capturedFunctionName) { - message += `'${frame.capturedFunctionName}', a function defined at\n`; - } - else if (frame.capturedModule) { - if (i === n - 1) { - message += `module '${frame.capturedModule.name}'\n`; - } - else { - message += `module '${frame.capturedModule.name}' which indirectly referenced\n`; + // Fail the deployment if we leaked any promises. + process.exitCode = 1; } - } - else if (frame.capturedVariableName) { - message += `variable '${frame.capturedVariableName}' which indirectly referenced\n`; - } + }); + leakDetectorScheduled = true; } - message += " ".repeat(i) + info + "\n\n"; - message += getTrimmedFunctionCode(func); - const moduleIndex = context.frames.findIndex(f => f.capturedModule !== undefined); - if (moduleIndex >= 0) { - const module = context.frames[moduleIndex].capturedModule; - const moduleName = module.name; - message += "\n"; - if (utils_1.hasTrueBooleanMember(module.value, "deploymentOnlyModule")) { - message += `Module '${moduleName}' is a 'deployment only' module. In general these cannot be captured inside a 'run time' function.`; - } - else { - const functionLocation = context.frames[moduleIndex - 1].functionLocation; - const location = getFunctionLocation(functionLocation); - message += `Capturing modules can sometimes cause problems. -Consider using import('${moduleName}') or require('${moduleName}') inside ${location}`; - } - } - // Hide the stack when printing out the closure serialization error. We don't want both the - // closure serialization object stack *and* the function execution stack. Furthermore, there - // is enough information about the Function printed (both line/col, and a few lines of its - // text) to give the user the appropriate info for fixing. - throw new errors_1.ResourceError(message, context.logResource, /*hideStack:*/ true); -} -function getTrimmedFunctionCode(func) { - const funcString = func.toString(); - // include up to the first 5 lines of the function to help show what is wrong with it. - let split = funcString.split(/\r?\n/); - if (split.length > 5) { - split = split.slice(0, 5); - split.push("..."); - } - let code = "Function code:\n"; - for (const line of split) { - code += " " + line + "\n"; - } - return code; -} -function getFunctionLocation(loc) { - let name = "'" + getFunctionName(loc) + "'"; - if (loc.file) { - name += `: ${upath.basename(loc.file)}(${loc.line + 1},${loc.column})`; - } - const prefix = loc.isArrowFunction ? "" : "function "; - return prefix + name; -} -function getFunctionName(loc) { - if (loc.isArrowFunction) { - let funcString = loc.functionString; - // If there's a semicolon in the text, only include up to that. we don't want to pull in - // the entire lambda if it's lots of statements. - const semicolonIndex = funcString.indexOf(";"); - if (semicolonIndex >= 0) { - funcString = funcString.slice(0, semicolonIndex + 1) + " ..."; - } - // squash all whitespace to single spaces. - funcString = funcString.replace(/\s\s+/g, " "); - const lengthLimit = 40; - if (funcString.length > lengthLimit) { - // Trim the header if its very long. - funcString = funcString.substring(0, lengthLimit - " ...".length) + " ..."; - } - return funcString; - } - if (loc.func.name) { - return loc.func.name; - } - return ""; -} -function isDefaultFunctionPrototypeAsync(func, prototypeProp) { - return __awaiter(this, void 0, void 0, function* () { - // The initial value of prototype on any newly-created Function instance is a new instance of - // Object, but with the own-property 'constructor' set to point back to the new function. - if (prototypeProp && prototypeProp.constructor === func) { - const descriptors = yield getOwnPropertyDescriptors(prototypeProp); - return descriptors.length === 1 && descriptors[0].name === "constructor"; - } - return false; - }); -} -function createPropertyInfoAsync(descriptor, context, serialize, logInfo) { - return __awaiter(this, void 0, void 0, function* () { - const propertyInfo = { hasValue: descriptor.value !== undefined }; - propertyInfo.configurable = descriptor.configurable; - propertyInfo.enumerable = descriptor.enumerable; - propertyInfo.writable = descriptor.writable; - if (descriptor.get) { - propertyInfo.get = yield getOrCreateEntryAsync(descriptor.get, undefined, context, serialize, logInfo); - } - if (descriptor.set) { - propertyInfo.set = yield getOrCreateEntryAsync(descriptor.set, undefined, context, serialize, logInfo); - } - return propertyInfo; + // Add this promise to the leak candidates list, and schedule it for removal if it resolves. + leakCandidates.add(p); + return p.then((val) => { + leakCandidates.delete(p); + return val; + }).catch((err) => { + leakCandidates.delete(p); + err.promise = p; + throw err; }); } -function getOrCreateNameEntryAsync(name, capturedObjectProperties, context, serialize, logInfo) { - return getOrCreateEntryAsync(name, capturedObjectProperties, context, serialize, logInfo); -} +exports.debuggablePromise = debuggablePromise; /** - * serializeAsync serializes an object, deeply, into something appropriate for an environment - * entry. If propNames is provided, and is non-empty, then only attempt to serialize out those - * specific properties. If propNames is not provided, or is empty, serialize out all properties. + * errorString produces a string from an error, conditionally including additional diagnostics. + * @internal */ -function getOrCreateEntryAsync(obj, capturedObjectProperties, context, serialize, logInfo) { - return __awaiter(this, void 0, void 0, function* () { - // Check if this is a special number that we cannot json serialize. Instead, we'll just inject - // the code necessary to represent the number on the other side. Note: we have to do this - // before we do *anything* else. This is because these special numbers don't even work in maps - // properly. So, if we lookup the value in a map, we may get the cached value for something - // else *entirely*. For example, 0 and -0 will map to the same entry. - if (typeof obj === "number") { - if (Object.is(obj, -0)) { - return { expr: "-0" }; - } - if (Object.is(obj, NaN)) { - return { expr: "NaN" }; - } - if (Object.is(obj, Infinity)) { - return { expr: "Infinity" }; - } - if (Object.is(obj, -Infinity)) { - return { expr: "-Infinity" }; - } - // Not special, just use normal json serialization. - return { json: obj }; - } - // See if we have a cache hit. If yes, use the object as-is. - let entry = context.cache.get(obj); - if (entry) { - // Even though we've already serialized out this object, it might be the case - // that we serialized out a different set of properties than the current set - // we're being asked to serialize. So we have to make sure that all these props - // are actually serialized. - if (entry.object) { - yield serializeObjectAsync(); - } - return entry; - } - if (obj instanceof Function && utils_1.hasTrueBooleanMember(obj, "doNotCapture")) { - // If we get a function we're not supposed to capture, then actually just serialize - // out a function that will throw at runtime so the user can understand the problem - // better. - const funcName = obj.name || "anonymous"; - const funcCode = getTrimmedFunctionCode(obj); - const message = `Function '${funcName}' cannot be called at runtime. ` + - `It can only be used at deployment time.\n\n${funcCode}`; - const errorFunc = () => { throw new Error(message); }; - obj = errorFunc; - } - // We may be processing recursive objects. Because of that, we preemptively put a placeholder - // entry in the cache. That way, if we encounter this obj again while recursing we can just - // return that placeholder. - entry = {}; - context.cache.set(obj, entry); - yield dispatchAnyAsync(); - return entry; - function doNotCapture() { - if (!serialize(obj)) { - // caller explicitly does not want us to capture this value. - return true; - } - if (utils_1.hasTrueBooleanMember(obj, "doNotCapture")) { - // object has set itself as something that should not be captured. - return true; - } - if (obj instanceof Function && - isDerivedNoCaptureConstructor(obj)) { - // this was a constructor that derived from something that should not be captured. - return true; - } - return false; - } - function dispatchAnyAsync() { - return __awaiter(this, void 0, void 0, function* () { - const typeofObj = typeof obj; - if (doNotCapture()) { - // We do not want to capture this object. Explicit set .json to undefined so - // that we will see that the property is set and we will simply roundtrip this - // as the 'undefined value. - entry.json = undefined; - return; - } - if (obj === undefined || - obj === null || - typeofObj === "boolean" || - typeofObj === "string") { - // Serialize primitives as-is. - entry.json = obj; - return; - } - else if (typeofObj === "bigint") { - entry.expr = `${obj}n`; - return; - } - else if (obj instanceof RegExp) { - entry.regexp = obj; - return; - } - const normalizedModuleName = yield findNormalizedModuleNameAsync(obj); - if (normalizedModuleName) { - yield captureModuleAsync(normalizedModuleName); - } - else if (obj instanceof Function) { - // Serialize functions recursively, and store them in a closure property. - entry.function = yield analyzeFunctionInfoAsync(obj, context, serialize, logInfo); - } - else if (output_1.Output.isInstance(obj)) { - if (yield output_1.isSecretOutput(obj)) { - context.containsSecrets = true; - } - entry.output = yield createOutputEntryAsync(obj); - } - else if (obj instanceof Promise) { - const val = yield obj; - entry.promise = yield getOrCreateEntryAsync(val, undefined, context, serialize, logInfo); - } - else if (obj instanceof Array) { - // Recursively serialize elements of an array. Note: we use getOwnPropertyNames as the - // array may be sparse and we want to properly respect that when serializing. - entry.array = []; - for (const descriptor of yield getOwnPropertyDescriptors(obj)) { - if (descriptor.name !== undefined && - descriptor.name !== "length") { - entry.array[descriptor.name] = yield getOrCreateEntryAsync(yield getOwnPropertyAsync(obj, descriptor), undefined, context, serialize, logInfo); - } - } - // TODO(cyrusn): It feels weird that we're not examining any other descriptors of an - // array. For example, if someone put on a property with a symbolic name, we'd lose - // that here. Unlikely, but something we may need to handle in the future. - } - else if (Object.prototype.toString.call(obj) === "[object Arguments]") { - // From: https://stackoverflow.com/questions/7656280/how-do-i-check-whether-an-object-is-an-arguments-object-in-javascript - entry.array = []; - for (const elem of obj) { - entry.array.push(yield getOrCreateEntryAsync(elem, undefined, context, serialize, logInfo)); - } - } - else { - // For all other objects, serialize out the properties we've been asked to serialize - // out. - yield serializeObjectAsync(); - } - }); - } - function serializeObjectAsync() { - return __awaiter(this, void 0, void 0, function* () { - // Serialize the set of property names asked for. If we discover that any of them - // use this/super, then go and reserialize all the properties. - const serializeAll = yield serializeObjectWorkerAsync(capturedObjectProperties || []); - if (serializeAll) { - yield serializeObjectWorkerAsync([]); - } - }); - } - // Returns 'true' if the caller (serializeObjectAsync) should call this again, but without any - // property filtering. - function serializeObjectWorkerAsync(localCapturedPropertyChains) { - return __awaiter(this, void 0, void 0, function* () { - entry.object = entry.object || { env: new Map() }; - if (localCapturedPropertyChains.length === 0) { - yield serializeAllObjectPropertiesAsync(entry.object); - return false; - } - else { - return yield serializeSomeObjectPropertiesAsync(entry.object, localCapturedPropertyChains); - } - }); - } - // Serializes out all the properties of this object. Used when we can't prove that - // only a subset of properties are used on this object. - function serializeAllObjectPropertiesAsync(object) { - return __awaiter(this, void 0, void 0, function* () { - // we wanted to capture everything (including the prototype chain) - const descriptors = yield getOwnPropertyDescriptors(obj); - for (const descriptor of descriptors) { - const keyEntry = yield getOrCreateEntryAsync(getNameOrSymbol(descriptor), undefined, context, serialize, logInfo); - // We're about to recurse inside this object. In order to prevent infinite loops, put a - // dummy entry in the environment map. That way, if we hit this object again while - // recursing we won't try to generate this property. - // - // Note: we only stop recursing if we hit exactly our sentinel key (i.e. we're self - // recursive). We *do* want to recurse through the object again if we see it through - // non-recursive paths. That's because we might be hitting this object through one - // prop-name-path, but we created it the first time through another prop-name path. - // - // By processing the object again, we will add the different members we need. - if (object.env.has(keyEntry) && object.env.get(keyEntry) === undefined) { - continue; - } - object.env.set(keyEntry, undefined); - const propertyInfo = yield createPropertyInfoAsync(descriptor, context, serialize, logInfo); - const prop = yield getOwnPropertyAsync(obj, descriptor); - const valEntry = yield getOrCreateEntryAsync(prop, undefined, context, serialize, logInfo); - // Now, replace the dummy entry with the actual one we want. - object.env.set(keyEntry, { info: propertyInfo, entry: valEntry }); - } - // If the object's __proto__ is not Object.prototype, then we have to capture what it - // actually is. On the other end, we'll use Object.create(deserializedProto) to set - // things up properly. - // - // We don't need to capture the prototype if the user is not capturing 'this' either. - if (!object.proto) { - const proto = Object.getPrototypeOf(obj); - if (proto !== Object.prototype) { - object.proto = yield getOrCreateEntryAsync(proto, undefined, context, serialize, logInfo); - } - } - }); - } - // Serializes out only the subset of properties of this object that we have seen used - // and have recorded in localCapturedPropertyChains - function serializeSomeObjectPropertiesAsync(object, localCapturedPropertyChains) { - return __awaiter(this, void 0, void 0, function* () { - // validate our invariants. - for (const chain of localCapturedPropertyChains) { - if (chain.infos.length === 0) { - throw new Error("Expected a non-empty chain."); - } - } - // we only want to capture a subset of properties. We can do this as long those - // properties don't somehow end up involving referencing "this" in an 'invoked' - // capacity (in which case we need to completely realize the object. - // - // this is slightly tricky as it's not obvious if a property is a getter/setter - // and this is implicitly invoked just by access it. - // Find the list of property names *directly* accessed off this object. - const propChainFirstNames = new Set(localCapturedPropertyChains.map(chain => chain.infos[0].name)); - // Now process each top level property name accessed off of this object in turn. For - // example, if we say "foo.bar.baz", "foo.bar.quux", "foo.ztesch", this would "bar" and - // "ztesch". - for (const propName of propChainFirstNames) { - // Get the named chains starting with this prop name. In the above example, if - // this was "bar", then we would get "[bar, baz]" and [bar, quux]. - const propChains = localCapturedPropertyChains.filter(chain => chain.infos[0].name === propName); - // Now, make an entry just for this name. - const keyEntry = yield getOrCreateNameEntryAsync(propName, undefined, context, serialize, logInfo); - // We're about to recurse inside this object. In order to prevent infinite loops, put a - // dummy entry in the environment map. That way, if we hit this object again while - // recursing we won't try to generate this property. - // - // Note: we only stop recursing if we hit exactly our sentinel key (i.e. we're self - // recursive). We *do* want to recurse through the object again if we see it through - // non-recursive paths. That's because we might be hitting this object through one - // prop-name-path, but we created it the first time through another prop-name path. - // - // By processing the object again, we will add the different members we need. - if (object.env.has(keyEntry) && object.env.get(keyEntry) === undefined) { - continue; - } - object.env.set(keyEntry, undefined); - const objPropValue = yield getPropertyAsync(obj, propName); - const propertyInfo = yield getPropertyInfoAsync(obj, propName); - if (!propertyInfo) { - if (objPropValue !== undefined) { - throw new Error("Could not find property info for real property on object: " + propName); - } - // User code referenced a property not actually on the object at all. - // So to properly represent that, we don't place any information about - // this property on the object. - object.env.delete(keyEntry); - } - else { - // Determine what chained property names we're accessing off of this sub-property. - // if we have no sub property name chain, then indicate that with an empty array - // so that we capture the entire object. - // - // i.e.: if we started with a.b.c.d, and we've finally gotten to the point where - // we're serializing out the 'd' property, then we need to serialize it out fully - // since there are no more accesses off of it. - let nestedPropChains = propChains.map(chain => ({ infos: chain.infos.slice(1) })); - if (nestedPropChains.some(chain => chain.infos.length === 0)) { - nestedPropChains = []; - } - // Note: objPropValue can be undefined here. That's the case where the - // object does have the property, but the property is just set to the - // undefined value. - const valEntry = yield getOrCreateEntryAsync(objPropValue, nestedPropChains, context, serialize, logInfo); - const infos = propChains.map(chain => chain.infos[0]); - if (propInfoUsesNonLexicalThis(infos, propertyInfo, valEntry)) { - // the referenced function captured 'this'. Have to serialize out - // this entire object. Undo the work we did to just serialize out a - // few properties. - object.env.clear(); - // Signal our caller to serialize the entire object. - return true; - } - // Now, replace the dummy entry with the actual one we want. - object.env.set(keyEntry, { info: propertyInfo, entry: valEntry }); - } - } - return false; - }); - } - function propInfoUsesNonLexicalThis(capturedInfos, propertyInfo, valEntry) { - if (capturedInfos.some(info => info.invoked)) { - // If the property was invoked, then we have to check if that property ends - // up using this/super. if so, then we actually have to serialize out this - // object entirely. - if (usesNonLexicalThis(valEntry)) { - return true; - } - } - // if we're accessing a getter/setter, and that getter/setter uses - // 'this', then we need to serialize out this object entirely. - if (usesNonLexicalThis(propertyInfo ? propertyInfo.get : undefined) || - usesNonLexicalThis(propertyInfo ? propertyInfo.set : undefined)) { - return true; - } - return false; - } - function getPropertyInfoAsync(on, key) { - return __awaiter(this, void 0, void 0, function* () { - for (let current = on; current; current = Object.getPrototypeOf(current)) { - const desc = Object.getOwnPropertyDescriptor(current, key); - if (desc) { - const closurePropDescriptor = createClosurePropertyDescriptor(key, desc); - const propertyInfo = yield createPropertyInfoAsync(closurePropDescriptor, context, serialize, logInfo); - return propertyInfo; - } - } - return undefined; - }); - } - function usesNonLexicalThis(localEntry) { - return localEntry && localEntry.function && localEntry.function.usesNonLexicalThis; - } - function captureModuleAsync(normalizedModuleName) { - return __awaiter(this, void 0, void 0, function* () { - // Splitting on "/" is safe to do as this module name is already in a normalized form. - const moduleParts = normalizedModuleName.split("/"); - const nodeModulesSegment = "node_modules"; - const nodeModulesSegmentIndex = moduleParts.findIndex(v => v === nodeModulesSegment); - const isInNodeModules = nodeModulesSegmentIndex >= 0; - const isLocalModule = normalizedModuleName.startsWith(".") && !isInNodeModules; - if (utils_1.hasTrueBooleanMember(obj, "deploymentOnlyModule") || isLocalModule) { - // Try to serialize deployment-time and local-modules by-value. - // - // A deployment-only modules can't ever be successfully 'required' on the 'inside'. But - // parts of it may be serializable on the inside (i.e. pulumi.Config). So just try to - // capture this as a value. If it fails, we will give the user a good message. - // Otherwise, it may succeed if the user is only using a small part of the API that is - // serializable (like pulumi.Config) - // - // Or this is a reference to a local module (i.e. starts with '.', but isn't in - // /node_modules/ somewhere). Always capture the local module as a value. We do this - // because capturing as a reference (i.e. 'require(...)') has the following problems: - // - // 1. 'require(...)' will not work at run-time, because the user's code will not be - // serialized in a way that can actually be require'd (i.e. it is not ) serialized - // into any sort of appropriate file/folder structure for those 'require's to work. - // - // 2. if we stop here and capture as a reference, then we won't actually see and walk - // the code that exists in those local modules (direct or transitive). So we won't - // actually generate the serialized code for the functions or values in that module. - // This will also lead to code that simply will not work at run-time. - yield serializeObjectAsync(); - } - else { - // If the path goes into node_modules, strip off the node_modules part. This will help - // ensure that lookup of those modules will work on the cloud-side even if the module - // isn't in a relative node_modules directory. For example, this happens with aws-sdk. - // It ends up actually being in /var/runtime/node_modules inside aws lambda. - // - // This also helps ensure that modules that are 'yarn link'ed are found properly. The - // module path we have may be on some non-local path due to the linking, however this - // will ensure that the module-name we load is a simple path that can be found off the - // node_modules that we actually upload with our serialized functions. - entry.module = isInNodeModules - ? package_1.getModuleFromPath(upath.join(...moduleParts.slice(nodeModulesSegmentIndex + 1))) - : normalizedModuleName; - } - }); - } - function createOutputEntryAsync(output) { - return __awaiter(this, void 0, void 0, function* () { - // We have an Output. This is effectively just a wrapped value 'V' at deployment-time. - // We want to effectively generate a value post serialization effectively equivalent to `new - // SerializedOutput(V)`. It is tempting to want to just do the following: - // - // const val = await output.promise(); - // return await getOrCreateEntryAsync(new SerializedOutput(val), undefined, context, serialize, logInfo); - // - // That seems like it would work. We're instantiating a SerializedOutput that will point at - // the underlying 'val' instance, and we're then serializing that entire object to be - // rehydrated on the other side. - // - // However, there's a subtlety here that we need to avoid. Specifically, in a world where - // we are never actually looking at real values, but are instead looking at 'Mirrors' of - // values, we never want to serialize something that actually points at a Mirror (like the - // SerializedOutput instance would). The reason for this is that if we then go to serialize - // the SerializedOutput, our Inspector APIs will hit the Mirror value and then get a Mirror - // for *that* Mirror. I.e. a Mirror. This is not what we want and will cause us to - // generate code that actually produces a Mirror object at cloud-runtime time instead of - // producing the real value. - // - // To avoid this, do something tricky. We first create an 'empty' SerializedObject. i.e. - // - // new SerializedOutput(undefined) - // - // We then serialize that instance (which we know must be an 'Object-Entry'). We then - // serialize out 'V', getting back the Entry for it. We then manually jam in that Entry - // into the Object-Entry for the SerializedOutput instance. - // First get the underlying value of the out, and create the environment entry for it. - const val = yield output.promise(); - const valEntry = yield getOrCreateEntryAsync(val, undefined, context, serialize, logInfo); - // Now, create an empty-serialized output and create an environment entry for it. It - // will have a property 'value' that points to an Entry for 'undefined'. - const initializedEmptyOutput = new SerializedOutput(undefined); - const emptyOutputEntry = yield getOrCreateEntryAsync(initializedEmptyOutput, undefined, context, serialize, logInfo); - // validate that we created the right sort of entry. It should be an Object-Entry with - // a single property called 'value' in it. - if (!emptyOutputEntry.object) { - throw new Error("Did not get an 'object' in the entry for a serialized output"); - } - const envEntries = [...emptyOutputEntry.object.env.entries()]; - if (envEntries.length !== 1) { - throw new Error("Expected SerializedOutput object to only have one property: " + envEntries.length); - } - const [envEntry] = envEntries[0]; - if (envEntry.json !== "value") { - throw new Error("Expected SerializedOutput object sole property to be called 'value': " + envEntry.json); - } - // Everything looked good. Replace the `"value" -> undefined-Entry` mapping in this entry - // with `"value" -> V-Entry` - emptyOutputEntry.object.env.set(envEntry, { entry: valEntry }); - return emptyOutputEntry; - }); - } - }); -} -// Is this a constructor derived from a noCapture constructor. if so, we don't want to -// emit it. We would be unable to actually hook up the "super()" call as one of the base -// constructors was set to not be captured. -function isDerivedNoCaptureConstructor(func) { - for (let current = func; current; current = Object.getPrototypeOf(current)) { - if (utils_1.hasTrueBooleanMember(current, "doNotCapture")) { - return true; - } - } - return false; -} -let builtInModules; -function getBuiltInModules() { - if (!builtInModules) { - builtInModules = computeBuiltInModules(); - } - return builtInModules; - function computeBuiltInModules() { - return __awaiter(this, void 0, void 0, function* () { - // These modules are built-in to Node.js, and are available via `require(...)` - // but are not stored in the `require.cache`. They are guaranteed to be - // available at the unqualified names listed below. _Note_: This list is derived - // based on Node.js 6.x tree at: https://github.com/nodejs/node/tree/v6.x/lib - const builtInModuleNames = [ - "assert", "buffer", "child_process", "cluster", "console", "constants", "crypto", - "dgram", "dns", "domain", "events", "fs", "http", "https", "module", "net", "os", - "path", "process", "punycode", "querystring", "readline", "repl", "stream", "string_decoder", - /* "sys" deprecated ,*/ "timers", "tls", "tty", "url", "util", "v8", "vm", "zlib", - ]; - const map = new Map(); - for (const name of builtInModuleNames) { - map.set(require(name), name); - } - return map; - }); - } -} -// findNormalizedModuleName attempts to find a global name bound to the object, which can be used as -// a stable reference across serialization. For built-in modules (i.e. "os", "fs", etc.) this will -// return that exact name of the module. Otherwise, this will return the relative path to the -// module from the current working directory of the process. This will normally be something of the -// form ./node_modules/... -// -// This function will also always return modules in a normalized form (i.e. all path components will -// be '/'). -function findNormalizedModuleNameAsync(obj) { - return __awaiter(this, void 0, void 0, function* () { - // First, check the built-in modules - const modules = yield getBuiltInModules(); - const key = modules.get(obj); - if (key) { - return key; - } - // Next, check the Node module require cache, which will store cached values - // of all non-built-in Node modules loaded by the program so far. _Note_: We - // don't pre-compute this because the require cache will get populated - // dynamically during execution. - for (const path of Object.keys(require.cache)) { - const c = require.cache[path]; - if (c !== undefined && c.exports === obj) { - // Rewrite the path to be a local module reference relative to the current working - // directory. - const modPath = upath.relative(process.cwd(), path); - return "./" + modPath; - } - } - // Else, return that no global name is available for this object. - return undefined; - }); -} -function createClosurePropertyDescriptor(nameOrSymbol, descriptor) { - if (nameOrSymbol === undefined) { - throw new Error("Was not given a name or symbol"); - } - const copy = Object.assign({}, descriptor); - if (typeof nameOrSymbol === "string") { - copy.name = nameOrSymbol; - } - else { - copy.symbol = nameOrSymbol; - } - return copy; -} -function getOwnPropertyDescriptors(obj) { - return __awaiter(this, void 0, void 0, function* () { - const result = []; - for (const name of Object.getOwnPropertyNames(obj)) { - if (name === "__proto__") { - // don't return prototypes here. If someone wants one, they should call - // Object.getPrototypeOf. Note: this is the standard behavior of - // Object.getOwnPropertyNames. However, the Inspector API returns these, and we want to - // filter them out. - continue; - } - const descriptor = Object.getOwnPropertyDescriptor(obj, name); - if (!descriptor) { - throw new Error(`Could not get descriptor for ${name} on: ${JSON.stringify(obj)}`); - } - result.push(createClosurePropertyDescriptor(name, descriptor)); - } - for (const symbol of Object.getOwnPropertySymbols(obj)) { - const descriptor = Object.getOwnPropertyDescriptor(obj, symbol); - if (!descriptor) { - throw new Error(`Could not get descriptor for symbol ${symbol.toString()} on: ${JSON.stringify(obj)}`); - } - result.push(createClosurePropertyDescriptor(symbol, descriptor)); - } - return result; - }); -} -function getOwnPropertyAsync(obj, descriptor) { - return __awaiter(this, void 0, void 0, function* () { - return (descriptor.get || descriptor.set) ? - undefined : - obj[getNameOrSymbol(descriptor)]; - }); -} -function getPropertyAsync(obj, name) { - return __awaiter(this, void 0, void 0, function* () { - return obj[name]; - }); -} -function getNameOrSymbol(descriptor) { - if (descriptor.symbol === undefined && descriptor.name === undefined) { - throw new Error("Descriptor didn't have symbol or name: " + JSON.stringify(descriptor)); +function errorString(err) { + if (err.stack) { + return err.stack; } - return descriptor.symbol || descriptor.name; + return err.toString(); } -//# sourceMappingURL=createClosure.js.map +exports.errorString = errorString; +//# sourceMappingURL=debuggable.js.map /***/ }), -/***/ 44585: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4800: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2022, Pulumi Corporation. +// Copyright 2016-2021, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40548,1025 +38214,358 @@ function getNameOrSymbol(descriptor) { // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const upath = __nccwpck_require__(8004); -// TODO[issue] handle https://nodejs.org/api/packages.html#package-entry-points -// -// Warning: Introducing the "exports" field prevents consumers of a package from using -// any entry points that are not defined, including the package.json -// (e.g. require("your-package/package.json"). This will likely be a breaking change. -function getPackageDefinition(path) { - try { - const directories = path.split(upath.sep); - let last = undefined; - let lastFullPath = undefined; - while (directories.length > 0) { - const curPath = directories.join(upath.sep); - try { - lastFullPath = require.resolve(curPath); - last = curPath; - } - catch (e) { - // current path is not a module - } - directories.pop(); - } - if (last === undefined || lastFullPath === undefined) { - throw new Error(`no package.json found for ${path}`); - } - const packageDefinitionAbsPath = lastFullPath.slice(0, lastFullPath.indexOf(last)) + last + "/package.json"; - return require(packageDefinitionAbsPath); - } - catch (err) { - return undefined; - } -} -// a module's implementations are leaves of the document tree. -function getAllLeafStrings(objectOrPath, opts) { - if (objectOrPath === null) { - // module blacklisted return no implementations - return []; - } - if (typeof objectOrPath === "string") { - return [objectOrPath]; - } - const strings = []; - for (const [key, value] of Object.entries(objectOrPath)) { - if (opts && !opts.isRequire && key === "require") { - continue; - } - if (opts && !opts.isImport && key === "import") { - continue; - } - const leaves = getAllLeafStrings(value); - if (leaves === []) { - // if there's an environment where this export does not work, - // don't suggest requires from this match as a more preferable path may - // match this file. - return []; - } - strings.push(...leaves); - } - return strings; +const grpc = __nccwpck_require__(7025); +const log = __nccwpck_require__(642); +const output_1 = __nccwpck_require__(3037); +const debuggable_1 = __nccwpck_require__(257); +const rpc_1 = __nccwpck_require__(60); +const settings_1 = __nccwpck_require__(4530); +const resource_1 = __nccwpck_require__(796); +const utils = __nccwpck_require__(1888); +const asyncIterableUtil_1 = __nccwpck_require__(6358); +const gstruct = __nccwpck_require__(8152); +const providerproto = __nccwpck_require__(8870); +const resourceproto = __nccwpck_require__(2480); +/** + * `invoke` dynamically invokes the function, `tok`, which is offered by a provider plugin. `invoke` + * behaves differently in the case that options contains `{async:true}` or not. + * + * In the case where `{async:true}` is present in the options bag: + * + * 1. the result of `invoke` will be a Promise resolved to the result value of the provider plugin. + * 2. the `props` inputs can be a bag of computed values (including, `T`s, `Promise`s, + * `Output`s etc.). + * + * + * In the case where `{async:true}` is not present in the options bag: + * + * 1. the result of `invoke` will be a Promise resolved to the result value of the provider call. + * However, that Promise will *also* have the respective values of the Provider result exposed + * directly on it as properties. + * + * 2. The inputs must be a bag of simple values, and the result is the result that the Provider + * produced. + * + * Simple values are: + * 1. `undefined`, `null`, string, number or boolean values. + * 2. arrays of simple values. + * 3. objects containing only simple values. + * + * Importantly, simple values do *not* include: + * 1. `Promise`s + * 2. `Output`s + * 3. `Asset`s or `Archive`s + * 4. `Resource`s. + * + * All of these contain async values that would prevent `invoke from being able to operate + * synchronously. + */ +function invoke(tok, props, opts = {}) { + return invokeAsync(tok, props, opts); } -// from https://github.com/nodejs/node/blob/b191e66ddf/lib/internal/modules/esm/resolve.js#L686 -function patternKeyCompare(a, b) { - const aPatternIndex = a.indexOf("*"); - const bPatternIndex = b.indexOf("*"); - const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; - const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - if (baseLenA > baseLenB) { - return -1; - } - if (baseLenB > baseLenA) { - return 1; - } - if (aPatternIndex === -1) { - return 1; - } - if (bPatternIndex === -1) { - return -1; - } - if (a.length > b.length) { - return -1; - } - if (b.length > a.length) { - return 1; - } - return 0; -} -function makeRule(srcPattern, modPattern) { - const srcSplit = srcPattern.split("*"); // NodeJS doesn't error out when provided multiple '*'. - const modSplit = modPattern.split("*"); - if (srcSplit.length > 2 || modSplit.length > 2) { - // there is undefined behavior on more than 1 "*" - // see https://github.com/nodejs/node/blob/b191e66ddf/lib/internal/modules/esm/resolve.js#L664 - throw new Error("multiple wildcards in single export target specification"); - } - const [srcPrefix, srcSuffix] = srcSplit; - const [modPrefix, modSuffix] = modSplit; - return [srcPrefix, { - modPrefix, - modSuffix: (modSuffix || ""), - srcSuffix: (srcSuffix || ""), - }]; -} -class WildcardMap { - constructor(matches) { - this.map = {}; - const rules = []; - for (const [match, srcPaths] of matches) { - for (const srcPath of srcPaths) { - if (srcPath.includes("*")) { - // wildcard match - rules.push(makeRule(srcPath, match)); - continue; +exports.invoke = invoke; +function streamInvoke(tok, props, opts = {}) { + return __awaiter(this, void 0, void 0, function* () { + const label = `StreamInvoking function: tok=${tok} asynchronously`; + log.debug(label + (settings_1.excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``)); + // Wait for all values to be available, and then perform the RPC. + const done = settings_1.rpcKeepAlive(); + try { + const serialized = yield rpc_1.serializeProperties(`streamInvoke:${tok}`, props); + log.debug(`StreamInvoke RPC prepared: tok=${tok}` + settings_1.excessiveDebugOutput + ? `, obj=${JSON.stringify(serialized)}` + : ``); + // Fetch the monitor and make an RPC request. + const monitor = settings_1.getMonitor(); + const provider = yield resource_1.ProviderResource.register(getProvider(tok, opts)); + const req = createInvokeRequest(tok, serialized, provider, opts); + // Call `streamInvoke`. + const result = monitor.streamInvoke(req, {}); + const queue = new asyncIterableUtil_1.PushableAsyncIterable(); + result.on("data", function (thing) { + const live = deserializeResponse(tok, thing); + queue.push(live); + }); + result.on("error", (err) => { + if (err.code === 1) { + return; } - this.map[srcPath] = match; - } - } - this.rules = rules.sort((a, b) => patternKeyCompare(a[0], b[0])); - } - get(srcName) { - if (this.map[srcName]) { - return this.map[srcName]; - } - for (const [srcPrefix, srcRule] of this.rules) { - if (!srcName.startsWith(srcPrefix) || !srcName.endsWith(srcRule.srcSuffix)) { - continue; - } - const srcSubpath = srcName.slice(srcPrefix.length, srcName.length - srcRule.srcSuffix.length); - const result = srcRule.modPrefix + srcSubpath + srcRule.modSuffix; - return result; - } - return undefined; - } -} -function isConditionalSugar(exports, name) { - // exports sugar does not handle mixing ["./path/to/module"] path keys - // and ["default"|"require"|"import"] conditional keys - // details https://github.com/nodejs/node/blob/b191e66ddf/lib/internal/modules/esm/resolve.js#L593 - let isSugar = false; - for (const key of Object.keys(exports)) { - if (isSugar && key.startsWith(".")) { - throw new Error(`${name}:package.json "exports" cannot contain some keys starting with "." and some not.` + - " The exports object must either be an object of package subpath keys" + - " or an object of main entry condition name keys only."); + throw err; + }); + result.on("end", () => { + queue.complete(); + }); + // Return a cancellable handle to the stream. + return new StreamInvokeResponse(queue, () => result.cancel()); } - if (!key.startsWith(".")) { - isSugar = true; - continue; + finally { + done(); } - } - return isSugar; + }); } -class ModuleMap { - constructor(name, exports, opts) { - this.name = name; - if (isConditionalSugar(exports, name)) { - // the exports keys are not paths meaning it is an exports sugar we need to simplify - exports = { ".": exports }; - } - const rules = []; - for (const [modPath, objectOrPath] of Object.entries(exports)) { - const modName = name + modPath.slice(1); - const leaves = getAllLeafStrings(objectOrPath, opts); - rules.push([modName, leaves.map(leaf => name + leaf.slice(1))]); +exports.streamInvoke = streamInvoke; +function invokeAsync(tok, props, opts) { + return __awaiter(this, void 0, void 0, function* () { + const label = `Invoking function: tok=${tok} asynchronously`; + log.debug(label + (settings_1.excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``)); + // Wait for all values to be available, and then perform the RPC. + const done = settings_1.rpcKeepAlive(); + try { + const serialized = yield rpc_1.serializeProperties(`invoke:${tok}`, props); + log.debug(`Invoke RPC prepared: tok=${tok}` + settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(serialized)}` : ``); + // Fetch the monitor and make an RPC request. + const monitor = settings_1.getMonitor(); + const provider = yield resource_1.ProviderResource.register(getProvider(tok, opts)); + const req = createInvokeRequest(tok, serialized, provider, opts); + const resp = yield debuggable_1.debuggablePromise(new Promise((innerResolve, innerReject) => monitor.invoke(req, (err, innerResponse) => { + log.debug(`Invoke RPC finished: tok=${tok}; err: ${err}, resp: ${innerResponse}`); + if (err) { + // If the monitor is unavailable, it is in the process of shutting down or has already + // shut down. Don't emit an error and don't do any more RPCs, just exit. + if (err.code === grpc.status.UNAVAILABLE || err.code === grpc.status.CANCELLED) { + settings_1.terminateRpcs(); + err.message = "Resource monitor is terminating"; + innerReject(err); + return; + } + // If the RPC failed, rethrow the error with a native exception and the message that + // the engine provided - it's suitable for user presentation. + innerReject(new Error(err.details)); + } + else { + innerResolve(innerResponse); + } + })), label); + // Finally propagate any other properties that were given to us as outputs. + return deserializeResponse(tok, resp); } - this.wildcardMap = new WildcardMap(rules); - } - get(srcName) { - const modPath = this.wildcardMap.get(srcName); - if (modPath === undefined) { - throw new Error(`package.json export path for "${srcName}" not found`); + finally { + done(); } - return modPath; - } + }); } -/* - We need to resolve from a source file path to a valid module export. - - Exports to source file is a many-to-one relationship. Reversing this is a one-to-many relationship. - Any of the initial exports are aliases to the same module and - we assume to be semantically equivalent. This makes it a one-to-any relationship. - for example, - <./package.json> - "exports": { - "./foo.js": "./lib/index.js", - "./bar.js": "./lib/index.js", - } - we will resolve ./lib/index.js into either ./foo.js or ./bar.js - a module can resolve into many files conditionally, but aliases are treated as equivalent. - - Due to null specifiers for modules and this one-to-many relationship, we assume that anything with a - null specifier may be unreachable on a different platform and opt for a different alias to cover it if - it exists. - - Exports ending in "/" will be deprecated by node. - - - For more details https://nodejs.org/api/esm.html#resolution-algorithm -*/ -function getModuleFromPath(path, packageDefinition, opts = { isRequire: true }) { - packageDefinition = packageDefinition || getPackageDefinition(path); - if (packageDefinition === undefined) { - return path; - } - if (packageDefinition.exports === undefined) { - return path; +// StreamInvokeResponse represents a (potentially infinite) streaming response to `streamInvoke`, +// with facilities to gracefully cancel and clean up the stream. +class StreamInvokeResponse { + constructor(source, cancelSource) { + this.source = source; + this.cancelSource = cancelSource; } - if (typeof packageDefinition.exports === "string") { - return packageDefinition.name; + // cancel signals the `streamInvoke` should be cancelled and cleaned up gracefully. + cancel() { + this.cancelSource(); } - if (typeof packageDefinition.exports === "object") { - const modMap = new ModuleMap(packageDefinition.name, packageDefinition.exports, opts); - const modulePath = modMap.get(path); - return modulePath; + [Symbol.asyncIterator]() { + return this.source[Symbol.asyncIterator](); } - return path; } -exports.getModuleFromPath = getModuleFromPath; -//# sourceMappingURL=package.js.map - -/***/ }), - -/***/ 48338: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const ts = __nccwpck_require__(4440); -const log = __nccwpck_require__(80642); -const utils = __nccwpck_require__(21866); -// These are the special globals we've marked as ones we do not want to capture by value. -// These values have a dual meaning. They mean one thing at deployment time and one thing -// at cloud-execution time. By **not** capturing-by-value we take the view that the user -// wants the cloud-execution time view of things. -const nodeModuleGlobals = { - "__dirname": true, - "__filename": true, - // We definitely should not try to capture/serialize 'require'. Not only will it bottom - // out as a native function, but it is definitely something the user intends to run - // against the right module environment at cloud-execution time and not deployment time. - "require": true, -}; -// Gets the text of the provided function (using .toString()) and massages it so that it is a legal -// function declaration. Note: this ties us heavily to V8 and its representation for functions. In -// particular, it has expectations around how functions/lambdas/methods/generators/constructors etc. -// are represented. If these change, this will likely break us. -/** @internal */ -function parseFunction(funcString) { - const [error, functionCode] = parseFunctionCode(funcString); - if (error) { - return [error, undefined]; - } - // In practice it's not guaranteed that a function's toString is parsable by TypeScript. - // V8 intrinsics are prefixed with a '%' and TypeScript does not consider that to be a valid - // identifier. - const [parseError, file] = createSourceFile(functionCode); - if (parseError) { - return [parseError, undefined]; - } - const capturedVariables = computeCapturedVariableNames(file); - // if we're looking at an arrow function, the it is always using lexical 'this's - // so we don't have to bother even examining it. - const usesNonLexicalThis = !functionCode.isArrowFunction && computeUsesNonLexicalThis(file); - const result = functionCode; - result.capturedVariables = capturedVariables; - result.usesNonLexicalThis = usesNonLexicalThis; - if (result.capturedVariables.required.has("this")) { - return [ - "arrow function captured 'this'. Assign 'this' to another name outside function and capture that.", - result, - ]; +exports.StreamInvokeResponse = StreamInvokeResponse; +function createInvokeRequest(tok, serialized, provider, opts) { + if (provider !== undefined && typeof provider !== "string") { + throw new Error("Incorrect provider type."); } - return ["", result]; + const obj = gstruct.Struct.fromJavaScript(serialized); + const req = new resourceproto.ResourceInvokeRequest(); + req.setTok(tok); + req.setArgs(obj); + req.setProvider(provider); + req.setVersion(opts.version || ""); + req.setAcceptresources(!utils.disableResourceReferences); + return req; } -exports.parseFunction = parseFunction; -function parseFunctionCode(funcString) { - if (funcString.startsWith("[Function:")) { - return [`the function form was not understood.`, undefined]; - } - // Split this constant out so that if this function *itself* is closure serialized, - // it will not be thought to be native code itself. - const nativeCodeString = "[native " + "code]"; - if (funcString.indexOf(nativeCodeString) !== -1) { - return [`it was a native code function.`, undefined]; - } - // There are three general forms of node toString'ed Functions we're trying to find out here. - // - // 1. `[mods] (...) => ... - // - // i.e. an arrow function. We need to ensure that arrow-functions stay arrow-functions, - // and non-arrow-functions end up looking like normal `function` functions. This will make - // it so that we can correctly handle 'this' properly depending on if that should be - // treated as the lexical capture of 'this' or the non-lexical 'this'. - // - // 2. `class Foo { ... }` - // - // i.e. node uses the entire string of a class when toString'ing the constructor function - // for it. - // - // 3. `[mods] function ... - // - // i.e. a normal function (maybe async, maybe a get/set function, but def not an arrow - // function) - if (tryParseAsArrowFunction(funcString)) { - return ["", { funcExprWithoutName: funcString, isArrowFunction: true }]; - } - // First check to see if this startsWith 'class'. If so, this is definitely a class. This - // works as Node does not place preceding comments on a class/function, allowing us to just - // directly see if we've started with the right text. - if (funcString.startsWith("class ")) { - // class constructor function. We want to get the actual constructor - // in the class definition (synthesizing an empty one if one does not) - // exist. - const [file, firstDiagnostic] = tryCreateSourceFile(funcString); - if (firstDiagnostic) { - return [`the class could not be parsed: ${firstDiagnostic}`, undefined]; - } - const classDecl = file.statements.find(x => ts.isClassDeclaration(x)); - if (!classDecl) { - return [`the class form was not understood:\n${funcString}`, undefined]; - } - const constructor = classDecl.members.find(m => ts.isConstructorDeclaration(m)); - if (!constructor) { - // class without explicit constructor. - const isSubClass = classDecl.heritageClauses && classDecl.heritageClauses.some(c => c.token === ts.SyntaxKind.ExtendsKeyword); - return isSubClass - ? makeFunctionDeclaration("constructor() { super(); }", /*isAsync:*/ false, /*isFunctionDeclaration:*/ false) - : makeFunctionDeclaration("constructor() { }", /*isAsync:*/ false, /*isFunctionDeclaration:*/ false); - } - const constructorCode = funcString.substring(constructor.getStart(file, /*includeJsDocComment*/ false), constructor.end).trim(); - return makeFunctionDeclaration(constructorCode, /*isAsync:*/ false, /*isFunctionDeclaration: */ false); - } - let isAsync = false; - if (funcString.startsWith("async ")) { - isAsync = true; - funcString = funcString.slice("async".length).trimLeft(); - } - if (funcString.startsWith("function get ") || funcString.startsWith("function set ")) { - const trimmed = funcString.slice("function get".length); - return makeFunctionDeclaration(trimmed, isAsync, /*isFunctionDeclaration: */ false); - } - if (funcString.startsWith("get ") || funcString.startsWith("set ")) { - const trimmed = funcString.slice("get ".length); - return makeFunctionDeclaration(trimmed, isAsync, /*isFunctionDeclaration: */ false); - } - if (funcString.startsWith("function")) { - const trimmed = funcString.slice("function".length); - return makeFunctionDeclaration(trimmed, isAsync, /*isFunctionDeclaration: */ true); - } - // Add "function" (this will make methods parseable). i.e. "foo() { }" becomes - // "function foo() { }" - // this also does the right thing for functions with computed names. - return makeFunctionDeclaration(funcString, isAsync, /*isFunctionDeclaration: */ false); -} -function tryParseAsArrowFunction(toParse) { - const [file] = tryCreateSourceFile(toParse); - if (!file || file.statements.length !== 1) { - return false; - } - const firstStatement = file.statements[0]; - return ts.isExpressionStatement(firstStatement) && - ts.isArrowFunction(firstStatement.expression); -} -function makeFunctionDeclaration(v, isAsync, isFunctionDeclaration) { - let prefix = isAsync ? "async " : ""; - prefix += "function "; - v = v.trimLeft(); - if (v.startsWith("*")) { - v = v.slice(1).trimLeft(); - prefix = "function* "; - } - const openParenIndex = v.indexOf("("); - if (openParenIndex < 0) { - return [`the function form was not understood.`, undefined]; - } - if (isComputed(v, openParenIndex)) { - v = v.slice(openParenIndex); - return ["", { - funcExprWithoutName: prefix + v, - funcExprWithName: prefix + "__computed" + v, - functionDeclarationName: undefined, - isArrowFunction: false, - }]; - } - const nameChunk = v.slice(0, openParenIndex); - const funcName = utils.isLegalMemberName(nameChunk) - ? utils.isLegalFunctionName(nameChunk) ? nameChunk : "/*" + nameChunk + "*/" - : ""; - const commentedName = utils.isLegalMemberName(nameChunk) ? "/*" + nameChunk + "*/" : ""; - v = v.slice(openParenIndex).trimLeft(); - return ["", { - funcExprWithoutName: prefix + commentedName + v, - funcExprWithName: prefix + funcName + v, - functionDeclarationName: isFunctionDeclaration ? nameChunk : undefined, - isArrowFunction: false, - }]; -} -function isComputed(v, openParenIndex) { - if (openParenIndex === 0) { - // node 8 and lower use no name at all for computed members. - return true; - } - if (v.length > 0 && v.charAt(0) === "[") { - // node 10 actually has the name as: [expr] - return true; - } - return false; +function getProvider(tok, opts) { + return opts.provider ? opts.provider : + opts.parent ? opts.parent.getProvider(tok) : undefined; } -function createSourceFile(serializedFunction) { - const funcstr = serializedFunction.funcExprWithName || serializedFunction.funcExprWithoutName; - // Wrap with parens to make into something parseable. This is necessary as many - // types of functions are valid function expressions, but not valid function - // declarations. i.e. "function () { }". This is not a valid function declaration - // (it's missing a name). But it's totally legal as "(function () { })". - const toParse = "(" + funcstr + ")"; - const [file, firstDiagnostic] = tryCreateSourceFile(toParse); - if (firstDiagnostic) { - return [`the function could not be parsed: ${firstDiagnostic}`, null]; - } - return ["", file]; -} -function tryCreateSourceFile(toParse) { - const file = ts.createSourceFile("", toParse, ts.ScriptTarget.Latest, /*setParentNodes:*/ true, ts.ScriptKind.TS); - const diagnostics = file.parseDiagnostics; - if (diagnostics.length) { - return [undefined, `${diagnostics[0].messageText}`]; - } - return [file, undefined]; -} -function computeUsesNonLexicalThis(file) { - let inTopmostFunction = false; - let usesNonLexicalThis = false; - ts.forEachChild(file, walk); - return usesNonLexicalThis; - function walk(node) { - if (!node) { - return; - } - switch (node.kind) { - case ts.SyntaxKind.SuperKeyword: - case ts.SyntaxKind.ThisKeyword: - usesNonLexicalThis = true; - break; - case ts.SyntaxKind.CallExpression: - return visitCallExpression(node); - case ts.SyntaxKind.MethodDeclaration: - case ts.SyntaxKind.FunctionDeclaration: - case ts.SyntaxKind.FunctionExpression: - return visitBaseFunction(node); - // Note: it is intentional that we ignore ArrowFunction. If we use 'this' inside of it, - // then that should be considered a use of the non-lexical-this from an outer function. - // i.e. - // function f() { var v = () => console.log(this) } - // - // case ts.SyntaxKind.ArrowFunction: - default: - break; - } - ts.forEachChild(node, walk); - } - function visitBaseFunction(node) { - if (inTopmostFunction) { - // we're already in the topmost function. No need to descend into any - // further functions. - return; - } - // Entering the topmost function. - inTopmostFunction = true; - // Now, visit its body to see if we use 'this/super'. - walk(node.body); - inTopmostFunction = false; - } - function visitCallExpression(node) { - // Most call expressions are normal. But we must special case one kind of function: - // TypeScript's __awaiter functions. They are of the form `__awaiter(this, void 0, void 0, - // function* (){})`, - // The first 'this' argument is passed along in case the expression awaited uses 'this'. - // However, doing that can be very bad for us as in many cases the 'this' just refers to the - // surrounding module, and the awaited expression won't be using that 'this' at all. - walk(node.expression); - if (isAwaiterCall(node)) { - const lastFunction = node.arguments[3]; - walk(lastFunction.body); - return; - } - // For normal calls, just walk all arguments normally. - for (const arg of node.arguments) { - walk(arg); +function deserializeResponse(tok, resp) { + const failures = resp.getFailuresList(); + if (failures && failures.length) { + let reasons = ""; + for (let i = 0; i < failures.length; i++) { + if (reasons !== "") { + reasons += "; "; + } + reasons += `${failures[i].getReason()} (${failures[i].getProperty()})`; } + throw new Error(`Invoke of '${tok}' failed: ${reasons}`); } + const ret = resp.getReturn(); + return ret === undefined + ? ret + : rpc_1.deserializeProperties(ret); } /** - * computeCapturedVariableNames computes the set of free variables in a given function string. Note that this string is - * expected to be the usual V8-serialized function expression text. + * `call` dynamically calls the function, `tok`, which is offered by a provider plugin. */ -function computeCapturedVariableNames(file) { - // Now that we've parsed the file, compute the free variables, and return them. - let required = new Map(); - let optional = new Map(); - const scopes = []; - let functionVars = new Set(); - // Recurse through the tree. We use typescript's AST here and generally walk the entire - // tree. One subtlety to be aware of is that we generally assume that when we hit an - // identifier that it either introduces a new variable, or it lexically references a - // variable. This clearly doesn't make sense for *all* identifiers. For example, if you - // have "console.log" then "console" tries to lexically reference a variable, but "log" does - // not. So, to avoid that being an issue, we carefully decide when to recurse. For - // example, for member access expressions (i.e. A.B) we do not recurse down the right side. - ts.forEachChild(file, walk); - // Now just return all variables whose value is true. Filter out any that are part of the built-in - // Node.js global object, however, since those are implicitly availble on the other side of serialization. - const result = { required: new Map(), optional: new Map() }; - for (const key of required.keys()) { - if (!isBuiltIn(key)) { - result.required.set(key, required.get(key).concat(optional.has(key) ? optional.get(key) : [])); - } - } - for (const key of optional.keys()) { - if (!isBuiltIn(key) && !required.has(key)) { - result.optional.set(key, optional.get(key)); - } - } - log.debug(`Found free variables: ${JSON.stringify(result)}`); - return result; - function isBuiltIn(ident) { - // __awaiter and __rest are never considered built-in. We do this as async/await code will generate - // an __awaiter (so we will need it), but some libraries (like tslib) will add this to the 'global' - // object. The same is true for __rest when destructuring. - // If we think these are built-in, we won't serialize them, and the functions may not - // actually be available if the import that caused it to get attached isn't included in the - // final serialized code. - if (ident === "__awaiter" || ident === "__rest") { - return false; - } - // Anything in the global dictionary is a built-in. So is anything that's a global Node.js object; - // note that these only exist in the scope of modules, and so are not truly global in the usual sense. - // See https://nodejs.org/api/globals.html for more details. - return global.hasOwnProperty(ident) || nodeModuleGlobals[ident]; - } - function currentScope() { - return scopes[scopes.length - 1]; - } - function visitIdentifier(node) { - // Remember undeclared identifiers during the walk, as they are possibly free. - const name = node.text; - for (let i = scopes.length - 1; i >= 0; i--) { - if (scopes[i].has(name)) { - // This is currently known in the scope chain, so do not add it as free. - return; - } - } - // We reached the top of the scope chain and this wasn't found; it's captured. - const capturedPropertyChain = determineCapturedPropertyChain(node); - if (node.parent.kind === ts.SyntaxKind.TypeOfExpression) { - // "typeof undeclared_id" is legal in JS (and is actually used in libraries). So keep - // track that we would like to capture this variable, but mark that capture as optional - // so we will not throw if we aren't able to find it in scope. - optional.set(name, combineProperties(optional.get(name), capturedPropertyChain)); - } - else { - required.set(name, combineProperties(required.get(name), capturedPropertyChain)); - } - } - function walk(node) { - if (!node) { - return; - } - switch (node.kind) { - case ts.SyntaxKind.Identifier: - return visitIdentifier(node); - case ts.SyntaxKind.ThisKeyword: - return visitThisExpression(node); - case ts.SyntaxKind.Block: - return visitBlockStatement(node); - case ts.SyntaxKind.CallExpression: - return visitCallExpression(node); - case ts.SyntaxKind.CatchClause: - return visitCatchClause(node); - case ts.SyntaxKind.MethodDeclaration: - return visitMethodDeclaration(node); - case ts.SyntaxKind.MetaProperty: - // don't walk down an es6 metaproperty (i.e. "new.target"). It doesn't - // capture anything. - return; - case ts.SyntaxKind.PropertyAssignment: - return visitPropertyAssignment(node); - case ts.SyntaxKind.PropertyAccessExpression: - return visitPropertyAccessExpression(node); - case ts.SyntaxKind.FunctionDeclaration: - case ts.SyntaxKind.FunctionExpression: - return visitFunctionDeclarationOrExpression(node); - case ts.SyntaxKind.ArrowFunction: - return visitBaseFunction(node, /*isArrowFunction:*/ true, /*name:*/ undefined); - case ts.SyntaxKind.VariableDeclaration: - return visitVariableDeclaration(node); - default: - break; - } - ts.forEachChild(node, walk); - } - function visitThisExpression(node) { - required.set("this", combineProperties(required.get("this"), determineCapturedPropertyChain(node))); - } - function combineProperties(existing, current) { - if (existing && existing.length === 0) { - // We already want to capture everything. Keep things that way. - return existing; - } - if (current === undefined) { - // We want to capture everything. So ignore any properties we've filtered down - // to and just capture them all. - return []; - } - // We want to capture a specific set of properties. Add this set of properties - // into the existing set. - const combined = existing || []; - combined.push(current); - return combined; - } - // Finds nodes of the form `(...expr...).PropName` or `(...expr...)["PropName"]` - // For element access expressions, the argument must be a string literal. - function isPropertyOrElementAccessExpression(node) { - if (ts.isPropertyAccessExpression(node)) { - return true; - } - if (ts.isElementAccessExpression(node) && ts.isStringLiteral(node.argumentExpression)) { - return true; - } - return false; - } - function determineCapturedPropertyChain(node) { - let infos; - // Walk up a sequence of property-access'es, recording the names we hit, until we hit - // something that isn't a property-access. - while (node && - node.parent && - isPropertyOrElementAccessExpression(node.parent) && - node.parent.expression === node) { - if (!infos) { - infos = []; - } - const propOrElementAccess = node.parent; - const name = ts.isPropertyAccessExpression(propOrElementAccess) - ? propOrElementAccess.name.text - : propOrElementAccess.argumentExpression.text; - const invoked = propOrElementAccess.parent !== undefined && - ts.isCallExpression(propOrElementAccess.parent) && - propOrElementAccess.parent.expression === propOrElementAccess; - // Keep track if this name was invoked. If so, we'll have to analyze it later - // to see if it captured 'this' - infos.push({ name, invoked }); - node = propOrElementAccess; - } - if (infos) { - // Invariant checking. - if (infos.length === 0) { - throw new Error("How did we end up with an empty list?"); - } - for (let i = 0; i < infos.length - 1; i++) { - if (infos[i].invoked) { - throw new Error("Only the last item in the dotted chain is allowed to be invoked."); +function call(tok, props, res) { + const label = `Calling function: tok=${tok}`; + log.debug(label + (settings_1.excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``)); + const [out, resolver] = createOutput(`call(${tok})`); + debuggable_1.debuggablePromise(Promise.resolve().then(() => __awaiter(this, void 0, void 0, function* () { + const done = settings_1.rpcKeepAlive(); + try { + // Construct a provider reference from the given provider, if one is available on the resource. + let provider = undefined; + let version = undefined; + let pluginDownloadURL = undefined; + if (res) { + if (res.__prov) { + provider = yield resource_1.ProviderResource.register(res.__prov); } + version = res.__version; + pluginDownloadURL = res.__pluginDownloadURL; } - return { infos }; - } - // For all other cases, capture everything. - return undefined; - } - function visitBlockStatement(node) { - // Push new scope, visit all block statements, and then restore the scope. - scopes.push(new Set()); - ts.forEachChild(node, walk); - scopes.pop(); - } - function visitFunctionDeclarationOrExpression(node) { - // A function declaration is special in one way: its identifier is added to the current function's - // var-style variables, so that its name is in scope no matter the order of surrounding references to it. - if (node.name) { - functionVars.add(node.name.text); - } - visitBaseFunction(node, /*isArrowFunction:*/ false, node.name); - } - function visitBaseFunction(node, isArrowFunction, functionName) { - // First, push new free vars list, scope, and function vars - const savedRequired = required; - const savedOptional = optional; - const savedFunctionVars = functionVars; - required = new Map(); - optional = new Map(); - functionVars = new Set(); - scopes.push(new Set()); - // If this is a named function, it's name is in scope at the top level of itself. - if (functionName) { - functionVars.add(functionName.text); - } - // this/arguments are in scope inside any non-arrow function. - if (!isArrowFunction) { - functionVars.add("this"); - functionVars.add("arguments"); - } - // The parameters of any function are in scope at the top level of the function. - for (const param of node.parameters) { - nameWalk(param.name, /*isVar:*/ true); - // Parse default argument expressions - if (param.initializer) { - walk(param.initializer); - } - } - // Next, visit the body underneath this new context. - walk(node.body); - // Remove any function-scoped variables that we encountered during the walk. - for (const v of functionVars) { - required.delete(v); - optional.delete(v); - } - // Restore the prior context and merge our free list with the previous one. - scopes.pop(); - mergeMaps(savedRequired, required); - mergeMaps(savedOptional, optional); - functionVars = savedFunctionVars; - required = savedRequired; - optional = savedOptional; - } - function mergeMaps(target, source) { - for (const key of source.keys()) { - const sourcePropInfos = source.get(key); - let targetPropInfos = target.get(key); - if (sourcePropInfos.length === 0) { - // we want to capture everything. Make sure that's reflected in the target. - targetPropInfos = []; + // We keep output values when serializing inputs for call. + const [serialized, propertyDepsResources] = yield rpc_1.serializePropertiesReturnDeps(`call:${tok}`, props, { + keepOutputValues: true, + }); + log.debug(`Call RPC prepared: tok=${tok}` + settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(serialized)}` : ``); + const req = yield createCallRequest(tok, serialized, propertyDepsResources, provider, version, pluginDownloadURL); + const monitor = settings_1.getMonitor(); + const resp = yield debuggable_1.debuggablePromise(new Promise((innerResolve, innerReject) => monitor.call(req, (err, innerResponse) => { + log.debug(`Call RPC finished: tok=${tok}; err: ${err}, resp: ${innerResponse}`); + if (err) { + // If the monitor is unavailable, it is in the process of shutting down or has already + // shut down. Don't emit an error and don't do any more RPCs, just exit. + if (err.code === grpc.status.UNAVAILABLE || err.code === grpc.status.CANCELLED) { + settings_1.terminateRpcs(); + err.message = "Resource monitor is terminating"; + innerReject(err); + return; + } + // If the RPC failed, rethrow the error with a native exception and the message that + // the engine provided - it's suitable for user presentation. + innerReject(new Error(err.details)); + } + else { + innerResolve(innerResponse); + } + })), label); + // Deserialize the response and resolve the output. + const deserialized = deserializeResponse(tok, resp); + let isSecret = false; + const deps = []; + // Keep track of whether we need to mark the resulting output a secret. + // and unwrap each individual value. + for (const k of Object.keys(deserialized)) { + const v = deserialized[k]; + if (rpc_1.isRpcSecret(v)) { + isSecret = true; + deserialized[k] = rpc_1.unwrapRpcSecret(v); + } } - else { - // we want to capture a subet of properties. merge that subset into whatever - // subset we've recorded so far. - for (const sourceInfo of sourcePropInfos) { - targetPropInfos = combineProperties(targetPropInfos, sourceInfo); + // Combine the individual dependencies into a single set of dependency resources. + const rpcDeps = resp.getReturndependenciesMap(); + if (rpcDeps) { + const urns = new Set(); + for (const [, returnDeps] of rpcDeps.entries()) { + for (const urn of returnDeps.getUrnsList()) { + urns.add(urn); + } + } + for (const urn of urns) { + deps.push(new resource_1.DependencyResource(urn)); } } - target.set(key, targetPropInfos); - } - } - function visitCatchClause(node) { - scopes.push(new Set()); - // Add the catch pattern to the scope as a variable. Note that it is scoped to our current - // fresh scope (so it can't be seen by the rest of the function). - if (node.variableDeclaration) { - nameWalk(node.variableDeclaration.name, /*isVar:*/ false); + // If the value the engine handed back is or contains an unknown value, the resolver will mark its value as + // unknown automatically, so we just pass true for isKnown here. Note that unknown values will only be + // present during previews (i.e. isDryRun() will be true). + resolver(deserialized, true, isSecret, deps); } - // And then visit the block without adding them as free variables. - walk(node.block); - // Relinquish the scope so the error patterns aren't available beyond the catch. - scopes.pop(); - } - function visitCallExpression(node) { - // Most call expressions are normal. But we must special case one kind of function: - // TypeScript's __awaiter functions. They are of the form `__awaiter(this, void 0, void 0, function* (){})`, - // The first 'this' argument is passed along in case the expression awaited uses 'this'. - // However, doing that can be very bad for us as in many cases the 'this' just refers to the - // surrounding module, and the awaited expression won't be using that 'this' at all. - // - // However, there are cases where 'this' may be legitimately lexically used in the awaited - // expression and should be captured properly. We'll figure this out by actually descending - // explicitly into the "function*(){}" argument, asking it to be treated as if it was - // actually a lambda and not a JS function (with the standard js 'this' semantics). By - // doing this, if 'this' is used inside the function* we'll act as if it's a real lexical - // capture so that we pass 'this' along. - walk(node.expression); - if (isAwaiterCall(node)) { - return visitBaseFunction(node.arguments[3], - /*isArrowFunction*/ true, - /*name*/ undefined); - } - // For normal calls, just walk all arguments normally. - for (const arg of node.arguments) { - walk(arg); - } - } - function visitMethodDeclaration(node) { - if (ts.isComputedPropertyName(node.name)) { - // Don't walk down the 'name' part of the property assignment if it is an identifier. It - // does not capture any variables. However, if it is a computed property name, walk it - // as it may capture variables. - walk(node.name); - } - // Always walk the method. Pass 'undefined' for the name as a method's name is not in scope - // inside itself. - visitBaseFunction(node, /*isArrowFunction:*/ false, /*name:*/ undefined); - } - function visitPropertyAssignment(node) { - if (ts.isComputedPropertyName(node.name)) { - // Don't walk down the 'name' part of the property assignment if it is an identifier. It - // is not capturing any variables. However, if it is a computed property name, walk it - // as it may capture variables. - walk(node.name); - } - // Always walk the property initializer. - walk(node.initializer); - } - function visitPropertyAccessExpression(node) { - // Don't walk down the 'name' part of the property access. It could not capture a free variable. - // i.e. if you have "A.B", we should analyze the "A" part and not the "B" part. - walk(node.expression); - } - function nameWalk(n, isVar) { - if (!n) { - return; + catch (e) { + resolver(undefined, true, false, undefined, e); } - switch (n.kind) { - case ts.SyntaxKind.Identifier: - return visitVariableDeclarationIdentifier(n, isVar); - case ts.SyntaxKind.ObjectBindingPattern: - case ts.SyntaxKind.ArrayBindingPattern: - const bindingPattern = n; - for (const element of bindingPattern.elements) { - if (ts.isBindingElement(element)) { - visitBindingElement(element, isVar); - } - } - return; - default: - return; + finally { + done(); } - } - function visitVariableDeclaration(node) { - // eslint-disable-next-line max-len - const isLet = node.parent !== undefined && ts.isVariableDeclarationList(node.parent) && (node.parent.flags & ts.NodeFlags.Let) !== 0; - // eslint-disable-next-line max-len - const isConst = node.parent !== undefined && ts.isVariableDeclarationList(node.parent) && (node.parent.flags & ts.NodeFlags.Const) !== 0; - const isVar = !isLet && !isConst; - // Walk the declaration's `name` property (which may be an Identifier or Pattern) placing - // any variables we encounter into the right scope. - nameWalk(node.name, isVar); - // Also walk into the variable initializer with the original walker to make sure we see any - // captures on the right hand side. - walk(node.initializer); - } - function visitVariableDeclarationIdentifier(node, isVar) { - // If the declaration is an identifier, it isn't a free variable, for whatever scope it - // pertains to (function-wide for var and scope-wide for let/const). Track it so we can - // remove any subseqeunt references to that variable, so we know it isn't free. - if (isVar) { - functionVars.add(node.text); + })), label); + return out; +} +exports.call = call; +function createOutput(label) { + let resolveValue; + let rejectValue; + let resolveIsKnown; + let rejectIsKnown; + let resolveIsSecret; + let rejectIsSecret; + let resolveDeps; + let rejectDeps; + const resolver = (v, isKnown, isSecret, deps = [], err) => { + if (!!err) { + rejectValue(err); + rejectIsKnown(err); + rejectIsSecret(err); + rejectDeps(err); } else { - currentScope().add(node.text); + resolveValue(v); + resolveIsKnown(isKnown); + resolveIsSecret(isSecret); + resolveDeps(deps); } - } - function visitBindingElement(node, isVar) { - // array and object patterns can be quite complex. You can have: - // - // var {t} = val; // lookup a property in 'val' called 't' and place into a variable 't'. - // var {t: m} = val; // lookup a property in 'val' called 't' and place into a variable 'm'. - // var {t: } = val; // lookup a property in 'val' called 't' and decompose further into the pattern. - // - // And, for all of the above, you can have: - // - // var {t = def} = val; - // var {t: m = def} = val; - // var {t: = def} = val; - // - // These are the same as the above, except that if there is no property 't' in 'val', - // then the default value will be used. - // - // You can also have at the end of the literal: { ...rest} - // Walk the name portion, looking for names to add. for - // - // var {t} // this will be 't'. - // - // for - // - // var {t: m} // this will be 'm' - // - // and for - // - // var {t: } // this will recurse into the pattern. - // - // and for - // - // ...rest // this will be 'rest' - nameWalk(node.name, isVar); - // if there is a default value, walk it as well, looking for captures. - walk(node.initializer); - // importantly, we do not walk into node.propertyName - // This Name defines what property will be retrieved from the value being pattern - // matched against. Importantly, it does not define a new name put into scope, - // nor does it reference a variable in scope. - } -} -function isAwaiterCall(node) { - const result = ts.isIdentifier(node.expression) && - node.expression.text === "__awaiter" && - node.arguments.length === 4 && - node.arguments[0].kind === ts.SyntaxKind.ThisKeyword && - ts.isFunctionLike(node.arguments[3]); - return result; + }; + const out = new output_1.Output([], debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveValue = resolve; + rejectValue = reject; + }), `${label}Value`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveIsKnown = resolve; + rejectIsKnown = reject; + }), `${label}IsKnown`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveIsSecret = resolve; + rejectIsSecret = reject; + }), `${label}IsSecret`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveDeps = resolve; + rejectDeps = reject; + }), `${label}Deps`)); + return [out, resolver]; } -//# sourceMappingURL=parseFunction.js.map - -/***/ }), - -/***/ 96034: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const ts = __nccwpck_require__(4440); -const utils = __nccwpck_require__(21866); -/** @internal */ -function rewriteSuperReferences(code, isStatic) { - const sourceFile = ts.createSourceFile("", code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); - // Transform any usages of "super(...)" into "__super.call(this, ...)", any - // instance usages of "super.xxx" into "__super.prototype.xxx" and any static - // usages of "super.xxx" into "__super.xxx" - const transformed = ts.transform(sourceFile, [rewriteSuperCallsWorker]); - const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); - const output = printer.printNode(ts.EmitHint.Unspecified, transformed.transformed[0], sourceFile).trim(); - return output; - function rewriteSuperCallsWorker(transformationContext) { - const newNodes = new Set(); - let firstFunctionDeclaration = true; - function visitor(node) { - // Convert the top level function so it doesn't have a name. We want to convert the user - // function to an anonymous function so that interior references to the same function - // bind properly. i.e. if we start with "function f() { f(); }" then this gets converted to - // - // function __f() { - // with ({ f: __f }) { - // return /*f*/() { f(); } - // - // This means the inner call properly binds to the *outer* function we create. - if (firstFunctionDeclaration && ts.isFunctionDeclaration(node)) { - firstFunctionDeclaration = false; - const funcDecl = ts.visitEachChild(node, visitor, transformationContext); - const text = utils.isLegalMemberName(funcDecl.name.text) - ? "/*" + funcDecl.name.text + "*/" : ""; - return ts.updateFunctionDeclaration(funcDecl, funcDecl.decorators, funcDecl.modifiers, funcDecl.asteriskToken, ts.createIdentifier(text), funcDecl.typeParameters, funcDecl.parameters, funcDecl.type, funcDecl.body); - } - if (node.kind === ts.SyntaxKind.SuperKeyword) { - const newNode = ts.createIdentifier("__super"); - newNodes.add(newNode); - return newNode; - } - else if (ts.isPropertyAccessExpression(node) && - node.expression.kind === ts.SyntaxKind.SuperKeyword) { - const expr = isStatic - ? ts.createIdentifier("__super") - : ts.createPropertyAccess(ts.createIdentifier("__super"), "prototype"); - const newNode = ts.updatePropertyAccess(node, expr, node.name); - newNodes.add(newNode); - return newNode; - } - else if (ts.isElementAccessExpression(node) && - node.argumentExpression && - node.expression.kind === ts.SyntaxKind.SuperKeyword) { - const expr = isStatic - ? ts.createIdentifier("__super") - : ts.createPropertyAccess(ts.createIdentifier("__super"), "prototype"); - const newNode = ts.updateElementAccess(node, expr, node.argumentExpression); - newNodes.add(newNode); - return newNode; - } - // for all other nodes, recurse first (so we update any usages of 'super') - // below them - const rewritten = ts.visitEachChild(node, visitor, transformationContext); - if (ts.isCallExpression(rewritten) && - newNodes.has(rewritten.expression)) { - // this was a call to super() or super.x() or super["x"](); - // the super will already have been transformed to __super or - // __super.prototype.x or __super.prototype["x"]. - // - // to that, we have to add the .call(this, ...) call. - const argumentsCopy = rewritten.arguments.slice(); - argumentsCopy.unshift(ts.createThis()); - return ts.updateCall(rewritten, ts.createPropertyAccess(rewritten.expression, "call"), rewritten.typeArguments, argumentsCopy); +function createCallRequest(tok, serialized, serializedDeps, provider, version, pluginDownloadURL) { + return __awaiter(this, void 0, void 0, function* () { + if (provider !== undefined && typeof provider !== "string") { + throw new Error("Incorrect provider type."); + } + const obj = gstruct.Struct.fromJavaScript(serialized); + const req = new providerproto.CallRequest(); + req.setTok(tok); + req.setArgs(obj); + req.setProvider(provider); + req.setVersion(version || ""); + req.setPlugindownloadurl(pluginDownloadURL || ""); + const argDependencies = req.getArgdependenciesMap(); + for (const [key, propertyDeps] of serializedDeps) { + const urns = new Set(); + for (const dep of propertyDeps) { + const urn = yield dep.urn.promise(); + urns.add(urn); } - return rewritten; + const deps = new providerproto.CallRequest.ArgumentDependencies(); + deps.setUrnsList(Array.from(urns)); + argDependencies.set(key, deps); } - return (node) => ts.visitNode(node, visitor); - } + return req; + }); } -exports.rewriteSuperReferences = rewriteSuperReferences; -//# sourceMappingURL=rewriteSuper.js.map +//# sourceMappingURL=invoke.js.map /***/ }), -/***/ 34256: +/***/ 140: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2018, Pulumi Corporation. +// Copyright 2016-2021, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41589,980 +38588,740 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const __1 = __nccwpck_require__(9978); -const closure = __nccwpck_require__(1260); -const utils = __nccwpck_require__(21866); -/** - * serializeFunction serializes a JavaScript function into a text form that can be loaded in another execution context, - * for example as part of a function callback associated with an AWS Lambda. The function serialization captures any - * variables captured by the function body and serializes those values into the generated text along with the function - * body. This process is recursive, so that functions referenced by the body of the serialized function will themselves - * be serialized as well. This process also deeply serializes captured object values, including prototype chains and - * property descriptors, such that the semantics of the function when deserialized should match the original function. - * - * There are several known limitations: - * - If a native function is captured either directly or indirectly, closure serialization will return an error. - * - Captured values will be serialized based on their values at the time that `serializeFunction` is called. Mutations - * to these values after that (but before the deserialized function is used) will not be observed by the deserialized - * function. - * - * @param func The JavaScript function to serialize. - * @param args Arguments to use to control the serialization of the JavaScript function. - */ -function serializeFunction(func, args = {}) { - return __awaiter(this, void 0, void 0, function* () { - const exportName = args.exportName || "handler"; - const serialize = args.serialize || (_ => true); - const isFactoryFunction = args.isFactoryFunction === undefined ? false : args.isFactoryFunction; - const closureInfo = yield closure.createClosureInfoAsync(func, serialize, args.logResource); - if (!args.allowSecrets && closureInfo.containsSecrets) { - throw new Error("Secret outputs cannot be captured by a closure."); - } - return serializeJavaScriptText(closureInfo, exportName, isFactoryFunction); - }); -} -exports.serializeFunction = serializeFunction; -/** - * @deprecated Please use 'serializeFunction' instead. - */ -function serializeFunctionAsync(func, serialize) { - return __awaiter(this, void 0, void 0, function* () { - __1.log.warn("'function serializeFunctionAsync' is deprecated. Please use 'serializeFunction' instead."); - serialize = serialize || (_ => true); - const closureInfo = yield closure.createClosureInfoAsync(func, serialize, /*logResource:*/ undefined); - if (closureInfo.containsSecrets) { - throw new Error("Secret outputs cannot be captured by a closure."); - } - return serializeJavaScriptText(closureInfo, "handler", /*isFactoryFunction*/ false).text; - }); -} -exports.serializeFunctionAsync = serializeFunctionAsync; +const grpc = __nccwpck_require__(7025); +const query = __nccwpck_require__(9160); +const log = __nccwpck_require__(642); +const utils = __nccwpck_require__(1888); +const output_1 = __nccwpck_require__(3037); +const resource_1 = __nccwpck_require__(796); +const resource_2 = __nccwpck_require__(796); +const debuggable_1 = __nccwpck_require__(257); +const invoke_1 = __nccwpck_require__(4800); +const rpc_1 = __nccwpck_require__(60); +const settings_1 = __nccwpck_require__(4530); +const gstruct = __nccwpck_require__(8152); +const resproto = __nccwpck_require__(2480); /** - * serializeJavaScriptText converts a FunctionInfo object into a string representation of a Node.js module body which - * exposes a single function `exports.handler` representing the serialized function. - * - * @param c The FunctionInfo to be serialized into a module string. + * Get an existing resource's state from the engine. */ -function serializeJavaScriptText(outerClosure, exportName, isFactoryFunction) { - // Now produce a textual representation of the closure and its serialized captured environment. - // State used to build up the environment variables for all the funcs we generate. - // In general, we try to create idiomatic code to make the generated code not too - // hideous. For example, we will try to generate code like: - // - // var __e1 = [1, 2, 3] // or - // var __e2 = { a: 1, b: 2, c: 3 } - // - // However, for non-common cases (i.e. sparse arrays, objects with configured properties, - // etc. etc.) we will spit things out in a much more verbose fashion that eschews - // prettyness for correct semantics. - const envEntryToEnvVar = new Map(); - const envVarNames = new Set(); - const functionInfoToEnvVar = new Map(); - let environmentText = ""; - let functionText = ""; - const outerFunctionName = emitFunctionAndGetName(outerClosure.func); - if (environmentText) { - environmentText = "\n" + environmentText; - } - // Export the appropriate value. For a normal function, this will just be exporting the name of - // the module function we created by serializing it. For a factory function this will export - // the function produced by invoking the factory function once. - let text; - const exportText = `exports.${exportName} = ${outerFunctionName}${isFactoryFunction ? "()" : ""};`; - if (isFactoryFunction) { - // for a factory function, we need to call the function at the end. That way all the logic - // to set up the environment has run. - text = environmentText + functionText + "\n" + exportText; - } - else { - text = exportText + "\n" + environmentText + functionText; - } - return { text, exportName, containsSecrets: outerClosure.containsSecrets }; - function emitFunctionAndGetName(functionInfo) { - // If this is the first time seeing this function, then actually emit the function code for - // it. Otherwise, just return the name of the emitted function for anyone that wants to - // reference it from their own code. - let functionName = functionInfoToEnvVar.get(functionInfo); - if (!functionName) { - functionName = functionInfo.name - ? createEnvVarName(functionInfo.name, /*addIndexAtEnd:*/ false) - : createEnvVarName("f", /*addIndexAtEnd:*/ true); - functionInfoToEnvVar.set(functionInfo, functionName); - emitFunctionWorker(functionInfo, functionName); - } - return functionName; - } - function emitFunctionWorker(functionInfo, varName) { - const capturedValues = envFromEnvObj(functionInfo.capturedValues); - const thisCapture = capturedValues.this; - const argumentsCapture = capturedValues.arguments; - delete capturedValues.this; - delete capturedValues.arguments; - const parameters = [...Array(functionInfo.paramCount)].map((_, index) => `__${index}`).join(", "); - functionText += "\n" + - "function " + varName + "(" + parameters + ") {\n" + - " return (function() {\n" + - " with(" + envObjToString(capturedValues) + ") {\n\n" + - "return " + functionInfo.code + ";\n\n" + - " }\n" + - " }).apply(" + thisCapture + ", " + argumentsCapture + ").apply(this, arguments);\n" + - "}\n"; - // If this function is complex (i.e. non-default __proto__, or has properties, etc.) - // then emit those as well. - emitComplexObjectProperties(varName, varName, functionInfo); - if (functionInfo.proto !== undefined) { - const protoVar = envEntryToString(functionInfo.proto, `${varName}_proto`); - environmentText += `Object.setPrototypeOf(${varName}, ${protoVar});\n`; - } - } - function envFromEnvObj(env) { - const envObj = {}; - for (const [keyEntry, { entry: valEntry }] of env) { - if (typeof keyEntry.json !== "string") { - throw new Error("PropertyMap key was not a string."); - } - const key = keyEntry.json; - const val = envEntryToString(valEntry, key); - envObj[key] = val; - } - return envObj; - } - function envEntryToString(envEntry, varName) { - const envVar = envEntryToEnvVar.get(envEntry); - if (envVar !== undefined) { - return envVar; - } - // Complex objects may also be referenced from multiple functions. As such, we have to - // create variables for them in the environment so that all references to them unify to the - // same reference to the env variable. Effectively, we need to do this for any object that - // could be compared for reference-identity. Basic types (strings, numbers, etc.) have - // value semantics and this can be emitted directly into the code where they are used as - // there is no way to observe that you are getting a different copy. - if (isObjOrArrayOrRegExp(envEntry)) { - return complexEnvEntryToString(envEntry, varName); - } - else { - // Other values (like strings, bools, etc.) can just be emitted inline. - return simpleEnvEntryToString(envEntry, varName); - } - } - function simpleEnvEntryToString(envEntry, varName) { - if (envEntry.hasOwnProperty("json")) { - return JSON.stringify(envEntry.json); - } - else if (envEntry.function !== undefined) { - return emitFunctionAndGetName(envEntry.function); - } - else if (envEntry.module !== undefined) { - return `require("${envEntry.module}")`; - } - else if (envEntry.output !== undefined) { - return envEntryToString(envEntry.output, varName); - } - else if (envEntry.expr) { - // Entry specifies exactly how it should be emitted. So just use whatever - // it wanted. - return envEntry.expr; - } - else if (envEntry.promise) { - return `Promise.resolve(${envEntryToString(envEntry.promise, varName)})`; - } - else { - throw new Error("Malformed: " + JSON.stringify(envEntry)); - } - } - function complexEnvEntryToString(envEntry, varName) { - // Call all environment variables __e to make them unique. But suffix - // them with the original name of the property to help provide context when - // looking at the source. - const envVar = createEnvVarName(varName, /*addIndexAtEnd:*/ false); - envEntryToEnvVar.set(envEntry, envVar); - if (envEntry.object) { - emitObject(envVar, envEntry.object, varName); - } - else if (envEntry.array) { - emitArray(envVar, envEntry.array, varName); - } - else if (envEntry.regexp) { - const { source, flags } = envEntry.regexp; - const regexVal = `new RegExp(${JSON.stringify(source)}, ${JSON.stringify(flags)})`; - const entryString = `var ${envVar} = ${regexVal};\n`; - environmentText += entryString; - } - return envVar; - } - function createEnvVarName(baseName, addIndexAtEnd) { - const trimLeadingUnderscoreRegex = /^_*/g; - const legalName = makeLegalJSName(baseName).replace(trimLeadingUnderscoreRegex, ""); - let index = 0; - let currentName = addIndexAtEnd - ? "__" + legalName + index - : "__" + legalName; - while (envVarNames.has(currentName)) { - currentName = addIndexAtEnd - ? "__" + legalName + index - : "__" + index + "_" + legalName; - index++; - } - envVarNames.add(currentName); - return currentName; - } - function emitObject(envVar, obj, varName) { - const complex = isComplex(obj); - if (complex) { - // we have a complex child. Because of the possibility of recursion in - // the object graph, we have to spit out this variable uninitialized first. - // Then we can walk our children, creating a single assignment per child. - // This way, if the child ends up referencing us, we'll have already emitted - // the **initialized** variable for them to reference. - if (obj.proto) { - const protoVar = envEntryToString(obj.proto, `${varName}_proto`); - environmentText += `var ${envVar} = Object.create(${protoVar});\n`; - } - else { - environmentText += `var ${envVar} = {};\n`; - } - emitComplexObjectProperties(envVar, varName, obj); - } - else { - // All values inside this obj are simple. We can just emit the object - // directly as an object literal with all children embedded in the literal. - const props = []; - for (const [keyEntry, { entry: valEntry }] of obj.env) { - const keyName = typeof keyEntry.json === "string" ? keyEntry.json : "sym"; - const propName = envEntryToString(keyEntry, keyName); - const propVal = simpleEnvEntryToString(valEntry, keyName); - if (typeof keyEntry.json === "string" && utils.isLegalMemberName(keyEntry.json)) { - props.push(`${keyEntry.json}: ${propVal}`); - } - else { - props.push(`[${propName}]: ${propVal}`); +function getResource(res, parent, props, custom, urn) { + // Extract the resource type from the URN. + const urnParts = urn.split("::"); + const qualifiedType = urnParts[2]; + const urnName = urnParts[3]; + const type = qualifiedType.split("$").pop(); + const label = `resource:urn=${urn}`; + log.debug(`Getting resource: urn=${urn}`); + const monitor = settings_1.getMonitor(); + const resopAsync = prepareResource(label, res, parent, custom, false, props, {}); + const preallocError = new Error(); + debuggable_1.debuggablePromise(resopAsync.then((resop) => __awaiter(this, void 0, void 0, function* () { + const inputs = yield rpc_1.serializeProperties(label, { urn }); + const req = new resproto.ResourceInvokeRequest(); + req.setTok("pulumi:pulumi:getResource"); + req.setArgs(gstruct.Struct.fromJavaScript(inputs)); + req.setProvider(""); + req.setVersion(""); + // Now run the operation, serializing the invocation if necessary. + const opLabel = `monitor.getResource(${label})`; + runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { + let resp = {}; + let err; + try { + if (monitor) { + resp = yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.invoke(req, (rpcError, innerResponse) => { + log.debug(`getResource Invoke RPC finished: err: ${rpcError}, resp: ${innerResponse}`); + if (rpcError) { + if (rpcError.code === grpc.status.UNAVAILABLE || rpcError.code === grpc.status.CANCELLED) { + err = rpcError; + settings_1.terminateRpcs(); + rpcError.message = "Resource monitor is terminating"; + preallocError.code = rpcError.code; + } + preallocError.message = `failed to get resource:urn=${urn}: ${rpcError.message}`; + reject(new Error(rpcError.details)); + } + else { + resolve(innerResponse); + } + })), opLabel); + // If the invoke failed, raise an error + const failures = resp.getFailuresList(); + if (failures && failures.length) { + let reasons = ""; + for (let i = 0; i < failures.length; i++) { + if (reasons !== "") { + reasons += "; "; + } + reasons += `${failures[i].getReason()} (${failures[i].getProperty()})`; + } + throw new Error(`getResource Invoke failed: ${reasons}`); + } + // Otherwise, return the response. + const m = resp.getReturn().getFieldsMap(); + resp = { + urn: m.get("urn").toJavaScript(), + id: m.get("id").toJavaScript() || undefined, + state: m.get("state").getStructValue(), + }; } } - const allProps = props.join(", "); - const entryString = `var ${envVar} = {${allProps}};\n`; - environmentText += entryString; - } - function isComplex(o) { - if (obj.proto !== undefined) { - return true; + catch (e) { + err = e; + resp = { + urn: "", + id: undefined, + state: undefined, + }; } - for (const v of o.env.values()) { - if (entryIsComplex(v)) { - return true; - } + resop.resolveURN(resp.urn, err); + // Note: 'id || undefined' is intentional. We intentionally collapse falsy values to + // undefined so that later parts of our system don't have to deal with values like 'null'. + if (resop.resolveID) { + const id = resp.id || undefined; + resop.resolveID(id, id !== undefined, err); } - return false; - } - function entryIsComplex(v) { - return !isSimplePropertyInfo(v.info) || deepContainsObjOrArrayOrRegExp(v.entry); - } + yield resolveOutputs(res, type, urnName, props, resp.state, {}, resop.resolvers, err); + })); + })), label); +} +exports.getResource = getResource; +/** + * Reads an existing custom resource's state from the resource monitor. Note that resources read in this way + * will not be part of the resulting stack's state, as they are presumed to belong to another. + */ +function readResource(res, parent, t, name, props, opts) { + const id = opts.id; + if (!id) { + throw new Error("Cannot read resource whose options are lacking an ID value"); } - function isSimplePropertyInfo(info) { - if (!info) { - return true; - } - return info.enumerable === true && - info.writable === true && - info.configurable === true && - !info.get && !info.set; - } - function emitComplexObjectProperties(envVar, varName, objEntry) { - for (const [keyEntry, { info, entry: valEntry }] of objEntry.env) { - const subName = typeof keyEntry.json === "string" ? keyEntry.json : "sym"; - const keyString = envEntryToString(keyEntry, varName + "_" + subName); - const valString = envEntryToString(valEntry, varName + "_" + subName); - if (isSimplePropertyInfo(info)) { - // normal property. Just emit simply as a direct assignment. - if (typeof keyEntry.json === "string" && utils.isLegalMemberName(keyEntry.json)) { - environmentText += `${envVar}.${keyEntry.json} = ${valString};\n`; + const label = `resource:${name}[${t}]#...`; + log.debug(`Reading resource: id=${output_1.Output.isInstance(id) ? "Output" : id}, t=${t}, name=${name}`); + const monitor = settings_1.getMonitor(); + const resopAsync = prepareResource(label, res, parent, true, false, props, opts); + const preallocError = new Error(); + debuggable_1.debuggablePromise(resopAsync.then((resop) => __awaiter(this, void 0, void 0, function* () { + const resolvedID = yield rpc_1.serializeProperty(label, id, new Set(), { keepOutputValues: false }); + log.debug(`ReadResource RPC prepared: id=${resolvedID}, t=${t}, name=${name}` + + (settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(resop.serializedProps)}` : ``)); + // Create a resource request and do the RPC. + const req = new resproto.ReadResourceRequest(); + req.setType(t); + req.setName(name); + req.setId(resolvedID); + req.setParent(resop.parentURN); + req.setProvider(resop.providerRef); + req.setProperties(gstruct.Struct.fromJavaScript(resop.serializedProps)); + req.setDependenciesList(Array.from(resop.allDirectDependencyURNs)); + req.setVersion(opts.version || ""); + req.setPlugindownloadurl(opts.pluginDownloadURL || ""); + req.setAcceptsecrets(true); + req.setAcceptresources(!utils.disableResourceReferences); + req.setAdditionalsecretoutputsList(opts.additionalSecretOutputs || []); + // Now run the operation, serializing the invocation if necessary. + const opLabel = `monitor.readResource(${label})`; + runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { + let resp = {}; + let err; + try { + if (monitor) { + // If we're attached to the engine, make an RPC call and wait for it to resolve. + resp = yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.readResource(req, (rpcError, innerResponse) => { + log.debug(`ReadResource RPC finished: ${label}; err: ${rpcError}, resp: ${innerResponse}`); + if (rpcError) { + if (rpcError.code === grpc.status.UNAVAILABLE || rpcError.code === grpc.status.CANCELLED) { + err = rpcError; + settings_1.terminateRpcs(); + rpcError.message = "Resource monitor is terminating"; + preallocError.code = rpcError.code; + } + preallocError.message = + `failed to read resource #${resolvedID} '${name}' [${t}]: ${rpcError.message}`; + reject(preallocError); + } + else { + resolve(innerResponse); + } + })), opLabel); } else { - environmentText += `${envVar}${`[${keyString}]`} = ${valString};\n`; - } - } - else { - // complex property. emit as Object.defineProperty - emitDefineProperty(info, valString, keyString); - } - } - function emitDefineProperty(desc, entryValue, propName) { - const copy = {}; - if (desc.configurable) { - copy.configurable = desc.configurable; - } - if (desc.enumerable) { - copy.enumerable = desc.enumerable; - } - if (desc.writable) { - copy.writable = desc.writable; - } - if (desc.get) { - copy.get = envEntryToString(desc.get, `${varName}_get`); - } - if (desc.set) { - copy.set = envEntryToString(desc.set, `${varName}_set`); - } - if (desc.hasValue) { - copy.value = entryValue; - } - const line = `Object.defineProperty(${envVar}, ${propName}, ${envObjToString(copy)});\n`; - environmentText += line; - } - } - function emitArray(envVar, arr, varName) { - if (arr.some(deepContainsObjOrArrayOrRegExp) || isSparse(arr) || hasNonNumericIndices(arr)) { - // we have a complex child. Because of the possibility of recursion in the object - // graph, we have to spit out this variable initialized (but empty) first. Then we can - // walk our children, knowing we'll be able to find this variable if they reference it. - environmentText += `var ${envVar} = [];\n`; - // Walk the names of the array properties directly. This ensures we work efficiently - // with sparse arrays. i.e. if the array has length 1k, but only has one value in it - // set, we can just set htat value, instead of setting 999 undefineds. - for (const key of Object.getOwnPropertyNames(arr)) { - if (key !== "length") { - const entryString = envEntryToString(arr[key], `${varName}_${key}`); - environmentText += `${envVar}${isNumeric(key) ? `[${key}]` : `.${key}`} = ${entryString};\n`; + // If we aren't attached to the engine, in test mode, mock up a fake response for testing purposes. + const mockurn = yield resource_2.createUrn(req.getName(), req.getType(), req.getParent()).promise(); + resp = { + getUrn: () => mockurn, + getProperties: () => req.getProperties(), + }; } } - } - else { - // All values inside this array are simple. We can just emit the array elements in - // place. i.e. we can emit as ``var arr = [1, 2, 3]`` as that's far more preferred than - // having four individual statements to do the same. - const strings = []; - for (let i = 0, n = arr.length; i < n; i++) { - strings.push(simpleEnvEntryToString(arr[i], `${varName}_${i}`)); + catch (e) { + err = e; + resp = { + getUrn: () => "", + getProperties: () => undefined, + }; } - const entryString = `var ${envVar} = [${strings.join(", ")}];\n`; - environmentText += entryString; - } - } -} -serializeJavaScriptText.doNotCapture = true; -const makeLegalRegex = /[^0-9a-zA-Z_]/g; -function makeLegalJSName(n) { - return n.replace(makeLegalRegex, x => ""); -} -function isSparse(arr) { - // getOwnPropertyNames for an array returns all the indices as well as 'length'. - // so we subtract one to get all the real indices. If that's not the same as - // the array length, then we must have missing properties and are thus sparse. - return arr.length !== (Object.getOwnPropertyNames(arr).length - 1); -} -function hasNonNumericIndices(arr) { - return Object.keys(arr).some(k => k !== "length" && !isNumeric(k)); -} -function isNumeric(n) { - return !isNaN(parseFloat(n)) && isFinite(+n); -} -function isObjOrArrayOrRegExp(env) { - return env.object !== undefined || env.array !== undefined || env.regexp !== undefined; -} -function deepContainsObjOrArrayOrRegExp(env) { - return isObjOrArrayOrRegExp(env) || - (env.output !== undefined && deepContainsObjOrArrayOrRegExp(env.output)) || - (env.promise !== undefined && deepContainsObjOrArrayOrRegExp(env.promise)); + // Now resolve everything: the URN, the ID (supplied as input), and the output properties. + resop.resolveURN(resp.getUrn(), err); + resop.resolveID(resolvedID, resolvedID !== undefined, err); + yield resolveOutputs(res, t, name, props, resp.getProperties(), {}, resop.resolvers, err); + })); + })), label); } +exports.readResource = readResource; /** - * Converts an environment object into a string which can be embedded into a serialized function - * body. Note that this is not JSON serialization, as we may have property values which are - * variable references to other global functions. In other words, there can be free variables in the - * resulting object literal. - * - * @param envObj The environment object to convert to a string. + * registerResource registers a new resource object with a given type t and name. It returns the auto-generated + * URN and the ID that will resolve after the deployment has completed. All properties will be initialized to property + * objects that the registration operation will resolve at the right time (or remain unresolved for deployments). */ -function envObjToString(envObj) { - return `{ ${Object.keys(envObj).map(k => `${k}: ${envObj[k]}`).join(", ")} }`; -} -//# sourceMappingURL=serializeClosure.js.map - -/***/ }), - -/***/ 21866: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const ts = __nccwpck_require__(4440); -const legalNameRegex = /^[a-zA-Z_][0-9a-zA-Z_]*$/; -/** @internal */ -function isLegalMemberName(n) { - return legalNameRegex.test(n); -} -exports.isLegalMemberName = isLegalMemberName; -/** @internal */ -function isLegalFunctionName(n) { - if (!isLegalMemberName(n)) { - return false; - } - const scanner = ts.createScanner(ts.ScriptTarget.Latest, /*skipTrivia:*/ false, ts.LanguageVariant.Standard, n); - const tokenKind = scanner.scan(); - if (tokenKind !== ts.SyntaxKind.Identifier && - tokenKind !== ts.SyntaxKind.ConstructorKeyword) { - return false; - } - return true; -} -exports.isLegalFunctionName = isLegalFunctionName; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 74552: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -// This file provides a low-level interface to a few V8 runtime objects. We will use this low-level -// interface when serializing closures to walk the scope chain and find the value of free variables -// captured by closures, as well as getting source-level debug information so that we can present -// high-quality error messages. -// -// As a side-effect of importing this file, we must enable the --allow-natives-syntax V8 flag. This -// is because we are using V8 intrinsics in order to implement this module. -const v8 = __nccwpck_require__(84655); -v8.setFlagsFromString("--allow-natives-syntax"); -const v8Hooks = __nccwpck_require__(9580); -const v8_v10andLower = __nccwpck_require__(83445); -const v8_v11andHigher = __nccwpck_require__(86899); -// Node majorly changed their introspection apis between 10.0 and 11.0 (removing outright some -// of the APIs we use). Detect if we're before or after this change and delegate to the -const versionSpecificV8Module = v8Hooks.isNodeAtLeastV11 ? v8_v11andHigher : v8_v10andLower; -/** - * Given a function and a free variable name, lookupCapturedVariableValue looks up the value of that free variable - * in the scope chain of the provided function. If the free variable is not found, `throwOnFailure` indicates - * whether or not this function should throw or return `undefined. - * - * @param func The function whose scope chain is to be analyzed - * @param freeVariable The name of the free variable to inspect - * @param throwOnFailure If true, throws if the free variable can't be found. - * @returns The value of the free variable. If `throwOnFailure` is false, returns `undefined` if not found. - * @internal - */ -exports.lookupCapturedVariableValueAsync = versionSpecificV8Module.lookupCapturedVariableValueAsync; -/** - * Given a function, returns the file, line and column number in the file where this function was - * defined. Returns { "", 0, 0 } if the location cannot be found or if the given function has no Script. - * @internal - */ -exports.getFunctionLocationAsync = versionSpecificV8Module.getFunctionLocationAsync; -//# sourceMappingURL=v8.js.map - -/***/ }), - -/***/ 9580: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -// Module that hooks into v8 and provides information about it to interested parties. Because this -// hooks into v8 events it is critical that this module is loaded early when the process starts. -// Otherwise, information may not be known when needed. This module is only intended for use on -// Node v11 and higher. -const v8 = __nccwpck_require__(84655); -v8.setFlagsFromString("--allow-natives-syntax"); -const semver = __nccwpck_require__(87486); -// On node11 and above, create an 'inspector session' that can be used to keep track of what is -// happening through a supported API. Pre-11 we can just call into % intrinsics for the same data. -/** @internal */ -exports.isNodeAtLeastV11 = semver.gte(process.version, "11.0.0"); -let session = undefined; -function getSession() { - if (session !== undefined) { - return session; - } - if (!exports.isNodeAtLeastV11) { - return Promise.resolve(undefined); - } - session = createInspectorSessionAsync(); - return session; -} -const scriptIdToUrlMap = new Map(); -function createInspectorSessionAsync() { - return __awaiter(this, void 0, void 0, function* () { - // Delay loading 'inspector' as it is not available on early versions of node, so we can't - // require it on the outside. - const inspector = yield Promise.resolve().then(() => __nccwpck_require__(31405)); - const inspectorSession = new inspector.Session(); - inspectorSession.connect(); - // Enable debugging support so we can hear about the Debugger.scriptParsed event. We need that - // event to know how to map from scriptId's to file-urls. - yield new Promise((resolve, reject) => { - inspectorSession.post("Debugger.enable", (err, res) => err ? reject(err) : resolve(res)); - }); - inspectorSession.addListener("Debugger.scriptParsed", event => { - const { scriptId, url } = event.params; - scriptIdToUrlMap.set(scriptId, url); - }); - return inspectorSession; - }); -} -/** - * Returns the inspector session that can be used to query the state of this running Node instance. - * Must only be called on Node11 and above. On Node10 and below, this will throw. - * @internal - */ -function getSessionAsync() { - return __awaiter(this, void 0, void 0, function* () { - if (!exports.isNodeAtLeastV11) { - throw new Error("Should not call getSessionAsync unless on Node11 or above."); +function registerResource(res, parent, t, name, custom, remote, newDependency, props, opts) { + const label = `resource:${name}[${t}]`; + log.debug(`Registering resource: t=${t}, name=${name}, custom=${custom}, remote=${remote}`); + const monitor = settings_1.getMonitor(); + const resopAsync = prepareResource(label, res, parent, custom, remote, props, opts); + // In order to present a useful stack trace if an error does occur, we preallocate potential + // errors here. V8 captures a stack trace at the moment an Error is created and this stack + // trace will lead directly to user code. Throwing in `runAsyncResourceOp` results in an Error + // with a non-useful stack trace. + const preallocError = new Error(); + debuggable_1.debuggablePromise(resopAsync.then((resop) => __awaiter(this, void 0, void 0, function* () { + log.debug(`RegisterResource RPC prepared: t=${t}, name=${name}` + + (settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(resop.serializedProps)}` : ``)); + const req = new resproto.RegisterResourceRequest(); + req.setType(t); + req.setName(name); + req.setParent(resop.parentURN); + req.setCustom(custom); + req.setObject(gstruct.Struct.fromJavaScript(resop.serializedProps)); + req.setProtect(opts.protect); + req.setProvider(resop.providerRef); + req.setDependenciesList(Array.from(resop.allDirectDependencyURNs)); + req.setDeletebeforereplace(opts.deleteBeforeReplace || false); + req.setDeletebeforereplacedefined(opts.deleteBeforeReplace !== undefined); + req.setIgnorechangesList(opts.ignoreChanges || []); + req.setVersion(opts.version || ""); + req.setAcceptsecrets(true); + req.setAcceptresources(!utils.disableResourceReferences); + req.setAdditionalsecretoutputsList(opts.additionalSecretOutputs || []); + req.setAliasesList(resop.aliases); + req.setImportid(resop.import || ""); + req.setSupportspartialvalues(true); + req.setRemote(remote); + req.setReplaceonchangesList(opts.replaceOnChanges || []); + req.setPlugindownloadurl(opts.pluginDownloadURL || ""); + req.setRetainondelete(opts.retainOnDelete || false); + const customTimeouts = new resproto.RegisterResourceRequest.CustomTimeouts(); + if (opts.customTimeouts != null) { + customTimeouts.setCreate(opts.customTimeouts.create); + customTimeouts.setUpdate(opts.customTimeouts.update); + customTimeouts.setDelete(opts.customTimeouts.delete); } - return getSession(); - }); -} -exports.getSessionAsync = getSessionAsync; -/** - * Returns a promise that can be used to determine when the v8hooks have been injected properly and - * code that depends on them can continue executing. - * @internal - */ -function isInitializedAsync() { - return __awaiter(this, void 0, void 0, function* () { - yield getSession(); - }); + req.setCustomtimeouts(customTimeouts); + const propertyDependencies = req.getPropertydependenciesMap(); + for (const [key, resourceURNs] of resop.propertyToDirectDependencyURNs) { + const deps = new resproto.RegisterResourceRequest.PropertyDependencies(); + deps.setUrnsList(Array.from(resourceURNs)); + propertyDependencies.set(key, deps); + } + const providerRefs = req.getProvidersMap(); + for (const [key, ref] of resop.providerRefs) { + providerRefs.set(key, ref); + } + // Now run the operation, serializing the invocation if necessary. + const opLabel = `monitor.registerResource(${label})`; + runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { + let resp = {}; + let err; + try { + if (monitor) { + // If we're running with an attachment to the engine, perform the operation. + resp = yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.registerResource(req, (rpcErr, innerResponse) => { + if (rpcErr) { + err = rpcErr; + // If the monitor is unavailable, it is in the process of shutting down or has already + // shut down. Don't emit an error and don't do any more RPCs, just exit. + if (rpcErr.code === grpc.status.UNAVAILABLE || rpcErr.code === grpc.status.CANCELLED) { + // Re-emit the message + settings_1.terminateRpcs(); + rpcErr.message = "Resource monitor is terminating"; + preallocError.code = rpcErr.code; + } + // Node lets us hack the message as long as we do it before accessing the `stack` property. + log.debug(`RegisterResource RPC finished: ${label}; err: ${rpcErr}, resp: ${innerResponse}`); + preallocError.message = `failed to register new resource ${name} [${t}]: ${rpcErr.message}`; + reject(preallocError); + } + else { + log.debug(`RegisterResource RPC finished: ${label}; err: ${rpcErr}, resp: ${innerResponse}`); + resolve(innerResponse); + } + })), opLabel); + } + else { + // If we aren't attached to the engine, in test mode, mock up a fake response for testing purposes. + const mockurn = yield resource_2.createUrn(req.getName(), req.getType(), req.getParent()).promise(); + resp = { + getUrn: () => mockurn, + getId: () => undefined, + getObject: () => req.getObject(), + getPropertydependenciesMap: () => undefined, + }; + } + } + catch (e) { + err = e; + resp = { + getUrn: () => "", + getId: () => undefined, + getObject: () => req.getObject(), + getPropertydependenciesMap: () => undefined, + }; + } + resop.resolveURN(resp.getUrn(), err); + // Note: 'id || undefined' is intentional. We intentionally collapse falsy values to + // undefined so that later parts of our system don't have to deal with values like 'null'. + if (resop.resolveID) { + const id = resp.getId() || undefined; + resop.resolveID(id, id !== undefined, err); + } + const deps = {}; + const rpcDeps = resp.getPropertydependenciesMap(); + if (rpcDeps) { + for (const [k, propertyDeps] of resp.getPropertydependenciesMap().entries()) { + const urns = propertyDeps.getUrnsList(); + deps[k] = urns.map(urn => newDependency(urn)); + } + } + // Now resolve the output properties. + yield resolveOutputs(res, t, name, props, resp.getObject(), deps, resop.resolvers, err); + })); + })), label); } -exports.isInitializedAsync = isInitializedAsync; +exports.registerResource = registerResource; /** - * Maps from a script-id to the local file url it corresponds to. - * @internal + * Prepares for an RPC that will manufacture a resource, and hence deals with input and output + * properties. */ -function getScriptUrl(id) { - return scriptIdToUrlMap.get(id); -} -exports.getScriptUrl = getScriptUrl; -//# sourceMappingURL=v8Hooks.js.map - -/***/ }), - -/***/ 83445: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const semver = __nccwpck_require__(87486); -const isNodeAtLeastV10 = semver.gte(process.version, "10.0.0"); -// `GetFunctionScopeDetails` returns a raw JavaScript array. This enum enumerates the objects that -// are at specific indices of the array. We only care about one of these. -var V8ScopeDetailsFields; -(function (V8ScopeDetailsFields) { - V8ScopeDetailsFields[V8ScopeDetailsFields["kScopeDetailsTypeIndex"] = 0] = "kScopeDetailsTypeIndex"; - V8ScopeDetailsFields[V8ScopeDetailsFields["kScopeDetailsObjectIndex"] = 1] = "kScopeDetailsObjectIndex"; - V8ScopeDetailsFields[V8ScopeDetailsFields["kScopeDetailsNameIndex"] = 2] = "kScopeDetailsNameIndex"; - V8ScopeDetailsFields[V8ScopeDetailsFields["kScopeDetailsStartPositionIndex"] = 3] = "kScopeDetailsStartPositionIndex"; - V8ScopeDetailsFields[V8ScopeDetailsFields["kScopeDetailsEndPositionIndex"] = 4] = "kScopeDetailsEndPositionIndex"; - V8ScopeDetailsFields[V8ScopeDetailsFields["kScopeDetailsFunctionIndex"] = 5] = "kScopeDetailsFunctionIndex"; -})(V8ScopeDetailsFields || (V8ScopeDetailsFields = {})); -/** @internal */ -function getFunctionLocationAsync(func) { +function prepareResource(label, res, parent, custom, remote, props, opts) { + var _a; return __awaiter(this, void 0, void 0, function* () { - const script = getScript(func); - const { line, column } = getLineColumn(); - return { file: script ? script.name : "", line, column }; - function getLineColumn() { - if (script) { - const pos = getSourcePosition(func); - try { - if (isNodeAtLeastV10) { - return scriptPositionInfo(script, pos); + // add an entry to the rpc queue while we prepare the request. + // automation api inline programs that don't have stack exports can exit quickly. If we don't do this, + // sometimes they will exit right after `prepareResource` is called as a part of register resource, but before the + // .then() that adds to the queue via `runAsyncResourceOp`. + const done = settings_1.rpcKeepAlive(); + try { + // Simply initialize the URN property and get prepared to resolve it later on. + // Note: a resource urn will always get a value, and thus the output property + // for it can always run .apply calls. + let resolveURN; + { + let resolveValue; + let rejectValue; + let resolveIsKnown; + let rejectIsKnown; + res.urn = new output_1.Output(res, debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveValue = resolve; + rejectValue = reject; + }), `resolveURN(${label})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveIsKnown = resolve; + rejectIsKnown = reject; + }), `resolveURNIsKnown(${label})`), + /*isSecret:*/ Promise.resolve(false), Promise.resolve(res)); + resolveURN = (v, err) => { + if (!!err) { + rejectValue(err); + rejectIsKnown(err); + } + else { + resolveValue(v); + resolveIsKnown(true); + } + }; + } + // If a custom resource, make room for the ID property. + let resolveID; + if (custom) { + let resolveValue; + let rejectValue; + let resolveIsKnown; + let rejectIsKnown; + res.id = new output_1.Output(res, debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveValue = resolve; + rejectValue = reject; + }), `resolveID(${label})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveIsKnown = resolve; + rejectIsKnown = reject; + }), `resolveIDIsKnown(${label})`), Promise.resolve(false), Promise.resolve(res)); + resolveID = (v, isKnown, err) => { + if (!!err) { + rejectValue(err); + rejectIsKnown(err); + } + else { + resolveValue(v); + resolveIsKnown(isKnown); + } + }; + } + // Now "transfer" all input properties into unresolved Promises on res. This way, + // this resource will look like it has all its output properties to anyone it is + // passed to. However, those promises won't actually resolve until the registerResource + // RPC returns + const resolvers = rpc_1.transferProperties(res, label, props); + /** IMPORTANT! We should never await prior to this line, otherwise the Resource will be partly uninitialized. */ + // Before we can proceed, all our dependencies must be finished. + const explicitDirectDependencies = new Set(yield gatherExplicitDependencies(opts.dependsOn)); + // Serialize out all our props to their final values. In doing so, we'll also collect all + // the Resources pointed to by any Dependency objects we encounter, adding them to 'propertyDependencies'. + const [serializedProps, propertyToDirectDependencies] = yield rpc_1.serializeResourceProperties(label, props, { + // To initially scope the use of this new feature, we only keep output values when + // remote is true (for multi-lang components). + keepOutputValues: remote, + }); + // Wait for the parent to complete. + // If no parent was provided, parent to the root resource. + const parentURN = parent ? yield parent.urn.promise() : undefined; + let providerRef; + let importID; + if (custom) { + const customOpts = opts; + importID = customOpts.import; + providerRef = yield resource_2.ProviderResource.register(opts.provider); + } + const providerRefs = new Map(); + if (remote) { + const componentOpts = opts; + resource_1.expandProviders(componentOpts); + // the casts are safe because expandProviders + // /always/ leaves providers as an array. + if (componentOpts.provider !== undefined) { + if (componentOpts.providers === undefined) { + // We still want to do the promotion, so we define providers + componentOpts.providers = [componentOpts.provider]; + } + else if (((_a = componentOpts.providers) === null || _a === void 0 ? void 0 : _a.indexOf(componentOpts.provider)) !== -1) { + const pkg = componentOpts.provider.getPackage(); + const message = `There is a conflit between the 'provider' field (${pkg}) and a member of the 'providers' map'. `; + const deprecationd = "This will become an error by the end of July 2022. See https://github.com/pulumi/pulumi/issues/8799 for more details"; + log.warn(message + deprecationd); } else { - return script.locationFromPosition(pos); + componentOpts.providers.push(componentOpts.provider); } } - catch (err) { - // Be resilient to native functions not being available. In this case, we just return - // '0,0'. That's not great, but it at least lets us run, and it isn't a terrible - // experience. - // - // Specifically, we only need these locations when we're printing out an error about not - // being able to serialize something. In that case, we still print out the names of the - // functions (as well as the call-tree that got us there), *and* we print out the body - // of the function. With both of these, it is generally not too difficult to find out - // where the code actually lives. + if (componentOpts.providers) { + for (const provider of componentOpts.providers) { + const pref = yield resource_2.ProviderResource.register(provider); + if (pref) { + providerRefs.set(provider.getPackage(), pref); + } + } + } + } + // Collect the URNs for explicit/implicit dependencies for the engine so that it can understand + // the dependency graph and optimize operations accordingly. + // The list of all dependencies (implicit or explicit). + const allDirectDependencies = new Set(explicitDirectDependencies); + const exclude = new Set([res]); + const allDirectDependencyURNs = yield getAllTransitivelyReferencedResourceURNs(explicitDirectDependencies, exclude); + const propertyToDirectDependencyURNs = new Map(); + for (const [propertyName, directDependencies] of propertyToDirectDependencies) { + addAll(allDirectDependencies, directDependencies); + const urns = yield getAllTransitivelyReferencedResourceURNs(directDependencies, exclude); + addAll(allDirectDependencyURNs, urns); + propertyToDirectDependencyURNs.set(propertyName, urns); + } + // Wait for all aliases. Note that we use `res.__aliases` instead of `opts.aliases` as the former has been processed + // in the Resource constructor prior to calling `registerResource` - both adding new inherited aliases and + // simplifying aliases down to URNs. + const aliases = []; + const uniqueAliases = new Set(); + for (const alias of (res.__aliases || [])) { + const aliasVal = yield output_1.output(alias).promise(); + if (!uniqueAliases.has(aliasVal)) { + uniqueAliases.add(aliasVal); + aliases.push(aliasVal); } } - return { line: 0, column: 0 }; + return { + resolveURN: resolveURN, + resolveID: resolveID, + resolvers: resolvers, + serializedProps: serializedProps, + parentURN: parentURN, + providerRef: providerRef, + providerRefs: providerRefs, + allDirectDependencyURNs: allDirectDependencyURNs, + propertyToDirectDependencyURNs: propertyToDirectDependencyURNs, + aliases: aliases, + import: importID, + }; + } + finally { + // free the RPC queue + done(); } }); } -exports.getFunctionLocationAsync = getFunctionLocationAsync; -function getScript(func) { - // The use of the Function constructor here and elsewhere in this file is because - // because V8 intrinsics are not valid JavaScript identifiers; they all begin with '%', - // which means that the TypeScript compiler issues errors for them. - const scriptFunc = new Function("func", "return %FunctionGetScript(func);"); - return scriptFunc(func); -} -// The second intrinsic is `FunctionGetScriptSourcePosition`, which does about what you'd -// expect. It returns a `V8SourcePosition`, which can be passed to `V8Script::locationFromPosition` -// to produce a `V8SourceLocation`. -const getSourcePosition = new Function("func", "return %FunctionGetScriptSourcePosition(func);"); -function scriptPositionInfo(script, pos) { - if (isNodeAtLeastV10) { - const scriptPositionInfoFunc = new Function("script", "pos", "return %ScriptPositionInfo(script, pos, false);"); - return scriptPositionInfoFunc(script, pos); - } - // Should not be called if running on Node<10.0.0. - return undefined; +function addAll(to, from) { + for (const val of from) { + to.add(val); + } } /** @internal */ -function lookupCapturedVariableValueAsync(func, freeVariable, throwOnFailure) { +function getAllTransitivelyReferencedResourceURNs(resources, exclude) { return __awaiter(this, void 0, void 0, function* () { - // The implementation of this function is now very straightforward since the intrinsics do all of the - // difficult work. - const count = getFunctionScopeCount(func); - for (let i = 0; i < count; i++) { - const scope = getScopeForFunction(func, i); - if (freeVariable in scope.scopeObject) { - return scope.scopeObject[freeVariable]; - } - } - if (throwOnFailure) { - throw new Error("Unexpected missing variable in closure environment: " + freeVariable); - } - return undefined; + // Go through 'resources', but transitively walk through **Component** resources, collecting any + // of their child resources. This way, a Component acts as an aggregation really of all the + // reachable resources it parents. This walking will stop when it hits custom resources. + // + // This function also terminates at remote components, whose children are not known to the Node SDK directly. + // Remote components will always wait on all of their children, so ensuring we return the remote component + // itself here and waiting on it will accomplish waiting on all of it's children regardless of whether they + // are returned explicitly here. + // + // In other words, if we had: + // + // Comp1 + // / | \ + // Cust1 Comp2 Remote1 + // / \ \ + // Cust2 Cust3 Comp3 + // / \ + // Cust4 Cust5 + // + // Then the transitively reachable resources of Comp1 will be [Cust1, Cust2, Cust3, Remote1]. + // It will *not* include: + // * Cust4 because it is a child of a custom resource + // * Comp2 because it is a non-remote component resource + // * Comp3 and Cust5 because Comp3 is a child of a remote component resource + // To do this, first we just get the transitively reachable set of resources (not diving + // into custom resources). In the above picture, if we start with 'Comp1', this will be + // [Comp1, Cust1, Comp2, Cust2, Cust3] + const transitivelyReachableResources = yield getTransitivelyReferencedChildResourcesOfComponentResources(resources); + // Then we filter to only include Custom and Remote resources. + const transitivelyReachableCustomResources = [...transitivelyReachableResources] + .filter(r => (resource_2.CustomResource.isInstance(r) || r.__remote) && !exclude.has(r)); + const promises = transitivelyReachableCustomResources.map(r => r.urn.promise()); + const urns = yield Promise.all(promises); + return new Set(urns); }); } -exports.lookupCapturedVariableValueAsync = lookupCapturedVariableValueAsync; -// The last two intrinsics are `GetFunctionScopeCount` and `GetFunctionScopeDetails`. -// The former function returns the number of scopes in a given function's scope chain, while -// the latter function returns the i'th entry in a function's scope chain, given a function and -// index i. -function getFunctionScopeDetails(func, index) { - const getFunctionScopeDetailsFunc = new Function("func", "index", "return %GetFunctionScopeDetails(func, index);"); - return getFunctionScopeDetailsFunc(func, index); -} -function getFunctionScopeCount(func) { - const getFunctionScopeCountFunc = new Function("func", "return %GetFunctionScopeCount(func);"); - return getFunctionScopeCountFunc(func); -} -// getScopeForFunction extracts a V8ScopeDetails for the index'th element in the scope chain for the -// given function. -function getScopeForFunction(func, index) { - const scopeDetails = getFunctionScopeDetails(func, index); - return { - scopeObject: scopeDetails[V8ScopeDetailsFields.kScopeDetailsObjectIndex], - }; -} -// All of these functions contain syntax that is not legal TS/JS (i.e. "%Whatever"). As such, -// we cannot serialize them. In case they somehow get captured, just block them from closure -// serialization entirely. -getScript.doNotCapture = true; -getSourcePosition.doNotCapture = true; -getFunctionScopeDetails.doNotCapture = true; -getFunctionScopeCount.doNotCapture = true; -//# sourceMappingURL=v8_v10andLower.js.map - -/***/ }), - -/***/ 86899: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const util = __nccwpck_require__(73837); -const vm = __nccwpck_require__(26144); -const v8Hooks = __nccwpck_require__(9580); -/** @internal */ -function getFunctionLocationAsync(func) { +exports.getAllTransitivelyReferencedResourceURNs = getAllTransitivelyReferencedResourceURNs; +/** + * Recursively walk the resources passed in, returning them and all resources reachable from + * [Resource.__childResources] through any **Component** resources we encounter. + */ +function getTransitivelyReferencedChildResourcesOfComponentResources(resources) { return __awaiter(this, void 0, void 0, function* () { - // First, find the runtime's internal id for this function. - const functionId = yield getRuntimeIdForFunctionAsync(func); - // Now, query for the internal properties the runtime sets up for it. - const { internalProperties } = yield runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false); - // There should normally be an internal property called [[FunctionLocation]]: - // https://chromium.googlesource.com/v8/v8.git/+/3f99afc93c9ba1ba5df19f123b93cc3079893c9b/src/inspector/v8-debugger.cc#793 - const functionLocation = internalProperties.find(p => p.name === "[[FunctionLocation]]"); - if (!functionLocation || !functionLocation.value || !functionLocation.value.value) { - return { file: "", line: 0, column: 0 }; - } - const value = functionLocation.value.value; - // Map from the scriptId the value has to a file-url. - const file = v8Hooks.getScriptUrl(value.scriptId) || ""; - const line = value.lineNumber || 0; - const column = value.columnNumber || 0; - return { file, line, column }; + // Recursively walk the dependent resources through their children, adding them to the result set. + const result = new Set(); + yield addTransitivelyReferencedChildResourcesOfComponentResources(resources, result); + return result; }); } -exports.getFunctionLocationAsync = getFunctionLocationAsync; -/** @internal */ -function lookupCapturedVariableValueAsync(func, freeVariable, throwOnFailure) { +function addTransitivelyReferencedChildResourcesOfComponentResources(resources, result) { return __awaiter(this, void 0, void 0, function* () { - // First, find the runtime's internal id for this function. - const functionId = yield getRuntimeIdForFunctionAsync(func); - // Now, query for the internal properties the runtime sets up for it. - const { internalProperties } = yield runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false); - // There should normally be an internal property called [[Scopes]]: - // https://chromium.googlesource.com/v8/v8.git/+/3f99afc93c9ba1ba5df19f123b93cc3079893c9b/src/inspector/v8-debugger.cc#820 - const scopes = internalProperties.find(p => p.name === "[[Scopes]]"); - if (!scopes) { - throw new Error("Could not find [[Scopes]] property"); - } - if (!scopes.value) { - throw new Error("[[Scopes]] property did not have [value]"); - } - if (!scopes.value.objectId) { - throw new Error("[[Scopes]].value have objectId"); - } - // This is sneaky, but we can actually map back from the [[Scopes]] object to a real in-memory - // v8 array-like value. Note: this isn't actually a real array. For example, it cannot be - // iterated. Nor can any actual methods be called on it. However, we can directly index into - // it, and we can. Similarly, the 'object' type it optionally points at is not a true JS - // object. So we can't call things like .hasOwnProperty on it. However, the values pointed to - // by 'object' are the real in-memory JS objects we are looking for. So we can find and return - // those successfully to our caller. - const scopesArray = yield getValueForObjectId(scopes.value.objectId); - // scopesArray is ordered from innermost to outermost. - for (let i = 0, n = scopesArray.length; i < n; i++) { - const scope = scopesArray[i]; - if (scope.object) { - if (freeVariable in scope.object) { - const val = scope.object[freeVariable]; - return val; + if (resources) { + for (const resource of resources) { + if (!result.has(resource)) { + result.add(resource); + if (resource_2.ComponentResource.isInstance(resource)) { + // This await is safe even if __isConstructed is undefined. Ensure that the + // resource has completely finished construction. That way all parent/child + // relationships will have been setup. + yield resource.__data; + addTransitivelyReferencedChildResourcesOfComponentResources(resource.__childResources, result); + } } } } - if (throwOnFailure) { - throw new Error("Unexpected missing variable in closure environment: " + freeVariable); - } - return undefined; - }); -} -exports.lookupCapturedVariableValueAsync = lookupCapturedVariableValueAsync; -// Isolated singleton context accessible from the inspector. -// Used instead of `global` object to support executions with multiple V8 vm contexts as, e.g., done by Jest. -let inflightContextCache; -function inflightContext() { - if (inflightContextCache) { - return inflightContextCache; - } - inflightContextCache = createContext(); - return inflightContextCache; -} -function createContext() { - return __awaiter(this, void 0, void 0, function* () { - const context = { - contextId: 0, - functions: {}, - currentFunctionId: 0, - calls: {}, - currentCallId: 0, - }; - const session = yield v8Hooks.getSessionAsync(); - const post = util.promisify(session.post); - // Create own context with known context id and functionsContext as `global` - yield post.call(session, "Runtime.enable"); - const contextIdAsync = new Promise(resolve => { - session.once("Runtime.executionContextCreated", event => { - resolve(event.params.context.id); - }); - }); - vm.createContext(context); - context.contextId = yield contextIdAsync; - yield post.call(session, "Runtime.disable"); - return context; }); } -function getRuntimeIdForFunctionAsync(func) { +/** + * Gathers explicit dependent Resources from a list of Resources (possibly Promises and/or Outputs). + */ +function gatherExplicitDependencies(dependsOn) { return __awaiter(this, void 0, void 0, function* () { - // In order to get information about an object, we need to put it in a well known location so - // that we can call Runtime.evaluate and find it. To do this, we use a special map on the - // 'global' object of a vm context only used for this purpose, and map from a unique-id to that - // object. We then call Runtime.evaluate with an expression that then points to that unique-id - // in that global object. The runtime will then find the object and give us back an internal id - // for it. We can then query for information about the object through that internal id. - // - // Note: the reason for the mapping object and the unique-id we create is so that we don't run - // into any issues when being called asynchronously. We don't want to place the object in a - // location that might be overwritten by another call while we're asynchronously waiting for our - // original call to complete. - const session = yield v8Hooks.getSessionAsync(); - const post = util.promisify(session.post); - // Place the function in a unique location - const context = yield inflightContext(); - const currentFunctionName = "id" + context.currentFunctionId++; - context.functions[currentFunctionName] = func; - const contextId = context.contextId; - const expression = `functions.${currentFunctionName}`; - try { - const retType = yield post.call(session, "Runtime.evaluate", { contextId, expression }); - if (retType.exceptionDetails) { - throw new Error(`Error calling "Runtime.evaluate(${expression})" on context ${contextId}: ` + retType.exceptionDetails.text); + if (dependsOn) { + if (Array.isArray(dependsOn)) { + const dos = []; + for (const d of dependsOn) { + dos.push(...(yield gatherExplicitDependencies(d))); + } + return dos; } - const remoteObject = retType.result; - if (remoteObject.type !== "function") { - throw new Error("Remote object was not 'function': " + JSON.stringify(remoteObject)); + else if (dependsOn instanceof Promise) { + return gatherExplicitDependencies(yield dependsOn); + } + else if (output_1.Output.isInstance(dependsOn)) { + // Recursively gather dependencies, await the promise, and append the output's dependencies. + const dos = dependsOn.apply(v => gatherExplicitDependencies(v)); + const urns = yield dos.promise(); + const dosResources = yield output_1.getAllResources(dos); + const implicits = yield gatherExplicitDependencies([...dosResources]); + return ((urns !== null && urns !== void 0 ? urns : [])).concat(implicits); } - if (!remoteObject.objectId) { - throw new Error("Remote function does not have 'objectId': " + JSON.stringify(remoteObject)); + else { + if (!resource_2.Resource.isInstance(dependsOn)) { + throw new Error("'dependsOn' was passed a value that was not a Resource."); + } + return [dependsOn]; } - return remoteObject.objectId; - } - finally { - delete context.functions[currentFunctionName]; } + return []; }); } -function runtimeGetPropertiesAsync(objectId, ownProperties) { +/** + * Finishes a resource creation RPC operation by resolving its outputs to the resulting RPC payload. + */ +function resolveOutputs(res, t, name, props, outputs, deps, resolvers, err) { return __awaiter(this, void 0, void 0, function* () { - const session = yield v8Hooks.getSessionAsync(); - const post = util.promisify(session.post); - // This cast will become unnecessary when we move to TS 3.1.6 or above. In that version they - // support typesafe '.call' calls. - const retType = yield post.call(session, "Runtime.getProperties", { objectId, ownProperties }); - if (retType.exceptionDetails) { - throw new Error(`Error calling "Runtime.getProperties(${objectId}, ${ownProperties})": ` - + retType.exceptionDetails.text); - } - return { internalProperties: retType.internalProperties || [], properties: retType.result }; + // Produce a combined set of property states, starting with inputs and then applying + // outputs. If the same property exists in the inputs and outputs states, the output wins. + const allProps = {}; + if (outputs) { + Object.assign(allProps, rpc_1.deserializeProperties(outputs)); + } + const label = `resource:${name}[${t}]#...`; + if (!settings_1.isDryRun() || settings_1.isLegacyApplyEnabled()) { + for (const key of Object.keys(props)) { + if (!allProps.hasOwnProperty(key)) { + // input prop the engine didn't give us a final value for. Just use the value passed into the resource + // after round-tripping it through serialization. We do the round-tripping primarily s.t. we ensure that + // Output values are handled properly w.r.t. unknowns. + const inputProp = yield rpc_1.serializeProperty(label, props[key], new Set(), { keepOutputValues: false }); + if (inputProp === undefined) { + continue; + } + allProps[key] = rpc_1.deserializeProperty(inputProp); + } + } + } + rpc_1.resolveProperties(res, resolvers, t, name, allProps, deps, err); }); } -function getValueForObjectId(objectId) { - return __awaiter(this, void 0, void 0, function* () { - // In order to get the raw JS value for the *remote wrapper* of the [[Scopes]] array, we use - // Runtime.callFunctionOn on it passing in a fresh function-declaration. The Node runtime will - // then compile that function, invoking it with the 'real' underlying scopes-array value in - // memory as the bound 'this' value. Inside that function declaration, we can then access - // 'this' and assign it to a unique-id in a well known mapping table we have set up. As above, - // the unique-id is to prevent any issues with multiple in-flight asynchronous calls. - const session = yield v8Hooks.getSessionAsync(); - const post = util.promisify(session.post); - const context = yield inflightContext(); - // Get an id for an unused location in the global table. - const tableId = "id" + context.currentCallId++; - // Now, ask the runtime to call a fictitious method on the scopes-array object. When it - // does, it will get the actual underlying value for the scopes array and bind it to the - // 'this' value inside the function. Inside the function we then just grab 'this' and - // stash it in our global table. After this completes, we'll then have access to it. - // This cast will become unnecessary when we move to TS 3.1.6 or above. In that version they - // support typesafe '.call' calls. - const retType = yield post.call(session, "Runtime.callFunctionOn", { - objectId, - functionDeclaration: `function () { - calls["${tableId}"] = this; - }`, - }); - if (retType.exceptionDetails) { - throw new Error(`Error calling "Runtime.callFunction(${objectId})": ` - + retType.exceptionDetails.text); +/** + * registerResourceOutputs completes the resource registration, attaching an optional set of computed outputs. + */ +function registerResourceOutputs(res, outputs) { + // Now run the operation. Note that we explicitly do not serialize output registration with + // respect to other resource operations, as outputs may depend on properties of other resources + // that will not resolve until later turns. This would create a circular promise chain that can + // never resolve. + const opLabel = `monitor.registerResourceOutputs(...)`; + runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { + // The registration could very well still be taking place, so we will need to wait for its URN. + // Additionally, the output properties might have come from other resources, so we must await those too. + const urn = yield res.urn.promise(); + const resolved = yield rpc_1.serializeProperties(opLabel, { outputs }); + const outputsObj = gstruct.Struct.fromJavaScript(resolved.outputs); + log.debug(`RegisterResourceOutputs RPC prepared: urn=${urn}` + + (settings_1.excessiveDebugOutput ? `, outputs=${JSON.stringify(outputsObj)}` : ``)); + // Fetch the monitor and make an RPC request. + const monitor = settings_1.getMonitor(); + if (monitor) { + const req = new resproto.RegisterResourceOutputsRequest(); + req.setUrn(urn); + req.setOutputs(outputsObj); + const label = `monitor.registerResourceOutputs(${urn}, ...)`; + yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.registerResourceOutputs(req, (err, innerResponse) => { + log.debug(`RegisterResourceOutputs RPC finished: urn=${urn}; ` + + `err: ${err}, resp: ${innerResponse}`); + if (err) { + // If the monitor is unavailable, it is in the process of shutting down or has already + // shut down. Don't emit an error and don't do any more RPCs, just exit. + if (err.code === grpc.status.UNAVAILABLE || err.code === grpc.status.CANCELLED) { + settings_1.terminateRpcs(); + err.message = "Resource monitor is terminating"; + } + reject(err); + } + else { + log.debug(`RegisterResourceOutputs RPC finished: urn=${urn}; ` + + `err: ${err}, resp: ${innerResponse}`); + resolve(); + } + })), label); } - if (!context.calls.hasOwnProperty(tableId)) { - throw new Error(`Value was not stored into table after calling "Runtime.callFunctionOn(${objectId})"`); + }), false); +} +exports.registerResourceOutputs = registerResourceOutputs; +function isAny(o) { + return true; +} +/** + * listResourceOutputs returns the resource outputs (if any) for a stack, or an error if the stack + * cannot be found. Resources are retrieved from the latest stack snapshot, which may include + * ongoing updates. + * + * @param stackName Name of stack to retrieve resource outputs for. Defaults to the current stack. + * @param typeFilter A [type + * guard](https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards) + * that specifies which resource types to list outputs of. + * + * @example + * const buckets = pulumi.runtime.listResourceOutput(aws.s3.Bucket.isInstance); + */ +function listResourceOutputs(typeFilter, stackName) { + if (typeFilter === undefined) { + typeFilter = isAny; + } + return query + .from(invoke_1.invoke("pulumi:pulumi:readStackResourceOutputs", { + stackName: stackName || settings_1.getStack(), + }).then(({ outputs }) => utils.values(outputs))) + .map(({ type: typ, outputs }) => { + return Object.assign(Object.assign({}, outputs), { __pulumiType: typ }); + }) + .filter(typeFilter); +} +exports.listResourceOutputs = listResourceOutputs; +/** + * resourceChain is used to serialize all resource requests. If we don't do this, all resource operations will be + * entirely asynchronous, meaning the dataflow graph that results will determine ordering of operations. This + * causes problems with some resource providers, so for now we will serialize all of them. The issue + * pulumi/pulumi#335 tracks coming up with a long-term solution here. + */ +let resourceChain = Promise.resolve(); +let resourceChainLabel = undefined; +// runAsyncResourceOp runs an asynchronous resource operation, possibly serializing it as necessary. +function runAsyncResourceOp(label, callback, serial) { + // Serialize the invocation if necessary. + if (serial === undefined) { + serial = settings_1.serialize(); + } + const resourceOp = rpc_1.suppressUnhandledGrpcRejections(debuggable_1.debuggablePromise(resourceChain.then(() => __awaiter(this, void 0, void 0, function* () { + if (serial) { + resourceChainLabel = label; + log.debug(`Resource RPC serialization requested: ${label} is current`); } - // Extract value and clear our table entry. - const val = context.calls[tableId]; - delete context.calls[tableId]; - return val; - }); + return callback(); + })), label + "-initial")); + // Ensure the process won't exit until this RPC call finishes and resolve it when appropriate. + const done = settings_1.rpcKeepAlive(); + const finalOp = debuggable_1.debuggablePromise(resourceOp.then(() => { done(); }, () => { done(); }), label + "-final"); + // Set up another promise that propagates the error, if any, so that it triggers unhandled rejection logic. + resourceOp.catch((err) => Promise.reject(err)); + // If serialization is requested, wait for the prior resource operation to finish before we proceed, serializing + // them, and make this the current resource operation so that everybody piles up on it. + if (serial) { + resourceChain = finalOp; + if (resourceChainLabel) { + log.debug(`Resource RPC serialization requested: ${label} is behind ${resourceChainLabel}`); + } + } } -//# sourceMappingURL=v8_v11andHigher.js.map +//# sourceMappingURL=resource.js.map /***/ }), -/***/ 67146: -/***/ ((__unused_webpack_module, exports) => { +/***/ 60: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2018, Pulumi Corporation. +// Copyright 2016-2021, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42575,278 +39334,720 @@ function getValueForObjectId(objectId) { // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); +const asset = __nccwpck_require__(3031); +const errors_1 = __nccwpck_require__(9693); +const log = __nccwpck_require__(642); +const output_1 = __nccwpck_require__(3037); +const resource_1 = __nccwpck_require__(796); +const debuggable_1 = __nccwpck_require__(257); +const settings_1 = __nccwpck_require__(4530); +const resource_2 = __nccwpck_require__(140); +const semver = __nccwpck_require__(7486); /** - * configEnvKey is the environment variable key that the language plugin uses to set configuration values. - */ -const configEnvKey = "PULUMI_CONFIG"; -/** - * configSecretKeysEnvKey is the environment variable key that the language plugin uses to set configuration keys that - * contain secrets. - */ -const configSecretKeysEnvKey = "PULUMI_CONFIG_SECRET_KEYS"; -/** - * allConfig returns a copy of the full config map. + * transferProperties mutates the 'onto' resource so that it has Promise-valued properties for all + * the 'props' input/output props. *Importantly* all these promises are completely unresolved. This + * is because we don't want anyone to observe the values of these properties until the rpc call to + * registerResource actually returns. This is because the registerResource call may actually + * override input values, and we only want people to see the final value. + * + * The result of this call (beyond the stateful changes to 'onto') is the set of Promise resolvers + * that will be called post-RPC call. When the registerResource RPC call comes back, the values + * that the engine actualy produced will be used to resolve all the unresolved promised placed on + * 'onto'. */ -function allConfig() { - const config = parseConfig(); - return Object.assign({}, config); +function transferProperties(onto, label, props) { + const resolvers = {}; + for (const k of Object.keys(props)) { + // Skip "id" and "urn", since we handle those specially. + if (k === "id" || k === "urn") { + continue; + } + // Create a property to wrap the value and store it on the resource. + if (onto.hasOwnProperty(k)) { + throw new Error(`Property '${k}' is already initialized on target '${label}`); + } + let resolveValue; + let rejectValue; + let resolveIsKnown; + let rejectIsKnown; + let resolveIsSecret; + let rejectIsSecret; + let resolveDeps; + let rejectDeps; + resolvers[k] = (v, isKnown, isSecret, deps = [], err) => { + if (!!err) { + rejectValue(err); + rejectIsKnown(err); + rejectIsSecret(err); + rejectDeps(err); + } + else { + resolveValue(v); + resolveIsKnown(isKnown); + resolveIsSecret(isSecret); + resolveDeps(deps); + } + }; + const propString = output_1.Output.isInstance(props[k]) ? "Output" : `${props[k]}`; + onto[k] = new output_1.Output(onto, debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveValue = resolve; + rejectValue = reject; + }), `transferProperty(${label}, ${k}, ${propString})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveIsKnown = resolve; + rejectIsKnown = reject; + }), `transferIsStable(${label}, ${k}, ${propString})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveIsSecret = resolve; + rejectIsSecret = reject; + }), `transferIsSecret(${label}, ${k}, ${propString})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { + resolveDeps = resolve; + rejectDeps = reject; + }), `transferDeps(${label}, ${k}, ${propString})`)); + } + return resolvers; } -exports.allConfig = allConfig; +exports.transferProperties = transferProperties; /** - * setAllConfig overwrites the config map. + * serializeFilteredProperties walks the props object passed in, awaiting all interior promises for + * properties with keys that match the provided filter, creating a reasonable POJO object that can + * be remoted over to registerResource. */ -function setAllConfig(c, secretKeys) { - const obj = {}; - for (const k of Object.keys(c)) { - obj[cleanKey(k)] = c[k]; - } - persistConfig(obj, secretKeys); +function serializeFilteredProperties(label, props, acceptKey, opts) { + return __awaiter(this, void 0, void 0, function* () { + const propertyToDependentResources = new Map(); + const result = {}; + for (const k of Object.keys(props)) { + if (acceptKey(k)) { + // We treat properties with undefined values as if they do not exist. + const dependentResources = new Set(); + const v = yield serializeProperty(`${label}.${k}`, props[k], dependentResources, opts); + if (v !== undefined) { + result[k] = v; + propertyToDependentResources.set(k, dependentResources); + } + } + } + return [result, propertyToDependentResources]; + }); } -exports.setAllConfig = setAllConfig; /** - * setConfig sets a configuration variable. + * serializeResourceProperties walks the props object passed in, awaiting all interior promises besides those for `id` + * and `urn`, creating a reasonable POJO object that can be remoted over to registerResource. */ -function setConfig(k, v) { - const config = parseConfig(); - config[cleanKey(k)] = v; - persistConfig(config, []); +function serializeResourceProperties(label, props, opts) { + return __awaiter(this, void 0, void 0, function* () { + return serializeFilteredProperties(label, props, key => key !== "id" && key !== "urn", opts); + }); } -exports.setConfig = setConfig; +exports.serializeResourceProperties = serializeResourceProperties; /** - * getConfig returns a configuration variable's value or undefined if it is unset. + * serializeProperties walks the props object passed in, awaiting all interior promises, creating a reasonable + * POJO object that can be remoted over to registerResource. */ -function getConfig(k) { - const config = parseConfig(); - return config[k]; +function serializeProperties(label, props, opts) { + return __awaiter(this, void 0, void 0, function* () { + const [result] = yield serializeFilteredProperties(label, props, _ => true, opts); + return result; + }); } -exports.getConfig = getConfig; +exports.serializeProperties = serializeProperties; +/** @internal */ +function serializePropertiesReturnDeps(label, props, opts) { + return __awaiter(this, void 0, void 0, function* () { + return serializeFilteredProperties(label, props, _ => true, opts); + }); +} +exports.serializePropertiesReturnDeps = serializePropertiesReturnDeps; /** - * isConfigSecret returns true if the key contains a secret value. - * @internal + * deserializeProperties fetches the raw outputs and deserializes them from a gRPC call result. */ -function isConfigSecret(k) { - const envConfigSecretKeys = process.env[configSecretKeysEnvKey]; - if (envConfigSecretKeys) { - const envConfigSecretArray = JSON.parse(envConfigSecretKeys); - if (Array.isArray(envConfigSecretArray)) { - return envConfigSecretArray.includes(k); +function deserializeProperties(outputsStruct) { + const props = {}; + const outputs = outputsStruct.toJavaScript(); + for (const k of Object.keys(outputs)) { + // We treat properties with undefined values as if they do not exist. + if (outputs[k] !== undefined) { + props[k] = deserializeProperty(outputs[k]); } } - return false; + return props; } -exports.isConfigSecret = isConfigSecret; +exports.deserializeProperties = deserializeProperties; /** - * parseConfig reads config from the source of truth, the environment. - * config must always be read this way because automation api introduces - * new program lifetime semantics where program lifetime != module lifetime. + * resolveProperties takes as input a gRPC serialized proto.google.protobuf.Struct and resolves all + * of the resource's matching properties to the values inside. + * + * NOTE: it is imperative that the properties in `allProps` were produced by `deserializeProperties` in order for + * output properties to work correctly w.r.t. knowns/unknowns: this function assumes that any undefined value in + * `allProps`represents an unknown value that was returned by an engine operation. */ -function parseConfig() { - const parsedConfig = {}; - const envConfig = process.env[configEnvKey]; - if (envConfig) { - const envObject = JSON.parse(envConfig); - for (const k of Object.keys(envObject)) { - parsedConfig[cleanKey(k)] = envObject[k]; +function resolveProperties(res, resolvers, t, name, allProps, deps, err) { + // If there is an error, just reject everything. + if (err) { + for (const k of Object.keys(resolvers)) { + const resolve = resolvers[k]; + resolve(undefined, true, false, [], err); + } + return; + } + // Now go ahead and resolve all properties present in the inputs and outputs set. + for (const k of Object.keys(allProps)) { + // Skip "id" and "urn", since we handle those specially. + if (k === "id" || k === "urn") { + continue; + } + // Otherwise, unmarshal the value, and store it on the resource object. + const resolve = resolvers[k]; + if (resolve === undefined) { + // engine returned a property that was not in our initial property-map. This can happen + // for outputs that were registered through direct calls to 'registerOutputs'. We do + // *not* want to do anything with these returned properties. First, the component + // resources that were calling 'registerOutputs' will have already assigned these fields + // directly on them themselves. Second, if we were to try to assign here we would have + // an incredibly bad race condition for two reasons: + // + // 1. This call to 'resolveProperties' happens asynchronously at some point far after + // the resource was constructed. So the user will have been able to observe the + // initial value up until we get to this point. + // + // 2. The component resource will have often assigned a value of some arbitrary type + // (say, a 'string'). If we overwrite this with an `Output` we'll be changing + // the type at some non-deterministic point in the future. + continue; + } + // If this value is a secret, unwrap its inner value. + let value = allProps[k]; + const isSecret = isRpcSecret(value); + value = unwrapRpcSecret(value); + try { + // If the value the engine handed back is or contains an unknown value, the resolver will mark its value as + // unknown automatically, so we just pass true for isKnown here. Note that unknown values will only be + // present during previews (i.e. isDryRun() will be true). + resolve(value, /*isKnown*/ true, isSecret, deps[k]); + } + catch (resolveError) { + throw new Error(`Unable to set property '${k}' on resource '${name}' [${t}]; error: ${debuggable_1.errorString(resolveError)}`); + } + } + // `allProps` may not have contained a value for every resolver: for example, optional outputs may not be present. + // We will resolve all of these values as `undefined`, and will mark the value as known if we are not running a + // preview. + for (const k of Object.keys(resolvers)) { + if (!allProps.hasOwnProperty(k)) { + const resolve = resolvers[k]; + resolve(undefined, !settings_1.isDryRun(), false); } } - return parsedConfig; } +exports.resolveProperties = resolveProperties; /** - * persistConfig writes config to the environment. - * config changes must always be persisted to the environment because automation api introduces - * new program lifetime semantics where program lifetime != module lifetime. + * Unknown values are encoded as a distinguished string value. */ -function persistConfig(config, secretKeys) { - const serializedConfig = JSON.stringify(config); - const serializedSecretKeys = Array.isArray(secretKeys) ? JSON.stringify(secretKeys) : "[]"; - process.env[configEnvKey] = serializedConfig; - process.env[configSecretKeysEnvKey] = serializedSecretKeys; -} +exports.unknownValue = "04da6b54-80e4-46f7-96ec-b56ff0331ba9"; /** - * cleanKey takes a configuration key, and if it is of the form ":config:" removes - * the ":config:" portion. Previously, our keys always had the string ":config:" in them, and we'd - * like to remove it. However, the language host needs to continue to set it so we can be compatible - * with older versions of our packages. Once we stop supporting older packages, we can change the - * language host to not add this :config: thing and remove this function. + * specialSigKey is sometimes used to encode type identity inside of a map. See sdk/go/common/resource/properties.go. */ -function cleanKey(key) { - const idx = key.indexOf(":"); - if (idx > 0 && key.startsWith("config:", idx + 1)) { - return key.substring(0, idx) + ":" + key.substring(idx + 1 + "config:".length); - } - return key; -} -//# sourceMappingURL=config.js.map - -/***/ }), - -/***/ 20257: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -const log = __nccwpck_require__(80642); +exports.specialSigKey = "4dabf18193072939515e22adb298388d"; /** - * debugPromiseLeaks can be set to enable promises leaks debugging. + * specialAssetSig is a randomly assigned hash used to identify assets in maps. See sdk/go/common/resource/asset.go. */ -const debugPromiseLeaks = !!process.env.PULUMI_DEBUG_PROMISE_LEAKS; +exports.specialAssetSig = "c44067f5952c0a294b673a41bacd8c17"; /** - * leakDetectorScheduled is true when the promise leak detector is scheduled for process exit. + * specialArchiveSig is a randomly assigned hash used to identify archives in maps. See sdk/go/common/resource/asset.go. */ -let leakDetectorScheduled = false; +exports.specialArchiveSig = "0def7320c3a5731c473e5ecbe6d01bc7"; /** - * leakCandidates tracks the list of potential leak candidates. + * specialSecretSig is a randomly assigned hash used to identify secrets in maps. + * See sdk/go/common/resource/properties.go. */ -let leakCandidates = new Set(); -function leakedPromises() { - const leaked = leakCandidates; - const promisePlural = leaked.size === 0 ? "promise was" : "promises were"; - const message = leaked.size === 0 ? "" : - `The Pulumi runtime detected that ${leaked.size} ${promisePlural} still active\n` + - "at the time that the process exited. There are a few ways that this can occur:\n" + - " * Not using `await` or `.then` on a Promise returned from a Pulumi API\n" + - " * Introducing a cyclic dependency between two Pulumi Resources\n" + - " * A bug in the Pulumi Runtime\n" + - "\n" + - "Leaving promises active is probably not what you want. If you are unsure about\n" + - "why you are seeing this message, re-run your program " - + "with the `PULUMI_DEBUG_PROMISE_LEAKS`\n" + - "environment variable. The Pulumi runtime will then print out additional\n" + - "debug information about the leaked promises."; - if (debugPromiseLeaks) { - for (const leak of leaked) { - console.error("Promise leak detected:"); - console.error(promiseDebugString(leak)); - } - } - leakCandidates = new Set(); - return [leaked, message]; -} -exports.leakedPromises = leakedPromises; -function promiseDebugString(p) { - return `CONTEXT(${p._debugId}): ${p._debugCtx}\n` + - `STACK_TRACE:\n` + - `${p._debugStackTrace}`; -} -exports.promiseDebugString = promiseDebugString; -let promiseId = 0; +exports.specialSecretSig = "1b47061264138c4ac30d75fd1eb44270"; /** - * debuggablePromise optionally wraps a promise with some goo to make it easier to debug common problems. - * @internal + * specialResourceSig is a randomly assigned hash used to identify resources in maps. + * See sdk/go/common/resource/properties.go. */ -function debuggablePromise(p, ctx) { - // Whack some stack onto the promise. Leave them non-enumerable to avoid awkward rendering. - Object.defineProperty(p, "_debugId", { writable: true, value: promiseId }); - Object.defineProperty(p, "_debugCtx", { writable: true, value: ctx }); - Object.defineProperty(p, "_debugStackTrace", { writable: true, value: new Error().stack }); - promiseId++; - if (!leakDetectorScheduled) { - process.on("exit", (code) => { - // Only print leaks if we're exiting normally. Otherwise, it could be a crash, which of - // course yields things that look like "leaks". - // - // process.exitCode is undefined unless set, in which case it's the exit code that was - // passed to process.exit. - if ((process.exitCode === undefined || process.exitCode === 0) && !log.hasErrors()) { - const [leaks, message] = leakedPromises(); - if (leaks.size === 0) { - // No leaks - proceed with the exit. - return; - } - // If we haven't opted-in to the debug error message, print a more user-friendly message. - if (!debugPromiseLeaks) { - console.error(message); - } - // Fail the deployment if we leaked any promises. - process.exitCode = 1; - } - }); - leakDetectorScheduled = true; - } - // Add this promise to the leak candidates list, and schedule it for removal if it resolves. - leakCandidates.add(p); - return p.then((val) => { - leakCandidates.delete(p); - return val; - }).catch((err) => { - leakCandidates.delete(p); - err.promise = p; - throw err; +exports.specialResourceSig = "5cf8f73096256a8f31e491e813e4eb8e"; +/** + * specialOutputValueSig is a randomly assigned hash used to identify outputs in maps. + * See sdk/go/common/resource/properties.go. + */ +exports.specialOutputValueSig = "d0e6a833031e9bbcd3f4e8bde6ca49a4"; +/** + * serializeProperty serializes properties deeply. This understands how to wait on any unresolved promises, as + * appropriate, in addition to translating certain "special" values so that they are ready to go on the wire. + */ +function serializeProperty(ctx, prop, dependentResources, opts) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + // IMPORTANT: + // IMPORTANT: Keep this in sync with serializePropertiesSync in invoke.ts + // IMPORTANT: + if (prop === undefined || + prop === null || + typeof prop === "boolean" || + typeof prop === "number" || + typeof prop === "string") { + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: primitive=${prop}`); + } + return prop; + } + if (asset.Asset.isInstance(prop) || asset.Archive.isInstance(prop)) { + // Serializing an asset or archive requires the use of a magical signature key, since otherwise it would look + // like any old weakly typed object/map when received by the other side of the RPC boundary. + const obj = { + [exports.specialSigKey]: asset.Asset.isInstance(prop) ? exports.specialAssetSig : exports.specialArchiveSig, + }; + return yield serializeAllKeys(prop, obj, { keepOutputValues: false }); + } + if (prop instanceof Promise) { + // For a promise input, await the property and then serialize the result. + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: Promise`); + } + const subctx = `Promise<${ctx}>`; + return serializeProperty(subctx, yield debuggable_1.debuggablePromise(prop, `serializeProperty.await(${subctx})`), dependentResources, opts); + } + if (output_1.Output.isInstance(prop)) { + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: Output`); + } + // handle serializing both old-style outputs (with sync resources) and new-style outputs + // (with async resources). + const propResources = yield output_1.getAllResources(prop); + for (const resource of propResources) { + dependentResources.add(resource); + } + // When serializing an Output, we will either serialize it as its resolved value or the "unknown value" + // sentinel. We will do the former for all outputs created directly by user code (such outputs always + // resolve isKnown to true) and for any resource outputs that were resolved with known values. + const isKnown = yield prop.isKnown; + // You might think that doing an explict `=== true` here is not needed, but it is for a subtle reason. If the + // output we are serializing is a proxy itself, and it comes from a version of the SDK that did not have the + // `isSecret` member on `OutputImpl` then the call to `prop.isSecret` here will return an Output itself, + // which will wrap undefined, if it were to be resolved (since `Output` has no member named .isSecret). + // so we must compare to the literal true instead of just doing await prop.isSecret. + const isSecret = (yield prop.isSecret) === true; + const promiseDeps = new Set(); + const value = yield serializeProperty(`${ctx}.id`, prop.promise(), promiseDeps, { + keepOutputValues: false, + }); + for (const resource of promiseDeps) { + propResources.add(resource); + dependentResources.add(resource); + } + if (((_a = opts) === null || _a === void 0 ? void 0 : _a.keepOutputValues) && (yield settings_1.monitorSupportsOutputValues())) { + const urnDeps = new Set(); + for (const resource of propResources) { + yield serializeProperty(`${ctx} dependency`, resource.urn, urnDeps, { + keepOutputValues: false, + }); + } + for (const resource of urnDeps) { + propResources.add(resource); + dependentResources.add(resource); + } + const dependencies = yield resource_2.getAllTransitivelyReferencedResourceURNs(propResources, new Set()); + const obj = { + [exports.specialSigKey]: exports.specialOutputValueSig, + }; + if (isKnown) { + // coerce 'undefined' to 'null' as required by the protobuf system. + obj["value"] = value === undefined ? null : value; + } + if (isSecret) { + obj["secret"] = isSecret; + } + if (dependencies.size > 0) { + obj["dependencies"] = Array.from(dependencies); + } + return obj; + } + if (!isKnown) { + return exports.unknownValue; + } + if (isSecret && (yield settings_1.monitorSupportsSecrets())) { + return { + [exports.specialSigKey]: exports.specialSecretSig, + // coerce 'undefined' to 'null' as required by the protobuf system. + value: value === undefined ? null : value, + }; + } + return value; + } + if (output_1.isUnknown(prop)) { + return exports.unknownValue; + } + if (resource_1.CustomResource.isInstance(prop)) { + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: custom resource urn`); + } + dependentResources.add(prop); + const id = yield serializeProperty(`${ctx}.id`, prop.id, dependentResources, { + keepOutputValues: false, + }); + if (yield settings_1.monitorSupportsResourceReferences()) { + // If we are keeping resources, emit a stronly typed wrapper over the URN + const urn = yield serializeProperty(`${ctx}.urn`, prop.urn, dependentResources, { + keepOutputValues: false, + }); + return { + [exports.specialSigKey]: exports.specialResourceSig, + urn: urn, + id: id, + }; + } + // Else, return the id for backward compatibility. + return id; + } + if (resource_1.ComponentResource.isInstance(prop)) { + // Component resources often can contain cycles in them. For example, an awsinfra + // SecurityGroupRule can point a the awsinfra SecurityGroup, which in turn can point back to + // its rules through its `egressRules` and `ingressRules` properties. If serializing out + // the `SecurityGroup` resource ends up trying to serialize out those properties, a deadlock + // will happen, due to waiting on the child, which is waiting on the parent. + // + // Practically, there is no need to actually serialize out a component. It doesn't represent + // a real resource, nor does it have normal properties that need to be tracked for differences + // (since changes to its properties don't represent changes to resources in the real world). + // + // So, to avoid these problems, while allowing a flexible and simple programming model, we + // just serialize out the component as its urn. This allows the component to be identified + // and tracked in a reasonable manner, while not causing us to compute or embed information + // about it that is not needed, and which can lead to deadlocks. + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: component resource urn`); + } + if (yield settings_1.monitorSupportsResourceReferences()) { + // If we are keeping resources, emit a strongly typed wrapper over the URN + const urn = yield serializeProperty(`${ctx}.urn`, prop.urn, dependentResources, { + keepOutputValues: false, + }); + return { + [exports.specialSigKey]: exports.specialResourceSig, + urn: urn, + }; + } + // Else, return the urn for backward compatibility. + return serializeProperty(`${ctx}.urn`, prop.urn, dependentResources, { + keepOutputValues: false, + }); + } + if (prop instanceof Array) { + const result = []; + for (let i = 0; i < prop.length; i++) { + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: array[${i}] element`); + } + // When serializing arrays, we serialize any undefined values as `null`. This matches JSON semantics. + const elem = yield serializeProperty(`${ctx}[${i}]`, prop[i], dependentResources, opts); + result.push(elem === undefined ? null : elem); + } + return result; + } + return yield serializeAllKeys(prop, {}, opts); + function serializeAllKeys(innerProp, obj, innerOpts) { + return __awaiter(this, void 0, void 0, function* () { + for (const k of Object.keys(innerProp)) { + if (settings_1.excessiveDebugOutput) { + log.debug(`Serialize property [${ctx}]: object.${k}`); + } + // When serializing an object, we omit any keys with undefined values. This matches JSON semantics. + const v = yield serializeProperty(`${ctx}.${k}`, innerProp[k], dependentResources, innerOpts); + if (v !== undefined) { + obj[k] = v; + } + } + return obj; + }); + } }); } -exports.debuggablePromise = debuggablePromise; +exports.serializeProperty = serializeProperty; /** - * errorString produces a string from an error, conditionally including additional diagnostics. - * @internal + * isRpcSecret returns true if obj is a wrapped secret value (i.e. it's an object with the special key set). */ -function errorString(err) { - if (err.stack) { - return err.stack; +function isRpcSecret(obj) { + return obj && obj[exports.specialSigKey] === exports.specialSecretSig; +} +exports.isRpcSecret = isRpcSecret; +/** + * unwrapRpcSecret returns the underlying value for a secret, or the value itself if it was not a secret. + */ +function unwrapRpcSecret(obj) { + if (!isRpcSecret(obj)) { + return obj; } - return err.toString(); + return obj.value; } -exports.errorString = errorString; -//# sourceMappingURL=debuggable.js.map - -/***/ }), - -/***/ 85022: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +exports.unwrapRpcSecret = unwrapRpcSecret; +/** + * deserializeProperty unpacks some special types, reversing the above process. + */ +function deserializeProperty(prop) { + if (prop === undefined) { + throw new Error("unexpected undefined property value during deserialization"); + } + else if (prop === exports.unknownValue) { + return settings_1.isDryRun() ? output_1.unknown : undefined; + } + else if (prop === null || typeof prop === "boolean" || typeof prop === "number" || typeof prop === "string") { + return prop; + } + else if (prop instanceof Array) { + // We can just deserialize all the elements of the underlying array and return it. + // However, we want to push secretness up to the top level (since we can't set sub-properties to secret) + // values since they are not typed as Output. + let hadSecret = false; + const elems = []; + for (const e of prop) { + prop = deserializeProperty(e); + hadSecret = hadSecret || isRpcSecret(prop); + elems.push(unwrapRpcSecret(prop)); + } + if (hadSecret) { + return { + [exports.specialSigKey]: exports.specialSecretSig, + value: elems, + }; + } + return elems; + } + else { + // We need to recognize assets and archives specially, so we can produce the right runtime objects. + const sig = prop[exports.specialSigKey]; + if (sig) { + switch (sig) { + case exports.specialAssetSig: + if (prop["path"]) { + return new asset.FileAsset(prop["path"]); + } + else if (prop["text"]) { + return new asset.StringAsset(prop["text"]); + } + else if (prop["uri"]) { + return new asset.RemoteAsset(prop["uri"]); + } + else { + throw new Error("Invalid asset encountered when unmarshaling resource property"); + } + case exports.specialArchiveSig: + if (prop["assets"]) { + const assets = {}; + for (const name of Object.keys(prop["assets"])) { + const a = deserializeProperty(prop["assets"][name]); + if (!(asset.Asset.isInstance(a)) && !(asset.Archive.isInstance(a))) { + throw new Error("Expected an AssetArchive's assets to be unmarshaled Asset or Archive objects"); + } + assets[name] = a; + } + return new asset.AssetArchive(assets); + } + else if (prop["path"]) { + return new asset.FileArchive(prop["path"]); + } + else if (prop["uri"]) { + return new asset.RemoteArchive(prop["uri"]); + } + else { + throw new Error("Invalid archive encountered when unmarshaling resource property"); + } + case exports.specialSecretSig: + return { + [exports.specialSigKey]: exports.specialSecretSig, + value: deserializeProperty(prop["value"]), + }; + case exports.specialResourceSig: + // Deserialize the resource into a live Resource reference + const urn = prop["urn"]; + const version = prop["packageVersion"]; + const urnParts = urn.split("::"); + const qualifiedType = urnParts[2]; + const urnName = urnParts[3]; + const type = qualifiedType.split("$").pop(); + const typeParts = type.split(":"); + const pkgName = typeParts[0]; + const modName = typeParts.length > 1 ? typeParts[1] : ""; + const typName = typeParts.length > 2 ? typeParts[2] : ""; + const isProvider = pkgName === "pulumi" && modName === "providers"; + if (isProvider) { + const resourcePackage = getResourcePackage(typName, version); + if (resourcePackage) { + return resourcePackage.constructProvider(urnName, type, urn); + } + } + else { + const resourceModule = getResourceModule(pkgName, modName, version); + if (resourceModule) { + return resourceModule.construct(urnName, type, urn); + } + } + // If we've made it here, deserialize the reference as either a URN or an ID (if present). + if (prop["id"]) { + const id = prop["id"]; + return deserializeProperty(id === "" ? exports.unknownValue : id); + } + return urn; + case exports.specialOutputValueSig: + let value = prop["value"]; + const isKnown = value !== undefined; + if (isKnown) { + value = deserializeProperty(value); + } + const isSecret = prop["secret"] === true; + const dependencies = prop["dependencies"]; + const resources = Array.isArray(dependencies) + ? dependencies.map(d => new resource_1.DependencyResource(d)) + : []; + return new output_1.Output(resources, Promise.resolve(value), Promise.resolve(isKnown), Promise.resolve(isSecret), Promise.resolve([])); + default: + throw new Error(`Unrecognized signature '${sig}' when unmarshaling resource property`); + } + } + // If there isn't a signature, it's not a special type, and we can simply return the object as a map. + // However, we want to push secretness up to the top level (since we can't set sub-properties to secret) + // values since they are not typed as Output. + const obj = {}; + let hadSecrets = false; + for (const k of Object.keys(prop)) { + const o = deserializeProperty(prop[k]); + hadSecrets = hadSecrets || isRpcSecret(o); + obj[k] = unwrapRpcSecret(o); + } + if (hadSecrets) { + return { + [exports.specialSigKey]: exports.specialSecretSig, + value: obj, + }; + } + return obj; + } } -Object.defineProperty(exports, "__esModule", ({ value: true })); -var serializeClosure_1 = __nccwpck_require__(34256); -exports.serializeFunctionAsync = serializeClosure_1.serializeFunctionAsync; -exports.serializeFunction = serializeClosure_1.serializeFunction; -var codePaths_1 = __nccwpck_require__(50276); -exports.computeCodePaths = codePaths_1.computeCodePaths; -var debuggable_1 = __nccwpck_require__(20257); -exports.leakedPromises = debuggable_1.leakedPromises; -var mocks_1 = __nccwpck_require__(94670); -exports.setMocks = mocks_1.setMocks; -__export(__nccwpck_require__(67146)); -__export(__nccwpck_require__(84800)); -__export(__nccwpck_require__(30140)); -__export(__nccwpck_require__(25158)); -__export(__nccwpck_require__(34530)); -__export(__nccwpck_require__(26664)); -//# sourceMappingURL=index.js.map +exports.deserializeProperty = deserializeProperty; +/** + * suppressUnhandledGrpcRejections silences any unhandled promise rejections that occur due to gRPC errors. The input + * promise may still be rejected. + */ +function suppressUnhandledGrpcRejections(p) { + p.catch(err => { + if (!errors_1.isGrpcError(err)) { + throw err; + } + }); + return p; +} +exports.suppressUnhandledGrpcRejections = suppressUnhandledGrpcRejections; +function sameVersion(a, b) { + // We treat undefined as a wildcard, so it always equals every other version. + return a === undefined || b === undefined || semver.eq(a, b); +} +function checkVersion(want, have) { + if (want === undefined || have === undefined) { + return true; + } + return have.major === want.major && have.minor >= want.minor && have.patch >= want.patch; +} +/** @internal */ +function register(source, registrationType, key, item) { + let items = source.get(key); + if (items) { + for (const existing of items) { + if (sameVersion(existing.version, item.version)) { + // It is possible for the same version of the same provider SDK to be loaded multiple times in Node.js. + // In this case, we might legitimately get multiple registrations of the same resource. It should not + // matter which we use, so we can just skip re-registering. De-serialized resources will always be + // instances of classes from the first registered package. + if (settings_1.excessiveDebugOutput) { + log.debug(`skip re-registering already registered ${registrationType} ${key}@${item.version}.`); + } + return false; + } + } + } + else { + items = []; + source.set(key, items); + } + if (settings_1.excessiveDebugOutput) { + log.debug(`registering ${registrationType} ${key}@${item.version}`); + } + items.push(item); + return true; +} +exports.register = register; +/** @internal */ +function getRegistration(source, key, version) { + var _a; + const ver = version ? new semver.SemVer(version) : undefined; + let bestMatch = undefined; + let bestMatchVersion = undefined; + for (const existing of (_a = source.get(key), (_a !== null && _a !== void 0 ? _a : []))) { + const existingVersion = existing.version !== undefined ? new semver.SemVer(existing.version) : undefined; + if (!checkVersion(ver, existingVersion)) { + continue; + } + if (!bestMatch || (existingVersion && bestMatchVersion && semver.gt(existingVersion, bestMatchVersion))) { + bestMatch = existing; + bestMatchVersion = existingVersion; + } + } + return bestMatch; +} +exports.getRegistration = getRegistration; +const resourcePackages = new Map(); +/** @internal Used only for testing purposes. */ +function _resetResourcePackages() { + resourcePackages.clear(); +} +exports._resetResourcePackages = _resetResourcePackages; +/** + * registerResourcePackage registers a resource package that will be used to construct providers for any URNs matching + * the package name and version that are deserialized by the current instance of the Pulumi JavaScript SDK. + */ +function registerResourcePackage(pkg, resourcePackage) { + register(resourcePackages, "package", pkg, resourcePackage); +} +exports.registerResourcePackage = registerResourcePackage; +function getResourcePackage(pkg, version) { + return getRegistration(resourcePackages, pkg, version); +} +exports.getResourcePackage = getResourcePackage; +const resourceModules = new Map(); +function moduleKey(pkg, mod) { + return `${pkg}:${mod}`; +} +/** @internal Used only for testing purposes. */ +function _resetResourceModules() { + resourceModules.clear(); +} +exports._resetResourceModules = _resetResourceModules; +/** + * registerResourceModule registers a resource module that will be used to construct resources for any URNs matching + * the module name and version that are deserialized by the current instance of the Pulumi JavaScript SDK. + */ +function registerResourceModule(pkg, mod, module) { + const key = moduleKey(pkg, mod); + register(resourceModules, "module", key, module); +} +exports.registerResourceModule = registerResourceModule; +function getResourceModule(pkg, mod, version) { + const key = moduleKey(pkg, mod); + return getRegistration(resourceModules, key, version); +} +exports.getResourceModule = getResourceModule; +//# sourceMappingURL=rpc.js.map /***/ }), -/***/ 84800: +/***/ 4530: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -42875,342 +40076,488 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); const grpc = __nccwpck_require__(7025); -const log = __nccwpck_require__(80642); -const output_1 = __nccwpck_require__(43037); -const debuggable_1 = __nccwpck_require__(20257); -const rpc_1 = __nccwpck_require__(25158); -const settings_1 = __nccwpck_require__(34530); -const resource_1 = __nccwpck_require__(90796); -const utils = __nccwpck_require__(21888); -const asyncIterableUtil_1 = __nccwpck_require__(86358); -const gstruct = __nccwpck_require__(68152); -const providerproto = __nccwpck_require__(68870); -const resourceproto = __nccwpck_require__(52480); +const fs = __nccwpck_require__(7147); +const path = __nccwpck_require__(1017); +const debuggable_1 = __nccwpck_require__(257); +const engrpc = __nccwpck_require__(5053); +const engproto = __nccwpck_require__(986); +const resrpc = __nccwpck_require__(5815); +const resproto = __nccwpck_require__(2480); +// maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) +exports.maxRPCMessageSize = 1024 * 1024 * 400; +const grpcChannelOptions = { "grpc.max_receive_message_length": exports.maxRPCMessageSize }; /** - * `invoke` dynamically invokes the function, `tok`, which is offered by a provider plugin. `invoke` - * behaves differently in the case that options contains `{async:true}` or not. - * - * In the case where `{async:true}` is present in the options bag: - * - * 1. the result of `invoke` will be a Promise resolved to the result value of the provider plugin. - * 2. the `props` inputs can be a bag of computed values (including, `T`s, `Promise`s, - * `Output`s etc.). - * - * - * In the case where `{async:true}` is not present in the options bag: - * - * 1. the result of `invoke` will be a Promise resolved to the result value of the provider call. - * However, that Promise will *also* have the respective values of the Provider result exposed - * directly on it as properties. - * - * 2. The inputs must be a bag of simple values, and the result is the result that the Provider - * produced. - * - * Simple values are: - * 1. `undefined`, `null`, string, number or boolean values. - * 2. arrays of simple values. - * 3. objects containing only simple values. + * excessiveDebugOutput enables, well, pretty excessive debug output pertaining to resources and properties. + */ +exports.excessiveDebugOutput = false; +const nodeEnvKeys = { + project: "PULUMI_NODEJS_PROJECT", + stack: "PULUMI_NODEJS_STACK", + dryRun: "PULUMI_NODEJS_DRY_RUN", + queryMode: "PULUMI_NODEJS_QUERY_MODE", + parallel: "PULUMI_NODEJS_PARALLEL", + monitorAddr: "PULUMI_NODEJS_MONITOR", + engineAddr: "PULUMI_NODEJS_ENGINE", + syncDir: "PULUMI_NODEJS_SYNC", + // this value is not set by the CLI and is controlled via a user set env var unlike the values above + cacheDynamicProviders: "PULUMI_NODEJS_CACHE_DYNAMIC_PROVIDERS", +}; +const pulumiEnvKeys = { + testMode: "PULUMI_TEST_MODE", + legacyApply: "PULUMI_ENABLE_LEGACY_APPLY", +}; +// reset options resets nodejs runtime global state (such as rpc clients), +// and sets nodejs runtime option env vars to the specified values. +function resetOptions(project, stack, parallel, engineAddr, monitorAddr, preview) { + monitor = undefined; + engine = undefined; + rpcDone = Promise.resolve(); + featureSupport = {}; + // reset node specific environment variables in the process + process.env[nodeEnvKeys.project] = project; + process.env[nodeEnvKeys.stack] = stack; + process.env[nodeEnvKeys.dryRun] = preview.toString(); + process.env[nodeEnvKeys.queryMode] = isQueryMode.toString(); + process.env[nodeEnvKeys.parallel] = parallel.toString(); + process.env[nodeEnvKeys.monitorAddr] = monitorAddr; + process.env[nodeEnvKeys.engineAddr] = engineAddr; +} +exports.resetOptions = resetOptions; +function setMockOptions(mockMonitor, project, stack, preview) { + const opts = options(); + resetOptions(project || opts.project || "project", stack || opts.stack || "stack", opts.parallel || -1, opts.engineAddr || "", opts.monitorAddr || "", preview || false); + monitor = mockMonitor; +} +exports.setMockOptions = setMockOptions; +/** @internal Used only for testing purposes. */ +function _setIsDryRun(val) { + process.env[nodeEnvKeys.dryRun] = val.toString(); +} +exports._setIsDryRun = _setIsDryRun; +/** + * Returns whether or not we are currently doing a preview. * - * Importantly, simple values do *not* include: - * 1. `Promise`s - * 2. `Output`s - * 3. `Asset`s or `Archive`s - * 4. `Resource`s. + * When writing unit tests, you can set this flag via either `setMocks` or `_setIsDryRun`. + */ +function isDryRun() { + return options().dryRun === true; +} +exports.isDryRun = isDryRun; +/** @internal Used only for testing purposes */ +function _reset() { + resetOptions("", "", -1, "", "", false); +} +exports._reset = _reset; +/** @internal Used only for testing purposes */ +function _setTestModeEnabled(val) { + process.env[pulumiEnvKeys.testMode] = val.toString(); +} +exports._setTestModeEnabled = _setTestModeEnabled; +/** @internal Used only for testing purposes */ +function _setFeatureSupport(key, val) { + featureSupport[key] = val; +} +exports._setFeatureSupport = _setFeatureSupport; +/** + * Returns true if test mode is enabled (PULUMI_TEST_MODE). * - * All of these contain async values that would prevent `invoke from being able to operate - * synchronously. + * NB: this test mode has nothing to do with preview/dryRun modality, and it is not automatically + * enabled by calling `setMocks`. It is a vestigial mechanism related to testing the runtime itself, + * and is not relevant to writing or running unit tests for a Pulumi project. */ -function invoke(tok, props, opts = {}) { - return invokeAsync(tok, props, opts); +function isTestModeEnabled() { + return options().testModeEnabled === true; } -exports.invoke = invoke; -function streamInvoke(tok, props, opts = {}) { - return __awaiter(this, void 0, void 0, function* () { - const label = `StreamInvoking function: tok=${tok} asynchronously`; - log.debug(label + (settings_1.excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``)); - // Wait for all values to be available, and then perform the RPC. - const done = settings_1.rpcKeepAlive(); - try { - const serialized = yield rpc_1.serializeProperties(`streamInvoke:${tok}`, props); - log.debug(`StreamInvoke RPC prepared: tok=${tok}` + settings_1.excessiveDebugOutput - ? `, obj=${JSON.stringify(serialized)}` - : ``); - // Fetch the monitor and make an RPC request. - const monitor = settings_1.getMonitor(); - const provider = yield resource_1.ProviderResource.register(getProvider(tok, opts)); - const req = createInvokeRequest(tok, serialized, provider, opts); - // Call `streamInvoke`. - const result = monitor.streamInvoke(req, {}); - const queue = new asyncIterableUtil_1.PushableAsyncIterable(); - result.on("data", function (thing) { - const live = deserializeResponse(tok, thing); - queue.push(live); - }); - result.on("error", (err) => { - if (err.code === 1) { - return; - } - throw err; - }); - result.on("end", () => { - queue.complete(); - }); - // Return a cancellable handle to the stream. - return new StreamInvokeResponse(queue, () => result.cancel()); - } - finally { - done(); - } - }); +exports.isTestModeEnabled = isTestModeEnabled; +/** + * Checks that test mode is enabled and, if not, throws an error. + */ +function requireTestModeEnabled() { + if (!isTestModeEnabled()) { + throw new Error("Program run without the Pulumi engine available; re-run using the `pulumi` CLI"); + } } -exports.streamInvoke = streamInvoke; -function invokeAsync(tok, props, opts) { - return __awaiter(this, void 0, void 0, function* () { - const label = `Invoking function: tok=${tok} asynchronously`; - log.debug(label + (settings_1.excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``)); - // Wait for all values to be available, and then perform the RPC. - const done = settings_1.rpcKeepAlive(); - try { - const serialized = yield rpc_1.serializeProperties(`invoke:${tok}`, props); - log.debug(`Invoke RPC prepared: tok=${tok}` + settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(serialized)}` : ``); - // Fetch the monitor and make an RPC request. - const monitor = settings_1.getMonitor(); - const provider = yield resource_1.ProviderResource.register(getProvider(tok, opts)); - const req = createInvokeRequest(tok, serialized, provider, opts); - const resp = yield debuggable_1.debuggablePromise(new Promise((innerResolve, innerReject) => monitor.invoke(req, (err, innerResponse) => { - log.debug(`Invoke RPC finished: tok=${tok}; err: ${err}, resp: ${innerResponse}`); - if (err) { - // If the monitor is unavailable, it is in the process of shutting down or has already - // shut down. Don't emit an error and don't do any more RPCs, just exit. - if (err.code === grpc.status.UNAVAILABLE || err.code === grpc.status.CANCELLED) { - settings_1.terminateRpcs(); - err.message = "Resource monitor is terminating"; - innerReject(err); - return; - } - // If the RPC failed, rethrow the error with a native exception and the message that - // the engine provided - it's suitable for user presentation. - innerReject(new Error(err.details)); - } - else { - innerResolve(innerResponse); - } - })), label); - // Finally propagate any other properties that were given to us as outputs. - return deserializeResponse(tok, resp); - } - finally { - done(); - } - }); +/** @internal Used only for testing purposes. */ +function _setQueryMode(val) { + process.env[nodeEnvKeys.queryMode] = val.toString(); } -// StreamInvokeResponse represents a (potentially infinite) streaming response to `streamInvoke`, -// with facilities to gracefully cancel and clean up the stream. -class StreamInvokeResponse { - constructor(source, cancelSource) { - this.source = source; - this.cancelSource = cancelSource; +exports._setQueryMode = _setQueryMode; +/** + * Returns true if query mode is enabled. + */ +function isQueryMode() { + return options().queryMode === true; +} +exports.isQueryMode = isQueryMode; +/** + * Returns true if we will resolve missing outputs to inputs during preview (PULUMI_ENABLE_LEGACY_APPLY). + */ +function isLegacyApplyEnabled() { + return options().legacyApply === true; +} +exports.isLegacyApplyEnabled = isLegacyApplyEnabled; +/** + * Returns true (default) if we will cache serialized dynamic providers on the program side + */ +function cacheDynamicProviders() { + return options().cacheDynamicProviders === true; +} +exports.cacheDynamicProviders = cacheDynamicProviders; +/** + * Get the project being run by the current update. + */ +function getProject() { + const project = options().project; + if (project) { + return project; } - // cancel signals the `streamInvoke` should be cancelled and cleaned up gracefully. - cancel() { - this.cancelSource(); + // If the project is missing, specialize the error. First, if test mode is disabled: + requireTestModeEnabled(); + // And now an error if test mode is enabled, instructing how to manually configure the project: + throw new Error("Missing project name; for test mode, please call `pulumi.runtime.setMocks`"); +} +exports.getProject = getProject; +/** @internal Used only for testing purposes. */ +function _setProject(val) { + process.env[nodeEnvKeys.project] = val; +} +exports._setProject = _setProject; +/** + * Get the stack being targeted by the current update. + */ +function getStack() { + const stack = options().stack; + if (stack) { + return stack; } - [Symbol.asyncIterator]() { - return this.source[Symbol.asyncIterator](); + // If the stack is missing, specialize the error. First, if test mode is disabled: + requireTestModeEnabled(); + // And now an error if test mode is enabled, instructing how to manually configure the stack: + throw new Error("Missing stack name; for test mode, please set PULUMI_NODEJS_STACK"); +} +exports.getStack = getStack; +/** @internal Used only for testing purposes. */ +function _setStack(val) { + process.env[nodeEnvKeys.stack] = val; +} +exports._setStack = _setStack; +/** + * monitor is a live connection to the resource monitor that tracks deployments (lazily initialized). + */ +let monitor; +let featureSupport = {}; +/** + * hasMonitor returns true if we are currently connected to a resource monitoring service. + */ +function hasMonitor() { + return !!monitor && !!options().monitorAddr; +} +exports.hasMonitor = hasMonitor; +/** + * getMonitor returns the current resource monitoring service client for RPC communications. + */ +function getMonitor() { + // pre-emptive fail fast check for node inline programs + runSxSCheck(); + if (monitor === undefined) { + const addr = options().monitorAddr; + if (addr) { + // Lazily initialize the RPC connection to the monitor. + monitor = new resrpc.ResourceMonitorClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); + } + else { + // If test mode isn't enabled, we can't run the program without an engine. + requireTestModeEnabled(); + } } + return monitor; } -exports.StreamInvokeResponse = StreamInvokeResponse; -function createInvokeRequest(tok, serialized, provider, opts) { - if (provider !== undefined && typeof provider !== "string") { - throw new Error("Incorrect provider type."); +exports.getMonitor = getMonitor; +let syncInvokes; +/** @internal */ +function tryGetSyncInvokes() { + const syncDir = options().syncDir; + if (syncInvokes === undefined && syncDir) { + const requests = fs.openSync(path.join(syncDir, "invoke_req"), fs.constants.O_WRONLY | fs.constants.O_SYNC); + const responses = fs.openSync(path.join(syncDir, "invoke_res"), fs.constants.O_RDONLY | fs.constants.O_SYNC); + syncInvokes = { requests, responses }; } - const obj = gstruct.Struct.fromJavaScript(serialized); - const req = new resourceproto.ResourceInvokeRequest(); - req.setTok(tok); - req.setArgs(obj); - req.setProvider(provider); - req.setVersion(opts.version || ""); - req.setAcceptresources(!utils.disableResourceReferences); - return req; + return syncInvokes; } -function getProvider(tok, opts) { - return opts.provider ? opts.provider : - opts.parent ? opts.parent.getProvider(tok) : undefined; +exports.tryGetSyncInvokes = tryGetSyncInvokes; +/** + * engine is a live connection to the engine, used for logging, etc. (lazily initialized). + */ +let engine; +/** + * hasEngine returns true if we are currently connected to an engine. + */ +function hasEngine() { + return !!engine && !!options().engineAddr; } -function deserializeResponse(tok, resp) { - const failures = resp.getFailuresList(); - if (failures && failures.length) { - let reasons = ""; - for (let i = 0; i < failures.length; i++) { - if (reasons !== "") { - reasons += "; "; - } - reasons += `${failures[i].getReason()} (${failures[i].getProperty()})`; +exports.hasEngine = hasEngine; +/** + * getEngine returns the current engine, if any, for RPC communications back to the resource engine. + */ +function getEngine() { + if (engine === undefined) { + const addr = options().engineAddr; + if (addr) { + // Lazily initialize the RPC connection to the engine. + engine = new engrpc.EngineClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); } - throw new Error(`Invoke of '${tok}' failed: ${reasons}`); } - const ret = resp.getReturn(); - return ret === undefined - ? ret - : rpc_1.deserializeProperties(ret); + return engine; +} +exports.getEngine = getEngine; +function terminateRpcs() { + disconnectSync(); } +exports.terminateRpcs = terminateRpcs; /** - * `call` dynamically calls the function, `tok`, which is offered by a provider plugin. + * serialize returns true if resource operations should be serialized. */ -function call(tok, props, res) { - const label = `Calling function: tok=${tok}`; - log.debug(label + (settings_1.excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``)); - const [out, resolver] = createOutput(`call(${tok})`); - debuggable_1.debuggablePromise(Promise.resolve().then(() => __awaiter(this, void 0, void 0, function* () { - const done = settings_1.rpcKeepAlive(); +function serialize() { + return options().parallel === 1; +} +exports.serialize = serialize; +/** + * options returns the options from the environment, which is the source of truth. Options are global per process. + * For CLI driven programs, pulumi-language-nodejs sets environment variables prior to the user program loading, + * meaning that options could be loaded up front and cached. + * Automation API and multi-language components introduced more complex lifecycles for runtime options(). + * These language hosts manage the lifecycle of options manually throughout the lifetime of the nodejs process. + * In addition, node module resolution can lead to duplicate copies of @pulumi/pulumi and thus duplicate options + * objects that may not be synced if options are cached upfront. Mutating options must write to the environment + * and reading options must always read directly from the environment. + + */ +function options() { + // pre-emptive fail fast check for node inline programs + runSxSCheck(); + // The only option that needs parsing is the parallelism flag. Ignore any failures. + let parallel; + const parallelOpt = process.env[nodeEnvKeys.parallel]; + if (parallelOpt) { try { - // Construct a provider reference from the given provider, if one is available on the resource. - let provider = undefined; - let version = undefined; - let pluginDownloadURL = undefined; - if (res) { - if (res.__prov) { - provider = yield resource_1.ProviderResource.register(res.__prov); - } - version = res.__version; - pluginDownloadURL = res.__pluginDownloadURL; - } - // We keep output values when serializing inputs for call. - const [serialized, propertyDepsResources] = yield rpc_1.serializePropertiesReturnDeps(`call:${tok}`, props, { - keepOutputValues: true, - }); - log.debug(`Call RPC prepared: tok=${tok}` + settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(serialized)}` : ``); - const req = yield createCallRequest(tok, serialized, propertyDepsResources, provider, version, pluginDownloadURL); - const monitor = settings_1.getMonitor(); - const resp = yield debuggable_1.debuggablePromise(new Promise((innerResolve, innerReject) => monitor.call(req, (err, innerResponse) => { - log.debug(`Call RPC finished: tok=${tok}; err: ${err}, resp: ${innerResponse}`); - if (err) { - // If the monitor is unavailable, it is in the process of shutting down or has already - // shut down. Don't emit an error and don't do any more RPCs, just exit. - if (err.code === grpc.status.UNAVAILABLE || err.code === grpc.status.CANCELLED) { - settings_1.terminateRpcs(); - err.message = "Resource monitor is terminating"; - innerReject(err); - return; - } - // If the RPC failed, rethrow the error with a native exception and the message that - // the engine provided - it's suitable for user presentation. - innerReject(new Error(err.details)); - } - else { - innerResolve(innerResponse); - } - })), label); - // Deserialize the response and resolve the output. - const deserialized = deserializeResponse(tok, resp); - let isSecret = false; - const deps = []; - // Keep track of whether we need to mark the resulting output a secret. - // and unwrap each individual value. - for (const k of Object.keys(deserialized)) { - const v = deserialized[k]; - if (rpc_1.isRpcSecret(v)) { - isSecret = true; - deserialized[k] = rpc_1.unwrapRpcSecret(v); - } - } - // Combine the individual dependencies into a single set of dependency resources. - const rpcDeps = resp.getReturndependenciesMap(); - if (rpcDeps) { - const urns = new Set(); - for (const [, returnDeps] of rpcDeps.entries()) { - for (const urn of returnDeps.getUrnsList()) { - urns.add(urn); - } - } - for (const urn of urns) { - deps.push(new resource_1.DependencyResource(urn)); - } - } - // If the value the engine handed back is or contains an unknown value, the resolver will mark its value as - // unknown automatically, so we just pass true for isKnown here. Note that unknown values will only be - // present during previews (i.e. isDryRun() will be true). - resolver(deserialized, true, isSecret, deps); - } - catch (e) { - resolver(undefined, true, false, undefined, e); + parallel = parseInt(parallelOpt, 10); } - finally { - done(); + catch (err) { + // ignore. } - })), label); - return out; + } + // Now just hydrate the rest from environment variables. These might be missing, in which case + // we will fail later on when we actually need to create an RPC connection back to the engine. + return { + // node runtime + project: process.env[nodeEnvKeys.project], + stack: process.env[nodeEnvKeys.stack], + dryRun: (process.env[nodeEnvKeys.dryRun] === "true"), + queryMode: (process.env[nodeEnvKeys.queryMode] === "true"), + parallel: parallel, + monitorAddr: process.env[nodeEnvKeys.monitorAddr], + engineAddr: process.env[nodeEnvKeys.engineAddr], + syncDir: process.env[nodeEnvKeys.syncDir], + cacheDynamicProviders: process.env[nodeEnvKeys.cacheDynamicProviders] !== "false", + // pulumi specific + testModeEnabled: (process.env[pulumiEnvKeys.testMode] === "true"), + legacyApply: (process.env[pulumiEnvKeys.legacyApply] === "true"), + }; } -exports.call = call; -function createOutput(label) { - let resolveValue; - let rejectValue; - let resolveIsKnown; - let rejectIsKnown; - let resolveIsSecret; - let rejectIsSecret; - let resolveDeps; - let rejectDeps; - const resolver = (v, isKnown, isSecret, deps = [], err) => { - if (!!err) { - rejectValue(err); - rejectIsKnown(err); - rejectIsSecret(err); - rejectDeps(err); +/** + * disconnect permanently disconnects from the server, closing the connections. It waits for the existing RPC + * queue to drain. If any RPCs come in afterwards, however, they will crash the process. + */ +function disconnect() { + return waitForRPCs(/*disconnectFromServers*/ true); +} +exports.disconnect = disconnect; +/** @internal */ +function waitForRPCs(disconnectFromServers = false) { + let done; + const closeCallback = () => { + if (done !== rpcDone) { + // If the done promise has changed, some activity occurred in between callbacks. Wait again. + done = rpcDone; + return debuggable_1.debuggablePromise(done.then(closeCallback), "disconnect"); } - else { - resolveValue(v); - resolveIsKnown(isKnown); - resolveIsSecret(isSecret); - resolveDeps(deps); + if (disconnectFromServers) { + disconnectSync(); } + return Promise.resolve(); }; - const out = new output_1.Output([], debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveValue = resolve; - rejectValue = reject; - }), `${label}Value`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveIsKnown = resolve; - rejectIsKnown = reject; - }), `${label}IsKnown`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveIsSecret = resolve; - rejectIsSecret = reject; - }), `${label}IsSecret`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveDeps = resolve; - rejectDeps = reject; - }), `${label}Deps`)); - return [out, resolver]; + return closeCallback(); } -function createCallRequest(tok, serialized, serializedDeps, provider, version, pluginDownloadURL) { +exports.waitForRPCs = waitForRPCs; +/** + * disconnectSync permanently disconnects from the server, closing the connections. Unlike `disconnect`. it does not + * wait for the existing RPC queue to drain. Any RPCs that come in after this call will crash the process. + */ +function disconnectSync() { + // Otherwise, actually perform the close activities (ignoring errors and crashes). + if (monitor) { + try { + monitor.close(); + } + catch (err) { + // ignore. + } + monitor = null; + } + if (engine) { + try { + engine.close(); + } + catch (err) { + // ignore. + } + engine = null; + } +} +exports.disconnectSync = disconnectSync; +/** + * rpcDone resolves when the last known client-side RPC call finishes. + */ +let rpcDone = Promise.resolve(); +/** + * rpcKeepAlive registers a pending call to ensure that we don't prematurely disconnect from the server. It returns + * a function that, when invoked, signals that the RPC has completed. + */ +function rpcKeepAlive() { + let done = undefined; + const donePromise = debuggable_1.debuggablePromise(new Promise(resolve => done = resolve), "rpcKeepAlive"); + rpcDone = rpcDone.then(() => donePromise); + return done; +} +exports.rpcKeepAlive = rpcKeepAlive; +/** + * setRootResource registers a resource that will become the default parent for all resources without explicit parents. + */ +function setRootResource(res) { return __awaiter(this, void 0, void 0, function* () { - if (provider !== undefined && typeof provider !== "string") { - throw new Error("Incorrect provider type."); + const engineRef = getEngine(); + if (!engineRef) { + return Promise.resolve(); } - const obj = gstruct.Struct.fromJavaScript(serialized); - const req = new providerproto.CallRequest(); - req.setTok(tok); - req.setArgs(obj); - req.setProvider(provider); - req.setVersion(version || ""); - req.setPlugindownloadurl(pluginDownloadURL || ""); - const argDependencies = req.getArgdependenciesMap(); - for (const [key, propertyDeps] of serializedDeps) { - const urns = new Set(); - for (const dep of propertyDeps) { - const urn = yield dep.urn.promise(); - urns.add(urn); - } - const deps = new providerproto.CallRequest.ArgumentDependencies(); - deps.setUrnsList(Array.from(urns)); - argDependencies.set(key, deps); + // Back-compat case - Try to set the root URN for SxS old SDKs that expect the engine to roundtrip the + // stack URN. + const req = new engproto.SetRootResourceRequest(); + const urn = yield res.urn.promise(); + req.setUrn(urn); + return new Promise((resolve, reject) => { + engineRef.setRootResource(req, (err, resp) => { + // Back-compat case - if the engine we're speaking to isn't aware that it can save and load root + // resources, just ignore there's nothing we can do. + if (err && err.code === grpc.status.UNIMPLEMENTED) { + return resolve(); + } + if (err) { + return reject(err); + } + return resolve(); + }); + }); + }); +} +exports.setRootResource = setRootResource; +/** + * monitorSupportsFeature returns a promise that when resolved tells you if the resource monitor we are connected + * to is able to support a particular feature. + */ +function monitorSupportsFeature(feature) { + return __awaiter(this, void 0, void 0, function* () { + const monitorRef = getMonitor(); + if (!monitorRef) { + // If there's no monitor and test mode is disabled, just return false. Otherwise, return whatever is present in + // the featureSupport map. + return isTestModeEnabled() && featureSupport[feature]; } - return req; + if (featureSupport[feature] === undefined) { + const req = new resproto.SupportsFeatureRequest(); + req.setId(feature); + const result = yield new Promise((resolve, reject) => { + monitorRef.supportsFeature(req, (err, resp) => { + // Back-compat case - if the monitor doesn't let us ask if it supports a feature, it doesn't support + // secrets. + if (err && err.code === grpc.status.UNIMPLEMENTED) { + return resolve(false); + } + if (err) { + return reject(err); + } + return resolve(resp.getHassupport()); + }); + }); + featureSupport[feature] = result; + } + return featureSupport[feature]; }); } -//# sourceMappingURL=invoke.js.map +exports.monitorSupportsFeature = monitorSupportsFeature; +/** + * monitorSupportsSecrets returns a promise that when resolved tells you if the resource monitor we are connected + * to is able to support secrets across its RPC interface. When it does, we marshal outputs marked with the secret + * bit in a special way. + */ +function monitorSupportsSecrets() { + return monitorSupportsFeature("secrets"); +} +exports.monitorSupportsSecrets = monitorSupportsSecrets; +/** + * monitorSupportsResourceReferences returns a promise that when resolved tells you if the resource monitor we are + * connected to is able to support resource references across its RPC interface. When it does, we marshal resources + * in a special way. + */ +function monitorSupportsResourceReferences() { + return __awaiter(this, void 0, void 0, function* () { + return monitorSupportsFeature("resourceReferences"); + }); +} +exports.monitorSupportsResourceReferences = monitorSupportsResourceReferences; +/** + * monitorSupportsOutputValues returns a promise that when resolved tells you if the resource monitor we are + * connected to is able to support output values across its RPC interface. When it does, we marshal outputs + * in a special way. + */ +function monitorSupportsOutputValues() { + return __awaiter(this, void 0, void 0, function* () { + return monitorSupportsFeature("outputValues"); + }); +} +exports.monitorSupportsOutputValues = monitorSupportsOutputValues; +// sxsRandomIdentifier is a module level global that is transfered to process.env. +// the goal is to detect side by side (sxs) pulumi/pulumi situations for inline programs +// and fail fast. See https://github.com/pulumi/pulumi/issues/7333 for details. +const sxsRandomIdentifier = Math.random().toString(); +// indicates that the current runtime context is via an inline program via automation api. +let isInline = false; +/** @internal only used by the internal inline language host implementation */ +function setInline() { + isInline = true; +} +exports.setInline = setInline; +const pulumiSxSEnv = "PULUMI_NODEJS_SXS_FLAG"; +/** + * runSxSCheck checks an identifier stored in the environment to detect multiple versions of pulumi. + * if we're running in inline mode, it will throw an error to fail fast due to global state collisions that can occur. + */ +function runSxSCheck() { + const envSxS = process.env[pulumiSxSEnv]; + process.env[pulumiSxSEnv] = sxsRandomIdentifier; + if (!isInline) { + return; + } + // if we see a different identifier, another version of pulumi has been loaded and we should fail. + if (!!envSxS && envSxS !== sxsRandomIdentifier) { + throw new Error("Detected multiple versions of '@pulumi/pulumi' in use in an inline automation api program.\n" + + "Use the yarn 'resolutions' field to pin to a single version: https://github.com/pulumi/pulumi/issues/5449."); + } +} +//# sourceMappingURL=settings.js.map /***/ }), -/***/ 94670: +/***/ 6664: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -43238,148 +40585,275 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const rpc_1 = __nccwpck_require__(25158); -const settings_1 = __nccwpck_require__(34530); -const provproto = __nccwpck_require__(68870); -const resproto = __nccwpck_require__(52480); -const structproto = __nccwpck_require__(68152); -class MockMonitor { - constructor(mocks) { - this.mocks = mocks; - this.resources = new Map(); - } - newUrn(parent, type, name) { - if (parent) { - const qualifiedType = parent.split("::")[2]; - const parentType = qualifiedType.split("$").pop(); - type = parentType + "$" + type; - } - return "urn:pulumi:" + [settings_1.getStack(), settings_1.getProject(), type, name].join("::"); +const asset = __nccwpck_require__(3031); +const metadata_1 = __nccwpck_require__(8085); +const output_1 = __nccwpck_require__(3037); +const resource_1 = __nccwpck_require__(796); +const settings_1 = __nccwpck_require__(4530); +/** + * rootPulumiStackTypeName is the type name that should be used to construct the root component in the tree of Pulumi + * resources allocated by a deployment. This must be kept up to date with + * `github.com/pulumi/pulumi/sdk/v3/go/common/resource/stack.RootStackType`. + */ +exports.rootPulumiStackTypeName = "pulumi:pulumi:Stack"; +// Get the root stack resource for the current stack deployment +function getStackResource() { + return globalThis.stackResource; +} +exports.getStackResource = getStackResource; +/** + * runInPulumiStack creates a new Pulumi stack resource and executes the callback inside of it. Any outputs + * returned by the callback will be stored as output properties on this resulting Stack object. + */ +function runInPulumiStack(init) { + if (!settings_1.isQueryMode()) { + const stack = new Stack(init); + return stack.outputs.promise(); + } + else { + return init(); + } +} +exports.runInPulumiStack = runInPulumiStack; +/** + * Stack is the root resource for a Pulumi stack. Before invoking the `init` callback, it registers itself as the root + * resource with the Pulumi engine. + */ +class Stack extends resource_1.ComponentResource { + constructor(init) { + // Clear the stackResource so that when the Resource constructor runs it gives us no parent, we'll + // then set this to ourselves in init before calling the user code that will then create other + // resources. + globalThis.stackResource = undefined; + super(exports.rootPulumiStackTypeName, `${metadata_1.getProject()}-${metadata_1.getStack()}`, { init }); + const data = this.getData(); + this.outputs = output_1.output(data); } - invoke(req, callback) { + /** + * runInit invokes the given init callback with this resource set as the root resource. The return value of init is + * used as the stack's output properties. + * + * @param init The callback to run in the context of this Pulumi stack + */ + initialize(args) { + const _super = Object.create(null, { + registerOutputs: { get: () => super.registerOutputs } + }); return __awaiter(this, void 0, void 0, function* () { + yield settings_1.setRootResource(this); + // Set the global reference to the stack resource before invoking this init() function + globalThis.stackResource = this; + let outputs; try { - const tok = req.getTok(); - const inputs = rpc_1.deserializeProperties(req.getArgs()); - if (tok === "pulumi:pulumi:getResource") { - const registeredResource = this.resources.get(inputs.urn); - if (!registeredResource) { - throw new Error(`unknown resource ${inputs.urn}`); - } - const resp = new provproto.InvokeResponse(); - resp.setReturn(structproto.Struct.fromJavaScript(registeredResource)); - callback(null, resp); - return; - } - const result = this.mocks.call({ - token: tok, - inputs: inputs, - provider: req.getProvider(), - }); - const response = new provproto.InvokeResponse(); - response.setReturn(structproto.Struct.fromJavaScript(yield rpc_1.serializeProperties("", result))); - callback(null, response); + const inputs = yield args.init(); + outputs = yield massage(inputs, []); } - catch (err) { - callback(err, undefined); + finally { + // We want to expose stack outputs as simple pojo objects (including Resources). This + // helps ensure that outputs can point to resources, and that that is stored and + // presented as something reasonable, and not as just an id/urn in the case of + // Resources. + _super.registerOutputs.call(this, outputs); } + return outputs; }); } - readResource(req, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const result = this.mocks.newResource({ - type: req.getType(), - name: req.getName(), - inputs: rpc_1.deserializeProperties(req.getProperties()), - provider: req.getProvider(), - custom: req.getCustom(), - id: req.getId(), - }); - const urn = this.newUrn(req.getParent(), req.getType(), req.getName()); - const serializedState = yield rpc_1.serializeProperties("", result.state); - this.resources.set(urn, { urn, id: result.id, state: serializedState }); - const response = new resproto.ReadResourceResponse(); - response.setUrn(urn); - response.setProperties(structproto.Struct.fromJavaScript(serializedState)); - callback(null, response); +} +function massage(prop, objectStack) { + return __awaiter(this, void 0, void 0, function* () { + if (prop === undefined || + prop === null || + typeof prop === "boolean" || + typeof prop === "number" || + typeof prop === "string") { + return prop; + } + if (prop instanceof Promise) { + return yield massage(yield prop, objectStack); + } + if (output_1.Output.isInstance(prop)) { + const result = prop.apply(v => massage(v, objectStack)); + // explicitly await the underlying promise of the output here. This is necessary to get a + // deterministic walk of the object graph. We need that deterministic walk, otherwise our + // actual cycle detection logic (using 'objectStack') doesn't work. i.e. if we don't do + // this then the main walking logic will be interleaved with the async function this output + // is executing. This interleaving breaks out assumption about pushing/popping values onto + // objectStack' + yield result.promise(); + return result; + } + // from this point on, we have complex objects. If we see them again, we don't want to emit + // them again fully or else we'd loop infinitely. + if (objectStack.indexOf(prop) >= 0) { + // Note: for Resources we hit again, emit their urn so cycles can be easily understood + // in the pojo objects. + if (resource_1.Resource.isInstance(prop)) { + return yield massage(prop.urn, objectStack); } - catch (err) { - callback(err, undefined); + return undefined; + } + try { + // push and pop what we see into a stack. That way if we see the same object through + // different paths, we will still print it out. We only skip it if it would truly cause + // recursion. + objectStack.push(prop); + return yield massageComplex(prop, objectStack); + } + finally { + const popped = objectStack.pop(); + if (popped !== prop) { + throw new Error("Invariant broken when processing stack outputs"); } - }); - } - registerResource(req, callback) { - return __awaiter(this, void 0, void 0, function* () { - try { - const result = this.mocks.newResource({ - type: req.getType(), - name: req.getName(), - inputs: rpc_1.deserializeProperties(req.getObject()), - provider: req.getProvider(), - custom: req.getCustom(), - id: req.getImportid(), - }); - const urn = this.newUrn(req.getParent(), req.getType(), req.getName()); - const serializedState = yield rpc_1.serializeProperties("", result.state); - this.resources.set(urn, { urn, id: result.id, state: serializedState }); - const response = new resproto.RegisterResourceResponse(); - response.setUrn(urn); - response.setId(result.id); - response.setObject(structproto.Struct.fromJavaScript(serializedState)); - callback(null, response); + } + }); +} +function massageComplex(prop, objectStack) { + return __awaiter(this, void 0, void 0, function* () { + if (asset.Asset.isInstance(prop)) { + if (prop.path !== undefined) { + return { path: prop.path }; } - catch (err) { - callback(err, undefined); + else if (prop.uri !== undefined) { + return { uri: prop.uri }; } - }); - } - registerResourceOutputs(req, callback) { - try { - const registeredResource = this.resources.get(req.getUrn()); - if (!registeredResource) { - throw new Error(`unknown resource ${req.getUrn()}`); + else if (prop.text !== undefined) { + return { text: "..." }; } - registeredResource.state = req.getOutputs(); - callback(null, {}); + return undefined; } - catch (err) { - callback(err, undefined); + if (asset.Archive.isInstance(prop)) { + if (prop.assets) { + return { assets: yield massage(prop.assets, objectStack) }; + } + else if (prop.path !== undefined) { + return { path: prop.path }; + } + else if (prop.uri !== undefined) { + return { uri: prop.uri }; + } + return undefined; } + if (resource_1.Resource.isInstance(prop)) { + // Emit a resource as a normal pojo. But filter out all our internal properties so that + // they don't clutter the display/checkpoint with values not relevant to the application. + // + // In preview only, we mark the POJO with "@isPulumiResource" to indicate that it is derived + // from a resource. This allows the engine to perform resource-specific filtering of unknowns + // from output diffs during a preview. This filtering is not necessary during an update because + // all property values are known. + const pojo = yield serializeAllKeys(n => !n.startsWith("__")); + return !settings_1.isDryRun() ? pojo : Object.assign(Object.assign({}, pojo), { "@isPulumiResource": true }); + } + if (prop instanceof Array) { + const result = []; + for (let i = 0; i < prop.length; i++) { + result[i] = yield massage(prop[i], objectStack); + } + return result; + } + return yield serializeAllKeys(n => true); + function serializeAllKeys(include) { + return __awaiter(this, void 0, void 0, function* () { + const obj = {}; + for (const k of Object.keys(prop)) { + if (include(k)) { + obj[k] = yield massage(prop[k], objectStack); + } + } + return obj; + }); + } + }); +} +/** + * Add a transformation to all future resources constructed in this Pulumi stack. + */ +function registerStackTransformation(t) { + if (!globalThis.stackResource) { + throw new Error("The root stack resource was referenced before it was initialized."); } - supportsFeature(req, callback) { - const id = req.getId(); - // Support for "outputValues" is deliberately disabled for the mock monitor so - // instances of `Output` don't show up in `MockResourceArgs` inputs. - const hasSupport = id === "secrets" || id === "resourceReferences"; - callback(null, { - getHassupport: () => hasSupport, - }); - } + globalThis.stackResource.__transformations = [...(globalThis.stackResource.__transformations || []), t]; } -exports.MockMonitor = MockMonitor; +exports.registerStackTransformation = registerStackTransformation; +//# sourceMappingURL=stack.js.map + +/***/ }), + +/***/ 1888: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Copyright 2016-2018, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); /** - * setMocks configures the Pulumi runtime to use the given mocks for testing. + * Common code for doing RTTI typechecks. RTTI is done by having a boolean property on an object + * with a special name (like "__resource" or "__asset"). This function checks that the object + * exists, has a **boolean** property with that name, and that that boolean property has the value + * of 'true'. Checking that property is 'boolean' helps ensure that this test works even on proxies + * that synthesize properties dynamically (like Output). Checking that the property has the 'true' + * value isn't strictly necessary, but works to make sure that the impls are following a common + * pattern. * - * @param mocks: The mocks to use for calls to provider functions and resource consrtuction. - * @param project: If provided, the name of the Pulumi project. Defaults to "project". - * @param stack: If provided, the name of the Pulumi stack. Defaults to "stack". - * @param preview: If provided, indicates whether or not the program is running a preview. Defaults to false. + * @internal */ -function setMocks(mocks, project, stack, preview) { - settings_1.setMockOptions(new MockMonitor(mocks), project, stack, preview); +function isInstance(obj, name) { + return hasTrueBooleanMember(obj, name); +} +exports.isInstance = isInstance; +/** @internal */ +function hasTrueBooleanMember(obj, memberName) { + if (obj === undefined || obj === null) { + return false; + } + const val = obj[memberName]; + if (typeof val !== "boolean") { + return false; + } + return val === true; +} +exports.hasTrueBooleanMember = hasTrueBooleanMember; +// Workaround errors we sometimes get on some machines saying that Object.values is not available. +/** @internal */ +function values(obj) { + const result = []; + for (const key of Object.keys(obj)) { + result.push(obj[key]); + } + return result; } -exports.setMocks = setMocks; -//# sourceMappingURL=mocks.js.map +exports.values = values; +/** @internal */ +function union(set1, set2) { + return new Set([...set1, ...set2]); +} +exports.union = union; +/** @internal */ +exports.disableResourceReferences = process.env.PULUMI_DISABLE_RESOURCE_REFERENCES === "1" || + (_a = process.env.PULUMI_DISABLE_RESOURCE_REFERENCES, (_a !== null && _a !== void 0 ? _a : "")).toUpperCase() === "TRUE"; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 30140: +/***/ 5907: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2021, Pulumi Corporation. +// Copyright 2016-2019, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -43393,749 +40867,417 @@ exports.setMocks = setMocks; // See the License for the specific language governing permissions and // limitations under the License. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const grpc = __nccwpck_require__(7025); -const query = __nccwpck_require__(39160); -const log = __nccwpck_require__(80642); -const utils = __nccwpck_require__(21888); -const output_1 = __nccwpck_require__(43037); -const resource_1 = __nccwpck_require__(90796); -const resource_2 = __nccwpck_require__(90796); -const debuggable_1 = __nccwpck_require__(20257); -const invoke_1 = __nccwpck_require__(84800); -const rpc_1 = __nccwpck_require__(25158); -const settings_1 = __nccwpck_require__(34530); -const gstruct = __nccwpck_require__(68152); -const resproto = __nccwpck_require__(52480); -/** - * Get an existing resource's state from the engine. - */ -function getResource(res, parent, props, custom, urn) { - // Extract the resource type from the URN. - const urnParts = urn.split("::"); - const qualifiedType = urnParts[2]; - const urnName = urnParts[3]; - const type = qualifiedType.split("$").pop(); - const label = `resource:urn=${urn}`; - log.debug(`Getting resource: urn=${urn}`); - const monitor = settings_1.getMonitor(); - const resopAsync = prepareResource(label, res, parent, custom, false, props, {}); - const preallocError = new Error(); - debuggable_1.debuggablePromise(resopAsync.then((resop) => __awaiter(this, void 0, void 0, function* () { - const inputs = yield rpc_1.serializeProperties(label, { urn }); - const req = new resproto.ResourceInvokeRequest(); - req.setTok("pulumi:pulumi:getResource"); - req.setArgs(gstruct.Struct.fromJavaScript(inputs)); - req.setProvider(""); - req.setVersion(""); - // Now run the operation, serializing the invocation if necessary. - const opLabel = `monitor.getResource(${label})`; - runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { - let resp = {}; - let err; - try { - if (monitor) { - resp = yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.invoke(req, (rpcError, innerResponse) => { - log.debug(`getResource Invoke RPC finished: err: ${rpcError}, resp: ${innerResponse}`); - if (rpcError) { - if (rpcError.code === grpc.status.UNAVAILABLE || rpcError.code === grpc.status.CANCELLED) { - err = rpcError; - settings_1.terminateRpcs(); - rpcError.message = "Resource monitor is terminating"; - preallocError.code = rpcError.code; - } - preallocError.message = `failed to get resource:urn=${urn}: ${rpcError.message}`; - reject(new Error(rpcError.details)); - } - else { - resolve(innerResponse); - } - })), opLabel); - // If the invoke failed, raise an error - const failures = resp.getFailuresList(); - if (failures && failures.length) { - let reasons = ""; - for (let i = 0; i < failures.length; i++) { - if (reasons !== "") { - reasons += "; "; - } - reasons += `${failures[i].getReason()} (${failures[i].getProperty()})`; - } - throw new Error(`getResource Invoke failed: ${reasons}`); +const base_1 = __nccwpck_require__(4139); +const operators_1 = __nccwpck_require__(327); +const sources_1 = __nccwpck_require__(8396); +class AsyncQueryableImpl extends base_1.IterableBase { + constructor(source) { + super(source); + } + // + // Constructors. + // + static from(source) { + return new AsyncQueryableImpl(sources_1.from(source)); + } + // + // Restriction operators. + // + filter(f) { + return this.pipe(operators_1.filter(f)); + } + // + // Projection operators. + // + flatMap(selector, resultSelector = (t, ti) => ti) { + return this.pipe(operators_1.flatMap(selector, resultSelector)); + } + map(f) { + return this.pipe(operators_1.map(f)); + } + // + // Partitioning operators. + // + skip(n) { + return this.pipe(operators_1.skip(n)); + } + skipWhile(predicate) { + return this.pipe(operators_1.skipWhile(predicate)); + } + take(n) { + return this.pipe(operators_1.take(n)); + } + takeWhile(predicate) { + return this.pipe(operators_1.takeWhile(predicate)); + } + // + // Join operators. + // + join(inner, outerKeySelector, innerKeySelector, resultSelector) { + return this.pipe(operators_1.join(sources_1.from(inner), outerKeySelector, innerKeySelector, resultSelector)); + } + groupJoin(inner, outerKeySelector, innerKeySelector, resultSelector) { + return this.pipe(operators_1.groupJoin(sources_1.from(inner), outerKeySelector, innerKeySelector, resultSelector)); + } + // + // Concatenation operators. + // + concat(iter) { + return this.pipe(operators_1.concat(sources_1.from(iter))); + } + // + // Ordering operators. + // + reverse() { + return this.pipe(operators_1.reverse()); + } + orderBy(keySelector) { + return this.pipe(operators_1.orderBy(keySelector)); + } + orderByDescending(keySelector) { + return this.pipe(operators_1.orderByDescending(keySelector)); + } + // + // Grouping operators. + // + groupBy(keySelector, elementSelector) { + return this.pipe(function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_1, _a; + const groups = yield __await(operators_1.groupBy(keySelector, elementSelector)(source)); + try { + for (var groups_1 = __asyncValues(groups), groups_1_1; groups_1_1 = yield __await(groups_1.next()), !groups_1_1.done;) { + const group = groups_1_1.value; + yield yield __await(new GroupingImpl(group.key, sources_1.from(group))); } - // Otherwise, return the response. - const m = resp.getReturn().getFieldsMap(); - resp = { - urn: m.get("urn").toJavaScript(), - id: m.get("id").toJavaScript() || undefined, - state: m.get("state").getStructValue(), - }; } - } - catch (e) { - err = e; - resp = { - urn: "", - id: undefined, - state: undefined, - }; - } - resop.resolveURN(resp.urn, err); - // Note: 'id || undefined' is intentional. We intentionally collapse falsy values to - // undefined so that later parts of our system don't have to deal with values like 'null'. - if (resop.resolveID) { - const id = resp.id || undefined; - resop.resolveID(id, id !== undefined, err); - } - yield resolveOutputs(res, type, urnName, props, resp.state, {}, resop.resolvers, err); - })); - })), label); -} -exports.getResource = getResource; -/** - * Reads an existing custom resource's state from the resource monitor. Note that resources read in this way - * will not be part of the resulting stack's state, as they are presumed to belong to another. - */ -function readResource(res, parent, t, name, props, opts) { - const id = opts.id; - if (!id) { - throw new Error("Cannot read resource whose options are lacking an ID value"); + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) yield __await(_a.call(groups_1)); + } + finally { if (e_1) throw e_1.error; } + } + }); + }); } - const label = `resource:${name}[${t}]#...`; - log.debug(`Reading resource: id=${output_1.Output.isInstance(id) ? "Output" : id}, t=${t}, name=${name}`); - const monitor = settings_1.getMonitor(); - const resopAsync = prepareResource(label, res, parent, true, false, props, opts); - const preallocError = new Error(); - debuggable_1.debuggablePromise(resopAsync.then((resop) => __awaiter(this, void 0, void 0, function* () { - const resolvedID = yield rpc_1.serializeProperty(label, id, new Set(), { keepOutputValues: false }); - log.debug(`ReadResource RPC prepared: id=${resolvedID}, t=${t}, name=${name}` + - (settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(resop.serializedProps)}` : ``)); - // Create a resource request and do the RPC. - const req = new resproto.ReadResourceRequest(); - req.setType(t); - req.setName(name); - req.setId(resolvedID); - req.setParent(resop.parentURN); - req.setProvider(resop.providerRef); - req.setProperties(gstruct.Struct.fromJavaScript(resop.serializedProps)); - req.setDependenciesList(Array.from(resop.allDirectDependencyURNs)); - req.setVersion(opts.version || ""); - req.setPlugindownloadurl(opts.pluginDownloadURL || ""); - req.setAcceptsecrets(true); - req.setAcceptresources(!utils.disableResourceReferences); - req.setAdditionalsecretoutputsList(opts.additionalSecretOutputs || []); - // Now run the operation, serializing the invocation if necessary. - const opLabel = `monitor.readResource(${label})`; - runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { - let resp = {}; - let err; + // + // Set operators. + // + distinct() { + return this.pipe(operators_1.distinct()); + } + union(second) { + return this.pipe(operators_1.union(sources_1.from(second))); + } + intersect(second) { + return this.pipe(operators_1.intersect(sources_1.from(second))); + } + except(second) { + return this.pipe(operators_1.except(sources_1.from(second))); + } + // + // Element operators. + // + first(predicate) { + return operators_1.first(predicate)(this); + } + firstOrDefault(defaultValue, predicate) { + return operators_1.firstOrDefault(defaultValue, predicate)(this); + } + last(predicate) { + return operators_1.last(predicate)(this); + } + lastOrDefault(defaultValue, predicate) { + return operators_1.lastOrDefault(defaultValue, predicate)(this); + } + single(predicate) { + return operators_1.single(predicate)(this); + } + singleOrDefault(defaultValue, predicate) { + return operators_1.singleOrDefault(defaultValue, predicate)(this); + } + elementAt(index) { + return operators_1.elementAt(index)(this); + } + elementAtOrDefault(defaultValue, index) { + return operators_1.elementAtOrDefault(defaultValue, index)(this); + } + defaultIfEmpty(defaultValue) { + return this.pipe(operators_1.defaultIfEmpty(defaultValue)); + } + // + // Quantifiers. + // + any(predicate) { + return operators_1.any(predicate)(this); + } + all(predicate) { + return operators_1.all(predicate)(this); + } + contains(value) { + return operators_1.contains(value)(this); + } + // + // Aggregate operators. + // + count(predicate) { + return operators_1.count(predicate)(this); + } + sum(selector) { + return operators_1.sum(selector)(this); + } + min(selector) { + return operators_1.min(selector)(this); + } + max(selector) { + return operators_1.max(selector)(this); + } + average(selector) { + return operators_1.average(selector)(this); + } + aggregate(seed, func) { + return operators_1.aggregate(seed, func)(this); + } + // + // Eval operators. + // + toArray() { + return __awaiter(this, void 0, void 0, function* () { + return operators_1.toArray()(this); + }); + } + toMap(keySelector, elementSelector) { + return operators_1.toMap(keySelector, elementSelector)(this); + } + ofType(typeGuard) { + return this.pipe(operators_1.ofType(typeGuard)); + } + forEach(f) { + var e_2, _a; + return __awaiter(this, void 0, void 0, function* () { try { - if (monitor) { - // If we're attached to the engine, make an RPC call and wait for it to resolve. - resp = yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.readResource(req, (rpcError, innerResponse) => { - log.debug(`ReadResource RPC finished: ${label}; err: ${rpcError}, resp: ${innerResponse}`); - if (rpcError) { - if (rpcError.code === grpc.status.UNAVAILABLE || rpcError.code === grpc.status.CANCELLED) { - err = rpcError; - settings_1.terminateRpcs(); - rpcError.message = "Resource monitor is terminating"; - preallocError.code = rpcError.code; - } - preallocError.message = - `failed to read resource #${resolvedID} '${name}' [${t}]: ${rpcError.message}`; - reject(preallocError); - } - else { - resolve(innerResponse); - } - })), opLabel); - } - else { - // If we aren't attached to the engine, in test mode, mock up a fake response for testing purposes. - const mockurn = yield resource_2.createUrn(req.getName(), req.getType(), req.getParent()).promise(); - resp = { - getUrn: () => mockurn, - getProperties: () => req.getProperties(), - }; + for (var _b = __asyncValues(this), _c; _c = yield _b.next(), !_c.done;) { + const t = _c.value; + f(t); } } - catch (e) { - err = e; - resp = { - getUrn: () => "", - getProperties: () => undefined, - }; - } - // Now resolve everything: the URN, the ID (supplied as input), and the output properties. - resop.resolveURN(resp.getUrn(), err); - resop.resolveID(resolvedID, resolvedID !== undefined, err); - yield resolveOutputs(res, t, name, props, resp.getProperties(), {}, resop.resolvers, err); - })); - })), label); -} -exports.readResource = readResource; -/** - * registerResource registers a new resource object with a given type t and name. It returns the auto-generated - * URN and the ID that will resolve after the deployment has completed. All properties will be initialized to property - * objects that the registration operation will resolve at the right time (or remain unresolved for deployments). - */ -function registerResource(res, parent, t, name, custom, remote, newDependency, props, opts) { - const label = `resource:${name}[${t}]`; - log.debug(`Registering resource: t=${t}, name=${name}, custom=${custom}, remote=${remote}`); - const monitor = settings_1.getMonitor(); - const resopAsync = prepareResource(label, res, parent, custom, remote, props, opts); - // In order to present a useful stack trace if an error does occur, we preallocate potential - // errors here. V8 captures a stack trace at the moment an Error is created and this stack - // trace will lead directly to user code. Throwing in `runAsyncResourceOp` results in an Error - // with a non-useful stack trace. - const preallocError = new Error(); - debuggable_1.debuggablePromise(resopAsync.then((resop) => __awaiter(this, void 0, void 0, function* () { - log.debug(`RegisterResource RPC prepared: t=${t}, name=${name}` + - (settings_1.excessiveDebugOutput ? `, obj=${JSON.stringify(resop.serializedProps)}` : ``)); - const req = new resproto.RegisterResourceRequest(); - req.setType(t); - req.setName(name); - req.setParent(resop.parentURN); - req.setCustom(custom); - req.setObject(gstruct.Struct.fromJavaScript(resop.serializedProps)); - req.setProtect(opts.protect); - req.setProvider(resop.providerRef); - req.setDependenciesList(Array.from(resop.allDirectDependencyURNs)); - req.setDeletebeforereplace(opts.deleteBeforeReplace || false); - req.setDeletebeforereplacedefined(opts.deleteBeforeReplace !== undefined); - req.setIgnorechangesList(opts.ignoreChanges || []); - req.setVersion(opts.version || ""); - req.setAcceptsecrets(true); - req.setAcceptresources(!utils.disableResourceReferences); - req.setAdditionalsecretoutputsList(opts.additionalSecretOutputs || []); - req.setAliasesList(resop.aliases); - req.setImportid(resop.import || ""); - req.setSupportspartialvalues(true); - req.setRemote(remote); - req.setReplaceonchangesList(opts.replaceOnChanges || []); - req.setPlugindownloadurl(opts.pluginDownloadURL || ""); - req.setRetainondelete(opts.retainOnDelete || false); - const customTimeouts = new resproto.RegisterResourceRequest.CustomTimeouts(); - if (opts.customTimeouts != null) { - customTimeouts.setCreate(opts.customTimeouts.create); - customTimeouts.setUpdate(opts.customTimeouts.update); - customTimeouts.setDelete(opts.customTimeouts.delete); - } - req.setCustomtimeouts(customTimeouts); - const propertyDependencies = req.getPropertydependenciesMap(); - for (const [key, resourceURNs] of resop.propertyToDirectDependencyURNs) { - const deps = new resproto.RegisterResourceRequest.PropertyDependencies(); - deps.setUrnsList(Array.from(resourceURNs)); - propertyDependencies.set(key, deps); - } - const providerRefs = req.getProvidersMap(); - for (const [key, ref] of resop.providerRefs) { - providerRefs.set(key, ref); - } - // Now run the operation, serializing the invocation if necessary. - const opLabel = `monitor.registerResource(${label})`; - runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { - let resp = {}; - let err; - try { - if (monitor) { - // If we're running with an attachment to the engine, perform the operation. - resp = yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.registerResource(req, (rpcErr, innerResponse) => { - if (rpcErr) { - err = rpcErr; - // If the monitor is unavailable, it is in the process of shutting down or has already - // shut down. Don't emit an error and don't do any more RPCs, just exit. - if (rpcErr.code === grpc.status.UNAVAILABLE || rpcErr.code === grpc.status.CANCELLED) { - // Re-emit the message - settings_1.terminateRpcs(); - rpcErr.message = "Resource monitor is terminating"; - preallocError.code = rpcErr.code; - } - // Node lets us hack the message as long as we do it before accessing the `stack` property. - log.debug(`RegisterResource RPC finished: ${label}; err: ${rpcErr}, resp: ${innerResponse}`); - preallocError.message = `failed to register new resource ${name} [${t}]: ${rpcErr.message}`; - reject(preallocError); - } - else { - log.debug(`RegisterResource RPC finished: ${label}; err: ${rpcErr}, resp: ${innerResponse}`); - resolve(innerResponse); - } - })), opLabel); - } - else { - // If we aren't attached to the engine, in test mode, mock up a fake response for testing purposes. - const mockurn = yield resource_2.createUrn(req.getName(), req.getType(), req.getParent()).promise(); - resp = { - getUrn: () => mockurn, - getId: () => undefined, - getObject: () => req.getObject(), - getPropertydependenciesMap: () => undefined, - }; + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); } + finally { if (e_2) throw e_2.error; } } - catch (e) { - err = e; - resp = { - getUrn: () => "", - getId: () => undefined, - getObject: () => req.getObject(), - getPropertydependenciesMap: () => undefined, - }; - } - resop.resolveURN(resp.getUrn(), err); - // Note: 'id || undefined' is intentional. We intentionally collapse falsy values to - // undefined so that later parts of our system don't have to deal with values like 'null'. - if (resop.resolveID) { - const id = resp.getId() || undefined; - resop.resolveID(id, id !== undefined, err); - } - const deps = {}; - const rpcDeps = resp.getPropertydependenciesMap(); - if (rpcDeps) { - for (const [k, propertyDeps] of resp.getPropertydependenciesMap().entries()) { - const urns = propertyDeps.getUrnsList(); - deps[k] = urns.map(urn => newDependency(urn)); + }); + } + pipe(...ops) { + return new AsyncQueryableImpl((function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_3, _a; + let newSource = source; + for (const op of ops) { + newSource = op(newSource); } - } - // Now resolve the output properties. - yield resolveOutputs(res, t, name, props, resp.getObject(), deps, resop.resolvers, err); - })); - })), label); -} -exports.registerResource = registerResource; -/** - * Prepares for an RPC that will manufacture a resource, and hence deals with input and output - * properties. - */ -function prepareResource(label, res, parent, custom, remote, props, opts) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - // add an entry to the rpc queue while we prepare the request. - // automation api inline programs that don't have stack exports can exit quickly. If we don't do this, - // sometimes they will exit right after `prepareResource` is called as a part of register resource, but before the - // .then() that adds to the queue via `runAsyncResourceOp`. - const done = settings_1.rpcKeepAlive(); - try { - // Simply initialize the URN property and get prepared to resolve it later on. - // Note: a resource urn will always get a value, and thus the output property - // for it can always run .apply calls. - let resolveURN; - { - let resolveValue; - let rejectValue; - let resolveIsKnown; - let rejectIsKnown; - res.urn = new output_1.Output(res, debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveValue = resolve; - rejectValue = reject; - }), `resolveURN(${label})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveIsKnown = resolve; - rejectIsKnown = reject; - }), `resolveURNIsKnown(${label})`), - /*isSecret:*/ Promise.resolve(false), Promise.resolve(res)); - resolveURN = (v, err) => { - if (!!err) { - rejectValue(err); - rejectIsKnown(err); + try { + for (var newSource_1 = __asyncValues(newSource), newSource_1_1; newSource_1_1 = yield __await(newSource_1.next()), !newSource_1_1.done;) { + const t = newSource_1_1.value; + yield yield __await(t); } - else { - resolveValue(v); - resolveIsKnown(true); + } + catch (e_3_1) { e_3 = { error: e_3_1 }; } + finally { + try { + if (newSource_1_1 && !newSource_1_1.done && (_a = newSource_1.return)) yield __await(_a.call(newSource_1)); } - }; - } - // If a custom resource, make room for the ID property. - let resolveID; - if (custom) { - let resolveValue; - let rejectValue; - let resolveIsKnown; - let rejectIsKnown; - res.id = new output_1.Output(res, debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveValue = resolve; - rejectValue = reject; - }), `resolveID(${label})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveIsKnown = resolve; - rejectIsKnown = reject; - }), `resolveIDIsKnown(${label})`), Promise.resolve(false), Promise.resolve(res)); - resolveID = (v, isKnown, err) => { - if (!!err) { - rejectValue(err); - rejectIsKnown(err); - } - else { - resolveValue(v); - resolveIsKnown(isKnown); - } - }; - } - // Now "transfer" all input properties into unresolved Promises on res. This way, - // this resource will look like it has all its output properties to anyone it is - // passed to. However, those promises won't actually resolve until the registerResource - // RPC returns - const resolvers = rpc_1.transferProperties(res, label, props); - /** IMPORTANT! We should never await prior to this line, otherwise the Resource will be partly uninitialized. */ - // Before we can proceed, all our dependencies must be finished. - const explicitDirectDependencies = new Set(yield gatherExplicitDependencies(opts.dependsOn)); - // Serialize out all our props to their final values. In doing so, we'll also collect all - // the Resources pointed to by any Dependency objects we encounter, adding them to 'propertyDependencies'. - const [serializedProps, propertyToDirectDependencies] = yield rpc_1.serializeResourceProperties(label, props, { - // To initially scope the use of this new feature, we only keep output values when - // remote is true (for multi-lang components). - keepOutputValues: remote, - }); - // Wait for the parent to complete. - // If no parent was provided, parent to the root resource. - const parentURN = parent ? yield parent.urn.promise() : undefined; - let providerRef; - let importID; - if (custom) { - const customOpts = opts; - importID = customOpts.import; - providerRef = yield resource_2.ProviderResource.register(opts.provider); - } - const providerRefs = new Map(); - if (remote) { - const componentOpts = opts; - resource_1.expandProviders(componentOpts); - // the casts are safe because expandProviders - // /always/ leaves providers as an array. - if (componentOpts.provider !== undefined) { - if (componentOpts.providers === undefined) { - // We still want to do the promotion, so we define providers - componentOpts.providers = [componentOpts.provider]; - } - else if (((_a = componentOpts.providers) === null || _a === void 0 ? void 0 : _a.indexOf(componentOpts.provider)) !== -1) { - const pkg = componentOpts.provider.getPackage(); - const message = `There is a conflit between the 'provider' field (${pkg}) and a member of the 'providers' map'. `; - const deprecationd = "This will become an error by the end of July 2022. See https://github.com/pulumi/pulumi/issues/8799 for more details"; - log.warn(message + deprecationd); - } - else { - componentOpts.providers.push(componentOpts.provider); - } - } - if (componentOpts.providers) { - for (const provider of componentOpts.providers) { - const pref = yield resource_2.ProviderResource.register(provider); - if (pref) { - providerRefs.set(provider.getPackage(), pref); - } - } - } - } - // Collect the URNs for explicit/implicit dependencies for the engine so that it can understand - // the dependency graph and optimize operations accordingly. - // The list of all dependencies (implicit or explicit). - const allDirectDependencies = new Set(explicitDirectDependencies); - const exclude = new Set([res]); - const allDirectDependencyURNs = yield getAllTransitivelyReferencedResourceURNs(explicitDirectDependencies, exclude); - const propertyToDirectDependencyURNs = new Map(); - for (const [propertyName, directDependencies] of propertyToDirectDependencies) { - addAll(allDirectDependencies, directDependencies); - const urns = yield getAllTransitivelyReferencedResourceURNs(directDependencies, exclude); - addAll(allDirectDependencyURNs, urns); - propertyToDirectDependencyURNs.set(propertyName, urns); - } - // Wait for all aliases. Note that we use `res.__aliases` instead of `opts.aliases` as the former has been processed - // in the Resource constructor prior to calling `registerResource` - both adding new inherited aliases and - // simplifying aliases down to URNs. - const aliases = []; - const uniqueAliases = new Set(); - for (const alias of (res.__aliases || [])) { - const aliasVal = yield output_1.output(alias).promise(); - if (!uniqueAliases.has(aliasVal)) { - uniqueAliases.add(aliasVal); - aliases.push(aliasVal); + finally { if (e_3) throw e_3.error; } } - } - return { - resolveURN: resolveURN, - resolveID: resolveID, - resolvers: resolvers, - serializedProps: serializedProps, - parentURN: parentURN, - providerRef: providerRef, - providerRefs: providerRefs, - allDirectDependencyURNs: allDirectDependencyURNs, - propertyToDirectDependencyURNs: propertyToDirectDependencyURNs, - aliases: aliases, - import: importID, - }; - } - finally { - // free the RPC queue - done(); - } - }); -} -function addAll(to, from) { - for (const val of from) { - to.add(val); + }); + })(this)); } } -/** @internal */ -function getAllTransitivelyReferencedResourceURNs(resources, exclude) { - return __awaiter(this, void 0, void 0, function* () { - // Go through 'resources', but transitively walk through **Component** resources, collecting any - // of their child resources. This way, a Component acts as an aggregation really of all the - // reachable resources it parents. This walking will stop when it hits custom resources. - // - // This function also terminates at remote components, whose children are not known to the Node SDK directly. - // Remote components will always wait on all of their children, so ensuring we return the remote component - // itself here and waiting on it will accomplish waiting on all of it's children regardless of whether they - // are returned explicitly here. - // - // In other words, if we had: - // - // Comp1 - // / | \ - // Cust1 Comp2 Remote1 - // / \ \ - // Cust2 Cust3 Comp3 - // / \ - // Cust4 Cust5 - // - // Then the transitively reachable resources of Comp1 will be [Cust1, Cust2, Cust3, Remote1]. - // It will *not* include: - // * Cust4 because it is a child of a custom resource - // * Comp2 because it is a non-remote component resource - // * Comp3 and Cust5 because Comp3 is a child of a remote component resource - // To do this, first we just get the transitively reachable set of resources (not diving - // into custom resources). In the above picture, if we start with 'Comp1', this will be - // [Comp1, Cust1, Comp2, Cust2, Cust3] - const transitivelyReachableResources = yield getTransitivelyReferencedChildResourcesOfComponentResources(resources); - // Then we filter to only include Custom and Remote resources. - const transitivelyReachableCustomResources = [...transitivelyReachableResources] - .filter(r => (resource_2.CustomResource.isInstance(r) || r.__remote) && !exclude.has(r)); - const promises = transitivelyReachableCustomResources.map(r => r.urn.promise()); - const urns = yield Promise.all(promises); - return new Set(urns); - }); +exports.AsyncQueryableImpl = AsyncQueryableImpl; +class GroupingImpl extends AsyncQueryableImpl { + constructor(key, group) { + super(group); + this.key = key; + } } -exports.getAllTransitivelyReferencedResourceURNs = getAllTransitivelyReferencedResourceURNs; -/** - * Recursively walk the resources passed in, returning them and all resources reachable from - * [Resource.__childResources] through any **Component** resources we encounter. - */ -function getTransitivelyReferencedChildResourcesOfComponentResources(resources) { - return __awaiter(this, void 0, void 0, function* () { - // Recursively walk the dependent resources through their children, adding them to the result set. - const result = new Set(); - yield addTransitivelyReferencedChildResourcesOfComponentResources(resources, result); - return result; - }); +exports.GroupingImpl = GroupingImpl; + + +/***/ }), + +/***/ 4139: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Copyright 2016-2019, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +class IterableBase { + constructor(core) { + this.core = core; + } + [Symbol.asyncIterator]() { + return this; + } + next(value) { + return this.core.next(value); + } } -function addTransitivelyReferencedChildResourcesOfComponentResources(resources, result) { - return __awaiter(this, void 0, void 0, function* () { - if (resources) { - for (const resource of resources) { - if (!result.has(resource)) { - result.add(resource); - if (resource_2.ComponentResource.isInstance(resource)) { - // This await is safe even if __isConstructed is undefined. Ensure that the - // resource has completely finished construction. That way all parent/child - // relationships will have been setup. - yield resource.__data; - addTransitivelyReferencedChildResourcesOfComponentResources(resource.__childResources, result); - } - } - } - } - }); +exports.IterableBase = IterableBase; +class GroupedAsyncIterableIteratorImpl extends IterableBase { + constructor(key, core) { + super(core); + this.key = key; + } } -/** - * Gathers explicit dependent Resources from a list of Resources (possibly Promises and/or Outputs). - */ -function gatherExplicitDependencies(dependsOn) { - return __awaiter(this, void 0, void 0, function* () { - if (dependsOn) { - if (Array.isArray(dependsOn)) { - const dos = []; - for (const d of dependsOn) { - dos.push(...(yield gatherExplicitDependencies(d))); - } - return dos; - } - else if (dependsOn instanceof Promise) { - return gatherExplicitDependencies(yield dependsOn); - } - else if (output_1.Output.isInstance(dependsOn)) { - // Recursively gather dependencies, await the promise, and append the output's dependencies. - const dos = dependsOn.apply(v => gatherExplicitDependencies(v)); - const urns = yield dos.promise(); - const dosResources = yield output_1.getAllResources(dos); - const implicits = yield gatherExplicitDependencies([...dosResources]); - return ((urns !== null && urns !== void 0 ? urns : [])).concat(implicits); - } - else { - if (!resource_2.Resource.isInstance(dependsOn)) { - throw new Error("'dependsOn' was passed a value that was not a Resource."); - } - return [dependsOn]; - } - } - return []; - }); +exports.GroupedAsyncIterableIteratorImpl = GroupedAsyncIterableIteratorImpl; + + +/***/ }), + +/***/ 9160: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// Copyright 2016-2019, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +// +// NOTE: We choose to be purposefully conservative about what details are exposed through these +// interfaces in case we decide to change the implementation drastically later. +// +// +// Polyfill the async iterator per the "caveats" section of the feature release notes: +// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#the-for-await-of-statement +// +if (typeof Symbol.asyncIterator === "undefined") { + Symbol.asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"); } +const asyncQueryable_1 = __nccwpck_require__(5907); +const sources = __nccwpck_require__(8396); /** - * Finishes a resource creation RPC operation by resolving its outputs to the resulting RPC payload. + * Creates an `AsyncQueryable` from things that look `Iterable` or `AsyncIterable`, even if they're + * wrapped in a `Promise`. + * @param source Object to convert into an `AsyncQueryable`. */ -function resolveOutputs(res, t, name, props, outputs, deps, resolvers, err) { - return __awaiter(this, void 0, void 0, function* () { - // Produce a combined set of property states, starting with inputs and then applying - // outputs. If the same property exists in the inputs and outputs states, the output wins. - const allProps = {}; - if (outputs) { - Object.assign(allProps, rpc_1.deserializeProperties(outputs)); - } - const label = `resource:${name}[${t}]#...`; - if (!settings_1.isDryRun() || settings_1.isLegacyApplyEnabled()) { - for (const key of Object.keys(props)) { - if (!allProps.hasOwnProperty(key)) { - // input prop the engine didn't give us a final value for. Just use the value passed into the resource - // after round-tripping it through serialization. We do the round-tripping primarily s.t. we ensure that - // Output values are handled properly w.r.t. unknowns. - const inputProp = yield rpc_1.serializeProperty(label, props[key], new Set(), { keepOutputValues: false }); - if (inputProp === undefined) { - continue; - } - allProps[key] = rpc_1.deserializeProperty(inputProp); - } - } - } - rpc_1.resolveProperties(res, resolvers, t, name, allProps, deps, err); - }); +function from(source) { + return asyncQueryable_1.AsyncQueryableImpl.from(source); } +exports.from = from; /** - * registerResourceOutputs completes the resource registration, attaching an optional set of computed outputs. + * Generates a (potentially infinite) sequence of integral numbers within a range. The first number + * emitted is `start`, and the last is `stop - 1`. If the enumerated sequence generates zero + * elements (for example, when `stop <= start + 1`), an exception is thrown. + * @param start Beginning of the range + * @param stop Non-inclusive end of the range. + * @example + * const squares = await range(0, 3).map(x => x * x).toArray(); // == [0, 1, 4] */ -function registerResourceOutputs(res, outputs) { - // Now run the operation. Note that we explicitly do not serialize output registration with - // respect to other resource operations, as outputs may depend on properties of other resources - // that will not resolve until later turns. This would create a circular promise chain that can - // never resolve. - const opLabel = `monitor.registerResourceOutputs(...)`; - runAsyncResourceOp(opLabel, () => __awaiter(this, void 0, void 0, function* () { - // The registration could very well still be taking place, so we will need to wait for its URN. - // Additionally, the output properties might have come from other resources, so we must await those too. - const urn = yield res.urn.promise(); - const resolved = yield rpc_1.serializeProperties(opLabel, { outputs }); - const outputsObj = gstruct.Struct.fromJavaScript(resolved.outputs); - log.debug(`RegisterResourceOutputs RPC prepared: urn=${urn}` + - (settings_1.excessiveDebugOutput ? `, outputs=${JSON.stringify(outputsObj)}` : ``)); - // Fetch the monitor and make an RPC request. - const monitor = settings_1.getMonitor(); - if (monitor) { - const req = new resproto.RegisterResourceOutputsRequest(); - req.setUrn(urn); - req.setOutputs(outputsObj); - const label = `monitor.registerResourceOutputs(${urn}, ...)`; - yield debuggable_1.debuggablePromise(new Promise((resolve, reject) => monitor.registerResourceOutputs(req, (err, innerResponse) => { - log.debug(`RegisterResourceOutputs RPC finished: urn=${urn}; ` + - `err: ${err}, resp: ${innerResponse}`); - if (err) { - // If the monitor is unavailable, it is in the process of shutting down or has already - // shut down. Don't emit an error and don't do any more RPCs, just exit. - if (err.code === grpc.status.UNAVAILABLE || err.code === grpc.status.CANCELLED) { - settings_1.terminateRpcs(); - err.message = "Resource monitor is terminating"; - } - reject(err); - } - else { - log.debug(`RegisterResourceOutputs RPC finished: urn=${urn}; ` + - `err: ${err}, resp: ${innerResponse}`); - resolve(); - } - })), label); - } - }), false); -} -exports.registerResourceOutputs = registerResourceOutputs; -function isAny(o) { - return true; +function range(start, stop) { + return asyncQueryable_1.AsyncQueryableImpl.from(sources.range(start, stop)); } +exports.range = range; /** - * listResourceOutputs returns the resource outputs (if any) for a stack, or an error if the stack - * cannot be found. Resources are retrieved from the latest stack snapshot, which may include - * ongoing updates. - * - * @param stackName Name of stack to retrieve resource outputs for. Defaults to the current stack. - * @param typeFilter A [type - * guard](https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards) - * that specifies which resource types to list outputs of. - * + * Returns an empty sequence of `TResult`. * @example - * const buckets = pulumi.runtime.listResourceOutput(aws.s3.Bucket.isInstance); + * const noNumbers = await empty().toArray(); // == [] */ -function listResourceOutputs(typeFilter, stackName) { - if (typeFilter === undefined) { - typeFilter = isAny; - } - return query - .from(invoke_1.invoke("pulumi:pulumi:readStackResourceOutputs", { - stackName: stackName || settings_1.getStack(), - }).then(({ outputs }) => utils.values(outputs))) - .map(({ type: typ, outputs }) => { - return Object.assign(Object.assign({}, outputs), { __pulumiType: typ }); - }) - .filter(typeFilter); +function empty() { + return asyncQueryable_1.AsyncQueryableImpl.from(sources.from([])); } -exports.listResourceOutputs = listResourceOutputs; +exports.empty = empty; /** - * resourceChain is used to serialize all resource requests. If we don't do this, all resource operations will be - * entirely asynchronous, meaning the dataflow graph that results will determine ordering of operations. This - * causes problems with some resource providers, so for now we will serialize all of them. The issue - * pulumi/pulumi#335 tracks coming up with a long-term solution here. + * Generates a (potentially infinite) sequence by repeating a single value. + * @param t Object to repeat + * @example + * const ones = await repeat(1).take(3).toArray(); // == [1, 1, 1] */ -let resourceChain = Promise.resolve(); -let resourceChainLabel = undefined; -// runAsyncResourceOp runs an asynchronous resource operation, possibly serializing it as necessary. -function runAsyncResourceOp(label, callback, serial) { - // Serialize the invocation if necessary. - if (serial === undefined) { - serial = settings_1.serialize(); - } - const resourceOp = rpc_1.suppressUnhandledGrpcRejections(debuggable_1.debuggablePromise(resourceChain.then(() => __awaiter(this, void 0, void 0, function* () { - if (serial) { - resourceChainLabel = label; - log.debug(`Resource RPC serialization requested: ${label} is current`); - } - return callback(); - })), label + "-initial")); - // Ensure the process won't exit until this RPC call finishes and resolve it when appropriate. - const done = settings_1.rpcKeepAlive(); - const finalOp = debuggable_1.debuggablePromise(resourceOp.then(() => { done(); }, () => { done(); }), label + "-final"); - // Set up another promise that propagates the error, if any, so that it triggers unhandled rejection logic. - resourceOp.catch((err) => Promise.reject(err)); - // If serialization is requested, wait for the prior resource operation to finish before we proceed, serializing - // them, and make this the current resource operation so that everybody piles up on it. - if (serial) { - resourceChain = finalOp; - if (resourceChainLabel) { - log.debug(`Resource RPC serialization requested: ${label} is behind ${resourceChainLabel}`); - } - } +function repeat(t /* TODO: add optional count. */) { + asyncQueryable_1.AsyncQueryableImpl.from((function () { + return __asyncGenerator(this, arguments, function* () { + while (true) { + yield yield __await(t); + } + }); + })()); } -//# sourceMappingURL=resource.js.map +exports.repeat = repeat; + /***/ }), -/***/ 25158: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 2830: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -// Copyright 2016-2021, Pulumi Corporation. +// Copyright 2016-2019, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -44148,725 +41290,1303 @@ function runAsyncResourceOp(label, callback, serial) { // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const asset = __nccwpck_require__(83031); -const errors_1 = __nccwpck_require__(89693); -const log = __nccwpck_require__(80642); -const output_1 = __nccwpck_require__(43037); -const resource_1 = __nccwpck_require__(90796); -const debuggable_1 = __nccwpck_require__(20257); -const settings_1 = __nccwpck_require__(34530); -const resource_2 = __nccwpck_require__(30140); -const semver = __nccwpck_require__(87486); -/** - * transferProperties mutates the 'onto' resource so that it has Promise-valued properties for all - * the 'props' input/output props. *Importantly* all these promises are completely unresolved. This - * is because we don't want anyone to observe the values of these properties until the rpc call to - * registerResource actually returns. This is because the registerResource call may actually - * override input values, and we only want people to see the final value. - * - * The result of this call (beyond the stateful changes to 'onto') is the set of Promise resolvers - * that will be called post-RPC call. When the registerResource RPC call comes back, the values - * that the engine actualy produced will be used to resolve all the unresolved promised placed on - * 'onto'. - */ -function transferProperties(onto, label, props) { - const resolvers = {}; - for (const k of Object.keys(props)) { - // Skip "id" and "urn", since we handle those specially. - if (k === "id" || k === "urn") { - continue; - } - // Create a property to wrap the value and store it on the resource. - if (onto.hasOwnProperty(k)) { - throw new Error(`Property '${k}' is already initialized on target '${label}`); - } - let resolveValue; - let rejectValue; - let resolveIsKnown; - let rejectIsKnown; - let resolveIsSecret; - let rejectIsSecret; - let resolveDeps; - let rejectDeps; - resolvers[k] = (v, isKnown, isSecret, deps = [], err) => { - if (!!err) { - rejectValue(err); - rejectIsKnown(err); - rejectIsSecret(err); - rejectDeps(err); +/////////////////////////////////////////////////////////////////////////////// +function isAsyncIterable(o) { + return typeof o[Symbol.asyncIterator] === "function"; +} +exports.isAsyncIterable = isAsyncIterable; +function isIterable(o) { + return typeof o[Symbol.iterator] === "function"; +} +exports.isIterable = isIterable; + + +/***/ }), + +/***/ 327: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// Copyright 2016-2019, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const util_1 = __nccwpck_require__(3837); +const base_1 = __nccwpck_require__(4139); +const sources_1 = __nccwpck_require__(8396); +// +// Restriction operators. +// +function filter(f) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_1, _a; + try { + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { + const [t, i] = _c.value; + if (yield __await(f(t, i))) { + yield yield __await(t); + } + } } - else { - resolveValue(v); - resolveIsKnown(isKnown); - resolveIsSecret(isSecret); - resolveDeps(deps); + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); + } + finally { if (e_1) throw e_1.error; } } - }; - const propString = output_1.Output.isInstance(props[k]) ? "Output" : `${props[k]}`; - onto[k] = new output_1.Output(onto, debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveValue = resolve; - rejectValue = reject; - }), `transferProperty(${label}, ${k}, ${propString})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveIsKnown = resolve; - rejectIsKnown = reject; - }), `transferIsStable(${label}, ${k}, ${propString})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveIsSecret = resolve; - rejectIsSecret = reject; - }), `transferIsSecret(${label}, ${k}, ${propString})`), debuggable_1.debuggablePromise(new Promise((resolve, reject) => { - resolveDeps = resolve; - rejectDeps = reject; - }), `transferDeps(${label}, ${k}, ${propString})`)); - } - return resolvers; + }); + }; } -exports.transferProperties = transferProperties; -/** - * serializeFilteredProperties walks the props object passed in, awaiting all interior promises for - * properties with keys that match the provided filter, creating a reasonable POJO object that can - * be remoted over to registerResource. - */ -function serializeFilteredProperties(label, props, acceptKey, opts) { - return __awaiter(this, void 0, void 0, function* () { - const propertyToDependentResources = new Map(); - const result = {}; - for (const k of Object.keys(props)) { - if (acceptKey(k)) { - // We treat properties with undefined values as if they do not exist. - const dependentResources = new Set(); - const v = yield serializeProperty(`${label}.${k}`, props[k], dependentResources, opts); - if (v !== undefined) { - result[k] = v; - propertyToDependentResources.set(k, dependentResources); +exports.filter = filter; +// +// Projection operators. +// +function flatMap(selector, resultSelector = (t, ti) => ti) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_2, _a, e_3, _b; + try { + for (var _c = __asyncValues(zip(source, sources_1.range(0))), _d; _d = yield __await(_c.next()), !_d.done;) { + const [t, i] = _d.value; + const us = selector(t, i); + try { + for (var _e = __asyncValues(sources_1.from(us)), _f; _f = yield __await(_e.next()), !_f.done;) { + const u = _f.value; + yield yield __await(yield __await(resultSelector(t, u))); + } + } + catch (e_3_1) { e_3 = { error: e_3_1 }; } + finally { + try { + if (_f && !_f.done && (_b = _e.return)) yield __await(_b.call(_e)); + } + finally { if (e_3) throw e_3.error; } + } } } - } - return [result, propertyToDependentResources]; - }); + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) yield __await(_a.call(_c)); + } + finally { if (e_2) throw e_2.error; } + } + }); + }; } -/** - * serializeResourceProperties walks the props object passed in, awaiting all interior promises besides those for `id` - * and `urn`, creating a reasonable POJO object that can be remoted over to registerResource. - */ -function serializeResourceProperties(label, props, opts) { - return __awaiter(this, void 0, void 0, function* () { - return serializeFilteredProperties(label, props, key => key !== "id" && key !== "urn", opts); - }); +exports.flatMap = flatMap; +function map(f) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_4, _a; + try { + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { + const [t, i] = _c.value; + yield yield __await(yield __await(f(t, i))); + } + } + catch (e_4_1) { e_4 = { error: e_4_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); + } + finally { if (e_4) throw e_4.error; } + } + }); + }; } -exports.serializeResourceProperties = serializeResourceProperties; -/** - * serializeProperties walks the props object passed in, awaiting all interior promises, creating a reasonable - * POJO object that can be remoted over to registerResource. - */ -function serializeProperties(label, props, opts) { - return __awaiter(this, void 0, void 0, function* () { - const [result] = yield serializeFilteredProperties(label, props, _ => true, opts); - return result; - }); +exports.map = map; +// +// Partitioning operators. +// +function skip(n) { + if (n < 0) { + throw Error("skip was provided a negative number of elements to skip"); + } + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_5, _a; + try { + for (var _b = __asyncValues(zip(source, sources_1.range(1))), _c; _c = yield __await(_b.next()), !_c.done;) { + const [t, i] = _c.value; + if (i > n) { + yield yield __await(t); + } + } + } + catch (e_5_1) { e_5 = { error: e_5_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); + } + finally { if (e_5) throw e_5.error; } + } + }); + }; } -exports.serializeProperties = serializeProperties; -/** @internal */ -function serializePropertiesReturnDeps(label, props, opts) { - return __awaiter(this, void 0, void 0, function* () { - return serializeFilteredProperties(label, props, _ => true, opts); - }); +exports.skip = skip; +function skipWhile(predicate) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_6, _a; + let stopSkipping = false; + try { + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { + const [t, i] = _c.value; + if (stopSkipping === true) { + yield yield __await(t); + } + else if ((yield __await(predicate(t, i))) === false) { + stopSkipping = true; + yield yield __await(t); + } + } + } + catch (e_6_1) { e_6 = { error: e_6_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); + } + finally { if (e_6) throw e_6.error; } + } + }); + }; } -exports.serializePropertiesReturnDeps = serializePropertiesReturnDeps; -/** - * deserializeProperties fetches the raw outputs and deserializes them from a gRPC call result. - */ -function deserializeProperties(outputsStruct) { - const props = {}; - const outputs = outputsStruct.toJavaScript(); - for (const k of Object.keys(outputs)) { - // We treat properties with undefined values as if they do not exist. - if (outputs[k] !== undefined) { - props[k] = deserializeProperty(outputs[k]); - } +exports.skipWhile = skipWhile; +function take(n) { + if (n < 0) { + throw Error("take was provided a negative number of elements to take"); } - return props; + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_7, _a; + try { + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { + const [t, i] = _c.value; + if (i >= n) { + return yield __await(void 0); + } + yield yield __await(t); + } + } + catch (e_7_1) { e_7 = { error: e_7_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); + } + finally { if (e_7) throw e_7.error; } + } + }); + }; } -exports.deserializeProperties = deserializeProperties; -/** - * resolveProperties takes as input a gRPC serialized proto.google.protobuf.Struct and resolves all - * of the resource's matching properties to the values inside. - * - * NOTE: it is imperative that the properties in `allProps` were produced by `deserializeProperties` in order for - * output properties to work correctly w.r.t. knowns/unknowns: this function assumes that any undefined value in - * `allProps`represents an unknown value that was returned by an engine operation. - */ -function resolveProperties(res, resolvers, t, name, allProps, deps, err) { - // If there is an error, just reject everything. - if (err) { - for (const k of Object.keys(resolvers)) { - const resolve = resolvers[k]; - resolve(undefined, true, false, [], err); - } - return; - } - // Now go ahead and resolve all properties present in the inputs and outputs set. - for (const k of Object.keys(allProps)) { - // Skip "id" and "urn", since we handle those specially. - if (k === "id" || k === "urn") { - continue; - } - // Otherwise, unmarshal the value, and store it on the resource object. - const resolve = resolvers[k]; - if (resolve === undefined) { - // engine returned a property that was not in our initial property-map. This can happen - // for outputs that were registered through direct calls to 'registerOutputs'. We do - // *not* want to do anything with these returned properties. First, the component - // resources that were calling 'registerOutputs' will have already assigned these fields - // directly on them themselves. Second, if we were to try to assign here we would have - // an incredibly bad race condition for two reasons: - // - // 1. This call to 'resolveProperties' happens asynchronously at some point far after - // the resource was constructed. So the user will have been able to observe the - // initial value up until we get to this point. - // - // 2. The component resource will have often assigned a value of some arbitrary type - // (say, a 'string'). If we overwrite this with an `Output` we'll be changing - // the type at some non-deterministic point in the future. - continue; - } - // If this value is a secret, unwrap its inner value. - let value = allProps[k]; - const isSecret = isRpcSecret(value); - value = unwrapRpcSecret(value); +exports.take = take; +function takeWhile(predicate) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_8, _a; + try { + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { + const [t, i] = _c.value; + if ((yield __await(predicate(t, i))) === false) { + return yield __await(void 0); + } + yield yield __await(t); + } + } + catch (e_8_1) { e_8 = { error: e_8_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); + } + finally { if (e_8) throw e_8.error; } + } + }); + }; +} +exports.takeWhile = takeWhile; +// +// Join operators. +// +function joinHelper(outer, inner, outerKeySelector, innerKeySelector) { + return __asyncGenerator(this, arguments, function* joinHelper_1() { + var e_9, _a, e_10, _b; + const inners = new Map(); try { - // If the value the engine handed back is or contains an unknown value, the resolver will mark its value as - // unknown automatically, so we just pass true for isKnown here. Note that unknown values will only be - // present during previews (i.e. isDryRun() will be true). - resolve(value, /*isKnown*/ true, isSecret, deps[k]); - } - catch (resolveError) { - throw new Error(`Unable to set property '${k}' on resource '${name}' [${t}]; error: ${debuggable_1.errorString(resolveError)}`); - } - } - // `allProps` may not have contained a value for every resolver: for example, optional outputs may not be present. - // We will resolve all of these values as `undefined`, and will mark the value as known if we are not running a - // preview. - for (const k of Object.keys(resolvers)) { - if (!allProps.hasOwnProperty(k)) { - const resolve = resolvers[k]; - resolve(undefined, !settings_1.isDryRun(), false); + for (var inner_1 = __asyncValues(inner), inner_1_1; inner_1_1 = yield __await(inner_1.next()), !inner_1_1.done;) { + const t = inner_1_1.value; + const key = yield __await(innerKeySelector(t)); + const val = inners.get(key); + if (inners.has(key)) { + val.push(t); + } + else { + inners.set(key, [t]); + } + } } - } -} -exports.resolveProperties = resolveProperties; -/** - * Unknown values are encoded as a distinguished string value. - */ -exports.unknownValue = "04da6b54-80e4-46f7-96ec-b56ff0331ba9"; -/** - * specialSigKey is sometimes used to encode type identity inside of a map. See sdk/go/common/resource/properties.go. - */ -exports.specialSigKey = "4dabf18193072939515e22adb298388d"; -/** - * specialAssetSig is a randomly assigned hash used to identify assets in maps. See sdk/go/common/resource/asset.go. - */ -exports.specialAssetSig = "c44067f5952c0a294b673a41bacd8c17"; -/** - * specialArchiveSig is a randomly assigned hash used to identify archives in maps. See sdk/go/common/resource/asset.go. - */ -exports.specialArchiveSig = "0def7320c3a5731c473e5ecbe6d01bc7"; -/** - * specialSecretSig is a randomly assigned hash used to identify secrets in maps. - * See sdk/go/common/resource/properties.go. - */ -exports.specialSecretSig = "1b47061264138c4ac30d75fd1eb44270"; -/** - * specialResourceSig is a randomly assigned hash used to identify resources in maps. - * See sdk/go/common/resource/properties.go. - */ -exports.specialResourceSig = "5cf8f73096256a8f31e491e813e4eb8e"; -/** - * specialOutputValueSig is a randomly assigned hash used to identify outputs in maps. - * See sdk/go/common/resource/properties.go. - */ -exports.specialOutputValueSig = "d0e6a833031e9bbcd3f4e8bde6ca49a4"; -/** - * serializeProperty serializes properties deeply. This understands how to wait on any unresolved promises, as - * appropriate, in addition to translating certain "special" values so that they are ready to go on the wire. - */ -function serializeProperty(ctx, prop, dependentResources, opts) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - // IMPORTANT: - // IMPORTANT: Keep this in sync with serializePropertiesSync in invoke.ts - // IMPORTANT: - if (prop === undefined || - prop === null || - typeof prop === "boolean" || - typeof prop === "number" || - typeof prop === "string") { - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: primitive=${prop}`); + catch (e_9_1) { e_9 = { error: e_9_1 }; } + finally { + try { + if (inner_1_1 && !inner_1_1.done && (_a = inner_1.return)) yield __await(_a.call(inner_1)); } - return prop; + finally { if (e_9) throw e_9.error; } } - if (asset.Asset.isInstance(prop) || asset.Archive.isInstance(prop)) { - // Serializing an asset or archive requires the use of a magical signature key, since otherwise it would look - // like any old weakly typed object/map when received by the other side of the RPC boundary. - const obj = { - [exports.specialSigKey]: asset.Asset.isInstance(prop) ? exports.specialAssetSig : exports.specialArchiveSig, - }; - return yield serializeAllKeys(prop, obj, { keepOutputValues: false }); + try { + for (var outer_1 = __asyncValues(outer), outer_1_1; outer_1_1 = yield __await(outer_1.next()), !outer_1_1.done;) { + const t = outer_1_1.value; + const key = yield __await(outerKeySelector(t)); + if (key === undefined) { + continue; + } + else if (inners.has(key)) { + const innerValues = inners.get(key); + yield yield __await([t, innerValues]); + } + } } - if (prop instanceof Promise) { - // For a promise input, await the property and then serialize the result. - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: Promise`); + catch (e_10_1) { e_10 = { error: e_10_1 }; } + finally { + try { + if (outer_1_1 && !outer_1_1.done && (_b = outer_1.return)) yield __await(_b.call(outer_1)); } - const subctx = `Promise<${ctx}>`; - return serializeProperty(subctx, yield debuggable_1.debuggablePromise(prop, `serializeProperty.await(${subctx})`), dependentResources, opts); + finally { if (e_10) throw e_10.error; } } - if (output_1.Output.isInstance(prop)) { - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: Output`); - } - // handle serializing both old-style outputs (with sync resources) and new-style outputs - // (with async resources). - const propResources = yield output_1.getAllResources(prop); - for (const resource of propResources) { - dependentResources.add(resource); - } - // When serializing an Output, we will either serialize it as its resolved value or the "unknown value" - // sentinel. We will do the former for all outputs created directly by user code (such outputs always - // resolve isKnown to true) and for any resource outputs that were resolved with known values. - const isKnown = yield prop.isKnown; - // You might think that doing an explict `=== true` here is not needed, but it is for a subtle reason. If the - // output we are serializing is a proxy itself, and it comes from a version of the SDK that did not have the - // `isSecret` member on `OutputImpl` then the call to `prop.isSecret` here will return an Output itself, - // which will wrap undefined, if it were to be resolved (since `Output` has no member named .isSecret). - // so we must compare to the literal true instead of just doing await prop.isSecret. - const isSecret = (yield prop.isSecret) === true; - const promiseDeps = new Set(); - const value = yield serializeProperty(`${ctx}.id`, prop.promise(), promiseDeps, { - keepOutputValues: false, - }); - for (const resource of promiseDeps) { - propResources.add(resource); - dependentResources.add(resource); - } - if (((_a = opts) === null || _a === void 0 ? void 0 : _a.keepOutputValues) && (yield settings_1.monitorSupportsOutputValues())) { - const urnDeps = new Set(); - for (const resource of propResources) { - yield serializeProperty(`${ctx} dependency`, resource.urn, urnDeps, { - keepOutputValues: false, - }); - } - for (const resource of urnDeps) { - propResources.add(resource); - dependentResources.add(resource); + }); +} +function join(inner, outerKeySelector, innerKeySelector, resultSelector) { + return function (outer) { + return __asyncGenerator(this, arguments, function* () { + var e_11, _a; + try { + for (var _b = __asyncValues(joinHelper(outer, inner, outerKeySelector, innerKeySelector)), _c; _c = yield __await(_b.next()), !_c.done;) { + const [o, inners] = _c.value; + for (const i of inners) { + yield yield __await(yield __await(resultSelector(o, i))); + } } - const dependencies = yield resource_2.getAllTransitivelyReferencedResourceURNs(propResources, new Set()); - const obj = { - [exports.specialSigKey]: exports.specialOutputValueSig, - }; - if (isKnown) { - // coerce 'undefined' to 'null' as required by the protobuf system. - obj["value"] = value === undefined ? null : value; + } + catch (e_11_1) { e_11 = { error: e_11_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); } - if (isSecret) { - obj["secret"] = isSecret; + finally { if (e_11) throw e_11.error; } + } + }); + }; +} +exports.join = join; +function groupJoin(inner, outerKeySelector, innerKeySelector, resultSelector) { + return function (outer) { + return __asyncGenerator(this, arguments, function* () { + var e_12, _a; + try { + for (var _b = __asyncValues(joinHelper(outer, inner, outerKeySelector, innerKeySelector)), _c; _c = yield __await(_b.next()), !_c.done;) { + const [o, inners] = _c.value; + yield yield __await(yield __await(resultSelector(o, sources_1.from(inners)))); } - if (dependencies.size > 0) { - obj["dependencies"] = Array.from(dependencies); + } + catch (e_12_1) { e_12 = { error: e_12_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); } - return obj; + finally { if (e_12) throw e_12.error; } } - if (!isKnown) { - return exports.unknownValue; + }); + }; +} +exports.groupJoin = groupJoin; +// +// Concatenation operators. +// +function concat(iter) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_13, _a, e_14, _b; + try { + for (var source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), !source_1_1.done;) { + const t = source_1_1.value; + yield yield __await(t); + } } - if (isSecret && (yield settings_1.monitorSupportsSecrets())) { - return { - [exports.specialSigKey]: exports.specialSecretSig, - // coerce 'undefined' to 'null' as required by the protobuf system. - value: value === undefined ? null : value, - }; + catch (e_13_1) { e_13 = { error: e_13_1 }; } + finally { + try { + if (source_1_1 && !source_1_1.done && (_a = source_1.return)) yield __await(_a.call(source_1)); + } + finally { if (e_13) throw e_13.error; } } - return value; - } - if (output_1.isUnknown(prop)) { - return exports.unknownValue; - } - if (resource_1.CustomResource.isInstance(prop)) { - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: custom resource urn`); + try { + for (var iter_1 = __asyncValues(iter), iter_1_1; iter_1_1 = yield __await(iter_1.next()), !iter_1_1.done;) { + const t = iter_1_1.value; + yield yield __await(t); + } } - dependentResources.add(prop); - const id = yield serializeProperty(`${ctx}.id`, prop.id, dependentResources, { - keepOutputValues: false, - }); - if (yield settings_1.monitorSupportsResourceReferences()) { - // If we are keeping resources, emit a stronly typed wrapper over the URN - const urn = yield serializeProperty(`${ctx}.urn`, prop.urn, dependentResources, { - keepOutputValues: false, - }); - return { - [exports.specialSigKey]: exports.specialResourceSig, - urn: urn, - id: id, - }; + catch (e_14_1) { e_14 = { error: e_14_1 }; } + finally { + try { + if (iter_1_1 && !iter_1_1.done && (_b = iter_1.return)) yield __await(_b.call(iter_1)); + } + finally { if (e_14) throw e_14.error; } } - // Else, return the id for backward compatibility. - return id; - } - if (resource_1.ComponentResource.isInstance(prop)) { - // Component resources often can contain cycles in them. For example, an awsinfra - // SecurityGroupRule can point a the awsinfra SecurityGroup, which in turn can point back to - // its rules through its `egressRules` and `ingressRules` properties. If serializing out - // the `SecurityGroup` resource ends up trying to serialize out those properties, a deadlock - // will happen, due to waiting on the child, which is waiting on the parent. + }); + }; +} +exports.concat = concat; +// +// Ordering operators. +// +function orderBy(keySelector) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { // - // Practically, there is no need to actually serialize out a component. It doesn't represent - // a real resource, nor does it have normal properties that need to be tracked for differences - // (since changes to its properties don't represent changes to resources in the real world). + // NOTE: This horrible little function is necessary because the default behavior of + // JavaScript's `Array#sort` is to coerce every element in the array into string, and then + // sort those strings lexically. // - // So, to avoid these problems, while allowing a flexible and simple programming model, we - // just serialize out the component as its urn. This allows the component to be identified - // and tracked in a reasonable manner, while not causing us to compute or embed information - // about it that is not needed, and which can lead to deadlocks. - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: component resource urn`); - } - if (yield settings_1.monitorSupportsResourceReferences()) { - // If we are keeping resources, emit a strongly typed wrapper over the URN - const urn = yield serializeProperty(`${ctx}.urn`, prop.urn, dependentResources, { - keepOutputValues: false, + // This, of course, is completely unacceptable. Approximately 0 users call `.sort` on an + // array of `Object` with the intention that they be sorted in this manner. The right thing + // to do is to simply assume this is a user error and throw an exception. + // + // If the user actually wants to sort an array of `Object` by their stringified + // representation, let them pass us a key function that performs this conversion explicitly. + // There is no particular need for Brendan Eich's problems from 30 years ago to become our + // users' problems today. + // + let lastKey; + const ts = yield __await(map(function (t) { + return __awaiter(this, void 0, void 0, function* () { + const key = yield keySelector(t); + if (lastKey === undefined) { + lastKey = key; + } + else { + if (util_1.isNumber(key) && util_1.isString(key)) { + throw Error("keySelector must produce a number or a string"); + } + if (typeof lastKey !== typeof key) { + throw Error(`keySelector must produce keys all of the same type, but found ` + + `${typeof key} and ${typeof lastKey}`); + } + } + return [key, t]; }); - return { - [exports.specialSigKey]: exports.specialResourceSig, - urn: urn, - }; + })(source)); + const keyed = yield __await(toArray()(ts)); + const comparator = ((util_1.isNumber(lastKey) + ? (a, b) => a - b + : (a, b) => a.localeCompare(b))); + const sorted = keyed.sort(([k1], [k2]) => comparator(k1, k2)); + for (const [, t] of sorted) { + yield yield __await(t); } - // Else, return the urn for backward compatibility. - return serializeProperty(`${ctx}.urn`, prop.urn, dependentResources, { - keepOutputValues: false, - }); - } - if (prop instanceof Array) { - const result = []; - for (let i = 0; i < prop.length; i++) { - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: array[${i}] element`); + }); + }; +} +exports.orderBy = orderBy; +function orderByDescending(keySelector) { + return function (source) { + return reverse()(orderBy(keySelector)(source)); + }; +} +exports.orderByDescending = orderByDescending; +function reverse() { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_15, _a; + const ts = []; + try { + for (var source_2 = __asyncValues(source), source_2_1; source_2_1 = yield __await(source_2.next()), !source_2_1.done;) { + const t = source_2_1.value; + ts.push(t); } - // When serializing arrays, we serialize any undefined values as `null`. This matches JSON semantics. - const elem = yield serializeProperty(`${ctx}[${i}]`, prop[i], dependentResources, opts); - result.push(elem === undefined ? null : elem); } - return result; - } - return yield serializeAllKeys(prop, {}, opts); - function serializeAllKeys(innerProp, obj, innerOpts) { - return __awaiter(this, void 0, void 0, function* () { - for (const k of Object.keys(innerProp)) { - if (settings_1.excessiveDebugOutput) { - log.debug(`Serialize property [${ctx}]: object.${k}`); + catch (e_15_1) { e_15 = { error: e_15_1 }; } + finally { + try { + if (source_2_1 && !source_2_1.done && (_a = source_2.return)) yield __await(_a.call(source_2)); + } + finally { if (e_15) throw e_15.error; } + } + for (const t of ts.reverse()) { + yield yield __await(t); + } + }); + }; +} +exports.reverse = reverse; +// +// Grouping operators. +// +function groupBy(keySelector, elementSelector) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_16, _a; + if (elementSelector === undefined) { + elementSelector = t => t; + } + const groups = new Map(); + try { + for (var source_3 = __asyncValues(source), source_3_1; source_3_1 = yield __await(source_3.next()), !source_3_1.done;) { + const t = source_3_1.value; + const key = yield __await(keySelector(t)); + const val = yield __await(elementSelector(t)); + if (!groups.has(key)) { + groups.set(key, [val]); } - // When serializing an object, we omit any keys with undefined values. This matches JSON semantics. - const v = yield serializeProperty(`${ctx}.${k}`, innerProp[k], dependentResources, innerOpts); - if (v !== undefined) { - obj[k] = v; + else { + const group = groups.get(key); + group.push(val); } } - return obj; - }); - } - }); -} -exports.serializeProperty = serializeProperty; -/** - * isRpcSecret returns true if obj is a wrapped secret value (i.e. it's an object with the special key set). - */ -function isRpcSecret(obj) { - return obj && obj[exports.specialSigKey] === exports.specialSecretSig; + } + catch (e_16_1) { e_16 = { error: e_16_1 }; } + finally { + try { + if (source_3_1 && !source_3_1.done && (_a = source_3.return)) yield __await(_a.call(source_3)); + } + finally { if (e_16) throw e_16.error; } + } + for (const [key, group] of groups) { + yield yield __await(new base_1.GroupedAsyncIterableIteratorImpl(key, sources_1.from(group))); + } + }); + }; } -exports.isRpcSecret = isRpcSecret; -/** - * unwrapRpcSecret returns the underlying value for a secret, or the value itself if it was not a secret. - */ -function unwrapRpcSecret(obj) { - if (!isRpcSecret(obj)) { - return obj; - } - return obj.value; +exports.groupBy = groupBy; +// +// Set operators. +// +function distinct() { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_17, _a; + const dist = new Set(); + try { + for (var source_4 = __asyncValues(source), source_4_1; source_4_1 = yield __await(source_4.next()), !source_4_1.done;) { + const t = source_4_1.value; + if (!dist.has(t)) { + dist.add(t); + yield yield __await(t); + } + } + } + catch (e_17_1) { e_17 = { error: e_17_1 }; } + finally { + try { + if (source_4_1 && !source_4_1.done && (_a = source_4.return)) yield __await(_a.call(source_4)); + } + finally { if (e_17) throw e_17.error; } + } + }); + }; } -exports.unwrapRpcSecret = unwrapRpcSecret; -/** - * deserializeProperty unpacks some special types, reversing the above process. - */ -function deserializeProperty(prop) { - if (prop === undefined) { - throw new Error("unexpected undefined property value during deserialization"); - } - else if (prop === exports.unknownValue) { - return settings_1.isDryRun() ? output_1.unknown : undefined; - } - else if (prop === null || typeof prop === "boolean" || typeof prop === "number" || typeof prop === "string") { - return prop; - } - else if (prop instanceof Array) { - // We can just deserialize all the elements of the underlying array and return it. - // However, we want to push secretness up to the top level (since we can't set sub-properties to secret) - // values since they are not typed as Output. - let hadSecret = false; - const elems = []; - for (const e of prop) { - prop = deserializeProperty(e); - hadSecret = hadSecret || isRpcSecret(prop); - elems.push(unwrapRpcSecret(prop)); - } - if (hadSecret) { - return { - [exports.specialSigKey]: exports.specialSecretSig, - value: elems, - }; - } - return elems; - } - else { - // We need to recognize assets and archives specially, so we can produce the right runtime objects. - const sig = prop[exports.specialSigKey]; - if (sig) { - switch (sig) { - case exports.specialAssetSig: - if (prop["path"]) { - return new asset.FileAsset(prop["path"]); +exports.distinct = distinct; +function union(second) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_18, _a, e_19, _b; + const dist = new Set(); + try { + for (var source_5 = __asyncValues(source), source_5_1; source_5_1 = yield __await(source_5.next()), !source_5_1.done;) { + const t = source_5_1.value; + if (!dist.has(t)) { + dist.add(t); + yield yield __await(t); } - else if (prop["text"]) { - return new asset.StringAsset(prop["text"]); + } + } + catch (e_18_1) { e_18 = { error: e_18_1 }; } + finally { + try { + if (source_5_1 && !source_5_1.done && (_a = source_5.return)) yield __await(_a.call(source_5)); + } + finally { if (e_18) throw e_18.error; } + } + try { + for (var second_1 = __asyncValues(second), second_1_1; second_1_1 = yield __await(second_1.next()), !second_1_1.done;) { + const t = second_1_1.value; + if (!dist.has(t)) { + dist.add(t); + yield yield __await(t); } - else if (prop["uri"]) { - return new asset.RemoteAsset(prop["uri"]); + } + } + catch (e_19_1) { e_19 = { error: e_19_1 }; } + finally { + try { + if (second_1_1 && !second_1_1.done && (_b = second_1.return)) yield __await(_b.call(second_1)); + } + finally { if (e_19) throw e_19.error; } + } + }); + }; +} +exports.union = union; +function intersect(second) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_20, _a, e_21, _b; + const dist = new Set(); + try { + for (var source_6 = __asyncValues(source), source_6_1; source_6_1 = yield __await(source_6.next()), !source_6_1.done;) { + const t = source_6_1.value; + dist.add(t); + } + } + catch (e_20_1) { e_20 = { error: e_20_1 }; } + finally { + try { + if (source_6_1 && !source_6_1.done && (_a = source_6.return)) yield __await(_a.call(source_6)); + } + finally { if (e_20) throw e_20.error; } + } + const emitted = new Set(); + try { + for (var second_2 = __asyncValues(second), second_2_1; second_2_1 = yield __await(second_2.next()), !second_2_1.done;) { + const t = second_2_1.value; + if (dist.has(t) && !emitted.has(t)) { + emitted.add(t); + yield yield __await(t); + } + } + } + catch (e_21_1) { e_21 = { error: e_21_1 }; } + finally { + try { + if (second_2_1 && !second_2_1.done && (_b = second_2.return)) yield __await(_b.call(second_2)); + } + finally { if (e_21) throw e_21.error; } + } + }); + }; +} +exports.intersect = intersect; +function except(second) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_22, _a, e_23, _b; + const dist = new Set(); + try { + for (var source_7 = __asyncValues(source), source_7_1; source_7_1 = yield __await(source_7.next()), !source_7_1.done;) { + const t = source_7_1.value; + dist.add(t); + } + } + catch (e_22_1) { e_22 = { error: e_22_1 }; } + finally { + try { + if (source_7_1 && !source_7_1.done && (_a = source_7.return)) yield __await(_a.call(source_7)); + } + finally { if (e_22) throw e_22.error; } + } + try { + for (var second_3 = __asyncValues(second), second_3_1; second_3_1 = yield __await(second_3.next()), !second_3_1.done;) { + const t = second_3_1.value; + if (dist.has(t)) { + dist.delete(t); } else { - throw new Error("Invalid asset encountered when unmarshaling resource property"); + dist.add(t); } - case exports.specialArchiveSig: - if (prop["assets"]) { - const assets = {}; - for (const name of Object.keys(prop["assets"])) { - const a = deserializeProperty(prop["assets"][name]); - if (!(asset.Asset.isInstance(a)) && !(asset.Archive.isInstance(a))) { - throw new Error("Expected an AssetArchive's assets to be unmarshaled Asset or Archive objects"); - } - assets[name] = a; - } - return new asset.AssetArchive(assets); - } - else if (prop["path"]) { - return new asset.FileArchive(prop["path"]); - } - else if (prop["uri"]) { - return new asset.RemoteArchive(prop["uri"]); - } - else { - throw new Error("Invalid archive encountered when unmarshaling resource property"); - } - case exports.specialSecretSig: - return { - [exports.specialSigKey]: exports.specialSecretSig, - value: deserializeProperty(prop["value"]), - }; - case exports.specialResourceSig: - // Deserialize the resource into a live Resource reference - const urn = prop["urn"]; - const version = prop["packageVersion"]; - const urnParts = urn.split("::"); - const qualifiedType = urnParts[2]; - const urnName = urnParts[3]; - const type = qualifiedType.split("$").pop(); - const typeParts = type.split(":"); - const pkgName = typeParts[0]; - const modName = typeParts.length > 1 ? typeParts[1] : ""; - const typName = typeParts.length > 2 ? typeParts[2] : ""; - const isProvider = pkgName === "pulumi" && modName === "providers"; - if (isProvider) { - const resourcePackage = getResourcePackage(typName, version); - if (resourcePackage) { - return resourcePackage.constructProvider(urnName, type, urn); - } - } - else { - const resourceModule = getResourceModule(pkgName, modName, version); - if (resourceModule) { - return resourceModule.construct(urnName, type, urn); - } - } - // If we've made it here, deserialize the reference as either a URN or an ID (if present). - if (prop["id"]) { - const id = prop["id"]; - return deserializeProperty(id === "" ? exports.unknownValue : id); - } - return urn; - case exports.specialOutputValueSig: - let value = prop["value"]; - const isKnown = value !== undefined; - if (isKnown) { - value = deserializeProperty(value); - } - const isSecret = prop["secret"] === true; - const dependencies = prop["dependencies"]; - const resources = Array.isArray(dependencies) - ? dependencies.map(d => new resource_1.DependencyResource(d)) - : []; - return new output_1.Output(resources, Promise.resolve(value), Promise.resolve(isKnown), Promise.resolve(isSecret), Promise.resolve([])); - default: - throw new Error(`Unrecognized signature '${sig}' when unmarshaling resource property`); + } } - } - // If there isn't a signature, it's not a special type, and we can simply return the object as a map. - // However, we want to push secretness up to the top level (since we can't set sub-properties to secret) - // values since they are not typed as Output. - const obj = {}; - let hadSecrets = false; - for (const k of Object.keys(prop)) { - const o = deserializeProperty(prop[k]); - hadSecrets = hadSecrets || isRpcSecret(o); - obj[k] = unwrapRpcSecret(o); - } - if (hadSecrets) { - return { - [exports.specialSigKey]: exports.specialSecretSig, - value: obj, - }; - } - return obj; - } + catch (e_23_1) { e_23 = { error: e_23_1 }; } + finally { + try { + if (second_3_1 && !second_3_1.done && (_b = second_3.return)) yield __await(_b.call(second_3)); + } + finally { if (e_23) throw e_23.error; } + } + for (const t of dist) { + yield yield __await(t); + } + }); + }; } -exports.deserializeProperty = deserializeProperty; -/** - * suppressUnhandledGrpcRejections silences any unhandled promise rejections that occur due to gRPC errors. The input - * promise may still be rejected. - */ -function suppressUnhandledGrpcRejections(p) { - p.catch(err => { - if (!errors_1.isGrpcError(err)) { - throw err; - } - }); - return p; +exports.except = except; +// +// Conversion operators. +// +function toArray() { + return function (source) { + var source_8, source_8_1; + var e_24, _a; + return __awaiter(this, void 0, void 0, function* () { + const ret = []; + try { + for (source_8 = __asyncValues(source); source_8_1 = yield source_8.next(), !source_8_1.done;) { + const t = source_8_1.value; + ret.push(t); + } + } + catch (e_24_1) { e_24 = { error: e_24_1 }; } + finally { + try { + if (source_8_1 && !source_8_1.done && (_a = source_8.return)) yield _a.call(source_8); + } + finally { if (e_24) throw e_24.error; } + } + return ret; + }); + }; } -exports.suppressUnhandledGrpcRejections = suppressUnhandledGrpcRejections; -function sameVersion(a, b) { - // We treat undefined as a wildcard, so it always equals every other version. - return a === undefined || b === undefined || semver.eq(a, b); +exports.toArray = toArray; +function toMap(keySelector, elementSelector) { + return function (source) { + var source_9, source_9_1; + var e_25, _a; + return __awaiter(this, void 0, void 0, function* () { + if (elementSelector === undefined) { + elementSelector = x => x; + } + const ret = new Map(); + try { + for (source_9 = __asyncValues(source); source_9_1 = yield source_9.next(), !source_9_1.done;) { + const t = source_9_1.value; + const key = yield keySelector(t); + if (key === undefined) { + throw Error("key selector can't produce a null value"); + } + const val = yield elementSelector(t); + ret.set(key, val); + } + } + catch (e_25_1) { e_25 = { error: e_25_1 }; } + finally { + try { + if (source_9_1 && !source_9_1.done && (_a = source_9.return)) yield _a.call(source_9); + } + finally { if (e_25) throw e_25.error; } + } + return ret; + }); + }; } -function checkVersion(want, have) { - if (want === undefined || have === undefined) { - return true; - } - return have.major === want.major && have.minor >= want.minor && have.patch >= want.patch; +exports.toMap = toMap; +function ofType(typeGuard) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_26, _a; + try { + for (var source_10 = __asyncValues(source), source_10_1; source_10_1 = yield __await(source_10.next()), !source_10_1.done;) { + const t = source_10_1.value; + if (typeGuard(t)) { + yield yield __await(t); + } + } + } + catch (e_26_1) { e_26 = { error: e_26_1 }; } + finally { + try { + if (source_10_1 && !source_10_1.done && (_a = source_10.return)) yield __await(_a.call(source_10)); + } + finally { if (e_26) throw e_26.error; } + } + }); + }; } -/** @internal */ -function register(source, registrationType, key, item) { - let items = source.get(key); - if (items) { - for (const existing of items) { - if (sameVersion(existing.version, item.version)) { - // It is possible for the same version of the same provider SDK to be loaded multiple times in Node.js. - // In this case, we might legitimately get multiple registrations of the same resource. It should not - // matter which we use, so we can just skip re-registering. De-serialized resources will always be - // instances of classes from the first registered package. - if (settings_1.excessiveDebugOutput) { - log.debug(`skip re-registering already registered ${registrationType} ${key}@${item.version}.`); +exports.ofType = ofType; +// +// Element operators. +// +function first(predicate) { + return function (source) { + var source_11, source_11_1; + var e_27, _a; + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + try { + for (source_11 = __asyncValues(source); source_11_1 = yield source_11.next(), !source_11_1.done;) { + const t = source_11_1.value; + if ((yield predicate(t)) === true) { + return t; + } } - return false; } - } - } - else { - items = []; - source.set(key, items); - } - if (settings_1.excessiveDebugOutput) { - log.debug(`registering ${registrationType} ${key}@${item.version}`); - } - items.push(item); - return true; + catch (e_27_1) { e_27 = { error: e_27_1 }; } + finally { + try { + if (source_11_1 && !source_11_1.done && (_a = source_11.return)) yield _a.call(source_11); + } + finally { if (e_27) throw e_27.error; } + } + return Promise.reject("first could not find any elements that match predicate"); + }); + }; } -exports.register = register; -/** @internal */ -function getRegistration(source, key, version) { - var _a; - const ver = version ? new semver.SemVer(version) : undefined; - let bestMatch = undefined; - let bestMatchVersion = undefined; - for (const existing of (_a = source.get(key), (_a !== null && _a !== void 0 ? _a : []))) { - const existingVersion = existing.version !== undefined ? new semver.SemVer(existing.version) : undefined; - if (!checkVersion(ver, existingVersion)) { - continue; - } - if (!bestMatch || (existingVersion && bestMatchVersion && semver.gt(existingVersion, bestMatchVersion))) { - bestMatch = existing; - bestMatchVersion = existingVersion; - } - } - return bestMatch; +exports.first = first; +function firstOrDefault(defaultValue, predicate) { + return function (source) { + var source_12, source_12_1; + var e_28, _a; + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + try { + for (source_12 = __asyncValues(source); source_12_1 = yield source_12.next(), !source_12_1.done;) { + const t = source_12_1.value; + if ((yield predicate(t)) === true) { + return t; + } + } + } + catch (e_28_1) { e_28 = { error: e_28_1 }; } + finally { + try { + if (source_12_1 && !source_12_1.done && (_a = source_12.return)) yield _a.call(source_12); + } + finally { if (e_28) throw e_28.error; } + } + return defaultValue; + }); + }; } -exports.getRegistration = getRegistration; -const resourcePackages = new Map(); -/** @internal Used only for testing purposes. */ -function _resetResourcePackages() { - resourcePackages.clear(); +exports.firstOrDefault = firstOrDefault; +function last(predicate) { + return function (source) { + var source_13, source_13_1; + var e_29, _a; + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + let curr; + try { + for (source_13 = __asyncValues(source); source_13_1 = yield source_13.next(), !source_13_1.done;) { + const t = source_13_1.value; + if ((yield predicate(t)) === true) { + curr = t; + } + } + } + catch (e_29_1) { e_29 = { error: e_29_1 }; } + finally { + try { + if (source_13_1 && !source_13_1.done && (_a = source_13.return)) yield _a.call(source_13); + } + finally { if (e_29) throw e_29.error; } + } + if (curr === undefined) { + return Promise.reject("last could not find any elements that match predicate"); + } + else { + return curr; + } + }); + }; } -exports._resetResourcePackages = _resetResourcePackages; -/** - * registerResourcePackage registers a resource package that will be used to construct providers for any URNs matching - * the package name and version that are deserialized by the current instance of the Pulumi JavaScript SDK. - */ -function registerResourcePackage(pkg, resourcePackage) { - register(resourcePackages, "package", pkg, resourcePackage); +exports.last = last; +function lastOrDefault(defaultValue, predicate) { + return function (source) { + var source_14, source_14_1; + var e_30, _a; + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + let curr; + try { + for (source_14 = __asyncValues(source); source_14_1 = yield source_14.next(), !source_14_1.done;) { + const t = source_14_1.value; + if ((yield predicate(t)) === true) { + curr = t; + } + } + } + catch (e_30_1) { e_30 = { error: e_30_1 }; } + finally { + try { + if (source_14_1 && !source_14_1.done && (_a = source_14.return)) yield _a.call(source_14); + } + finally { if (e_30) throw e_30.error; } + } + if (curr === undefined) { + return defaultValue; + } + else { + return curr; + } + }); + }; } -exports.registerResourcePackage = registerResourcePackage; -function getResourcePackage(pkg, version) { - return getRegistration(resourcePackages, pkg, version); +exports.lastOrDefault = lastOrDefault; +function single(predicate) { + return function (source) { + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + const seq = yield toArray()(filter(predicate)(source)); + if (seq.length === 0) { + throw Error("single did not find any elements matching the predicate"); + } + else if (seq.length > 1) { + throw Error("single found multiple elements matching the predicate"); + } + return seq[0]; + }); + }; } -exports.getResourcePackage = getResourcePackage; -const resourceModules = new Map(); -function moduleKey(pkg, mod) { - return `${pkg}:${mod}`; +exports.single = single; +function singleOrDefault(defaultValue, predicate) { + return function (source) { + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + const seq = yield toArray()(filter(predicate)(source)); + if (seq.length === 0) { + return defaultValue; + } + else if (seq.length > 1) { + throw Error("single found multiple elements matching the predicate"); + } + else { + return seq[0]; + } + }); + }; } -/** @internal Used only for testing purposes. */ -function _resetResourceModules() { - resourceModules.clear(); +exports.singleOrDefault = singleOrDefault; +function elementAt(index) { + return function (source) { + var e_31, _a; + return __awaiter(this, void 0, void 0, function* () { + try { + // TODO: Maybe support `Array` here if we ever support sync iterables. This would allow us + // to access that index directly. + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield _b.next(), !_c.done;) { + const [t, i] = _c.value; + if (i === index) { + return t; + } + } + } + catch (e_31_1) { e_31 = { error: e_31_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_31) throw e_31.error; } + } + throw Error(`elementAt tried to find item at index ${index}, but sequence had fewer elements`); + }); + }; } -exports._resetResourceModules = _resetResourceModules; -/** - * registerResourceModule registers a resource module that will be used to construct resources for any URNs matching - * the module name and version that are deserialized by the current instance of the Pulumi JavaScript SDK. - */ -function registerResourceModule(pkg, mod, module) { - const key = moduleKey(pkg, mod); - register(resourceModules, "module", key, module); +exports.elementAt = elementAt; +function elementAtOrDefault(defaultValue, index) { + return function (source) { + var e_32, _a; + return __awaiter(this, void 0, void 0, function* () { + try { + // TODO: Maybe support `Array` here if we ever support sync iterables. This would allow us + // to access that index directly. + for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield _b.next(), !_c.done;) { + const [t, i] = _c.value; + if (i === index) { + return t; + } + } + } + catch (e_32_1) { e_32 = { error: e_32_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_32) throw e_32.error; } + } + return defaultValue; + }); + }; } -exports.registerResourceModule = registerResourceModule; -function getResourceModule(pkg, mod, version) { - const key = moduleKey(pkg, mod); - return getRegistration(resourceModules, key, version); +exports.elementAtOrDefault = elementAtOrDefault; +function defaultIfEmpty(defaultValue) { + return function (source) { + return __asyncGenerator(this, arguments, function* () { + var e_33, _a; + let sequenceEmpty = true; + try { + for (var source_15 = __asyncValues(source), source_15_1; source_15_1 = yield __await(source_15.next()), !source_15_1.done;) { + const t = source_15_1.value; + sequenceEmpty = false; + yield yield __await(t); + } + } + catch (e_33_1) { e_33 = { error: e_33_1 }; } + finally { + try { + if (source_15_1 && !source_15_1.done && (_a = source_15.return)) yield __await(_a.call(source_15)); + } + finally { if (e_33) throw e_33.error; } + } + if (sequenceEmpty) { + yield yield __await(defaultValue); + } + }); + }; } -exports.getResourceModule = getResourceModule; -//# sourceMappingURL=rpc.js.map +exports.defaultIfEmpty = defaultIfEmpty; +// +// Quantifiers. +// +function any(predicate) { + return function (source) { + var source_16, source_16_1; + var e_34, _a; + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + try { + for (source_16 = __asyncValues(source); source_16_1 = yield source_16.next(), !source_16_1.done;) { + const t = source_16_1.value; + if ((yield predicate(t)) === true) { + return true; + } + } + } + catch (e_34_1) { e_34 = { error: e_34_1 }; } + finally { + try { + if (source_16_1 && !source_16_1.done && (_a = source_16.return)) yield _a.call(source_16); + } + finally { if (e_34) throw e_34.error; } + } + return false; + }); + }; +} +exports.any = any; +function all(predicate) { + return function (source) { + var source_17, source_17_1; + var e_35, _a; + return __awaiter(this, void 0, void 0, function* () { + try { + for (source_17 = __asyncValues(source); source_17_1 = yield source_17.next(), !source_17_1.done;) { + const t = source_17_1.value; + if ((yield predicate(t)) === false) { + return false; + } + } + } + catch (e_35_1) { e_35 = { error: e_35_1 }; } + finally { + try { + if (source_17_1 && !source_17_1.done && (_a = source_17.return)) yield _a.call(source_17); + } + finally { if (e_35) throw e_35.error; } + } + return true; + }); + }; +} +exports.all = all; +function contains(value) { + return function (source) { + var source_18, source_18_1; + var e_36, _a; + return __awaiter(this, void 0, void 0, function* () { + const dist = new Set([value]); + try { + for (source_18 = __asyncValues(source); source_18_1 = yield source_18.next(), !source_18_1.done;) { + const t = source_18_1.value; + if (dist.has(t)) { + return true; + } + } + } + catch (e_36_1) { e_36 = { error: e_36_1 }; } + finally { + try { + if (source_18_1 && !source_18_1.done && (_a = source_18.return)) yield _a.call(source_18); + } + finally { if (e_36) throw e_36.error; } + } + return false; + }); + }; +} +exports.contains = contains; +// +// Aggregate operators. +// +function count(predicate) { + return function (source) { + var source_19, source_19_1; + var e_37, _a; + return __awaiter(this, void 0, void 0, function* () { + if (predicate === undefined) { + predicate = t => true; + } + let n = 0; + try { + for (source_19 = __asyncValues(source); source_19_1 = yield source_19.next(), !source_19_1.done;) { + const t = source_19_1.value; + if ((yield predicate(t)) === true) { + n++; + } + } + } + catch (e_37_1) { e_37 = { error: e_37_1 }; } + finally { + try { + if (source_19_1 && !source_19_1.done && (_a = source_19.return)) yield _a.call(source_19); + } + finally { if (e_37) throw e_37.error; } + } + return n; + }); + }; +} +exports.count = count; +function sum(selector) { + return function (source) { + var source_20, source_20_1; + var e_38, _a; + return __awaiter(this, void 0, void 0, function* () { + // If selector is undefined, the source should emit `number`. + if (selector === undefined) { + selector = t => t; + } + let total = 0; + try { + for (source_20 = __asyncValues(source); source_20_1 = yield source_20.next(), !source_20_1.done;) { + const t = source_20_1.value; + const toSum = yield selector(t); + if (!util_1.isNumber(toSum)) { + throw Error("Can't sum things that aren't numbers"); + } + total += toSum; + } + } + catch (e_38_1) { e_38 = { error: e_38_1 }; } + finally { + try { + if (source_20_1 && !source_20_1.done && (_a = source_20.return)) yield _a.call(source_20); + } + finally { if (e_38) throw e_38.error; } + } + return total; + }); + }; +} +exports.sum = sum; +function min(selector) { + return function (source) { + var source_21, source_21_1; + var e_39, _a; + return __awaiter(this, void 0, void 0, function* () { + // If selector is undefined, the source should emit `number`. + if (selector === undefined) { + selector = t => t; + } + let minimum = undefined; + try { + for (source_21 = __asyncValues(source); source_21_1 = yield source_21.next(), !source_21_1.done;) { + const t = source_21_1.value; + const curr = yield selector(t); + if (minimum === undefined) { + minimum = curr; + } + if (!util_1.isNumber(curr)) { + throw Error("min can't find the minimum of things that aren't numbers"); + } + if (minimum > curr) { + minimum = curr; + } + } + } + catch (e_39_1) { e_39 = { error: e_39_1 }; } + finally { + try { + if (source_21_1 && !source_21_1.done && (_a = source_21.return)) yield _a.call(source_21); + } + finally { if (e_39) throw e_39.error; } + } + if (minimum === undefined) { + throw Error("min can't be called on an empty sequence"); + } + return minimum; + }); + }; +} +exports.min = min; +function max(selector) { + return function (source) { + var source_22, source_22_1; + var e_40, _a; + return __awaiter(this, void 0, void 0, function* () { + // If selector is undefined, the source should emit `number`. + if (selector === undefined) { + selector = t => t; + } + let maximum = undefined; + try { + for (source_22 = __asyncValues(source); source_22_1 = yield source_22.next(), !source_22_1.done;) { + const t = source_22_1.value; + const curr = yield selector(t); + if (maximum === undefined) { + maximum = curr; + } + if (!util_1.isNumber(curr)) { + throw Error("max can't find the maximum of things that aren't numbers"); + } + if (maximum < curr) { + maximum = curr; + } + } + } + catch (e_40_1) { e_40 = { error: e_40_1 }; } + finally { + try { + if (source_22_1 && !source_22_1.done && (_a = source_22.return)) yield _a.call(source_22); + } + finally { if (e_40) throw e_40.error; } + } + if (maximum === undefined) { + throw Error("max can't be called on an empty sequence"); + } + return maximum; + }); + }; +} +exports.max = max; +function average(selector) { + return function (source) { + var source_23, source_23_1; + var e_41, _a; + return __awaiter(this, void 0, void 0, function* () { + // If selector is undefined, the source should emit `number`. + if (selector === undefined) { + selector = t => t; + } + let total = 0; + let cnt = 0; + try { + for (source_23 = __asyncValues(source); source_23_1 = yield source_23.next(), !source_23_1.done;) { + const t = source_23_1.value; + const toSum = yield selector(t); + if (!util_1.isNumber(toSum)) { + throw Error("Can't sum things that aren't numbers"); + } + total += toSum; + cnt++; + } + } + catch (e_41_1) { e_41 = { error: e_41_1 }; } + finally { + try { + if (source_23_1 && !source_23_1.done && (_a = source_23.return)) yield _a.call(source_23); + } + finally { if (e_41) throw e_41.error; } + } + if (cnt === 0) { + return Promise.reject("Can't compute average of empty sequence"); + } + return total / cnt; + }); + }; +} +exports.average = average; +function aggregate(seed, func) { + return function (source) { + var source_24, source_24_1; + var e_42, _a; + return __awaiter(this, void 0, void 0, function* () { + let acc = seed; + try { + for (source_24 = __asyncValues(source); source_24_1 = yield source_24.next(), !source_24_1.done;) { + const t = source_24_1.value; + acc = yield func(acc, t); + } + } + catch (e_42_1) { e_42 = { error: e_42_1 }; } + finally { + try { + if (source_24_1 && !source_24_1.done && (_a = source_24.return)) yield _a.call(source_24); + } + finally { if (e_42) throw e_42.error; } + } + return acc; + }); + }; +} +exports.aggregate = aggregate; +// +// Misc. +// +function zip(source1, source2, resultSelector = (t1, t2) => [t1, t2]) { + return __asyncGenerator(this, arguments, function* zip_1() { + while (true) { + const result1 = yield __await(source1.next()); + const result2 = yield __await(source2.next()); + if (result1.done || result2.done) { + return yield __await(void 0); + } + else { + yield yield __await(yield __await(resultSelector(result1.value, result2.value))); + } + } + }); +} +exports.zip = zip; + /***/ }), -/***/ 34530: +/***/ 8396: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// Copyright 2016-2021, Pulumi Corporation. +// Copyright 2016-2019, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -44879,45459 +42599,25611 @@ exports.getResourceModule = getResourceModule; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const grpc = __nccwpck_require__(7025); -const fs = __nccwpck_require__(57147); -const path = __nccwpck_require__(71017); -const debuggable_1 = __nccwpck_require__(20257); -const engrpc = __nccwpck_require__(5053); -const engproto = __nccwpck_require__(10986); -const resrpc = __nccwpck_require__(25815); -const resproto = __nccwpck_require__(52480); -// maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) -exports.maxRPCMessageSize = 1024 * 1024 * 400; -const grpcChannelOptions = { "grpc.max_receive_message_length": exports.maxRPCMessageSize }; -/** - * excessiveDebugOutput enables, well, pretty excessive debug output pertaining to resources and properties. - */ -exports.excessiveDebugOutput = false; -const nodeEnvKeys = { - project: "PULUMI_NODEJS_PROJECT", - stack: "PULUMI_NODEJS_STACK", - dryRun: "PULUMI_NODEJS_DRY_RUN", - queryMode: "PULUMI_NODEJS_QUERY_MODE", - parallel: "PULUMI_NODEJS_PARALLEL", - monitorAddr: "PULUMI_NODEJS_MONITOR", - engineAddr: "PULUMI_NODEJS_ENGINE", - syncDir: "PULUMI_NODEJS_SYNC", - // this value is not set by the CLI and is controlled via a user set env var unlike the values above - cacheDynamicProviders: "PULUMI_NODEJS_CACHE_DYNAMIC_PROVIDERS", +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; -const pulumiEnvKeys = { - testMode: "PULUMI_TEST_MODE", - legacyApply: "PULUMI_ENABLE_LEGACY_APPLY", +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } }; -// reset options resets nodejs runtime global state (such as rpc clients), -// and sets nodejs runtime option env vars to the specified values. -function resetOptions(project, stack, parallel, engineAddr, monitorAddr, preview) { - monitor = undefined; - engine = undefined; - rpcDone = Promise.resolve(); - featureSupport = {}; - // reset node specific environment variables in the process - process.env[nodeEnvKeys.project] = project; - process.env[nodeEnvKeys.stack] = stack; - process.env[nodeEnvKeys.dryRun] = preview.toString(); - process.env[nodeEnvKeys.queryMode] = isQueryMode.toString(); - process.env[nodeEnvKeys.parallel] = parallel.toString(); - process.env[nodeEnvKeys.monitorAddr] = monitorAddr; - process.env[nodeEnvKeys.engineAddr] = engineAddr; -} -exports.resetOptions = resetOptions; -function setMockOptions(mockMonitor, project, stack, preview) { - const opts = options(); - resetOptions(project || opts.project || "project", stack || opts.stack || "stack", opts.parallel || -1, opts.engineAddr || "", opts.monitorAddr || "", preview || false); - monitor = mockMonitor; -} -exports.setMockOptions = setMockOptions; -/** @internal Used only for testing purposes. */ -function _setIsDryRun(val) { - process.env[nodeEnvKeys.dryRun] = val.toString(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const interfaces_1 = __nccwpck_require__(2830); +const util_1 = __nccwpck_require__(8158); +function range(start, end) { + return __asyncGenerator(this, arguments, function* range_1() { + let i = start; + while (true) { + if (end !== undefined && i >= end) { + return yield __await(void 0); + } + yield yield __await(i++); + } + }); } -exports._setIsDryRun = _setIsDryRun; -/** - * Returns whether or not we are currently doing a preview. - * - * When writing unit tests, you can set this flag via either `setMocks` or `_setIsDryRun`. - */ -function isDryRun() { - return options().dryRun === true; +exports.range = range; +function from(source) { + return __asyncGenerator(this, arguments, function* from_1() { + var e_1, _a; + let iter; + if (util_1.isIterable(source) || interfaces_1.isAsyncIterable(source)) { + iter = source; + } + else { + iter = yield __await(source); + } + if (util_1.isIterable(iter)) { + for (const t of iter) { + yield yield __await(t); + } + } + else { + try { + for (var iter_1 = __asyncValues(iter), iter_1_1; iter_1_1 = yield __await(iter_1.next()), !iter_1_1.done;) { + const t = iter_1_1.value; + yield yield __await(t); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (iter_1_1 && !iter_1_1.done && (_a = iter_1.return)) yield __await(_a.call(iter_1)); + } + finally { if (e_1) throw e_1.error; } + } + } + }); } -exports.isDryRun = isDryRun; -/** @internal Used only for testing purposes */ -function _reset() { - resetOptions("", "", -1, "", "", false); +exports.from = from; + + +/***/ }), + +/***/ 8158: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// Copyright 2016-2019, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +function isAsyncIterable(o) { + return typeof o[Symbol.asyncIterator] === "function"; } -exports._reset = _reset; -/** @internal Used only for testing purposes */ -function _setTestModeEnabled(val) { - process.env[pulumiEnvKeys.testMode] = val.toString(); +exports.isAsyncIterable = isAsyncIterable; +function isIterable(o) { + return typeof o[Symbol.iterator] === "function"; } -exports._setTestModeEnabled = _setTestModeEnabled; -/** @internal Used only for testing purposes */ -function _setFeatureSupport(key, val) { - featureSupport[key] = val; +exports.isIterable = isIterable; + + +/***/ }), + +/***/ 7678: +/***/ ((module, exports) => { + +"use strict"; + +/// +/// +/// +Object.defineProperty(exports, "__esModule", ({ value: true })); +const typedArrayTypeNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' +]; +function isTypedArrayName(name) { + return typedArrayTypeNames.includes(name); } -exports._setFeatureSupport = _setFeatureSupport; -/** - * Returns true if test mode is enabled (PULUMI_TEST_MODE). - * - * NB: this test mode has nothing to do with preview/dryRun modality, and it is not automatically - * enabled by calling `setMocks`. It is a vestigial mechanism related to testing the runtime itself, - * and is not relevant to writing or running unit tests for a Pulumi project. - */ -function isTestModeEnabled() { - return options().testModeEnabled === true; -} -exports.isTestModeEnabled = isTestModeEnabled; -/** - * Checks that test mode is enabled and, if not, throws an error. - */ -function requireTestModeEnabled() { - if (!isTestModeEnabled()) { - throw new Error("Program run without the Pulumi engine available; re-run using the `pulumi` CLI"); - } -} -/** @internal Used only for testing purposes. */ -function _setQueryMode(val) { - process.env[nodeEnvKeys.queryMode] = val.toString(); -} -exports._setQueryMode = _setQueryMode; -/** - * Returns true if query mode is enabled. - */ -function isQueryMode() { - return options().queryMode === true; +const objectTypeNames = [ + 'Function', + 'Generator', + 'AsyncGenerator', + 'GeneratorFunction', + 'AsyncGeneratorFunction', + 'AsyncFunction', + 'Observable', + 'Array', + 'Buffer', + 'Blob', + 'Object', + 'RegExp', + 'Date', + 'Error', + 'Map', + 'Set', + 'WeakMap', + 'WeakSet', + 'ArrayBuffer', + 'SharedArrayBuffer', + 'DataView', + 'Promise', + 'URL', + 'FormData', + 'URLSearchParams', + 'HTMLElement', + ...typedArrayTypeNames +]; +function isObjectTypeName(name) { + return objectTypeNames.includes(name); } -exports.isQueryMode = isQueryMode; -/** - * Returns true if we will resolve missing outputs to inputs during preview (PULUMI_ENABLE_LEGACY_APPLY). - */ -function isLegacyApplyEnabled() { - return options().legacyApply === true; +const primitiveTypeNames = [ + 'null', + 'undefined', + 'string', + 'number', + 'bigint', + 'boolean', + 'symbol' +]; +function isPrimitiveTypeName(name) { + return primitiveTypeNames.includes(name); } -exports.isLegacyApplyEnabled = isLegacyApplyEnabled; -/** - * Returns true (default) if we will cache serialized dynamic providers on the program side - */ -function cacheDynamicProviders() { - return options().cacheDynamicProviders === true; +// eslint-disable-next-line @typescript-eslint/ban-types +function isOfType(type) { + return (value) => typeof value === type; } -exports.cacheDynamicProviders = cacheDynamicProviders; -/** - * Get the project being run by the current update. - */ -function getProject() { - const project = options().project; - if (project) { - return project; +const { toString } = Object.prototype; +const getObjectType = (value) => { + const objectTypeName = toString.call(value).slice(8, -1); + if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) { + return 'HTMLElement'; } - // If the project is missing, specialize the error. First, if test mode is disabled: - requireTestModeEnabled(); - // And now an error if test mode is enabled, instructing how to manually configure the project: - throw new Error("Missing project name; for test mode, please call `pulumi.runtime.setMocks`"); -} -exports.getProject = getProject; -/** @internal Used only for testing purposes. */ -function _setProject(val) { - process.env[nodeEnvKeys.project] = val; -} -exports._setProject = _setProject; -/** - * Get the stack being targeted by the current update. - */ -function getStack() { - const stack = options().stack; - if (stack) { - return stack; + if (isObjectTypeName(objectTypeName)) { + return objectTypeName; } - // If the stack is missing, specialize the error. First, if test mode is disabled: - requireTestModeEnabled(); - // And now an error if test mode is enabled, instructing how to manually configure the stack: - throw new Error("Missing stack name; for test mode, please set PULUMI_NODEJS_STACK"); -} -exports.getStack = getStack; -/** @internal Used only for testing purposes. */ -function _setStack(val) { - process.env[nodeEnvKeys.stack] = val; -} -exports._setStack = _setStack; -/** - * monitor is a live connection to the resource monitor that tracks deployments (lazily initialized). - */ -let monitor; -let featureSupport = {}; -/** - * hasMonitor returns true if we are currently connected to a resource monitoring service. - */ -function hasMonitor() { - return !!monitor && !!options().monitorAddr; -} -exports.hasMonitor = hasMonitor; -/** - * getMonitor returns the current resource monitoring service client for RPC communications. - */ -function getMonitor() { - // pre-emptive fail fast check for node inline programs - runSxSCheck(); - if (monitor === undefined) { - const addr = options().monitorAddr; - if (addr) { - // Lazily initialize the RPC connection to the monitor. - monitor = new resrpc.ResourceMonitorClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); - } - else { - // If test mode isn't enabled, we can't run the program without an engine. - requireTestModeEnabled(); - } + return undefined; +}; +const isObjectOfType = (type) => (value) => getObjectType(value) === type; +function is(value) { + if (value === null) { + return 'null'; } - return monitor; -} -exports.getMonitor = getMonitor; -let syncInvokes; -/** @internal */ -function tryGetSyncInvokes() { - const syncDir = options().syncDir; - if (syncInvokes === undefined && syncDir) { - const requests = fs.openSync(path.join(syncDir, "invoke_req"), fs.constants.O_WRONLY | fs.constants.O_SYNC); - const responses = fs.openSync(path.join(syncDir, "invoke_res"), fs.constants.O_RDONLY | fs.constants.O_SYNC); - syncInvokes = { requests, responses }; + switch (typeof value) { + case 'undefined': + return 'undefined'; + case 'string': + return 'string'; + case 'number': + return 'number'; + case 'boolean': + return 'boolean'; + case 'function': + return 'Function'; + case 'bigint': + return 'bigint'; + case 'symbol': + return 'symbol'; + default: } - return syncInvokes; -} -exports.tryGetSyncInvokes = tryGetSyncInvokes; -/** - * engine is a live connection to the engine, used for logging, etc. (lazily initialized). - */ -let engine; -/** - * hasEngine returns true if we are currently connected to an engine. - */ -function hasEngine() { - return !!engine && !!options().engineAddr; -} -exports.hasEngine = hasEngine; -/** - * getEngine returns the current engine, if any, for RPC communications back to the resource engine. - */ -function getEngine() { - if (engine === undefined) { - const addr = options().engineAddr; - if (addr) { - // Lazily initialize the RPC connection to the engine. - engine = new engrpc.EngineClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); - } + if (is.observable(value)) { + return 'Observable'; } - return engine; -} -exports.getEngine = getEngine; -function terminateRpcs() { - disconnectSync(); -} -exports.terminateRpcs = terminateRpcs; -/** - * serialize returns true if resource operations should be serialized. - */ -function serialize() { - return options().parallel === 1; -} -exports.serialize = serialize; -/** - * options returns the options from the environment, which is the source of truth. Options are global per process. - * For CLI driven programs, pulumi-language-nodejs sets environment variables prior to the user program loading, - * meaning that options could be loaded up front and cached. - * Automation API and multi-language components introduced more complex lifecycles for runtime options(). - * These language hosts manage the lifecycle of options manually throughout the lifetime of the nodejs process. - * In addition, node module resolution can lead to duplicate copies of @pulumi/pulumi and thus duplicate options - * objects that may not be synced if options are cached upfront. Mutating options must write to the environment - * and reading options must always read directly from the environment. - - */ -function options() { - // pre-emptive fail fast check for node inline programs - runSxSCheck(); - // The only option that needs parsing is the parallelism flag. Ignore any failures. - let parallel; - const parallelOpt = process.env[nodeEnvKeys.parallel]; - if (parallelOpt) { - try { - parallel = parseInt(parallelOpt, 10); - } - catch (err) { - // ignore. - } + if (is.array(value)) { + return 'Array'; } - // Now just hydrate the rest from environment variables. These might be missing, in which case - // we will fail later on when we actually need to create an RPC connection back to the engine. - return { - // node runtime - project: process.env[nodeEnvKeys.project], - stack: process.env[nodeEnvKeys.stack], - dryRun: (process.env[nodeEnvKeys.dryRun] === "true"), - queryMode: (process.env[nodeEnvKeys.queryMode] === "true"), - parallel: parallel, - monitorAddr: process.env[nodeEnvKeys.monitorAddr], - engineAddr: process.env[nodeEnvKeys.engineAddr], - syncDir: process.env[nodeEnvKeys.syncDir], - cacheDynamicProviders: process.env[nodeEnvKeys.cacheDynamicProviders] !== "false", - // pulumi specific - testModeEnabled: (process.env[pulumiEnvKeys.testMode] === "true"), - legacyApply: (process.env[pulumiEnvKeys.legacyApply] === "true"), - }; -} -/** - * disconnect permanently disconnects from the server, closing the connections. It waits for the existing RPC - * queue to drain. If any RPCs come in afterwards, however, they will crash the process. - */ -function disconnect() { - return waitForRPCs(/*disconnectFromServers*/ true); -} -exports.disconnect = disconnect; -/** @internal */ -function waitForRPCs(disconnectFromServers = false) { - let done; - const closeCallback = () => { - if (done !== rpcDone) { - // If the done promise has changed, some activity occurred in between callbacks. Wait again. - done = rpcDone; - return debuggable_1.debuggablePromise(done.then(closeCallback), "disconnect"); - } - if (disconnectFromServers) { - disconnectSync(); - } - return Promise.resolve(); - }; - return closeCallback(); -} -exports.waitForRPCs = waitForRPCs; -/** - * disconnectSync permanently disconnects from the server, closing the connections. Unlike `disconnect`. it does not - * wait for the existing RPC queue to drain. Any RPCs that come in after this call will crash the process. - */ -function disconnectSync() { - // Otherwise, actually perform the close activities (ignoring errors and crashes). - if (monitor) { - try { - monitor.close(); - } - catch (err) { - // ignore. - } - monitor = null; + if (is.buffer(value)) { + return 'Buffer'; } - if (engine) { - try { - engine.close(); - } - catch (err) { - // ignore. - } - engine = null; + const tagType = getObjectType(value); + if (tagType) { + return tagType; } + if (value instanceof String || value instanceof Boolean || value instanceof Number) { + throw new TypeError('Please don\'t use object wrappers for primitive types'); + } + return 'Object'; } -exports.disconnectSync = disconnectSync; -/** - * rpcDone resolves when the last known client-side RPC call finishes. - */ -let rpcDone = Promise.resolve(); -/** - * rpcKeepAlive registers a pending call to ensure that we don't prematurely disconnect from the server. It returns - * a function that, when invoked, signals that the RPC has completed. - */ -function rpcKeepAlive() { - let done = undefined; - const donePromise = debuggable_1.debuggablePromise(new Promise(resolve => done = resolve), "rpcKeepAlive"); - rpcDone = rpcDone.then(() => donePromise); - return done; -} -exports.rpcKeepAlive = rpcKeepAlive; -/** - * setRootResource registers a resource that will become the default parent for all resources without explicit parents. - */ -function setRootResource(res) { - return __awaiter(this, void 0, void 0, function* () { - const engineRef = getEngine(); - if (!engineRef) { - return Promise.resolve(); - } - // Back-compat case - Try to set the root URN for SxS old SDKs that expect the engine to roundtrip the - // stack URN. - const req = new engproto.SetRootResourceRequest(); - const urn = yield res.urn.promise(); - req.setUrn(urn); - return new Promise((resolve, reject) => { - engineRef.setRootResource(req, (err, resp) => { - // Back-compat case - if the engine we're speaking to isn't aware that it can save and load root - // resources, just ignore there's nothing we can do. - if (err && err.code === grpc.status.UNIMPLEMENTED) { - return resolve(); - } - if (err) { - return reject(err); - } - return resolve(); - }); - }); - }); -} -exports.setRootResource = setRootResource; -/** - * monitorSupportsFeature returns a promise that when resolved tells you if the resource monitor we are connected - * to is able to support a particular feature. - */ -function monitorSupportsFeature(feature) { - return __awaiter(this, void 0, void 0, function* () { - const monitorRef = getMonitor(); - if (!monitorRef) { - // If there's no monitor and test mode is disabled, just return false. Otherwise, return whatever is present in - // the featureSupport map. - return isTestModeEnabled() && featureSupport[feature]; - } - if (featureSupport[feature] === undefined) { - const req = new resproto.SupportsFeatureRequest(); - req.setId(feature); - const result = yield new Promise((resolve, reject) => { - monitorRef.supportsFeature(req, (err, resp) => { - // Back-compat case - if the monitor doesn't let us ask if it supports a feature, it doesn't support - // secrets. - if (err && err.code === grpc.status.UNIMPLEMENTED) { - return resolve(false); - } - if (err) { - return reject(err); - } - return resolve(resp.getHassupport()); - }); - }); - featureSupport[feature] = result; - } - return featureSupport[feature]; - }); -} -exports.monitorSupportsFeature = monitorSupportsFeature; -/** - * monitorSupportsSecrets returns a promise that when resolved tells you if the resource monitor we are connected - * to is able to support secrets across its RPC interface. When it does, we marshal outputs marked with the secret - * bit in a special way. - */ -function monitorSupportsSecrets() { - return monitorSupportsFeature("secrets"); -} -exports.monitorSupportsSecrets = monitorSupportsSecrets; -/** - * monitorSupportsResourceReferences returns a promise that when resolved tells you if the resource monitor we are - * connected to is able to support resource references across its RPC interface. When it does, we marshal resources - * in a special way. - */ -function monitorSupportsResourceReferences() { - return __awaiter(this, void 0, void 0, function* () { - return monitorSupportsFeature("resourceReferences"); - }); -} -exports.monitorSupportsResourceReferences = monitorSupportsResourceReferences; -/** - * monitorSupportsOutputValues returns a promise that when resolved tells you if the resource monitor we are - * connected to is able to support output values across its RPC interface. When it does, we marshal outputs - * in a special way. - */ -function monitorSupportsOutputValues() { - return __awaiter(this, void 0, void 0, function* () { - return monitorSupportsFeature("outputValues"); - }); -} -exports.monitorSupportsOutputValues = monitorSupportsOutputValues; -// sxsRandomIdentifier is a module level global that is transfered to process.env. -// the goal is to detect side by side (sxs) pulumi/pulumi situations for inline programs -// and fail fast. See https://github.com/pulumi/pulumi/issues/7333 for details. -const sxsRandomIdentifier = Math.random().toString(); -// indicates that the current runtime context is via an inline program via automation api. -let isInline = false; -/** @internal only used by the internal inline language host implementation */ -function setInline() { - isInline = true; -} -exports.setInline = setInline; -const pulumiSxSEnv = "PULUMI_NODEJS_SXS_FLAG"; -/** - * runSxSCheck checks an identifier stored in the environment to detect multiple versions of pulumi. - * if we're running in inline mode, it will throw an error to fail fast due to global state collisions that can occur. - */ -function runSxSCheck() { - const envSxS = process.env[pulumiSxSEnv]; - process.env[pulumiSxSEnv] = sxsRandomIdentifier; - if (!isInline) { - return; +is.undefined = isOfType('undefined'); +is.string = isOfType('string'); +const isNumberType = isOfType('number'); +is.number = (value) => isNumberType(value) && !is.nan(value); +is.bigint = isOfType('bigint'); +// eslint-disable-next-line @typescript-eslint/ban-types +is.function_ = isOfType('function'); +is.null_ = (value) => value === null; +is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); +is.boolean = (value) => value === true || value === false; +is.symbol = isOfType('symbol'); +is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value)); +is.array = (value, assertion) => { + if (!Array.isArray(value)) { + return false; } - // if we see a different identifier, another version of pulumi has been loaded and we should fail. - if (!!envSxS && envSxS !== sxsRandomIdentifier) { - throw new Error("Detected multiple versions of '@pulumi/pulumi' in use in an inline automation api program.\n" + - "Use the yarn 'resolutions' field to pin to a single version: https://github.com/pulumi/pulumi/issues/5449."); + if (!is.function_(assertion)) { + return true; } -} -//# sourceMappingURL=settings.js.map - -/***/ }), - -/***/ 26664: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return value.every(assertion); }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const asset = __nccwpck_require__(83031); -const metadata_1 = __nccwpck_require__(8085); -const output_1 = __nccwpck_require__(43037); -const resource_1 = __nccwpck_require__(90796); -const settings_1 = __nccwpck_require__(34530); -/** - * rootPulumiStackTypeName is the type name that should be used to construct the root component in the tree of Pulumi - * resources allocated by a deployment. This must be kept up to date with - * `github.com/pulumi/pulumi/sdk/v3/go/common/resource/stack.RootStackType`. - */ -exports.rootPulumiStackTypeName = "pulumi:pulumi:Stack"; -// Get the root stack resource for the current stack deployment -function getStackResource() { - return globalThis.stackResource; -} -exports.getStackResource = getStackResource; -/** - * runInPulumiStack creates a new Pulumi stack resource and executes the callback inside of it. Any outputs - * returned by the callback will be stored as output properties on this resulting Stack object. - */ -function runInPulumiStack(init) { - if (!settings_1.isQueryMode()) { - const stack = new Stack(init); - return stack.outputs.promise(); - } - else { - return init(); - } -} -exports.runInPulumiStack = runInPulumiStack; -/** - * Stack is the root resource for a Pulumi stack. Before invoking the `init` callback, it registers itself as the root - * resource with the Pulumi engine. - */ -class Stack extends resource_1.ComponentResource { - constructor(init) { - // Clear the stackResource so that when the Resource constructor runs it gives us no parent, we'll - // then set this to ourselves in init before calling the user code that will then create other - // resources. - globalThis.stackResource = undefined; - super(exports.rootPulumiStackTypeName, `${metadata_1.getProject()}-${metadata_1.getStack()}`, { init }); - const data = this.getData(); - this.outputs = output_1.output(data); - } - /** - * runInit invokes the given init callback with this resource set as the root resource. The return value of init is - * used as the stack's output properties. - * - * @param init The callback to run in the context of this Pulumi stack - */ - initialize(args) { - const _super = Object.create(null, { - registerOutputs: { get: () => super.registerOutputs } - }); - return __awaiter(this, void 0, void 0, function* () { - yield settings_1.setRootResource(this); - // Set the global reference to the stack resource before invoking this init() function - globalThis.stackResource = this; - let outputs; - try { - const inputs = yield args.init(); - outputs = yield massage(inputs, []); - } - finally { - // We want to expose stack outputs as simple pojo objects (including Resources). This - // helps ensure that outputs can point to resources, and that that is stored and - // presented as something reasonable, and not as just an id/urn in the case of - // Resources. - _super.registerOutputs.call(this, outputs); - } - return outputs; - }); - } -} -function massage(prop, objectStack) { - return __awaiter(this, void 0, void 0, function* () { - if (prop === undefined || - prop === null || - typeof prop === "boolean" || - typeof prop === "number" || - typeof prop === "string") { - return prop; - } - if (prop instanceof Promise) { - return yield massage(yield prop, objectStack); - } - if (output_1.Output.isInstance(prop)) { - const result = prop.apply(v => massage(v, objectStack)); - // explicitly await the underlying promise of the output here. This is necessary to get a - // deterministic walk of the object graph. We need that deterministic walk, otherwise our - // actual cycle detection logic (using 'objectStack') doesn't work. i.e. if we don't do - // this then the main walking logic will be interleaved with the async function this output - // is executing. This interleaving breaks out assumption about pushing/popping values onto - // objectStack' - yield result.promise(); - return result; - } - // from this point on, we have complex objects. If we see them again, we don't want to emit - // them again fully or else we'd loop infinitely. - if (objectStack.indexOf(prop) >= 0) { - // Note: for Resources we hit again, emit their urn so cycles can be easily understood - // in the pojo objects. - if (resource_1.Resource.isInstance(prop)) { - return yield massage(prop.urn, objectStack); - } - return undefined; - } - try { - // push and pop what we see into a stack. That way if we see the same object through - // different paths, we will still print it out. We only skip it if it would truly cause - // recursion. - objectStack.push(prop); - return yield massageComplex(prop, objectStack); - } - finally { - const popped = objectStack.pop(); - if (popped !== prop) { - throw new Error("Invariant broken when processing stack outputs"); - } - } - }); -} -function massageComplex(prop, objectStack) { - return __awaiter(this, void 0, void 0, function* () { - if (asset.Asset.isInstance(prop)) { - if (prop.path !== undefined) { - return { path: prop.path }; - } - else if (prop.uri !== undefined) { - return { uri: prop.uri }; - } - else if (prop.text !== undefined) { - return { text: "..." }; - } - return undefined; - } - if (asset.Archive.isInstance(prop)) { - if (prop.assets) { - return { assets: yield massage(prop.assets, objectStack) }; - } - else if (prop.path !== undefined) { - return { path: prop.path }; - } - else if (prop.uri !== undefined) { - return { uri: prop.uri }; - } - return undefined; - } - if (resource_1.Resource.isInstance(prop)) { - // Emit a resource as a normal pojo. But filter out all our internal properties so that - // they don't clutter the display/checkpoint with values not relevant to the application. - // - // In preview only, we mark the POJO with "@isPulumiResource" to indicate that it is derived - // from a resource. This allows the engine to perform resource-specific filtering of unknowns - // from output diffs during a preview. This filtering is not necessary during an update because - // all property values are known. - const pojo = yield serializeAllKeys(n => !n.startsWith("__")); - return !settings_1.isDryRun() ? pojo : Object.assign(Object.assign({}, pojo), { "@isPulumiResource": true }); - } - if (prop instanceof Array) { - const result = []; - for (let i = 0; i < prop.length; i++) { - result[i] = yield massage(prop[i], objectStack); - } - return result; - } - return yield serializeAllKeys(n => true); - function serializeAllKeys(include) { - return __awaiter(this, void 0, void 0, function* () { - const obj = {}; - for (const k of Object.keys(prop)) { - if (include(k)) { - obj[k] = yield massage(prop[k], objectStack); - } - } - return obj; - }); - } - }); -} -/** - * Add a transformation to all future resources constructed in this Pulumi stack. - */ -function registerStackTransformation(t) { - if (!globalThis.stackResource) { - throw new Error("The root stack resource was referenced before it was initialized."); - } - globalThis.stackResource.__transformations = [...(globalThis.stackResource.__transformations || []), t]; -} -exports.registerStackTransformation = registerStackTransformation; -//# sourceMappingURL=stack.js.map - -/***/ }), - -/***/ 74919: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); +is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; }; +is.blob = (value) => isObjectOfType('Blob')(value); +is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); +is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value)); +is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); }; +is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); }; +is.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); }; +is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw); +is.nativePromise = (value) => isObjectOfType('Promise')(value); +const hasPromiseAPI = (value) => { + var _a, _b; + return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) && + is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch); }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const output_1 = __nccwpck_require__(43037); -const resource_1 = __nccwpck_require__(90796); -/** - * Manages a reference to a Pulumi stack. The referenced stack's outputs are available via the - * `outputs` property or the `output` method. - */ -class StackReference extends resource_1.CustomResource { - /** - * Create a StackReference resource with the given unique name, arguments, and options. - * - * If args is not specified, the name of the referenced stack will be the name of the StackReference resource. - * - * @param name The _unique_ name of the stack reference. - * @param args The arguments to use to populate this resource's properties. - * @Param opts A bag of options that control this resource's behavior. - */ - constructor(name, args, opts) { - args = args || {}; - const stackReferenceName = args.name || name; - super("pulumi:pulumi:StackReference", name, { - name: stackReferenceName, - outputs: undefined, - secretOutputNames: undefined, - }, Object.assign(Object.assign({}, opts), { id: stackReferenceName })); +is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); +is.generatorFunction = isObjectOfType('GeneratorFunction'); +is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction'; +is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction'; +// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types +is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); +is.regExp = isObjectOfType('RegExp'); +is.date = isObjectOfType('Date'); +is.error = isObjectOfType('Error'); +is.map = (value) => isObjectOfType('Map')(value); +is.set = (value) => isObjectOfType('Set')(value); +is.weakMap = (value) => isObjectOfType('WeakMap')(value); +is.weakSet = (value) => isObjectOfType('WeakSet')(value); +is.int8Array = isObjectOfType('Int8Array'); +is.uint8Array = isObjectOfType('Uint8Array'); +is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray'); +is.int16Array = isObjectOfType('Int16Array'); +is.uint16Array = isObjectOfType('Uint16Array'); +is.int32Array = isObjectOfType('Int32Array'); +is.uint32Array = isObjectOfType('Uint32Array'); +is.float32Array = isObjectOfType('Float32Array'); +is.float64Array = isObjectOfType('Float64Array'); +is.bigInt64Array = isObjectOfType('BigInt64Array'); +is.bigUint64Array = isObjectOfType('BigUint64Array'); +is.arrayBuffer = isObjectOfType('ArrayBuffer'); +is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer'); +is.dataView = isObjectOfType('DataView'); +is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value); +is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype; +is.urlInstance = (value) => isObjectOfType('URL')(value); +is.urlString = (value) => { + if (!is.string(value)) { + return false; } - /** - * Fetches the value of the named stack output, or undefined if the stack output was not found. - * - * @param name The name of the stack output to fetch. - */ - getOutput(name) { - // Note that this is subtly different from "apply" here. A default "apply" will set the secret bit if any - // of the inputs are a secret, and this.outputs is always a secret if it contains any secrets. We do this dance - // so we can ensure that the Output we return is not needlessly tainted as a secret. - const value = output_1.all([output_1.output(name), this.outputs]).apply(([n, os]) => os[n]); - // 'value' is an Output produced by our own `.apply` implementation. So it's safe to - // `.allResources!` on it. - return new output_1.Output(value.resources(), value.promise(), value.isKnown, isSecretOutputName(this, output_1.output(name)), value.allResources()); + try { + new URL(value); // eslint-disable-line no-new + return true; } - /** - * Fetches the value of the named stack output, or throws an error if the output was not found. - * - * @param name The name of the stack output to fetch. - */ - requireOutput(name) { - const value = output_1.all([output_1.output(this.name), output_1.output(name), this.outputs]).apply(([stackname, n, os]) => { - if (!os.hasOwnProperty(n)) { - throw new Error(`Required output '${n}' does not exist on stack '${stackname}'.`); - } - return os[n]; - }); - return new output_1.Output(value.resources(), value.promise(), value.isKnown, isSecretOutputName(this, output_1.output(name)), value.allResources()); + catch (_a) { + return false; } - /** - * Fetches the value promptly of the named stack output. May return undefined if the value is - * not known for some reason. - * - * This operation is not supported (and will throw) if the named stack output is a secret. - * - * @param name The name of the stack output to fetch. - */ - getOutputValue(name) { - return __awaiter(this, void 0, void 0, function* () { - const [out, isSecret] = yield this.readOutputValue("getOutputValue", name, false /*required*/); - if (isSecret) { - throw new Error("Cannot call 'getOutputValue' if the referenced stack output is a secret. Use 'getOutput' instead."); - } - return out; - }); +}; +// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` +is.truthy = (value) => Boolean(value); +// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` +is.falsy = (value) => !value; +is.nan = (value) => Number.isNaN(value); +is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value); +is.integer = (value) => Number.isInteger(value); +is.safeInteger = (value) => Number.isSafeInteger(value); +is.plainObject = (value) => { + // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js + if (toString.call(value) !== '[object Object]') { + return false; } - /** - * Fetches the value promptly of the named stack output. Throws an error if the stack output is - * not found. - * - * This operation is not supported (and will throw) if the named stack output is a secret. - * - * @param name The name of the stack output to fetch. - */ - requireOutputValue(name) { - return __awaiter(this, void 0, void 0, function* () { - const [out, isSecret] = yield this.readOutputValue("requireOutputSync", name, true /*required*/); - if (isSecret) { - throw new Error("Cannot call 'requireOutputValue' if the referenced stack output is a secret. Use 'requireOutput' instead."); - } - return out; - }); + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.getPrototypeOf({}); +}; +is.typedArray = (value) => isTypedArrayName(getObjectType(value)); +const isValidLength = (value) => is.safeInteger(value) && value >= 0; +is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); +is.inRange = (value, range) => { + if (is.number(range)) { + return value >= Math.min(0, range) && value <= Math.max(range, 0); } - readOutputValue(callerName, outputName, required) { - return __awaiter(this, void 0, void 0, function* () { - const out = required ? this.requireOutput(outputName) : this.getOutput(outputName); - return Promise.all([out.promise(), out.isSecret]); - }); + if (is.array(range) && range.length === 2) { + return value >= Math.min(...range) && value <= Math.max(...range); } -} -exports.StackReference = StackReference; -function isSecretOutputName(sr, name) { - return __awaiter(this, void 0, void 0, function* () { - const nameOutput = output_1.output(name); - // If either the name or set of secret outputs is unknown, we can't do anything smart, so we just copy the - // secretness from the entire outputs value. - if (!((yield nameOutput.isKnown) && (yield sr.secretOutputNames.isKnown))) { - return yield sr.outputs.isSecret; - } - // Otherwise, if we have a list of outputs we know are secret, we can use that list to determine if this - // output should be secret. Names could be falsy here in cases where we are using an older CLI that did - // not return this information (in this case we again fallback to the secretness of outputs value). - const names = yield sr.secretOutputNames.promise(); - if (!names) { - return yield sr.outputs.isSecret; - } - return names.includes(yield nameOutput.promise()); - }); -} -//# sourceMappingURL=stackReference.js.map - -/***/ }), - -/***/ 21888: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// Copyright 2016-2018, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var _a; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Common code for doing RTTI typechecks. RTTI is done by having a boolean property on an object - * with a special name (like "__resource" or "__asset"). This function checks that the object - * exists, has a **boolean** property with that name, and that that boolean property has the value - * of 'true'. Checking that property is 'boolean' helps ensure that this test works even on proxies - * that synthesize properties dynamically (like Output). Checking that the property has the 'true' - * value isn't strictly necessary, but works to make sure that the impls are following a common - * pattern. - * - * @internal - */ -function isInstance(obj, name) { - return hasTrueBooleanMember(obj, name); -} -exports.isInstance = isInstance; -/** @internal */ -function hasTrueBooleanMember(obj, memberName) { - if (obj === undefined || obj === null) { + throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); +}; +const NODE_TYPE_ELEMENT = 1; +const DOM_PROPERTIES_TO_CHECK = [ + 'innerHTML', + 'ownerDocument', + 'style', + 'attributes', + 'nodeValue' +]; +is.domElement = (value) => { + return is.object(value) && + value.nodeType === NODE_TYPE_ELEMENT && + is.string(value.nodeName) && + !is.plainObject(value) && + DOM_PROPERTIES_TO_CHECK.every(property => property in value); +}; +is.observable = (value) => { + var _a, _b, _c, _d; + if (!value) { return false; } - const val = obj[memberName]; - if (typeof val !== "boolean") { - return false; + // eslint-disable-next-line no-use-extend-native/no-use-extend-native + if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) { + return true; } - return val === true; -} -exports.hasTrueBooleanMember = hasTrueBooleanMember; -// Workaround errors we sometimes get on some machines saying that Object.values is not available. -/** @internal */ -function values(obj) { - const result = []; - for (const key of Object.keys(obj)) { - result.push(obj[key]); + if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) { + return true; } - return result; -} -exports.values = values; -/** @internal */ -function union(set1, set2) { - return new Set([...set1, ...set2]); -} -exports.union = union; -/** @internal */ -exports.disableResourceReferences = process.env.PULUMI_DISABLE_RESOURCE_REFERENCES === "1" || - (_a = process.env.PULUMI_DISABLE_RESOURCE_REFERENCES, (_a !== null && _a !== void 0 ? _a : "")).toUpperCase() === "TRUE"; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 75907: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return false; }; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value); +is.infinite = (value) => value === Infinity || value === -Infinity; +const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder; +is.evenInteger = isAbsoluteMod2(0); +is.oddInteger = isAbsoluteMod2(1); +is.emptyArray = (value) => is.array(value) && value.length === 0; +is.nonEmptyArray = (value) => is.array(value) && value.length > 0; +is.emptyString = (value) => is.string(value) && value.length === 0; +const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value); +is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); +// TODO: Use `not ''` when the `not` operator is available. +is.nonEmptyString = (value) => is.string(value) && value.length > 0; +// TODO: Use `not ''` when the `not` operator is available. +is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value); +is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; +// TODO: Use `not` operator here to remove `Map` and `Set` from type guard: +// - https://github.com/Microsoft/TypeScript/pull/29317 +is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; +is.emptySet = (value) => is.set(value) && value.size === 0; +is.nonEmptySet = (value) => is.set(value) && value.size > 0; +is.emptyMap = (value) => is.map(value) && value.size === 0; +is.nonEmptyMap = (value) => is.map(value) && value.size > 0; +// `PropertyKey` is any value that can be used as an object key (string, number, or symbol) +is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value); +is.formData = (value) => isObjectOfType('FormData')(value); +is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value); +const predicateOnArray = (method, predicate, values) => { + if (!is.function_(predicate)) { + throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); + } + if (values.length === 0) { + throw new TypeError('Invalid number of values'); + } + return method.call(values, predicate); }; -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +is.any = (predicate, ...values) => { + const predicates = is.array(predicate) ? predicate : [predicate]; + return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values)); }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const base_1 = __nccwpck_require__(44139); -const operators_1 = __nccwpck_require__(20327); -const sources_1 = __nccwpck_require__(48396); -class AsyncQueryableImpl extends base_1.IterableBase { - constructor(source) { - super(source); +is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); +const assertType = (condition, description, value, options = {}) => { + if (!condition) { + const { multipleValues } = options; + const valuesMessage = multipleValues ? + `received values of types ${[ + ...new Set(value.map(singleValue => `\`${is(singleValue)}\``)) + ].join(', ')}` : + `received value of type \`${is(value)}\``; + throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`); } - // - // Constructors. - // - static from(source) { - return new AsyncQueryableImpl(sources_1.from(source)); - } - // - // Restriction operators. - // - filter(f) { - return this.pipe(operators_1.filter(f)); - } - // - // Projection operators. - // - flatMap(selector, resultSelector = (t, ti) => ti) { - return this.pipe(operators_1.flatMap(selector, resultSelector)); - } - map(f) { - return this.pipe(operators_1.map(f)); - } - // - // Partitioning operators. - // - skip(n) { - return this.pipe(operators_1.skip(n)); - } - skipWhile(predicate) { - return this.pipe(operators_1.skipWhile(predicate)); - } - take(n) { - return this.pipe(operators_1.take(n)); - } - takeWhile(predicate) { - return this.pipe(operators_1.takeWhile(predicate)); - } - // - // Join operators. - // - join(inner, outerKeySelector, innerKeySelector, resultSelector) { - return this.pipe(operators_1.join(sources_1.from(inner), outerKeySelector, innerKeySelector, resultSelector)); - } - groupJoin(inner, outerKeySelector, innerKeySelector, resultSelector) { - return this.pipe(operators_1.groupJoin(sources_1.from(inner), outerKeySelector, innerKeySelector, resultSelector)); - } - // - // Concatenation operators. - // - concat(iter) { - return this.pipe(operators_1.concat(sources_1.from(iter))); - } - // - // Ordering operators. - // - reverse() { - return this.pipe(operators_1.reverse()); - } - orderBy(keySelector) { - return this.pipe(operators_1.orderBy(keySelector)); - } - orderByDescending(keySelector) { - return this.pipe(operators_1.orderByDescending(keySelector)); - } - // - // Grouping operators. - // - groupBy(keySelector, elementSelector) { - return this.pipe(function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_1, _a; - const groups = yield __await(operators_1.groupBy(keySelector, elementSelector)(source)); - try { - for (var groups_1 = __asyncValues(groups), groups_1_1; groups_1_1 = yield __await(groups_1.next()), !groups_1_1.done;) { - const group = groups_1_1.value; - yield yield __await(new GroupingImpl(group.key, sources_1.from(group))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) yield __await(_a.call(groups_1)); - } - finally { if (e_1) throw e_1.error; } - } - }); - }); - } - // - // Set operators. - // - distinct() { - return this.pipe(operators_1.distinct()); - } - union(second) { - return this.pipe(operators_1.union(sources_1.from(second))); - } - intersect(second) { - return this.pipe(operators_1.intersect(sources_1.from(second))); - } - except(second) { - return this.pipe(operators_1.except(sources_1.from(second))); - } - // - // Element operators. - // - first(predicate) { - return operators_1.first(predicate)(this); - } - firstOrDefault(defaultValue, predicate) { - return operators_1.firstOrDefault(defaultValue, predicate)(this); - } - last(predicate) { - return operators_1.last(predicate)(this); - } - lastOrDefault(defaultValue, predicate) { - return operators_1.lastOrDefault(defaultValue, predicate)(this); - } - single(predicate) { - return operators_1.single(predicate)(this); - } - singleOrDefault(defaultValue, predicate) { - return operators_1.singleOrDefault(defaultValue, predicate)(this); - } - elementAt(index) { - return operators_1.elementAt(index)(this); - } - elementAtOrDefault(defaultValue, index) { - return operators_1.elementAtOrDefault(defaultValue, index)(this); - } - defaultIfEmpty(defaultValue) { - return this.pipe(operators_1.defaultIfEmpty(defaultValue)); - } - // - // Quantifiers. - // - any(predicate) { - return operators_1.any(predicate)(this); - } - all(predicate) { - return operators_1.all(predicate)(this); - } - contains(value) { - return operators_1.contains(value)(this); - } - // - // Aggregate operators. - // - count(predicate) { - return operators_1.count(predicate)(this); - } - sum(selector) { - return operators_1.sum(selector)(this); - } - min(selector) { - return operators_1.min(selector)(this); - } - max(selector) { - return operators_1.max(selector)(this); - } - average(selector) { - return operators_1.average(selector)(this); - } - aggregate(seed, func) { - return operators_1.aggregate(seed, func)(this); - } - // - // Eval operators. - // - toArray() { - return __awaiter(this, void 0, void 0, function* () { - return operators_1.toArray()(this); - }); - } - toMap(keySelector, elementSelector) { - return operators_1.toMap(keySelector, elementSelector)(this); - } - ofType(typeGuard) { - return this.pipe(operators_1.ofType(typeGuard)); - } - forEach(f) { - var e_2, _a; - return __awaiter(this, void 0, void 0, function* () { - try { - for (var _b = __asyncValues(this), _c; _c = yield _b.next(), !_c.done;) { - const t = _c.value; - f(t); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } - finally { if (e_2) throw e_2.error; } - } - }); - } - pipe(...ops) { - return new AsyncQueryableImpl((function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_3, _a; - let newSource = source; - for (const op of ops) { - newSource = op(newSource); - } - try { - for (var newSource_1 = __asyncValues(newSource), newSource_1_1; newSource_1_1 = yield __await(newSource_1.next()), !newSource_1_1.done;) { - const t = newSource_1_1.value; - yield yield __await(t); - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (newSource_1_1 && !newSource_1_1.done && (_a = newSource_1.return)) yield __await(_a.call(newSource_1)); - } - finally { if (e_3) throw e_3.error; } - } - }); - })(this)); +}; +exports.assert = { + // Unknowns. + undefined: (value) => assertType(is.undefined(value), 'undefined', value), + string: (value) => assertType(is.string(value), 'string', value), + number: (value) => assertType(is.number(value), 'number', value), + bigint: (value) => assertType(is.bigint(value), 'bigint', value), + // eslint-disable-next-line @typescript-eslint/ban-types + function_: (value) => assertType(is.function_(value), 'Function', value), + null_: (value) => assertType(is.null_(value), 'null', value), + class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value), + boolean: (value) => assertType(is.boolean(value), 'boolean', value), + symbol: (value) => assertType(is.symbol(value), 'symbol', value), + numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value), + array: (value, assertion) => { + const assert = assertType; + assert(is.array(value), 'Array', value); + if (assertion) { + value.forEach(assertion); + } + }, + buffer: (value) => assertType(is.buffer(value), 'Buffer', value), + blob: (value) => assertType(is.blob(value), 'Blob', value), + nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value), + object: (value) => assertType(is.object(value), 'Object', value), + iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value), + asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value), + generator: (value) => assertType(is.generator(value), 'Generator', value), + asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value), + nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value), + promise: (value) => assertType(is.promise(value), 'Promise', value), + generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value), + asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value), + // eslint-disable-next-line @typescript-eslint/ban-types + asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value), + // eslint-disable-next-line @typescript-eslint/ban-types + boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value), + regExp: (value) => assertType(is.regExp(value), 'RegExp', value), + date: (value) => assertType(is.date(value), 'Date', value), + error: (value) => assertType(is.error(value), 'Error', value), + map: (value) => assertType(is.map(value), 'Map', value), + set: (value) => assertType(is.set(value), 'Set', value), + weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value), + weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value), + int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value), + uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value), + uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value), + int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value), + uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value), + int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value), + uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value), + float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value), + float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value), + bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value), + bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value), + arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value), + sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value), + dataView: (value) => assertType(is.dataView(value), 'DataView', value), + enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value), + urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value), + urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value), + truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value), + falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value), + nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value), + primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value), + integer: (value) => assertType(is.integer(value), "integer" /* integer */, value), + safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value), + plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value), + typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value), + arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value), + domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value), + observable: (value) => assertType(is.observable(value), 'Observable', value), + nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value), + infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value), + emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value), + nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value), + emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value), + emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value), + nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value), + nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace" /* nonEmptyStringAndNotWhitespace */, value), + emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value), + nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value), + emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value), + nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value), + emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value), + nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value), + propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value), + formData: (value) => assertType(is.formData(value), 'FormData', value), + urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value), + // Numbers. + evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value), + oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value), + // Two arguments. + directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance), + inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value), + // Variadic functions. + any: (predicate, ...values) => { + return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true }); + }, + all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true }) +}; +// Some few keywords are reserved, but we'll populate them for Node.js users +// See https://github.com/Microsoft/TypeScript/issues/2536 +Object.defineProperties(is, { + class: { + value: is.class_ + }, + function: { + value: is.function_ + }, + null: { + value: is.null_ } -} -exports.AsyncQueryableImpl = AsyncQueryableImpl; -class GroupingImpl extends AsyncQueryableImpl { - constructor(key, group) { - super(group); - this.key = key; +}); +Object.defineProperties(exports.assert, { + class: { + value: exports.assert.class_ + }, + function: { + value: exports.assert.function_ + }, + null: { + value: exports.assert.null_ } -} -exports.GroupingImpl = GroupingImpl; +}); +exports["default"] = is; +// For CommonJS default export support +module.exports = is; +module.exports["default"] = is; +module.exports.assert = exports.assert; /***/ }), -/***/ 44139: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8097: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -class IterableBase { - constructor(core) { - this.core = core; +const defer_to_connect_1 = __nccwpck_require__(6214); +const util_1 = __nccwpck_require__(3837); +const nodejsMajorVersion = Number(process.versions.node.split('.')[0]); +const timer = (request) => { + if (request.timings) { + return request.timings; } - [Symbol.asyncIterator]() { - return this; + const timings = { + start: Date.now(), + socket: undefined, + lookup: undefined, + connect: undefined, + secureConnect: undefined, + upload: undefined, + response: undefined, + end: undefined, + error: undefined, + abort: undefined, + phases: { + wait: undefined, + dns: undefined, + tcp: undefined, + tls: undefined, + request: undefined, + firstByte: undefined, + download: undefined, + total: undefined + } + }; + request.timings = timings; + const handleError = (origin) => { + const emit = origin.emit.bind(origin); + origin.emit = (event, ...args) => { + // Catches the `error` event + if (event === 'error') { + timings.error = Date.now(); + timings.phases.total = timings.error - timings.start; + origin.emit = emit; + } + // Saves the original behavior + return emit(event, ...args); + }; + }; + handleError(request); + const onAbort = () => { + timings.abort = Date.now(); + // Let the `end` response event be responsible for setting the total phase, + // unless the Node.js major version is >= 13. + if (!timings.response || nodejsMajorVersion >= 13) { + timings.phases.total = Date.now() - timings.start; + } + }; + request.prependOnceListener('abort', onAbort); + const onSocket = (socket) => { + timings.socket = Date.now(); + timings.phases.wait = timings.socket - timings.start; + if (util_1.types.isProxy(socket)) { + return; + } + const lookupListener = () => { + timings.lookup = Date.now(); + timings.phases.dns = timings.lookup - timings.socket; + }; + socket.prependOnceListener('lookup', lookupListener); + defer_to_connect_1.default(socket, { + connect: () => { + timings.connect = Date.now(); + if (timings.lookup === undefined) { + socket.removeListener('lookup', lookupListener); + timings.lookup = timings.connect; + timings.phases.dns = timings.lookup - timings.socket; + } + timings.phases.tcp = timings.connect - timings.lookup; + // This callback is called before flushing any data, + // so we don't need to set `timings.phases.request` here. + }, + secureConnect: () => { + timings.secureConnect = Date.now(); + timings.phases.tls = timings.secureConnect - timings.connect; + } + }); + }; + if (request.socket) { + onSocket(request.socket); } - next(value) { - return this.core.next(value); + else { + request.prependOnceListener('socket', onSocket); } -} -exports.IterableBase = IterableBase; -class GroupedAsyncIterableIteratorImpl extends IterableBase { - constructor(key, core) { - super(core); - this.key = key; + const onUpload = () => { + var _a; + timings.upload = Date.now(); + timings.phases.request = timings.upload - ((_a = timings.secureConnect) !== null && _a !== void 0 ? _a : timings.connect); + }; + const writableFinished = () => { + if (typeof request.writableFinished === 'boolean') { + return request.writableFinished; + } + // Node.js doesn't have `request.writableFinished` property + return request.finished && request.outputSize === 0 && (!request.socket || request.socket.writableLength === 0); + }; + if (writableFinished()) { + onUpload(); } -} -exports.GroupedAsyncIterableIteratorImpl = GroupedAsyncIterableIteratorImpl; + else { + request.prependOnceListener('finish', onUpload); + } + request.prependOnceListener('response', (response) => { + timings.response = Date.now(); + timings.phases.firstByte = timings.response - timings.upload; + response.timings = timings; + handleError(response); + response.prependOnceListener('end', () => { + timings.end = Date.now(); + timings.phases.download = timings.end - timings.response; + timings.phases.total = timings.end - timings.start; + }); + response.prependOnceListener('aborted', onAbort); + }); + return timings; +}; +exports["default"] = timer; +// For CommonJS default export support +module.exports = timer; +module.exports["default"] = timer; /***/ }), -/***/ 39160: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 3682: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var register = __nccwpck_require__(4670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -// -// NOTE: We choose to be purposefully conservative about what details are exposed through these -// interfaces in case we decide to change the implementation drastically later. -// -// -// Polyfill the async iterator per the "caveats" section of the feature release notes: -// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#the-for-await-of-statement -// -if (typeof Symbol.asyncIterator === "undefined") { - Symbol.asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"); +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind +var bindable = bind.bind(bind) + +function bindApi (hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) + hook.api = { remove: removeHookRef } + hook.remove = removeHookRef + + ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind] + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) + }) } -const asyncQueryable_1 = __nccwpck_require__(75907); -const sources = __nccwpck_require__(48396); -/** - * Creates an `AsyncQueryable` from things that look `Iterable` or `AsyncIterable`, even if they're - * wrapped in a `Promise`. - * @param source Object to convert into an `AsyncQueryable`. - */ -function from(source) { - return asyncQueryable_1.AsyncQueryableImpl.from(source); + +function HookSingular () { + var singularHookName = 'h' + var singularHookState = { + registry: {} + } + var singularHook = register.bind(null, singularHookState, singularHookName) + bindApi(singularHook, singularHookState, singularHookName) + return singularHook } -exports.from = from; -/** - * Generates a (potentially infinite) sequence of integral numbers within a range. The first number - * emitted is `start`, and the last is `stop - 1`. If the enumerated sequence generates zero - * elements (for example, when `stop <= start + 1`), an exception is thrown. - * @param start Beginning of the range - * @param stop Non-inclusive end of the range. - * @example - * const squares = await range(0, 3).map(x => x * x).toArray(); // == [0, 1, 4] - */ -function range(start, stop) { - return asyncQueryable_1.AsyncQueryableImpl.from(sources.range(start, stop)); + +function HookCollection () { + var state = { + registry: {} + } + + var hook = register.bind(null, state) + bindApi(hook, state) + + return hook } -exports.range = range; -/** - * Returns an empty sequence of `TResult`. - * @example - * const noNumbers = await empty().toArray(); // == [] - */ -function empty() { - return asyncQueryable_1.AsyncQueryableImpl.from(sources.from([])); + +var collectionHookDeprecationMessageDisplayed = false +function Hook () { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') + collectionHookDeprecationMessageDisplayed = true + } + return HookCollection() } -exports.empty = empty; -/** - * Generates a (potentially infinite) sequence by repeating a single value. - * @param t Object to repeat - * @example - * const ones = await repeat(1).take(3).toArray(); // == [1, 1, 1] - */ -function repeat(t /* TODO: add optional count. */) { - asyncQueryable_1.AsyncQueryableImpl.from((function () { - return __asyncGenerator(this, arguments, function* () { - while (true) { - yield yield __await(t); - } + +Hook.Singular = HookSingular.bind() +Hook.Collection = HookCollection.bind() + +module.exports = Hook +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook +module.exports.Singular = Hook.Singular +module.exports.Collection = Hook.Collection + + +/***/ }), + +/***/ 5549: +/***/ ((module) => { + +module.exports = addHook; + +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } + + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } + + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; }); - })()); + }; + } + + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; + } + + state.registry[name].push({ + hook: hook, + orig: orig, + }); } -exports.repeat = repeat; /***/ }), -/***/ 2830: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4670: +/***/ ((module) => { -"use strict"; +module.exports = register; -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -/////////////////////////////////////////////////////////////////////////////// -function isAsyncIterable(o) { - return typeof o[Symbol.asyncIterator] === "function"; +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } + + if (!options) { + options = {}; + } + + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } + + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); + } + + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); } -exports.isAsyncIterable = isAsyncIterable; -function isIterable(o) { - return typeof o[Symbol.iterator] === "function"; + + +/***/ }), + +/***/ 6819: +/***/ ((module) => { + +module.exports = removeHook; + +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } + + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); + + if (index === -1) { + return; + } + + state.registry[name].splice(index, 1); } -exports.isIterable = isIterable; /***/ }), -/***/ 20327: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 2286: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); +const { + V4MAPPED, + ADDRCONFIG, + ALL, + promises: { + Resolver: AsyncResolver + }, + lookup: dnsLookup +} = __nccwpck_require__(9523); +const {promisify} = __nccwpck_require__(3837); +const os = __nccwpck_require__(2037); + +const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); +const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); +const kExpires = Symbol('expires'); + +const supportsALL = typeof ALL === 'number'; + +const verifyAgent = agent => { + if (!(agent && typeof agent.createConnection === 'function')) { + throw new Error('Expected an Agent instance as the first argument'); + } }; -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + +const map4to6 = entries => { + for (const entry of entries) { + if (entry.family === 6) { + continue; + } + + entry.address = `::ffff:${entry.address}`; + entry.family = 6; + } }; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + +const getIfaceInfo = () => { + let has4 = false; + let has6 = false; + + for (const device of Object.values(os.networkInterfaces())) { + for (const iface of device) { + if (iface.internal) { + continue; + } + + if (iface.family === 'IPv6') { + has6 = true; + } else { + has4 = true; + } + + if (has4 && has6) { + return {has4, has6}; + } + } + } + + return {has4, has6}; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const util_1 = __nccwpck_require__(73837); -const base_1 = __nccwpck_require__(44139); -const sources_1 = __nccwpck_require__(48396); -// -// Restriction operators. -// -function filter(f) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_1, _a; - try { - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { - const [t, i] = _c.value; - if (yield __await(f(t, i))) { - yield yield __await(t); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_1) throw e_1.error; } - } - }); - }; -} -exports.filter = filter; -// -// Projection operators. -// -function flatMap(selector, resultSelector = (t, ti) => ti) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_2, _a, e_3, _b; - try { - for (var _c = __asyncValues(zip(source, sources_1.range(0))), _d; _d = yield __await(_c.next()), !_d.done;) { - const [t, i] = _d.value; - const us = selector(t, i); - try { - for (var _e = __asyncValues(sources_1.from(us)), _f; _f = yield __await(_e.next()), !_f.done;) { - const u = _f.value; - yield yield __await(yield __await(resultSelector(t, u))); - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_f && !_f.done && (_b = _e.return)) yield __await(_b.call(_e)); - } - finally { if (e_3) throw e_3.error; } - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) yield __await(_a.call(_c)); - } - finally { if (e_2) throw e_2.error; } - } - }); - }; -} -exports.flatMap = flatMap; -function map(f) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_4, _a; - try { - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { - const [t, i] = _c.value; - yield yield __await(yield __await(f(t, i))); - } - } - catch (e_4_1) { e_4 = { error: e_4_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_4) throw e_4.error; } - } - }); - }; -} -exports.map = map; -// -// Partitioning operators. -// -function skip(n) { - if (n < 0) { - throw Error("skip was provided a negative number of elements to skip"); - } - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_5, _a; - try { - for (var _b = __asyncValues(zip(source, sources_1.range(1))), _c; _c = yield __await(_b.next()), !_c.done;) { - const [t, i] = _c.value; - if (i > n) { - yield yield __await(t); - } - } - } - catch (e_5_1) { e_5 = { error: e_5_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_5) throw e_5.error; } - } - }); - }; -} -exports.skip = skip; -function skipWhile(predicate) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_6, _a; - let stopSkipping = false; - try { - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { - const [t, i] = _c.value; - if (stopSkipping === true) { - yield yield __await(t); - } - else if ((yield __await(predicate(t, i))) === false) { - stopSkipping = true; - yield yield __await(t); - } - } - } - catch (e_6_1) { e_6 = { error: e_6_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_6) throw e_6.error; } - } - }); - }; -} -exports.skipWhile = skipWhile; -function take(n) { - if (n < 0) { - throw Error("take was provided a negative number of elements to take"); - } - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_7, _a; - try { - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { - const [t, i] = _c.value; - if (i >= n) { - return yield __await(void 0); - } - yield yield __await(t); - } - } - catch (e_7_1) { e_7 = { error: e_7_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_7) throw e_7.error; } - } - }); - }; -} -exports.take = take; -function takeWhile(predicate) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_8, _a; - try { - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield __await(_b.next()), !_c.done;) { - const [t, i] = _c.value; - if ((yield __await(predicate(t, i))) === false) { - return yield __await(void 0); - } - yield yield __await(t); - } - } - catch (e_8_1) { e_8 = { error: e_8_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_8) throw e_8.error; } - } - }); - }; -} -exports.takeWhile = takeWhile; -// -// Join operators. -// -function joinHelper(outer, inner, outerKeySelector, innerKeySelector) { - return __asyncGenerator(this, arguments, function* joinHelper_1() { - var e_9, _a, e_10, _b; - const inners = new Map(); - try { - for (var inner_1 = __asyncValues(inner), inner_1_1; inner_1_1 = yield __await(inner_1.next()), !inner_1_1.done;) { - const t = inner_1_1.value; - const key = yield __await(innerKeySelector(t)); - const val = inners.get(key); - if (inners.has(key)) { - val.push(t); - } - else { - inners.set(key, [t]); - } - } - } - catch (e_9_1) { e_9 = { error: e_9_1 }; } - finally { - try { - if (inner_1_1 && !inner_1_1.done && (_a = inner_1.return)) yield __await(_a.call(inner_1)); - } - finally { if (e_9) throw e_9.error; } - } - try { - for (var outer_1 = __asyncValues(outer), outer_1_1; outer_1_1 = yield __await(outer_1.next()), !outer_1_1.done;) { - const t = outer_1_1.value; - const key = yield __await(outerKeySelector(t)); - if (key === undefined) { - continue; - } - else if (inners.has(key)) { - const innerValues = inners.get(key); - yield yield __await([t, innerValues]); - } - } - } - catch (e_10_1) { e_10 = { error: e_10_1 }; } - finally { - try { - if (outer_1_1 && !outer_1_1.done && (_b = outer_1.return)) yield __await(_b.call(outer_1)); - } - finally { if (e_10) throw e_10.error; } - } - }); -} -function join(inner, outerKeySelector, innerKeySelector, resultSelector) { - return function (outer) { - return __asyncGenerator(this, arguments, function* () { - var e_11, _a; - try { - for (var _b = __asyncValues(joinHelper(outer, inner, outerKeySelector, innerKeySelector)), _c; _c = yield __await(_b.next()), !_c.done;) { - const [o, inners] = _c.value; - for (const i of inners) { - yield yield __await(yield __await(resultSelector(o, i))); - } - } - } - catch (e_11_1) { e_11 = { error: e_11_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_11) throw e_11.error; } - } - }); - }; -} -exports.join = join; -function groupJoin(inner, outerKeySelector, innerKeySelector, resultSelector) { - return function (outer) { - return __asyncGenerator(this, arguments, function* () { - var e_12, _a; - try { - for (var _b = __asyncValues(joinHelper(outer, inner, outerKeySelector, innerKeySelector)), _c; _c = yield __await(_b.next()), !_c.done;) { - const [o, inners] = _c.value; - yield yield __await(yield __await(resultSelector(o, sources_1.from(inners)))); - } - } - catch (e_12_1) { e_12 = { error: e_12_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); - } - finally { if (e_12) throw e_12.error; } - } - }); - }; + +const isIterable = map => { + return Symbol.iterator in map; +}; + +const ttl = {ttl: true}; +const all = {all: true}; + +class CacheableLookup { + constructor({ + cache = new Map(), + maxTtl = Infinity, + fallbackDuration = 3600, + errorTtl = 0.15, + resolver = new AsyncResolver(), + lookup = dnsLookup + } = {}) { + this.maxTtl = maxTtl; + this.errorTtl = errorTtl; + + this._cache = cache; + this._resolver = resolver; + this._dnsLookup = promisify(lookup); + + if (this._resolver instanceof AsyncResolver) { + this._resolve4 = this._resolver.resolve4.bind(this._resolver); + this._resolve6 = this._resolver.resolve6.bind(this._resolver); + } else { + this._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver)); + this._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver)); + } + + this._iface = getIfaceInfo(); + + this._pending = {}; + this._nextRemovalTime = false; + this._hostnamesToFallback = new Set(); + + if (fallbackDuration < 1) { + this._fallback = false; + } else { + this._fallback = true; + + const interval = setInterval(() => { + this._hostnamesToFallback.clear(); + }, fallbackDuration * 1000); + + /* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */ + if (interval.unref) { + interval.unref(); + } + } + + this.lookup = this.lookup.bind(this); + this.lookupAsync = this.lookupAsync.bind(this); + } + + set servers(servers) { + this.clear(); + + this._resolver.setServers(servers); + } + + get servers() { + return this._resolver.getServers(); + } + + lookup(hostname, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } else if (typeof options === 'number') { + options = { + family: options + }; + } + + if (!callback) { + throw new Error('Callback must be a function.'); + } + + // eslint-disable-next-line promise/prefer-await-to-then + this.lookupAsync(hostname, options).then(result => { + if (options.all) { + callback(null, result); + } else { + callback(null, result.address, result.family, result.expires, result.ttl); + } + }, callback); + } + + async lookupAsync(hostname, options = {}) { + if (typeof options === 'number') { + options = { + family: options + }; + } + + let cached = await this.query(hostname); + + if (options.family === 6) { + const filtered = cached.filter(entry => entry.family === 6); + + if (options.hints & V4MAPPED) { + if ((supportsALL && options.hints & ALL) || filtered.length === 0) { + map4to6(cached); + } else { + cached = filtered; + } + } else { + cached = filtered; + } + } else if (options.family === 4) { + cached = cached.filter(entry => entry.family === 4); + } + + if (options.hints & ADDRCONFIG) { + const {_iface} = this; + cached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4); + } + + if (cached.length === 0) { + const error = new Error(`cacheableLookup ENOTFOUND ${hostname}`); + error.code = 'ENOTFOUND'; + error.hostname = hostname; + + throw error; + } + + if (options.all) { + return cached; + } + + return cached[0]; + } + + async query(hostname) { + let cached = await this._cache.get(hostname); + + if (!cached) { + const pending = this._pending[hostname]; + + if (pending) { + cached = await pending; + } else { + const newPromise = this.queryAndCache(hostname); + this._pending[hostname] = newPromise; + + try { + cached = await newPromise; + } finally { + delete this._pending[hostname]; + } + } + } + + cached = cached.map(entry => { + return {...entry}; + }); + + return cached; + } + + async _resolve(hostname) { + const wrap = async promise => { + try { + return await promise; + } catch (error) { + if (error.code === 'ENODATA' || error.code === 'ENOTFOUND') { + return []; + } + + throw error; + } + }; + + // ANY is unsafe as it doesn't trigger new queries in the underlying server. + const [A, AAAA] = await Promise.all([ + this._resolve4(hostname, ttl), + this._resolve6(hostname, ttl) + ].map(promise => wrap(promise))); + + let aTtl = 0; + let aaaaTtl = 0; + let cacheTtl = 0; + + const now = Date.now(); + + for (const entry of A) { + entry.family = 4; + entry.expires = now + (entry.ttl * 1000); + + aTtl = Math.max(aTtl, entry.ttl); + } + + for (const entry of AAAA) { + entry.family = 6; + entry.expires = now + (entry.ttl * 1000); + + aaaaTtl = Math.max(aaaaTtl, entry.ttl); + } + + if (A.length > 0) { + if (AAAA.length > 0) { + cacheTtl = Math.min(aTtl, aaaaTtl); + } else { + cacheTtl = aTtl; + } + } else { + cacheTtl = aaaaTtl; + } + + return { + entries: [ + ...A, + ...AAAA + ], + cacheTtl + }; + } + + async _lookup(hostname) { + try { + const entries = await this._dnsLookup(hostname, { + all: true + }); + + return { + entries, + cacheTtl: 0 + }; + } catch (_) { + return { + entries: [], + cacheTtl: 0 + }; + } + } + + async _set(hostname, data, cacheTtl) { + if (this.maxTtl > 0 && cacheTtl > 0) { + cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000; + data[kExpires] = Date.now() + cacheTtl; + + try { + await this._cache.set(hostname, data, cacheTtl); + } catch (error) { + this.lookupAsync = async () => { + const cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.'); + cacheError.cause = error; + + throw cacheError; + }; + } + + if (isIterable(this._cache)) { + this._tick(cacheTtl); + } + } + } + + async queryAndCache(hostname) { + if (this._hostnamesToFallback.has(hostname)) { + return this._dnsLookup(hostname, all); + } + + let query = await this._resolve(hostname); + + if (query.entries.length === 0 && this._fallback) { + query = await this._lookup(hostname); + + if (query.entries.length !== 0) { + // Use `dns.lookup(...)` for that particular hostname + this._hostnamesToFallback.add(hostname); + } + } + + const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl; + await this._set(hostname, query.entries, cacheTtl); + + return query.entries; + } + + _tick(ms) { + const nextRemovalTime = this._nextRemovalTime; + + if (!nextRemovalTime || ms < nextRemovalTime) { + clearTimeout(this._removalTimeout); + + this._nextRemovalTime = ms; + + this._removalTimeout = setTimeout(() => { + this._nextRemovalTime = false; + + let nextExpiry = Infinity; + + const now = Date.now(); + + for (const [hostname, entries] of this._cache) { + const expires = entries[kExpires]; + + if (now >= expires) { + this._cache.delete(hostname); + } else if (expires < nextExpiry) { + nextExpiry = expires; + } + } + + if (nextExpiry !== Infinity) { + this._tick(nextExpiry - now); + } + }, ms); + + /* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */ + if (this._removalTimeout.unref) { + this._removalTimeout.unref(); + } + } + } + + install(agent) { + verifyAgent(agent); + + if (kCacheableLookupCreateConnection in agent) { + throw new Error('CacheableLookup has been already installed'); + } + + agent[kCacheableLookupCreateConnection] = agent.createConnection; + agent[kCacheableLookupInstance] = this; + + agent.createConnection = (options, callback) => { + if (!('lookup' in options)) { + options.lookup = this.lookup; + } + + return agent[kCacheableLookupCreateConnection](options, callback); + }; + } + + uninstall(agent) { + verifyAgent(agent); + + if (agent[kCacheableLookupCreateConnection]) { + if (agent[kCacheableLookupInstance] !== this) { + throw new Error('The agent is not owned by this CacheableLookup instance'); + } + + agent.createConnection = agent[kCacheableLookupCreateConnection]; + + delete agent[kCacheableLookupCreateConnection]; + delete agent[kCacheableLookupInstance]; + } + } + + updateInterfaceInfo() { + const {_iface} = this; + + this._iface = getIfaceInfo(); + + if ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) { + this._cache.clear(); + } + } + + clear(hostname) { + if (hostname) { + this._cache.delete(hostname); + return; + } + + this._cache.clear(); + } } -exports.groupJoin = groupJoin; -// -// Concatenation operators. -// -function concat(iter) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_13, _a, e_14, _b; - try { - for (var source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), !source_1_1.done;) { - const t = source_1_1.value; - yield yield __await(t); - } - } - catch (e_13_1) { e_13 = { error: e_13_1 }; } - finally { - try { - if (source_1_1 && !source_1_1.done && (_a = source_1.return)) yield __await(_a.call(source_1)); - } - finally { if (e_13) throw e_13.error; } - } - try { - for (var iter_1 = __asyncValues(iter), iter_1_1; iter_1_1 = yield __await(iter_1.next()), !iter_1_1.done;) { - const t = iter_1_1.value; - yield yield __await(t); - } - } - catch (e_14_1) { e_14 = { error: e_14_1 }; } - finally { - try { - if (iter_1_1 && !iter_1_1.done && (_b = iter_1.return)) yield __await(_b.call(iter_1)); - } - finally { if (e_14) throw e_14.error; } - } - }); - }; + +module.exports = CacheableLookup; +module.exports["default"] = CacheableLookup; + + +/***/ }), + +/***/ 8116: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const EventEmitter = __nccwpck_require__(2361); +const urlLib = __nccwpck_require__(7310); +const normalizeUrl = __nccwpck_require__(7952); +const getStream = __nccwpck_require__(1766); +const CachePolicy = __nccwpck_require__(1002); +const Response = __nccwpck_require__(9004); +const lowercaseKeys = __nccwpck_require__(9662); +const cloneResponse = __nccwpck_require__(1312); +const Keyv = __nccwpck_require__(1531); + +class CacheableRequest { + constructor(request, cacheAdapter) { + if (typeof request !== 'function') { + throw new TypeError('Parameter `request` must be a function'); + } + + this.cache = new Keyv({ + uri: typeof cacheAdapter === 'string' && cacheAdapter, + store: typeof cacheAdapter !== 'string' && cacheAdapter, + namespace: 'cacheable-request' + }); + + return this.createCacheableRequest(request); + } + + createCacheableRequest(request) { + return (opts, cb) => { + let url; + if (typeof opts === 'string') { + url = normalizeUrlObject(urlLib.parse(opts)); + opts = {}; + } else if (opts instanceof urlLib.URL) { + url = normalizeUrlObject(urlLib.parse(opts.toString())); + opts = {}; + } else { + const [pathname, ...searchParts] = (opts.path || '').split('?'); + const search = searchParts.length > 0 ? + `?${searchParts.join('?')}` : + ''; + url = normalizeUrlObject({ ...opts, pathname, search }); + } + + opts = { + headers: {}, + method: 'GET', + cache: true, + strictTtl: false, + automaticFailover: false, + ...opts, + ...urlObjectToRequestOptions(url) + }; + opts.headers = lowercaseKeys(opts.headers); + + const ee = new EventEmitter(); + const normalizedUrlString = normalizeUrl( + urlLib.format(url), + { + stripWWW: false, + removeTrailingSlash: false, + stripAuthentication: false + } + ); + const key = `${opts.method}:${normalizedUrlString}`; + let revalidate = false; + let madeRequest = false; + + const makeRequest = opts => { + madeRequest = true; + let requestErrored = false; + let requestErrorCallback; + + const requestErrorPromise = new Promise(resolve => { + requestErrorCallback = () => { + if (!requestErrored) { + requestErrored = true; + resolve(); + } + }; + }); + + const handler = response => { + if (revalidate && !opts.forceRefresh) { + response.status = response.statusCode; + const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); + if (!revalidatedPolicy.modified) { + const headers = revalidatedPolicy.policy.responseHeaders(); + response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); + response.cachePolicy = revalidatedPolicy.policy; + response.fromCache = true; + } + } + + if (!response.fromCache) { + response.cachePolicy = new CachePolicy(opts, response, opts); + response.fromCache = false; + } + + let clonedResponse; + if (opts.cache && response.cachePolicy.storable()) { + clonedResponse = cloneResponse(response); + + (async () => { + try { + const bodyPromise = getStream.buffer(response); + + await Promise.race([ + requestErrorPromise, + new Promise(resolve => response.once('end', resolve)) + ]); + + if (requestErrored) { + return; + } + + const body = await bodyPromise; + + const value = { + cachePolicy: response.cachePolicy.toObject(), + url: response.url, + statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, + body + }; + + let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; + if (opts.maxTtl) { + ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; + } + + await this.cache.set(key, value, ttl); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } else if (opts.cache && revalidate) { + (async () => { + try { + await this.cache.delete(key); + } catch (error) { + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + } + + ee.emit('response', clonedResponse || response); + if (typeof cb === 'function') { + cb(clonedResponse || response); + } + }; + + try { + const req = request(opts, handler); + req.once('error', requestErrorCallback); + req.once('abort', requestErrorCallback); + ee.emit('request', req); + } catch (error) { + ee.emit('error', new CacheableRequest.RequestError(error)); + } + }; + + (async () => { + const get = async opts => { + await Promise.resolve(); + + const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; + if (typeof cacheEntry === 'undefined') { + return makeRequest(opts); + } + + const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); + if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { + const headers = policy.responseHeaders(); + const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); + response.cachePolicy = policy; + response.fromCache = true; + + ee.emit('response', response); + if (typeof cb === 'function') { + cb(response); + } + } else { + revalidate = cacheEntry; + opts.headers = policy.revalidationHeaders(opts); + makeRequest(opts); + } + }; + + const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); + this.cache.once('error', errorHandler); + ee.on('response', () => this.cache.removeListener('error', errorHandler)); + + try { + await get(opts); + } catch (error) { + if (opts.automaticFailover && !madeRequest) { + makeRequest(opts); + } + + ee.emit('error', new CacheableRequest.CacheError(error)); + } + })(); + + return ee; + }; + } } -exports.concat = concat; -// -// Ordering operators. -// -function orderBy(keySelector) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - // - // NOTE: This horrible little function is necessary because the default behavior of - // JavaScript's `Array#sort` is to coerce every element in the array into string, and then - // sort those strings lexically. - // - // This, of course, is completely unacceptable. Approximately 0 users call `.sort` on an - // array of `Object` with the intention that they be sorted in this manner. The right thing - // to do is to simply assume this is a user error and throw an exception. - // - // If the user actually wants to sort an array of `Object` by their stringified - // representation, let them pass us a key function that performs this conversion explicitly. - // There is no particular need for Brendan Eich's problems from 30 years ago to become our - // users' problems today. - // - let lastKey; - const ts = yield __await(map(function (t) { - return __awaiter(this, void 0, void 0, function* () { - const key = yield keySelector(t); - if (lastKey === undefined) { - lastKey = key; - } - else { - if (util_1.isNumber(key) && util_1.isString(key)) { - throw Error("keySelector must produce a number or a string"); - } - if (typeof lastKey !== typeof key) { - throw Error(`keySelector must produce keys all of the same type, but found ` + - `${typeof key} and ${typeof lastKey}`); - } - } - return [key, t]; - }); - })(source)); - const keyed = yield __await(toArray()(ts)); - const comparator = ((util_1.isNumber(lastKey) - ? (a, b) => a - b - : (a, b) => a.localeCompare(b))); - const sorted = keyed.sort(([k1], [k2]) => comparator(k1, k2)); - for (const [, t] of sorted) { - yield yield __await(t); - } - }); - }; + +function urlObjectToRequestOptions(url) { + const options = { ...url }; + options.path = `${url.pathname || '/'}${url.search || ''}`; + delete options.pathname; + delete options.search; + return options; } -exports.orderBy = orderBy; -function orderByDescending(keySelector) { - return function (source) { - return reverse()(orderBy(keySelector)(source)); - }; + +function normalizeUrlObject(url) { + // If url was parsed by url.parse or new URL: + // - hostname will be set + // - host will be hostname[:port] + // - port will be set if it was explicit in the parsed string + // Otherwise, url was from request options: + // - hostname or host may be set + // - host shall not have port encoded + return { + protocol: url.protocol, + auth: url.auth, + hostname: url.hostname || url.host || 'localhost', + port: url.port, + pathname: url.pathname, + search: url.search + }; } -exports.orderByDescending = orderByDescending; -function reverse() { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_15, _a; - const ts = []; - try { - for (var source_2 = __asyncValues(source), source_2_1; source_2_1 = yield __await(source_2.next()), !source_2_1.done;) { - const t = source_2_1.value; - ts.push(t); - } - } - catch (e_15_1) { e_15 = { error: e_15_1 }; } - finally { - try { - if (source_2_1 && !source_2_1.done && (_a = source_2.return)) yield __await(_a.call(source_2)); - } - finally { if (e_15) throw e_15.error; } - } - for (const t of ts.reverse()) { - yield yield __await(t); - } - }); - }; + +CacheableRequest.RequestError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'RequestError'; + Object.assign(this, error); + } +}; + +CacheableRequest.CacheError = class extends Error { + constructor(error) { + super(error.message); + this.name = 'CacheError'; + Object.assign(this, error); + } +}; + +module.exports = CacheableRequest; + + +/***/ }), + +/***/ 9372: +/***/ ((module) => { + +"use strict"; + + +// We define these manually to ensure they're always copied +// even if they would move up the prototype chain +// https://nodejs.org/api/http.html#http_class_http_incomingmessage +const knownProps = [ + 'destroy', + 'setTimeout', + 'socket', + 'headers', + 'trailers', + 'rawHeaders', + 'statusCode', + 'httpVersion', + 'httpVersionMinor', + 'httpVersionMajor', + 'rawTrailers', + 'statusMessage' +]; + +module.exports = (fromStream, toStream) => { + const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); + + for (const prop of fromProps) { + // Don't overwrite existing properties + if (prop in toStream) { + continue; + } + + toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; + } +}; + + +/***/ }), + +/***/ 1312: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const PassThrough = (__nccwpck_require__(2781).PassThrough); +const mimicResponse = __nccwpck_require__(9372); + +const cloneResponse = response => { + if (!(response && response.pipe)) { + throw new TypeError('Parameter `response` must be a response stream.'); + } + + const clone = new PassThrough(); + mimicResponse(response, clone); + + return response.pipe(clone); +}; + +module.exports = cloneResponse; + + +/***/ }), + +/***/ 5728: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { promisify } = __nccwpck_require__(3837) +const JSONB = __nccwpck_require__(2820) +const zlib = __nccwpck_require__(9796) + +const mergeOptions = __nccwpck_require__(4968) + +const compress = promisify(zlib.brotliCompress) + +const decompress = promisify(zlib.brotliDecompress) + +const identity = val => val + +const createCompress = ({ + enable = true, + serialize = JSONB.stringify, + deserialize = JSONB.parse, + compressOptions, + decompressOptions +} = {}) => { + if (!enable) { + return { serialize, deserialize, decompress: identity, compress: identity } + } + + return { + serialize, + deserialize, + compress: async (data, options = {}) => { + if (data === undefined) return data + const serializedData = serialize(data) + return compress(serializedData, mergeOptions(compressOptions, options)) + }, + decompress: async (data, options = {}) => { + if (data === undefined) return data + return deserialize( + await decompress(data, mergeOptions(decompressOptions, options)) + ) + } + } } -exports.reverse = reverse; -// -// Grouping operators. -// -function groupBy(keySelector, elementSelector) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_16, _a; - if (elementSelector === undefined) { - elementSelector = t => t; - } - const groups = new Map(); - try { - for (var source_3 = __asyncValues(source), source_3_1; source_3_1 = yield __await(source_3.next()), !source_3_1.done;) { - const t = source_3_1.value; - const key = yield __await(keySelector(t)); - const val = yield __await(elementSelector(t)); - if (!groups.has(key)) { - groups.set(key, [val]); - } - else { - const group = groups.get(key); - group.push(val); - } - } - } - catch (e_16_1) { e_16 = { error: e_16_1 }; } - finally { - try { - if (source_3_1 && !source_3_1.done && (_a = source_3.return)) yield __await(_a.call(source_3)); - } - finally { if (e_16) throw e_16.error; } - } - for (const [key, group] of groups) { - yield yield __await(new base_1.GroupedAsyncIterableIteratorImpl(key, sources_1.from(group))); - } - }); - }; + +module.exports = createCompress +module.exports.stringify = JSONB.stringify +module.exports.parse = JSONB.parse + + +/***/ }), + +/***/ 4968: +/***/ ((module) => { + +"use strict"; + + +module.exports = (defaultOptions = {}, options = {}) => { + const params = { + ...(defaultOptions.params || {}), + ...(options.params || {}) + } + + return { + ...defaultOptions, + ...options, + ...(Object.keys(params).length + ? { + params + } + : {}) + } } -exports.groupBy = groupBy; -// -// Set operators. -// -function distinct() { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_17, _a; - const dist = new Set(); - try { - for (var source_4 = __asyncValues(source), source_4_1; source_4_1 = yield __await(source_4.next()), !source_4_1.done;) { - const t = source_4_1.value; - if (!dist.has(t)) { - dist.add(t); - yield yield __await(t); - } - } - } - catch (e_17_1) { e_17 = { error: e_17_1 }; } - finally { - try { - if (source_4_1 && !source_4_1.done && (_a = source_4.return)) yield __await(_a.call(source_4)); - } - finally { if (e_17) throw e_17.error; } - } - }); - }; + + +/***/ }), + +/***/ 2391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const {Transform, PassThrough} = __nccwpck_require__(2781); +const zlib = __nccwpck_require__(9796); +const mimicResponse = __nccwpck_require__(2610); + +module.exports = response => { + const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase(); + + if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) { + return response; + } + + // TODO: Remove this when targeting Node.js 12. + const isBrotli = contentEncoding === 'br'; + if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') { + response.destroy(new Error('Brotli is not supported on Node.js < 12')); + return response; + } + + let isEmpty = true; + + const checker = new Transform({ + transform(data, _encoding, callback) { + isEmpty = false; + + callback(null, data); + }, + + flush(callback) { + callback(); + } + }); + + const finalStream = new PassThrough({ + autoDestroy: false, + destroy(error, callback) { + response.destroy(); + + callback(error); + } + }); + + const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); + + decompressStream.once('error', error => { + if (isEmpty && !response.readable) { + finalStream.end(); + return; + } + + finalStream.destroy(error); + }); + + mimicResponse(response, finalStream); + response.pipe(checker).pipe(decompressStream).pipe(finalStream); + + return finalStream; +}; + + +/***/ }), + +/***/ 5281: +/***/ ((module) => { + +"use strict"; + + +function dedent(strings) { + + var raw = void 0; + if (typeof strings === "string") { + // dedent can be used as a plain function + raw = [strings]; + } else { + raw = strings.raw; + } + + // first, perform interpolation + var result = ""; + for (var i = 0; i < raw.length; i++) { + result += raw[i]. + // join lines when there is a suppressed newline + replace(/\\\n[ \t]*/g, ""). + + // handle escaped backticks + replace(/\\`/g, "`"); + + if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { + result += arguments.length <= i + 1 ? undefined : arguments[i + 1]; + } + } + + // now strip indentation + var lines = result.split("\n"); + var mindent = null; + lines.forEach(function (l) { + var m = l.match(/^(\s+)\S+/); + if (m) { + var indent = m[1].length; + if (!mindent) { + // this is the first indented line + mindent = indent; + } else { + mindent = Math.min(mindent, indent); + } + } + }); + + if (mindent !== null) { + result = lines.map(function (l) { + return l[0] === " " ? l.slice(mindent) : l; + }).join("\n"); + } + + // dedent eats leading and trailing whitespace too + result = result.trim(); + + // handle escaped newlines at the end to ensure they don't get stripped too + return result.replace(/\\n/g, "\n"); } -exports.distinct = distinct; -function union(second) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_18, _a, e_19, _b; - const dist = new Set(); - try { - for (var source_5 = __asyncValues(source), source_5_1; source_5_1 = yield __await(source_5.next()), !source_5_1.done;) { - const t = source_5_1.value; - if (!dist.has(t)) { - dist.add(t); - yield yield __await(t); - } - } - } - catch (e_18_1) { e_18 = { error: e_18_1 }; } - finally { - try { - if (source_5_1 && !source_5_1.done && (_a = source_5.return)) yield __await(_a.call(source_5)); - } - finally { if (e_18) throw e_18.error; } - } - try { - for (var second_1 = __asyncValues(second), second_1_1; second_1_1 = yield __await(second_1.next()), !second_1_1.done;) { - const t = second_1_1.value; - if (!dist.has(t)) { - dist.add(t); - yield yield __await(t); - } - } + +if (true) { + module.exports = dedent; +} + + +/***/ }), + +/***/ 6214: +/***/ ((module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +function isTLSSocket(socket) { + return socket.encrypted; +} +const deferToConnect = (socket, fn) => { + let listeners; + if (typeof fn === 'function') { + const connect = fn; + listeners = { connect }; + } + else { + listeners = fn; + } + const hasConnectListener = typeof listeners.connect === 'function'; + const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; + const hasCloseListener = typeof listeners.close === 'function'; + const onConnect = () => { + if (hasConnectListener) { + listeners.connect(); + } + if (isTLSSocket(socket) && hasSecureConnectListener) { + if (socket.authorized) { + listeners.secureConnect(); } - catch (e_19_1) { e_19 = { error: e_19_1 }; } - finally { - try { - if (second_1_1 && !second_1_1.done && (_b = second_1.return)) yield __await(_b.call(second_1)); - } - finally { if (e_19) throw e_19.error; } + else if (!socket.authorizationError) { + socket.once('secureConnect', listeners.secureConnect); } - }); + } + if (hasCloseListener) { + socket.once('close', listeners.close); + } }; + if (socket.writable && !socket.connecting) { + onConnect(); + } + else if (socket.connecting) { + socket.once('connect', onConnect); + } + else if (socket.destroyed && hasCloseListener) { + listeners.close(socket._hadError); + } +}; +exports["default"] = deferToConnect; +// For CommonJS default export support +module.exports = deferToConnect; +module.exports["default"] = deferToConnect; + + +/***/ }), + +/***/ 8932: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = 'Deprecation'; + } + } -exports.union = union; -function intersect(second) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_20, _a, e_21, _b; - const dist = new Set(); - try { - for (var source_6 = __asyncValues(source), source_6_1; source_6_1 = yield __await(source_6.next()), !source_6_1.done;) { - const t = source_6_1.value; - dist.add(t); - } - } - catch (e_20_1) { e_20 = { error: e_20_1 }; } - finally { - try { - if (source_6_1 && !source_6_1.done && (_a = source_6.return)) yield __await(_a.call(source_6)); - } - finally { if (e_20) throw e_20.error; } - } - const emitted = new Set(); - try { - for (var second_2 = __asyncValues(second), second_2_1; second_2_1 = yield __await(second_2.next()), !second_2_1.done;) { - const t = second_2_1.value; - if (dist.has(t) && !emitted.has(t)) { - emitted.add(t); - yield yield __await(t); - } - } + +exports.Deprecation = Deprecation; + + +/***/ }), + +/***/ 1205: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var once = __nccwpck_require__(1223); + +var noop = function() {}; + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onerror = function(err) { + callback.call(stream, err); + }; + + var onclose = function() { + process.nextTick(onclosenexttick); + }; + + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; + + +/***/ }), + +/***/ 972: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.__esModule = true; +exports.getSanitizedEnv = exports.testOnlySymbol = void 0; +var errors_1 = __nccwpck_require__(9150); +var reporter_1 = __nccwpck_require__(3121); +exports.testOnlySymbol = Symbol('envalid - test only'); +/** + * Validate a single env var, given a spec object + * + * @throws EnvError - If validation is unsuccessful + * @return - The cleaned value + */ +function validateVar(_a) { + var spec = _a.spec, name = _a.name, rawValue = _a.rawValue; + if (typeof spec._parse !== 'function') { + throw new errors_1.EnvError("Invalid spec for \"".concat(name, "\"")); + } + var value = spec._parse(rawValue); + if (spec.choices) { + if (!Array.isArray(spec.choices)) { + throw new TypeError("\"choices\" must be an array (in spec for \"".concat(name, "\")")); + } + else if (!spec.choices.includes(value)) { + throw new errors_1.EnvError("Value \"".concat(value, "\" not in choices [").concat(spec.choices, "]")); + } + } + if (value == null) + throw new errors_1.EnvError("Invalid value for env var \"".concat(name, "\"")); + return value; +} +// Format a string error message for when a required env var is missing +function formatSpecDescription(spec) { + var egText = spec.example ? " (eg. \"".concat(spec.example, "\")") : ''; + var docsText = spec.docs ? ". See ".concat(spec.docs) : ''; + return "".concat(spec.desc).concat(egText).concat(docsText); +} +var readRawEnvValue = function (env, k) { + return env[k]; +}; +var isTestOnlySymbol = function (value) { return value === exports.testOnlySymbol; }; +/** + * Perform the central validation/sanitization logic on the full environment object + */ +function getSanitizedEnv(environment, specs, options) { + if (options === void 0) { options = {}; } + var cleanedEnv = {}; + var errors = {}; + var varKeys = Object.keys(specs); + var rawNodeEnv = readRawEnvValue(environment, 'NODE_ENV'); + for (var _i = 0, varKeys_1 = varKeys; _i < varKeys_1.length; _i++) { + var k = varKeys_1[_i]; + var spec = specs[k]; + var rawValue = readRawEnvValue(environment, k); + // If no value was given and default/devDefault were provided, return the appropriate default + // value without passing it through validation + if (rawValue === undefined) { + // Use devDefault values only if NODE_ENV was explicitly set, and isn't 'production' + var usingDevDefault = rawNodeEnv && rawNodeEnv !== 'production' && spec.hasOwnProperty('devDefault'); + if (usingDevDefault) { + // @ts-expect-error default values can break the rules slightly by being explicitly set to undefined + cleanedEnv[k] = spec.devDefault; + continue; } - catch (e_21_1) { e_21 = { error: e_21_1 }; } - finally { - try { - if (second_2_1 && !second_2_1.done && (_b = second_2.return)) yield __await(_b.call(second_2)); - } - finally { if (e_21) throw e_21.error; } + if (spec.hasOwnProperty('default')) { + // @ts-expect-error default values can break the rules slightly by being explicitly set to undefined + cleanedEnv[k] = spec["default"]; + continue; } - }); - }; -} -exports.intersect = intersect; -function except(second) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_22, _a, e_23, _b; - const dist = new Set(); - try { - for (var source_7 = __asyncValues(source), source_7_1; source_7_1 = yield __await(source_7.next()), !source_7_1.done;) { - const t = source_7_1.value; - dist.add(t); - } + } + try { + if (isTestOnlySymbol(rawValue)) { + throw new errors_1.EnvMissingError(formatSpecDescription(spec)); } - catch (e_22_1) { e_22 = { error: e_22_1 }; } - finally { - try { - if (source_7_1 && !source_7_1.done && (_a = source_7.return)) yield __await(_a.call(source_7)); - } - finally { if (e_22) throw e_22.error; } + if (rawValue === undefined) { + // @ts-ignore (fixes #138) Need to figure out why explicitly undefined default/devDefault breaks inference + cleanedEnv[k] = undefined; + throw new errors_1.EnvMissingError(formatSpecDescription(spec)); } - try { - for (var second_3 = __asyncValues(second), second_3_1; second_3_1 = yield __await(second_3.next()), !second_3_1.done;) { - const t = second_3_1.value; - if (dist.has(t)) { - dist.delete(t); - } - else { - dist.add(t); - } - } + else { + cleanedEnv[k] = validateVar({ name: k, spec: spec, rawValue: rawValue }); } - catch (e_23_1) { e_23 = { error: e_23_1 }; } - finally { - try { - if (second_3_1 && !second_3_1.done && (_b = second_3.return)) yield __await(_b.call(second_3)); - } - finally { if (e_23) throw e_23.error; } - } - for (const t of dist) { - yield yield __await(t); - } - }); - }; + } + catch (err) { + if ((options === null || options === void 0 ? void 0 : options.reporter) === null) + throw err; + if (err instanceof Error) + errors[k] = err; + } + } + var reporter = (options === null || options === void 0 ? void 0 : options.reporter) || reporter_1.defaultReporter; + reporter({ errors: errors, env: cleanedEnv }); + return cleanedEnv; } -exports.except = except; -// -// Conversion operators. -// -function toArray() { - return function (source) { - var source_8, source_8_1; - var e_24, _a; - return __awaiter(this, void 0, void 0, function* () { - const ret = []; - try { - for (source_8 = __asyncValues(source); source_8_1 = yield source_8.next(), !source_8_1.done;) { - const t = source_8_1.value; - ret.push(t); - } - } - catch (e_24_1) { e_24 = { error: e_24_1 }; } - finally { - try { - if (source_8_1 && !source_8_1.done && (_a = source_8.return)) yield _a.call(source_8); - } - finally { if (e_24) throw e_24.error; } - } - return ret; - }); - }; +exports.getSanitizedEnv = getSanitizedEnv; +//# sourceMappingURL=core.js.map + +/***/ }), + +/***/ 6125: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.__esModule = true; +exports.testOnly = exports.customCleanEnv = exports.cleanEnv = void 0; +var core_1 = __nccwpck_require__(972); +var middleware_1 = __nccwpck_require__(1639); +/** + * Returns a sanitized, immutable environment object. _Only_ the env vars + * specified in the `validators` parameter will be accessible on the returned + * object. + * @param environment An object containing your env vars (eg. process.env). + * @param specs An object that specifies the format of required vars. + * @param options An object that specifies options for cleanEnv. + */ +function cleanEnv(environment, specs, options) { + if (options === void 0) { options = {}; } + var cleaned = (0, core_1.getSanitizedEnv)(environment, specs, options); + return Object.freeze((0, middleware_1.applyDefaultMiddleware)(cleaned, environment)); } -exports.toArray = toArray; -function toMap(keySelector, elementSelector) { - return function (source) { - var source_9, source_9_1; - var e_25, _a; - return __awaiter(this, void 0, void 0, function* () { - if (elementSelector === undefined) { - elementSelector = x => x; - } - const ret = new Map(); - try { - for (source_9 = __asyncValues(source); source_9_1 = yield source_9.next(), !source_9_1.done;) { - const t = source_9_1.value; - const key = yield keySelector(t); - if (key === undefined) { - throw Error("key selector can't produce a null value"); - } - const val = yield elementSelector(t); - ret.set(key, val); - } - } - catch (e_25_1) { e_25 = { error: e_25_1 }; } - finally { - try { - if (source_9_1 && !source_9_1.done && (_a = source_9.return)) yield _a.call(source_9); - } - finally { if (e_25) throw e_25.error; } - } - return ret; - }); - }; +exports.cleanEnv = cleanEnv; +/** + * Returns a sanitized, immutable environment object, and passes it through a custom + * applyMiddleware function before being frozen. Most users won't need the flexibility of custom + * middleware; prefer cleanEnv() unless you're sure you need it + * + * @param environment An object containing your env vars (eg. process.env). + * @param specs An object that specifies the format of required vars. + * @param applyMiddleware A function that applies transformations to the cleaned env object + * @param options An object that specifies options for cleanEnv. + */ +function customCleanEnv(environment, specs, applyMiddleware, options) { + if (options === void 0) { options = {}; } + var cleaned = (0, core_1.getSanitizedEnv)(environment, specs, options); + return Object.freeze(applyMiddleware(cleaned, environment)); } -exports.toMap = toMap; -function ofType(typeGuard) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_26, _a; - try { - for (var source_10 = __asyncValues(source), source_10_1; source_10_1 = yield __await(source_10.next()), !source_10_1.done;) { - const t = source_10_1.value; - if (typeGuard(t)) { - yield yield __await(t); - } - } +exports.customCleanEnv = customCleanEnv; +/** + * Utility function for providing default values only when NODE_ENV=test + * + * For more context, see https://github.com/af/envalid/issues/32 + */ +var testOnly = function (defaultValueForTests) { + return process.env.NODE_ENV === 'test' ? defaultValueForTests : core_1.testOnlySymbol; // T is not strictly correct, but prevents type errors during usage +}; +exports.testOnly = testOnly; +//# sourceMappingURL=envalid.js.map + +/***/ }), + +/***/ 9150: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// Surprisingly involved error subclassing +// See https://stackoverflow.com/questions/41102060/typescript-extending-error-class +exports.__esModule = true; +exports.EnvMissingError = exports.EnvError = void 0; +var tslib_1 = __nccwpck_require__(9315); +var EnvError = /** @class */ (function (_super) { + tslib_1.__extends(EnvError, _super); + function EnvError(message) { + var _newTarget = this.constructor; + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + Error.captureStackTrace(_this, EnvError); + _this.name = _this.constructor.name; + return _this; + } + return EnvError; +}(TypeError)); +exports.EnvError = EnvError; +var EnvMissingError = /** @class */ (function (_super) { + tslib_1.__extends(EnvMissingError, _super); + function EnvMissingError(message) { + var _newTarget = this.constructor; + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, _newTarget.prototype); + Error.captureStackTrace(_this, EnvMissingError); + _this.name = _this.constructor.name; + return _this; + } + return EnvMissingError; +}(ReferenceError)); +exports.EnvMissingError = EnvMissingError; +//# sourceMappingURL=errors.js.map + +/***/ }), + +/***/ 2322: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.__esModule = true; +var tslib_1 = __nccwpck_require__(9315); +tslib_1.__exportStar(__nccwpck_require__(6125), exports); +tslib_1.__exportStar(__nccwpck_require__(9150), exports); +tslib_1.__exportStar(__nccwpck_require__(1639), exports); +tslib_1.__exportStar(__nccwpck_require__(2938), exports); +tslib_1.__exportStar(__nccwpck_require__(4415), exports); +tslib_1.__exportStar(__nccwpck_require__(3121), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 1639: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.__esModule = true; +exports.applyDefaultMiddleware = exports.accessorMiddleware = exports.strictProxyMiddleware = void 0; +var strictProxyMiddleware = function (envObj, rawEnv) { + var inspectables = [ + 'length', + 'inspect', + 'hasOwnProperty', + 'toJSON', + Symbol.toStringTag, + Symbol.iterator, + // For jest + 'asymmetricMatch', + 'nodeType', + // For react-refresh, see #150 + '$$typeof', + // For libs that use `then` checks to see if objects are Promises (see #74): + 'then', + // For usage with TypeScript esModuleInterop flag + '__esModule', + ]; + var inspectSymbolStrings = ['Symbol(util.inspect.custom)', 'Symbol(nodejs.util.inspect.custom)']; + return new Proxy(envObj, { + get: function (target, name) { + var _a; + // These checks are needed because calling console.log on a + // proxy that throws crashes the entire process. This permits access on + // the necessary properties for `console.log(envObj)`, `envObj.length`, + // `envObj.hasOwnProperty('string')` to work. + if (inspectables.includes(name) || inspectSymbolStrings.includes(name.toString())) { + // @ts-expect-error TS doesn't like symbol types as indexers + return target[name]; } - catch (e_26_1) { e_26 = { error: e_26_1 }; } - finally { - try { - if (source_10_1 && !source_10_1.done && (_a = source_10.return)) yield __await(_a.call(source_10)); + var varExists = target.hasOwnProperty(name); + if (!varExists) { + if (typeof rawEnv === 'object' && ((_a = rawEnv === null || rawEnv === void 0 ? void 0 : rawEnv.hasOwnProperty) === null || _a === void 0 ? void 0 : _a.call(rawEnv, name))) { + throw new ReferenceError("[envalid] Env var ".concat(name, " was accessed but not validated. This var is set in the environment; please add an envalid validator for it.")); } - finally { if (e_26) throw e_26.error; } + throw new ReferenceError("[envalid] Env var not found: ".concat(name)); } - }); - }; -} -exports.ofType = ofType; -// -// Element operators. + return target[name]; + }, + set: function (_target, name) { + throw new TypeError("[envalid] Attempt to mutate environment value: ".concat(name)); + } + }); +}; +exports.strictProxyMiddleware = strictProxyMiddleware; +var accessorMiddleware = function (envObj, rawEnv) { + // Attach is{Prod/Dev/Test} properties for more readable NODE_ENV checks + // Note that isDev and isProd are just aliases to isDevelopment and isProduction + // @ts-ignore attempt to read NODE_ENV even if it's not in the spec + var computedNodeEnv = envObj.NODE_ENV || rawEnv.NODE_ENV; + // If NODE_ENV is not set, assume production + var isProd = !computedNodeEnv || computedNodeEnv === 'production'; + Object.defineProperties(envObj, { + isDevelopment: { value: computedNodeEnv === 'development' }, + isDev: { value: computedNodeEnv === 'development' }, + isProduction: { value: isProd }, + isProd: { value: isProd }, + isTest: { value: computedNodeEnv === 'test' } + }); + return envObj; +}; +exports.accessorMiddleware = accessorMiddleware; +var applyDefaultMiddleware = function (cleanedEnv, rawEnv) { + // Note: Ideally we would declare the default middlewares in an array and apply them in series with + // a generic pipe() function. However, a generically typed variadic pipe() appears to not be possible + // in TypeScript as of 4.x, so we just manually apply them below. See + // https://github.com/microsoft/TypeScript/pull/39094#issuecomment-647042984 + return (0, exports.strictProxyMiddleware)((0, exports.accessorMiddleware)(cleanedEnv, rawEnv), rawEnv); +}; +exports.applyDefaultMiddleware = applyDefaultMiddleware; +//# sourceMappingURL=middleware.js.map + +/***/ }), + +/***/ 3121: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +var _a; +exports.__esModule = true; +exports.defaultReporter = exports.envalidErrorFormatter = void 0; +/* eslint-disable no-console */ +var errors_1 = __nccwpck_require__(9150); +var defaultLogger = console.error.bind(console); +// Apply ANSI colors to the reporter output only if we detect that we're running in Node +var isNode = !!(typeof process === 'object' && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node)); +var colorWith = function (colorCode) { return function (str) { + return isNode ? "\u001B[".concat(colorCode, "m").concat(str, "\u001B[0m") : str; +}; }; +var colors = { + blue: colorWith('34'), + white: colorWith('37'), + yellow: colorWith('33') +}; +var RULE = colors.white('================================'); +// Takes the provided errors, formats them all to an output string, and passes that string output to the +// provided "logger" function. // -function first(predicate) { - return function (source) { - var source_11, source_11_1; - var e_27, _a; - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - try { - for (source_11 = __asyncValues(source); source_11_1 = yield source_11.next(), !source_11_1.done;) { - const t = source_11_1.value; - if ((yield predicate(t)) === true) { - return t; - } - } - } - catch (e_27_1) { e_27 = { error: e_27_1 }; } - finally { - try { - if (source_11_1 && !source_11_1.done && (_a = source_11.return)) yield _a.call(source_11); - } - finally { if (e_27) throw e_27.error; } - } - return Promise.reject("first could not find any elements that match predicate"); - }); +// This is exposed in the public API so third-party reporters can leverage this logic if desired +var envalidErrorFormatter = function (errors, logger) { + if (logger === void 0) { logger = defaultLogger; } + var missingVarsOutput = []; + var invalidVarsOutput = []; + for (var _i = 0, _a = Object.entries(errors); _i < _a.length; _i++) { + var _b = _a[_i], k = _b[0], err = _b[1]; + if (err instanceof errors_1.EnvMissingError) { + missingVarsOutput.push(" ".concat(colors.blue(k), ": ").concat(err.message || '(required)')); + } + else + invalidVarsOutput.push(" ".concat(colors.blue(k), ": ").concat((err === null || err === void 0 ? void 0 : err.message) || '(invalid format)')); + } + // Prepend "header" output for each section of the output: + if (invalidVarsOutput.length) { + invalidVarsOutput.unshift(" ".concat(colors.yellow('Invalid'), " environment variables:")); + } + if (missingVarsOutput.length) { + missingVarsOutput.unshift(" ".concat(colors.yellow('Missing'), " environment variables:")); + } + var output = [ + RULE, + invalidVarsOutput.sort().join('\n'), + missingVarsOutput.sort().join('\n'), + RULE, + ] + .filter(function (x) { return !!x; }) + .join('\n'); + logger(output); +}; +exports.envalidErrorFormatter = envalidErrorFormatter; +var defaultReporter = function (_a, _b) { + var _c = _a.errors, errors = _c === void 0 ? {} : _c; + var _d = _b === void 0 ? { logger: defaultLogger } : _b, onError = _d.onError, logger = _d.logger; + if (!Object.keys(errors).length) + return; + (0, exports.envalidErrorFormatter)(errors, logger); + if (onError) { + onError(errors); + } + else if (isNode) { + logger(colors.yellow('\n Exiting with error code 1')); + process.exit(1); + } + else { + throw new TypeError('Environment validation failed'); + } +}; +exports.defaultReporter = defaultReporter; +//# sourceMappingURL=reporter.js.map + +/***/ }), + +/***/ 2938: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +exports.__esModule = true; +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 4415: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +exports.__esModule = true; +exports.json = exports.url = exports.port = exports.host = exports.email = exports.str = exports.num = exports.bool = exports.makeValidator = void 0; +var tslib_1 = __nccwpck_require__(9315); +var errors_1 = __nccwpck_require__(9150); +// Simplified adaptation of https://github.com/validatorjs/validator.js/blob/master/src/lib/isFQDN.js +var isFQDN = function (input) { + if (!input.length) + return false; + var parts = input.split('.'); + for (var part = void 0, i = 0; i < parts.length; i++) { + part = parts[i]; + if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) + return false; + if (/[\uff01-\uff5e]/.test(part)) + return false; // disallow full-width chars + if (part[0] === '-' || part[part.length - 1] === '-') + return false; + } + return true; +}; +// "best effort" regex-based IP address check +// If you want a more exhaustive check, create your own custom validator, perhaps wrapping this +// implementation (the source of the ipv4 regex below): https://github.com/validatorjs/validator.js/blob/master/src/lib/isIP.js +var ipv4Regex = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/; +var ipv6Regex = /([a-f0-9]+:+)+[a-f0-9]+/; +var isIP = function (input) { + if (!input.length) + return false; + return ipv4Regex.test(input) || ipv6Regex.test(input); +}; +var EMAIL_REGEX = /^[^@\s]+@[^@\s]+\.[^@\s]+$/; // intentionally non-exhaustive +var makeValidator = function (parseFn) { + return function (spec) { + return tslib_1.__assign(tslib_1.__assign({}, spec), { _parse: parseFn }); }; +}; +exports.makeValidator = makeValidator; +// The reason for the function wrapper is to enable the type parameter +// that enables better type inference. For more context, check out the following PR: +// https://github.com/af/envalid/pull/118 +function bool(spec) { + return (0, exports.makeValidator)(function (input) { + switch (input) { + case true: + case 'true': + case 't': + case '1': + return true; + case false: + case 'false': + case 'f': + case '0': + return false; + default: + throw new errors_1.EnvError("Invalid bool input: \"".concat(input, "\"")); + } + })(spec); } -exports.first = first; -function firstOrDefault(defaultValue, predicate) { - return function (source) { - var source_12, source_12_1; - var e_28, _a; - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - try { - for (source_12 = __asyncValues(source); source_12_1 = yield source_12.next(), !source_12_1.done;) { - const t = source_12_1.value; - if ((yield predicate(t)) === true) { - return t; - } - } - } - catch (e_28_1) { e_28 = { error: e_28_1 }; } - finally { - try { - if (source_12_1 && !source_12_1.done && (_a = source_12.return)) yield _a.call(source_12); - } - finally { if (e_28) throw e_28.error; } - } - return defaultValue; - }); - }; +exports.bool = bool; +function num(spec) { + return (0, exports.makeValidator)(function (input) { + var coerced = parseFloat(input); + if (Number.isNaN(coerced)) + throw new errors_1.EnvError("Invalid number input: \"".concat(input, "\"")); + return coerced; + })(spec); } -exports.firstOrDefault = firstOrDefault; -function last(predicate) { - return function (source) { - var source_13, source_13_1; - var e_29, _a; - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - let curr; - try { - for (source_13 = __asyncValues(source); source_13_1 = yield source_13.next(), !source_13_1.done;) { - const t = source_13_1.value; - if ((yield predicate(t)) === true) { - curr = t; - } - } - } - catch (e_29_1) { e_29 = { error: e_29_1 }; } - finally { - try { - if (source_13_1 && !source_13_1.done && (_a = source_13.return)) yield _a.call(source_13); - } - finally { if (e_29) throw e_29.error; } - } - if (curr === undefined) { - return Promise.reject("last could not find any elements that match predicate"); - } - else { - return curr; - } - }); - }; -} -exports.last = last; -function lastOrDefault(defaultValue, predicate) { - return function (source) { - var source_14, source_14_1; - var e_30, _a; - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - let curr; - try { - for (source_14 = __asyncValues(source); source_14_1 = yield source_14.next(), !source_14_1.done;) { - const t = source_14_1.value; - if ((yield predicate(t)) === true) { - curr = t; - } - } - } - catch (e_30_1) { e_30 = { error: e_30_1 }; } - finally { - try { - if (source_14_1 && !source_14_1.done && (_a = source_14.return)) yield _a.call(source_14); - } - finally { if (e_30) throw e_30.error; } - } - if (curr === undefined) { - return defaultValue; - } - else { - return curr; - } - }); - }; -} -exports.lastOrDefault = lastOrDefault; -function single(predicate) { - return function (source) { - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - const seq = yield toArray()(filter(predicate)(source)); - if (seq.length === 0) { - throw Error("single did not find any elements matching the predicate"); - } - else if (seq.length > 1) { - throw Error("single found multiple elements matching the predicate"); - } - return seq[0]; - }); - }; -} -exports.single = single; -function singleOrDefault(defaultValue, predicate) { - return function (source) { - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - const seq = yield toArray()(filter(predicate)(source)); - if (seq.length === 0) { - return defaultValue; - } - else if (seq.length > 1) { - throw Error("single found multiple elements matching the predicate"); - } - else { - return seq[0]; - } - }); - }; -} -exports.singleOrDefault = singleOrDefault; -function elementAt(index) { - return function (source) { - var e_31, _a; - return __awaiter(this, void 0, void 0, function* () { - try { - // TODO: Maybe support `Array` here if we ever support sync iterables. This would allow us - // to access that index directly. - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield _b.next(), !_c.done;) { - const [t, i] = _c.value; - if (i === index) { - return t; - } - } - } - catch (e_31_1) { e_31 = { error: e_31_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } - finally { if (e_31) throw e_31.error; } - } - throw Error(`elementAt tried to find item at index ${index}, but sequence had fewer elements`); - }); - }; -} -exports.elementAt = elementAt; -function elementAtOrDefault(defaultValue, index) { - return function (source) { - var e_32, _a; - return __awaiter(this, void 0, void 0, function* () { - try { - // TODO: Maybe support `Array` here if we ever support sync iterables. This would allow us - // to access that index directly. - for (var _b = __asyncValues(zip(source, sources_1.range(0))), _c; _c = yield _b.next(), !_c.done;) { - const [t, i] = _c.value; - if (i === index) { - return t; - } - } - } - catch (e_32_1) { e_32 = { error: e_32_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } - finally { if (e_32) throw e_32.error; } - } - return defaultValue; - }); - }; -} -exports.elementAtOrDefault = elementAtOrDefault; -function defaultIfEmpty(defaultValue) { - return function (source) { - return __asyncGenerator(this, arguments, function* () { - var e_33, _a; - let sequenceEmpty = true; - try { - for (var source_15 = __asyncValues(source), source_15_1; source_15_1 = yield __await(source_15.next()), !source_15_1.done;) { - const t = source_15_1.value; - sequenceEmpty = false; - yield yield __await(t); - } - } - catch (e_33_1) { e_33 = { error: e_33_1 }; } - finally { - try { - if (source_15_1 && !source_15_1.done && (_a = source_15.return)) yield __await(_a.call(source_15)); - } - finally { if (e_33) throw e_33.error; } - } - if (sequenceEmpty) { - yield yield __await(defaultValue); - } - }); - }; -} -exports.defaultIfEmpty = defaultIfEmpty; -// -// Quantifiers. -// -function any(predicate) { - return function (source) { - var source_16, source_16_1; - var e_34, _a; - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - try { - for (source_16 = __asyncValues(source); source_16_1 = yield source_16.next(), !source_16_1.done;) { - const t = source_16_1.value; - if ((yield predicate(t)) === true) { - return true; - } - } - } - catch (e_34_1) { e_34 = { error: e_34_1 }; } - finally { - try { - if (source_16_1 && !source_16_1.done && (_a = source_16.return)) yield _a.call(source_16); - } - finally { if (e_34) throw e_34.error; } - } - return false; - }); - }; -} -exports.any = any; -function all(predicate) { - return function (source) { - var source_17, source_17_1; - var e_35, _a; - return __awaiter(this, void 0, void 0, function* () { - try { - for (source_17 = __asyncValues(source); source_17_1 = yield source_17.next(), !source_17_1.done;) { - const t = source_17_1.value; - if ((yield predicate(t)) === false) { - return false; - } - } - } - catch (e_35_1) { e_35 = { error: e_35_1 }; } - finally { - try { - if (source_17_1 && !source_17_1.done && (_a = source_17.return)) yield _a.call(source_17); - } - finally { if (e_35) throw e_35.error; } - } - return true; - }); - }; -} -exports.all = all; -function contains(value) { - return function (source) { - var source_18, source_18_1; - var e_36, _a; - return __awaiter(this, void 0, void 0, function* () { - const dist = new Set([value]); - try { - for (source_18 = __asyncValues(source); source_18_1 = yield source_18.next(), !source_18_1.done;) { - const t = source_18_1.value; - if (dist.has(t)) { - return true; - } - } - } - catch (e_36_1) { e_36 = { error: e_36_1 }; } - finally { - try { - if (source_18_1 && !source_18_1.done && (_a = source_18.return)) yield _a.call(source_18); - } - finally { if (e_36) throw e_36.error; } - } - return false; - }); - }; -} -exports.contains = contains; -// -// Aggregate operators. -// -function count(predicate) { - return function (source) { - var source_19, source_19_1; - var e_37, _a; - return __awaiter(this, void 0, void 0, function* () { - if (predicate === undefined) { - predicate = t => true; - } - let n = 0; - try { - for (source_19 = __asyncValues(source); source_19_1 = yield source_19.next(), !source_19_1.done;) { - const t = source_19_1.value; - if ((yield predicate(t)) === true) { - n++; - } - } - } - catch (e_37_1) { e_37 = { error: e_37_1 }; } - finally { - try { - if (source_19_1 && !source_19_1.done && (_a = source_19.return)) yield _a.call(source_19); - } - finally { if (e_37) throw e_37.error; } - } - return n; - }); - }; -} -exports.count = count; -function sum(selector) { - return function (source) { - var source_20, source_20_1; - var e_38, _a; - return __awaiter(this, void 0, void 0, function* () { - // If selector is undefined, the source should emit `number`. - if (selector === undefined) { - selector = t => t; - } - let total = 0; - try { - for (source_20 = __asyncValues(source); source_20_1 = yield source_20.next(), !source_20_1.done;) { - const t = source_20_1.value; - const toSum = yield selector(t); - if (!util_1.isNumber(toSum)) { - throw Error("Can't sum things that aren't numbers"); - } - total += toSum; - } - } - catch (e_38_1) { e_38 = { error: e_38_1 }; } - finally { - try { - if (source_20_1 && !source_20_1.done && (_a = source_20.return)) yield _a.call(source_20); - } - finally { if (e_38) throw e_38.error; } - } - return total; - }); - }; +exports.num = num; +function str(spec) { + return (0, exports.makeValidator)(function (input) { + if (typeof input === 'string') + return input; + throw new errors_1.EnvError("Not a string: \"".concat(input, "\"")); + })(spec); } -exports.sum = sum; -function min(selector) { - return function (source) { - var source_21, source_21_1; - var e_39, _a; - return __awaiter(this, void 0, void 0, function* () { - // If selector is undefined, the source should emit `number`. - if (selector === undefined) { - selector = t => t; - } - let minimum = undefined; - try { - for (source_21 = __asyncValues(source); source_21_1 = yield source_21.next(), !source_21_1.done;) { - const t = source_21_1.value; - const curr = yield selector(t); - if (minimum === undefined) { - minimum = curr; - } - if (!util_1.isNumber(curr)) { - throw Error("min can't find the minimum of things that aren't numbers"); - } - if (minimum > curr) { - minimum = curr; - } - } - } - catch (e_39_1) { e_39 = { error: e_39_1 }; } - finally { - try { - if (source_21_1 && !source_21_1.done && (_a = source_21.return)) yield _a.call(source_21); - } - finally { if (e_39) throw e_39.error; } - } - if (minimum === undefined) { - throw Error("min can't be called on an empty sequence"); - } - return minimum; - }); - }; +exports.str = str; +function email(spec) { + return (0, exports.makeValidator)(function (x) { + if (EMAIL_REGEX.test(x)) + return x; + throw new errors_1.EnvError("Invalid email address: \"".concat(x, "\"")); + })(spec); } -exports.min = min; -function max(selector) { - return function (source) { - var source_22, source_22_1; - var e_40, _a; - return __awaiter(this, void 0, void 0, function* () { - // If selector is undefined, the source should emit `number`. - if (selector === undefined) { - selector = t => t; - } - let maximum = undefined; - try { - for (source_22 = __asyncValues(source); source_22_1 = yield source_22.next(), !source_22_1.done;) { - const t = source_22_1.value; - const curr = yield selector(t); - if (maximum === undefined) { - maximum = curr; - } - if (!util_1.isNumber(curr)) { - throw Error("max can't find the maximum of things that aren't numbers"); - } - if (maximum < curr) { - maximum = curr; - } - } - } - catch (e_40_1) { e_40 = { error: e_40_1 }; } - finally { - try { - if (source_22_1 && !source_22_1.done && (_a = source_22.return)) yield _a.call(source_22); - } - finally { if (e_40) throw e_40.error; } - } - if (maximum === undefined) { - throw Error("max can't be called on an empty sequence"); - } - return maximum; - }); - }; +exports.email = email; +function host(spec) { + return (0, exports.makeValidator)(function (input) { + if (!isFQDN(input) && !isIP(input)) { + throw new errors_1.EnvError("Invalid host (domain or ip): \"".concat(input, "\"")); + } + return input; + })(spec); } -exports.max = max; -function average(selector) { - return function (source) { - var source_23, source_23_1; - var e_41, _a; - return __awaiter(this, void 0, void 0, function* () { - // If selector is undefined, the source should emit `number`. - if (selector === undefined) { - selector = t => t; - } - let total = 0; - let cnt = 0; - try { - for (source_23 = __asyncValues(source); source_23_1 = yield source_23.next(), !source_23_1.done;) { - const t = source_23_1.value; - const toSum = yield selector(t); - if (!util_1.isNumber(toSum)) { - throw Error("Can't sum things that aren't numbers"); - } - total += toSum; - cnt++; - } - } - catch (e_41_1) { e_41 = { error: e_41_1 }; } - finally { - try { - if (source_23_1 && !source_23_1.done && (_a = source_23.return)) yield _a.call(source_23); - } - finally { if (e_41) throw e_41.error; } - } - if (cnt === 0) { - return Promise.reject("Can't compute average of empty sequence"); - } - return total / cnt; - }); - }; +exports.host = host; +function port(spec) { + return (0, exports.makeValidator)(function (input) { + var coerced = +input; + if (Number.isNaN(coerced) || + "".concat(coerced) !== "".concat(input) || + coerced % 1 !== 0 || + coerced < 1 || + coerced > 65535) { + throw new errors_1.EnvError("Invalid port input: \"".concat(input, "\"")); + } + return coerced; + })(spec); } -exports.average = average; -function aggregate(seed, func) { - return function (source) { - var source_24, source_24_1; - var e_42, _a; - return __awaiter(this, void 0, void 0, function* () { - let acc = seed; - try { - for (source_24 = __asyncValues(source); source_24_1 = yield source_24.next(), !source_24_1.done;) { - const t = source_24_1.value; - acc = yield func(acc, t); - } - } - catch (e_42_1) { e_42 = { error: e_42_1 }; } - finally { - try { - if (source_24_1 && !source_24_1.done && (_a = source_24.return)) yield _a.call(source_24); - } - finally { if (e_42) throw e_42.error; } - } - return acc; - }); - }; +exports.port = port; +function url(spec) { + return (0, exports.makeValidator)(function (x) { + try { + new URL(x); + return x; + } + catch (e) { + throw new errors_1.EnvError("Invalid url: \"".concat(x, "\"")); + } + })(spec); } -exports.aggregate = aggregate; -// -// Misc. +exports.url = url; +// It's recommended that you provide an explicit type parameter for json validation +// if you're using TypeScript. Otherwise the output will be typed as `any`. For example: // -function zip(source1, source2, resultSelector = (t1, t2) => [t1, t2]) { - return __asyncGenerator(this, arguments, function* zip_1() { - while (true) { - const result1 = yield __await(source1.next()); - const result2 = yield __await(source2.next()); - if (result1.done || result2.done) { - return yield __await(void 0); - } - else { - yield yield __await(yield __await(resultSelector(result1.value, result2.value))); - } +// cleanEnv({ +// MY_VAR: json<{ foo: number }>({ default: { foo: 123 } }), +// }) +function json(spec) { + return (0, exports.makeValidator)(function (x) { + try { + return JSON.parse(x); } - }); + catch (e) { + throw new errors_1.EnvError("Invalid json: \"".concat(x, "\"")); + } + })(spec); } -exports.zip = zip; - +exports.json = json; +//# sourceMappingURL=validators.js.map /***/ }), -/***/ 48396: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 9315: +/***/ ((module) => { + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); + + +/***/ }), + +/***/ 1585: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +const {PassThrough: PassThroughStream} = __nccwpck_require__(2781); + +module.exports = options => { + options = {...options}; + + const {array} = options; + let {encoding} = options; + const isBuffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || 'utf8'; + } + + if (isBuffer) { + encoding = null; + } + + const stream = new PassThroughStream({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + let length = 0; + const chunks = []; + + stream.on('data', chunk => { + chunks.push(chunk); + + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return chunks; + } + + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); + }; + + stream.getBufferedLength = () => length; + + return stream; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const interfaces_1 = __nccwpck_require__(2830); -const util_1 = __nccwpck_require__(18158); -function range(start, end) { - return __asyncGenerator(this, arguments, function* range_1() { - let i = start; - while (true) { - if (end !== undefined && i >= end) { - return yield __await(void 0); - } - yield yield __await(i++); - } - }); -} -exports.range = range; -function from(source) { - return __asyncGenerator(this, arguments, function* from_1() { - var e_1, _a; - let iter; - if (util_1.isIterable(source) || interfaces_1.isAsyncIterable(source)) { - iter = source; - } - else { - iter = yield __await(source); - } - if (util_1.isIterable(iter)) { - for (const t of iter) { - yield yield __await(t); - } - } - else { - try { - for (var iter_1 = __asyncValues(iter), iter_1_1; iter_1_1 = yield __await(iter_1.next()), !iter_1_1.done;) { - const t = iter_1_1.value; - yield yield __await(t); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iter_1_1 && !iter_1_1.done && (_a = iter_1.return)) yield __await(_a.call(iter_1)); - } - finally { if (e_1) throw e_1.error; } - } - } - }); -} -exports.from = from; /***/ }), -/***/ 18158: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1766: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Copyright 2016-2019, Pulumi Corporation. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -function isAsyncIterable(o) { - return typeof o[Symbol.asyncIterator] === "function"; -} -exports.isAsyncIterable = isAsyncIterable; -function isIterable(o) { - return typeof o[Symbol.iterator] === "function"; +const {constants: BufferConstants} = __nccwpck_require__(4300); +const pump = __nccwpck_require__(8341); +const bufferStream = __nccwpck_require__(1585); + +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } } -exports.isIterable = isIterable; +async function getStream(inputStream, options) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } -/***/ }), + options = { + maxBuffer: Infinity, + ...options + }; -/***/ 7678: -/***/ ((module, exports) => { + const {maxBuffer} = options; -"use strict"; + let stream; + await new Promise((resolve, reject) => { + const rejectPromise = error => { + // Don't retrieve an oversized buffer. + if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream.getBufferedValue(); + } -/// -/// -/// -Object.defineProperty(exports, "__esModule", ({ value: true })); -const typedArrayTypeNames = [ - 'Int8Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'Int16Array', - 'Uint16Array', - 'Int32Array', - 'Uint32Array', - 'Float32Array', - 'Float64Array', - 'BigInt64Array', - 'BigUint64Array' -]; -function isTypedArrayName(name) { - return typedArrayTypeNames.includes(name); -} -const objectTypeNames = [ - 'Function', - 'Generator', - 'AsyncGenerator', - 'GeneratorFunction', - 'AsyncGeneratorFunction', - 'AsyncFunction', - 'Observable', - 'Array', - 'Buffer', - 'Blob', - 'Object', - 'RegExp', - 'Date', - 'Error', - 'Map', - 'Set', - 'WeakMap', - 'WeakSet', - 'ArrayBuffer', - 'SharedArrayBuffer', - 'DataView', - 'Promise', - 'URL', - 'FormData', - 'URLSearchParams', - 'HTMLElement', - ...typedArrayTypeNames -]; -function isObjectTypeName(name) { - return objectTypeNames.includes(name); -} -const primitiveTypeNames = [ - 'null', - 'undefined', - 'string', - 'number', - 'bigint', - 'boolean', - 'symbol' -]; -function isPrimitiveTypeName(name) { - return primitiveTypeNames.includes(name); -} -// eslint-disable-next-line @typescript-eslint/ban-types -function isOfType(type) { - return (value) => typeof value === type; -} -const { toString } = Object.prototype; -const getObjectType = (value) => { - const objectTypeName = toString.call(value).slice(8, -1); - if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) { - return 'HTMLElement'; - } - if (isObjectTypeName(objectTypeName)) { - return objectTypeName; - } - return undefined; -}; -const isObjectOfType = (type) => (value) => getObjectType(value) === type; -function is(value) { - if (value === null) { - return 'null'; - } - switch (typeof value) { - case 'undefined': - return 'undefined'; - case 'string': - return 'string'; - case 'number': - return 'number'; - case 'boolean': - return 'boolean'; - case 'function': - return 'Function'; - case 'bigint': - return 'bigint'; - case 'symbol': - return 'symbol'; - default: - } - if (is.observable(value)) { - return 'Observable'; - } - if (is.array(value)) { - return 'Array'; - } - if (is.buffer(value)) { - return 'Buffer'; - } - const tagType = getObjectType(value); - if (tagType) { - return tagType; - } - if (value instanceof String || value instanceof Boolean || value instanceof Number) { - throw new TypeError('Please don\'t use object wrappers for primitive types'); - } - return 'Object'; + reject(error); + }; + + stream = pump(inputStream, bufferStream(options), error => { + if (error) { + rejectPromise(error); + return; + } + + resolve(); + }); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); + + return stream.getBufferedValue(); } -is.undefined = isOfType('undefined'); -is.string = isOfType('string'); -const isNumberType = isOfType('number'); -is.number = (value) => isNumberType(value) && !is.nan(value); -is.bigint = isOfType('bigint'); -// eslint-disable-next-line @typescript-eslint/ban-types -is.function_ = isOfType('function'); -is.null_ = (value) => value === null; -is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); -is.boolean = (value) => value === true || value === false; -is.symbol = isOfType('symbol'); -is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value)); -is.array = (value, assertion) => { - if (!Array.isArray(value)) { - return false; - } - if (!is.function_(assertion)) { - return true; - } - return value.every(assertion); -}; -is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; }; -is.blob = (value) => isObjectOfType('Blob')(value); -is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); -is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value)); -is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); }; -is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); }; -is.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); }; -is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw); -is.nativePromise = (value) => isObjectOfType('Promise')(value); -const hasPromiseAPI = (value) => { - var _a, _b; - return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) && - is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch); -}; -is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); -is.generatorFunction = isObjectOfType('GeneratorFunction'); -is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction'; -is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction'; -// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types -is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); -is.regExp = isObjectOfType('RegExp'); -is.date = isObjectOfType('Date'); -is.error = isObjectOfType('Error'); -is.map = (value) => isObjectOfType('Map')(value); -is.set = (value) => isObjectOfType('Set')(value); -is.weakMap = (value) => isObjectOfType('WeakMap')(value); -is.weakSet = (value) => isObjectOfType('WeakSet')(value); -is.int8Array = isObjectOfType('Int8Array'); -is.uint8Array = isObjectOfType('Uint8Array'); -is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray'); -is.int16Array = isObjectOfType('Int16Array'); -is.uint16Array = isObjectOfType('Uint16Array'); -is.int32Array = isObjectOfType('Int32Array'); -is.uint32Array = isObjectOfType('Uint32Array'); -is.float32Array = isObjectOfType('Float32Array'); -is.float64Array = isObjectOfType('Float64Array'); -is.bigInt64Array = isObjectOfType('BigInt64Array'); -is.bigUint64Array = isObjectOfType('BigUint64Array'); -is.arrayBuffer = isObjectOfType('ArrayBuffer'); -is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer'); -is.dataView = isObjectOfType('DataView'); -is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value); -is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype; -is.urlInstance = (value) => isObjectOfType('URL')(value); -is.urlString = (value) => { - if (!is.string(value)) { - return false; - } - try { - new URL(value); // eslint-disable-line no-new - return true; - } - catch (_a) { - return false; - } -}; -// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` -is.truthy = (value) => Boolean(value); -// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` -is.falsy = (value) => !value; -is.nan = (value) => Number.isNaN(value); -is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value); -is.integer = (value) => Number.isInteger(value); -is.safeInteger = (value) => Number.isSafeInteger(value); -is.plainObject = (value) => { - // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js - if (toString.call(value) !== '[object Object]') { - return false; - } - const prototype = Object.getPrototypeOf(value); - return prototype === null || prototype === Object.getPrototypeOf({}); -}; -is.typedArray = (value) => isTypedArrayName(getObjectType(value)); -const isValidLength = (value) => is.safeInteger(value) && value >= 0; -is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); -is.inRange = (value, range) => { - if (is.number(range)) { - return value >= Math.min(0, range) && value <= Math.max(range, 0); - } - if (is.array(range) && range.length === 2) { - return value >= Math.min(...range) && value <= Math.max(...range); - } - throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); -}; -const NODE_TYPE_ELEMENT = 1; -const DOM_PROPERTIES_TO_CHECK = [ - 'innerHTML', - 'ownerDocument', - 'style', - 'attributes', - 'nodeValue' -]; -is.domElement = (value) => { - return is.object(value) && - value.nodeType === NODE_TYPE_ELEMENT && - is.string(value.nodeName) && - !is.plainObject(value) && - DOM_PROPERTIES_TO_CHECK.every(property => property in value); -}; -is.observable = (value) => { - var _a, _b, _c, _d; - if (!value) { - return false; - } - // eslint-disable-next-line no-use-extend-native/no-use-extend-native - if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) { - return true; - } - if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) { - return true; - } - return false; -}; -is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value); -is.infinite = (value) => value === Infinity || value === -Infinity; -const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder; -is.evenInteger = isAbsoluteMod2(0); -is.oddInteger = isAbsoluteMod2(1); -is.emptyArray = (value) => is.array(value) && value.length === 0; -is.nonEmptyArray = (value) => is.array(value) && value.length > 0; -is.emptyString = (value) => is.string(value) && value.length === 0; -const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value); -is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); -// TODO: Use `not ''` when the `not` operator is available. -is.nonEmptyString = (value) => is.string(value) && value.length > 0; -// TODO: Use `not ''` when the `not` operator is available. -is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value); -is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; -// TODO: Use `not` operator here to remove `Map` and `Set` from type guard: -// - https://github.com/Microsoft/TypeScript/pull/29317 -is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; -is.emptySet = (value) => is.set(value) && value.size === 0; -is.nonEmptySet = (value) => is.set(value) && value.size > 0; -is.emptyMap = (value) => is.map(value) && value.size === 0; -is.nonEmptyMap = (value) => is.map(value) && value.size > 0; -// `PropertyKey` is any value that can be used as an object key (string, number, or symbol) -is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value); -is.formData = (value) => isObjectOfType('FormData')(value); -is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value); -const predicateOnArray = (method, predicate, values) => { - if (!is.function_(predicate)) { - throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); - } - if (values.length === 0) { - throw new TypeError('Invalid number of values'); - } - return method.call(values, predicate); -}; -is.any = (predicate, ...values) => { - const predicates = is.array(predicate) ? predicate : [predicate]; - return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values)); -}; -is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); -const assertType = (condition, description, value, options = {}) => { - if (!condition) { - const { multipleValues } = options; - const valuesMessage = multipleValues ? - `received values of types ${[ - ...new Set(value.map(singleValue => `\`${is(singleValue)}\``)) - ].join(', ')}` : - `received value of type \`${is(value)}\``; - throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`); - } -}; -exports.assert = { - // Unknowns. - undefined: (value) => assertType(is.undefined(value), 'undefined', value), - string: (value) => assertType(is.string(value), 'string', value), - number: (value) => assertType(is.number(value), 'number', value), - bigint: (value) => assertType(is.bigint(value), 'bigint', value), - // eslint-disable-next-line @typescript-eslint/ban-types - function_: (value) => assertType(is.function_(value), 'Function', value), - null_: (value) => assertType(is.null_(value), 'null', value), - class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value), - boolean: (value) => assertType(is.boolean(value), 'boolean', value), - symbol: (value) => assertType(is.symbol(value), 'symbol', value), - numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value), - array: (value, assertion) => { - const assert = assertType; - assert(is.array(value), 'Array', value); - if (assertion) { - value.forEach(assertion); - } - }, - buffer: (value) => assertType(is.buffer(value), 'Buffer', value), - blob: (value) => assertType(is.blob(value), 'Blob', value), - nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value), - object: (value) => assertType(is.object(value), 'Object', value), - iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value), - asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value), - generator: (value) => assertType(is.generator(value), 'Generator', value), - asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value), - nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value), - promise: (value) => assertType(is.promise(value), 'Promise', value), - generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value), - asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value), - // eslint-disable-next-line @typescript-eslint/ban-types - asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value), - // eslint-disable-next-line @typescript-eslint/ban-types - boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value), - regExp: (value) => assertType(is.regExp(value), 'RegExp', value), - date: (value) => assertType(is.date(value), 'Date', value), - error: (value) => assertType(is.error(value), 'Error', value), - map: (value) => assertType(is.map(value), 'Map', value), - set: (value) => assertType(is.set(value), 'Set', value), - weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value), - weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value), - int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value), - uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value), - uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value), - int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value), - uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value), - int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value), - uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value), - float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value), - float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value), - bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value), - bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value), - arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value), - sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value), - dataView: (value) => assertType(is.dataView(value), 'DataView', value), - enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value), - urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value), - urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value), - truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value), - falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value), - nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value), - primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value), - integer: (value) => assertType(is.integer(value), "integer" /* integer */, value), - safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value), - plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value), - typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value), - arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value), - domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value), - observable: (value) => assertType(is.observable(value), 'Observable', value), - nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value), - infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value), - emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value), - nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value), - emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value), - emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value), - nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value), - nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace" /* nonEmptyStringAndNotWhitespace */, value), - emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value), - nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value), - emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value), - nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value), - emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value), - nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value), - propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value), - formData: (value) => assertType(is.formData(value), 'FormData', value), - urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value), - // Numbers. - evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value), - oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value), - // Two arguments. - directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance), - inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value), - // Variadic functions. - any: (predicate, ...values) => { - return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true }); - }, - all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true }) -}; -// Some few keywords are reserved, but we'll populate them for Node.js users -// See https://github.com/Microsoft/TypeScript/issues/2536 -Object.defineProperties(is, { - class: { - value: is.class_ - }, - function: { - value: is.function_ - }, - null: { - value: is.null_ - } -}); -Object.defineProperties(exports.assert, { - class: { - value: exports.assert.class_ - }, - function: { - value: exports.assert.function_ - }, - null: { - value: exports.assert.null_ - } -}); -exports["default"] = is; -// For CommonJS default export support -module.exports = is; -module.exports["default"] = is; -module.exports.assert = exports.assert; + +module.exports = getStream; +// TODO: Remove this for the next major release +module.exports["default"] = getStream; +module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); +module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); +module.exports.MaxBufferError = MaxBufferError; /***/ }), -/***/ 48097: -/***/ ((module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 9917: +/***/ (function(__unused_webpack_module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -const defer_to_connect_1 = __nccwpck_require__(96214); -const util_1 = __nccwpck_require__(73837); -const nodejsMajorVersion = Number(process.versions.node.split('.')[0]); -const timer = (request) => { - if (request.timings) { - return request.timings; - } - const timings = { - start: Date.now(), - socket: undefined, - lookup: undefined, - connect: undefined, - secureConnect: undefined, - upload: undefined, - response: undefined, - end: undefined, - error: undefined, - abort: undefined, - phases: { - wait: undefined, - dns: undefined, - tcp: undefined, - tls: undefined, - request: undefined, - firstByte: undefined, - download: undefined, - total: undefined - } - }; - request.timings = timings; - const handleError = (origin) => { - const emit = origin.emit.bind(origin); - origin.emit = (event, ...args) => { - // Catches the `error` event - if (event === 'error') { - timings.error = Date.now(); - timings.phases.total = timings.error - timings.start; - origin.emit = emit; - } - // Saves the original behavior - return emit(event, ...args); - }; - }; - handleError(request); - const onAbort = () => { - timings.abort = Date.now(); - // Let the `end` response event be responsible for setting the total phase, - // unless the Node.js major version is >= 13. - if (!timings.response || nodejsMajorVersion >= 13) { - timings.phases.total = Date.now() - timings.start; - } - }; - request.prependOnceListener('abort', onAbort); - const onSocket = (socket) => { - timings.socket = Date.now(); - timings.phases.wait = timings.socket - timings.start; - if (util_1.types.isProxy(socket)) { - return; - } - const lookupListener = () => { - timings.lookup = Date.now(); - timings.phases.dns = timings.lookup - timings.socket; - }; - socket.prependOnceListener('lookup', lookupListener); - defer_to_connect_1.default(socket, { - connect: () => { - timings.connect = Date.now(); - if (timings.lookup === undefined) { - socket.removeListener('lookup', lookupListener); - timings.lookup = timings.connect; - timings.phases.dns = timings.lookup - timings.socket; - } - timings.phases.tcp = timings.connect - timings.lookup; - // This callback is called before flushing any data, - // so we don't need to set `timings.phases.request` here. - }, - secureConnect: () => { - timings.secureConnect = Date.now(); - timings.phases.tls = timings.secureConnect - timings.connect; - } - }); - }; - if (request.socket) { - onSocket(request.socket); - } - else { - request.prependOnceListener('socket', onSocket); - } - const onUpload = () => { - var _a; - timings.upload = Date.now(); - timings.phases.request = timings.upload - ((_a = timings.secureConnect) !== null && _a !== void 0 ? _a : timings.connect); - }; - const writableFinished = () => { - if (typeof request.writableFinished === 'boolean') { - return request.writableFinished; - } - // Node.js doesn't have `request.writableFinished` property - return request.finished && request.outputSize === 0 && (!request.socket || request.socket.writableLength === 0); - }; - if (writableFinished()) { - onUpload(); - } - else { - request.prependOnceListener('finish', onUpload); - } - request.prependOnceListener('response', (response) => { - timings.response = Date.now(); - timings.phases.firstByte = timings.response - timings.upload; - response.timings = timings; - handleError(response); - response.prependOnceListener('end', () => { - timings.end = Date.now(); - timings.phases.download = timings.end - timings.response; - timings.phases.total = timings.end - timings.start; - }); - response.prependOnceListener('aborted', onAbort); - }); - return timings; -}; -exports["default"] = timer; -// For CommonJS default export support -module.exports = timer; -module.exports["default"] = timer; - - -/***/ }), - -/***/ 52488: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var Call = __nccwpck_require__(99933); -var Get = __nccwpck_require__(43705); -var HasProperty = __nccwpck_require__(90390); -var IsCallable = __nccwpck_require__(8626); -var LengthOfArrayLike = __nccwpck_require__(32774); -var ToObject = __nccwpck_require__(90789); -var ToString = __nccwpck_require__(31996); -var callBound = __nccwpck_require__(28803); -var isString = __nccwpck_require__(20639); - -var $TypeError = TypeError; - -// Check failure of by-index access of string characters (IE < 9) and failure of `0 in boxedString` (Rhino) -var boxedString = Object('a'); -var splitString = boxedString[0] !== 'a' || !(0 in boxedString); - -var strSplit = callBound('%String.prototype.split%'); - -module.exports = function reduce(callbackfn) { - var O = ToObject(this); - var self = splitString && isString(O) ? strSplit(O, '') : O; - var len = LengthOfArrayLike(self); - - // If no callback function or if callback is not a callable function - if (!IsCallable(callbackfn)) { - throw new $TypeError('Array.prototype.reduce callback must be a function'); - } - - if (len === 0 && arguments.length < 2) { - throw new $TypeError('reduce of empty array with no initial value'); - } - - var k = 0; - - var accumulator; - var Pk, kPresent; - if (arguments.length > 1) { - accumulator = arguments[1]; - } else { - kPresent = false; - while (!kPresent && k < len) { - Pk = ToString(k); - kPresent = HasProperty(O, Pk); - if (kPresent) { - accumulator = Get(O, Pk); - } - k += 1; - } - if (!kPresent) { - throw new $TypeError('reduce of empty array with no initial value'); - } - } - - while (k < len) { - Pk = ToString(k); - kPresent = HasProperty(O, Pk); - if (kPresent) { - var kValue = Get(O, Pk); - accumulator = Call(callbackfn, void undefined, [accumulator, kValue, k, O]); - } - k += 1; - } - - return accumulator; -}; - - -/***/ }), - -/***/ 29652: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var define = __nccwpck_require__(59234); -var RequireObjectCoercible = __nccwpck_require__(39538); -var callBind = __nccwpck_require__(62977); -var callBound = __nccwpck_require__(28803); - -var implementation = __nccwpck_require__(52488); - -var getPolyfill = __nccwpck_require__(84392); -var polyfill = callBind.apply(getPolyfill()); - -var shim = __nccwpck_require__(57355); - -var $slice = callBound('%Array.prototype.slice%'); - -// eslint-disable-next-line no-unused-vars -var boundShim = function reduce(array, callbackfn) { - RequireObjectCoercible(array); - return polyfill(array, $slice(arguments, 1)); -}; -define(boundShim, { - getPolyfill: getPolyfill, - implementation: implementation, - shim: shim -}); - -module.exports = boundShim; - - -/***/ }), - -/***/ 84392: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var arrayMethodBoxesProperly = __nccwpck_require__(43925); - -var implementation = __nccwpck_require__(52488); - -module.exports = function getPolyfill() { - var method = Array.prototype.reduce; - return arrayMethodBoxesProperly(method) ? method : implementation; -}; - - -/***/ }), - -/***/ 57355: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var define = __nccwpck_require__(59234); -var getPolyfill = __nccwpck_require__(84392); - -module.exports = function shimArrayPrototypeReduce() { - var polyfill = getPolyfill(); - define( - Array.prototype, - { reduce: polyfill }, - { reduce: function () { return Array.prototype.reduce !== polyfill; } } - ); - return polyfill; -}; - - -/***/ }), - -/***/ 87943: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var rawAsap = __nccwpck_require__(83691); -var freeTasks = []; - -/** - * Calls a task as soon as possible after returning, in its own event, with - * priority over IO events. An exception thrown in a task can be handled by - * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise - * crash the process. If the error is handled, all subsequent tasks will - * resume. - * - * @param {{call}} task A callable object, typically a function that takes no - * arguments. - */ -module.exports = asap; -function asap(task) { - var rawTask; - if (freeTasks.length) { - rawTask = freeTasks.pop(); - } else { - rawTask = new RawTask(); - } - rawTask.task = task; - rawTask.domain = process.domain; - rawAsap(rawTask); -} - -function RawTask() { - this.task = null; - this.domain = null; -} - -RawTask.prototype.call = function () { - if (this.domain) { - this.domain.enter(); - } - var threw = true; - try { - this.task.call(); - threw = false; - // If the task throws an exception (presumably) Node.js restores the - // domain stack for the next event. - if (this.domain) { - this.domain.exit(); - } - } finally { - // We use try/finally and a threw flag to avoid messing up stack traces - // when we catch and release errors. - if (threw) { - // In Node.js, uncaught exceptions are considered fatal errors. - // Re-throw them to interrupt flushing! - // Ensure that flushing continues if an uncaught exception is - // suppressed listening process.on("uncaughtException") or - // domain.on("error"). - rawAsap.requestFlush(); - } - // If the task threw an error, we do not want to exit the domain here. - // Exiting the domain would prevent the domain from catching the error. - this.task = null; - this.domain = null; - freeTasks.push(this); - } -}; - - - -/***/ }), - -/***/ 83691: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var domain; // The domain module is executed on demand -var hasSetImmediate = typeof setImmediate === "function"; - -// Use the fastest means possible to execute a task in its own turn, with -// priority over other events including network IO events in Node.js. -// -// An exception thrown by a task will permanently interrupt the processing of -// subsequent tasks. The higher level `asap` function ensures that if an -// exception is thrown by a task, that the task queue will continue flushing as -// soon as possible, but if you use `rawAsap` directly, you are responsible to -// either ensure that no exceptions are thrown from your task, or to manually -// call `rawAsap.requestFlush` if an exception is thrown. -module.exports = rawAsap; -function rawAsap(task) { - if (!queue.length) { - requestFlush(); - flushing = true; - } - // Avoids a function call - queue[queue.length] = task; -} - -var queue = []; -// Once a flush has been requested, no further calls to `requestFlush` are -// necessary until the next `flush` completes. -var flushing = false; -// The position of the next task to execute in the task queue. This is -// preserved between calls to `flush` so that it can be resumed if -// a task throws an exception. -var index = 0; -// If a task schedules additional tasks recursively, the task queue can grow -// unbounded. To prevent memory excaustion, the task queue will periodically -// truncate already-completed tasks. -var capacity = 1024; - -// The flush function processes all tasks that have been scheduled with -// `rawAsap` unless and until one of those tasks throws an exception. -// If a task throws an exception, `flush` ensures that its state will remain -// consistent and will resume where it left off when called again. -// However, `flush` does not make any arrangements to be called again if an -// exception is thrown. -function flush() { - while (index < queue.length) { - var currentIndex = index; - // Advance the index before calling the task. This ensures that we will - // begin flushing on the next task the task throws an error. - index = index + 1; - queue[currentIndex].call(); - // Prevent leaking memory for long chains of recursive calls to `asap`. - // If we call `asap` within tasks scheduled by `asap`, the queue will - // grow, but to avoid an O(n) walk for every task we execute, we don't - // shift tasks off the queue after they have been executed. - // Instead, we periodically shift 1024 tasks off the queue. - if (index > capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { - queue[scan] = queue[scan + index]; - } - queue.length -= index; - index = 0; - } - } - queue.length = 0; - index = 0; - flushing = false; -} - -rawAsap.requestFlush = requestFlush; -function requestFlush() { - // Ensure flushing is not bound to any domain. - // It is not sufficient to exit the domain, because domains exist on a stack. - // To execute code outside of any domain, the following dance is necessary. - var parentDomain = process.domain; - if (parentDomain) { - if (!domain) { - // Lazy execute the domain module. - // Only employed if the user elects to use domains. - domain = __nccwpck_require__(13639); - } - domain.active = process.domain = null; - } - - // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` - // cannot handle recursion. - // `requestFlush` will only be called recursively from `asap.js`, to resume - // flushing after an error is thrown into a domain. - // Conveniently, `setImmediate` was introduced in the same version - // `process.nextTick` started throwing recursion errors. - if (flushing && hasSetImmediate) { - setImmediate(flush); - } else { - process.nextTick(flush); - } - - if (parentDomain) { - domain.active = process.domain = parentDomain; - } -} - - -/***/ }), - -/***/ 9417: -/***/ ((module) => { - -"use strict"; - -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} - - -/***/ }), - -/***/ 83682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var register = __nccwpck_require__(44670) -var addHook = __nccwpck_require__(5549) -var removeHook = __nccwpck_require__(6819) - -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) - -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) -} - -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook -} - -function HookCollection () { - var state = { - registry: {} - } - - var hook = register.bind(null, state) - bindApi(hook, state) - - return hook -} - -var collectionHookDeprecationMessageDisplayed = false -function Hook () { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true - } - return HookCollection() -} - -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() - -module.exports = Hook -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection - - -/***/ }), - -/***/ 5549: -/***/ ((module) => { - -module.exports = addHook; - -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } - - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; - } - - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; - } - - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; - } - - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} - - -/***/ }), - -/***/ 44670: -/***/ ((module) => { - -module.exports = register; - -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - - if (!options) { - options = {}; - } - - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } - - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); - } - - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} - - -/***/ }), - -/***/ 6819: -/***/ ((module) => { - -module.exports = removeHook; - -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); - - if (index === -1) { - return; - } - - state.registry[name].splice(index, 1); -} - - -/***/ }), - -/***/ 33717: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var concatMap = __nccwpck_require__(86891); -var balanced = __nccwpck_require__(9417); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - - - -/***/ }), - -/***/ 93018: -/***/ ((module) => { - -/* eslint-disable node/no-deprecated-api */ - -var toString = Object.prototype.toString - -var isModern = ( - typeof Buffer !== 'undefined' && - typeof Buffer.alloc === 'function' && - typeof Buffer.allocUnsafe === 'function' && - typeof Buffer.from === 'function' -) - -function isArrayBuffer (input) { - return toString.call(input).slice(8, -1) === 'ArrayBuffer' -} - -function fromArrayBuffer (obj, byteOffset, length) { - byteOffset >>>= 0 - - var maxLength = obj.byteLength - byteOffset - - if (maxLength < 0) { - throw new RangeError("'offset' is out of bounds") - } - - if (length === undefined) { - length = maxLength - } else { - length >>>= 0 - - if (length > maxLength) { - throw new RangeError("'length' is out of bounds") - } - } - - return isModern - ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) - : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) -} - -function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - return isModern - ? Buffer.from(string, encoding) - : new Buffer(string, encoding) -} - -function bufferFrom (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (isArrayBuffer(value)) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - return isModern - ? Buffer.from(value) - : new Buffer(value) -} - -module.exports = bufferFrom - - -/***/ }), - -/***/ 2286: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const { - V4MAPPED, - ADDRCONFIG, - ALL, - promises: { - Resolver: AsyncResolver - }, - lookup: dnsLookup -} = __nccwpck_require__(9523); -const {promisify} = __nccwpck_require__(73837); -const os = __nccwpck_require__(22037); - -const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); -const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); -const kExpires = Symbol('expires'); - -const supportsALL = typeof ALL === 'number'; - -const verifyAgent = agent => { - if (!(agent && typeof agent.createConnection === 'function')) { - throw new Error('Expected an Agent instance as the first argument'); - } -}; - -const map4to6 = entries => { - for (const entry of entries) { - if (entry.family === 6) { - continue; - } - - entry.address = `::ffff:${entry.address}`; - entry.family = 6; - } -}; - -const getIfaceInfo = () => { - let has4 = false; - let has6 = false; - - for (const device of Object.values(os.networkInterfaces())) { - for (const iface of device) { - if (iface.internal) { - continue; - } - - if (iface.family === 'IPv6') { - has6 = true; - } else { - has4 = true; - } - - if (has4 && has6) { - return {has4, has6}; - } - } - } - - return {has4, has6}; -}; - -const isIterable = map => { - return Symbol.iterator in map; -}; - -const ttl = {ttl: true}; -const all = {all: true}; - -class CacheableLookup { - constructor({ - cache = new Map(), - maxTtl = Infinity, - fallbackDuration = 3600, - errorTtl = 0.15, - resolver = new AsyncResolver(), - lookup = dnsLookup - } = {}) { - this.maxTtl = maxTtl; - this.errorTtl = errorTtl; - - this._cache = cache; - this._resolver = resolver; - this._dnsLookup = promisify(lookup); - - if (this._resolver instanceof AsyncResolver) { - this._resolve4 = this._resolver.resolve4.bind(this._resolver); - this._resolve6 = this._resolver.resolve6.bind(this._resolver); - } else { - this._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver)); - this._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver)); - } - - this._iface = getIfaceInfo(); - - this._pending = {}; - this._nextRemovalTime = false; - this._hostnamesToFallback = new Set(); - - if (fallbackDuration < 1) { - this._fallback = false; - } else { - this._fallback = true; - - const interval = setInterval(() => { - this._hostnamesToFallback.clear(); - }, fallbackDuration * 1000); - - /* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */ - if (interval.unref) { - interval.unref(); - } - } - - this.lookup = this.lookup.bind(this); - this.lookupAsync = this.lookupAsync.bind(this); - } - - set servers(servers) { - this.clear(); - - this._resolver.setServers(servers); - } - - get servers() { - return this._resolver.getServers(); - } - - lookup(hostname, options, callback) { - if (typeof options === 'function') { - callback = options; - options = {}; - } else if (typeof options === 'number') { - options = { - family: options - }; - } - - if (!callback) { - throw new Error('Callback must be a function.'); - } - - // eslint-disable-next-line promise/prefer-await-to-then - this.lookupAsync(hostname, options).then(result => { - if (options.all) { - callback(null, result); - } else { - callback(null, result.address, result.family, result.expires, result.ttl); - } - }, callback); - } - - async lookupAsync(hostname, options = {}) { - if (typeof options === 'number') { - options = { - family: options - }; - } - - let cached = await this.query(hostname); - - if (options.family === 6) { - const filtered = cached.filter(entry => entry.family === 6); - - if (options.hints & V4MAPPED) { - if ((supportsALL && options.hints & ALL) || filtered.length === 0) { - map4to6(cached); - } else { - cached = filtered; - } - } else { - cached = filtered; - } - } else if (options.family === 4) { - cached = cached.filter(entry => entry.family === 4); - } - - if (options.hints & ADDRCONFIG) { - const {_iface} = this; - cached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4); - } - - if (cached.length === 0) { - const error = new Error(`cacheableLookup ENOTFOUND ${hostname}`); - error.code = 'ENOTFOUND'; - error.hostname = hostname; - - throw error; - } - - if (options.all) { - return cached; - } - - return cached[0]; - } - - async query(hostname) { - let cached = await this._cache.get(hostname); - - if (!cached) { - const pending = this._pending[hostname]; - - if (pending) { - cached = await pending; - } else { - const newPromise = this.queryAndCache(hostname); - this._pending[hostname] = newPromise; - - try { - cached = await newPromise; - } finally { - delete this._pending[hostname]; - } - } - } - - cached = cached.map(entry => { - return {...entry}; - }); - - return cached; - } - - async _resolve(hostname) { - const wrap = async promise => { - try { - return await promise; - } catch (error) { - if (error.code === 'ENODATA' || error.code === 'ENOTFOUND') { - return []; - } - - throw error; - } - }; - - // ANY is unsafe as it doesn't trigger new queries in the underlying server. - const [A, AAAA] = await Promise.all([ - this._resolve4(hostname, ttl), - this._resolve6(hostname, ttl) - ].map(promise => wrap(promise))); - - let aTtl = 0; - let aaaaTtl = 0; - let cacheTtl = 0; - - const now = Date.now(); - - for (const entry of A) { - entry.family = 4; - entry.expires = now + (entry.ttl * 1000); - - aTtl = Math.max(aTtl, entry.ttl); - } - - for (const entry of AAAA) { - entry.family = 6; - entry.expires = now + (entry.ttl * 1000); - - aaaaTtl = Math.max(aaaaTtl, entry.ttl); - } - - if (A.length > 0) { - if (AAAA.length > 0) { - cacheTtl = Math.min(aTtl, aaaaTtl); - } else { - cacheTtl = aTtl; - } - } else { - cacheTtl = aaaaTtl; - } - - return { - entries: [ - ...A, - ...AAAA - ], - cacheTtl - }; - } - - async _lookup(hostname) { - try { - const entries = await this._dnsLookup(hostname, { - all: true - }); - - return { - entries, - cacheTtl: 0 - }; - } catch (_) { - return { - entries: [], - cacheTtl: 0 - }; - } - } - - async _set(hostname, data, cacheTtl) { - if (this.maxTtl > 0 && cacheTtl > 0) { - cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000; - data[kExpires] = Date.now() + cacheTtl; - - try { - await this._cache.set(hostname, data, cacheTtl); - } catch (error) { - this.lookupAsync = async () => { - const cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.'); - cacheError.cause = error; - - throw cacheError; - }; - } - - if (isIterable(this._cache)) { - this._tick(cacheTtl); - } - } - } - - async queryAndCache(hostname) { - if (this._hostnamesToFallback.has(hostname)) { - return this._dnsLookup(hostname, all); - } - - let query = await this._resolve(hostname); - - if (query.entries.length === 0 && this._fallback) { - query = await this._lookup(hostname); - - if (query.entries.length !== 0) { - // Use `dns.lookup(...)` for that particular hostname - this._hostnamesToFallback.add(hostname); - } - } - - const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl; - await this._set(hostname, query.entries, cacheTtl); - - return query.entries; - } - - _tick(ms) { - const nextRemovalTime = this._nextRemovalTime; - - if (!nextRemovalTime || ms < nextRemovalTime) { - clearTimeout(this._removalTimeout); - - this._nextRemovalTime = ms; - - this._removalTimeout = setTimeout(() => { - this._nextRemovalTime = false; - - let nextExpiry = Infinity; - - const now = Date.now(); - - for (const [hostname, entries] of this._cache) { - const expires = entries[kExpires]; - - if (now >= expires) { - this._cache.delete(hostname); - } else if (expires < nextExpiry) { - nextExpiry = expires; - } - } - - if (nextExpiry !== Infinity) { - this._tick(nextExpiry - now); - } - }, ms); - - /* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */ - if (this._removalTimeout.unref) { - this._removalTimeout.unref(); - } - } - } - - install(agent) { - verifyAgent(agent); - - if (kCacheableLookupCreateConnection in agent) { - throw new Error('CacheableLookup has been already installed'); - } - - agent[kCacheableLookupCreateConnection] = agent.createConnection; - agent[kCacheableLookupInstance] = this; - - agent.createConnection = (options, callback) => { - if (!('lookup' in options)) { - options.lookup = this.lookup; - } - - return agent[kCacheableLookupCreateConnection](options, callback); - }; - } - - uninstall(agent) { - verifyAgent(agent); - - if (agent[kCacheableLookupCreateConnection]) { - if (agent[kCacheableLookupInstance] !== this) { - throw new Error('The agent is not owned by this CacheableLookup instance'); - } - - agent.createConnection = agent[kCacheableLookupCreateConnection]; - - delete agent[kCacheableLookupCreateConnection]; - delete agent[kCacheableLookupInstance]; - } - } - - updateInterfaceInfo() { - const {_iface} = this; - - this._iface = getIfaceInfo(); - - if ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) { - this._cache.clear(); - } - } - - clear(hostname) { - if (hostname) { - this._cache.delete(hostname); - return; - } - - this._cache.clear(); - } -} - -module.exports = CacheableLookup; -module.exports["default"] = CacheableLookup; - - -/***/ }), - -/***/ 78116: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const EventEmitter = __nccwpck_require__(82361); -const urlLib = __nccwpck_require__(57310); -const normalizeUrl = __nccwpck_require__(17952); -const getStream = __nccwpck_require__(21766); -const CachePolicy = __nccwpck_require__(61002); -const Response = __nccwpck_require__(9004); -const lowercaseKeys = __nccwpck_require__(9662); -const cloneResponse = __nccwpck_require__(81312); -const Keyv = __nccwpck_require__(51531); - -class CacheableRequest { - constructor(request, cacheAdapter) { - if (typeof request !== 'function') { - throw new TypeError('Parameter `request` must be a function'); - } - - this.cache = new Keyv({ - uri: typeof cacheAdapter === 'string' && cacheAdapter, - store: typeof cacheAdapter !== 'string' && cacheAdapter, - namespace: 'cacheable-request' - }); - - return this.createCacheableRequest(request); - } - - createCacheableRequest(request) { - return (opts, cb) => { - let url; - if (typeof opts === 'string') { - url = normalizeUrlObject(urlLib.parse(opts)); - opts = {}; - } else if (opts instanceof urlLib.URL) { - url = normalizeUrlObject(urlLib.parse(opts.toString())); - opts = {}; - } else { - const [pathname, ...searchParts] = (opts.path || '').split('?'); - const search = searchParts.length > 0 ? - `?${searchParts.join('?')}` : - ''; - url = normalizeUrlObject({ ...opts, pathname, search }); - } - - opts = { - headers: {}, - method: 'GET', - cache: true, - strictTtl: false, - automaticFailover: false, - ...opts, - ...urlObjectToRequestOptions(url) - }; - opts.headers = lowercaseKeys(opts.headers); - - const ee = new EventEmitter(); - const normalizedUrlString = normalizeUrl( - urlLib.format(url), - { - stripWWW: false, - removeTrailingSlash: false, - stripAuthentication: false - } - ); - const key = `${opts.method}:${normalizedUrlString}`; - let revalidate = false; - let madeRequest = false; - - const makeRequest = opts => { - madeRequest = true; - let requestErrored = false; - let requestErrorCallback; - - const requestErrorPromise = new Promise(resolve => { - requestErrorCallback = () => { - if (!requestErrored) { - requestErrored = true; - resolve(); - } - }; - }); - - const handler = response => { - if (revalidate && !opts.forceRefresh) { - response.status = response.statusCode; - const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); - if (!revalidatedPolicy.modified) { - const headers = revalidatedPolicy.policy.responseHeaders(); - response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); - response.cachePolicy = revalidatedPolicy.policy; - response.fromCache = true; - } - } - - if (!response.fromCache) { - response.cachePolicy = new CachePolicy(opts, response, opts); - response.fromCache = false; - } - - let clonedResponse; - if (opts.cache && response.cachePolicy.storable()) { - clonedResponse = cloneResponse(response); - - (async () => { - try { - const bodyPromise = getStream.buffer(response); - - await Promise.race([ - requestErrorPromise, - new Promise(resolve => response.once('end', resolve)) - ]); - - if (requestErrored) { - return; - } - - const body = await bodyPromise; - - const value = { - cachePolicy: response.cachePolicy.toObject(), - url: response.url, - statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, - body - }; - - let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; - if (opts.maxTtl) { - ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; - } - - await this.cache.set(key, value, ttl); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } else if (opts.cache && revalidate) { - (async () => { - try { - await this.cache.delete(key); - } catch (error) { - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - } - - ee.emit('response', clonedResponse || response); - if (typeof cb === 'function') { - cb(clonedResponse || response); - } - }; - - try { - const req = request(opts, handler); - req.once('error', requestErrorCallback); - req.once('abort', requestErrorCallback); - ee.emit('request', req); - } catch (error) { - ee.emit('error', new CacheableRequest.RequestError(error)); - } - }; - - (async () => { - const get = async opts => { - await Promise.resolve(); - - const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; - if (typeof cacheEntry === 'undefined') { - return makeRequest(opts); - } - - const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); - if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { - const headers = policy.responseHeaders(); - const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); - response.cachePolicy = policy; - response.fromCache = true; - - ee.emit('response', response); - if (typeof cb === 'function') { - cb(response); - } - } else { - revalidate = cacheEntry; - opts.headers = policy.revalidationHeaders(opts); - makeRequest(opts); - } - }; - - const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); - this.cache.once('error', errorHandler); - ee.on('response', () => this.cache.removeListener('error', errorHandler)); - - try { - await get(opts); - } catch (error) { - if (opts.automaticFailover && !madeRequest) { - makeRequest(opts); - } - - ee.emit('error', new CacheableRequest.CacheError(error)); - } - })(); - - return ee; - }; - } -} - -function urlObjectToRequestOptions(url) { - const options = { ...url }; - options.path = `${url.pathname || '/'}${url.search || ''}`; - delete options.pathname; - delete options.search; - return options; -} - -function normalizeUrlObject(url) { - // If url was parsed by url.parse or new URL: - // - hostname will be set - // - host will be hostname[:port] - // - port will be set if it was explicit in the parsed string - // Otherwise, url was from request options: - // - hostname or host may be set - // - host shall not have port encoded - return { - protocol: url.protocol, - auth: url.auth, - hostname: url.hostname || url.host || 'localhost', - port: url.port, - pathname: url.pathname, - search: url.search - }; -} - -CacheableRequest.RequestError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'RequestError'; - Object.assign(this, error); - } -}; - -CacheableRequest.CacheError = class extends Error { - constructor(error) { - super(error.message); - this.name = 'CacheError'; - Object.assign(this, error); - } -}; - -module.exports = CacheableRequest; - - -/***/ }), - -/***/ 28803: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var GetIntrinsic = __nccwpck_require__(74538); - -var callBind = __nccwpck_require__(62977); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; - - -/***/ }), - -/***/ 62977: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var bind = __nccwpck_require__(88334); -var GetIntrinsic = __nccwpck_require__(74538); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} - - -/***/ }), - -/***/ 69372: -/***/ ((module) => { - -"use strict"; - - -// We define these manually to ensure they're always copied -// even if they would move up the prototype chain -// https://nodejs.org/api/http.html#http_class_http_incomingmessage -const knownProps = [ - 'destroy', - 'setTimeout', - 'socket', - 'headers', - 'trailers', - 'rawHeaders', - 'statusCode', - 'httpVersion', - 'httpVersionMinor', - 'httpVersionMajor', - 'rawTrailers', - 'statusMessage' -]; - -module.exports = (fromStream, toStream) => { - const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); - - for (const prop of fromProps) { - // Don't overwrite existing properties - if (prop in toStream) { - continue; - } - - toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; - } -}; - - -/***/ }), - -/***/ 81312: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const PassThrough = (__nccwpck_require__(12781).PassThrough); -const mimicResponse = __nccwpck_require__(69372); - -const cloneResponse = response => { - if (!(response && response.pipe)) { - throw new TypeError('Parameter `response` must be a response stream.'); - } - - const clone = new PassThrough(); - mimicResponse(response, clone); - - return response.pipe(clone); -}; - -module.exports = cloneResponse; - - -/***/ }), - -/***/ 85728: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const { promisify } = __nccwpck_require__(73837) -const JSONB = __nccwpck_require__(22820) -const zlib = __nccwpck_require__(59796) - -const mergeOptions = __nccwpck_require__(44968) - -const compress = promisify(zlib.brotliCompress) - -const decompress = promisify(zlib.brotliDecompress) - -const identity = val => val - -const createCompress = ({ - enable = true, - serialize = JSONB.stringify, - deserialize = JSONB.parse, - compressOptions, - decompressOptions -} = {}) => { - if (!enable) { - return { serialize, deserialize, decompress: identity, compress: identity } - } - - return { - serialize, - deserialize, - compress: async (data, options = {}) => { - if (data === undefined) return data - const serializedData = serialize(data) - return compress(serializedData, mergeOptions(compressOptions, options)) - }, - decompress: async (data, options = {}) => { - if (data === undefined) return data - return deserialize( - await decompress(data, mergeOptions(decompressOptions, options)) - ) - } - } -} - -module.exports = createCompress -module.exports.stringify = JSONB.stringify -module.exports.parse = JSONB.parse - - -/***/ }), - -/***/ 44968: -/***/ ((module) => { - -"use strict"; - - -module.exports = (defaultOptions = {}, options = {}) => { - const params = { - ...(defaultOptions.params || {}), - ...(options.params || {}) - } - - return { - ...defaultOptions, - ...options, - ...(Object.keys(params).length - ? { - params - } - : {}) - } -} - - -/***/ }), - -/***/ 86891: -/***/ ((module) => { - -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - - -/***/ }), - -/***/ 31757: -/***/ ((module, exports, __nccwpck_require__) => { - -var util = __nccwpck_require__(73837); - -module.exports = (util && util.debuglog) || debuglog; - -var debugs = {}; -var debugEnviron = process.env.NODE_DEBUG || ''; - -function debuglog(set) { - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = process.pid; - debugs[set] = function() { - var msg = util.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/***/ }), - -/***/ 82391: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const {Transform, PassThrough} = __nccwpck_require__(12781); -const zlib = __nccwpck_require__(59796); -const mimicResponse = __nccwpck_require__(42610); - -module.exports = response => { - const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase(); - - if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) { - return response; - } - - // TODO: Remove this when targeting Node.js 12. - const isBrotli = contentEncoding === 'br'; - if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') { - response.destroy(new Error('Brotli is not supported on Node.js < 12')); - return response; - } - - let isEmpty = true; - - const checker = new Transform({ - transform(data, _encoding, callback) { - isEmpty = false; - - callback(null, data); - }, - - flush(callback) { - callback(); - } - }); - - const finalStream = new PassThrough({ - autoDestroy: false, - destroy(error, callback) { - response.destroy(); - - callback(error); - } - }); - - const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); - - decompressStream.once('error', error => { - if (isEmpty && !response.readable) { - finalStream.end(); - return; - } - - finalStream.destroy(error); - }); - - mimicResponse(response, finalStream); - response.pipe(checker).pipe(decompressStream).pipe(finalStream); - - return finalStream; -}; - - -/***/ }), - -/***/ 35281: -/***/ ((module) => { - -"use strict"; - - -function dedent(strings) { - - var raw = void 0; - if (typeof strings === "string") { - // dedent can be used as a plain function - raw = [strings]; - } else { - raw = strings.raw; - } - - // first, perform interpolation - var result = ""; - for (var i = 0; i < raw.length; i++) { - result += raw[i]. - // join lines when there is a suppressed newline - replace(/\\\n[ \t]*/g, ""). - - // handle escaped backticks - replace(/\\`/g, "`"); - - if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { - result += arguments.length <= i + 1 ? undefined : arguments[i + 1]; - } - } - - // now strip indentation - var lines = result.split("\n"); - var mindent = null; - lines.forEach(function (l) { - var m = l.match(/^(\s+)\S+/); - if (m) { - var indent = m[1].length; - if (!mindent) { - // this is the first indented line - mindent = indent; - } else { - mindent = Math.min(mindent, indent); - } - } - }); - - if (mindent !== null) { - result = lines.map(function (l) { - return l[0] === " " ? l.slice(mindent) : l; - }).join("\n"); - } - - // dedent eats leading and trailing whitespace too - result = result.trim(); - - // handle escaped newlines at the end to ensure they don't get stripped too - return result.replace(/\\n/g, "\n"); -} - -if (true) { - module.exports = dedent; -} - - -/***/ }), - -/***/ 96214: -/***/ ((module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -function isTLSSocket(socket) { - return socket.encrypted; -} -const deferToConnect = (socket, fn) => { - let listeners; - if (typeof fn === 'function') { - const connect = fn; - listeners = { connect }; - } - else { - listeners = fn; - } - const hasConnectListener = typeof listeners.connect === 'function'; - const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; - const hasCloseListener = typeof listeners.close === 'function'; - const onConnect = () => { - if (hasConnectListener) { - listeners.connect(); - } - if (isTLSSocket(socket) && hasSecureConnectListener) { - if (socket.authorized) { - listeners.secureConnect(); - } - else if (!socket.authorizationError) { - socket.once('secureConnect', listeners.secureConnect); - } - } - if (hasCloseListener) { - socket.once('close', listeners.close); - } - }; - if (socket.writable && !socket.connecting) { - onConnect(); - } - else if (socket.connecting) { - socket.once('connect', onConnect); - } - else if (socket.destroyed && hasCloseListener) { - listeners.close(socket._hadError); - } -}; -exports["default"] = deferToConnect; -// For CommonJS default export support -module.exports = deferToConnect; -module.exports["default"] = deferToConnect; - - -/***/ }), - -/***/ 59234: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var keys = __nccwpck_require__(70137); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; - -var toStr = Object.prototype.toString; -var concat = Array.prototype.concat; -var origDefineProperty = Object.defineProperty; - -var isFunction = function (fn) { - return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; -}; - -var hasPropertyDescriptors = __nccwpck_require__(90176)(); - -var supportsDescriptors = origDefineProperty && hasPropertyDescriptors; - -var defineProperty = function (object, name, value, predicate) { - if (name in object && (!isFunction(predicate) || !predicate())) { - return; - } - if (supportsDescriptors) { - origDefineProperty(object, name, { - configurable: true, - enumerable: false, - value: value, - writable: true - }); - } else { - object[name] = value; // eslint-disable-line no-param-reassign - } -}; - -var defineProperties = function (object, map) { - var predicates = arguments.length > 2 ? arguments[2] : {}; - var props = keys(map); - if (hasSymbols) { - props = concat.call(props, Object.getOwnPropertySymbols(map)); - } - for (var i = 0; i < props.length; i += 1) { - defineProperty(object, props[i], map[props[i]], predicates[props[i]]); - } -}; - -defineProperties.supportsDescriptors = !!supportsDescriptors; - -module.exports = defineProperties; - - -/***/ }), - -/***/ 58932: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; - } - -} - -exports.Deprecation = Deprecation; - - -/***/ }), - -/***/ 74308: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var wrappy = __nccwpck_require__(62940) -module.exports = wrappy(dezalgo) - -var asap = __nccwpck_require__(87943) - -function dezalgo (cb) { - var sync = true - asap(function () { - sync = false - }) - - return function zalgoSafe() { - var args = arguments - var me = this - if (sync) - asap(function() { - cb.apply(me, args) - }) - else - cb.apply(me, args) - } -} - - -/***/ }), - -/***/ 81205: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var once = __nccwpck_require__(1223); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - var cancelled = false; - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback.call(stream); - }; - - var onend = function() { - readable = false; - if (!writable) callback.call(stream); - }; - - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); - }; - - var onerror = function(err) { - callback.call(stream, err); - }; - - var onclose = function() { - process.nextTick(onclosenexttick); - }; - - var onclosenexttick = function() { - if (cancelled) return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); - if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - if (isChildProcess(stream)) stream.on('exit', onexit); - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - - return function() { - cancelled = true; - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('exit', onexit); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos; - - -/***/ }), - -/***/ 10972: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.__esModule = true; -exports.getSanitizedEnv = exports.testOnlySymbol = void 0; -var errors_1 = __nccwpck_require__(67902); -var reporter_1 = __nccwpck_require__(23121); -exports.testOnlySymbol = Symbol('envalid - test only'); -/** - * Validate a single env var, given a spec object - * - * @throws EnvError - If validation is unsuccessful - * @return - The cleaned value - */ -function validateVar(_a) { - var spec = _a.spec, name = _a.name, rawValue = _a.rawValue; - if (typeof spec._parse !== 'function') { - throw new errors_1.EnvError("Invalid spec for \"".concat(name, "\"")); - } - var value = spec._parse(rawValue); - if (spec.choices) { - if (!Array.isArray(spec.choices)) { - throw new TypeError("\"choices\" must be an array (in spec for \"".concat(name, "\")")); - } - else if (!spec.choices.includes(value)) { - throw new errors_1.EnvError("Value \"".concat(value, "\" not in choices [").concat(spec.choices, "]")); - } - } - if (value == null) - throw new errors_1.EnvError("Invalid value for env var \"".concat(name, "\"")); - return value; -} -// Format a string error message for when a required env var is missing -function formatSpecDescription(spec) { - var egText = spec.example ? " (eg. \"".concat(spec.example, "\")") : ''; - var docsText = spec.docs ? ". See ".concat(spec.docs) : ''; - return "".concat(spec.desc).concat(egText).concat(docsText); -} -var readRawEnvValue = function (env, k) { - return env[k]; -}; -var isTestOnlySymbol = function (value) { return value === exports.testOnlySymbol; }; -/** - * Perform the central validation/sanitization logic on the full environment object - */ -function getSanitizedEnv(environment, specs, options) { - if (options === void 0) { options = {}; } - var cleanedEnv = {}; - var errors = {}; - var varKeys = Object.keys(specs); - var rawNodeEnv = readRawEnvValue(environment, 'NODE_ENV'); - for (var _i = 0, varKeys_1 = varKeys; _i < varKeys_1.length; _i++) { - var k = varKeys_1[_i]; - var spec = specs[k]; - var rawValue = readRawEnvValue(environment, k); - // If no value was given and default/devDefault were provided, return the appropriate default - // value without passing it through validation - if (rawValue === undefined) { - // Use devDefault values only if NODE_ENV was explicitly set, and isn't 'production' - var usingDevDefault = rawNodeEnv && rawNodeEnv !== 'production' && spec.hasOwnProperty('devDefault'); - if (usingDevDefault) { - // @ts-expect-error default values can break the rules slightly by being explicitly set to undefined - cleanedEnv[k] = spec.devDefault; - continue; - } - if (spec.hasOwnProperty('default')) { - // @ts-expect-error default values can break the rules slightly by being explicitly set to undefined - cleanedEnv[k] = spec["default"]; - continue; - } - } - try { - if (isTestOnlySymbol(rawValue)) { - throw new errors_1.EnvMissingError(formatSpecDescription(spec)); - } - if (rawValue === undefined) { - // @ts-ignore (fixes #138) Need to figure out why explicitly undefined default/devDefault breaks inference - cleanedEnv[k] = undefined; - throw new errors_1.EnvMissingError(formatSpecDescription(spec)); - } - else { - cleanedEnv[k] = validateVar({ name: k, spec: spec, rawValue: rawValue }); - } - } - catch (err) { - if ((options === null || options === void 0 ? void 0 : options.reporter) === null) - throw err; - if (err instanceof Error) - errors[k] = err; - } - } - var reporter = (options === null || options === void 0 ? void 0 : options.reporter) || reporter_1.defaultReporter; - reporter({ errors: errors, env: cleanedEnv }); - return cleanedEnv; -} -exports.getSanitizedEnv = getSanitizedEnv; -//# sourceMappingURL=core.js.map - -/***/ }), - -/***/ 66125: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.__esModule = true; -exports.testOnly = exports.customCleanEnv = exports.cleanEnv = void 0; -var core_1 = __nccwpck_require__(10972); -var middleware_1 = __nccwpck_require__(51639); -/** - * Returns a sanitized, immutable environment object. _Only_ the env vars - * specified in the `validators` parameter will be accessible on the returned - * object. - * @param environment An object containing your env vars (eg. process.env). - * @param specs An object that specifies the format of required vars. - * @param options An object that specifies options for cleanEnv. - */ -function cleanEnv(environment, specs, options) { - if (options === void 0) { options = {}; } - var cleaned = (0, core_1.getSanitizedEnv)(environment, specs, options); - return Object.freeze((0, middleware_1.applyDefaultMiddleware)(cleaned, environment)); -} -exports.cleanEnv = cleanEnv; -/** - * Returns a sanitized, immutable environment object, and passes it through a custom - * applyMiddleware function before being frozen. Most users won't need the flexibility of custom - * middleware; prefer cleanEnv() unless you're sure you need it - * - * @param environment An object containing your env vars (eg. process.env). - * @param specs An object that specifies the format of required vars. - * @param applyMiddleware A function that applies transformations to the cleaned env object - * @param options An object that specifies options for cleanEnv. - */ -function customCleanEnv(environment, specs, applyMiddleware, options) { - if (options === void 0) { options = {}; } - var cleaned = (0, core_1.getSanitizedEnv)(environment, specs, options); - return Object.freeze(applyMiddleware(cleaned, environment)); -} -exports.customCleanEnv = customCleanEnv; -/** - * Utility function for providing default values only when NODE_ENV=test - * - * For more context, see https://github.com/af/envalid/issues/32 - */ -var testOnly = function (defaultValueForTests) { - return process.env.NODE_ENV === 'test' ? defaultValueForTests : core_1.testOnlySymbol; // T is not strictly correct, but prevents type errors during usage -}; -exports.testOnly = testOnly; -//# sourceMappingURL=envalid.js.map - -/***/ }), - -/***/ 67902: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -// Surprisingly involved error subclassing -// See https://stackoverflow.com/questions/41102060/typescript-extending-error-class -exports.__esModule = true; -exports.EnvMissingError = exports.EnvError = void 0; -var tslib_1 = __nccwpck_require__(99315); -var EnvError = /** @class */ (function (_super) { - tslib_1.__extends(EnvError, _super); - function EnvError(message) { - var _newTarget = this.constructor; - var _this = _super.call(this, message) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - Error.captureStackTrace(_this, EnvError); - _this.name = _this.constructor.name; - return _this; - } - return EnvError; -}(TypeError)); -exports.EnvError = EnvError; -var EnvMissingError = /** @class */ (function (_super) { - tslib_1.__extends(EnvMissingError, _super); - function EnvMissingError(message) { - var _newTarget = this.constructor; - var _this = _super.call(this, message) || this; - Object.setPrototypeOf(_this, _newTarget.prototype); - Error.captureStackTrace(_this, EnvMissingError); - _this.name = _this.constructor.name; - return _this; - } - return EnvMissingError; -}(ReferenceError)); -exports.EnvMissingError = EnvMissingError; -//# sourceMappingURL=errors.js.map - -/***/ }), - -/***/ 52322: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.__esModule = true; -var tslib_1 = __nccwpck_require__(99315); -tslib_1.__exportStar(__nccwpck_require__(66125), exports); -tslib_1.__exportStar(__nccwpck_require__(67902), exports); -tslib_1.__exportStar(__nccwpck_require__(51639), exports); -tslib_1.__exportStar(__nccwpck_require__(12938), exports); -tslib_1.__exportStar(__nccwpck_require__(24415), exports); -tslib_1.__exportStar(__nccwpck_require__(23121), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 51639: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.__esModule = true; -exports.applyDefaultMiddleware = exports.accessorMiddleware = exports.strictProxyMiddleware = void 0; -var strictProxyMiddleware = function (envObj, rawEnv) { - var inspectables = [ - 'length', - 'inspect', - 'hasOwnProperty', - 'toJSON', - Symbol.toStringTag, - Symbol.iterator, - // For jest - 'asymmetricMatch', - 'nodeType', - // For react-refresh, see #150 - '$$typeof', - // For libs that use `then` checks to see if objects are Promises (see #74): - 'then', - // For usage with TypeScript esModuleInterop flag - '__esModule', - ]; - var inspectSymbolStrings = ['Symbol(util.inspect.custom)', 'Symbol(nodejs.util.inspect.custom)']; - return new Proxy(envObj, { - get: function (target, name) { - var _a; - // These checks are needed because calling console.log on a - // proxy that throws crashes the entire process. This permits access on - // the necessary properties for `console.log(envObj)`, `envObj.length`, - // `envObj.hasOwnProperty('string')` to work. - if (inspectables.includes(name) || inspectSymbolStrings.includes(name.toString())) { - // @ts-expect-error TS doesn't like symbol types as indexers - return target[name]; - } - var varExists = target.hasOwnProperty(name); - if (!varExists) { - if (typeof rawEnv === 'object' && ((_a = rawEnv === null || rawEnv === void 0 ? void 0 : rawEnv.hasOwnProperty) === null || _a === void 0 ? void 0 : _a.call(rawEnv, name))) { - throw new ReferenceError("[envalid] Env var ".concat(name, " was accessed but not validated. This var is set in the environment; please add an envalid validator for it.")); - } - throw new ReferenceError("[envalid] Env var not found: ".concat(name)); - } - return target[name]; - }, - set: function (_target, name) { - throw new TypeError("[envalid] Attempt to mutate environment value: ".concat(name)); - } - }); -}; -exports.strictProxyMiddleware = strictProxyMiddleware; -var accessorMiddleware = function (envObj, rawEnv) { - // Attach is{Prod/Dev/Test} properties for more readable NODE_ENV checks - // Note that isDev and isProd are just aliases to isDevelopment and isProduction - // @ts-ignore attempt to read NODE_ENV even if it's not in the spec - var computedNodeEnv = envObj.NODE_ENV || rawEnv.NODE_ENV; - // If NODE_ENV is not set, assume production - var isProd = !computedNodeEnv || computedNodeEnv === 'production'; - Object.defineProperties(envObj, { - isDevelopment: { value: computedNodeEnv === 'development' }, - isDev: { value: computedNodeEnv === 'development' }, - isProduction: { value: isProd }, - isProd: { value: isProd }, - isTest: { value: computedNodeEnv === 'test' } - }); - return envObj; -}; -exports.accessorMiddleware = accessorMiddleware; -var applyDefaultMiddleware = function (cleanedEnv, rawEnv) { - // Note: Ideally we would declare the default middlewares in an array and apply them in series with - // a generic pipe() function. However, a generically typed variadic pipe() appears to not be possible - // in TypeScript as of 4.x, so we just manually apply them below. See - // https://github.com/microsoft/TypeScript/pull/39094#issuecomment-647042984 - return (0, exports.strictProxyMiddleware)((0, exports.accessorMiddleware)(cleanedEnv, rawEnv), rawEnv); -}; -exports.applyDefaultMiddleware = applyDefaultMiddleware; -//# sourceMappingURL=middleware.js.map - -/***/ }), - -/***/ 23121: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -var _a; -exports.__esModule = true; -exports.defaultReporter = exports.envalidErrorFormatter = void 0; -/* eslint-disable no-console */ -var errors_1 = __nccwpck_require__(67902); -var defaultLogger = console.error.bind(console); -// Apply ANSI colors to the reporter output only if we detect that we're running in Node -var isNode = !!(typeof process === 'object' && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node)); -var colorWith = function (colorCode) { return function (str) { - return isNode ? "\u001B[".concat(colorCode, "m").concat(str, "\u001B[0m") : str; -}; }; -var colors = { - blue: colorWith('34'), - white: colorWith('37'), - yellow: colorWith('33') -}; -var RULE = colors.white('================================'); -// Takes the provided errors, formats them all to an output string, and passes that string output to the -// provided "logger" function. -// -// This is exposed in the public API so third-party reporters can leverage this logic if desired -var envalidErrorFormatter = function (errors, logger) { - if (logger === void 0) { logger = defaultLogger; } - var missingVarsOutput = []; - var invalidVarsOutput = []; - for (var _i = 0, _a = Object.entries(errors); _i < _a.length; _i++) { - var _b = _a[_i], k = _b[0], err = _b[1]; - if (err instanceof errors_1.EnvMissingError) { - missingVarsOutput.push(" ".concat(colors.blue(k), ": ").concat(err.message || '(required)')); - } - else - invalidVarsOutput.push(" ".concat(colors.blue(k), ": ").concat((err === null || err === void 0 ? void 0 : err.message) || '(invalid format)')); - } - // Prepend "header" output for each section of the output: - if (invalidVarsOutput.length) { - invalidVarsOutput.unshift(" ".concat(colors.yellow('Invalid'), " environment variables:")); - } - if (missingVarsOutput.length) { - missingVarsOutput.unshift(" ".concat(colors.yellow('Missing'), " environment variables:")); - } - var output = [ - RULE, - invalidVarsOutput.sort().join('\n'), - missingVarsOutput.sort().join('\n'), - RULE, - ] - .filter(function (x) { return !!x; }) - .join('\n'); - logger(output); -}; -exports.envalidErrorFormatter = envalidErrorFormatter; -var defaultReporter = function (_a, _b) { - var _c = _a.errors, errors = _c === void 0 ? {} : _c; - var _d = _b === void 0 ? { logger: defaultLogger } : _b, onError = _d.onError, logger = _d.logger; - if (!Object.keys(errors).length) - return; - (0, exports.envalidErrorFormatter)(errors, logger); - if (onError) { - onError(errors); - } - else if (isNode) { - logger(colors.yellow('\n Exiting with error code 1')); - process.exit(1); - } - else { - throw new TypeError('Environment validation failed'); - } -}; -exports.defaultReporter = defaultReporter; -//# sourceMappingURL=reporter.js.map - -/***/ }), - -/***/ 12938: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -exports.__esModule = true; -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 24415: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -exports.__esModule = true; -exports.json = exports.url = exports.port = exports.host = exports.email = exports.str = exports.num = exports.bool = exports.makeValidator = void 0; -var tslib_1 = __nccwpck_require__(99315); -var errors_1 = __nccwpck_require__(67902); -// Simplified adaptation of https://github.com/validatorjs/validator.js/blob/master/src/lib/isFQDN.js -var isFQDN = function (input) { - if (!input.length) - return false; - var parts = input.split('.'); - for (var part = void 0, i = 0; i < parts.length; i++) { - part = parts[i]; - if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) - return false; - if (/[\uff01-\uff5e]/.test(part)) - return false; // disallow full-width chars - if (part[0] === '-' || part[part.length - 1] === '-') - return false; - } - return true; -}; -// "best effort" regex-based IP address check -// If you want a more exhaustive check, create your own custom validator, perhaps wrapping this -// implementation (the source of the ipv4 regex below): https://github.com/validatorjs/validator.js/blob/master/src/lib/isIP.js -var ipv4Regex = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/; -var ipv6Regex = /([a-f0-9]+:+)+[a-f0-9]+/; -var isIP = function (input) { - if (!input.length) - return false; - return ipv4Regex.test(input) || ipv6Regex.test(input); -}; -var EMAIL_REGEX = /^[^@\s]+@[^@\s]+\.[^@\s]+$/; // intentionally non-exhaustive -var makeValidator = function (parseFn) { - return function (spec) { - return tslib_1.__assign(tslib_1.__assign({}, spec), { _parse: parseFn }); - }; -}; -exports.makeValidator = makeValidator; -// The reason for the function wrapper is to enable the type parameter -// that enables better type inference. For more context, check out the following PR: -// https://github.com/af/envalid/pull/118 -function bool(spec) { - return (0, exports.makeValidator)(function (input) { - switch (input) { - case true: - case 'true': - case 't': - case '1': - return true; - case false: - case 'false': - case 'f': - case '0': - return false; - default: - throw new errors_1.EnvError("Invalid bool input: \"".concat(input, "\"")); - } - })(spec); -} -exports.bool = bool; -function num(spec) { - return (0, exports.makeValidator)(function (input) { - var coerced = parseFloat(input); - if (Number.isNaN(coerced)) - throw new errors_1.EnvError("Invalid number input: \"".concat(input, "\"")); - return coerced; - })(spec); -} -exports.num = num; -function str(spec) { - return (0, exports.makeValidator)(function (input) { - if (typeof input === 'string') - return input; - throw new errors_1.EnvError("Not a string: \"".concat(input, "\"")); - })(spec); -} -exports.str = str; -function email(spec) { - return (0, exports.makeValidator)(function (x) { - if (EMAIL_REGEX.test(x)) - return x; - throw new errors_1.EnvError("Invalid email address: \"".concat(x, "\"")); - })(spec); -} -exports.email = email; -function host(spec) { - return (0, exports.makeValidator)(function (input) { - if (!isFQDN(input) && !isIP(input)) { - throw new errors_1.EnvError("Invalid host (domain or ip): \"".concat(input, "\"")); - } - return input; - })(spec); -} -exports.host = host; -function port(spec) { - return (0, exports.makeValidator)(function (input) { - var coerced = +input; - if (Number.isNaN(coerced) || - "".concat(coerced) !== "".concat(input) || - coerced % 1 !== 0 || - coerced < 1 || - coerced > 65535) { - throw new errors_1.EnvError("Invalid port input: \"".concat(input, "\"")); - } - return coerced; - })(spec); -} -exports.port = port; -function url(spec) { - return (0, exports.makeValidator)(function (x) { - try { - new URL(x); - return x; - } - catch (e) { - throw new errors_1.EnvError("Invalid url: \"".concat(x, "\"")); - } - })(spec); -} -exports.url = url; -// It's recommended that you provide an explicit type parameter for json validation -// if you're using TypeScript. Otherwise the output will be typed as `any`. For example: -// -// cleanEnv({ -// MY_VAR: json<{ foo: number }>({ default: { foo: 123 } }), -// }) -function json(spec) { - return (0, exports.makeValidator)(function (x) { - try { - return JSON.parse(x); - } - catch (e) { - throw new errors_1.EnvError("Invalid json: \"".concat(x, "\"")); - } - })(spec); -} -exports.json = json; -//# sourceMappingURL=validators.js.map - -/***/ }), - -/***/ 99315: -/***/ ((module) => { - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); -}); - - -/***/ }), - -/***/ 43925: -/***/ ((module) => { - -module.exports = function properlyBoxed(method) { - // Check node 0.6.21 bug where third parameter is not boxed - var properlyBoxesNonStrict = true; - var properlyBoxesStrict = true; - var threwException = false; - if (typeof method === 'function') { - try { - // eslint-disable-next-line max-params - method.call('f', function (_, __, O) { - if (typeof O !== 'object') { - properlyBoxesNonStrict = false; - } - }); - - method.call( - [null], - function () { - 'use strict'; - - properlyBoxesStrict = typeof this === 'string'; // eslint-disable-line no-invalid-this - }, - 'x' - ); - } catch (e) { - threwException = true; - } - return !threwException && properlyBoxesNonStrict && properlyBoxesStrict; - } - return false; -}; - - -/***/ }), - -/***/ 29464: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; - -var isPrimitive = __nccwpck_require__(61367); -var isCallable = __nccwpck_require__(94615); -var isDate = __nccwpck_require__(89711); -var isSymbol = __nccwpck_require__(76510); - -var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { - if (typeof O === 'undefined' || O === null) { - throw new TypeError('Cannot call method on ' + O); - } - if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { - throw new TypeError('hint must be "string" or "number"'); - } - var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; - var method, result, i; - for (i = 0; i < methodNames.length; ++i) { - method = O[methodNames[i]]; - if (isCallable(method)) { - result = method.call(O); - if (isPrimitive(result)) { - return result; - } - } - } - throw new TypeError('No default value'); -}; - -var GetMethod = function GetMethod(O, P) { - var func = O[P]; - if (func !== null && typeof func !== 'undefined') { - if (!isCallable(func)) { - throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); - } - return func; - } - return void 0; -}; - -// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive -module.exports = function ToPrimitive(input) { - if (isPrimitive(input)) { - return input; - } - var hint = 'default'; - if (arguments.length > 1) { - if (arguments[1] === String) { - hint = 'string'; - } else if (arguments[1] === Number) { - hint = 'number'; - } - } - - var exoticToPrim; - if (hasSymbols) { - if (Symbol.toPrimitive) { - exoticToPrim = GetMethod(input, Symbol.toPrimitive); - } else if (isSymbol(input)) { - exoticToPrim = Symbol.prototype.valueOf; - } - } - if (typeof exoticToPrim !== 'undefined') { - var result = exoticToPrim.call(input, hint); - if (isPrimitive(result)) { - return result; - } - throw new TypeError('unable to convert exotic object to primitive'); - } - if (hint === 'default' && (isDate(input) || isSymbol(input))) { - hint = 'string'; - } - return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); -}; - - -/***/ }), - -/***/ 61367: -/***/ ((module) => { - -"use strict"; - - -module.exports = function isPrimitive(value) { - return value === null || (typeof value !== 'function' && typeof value !== 'object'); -}; - - -/***/ }), - -/***/ 46863: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = __nccwpck_require__(57147) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __nccwpck_require__(71734) - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} - - -/***/ }), - -/***/ 71734: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var pathModule = __nccwpck_require__(71017); -var isWindows = process.platform === 'win32'; -var fs = __nccwpck_require__(57147); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - -/***/ }), - -/***/ 19320: -/***/ ((module) => { - -"use strict"; - - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; - - -/***/ }), - -/***/ 88334: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var implementation = __nccwpck_require__(19320); - -module.exports = Function.prototype.bind || implementation; - - -/***/ }), - -/***/ 74538: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var undefined; - -var $SyntaxError = SyntaxError; -var $Function = Function; -var $TypeError = TypeError; - -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} -}; - -var $gOPD = Object.getOwnPropertyDescriptor; -if ($gOPD) { - try { - $gOPD({}, ''); - } catch (e) { - $gOPD = null; // this is IE 8, which has a broken gOPD - } -} - -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; - -var hasSymbols = __nccwpck_require__(40587)(); - -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto - -var needsEval = {}; - -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); - -var INTRINSICS = { - '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, - '%Array%': Array, - '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, - '%JSON%': typeof JSON === 'object' ? JSON : undefined, - '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': Object, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet -}; - -var doEval = function doEval(name) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen) { - value = getProto(gen.prototype); - } - } - - INTRINSICS[name] = value; - - return value; -}; - -var LEGACY_ALIASES = { - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; - -var bind = __nccwpck_require__(88334); -var hasOwn = __nccwpck_require__(76339); -var $concat = bind.call(Function.call, Array.prototype.concat); -var $spliceApply = bind.call(Function.apply, Array.prototype.splice); -var $replace = bind.call(Function.call, String.prototype.replace); -var $strSlice = bind.call(Function.call, String.prototype.slice); -var $exec = bind.call(Function.call, RegExp.prototype.exec); - -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ - -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } - - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } - - return { - alias: alias, - name: intrinsicName, - value: value - }; - } - - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; - -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - - if ($exec(/^%?[^%]*%?$/g, name) === null) { - throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; - - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } - - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; - - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; - - -/***/ }), - -/***/ 91585: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const {PassThrough: PassThroughStream} = __nccwpck_require__(12781); - -module.exports = options => { - options = {...options}; - - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on('data', chunk => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; - - stream.getBufferedLength = () => length; - - return stream; -}; - - -/***/ }), - -/***/ 21766: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const {constants: BufferConstants} = __nccwpck_require__(14300); -const pump = __nccwpck_require__(18341); -const bufferStream = __nccwpck_require__(91585); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = error => { - // Don't retrieve an oversized buffer. - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } - - resolve(); - }); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -// TODO: Remove this for the next major release -module.exports["default"] = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; - - -/***/ }), - -/***/ 47625: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var fs = __nccwpck_require__(57147) -var path = __nccwpck_require__(71017) -var minimatch = __nccwpck_require__(83973) -var isAbsolute = __nccwpck_require__(38714) -var Minimatch = minimatch.Minimatch - -function alphasort (a, b) { - return a.localeCompare(b, 'en') -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - // always treat \ in patterns as escapes, not path separators - options.allowWindowsEscape = false - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - - -/***/ }), - -/***/ 91957: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = __nccwpck_require__(46863) -var minimatch = __nccwpck_require__(83973) -var Minimatch = minimatch.Minimatch -var inherits = __nccwpck_require__(44124) -var EE = (__nccwpck_require__(82361).EventEmitter) -var path = __nccwpck_require__(71017) -var assert = __nccwpck_require__(39491) -var isAbsolute = __nccwpck_require__(38714) -var globSync = __nccwpck_require__(84579) -var common = __nccwpck_require__(47625) -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __nccwpck_require__(52492) -var util = __nccwpck_require__(73837) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = __nccwpck_require__(1223) - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - self.fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} - - -/***/ }), - -/***/ 84579: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = globSync -globSync.GlobSync = GlobSync - -var rp = __nccwpck_require__(46863) -var minimatch = __nccwpck_require__(83973) -var Minimatch = minimatch.Minimatch -var Glob = (__nccwpck_require__(91957).Glob) -var util = __nccwpck_require__(73837) -var path = __nccwpck_require__(71017) -var assert = __nccwpck_require__(39491) -var isAbsolute = __nccwpck_require__(38714) -var common = __nccwpck_require__(47625) -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert.ok(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert.ok(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - - -/***/ }), - -/***/ 69917: -/***/ (function(__unused_webpack_module, exports) { - -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e=e}},"es6","es3");$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3"); -$jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(a,c){var b=$jscomp.checkStringArgs(this,a,"startsWith");a+="";var e=b.length,f=a.length;c=Math.max(0,Math.min(c|0,b.length));for(var g=0;g=f}},"es6","es3"); -$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var b=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279>>=1)b+=b;return d}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self;goog.isDef=function(a){return void 0!==a};goog.isString=function(a){return"string"==typeof a};goog.isBoolean=function(a){return"boolean"==typeof a}; -goog.isNumber=function(a){return"number"==typeof a};goog.exportPath_=function(a,b,c){a=a.split(".");c=c||goog.global;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&goog.isDef(b)?c[d]=b:c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}}; -goog.define=function(a,b){if(!COMPILED){var c=goog.global.CLOSURE_UNCOMPILED_DEFINES,d=goog.global.CLOSURE_DEFINES;c&&void 0===c.nodeType&&Object.prototype.hasOwnProperty.call(c,a)?b=c[a]:d&&void 0===d.nodeType&&Object.prototype.hasOwnProperty.call(d,a)&&(b=d[a])}return b};goog.FEATURESET_YEAR=2012;goog.DEBUG=!0;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1; -goog.provide=function(a){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');goog.constructNamespace_(a)};goog.constructNamespace_=function(a,b){if(!COMPILED){delete goog.implicitNamespaces_[a];for(var c=a;(c=c.substring(0,c.lastIndexOf(".")))&&!goog.getObjectByName(c);)goog.implicitNamespaces_[c]=!0}goog.exportPath_(a,b)}; -goog.getScriptNonce=function(a){if(a&&a!=goog.global)return goog.getScriptNonce_(a.document);null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document));return goog.cspNonce_};goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/;goog.cspNonce_=null;goog.getScriptNonce_=function(a){return(a=a.querySelector&&a.querySelector("script[nonce]"))&&(a=a.nonce||a.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(a)?a:""};goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/; -goog.module=function(a){if(!goog.isString(a)||!a||-1==a.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+a+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide."); -if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=a;if(!COMPILED){if(goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');delete goog.implicitNamespaces_[a]}};goog.module.get=function(a){return goog.module.getInternal_(a)}; -goog.module.getInternal_=function(a){if(!COMPILED){if(a in goog.loadedModules_)return goog.loadedModules_[a].exports;if(!goog.implicitNamespaces_[a])return a=goog.getObjectByName(a),null!=a?a:null}return null};goog.ModuleType={ES6:"es6",GOOG:"goog"};goog.moduleLoaderState_=null;goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()};goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG}; -goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var a=goog.global.$jscomp;return a?"function"!=typeof a.getCurrentModulePath?!1:!!a.getCurrentModulePath():!1}; -goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0}; -goog.declareModuleId=function(a){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(a in goog.loadedModules_)throw Error('Module with namespace "'+a+'" already exists.');}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=a;else{var b=goog.global.$jscomp;if(!b||"function"!=typeof b.getCurrentModulePath)throw Error('Module with namespace "'+ -a+'" has been loaded incorrectly.');b=b.require(b.getCurrentModulePath());goog.loadedModules_[a]={exports:b,type:goog.ModuleType.ES6,moduleId:a}}};goog.setTestOnly=function(a){if(goog.DISALLOW_TEST_ONLY_CODE)throw a=a||"",Error("Importing test-only code into non-debug environment"+(a?": "+a:"."));};goog.forwardDeclare=function(a){}; -COMPILED||(goog.isProvided_=function(a){return a in goog.loadedModules_||!goog.implicitNamespaces_[a]&&goog.isDefAndNotNull(goog.getObjectByName(a))},goog.implicitNamespaces_={"goog.module":!0});goog.getObjectByName=function(a,b){a=a.split(".");b=b||goog.global;for(var c=0;c>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid; -goog.removeHashCode=goog.removeUid;goog.cloneObject=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if("function"===typeof a.clone)return a.clone();b="array"==b?[]:{};for(var c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)}; -goog.bindJs_=function(a,b,c){if(!a)throw Error();if(2{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')}); -a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async () => 1, true")});a("es9",function(){return b("({...rest} = {}), true")});a("es_next",function(){return!1});return{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(a,b){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var c=this.createRequiresTranspilation_();this.requiresTranspilation_=c.map;this.transpilationTarget_=this.transpilationTarget_|| -c.target}if(a in this.requiresTranspilation_)return this.requiresTranspilation_[a]?!0:!goog.inHtmlDocument_()||"es6"!=b||"noModule"in goog.global.document.createElement("script")?!1:!0;throw Error("Unknown language mode: "+a);},goog.Transpiler.prototype.transpile=function(a,b){return goog.transpile_(a,b,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={}; -this.idToPath_={};this.written_={};this.loadingDeps_=[];this.depsToLoad_=[];this.paused_=!1;this.factory_=new goog.DependencyFactory(goog.transpiler_);this.deferredCallbacks_={};this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(a,b){function c(){d&&(goog.global.setTimeout(d,0),d=null)}var d=b;if(a.length){b=[];for(var e=0;e\x3c/script>";b.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(d):d)}else{var e=b.createElement("script");e.defer=goog.Dependency.defer_;e.async=!1;e.type="text/javascript";(d=goog.getScriptNonce())&&e.setAttribute("nonce",d);goog.DebugLoader_.IS_OLD_IE_? -(a.pause(),e.onreadystatechange=function(){if("loaded"==e.readyState||"complete"==e.readyState)a.loaded(),a.resume()}):e.onload=function(){e.onload=null;a.loaded()};e.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path;b.head.appendChild(e)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."), -a.loaded()):a.pause()},goog.Es6ModuleDependency=function(a,b,c,d,e){goog.Dependency.call(this,a,b,c,d,e)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(a){function b(a,b){a=b?'