From af4c706f2a7e6ca5b0561fcb1f69588876f47a5c Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Mon, 17 Jun 2024 17:49:14 +0100 Subject: [PATCH] Implement for nodejs --- .github/workflows/ci.yml | 12 +- __tests__/main.test.ts | 128 +- __tests__/programs/random-nodejs/Pulumi.yaml | 3 + __tests__/programs/random-nodejs/README.md | 3 + __tests__/programs/random-nodejs/index.ts | 47 + __tests__/programs/random-nodejs/package.json | 15 + .../programs/random-nodejs/tsconfig.json | 16 + __tests__/wait.test.ts | 25 - action.yml | 10 +- badges/coverage.svg | 2 +- dist/exec-child.js | 39 + dist/index.js | 93472 +++++++++++++++- dist/index.js.map | 2 +- dist/licenses.txt | 2831 + dist/proto/channelz.proto | 564 + package-lock.json | 2951 +- package.json | 6 +- src/main.ts | 60 +- src/verifyRelease.ts | 87 + src/wait.ts | 14 - 20 files changed, 99458 insertions(+), 829 deletions(-) create mode 100644 __tests__/programs/random-nodejs/Pulumi.yaml create mode 100644 __tests__/programs/random-nodejs/README.md create mode 100644 __tests__/programs/random-nodejs/index.ts create mode 100644 __tests__/programs/random-nodejs/package.json create mode 100644 __tests__/programs/random-nodejs/tsconfig.json delete mode 100644 __tests__/wait.test.ts create mode 100644 dist/exec-child.js create mode 100644 dist/proto/channelz.proto create mode 100644 src/verifyRelease.ts delete mode 100644 src/wait.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6d2861..5064076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,12 +53,10 @@ jobs: id: checkout uses: actions/checkout@v4 - - name: Test Local Action - id: test-action + - name: Test Local Action for nodejs uses: ./ with: - milliseconds: 2000 - - - name: Print Output - id: output - run: echo "${{ steps.test-action.outputs.time }}" + language: nodejs + directory: __tests__/programs/random-nodejs + provider: random + providerVersion: '4.16.2' diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index ce373fb..6e2651f 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -12,9 +12,6 @@ import * as main from '../src/main' // Mock the action's main function const runMock = jest.spyOn(main, 'run') -// Other utilities -const timeRegex = /^\d{2}:\d{2}:\d{2}/ - // Mock the GitHub Actions core library let debugMock: jest.SpiedFunction let errorMock: jest.SpiedFunction @@ -23,6 +20,9 @@ let setFailedMock: jest.SpiedFunction let setOutputMock: jest.SpiedFunction describe('action', () => { + // Increase the Jest timeout to 30 seconds as we're download dependencies + jest.setTimeout(30 * 1000) + beforeEach(() => { jest.clearAllMocks() @@ -33,12 +33,40 @@ describe('action', () => { setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation() }) - it('sets the time output', async () => { + it('valid setup', async () => { + // Set the action's inputs as return values from core.getInput() + getInputMock.mockImplementation(name => { + switch (name) { + case 'language': + return 'nodejs' + case 'directory': + return '__tests__/programs/random-nodejs' + case 'provider': + return 'random' + case 'providerVersion': + return '4.16.2' + case 'publisher': + return 'pulumi' + default: + return '' + } + }) + + await main.run() + expect(runMock).toHaveReturned() + + expect(setFailedMock).not.toHaveBeenCalled() + expect(errorMock).not.toHaveBeenCalled() + expect(debugMock).toHaveBeenCalled() + expect(setOutputMock).toHaveBeenCalledTimes(0) + }) + + it('invalid language', async () => { // Set the action's inputs as return values from core.getInput() getInputMock.mockImplementation(name => { switch (name) { - case 'milliseconds': - return '500' + case 'language': + return 'this is not a language' default: return '' } @@ -48,29 +76,89 @@ describe('action', () => { expect(runMock).toHaveReturned() // Verify that all of the core library functions were called correctly - expect(debugMock).toHaveBeenNthCalledWith(1, 'Waiting 500 milliseconds ...') - expect(debugMock).toHaveBeenNthCalledWith( - 2, - expect.stringMatching(timeRegex) + expect(setFailedMock).toHaveBeenNthCalledWith( + 1, + 'Unsupported language: this is not a language' ) - expect(debugMock).toHaveBeenNthCalledWith( - 3, - expect.stringMatching(timeRegex) + expect(errorMock).not.toHaveBeenCalled() + }) + + it('directory does not exist', async () => { + // Set the action's inputs as return values from core.getInput() + getInputMock.mockImplementation(name => { + switch (name) { + case 'language': + return 'nodejs' + case 'directory': + return '__tests__/programs/nonexistent' + case 'provider': + return 'random' + case 'providerVersion': + return '4.16.2' + case 'publisher': + return 'pulumi' + default: + return '' + } + }) + + await main.run() + expect(runMock).toHaveReturned() + + // Verify that all of the core library functions were called correctly + expect(setFailedMock).toHaveBeenNthCalledWith( + 1, + "Can't access directory __tests__/programs/nonexistent: Error: ENOENT: no such file or directory, access '__tests__/programs/nonexistent'" ) - expect(setOutputMock).toHaveBeenNthCalledWith( + expect(errorMock).not.toHaveBeenCalled() + }) + + it('invalid provider version', async () => { + // Set the action's inputs as return values from core.getInput() + getInputMock.mockImplementation(name => { + switch (name) { + case 'language': + return 'nodejs' + case 'directory': + return '__tests__/programs/random-nodejs' + case 'provider': + return 'random' + case 'providerVersion': + return 'not a version' + case 'publisher': + return 'pulumi' + default: + return '' + } + }) + + await main.run() + expect(runMock).toHaveReturned() + + // Verify that all of the core library functions were called correctly + expect(setFailedMock).toHaveBeenNthCalledWith( 1, - 'time', - expect.stringMatching(timeRegex) + 'Invalid provider version: not a version' ) expect(errorMock).not.toHaveBeenCalled() }) - it('sets a failed status', async () => { + it('invalid package version', async () => { // Set the action's inputs as return values from core.getInput() getInputMock.mockImplementation(name => { switch (name) { - case 'milliseconds': - return 'this is not a number' + case 'language': + return 'nodejs' + case 'directory': + return '__tests__/programs/random-nodejs' + case 'provider': + return 'random' + case 'providerVersion': + return '4.16.2' + case 'packageVersion': + return 'not a version' + case 'publisher': + return 'pulumi' default: return '' } @@ -82,7 +170,7 @@ describe('action', () => { // Verify that all of the core library functions were called correctly expect(setFailedMock).toHaveBeenNthCalledWith( 1, - 'milliseconds not a number' + 'Invalid package version: not a version' ) expect(errorMock).not.toHaveBeenCalled() }) diff --git a/__tests__/programs/random-nodejs/Pulumi.yaml b/__tests__/programs/random-nodejs/Pulumi.yaml new file mode 100644 index 0000000..c61bd74 --- /dev/null +++ b/__tests__/programs/random-nodejs/Pulumi.yaml @@ -0,0 +1,3 @@ +name: simple-random +runtime: nodejs +description: A simple example of using various random resources. diff --git a/__tests__/programs/random-nodejs/README.md b/__tests__/programs/random-nodejs/README.md new file mode 100644 index 0000000..309ed5b --- /dev/null +++ b/__tests__/programs/random-nodejs/README.md @@ -0,0 +1,3 @@ +# examples/simple + +A simple example of using various random APIs. diff --git a/__tests__/programs/random-nodejs/index.ts b/__tests__/programs/random-nodejs/index.ts new file mode 100644 index 0000000..4cd46e7 --- /dev/null +++ b/__tests__/programs/random-nodejs/index.ts @@ -0,0 +1,47 @@ +// Copyright 2016-2023, 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. + +import * as random from '@pulumi/random' + +export const randomId = new random.RandomId('id', { byteLength: 4 }).hex +export const randomShuffle = new random.RandomShuffle('shuffle', { + inputs: ['a', 'b', 'c'] +}).results +export const randomString = new random.RandomString('string', { length: 32 }) + .result +export const randomInteger = new random.RandomInteger('integer', { + min: 128, + max: 1024 +}).result +export const randomUuid = new random.RandomUuid('uuid').result +export const randomPassword = new random.RandomPassword('password', { + length: 32 +}).result +export const randomPet = new random.RandomPet('pet').id + +export const randomPasswordWithKeepers = new random.RandomPassword( + 'passwordWithKeepers', + { + length: 32, + keepers: { pwdseed1: 'pwdseed1' } + } +).result + +export const randomStringWithWarning = new random.RandomString( + 'stringWithWarning', + { + length: 32, + number: false // this is deprecated, but Pulumi program should not fail + } +).result diff --git a/__tests__/programs/random-nodejs/package.json b/__tests__/programs/random-nodejs/package.json new file mode 100644 index 0000000..cd335dd --- /dev/null +++ b/__tests__/programs/random-nodejs/package.json @@ -0,0 +1,15 @@ +{ + "name": "simple", + "version": "0.0.1", + "license": "Apache-2.0", + "scripts": { + "build": "tsc" + }, + "dependencies": { + "@pulumi/pulumi": "^3.0.0", + "@pulumi/random": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^8.0.0" + } +} diff --git a/__tests__/programs/random-nodejs/tsconfig.json b/__tests__/programs/random-nodejs/tsconfig.json new file mode 100644 index 0000000..9469ac5 --- /dev/null +++ b/__tests__/programs/random-nodejs/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "strict": true, + "outDir": "bin", + "target": "es2016", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "experimentalDecorators": true, + "pretty": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.ts"] +} diff --git a/__tests__/wait.test.ts b/__tests__/wait.test.ts deleted file mode 100644 index 1336aaa..0000000 --- a/__tests__/wait.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Unit tests for src/wait.ts - */ - -import { wait } from '../src/wait' -import { expect } from '@jest/globals' - -describe('wait.ts', () => { - it('throws an invalid number', async () => { - const input = parseInt('foo', 10) - expect(isNaN(input)).toBe(true) - - await expect(wait(input)).rejects.toThrow('milliseconds not a number') - }) - - it('waits with a valid number', async () => { - const start = new Date() - await wait(500) - const end = new Date() - - const delta = Math.abs(end.getTime() - start.getTime()) - - expect(delta).toBeGreaterThan(450) - }) -}) diff --git a/action.yml b/action.yml index 4fe0b4c..a94e806 100644 --- a/action.yml +++ b/action.yml @@ -17,12 +17,16 @@ inputs: directory: description: Path to a Pulumi program to use for the test. required: true - version: - description: The version of the provider to be tested. - required: true provider: description: The name of the provider (excluding the publisher prefix) required: true + providerVersion: + description: The version of the provider to be tested. + required: true + packageVersion: + description: + The version of the package to be tested. Defaults to ${{ providerVersion + }} if not set. publisher: description: The publisher of the provider (if not pulumi) default: pulumi diff --git a/badges/coverage.svg b/badges/coverage.svg index 5bb55be..15a4d00 100644 --- a/badges/coverage.svg +++ b/badges/coverage.svg @@ -1 +1 @@ -Coverage: 100%Coverage100% \ No newline at end of file +Coverage: 98.5%Coverage98.5% \ No newline at end of file diff --git a/dist/exec-child.js b/dist/exec-child.js new file mode 100644 index 0000000..eab86ed --- /dev/null +++ b/dist/exec-child.js @@ -0,0 +1,39 @@ +if (require.main !== module) { + throw new Error('This file should not be required'); +} + +var childProcess = require('child_process'); +var fs = require('fs'); + +var paramFilePath = process.argv[2]; + +var serializedParams = fs.readFileSync(paramFilePath, 'utf8'); +var params = JSON.parse(serializedParams); + +var cmd = params.command; +var execOptions = params.execOptions; +var pipe = params.pipe; +var stdoutFile = params.stdoutFile; +var stderrFile = params.stderrFile; + +var c = childProcess.exec(cmd, execOptions, function (err) { + if (!err) { + process.exitCode = 0; + } else if (err.code === undefined) { + process.exitCode = 1; + } else { + process.exitCode = err.code; + } +}); + +var stdoutStream = fs.createWriteStream(stdoutFile); +var stderrStream = fs.createWriteStream(stderrFile); + +c.stdout.pipe(stdoutStream); +c.stderr.pipe(stderrStream); +c.stdout.pipe(process.stdout); +c.stderr.pipe(process.stderr); + +if (pipe) { + c.stdin.end(pipe); +} diff --git a/dist/index.js b/dist/index.js index e5ceef4..b7963fa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 7351: +/***/ 87351: /***/ (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__(2037)); +const os = __importStar(__nccwpck_require__(22037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -100,7 +100,7 @@ function escapeProperty(s) { /***/ }), -/***/ 2186: +/***/ 42186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -135,12 +135,12 @@ 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__(7351); +const command_1 = __nccwpck_require__(87351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(2037)); -const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(8041); +const os = __importStar(__nccwpck_require__(22037)); +const path = __importStar(__nccwpck_require__(71017)); +const oidc_utils_1 = __nccwpck_require__(98041); /** * The code to exit an action */ @@ -425,12 +425,12 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(1327); +var summary_1 = __nccwpck_require__(81327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(1327); +var summary_2 = __nccwpck_require__(81327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports @@ -472,9 +472,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(7147)); -const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(5840); +const fs = __importStar(__nccwpck_require__(57147)); +const os = __importStar(__nccwpck_require__(22037)); +const uuid_1 = __nccwpck_require__(75840); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -508,7 +508,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 8041: +/***/ 98041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -524,9 +524,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__(6255); -const auth_1 = __nccwpck_require__(5526); -const core_1 = __nccwpck_require__(2186); +const http_client_1 = __nccwpck_require__(96255); +const auth_1 = __nccwpck_require__(35526); +const core_1 = __nccwpck_require__(42186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -618,7 +618,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__(1017)); +const path = __importStar(__nccwpck_require__(71017)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -657,7 +657,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 1327: +/***/ 81327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -673,8 +673,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__(2037); -const fs_1 = __nccwpck_require__(7147); +const os_1 = __nccwpck_require__(22037); +const fs_1 = __nccwpck_require__(57147); 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'; @@ -994,7 +994,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 5526: +/***/ 35526: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -1082,7 +1082,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 6255: +/***/ 96255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1122,11 +1122,11 @@ 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__(3685)); -const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(9835)); -const tunnel = __importStar(__nccwpck_require__(4294)); -const undici_1 = __nccwpck_require__(1773); +const http = __importStar(__nccwpck_require__(13685)); +const https = __importStar(__nccwpck_require__(95687)); +const pm = __importStar(__nccwpck_require__(19835)); +const tunnel = __importStar(__nccwpck_require__(74294)); +const undici_1 = __nccwpck_require__(41773); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -1745,7 +1745,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 9835: +/***/ 19835: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1834,27 +1834,90323 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 4294: +/***/ 8258: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2021 gRPC authors. + * + * 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 })); +exports.addAdminServicesToServer = exports.registerAdminService = void 0; +const registeredAdminServices = []; +function registerAdminService(getServiceDefinition, getHandlers) { + registeredAdminServices.push({ getServiceDefinition, getHandlers }); +} +exports.registerAdminService = registerAdminService; +function addAdminServicesToServer(server) { + for (const { getServiceDefinition, getHandlers } of registeredAdminServices) { + server.addService(getServiceDefinition(), getHandlers()); + } +} +exports.addAdminServicesToServer = addAdminServicesToServer; +//# sourceMappingURL=admin.js.map + +/***/ }), + +/***/ 34186: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.BackoffTimeout = void 0; +const INITIAL_BACKOFF_MS = 1000; +const BACKOFF_MULTIPLIER = 1.6; +const MAX_BACKOFF_MS = 120000; +const BACKOFF_JITTER = 0.2; +/** + * Get a number uniformly at random in the range [min, max) + * @param min + * @param max + */ +function uniformRandom(min, max) { + return Math.random() * (max - min) + min; +} +class BackoffTimeout { + constructor(callback, options) { + this.callback = callback; + /** + * The delay time at the start, and after each reset. + */ + this.initialDelay = INITIAL_BACKOFF_MS; + /** + * The exponential backoff multiplier. + */ + this.multiplier = BACKOFF_MULTIPLIER; + /** + * The maximum delay time + */ + this.maxDelay = MAX_BACKOFF_MS; + /** + * The maximum fraction by which the delay time can randomly vary after + * applying the multiplier. + */ + this.jitter = BACKOFF_JITTER; + /** + * Indicates whether the timer is currently running. + */ + this.running = false; + /** + * Indicates whether the timer should keep the Node process running if no + * other async operation is doing so. + */ + this.hasRef = true; + /** + * The time that the currently running timer was started. Only valid if + * running is true. + */ + this.startTime = new Date(); + /** + * The approximate time that the currently running timer will end. Only valid + * if running is true. + */ + this.endTime = new Date(); + if (options) { + if (options.initialDelay) { + this.initialDelay = options.initialDelay; + } + if (options.multiplier) { + this.multiplier = options.multiplier; + } + if (options.jitter) { + this.jitter = options.jitter; + } + if (options.maxDelay) { + this.maxDelay = options.maxDelay; + } + } + this.nextDelay = this.initialDelay; + this.timerId = setTimeout(() => { }, 0); + clearTimeout(this.timerId); + } + runTimer(delay) { + var _a, _b; + this.endTime = this.startTime; + this.endTime.setMilliseconds(this.endTime.getMilliseconds() + this.nextDelay); + clearTimeout(this.timerId); + this.timerId = setTimeout(() => { + this.callback(); + this.running = false; + }, delay); + if (!this.hasRef) { + (_b = (_a = this.timerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + } + /** + * Call the callback after the current amount of delay time + */ + runOnce() { + this.running = true; + this.startTime = new Date(); + this.runTimer(this.nextDelay); + const nextBackoff = Math.min(this.nextDelay * this.multiplier, this.maxDelay); + const jitterMagnitude = nextBackoff * this.jitter; + this.nextDelay = + nextBackoff + uniformRandom(-jitterMagnitude, jitterMagnitude); + } + /** + * Stop the timer. The callback will not be called until `runOnce` is called + * again. + */ + stop() { + clearTimeout(this.timerId); + this.running = false; + } + /** + * Reset the delay time to its initial value. If the timer is still running, + * retroactively apply that reset to the current timer. + */ + reset() { + this.nextDelay = this.initialDelay; + if (this.running) { + const now = new Date(); + const newEndTime = this.startTime; + newEndTime.setMilliseconds(newEndTime.getMilliseconds() + this.nextDelay); + clearTimeout(this.timerId); + if (now < newEndTime) { + this.runTimer(newEndTime.getTime() - now.getTime()); + } + else { + this.running = false; + } + } + } + /** + * Check whether the timer is currently running. + */ + isRunning() { + return this.running; + } + /** + * Set that while the timer is running, it should keep the Node process + * running. + */ + ref() { + var _a, _b; + this.hasRef = true; + (_b = (_a = this.timerId).ref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + /** + * Set that while the timer is running, it should not keep the Node process + * running. + */ + unref() { + var _a, _b; + this.hasRef = false; + (_b = (_a = this.timerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + /** + * Get the approximate timestamp of when the timer will fire. Only valid if + * this.isRunning() is true. + */ + getEndTime() { + return this.endTime; + } +} +exports.BackoffTimeout = BackoffTimeout; +//# sourceMappingURL=backoff-timeout.js.map + +/***/ }), + +/***/ 21426: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.CallCredentials = void 0; +const metadata_1 = __nccwpck_require__(83665); +function isCurrentOauth2Client(client) { + return ('getRequestHeaders' in client && + typeof client.getRequestHeaders === 'function'); +} +/** + * A class that represents a generic method of adding authentication-related + * metadata on a per-request basis. + */ +class CallCredentials { + /** + * Creates a new CallCredentials object from a given function that generates + * Metadata objects. + * @param metadataGenerator A function that accepts a set of options, and + * generates a Metadata object based on these options, which is passed back + * to the caller via a supplied (err, metadata) callback. + */ + static createFromMetadataGenerator(metadataGenerator) { + return new SingleCallCredentials(metadataGenerator); + } + /** + * Create a gRPC credential from a Google credential object. + * @param googleCredentials The authentication client to use. + * @return The resulting CallCredentials object. + */ + static createFromGoogleCredential(googleCredentials) { + return CallCredentials.createFromMetadataGenerator((options, callback) => { + let getHeaders; + if (isCurrentOauth2Client(googleCredentials)) { + getHeaders = googleCredentials.getRequestHeaders(options.service_url); + } + else { + getHeaders = new Promise((resolve, reject) => { + googleCredentials.getRequestMetadata(options.service_url, (err, headers) => { + if (err) { + reject(err); + return; + } + if (!headers) { + reject(new Error('Headers not set by metadata plugin')); + return; + } + resolve(headers); + }); + }); + } + getHeaders.then(headers => { + const metadata = new metadata_1.Metadata(); + for (const key of Object.keys(headers)) { + metadata.add(key, headers[key]); + } + callback(null, metadata); + }, err => { + callback(err); + }); + }); + } + static createEmpty() { + return new EmptyCallCredentials(); + } +} +exports.CallCredentials = CallCredentials; +class ComposedCallCredentials extends CallCredentials { + constructor(creds) { + super(); + this.creds = creds; + } + async generateMetadata(options) { + const base = new metadata_1.Metadata(); + const generated = await Promise.all(this.creds.map(cred => cred.generateMetadata(options))); + for (const gen of generated) { + base.merge(gen); + } + return base; + } + compose(other) { + return new ComposedCallCredentials(this.creds.concat([other])); + } + _equals(other) { + if (this === other) { + return true; + } + if (other instanceof ComposedCallCredentials) { + return this.creds.every((value, index) => value._equals(other.creds[index])); + } + else { + return false; + } + } +} +class SingleCallCredentials extends CallCredentials { + constructor(metadataGenerator) { + super(); + this.metadataGenerator = metadataGenerator; + } + generateMetadata(options) { + return new Promise((resolve, reject) => { + this.metadataGenerator(options, (err, metadata) => { + if (metadata !== undefined) { + resolve(metadata); + } + else { + reject(err); + } + }); + }); + } + compose(other) { + return new ComposedCallCredentials([this, other]); + } + _equals(other) { + if (this === other) { + return true; + } + if (other instanceof SingleCallCredentials) { + return this.metadataGenerator === other.metadataGenerator; + } + else { + return false; + } + } +} +class EmptyCallCredentials extends CallCredentials { + generateMetadata(options) { + return Promise.resolve(new metadata_1.Metadata()); + } + compose(other) { + return other; + } + _equals(other) { + return other instanceof EmptyCallCredentials; + } +} +//# sourceMappingURL=call-credentials.js.map + +/***/ }), + +/***/ 78710: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.InterceptingListenerImpl = exports.isInterceptingListener = void 0; +function isInterceptingListener(listener) { + return (listener.onReceiveMetadata !== undefined && + listener.onReceiveMetadata.length === 1); +} +exports.isInterceptingListener = isInterceptingListener; +class InterceptingListenerImpl { + constructor(listener, nextListener) { + this.listener = listener; + this.nextListener = nextListener; + this.processingMetadata = false; + this.hasPendingMessage = false; + this.processingMessage = false; + this.pendingStatus = null; + } + processPendingMessage() { + if (this.hasPendingMessage) { + this.nextListener.onReceiveMessage(this.pendingMessage); + this.pendingMessage = null; + this.hasPendingMessage = false; + } + } + processPendingStatus() { + if (this.pendingStatus) { + this.nextListener.onReceiveStatus(this.pendingStatus); + } + } + onReceiveMetadata(metadata) { + this.processingMetadata = true; + this.listener.onReceiveMetadata(metadata, metadata => { + this.processingMetadata = false; + this.nextListener.onReceiveMetadata(metadata); + this.processPendingMessage(); + this.processPendingStatus(); + }); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onReceiveMessage(message) { + /* If this listener processes messages asynchronously, the last message may + * be reordered with respect to the status */ + this.processingMessage = true; + this.listener.onReceiveMessage(message, msg => { + this.processingMessage = false; + if (this.processingMetadata) { + this.pendingMessage = msg; + this.hasPendingMessage = true; + } + else { + this.nextListener.onReceiveMessage(msg); + this.processPendingStatus(); + } + }); + } + onReceiveStatus(status) { + this.listener.onReceiveStatus(status, processedStatus => { + if (this.processingMetadata || this.processingMessage) { + this.pendingStatus = processedStatus; + } + else { + this.nextListener.onReceiveStatus(processedStatus); + } + }); + } +} +exports.InterceptingListenerImpl = InterceptingListenerImpl; +//# sourceMappingURL=call-interface.js.map + +/***/ }), + +/***/ 70380: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.getNextCallNumber = void 0; +let nextCallNumber = 0; +function getNextCallNumber() { + return nextCallNumber++; +} +exports.getNextCallNumber = getNextCallNumber; +//# sourceMappingURL=call-number.js.map + +/***/ }), + +/***/ 97453: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +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); +/** + * Construct a ServiceError from a StatusObject. This function exists primarily + * as an attempt to make the error stack trace clearly communicate that the + * error is not necessarily a problem in gRPC itself. + * @param status + */ +function callErrorFromStatus(status, callerStack) { + const message = `${status.code} ${constants_1.Status[status.code]}: ${status.details}`; + const error = new Error(message); + const stack = `${error.stack}\nfor call at\n${callerStack}`; + return Object.assign(new Error(message), status, { stack }); +} +exports.callErrorFromStatus = callErrorFromStatus; +class ClientUnaryCallImpl extends events_1.EventEmitter { + constructor() { + super(); + } + cancel() { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); + } + getPeer() { + var _a, _b; + return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; + } +} +exports.ClientUnaryCallImpl = ClientUnaryCallImpl; +class ClientReadableStreamImpl extends stream_1.Readable { + constructor(deserialize) { + super({ objectMode: true }); + this.deserialize = deserialize; + } + cancel() { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); + } + getPeer() { + var _a, _b; + return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; + } + _read(_size) { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.startRead(); + } +} +exports.ClientReadableStreamImpl = ClientReadableStreamImpl; +class ClientWritableStreamImpl extends stream_1.Writable { + constructor(serialize) { + super({ objectMode: true }); + this.serialize = serialize; + } + cancel() { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); + } + getPeer() { + var _a, _b; + return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; + } + _write(chunk, encoding, cb) { + var _a; + const context = { + callback: cb, + }; + const flags = Number(encoding); + if (!Number.isNaN(flags)) { + context.flags = flags; + } + (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendMessageWithContext(context, chunk); + } + _final(cb) { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.halfClose(); + cb(); + } +} +exports.ClientWritableStreamImpl = ClientWritableStreamImpl; +class ClientDuplexStreamImpl extends stream_1.Duplex { + constructor(serialize, deserialize) { + super({ objectMode: true }); + this.serialize = serialize; + this.deserialize = deserialize; + } + cancel() { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); + } + getPeer() { + var _a, _b; + return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; + } + _read(_size) { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.startRead(); + } + _write(chunk, encoding, cb) { + var _a; + const context = { + callback: cb, + }; + const flags = Number(encoding); + if (!Number.isNaN(flags)) { + context.flags = flags; + } + (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendMessageWithContext(context, chunk); + } + _final(cb) { + var _a; + (_a = this.call) === null || _a === void 0 ? void 0 : _a.halfClose(); + cb(); + } +} +exports.ClientDuplexStreamImpl = ClientDuplexStreamImpl; +//# sourceMappingURL=call.js.map + +/***/ }), + +/***/ 44030: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.ChannelCredentials = void 0; +const tls_1 = __nccwpck_require__(24404); +const call_credentials_1 = __nccwpck_require__(21426); +const tls_helpers_1 = __nccwpck_require__(86581); +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function verifyIsBufferOrNull(obj, friendlyName) { + if (obj && !(obj instanceof Buffer)) { + throw new TypeError(`${friendlyName}, if provided, must be a Buffer.`); + } +} +/** + * A class that contains credentials for communicating over a channel, as well + * as a set of per-call credentials, which are applied to every method call made + * over a channel initialized with an instance of this class. + */ +class ChannelCredentials { + constructor(callCredentials) { + this.callCredentials = callCredentials || call_credentials_1.CallCredentials.createEmpty(); + } + /** + * Gets the set of per-call credentials associated with this instance. + */ + _getCallCredentials() { + return this.callCredentials; + } + /** + * Return a new ChannelCredentials instance with a given set of credentials. + * The resulting instance can be used to construct a Channel that communicates + * over TLS. + * @param rootCerts The root certificate data. + * @param privateKey The client certificate private key, if available. + * @param certChain The client certificate key chain, if available. + * @param verifyOptions Additional options to modify certificate verification + */ + static createSsl(rootCerts, privateKey, certChain, verifyOptions) { + var _a; + verifyIsBufferOrNull(rootCerts, 'Root certificate'); + verifyIsBufferOrNull(privateKey, 'Private key'); + verifyIsBufferOrNull(certChain, 'Certificate chain'); + if (privateKey && !certChain) { + throw new Error('Private key must be given with accompanying certificate chain'); + } + if (!privateKey && certChain) { + throw new Error('Certificate chain must be given with accompanying private key'); + } + const secureContext = (0, tls_1.createSecureContext)({ + ca: (_a = rootCerts !== null && rootCerts !== void 0 ? rootCerts : (0, tls_helpers_1.getDefaultRootsData)()) !== null && _a !== void 0 ? _a : undefined, + key: privateKey !== null && privateKey !== void 0 ? privateKey : undefined, + cert: certChain !== null && certChain !== void 0 ? certChain : undefined, + ciphers: tls_helpers_1.CIPHER_SUITES, + }); + return new SecureChannelCredentialsImpl(secureContext, verifyOptions !== null && verifyOptions !== void 0 ? verifyOptions : {}); + } + /** + * Return a new ChannelCredentials instance with credentials created using + * the provided secureContext. The resulting instances can be used to + * construct a Channel that communicates over TLS. gRPC will not override + * anything in the provided secureContext, so the environment variables + * GRPC_SSL_CIPHER_SUITES and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH will + * not be applied. + * @param secureContext The return value of tls.createSecureContext() + * @param verifyOptions Additional options to modify certificate verification + */ + static createFromSecureContext(secureContext, verifyOptions) { + return new SecureChannelCredentialsImpl(secureContext, verifyOptions !== null && verifyOptions !== void 0 ? verifyOptions : {}); + } + /** + * Return a new ChannelCredentials instance with no credentials. + */ + static createInsecure() { + return new InsecureChannelCredentialsImpl(); + } +} +exports.ChannelCredentials = ChannelCredentials; +class InsecureChannelCredentialsImpl extends ChannelCredentials { + constructor() { + super(); + } + compose(callCredentials) { + throw new Error('Cannot compose insecure credentials'); + } + _getConnectionOptions() { + return null; + } + _isSecure() { + return false; + } + _equals(other) { + return other instanceof InsecureChannelCredentialsImpl; + } +} +class SecureChannelCredentialsImpl extends ChannelCredentials { + constructor(secureContext, verifyOptions) { + super(); + this.secureContext = secureContext; + this.verifyOptions = verifyOptions; + this.connectionOptions = { + secureContext, + }; + // Node asserts that this option is a function, so we cannot pass undefined + if (verifyOptions === null || verifyOptions === void 0 ? void 0 : verifyOptions.checkServerIdentity) { + this.connectionOptions.checkServerIdentity = + verifyOptions.checkServerIdentity; + } + } + compose(callCredentials) { + const combinedCallCredentials = this.callCredentials.compose(callCredentials); + return new ComposedChannelCredentialsImpl(this, combinedCallCredentials); + } + _getConnectionOptions() { + // Copy to prevent callers from mutating this.connectionOptions + return Object.assign({}, this.connectionOptions); + } + _isSecure() { + return true; + } + _equals(other) { + if (this === other) { + return true; + } + if (other instanceof SecureChannelCredentialsImpl) { + return (this.secureContext === other.secureContext && + this.verifyOptions.checkServerIdentity === + other.verifyOptions.checkServerIdentity); + } + else { + return false; + } + } +} +class ComposedChannelCredentialsImpl extends ChannelCredentials { + constructor(channelCredentials, callCreds) { + super(callCreds); + this.channelCredentials = channelCredentials; + } + compose(callCredentials) { + const combinedCallCredentials = this.callCredentials.compose(callCredentials); + return new ComposedChannelCredentialsImpl(this.channelCredentials, combinedCallCredentials); + } + _getConnectionOptions() { + return this.channelCredentials._getConnectionOptions(); + } + _isSecure() { + return true; + } + _equals(other) { + if (this === other) { + return true; + } + if (other instanceof ComposedChannelCredentialsImpl) { + return (this.channelCredentials._equals(other.channelCredentials) && + this.callCredentials._equals(other.callCredentials)); + } + else { + return false; + } + } +} +//# sourceMappingURL=channel-credentials.js.map + +/***/ }), + +/***/ 99810: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.channelOptionsEqual = exports.recognizedOptions = void 0; +/** + * This is for checking provided options at runtime. This is an object for + * easier membership checking. + */ +exports.recognizedOptions = { + 'grpc.ssl_target_name_override': true, + 'grpc.primary_user_agent': true, + 'grpc.secondary_user_agent': true, + 'grpc.default_authority': true, + 'grpc.keepalive_time_ms': true, + 'grpc.keepalive_timeout_ms': true, + 'grpc.keepalive_permit_without_calls': true, + 'grpc.service_config': true, + 'grpc.max_concurrent_streams': true, + 'grpc.initial_reconnect_backoff_ms': true, + 'grpc.max_reconnect_backoff_ms': true, + 'grpc.use_local_subchannel_pool': true, + 'grpc.max_send_message_length': true, + 'grpc.max_receive_message_length': true, + 'grpc.enable_http_proxy': true, + 'grpc.enable_channelz': true, + 'grpc.dns_min_time_between_resolutions_ms': true, + 'grpc.enable_retries': true, + 'grpc.per_rpc_retry_buffer_size': true, + 'grpc.retry_buffer_size': true, + 'grpc.max_connection_age_ms': true, + 'grpc.max_connection_age_grace_ms': true, + 'grpc-node.max_session_memory': true, + 'grpc.service_config_disable_resolution': true, + 'grpc.client_idle_timeout_ms': true, + 'grpc-node.tls_enable_trace': true, + 'grpc.lb.ring_hash.ring_size_cap': true, +}; +function channelOptionsEqual(options1, options2) { + const keys1 = Object.keys(options1).sort(); + const keys2 = Object.keys(options2).sort(); + if (keys1.length !== keys2.length) { + return false; + } + for (let i = 0; i < keys1.length; i += 1) { + if (keys1[i] !== keys2[i]) { + return false; + } + if (options1[keys1[i]] !== options2[keys2[i]]) { + return false; + } + } + return true; +} +exports.channelOptionsEqual = channelOptionsEqual; +//# sourceMappingURL=channel-options.js.map + +/***/ }), + +/***/ 13860: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.ChannelImplementation = void 0; +const channel_credentials_1 = __nccwpck_require__(44030); +const internal_channel_1 = __nccwpck_require__(69672); +class ChannelImplementation { + constructor(target, credentials, options) { + if (typeof target !== 'string') { + throw new TypeError('Channel target must be a string'); + } + if (!(credentials instanceof channel_credentials_1.ChannelCredentials)) { + throw new TypeError('Channel credentials must be a ChannelCredentials object'); + } + if (options) { + if (typeof options !== 'object') { + throw new TypeError('Channel options must be an object'); + } + } + this.internalChannel = new internal_channel_1.InternalChannel(target, credentials, options); + } + close() { + this.internalChannel.close(); + } + getTarget() { + return this.internalChannel.getTarget(); + } + getConnectivityState(tryToConnect) { + return this.internalChannel.getConnectivityState(tryToConnect); + } + watchConnectivityState(currentState, deadline, callback) { + this.internalChannel.watchConnectivityState(currentState, deadline, callback); + } + /** + * Get the channelz reference object for this channel. The returned value is + * garbage if channelz is disabled for this channel. + * @returns + */ + getChannelzRef() { + return this.internalChannel.getChannelzRef(); + } + createCall(method, deadline, host, parentCall, propagateFlags) { + if (typeof method !== 'string') { + throw new TypeError('Channel#createCall: method must be a string'); + } + if (!(typeof deadline === 'number' || deadline instanceof Date)) { + throw new TypeError('Channel#createCall: deadline must be a number or Date'); + } + return this.internalChannel.createCall(method, deadline, host, parentCall, propagateFlags); + } +} +exports.ChannelImplementation = ChannelImplementation; +//# sourceMappingURL=channel.js.map + +/***/ }), + +/***/ 79975: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2021 gRPC authors. + * + * 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 })); +exports.setup = exports.getChannelzServiceDefinition = exports.getChannelzHandlers = exports.unregisterChannelzRef = exports.registerChannelzSocket = exports.registerChannelzServer = exports.registerChannelzSubchannel = exports.registerChannelzChannel = exports.ChannelzCallTrackerStub = exports.ChannelzCallTracker = exports.ChannelzChildrenTrackerStub = exports.ChannelzChildrenTracker = exports.ChannelzTrace = exports.ChannelzTraceStub = void 0; +const net_1 = __nccwpck_require__(41808); +const ordered_map_1 = __nccwpck_require__(12592); +const connectivity_state_1 = __nccwpck_require__(80878); +const constants_1 = __nccwpck_require__(90634); +const subchannel_address_1 = __nccwpck_require__(99905); +const admin_1 = __nccwpck_require__(8258); +const make_client_1 = __nccwpck_require__(38541); +function channelRefToMessage(ref) { + return { + channel_id: ref.id, + name: ref.name, + }; +} +function subchannelRefToMessage(ref) { + return { + subchannel_id: ref.id, + name: ref.name, + }; +} +function serverRefToMessage(ref) { + return { + server_id: ref.id, + }; +} +function socketRefToMessage(ref) { + return { + socket_id: ref.id, + name: ref.name, + }; +} +/** + * The loose upper bound on the number of events that should be retained in a + * trace. This may be exceeded by up to a factor of 2. Arbitrarily chosen as a + * number that should be large enough to contain the recent relevant + * information, but small enough to not use excessive memory. + */ +const TARGET_RETAINED_TRACES = 32; +/** + * Default number of sockets/servers/channels/subchannels to return + */ +const DEFAULT_MAX_RESULTS = 100; +class ChannelzTraceStub { + constructor() { + this.events = []; + this.creationTimestamp = new Date(); + this.eventsLogged = 0; + } + addTrace() { } + getTraceMessage() { + return { + creation_timestamp: dateToProtoTimestamp(this.creationTimestamp), + num_events_logged: this.eventsLogged, + events: [], + }; + } +} +exports.ChannelzTraceStub = ChannelzTraceStub; +class ChannelzTrace { + constructor() { + this.events = []; + this.eventsLogged = 0; + this.creationTimestamp = new Date(); + } + addTrace(severity, description, child) { + const timestamp = new Date(); + this.events.push({ + description: description, + severity: severity, + timestamp: timestamp, + childChannel: (child === null || child === void 0 ? void 0 : child.kind) === 'channel' ? child : undefined, + childSubchannel: (child === null || child === void 0 ? void 0 : child.kind) === 'subchannel' ? child : undefined, + }); + // Whenever the trace array gets too large, discard the first half + if (this.events.length >= TARGET_RETAINED_TRACES * 2) { + this.events = this.events.slice(TARGET_RETAINED_TRACES); + } + this.eventsLogged += 1; + } + getTraceMessage() { + return { + creation_timestamp: dateToProtoTimestamp(this.creationTimestamp), + num_events_logged: this.eventsLogged, + events: this.events.map(event => { + return { + description: event.description, + severity: event.severity, + timestamp: dateToProtoTimestamp(event.timestamp), + channel_ref: event.childChannel + ? channelRefToMessage(event.childChannel) + : null, + subchannel_ref: event.childSubchannel + ? subchannelRefToMessage(event.childSubchannel) + : null, + }; + }), + }; + } +} +exports.ChannelzTrace = ChannelzTrace; +class ChannelzChildrenTracker { + constructor() { + this.channelChildren = new ordered_map_1.OrderedMap(); + this.subchannelChildren = new ordered_map_1.OrderedMap(); + this.socketChildren = new ordered_map_1.OrderedMap(); + this.trackerMap = { + ["channel" /* EntityTypes.channel */]: this.channelChildren, + ["subchannel" /* EntityTypes.subchannel */]: this.subchannelChildren, + ["socket" /* EntityTypes.socket */]: this.socketChildren, + }; + } + refChild(child) { + const tracker = this.trackerMap[child.kind]; + const trackedChild = tracker.find(child.id); + if (trackedChild.equals(tracker.end())) { + tracker.setElement(child.id, { + ref: child, + count: 1, + }, trackedChild); + } + else { + trackedChild.pointer[1].count += 1; + } + } + unrefChild(child) { + const tracker = this.trackerMap[child.kind]; + const trackedChild = tracker.getElementByKey(child.id); + if (trackedChild !== undefined) { + trackedChild.count -= 1; + if (trackedChild.count === 0) { + tracker.eraseElementByKey(child.id); + } + } + } + getChildLists() { + return { + channels: this.channelChildren, + subchannels: this.subchannelChildren, + sockets: this.socketChildren, + }; + } +} +exports.ChannelzChildrenTracker = ChannelzChildrenTracker; +class ChannelzChildrenTrackerStub extends ChannelzChildrenTracker { + refChild() { } + unrefChild() { } +} +exports.ChannelzChildrenTrackerStub = ChannelzChildrenTrackerStub; +class ChannelzCallTracker { + constructor() { + this.callsStarted = 0; + this.callsSucceeded = 0; + this.callsFailed = 0; + this.lastCallStartedTimestamp = null; + } + addCallStarted() { + this.callsStarted += 1; + this.lastCallStartedTimestamp = new Date(); + } + addCallSucceeded() { + this.callsSucceeded += 1; + } + addCallFailed() { + this.callsFailed += 1; + } +} +exports.ChannelzCallTracker = ChannelzCallTracker; +class ChannelzCallTrackerStub extends ChannelzCallTracker { + addCallStarted() { } + addCallSucceeded() { } + addCallFailed() { } +} +exports.ChannelzCallTrackerStub = ChannelzCallTrackerStub; +const entityMaps = { + ["channel" /* EntityTypes.channel */]: new ordered_map_1.OrderedMap(), + ["subchannel" /* EntityTypes.subchannel */]: new ordered_map_1.OrderedMap(), + ["server" /* EntityTypes.server */]: new ordered_map_1.OrderedMap(), + ["socket" /* EntityTypes.socket */]: new ordered_map_1.OrderedMap(), +}; +const generateRegisterFn = (kind) => { + let nextId = 1; + function getNextId() { + return nextId++; + } + const entityMap = entityMaps[kind]; + return (name, getInfo, channelzEnabled) => { + const id = getNextId(); + const ref = { id, name, kind }; + if (channelzEnabled) { + entityMap.setElement(id, { ref, getInfo }); + } + return ref; + }; +}; +exports.registerChannelzChannel = generateRegisterFn("channel" /* EntityTypes.channel */); +exports.registerChannelzSubchannel = generateRegisterFn("subchannel" /* EntityTypes.subchannel */); +exports.registerChannelzServer = generateRegisterFn("server" /* EntityTypes.server */); +exports.registerChannelzSocket = generateRegisterFn("socket" /* EntityTypes.socket */); +function unregisterChannelzRef(ref) { + entityMaps[ref.kind].eraseElementByKey(ref.id); +} +exports.unregisterChannelzRef = unregisterChannelzRef; +/** + * Parse a single section of an IPv6 address as two bytes + * @param addressSection A hexadecimal string of length up to 4 + * @returns The pair of bytes representing this address section + */ +function parseIPv6Section(addressSection) { + const numberValue = Number.parseInt(addressSection, 16); + return [(numberValue / 256) | 0, numberValue % 256]; +} +/** + * Parse a chunk of an IPv6 address string to some number of bytes + * @param addressChunk Some number of segments of up to 4 hexadecimal + * characters each, joined by colons. + * @returns The list of bytes representing this address chunk + */ +function parseIPv6Chunk(addressChunk) { + if (addressChunk === '') { + return []; + } + const bytePairs = addressChunk + .split(':') + .map(section => parseIPv6Section(section)); + const result = []; + return result.concat(...bytePairs); +} +/** + * Converts an IPv4 or IPv6 address from string representation to binary + * representation + * @param ipAddress an IP address in standard IPv4 or IPv6 text format + * @returns + */ +function ipAddressStringToBuffer(ipAddress) { + if ((0, net_1.isIPv4)(ipAddress)) { + return Buffer.from(Uint8Array.from(ipAddress.split('.').map(segment => Number.parseInt(segment)))); + } + else if ((0, net_1.isIPv6)(ipAddress)) { + let leftSection; + let rightSection; + const doubleColonIndex = ipAddress.indexOf('::'); + if (doubleColonIndex === -1) { + leftSection = ipAddress; + rightSection = ''; + } + else { + leftSection = ipAddress.substring(0, doubleColonIndex); + rightSection = ipAddress.substring(doubleColonIndex + 2); + } + const leftBuffer = Buffer.from(parseIPv6Chunk(leftSection)); + const rightBuffer = Buffer.from(parseIPv6Chunk(rightSection)); + const middleBuffer = Buffer.alloc(16 - leftBuffer.length - rightBuffer.length, 0); + return Buffer.concat([leftBuffer, middleBuffer, rightBuffer]); + } + else { + return null; + } +} +function connectivityStateToMessage(state) { + switch (state) { + case connectivity_state_1.ConnectivityState.CONNECTING: + return { + state: 'CONNECTING', + }; + case connectivity_state_1.ConnectivityState.IDLE: + return { + state: 'IDLE', + }; + case connectivity_state_1.ConnectivityState.READY: + return { + state: 'READY', + }; + case connectivity_state_1.ConnectivityState.SHUTDOWN: + return { + state: 'SHUTDOWN', + }; + case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE: + return { + state: 'TRANSIENT_FAILURE', + }; + default: + return { + state: 'UNKNOWN', + }; + } +} +function dateToProtoTimestamp(date) { + if (!date) { + return null; + } + const millisSinceEpoch = date.getTime(); + return { + seconds: (millisSinceEpoch / 1000) | 0, + nanos: (millisSinceEpoch % 1000) * 1000000, + }; +} +function getChannelMessage(channelEntry) { + const resolvedInfo = channelEntry.getInfo(); + const channelRef = []; + const subchannelRef = []; + resolvedInfo.children.channels.forEach(el => { + channelRef.push(channelRefToMessage(el[1].ref)); + }); + resolvedInfo.children.subchannels.forEach(el => { + subchannelRef.push(subchannelRefToMessage(el[1].ref)); + }); + return { + ref: channelRefToMessage(channelEntry.ref), + data: { + target: resolvedInfo.target, + state: connectivityStateToMessage(resolvedInfo.state), + calls_started: resolvedInfo.callTracker.callsStarted, + calls_succeeded: resolvedInfo.callTracker.callsSucceeded, + calls_failed: resolvedInfo.callTracker.callsFailed, + last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), + trace: resolvedInfo.trace.getTraceMessage(), + }, + channel_ref: channelRef, + subchannel_ref: subchannelRef, + }; +} +function GetChannel(call, callback) { + const channelId = parseInt(call.request.channel_id, 10); + const channelEntry = entityMaps["channel" /* EntityTypes.channel */].getElementByKey(channelId); + if (channelEntry === undefined) { + callback({ + code: constants_1.Status.NOT_FOUND, + details: 'No channel data found for id ' + channelId, + }); + return; + } + callback(null, { channel: getChannelMessage(channelEntry) }); +} +function GetTopChannels(call, callback) { + const maxResults = parseInt(call.request.max_results, 10) || DEFAULT_MAX_RESULTS; + const resultList = []; + const startId = parseInt(call.request.start_channel_id, 10); + const channelEntries = entityMaps["channel" /* EntityTypes.channel */]; + let i; + for (i = channelEntries.lowerBound(startId); !i.equals(channelEntries.end()) && resultList.length < maxResults; i = i.next()) { + resultList.push(getChannelMessage(i.pointer[1])); + } + callback(null, { + channel: resultList, + end: i.equals(channelEntries.end()), + }); +} +function getServerMessage(serverEntry) { + const resolvedInfo = serverEntry.getInfo(); + const listenSocket = []; + resolvedInfo.listenerChildren.sockets.forEach(el => { + listenSocket.push(socketRefToMessage(el[1].ref)); + }); + return { + ref: serverRefToMessage(serverEntry.ref), + data: { + calls_started: resolvedInfo.callTracker.callsStarted, + calls_succeeded: resolvedInfo.callTracker.callsSucceeded, + calls_failed: resolvedInfo.callTracker.callsFailed, + last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), + trace: resolvedInfo.trace.getTraceMessage(), + }, + listen_socket: listenSocket, + }; +} +function GetServer(call, callback) { + const serverId = parseInt(call.request.server_id, 10); + const serverEntries = entityMaps["server" /* EntityTypes.server */]; + const serverEntry = serverEntries.getElementByKey(serverId); + if (serverEntry === undefined) { + callback({ + code: constants_1.Status.NOT_FOUND, + details: 'No server data found for id ' + serverId, + }); + return; + } + callback(null, { server: getServerMessage(serverEntry) }); +} +function GetServers(call, callback) { + const maxResults = parseInt(call.request.max_results, 10) || DEFAULT_MAX_RESULTS; + const startId = parseInt(call.request.start_server_id, 10); + const serverEntries = entityMaps["server" /* EntityTypes.server */]; + const resultList = []; + let i; + for (i = serverEntries.lowerBound(startId); !i.equals(serverEntries.end()) && resultList.length < maxResults; i = i.next()) { + resultList.push(getServerMessage(i.pointer[1])); + } + callback(null, { + server: resultList, + end: i.equals(serverEntries.end()), + }); +} +function GetSubchannel(call, callback) { + const subchannelId = parseInt(call.request.subchannel_id, 10); + const subchannelEntry = entityMaps["subchannel" /* EntityTypes.subchannel */].getElementByKey(subchannelId); + if (subchannelEntry === undefined) { + callback({ + code: constants_1.Status.NOT_FOUND, + details: 'No subchannel data found for id ' + subchannelId, + }); + return; + } + const resolvedInfo = subchannelEntry.getInfo(); + const listenSocket = []; + resolvedInfo.children.sockets.forEach(el => { + listenSocket.push(socketRefToMessage(el[1].ref)); + }); + const subchannelMessage = { + ref: subchannelRefToMessage(subchannelEntry.ref), + data: { + target: resolvedInfo.target, + state: connectivityStateToMessage(resolvedInfo.state), + calls_started: resolvedInfo.callTracker.callsStarted, + calls_succeeded: resolvedInfo.callTracker.callsSucceeded, + calls_failed: resolvedInfo.callTracker.callsFailed, + last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), + trace: resolvedInfo.trace.getTraceMessage(), + }, + socket_ref: listenSocket, + }; + callback(null, { subchannel: subchannelMessage }); +} +function subchannelAddressToAddressMessage(subchannelAddress) { + var _a; + if ((0, subchannel_address_1.isTcpSubchannelAddress)(subchannelAddress)) { + return { + address: 'tcpip_address', + tcpip_address: { + ip_address: (_a = ipAddressStringToBuffer(subchannelAddress.host)) !== null && _a !== void 0 ? _a : undefined, + port: subchannelAddress.port, + }, + }; + } + else { + return { + address: 'uds_address', + uds_address: { + filename: subchannelAddress.path, + }, + }; + } +} +function GetSocket(call, callback) { + var _a, _b, _c, _d, _e; + const socketId = parseInt(call.request.socket_id, 10); + const socketEntry = entityMaps["socket" /* EntityTypes.socket */].getElementByKey(socketId); + if (socketEntry === undefined) { + callback({ + code: constants_1.Status.NOT_FOUND, + details: 'No socket data found for id ' + socketId, + }); + return; + } + const resolvedInfo = socketEntry.getInfo(); + const securityMessage = resolvedInfo.security + ? { + model: 'tls', + tls: { + cipher_suite: resolvedInfo.security.cipherSuiteStandardName + ? 'standard_name' + : 'other_name', + standard_name: (_a = resolvedInfo.security.cipherSuiteStandardName) !== null && _a !== void 0 ? _a : undefined, + other_name: (_b = resolvedInfo.security.cipherSuiteOtherName) !== null && _b !== void 0 ? _b : undefined, + local_certificate: (_c = resolvedInfo.security.localCertificate) !== null && _c !== void 0 ? _c : undefined, + remote_certificate: (_d = resolvedInfo.security.remoteCertificate) !== null && _d !== void 0 ? _d : undefined, + }, + } + : null; + const socketMessage = { + ref: socketRefToMessage(socketEntry.ref), + local: resolvedInfo.localAddress + ? subchannelAddressToAddressMessage(resolvedInfo.localAddress) + : null, + remote: resolvedInfo.remoteAddress + ? subchannelAddressToAddressMessage(resolvedInfo.remoteAddress) + : null, + remote_name: (_e = resolvedInfo.remoteName) !== null && _e !== void 0 ? _e : undefined, + security: securityMessage, + data: { + keep_alives_sent: resolvedInfo.keepAlivesSent, + streams_started: resolvedInfo.streamsStarted, + streams_succeeded: resolvedInfo.streamsSucceeded, + streams_failed: resolvedInfo.streamsFailed, + last_local_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastLocalStreamCreatedTimestamp), + last_remote_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastRemoteStreamCreatedTimestamp), + messages_received: resolvedInfo.messagesReceived, + messages_sent: resolvedInfo.messagesSent, + last_message_received_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageReceivedTimestamp), + last_message_sent_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageSentTimestamp), + local_flow_control_window: resolvedInfo.localFlowControlWindow + ? { value: resolvedInfo.localFlowControlWindow } + : null, + remote_flow_control_window: resolvedInfo.remoteFlowControlWindow + ? { value: resolvedInfo.remoteFlowControlWindow } + : null, + }, + }; + callback(null, { socket: socketMessage }); +} +function GetServerSockets(call, callback) { + const serverId = parseInt(call.request.server_id, 10); + const serverEntry = entityMaps["server" /* EntityTypes.server */].getElementByKey(serverId); + if (serverEntry === undefined) { + callback({ + code: constants_1.Status.NOT_FOUND, + details: 'No server data found for id ' + serverId, + }); + return; + } + const startId = parseInt(call.request.start_socket_id, 10); + const maxResults = parseInt(call.request.max_results, 10) || DEFAULT_MAX_RESULTS; + const resolvedInfo = serverEntry.getInfo(); + // If we wanted to include listener sockets in the result, this line would + // instead say + // const allSockets = resolvedInfo.listenerChildren.sockets.concat(resolvedInfo.sessionChildren.sockets).sort((ref1, ref2) => ref1.id - ref2.id); + const allSockets = resolvedInfo.sessionChildren.sockets; + const resultList = []; + let i; + for (i = allSockets.lowerBound(startId); !i.equals(allSockets.end()) && resultList.length < maxResults; i = i.next()) { + resultList.push(socketRefToMessage(i.pointer[1].ref)); + } + callback(null, { + socket_ref: resultList, + end: i.equals(allSockets.end()), + }); +} +function getChannelzHandlers() { + return { + GetChannel, + GetTopChannels, + GetServer, + GetServers, + GetSubchannel, + GetSocket, + GetServerSockets, + }; +} +exports.getChannelzHandlers = getChannelzHandlers; +let loadedChannelzDefinition = null; +function getChannelzServiceDefinition() { + if (loadedChannelzDefinition) { + return loadedChannelzDefinition; + } + /* The purpose of this complexity is to avoid loading @grpc/proto-loader at + * runtime for users who will not use/enable channelz. */ + const loaderLoadSync = (__nccwpck_require__(98171)/* .loadSync */ .J_); + const loadedProto = loaderLoadSync('channelz.proto', { + keepCase: true, + longs: String, + enums: String, + defaults: true, + oneofs: true, + includeDirs: [__nccwpck_require__.ab + "proto"], + }); + const channelzGrpcObject = (0, make_client_1.loadPackageDefinition)(loadedProto); + loadedChannelzDefinition = + channelzGrpcObject.grpc.channelz.v1.Channelz.service; + return loadedChannelzDefinition; +} +exports.getChannelzServiceDefinition = getChannelzServiceDefinition; +function setup() { + (0, admin_1.registerAdminService)(getChannelzServiceDefinition, getChannelzHandlers); +} +exports.setup = setup; +//# sourceMappingURL=channelz.js.map + +/***/ }), + +/***/ 82127: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.getInterceptingCall = exports.InterceptingCall = exports.RequesterBuilder = exports.ListenerBuilder = exports.InterceptorConfigurationError = void 0; +const metadata_1 = __nccwpck_require__(83665); +const call_interface_1 = __nccwpck_require__(78710); +const constants_1 = __nccwpck_require__(90634); +const error_1 = __nccwpck_require__(22336); +/** + * Error class associated with passing both interceptors and interceptor + * providers to a client constructor or as call options. + */ +class InterceptorConfigurationError extends Error { + constructor(message) { + super(message); + this.name = 'InterceptorConfigurationError'; + Error.captureStackTrace(this, InterceptorConfigurationError); + } +} +exports.InterceptorConfigurationError = InterceptorConfigurationError; +class ListenerBuilder { + constructor() { + this.metadata = undefined; + this.message = undefined; + this.status = undefined; + } + withOnReceiveMetadata(onReceiveMetadata) { + this.metadata = onReceiveMetadata; + return this; + } + withOnReceiveMessage(onReceiveMessage) { + this.message = onReceiveMessage; + return this; + } + withOnReceiveStatus(onReceiveStatus) { + this.status = onReceiveStatus; + return this; + } + build() { + return { + onReceiveMetadata: this.metadata, + onReceiveMessage: this.message, + onReceiveStatus: this.status, + }; + } +} +exports.ListenerBuilder = ListenerBuilder; +class RequesterBuilder { + constructor() { + this.start = undefined; + this.message = undefined; + this.halfClose = undefined; + this.cancel = undefined; + } + withStart(start) { + this.start = start; + return this; + } + withSendMessage(sendMessage) { + this.message = sendMessage; + return this; + } + withHalfClose(halfClose) { + this.halfClose = halfClose; + return this; + } + withCancel(cancel) { + this.cancel = cancel; + return this; + } + build() { + return { + start: this.start, + sendMessage: this.message, + halfClose: this.halfClose, + cancel: this.cancel, + }; + } +} +exports.RequesterBuilder = RequesterBuilder; +/** + * A Listener with a default pass-through implementation of each method. Used + * for filling out Listeners with some methods omitted. + */ +const defaultListener = { + onReceiveMetadata: (metadata, next) => { + next(metadata); + }, + onReceiveMessage: (message, next) => { + next(message); + }, + onReceiveStatus: (status, next) => { + next(status); + }, +}; +/** + * A Requester with a default pass-through implementation of each method. Used + * for filling out Requesters with some methods omitted. + */ +const defaultRequester = { + start: (metadata, listener, next) => { + next(metadata, listener); + }, + sendMessage: (message, next) => { + next(message); + }, + halfClose: next => { + next(); + }, + cancel: next => { + next(); + }, +}; +class InterceptingCall { + constructor(nextCall, requester) { + var _a, _b, _c, _d; + this.nextCall = nextCall; + /** + * Indicates that metadata has been passed to the requester's start + * method but it has not been passed to the corresponding next callback + */ + this.processingMetadata = false; + /** + * Message context for a pending message that is waiting for + */ + this.pendingMessageContext = null; + /** + * Indicates that a message has been passed to the requester's sendMessage + * method but it has not been passed to the corresponding next callback + */ + this.processingMessage = false; + /** + * Indicates that a status was received but could not be propagated because + * a message was still being processed. + */ + this.pendingHalfClose = false; + if (requester) { + this.requester = { + start: (_a = requester.start) !== null && _a !== void 0 ? _a : defaultRequester.start, + sendMessage: (_b = requester.sendMessage) !== null && _b !== void 0 ? _b : defaultRequester.sendMessage, + halfClose: (_c = requester.halfClose) !== null && _c !== void 0 ? _c : defaultRequester.halfClose, + cancel: (_d = requester.cancel) !== null && _d !== void 0 ? _d : defaultRequester.cancel, + }; + } + else { + this.requester = defaultRequester; + } + } + cancelWithStatus(status, details) { + this.requester.cancel(() => { + this.nextCall.cancelWithStatus(status, details); + }); + } + getPeer() { + return this.nextCall.getPeer(); + } + processPendingMessage() { + if (this.pendingMessageContext) { + this.nextCall.sendMessageWithContext(this.pendingMessageContext, this.pendingMessage); + this.pendingMessageContext = null; + this.pendingMessage = null; + } + } + processPendingHalfClose() { + if (this.pendingHalfClose) { + this.nextCall.halfClose(); + } + } + start(metadata, interceptingListener) { + var _a, _b, _c, _d, _e, _f; + const fullInterceptingListener = { + onReceiveMetadata: (_b = (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.bind(interceptingListener)) !== null && _b !== void 0 ? _b : (metadata => { }), + onReceiveMessage: (_d = (_c = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMessage) === null || _c === void 0 ? void 0 : _c.bind(interceptingListener)) !== null && _d !== void 0 ? _d : (message => { }), + onReceiveStatus: (_f = (_e = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _e === void 0 ? void 0 : _e.bind(interceptingListener)) !== null && _f !== void 0 ? _f : (status => { }), + }; + this.processingMetadata = true; + this.requester.start(metadata, fullInterceptingListener, (md, listener) => { + var _a, _b, _c; + this.processingMetadata = false; + let finalInterceptingListener; + if ((0, call_interface_1.isInterceptingListener)(listener)) { + finalInterceptingListener = listener; + } + else { + const fullListener = { + onReceiveMetadata: (_a = listener.onReceiveMetadata) !== null && _a !== void 0 ? _a : defaultListener.onReceiveMetadata, + onReceiveMessage: (_b = listener.onReceiveMessage) !== null && _b !== void 0 ? _b : defaultListener.onReceiveMessage, + onReceiveStatus: (_c = listener.onReceiveStatus) !== null && _c !== void 0 ? _c : defaultListener.onReceiveStatus, + }; + finalInterceptingListener = new call_interface_1.InterceptingListenerImpl(fullListener, fullInterceptingListener); + } + this.nextCall.start(md, finalInterceptingListener); + this.processPendingMessage(); + this.processPendingHalfClose(); + }); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendMessageWithContext(context, message) { + this.processingMessage = true; + this.requester.sendMessage(message, finalMessage => { + this.processingMessage = false; + if (this.processingMetadata) { + this.pendingMessageContext = context; + this.pendingMessage = message; + } + else { + this.nextCall.sendMessageWithContext(context, finalMessage); + this.processPendingHalfClose(); + } + }); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendMessage(message) { + this.sendMessageWithContext({}, message); + } + startRead() { + this.nextCall.startRead(); + } + halfClose() { + this.requester.halfClose(() => { + if (this.processingMetadata || this.processingMessage) { + this.pendingHalfClose = true; + } + else { + this.nextCall.halfClose(); + } + }); + } +} +exports.InterceptingCall = InterceptingCall; +function getCall(channel, path, options) { + var _a, _b; + const deadline = (_a = options.deadline) !== null && _a !== void 0 ? _a : Infinity; + const host = options.host; + const parent = (_b = options.parent) !== null && _b !== void 0 ? _b : null; + const propagateFlags = options.propagate_flags; + const credentials = options.credentials; + const call = channel.createCall(path, deadline, host, parent, propagateFlags); + if (credentials) { + call.setCredentials(credentials); + } + return call; +} +/** + * InterceptingCall implementation that directly owns the underlying Call + * object and handles serialization and deseraizliation. + */ +class BaseInterceptingCall { + constructor(call, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + methodDefinition) { + this.call = call; + this.methodDefinition = methodDefinition; + } + cancelWithStatus(status, details) { + this.call.cancelWithStatus(status, details); + } + getPeer() { + return this.call.getPeer(); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendMessageWithContext(context, message) { + let serialized; + try { + serialized = this.methodDefinition.requestSerialize(message); + } + catch (e) { + this.call.cancelWithStatus(constants_1.Status.INTERNAL, `Request message serialization failure: ${(0, error_1.getErrorMessage)(e)}`); + return; + } + this.call.sendMessageWithContext(context, serialized); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + sendMessage(message) { + this.sendMessageWithContext({}, message); + } + start(metadata, interceptingListener) { + let readError = null; + this.call.start(metadata, { + onReceiveMetadata: metadata => { + var _a; + (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, metadata); + }, + onReceiveMessage: message => { + var _a; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let deserialized; + try { + deserialized = this.methodDefinition.responseDeserialize(message); + } + catch (e) { + readError = { + code: constants_1.Status.INTERNAL, + details: `Response message parsing error: ${(0, error_1.getErrorMessage)(e)}`, + metadata: new metadata_1.Metadata(), + }; + this.call.cancelWithStatus(readError.code, readError.details); + return; + } + (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, deserialized); + }, + onReceiveStatus: status => { + var _a, _b; + if (readError) { + (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, readError); + } + else { + (_b = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _b === void 0 ? void 0 : _b.call(interceptingListener, status); + } + }, + }); + } + startRead() { + this.call.startRead(); + } + halfClose() { + this.call.halfClose(); + } +} +/** + * BaseInterceptingCall with special-cased behavior for methods with unary + * responses. + */ +class BaseUnaryInterceptingCall extends BaseInterceptingCall { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(call, methodDefinition) { + super(call, methodDefinition); + } + start(metadata, listener) { + var _a, _b; + let receivedMessage = false; + const wrapperListener = { + onReceiveMetadata: (_b = (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.bind(listener)) !== null && _b !== void 0 ? _b : (metadata => { }), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onReceiveMessage: (message) => { + var _a; + receivedMessage = true; + (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(listener, message); + }, + onReceiveStatus: (status) => { + var _a, _b; + if (!receivedMessage) { + (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(listener, null); + } + (_b = listener === null || listener === void 0 ? void 0 : listener.onReceiveStatus) === null || _b === void 0 ? void 0 : _b.call(listener, status); + }, + }; + super.start(metadata, wrapperListener); + this.call.startRead(); + } +} +/** + * BaseInterceptingCall with special-cased behavior for methods with streaming + * responses. + */ +class BaseStreamingInterceptingCall extends BaseInterceptingCall { +} +function getBottomInterceptingCall(channel, options, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +methodDefinition) { + const call = getCall(channel, methodDefinition.path, options); + if (methodDefinition.responseStream) { + return new BaseStreamingInterceptingCall(call, methodDefinition); + } + else { + return new BaseUnaryInterceptingCall(call, methodDefinition); + } +} +function getInterceptingCall(interceptorArgs, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +methodDefinition, options, channel) { + if (interceptorArgs.clientInterceptors.length > 0 && + interceptorArgs.clientInterceptorProviders.length > 0) { + throw new InterceptorConfigurationError('Both interceptors and interceptor_providers were passed as options ' + + 'to the client constructor. Only one of these is allowed.'); + } + if (interceptorArgs.callInterceptors.length > 0 && + interceptorArgs.callInterceptorProviders.length > 0) { + throw new InterceptorConfigurationError('Both interceptors and interceptor_providers were passed as call ' + + 'options. Only one of these is allowed.'); + } + let interceptors = []; + // Interceptors passed to the call override interceptors passed to the client constructor + if (interceptorArgs.callInterceptors.length > 0 || + interceptorArgs.callInterceptorProviders.length > 0) { + interceptors = [] + .concat(interceptorArgs.callInterceptors, interceptorArgs.callInterceptorProviders.map(provider => provider(methodDefinition))) + .filter(interceptor => interceptor); + // Filter out falsy values when providers return nothing + } + else { + interceptors = [] + .concat(interceptorArgs.clientInterceptors, interceptorArgs.clientInterceptorProviders.map(provider => provider(methodDefinition))) + .filter(interceptor => interceptor); + // Filter out falsy values when providers return nothing + } + const interceptorOptions = Object.assign({}, options, { + method_definition: methodDefinition, + }); + /* For each interceptor in the list, the nextCall function passed to it is + * based on the next interceptor in the list, using a nextCall function + * constructed with the following interceptor in the list, and so on. The + * initialValue, which is effectively at the end of the list, is a nextCall + * function that invokes getBottomInterceptingCall, the result of which + * handles (de)serialization and also gets the underlying call from the + * channel. */ + const getCall = interceptors.reduceRight((nextCall, nextInterceptor) => { + return currentOptions => nextInterceptor(currentOptions, nextCall); + }, (finalOptions) => getBottomInterceptingCall(channel, finalOptions, methodDefinition)); + return getCall(interceptorOptions); +} +exports.getInterceptingCall = getInterceptingCall; +//# sourceMappingURL=client-interceptors.js.map + +/***/ }), + +/***/ 87172: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.Client = void 0; +const call_1 = __nccwpck_require__(97453); +const channel_1 = __nccwpck_require__(13860); +const connectivity_state_1 = __nccwpck_require__(80878); +const constants_1 = __nccwpck_require__(90634); +const metadata_1 = __nccwpck_require__(83665); +const client_interceptors_1 = __nccwpck_require__(82127); +const CHANNEL_SYMBOL = Symbol(); +const INTERCEPTOR_SYMBOL = Symbol(); +const INTERCEPTOR_PROVIDER_SYMBOL = Symbol(); +const CALL_INVOCATION_TRANSFORMER_SYMBOL = Symbol(); +function isFunction(arg) { + return typeof arg === 'function'; +} +function getErrorStackString(error) { + var _a; + return ((_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\n').slice(1).join('\n')) || 'no stack trace available'; +} +/** + * A generic gRPC client. Primarily useful as a base class for all generated + * clients. + */ +class Client { + constructor(address, credentials, options = {}) { + var _a, _b; + options = Object.assign({}, options); + this[INTERCEPTOR_SYMBOL] = (_a = options.interceptors) !== null && _a !== void 0 ? _a : []; + delete options.interceptors; + this[INTERCEPTOR_PROVIDER_SYMBOL] = (_b = options.interceptor_providers) !== null && _b !== void 0 ? _b : []; + delete options.interceptor_providers; + if (this[INTERCEPTOR_SYMBOL].length > 0 && + this[INTERCEPTOR_PROVIDER_SYMBOL].length > 0) { + throw new Error('Both interceptors and interceptor_providers were passed as options ' + + 'to the client constructor. Only one of these is allowed.'); + } + this[CALL_INVOCATION_TRANSFORMER_SYMBOL] = + options.callInvocationTransformer; + delete options.callInvocationTransformer; + if (options.channelOverride) { + this[CHANNEL_SYMBOL] = options.channelOverride; + } + else if (options.channelFactoryOverride) { + const channelFactoryOverride = options.channelFactoryOverride; + delete options.channelFactoryOverride; + this[CHANNEL_SYMBOL] = channelFactoryOverride(address, credentials, options); + } + else { + this[CHANNEL_SYMBOL] = new channel_1.ChannelImplementation(address, credentials, options); + } + } + close() { + this[CHANNEL_SYMBOL].close(); + } + getChannel() { + return this[CHANNEL_SYMBOL]; + } + waitForReady(deadline, callback) { + const checkState = (err) => { + if (err) { + callback(new Error('Failed to connect before the deadline')); + return; + } + let newState; + try { + newState = this[CHANNEL_SYMBOL].getConnectivityState(true); + } + catch (e) { + callback(new Error('The channel has been closed')); + return; + } + if (newState === connectivity_state_1.ConnectivityState.READY) { + callback(); + } + else { + try { + this[CHANNEL_SYMBOL].watchConnectivityState(newState, deadline, checkState); + } + catch (e) { + callback(new Error('The channel has been closed')); + } + } + }; + setImmediate(checkState); + } + checkOptionalUnaryResponseArguments(arg1, arg2, arg3) { + if (isFunction(arg1)) { + return { metadata: new metadata_1.Metadata(), options: {}, callback: arg1 }; + } + else if (isFunction(arg2)) { + if (arg1 instanceof metadata_1.Metadata) { + return { metadata: arg1, options: {}, callback: arg2 }; + } + else { + return { metadata: new metadata_1.Metadata(), options: arg1, callback: arg2 }; + } + } + else { + if (!(arg1 instanceof metadata_1.Metadata && + arg2 instanceof Object && + isFunction(arg3))) { + throw new Error('Incorrect arguments passed'); + } + return { metadata: arg1, options: arg2, callback: arg3 }; + } + } + makeUnaryRequest(method, serialize, deserialize, argument, metadata, options, callback) { + var _a, _b; + const checkedArguments = this.checkOptionalUnaryResponseArguments(metadata, options, callback); + const methodDefinition = { + path: method, + requestStream: false, + responseStream: false, + requestSerialize: serialize, + responseDeserialize: deserialize, + }; + let callProperties = { + argument: argument, + metadata: checkedArguments.metadata, + call: new call_1.ClientUnaryCallImpl(), + channel: this[CHANNEL_SYMBOL], + methodDefinition: methodDefinition, + callOptions: checkedArguments.options, + callback: checkedArguments.callback, + }; + if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { + callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); + } + const emitter = callProperties.call; + const interceptorArgs = { + clientInterceptors: this[INTERCEPTOR_SYMBOL], + clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], + callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], + callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], + }; + const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); + /* This needs to happen before the emitter is used. Unfortunately we can't + * enforce this with the type system. We need to construct this emitter + * before calling the CallInvocationTransformer, and we need to create the + * call after that. */ + emitter.call = call; + let responseMessage = null; + let receivedStatus = false; + let callerStackError = new Error(); + call.start(callProperties.metadata, { + onReceiveMetadata: metadata => { + emitter.emit('metadata', metadata); + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onReceiveMessage(message) { + if (responseMessage !== null) { + call.cancelWithStatus(constants_1.Status.INTERNAL, 'Too many responses received'); + } + responseMessage = message; + }, + onReceiveStatus(status) { + if (receivedStatus) { + return; + } + receivedStatus = true; + if (status.code === constants_1.Status.OK) { + if (responseMessage === null) { + const callerStack = getErrorStackString(callerStackError); + callProperties.callback((0, call_1.callErrorFromStatus)({ + code: constants_1.Status.INTERNAL, + details: 'No message received', + metadata: status.metadata, + }, callerStack)); + } + else { + callProperties.callback(null, responseMessage); + } + } + else { + const callerStack = getErrorStackString(callerStackError); + callProperties.callback((0, call_1.callErrorFromStatus)(status, callerStack)); + } + /* Avoid retaining the callerStackError object in the call context of + * the status event handler. */ + callerStackError = null; + emitter.emit('status', status); + }, + }); + call.sendMessage(argument); + call.halfClose(); + return emitter; + } + makeClientStreamRequest(method, serialize, deserialize, metadata, options, callback) { + var _a, _b; + const checkedArguments = this.checkOptionalUnaryResponseArguments(metadata, options, callback); + const methodDefinition = { + path: method, + requestStream: true, + responseStream: false, + requestSerialize: serialize, + responseDeserialize: deserialize, + }; + let callProperties = { + metadata: checkedArguments.metadata, + call: new call_1.ClientWritableStreamImpl(serialize), + channel: this[CHANNEL_SYMBOL], + methodDefinition: methodDefinition, + callOptions: checkedArguments.options, + callback: checkedArguments.callback, + }; + if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { + callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); + } + const emitter = callProperties.call; + const interceptorArgs = { + clientInterceptors: this[INTERCEPTOR_SYMBOL], + clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], + callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], + callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], + }; + const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); + /* This needs to happen before the emitter is used. Unfortunately we can't + * enforce this with the type system. We need to construct this emitter + * before calling the CallInvocationTransformer, and we need to create the + * call after that. */ + emitter.call = call; + let responseMessage = null; + let receivedStatus = false; + let callerStackError = new Error(); + call.start(callProperties.metadata, { + onReceiveMetadata: metadata => { + emitter.emit('metadata', metadata); + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onReceiveMessage(message) { + if (responseMessage !== null) { + call.cancelWithStatus(constants_1.Status.INTERNAL, 'Too many responses received'); + } + responseMessage = message; + }, + onReceiveStatus(status) { + if (receivedStatus) { + return; + } + receivedStatus = true; + if (status.code === constants_1.Status.OK) { + if (responseMessage === null) { + const callerStack = getErrorStackString(callerStackError); + callProperties.callback((0, call_1.callErrorFromStatus)({ + code: constants_1.Status.INTERNAL, + details: 'No message received', + metadata: status.metadata, + }, callerStack)); + } + else { + callProperties.callback(null, responseMessage); + } + } + else { + const callerStack = getErrorStackString(callerStackError); + callProperties.callback((0, call_1.callErrorFromStatus)(status, callerStack)); + } + /* Avoid retaining the callerStackError object in the call context of + * the status event handler. */ + callerStackError = null; + emitter.emit('status', status); + }, + }); + return emitter; + } + checkMetadataAndOptions(arg1, arg2) { + let metadata; + let options; + if (arg1 instanceof metadata_1.Metadata) { + metadata = arg1; + if (arg2) { + options = arg2; + } + else { + options = {}; + } + } + else { + if (arg1) { + options = arg1; + } + else { + options = {}; + } + metadata = new metadata_1.Metadata(); + } + return { metadata, options }; + } + makeServerStreamRequest(method, serialize, deserialize, argument, metadata, options) { + var _a, _b; + const checkedArguments = this.checkMetadataAndOptions(metadata, options); + const methodDefinition = { + path: method, + requestStream: false, + responseStream: true, + requestSerialize: serialize, + responseDeserialize: deserialize, + }; + let callProperties = { + argument: argument, + metadata: checkedArguments.metadata, + call: new call_1.ClientReadableStreamImpl(deserialize), + channel: this[CHANNEL_SYMBOL], + methodDefinition: methodDefinition, + callOptions: checkedArguments.options, + }; + if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { + callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); + } + const stream = callProperties.call; + const interceptorArgs = { + clientInterceptors: this[INTERCEPTOR_SYMBOL], + clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], + callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], + callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], + }; + const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); + /* This needs to happen before the emitter is used. Unfortunately we can't + * enforce this with the type system. We need to construct this emitter + * before calling the CallInvocationTransformer, and we need to create the + * call after that. */ + stream.call = call; + let receivedStatus = false; + let callerStackError = new Error(); + call.start(callProperties.metadata, { + onReceiveMetadata(metadata) { + stream.emit('metadata', metadata); + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onReceiveMessage(message) { + stream.push(message); + }, + onReceiveStatus(status) { + if (receivedStatus) { + return; + } + receivedStatus = true; + stream.push(null); + if (status.code !== constants_1.Status.OK) { + const callerStack = getErrorStackString(callerStackError); + stream.emit('error', (0, call_1.callErrorFromStatus)(status, callerStack)); + } + /* Avoid retaining the callerStackError object in the call context of + * the status event handler. */ + callerStackError = null; + stream.emit('status', status); + }, + }); + call.sendMessage(argument); + call.halfClose(); + return stream; + } + makeBidiStreamRequest(method, serialize, deserialize, metadata, options) { + var _a, _b; + const checkedArguments = this.checkMetadataAndOptions(metadata, options); + const methodDefinition = { + path: method, + requestStream: true, + responseStream: true, + requestSerialize: serialize, + responseDeserialize: deserialize, + }; + let callProperties = { + metadata: checkedArguments.metadata, + call: new call_1.ClientDuplexStreamImpl(serialize, deserialize), + channel: this[CHANNEL_SYMBOL], + methodDefinition: methodDefinition, + callOptions: checkedArguments.options, + }; + if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { + callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); + } + const stream = callProperties.call; + const interceptorArgs = { + clientInterceptors: this[INTERCEPTOR_SYMBOL], + clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], + callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], + callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], + }; + const call = (0, client_interceptors_1.getInterceptingCall)(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); + /* This needs to happen before the emitter is used. Unfortunately we can't + * enforce this with the type system. We need to construct this emitter + * before calling the CallInvocationTransformer, and we need to create the + * call after that. */ + stream.call = call; + let receivedStatus = false; + let callerStackError = new Error(); + call.start(callProperties.metadata, { + onReceiveMetadata(metadata) { + stream.emit('metadata', metadata); + }, + onReceiveMessage(message) { + stream.push(message); + }, + onReceiveStatus(status) { + if (receivedStatus) { + return; + } + receivedStatus = true; + stream.push(null); + if (status.code !== constants_1.Status.OK) { + const callerStack = getErrorStackString(callerStackError); + stream.emit('error', (0, call_1.callErrorFromStatus)(status, callerStack)); + } + /* Avoid retaining the callerStackError object in the call context of + * the status event handler. */ + callerStackError = null; + stream.emit('status', status); + }, + }); + return stream; + } +} +exports.Client = Client; +//# sourceMappingURL=client.js.map + +/***/ }), + +/***/ 54789: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2021 gRPC authors. + * + * 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 })); +exports.CompressionAlgorithms = void 0; +var CompressionAlgorithms; +(function (CompressionAlgorithms) { + CompressionAlgorithms[CompressionAlgorithms["identity"] = 0] = "identity"; + CompressionAlgorithms[CompressionAlgorithms["deflate"] = 1] = "deflate"; + CompressionAlgorithms[CompressionAlgorithms["gzip"] = 2] = "gzip"; +})(CompressionAlgorithms || (exports.CompressionAlgorithms = CompressionAlgorithms = {})); +//# sourceMappingURL=compression-algorithms.js.map + +/***/ }), + +/***/ 47616: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.CompressionFilterFactory = exports.CompressionFilter = void 0; +const zlib = __nccwpck_require__(59796); +const compression_algorithms_1 = __nccwpck_require__(54789); +const constants_1 = __nccwpck_require__(90634); +const filter_1 = __nccwpck_require__(43392); +const logging = __nccwpck_require__(35993); +const isCompressionAlgorithmKey = (key) => { + return (typeof key === 'number' && typeof compression_algorithms_1.CompressionAlgorithms[key] === 'string'); +}; +class CompressionHandler { + /** + * @param message Raw uncompressed message bytes + * @param compress Indicates whether the message should be compressed + * @return Framed message, compressed if applicable + */ + async writeMessage(message, compress) { + let messageBuffer = message; + if (compress) { + messageBuffer = await this.compressMessage(messageBuffer); + } + const output = Buffer.allocUnsafe(messageBuffer.length + 5); + output.writeUInt8(compress ? 1 : 0, 0); + output.writeUInt32BE(messageBuffer.length, 1); + messageBuffer.copy(output, 5); + return output; + } + /** + * @param data Framed message, possibly compressed + * @return Uncompressed message + */ + async readMessage(data) { + const compressed = data.readUInt8(0) === 1; + let messageBuffer = data.slice(5); + if (compressed) { + messageBuffer = await this.decompressMessage(messageBuffer); + } + return messageBuffer; + } +} +class IdentityHandler extends CompressionHandler { + async compressMessage(message) { + return message; + } + async writeMessage(message, compress) { + const output = Buffer.allocUnsafe(message.length + 5); + /* With "identity" compression, messages should always be marked as + * uncompressed */ + output.writeUInt8(0, 0); + output.writeUInt32BE(message.length, 1); + message.copy(output, 5); + return output; + } + decompressMessage(message) { + return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity')); + } +} +class DeflateHandler extends CompressionHandler { + constructor(maxRecvMessageLength) { + super(); + this.maxRecvMessageLength = maxRecvMessageLength; + } + compressMessage(message) { + return new Promise((resolve, reject) => { + zlib.deflate(message, (err, output) => { + if (err) { + reject(err); + } + else { + resolve(output); + } + }); + }); + } + decompressMessage(message) { + return new Promise((resolve, reject) => { + let totalLength = 0; + const messageParts = []; + const decompresser = zlib.createInflate(); + decompresser.on('data', (chunk) => { + messageParts.push(chunk); + totalLength += chunk.byteLength; + if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) { + decompresser.destroy(); + reject({ + code: constants_1.Status.RESOURCE_EXHAUSTED, + details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}` + }); + } + }); + decompresser.on('end', () => { + resolve(Buffer.concat(messageParts)); + }); + decompresser.write(message); + decompresser.end(); + }); + } +} +class GzipHandler extends CompressionHandler { + constructor(maxRecvMessageLength) { + super(); + this.maxRecvMessageLength = maxRecvMessageLength; + } + compressMessage(message) { + return new Promise((resolve, reject) => { + zlib.gzip(message, (err, output) => { + if (err) { + reject(err); + } + else { + resolve(output); + } + }); + }); + } + decompressMessage(message) { + return new Promise((resolve, reject) => { + let totalLength = 0; + const messageParts = []; + const decompresser = zlib.createGunzip(); + decompresser.on('data', (chunk) => { + messageParts.push(chunk); + totalLength += chunk.byteLength; + if (this.maxRecvMessageLength !== -1 && totalLength > this.maxRecvMessageLength) { + decompresser.destroy(); + reject({ + code: constants_1.Status.RESOURCE_EXHAUSTED, + details: `Received message that decompresses to a size larger than ${this.maxRecvMessageLength}` + }); + } + }); + decompresser.on('end', () => { + resolve(Buffer.concat(messageParts)); + }); + decompresser.write(message); + decompresser.end(); + }); + } +} +class UnknownHandler extends CompressionHandler { + constructor(compressionName) { + super(); + this.compressionName = compressionName; + } + compressMessage(message) { + return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`)); + } + decompressMessage(message) { + // This should be unreachable + return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`)); + } +} +function getCompressionHandler(compressionName, maxReceiveMessageSize) { + switch (compressionName) { + case 'identity': + return new IdentityHandler(); + case 'deflate': + return new DeflateHandler(maxReceiveMessageSize); + case 'gzip': + return new GzipHandler(maxReceiveMessageSize); + default: + return new UnknownHandler(compressionName); + } +} +class CompressionFilter extends filter_1.BaseFilter { + constructor(channelOptions, sharedFilterConfig) { + var _a, _b; + super(); + this.sharedFilterConfig = sharedFilterConfig; + this.sendCompression = new IdentityHandler(); + this.receiveCompression = new IdentityHandler(); + this.currentCompressionAlgorithm = 'identity'; + const compressionAlgorithmKey = channelOptions['grpc.default_compression_algorithm']; + this.maxReceiveMessageLength = (_a = channelOptions['grpc.max_receive_message_length']) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; + if (compressionAlgorithmKey !== undefined) { + if (isCompressionAlgorithmKey(compressionAlgorithmKey)) { + const clientSelectedEncoding = compression_algorithms_1.CompressionAlgorithms[compressionAlgorithmKey]; + const serverSupportedEncodings = (_b = sharedFilterConfig.serverSupportedEncodingHeader) === null || _b === void 0 ? void 0 : _b.split(','); + /** + * There are two possible situations here: + * 1) We don't have any info yet from the server about what compression it supports + * In that case we should just use what the client tells us to use + * 2) We've previously received a response from the server including a grpc-accept-encoding header + * In that case we only want to use the encoding chosen by the client if the server supports it + */ + if (!serverSupportedEncodings || + serverSupportedEncodings.includes(clientSelectedEncoding)) { + this.currentCompressionAlgorithm = clientSelectedEncoding; + this.sendCompression = getCompressionHandler(this.currentCompressionAlgorithm, -1); + } + } + else { + logging.log(constants_1.LogVerbosity.ERROR, `Invalid value provided for grpc.default_compression_algorithm option: ${compressionAlgorithmKey}`); + } + } + } + async sendMetadata(metadata) { + const headers = await metadata; + headers.set('grpc-accept-encoding', 'identity,deflate,gzip'); + headers.set('accept-encoding', 'identity'); + // No need to send the header if it's "identity" - behavior is identical; save the bandwidth + if (this.currentCompressionAlgorithm === 'identity') { + headers.remove('grpc-encoding'); + } + else { + headers.set('grpc-encoding', this.currentCompressionAlgorithm); + } + return headers; + } + receiveMetadata(metadata) { + const receiveEncoding = metadata.get('grpc-encoding'); + if (receiveEncoding.length > 0) { + const encoding = receiveEncoding[0]; + if (typeof encoding === 'string') { + this.receiveCompression = getCompressionHandler(encoding, this.maxReceiveMessageLength); + } + } + metadata.remove('grpc-encoding'); + /* Check to see if the compression we're using to send messages is supported by the server + * If not, reset the sendCompression filter and have it use the default IdentityHandler */ + const serverSupportedEncodingsHeader = metadata.get('grpc-accept-encoding')[0]; + if (serverSupportedEncodingsHeader) { + this.sharedFilterConfig.serverSupportedEncodingHeader = + serverSupportedEncodingsHeader; + const serverSupportedEncodings = serverSupportedEncodingsHeader.split(','); + if (!serverSupportedEncodings.includes(this.currentCompressionAlgorithm)) { + this.sendCompression = new IdentityHandler(); + this.currentCompressionAlgorithm = 'identity'; + } + } + metadata.remove('grpc-accept-encoding'); + return metadata; + } + async sendMessage(message) { + var _a; + /* This filter is special. The input message is the bare message bytes, + * and the output is a framed and possibly compressed message. For this + * reason, this filter should be at the bottom of the filter stack */ + const resolvedMessage = await message; + let compress; + if (this.sendCompression instanceof IdentityHandler) { + compress = false; + } + else { + compress = (((_a = resolvedMessage.flags) !== null && _a !== void 0 ? _a : 0) & 2 /* WriteFlags.NoCompress */) === 0; + } + return { + message: await this.sendCompression.writeMessage(resolvedMessage.message, compress), + flags: resolvedMessage.flags, + }; + } + async receiveMessage(message) { + /* This filter is also special. The input message is framed and possibly + * compressed, and the output message is deframed and uncompressed. So + * this is another reason that this filter should be at the bottom of the + * filter stack. */ + return this.receiveCompression.readMessage(await message); + } +} +exports.CompressionFilter = CompressionFilter; +class CompressionFilterFactory { + constructor(channel, options) { + this.options = options; + this.sharedFilterConfig = {}; + } + createFilter() { + return new CompressionFilter(this.options, this.sharedFilterConfig); + } +} +exports.CompressionFilterFactory = CompressionFilterFactory; +//# sourceMappingURL=compression-filter.js.map + +/***/ }), + +/***/ 80878: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2021 gRPC authors. + * + * 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 })); +exports.ConnectivityState = void 0; +var ConnectivityState; +(function (ConnectivityState) { + ConnectivityState[ConnectivityState["IDLE"] = 0] = "IDLE"; + ConnectivityState[ConnectivityState["CONNECTING"] = 1] = "CONNECTING"; + ConnectivityState[ConnectivityState["READY"] = 2] = "READY"; + ConnectivityState[ConnectivityState["TRANSIENT_FAILURE"] = 3] = "TRANSIENT_FAILURE"; + ConnectivityState[ConnectivityState["SHUTDOWN"] = 4] = "SHUTDOWN"; +})(ConnectivityState || (exports.ConnectivityState = ConnectivityState = {})); +//# sourceMappingURL=connectivity-state.js.map + +/***/ }), + +/***/ 90634: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = exports.DEFAULT_MAX_SEND_MESSAGE_LENGTH = exports.Propagate = exports.LogVerbosity = exports.Status = void 0; +var Status; +(function (Status) { + Status[Status["OK"] = 0] = "OK"; + Status[Status["CANCELLED"] = 1] = "CANCELLED"; + Status[Status["UNKNOWN"] = 2] = "UNKNOWN"; + Status[Status["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT"; + Status[Status["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED"; + Status[Status["NOT_FOUND"] = 5] = "NOT_FOUND"; + Status[Status["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS"; + Status[Status["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED"; + Status[Status["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED"; + Status[Status["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION"; + Status[Status["ABORTED"] = 10] = "ABORTED"; + Status[Status["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE"; + Status[Status["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED"; + Status[Status["INTERNAL"] = 13] = "INTERNAL"; + Status[Status["UNAVAILABLE"] = 14] = "UNAVAILABLE"; + Status[Status["DATA_LOSS"] = 15] = "DATA_LOSS"; + Status[Status["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED"; +})(Status || (exports.Status = Status = {})); +var LogVerbosity; +(function (LogVerbosity) { + LogVerbosity[LogVerbosity["DEBUG"] = 0] = "DEBUG"; + LogVerbosity[LogVerbosity["INFO"] = 1] = "INFO"; + LogVerbosity[LogVerbosity["ERROR"] = 2] = "ERROR"; + LogVerbosity[LogVerbosity["NONE"] = 3] = "NONE"; +})(LogVerbosity || (exports.LogVerbosity = LogVerbosity = {})); +/** + * NOTE: This enum is not currently used in any implemented API in this + * library. It is included only for type parity with the other implementation. + */ +var Propagate; +(function (Propagate) { + Propagate[Propagate["DEADLINE"] = 1] = "DEADLINE"; + Propagate[Propagate["CENSUS_STATS_CONTEXT"] = 2] = "CENSUS_STATS_CONTEXT"; + Propagate[Propagate["CENSUS_TRACING_CONTEXT"] = 4] = "CENSUS_TRACING_CONTEXT"; + Propagate[Propagate["CANCELLATION"] = 8] = "CANCELLATION"; + // https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/propagation_bits.h#L43 + Propagate[Propagate["DEFAULTS"] = 65535] = "DEFAULTS"; +})(Propagate || (exports.Propagate = Propagate = {})); +// -1 means unlimited +exports.DEFAULT_MAX_SEND_MESSAGE_LENGTH = -1; +// 4 MB default +exports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 39129: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.restrictControlPlaneStatusCode = void 0; +const constants_1 = __nccwpck_require__(90634); +const INAPPROPRIATE_CONTROL_PLANE_CODES = [ + constants_1.Status.OK, + constants_1.Status.INVALID_ARGUMENT, + constants_1.Status.NOT_FOUND, + constants_1.Status.ALREADY_EXISTS, + constants_1.Status.FAILED_PRECONDITION, + constants_1.Status.ABORTED, + constants_1.Status.OUT_OF_RANGE, + constants_1.Status.DATA_LOSS, +]; +function restrictControlPlaneStatusCode(code, details) { + if (INAPPROPRIATE_CONTROL_PLANE_CODES.includes(code)) { + return { + code: constants_1.Status.INTERNAL, + details: `Invalid status from control plane: ${code} ${constants_1.Status[code]} ${details}`, + }; + } + else { + return { code, details }; + } +} +exports.restrictControlPlaneStatusCode = restrictControlPlaneStatusCode; +//# sourceMappingURL=control-plane-status.js.map + +/***/ }), + +/***/ 511: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.formatDateDifference = exports.deadlineToString = exports.getRelativeTimeout = exports.getDeadlineTimeoutString = exports.minDeadline = void 0; +function minDeadline(...deadlineList) { + let minValue = Infinity; + for (const deadline of deadlineList) { + const deadlineMsecs = deadline instanceof Date ? deadline.getTime() : deadline; + if (deadlineMsecs < minValue) { + minValue = deadlineMsecs; + } + } + return minValue; +} +exports.minDeadline = minDeadline; +const units = [ + ['m', 1], + ['S', 1000], + ['M', 60 * 1000], + ['H', 60 * 60 * 1000], +]; +function getDeadlineTimeoutString(deadline) { + const now = new Date().getTime(); + if (deadline instanceof Date) { + deadline = deadline.getTime(); + } + const timeoutMs = Math.max(deadline - now, 0); + for (const [unit, factor] of units) { + const amount = timeoutMs / factor; + if (amount < 1e8) { + return String(Math.ceil(amount)) + unit; + } + } + throw new Error('Deadline is too far in the future'); +} +exports.getDeadlineTimeoutString = getDeadlineTimeoutString; +/** + * See https://nodejs.org/api/timers.html#settimeoutcallback-delay-args + * In particular, "When delay is larger than 2147483647 or less than 1, the + * delay will be set to 1. Non-integer delays are truncated to an integer." + * This number of milliseconds is almost 25 days. + */ +const MAX_TIMEOUT_TIME = 2147483647; +/** + * Get the timeout value that should be passed to setTimeout now for the timer + * to end at the deadline. For any deadline before now, the timer should end + * immediately, represented by a value of 0. For any deadline more than + * MAX_TIMEOUT_TIME milliseconds in the future, a timer cannot be set that will + * end at that time, so it is treated as infinitely far in the future. + * @param deadline + * @returns + */ +function getRelativeTimeout(deadline) { + const deadlineMs = deadline instanceof Date ? deadline.getTime() : deadline; + const now = new Date().getTime(); + const timeout = deadlineMs - now; + if (timeout < 0) { + return 0; + } + else if (timeout > MAX_TIMEOUT_TIME) { + return Infinity; + } + else { + return timeout; + } +} +exports.getRelativeTimeout = getRelativeTimeout; +function deadlineToString(deadline) { + if (deadline instanceof Date) { + return deadline.toISOString(); + } + else { + const dateDeadline = new Date(deadline); + if (Number.isNaN(dateDeadline.getTime())) { + return '' + deadline; + } + else { + return dateDeadline.toISOString(); + } + } +} +exports.deadlineToString = deadlineToString; +/** + * Calculate the difference between two dates as a number of seconds and format + * it as a string. + * @param startDate + * @param endDate + * @returns + */ +function formatDateDifference(startDate, endDate) { + return ((endDate.getTime() - startDate.getTime()) / 1000).toFixed(3) + 's'; +} +exports.formatDateDifference = formatDateDifference; +//# sourceMappingURL=deadline.js.map + +/***/ }), + +/***/ 62668: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.isDuration = exports.durationToMs = exports.msToDuration = void 0; +function msToDuration(millis) { + return { + seconds: (millis / 1000) | 0, + nanos: ((millis % 1000) * 1000000) | 0, + }; +} +exports.msToDuration = msToDuration; +function durationToMs(duration) { + return (duration.seconds * 1000 + duration.nanos / 1000000) | 0; +} +exports.durationToMs = durationToMs; +function isDuration(value) { + return typeof value.seconds === 'number' && typeof value.nanos === 'number'; +} +exports.isDuration = isDuration; +//# sourceMappingURL=duration.js.map + +/***/ }), + +/***/ 22336: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.getErrorCode = exports.getErrorMessage = void 0; +function getErrorMessage(error) { + if (error instanceof Error) { + return error.message; + } + else { + return String(error); + } +} +exports.getErrorMessage = getErrorMessage; +function getErrorCode(error) { + if (typeof error === 'object' && + error !== null && + 'code' in error && + typeof error.code === 'number') { + return error.code; + } + else { + return null; + } +} +exports.getErrorCode = getErrorCode; +//# sourceMappingURL=error.js.map + +/***/ }), + +/***/ 37626: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BaseSubchannelWrapper = exports.registerAdminService = exports.FilterStackFactory = exports.BaseFilter = exports.PickResultType = exports.QueuePicker = exports.UnavailablePicker = exports.ChildLoadBalancerHandler = exports.EndpointMap = exports.endpointHasAddress = exports.endpointToString = exports.subchannelAddressToString = exports.LeafLoadBalancer = exports.isLoadBalancerNameRegistered = exports.parseLoadBalancingConfig = exports.selectLbConfigFromList = exports.registerLoadBalancerType = exports.createChildChannelControlHelper = exports.BackoffTimeout = exports.durationToMs = exports.uriToString = exports.createResolver = exports.registerResolver = exports.log = exports.trace = void 0; +var logging_1 = __nccwpck_require__(35993); +Object.defineProperty(exports, "trace", ({ enumerable: true, get: function () { return logging_1.trace; } })); +Object.defineProperty(exports, "log", ({ enumerable: true, get: function () { return logging_1.log; } })); +var resolver_1 = __nccwpck_require__(31594); +Object.defineProperty(exports, "registerResolver", ({ enumerable: true, get: function () { return resolver_1.registerResolver; } })); +Object.defineProperty(exports, "createResolver", ({ enumerable: true, get: function () { return resolver_1.createResolver; } })); +var uri_parser_1 = __nccwpck_require__(65974); +Object.defineProperty(exports, "uriToString", ({ enumerable: true, get: function () { return uri_parser_1.uriToString; } })); +var duration_1 = __nccwpck_require__(62668); +Object.defineProperty(exports, "durationToMs", ({ enumerable: true, get: function () { return duration_1.durationToMs; } })); +var backoff_timeout_1 = __nccwpck_require__(34186); +Object.defineProperty(exports, "BackoffTimeout", ({ enumerable: true, get: function () { return backoff_timeout_1.BackoffTimeout; } })); +var load_balancer_1 = __nccwpck_require__(52680); +Object.defineProperty(exports, "createChildChannelControlHelper", ({ enumerable: true, get: function () { return load_balancer_1.createChildChannelControlHelper; } })); +Object.defineProperty(exports, "registerLoadBalancerType", ({ enumerable: true, get: function () { return load_balancer_1.registerLoadBalancerType; } })); +Object.defineProperty(exports, "selectLbConfigFromList", ({ enumerable: true, get: function () { return load_balancer_1.selectLbConfigFromList; } })); +Object.defineProperty(exports, "parseLoadBalancingConfig", ({ enumerable: true, get: function () { return load_balancer_1.parseLoadBalancingConfig; } })); +Object.defineProperty(exports, "isLoadBalancerNameRegistered", ({ enumerable: true, get: function () { return load_balancer_1.isLoadBalancerNameRegistered; } })); +var load_balancer_pick_first_1 = __nccwpck_require__(38977); +Object.defineProperty(exports, "LeafLoadBalancer", ({ enumerable: true, get: function () { return load_balancer_pick_first_1.LeafLoadBalancer; } })); +var subchannel_address_1 = __nccwpck_require__(99905); +Object.defineProperty(exports, "subchannelAddressToString", ({ enumerable: true, get: function () { return subchannel_address_1.subchannelAddressToString; } })); +Object.defineProperty(exports, "endpointToString", ({ enumerable: true, get: function () { return subchannel_address_1.endpointToString; } })); +Object.defineProperty(exports, "endpointHasAddress", ({ enumerable: true, get: function () { return subchannel_address_1.endpointHasAddress; } })); +Object.defineProperty(exports, "EndpointMap", ({ enumerable: true, get: function () { return subchannel_address_1.EndpointMap; } })); +var load_balancer_child_handler_1 = __nccwpck_require__(17559); +Object.defineProperty(exports, "ChildLoadBalancerHandler", ({ enumerable: true, get: function () { return load_balancer_child_handler_1.ChildLoadBalancerHandler; } })); +var picker_1 = __nccwpck_require__(81611); +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); +Object.defineProperty(exports, "BaseFilter", ({ enumerable: true, get: function () { return filter_1.BaseFilter; } })); +var filter_stack_1 = __nccwpck_require__(66450); +Object.defineProperty(exports, "FilterStackFactory", ({ enumerable: true, get: function () { return filter_stack_1.FilterStackFactory; } })); +var admin_1 = __nccwpck_require__(8258); +Object.defineProperty(exports, "registerAdminService", ({ enumerable: true, get: function () { return admin_1.registerAdminService; } })); +var subchannel_interface_1 = __nccwpck_require__(12258); +Object.defineProperty(exports, "BaseSubchannelWrapper", ({ enumerable: true, get: function () { return subchannel_interface_1.BaseSubchannelWrapper; } })); +//# sourceMappingURL=experimental.js.map + +/***/ }), + +/***/ 66450: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.FilterStackFactory = exports.FilterStack = void 0; +class FilterStack { + constructor(filters) { + this.filters = filters; + } + sendMetadata(metadata) { + let result = metadata; + for (let i = 0; i < this.filters.length; i++) { + result = this.filters[i].sendMetadata(result); + } + return result; + } + receiveMetadata(metadata) { + let result = metadata; + for (let i = this.filters.length - 1; i >= 0; i--) { + result = this.filters[i].receiveMetadata(result); + } + return result; + } + sendMessage(message) { + let result = message; + for (let i = 0; i < this.filters.length; i++) { + result = this.filters[i].sendMessage(result); + } + return result; + } + receiveMessage(message) { + let result = message; + for (let i = this.filters.length - 1; i >= 0; i--) { + result = this.filters[i].receiveMessage(result); + } + return result; + } + receiveTrailers(status) { + let result = status; + for (let i = this.filters.length - 1; i >= 0; i--) { + result = this.filters[i].receiveTrailers(result); + } + return result; + } + push(filters) { + this.filters.unshift(...filters); + } + getFilters() { + return this.filters; + } +} +exports.FilterStack = FilterStack; +class FilterStackFactory { + constructor(factories) { + this.factories = factories; + } + push(filterFactories) { + this.factories.unshift(...filterFactories); + } + clone() { + return new FilterStackFactory([...this.factories]); + } + createFilter() { + return new FilterStack(this.factories.map(factory => factory.createFilter())); + } +} +exports.FilterStackFactory = FilterStackFactory; +//# sourceMappingURL=filter-stack.js.map + +/***/ }), + +/***/ 43392: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.BaseFilter = void 0; +class BaseFilter { + async sendMetadata(metadata) { + return metadata; + } + receiveMetadata(metadata) { + return metadata; + } + async sendMessage(message) { + return message; + } + async receiveMessage(message) { + return message; + } + receiveTrailers(status) { + return status; + } +} +exports.BaseFilter = BaseFilter; +//# sourceMappingURL=filter.js.map + +/***/ }), + +/***/ 24000: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +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_address_1 = __nccwpck_require__(99905); +const uri_parser_1 = __nccwpck_require__(65974); +const url_1 = __nccwpck_require__(57310); +const resolver_dns_1 = __nccwpck_require__(54886); +const TRACER_NAME = 'proxy'; +function trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); +} +function getProxyInfo() { + let proxyEnv = ''; + let envVar = ''; + /* Prefer using 'grpc_proxy'. Fallback on 'http_proxy' if it is not set. + * Also prefer using 'https_proxy' with fallback on 'http_proxy'. The + * fallback behavior can be removed if there's a demand for it. + */ + if (process.env.grpc_proxy) { + envVar = 'grpc_proxy'; + proxyEnv = process.env.grpc_proxy; + } + else if (process.env.https_proxy) { + envVar = 'https_proxy'; + proxyEnv = process.env.https_proxy; + } + else if (process.env.http_proxy) { + envVar = 'http_proxy'; + proxyEnv = process.env.http_proxy; + } + else { + return {}; + } + let proxyUrl; + try { + proxyUrl = new url_1.URL(proxyEnv); + } + catch (e) { + (0, logging_1.log)(constants_1.LogVerbosity.ERROR, `cannot parse value of "${envVar}" env var`); + return {}; + } + if (proxyUrl.protocol !== 'http:') { + (0, logging_1.log)(constants_1.LogVerbosity.ERROR, `"${proxyUrl.protocol}" scheme not supported in proxy URI`); + return {}; + } + let userCred = null; + if (proxyUrl.username) { + if (proxyUrl.password) { + (0, logging_1.log)(constants_1.LogVerbosity.INFO, 'userinfo found in proxy URI'); + userCred = `${proxyUrl.username}:${proxyUrl.password}`; + } + else { + userCred = proxyUrl.username; + } + } + const hostname = proxyUrl.hostname; + let port = proxyUrl.port; + /* The proxy URL uses the scheme "http:", which has a default port number of + * 80. We need to set that explicitly here if it is omitted because otherwise + * it will use gRPC's default port 443. */ + if (port === '') { + port = '80'; + } + const result = { + address: `${hostname}:${port}`, + }; + if (userCred) { + result.creds = userCred; + } + trace('Proxy server ' + result.address + ' set by environment variable ' + envVar); + return result; +} +function getNoProxyHostList() { + /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */ + let noProxyStr = process.env.no_grpc_proxy; + let envVar = 'no_grpc_proxy'; + if (!noProxyStr) { + noProxyStr = process.env.no_proxy; + envVar = 'no_proxy'; + } + if (noProxyStr) { + trace('No proxy server list set by environment variable ' + envVar); + return noProxyStr.split(','); + } + else { + return []; + } +} +function mapProxyName(target, options) { + var _a; + const noProxyResult = { + target: target, + extraOptions: {}, + }; + if (((_a = options['grpc.enable_http_proxy']) !== null && _a !== void 0 ? _a : 1) === 0) { + return noProxyResult; + } + if (target.scheme === 'unix') { + return noProxyResult; + } + const proxyInfo = getProxyInfo(); + if (!proxyInfo.address) { + return noProxyResult; + } + const hostPort = (0, uri_parser_1.splitHostPort)(target.path); + if (!hostPort) { + return noProxyResult; + } + const serverHost = hostPort.host; + for (const host of getNoProxyHostList()) { + if (host === serverHost) { + trace('Not using proxy for target in no_proxy list: ' + (0, uri_parser_1.uriToString)(target)); + return noProxyResult; + } + } + const extraOptions = { + 'grpc.http_connect_target': (0, uri_parser_1.uriToString)(target), + }; + if (proxyInfo.creds) { + extraOptions['grpc.http_connect_creds'] = proxyInfo.creds; + } + return { + target: { + scheme: 'dns', + path: proxyInfo.address, + }, + extraOptions: extraOptions, + }; +} +exports.mapProxyName = mapProxyName; +function getProxiedConnection(address, channelOptions, connectionOptions) { + var _a; + if (!('grpc.http_connect_target' in channelOptions)) { + return Promise.resolve({}); + } + const realTarget = channelOptions['grpc.http_connect_target']; + const parsedTarget = (0, uri_parser_1.parseUri)(realTarget); + if (parsedTarget === null) { + return Promise.resolve({}); + } + const splitHostPost = (0, uri_parser_1.splitHostPort)(parsedTarget.path); + if (splitHostPost === null) { + return Promise.resolve({}); + } + const hostPort = `${splitHostPost.host}:${(_a = splitHostPost.port) !== null && _a !== void 0 ? _a : resolver_dns_1.DEFAULT_PORT}`; + const options = { + method: 'CONNECT', + path: hostPort, + }; + const headers = { + Host: hostPort, + }; + // Connect to the subchannel address as a proxy + if ((0, subchannel_address_1.isTcpSubchannelAddress)(address)) { + options.host = address.host; + options.port = address.port; + } + else { + options.socketPath = address.path; + } + if ('grpc.http_connect_creds' in channelOptions) { + headers['Proxy-Authorization'] = + 'Basic ' + + Buffer.from(channelOptions['grpc.http_connect_creds']).toString('base64'); + } + options.headers = headers; + const proxyAddressString = (0, subchannel_address_1.subchannelAddressToString)(address); + trace('Using proxy ' + proxyAddressString + ' to connect to ' + options.path); + return new Promise((resolve, reject) => { + const request = http.request(options); + request.once('connect', (res, socket, head) => { + var _a; + request.removeAllListeners(); + socket.removeAllListeners(); + if (res.statusCode === 200) { + trace('Successfully connected to ' + + options.path + + ' through proxy ' + + proxyAddressString); + if ('secureContext' in connectionOptions) { + /* The proxy is connecting to a TLS server, so upgrade this socket + * connection to a TLS connection. + * This is a workaround for https://github.com/nodejs/node/issues/32922 + * See https://github.com/grpc/grpc-node/pull/1369 for more info. */ + const targetPath = (0, resolver_1.getDefaultAuthority)(parsedTarget); + const hostPort = (0, uri_parser_1.splitHostPort)(targetPath); + const remoteHost = (_a = hostPort === null || hostPort === void 0 ? void 0 : hostPort.host) !== null && _a !== void 0 ? _a : targetPath; + const cts = tls.connect(Object.assign({ host: remoteHost, servername: remoteHost, socket: socket }, connectionOptions), () => { + trace('Successfully established a TLS connection to ' + + options.path + + ' through proxy ' + + proxyAddressString); + resolve({ socket: cts, realTarget: parsedTarget }); + }); + cts.on('error', (error) => { + trace('Failed to establish a TLS connection to ' + + options.path + + ' through proxy ' + + proxyAddressString + + ' with error ' + + error.message); + reject(); + }); + } + else { + trace('Successfully established a plaintext connection to ' + + options.path + + ' through proxy ' + + proxyAddressString); + resolve({ + socket, + realTarget: parsedTarget, + }); + } + } + else { + (0, logging_1.log)(constants_1.LogVerbosity.ERROR, 'Failed to connect to ' + + options.path + + ' through proxy ' + + proxyAddressString + + ' with status ' + + res.statusCode); + reject(); + } + }); + request.once('error', err => { + request.removeAllListeners(); + (0, logging_1.log)(constants_1.LogVerbosity.ERROR, 'Failed to connect to proxy ' + + proxyAddressString + + ' with error ' + + err.message); + reject(); + }); + request.end(); + }); +} +exports.getProxiedConnection = getProxiedConnection; +//# sourceMappingURL=http_proxy.js.map + +/***/ }), + +/***/ 7025: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.experimental = exports.ServerInterceptingCall = exports.ResponderBuilder = exports.ServerListenerBuilder = exports.addAdminServicesToServer = exports.getChannelzHandlers = exports.getChannelzServiceDefinition = exports.InterceptorConfigurationError = exports.InterceptingCall = exports.RequesterBuilder = exports.ListenerBuilder = 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.compressionAlgorithms = exports.propagate = exports.connectivityState = exports.status = exports.logVerbosity = exports.Metadata = exports.credentials = void 0; +const call_credentials_1 = __nccwpck_require__(21426); +Object.defineProperty(exports, "CallCredentials", ({ enumerable: true, get: function () { return call_credentials_1.CallCredentials; } })); +const channel_1 = __nccwpck_require__(13860); +Object.defineProperty(exports, "Channel", ({ enumerable: true, get: function () { return channel_1.ChannelImplementation; } })); +const compression_algorithms_1 = __nccwpck_require__(54789); +Object.defineProperty(exports, "compressionAlgorithms", ({ enumerable: true, get: function () { return compression_algorithms_1.CompressionAlgorithms; } })); +const connectivity_state_1 = __nccwpck_require__(80878); +Object.defineProperty(exports, "connectivityState", ({ enumerable: true, get: function () { return connectivity_state_1.ConnectivityState; } })); +const channel_credentials_1 = __nccwpck_require__(44030); +Object.defineProperty(exports, "ChannelCredentials", ({ enumerable: true, get: function () { return channel_credentials_1.ChannelCredentials; } })); +const client_1 = __nccwpck_require__(87172); +Object.defineProperty(exports, "Client", ({ enumerable: true, get: function () { return client_1.Client; } })); +const constants_1 = __nccwpck_require__(90634); +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); +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); +Object.defineProperty(exports, "Metadata", ({ enumerable: true, get: function () { return metadata_1.Metadata; } })); +const server_1 = __nccwpck_require__(33389); +Object.defineProperty(exports, "Server", ({ enumerable: true, get: function () { return server_1.Server; } })); +const server_credentials_1 = __nccwpck_require__(63828); +Object.defineProperty(exports, "ServerCredentials", ({ enumerable: true, get: function () { return server_credentials_1.ServerCredentials; } })); +const status_builder_1 = __nccwpck_require__(73155); +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 +exports.credentials = { + /** + * Combine a ChannelCredentials with any number of CallCredentials into a + * single ChannelCredentials object. + * @param channelCredentials The ChannelCredentials object. + * @param callCredentials Any number of CallCredentials objects. + * @return The resulting ChannelCredentials object. + */ + combineChannelCredentials: (channelCredentials, ...callCredentials) => { + return callCredentials.reduce((acc, other) => acc.compose(other), channelCredentials); + }, + /** + * Combine any number of CallCredentials into a single CallCredentials + * object. + * @param first The first CallCredentials object. + * @param additional Any number of additional CallCredentials objects. + * @return The resulting CallCredentials object. + */ + combineCallCredentials: (first, ...additional) => { + return additional.reduce((acc, other) => acc.compose(other), first); + }, + // from channel-credentials.ts + createInsecure: channel_credentials_1.ChannelCredentials.createInsecure, + createSsl: channel_credentials_1.ChannelCredentials.createSsl, + createFromSecureContext: channel_credentials_1.ChannelCredentials.createFromSecureContext, + // from call-credentials.ts + createFromMetadataGenerator: call_credentials_1.CallCredentials.createFromMetadataGenerator, + createFromGoogleCredential: call_credentials_1.CallCredentials.createFromGoogleCredential, + createEmpty: call_credentials_1.CallCredentials.createEmpty, +}; +/** + * Close a Client object. + * @param client The client to close. + */ +const closeClient = (client) => client.close(); +exports.closeClient = closeClient; +const waitForClientReady = (client, deadline, callback) => client.waitForReady(deadline, callback); +exports.waitForClientReady = waitForClientReady; +/* eslint-enable @typescript-eslint/no-explicit-any */ +/**** Unimplemented function stubs ****/ +/* eslint-disable @typescript-eslint/no-explicit-any */ +const loadObject = (value, options) => { + throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'); +}; +exports.loadObject = loadObject; +const load = (filename, format, options) => { + throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'); +}; +exports.load = load; +const setLogger = (logger) => { + logging.setLogger(logger); +}; +exports.setLogger = setLogger; +const setLogVerbosity = (verbosity) => { + logging.setLoggerVerbosity(verbosity); +}; +exports.setLogVerbosity = setLogVerbosity; +const getClientChannel = (client) => { + return client_1.Client.prototype.getChannel.call(client); +}; +exports.getClientChannel = getClientChannel; +var client_interceptors_1 = __nccwpck_require__(82127); +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; } })); +var channelz_1 = __nccwpck_require__(79975); +Object.defineProperty(exports, "getChannelzServiceDefinition", ({ enumerable: true, get: function () { return channelz_1.getChannelzServiceDefinition; } })); +Object.defineProperty(exports, "getChannelzHandlers", ({ enumerable: true, get: function () { return channelz_1.getChannelzHandlers; } })); +var admin_1 = __nccwpck_require__(8258); +Object.defineProperty(exports, "addAdminServicesToServer", ({ enumerable: true, get: function () { return admin_1.addAdminServicesToServer; } })); +var server_interceptors_1 = __nccwpck_require__(20998); +Object.defineProperty(exports, "ServerListenerBuilder", ({ enumerable: true, get: function () { return server_interceptors_1.ServerListenerBuilder; } })); +Object.defineProperty(exports, "ResponderBuilder", ({ enumerable: true, get: function () { return server_interceptors_1.ResponderBuilder; } })); +Object.defineProperty(exports, "ServerInterceptingCall", ({ enumerable: true, get: function () { return server_interceptors_1.ServerInterceptingCall; } })); +const experimental = __nccwpck_require__(37626); +exports.experimental = experimental; +const resolver_dns = __nccwpck_require__(54886); +const resolver_uds = __nccwpck_require__(5252); +const resolver_ip = __nccwpck_require__(97902); +const load_balancer_pick_first = __nccwpck_require__(38977); +const load_balancer_round_robin = __nccwpck_require__(92787); +const load_balancer_outlier_detection = __nccwpck_require__(76828); +const channelz = __nccwpck_require__(79975); +(() => { + resolver_dns.setup(); + resolver_uds.setup(); + resolver_ip.setup(); + load_balancer_pick_first.setup(); + load_balancer_round_robin.setup(); + load_balancer_outlier_detection.setup(); + channelz.setup(); +})(); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 69672: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.InternalChannel = void 0; +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 compression_filter_1 = __nccwpck_require__(47616); +const resolver_1 = __nccwpck_require__(31594); +const logging_1 = __nccwpck_require__(35993); +const http_proxy_1 = __nccwpck_require__(24000); +const uri_parser_1 = __nccwpck_require__(65974); +const connectivity_state_1 = __nccwpck_require__(80878); +const channelz_1 = __nccwpck_require__(79975); +const load_balancing_call_1 = __nccwpck_require__(776); +const deadline_1 = __nccwpck_require__(511); +const resolving_call_1 = __nccwpck_require__(39909); +const call_number_1 = __nccwpck_require__(70380); +const control_plane_status_1 = __nccwpck_require__(39129); +const retrying_call_1 = __nccwpck_require__(48159); +const subchannel_interface_1 = __nccwpck_require__(12258); +/** + * See https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_args + */ +const MAX_TIMEOUT_TIME = 2147483647; +const MIN_IDLE_TIMEOUT_MS = 1000; +// 30 minutes +const DEFAULT_IDLE_TIMEOUT_MS = 30 * 60 * 1000; +const RETRY_THROTTLER_MAP = new Map(); +const DEFAULT_RETRY_BUFFER_SIZE_BYTES = 1 << 24; // 16 MB +const DEFAULT_PER_RPC_RETRY_BUFFER_SIZE_BYTES = 1 << 20; // 1 MB +class ChannelSubchannelWrapper extends subchannel_interface_1.BaseSubchannelWrapper { + constructor(childSubchannel, channel) { + super(childSubchannel); + this.channel = channel; + this.refCount = 0; + this.subchannelStateListener = (subchannel, previousState, newState, keepaliveTime) => { + channel.throttleKeepalive(keepaliveTime); + }; + childSubchannel.addConnectivityStateListener(this.subchannelStateListener); + } + ref() { + this.child.ref(); + this.refCount += 1; + } + unref() { + this.child.unref(); + this.refCount -= 1; + if (this.refCount <= 0) { + this.child.removeConnectivityStateListener(this.subchannelStateListener); + this.channel.removeWrappedSubchannel(this); + } + } +} +class InternalChannel { + constructor(target, credentials, options) { + var _a, _b, _c, _d, _e, _f, _g, _h; + this.credentials = credentials; + this.options = options; + this.connectivityState = connectivity_state_1.ConnectivityState.IDLE; + this.currentPicker = new picker_1.UnavailablePicker(); + /** + * Calls queued up to get a call config. Should only be populated before the + * first time the resolver returns a result, which includes the ConfigSelector. + */ + this.configSelectionQueue = []; + this.pickQueue = []; + this.connectivityStateWatchers = []; + this.configSelector = null; + /** + * This is the error from the name resolver if it failed most recently. It + * is only used to end calls that start while there is no config selector + * and the name resolver is in backoff, so it should be nulled if + * configSelector becomes set or the channel state becomes anything other + * than TRANSIENT_FAILURE. + */ + this.currentResolutionError = null; + this.wrappedSubchannels = new Set(); + this.callCount = 0; + this.idleTimer = null; + // Channelz info + this.channelzEnabled = true; + this.callTracker = new channelz_1.ChannelzCallTracker(); + this.childrenTracker = new channelz_1.ChannelzChildrenTracker(); + /** + * Randomly generated ID to be passed to the config selector, for use by + * ring_hash in xDS. An integer distributed approximately uniformly between + * 0 and MAX_SAFE_INTEGER. + */ + this.randomChannelId = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); + if (typeof target !== 'string') { + throw new TypeError('Channel target must be a string'); + } + if (!(credentials instanceof channel_credentials_1.ChannelCredentials)) { + throw new TypeError('Channel credentials must be a ChannelCredentials object'); + } + if (options) { + if (typeof options !== 'object') { + throw new TypeError('Channel options must be an object'); + } + } + this.originalTarget = target; + const originalTargetUri = (0, uri_parser_1.parseUri)(target); + if (originalTargetUri === null) { + throw new Error(`Could not parse target name "${target}"`); + } + /* This ensures that the target has a scheme that is registered with the + * resolver */ + const defaultSchemeMapResult = (0, resolver_1.mapUriDefaultScheme)(originalTargetUri); + if (defaultSchemeMapResult === null) { + throw new Error(`Could not find a default scheme for target name "${target}"`); + } + this.callRefTimer = setInterval(() => { }, MAX_TIMEOUT_TIME); + (_b = (_a = this.callRefTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + if (this.options['grpc.enable_channelz'] === 0) { + this.channelzEnabled = false; + } + this.channelzTrace = new channelz_1.ChannelzTrace(); + this.channelzRef = (0, channelz_1.registerChannelzChannel)(target, () => this.getChannelzInfo(), this.channelzEnabled); + if (this.channelzEnabled) { + this.channelzTrace.addTrace('CT_INFO', 'Channel created'); + } + if (this.options['grpc.default_authority']) { + this.defaultAuthority = this.options['grpc.default_authority']; + } + else { + this.defaultAuthority = (0, resolver_1.getDefaultAuthority)(defaultSchemeMapResult); + } + const proxyMapResult = (0, http_proxy_1.mapProxyName)(defaultSchemeMapResult, options); + this.target = proxyMapResult.target; + this.options = Object.assign({}, this.options, proxyMapResult.extraOptions); + /* The global boolean parameter to getSubchannelPool has the inverse meaning to what + * the grpc.use_local_subchannel_pool channel option means. */ + this.subchannelPool = (0, subchannel_pool_1.getSubchannelPool)(((_c = options['grpc.use_local_subchannel_pool']) !== null && _c !== void 0 ? _c : 0) === 0); + this.retryBufferTracker = new retrying_call_1.MessageBufferTracker((_d = options['grpc.retry_buffer_size']) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_BUFFER_SIZE_BYTES, (_e = options['grpc.per_rpc_retry_buffer_size']) !== null && _e !== void 0 ? _e : DEFAULT_PER_RPC_RETRY_BUFFER_SIZE_BYTES); + this.keepaliveTime = (_f = options['grpc.keepalive_time_ms']) !== null && _f !== void 0 ? _f : -1; + this.idleTimeoutMs = Math.max((_g = options['grpc.client_idle_timeout_ms']) !== null && _g !== void 0 ? _g : DEFAULT_IDLE_TIMEOUT_MS, MIN_IDLE_TIMEOUT_MS); + const channelControlHelper = { + createSubchannel: (subchannelAddress, subchannelArgs) => { + const subchannel = this.subchannelPool.getOrCreateSubchannel(this.target, subchannelAddress, Object.assign({}, this.options, subchannelArgs), this.credentials); + subchannel.throttleKeepalive(this.keepaliveTime); + if (this.channelzEnabled) { + this.channelzTrace.addTrace('CT_INFO', 'Created subchannel or used existing subchannel', subchannel.getChannelzRef()); + } + const wrappedSubchannel = new ChannelSubchannelWrapper(subchannel, this); + this.wrappedSubchannels.add(wrappedSubchannel); + return wrappedSubchannel; + }, + updateState: (connectivityState, picker) => { + this.currentPicker = picker; + const queueCopy = this.pickQueue.slice(); + this.pickQueue = []; + if (queueCopy.length > 0) { + this.callRefTimerUnref(); + } + for (const call of queueCopy) { + call.doPick(); + } + this.updateState(connectivityState); + }, + requestReresolution: () => { + // This should never be called. + throw new Error('Resolving load balancer should never call requestReresolution'); + }, + addChannelzChild: (child) => { + if (this.channelzEnabled) { + this.childrenTracker.refChild(child); + } + }, + removeChannelzChild: (child) => { + if (this.channelzEnabled) { + this.childrenTracker.unrefChild(child); + } + }, + }; + this.resolvingLoadBalancer = new resolving_load_balancer_1.ResolvingLoadBalancer(this.target, channelControlHelper, options, (serviceConfig, configSelector) => { + if (serviceConfig.retryThrottling) { + RETRY_THROTTLER_MAP.set(this.getTarget(), new retrying_call_1.RetryThrottler(serviceConfig.retryThrottling.maxTokens, serviceConfig.retryThrottling.tokenRatio, RETRY_THROTTLER_MAP.get(this.getTarget()))); + } + else { + RETRY_THROTTLER_MAP.delete(this.getTarget()); + } + if (this.channelzEnabled) { + this.channelzTrace.addTrace('CT_INFO', 'Address resolution succeeded'); + } + this.configSelector = configSelector; + this.currentResolutionError = null; + /* We process the queue asynchronously to ensure that the corresponding + * load balancer update has completed. */ + process.nextTick(() => { + const localQueue = this.configSelectionQueue; + this.configSelectionQueue = []; + if (localQueue.length > 0) { + this.callRefTimerUnref(); + } + for (const call of localQueue) { + call.getConfig(); + } + }); + }, status => { + if (this.channelzEnabled) { + this.channelzTrace.addTrace('CT_WARNING', 'Address resolution failed with code ' + + status.code + + ' and details "' + + status.details + + '"'); + } + if (this.configSelectionQueue.length > 0) { + this.trace('Name resolution failed with calls queued for config selection'); + } + if (this.configSelector === null) { + this.currentResolutionError = Object.assign(Object.assign({}, (0, control_plane_status_1.restrictControlPlaneStatusCode)(status.code, status.details)), { metadata: status.metadata }); + } + const localQueue = this.configSelectionQueue; + this.configSelectionQueue = []; + if (localQueue.length > 0) { + this.callRefTimerUnref(); + } + for (const call of localQueue) { + call.reportResolverError(status); + } + }); + this.filterStackFactory = new filter_stack_1.FilterStackFactory([ + new compression_filter_1.CompressionFilterFactory(this, this.options), + ]); + this.trace('Channel constructed with options ' + + JSON.stringify(options, undefined, 2)); + const error = new Error(); + (0, logging_1.trace)(constants_1.LogVerbosity.DEBUG, 'channel_stacktrace', '(' + + this.channelzRef.id + + ') ' + + 'Channel constructed \n' + + ((_h = error.stack) === null || _h === void 0 ? void 0 : _h.substring(error.stack.indexOf('\n') + 1))); + this.lastActivityTimestamp = new Date(); + } + getChannelzInfo() { + return { + target: this.originalTarget, + state: this.connectivityState, + trace: this.channelzTrace, + callTracker: this.callTracker, + children: this.childrenTracker.getChildLists(), + }; + } + trace(text, verbosityOverride) { + (0, logging_1.trace)(verbosityOverride !== null && verbosityOverride !== void 0 ? verbosityOverride : constants_1.LogVerbosity.DEBUG, 'channel', '(' + this.channelzRef.id + ') ' + (0, uri_parser_1.uriToString)(this.target) + ' ' + text); + } + callRefTimerRef() { + var _a, _b, _c, _d; + // If the hasRef function does not exist, always run the code + if (!((_b = (_a = this.callRefTimer).hasRef) === null || _b === void 0 ? void 0 : _b.call(_a))) { + this.trace('callRefTimer.ref | configSelectionQueue.length=' + + this.configSelectionQueue.length + + ' pickQueue.length=' + + this.pickQueue.length); + (_d = (_c = this.callRefTimer).ref) === null || _d === void 0 ? void 0 : _d.call(_c); + } + } + callRefTimerUnref() { + var _a, _b; + // If the hasRef function does not exist, always run the code + if (!this.callRefTimer.hasRef || this.callRefTimer.hasRef()) { + this.trace('callRefTimer.unref | configSelectionQueue.length=' + + this.configSelectionQueue.length + + ' pickQueue.length=' + + this.pickQueue.length); + (_b = (_a = this.callRefTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + } + removeConnectivityStateWatcher(watcherObject) { + const watcherIndex = this.connectivityStateWatchers.findIndex(value => value === watcherObject); + if (watcherIndex >= 0) { + this.connectivityStateWatchers.splice(watcherIndex, 1); + } + } + updateState(newState) { + (0, logging_1.trace)(constants_1.LogVerbosity.DEBUG, 'connectivity_state', '(' + + this.channelzRef.id + + ') ' + + (0, uri_parser_1.uriToString)(this.target) + + ' ' + + connectivity_state_1.ConnectivityState[this.connectivityState] + + ' -> ' + + connectivity_state_1.ConnectivityState[newState]); + if (this.channelzEnabled) { + this.channelzTrace.addTrace('CT_INFO', 'Connectivity state change to ' + connectivity_state_1.ConnectivityState[newState]); + } + this.connectivityState = newState; + const watchersCopy = this.connectivityStateWatchers.slice(); + for (const watcherObject of watchersCopy) { + if (newState !== watcherObject.currentState) { + if (watcherObject.timer) { + clearTimeout(watcherObject.timer); + } + this.removeConnectivityStateWatcher(watcherObject); + watcherObject.callback(); + } + } + if (newState !== connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { + this.currentResolutionError = null; + } + } + throttleKeepalive(newKeepaliveTime) { + if (newKeepaliveTime > this.keepaliveTime) { + this.keepaliveTime = newKeepaliveTime; + for (const wrappedSubchannel of this.wrappedSubchannels) { + wrappedSubchannel.throttleKeepalive(newKeepaliveTime); + } + } + } + removeWrappedSubchannel(wrappedSubchannel) { + this.wrappedSubchannels.delete(wrappedSubchannel); + } + doPick(metadata, extraPickInfo) { + return this.currentPicker.pick({ + metadata: metadata, + extraPickInfo: extraPickInfo, + }); + } + queueCallForPick(call) { + this.pickQueue.push(call); + this.callRefTimerRef(); + } + getConfig(method, metadata) { + this.resolvingLoadBalancer.exitIdle(); + if (this.configSelector) { + return { + type: 'SUCCESS', + config: this.configSelector(method, metadata, this.randomChannelId), + }; + } + else { + if (this.currentResolutionError) { + return { + type: 'ERROR', + error: this.currentResolutionError, + }; + } + else { + return { + type: 'NONE', + }; + } + } + } + queueCallForConfig(call) { + this.configSelectionQueue.push(call); + this.callRefTimerRef(); + } + enterIdle() { + this.resolvingLoadBalancer.destroy(); + this.updateState(connectivity_state_1.ConnectivityState.IDLE); + this.currentPicker = new picker_1.QueuePicker(this.resolvingLoadBalancer); + if (this.idleTimer) { + clearTimeout(this.idleTimer); + this.idleTimer = null; + } + } + startIdleTimeout(timeoutMs) { + var _a, _b; + this.idleTimer = setTimeout(() => { + if (this.callCount > 0) { + /* If there is currently a call, the channel will not go idle for a + * period of at least idleTimeoutMs, so check again after that time. + */ + this.startIdleTimeout(this.idleTimeoutMs); + return; + } + const now = new Date(); + const timeSinceLastActivity = now.valueOf() - this.lastActivityTimestamp.valueOf(); + if (timeSinceLastActivity >= this.idleTimeoutMs) { + this.trace('Idle timer triggered after ' + + this.idleTimeoutMs + + 'ms of inactivity'); + this.enterIdle(); + } + else { + /* Whenever the timer fires with the latest activity being too recent, + * set the timer again for the time when the time since the last + * activity is equal to the timeout. This should result in the timer + * firing no more than once every idleTimeoutMs/2 on average. */ + this.startIdleTimeout(this.idleTimeoutMs - timeSinceLastActivity); + } + }, timeoutMs); + (_b = (_a = this.idleTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + maybeStartIdleTimer() { + if (this.connectivityState !== connectivity_state_1.ConnectivityState.SHUTDOWN && + !this.idleTimer) { + this.startIdleTimeout(this.idleTimeoutMs); + } + } + onCallStart() { + if (this.channelzEnabled) { + this.callTracker.addCallStarted(); + } + this.callCount += 1; + } + onCallEnd(status) { + if (this.channelzEnabled) { + if (status.code === constants_1.Status.OK) { + this.callTracker.addCallSucceeded(); + } + else { + this.callTracker.addCallFailed(); + } + } + this.callCount -= 1; + this.lastActivityTimestamp = new Date(); + this.maybeStartIdleTimer(); + } + createLoadBalancingCall(callConfig, method, host, credentials, deadline) { + const callNumber = (0, call_number_1.getNextCallNumber)(); + this.trace('createLoadBalancingCall [' + callNumber + '] method="' + method + '"'); + return new load_balancing_call_1.LoadBalancingCall(this, callConfig, method, host, credentials, deadline, callNumber); + } + createRetryingCall(callConfig, method, host, credentials, deadline) { + const callNumber = (0, call_number_1.getNextCallNumber)(); + this.trace('createRetryingCall [' + callNumber + '] method="' + method + '"'); + return new retrying_call_1.RetryingCall(this, callConfig, method, host, credentials, deadline, callNumber, this.retryBufferTracker, RETRY_THROTTLER_MAP.get(this.getTarget())); + } + createInnerCall(callConfig, method, host, credentials, deadline) { + // Create a RetryingCall if retries are enabled + if (this.options['grpc.enable_retries'] === 0) { + return this.createLoadBalancingCall(callConfig, method, host, credentials, deadline); + } + else { + return this.createRetryingCall(callConfig, method, host, credentials, deadline); + } + } + createResolvingCall(method, deadline, host, parentCall, propagateFlags) { + const callNumber = (0, call_number_1.getNextCallNumber)(); + this.trace('createResolvingCall [' + + callNumber + + '] method="' + + method + + '", deadline=' + + (0, deadline_1.deadlineToString)(deadline)); + const finalOptions = { + deadline: deadline, + flags: propagateFlags !== null && propagateFlags !== void 0 ? propagateFlags : constants_1.Propagate.DEFAULTS, + host: host !== null && host !== void 0 ? host : this.defaultAuthority, + parentCall: parentCall, + }; + const call = new resolving_call_1.ResolvingCall(this, method, finalOptions, this.filterStackFactory.clone(), this.credentials._getCallCredentials(), callNumber); + this.onCallStart(); + call.addStatusWatcher(status => { + this.onCallEnd(status); + }); + return call; + } + close() { + this.resolvingLoadBalancer.destroy(); + this.updateState(connectivity_state_1.ConnectivityState.SHUTDOWN); + clearInterval(this.callRefTimer); + if (this.idleTimer) { + clearTimeout(this.idleTimer); + } + if (this.channelzEnabled) { + (0, channelz_1.unregisterChannelzRef)(this.channelzRef); + } + this.subchannelPool.unrefUnusedSubchannels(); + } + getTarget() { + return (0, uri_parser_1.uriToString)(this.target); + } + getConnectivityState(tryToConnect) { + const connectivityState = this.connectivityState; + if (tryToConnect) { + this.resolvingLoadBalancer.exitIdle(); + this.lastActivityTimestamp = new Date(); + this.maybeStartIdleTimer(); + } + return connectivityState; + } + watchConnectivityState(currentState, deadline, callback) { + if (this.connectivityState === connectivity_state_1.ConnectivityState.SHUTDOWN) { + throw new Error('Channel has been shut down'); + } + let timer = null; + if (deadline !== Infinity) { + const deadlineDate = deadline instanceof Date ? deadline : new Date(deadline); + const now = new Date(); + if (deadline === -Infinity || deadlineDate <= now) { + process.nextTick(callback, new Error('Deadline passed without connectivity state change')); + return; + } + timer = setTimeout(() => { + this.removeConnectivityStateWatcher(watcherObject); + callback(new Error('Deadline passed without connectivity state change')); + }, deadlineDate.getTime() - now.getTime()); + } + const watcherObject = { + currentState, + callback, + timer, + }; + this.connectivityStateWatchers.push(watcherObject); + } + /** + * Get the channelz reference object for this channel. The returned value is + * garbage if channelz is disabled for this channel. + * @returns + */ + getChannelzRef() { + return this.channelzRef; + } + createCall(method, deadline, host, parentCall, propagateFlags) { + if (typeof method !== 'string') { + throw new TypeError('Channel#createCall: method must be a string'); + } + if (!(typeof deadline === 'number' || deadline instanceof Date)) { + throw new TypeError('Channel#createCall: deadline must be a number or Date'); + } + if (this.connectivityState === connectivity_state_1.ConnectivityState.SHUTDOWN) { + throw new Error('Channel has been shut down'); + } + return this.createResolvingCall(method, deadline, host, parentCall, propagateFlags); + } +} +exports.InternalChannel = InternalChannel; +//# sourceMappingURL=internal-channel.js.map + +/***/ }), + +/***/ 17559: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2020 gRPC authors. + * + * 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 })); +exports.ChildLoadBalancerHandler = void 0; +const load_balancer_1 = __nccwpck_require__(52680); +const connectivity_state_1 = __nccwpck_require__(80878); +const TYPE_NAME = 'child_load_balancer_helper'; +class ChildLoadBalancerHandler { + constructor(channelControlHelper, options) { + this.channelControlHelper = channelControlHelper; + this.options = options; + this.currentChild = null; + this.pendingChild = null; + this.latestConfig = null; + this.ChildPolicyHelper = class { + constructor(parent) { + this.parent = parent; + this.child = null; + } + createSubchannel(subchannelAddress, subchannelArgs) { + return this.parent.channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs); + } + updateState(connectivityState, picker) { + var _a; + if (this.calledByPendingChild()) { + if (connectivityState === connectivity_state_1.ConnectivityState.CONNECTING) { + return; + } + (_a = this.parent.currentChild) === null || _a === void 0 ? void 0 : _a.destroy(); + this.parent.currentChild = this.parent.pendingChild; + this.parent.pendingChild = null; + } + else if (!this.calledByCurrentChild()) { + return; + } + this.parent.channelControlHelper.updateState(connectivityState, picker); + } + requestReresolution() { + var _a; + const latestChild = (_a = this.parent.pendingChild) !== null && _a !== void 0 ? _a : this.parent.currentChild; + if (this.child === latestChild) { + this.parent.channelControlHelper.requestReresolution(); + } + } + setChild(newChild) { + this.child = newChild; + } + addChannelzChild(child) { + this.parent.channelControlHelper.addChannelzChild(child); + } + removeChannelzChild(child) { + this.parent.channelControlHelper.removeChannelzChild(child); + } + calledByPendingChild() { + return this.child === this.parent.pendingChild; + } + calledByCurrentChild() { + return this.child === this.parent.currentChild; + } + }; + } + configUpdateRequiresNewPolicyInstance(oldConfig, newConfig) { + return oldConfig.getLoadBalancerName() !== newConfig.getLoadBalancerName(); + } + /** + * Prerequisites: lbConfig !== null and lbConfig.name is registered + * @param endpointList + * @param lbConfig + * @param attributes + */ + updateAddressList(endpointList, lbConfig, attributes) { + let childToUpdate; + if (this.currentChild === null || + this.latestConfig === null || + this.configUpdateRequiresNewPolicyInstance(this.latestConfig, lbConfig)) { + const newHelper = new this.ChildPolicyHelper(this); + const newChild = (0, load_balancer_1.createLoadBalancer)(lbConfig, newHelper, this.options); + newHelper.setChild(newChild); + if (this.currentChild === null) { + this.currentChild = newChild; + childToUpdate = this.currentChild; + } + else { + if (this.pendingChild) { + this.pendingChild.destroy(); + } + this.pendingChild = newChild; + childToUpdate = this.pendingChild; + } + } + else { + if (this.pendingChild === null) { + childToUpdate = this.currentChild; + } + else { + childToUpdate = this.pendingChild; + } + } + this.latestConfig = lbConfig; + childToUpdate.updateAddressList(endpointList, lbConfig, attributes); + } + exitIdle() { + if (this.currentChild) { + this.currentChild.exitIdle(); + if (this.pendingChild) { + this.pendingChild.exitIdle(); + } + } + } + resetBackoff() { + if (this.currentChild) { + this.currentChild.resetBackoff(); + if (this.pendingChild) { + this.pendingChild.resetBackoff(); + } + } + } + destroy() { + /* Note: state updates are only propagated from the child balancer if that + * object is equal to this.currentChild or this.pendingChild. Since this + * function sets both of those to null, no further state updates will + * occur after this function returns. */ + if (this.currentChild) { + this.currentChild.destroy(); + this.currentChild = null; + } + if (this.pendingChild) { + this.pendingChild.destroy(); + this.pendingChild = null; + } + } + getTypeName() { + return TYPE_NAME; + } +} +exports.ChildLoadBalancerHandler = ChildLoadBalancerHandler; +//# sourceMappingURL=load-balancer-child-handler.js.map + +/***/ }), + +/***/ 76828: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.setup = exports.OutlierDetectionLoadBalancer = exports.OutlierDetectionLoadBalancingConfig = void 0; +const connectivity_state_1 = __nccwpck_require__(80878); +const constants_1 = __nccwpck_require__(90634); +const duration_1 = __nccwpck_require__(62668); +const experimental_1 = __nccwpck_require__(37626); +const load_balancer_1 = __nccwpck_require__(52680); +const load_balancer_child_handler_1 = __nccwpck_require__(17559); +const picker_1 = __nccwpck_require__(81611); +const subchannel_address_1 = __nccwpck_require__(99905); +const subchannel_interface_1 = __nccwpck_require__(12258); +const logging = __nccwpck_require__(35993); +const TRACER_NAME = 'outlier_detection'; +function trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); +} +const TYPE_NAME = 'outlier_detection'; +const OUTLIER_DETECTION_ENABLED = ((_a = process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION) !== null && _a !== void 0 ? _a : 'true') === 'true'; +const defaultSuccessRateEjectionConfig = { + stdev_factor: 1900, + enforcement_percentage: 100, + minimum_hosts: 5, + request_volume: 100, +}; +const defaultFailurePercentageEjectionConfig = { + threshold: 85, + enforcement_percentage: 100, + minimum_hosts: 5, + request_volume: 50, +}; +function validateFieldType(obj, fieldName, expectedType, objectName) { + if (fieldName in obj && + obj[fieldName] !== undefined && + typeof obj[fieldName] !== expectedType) { + const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; + throw new Error(`outlier detection config ${fullFieldName} parse error: expected ${expectedType}, got ${typeof obj[fieldName]}`); + } +} +function validatePositiveDuration(obj, fieldName, objectName) { + const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; + if (fieldName in obj && obj[fieldName] !== undefined) { + if (!(0, duration_1.isDuration)(obj[fieldName])) { + throw new Error(`outlier detection config ${fullFieldName} parse error: expected Duration, got ${typeof obj[fieldName]}`); + } + if (!(obj[fieldName].seconds >= 0 && + obj[fieldName].seconds <= 315576000000 && + obj[fieldName].nanos >= 0 && + obj[fieldName].nanos <= 999999999)) { + throw new Error(`outlier detection config ${fullFieldName} parse error: values out of range for non-negative Duaration`); + } + } +} +function validatePercentage(obj, fieldName, objectName) { + const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; + validateFieldType(obj, fieldName, 'number', objectName); + if (fieldName in obj && + obj[fieldName] !== undefined && + !(obj[fieldName] >= 0 && obj[fieldName] <= 100)) { + throw new Error(`outlier detection config ${fullFieldName} parse error: value out of range for percentage (0-100)`); + } +} +class OutlierDetectionLoadBalancingConfig { + constructor(intervalMs, baseEjectionTimeMs, maxEjectionTimeMs, maxEjectionPercent, successRateEjection, failurePercentageEjection, childPolicy) { + this.childPolicy = childPolicy; + if (childPolicy.getLoadBalancerName() === 'pick_first') { + throw new Error('outlier_detection LB policy cannot have a pick_first child policy'); + } + this.intervalMs = intervalMs !== null && intervalMs !== void 0 ? intervalMs : 10000; + this.baseEjectionTimeMs = baseEjectionTimeMs !== null && baseEjectionTimeMs !== void 0 ? baseEjectionTimeMs : 30000; + this.maxEjectionTimeMs = maxEjectionTimeMs !== null && maxEjectionTimeMs !== void 0 ? maxEjectionTimeMs : 300000; + this.maxEjectionPercent = maxEjectionPercent !== null && maxEjectionPercent !== void 0 ? maxEjectionPercent : 10; + this.successRateEjection = successRateEjection + ? Object.assign(Object.assign({}, defaultSuccessRateEjectionConfig), successRateEjection) : null; + this.failurePercentageEjection = failurePercentageEjection + ? Object.assign(Object.assign({}, defaultFailurePercentageEjectionConfig), failurePercentageEjection) : null; + } + getLoadBalancerName() { + return TYPE_NAME; + } + toJsonObject() { + var _a, _b; + return { + outlier_detection: { + interval: (0, duration_1.msToDuration)(this.intervalMs), + base_ejection_time: (0, duration_1.msToDuration)(this.baseEjectionTimeMs), + max_ejection_time: (0, duration_1.msToDuration)(this.maxEjectionTimeMs), + max_ejection_percent: this.maxEjectionPercent, + success_rate_ejection: (_a = this.successRateEjection) !== null && _a !== void 0 ? _a : undefined, + failure_percentage_ejection: (_b = this.failurePercentageEjection) !== null && _b !== void 0 ? _b : undefined, + child_policy: [this.childPolicy.toJsonObject()], + }, + }; + } + getIntervalMs() { + return this.intervalMs; + } + getBaseEjectionTimeMs() { + return this.baseEjectionTimeMs; + } + getMaxEjectionTimeMs() { + return this.maxEjectionTimeMs; + } + getMaxEjectionPercent() { + return this.maxEjectionPercent; + } + getSuccessRateEjectionConfig() { + return this.successRateEjection; + } + getFailurePercentageEjectionConfig() { + return this.failurePercentageEjection; + } + getChildPolicy() { + return this.childPolicy; + } + static createFromJson(obj) { + var _a; + validatePositiveDuration(obj, 'interval'); + validatePositiveDuration(obj, 'base_ejection_time'); + validatePositiveDuration(obj, 'max_ejection_time'); + validatePercentage(obj, 'max_ejection_percent'); + if ('success_rate_ejection' in obj && + obj.success_rate_ejection !== undefined) { + if (typeof obj.success_rate_ejection !== 'object') { + throw new Error('outlier detection config success_rate_ejection must be an object'); + } + validateFieldType(obj.success_rate_ejection, 'stdev_factor', 'number', 'success_rate_ejection'); + validatePercentage(obj.success_rate_ejection, 'enforcement_percentage', 'success_rate_ejection'); + validateFieldType(obj.success_rate_ejection, 'minimum_hosts', 'number', 'success_rate_ejection'); + validateFieldType(obj.success_rate_ejection, 'request_volume', 'number', 'success_rate_ejection'); + } + if ('failure_percentage_ejection' in obj && + obj.failure_percentage_ejection !== undefined) { + if (typeof obj.failure_percentage_ejection !== 'object') { + throw new Error('outlier detection config failure_percentage_ejection must be an object'); + } + validatePercentage(obj.failure_percentage_ejection, 'threshold', 'failure_percentage_ejection'); + validatePercentage(obj.failure_percentage_ejection, 'enforcement_percentage', 'failure_percentage_ejection'); + validateFieldType(obj.failure_percentage_ejection, 'minimum_hosts', 'number', 'failure_percentage_ejection'); + validateFieldType(obj.failure_percentage_ejection, 'request_volume', 'number', 'failure_percentage_ejection'); + } + if (!('child_policy' in obj) || !Array.isArray(obj.child_policy)) { + throw new Error('outlier detection config child_policy must be an array'); + } + const childPolicy = (0, load_balancer_1.selectLbConfigFromList)(obj.child_policy); + if (!childPolicy) { + throw new Error('outlier detection config child_policy: no valid recognized policy found'); + } + return new OutlierDetectionLoadBalancingConfig(obj.interval ? (0, duration_1.durationToMs)(obj.interval) : null, obj.base_ejection_time ? (0, duration_1.durationToMs)(obj.base_ejection_time) : null, obj.max_ejection_time ? (0, duration_1.durationToMs)(obj.max_ejection_time) : null, (_a = obj.max_ejection_percent) !== null && _a !== void 0 ? _a : null, obj.success_rate_ejection, obj.failure_percentage_ejection, childPolicy); + } +} +exports.OutlierDetectionLoadBalancingConfig = OutlierDetectionLoadBalancingConfig; +class OutlierDetectionSubchannelWrapper extends subchannel_interface_1.BaseSubchannelWrapper { + constructor(childSubchannel, mapEntry) { + super(childSubchannel); + this.mapEntry = mapEntry; + this.refCount = 0; + } + ref() { + this.child.ref(); + this.refCount += 1; + } + unref() { + this.child.unref(); + this.refCount -= 1; + if (this.refCount <= 0) { + if (this.mapEntry) { + const index = this.mapEntry.subchannelWrappers.indexOf(this); + if (index >= 0) { + this.mapEntry.subchannelWrappers.splice(index, 1); + } + } + } + } + eject() { + this.setHealthy(false); + } + uneject() { + this.setHealthy(true); + } + getMapEntry() { + return this.mapEntry; + } + getWrappedSubchannel() { + return this.child; + } +} +function createEmptyBucket() { + return { + success: 0, + failure: 0, + }; +} +class CallCounter { + constructor() { + this.activeBucket = createEmptyBucket(); + this.inactiveBucket = createEmptyBucket(); + } + addSuccess() { + this.activeBucket.success += 1; + } + addFailure() { + this.activeBucket.failure += 1; + } + switchBuckets() { + this.inactiveBucket = this.activeBucket; + this.activeBucket = createEmptyBucket(); + } + getLastSuccesses() { + return this.inactiveBucket.success; + } + getLastFailures() { + return this.inactiveBucket.failure; + } +} +class OutlierDetectionPicker { + constructor(wrappedPicker, countCalls) { + this.wrappedPicker = wrappedPicker; + this.countCalls = countCalls; + } + pick(pickArgs) { + const wrappedPick = this.wrappedPicker.pick(pickArgs); + if (wrappedPick.pickResultType === picker_1.PickResultType.COMPLETE) { + const subchannelWrapper = wrappedPick.subchannel; + const mapEntry = subchannelWrapper.getMapEntry(); + if (mapEntry) { + let onCallEnded = wrappedPick.onCallEnded; + if (this.countCalls) { + onCallEnded = statusCode => { + var _a; + if (statusCode === constants_1.Status.OK) { + mapEntry.counter.addSuccess(); + } + else { + mapEntry.counter.addFailure(); + } + (_a = wrappedPick.onCallEnded) === null || _a === void 0 ? void 0 : _a.call(wrappedPick, statusCode); + }; + } + return Object.assign(Object.assign({}, wrappedPick), { subchannel: subchannelWrapper.getWrappedSubchannel(), onCallEnded: onCallEnded }); + } + else { + return Object.assign(Object.assign({}, wrappedPick), { subchannel: subchannelWrapper.getWrappedSubchannel() }); + } + } + else { + return wrappedPick; + } + } +} +class OutlierDetectionLoadBalancer { + constructor(channelControlHelper, options) { + this.entryMap = new subchannel_address_1.EndpointMap(); + this.latestConfig = null; + this.timerStartTime = null; + this.childBalancer = new load_balancer_child_handler_1.ChildLoadBalancerHandler((0, experimental_1.createChildChannelControlHelper)(channelControlHelper, { + createSubchannel: (subchannelAddress, subchannelArgs) => { + const originalSubchannel = channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs); + const mapEntry = this.entryMap.getForSubchannelAddress(subchannelAddress); + const subchannelWrapper = new OutlierDetectionSubchannelWrapper(originalSubchannel, mapEntry); + if ((mapEntry === null || mapEntry === void 0 ? void 0 : mapEntry.currentEjectionTimestamp) !== null) { + // If the address is ejected, propagate that to the new subchannel wrapper + subchannelWrapper.eject(); + } + mapEntry === null || mapEntry === void 0 ? void 0 : mapEntry.subchannelWrappers.push(subchannelWrapper); + return subchannelWrapper; + }, + updateState: (connectivityState, picker) => { + if (connectivityState === connectivity_state_1.ConnectivityState.READY) { + channelControlHelper.updateState(connectivityState, new OutlierDetectionPicker(picker, this.isCountingEnabled())); + } + else { + channelControlHelper.updateState(connectivityState, picker); + } + }, + }), options); + this.ejectionTimer = setInterval(() => { }, 0); + clearInterval(this.ejectionTimer); + } + isCountingEnabled() { + return (this.latestConfig !== null && + (this.latestConfig.getSuccessRateEjectionConfig() !== null || + this.latestConfig.getFailurePercentageEjectionConfig() !== null)); + } + getCurrentEjectionPercent() { + let ejectionCount = 0; + for (const mapEntry of this.entryMap.values()) { + if (mapEntry.currentEjectionTimestamp !== null) { + ejectionCount += 1; + } + } + return (ejectionCount * 100) / this.entryMap.size; + } + runSuccessRateCheck(ejectionTimestamp) { + if (!this.latestConfig) { + return; + } + const successRateConfig = this.latestConfig.getSuccessRateEjectionConfig(); + if (!successRateConfig) { + return; + } + trace('Running success rate check'); + // Step 1 + const targetRequestVolume = successRateConfig.request_volume; + let addresesWithTargetVolume = 0; + const successRates = []; + for (const [endpoint, mapEntry] of this.entryMap.entries()) { + const successes = mapEntry.counter.getLastSuccesses(); + const failures = mapEntry.counter.getLastFailures(); + trace('Stats for ' + + (0, subchannel_address_1.endpointToString)(endpoint) + + ': successes=' + + successes + + ' failures=' + + failures + + ' targetRequestVolume=' + + targetRequestVolume); + if (successes + failures >= targetRequestVolume) { + addresesWithTargetVolume += 1; + successRates.push(successes / (successes + failures)); + } + } + trace('Found ' + + addresesWithTargetVolume + + ' success rate candidates; currentEjectionPercent=' + + this.getCurrentEjectionPercent() + + ' successRates=[' + + successRates + + ']'); + if (addresesWithTargetVolume < successRateConfig.minimum_hosts) { + return; + } + // Step 2 + const successRateMean = successRates.reduce((a, b) => a + b) / successRates.length; + let successRateDeviationSum = 0; + for (const rate of successRates) { + const deviation = rate - successRateMean; + successRateDeviationSum += deviation * deviation; + } + const successRateVariance = successRateDeviationSum / successRates.length; + const successRateStdev = Math.sqrt(successRateVariance); + const ejectionThreshold = successRateMean - + successRateStdev * (successRateConfig.stdev_factor / 1000); + trace('stdev=' + successRateStdev + ' ejectionThreshold=' + ejectionThreshold); + // Step 3 + for (const [address, mapEntry] of this.entryMap.entries()) { + // Step 3.i + if (this.getCurrentEjectionPercent() >= + this.latestConfig.getMaxEjectionPercent()) { + break; + } + // Step 3.ii + const successes = mapEntry.counter.getLastSuccesses(); + const failures = mapEntry.counter.getLastFailures(); + if (successes + failures < targetRequestVolume) { + continue; + } + // Step 3.iii + const successRate = successes / (successes + failures); + trace('Checking candidate ' + address + ' successRate=' + successRate); + if (successRate < ejectionThreshold) { + const randomNumber = Math.random() * 100; + trace('Candidate ' + + address + + ' randomNumber=' + + randomNumber + + ' enforcement_percentage=' + + successRateConfig.enforcement_percentage); + if (randomNumber < successRateConfig.enforcement_percentage) { + trace('Ejecting candidate ' + address); + this.eject(mapEntry, ejectionTimestamp); + } + } + } + } + runFailurePercentageCheck(ejectionTimestamp) { + if (!this.latestConfig) { + return; + } + const failurePercentageConfig = this.latestConfig.getFailurePercentageEjectionConfig(); + if (!failurePercentageConfig) { + return; + } + trace('Running failure percentage check. threshold=' + + failurePercentageConfig.threshold + + ' request volume threshold=' + + failurePercentageConfig.request_volume); + // Step 1 + let addressesWithTargetVolume = 0; + for (const mapEntry of this.entryMap.values()) { + const successes = mapEntry.counter.getLastSuccesses(); + const failures = mapEntry.counter.getLastFailures(); + if (successes + failures >= failurePercentageConfig.request_volume) { + addressesWithTargetVolume += 1; + } + } + if (addressesWithTargetVolume < failurePercentageConfig.minimum_hosts) { + return; + } + // Step 2 + for (const [address, mapEntry] of this.entryMap.entries()) { + // Step 2.i + if (this.getCurrentEjectionPercent() >= + this.latestConfig.getMaxEjectionPercent()) { + break; + } + // Step 2.ii + const successes = mapEntry.counter.getLastSuccesses(); + const failures = mapEntry.counter.getLastFailures(); + trace('Candidate successes=' + successes + ' failures=' + failures); + if (successes + failures < failurePercentageConfig.request_volume) { + continue; + } + // Step 2.iii + const failurePercentage = (failures * 100) / (failures + successes); + if (failurePercentage > failurePercentageConfig.threshold) { + const randomNumber = Math.random() * 100; + trace('Candidate ' + + address + + ' randomNumber=' + + randomNumber + + ' enforcement_percentage=' + + failurePercentageConfig.enforcement_percentage); + if (randomNumber < failurePercentageConfig.enforcement_percentage) { + trace('Ejecting candidate ' + address); + this.eject(mapEntry, ejectionTimestamp); + } + } + } + } + eject(mapEntry, ejectionTimestamp) { + mapEntry.currentEjectionTimestamp = new Date(); + mapEntry.ejectionTimeMultiplier += 1; + for (const subchannelWrapper of mapEntry.subchannelWrappers) { + subchannelWrapper.eject(); + } + } + uneject(mapEntry) { + mapEntry.currentEjectionTimestamp = null; + for (const subchannelWrapper of mapEntry.subchannelWrappers) { + subchannelWrapper.uneject(); + } + } + switchAllBuckets() { + for (const mapEntry of this.entryMap.values()) { + mapEntry.counter.switchBuckets(); + } + } + startTimer(delayMs) { + var _a, _b; + this.ejectionTimer = setTimeout(() => this.runChecks(), delayMs); + (_b = (_a = this.ejectionTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + runChecks() { + const ejectionTimestamp = new Date(); + trace('Ejection timer running'); + this.switchAllBuckets(); + if (!this.latestConfig) { + return; + } + this.timerStartTime = ejectionTimestamp; + this.startTimer(this.latestConfig.getIntervalMs()); + this.runSuccessRateCheck(ejectionTimestamp); + this.runFailurePercentageCheck(ejectionTimestamp); + for (const [address, mapEntry] of this.entryMap.entries()) { + if (mapEntry.currentEjectionTimestamp === null) { + if (mapEntry.ejectionTimeMultiplier > 0) { + mapEntry.ejectionTimeMultiplier -= 1; + } + } + else { + const baseEjectionTimeMs = this.latestConfig.getBaseEjectionTimeMs(); + const maxEjectionTimeMs = this.latestConfig.getMaxEjectionTimeMs(); + const returnTime = new Date(mapEntry.currentEjectionTimestamp.getTime()); + returnTime.setMilliseconds(returnTime.getMilliseconds() + + Math.min(baseEjectionTimeMs * mapEntry.ejectionTimeMultiplier, Math.max(baseEjectionTimeMs, maxEjectionTimeMs))); + if (returnTime < new Date()) { + trace('Unejecting ' + address); + this.uneject(mapEntry); + } + } + } + } + updateAddressList(endpointList, lbConfig, attributes) { + if (!(lbConfig instanceof OutlierDetectionLoadBalancingConfig)) { + return; + } + for (const endpoint of endpointList) { + if (!this.entryMap.has(endpoint)) { + trace('Adding map entry for ' + (0, subchannel_address_1.endpointToString)(endpoint)); + this.entryMap.set(endpoint, { + counter: new CallCounter(), + currentEjectionTimestamp: null, + ejectionTimeMultiplier: 0, + subchannelWrappers: [], + }); + } + } + this.entryMap.deleteMissing(endpointList); + const childPolicy = lbConfig.getChildPolicy(); + this.childBalancer.updateAddressList(endpointList, childPolicy, attributes); + if (lbConfig.getSuccessRateEjectionConfig() || + lbConfig.getFailurePercentageEjectionConfig()) { + if (this.timerStartTime) { + trace('Previous timer existed. Replacing timer'); + clearTimeout(this.ejectionTimer); + const remainingDelay = lbConfig.getIntervalMs() - + (new Date().getTime() - this.timerStartTime.getTime()); + this.startTimer(remainingDelay); + } + else { + trace('Starting new timer'); + this.timerStartTime = new Date(); + this.startTimer(lbConfig.getIntervalMs()); + this.switchAllBuckets(); + } + } + else { + trace('Counting disabled. Cancelling timer.'); + this.timerStartTime = null; + clearTimeout(this.ejectionTimer); + for (const mapEntry of this.entryMap.values()) { + this.uneject(mapEntry); + mapEntry.ejectionTimeMultiplier = 0; + } + } + this.latestConfig = lbConfig; + } + exitIdle() { + this.childBalancer.exitIdle(); + } + resetBackoff() { + this.childBalancer.resetBackoff(); + } + destroy() { + clearTimeout(this.ejectionTimer); + this.childBalancer.destroy(); + } + getTypeName() { + return TYPE_NAME; + } +} +exports.OutlierDetectionLoadBalancer = OutlierDetectionLoadBalancer; +function setup() { + if (OUTLIER_DETECTION_ENABLED) { + (0, experimental_1.registerLoadBalancerType)(TYPE_NAME, OutlierDetectionLoadBalancer, OutlierDetectionLoadBalancingConfig); + } +} +exports.setup = setup; +//# sourceMappingURL=load-balancer-outlier-detection.js.map + +/***/ }), + +/***/ 38977: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.setup = exports.LeafLoadBalancer = exports.PickFirstLoadBalancer = exports.shuffled = exports.PickFirstLoadBalancingConfig = void 0; +const load_balancer_1 = __nccwpck_require__(52680); +const connectivity_state_1 = __nccwpck_require__(80878); +const picker_1 = __nccwpck_require__(81611); +const logging = __nccwpck_require__(35993); +const constants_1 = __nccwpck_require__(90634); +const subchannel_address_1 = __nccwpck_require__(99905); +const net_1 = __nccwpck_require__(41808); +const TRACER_NAME = 'pick_first'; +function trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); +} +const TYPE_NAME = 'pick_first'; +/** + * Delay after starting a connection on a subchannel before starting a + * connection on the next subchannel in the list, for Happy Eyeballs algorithm. + */ +const CONNECTION_DELAY_INTERVAL_MS = 250; +class PickFirstLoadBalancingConfig { + constructor(shuffleAddressList) { + this.shuffleAddressList = shuffleAddressList; + } + getLoadBalancerName() { + return TYPE_NAME; + } + toJsonObject() { + return { + [TYPE_NAME]: { + shuffleAddressList: this.shuffleAddressList, + }, + }; + } + getShuffleAddressList() { + return this.shuffleAddressList; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + static createFromJson(obj) { + if ('shuffleAddressList' in obj && + !(typeof obj.shuffleAddressList === 'boolean')) { + throw new Error('pick_first config field shuffleAddressList must be a boolean if provided'); + } + return new PickFirstLoadBalancingConfig(obj.shuffleAddressList === true); + } +} +exports.PickFirstLoadBalancingConfig = PickFirstLoadBalancingConfig; +/** + * Picker for a `PickFirstLoadBalancer` in the READY state. Always returns the + * picked subchannel. + */ +class PickFirstPicker { + constructor(subchannel) { + this.subchannel = subchannel; + } + pick(pickArgs) { + return { + pickResultType: picker_1.PickResultType.COMPLETE, + subchannel: this.subchannel, + status: null, + onCallStarted: null, + onCallEnded: null, + }; + } +} +/** + * Return a new array with the elements of the input array in a random order + * @param list The input array + * @returns A shuffled array of the elements of list + */ +function shuffled(list) { + const result = list.slice(); + for (let i = result.length - 1; i > 1; i--) { + const j = Math.floor(Math.random() * (i + 1)); + const temp = result[i]; + result[i] = result[j]; + result[j] = temp; + } + return result; +} +exports.shuffled = shuffled; +/** + * Interleave addresses in addressList by family in accordance with RFC-8304 section 4 + * @param addressList + * @returns + */ +function interleaveAddressFamilies(addressList) { + const result = []; + const ipv6Addresses = []; + const ipv4Addresses = []; + const ipv6First = (0, subchannel_address_1.isTcpSubchannelAddress)(addressList[0]) && (0, net_1.isIPv6)(addressList[0].host); + for (const address of addressList) { + if ((0, subchannel_address_1.isTcpSubchannelAddress)(address) && (0, net_1.isIPv6)(address.host)) { + ipv6Addresses.push(address); + } + else { + ipv4Addresses.push(address); + } + } + const firstList = ipv6First ? ipv6Addresses : ipv4Addresses; + const secondList = ipv6First ? ipv4Addresses : ipv6Addresses; + for (let i = 0; i < Math.max(firstList.length, secondList.length); i++) { + if (i < firstList.length) { + result.push(firstList[i]); + } + if (i < secondList.length) { + result.push(secondList[i]); + } + } + return result; +} +const REPORT_HEALTH_STATUS_OPTION_NAME = 'grpc-node.internal.pick-first.report_health_status'; +class PickFirstLoadBalancer { + /** + * Load balancer that attempts to connect to each backend in the address list + * in order, and picks the first one that connects, using it for every + * request. + * @param channelControlHelper `ChannelControlHelper` instance provided by + * this load balancer's owner. + */ + constructor(channelControlHelper, options) { + this.channelControlHelper = channelControlHelper; + /** + * The list of subchannels this load balancer is currently attempting to + * connect to. + */ + this.children = []; + /** + * The current connectivity state of the load balancer. + */ + this.currentState = connectivity_state_1.ConnectivityState.IDLE; + /** + * The index within the `subchannels` array of the subchannel with the most + * recently started connection attempt. + */ + this.currentSubchannelIndex = 0; + /** + * The currently picked subchannel used for making calls. Populated if + * and only if the load balancer's current state is READY. In that case, + * the subchannel's current state is also READY. + */ + this.currentPick = null; + /** + * Listener callback attached to each subchannel in the `subchannels` list + * while establishing a connection. + */ + this.subchannelStateListener = (subchannel, previousState, newState, keepaliveTime, errorMessage) => { + this.onSubchannelStateUpdate(subchannel, previousState, newState, errorMessage); + }; + this.pickedSubchannelHealthListener = () => this.calculateAndReportNewState(); + this.triedAllSubchannels = false; + /** + * The LB policy enters sticky TRANSIENT_FAILURE mode when all + * subchannels have failed to connect at least once, and it stays in that + * mode until a connection attempt is successful. While in sticky TF mode, + * the LB policy continuously attempts to connect to all of its subchannels. + */ + this.stickyTransientFailureMode = false; + /** + * Indicates whether we called channelControlHelper.requestReresolution since + * the last call to updateAddressList + */ + this.requestedResolutionSinceLastUpdate = false; + /** + * The most recent error reported by any subchannel as it transitioned to + * TRANSIENT_FAILURE. + */ + this.lastError = null; + this.latestAddressList = null; + this.connectionDelayTimeout = setTimeout(() => { }, 0); + clearTimeout(this.connectionDelayTimeout); + this.reportHealthStatus = options[REPORT_HEALTH_STATUS_OPTION_NAME]; + } + allChildrenHaveReportedTF() { + return this.children.every(child => child.hasReportedTransientFailure); + } + calculateAndReportNewState() { + if (this.currentPick) { + if (this.reportHealthStatus && !this.currentPick.isHealthy()) { + this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({ + details: `Picked subchannel ${this.currentPick.getAddress()} is unhealthy`, + })); + } + else { + this.updateState(connectivity_state_1.ConnectivityState.READY, new PickFirstPicker(this.currentPick)); + } + } + else if (this.children.length === 0) { + this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); + } + else { + if (this.stickyTransientFailureMode) { + this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({ + details: `No connection established. Last error: ${this.lastError}`, + })); + } + else { + this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); + } + } + } + requestReresolution() { + this.requestedResolutionSinceLastUpdate = true; + this.channelControlHelper.requestReresolution(); + } + maybeEnterStickyTransientFailureMode() { + if (!this.allChildrenHaveReportedTF()) { + return; + } + if (!this.requestedResolutionSinceLastUpdate) { + /* Each time we get an update we reset each subchannel's + * hasReportedTransientFailure flag, so the next time we get to this + * point after that, each subchannel has reported TRANSIENT_FAILURE + * at least once since then. That is the trigger for requesting + * reresolution, whether or not the LB policy is already in sticky TF + * mode. */ + this.requestReresolution(); + } + if (this.stickyTransientFailureMode) { + return; + } + this.stickyTransientFailureMode = true; + for (const { subchannel } of this.children) { + subchannel.startConnecting(); + } + this.calculateAndReportNewState(); + } + removeCurrentPick() { + if (this.currentPick !== null) { + /* Unref can cause a state change, which can cause a change in the value + * of this.currentPick, so we hold a local reference to make sure that + * does not impact this function. */ + const currentPick = this.currentPick; + this.currentPick = null; + currentPick.unref(); + currentPick.removeConnectivityStateListener(this.subchannelStateListener); + this.channelControlHelper.removeChannelzChild(currentPick.getChannelzRef()); + if (this.reportHealthStatus) { + currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener); + } + } + } + onSubchannelStateUpdate(subchannel, previousState, newState, errorMessage) { + var _a; + if ((_a = this.currentPick) === null || _a === void 0 ? void 0 : _a.realSubchannelEquals(subchannel)) { + if (newState !== connectivity_state_1.ConnectivityState.READY) { + this.removeCurrentPick(); + this.calculateAndReportNewState(); + this.requestReresolution(); + } + return; + } + for (const [index, child] of this.children.entries()) { + if (subchannel.realSubchannelEquals(child.subchannel)) { + if (newState === connectivity_state_1.ConnectivityState.READY) { + this.pickSubchannel(child.subchannel); + } + if (newState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { + child.hasReportedTransientFailure = true; + if (errorMessage) { + this.lastError = errorMessage; + } + this.maybeEnterStickyTransientFailureMode(); + if (index === this.currentSubchannelIndex) { + this.startNextSubchannelConnecting(index + 1); + } + } + child.subchannel.startConnecting(); + return; + } + } + } + startNextSubchannelConnecting(startIndex) { + clearTimeout(this.connectionDelayTimeout); + if (this.triedAllSubchannels) { + return; + } + for (const [index, child] of this.children.entries()) { + if (index >= startIndex) { + const subchannelState = child.subchannel.getConnectivityState(); + if (subchannelState === connectivity_state_1.ConnectivityState.IDLE || + subchannelState === connectivity_state_1.ConnectivityState.CONNECTING) { + this.startConnecting(index); + return; + } + } + } + this.triedAllSubchannels = true; + this.maybeEnterStickyTransientFailureMode(); + } + /** + * Have a single subchannel in the `subchannels` list start connecting. + * @param subchannelIndex The index into the `subchannels` list. + */ + startConnecting(subchannelIndex) { + var _a, _b; + clearTimeout(this.connectionDelayTimeout); + this.currentSubchannelIndex = subchannelIndex; + if (this.children[subchannelIndex].subchannel.getConnectivityState() === + connectivity_state_1.ConnectivityState.IDLE) { + trace('Start connecting to subchannel with address ' + + this.children[subchannelIndex].subchannel.getAddress()); + process.nextTick(() => { + var _a; + (_a = this.children[subchannelIndex]) === null || _a === void 0 ? void 0 : _a.subchannel.startConnecting(); + }); + } + this.connectionDelayTimeout = setTimeout(() => { + this.startNextSubchannelConnecting(subchannelIndex + 1); + }, CONNECTION_DELAY_INTERVAL_MS); + (_b = (_a = this.connectionDelayTimeout).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + pickSubchannel(subchannel) { + if (this.currentPick && subchannel.realSubchannelEquals(this.currentPick)) { + return; + } + trace('Pick subchannel with address ' + subchannel.getAddress()); + this.stickyTransientFailureMode = false; + this.removeCurrentPick(); + this.currentPick = subchannel; + subchannel.ref(); + if (this.reportHealthStatus) { + subchannel.addHealthStateWatcher(this.pickedSubchannelHealthListener); + } + this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); + this.resetSubchannelList(); + clearTimeout(this.connectionDelayTimeout); + this.calculateAndReportNewState(); + } + updateState(newState, picker) { + trace(connectivity_state_1.ConnectivityState[this.currentState] + + ' -> ' + + connectivity_state_1.ConnectivityState[newState]); + this.currentState = newState; + this.channelControlHelper.updateState(newState, picker); + } + resetSubchannelList() { + for (const child of this.children) { + if (!(this.currentPick && + child.subchannel.realSubchannelEquals(this.currentPick))) { + /* The connectivity state listener is the same whether the subchannel + * is in the list of children or it is the currentPick, so if it is in + * both, removing it here would cause problems. In particular, that + * always happens immediately after the subchannel is picked. */ + child.subchannel.removeConnectivityStateListener(this.subchannelStateListener); + } + /* Refs are counted independently for the children list and the + * currentPick, so we call unref whether or not the child is the + * currentPick. Channelz child references are also refcounted, so + * removeChannelzChild can be handled the same way. */ + child.subchannel.unref(); + this.channelControlHelper.removeChannelzChild(child.subchannel.getChannelzRef()); + } + this.currentSubchannelIndex = 0; + this.children = []; + this.triedAllSubchannels = false; + this.requestedResolutionSinceLastUpdate = false; + } + connectToAddressList(addressList) { + const newChildrenList = addressList.map(address => ({ + subchannel: this.channelControlHelper.createSubchannel(address, {}), + hasReportedTransientFailure: false, + })); + /* Ref each subchannel before resetting the list, to ensure that + * subchannels shared between the list don't drop to 0 refs during the + * transition. */ + for (const { subchannel } of newChildrenList) { + subchannel.ref(); + this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); + } + this.resetSubchannelList(); + this.children = newChildrenList; + for (const { subchannel } of this.children) { + subchannel.addConnectivityStateListener(this.subchannelStateListener); + if (subchannel.getConnectivityState() === connectivity_state_1.ConnectivityState.READY) { + this.pickSubchannel(subchannel); + return; + } + } + for (const child of this.children) { + if (child.subchannel.getConnectivityState() === + connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { + child.hasReportedTransientFailure = true; + } + } + this.startNextSubchannelConnecting(0); + this.calculateAndReportNewState(); + } + updateAddressList(endpointList, lbConfig) { + if (!(lbConfig instanceof PickFirstLoadBalancingConfig)) { + return; + } + /* Previously, an update would be discarded if it was identical to the + * previous update, to minimize churn. Now the DNS resolver is + * rate-limited, so that is less of a concern. */ + if (lbConfig.getShuffleAddressList()) { + endpointList = shuffled(endpointList); + } + const rawAddressList = [].concat(...endpointList.map(endpoint => endpoint.addresses)); + if (rawAddressList.length === 0) { + throw new Error('No addresses in endpoint list passed to pick_first'); + } + const addressList = interleaveAddressFamilies(rawAddressList); + this.latestAddressList = addressList; + this.connectToAddressList(addressList); + } + exitIdle() { + if (this.currentState === connectivity_state_1.ConnectivityState.IDLE && + this.latestAddressList) { + this.connectToAddressList(this.latestAddressList); + } + } + resetBackoff() { + /* The pick first load balancer does not have a connection backoff, so this + * does nothing */ + } + destroy() { + this.resetSubchannelList(); + this.removeCurrentPick(); + } + getTypeName() { + return TYPE_NAME; + } +} +exports.PickFirstLoadBalancer = PickFirstLoadBalancer; +const LEAF_CONFIG = new PickFirstLoadBalancingConfig(false); +/** + * This class handles the leaf load balancing operations for a single endpoint. + * It is a thin wrapper around a PickFirstLoadBalancer with a different API + * that more closely reflects how it will be used as a leaf balancer. + */ +class LeafLoadBalancer { + constructor(endpoint, channelControlHelper, options) { + this.endpoint = endpoint; + this.latestState = connectivity_state_1.ConnectivityState.IDLE; + const childChannelControlHelper = (0, load_balancer_1.createChildChannelControlHelper)(channelControlHelper, { + updateState: (connectivityState, picker) => { + this.latestState = connectivityState; + this.latestPicker = picker; + channelControlHelper.updateState(connectivityState, picker); + }, + }); + this.pickFirstBalancer = new PickFirstLoadBalancer(childChannelControlHelper, Object.assign(Object.assign({}, options), { [REPORT_HEALTH_STATUS_OPTION_NAME]: true })); + this.latestPicker = new picker_1.QueuePicker(this.pickFirstBalancer); + } + startConnecting() { + this.pickFirstBalancer.updateAddressList([this.endpoint], LEAF_CONFIG); + } + /** + * Update the endpoint associated with this LeafLoadBalancer to a new + * endpoint. Does not trigger connection establishment if a connection + * attempt is not already in progress. + * @param newEndpoint + */ + updateEndpoint(newEndpoint) { + this.endpoint = newEndpoint; + if (this.latestState !== connectivity_state_1.ConnectivityState.IDLE) { + this.startConnecting(); + } + } + getConnectivityState() { + return this.latestState; + } + getPicker() { + return this.latestPicker; + } + getEndpoint() { + return this.endpoint; + } + exitIdle() { + this.pickFirstBalancer.exitIdle(); + } + destroy() { + this.pickFirstBalancer.destroy(); + } +} +exports.LeafLoadBalancer = LeafLoadBalancer; +function setup() { + (0, load_balancer_1.registerLoadBalancerType)(TYPE_NAME, PickFirstLoadBalancer, PickFirstLoadBalancingConfig); + (0, load_balancer_1.registerDefaultLoadBalancerType)(TYPE_NAME); +} +exports.setup = setup; +//# sourceMappingURL=load-balancer-pick-first.js.map + +/***/ }), + +/***/ 92787: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.setup = exports.RoundRobinLoadBalancer = void 0; +const load_balancer_1 = __nccwpck_require__(52680); +const connectivity_state_1 = __nccwpck_require__(80878); +const picker_1 = __nccwpck_require__(81611); +const logging = __nccwpck_require__(35993); +const constants_1 = __nccwpck_require__(90634); +const subchannel_address_1 = __nccwpck_require__(99905); +const load_balancer_pick_first_1 = __nccwpck_require__(38977); +const TRACER_NAME = 'round_robin'; +function trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); +} +const TYPE_NAME = 'round_robin'; +class RoundRobinLoadBalancingConfig { + getLoadBalancerName() { + return TYPE_NAME; + } + constructor() { } + toJsonObject() { + return { + [TYPE_NAME]: {}, + }; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + static createFromJson(obj) { + return new RoundRobinLoadBalancingConfig(); + } +} +class RoundRobinPicker { + constructor(children, nextIndex = 0) { + this.children = children; + this.nextIndex = nextIndex; + } + pick(pickArgs) { + const childPicker = this.children[this.nextIndex].picker; + this.nextIndex = (this.nextIndex + 1) % this.children.length; + return childPicker.pick(pickArgs); + } + /** + * Check what the next subchannel returned would be. Used by the load + * balancer implementation to preserve this part of the picker state if + * possible when a subchannel connects or disconnects. + */ + peekNextEndpoint() { + return this.children[this.nextIndex].endpoint; + } +} +class RoundRobinLoadBalancer { + constructor(channelControlHelper, options) { + this.channelControlHelper = channelControlHelper; + this.options = options; + this.children = []; + this.currentState = connectivity_state_1.ConnectivityState.IDLE; + this.currentReadyPicker = null; + this.updatesPaused = false; + this.lastError = null; + this.childChannelControlHelper = (0, load_balancer_1.createChildChannelControlHelper)(channelControlHelper, { + updateState: (connectivityState, picker) => { + this.calculateAndUpdateState(); + }, + }); + } + countChildrenWithState(state) { + return this.children.filter(child => child.getConnectivityState() === state) + .length; + } + calculateAndUpdateState() { + if (this.updatesPaused) { + return; + } + if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.READY) > 0) { + const readyChildren = this.children.filter(child => child.getConnectivityState() === connectivity_state_1.ConnectivityState.READY); + let index = 0; + if (this.currentReadyPicker !== null) { + const nextPickedEndpoint = this.currentReadyPicker.peekNextEndpoint(); + index = readyChildren.findIndex(child => (0, subchannel_address_1.endpointEqual)(child.getEndpoint(), nextPickedEndpoint)); + if (index < 0) { + index = 0; + } + } + this.updateState(connectivity_state_1.ConnectivityState.READY, new RoundRobinPicker(readyChildren.map(child => ({ + endpoint: child.getEndpoint(), + picker: child.getPicker(), + })), index)); + } + else if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.CONNECTING) > 0) { + this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); + } + else if (this.countChildrenWithState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) > 0) { + this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker({ + details: `No connection established. Last error: ${this.lastError}`, + })); + } + else { + this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); + } + /* round_robin should keep all children connected, this is how we do that. + * We can't do this more efficiently in the individual child's updateState + * callback because that doesn't have a reference to which child the state + * change is associated with. */ + for (const child of this.children) { + if (child.getConnectivityState() === connectivity_state_1.ConnectivityState.IDLE) { + child.exitIdle(); + } + } + } + updateState(newState, picker) { + trace(connectivity_state_1.ConnectivityState[this.currentState] + + ' -> ' + + connectivity_state_1.ConnectivityState[newState]); + if (newState === connectivity_state_1.ConnectivityState.READY) { + this.currentReadyPicker = picker; + } + else { + this.currentReadyPicker = null; + } + this.currentState = newState; + this.channelControlHelper.updateState(newState, picker); + } + resetSubchannelList() { + for (const child of this.children) { + child.destroy(); + } + } + updateAddressList(endpointList, lbConfig) { + this.resetSubchannelList(); + trace('Connect to endpoint list ' + endpointList.map(subchannel_address_1.endpointToString)); + this.updatesPaused = true; + this.children = endpointList.map(endpoint => new load_balancer_pick_first_1.LeafLoadBalancer(endpoint, this.childChannelControlHelper, this.options)); + for (const child of this.children) { + child.startConnecting(); + } + this.updatesPaused = false; + this.calculateAndUpdateState(); + } + exitIdle() { + /* The round_robin LB policy is only in the IDLE state if it has no + * addresses to try to connect to and it has no picked subchannel. + * In that case, there is no meaningful action that can be taken here. */ + } + resetBackoff() { + // This LB policy has no backoff to reset + } + destroy() { + this.resetSubchannelList(); + } + getTypeName() { + return TYPE_NAME; + } +} +exports.RoundRobinLoadBalancer = RoundRobinLoadBalancer; +function setup() { + (0, load_balancer_1.registerLoadBalancerType)(TYPE_NAME, RoundRobinLoadBalancer, RoundRobinLoadBalancingConfig); +} +exports.setup = setup; +//# sourceMappingURL=load-balancer-round-robin.js.map + +/***/ }), + +/***/ 52680: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.selectLbConfigFromList = exports.getDefaultConfig = exports.parseLoadBalancingConfig = exports.isLoadBalancerNameRegistered = exports.createLoadBalancer = exports.registerDefaultLoadBalancerType = exports.registerLoadBalancerType = exports.createChildChannelControlHelper = void 0; +const logging_1 = __nccwpck_require__(35993); +const constants_1 = __nccwpck_require__(90634); +/** + * Create a child ChannelControlHelper that overrides some methods of the + * parent while letting others pass through to the parent unmodified. This + * allows other code to create these children without needing to know about + * all of the methods to be passed through. + * @param parent + * @param overrides + */ +function createChildChannelControlHelper(parent, overrides) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; + return { + createSubchannel: (_b = (_a = overrides.createSubchannel) === null || _a === void 0 ? void 0 : _a.bind(overrides)) !== null && _b !== void 0 ? _b : parent.createSubchannel.bind(parent), + updateState: (_d = (_c = overrides.updateState) === null || _c === void 0 ? void 0 : _c.bind(overrides)) !== null && _d !== void 0 ? _d : parent.updateState.bind(parent), + requestReresolution: (_f = (_e = overrides.requestReresolution) === null || _e === void 0 ? void 0 : _e.bind(overrides)) !== null && _f !== void 0 ? _f : parent.requestReresolution.bind(parent), + addChannelzChild: (_h = (_g = overrides.addChannelzChild) === null || _g === void 0 ? void 0 : _g.bind(overrides)) !== null && _h !== void 0 ? _h : parent.addChannelzChild.bind(parent), + removeChannelzChild: (_k = (_j = overrides.removeChannelzChild) === null || _j === void 0 ? void 0 : _j.bind(overrides)) !== null && _k !== void 0 ? _k : parent.removeChannelzChild.bind(parent), + }; +} +exports.createChildChannelControlHelper = createChildChannelControlHelper; +const registeredLoadBalancerTypes = {}; +let defaultLoadBalancerType = null; +function registerLoadBalancerType(typeName, loadBalancerType, loadBalancingConfigType) { + registeredLoadBalancerTypes[typeName] = { + LoadBalancer: loadBalancerType, + LoadBalancingConfig: loadBalancingConfigType, + }; +} +exports.registerLoadBalancerType = registerLoadBalancerType; +function registerDefaultLoadBalancerType(typeName) { + defaultLoadBalancerType = typeName; +} +exports.registerDefaultLoadBalancerType = registerDefaultLoadBalancerType; +function createLoadBalancer(config, channelControlHelper, options) { + const typeName = config.getLoadBalancerName(); + if (typeName in registeredLoadBalancerTypes) { + return new registeredLoadBalancerTypes[typeName].LoadBalancer(channelControlHelper, options); + } + else { + return null; + } +} +exports.createLoadBalancer = createLoadBalancer; +function isLoadBalancerNameRegistered(typeName) { + return typeName in registeredLoadBalancerTypes; +} +exports.isLoadBalancerNameRegistered = isLoadBalancerNameRegistered; +function parseLoadBalancingConfig(rawConfig) { + const keys = Object.keys(rawConfig); + if (keys.length !== 1) { + throw new Error('Provided load balancing config has multiple conflicting entries'); + } + const typeName = keys[0]; + if (typeName in registeredLoadBalancerTypes) { + try { + return registeredLoadBalancerTypes[typeName].LoadBalancingConfig.createFromJson(rawConfig[typeName]); + } + catch (e) { + throw new Error(`${typeName}: ${e.message}`); + } + } + else { + throw new Error(`Unrecognized load balancing config name ${typeName}`); + } +} +exports.parseLoadBalancingConfig = parseLoadBalancingConfig; +function getDefaultConfig() { + if (!defaultLoadBalancerType) { + throw new Error('No default load balancer type registered'); + } + return new registeredLoadBalancerTypes[defaultLoadBalancerType].LoadBalancingConfig(); +} +exports.getDefaultConfig = getDefaultConfig; +function selectLbConfigFromList(configs, fallbackTodefault = false) { + for (const config of configs) { + try { + return parseLoadBalancingConfig(config); + } + catch (e) { + (0, logging_1.log)(constants_1.LogVerbosity.DEBUG, 'Config parsing failed with error', e.message); + continue; + } + } + if (fallbackTodefault) { + if (defaultLoadBalancerType) { + return new registeredLoadBalancerTypes[defaultLoadBalancerType].LoadBalancingConfig(); + } + else { + return null; + } + } + else { + return null; + } +} +exports.selectLbConfigFromList = selectLbConfigFromList; +//# sourceMappingURL=load-balancer.js.map + +/***/ }), + +/***/ 776: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.LoadBalancingCall = void 0; +const connectivity_state_1 = __nccwpck_require__(80878); +const constants_1 = __nccwpck_require__(90634); +const deadline_1 = __nccwpck_require__(511); +const metadata_1 = __nccwpck_require__(83665); +const picker_1 = __nccwpck_require__(81611); +const uri_parser_1 = __nccwpck_require__(65974); +const logging = __nccwpck_require__(35993); +const control_plane_status_1 = __nccwpck_require__(39129); +const http2 = __nccwpck_require__(85158); +const TRACER_NAME = 'load_balancing_call'; +class LoadBalancingCall { + constructor(channel, callConfig, methodName, host, credentials, deadline, callNumber) { + var _a, _b; + this.channel = channel; + this.callConfig = callConfig; + this.methodName = methodName; + this.host = host; + this.credentials = credentials; + this.deadline = deadline; + this.callNumber = callNumber; + this.child = null; + this.readPending = false; + this.pendingMessage = null; + this.pendingHalfClose = false; + this.ended = false; + this.metadata = null; + this.listener = null; + this.onCallEnded = null; + this.childStartTime = null; + const splitPath = this.methodName.split('/'); + let serviceName = ''; + /* The standard path format is "/{serviceName}/{methodName}", so if we split + * by '/', the first item should be empty and the second should be the + * service name */ + if (splitPath.length >= 2) { + serviceName = splitPath[1]; + } + const hostname = (_b = (_a = (0, uri_parser_1.splitHostPort)(this.host)) === null || _a === void 0 ? void 0 : _a.host) !== null && _b !== void 0 ? _b : 'localhost'; + /* Currently, call credentials are only allowed on HTTPS connections, so we + * can assume that the scheme is "https" */ + this.serviceUrl = `https://${hostname}/${serviceName}`; + this.startTime = new Date(); + } + getDeadlineInfo() { + var _a, _b; + const deadlineInfo = []; + if (this.childStartTime) { + if (this.childStartTime > this.startTime) { + if ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.getOptions().waitForReady) { + deadlineInfo.push('wait_for_ready'); + } + deadlineInfo.push(`LB pick: ${(0, deadline_1.formatDateDifference)(this.startTime, this.childStartTime)}`); + } + deadlineInfo.push(...this.child.getDeadlineInfo()); + return deadlineInfo; + } + else { + if ((_b = this.metadata) === null || _b === void 0 ? void 0 : _b.getOptions().waitForReady) { + deadlineInfo.push('wait_for_ready'); + } + deadlineInfo.push('Waiting for LB pick'); + } + return deadlineInfo; + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text); + } + outputStatus(status, progress) { + var _a, _b; + if (!this.ended) { + this.ended = true; + this.trace('ended with status: code=' + + status.code + + ' details="' + + status.details + + '" start time=' + + this.startTime.toISOString()); + const finalStatus = Object.assign(Object.assign({}, status), { progress }); + (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus(finalStatus); + (_b = this.onCallEnded) === null || _b === void 0 ? void 0 : _b.call(this, finalStatus.code); + } + } + doPick() { + var _a, _b; + if (this.ended) { + return; + } + if (!this.metadata) { + throw new Error('doPick called before start'); + } + this.trace('Pick called'); + const finalMetadata = this.metadata.clone(); + const pickResult = this.channel.doPick(finalMetadata, this.callConfig.pickInformation); + const subchannelString = pickResult.subchannel + ? '(' + + pickResult.subchannel.getChannelzRef().id + + ') ' + + pickResult.subchannel.getAddress() + : '' + pickResult.subchannel; + this.trace('Pick result: ' + + picker_1.PickResultType[pickResult.pickResultType] + + ' subchannel: ' + + subchannelString + + ' status: ' + + ((_a = pickResult.status) === null || _a === void 0 ? void 0 : _a.code) + + ' ' + + ((_b = pickResult.status) === null || _b === void 0 ? void 0 : _b.details)); + switch (pickResult.pickResultType) { + case picker_1.PickResultType.COMPLETE: + this.credentials + .generateMetadata({ service_url: this.serviceUrl }) + .then(credsMetadata => { + var _a, _b, _c; + /* If this call was cancelled (e.g. by the deadline) before + * metadata generation finished, we shouldn't do anything with + * it. */ + if (this.ended) { + this.trace('Credentials metadata generation finished after call ended'); + return; + } + finalMetadata.merge(credsMetadata); + if (finalMetadata.get('authorization').length > 1) { + this.outputStatus({ + code: constants_1.Status.INTERNAL, + details: '"authorization" metadata cannot have multiple values', + metadata: new metadata_1.Metadata(), + }, 'PROCESSED'); + } + if (pickResult.subchannel.getConnectivityState() !== + connectivity_state_1.ConnectivityState.READY) { + this.trace('Picked subchannel ' + + subchannelString + + ' has state ' + + connectivity_state_1.ConnectivityState[pickResult.subchannel.getConnectivityState()] + + ' after getting credentials metadata. Retrying pick'); + this.doPick(); + return; + } + if (this.deadline !== Infinity) { + finalMetadata.set('grpc-timeout', (0, deadline_1.getDeadlineTimeoutString)(this.deadline)); + } + try { + this.child = pickResult + .subchannel.getRealSubchannel() + .createCall(finalMetadata, this.host, this.methodName, { + onReceiveMetadata: metadata => { + this.trace('Received metadata'); + this.listener.onReceiveMetadata(metadata); + }, + onReceiveMessage: message => { + this.trace('Received message'); + this.listener.onReceiveMessage(message); + }, + onReceiveStatus: status => { + this.trace('Received status'); + if (status.rstCode === + http2.constants.NGHTTP2_REFUSED_STREAM) { + this.outputStatus(status, 'REFUSED'); + } + else { + this.outputStatus(status, 'PROCESSED'); + } + }, + }); + this.childStartTime = new Date(); + } + catch (error) { + this.trace('Failed to start call on picked subchannel ' + + subchannelString + + ' with error ' + + error.message); + this.outputStatus({ + code: constants_1.Status.INTERNAL, + details: 'Failed to start HTTP/2 stream with error ' + + error.message, + metadata: new metadata_1.Metadata(), + }, 'NOT_STARTED'); + return; + } + (_b = (_a = this.callConfig).onCommitted) === null || _b === void 0 ? void 0 : _b.call(_a); + (_c = pickResult.onCallStarted) === null || _c === void 0 ? void 0 : _c.call(pickResult); + this.onCallEnded = pickResult.onCallEnded; + this.trace('Created child call [' + this.child.getCallNumber() + ']'); + if (this.readPending) { + this.child.startRead(); + } + if (this.pendingMessage) { + this.child.sendMessageWithContext(this.pendingMessage.context, this.pendingMessage.message); + } + if (this.pendingHalfClose) { + this.child.halfClose(); + } + }, (error) => { + // We assume the error code isn't 0 (Status.OK) + const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(typeof error.code === 'number' ? error.code : constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`); + this.outputStatus({ + code: code, + details: details, + metadata: new metadata_1.Metadata(), + }, 'PROCESSED'); + }); + break; + case picker_1.PickResultType.DROP: + const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(pickResult.status.code, pickResult.status.details); + setImmediate(() => { + this.outputStatus({ code, details, metadata: pickResult.status.metadata }, 'DROP'); + }); + break; + case picker_1.PickResultType.TRANSIENT_FAILURE: + if (this.metadata.getOptions().waitForReady) { + this.channel.queueCallForPick(this); + } + else { + const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(pickResult.status.code, pickResult.status.details); + setImmediate(() => { + this.outputStatus({ code, details, metadata: pickResult.status.metadata }, 'PROCESSED'); + }); + } + break; + case picker_1.PickResultType.QUEUE: + this.channel.queueCallForPick(this); + } + } + cancelWithStatus(status, details) { + var _a; + this.trace('cancelWithStatus code: ' + status + ' details: "' + details + '"'); + (_a = this.child) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(status, details); + this.outputStatus({ code: status, details: details, metadata: new metadata_1.Metadata() }, 'PROCESSED'); + } + getPeer() { + var _a, _b; + return (_b = (_a = this.child) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : this.channel.getTarget(); + } + start(metadata, listener) { + this.trace('start called'); + this.listener = listener; + this.metadata = metadata; + this.doPick(); + } + sendMessageWithContext(context, message) { + this.trace('write() called with message of length ' + message.length); + if (this.child) { + this.child.sendMessageWithContext(context, message); + } + else { + this.pendingMessage = { context, message }; + } + } + startRead() { + this.trace('startRead called'); + if (this.child) { + this.child.startRead(); + } + else { + this.readPending = true; + } + } + halfClose() { + this.trace('halfClose called'); + if (this.child) { + this.child.halfClose(); + } + else { + this.pendingHalfClose = true; + } + } + setCredentials(credentials) { + throw new Error('Method not implemented.'); + } + getCallNumber() { + return this.callNumber; + } +} +exports.LoadBalancingCall = LoadBalancingCall; +//# sourceMappingURL=load-balancing-call.js.map + +/***/ }), + +/***/ 35993: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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, _b, _c, _d; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTracerEnabled = exports.trace = exports.log = exports.setLoggerVerbosity = exports.setLogger = exports.getLogger = void 0; +const constants_1 = __nccwpck_require__(90634); +const process_1 = __nccwpck_require__(77282); +const clientVersion = (__nccwpck_require__(56569)/* .version */ .i8); +const DEFAULT_LOGGER = { + error: (message, ...optionalParams) => { + console.error('E ' + message, ...optionalParams); + }, + info: (message, ...optionalParams) => { + console.error('I ' + message, ...optionalParams); + }, + debug: (message, ...optionalParams) => { + console.error('D ' + message, ...optionalParams); + }, +}; +let _logger = DEFAULT_LOGGER; +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 : ''; +switch (verbosityString.toUpperCase()) { + case 'DEBUG': + _logVerbosity = constants_1.LogVerbosity.DEBUG; + break; + case 'INFO': + _logVerbosity = constants_1.LogVerbosity.INFO; + break; + case 'ERROR': + _logVerbosity = constants_1.LogVerbosity.ERROR; + break; + case 'NONE': + _logVerbosity = constants_1.LogVerbosity.NONE; + break; + default: + // Ignore any other values +} +const getLogger = () => { + return _logger; +}; +exports.getLogger = getLogger; +const setLogger = (logger) => { + _logger = logger; +}; +exports.setLogger = setLogger; +const setLoggerVerbosity = (verbosity) => { + _logVerbosity = verbosity; +}; +exports.setLoggerVerbosity = setLoggerVerbosity; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const log = (severity, ...args) => { + let logFunction; + if (severity >= _logVerbosity) { + switch (severity) { + case constants_1.LogVerbosity.DEBUG: + logFunction = _logger.debug; + break; + case constants_1.LogVerbosity.INFO: + logFunction = _logger.info; + break; + case constants_1.LogVerbosity.ERROR: + logFunction = _logger.error; + break; + } + /* Fall back to _logger.error when other methods are not available for + * compatiblity with older behavior that always logged to _logger.error */ + if (!logFunction) { + logFunction = _logger.error; + } + if (logFunction) { + logFunction.bind(_logger)(...args); + } + } +}; +exports.log = log; +const tracersString = (_d = (_c = process.env.GRPC_NODE_TRACE) !== null && _c !== void 0 ? _c : process.env.GRPC_TRACE) !== null && _d !== void 0 ? _d : ''; +const enabledTracers = new Set(); +const disabledTracers = new Set(); +for (const tracerName of tracersString.split(',')) { + if (tracerName.startsWith('-')) { + disabledTracers.add(tracerName.substring(1)); + } + else { + enabledTracers.add(tracerName); + } +} +const allEnabled = enabledTracers.has('all'); +function trace(severity, tracer, text) { + if (isTracerEnabled(tracer)) { + (0, exports.log)(severity, new Date().toISOString() + + ' | v' + + clientVersion + + ' ' + + process_1.pid + + ' | ' + + tracer + + ' | ' + + text); + } +} +exports.trace = trace; +function isTracerEnabled(tracer) { + return (!disabledTracers.has(tracer) && (allEnabled || enabledTracers.has(tracer))); +} +exports.isTracerEnabled = isTracerEnabled; +//# sourceMappingURL=logging.js.map + +/***/ }), + +/***/ 38541: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.loadPackageDefinition = exports.makeClientConstructor = void 0; +const client_1 = __nccwpck_require__(87172); +/** + * Map with short names for each of the requester maker functions. Used in + * makeClientConstructor + * @private + */ +const requesterFuncs = { + unary: client_1.Client.prototype.makeUnaryRequest, + server_stream: client_1.Client.prototype.makeServerStreamRequest, + client_stream: client_1.Client.prototype.makeClientStreamRequest, + bidi: client_1.Client.prototype.makeBidiStreamRequest, +}; +/** + * Returns true, if given key is included in the blacklisted + * keys. + * @param key key for check, string. + */ +function isPrototypePolluted(key) { + return ['__proto__', 'prototype', 'constructor'].includes(key); +} +/** + * Creates a constructor for a client with the given methods, as specified in + * the methods argument. The resulting class will have an instance method for + * each method in the service, which is a partial application of one of the + * [Client]{@link grpc.Client} request methods, depending on `requestSerialize` + * and `responseSerialize`, with the `method`, `serialize`, and `deserialize` + * arguments predefined. + * @param methods An object mapping method names to + * method attributes + * @param serviceName The fully qualified name of the service + * @param classOptions An options object. + * @return New client constructor, which is a subclass of + * {@link grpc.Client}, and has the same arguments as that constructor. + */ +function makeClientConstructor(methods, serviceName, classOptions) { + if (!classOptions) { + classOptions = {}; + } + class ServiceClientImpl extends client_1.Client { + } + Object.keys(methods).forEach(name => { + if (isPrototypePolluted(name)) { + return; + } + const attrs = methods[name]; + let methodType; + // TODO(murgatroid99): Verify that we don't need this anymore + if (typeof name === 'string' && name.charAt(0) === '$') { + throw new Error('Method names cannot start with $'); + } + if (attrs.requestStream) { + if (attrs.responseStream) { + methodType = 'bidi'; + } + else { + methodType = 'client_stream'; + } + } + else { + if (attrs.responseStream) { + methodType = 'server_stream'; + } + else { + methodType = 'unary'; + } + } + const serialize = attrs.requestSerialize; + const deserialize = attrs.responseDeserialize; + const methodFunc = partial(requesterFuncs[methodType], attrs.path, serialize, deserialize); + ServiceClientImpl.prototype[name] = methodFunc; + // Associate all provided attributes with the method + Object.assign(ServiceClientImpl.prototype[name], attrs); + if (attrs.originalName && !isPrototypePolluted(attrs.originalName)) { + ServiceClientImpl.prototype[attrs.originalName] = + ServiceClientImpl.prototype[name]; + } + }); + ServiceClientImpl.service = methods; + ServiceClientImpl.serviceName = serviceName; + return ServiceClientImpl; +} +exports.makeClientConstructor = makeClientConstructor; +function partial(fn, path, serialize, deserialize) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return function (...args) { + return fn.call(this, path, serialize, deserialize, ...args); + }; +} +function isProtobufTypeDefinition(obj) { + return 'format' in obj; +} +/** + * Load a gRPC package definition as a gRPC object hierarchy. + * @param packageDef The package definition object. + * @return The resulting gRPC object. + */ +function loadPackageDefinition(packageDef) { + const result = {}; + for (const serviceFqn in packageDef) { + if (Object.prototype.hasOwnProperty.call(packageDef, serviceFqn)) { + const service = packageDef[serviceFqn]; + const nameComponents = serviceFqn.split('.'); + if (nameComponents.some((comp) => isPrototypePolluted(comp))) { + continue; + } + const serviceName = nameComponents[nameComponents.length - 1]; + let current = result; + for (const packageName of nameComponents.slice(0, -1)) { + if (!current[packageName]) { + current[packageName] = {}; + } + current = current[packageName]; + } + if (isProtobufTypeDefinition(service)) { + current[serviceName] = service; + } + else { + current[serviceName] = makeClientConstructor(service, serviceName, {}); + } + } + } + return result; +} +exports.loadPackageDefinition = loadPackageDefinition; +//# sourceMappingURL=make-client.js.map + +/***/ }), + +/***/ 83665: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.Metadata = void 0; +const logging_1 = __nccwpck_require__(35993); +const constants_1 = __nccwpck_require__(90634); +const error_1 = __nccwpck_require__(22336); +const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/; +const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/; +function isLegalKey(key) { + return LEGAL_KEY_REGEX.test(key); +} +function isLegalNonBinaryValue(value) { + return LEGAL_NON_BINARY_VALUE_REGEX.test(value); +} +function isBinaryKey(key) { + return key.endsWith('-bin'); +} +function isCustomMetadata(key) { + return !key.startsWith('grpc-'); +} +function normalizeKey(key) { + return key.toLowerCase(); +} +function validate(key, value) { + if (!isLegalKey(key)) { + throw new Error('Metadata key "' + key + '" contains illegal characters'); + } + if (value !== null && value !== undefined) { + if (isBinaryKey(key)) { + if (!Buffer.isBuffer(value)) { + throw new Error("keys that end with '-bin' must have Buffer values"); + } + } + else { + if (Buffer.isBuffer(value)) { + throw new Error("keys that don't end with '-bin' must have String values"); + } + if (!isLegalNonBinaryValue(value)) { + throw new Error('Metadata string value "' + value + '" contains illegal characters'); + } + } + } +} +/** + * A class for storing metadata. Keys are normalized to lowercase ASCII. + */ +class Metadata { + constructor(options = {}) { + this.internalRepr = new Map(); + this.options = options; + } + /** + * Sets the given value for the given key by replacing any other values + * associated with that key. Normalizes the key. + * @param key The key to whose value should be set. + * @param value The value to set. Must be a buffer if and only + * if the normalized key ends with '-bin'. + */ + set(key, value) { + key = normalizeKey(key); + validate(key, value); + this.internalRepr.set(key, [value]); + } + /** + * Adds the given value for the given key by appending to a list of previous + * values associated with that key. Normalizes the key. + * @param key The key for which a new value should be appended. + * @param value The value to add. Must be a buffer if and only + * if the normalized key ends with '-bin'. + */ + add(key, value) { + key = normalizeKey(key); + validate(key, value); + const existingValue = this.internalRepr.get(key); + if (existingValue === undefined) { + this.internalRepr.set(key, [value]); + } + else { + existingValue.push(value); + } + } + /** + * Removes the given key and any associated values. Normalizes the key. + * @param key The key whose values should be removed. + */ + remove(key) { + key = normalizeKey(key); + // validate(key); + this.internalRepr.delete(key); + } + /** + * Gets a list of all values associated with the key. Normalizes the key. + * @param key The key whose value should be retrieved. + * @return A list of values associated with the given key. + */ + get(key) { + key = normalizeKey(key); + // validate(key); + return this.internalRepr.get(key) || []; + } + /** + * Gets a plain object mapping each key to the first value associated with it. + * This reflects the most common way that people will want to see metadata. + * @return A key/value mapping of the metadata. + */ + getMap() { + const result = {}; + for (const [key, values] of this.internalRepr) { + if (values.length > 0) { + const v = values[0]; + result[key] = Buffer.isBuffer(v) ? Buffer.from(v) : v; + } + } + return result; + } + /** + * Clones the metadata object. + * @return The newly cloned object. + */ + clone() { + const newMetadata = new Metadata(this.options); + const newInternalRepr = newMetadata.internalRepr; + for (const [key, value] of this.internalRepr) { + const clonedValue = value.map(v => { + if (Buffer.isBuffer(v)) { + return Buffer.from(v); + } + else { + return v; + } + }); + newInternalRepr.set(key, clonedValue); + } + return newMetadata; + } + /** + * Merges all key-value pairs from a given Metadata object into this one. + * If both this object and the given object have values in the same key, + * values from the other Metadata object will be appended to this object's + * values. + * @param other A Metadata object. + */ + merge(other) { + for (const [key, values] of other.internalRepr) { + const mergedValue = (this.internalRepr.get(key) || []).concat(values); + this.internalRepr.set(key, mergedValue); + } + } + setOptions(options) { + this.options = options; + } + getOptions() { + return this.options; + } + /** + * Creates an OutgoingHttpHeaders object that can be used with the http2 API. + */ + toHttp2Headers() { + // NOTE: Node <8.9 formats http2 headers incorrectly. + const result = {}; + for (const [key, values] of this.internalRepr) { + // We assume that the user's interaction with this object is limited to + // through its public API (i.e. keys and values are already validated). + result[key] = values.map(bufToString); + } + return result; + } + /** + * This modifies the behavior of JSON.stringify to show an object + * representation of the metadata map. + */ + toJSON() { + const result = {}; + for (const [key, values] of this.internalRepr) { + result[key] = values; + } + return result; + } + /** + * Returns a new Metadata object based fields in a given IncomingHttpHeaders + * object. + * @param headers An IncomingHttpHeaders object. + */ + static fromHttp2Headers(headers) { + const result = new Metadata(); + for (const key of Object.keys(headers)) { + // Reserved headers (beginning with `:`) are not valid keys. + if (key.charAt(0) === ':') { + continue; + } + const values = headers[key]; + try { + if (isBinaryKey(key)) { + if (Array.isArray(values)) { + values.forEach(value => { + result.add(key, Buffer.from(value, 'base64')); + }); + } + else if (values !== undefined) { + if (isCustomMetadata(key)) { + values.split(',').forEach(v => { + result.add(key, Buffer.from(v.trim(), 'base64')); + }); + } + else { + result.add(key, Buffer.from(values, 'base64')); + } + } + } + else { + if (Array.isArray(values)) { + values.forEach(value => { + result.add(key, value); + }); + } + else if (values !== undefined) { + result.add(key, values); + } + } + } + catch (error) { + const message = `Failed to add metadata entry ${key}: ${values}. ${(0, error_1.getErrorMessage)(error)}. For more information see https://github.com/grpc/grpc-node/issues/1173`; + (0, logging_1.log)(constants_1.LogVerbosity.ERROR, message); + } + } + return result; + } +} +exports.Metadata = Metadata; +const bufToString = (val) => { + return Buffer.isBuffer(val) ? val.toString('base64') : val; +}; +//# sourceMappingURL=metadata.js.map + +/***/ }), + +/***/ 81611: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.QueuePicker = exports.UnavailablePicker = exports.PickResultType = void 0; +const metadata_1 = __nccwpck_require__(83665); +const constants_1 = __nccwpck_require__(90634); +var PickResultType; +(function (PickResultType) { + PickResultType[PickResultType["COMPLETE"] = 0] = "COMPLETE"; + PickResultType[PickResultType["QUEUE"] = 1] = "QUEUE"; + PickResultType[PickResultType["TRANSIENT_FAILURE"] = 2] = "TRANSIENT_FAILURE"; + PickResultType[PickResultType["DROP"] = 3] = "DROP"; +})(PickResultType || (exports.PickResultType = PickResultType = {})); +/** + * A standard picker representing a load balancer in the TRANSIENT_FAILURE + * state. Always responds to every pick request with an UNAVAILABLE status. + */ +class UnavailablePicker { + constructor(status) { + this.status = Object.assign({ code: constants_1.Status.UNAVAILABLE, details: 'No connection established', metadata: new metadata_1.Metadata() }, status); + } + pick(pickArgs) { + return { + pickResultType: PickResultType.TRANSIENT_FAILURE, + subchannel: null, + status: this.status, + onCallStarted: null, + onCallEnded: null, + }; + } +} +exports.UnavailablePicker = UnavailablePicker; +/** + * A standard picker representing a load balancer in the IDLE or CONNECTING + * state. Always responds to every pick request with a QUEUE pick result + * indicating that the pick should be tried again with the next `Picker`. Also + * reports back to the load balancer that a connection should be established + * once any pick is attempted. + * If the childPicker is provided, delegate to it instead of returning the + * hardcoded QUEUE pick result, but still calls exitIdle. + */ +class QueuePicker { + // Constructed with a load balancer. Calls exitIdle on it the first time pick is called + constructor(loadBalancer, childPicker) { + this.loadBalancer = loadBalancer; + this.childPicker = childPicker; + this.calledExitIdle = false; + } + pick(pickArgs) { + if (!this.calledExitIdle) { + process.nextTick(() => { + this.loadBalancer.exitIdle(); + }); + this.calledExitIdle = true; + } + if (this.childPicker) { + return this.childPicker.pick(pickArgs); + } + else { + return { + pickResultType: PickResultType.QUEUE, + subchannel: null, + status: null, + onCallStarted: null, + onCallEnded: null, + }; + } + } +} +exports.QueuePicker = QueuePicker; +//# sourceMappingURL=picker.js.map + +/***/ }), + +/***/ 54886: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.setup = exports.DEFAULT_PORT = void 0; +const resolver_1 = __nccwpck_require__(31594); +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 backoff_timeout_1 = __nccwpck_require__(34186); +const TRACER_NAME = 'dns_resolver'; +function trace(text) { + logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text); +} +/** + * The default TCP port to connect to if not explicitly specified in the target. + */ +exports.DEFAULT_PORT = 443; +const DEFAULT_MIN_TIME_BETWEEN_RESOLUTIONS_MS = 30000; +const resolveTxtPromise = util.promisify(dns.resolveTxt); +const dnsLookupPromise = util.promisify(dns.lookup); +/** + * Resolver implementation that handles DNS names and IP addresses. + */ +class DnsResolver { + constructor(target, listener, channelOptions) { + var _a, _b, _c; + this.target = target; + this.listener = listener; + this.pendingLookupPromise = null; + this.pendingTxtPromise = null; + this.latestLookupResult = null; + this.latestServiceConfig = null; + this.latestServiceConfigError = null; + this.continueResolving = false; + this.isNextResolutionTimerRunning = false; + this.isServiceConfigEnabled = true; + this.returnedIpResult = false; + trace('Resolver constructed for target ' + (0, uri_parser_1.uriToString)(target)); + const hostPort = (0, uri_parser_1.splitHostPort)(target.path); + if (hostPort === null) { + this.ipResult = null; + this.dnsHostname = null; + this.port = null; + } + else { + if ((0, net_1.isIPv4)(hostPort.host) || (0, net_1.isIPv6)(hostPort.host)) { + this.ipResult = [ + { + addresses: [ + { + host: hostPort.host, + port: (_a = hostPort.port) !== null && _a !== void 0 ? _a : exports.DEFAULT_PORT, + }, + ], + }, + ]; + this.dnsHostname = null; + this.port = null; + } + else { + this.ipResult = null; + this.dnsHostname = hostPort.host; + this.port = (_b = hostPort.port) !== null && _b !== void 0 ? _b : exports.DEFAULT_PORT; + } + } + this.percentage = Math.random() * 100; + if (channelOptions['grpc.service_config_disable_resolution'] === 1) { + this.isServiceConfigEnabled = false; + } + this.defaultResolutionError = { + code: constants_1.Status.UNAVAILABLE, + details: `Name resolution failed for target ${(0, uri_parser_1.uriToString)(this.target)}`, + metadata: new metadata_1.Metadata(), + }; + const backoffOptions = { + initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'], + maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'], + }; + this.backoff = new backoff_timeout_1.BackoffTimeout(() => { + if (this.continueResolving) { + this.startResolutionWithBackoff(); + } + }, backoffOptions); + this.backoff.unref(); + this.minTimeBetweenResolutionsMs = + (_c = channelOptions['grpc.dns_min_time_between_resolutions_ms']) !== null && _c !== void 0 ? _c : DEFAULT_MIN_TIME_BETWEEN_RESOLUTIONS_MS; + this.nextResolutionTimer = setTimeout(() => { }, 0); + clearTimeout(this.nextResolutionTimer); + } + /** + * If the target is an IP address, just provide that address as a result. + * Otherwise, initiate A, AAAA, and TXT lookups + */ + startResolution() { + if (this.ipResult !== null) { + if (!this.returnedIpResult) { + trace('Returning IP address for target ' + (0, uri_parser_1.uriToString)(this.target)); + setImmediate(() => { + this.listener.onSuccessfulResolution(this.ipResult, null, null, null, {}); + }); + this.returnedIpResult = true; + } + this.backoff.stop(); + this.backoff.reset(); + this.stopNextResolutionTimer(); + return; + } + if (this.dnsHostname === null) { + trace('Failed to parse DNS address ' + (0, uri_parser_1.uriToString)(this.target)); + setImmediate(() => { + this.listener.onError({ + code: constants_1.Status.UNAVAILABLE, + details: `Failed to parse DNS address ${(0, uri_parser_1.uriToString)(this.target)}`, + metadata: new metadata_1.Metadata(), + }); + }); + this.stopNextResolutionTimer(); + } + else { + if (this.pendingLookupPromise !== null) { + return; + } + trace('Looking up DNS hostname ' + this.dnsHostname); + /* We clear out latestLookupResult here to ensure that it contains the + * latest result since the last time we started resolving. That way, the + * TXT resolution handler can use it, but only if it finishes second. We + * don't clear out any previous service config results because it's + * better to use a service config that's slightly out of date than to + * revert to an effectively blank one. */ + this.latestLookupResult = null; + const hostname = this.dnsHostname; + /* We lookup both address families here and then split them up later + * because when looking up a single family, dns.lookup outputs an error + * if the name exists but there are no records for that family, and that + * error is indistinguishable from other kinds of errors */ + this.pendingLookupPromise = dnsLookupPromise(hostname, { all: true }); + this.pendingLookupPromise.then(addressList => { + if (this.pendingLookupPromise === null) { + return; + } + this.pendingLookupPromise = null; + this.backoff.reset(); + this.backoff.stop(); + const subchannelAddresses = addressList.map(addr => ({ host: addr.address, port: +this.port })); + this.latestLookupResult = subchannelAddresses.map(address => ({ + addresses: [address], + })); + const allAddressesString = '[' + + subchannelAddresses + .map(addr => addr.host + ':' + addr.port) + .join(',') + + ']'; + trace('Resolved addresses for target ' + + (0, uri_parser_1.uriToString)(this.target) + + ': ' + + allAddressesString); + if (this.latestLookupResult.length === 0) { + this.listener.onError(this.defaultResolutionError); + return; + } + /* If the TXT lookup has not yet finished, both of the last two + * arguments will be null, which is the equivalent of getting an + * empty TXT response. When the TXT lookup does finish, its handler + * can update the service config by using the same address list */ + this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {}); + }, err => { + if (this.pendingLookupPromise === null) { + return; + } + trace('Resolution error for target ' + + (0, uri_parser_1.uriToString)(this.target) + + ': ' + + err.message); + this.pendingLookupPromise = null; + this.stopNextResolutionTimer(); + this.listener.onError(this.defaultResolutionError); + }); + /* If there already is a still-pending TXT resolution, we can just use + * that result when it comes in */ + if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) { + /* We handle the TXT query promise differently than the others because + * the name resolution attempt as a whole is a success even if the TXT + * lookup fails */ + this.pendingTxtPromise = resolveTxtPromise(hostname); + this.pendingTxtPromise.then(txtRecord => { + if (this.pendingTxtPromise === null) { + return; + } + this.pendingTxtPromise = null; + try { + this.latestServiceConfig = (0, service_config_1.extractAndSelectServiceConfig)(txtRecord, this.percentage); + } + catch (err) { + this.latestServiceConfigError = { + code: constants_1.Status.UNAVAILABLE, + details: `Parsing service config failed with error ${err.message}`, + metadata: new metadata_1.Metadata(), + }; + } + if (this.latestLookupResult !== null) { + /* We rely here on the assumption that calling this function with + * identical parameters will be essentialy idempotent, and calling + * it with the same address list and a different service config + * should result in a fast and seamless switchover. */ + this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {}); + } + }, err => { + /* If TXT lookup fails we should do nothing, which means that we + * continue to use the result of the most recent successful lookup, + * or the default null config object if there has never been a + * successful lookup. We do not set the latestServiceConfigError + * here because that is specifically used for response validation + * errors. We still need to handle this error so that it does not + * bubble up as an unhandled promise rejection. */ + }); + } + } + } + startNextResolutionTimer() { + var _a, _b; + clearTimeout(this.nextResolutionTimer); + this.nextResolutionTimer = setTimeout(() => { + this.stopNextResolutionTimer(); + if (this.continueResolving) { + this.startResolutionWithBackoff(); + } + }, this.minTimeBetweenResolutionsMs); + (_b = (_a = this.nextResolutionTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + this.isNextResolutionTimerRunning = true; + } + stopNextResolutionTimer() { + clearTimeout(this.nextResolutionTimer); + this.isNextResolutionTimerRunning = false; + } + startResolutionWithBackoff() { + if (this.pendingLookupPromise === null) { + this.continueResolving = false; + this.backoff.runOnce(); + this.startNextResolutionTimer(); + this.startResolution(); + } + } + updateResolution() { + /* If there is a pending lookup, just let it finish. Otherwise, if the + * nextResolutionTimer or backoff timer is running, set the + * continueResolving flag to resolve when whichever of those timers + * fires. Otherwise, start resolving immediately. */ + if (this.pendingLookupPromise === null) { + if (this.isNextResolutionTimerRunning || this.backoff.isRunning()) { + if (this.isNextResolutionTimerRunning) { + trace('resolution update delayed by "min time between resolutions" rate limit'); + } + else { + trace('resolution update delayed by backoff timer until ' + + this.backoff.getEndTime().toISOString()); + } + this.continueResolving = true; + } + else { + this.startResolutionWithBackoff(); + } + } + } + /** + * Reset the resolver to the same state it had when it was created. In-flight + * DNS requests cannot be cancelled, but they are discarded and their results + * will be ignored. + */ + destroy() { + this.continueResolving = false; + this.backoff.reset(); + this.backoff.stop(); + this.stopNextResolutionTimer(); + this.pendingLookupPromise = null; + this.pendingTxtPromise = null; + this.latestLookupResult = null; + this.latestServiceConfig = null; + this.latestServiceConfigError = null; + this.returnedIpResult = false; + } + /** + * Get the default authority for the given target. For IP targets, that is + * the IP address. For DNS targets, it is the hostname. + * @param target + */ + static getDefaultAuthority(target) { + return target.path; + } +} +/** + * Set up the DNS resolver class by registering it as the handler for the + * "dns:" prefix and as the default resolver. + */ +function setup() { + (0, resolver_1.registerResolver)('dns', DnsResolver); + (0, resolver_1.registerDefaultScheme)('dns'); +} +exports.setup = setup; +//# sourceMappingURL=resolver-dns.js.map + +/***/ }), + +/***/ 97902: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2021 gRPC authors. + * + * 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 })); +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 TRACER_NAME = 'ip_resolver'; +function trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); +} +const IPV4_SCHEME = 'ipv4'; +const IPV6_SCHEME = 'ipv6'; +/** + * The default TCP port to connect to if not explicitly specified in the target. + */ +const DEFAULT_PORT = 443; +class IpResolver { + constructor(target, listener, channelOptions) { + var _a; + this.listener = listener; + this.endpoints = []; + this.error = null; + this.hasReturnedResult = false; + trace('Resolver constructed for target ' + (0, uri_parser_1.uriToString)(target)); + const addresses = []; + if (!(target.scheme === IPV4_SCHEME || target.scheme === IPV6_SCHEME)) { + this.error = { + code: constants_1.Status.UNAVAILABLE, + details: `Unrecognized scheme ${target.scheme} in IP resolver`, + metadata: new metadata_1.Metadata(), + }; + return; + } + const pathList = target.path.split(','); + for (const path of pathList) { + const hostPort = (0, uri_parser_1.splitHostPort)(path); + if (hostPort === null) { + this.error = { + code: constants_1.Status.UNAVAILABLE, + details: `Failed to parse ${target.scheme} address ${path}`, + metadata: new metadata_1.Metadata(), + }; + return; + } + if ((target.scheme === IPV4_SCHEME && !(0, net_1.isIPv4)(hostPort.host)) || + (target.scheme === IPV6_SCHEME && !(0, net_1.isIPv6)(hostPort.host))) { + this.error = { + code: constants_1.Status.UNAVAILABLE, + details: `Failed to parse ${target.scheme} address ${path}`, + metadata: new metadata_1.Metadata(), + }; + return; + } + addresses.push({ + host: hostPort.host, + port: (_a = hostPort.port) !== null && _a !== void 0 ? _a : DEFAULT_PORT, + }); + } + this.endpoints = addresses.map(address => ({ addresses: [address] })); + trace('Parsed ' + target.scheme + ' address list ' + addresses); + } + updateResolution() { + if (!this.hasReturnedResult) { + this.hasReturnedResult = true; + process.nextTick(() => { + if (this.error) { + this.listener.onError(this.error); + } + else { + this.listener.onSuccessfulResolution(this.endpoints, null, null, null, {}); + } + }); + } + } + destroy() { + this.hasReturnedResult = false; + } + static getDefaultAuthority(target) { + return target.path.split(',')[0]; + } +} +function setup() { + (0, resolver_1.registerResolver)(IPV4_SCHEME, IpResolver); + (0, resolver_1.registerResolver)(IPV6_SCHEME, IpResolver); +} +exports.setup = setup; +//# sourceMappingURL=resolver-ip.js.map + +/***/ }), + +/***/ 5252: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.setup = void 0; +const resolver_1 = __nccwpck_require__(31594); +class UdsResolver { + constructor(target, listener, channelOptions) { + this.listener = listener; + this.hasReturnedResult = false; + this.endpoints = []; + let path; + if (target.authority === '') { + path = '/' + target.path; + } + else { + path = target.path; + } + this.endpoints = [{ addresses: [{ path }] }]; + } + updateResolution() { + if (!this.hasReturnedResult) { + this.hasReturnedResult = true; + process.nextTick(this.listener.onSuccessfulResolution, this.endpoints, null, null, null, {}); + } + } + destroy() { + this.hasReturnedResult = false; + } + static getDefaultAuthority(target) { + return 'localhost'; + } +} +function setup() { + (0, resolver_1.registerResolver)('unix', UdsResolver); +} +exports.setup = setup; +//# sourceMappingURL=resolver-uds.js.map + +/***/ }), + +/***/ 31594: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.mapUriDefaultScheme = exports.getDefaultAuthority = exports.createResolver = exports.registerDefaultScheme = exports.registerResolver = void 0; +const uri_parser_1 = __nccwpck_require__(65974); +const registeredResolvers = {}; +let defaultScheme = null; +/** + * Register a resolver class to handle target names prefixed with the `prefix` + * string. This prefix should correspond to a URI scheme name listed in the + * [gRPC Name Resolution document](https://github.com/grpc/grpc/blob/master/doc/naming.md) + * @param prefix + * @param resolverClass + */ +function registerResolver(scheme, resolverClass) { + registeredResolvers[scheme] = resolverClass; +} +exports.registerResolver = registerResolver; +/** + * Register a default resolver to handle target names that do not start with + * any registered prefix. + * @param resolverClass + */ +function registerDefaultScheme(scheme) { + defaultScheme = scheme; +} +exports.registerDefaultScheme = registerDefaultScheme; +/** + * Create a name resolver for the specified target, if possible. Throws an + * error if no such name resolver can be created. + * @param target + * @param listener + */ +function createResolver(target, listener, options) { + if (target.scheme !== undefined && target.scheme in registeredResolvers) { + return new registeredResolvers[target.scheme](target, listener, options); + } + else { + throw new Error(`No resolver could be created for target ${(0, uri_parser_1.uriToString)(target)}`); + } +} +exports.createResolver = createResolver; +/** + * Get the default authority for the specified target, if possible. Throws an + * error if no registered name resolver can parse that target string. + * @param target + */ +function getDefaultAuthority(target) { + if (target.scheme !== undefined && target.scheme in registeredResolvers) { + return registeredResolvers[target.scheme].getDefaultAuthority(target); + } + else { + throw new Error(`Invalid target ${(0, uri_parser_1.uriToString)(target)}`); + } +} +exports.getDefaultAuthority = getDefaultAuthority; +function mapUriDefaultScheme(target) { + if (target.scheme === undefined || !(target.scheme in registeredResolvers)) { + if (defaultScheme !== null) { + return { + scheme: defaultScheme, + authority: undefined, + path: (0, uri_parser_1.uriToString)(target), + }; + } + else { + return null; + } + } + return target; +} +exports.mapUriDefaultScheme = mapUriDefaultScheme; +//# sourceMappingURL=resolver.js.map + +/***/ }), + +/***/ 39909: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.ResolvingCall = void 0; +const constants_1 = __nccwpck_require__(90634); +const deadline_1 = __nccwpck_require__(511); +const metadata_1 = __nccwpck_require__(83665); +const logging = __nccwpck_require__(35993); +const control_plane_status_1 = __nccwpck_require__(39129); +const TRACER_NAME = 'resolving_call'; +class ResolvingCall { + constructor(channel, method, options, filterStackFactory, credentials, callNumber) { + this.channel = channel; + this.method = method; + this.filterStackFactory = filterStackFactory; + this.credentials = credentials; + this.callNumber = callNumber; + this.child = null; + this.readPending = false; + this.pendingMessage = null; + this.pendingHalfClose = false; + this.ended = false; + this.readFilterPending = false; + this.writeFilterPending = false; + this.pendingChildStatus = null; + this.metadata = null; + this.listener = null; + this.statusWatchers = []; + this.deadlineTimer = setTimeout(() => { }, 0); + this.filterStack = null; + this.deadlineStartTime = null; + this.configReceivedTime = null; + this.childStartTime = null; + this.deadline = options.deadline; + this.host = options.host; + if (options.parentCall) { + if (options.flags & constants_1.Propagate.CANCELLATION) { + options.parentCall.on('cancelled', () => { + this.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled by parent call'); + }); + } + if (options.flags & constants_1.Propagate.DEADLINE) { + this.trace('Propagating deadline from parent: ' + + options.parentCall.getDeadline()); + this.deadline = (0, deadline_1.minDeadline)(this.deadline, options.parentCall.getDeadline()); + } + } + this.trace('Created'); + this.runDeadlineTimer(); + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text); + } + runDeadlineTimer() { + clearTimeout(this.deadlineTimer); + this.deadlineStartTime = new Date(); + this.trace('Deadline: ' + (0, deadline_1.deadlineToString)(this.deadline)); + const timeout = (0, deadline_1.getRelativeTimeout)(this.deadline); + if (timeout !== Infinity) { + this.trace('Deadline will be reached in ' + timeout + 'ms'); + const handleDeadline = () => { + if (!this.deadlineStartTime) { + this.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, 'Deadline exceeded'); + return; + } + const deadlineInfo = []; + const deadlineEndTime = new Date(); + deadlineInfo.push(`Deadline exceeded after ${(0, deadline_1.formatDateDifference)(this.deadlineStartTime, deadlineEndTime)}`); + if (this.configReceivedTime) { + if (this.configReceivedTime > this.deadlineStartTime) { + deadlineInfo.push(`name resolution: ${(0, deadline_1.formatDateDifference)(this.deadlineStartTime, this.configReceivedTime)}`); + } + if (this.childStartTime) { + if (this.childStartTime > this.configReceivedTime) { + deadlineInfo.push(`metadata filters: ${(0, deadline_1.formatDateDifference)(this.configReceivedTime, this.childStartTime)}`); + } + } + else { + deadlineInfo.push('waiting for metadata filters'); + } + } + else { + deadlineInfo.push('waiting for name resolution'); + } + if (this.child) { + deadlineInfo.push(...this.child.getDeadlineInfo()); + } + this.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, deadlineInfo.join(',')); + }; + if (timeout <= 0) { + process.nextTick(handleDeadline); + } + else { + this.deadlineTimer = setTimeout(handleDeadline, timeout); + } + } + } + outputStatus(status) { + if (!this.ended) { + this.ended = true; + if (!this.filterStack) { + this.filterStack = this.filterStackFactory.createFilter(); + } + clearTimeout(this.deadlineTimer); + const filteredStatus = this.filterStack.receiveTrailers(status); + this.trace('ended with status: code=' + + filteredStatus.code + + ' details="' + + filteredStatus.details + + '"'); + this.statusWatchers.forEach(watcher => watcher(filteredStatus)); + process.nextTick(() => { + var _a; + (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus(filteredStatus); + }); + } + } + sendMessageOnChild(context, message) { + if (!this.child) { + throw new Error('sendMessageonChild called with child not populated'); + } + const child = this.child; + this.writeFilterPending = true; + this.filterStack.sendMessage(Promise.resolve({ message: message, flags: context.flags })).then(filteredMessage => { + this.writeFilterPending = false; + child.sendMessageWithContext(context, filteredMessage.message); + if (this.pendingHalfClose) { + child.halfClose(); + } + }, (status) => { + this.cancelWithStatus(status.code, status.details); + }); + } + getConfig() { + if (this.ended) { + return; + } + if (!this.metadata || !this.listener) { + throw new Error('getConfig called before start'); + } + const configResult = this.channel.getConfig(this.method, this.metadata); + if (configResult.type === 'NONE') { + this.channel.queueCallForConfig(this); + return; + } + else if (configResult.type === 'ERROR') { + if (this.metadata.getOptions().waitForReady) { + this.channel.queueCallForConfig(this); + } + else { + this.outputStatus(configResult.error); + } + return; + } + // configResult.type === 'SUCCESS' + this.configReceivedTime = new Date(); + const config = configResult.config; + if (config.status !== constants_1.Status.OK) { + const { code, details } = (0, control_plane_status_1.restrictControlPlaneStatusCode)(config.status, 'Failed to route call to method ' + this.method); + this.outputStatus({ + code: code, + details: details, + metadata: new metadata_1.Metadata(), + }); + return; + } + if (config.methodConfig.timeout) { + const configDeadline = new Date(); + configDeadline.setSeconds(configDeadline.getSeconds() + config.methodConfig.timeout.seconds); + configDeadline.setMilliseconds(configDeadline.getMilliseconds() + + config.methodConfig.timeout.nanos / 1000000); + this.deadline = (0, deadline_1.minDeadline)(this.deadline, configDeadline); + this.runDeadlineTimer(); + } + this.filterStackFactory.push(config.dynamicFilterFactories); + this.filterStack = this.filterStackFactory.createFilter(); + this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(filteredMetadata => { + this.child = this.channel.createInnerCall(config, this.method, this.host, this.credentials, this.deadline); + this.trace('Created child [' + this.child.getCallNumber() + ']'); + this.childStartTime = new Date(); + this.child.start(filteredMetadata, { + onReceiveMetadata: metadata => { + this.trace('Received metadata'); + this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(metadata)); + }, + onReceiveMessage: message => { + this.trace('Received message'); + this.readFilterPending = true; + this.filterStack.receiveMessage(message).then(filteredMesssage => { + this.trace('Finished filtering received message'); + this.readFilterPending = false; + this.listener.onReceiveMessage(filteredMesssage); + if (this.pendingChildStatus) { + this.outputStatus(this.pendingChildStatus); + } + }, (status) => { + this.cancelWithStatus(status.code, status.details); + }); + }, + onReceiveStatus: status => { + this.trace('Received status'); + if (this.readFilterPending) { + this.pendingChildStatus = status; + } + else { + this.outputStatus(status); + } + }, + }); + if (this.readPending) { + this.child.startRead(); + } + if (this.pendingMessage) { + this.sendMessageOnChild(this.pendingMessage.context, this.pendingMessage.message); + } + else if (this.pendingHalfClose) { + this.child.halfClose(); + } + }, (status) => { + this.outputStatus(status); + }); + } + reportResolverError(status) { + var _a; + if ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.getOptions().waitForReady) { + this.channel.queueCallForConfig(this); + } + else { + this.outputStatus(status); + } + } + cancelWithStatus(status, details) { + var _a; + this.trace('cancelWithStatus code: ' + status + ' details: "' + details + '"'); + (_a = this.child) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(status, details); + this.outputStatus({ + code: status, + details: details, + metadata: new metadata_1.Metadata(), + }); + } + getPeer() { + var _a, _b; + return (_b = (_a = this.child) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : this.channel.getTarget(); + } + start(metadata, listener) { + this.trace('start called'); + this.metadata = metadata.clone(); + this.listener = listener; + this.getConfig(); + } + sendMessageWithContext(context, message) { + this.trace('write() called with message of length ' + message.length); + if (this.child) { + this.sendMessageOnChild(context, message); + } + else { + this.pendingMessage = { context, message }; + } + } + startRead() { + this.trace('startRead called'); + if (this.child) { + this.child.startRead(); + } + else { + this.readPending = true; + } + } + halfClose() { + this.trace('halfClose called'); + if (this.child && !this.writeFilterPending) { + this.child.halfClose(); + } + else { + this.pendingHalfClose = true; + } + } + setCredentials(credentials) { + this.credentials = this.credentials.compose(credentials); + } + addStatusWatcher(watcher) { + this.statusWatchers.push(watcher); + } + getCallNumber() { + return this.callNumber; + } +} +exports.ResolvingCall = ResolvingCall; +//# sourceMappingURL=resolving-call.js.map + +/***/ }), + +/***/ 19192: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.ResolvingLoadBalancer = void 0; +const load_balancer_1 = __nccwpck_require__(52680); +const service_config_1 = __nccwpck_require__(21761); +const connectivity_state_1 = __nccwpck_require__(80878); +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 TRACER_NAME = 'resolving_load_balancer'; +function trace(text) { + logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text); +} +/** + * Name match levels in order from most to least specific. This is the order in + * which searches will be performed. + */ +const NAME_MATCH_LEVEL_ORDER = [ + 'SERVICE_AND_METHOD', + 'SERVICE', + 'EMPTY', +]; +function hasMatchingName(service, method, methodConfig, matchLevel) { + for (const name of methodConfig.name) { + switch (matchLevel) { + case 'EMPTY': + if (!name.service && !name.method) { + return true; + } + break; + case 'SERVICE': + if (name.service === service && !name.method) { + return true; + } + break; + case 'SERVICE_AND_METHOD': + if (name.service === service && name.method === method) { + return true; + } + } + } + return false; +} +function findMatchingConfig(service, method, methodConfigs, matchLevel) { + for (const config of methodConfigs) { + if (hasMatchingName(service, method, config, matchLevel)) { + return config; + } + } + return null; +} +function getDefaultConfigSelector(serviceConfig) { + return function defaultConfigSelector(methodName, metadata) { + var _a, _b; + const splitName = methodName.split('/').filter(x => x.length > 0); + const service = (_a = splitName[0]) !== null && _a !== void 0 ? _a : ''; + const method = (_b = splitName[1]) !== null && _b !== void 0 ? _b : ''; + if (serviceConfig && serviceConfig.methodConfig) { + /* Check for the following in order, and return the first method + * config that matches: + * 1. A name that exactly matches the service and method + * 2. A name with no method set that matches the service + * 3. An empty name + */ + for (const matchLevel of NAME_MATCH_LEVEL_ORDER) { + const matchingConfig = findMatchingConfig(service, method, serviceConfig.methodConfig, matchLevel); + if (matchingConfig) { + return { + methodConfig: matchingConfig, + pickInformation: {}, + status: constants_1.Status.OK, + dynamicFilterFactories: [], + }; + } + } + } + return { + methodConfig: { name: [] }, + pickInformation: {}, + status: constants_1.Status.OK, + dynamicFilterFactories: [], + }; + }; +} +class ResolvingLoadBalancer { + /** + * Wrapper class that behaves like a `LoadBalancer` and also handles name + * resolution internally. + * @param target The address of the backend to connect to. + * @param channelControlHelper `ChannelControlHelper` instance provided by + * this load balancer's owner. + * @param defaultServiceConfig The default service configuration to be used + * if none is provided by the name resolver. A `null` value indicates + * that the default behavior should be the default unconfigured behavior. + * In practice, that means using the "pick first" load balancer + * implmentation + */ + constructor(target, channelControlHelper, channelOptions, onSuccessfulResolution, onFailedResolution) { + this.target = target; + this.channelControlHelper = channelControlHelper; + this.onSuccessfulResolution = onSuccessfulResolution; + this.onFailedResolution = onFailedResolution; + this.latestChildState = connectivity_state_1.ConnectivityState.IDLE; + this.latestChildPicker = new picker_1.QueuePicker(this); + /** + * This resolving load balancer's current connectivity state. + */ + this.currentState = connectivity_state_1.ConnectivityState.IDLE; + /** + * The service config object from the last successful resolution, if + * available. A value of null indicates that we have not yet received a valid + * service config from the resolver. + */ + this.previousServiceConfig = null; + /** + * Indicates whether we should attempt to resolve again after the backoff + * timer runs out. + */ + this.continueResolving = false; + if (channelOptions['grpc.service_config']) { + this.defaultServiceConfig = (0, service_config_1.validateServiceConfig)(JSON.parse(channelOptions['grpc.service_config'])); + } + else { + this.defaultServiceConfig = { + loadBalancingConfig: [], + methodConfig: [], + }; + } + this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); + this.childLoadBalancer = new load_balancer_child_handler_1.ChildLoadBalancerHandler({ + createSubchannel: channelControlHelper.createSubchannel.bind(channelControlHelper), + requestReresolution: () => { + /* If the backoffTimeout is running, we're still backing off from + * making resolve requests, so we shouldn't make another one here. + * In that case, the backoff timer callback will call + * updateResolution */ + if (this.backoffTimeout.isRunning()) { + trace('requestReresolution delayed by backoff timer until ' + + this.backoffTimeout.getEndTime().toISOString()); + this.continueResolving = true; + } + else { + this.updateResolution(); + } + }, + updateState: (newState, picker) => { + this.latestChildState = newState; + this.latestChildPicker = picker; + this.updateState(newState, picker); + }, + addChannelzChild: channelControlHelper.addChannelzChild.bind(channelControlHelper), + removeChannelzChild: channelControlHelper.removeChannelzChild.bind(channelControlHelper), + }, channelOptions); + this.innerResolver = (0, resolver_1.createResolver)(target, { + onSuccessfulResolution: (endpointList, serviceConfig, serviceConfigError, configSelector, attributes) => { + var _a; + this.backoffTimeout.stop(); + this.backoffTimeout.reset(); + let workingServiceConfig = null; + /* This first group of conditionals implements the algorithm described + * in https://github.com/grpc/proposal/blob/master/A21-service-config-error-handling.md + * in the section called "Behavior on receiving a new gRPC Config". + */ + if (serviceConfig === null) { + // Step 4 and 5 + if (serviceConfigError === null) { + // Step 5 + this.previousServiceConfig = null; + workingServiceConfig = this.defaultServiceConfig; + } + else { + // Step 4 + if (this.previousServiceConfig === null) { + // Step 4.ii + this.handleResolutionFailure(serviceConfigError); + } + else { + // Step 4.i + workingServiceConfig = this.previousServiceConfig; + } + } + } + else { + // Step 3 + workingServiceConfig = serviceConfig; + this.previousServiceConfig = serviceConfig; + } + const workingConfigList = (_a = workingServiceConfig === null || workingServiceConfig === void 0 ? void 0 : workingServiceConfig.loadBalancingConfig) !== null && _a !== void 0 ? _a : []; + const loadBalancingConfig = (0, load_balancer_1.selectLbConfigFromList)(workingConfigList, true); + if (loadBalancingConfig === null) { + // There were load balancing configs but none are supported. This counts as a resolution failure + this.handleResolutionFailure({ + code: constants_1.Status.UNAVAILABLE, + details: 'All load balancer options in service config are not compatible', + metadata: new metadata_1.Metadata(), + }); + return; + } + this.childLoadBalancer.updateAddressList(endpointList, loadBalancingConfig, attributes); + const finalServiceConfig = workingServiceConfig !== null && workingServiceConfig !== void 0 ? workingServiceConfig : this.defaultServiceConfig; + this.onSuccessfulResolution(finalServiceConfig, configSelector !== null && configSelector !== void 0 ? configSelector : getDefaultConfigSelector(finalServiceConfig)); + }, + onError: (error) => { + this.handleResolutionFailure(error); + }, + }, channelOptions); + const backoffOptions = { + initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'], + maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'], + }; + this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => { + if (this.continueResolving) { + this.updateResolution(); + this.continueResolving = false; + } + else { + this.updateState(this.latestChildState, this.latestChildPicker); + } + }, backoffOptions); + this.backoffTimeout.unref(); + } + updateResolution() { + this.innerResolver.updateResolution(); + if (this.currentState === connectivity_state_1.ConnectivityState.IDLE) { + /* this.latestChildPicker is initialized as new QueuePicker(this), which + * is an appropriate value here if the child LB policy is unset. + * Otherwise, we want to delegate to the child here, in case that + * triggers something. */ + this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, this.latestChildPicker); + } + this.backoffTimeout.runOnce(); + } + updateState(connectivityState, picker) { + trace((0, uri_parser_1.uriToString)(this.target) + + ' ' + + connectivity_state_1.ConnectivityState[this.currentState] + + ' -> ' + + connectivity_state_1.ConnectivityState[connectivityState]); + // Ensure that this.exitIdle() is called by the picker + if (connectivityState === connectivity_state_1.ConnectivityState.IDLE) { + picker = new picker_1.QueuePicker(this, picker); + } + this.currentState = connectivityState; + this.channelControlHelper.updateState(connectivityState, picker); + } + handleResolutionFailure(error) { + if (this.latestChildState === connectivity_state_1.ConnectivityState.IDLE) { + this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker(error)); + this.onFailedResolution(error); + } + } + exitIdle() { + if (this.currentState === connectivity_state_1.ConnectivityState.IDLE || + this.currentState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { + if (this.backoffTimeout.isRunning()) { + this.continueResolving = true; + } + else { + this.updateResolution(); + } + } + this.childLoadBalancer.exitIdle(); + } + updateAddressList(endpointList, lbConfig) { + throw new Error('updateAddressList not supported on ResolvingLoadBalancer'); + } + resetBackoff() { + this.backoffTimeout.reset(); + this.childLoadBalancer.resetBackoff(); + } + destroy() { + this.childLoadBalancer.destroy(); + this.innerResolver.destroy(); + this.backoffTimeout.reset(); + this.backoffTimeout.stop(); + this.latestChildState = connectivity_state_1.ConnectivityState.IDLE; + this.latestChildPicker = new picker_1.QueuePicker(this); + this.currentState = connectivity_state_1.ConnectivityState.IDLE; + this.previousServiceConfig = null; + this.continueResolving = false; + } + getTypeName() { + return 'resolving_load_balancer'; + } +} +exports.ResolvingLoadBalancer = ResolvingLoadBalancer; +//# sourceMappingURL=resolving-load-balancer.js.map + +/***/ }), + +/***/ 48159: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.RetryingCall = exports.MessageBufferTracker = exports.RetryThrottler = void 0; +const constants_1 = __nccwpck_require__(90634); +const deadline_1 = __nccwpck_require__(511); +const metadata_1 = __nccwpck_require__(83665); +const logging = __nccwpck_require__(35993); +const TRACER_NAME = 'retrying_call'; +class RetryThrottler { + constructor(maxTokens, tokenRatio, previousRetryThrottler) { + this.maxTokens = maxTokens; + this.tokenRatio = tokenRatio; + if (previousRetryThrottler) { + /* When carrying over tokens from a previous config, rescale them to the + * new max value */ + this.tokens = + previousRetryThrottler.tokens * + (maxTokens / previousRetryThrottler.maxTokens); + } + else { + this.tokens = maxTokens; + } + } + addCallSucceeded() { + this.tokens = Math.max(this.tokens + this.tokenRatio, this.maxTokens); + } + addCallFailed() { + this.tokens = Math.min(this.tokens - 1, 0); + } + canRetryCall() { + return this.tokens > this.maxTokens / 2; + } +} +exports.RetryThrottler = RetryThrottler; +class MessageBufferTracker { + constructor(totalLimit, limitPerCall) { + this.totalLimit = totalLimit; + this.limitPerCall = limitPerCall; + this.totalAllocated = 0; + this.allocatedPerCall = new Map(); + } + allocate(size, callId) { + var _a; + const currentPerCall = (_a = this.allocatedPerCall.get(callId)) !== null && _a !== void 0 ? _a : 0; + if (this.limitPerCall - currentPerCall < size || + this.totalLimit - this.totalAllocated < size) { + return false; + } + this.allocatedPerCall.set(callId, currentPerCall + size); + this.totalAllocated += size; + return true; + } + free(size, callId) { + var _a; + if (this.totalAllocated < size) { + throw new Error(`Invalid buffer allocation state: call ${callId} freed ${size} > total allocated ${this.totalAllocated}`); + } + this.totalAllocated -= size; + const currentPerCall = (_a = this.allocatedPerCall.get(callId)) !== null && _a !== void 0 ? _a : 0; + if (currentPerCall < size) { + throw new Error(`Invalid buffer allocation state: call ${callId} freed ${size} > allocated for call ${currentPerCall}`); + } + this.allocatedPerCall.set(callId, currentPerCall - size); + } + freeAll(callId) { + var _a; + const currentPerCall = (_a = this.allocatedPerCall.get(callId)) !== null && _a !== void 0 ? _a : 0; + if (this.totalAllocated < currentPerCall) { + throw new Error(`Invalid buffer allocation state: call ${callId} allocated ${currentPerCall} > total allocated ${this.totalAllocated}`); + } + this.totalAllocated -= currentPerCall; + this.allocatedPerCall.delete(callId); + } +} +exports.MessageBufferTracker = MessageBufferTracker; +const PREVIONS_RPC_ATTEMPTS_METADATA_KEY = 'grpc-previous-rpc-attempts'; +class RetryingCall { + constructor(channel, callConfig, methodName, host, credentials, deadline, callNumber, bufferTracker, retryThrottler) { + this.channel = channel; + this.callConfig = callConfig; + this.methodName = methodName; + this.host = host; + this.credentials = credentials; + this.deadline = deadline; + this.callNumber = callNumber; + this.bufferTracker = bufferTracker; + this.retryThrottler = retryThrottler; + this.listener = null; + this.initialMetadata = null; + this.underlyingCalls = []; + this.writeBuffer = []; + /** + * The offset of message indices in the writeBuffer. For example, if + * writeBufferOffset is 10, message 10 is in writeBuffer[0] and message 15 + * is in writeBuffer[5]. + */ + this.writeBufferOffset = 0; + /** + * Tracks whether a read has been started, so that we know whether to start + * reads on new child calls. This only matters for the first read, because + * once a message comes in the child call becomes committed and there will + * be no new child calls. + */ + this.readStarted = false; + this.transparentRetryUsed = false; + /** + * Number of attempts so far + */ + this.attempts = 0; + this.hedgingTimer = null; + this.committedCallIndex = null; + this.initialRetryBackoffSec = 0; + this.nextRetryBackoffSec = 0; + if (callConfig.methodConfig.retryPolicy) { + this.state = 'RETRY'; + const retryPolicy = callConfig.methodConfig.retryPolicy; + this.nextRetryBackoffSec = this.initialRetryBackoffSec = Number(retryPolicy.initialBackoff.substring(0, retryPolicy.initialBackoff.length - 1)); + } + else if (callConfig.methodConfig.hedgingPolicy) { + this.state = 'HEDGING'; + } + else { + this.state = 'TRANSPARENT_ONLY'; + } + this.startTime = new Date(); + } + getDeadlineInfo() { + if (this.underlyingCalls.length === 0) { + return []; + } + const deadlineInfo = []; + const latestCall = this.underlyingCalls[this.underlyingCalls.length - 1]; + if (this.underlyingCalls.length > 1) { + deadlineInfo.push(`previous attempts: ${this.underlyingCalls.length - 1}`); + } + if (latestCall.startTime > this.startTime) { + deadlineInfo.push(`time to current attempt start: ${(0, deadline_1.formatDateDifference)(this.startTime, latestCall.startTime)}`); + } + deadlineInfo.push(...latestCall.call.getDeadlineInfo()); + return deadlineInfo; + } + getCallNumber() { + return this.callNumber; + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text); + } + reportStatus(statusObject) { + this.trace('ended with status: code=' + + statusObject.code + + ' details="' + + statusObject.details + + '" start time=' + + this.startTime.toISOString()); + this.bufferTracker.freeAll(this.callNumber); + this.writeBufferOffset = this.writeBufferOffset + this.writeBuffer.length; + this.writeBuffer = []; + process.nextTick(() => { + var _a; + // Explicitly construct status object to remove progress field + (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus({ + code: statusObject.code, + details: statusObject.details, + metadata: statusObject.metadata, + }); + }); + } + cancelWithStatus(status, details) { + this.trace('cancelWithStatus code: ' + status + ' details: "' + details + '"'); + this.reportStatus({ code: status, details, metadata: new metadata_1.Metadata() }); + for (const { call } of this.underlyingCalls) { + call.cancelWithStatus(status, details); + } + } + getPeer() { + if (this.committedCallIndex !== null) { + return this.underlyingCalls[this.committedCallIndex].call.getPeer(); + } + else { + return 'unknown'; + } + } + getBufferEntry(messageIndex) { + var _a; + return ((_a = this.writeBuffer[messageIndex - this.writeBufferOffset]) !== null && _a !== void 0 ? _a : { + entryType: 'FREED', + allocated: false, + }); + } + getNextBufferIndex() { + return this.writeBufferOffset + this.writeBuffer.length; + } + clearSentMessages() { + if (this.state !== 'COMMITTED') { + return; + } + const earliestNeededMessageIndex = this.underlyingCalls[this.committedCallIndex].nextMessageToSend; + for (let messageIndex = this.writeBufferOffset; messageIndex < earliestNeededMessageIndex; messageIndex++) { + const bufferEntry = this.getBufferEntry(messageIndex); + if (bufferEntry.allocated) { + this.bufferTracker.free(bufferEntry.message.message.length, this.callNumber); + } + } + this.writeBuffer = this.writeBuffer.slice(earliestNeededMessageIndex - this.writeBufferOffset); + this.writeBufferOffset = earliestNeededMessageIndex; + } + commitCall(index) { + if (this.state === 'COMMITTED') { + return; + } + if (this.underlyingCalls[index].state === 'COMPLETED') { + return; + } + this.trace('Committing call [' + + this.underlyingCalls[index].call.getCallNumber() + + '] at index ' + + index); + this.state = 'COMMITTED'; + this.committedCallIndex = index; + for (let i = 0; i < this.underlyingCalls.length; i++) { + if (i === index) { + continue; + } + if (this.underlyingCalls[i].state === 'COMPLETED') { + continue; + } + this.underlyingCalls[i].state = 'COMPLETED'; + this.underlyingCalls[i].call.cancelWithStatus(constants_1.Status.CANCELLED, 'Discarded in favor of other hedged attempt'); + } + this.clearSentMessages(); + } + commitCallWithMostMessages() { + if (this.state === 'COMMITTED') { + return; + } + let mostMessages = -1; + let callWithMostMessages = -1; + for (const [index, childCall] of this.underlyingCalls.entries()) { + if (childCall.state === 'ACTIVE' && + childCall.nextMessageToSend > mostMessages) { + mostMessages = childCall.nextMessageToSend; + callWithMostMessages = index; + } + } + if (callWithMostMessages === -1) { + /* There are no active calls, disable retries to force the next call that + * is started to be committed. */ + this.state = 'TRANSPARENT_ONLY'; + } + else { + this.commitCall(callWithMostMessages); + } + } + isStatusCodeInList(list, code) { + return list.some(value => value === code || + value.toString().toLowerCase() === constants_1.Status[code].toLowerCase()); + } + getNextRetryBackoffMs() { + var _a; + const retryPolicy = (_a = this.callConfig) === null || _a === void 0 ? void 0 : _a.methodConfig.retryPolicy; + if (!retryPolicy) { + return 0; + } + const nextBackoffMs = Math.random() * this.nextRetryBackoffSec * 1000; + const maxBackoffSec = Number(retryPolicy.maxBackoff.substring(0, retryPolicy.maxBackoff.length - 1)); + this.nextRetryBackoffSec = Math.min(this.nextRetryBackoffSec * retryPolicy.backoffMultiplier, maxBackoffSec); + return nextBackoffMs; + } + maybeRetryCall(pushback, callback) { + if (this.state !== 'RETRY') { + callback(false); + return; + } + const retryPolicy = this.callConfig.methodConfig.retryPolicy; + if (this.attempts >= Math.min(retryPolicy.maxAttempts, 5)) { + callback(false); + return; + } + let retryDelayMs; + if (pushback === null) { + retryDelayMs = this.getNextRetryBackoffMs(); + } + else if (pushback < 0) { + this.state = 'TRANSPARENT_ONLY'; + callback(false); + return; + } + else { + retryDelayMs = pushback; + this.nextRetryBackoffSec = this.initialRetryBackoffSec; + } + setTimeout(() => { + var _a, _b; + if (this.state !== 'RETRY') { + callback(false); + return; + } + if ((_b = (_a = this.retryThrottler) === null || _a === void 0 ? void 0 : _a.canRetryCall()) !== null && _b !== void 0 ? _b : true) { + callback(true); + this.attempts += 1; + this.startNewAttempt(); + } + }, retryDelayMs); + } + countActiveCalls() { + let count = 0; + for (const call of this.underlyingCalls) { + if ((call === null || call === void 0 ? void 0 : call.state) === 'ACTIVE') { + count += 1; + } + } + return count; + } + handleProcessedStatus(status, callIndex, pushback) { + var _a, _b, _c; + switch (this.state) { + case 'COMMITTED': + case 'TRANSPARENT_ONLY': + this.commitCall(callIndex); + this.reportStatus(status); + break; + case 'HEDGING': + if (this.isStatusCodeInList((_a = this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes) !== null && _a !== void 0 ? _a : [], status.code)) { + (_b = this.retryThrottler) === null || _b === void 0 ? void 0 : _b.addCallFailed(); + let delayMs; + if (pushback === null) { + delayMs = 0; + } + else if (pushback < 0) { + this.state = 'TRANSPARENT_ONLY'; + this.commitCall(callIndex); + this.reportStatus(status); + return; + } + else { + delayMs = pushback; + } + setTimeout(() => { + this.maybeStartHedgingAttempt(); + // If after trying to start a call there are no active calls, this was the last one + if (this.countActiveCalls() === 0) { + this.commitCall(callIndex); + this.reportStatus(status); + } + }, delayMs); + } + else { + this.commitCall(callIndex); + this.reportStatus(status); + } + break; + case 'RETRY': + if (this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes, status.code)) { + (_c = this.retryThrottler) === null || _c === void 0 ? void 0 : _c.addCallFailed(); + this.maybeRetryCall(pushback, retried => { + if (!retried) { + this.commitCall(callIndex); + this.reportStatus(status); + } + }); + } + else { + this.commitCall(callIndex); + this.reportStatus(status); + } + break; + } + } + getPushback(metadata) { + const mdValue = metadata.get('grpc-retry-pushback-ms'); + if (mdValue.length === 0) { + return null; + } + try { + return parseInt(mdValue[0]); + } + catch (e) { + return -1; + } + } + handleChildStatus(status, callIndex) { + var _a; + if (this.underlyingCalls[callIndex].state === 'COMPLETED') { + return; + } + this.trace('state=' + + this.state + + ' handling status with progress ' + + status.progress + + ' from child [' + + this.underlyingCalls[callIndex].call.getCallNumber() + + '] in state ' + + this.underlyingCalls[callIndex].state); + this.underlyingCalls[callIndex].state = 'COMPLETED'; + if (status.code === constants_1.Status.OK) { + (_a = this.retryThrottler) === null || _a === void 0 ? void 0 : _a.addCallSucceeded(); + this.commitCall(callIndex); + this.reportStatus(status); + return; + } + if (this.state === 'COMMITTED') { + this.reportStatus(status); + return; + } + const pushback = this.getPushback(status.metadata); + switch (status.progress) { + case 'NOT_STARTED': + // RPC never leaves the client, always safe to retry + this.startNewAttempt(); + break; + case 'REFUSED': + // RPC reaches the server library, but not the server application logic + if (this.transparentRetryUsed) { + this.handleProcessedStatus(status, callIndex, pushback); + } + else { + this.transparentRetryUsed = true; + this.startNewAttempt(); + } + break; + case 'DROP': + this.commitCall(callIndex); + this.reportStatus(status); + break; + case 'PROCESSED': + this.handleProcessedStatus(status, callIndex, pushback); + break; + } + } + maybeStartHedgingAttempt() { + if (this.state !== 'HEDGING') { + return; + } + if (!this.callConfig.methodConfig.hedgingPolicy) { + return; + } + const hedgingPolicy = this.callConfig.methodConfig.hedgingPolicy; + if (this.attempts >= Math.min(hedgingPolicy.maxAttempts, 5)) { + return; + } + this.attempts += 1; + this.startNewAttempt(); + this.maybeStartHedgingTimer(); + } + maybeStartHedgingTimer() { + var _a, _b, _c; + if (this.hedgingTimer) { + clearTimeout(this.hedgingTimer); + } + if (this.state !== 'HEDGING') { + return; + } + if (!this.callConfig.methodConfig.hedgingPolicy) { + return; + } + const hedgingPolicy = this.callConfig.methodConfig.hedgingPolicy; + if (this.attempts >= Math.min(hedgingPolicy.maxAttempts, 5)) { + return; + } + const hedgingDelayString = (_a = hedgingPolicy.hedgingDelay) !== null && _a !== void 0 ? _a : '0s'; + const hedgingDelaySec = Number(hedgingDelayString.substring(0, hedgingDelayString.length - 1)); + this.hedgingTimer = setTimeout(() => { + this.maybeStartHedgingAttempt(); + }, hedgingDelaySec * 1000); + (_c = (_b = this.hedgingTimer).unref) === null || _c === void 0 ? void 0 : _c.call(_b); + } + startNewAttempt() { + const child = this.channel.createLoadBalancingCall(this.callConfig, this.methodName, this.host, this.credentials, this.deadline); + this.trace('Created child call [' + + child.getCallNumber() + + '] for attempt ' + + this.attempts); + const index = this.underlyingCalls.length; + this.underlyingCalls.push({ + state: 'ACTIVE', + call: child, + nextMessageToSend: 0, + startTime: new Date() + }); + const previousAttempts = this.attempts - 1; + const initialMetadata = this.initialMetadata.clone(); + if (previousAttempts > 0) { + initialMetadata.set(PREVIONS_RPC_ATTEMPTS_METADATA_KEY, `${previousAttempts}`); + } + let receivedMetadata = false; + child.start(initialMetadata, { + onReceiveMetadata: metadata => { + this.trace('Received metadata from child [' + child.getCallNumber() + ']'); + this.commitCall(index); + receivedMetadata = true; + if (previousAttempts > 0) { + metadata.set(PREVIONS_RPC_ATTEMPTS_METADATA_KEY, `${previousAttempts}`); + } + if (this.underlyingCalls[index].state === 'ACTIVE') { + this.listener.onReceiveMetadata(metadata); + } + }, + onReceiveMessage: message => { + this.trace('Received message from child [' + child.getCallNumber() + ']'); + this.commitCall(index); + if (this.underlyingCalls[index].state === 'ACTIVE') { + this.listener.onReceiveMessage(message); + } + }, + onReceiveStatus: status => { + this.trace('Received status from child [' + child.getCallNumber() + ']'); + if (!receivedMetadata && previousAttempts > 0) { + status.metadata.set(PREVIONS_RPC_ATTEMPTS_METADATA_KEY, `${previousAttempts}`); + } + this.handleChildStatus(status, index); + }, + }); + this.sendNextChildMessage(index); + if (this.readStarted) { + child.startRead(); + } + } + start(metadata, listener) { + this.trace('start called'); + this.listener = listener; + this.initialMetadata = metadata; + this.attempts += 1; + this.startNewAttempt(); + this.maybeStartHedgingTimer(); + } + handleChildWriteCompleted(childIndex) { + var _a, _b; + const childCall = this.underlyingCalls[childIndex]; + const messageIndex = childCall.nextMessageToSend; + (_b = (_a = this.getBufferEntry(messageIndex)).callback) === null || _b === void 0 ? void 0 : _b.call(_a); + this.clearSentMessages(); + childCall.nextMessageToSend += 1; + this.sendNextChildMessage(childIndex); + } + sendNextChildMessage(childIndex) { + const childCall = this.underlyingCalls[childIndex]; + if (childCall.state === 'COMPLETED') { + return; + } + if (this.getBufferEntry(childCall.nextMessageToSend)) { + const bufferEntry = this.getBufferEntry(childCall.nextMessageToSend); + switch (bufferEntry.entryType) { + case 'MESSAGE': + childCall.call.sendMessageWithContext({ + callback: error => { + // Ignore error + this.handleChildWriteCompleted(childIndex); + }, + }, bufferEntry.message.message); + break; + case 'HALF_CLOSE': + childCall.nextMessageToSend += 1; + childCall.call.halfClose(); + break; + case 'FREED': + // Should not be possible + break; + } + } + } + sendMessageWithContext(context, message) { + var _a; + this.trace('write() called with message of length ' + message.length); + const writeObj = { + message, + flags: context.flags, + }; + const messageIndex = this.getNextBufferIndex(); + const bufferEntry = { + entryType: 'MESSAGE', + message: writeObj, + allocated: this.bufferTracker.allocate(message.length, this.callNumber), + }; + this.writeBuffer.push(bufferEntry); + if (bufferEntry.allocated) { + (_a = context.callback) === null || _a === void 0 ? void 0 : _a.call(context); + for (const [callIndex, call] of this.underlyingCalls.entries()) { + if (call.state === 'ACTIVE' && + call.nextMessageToSend === messageIndex) { + call.call.sendMessageWithContext({ + callback: error => { + // Ignore error + this.handleChildWriteCompleted(callIndex); + }, + }, message); + } + } + } + else { + this.commitCallWithMostMessages(); + // commitCallWithMostMessages can fail if we are between ping attempts + if (this.committedCallIndex === null) { + return; + } + const call = this.underlyingCalls[this.committedCallIndex]; + bufferEntry.callback = context.callback; + if (call.state === 'ACTIVE' && call.nextMessageToSend === messageIndex) { + call.call.sendMessageWithContext({ + callback: error => { + // Ignore error + this.handleChildWriteCompleted(this.committedCallIndex); + }, + }, message); + } + } + } + startRead() { + this.trace('startRead called'); + this.readStarted = true; + for (const underlyingCall of this.underlyingCalls) { + if ((underlyingCall === null || underlyingCall === void 0 ? void 0 : underlyingCall.state) === 'ACTIVE') { + underlyingCall.call.startRead(); + } + } + } + halfClose() { + this.trace('halfClose called'); + const halfCloseIndex = this.getNextBufferIndex(); + this.writeBuffer.push({ + entryType: 'HALF_CLOSE', + allocated: false, + }); + for (const call of this.underlyingCalls) { + if ((call === null || call === void 0 ? void 0 : call.state) === 'ACTIVE' && + call.nextMessageToSend === halfCloseIndex) { + call.nextMessageToSend += 1; + call.call.halfClose(); + } + } + } + setCredentials(newCredentials) { + throw new Error('Method not implemented.'); + } + getMethod() { + return this.methodName; + } + getHost() { + return this.host; + } +} +exports.RetryingCall = RetryingCall; +//# sourceMappingURL=retrying-call.js.map + +/***/ }), + +/***/ 62533: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.ServerDuplexStreamImpl = exports.ServerWritableStreamImpl = exports.ServerReadableStreamImpl = exports.ServerUnaryCallImpl = exports.serverErrorToStatus = void 0; +const events_1 = __nccwpck_require__(82361); +const stream_1 = __nccwpck_require__(12781); +const constants_1 = __nccwpck_require__(90634); +const metadata_1 = __nccwpck_require__(83665); +function serverErrorToStatus(error, overrideTrailers) { + var _a; + const status = { + code: constants_1.Status.UNKNOWN, + details: 'message' in error ? error.message : 'Unknown Error', + metadata: (_a = overrideTrailers !== null && overrideTrailers !== void 0 ? overrideTrailers : error.metadata) !== null && _a !== void 0 ? _a : null, + }; + if ('code' in error && + typeof error.code === 'number' && + Number.isInteger(error.code)) { + status.code = error.code; + if ('details' in error && typeof error.details === 'string') { + status.details = error.details; + } + } + return status; +} +exports.serverErrorToStatus = serverErrorToStatus; +class ServerUnaryCallImpl extends events_1.EventEmitter { + constructor(path, call, metadata, request) { + super(); + this.path = path; + this.call = call; + this.metadata = metadata; + this.request = request; + this.cancelled = false; + } + getPeer() { + return this.call.getPeer(); + } + sendMetadata(responseMetadata) { + this.call.sendMetadata(responseMetadata); + } + getDeadline() { + return this.call.getDeadline(); + } + getPath() { + return this.path; + } +} +exports.ServerUnaryCallImpl = ServerUnaryCallImpl; +class ServerReadableStreamImpl extends stream_1.Readable { + constructor(path, call, metadata) { + super({ objectMode: true }); + this.path = path; + this.call = call; + this.metadata = metadata; + this.cancelled = false; + } + _read(size) { + this.call.startRead(); + } + getPeer() { + return this.call.getPeer(); + } + sendMetadata(responseMetadata) { + this.call.sendMetadata(responseMetadata); + } + getDeadline() { + return this.call.getDeadline(); + } + getPath() { + return this.path; + } +} +exports.ServerReadableStreamImpl = ServerReadableStreamImpl; +class ServerWritableStreamImpl extends stream_1.Writable { + constructor(path, call, metadata, request) { + super({ objectMode: true }); + this.path = path; + this.call = call; + this.metadata = metadata; + this.request = request; + this.pendingStatus = { + code: constants_1.Status.OK, + details: 'OK', + }; + this.cancelled = false; + this.trailingMetadata = new metadata_1.Metadata(); + this.on('error', err => { + this.pendingStatus = serverErrorToStatus(err); + this.end(); + }); + } + getPeer() { + return this.call.getPeer(); + } + sendMetadata(responseMetadata) { + this.call.sendMetadata(responseMetadata); + } + getDeadline() { + return this.call.getDeadline(); + } + getPath() { + return this.path; + } + _write(chunk, encoding, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback) { + this.call.sendMessage(chunk, callback); + } + _final(callback) { + var _a; + callback(null); + this.call.sendStatus(Object.assign(Object.assign({}, this.pendingStatus), { metadata: (_a = this.pendingStatus.metadata) !== null && _a !== void 0 ? _a : this.trailingMetadata })); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + end(metadata) { + if (metadata) { + this.trailingMetadata = metadata; + } + return super.end(); + } +} +exports.ServerWritableStreamImpl = ServerWritableStreamImpl; +class ServerDuplexStreamImpl extends stream_1.Duplex { + constructor(path, call, metadata) { + super({ objectMode: true }); + this.path = path; + this.call = call; + this.metadata = metadata; + this.pendingStatus = { + code: constants_1.Status.OK, + details: 'OK', + }; + this.cancelled = false; + this.trailingMetadata = new metadata_1.Metadata(); + this.on('error', err => { + this.pendingStatus = serverErrorToStatus(err); + this.end(); + }); + } + getPeer() { + return this.call.getPeer(); + } + sendMetadata(responseMetadata) { + this.call.sendMetadata(responseMetadata); + } + getDeadline() { + return this.call.getDeadline(); + } + getPath() { + return this.path; + } + _read(size) { + this.call.startRead(); + } + _write(chunk, encoding, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback) { + this.call.sendMessage(chunk, callback); + } + _final(callback) { + var _a; + callback(null); + this.call.sendStatus(Object.assign(Object.assign({}, this.pendingStatus), { metadata: (_a = this.pendingStatus.metadata) !== null && _a !== void 0 ? _a : this.trailingMetadata })); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + end(metadata) { + if (metadata) { + this.trailingMetadata = metadata; + } + return super.end(); + } +} +exports.ServerDuplexStreamImpl = ServerDuplexStreamImpl; +//# sourceMappingURL=server-call.js.map + +/***/ }), + +/***/ 63828: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.ServerCredentials = void 0; +const tls_helpers_1 = __nccwpck_require__(86581); +class ServerCredentials { + static createInsecure() { + return new InsecureServerCredentials(); + } + static createSsl(rootCerts, keyCertPairs, checkClientCertificate = false) { + var _a; + if (rootCerts !== null && !Buffer.isBuffer(rootCerts)) { + throw new TypeError('rootCerts must be null or a Buffer'); + } + if (!Array.isArray(keyCertPairs)) { + throw new TypeError('keyCertPairs must be an array'); + } + if (typeof checkClientCertificate !== 'boolean') { + throw new TypeError('checkClientCertificate must be a boolean'); + } + const cert = []; + const key = []; + for (let i = 0; i < keyCertPairs.length; i++) { + const pair = keyCertPairs[i]; + if (pair === null || typeof pair !== 'object') { + throw new TypeError(`keyCertPair[${i}] must be an object`); + } + if (!Buffer.isBuffer(pair.private_key)) { + throw new TypeError(`keyCertPair[${i}].private_key must be a Buffer`); + } + if (!Buffer.isBuffer(pair.cert_chain)) { + throw new TypeError(`keyCertPair[${i}].cert_chain must be a Buffer`); + } + cert.push(pair.cert_chain); + key.push(pair.private_key); + } + return new SecureServerCredentials({ + ca: (_a = rootCerts !== null && rootCerts !== void 0 ? rootCerts : (0, tls_helpers_1.getDefaultRootsData)()) !== null && _a !== void 0 ? _a : undefined, + cert, + key, + requestCert: checkClientCertificate, + ciphers: tls_helpers_1.CIPHER_SUITES, + }); + } +} +exports.ServerCredentials = ServerCredentials; +class InsecureServerCredentials extends ServerCredentials { + _isSecure() { + return false; + } + _getSettings() { + return null; + } + _equals(other) { + return other instanceof InsecureServerCredentials; + } +} +class SecureServerCredentials extends ServerCredentials { + constructor(options) { + super(); + this.options = options; + } + _isSecure() { + return true; + } + _getSettings() { + return this.options; + } + /** + * Checks equality by checking the options that are actually set by + * createSsl. + * @param other + * @returns + */ + _equals(other) { + if (this === other) { + return true; + } + if (!(other instanceof SecureServerCredentials)) { + return false; + } + // options.ca equality check + if (Buffer.isBuffer(this.options.ca) && Buffer.isBuffer(other.options.ca)) { + if (!this.options.ca.equals(other.options.ca)) { + return false; + } + } + else { + if (this.options.ca !== other.options.ca) { + return false; + } + } + // options.cert equality check + if (Array.isArray(this.options.cert) && Array.isArray(other.options.cert)) { + if (this.options.cert.length !== other.options.cert.length) { + return false; + } + for (let i = 0; i < this.options.cert.length; i++) { + const thisCert = this.options.cert[i]; + const otherCert = other.options.cert[i]; + if (Buffer.isBuffer(thisCert) && Buffer.isBuffer(otherCert)) { + if (!thisCert.equals(otherCert)) { + return false; + } + } + else { + if (thisCert !== otherCert) { + return false; + } + } + } + } + else { + if (this.options.cert !== other.options.cert) { + return false; + } + } + // options.key equality check + if (Array.isArray(this.options.key) && Array.isArray(other.options.key)) { + if (this.options.key.length !== other.options.key.length) { + return false; + } + for (let i = 0; i < this.options.key.length; i++) { + const thisKey = this.options.key[i]; + const otherKey = other.options.key[i]; + if (Buffer.isBuffer(thisKey) && Buffer.isBuffer(otherKey)) { + if (!thisKey.equals(otherKey)) { + return false; + } + } + else { + if (thisKey !== otherKey) { + return false; + } + } + } + } + else { + if (this.options.key !== other.options.key) { + return false; + } + } + // options.requestCert equality check + if (this.options.requestCert !== other.options.requestCert) { + return false; + } + /* ciphers is derived from a value that is constant for the process, so no + * equality check is needed. */ + return true; + } +} +//# sourceMappingURL=server-credentials.js.map + +/***/ }), + +/***/ 20998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2024 gRPC authors. + * + * 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 })); +exports.getServerInterceptingCall = exports.BaseServerInterceptingCall = exports.ServerInterceptingCall = exports.ResponderBuilder = exports.isInterceptingServerListener = exports.ServerListenerBuilder = void 0; +const metadata_1 = __nccwpck_require__(83665); +const constants_1 = __nccwpck_require__(90634); +const http2 = __nccwpck_require__(85158); +const error_1 = __nccwpck_require__(22336); +const zlib = __nccwpck_require__(59796); +const stream_decoder_1 = __nccwpck_require__(16575); +const logging = __nccwpck_require__(35993); +const TRACER_NAME = 'server_call'; +function trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); +} +class ServerListenerBuilder { + constructor() { + this.metadata = undefined; + this.message = undefined; + this.halfClose = undefined; + this.cancel = undefined; + } + withOnReceiveMetadata(onReceiveMetadata) { + this.metadata = onReceiveMetadata; + return this; + } + withOnReceiveMessage(onReceiveMessage) { + this.message = onReceiveMessage; + return this; + } + withOnReceiveHalfClose(onReceiveHalfClose) { + this.halfClose = onReceiveHalfClose; + return this; + } + withOnCancel(onCancel) { + this.cancel = onCancel; + return this; + } + build() { + return { + onReceiveMetadata: this.metadata, + onReceiveMessage: this.message, + onReceiveHalfClose: this.halfClose, + onCancel: this.cancel, + }; + } +} +exports.ServerListenerBuilder = ServerListenerBuilder; +function isInterceptingServerListener(listener) { + return (listener.onReceiveMetadata !== undefined && + listener.onReceiveMetadata.length === 1); +} +exports.isInterceptingServerListener = isInterceptingServerListener; +class InterceptingServerListenerImpl { + constructor(listener, nextListener) { + this.listener = listener; + this.nextListener = nextListener; + /** + * Once the call is cancelled, ignore all other events. + */ + this.cancelled = false; + this.processingMetadata = false; + this.hasPendingMessage = false; + this.pendingMessage = null; + this.processingMessage = false; + this.hasPendingHalfClose = false; + } + processPendingMessage() { + if (this.hasPendingMessage) { + this.nextListener.onReceiveMessage(this.pendingMessage); + this.pendingMessage = null; + this.hasPendingMessage = false; + } + } + processPendingHalfClose() { + if (this.hasPendingHalfClose) { + this.nextListener.onReceiveHalfClose(); + this.hasPendingHalfClose = false; + } + } + onReceiveMetadata(metadata) { + if (this.cancelled) { + return; + } + this.processingMetadata = true; + this.listener.onReceiveMetadata(metadata, interceptedMetadata => { + this.processingMetadata = false; + if (this.cancelled) { + return; + } + this.nextListener.onReceiveMetadata(interceptedMetadata); + this.processPendingMessage(); + this.processPendingHalfClose(); + }); + } + onReceiveMessage(message) { + if (this.cancelled) { + return; + } + this.processingMessage = true; + this.listener.onReceiveMessage(message, msg => { + this.processingMessage = false; + if (this.cancelled) { + return; + } + if (this.processingMetadata) { + this.pendingMessage = msg; + this.hasPendingMessage = true; + } + else { + this.nextListener.onReceiveMessage(msg); + this.processPendingHalfClose(); + } + }); + } + onReceiveHalfClose() { + if (this.cancelled) { + return; + } + this.listener.onReceiveHalfClose(() => { + if (this.cancelled) { + return; + } + if (this.processingMetadata || this.processingMessage) { + this.hasPendingHalfClose = true; + } + else { + this.nextListener.onReceiveHalfClose(); + } + }); + } + onCancel() { + this.cancelled = true; + this.listener.onCancel(); + this.nextListener.onCancel(); + } +} +class ResponderBuilder { + constructor() { + this.start = undefined; + this.metadata = undefined; + this.message = undefined; + this.status = undefined; + } + withStart(start) { + this.start = start; + return this; + } + withSendMetadata(sendMetadata) { + this.metadata = sendMetadata; + return this; + } + withSendMessage(sendMessage) { + this.message = sendMessage; + return this; + } + withSendStatus(sendStatus) { + this.status = sendStatus; + return this; + } + build() { + return { + start: this.start, + sendMetadata: this.metadata, + sendMessage: this.message, + sendStatus: this.status, + }; + } +} +exports.ResponderBuilder = ResponderBuilder; +const defaultServerListener = { + onReceiveMetadata: (metadata, next) => { + next(metadata); + }, + onReceiveMessage: (message, next) => { + next(message); + }, + onReceiveHalfClose: next => { + next(); + }, + onCancel: () => { }, +}; +const defaultResponder = { + start: next => { + next(); + }, + sendMetadata: (metadata, next) => { + next(metadata); + }, + sendMessage: (message, next) => { + next(message); + }, + sendStatus: (status, next) => { + next(status); + }, +}; +class ServerInterceptingCall { + constructor(nextCall, responder) { + var _a, _b, _c, _d; + this.nextCall = nextCall; + this.processingMetadata = false; + this.processingMessage = false; + this.pendingMessage = null; + this.pendingMessageCallback = null; + this.pendingStatus = null; + this.responder = { + start: (_a = responder === null || responder === void 0 ? void 0 : responder.start) !== null && _a !== void 0 ? _a : defaultResponder.start, + sendMetadata: (_b = responder === null || responder === void 0 ? void 0 : responder.sendMetadata) !== null && _b !== void 0 ? _b : defaultResponder.sendMetadata, + sendMessage: (_c = responder === null || responder === void 0 ? void 0 : responder.sendMessage) !== null && _c !== void 0 ? _c : defaultResponder.sendMessage, + sendStatus: (_d = responder === null || responder === void 0 ? void 0 : responder.sendStatus) !== null && _d !== void 0 ? _d : defaultResponder.sendStatus, + }; + } + processPendingMessage() { + if (this.pendingMessageCallback) { + this.nextCall.sendMessage(this.pendingMessage, this.pendingMessageCallback); + this.pendingMessage = null; + this.pendingMessageCallback = null; + } + } + processPendingStatus() { + if (this.pendingStatus) { + this.nextCall.sendStatus(this.pendingStatus); + this.pendingStatus = null; + } + } + start(listener) { + this.responder.start(interceptedListener => { + var _a, _b, _c, _d; + const fullInterceptedListener = { + onReceiveMetadata: (_a = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onReceiveMetadata) !== null && _a !== void 0 ? _a : defaultServerListener.onReceiveMetadata, + onReceiveMessage: (_b = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onReceiveMessage) !== null && _b !== void 0 ? _b : defaultServerListener.onReceiveMessage, + onReceiveHalfClose: (_c = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onReceiveHalfClose) !== null && _c !== void 0 ? _c : defaultServerListener.onReceiveHalfClose, + onCancel: (_d = interceptedListener === null || interceptedListener === void 0 ? void 0 : interceptedListener.onCancel) !== null && _d !== void 0 ? _d : defaultServerListener.onCancel, + }; + const finalInterceptingListener = new InterceptingServerListenerImpl(fullInterceptedListener, listener); + this.nextCall.start(finalInterceptingListener); + }); + } + sendMetadata(metadata) { + this.processingMetadata = true; + this.responder.sendMetadata(metadata, interceptedMetadata => { + this.processingMetadata = false; + this.nextCall.sendMetadata(interceptedMetadata); + this.processPendingMessage(); + this.processPendingStatus(); + }); + } + sendMessage(message, callback) { + this.processingMessage = true; + this.responder.sendMessage(message, interceptedMessage => { + this.processingMessage = false; + if (this.processingMetadata) { + this.pendingMessage = interceptedMessage; + this.pendingMessageCallback = callback; + } + else { + this.nextCall.sendMessage(interceptedMessage, callback); + } + }); + } + sendStatus(status) { + this.responder.sendStatus(status, interceptedStatus => { + if (this.processingMetadata || this.processingMessage) { + this.pendingStatus = interceptedStatus; + } + else { + this.nextCall.sendStatus(interceptedStatus); + } + }); + } + startRead() { + this.nextCall.startRead(); + } + getPeer() { + return this.nextCall.getPeer(); + } + getDeadline() { + return this.nextCall.getDeadline(); + } +} +exports.ServerInterceptingCall = ServerInterceptingCall; +const GRPC_ACCEPT_ENCODING_HEADER = 'grpc-accept-encoding'; +const GRPC_ENCODING_HEADER = 'grpc-encoding'; +const GRPC_MESSAGE_HEADER = 'grpc-message'; +const GRPC_STATUS_HEADER = 'grpc-status'; +const GRPC_TIMEOUT_HEADER = 'grpc-timeout'; +const DEADLINE_REGEX = /(\d{1,8})\s*([HMSmun])/; +const deadlineUnitsToMs = { + H: 3600000, + M: 60000, + S: 1000, + m: 1, + u: 0.001, + n: 0.000001, +}; +const defaultCompressionHeaders = { + // TODO(cjihrig): Remove these encoding headers from the default response + // once compression is integrated. + [GRPC_ACCEPT_ENCODING_HEADER]: 'identity,deflate,gzip', + [GRPC_ENCODING_HEADER]: 'identity', +}; +const defaultResponseHeaders = { + [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK, + [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto', +}; +const defaultResponseOptions = { + waitForTrailers: true, +}; +class BaseServerInterceptingCall { + constructor(stream, headers, callEventTracker, handler, options) { + this.stream = stream; + this.callEventTracker = callEventTracker; + this.handler = handler; + this.listener = null; + this.deadlineTimer = null; + this.deadline = Infinity; + this.maxSendMessageSize = constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH; + this.maxReceiveMessageSize = constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; + this.cancelled = false; + this.metadataSent = false; + this.wantTrailers = false; + this.cancelNotified = false; + this.incomingEncoding = 'identity'; + this.readQueue = []; + this.isReadPending = false; + this.receivedHalfClose = false; + this.streamEnded = false; + this.stream.once('error', (err) => { + /* We need an error handler to avoid uncaught error event exceptions, but + * there is nothing we can reasonably do here. Any error event should + * have a corresponding close event, which handles emitting the cancelled + * event. And the stream is now in a bad state, so we can't reasonably + * expect to be able to send an error over it. */ + }); + this.stream.once('close', () => { + var _a; + trace('Request to method ' + + ((_a = this.handler) === null || _a === void 0 ? void 0 : _a.path) + + ' stream closed with rstCode ' + + this.stream.rstCode); + if (this.callEventTracker && !this.streamEnded) { + this.streamEnded = true; + this.callEventTracker.onStreamEnd(false); + this.callEventTracker.onCallEnd({ + code: constants_1.Status.CANCELLED, + details: 'Stream closed before sending status', + metadata: null, + }); + } + this.notifyOnCancel(); + }); + this.stream.on('data', (data) => { + this.handleDataFrame(data); + }); + this.stream.pause(); + this.stream.on('end', () => { + this.handleEndEvent(); + }); + if ('grpc.max_send_message_length' in options) { + this.maxSendMessageSize = options['grpc.max_send_message_length']; + } + if ('grpc.max_receive_message_length' in options) { + this.maxReceiveMessageSize = options['grpc.max_receive_message_length']; + } + this.decoder = new stream_decoder_1.StreamDecoder(this.maxReceiveMessageSize); + const metadata = metadata_1.Metadata.fromHttp2Headers(headers); + if (logging.isTracerEnabled(TRACER_NAME)) { + trace('Request to ' + + this.handler.path + + ' received headers ' + + JSON.stringify(metadata.toJSON())); + } + const timeoutHeader = metadata.get(GRPC_TIMEOUT_HEADER); + if (timeoutHeader.length > 0) { + this.handleTimeoutHeader(timeoutHeader[0]); + } + const encodingHeader = metadata.get(GRPC_ENCODING_HEADER); + if (encodingHeader.length > 0) { + this.incomingEncoding = encodingHeader[0]; + } + // Remove several headers that should not be propagated to the application + metadata.remove(GRPC_TIMEOUT_HEADER); + metadata.remove(GRPC_ENCODING_HEADER); + metadata.remove(GRPC_ACCEPT_ENCODING_HEADER); + metadata.remove(http2.constants.HTTP2_HEADER_ACCEPT_ENCODING); + metadata.remove(http2.constants.HTTP2_HEADER_TE); + metadata.remove(http2.constants.HTTP2_HEADER_CONTENT_TYPE); + this.metadata = metadata; + } + handleTimeoutHeader(timeoutHeader) { + const match = timeoutHeader.toString().match(DEADLINE_REGEX); + if (match === null) { + const status = { + code: constants_1.Status.INTERNAL, + details: `Invalid ${GRPC_TIMEOUT_HEADER} value "${timeoutHeader}"`, + metadata: null, + }; + // Wait for the constructor to complete before sending the error. + process.nextTick(() => { + this.sendStatus(status); + }); + return; + } + const timeout = (+match[1] * deadlineUnitsToMs[match[2]]) | 0; + const now = new Date(); + this.deadline = now.setMilliseconds(now.getMilliseconds() + timeout); + this.deadlineTimer = setTimeout(() => { + const status = { + code: constants_1.Status.DEADLINE_EXCEEDED, + details: 'Deadline exceeded', + metadata: null, + }; + this.sendStatus(status); + }, timeout); + } + checkCancelled() { + /* In some cases the stream can become destroyed before the close event + * fires. That creates a race condition that this check works around */ + if (!this.cancelled && (this.stream.destroyed || this.stream.closed)) { + this.notifyOnCancel(); + this.cancelled = true; + } + return this.cancelled; + } + notifyOnCancel() { + if (this.cancelNotified) { + return; + } + this.cancelNotified = true; + this.cancelled = true; + process.nextTick(() => { + var _a; + (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onCancel(); + }); + if (this.deadlineTimer) { + clearTimeout(this.deadlineTimer); + } + // Flush incoming data frames + this.stream.resume(); + } + /** + * A server handler can start sending messages without explicitly sending + * metadata. In that case, we need to send headers before sending any + * messages. This function does that if necessary. + */ + maybeSendMetadata() { + if (!this.metadataSent) { + this.sendMetadata(new metadata_1.Metadata()); + } + } + /** + * Serialize a message to a length-delimited byte string. + * @param value + * @returns + */ + serializeMessage(value) { + const messageBuffer = this.handler.serialize(value); + const byteLength = messageBuffer.byteLength; + const output = Buffer.allocUnsafe(byteLength + 5); + /* Note: response compression is currently not supported, so this + * compressed bit is always 0. */ + output.writeUInt8(0, 0); + output.writeUInt32BE(byteLength, 1); + messageBuffer.copy(output, 5); + return output; + } + decompressMessage(message, encoding) { + const messageContents = message.subarray(5); + if (encoding === 'identity') { + return messageContents; + } + else if (encoding === 'deflate' || encoding === 'gzip') { + let decompresser; + if (encoding === 'deflate') { + decompresser = zlib.createInflate(); + } + else { + decompresser = zlib.createGunzip(); + } + return new Promise((resolve, reject) => { + let totalLength = 0; + const messageParts = []; + decompresser.on('data', (chunk) => { + messageParts.push(chunk); + totalLength += chunk.byteLength; + if (this.maxReceiveMessageSize !== -1 && totalLength > this.maxReceiveMessageSize) { + decompresser.destroy(); + reject({ + code: constants_1.Status.RESOURCE_EXHAUSTED, + details: `Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}` + }); + } + }); + decompresser.on('end', () => { + resolve(Buffer.concat(messageParts)); + }); + decompresser.write(messageContents); + decompresser.end(); + }); + } + else { + return Promise.reject({ + code: constants_1.Status.UNIMPLEMENTED, + details: `Received message compressed with unsupported encoding "${encoding}"`, + }); + } + } + async decompressAndMaybePush(queueEntry) { + if (queueEntry.type !== 'COMPRESSED') { + throw new Error(`Invalid queue entry type: ${queueEntry.type}`); + } + const compressed = queueEntry.compressedMessage.readUInt8(0) === 1; + const compressedMessageEncoding = compressed + ? this.incomingEncoding + : 'identity'; + let decompressedMessage; + try { + decompressedMessage = await this.decompressMessage(queueEntry.compressedMessage, compressedMessageEncoding); + } + catch (err) { + this.sendStatus(err); + return; + } + try { + queueEntry.parsedMessage = this.handler.deserialize(decompressedMessage); + } + catch (err) { + this.sendStatus({ + code: constants_1.Status.INTERNAL, + details: `Error deserializing request: ${err.message}`, + }); + return; + } + queueEntry.type = 'READABLE'; + this.maybePushNextMessage(); + } + maybePushNextMessage() { + if (this.listener && + this.isReadPending && + this.readQueue.length > 0 && + this.readQueue[0].type !== 'COMPRESSED') { + this.isReadPending = false; + const nextQueueEntry = this.readQueue.shift(); + if (nextQueueEntry.type === 'READABLE') { + this.listener.onReceiveMessage(nextQueueEntry.parsedMessage); + } + else { + // nextQueueEntry.type === 'HALF_CLOSE' + this.listener.onReceiveHalfClose(); + } + } + } + handleDataFrame(data) { + var _a; + if (this.checkCancelled()) { + return; + } + trace('Request to ' + + this.handler.path + + ' received data frame of size ' + + data.length); + let rawMessages; + try { + rawMessages = this.decoder.write(data); + } + catch (e) { + this.sendStatus({ code: constants_1.Status.RESOURCE_EXHAUSTED, details: e.message }); + return; + } + for (const messageBytes of rawMessages) { + this.stream.pause(); + const queueEntry = { + type: 'COMPRESSED', + compressedMessage: messageBytes, + parsedMessage: null, + }; + this.readQueue.push(queueEntry); + this.decompressAndMaybePush(queueEntry); + (_a = this.callEventTracker) === null || _a === void 0 ? void 0 : _a.addMessageReceived(); + } + } + handleEndEvent() { + this.readQueue.push({ + type: 'HALF_CLOSE', + compressedMessage: null, + parsedMessage: null, + }); + this.receivedHalfClose = true; + this.maybePushNextMessage(); + } + start(listener) { + trace('Request to ' + this.handler.path + ' start called'); + if (this.checkCancelled()) { + return; + } + this.listener = listener; + listener.onReceiveMetadata(this.metadata); + } + sendMetadata(metadata) { + if (this.checkCancelled()) { + return; + } + if (this.metadataSent) { + return; + } + this.metadataSent = true; + const custom = metadata ? metadata.toHttp2Headers() : null; + const headers = Object.assign(Object.assign(Object.assign({}, defaultResponseHeaders), defaultCompressionHeaders), custom); + this.stream.respond(headers, defaultResponseOptions); + } + sendMessage(message, callback) { + if (this.checkCancelled()) { + return; + } + let response; + try { + response = this.serializeMessage(message); + } + catch (e) { + this.sendStatus({ + code: constants_1.Status.INTERNAL, + details: `Error serializing response: ${(0, error_1.getErrorMessage)(e)}`, + metadata: null, + }); + return; + } + if (this.maxSendMessageSize !== -1 && + response.length - 5 > this.maxSendMessageSize) { + this.sendStatus({ + code: constants_1.Status.RESOURCE_EXHAUSTED, + details: `Sent message larger than max (${response.length} vs. ${this.maxSendMessageSize})`, + metadata: null, + }); + return; + } + this.maybeSendMetadata(); + trace('Request to ' + + this.handler.path + + ' sent data frame of size ' + + response.length); + this.stream.write(response, error => { + var _a; + if (error) { + this.sendStatus({ + code: constants_1.Status.INTERNAL, + details: `Error writing message: ${(0, error_1.getErrorMessage)(error)}`, + metadata: null, + }); + return; + } + (_a = this.callEventTracker) === null || _a === void 0 ? void 0 : _a.addMessageSent(); + callback(); + }); + } + sendStatus(status) { + var _a, _b; + if (this.checkCancelled()) { + return; + } + trace('Request to method ' + + ((_a = this.handler) === null || _a === void 0 ? void 0 : _a.path) + + ' ended with status code: ' + + constants_1.Status[status.code] + + ' details: ' + + status.details); + if (this.metadataSent) { + if (!this.wantTrailers) { + this.wantTrailers = true; + this.stream.once('wantTrailers', () => { + var _a; + if (this.callEventTracker && !this.streamEnded) { + this.streamEnded = true; + this.callEventTracker.onStreamEnd(true); + this.callEventTracker.onCallEnd(status); + } + const trailersToSend = Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, (_a = status.metadata) === null || _a === void 0 ? void 0 : _a.toHttp2Headers()); + this.stream.sendTrailers(trailersToSend); + this.notifyOnCancel(); + }); + this.stream.end(); + } + else { + this.notifyOnCancel(); + } + } + else { + if (this.callEventTracker && !this.streamEnded) { + this.streamEnded = true; + this.callEventTracker.onStreamEnd(true); + this.callEventTracker.onCallEnd(status); + } + // Trailers-only response + const trailersToSend = Object.assign(Object.assign({ [GRPC_STATUS_HEADER]: status.code, [GRPC_MESSAGE_HEADER]: encodeURI(status.details) }, defaultResponseHeaders), (_b = status.metadata) === null || _b === void 0 ? void 0 : _b.toHttp2Headers()); + this.stream.respond(trailersToSend, { endStream: true }); + this.notifyOnCancel(); + } + } + startRead() { + trace('Request to ' + this.handler.path + ' startRead called'); + if (this.checkCancelled()) { + return; + } + this.isReadPending = true; + if (this.readQueue.length === 0) { + if (!this.receivedHalfClose) { + this.stream.resume(); + } + } + else { + this.maybePushNextMessage(); + } + } + getPeer() { + var _a; + const socket = (_a = this.stream.session) === null || _a === void 0 ? void 0 : _a.socket; + if (socket === null || socket === void 0 ? void 0 : socket.remoteAddress) { + if (socket.remotePort) { + return `${socket.remoteAddress}:${socket.remotePort}`; + } + else { + return socket.remoteAddress; + } + } + else { + return 'unknown'; + } + } + getDeadline() { + return this.deadline; + } +} +exports.BaseServerInterceptingCall = BaseServerInterceptingCall; +function getServerInterceptingCall(interceptors, stream, headers, callEventTracker, handler, options) { + const methodDefinition = { + path: handler.path, + requestStream: handler.type === 'clientStream' || handler.type === 'bidi', + responseStream: handler.type === 'serverStream' || handler.type === 'bidi', + requestDeserialize: handler.deserialize, + responseSerialize: handler.serialize, + }; + const baseCall = new BaseServerInterceptingCall(stream, headers, callEventTracker, handler, options); + return interceptors.reduce((call, interceptor) => { + return interceptor(methodDefinition, call); + }, baseCall); +} +exports.getServerInterceptingCall = getServerInterceptingCall; +//# sourceMappingURL=server-interceptors.js.map + +/***/ }), + +/***/ 33389: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; +var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Server = void 0; +const http2 = __nccwpck_require__(85158); +const util = __nccwpck_require__(73837); +const constants_1 = __nccwpck_require__(90634); +const server_call_1 = __nccwpck_require__(62533); +const server_credentials_1 = __nccwpck_require__(63828); +const resolver_1 = __nccwpck_require__(31594); +const logging = __nccwpck_require__(35993); +const subchannel_address_1 = __nccwpck_require__(99905); +const uri_parser_1 = __nccwpck_require__(65974); +const channelz_1 = __nccwpck_require__(79975); +const server_interceptors_1 = __nccwpck_require__(20998); +const UNLIMITED_CONNECTION_AGE_MS = ~(1 << 31); +const KEEPALIVE_MAX_TIME_MS = ~(1 << 31); +const KEEPALIVE_TIMEOUT_MS = 20000; +const MAX_CONNECTION_IDLE_MS = ~(1 << 31); +const { HTTP2_HEADER_PATH } = http2.constants; +const TRACER_NAME = 'server'; +const kMaxAge = Buffer.from('max_age'); +function noop() { } +/** + * Decorator to wrap a class method with util.deprecate + * @param message The message to output if the deprecated method is called + * @returns + */ +function deprecate(message) { + return function (target, context) { + return util.deprecate(target, message); + }; +} +function getUnimplementedStatusResponse(methodName) { + return { + code: constants_1.Status.UNIMPLEMENTED, + details: `The server does not implement the method ${methodName}`, + }; +} +function getDefaultHandler(handlerType, methodName) { + const unimplementedStatusResponse = getUnimplementedStatusResponse(methodName); + switch (handlerType) { + case 'unary': + return (call, callback) => { + callback(unimplementedStatusResponse, null); + }; + case 'clientStream': + return (call, callback) => { + callback(unimplementedStatusResponse, null); + }; + case 'serverStream': + return (call) => { + call.emit('error', unimplementedStatusResponse); + }; + case 'bidi': + return (call) => { + call.emit('error', unimplementedStatusResponse); + }; + default: + throw new Error(`Invalid handlerType ${handlerType}`); + } +} +let Server = (() => { + var _a; + let _instanceExtraInitializers = []; + let _start_decorators; + return _a = class Server { + constructor(options) { + var _b, _c, _d, _e, _f, _g; + this.boundPorts = (__runInitializers(this, _instanceExtraInitializers), new Map()); + this.http2Servers = new Map(); + this.sessionIdleTimeouts = new Map(); + this.handlers = new Map(); + this.sessions = new Map(); + /** + * This field only exists to ensure that the start method throws an error if + * it is called twice, as it did previously. + */ + this.started = false; + this.shutdown = false; + this.serverAddressString = 'null'; + // Channelz Info + this.channelzEnabled = true; + this.options = options !== null && options !== void 0 ? options : {}; + if (this.options['grpc.enable_channelz'] === 0) { + this.channelzEnabled = false; + this.channelzTrace = new channelz_1.ChannelzTraceStub(); + this.callTracker = new channelz_1.ChannelzCallTrackerStub(); + this.listenerChildrenTracker = new channelz_1.ChannelzChildrenTrackerStub(); + this.sessionChildrenTracker = new channelz_1.ChannelzChildrenTrackerStub(); + } + else { + this.channelzTrace = new channelz_1.ChannelzTrace(); + this.callTracker = new channelz_1.ChannelzCallTracker(); + this.listenerChildrenTracker = new channelz_1.ChannelzChildrenTracker(); + this.sessionChildrenTracker = new channelz_1.ChannelzChildrenTracker(); + } + this.channelzRef = (0, channelz_1.registerChannelzServer)('server', () => this.getChannelzInfo(), this.channelzEnabled); + this.channelzTrace.addTrace('CT_INFO', 'Server created'); + this.maxConnectionAgeMs = + (_b = this.options['grpc.max_connection_age_ms']) !== null && _b !== void 0 ? _b : UNLIMITED_CONNECTION_AGE_MS; + this.maxConnectionAgeGraceMs = + (_c = this.options['grpc.max_connection_age_grace_ms']) !== null && _c !== void 0 ? _c : UNLIMITED_CONNECTION_AGE_MS; + this.keepaliveTimeMs = + (_d = this.options['grpc.keepalive_time_ms']) !== null && _d !== void 0 ? _d : KEEPALIVE_MAX_TIME_MS; + this.keepaliveTimeoutMs = + (_e = this.options['grpc.keepalive_timeout_ms']) !== null && _e !== void 0 ? _e : KEEPALIVE_TIMEOUT_MS; + this.sessionIdleTimeout = + (_f = this.options['grpc.max_connection_idle_ms']) !== null && _f !== void 0 ? _f : MAX_CONNECTION_IDLE_MS; + this.commonServerOptions = { + maxSendHeaderBlockLength: Number.MAX_SAFE_INTEGER, + }; + if ('grpc-node.max_session_memory' in this.options) { + this.commonServerOptions.maxSessionMemory = + this.options['grpc-node.max_session_memory']; + } + else { + /* By default, set a very large max session memory limit, to effectively + * disable enforcement of the limit. Some testing indicates that Node's + * behavior degrades badly when this limit is reached, so we solve that + * by disabling the check entirely. */ + this.commonServerOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER; + } + if ('grpc.max_concurrent_streams' in this.options) { + this.commonServerOptions.settings = { + maxConcurrentStreams: this.options['grpc.max_concurrent_streams'], + }; + } + this.interceptors = (_g = this.options.interceptors) !== null && _g !== void 0 ? _g : []; + this.trace('Server constructed'); + } + getChannelzInfo() { + return { + trace: this.channelzTrace, + callTracker: this.callTracker, + listenerChildren: this.listenerChildrenTracker.getChildLists(), + sessionChildren: this.sessionChildrenTracker.getChildLists(), + }; + } + getChannelzSessionInfo(session) { + var _b, _c, _d; + const sessionInfo = this.sessions.get(session); + const sessionSocket = session.socket; + const remoteAddress = sessionSocket.remoteAddress + ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.remoteAddress, sessionSocket.remotePort) + : null; + const localAddress = sessionSocket.localAddress + ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.localAddress, sessionSocket.localPort) + : null; + let tlsInfo; + if (session.encrypted) { + const tlsSocket = sessionSocket; + const cipherInfo = tlsSocket.getCipher(); + const certificate = tlsSocket.getCertificate(); + const peerCertificate = tlsSocket.getPeerCertificate(); + tlsInfo = { + cipherSuiteStandardName: (_b = cipherInfo.standardName) !== null && _b !== void 0 ? _b : null, + cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name, + localCertificate: certificate && 'raw' in certificate ? certificate.raw : null, + remoteCertificate: peerCertificate && 'raw' in peerCertificate + ? peerCertificate.raw + : null, + }; + } + else { + tlsInfo = null; + } + const socketInfo = { + remoteAddress: remoteAddress, + localAddress: localAddress, + security: tlsInfo, + remoteName: null, + streamsStarted: sessionInfo.streamTracker.callsStarted, + streamsSucceeded: sessionInfo.streamTracker.callsSucceeded, + streamsFailed: sessionInfo.streamTracker.callsFailed, + messagesSent: sessionInfo.messagesSent, + messagesReceived: sessionInfo.messagesReceived, + keepAlivesSent: sessionInfo.keepAlivesSent, + lastLocalStreamCreatedTimestamp: null, + lastRemoteStreamCreatedTimestamp: sessionInfo.streamTracker.lastCallStartedTimestamp, + lastMessageSentTimestamp: sessionInfo.lastMessageSentTimestamp, + lastMessageReceivedTimestamp: sessionInfo.lastMessageReceivedTimestamp, + localFlowControlWindow: (_c = session.state.localWindowSize) !== null && _c !== void 0 ? _c : null, + remoteFlowControlWindow: (_d = session.state.remoteWindowSize) !== null && _d !== void 0 ? _d : null, + }; + return socketInfo; + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' + this.channelzRef.id + ') ' + text); + } + addProtoService() { + throw new Error('Not implemented. Use addService() instead'); + } + addService(service, implementation) { + if (service === null || + typeof service !== 'object' || + implementation === null || + typeof implementation !== 'object') { + throw new Error('addService() requires two objects as arguments'); + } + const serviceKeys = Object.keys(service); + if (serviceKeys.length === 0) { + throw new Error('Cannot add an empty service to a server'); + } + serviceKeys.forEach(name => { + const attrs = service[name]; + let methodType; + if (attrs.requestStream) { + if (attrs.responseStream) { + methodType = 'bidi'; + } + else { + methodType = 'clientStream'; + } + } + else { + if (attrs.responseStream) { + methodType = 'serverStream'; + } + else { + methodType = 'unary'; + } + } + let implFn = implementation[name]; + let impl; + if (implFn === undefined && typeof attrs.originalName === 'string') { + implFn = implementation[attrs.originalName]; + } + if (implFn !== undefined) { + impl = implFn.bind(implementation); + } + else { + impl = getDefaultHandler(methodType, name); + } + const success = this.register(attrs.path, impl, attrs.responseSerialize, attrs.requestDeserialize, methodType); + if (success === false) { + throw new Error(`Method handler for ${attrs.path} already provided.`); + } + }); + } + removeService(service) { + if (service === null || typeof service !== 'object') { + throw new Error('removeService() requires object as argument'); + } + const serviceKeys = Object.keys(service); + serviceKeys.forEach(name => { + const attrs = service[name]; + this.unregister(attrs.path); + }); + } + bind(port, creds) { + throw new Error('Not implemented. Use bindAsync() instead'); + } + registerListenerToChannelz(boundAddress) { + return (0, channelz_1.registerChannelzSocket)((0, subchannel_address_1.subchannelAddressToString)(boundAddress), () => { + return { + localAddress: boundAddress, + remoteAddress: null, + security: null, + remoteName: null, + streamsStarted: 0, + streamsSucceeded: 0, + streamsFailed: 0, + messagesSent: 0, + messagesReceived: 0, + keepAlivesSent: 0, + lastLocalStreamCreatedTimestamp: null, + lastRemoteStreamCreatedTimestamp: null, + lastMessageSentTimestamp: null, + lastMessageReceivedTimestamp: null, + localFlowControlWindow: null, + remoteFlowControlWindow: null, + }; + }, this.channelzEnabled); + } + createHttp2Server(credentials) { + let http2Server; + if (credentials._isSecure()) { + const secureServerOptions = Object.assign(this.commonServerOptions, credentials._getSettings()); + secureServerOptions.enableTrace = + this.options['grpc-node.tls_enable_trace'] === 1; + http2Server = http2.createSecureServer(secureServerOptions); + http2Server.on('secureConnection', (socket) => { + /* These errors need to be handled by the user of Http2SecureServer, + * according to https://github.com/nodejs/node/issues/35824 */ + socket.on('error', (e) => { + this.trace('An incoming TLS connection closed with error: ' + e.message); + }); + }); + } + else { + http2Server = http2.createServer(this.commonServerOptions); + } + http2Server.setTimeout(0, noop); + this._setupHandlers(http2Server); + return http2Server; + } + bindOneAddress(address, boundPortObject) { + this.trace('Attempting to bind ' + (0, subchannel_address_1.subchannelAddressToString)(address)); + const http2Server = this.createHttp2Server(boundPortObject.credentials); + return new Promise((resolve, reject) => { + const onError = (err) => { + this.trace('Failed to bind ' + + (0, subchannel_address_1.subchannelAddressToString)(address) + + ' with error ' + + err.message); + resolve({ + port: 'port' in address ? address.port : 1, + error: err.message, + }); + }; + http2Server.once('error', onError); + http2Server.listen(address, () => { + const boundAddress = http2Server.address(); + let boundSubchannelAddress; + if (typeof boundAddress === 'string') { + boundSubchannelAddress = { + path: boundAddress, + }; + } + else { + boundSubchannelAddress = { + host: boundAddress.address, + port: boundAddress.port, + }; + } + const channelzRef = this.registerListenerToChannelz(boundSubchannelAddress); + this.listenerChildrenTracker.refChild(channelzRef); + this.http2Servers.set(http2Server, { + channelzRef: channelzRef, + sessions: new Set(), + }); + boundPortObject.listeningServers.add(http2Server); + this.trace('Successfully bound ' + + (0, subchannel_address_1.subchannelAddressToString)(boundSubchannelAddress)); + resolve({ + port: 'port' in boundSubchannelAddress ? boundSubchannelAddress.port : 1, + }); + http2Server.removeListener('error', onError); + }); + }); + } + async bindManyPorts(addressList, boundPortObject) { + if (addressList.length === 0) { + return { + count: 0, + port: 0, + errors: [], + }; + } + if ((0, subchannel_address_1.isTcpSubchannelAddress)(addressList[0]) && addressList[0].port === 0) { + /* If binding to port 0, first try to bind the first address, then bind + * the rest of the address list to the specific port that it binds. */ + const firstAddressResult = await this.bindOneAddress(addressList[0], boundPortObject); + if (firstAddressResult.error) { + /* If the first address fails to bind, try the same operation starting + * from the second item in the list. */ + const restAddressResult = await this.bindManyPorts(addressList.slice(1), boundPortObject); + return Object.assign(Object.assign({}, restAddressResult), { errors: [firstAddressResult.error, ...restAddressResult.errors] }); + } + else { + const restAddresses = addressList + .slice(1) + .map(address => (0, subchannel_address_1.isTcpSubchannelAddress)(address) + ? { host: address.host, port: firstAddressResult.port } + : address); + const restAddressResult = await Promise.all(restAddresses.map(address => this.bindOneAddress(address, boundPortObject))); + const allResults = [firstAddressResult, ...restAddressResult]; + return { + count: allResults.filter(result => result.error === undefined).length, + port: firstAddressResult.port, + errors: allResults + .filter(result => result.error) + .map(result => result.error), + }; + } + } + else { + const allResults = await Promise.all(addressList.map(address => this.bindOneAddress(address, boundPortObject))); + return { + count: allResults.filter(result => result.error === undefined).length, + port: allResults[0].port, + errors: allResults + .filter(result => result.error) + .map(result => result.error), + }; + } + } + async bindAddressList(addressList, boundPortObject) { + const bindResult = await this.bindManyPorts(addressList, boundPortObject); + if (bindResult.count > 0) { + if (bindResult.count < addressList.length) { + logging.log(constants_1.LogVerbosity.INFO, `WARNING Only ${bindResult.count} addresses added out of total ${addressList.length} resolved`); + } + return bindResult.port; + } + else { + const errorString = `No address added out of total ${addressList.length} resolved`; + logging.log(constants_1.LogVerbosity.ERROR, errorString); + throw new Error(`${errorString} errors: [${bindResult.errors.join(',')}]`); + } + } + resolvePort(port) { + return new Promise((resolve, reject) => { + const resolverListener = { + onSuccessfulResolution: (endpointList, serviceConfig, serviceConfigError) => { + // We only want one resolution result. Discard all future results + resolverListener.onSuccessfulResolution = () => { }; + const addressList = [].concat(...endpointList.map(endpoint => endpoint.addresses)); + if (addressList.length === 0) { + reject(new Error(`No addresses resolved for port ${port}`)); + return; + } + resolve(addressList); + }, + onError: error => { + reject(new Error(error.details)); + }, + }; + const resolver = (0, resolver_1.createResolver)(port, resolverListener, this.options); + resolver.updateResolution(); + }); + } + async bindPort(port, boundPortObject) { + const addressList = await this.resolvePort(port); + if (boundPortObject.cancelled) { + this.completeUnbind(boundPortObject); + throw new Error('bindAsync operation cancelled by unbind call'); + } + const portNumber = await this.bindAddressList(addressList, boundPortObject); + if (boundPortObject.cancelled) { + this.completeUnbind(boundPortObject); + throw new Error('bindAsync operation cancelled by unbind call'); + } + return portNumber; + } + normalizePort(port) { + const initialPortUri = (0, uri_parser_1.parseUri)(port); + if (initialPortUri === null) { + throw new Error(`Could not parse port "${port}"`); + } + const portUri = (0, resolver_1.mapUriDefaultScheme)(initialPortUri); + if (portUri === null) { + throw new Error(`Could not get a default scheme for port "${port}"`); + } + return portUri; + } + bindAsync(port, creds, callback) { + if (this.shutdown) { + throw new Error('bindAsync called after shutdown'); + } + if (typeof port !== 'string') { + throw new TypeError('port must be a string'); + } + if (creds === null || !(creds instanceof server_credentials_1.ServerCredentials)) { + throw new TypeError('creds must be a ServerCredentials object'); + } + if (typeof callback !== 'function') { + throw new TypeError('callback must be a function'); + } + this.trace('bindAsync port=' + port); + const portUri = this.normalizePort(port); + const deferredCallback = (error, port) => { + process.nextTick(() => callback(error, port)); + }; + /* First, if this port is already bound or that bind operation is in + * progress, use that result. */ + let boundPortObject = this.boundPorts.get((0, uri_parser_1.uriToString)(portUri)); + if (boundPortObject) { + if (!creds._equals(boundPortObject.credentials)) { + deferredCallback(new Error(`${port} already bound with incompatible credentials`), 0); + return; + } + /* If that operation has previously been cancelled by an unbind call, + * uncancel it. */ + boundPortObject.cancelled = false; + if (boundPortObject.completionPromise) { + boundPortObject.completionPromise.then(portNum => callback(null, portNum), error => callback(error, 0)); + } + else { + deferredCallback(null, boundPortObject.portNumber); + } + return; + } + boundPortObject = { + mapKey: (0, uri_parser_1.uriToString)(portUri), + originalUri: portUri, + completionPromise: null, + cancelled: false, + portNumber: 0, + credentials: creds, + listeningServers: new Set(), + }; + const splitPort = (0, uri_parser_1.splitHostPort)(portUri.path); + const completionPromise = this.bindPort(portUri, boundPortObject); + boundPortObject.completionPromise = completionPromise; + /* If the port number is 0, defer populating the map entry until after the + * bind operation completes and we have a specific port number. Otherwise, + * populate it immediately. */ + if ((splitPort === null || splitPort === void 0 ? void 0 : splitPort.port) === 0) { + completionPromise.then(portNum => { + const finalUri = { + scheme: portUri.scheme, + authority: portUri.authority, + path: (0, uri_parser_1.combineHostPort)({ host: splitPort.host, port: portNum }), + }; + boundPortObject.mapKey = (0, uri_parser_1.uriToString)(finalUri); + boundPortObject.completionPromise = null; + boundPortObject.portNumber = portNum; + this.boundPorts.set(boundPortObject.mapKey, boundPortObject); + callback(null, portNum); + }, error => { + callback(error, 0); + }); + } + else { + this.boundPorts.set(boundPortObject.mapKey, boundPortObject); + completionPromise.then(portNum => { + boundPortObject.completionPromise = null; + boundPortObject.portNumber = portNum; + callback(null, portNum); + }, error => { + callback(error, 0); + }); + } + } + closeServer(server, callback) { + this.trace('Closing server with address ' + JSON.stringify(server.address())); + const serverInfo = this.http2Servers.get(server); + server.close(() => { + if (serverInfo) { + this.listenerChildrenTracker.unrefChild(serverInfo.channelzRef); + (0, channelz_1.unregisterChannelzRef)(serverInfo.channelzRef); + } + this.http2Servers.delete(server); + callback === null || callback === void 0 ? void 0 : callback(); + }); + } + closeSession(session, callback) { + var _b; + this.trace('Closing session initiated by ' + ((_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress)); + const sessionInfo = this.sessions.get(session); + const closeCallback = () => { + if (sessionInfo) { + this.sessionChildrenTracker.unrefChild(sessionInfo.ref); + (0, channelz_1.unregisterChannelzRef)(sessionInfo.ref); + } + callback === null || callback === void 0 ? void 0 : callback(); + }; + if (session.closed) { + queueMicrotask(closeCallback); + } + else { + session.close(closeCallback); + } + } + completeUnbind(boundPortObject) { + for (const server of boundPortObject.listeningServers) { + const serverInfo = this.http2Servers.get(server); + this.closeServer(server, () => { + boundPortObject.listeningServers.delete(server); + }); + if (serverInfo) { + for (const session of serverInfo.sessions) { + this.closeSession(session); + } + } + } + this.boundPorts.delete(boundPortObject.mapKey); + } + /** + * Unbind a previously bound port, or cancel an in-progress bindAsync + * operation. If port 0 was bound, only the actual bound port can be + * unbound. For example, if bindAsync was called with "localhost:0" and the + * bound port result was 54321, it can be unbound as "localhost:54321". + * @param port + */ + unbind(port) { + this.trace('unbind port=' + port); + const portUri = this.normalizePort(port); + const splitPort = (0, uri_parser_1.splitHostPort)(portUri.path); + if ((splitPort === null || splitPort === void 0 ? void 0 : splitPort.port) === 0) { + throw new Error('Cannot unbind port 0'); + } + const boundPortObject = this.boundPorts.get((0, uri_parser_1.uriToString)(portUri)); + if (boundPortObject) { + this.trace('unbinding ' + + boundPortObject.mapKey + + ' originally bound as ' + + (0, uri_parser_1.uriToString)(boundPortObject.originalUri)); + /* If the bind operation is pending, the cancelled flag will trigger + * the unbind operation later. */ + if (boundPortObject.completionPromise) { + boundPortObject.cancelled = true; + } + else { + this.completeUnbind(boundPortObject); + } + } + } + /** + * Gracefully close all connections associated with a previously bound port. + * After the grace time, forcefully close all remaining open connections. + * + * If port 0 was bound, only the actual bound port can be + * drained. For example, if bindAsync was called with "localhost:0" and the + * bound port result was 54321, it can be drained as "localhost:54321". + * @param port + * @param graceTimeMs + * @returns + */ + drain(port, graceTimeMs) { + var _b, _c; + this.trace('drain port=' + port + ' graceTimeMs=' + graceTimeMs); + const portUri = this.normalizePort(port); + const splitPort = (0, uri_parser_1.splitHostPort)(portUri.path); + if ((splitPort === null || splitPort === void 0 ? void 0 : splitPort.port) === 0) { + throw new Error('Cannot drain port 0'); + } + const boundPortObject = this.boundPorts.get((0, uri_parser_1.uriToString)(portUri)); + if (!boundPortObject) { + return; + } + const allSessions = new Set(); + for (const http2Server of boundPortObject.listeningServers) { + const serverEntry = this.http2Servers.get(http2Server); + if (serverEntry) { + for (const session of serverEntry.sessions) { + allSessions.add(session); + this.closeSession(session, () => { + allSessions.delete(session); + }); + } + } + } + /* After the grace time ends, send another goaway to all remaining sessions + * with the CANCEL code. */ + (_c = (_b = setTimeout(() => { + for (const session of allSessions) { + session.destroy(http2.constants.NGHTTP2_CANCEL); + } + }, graceTimeMs)).unref) === null || _c === void 0 ? void 0 : _c.call(_b); + } + forceShutdown() { + for (const boundPortObject of this.boundPorts.values()) { + boundPortObject.cancelled = true; + } + this.boundPorts.clear(); + // Close the server if it is still running. + for (const server of this.http2Servers.keys()) { + this.closeServer(server); + } + // Always destroy any available sessions. It's possible that one or more + // tryShutdown() calls are in progress. Don't wait on them to finish. + this.sessions.forEach((channelzInfo, session) => { + this.closeSession(session); + // Cast NGHTTP2_CANCEL to any because TypeScript doesn't seem to + // recognize destroy(code) as a valid signature. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + session.destroy(http2.constants.NGHTTP2_CANCEL); + }); + this.sessions.clear(); + (0, channelz_1.unregisterChannelzRef)(this.channelzRef); + this.shutdown = true; + } + register(name, handler, serialize, deserialize, type) { + if (this.handlers.has(name)) { + return false; + } + this.handlers.set(name, { + func: handler, + serialize, + deserialize, + type, + path: name, + }); + return true; + } + unregister(name) { + return this.handlers.delete(name); + } + /** + * @deprecated No longer needed as of version 1.10.x + */ + start() { + if (this.http2Servers.size === 0 || + [...this.http2Servers.keys()].every(server => !server.listening)) { + throw new Error('server must be bound in order to start'); + } + if (this.started === true) { + throw new Error('server is already started'); + } + this.started = true; + } + tryShutdown(callback) { + var _b; + const wrappedCallback = (error) => { + (0, channelz_1.unregisterChannelzRef)(this.channelzRef); + callback(error); + }; + let pendingChecks = 0; + function maybeCallback() { + pendingChecks--; + if (pendingChecks === 0) { + wrappedCallback(); + } + } + this.shutdown = true; + for (const [serverKey, server] of this.http2Servers.entries()) { + pendingChecks++; + const serverString = server.channelzRef.name; + this.trace('Waiting for server ' + serverString + ' to close'); + this.closeServer(serverKey, () => { + this.trace('Server ' + serverString + ' finished closing'); + maybeCallback(); + }); + for (const session of server.sessions.keys()) { + pendingChecks++; + const sessionString = (_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress; + this.trace('Waiting for session ' + sessionString + ' to close'); + this.closeSession(session, () => { + this.trace('Session ' + sessionString + ' finished closing'); + maybeCallback(); + }); + } + } + if (pendingChecks === 0) { + wrappedCallback(); + } + } + addHttp2Port() { + throw new Error('Not yet implemented'); + } + /** + * Get the channelz reference object for this server. The returned value is + * garbage if channelz is disabled for this server. + * @returns + */ + getChannelzRef() { + return this.channelzRef; + } + _verifyContentType(stream, headers) { + const contentType = headers[http2.constants.HTTP2_HEADER_CONTENT_TYPE]; + if (typeof contentType !== 'string' || + !contentType.startsWith('application/grpc')) { + stream.respond({ + [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, + }, { endStream: true }); + return false; + } + return true; + } + _retrieveHandler(path) { + this.trace('Received call to method ' + + path + + ' at address ' + + this.serverAddressString); + const handler = this.handlers.get(path); + if (handler === undefined) { + this.trace('No handler registered for method ' + + path + + '. Sending UNIMPLEMENTED status.'); + return null; + } + return handler; + } + _respondWithError(err, stream, channelzSessionInfo = null) { + var _b, _c; + const trailersToSend = Object.assign({ 'grpc-status': (_b = err.code) !== null && _b !== void 0 ? _b : constants_1.Status.INTERNAL, 'grpc-message': err.details, [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK, [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto' }, (_c = err.metadata) === null || _c === void 0 ? void 0 : _c.toHttp2Headers()); + stream.respond(trailersToSend, { endStream: true }); + this.callTracker.addCallFailed(); + channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed(); + } + _channelzHandler(stream, headers) { + // for handling idle timeout + this.onStreamOpened(stream); + const channelzSessionInfo = this.sessions.get(stream.session); + this.callTracker.addCallStarted(); + channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallStarted(); + if (!this._verifyContentType(stream, headers)) { + this.callTracker.addCallFailed(); + channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed(); + return; + } + const path = headers[HTTP2_HEADER_PATH]; + const handler = this._retrieveHandler(path); + if (!handler) { + this._respondWithError(getUnimplementedStatusResponse(path), stream, channelzSessionInfo); + return; + } + const callEventTracker = { + addMessageSent: () => { + if (channelzSessionInfo) { + channelzSessionInfo.messagesSent += 1; + channelzSessionInfo.lastMessageSentTimestamp = new Date(); + } + }, + addMessageReceived: () => { + if (channelzSessionInfo) { + channelzSessionInfo.messagesReceived += 1; + channelzSessionInfo.lastMessageReceivedTimestamp = new Date(); + } + }, + onCallEnd: status => { + if (status.code === constants_1.Status.OK) { + this.callTracker.addCallSucceeded(); + } + else { + this.callTracker.addCallFailed(); + } + }, + onStreamEnd: success => { + if (channelzSessionInfo) { + if (success) { + channelzSessionInfo.streamTracker.addCallSucceeded(); + } + else { + channelzSessionInfo.streamTracker.addCallFailed(); + } + } + }, + }; + const call = (0, server_interceptors_1.getServerInterceptingCall)(this.interceptors, stream, headers, callEventTracker, handler, this.options); + if (!this._runHandlerForCall(call, handler)) { + this.callTracker.addCallFailed(); + channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed(); + call.sendStatus({ + code: constants_1.Status.INTERNAL, + details: `Unknown handler type: ${handler.type}`, + }); + } + } + _streamHandler(stream, headers) { + // for handling idle timeout + this.onStreamOpened(stream); + if (this._verifyContentType(stream, headers) !== true) { + return; + } + const path = headers[HTTP2_HEADER_PATH]; + const handler = this._retrieveHandler(path); + if (!handler) { + this._respondWithError(getUnimplementedStatusResponse(path), stream, null); + return; + } + const call = (0, server_interceptors_1.getServerInterceptingCall)(this.interceptors, stream, headers, null, handler, this.options); + if (!this._runHandlerForCall(call, handler)) { + call.sendStatus({ + code: constants_1.Status.INTERNAL, + details: `Unknown handler type: ${handler.type}`, + }); + } + } + _runHandlerForCall(call, handler) { + const { type } = handler; + if (type === 'unary') { + handleUnary(call, handler); + } + else if (type === 'clientStream') { + handleClientStreaming(call, handler); + } + else if (type === 'serverStream') { + handleServerStreaming(call, handler); + } + else if (type === 'bidi') { + handleBidiStreaming(call, handler); + } + else { + return false; + } + return true; + } + _setupHandlers(http2Server) { + if (http2Server === null) { + return; + } + const serverAddress = http2Server.address(); + let serverAddressString = 'null'; + if (serverAddress) { + if (typeof serverAddress === 'string') { + serverAddressString = serverAddress; + } + else { + serverAddressString = serverAddress.address + ':' + serverAddress.port; + } + } + this.serverAddressString = serverAddressString; + const handler = this.channelzEnabled + ? this._channelzHandler + : this._streamHandler; + const sessionHandler = this.channelzEnabled + ? this._channelzSessionHandler(http2Server) + : this._sessionHandler(http2Server); + http2Server.on('stream', handler.bind(this)); + http2Server.on('session', sessionHandler); + } + _sessionHandler(http2Server) { + return (session) => { + var _b, _c, _d; + (_b = this.http2Servers.get(http2Server)) === null || _b === void 0 ? void 0 : _b.sessions.add(session); + let connectionAgeTimer = null; + let connectionAgeGraceTimer = null; + let keeapliveTimeTimer = null; + let keepaliveTimeoutTimer = null; + let sessionClosedByServer = false; + const idleTimeoutObj = this.enableIdleTimeout(session); + if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) { + // Apply a random jitter within a +/-10% range + const jitterMagnitude = this.maxConnectionAgeMs / 10; + const jitter = Math.random() * jitterMagnitude * 2 - jitterMagnitude; + connectionAgeTimer = setTimeout(() => { + var _b, _c; + sessionClosedByServer = true; + this.trace('Connection dropped by max connection age: ' + + ((_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress)); + try { + session.goaway(http2.constants.NGHTTP2_NO_ERROR, ~(1 << 31), kMaxAge); + } + catch (e) { + // The goaway can't be sent because the session is already closed + session.destroy(); + return; + } + session.close(); + /* Allow a grace period after sending the GOAWAY before forcibly + * closing the connection. */ + if (this.maxConnectionAgeGraceMs !== UNLIMITED_CONNECTION_AGE_MS) { + connectionAgeGraceTimer = setTimeout(() => { + session.destroy(); + }, this.maxConnectionAgeGraceMs); + (_c = connectionAgeGraceTimer.unref) === null || _c === void 0 ? void 0 : _c.call(connectionAgeGraceTimer); + } + }, this.maxConnectionAgeMs + jitter); + (_c = connectionAgeTimer.unref) === null || _c === void 0 ? void 0 : _c.call(connectionAgeTimer); + } + if (this.keepaliveTimeMs < KEEPALIVE_MAX_TIME_MS) { + keeapliveTimeTimer = setInterval(() => { + var _b; + keepaliveTimeoutTimer = setTimeout(() => { + sessionClosedByServer = true; + session.close(); + }, this.keepaliveTimeoutMs); + (_b = keepaliveTimeoutTimer.unref) === null || _b === void 0 ? void 0 : _b.call(keepaliveTimeoutTimer); + try { + session.ping((err, duration, payload) => { + if (keepaliveTimeoutTimer) { + clearTimeout(keepaliveTimeoutTimer); + } + if (err) { + sessionClosedByServer = true; + this.trace('Connection dropped due to error of a ping frame ' + + err.message + + ' return in ' + + duration); + session.close(); + } + }); + } + catch (e) { + clearTimeout(keepaliveTimeoutTimer); + // The ping can't be sent because the session is already closed + session.destroy(); + } + }, this.keepaliveTimeMs); + (_d = keeapliveTimeTimer.unref) === null || _d === void 0 ? void 0 : _d.call(keeapliveTimeTimer); + } + session.on('close', () => { + var _b, _c; + if (!sessionClosedByServer) { + this.trace(`Connection dropped by client ${(_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress}`); + } + if (connectionAgeTimer) { + clearTimeout(connectionAgeTimer); + } + if (connectionAgeGraceTimer) { + clearTimeout(connectionAgeGraceTimer); + } + if (keeapliveTimeTimer) { + clearInterval(keeapliveTimeTimer); + if (keepaliveTimeoutTimer) { + clearTimeout(keepaliveTimeoutTimer); + } + } + if (idleTimeoutObj !== null) { + clearTimeout(idleTimeoutObj.timeout); + this.sessionIdleTimeouts.delete(session); + } + (_c = this.http2Servers.get(http2Server)) === null || _c === void 0 ? void 0 : _c.sessions.delete(session); + }); + }; + } + _channelzSessionHandler(http2Server) { + return (session) => { + var _b, _c, _d, _e, _f; + const channelzRef = (0, channelz_1.registerChannelzSocket)((_c = (_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress) !== null && _c !== void 0 ? _c : 'unknown', this.getChannelzSessionInfo.bind(this, session), this.channelzEnabled); + const channelzSessionInfo = { + ref: channelzRef, + streamTracker: new channelz_1.ChannelzCallTracker(), + messagesSent: 0, + messagesReceived: 0, + keepAlivesSent: 0, + lastMessageSentTimestamp: null, + lastMessageReceivedTimestamp: null, + }; + (_d = this.http2Servers.get(http2Server)) === null || _d === void 0 ? void 0 : _d.sessions.add(session); + this.sessions.set(session, channelzSessionInfo); + const clientAddress = `${session.socket.remoteAddress}:${session.socket.remotePort}`; + this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress); + this.trace('Connection established by client ' + clientAddress); + this.sessionChildrenTracker.refChild(channelzRef); + let connectionAgeTimer = null; + let connectionAgeGraceTimer = null; + let keeapliveTimeTimer = null; + let keepaliveTimeoutTimer = null; + let sessionClosedByServer = false; + const idleTimeoutObj = this.enableIdleTimeout(session); + if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) { + // Apply a random jitter within a +/-10% range + const jitterMagnitude = this.maxConnectionAgeMs / 10; + const jitter = Math.random() * jitterMagnitude * 2 - jitterMagnitude; + connectionAgeTimer = setTimeout(() => { + var _b; + sessionClosedByServer = true; + this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by max connection age from ' + clientAddress); + try { + session.goaway(http2.constants.NGHTTP2_NO_ERROR, ~(1 << 31), kMaxAge); + } + catch (e) { + // The goaway can't be sent because the session is already closed + session.destroy(); + return; + } + session.close(); + /* Allow a grace period after sending the GOAWAY before forcibly + * closing the connection. */ + if (this.maxConnectionAgeGraceMs !== UNLIMITED_CONNECTION_AGE_MS) { + connectionAgeGraceTimer = setTimeout(() => { + session.destroy(); + }, this.maxConnectionAgeGraceMs); + (_b = connectionAgeGraceTimer.unref) === null || _b === void 0 ? void 0 : _b.call(connectionAgeGraceTimer); + } + }, this.maxConnectionAgeMs + jitter); + (_e = connectionAgeTimer.unref) === null || _e === void 0 ? void 0 : _e.call(connectionAgeTimer); + } + if (this.keepaliveTimeMs < KEEPALIVE_MAX_TIME_MS) { + keeapliveTimeTimer = setInterval(() => { + var _b; + keepaliveTimeoutTimer = setTimeout(() => { + sessionClosedByServer = true; + this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by keepalive timeout from ' + clientAddress); + session.close(); + }, this.keepaliveTimeoutMs); + (_b = keepaliveTimeoutTimer.unref) === null || _b === void 0 ? void 0 : _b.call(keepaliveTimeoutTimer); + try { + session.ping((err, duration, payload) => { + if (keepaliveTimeoutTimer) { + clearTimeout(keepaliveTimeoutTimer); + } + if (err) { + sessionClosedByServer = true; + this.channelzTrace.addTrace('CT_INFO', 'Connection dropped due to error of a ping frame ' + + err.message + + ' return in ' + + duration); + session.close(); + } + }); + channelzSessionInfo.keepAlivesSent += 1; + } + catch (e) { + clearTimeout(keepaliveTimeoutTimer); + // The ping can't be sent because the session is already closed + session.destroy(); + } + }, this.keepaliveTimeMs); + (_f = keeapliveTimeTimer.unref) === null || _f === void 0 ? void 0 : _f.call(keeapliveTimeTimer); + } + session.on('close', () => { + var _b; + if (!sessionClosedByServer) { + this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by client ' + clientAddress); + } + this.sessionChildrenTracker.unrefChild(channelzRef); + (0, channelz_1.unregisterChannelzRef)(channelzRef); + if (connectionAgeTimer) { + clearTimeout(connectionAgeTimer); + } + if (connectionAgeGraceTimer) { + clearTimeout(connectionAgeGraceTimer); + } + if (keeapliveTimeTimer) { + clearInterval(keeapliveTimeTimer); + if (keepaliveTimeoutTimer) { + clearTimeout(keepaliveTimeoutTimer); + } + } + if (idleTimeoutObj !== null) { + clearTimeout(idleTimeoutObj.timeout); + this.sessionIdleTimeouts.delete(session); + } + (_b = this.http2Servers.get(http2Server)) === null || _b === void 0 ? void 0 : _b.sessions.delete(session); + this.sessions.delete(session); + }); + }; + } + enableIdleTimeout(session) { + var _b, _c; + if (this.sessionIdleTimeout >= MAX_CONNECTION_IDLE_MS) { + return null; + } + const idleTimeoutObj = { + activeStreams: 0, + lastIdle: Date.now(), + onClose: this.onStreamClose.bind(this, session), + timeout: setTimeout(this.onIdleTimeout, this.sessionIdleTimeout, this, session), + }; + (_c = (_b = idleTimeoutObj.timeout).unref) === null || _c === void 0 ? void 0 : _c.call(_b); + this.sessionIdleTimeouts.set(session, idleTimeoutObj); + const { socket } = session; + this.trace('Enable idle timeout for ' + + socket.remoteAddress + + ':' + + socket.remotePort); + return idleTimeoutObj; + } + onIdleTimeout(ctx, session) { + const { socket } = session; + const sessionInfo = ctx.sessionIdleTimeouts.get(session); + // if it is called while we have activeStreams - timer will not be rescheduled + // until last active stream is closed, then it will call .refresh() on the timer + // important part is to not clearTimeout(timer) or it becomes unusable + // for future refreshes + if (sessionInfo !== undefined && + sessionInfo.activeStreams === 0 && + Date.now() - sessionInfo.lastIdle >= ctx.sessionIdleTimeout) { + ctx.trace('Session idle timeout triggered for ' + + (socket === null || socket === void 0 ? void 0 : socket.remoteAddress) + + ':' + + (socket === null || socket === void 0 ? void 0 : socket.remotePort) + + ' last idle at ' + + sessionInfo.lastIdle); + ctx.closeSession(session); + } + } + onStreamOpened(stream) { + const session = stream.session; + const idleTimeoutObj = this.sessionIdleTimeouts.get(session); + if (idleTimeoutObj) { + idleTimeoutObj.activeStreams += 1; + stream.once('close', idleTimeoutObj.onClose); + } + } + onStreamClose(session) { + var _b, _c; + const idleTimeoutObj = this.sessionIdleTimeouts.get(session); + if (idleTimeoutObj) { + idleTimeoutObj.activeStreams -= 1; + if (idleTimeoutObj.activeStreams === 0) { + idleTimeoutObj.lastIdle = Date.now(); + idleTimeoutObj.timeout.refresh(); + this.trace('Session onStreamClose' + + ((_b = session.socket) === null || _b === void 0 ? void 0 : _b.remoteAddress) + + ':' + + ((_c = session.socket) === null || _c === void 0 ? void 0 : _c.remotePort) + + ' at ' + + idleTimeoutObj.lastIdle); + } + } + } + }, + (() => { + const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0; + _start_decorators = [deprecate('Calling start() is no longer necessary. It can be safely omitted.')]; + __esDecorate(_a, null, _start_decorators, { kind: "method", name: "start", static: false, private: false, access: { has: obj => "start" in obj, get: obj => obj.start }, metadata: _metadata }, null, _instanceExtraInitializers); + if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata }); + })(), + _a; +})(); +exports.Server = Server; +async function handleUnary(call, handler) { + let stream; + function respond(err, value, trailer, flags) { + if (err) { + call.sendStatus((0, server_call_1.serverErrorToStatus)(err, trailer)); + return; + } + call.sendMessage(value, () => { + call.sendStatus({ + code: constants_1.Status.OK, + details: 'OK', + metadata: trailer !== null && trailer !== void 0 ? trailer : null, + }); + }); + } + let requestMetadata; + let requestMessage = null; + call.start({ + onReceiveMetadata(metadata) { + requestMetadata = metadata; + call.startRead(); + }, + onReceiveMessage(message) { + if (requestMessage) { + call.sendStatus({ + code: constants_1.Status.UNIMPLEMENTED, + details: `Received a second request message for server streaming method ${handler.path}`, + metadata: null, + }); + return; + } + requestMessage = message; + call.startRead(); + }, + onReceiveHalfClose() { + if (!requestMessage) { + call.sendStatus({ + code: constants_1.Status.UNIMPLEMENTED, + details: `Received no request message for server streaming method ${handler.path}`, + metadata: null, + }); + return; + } + stream = new server_call_1.ServerWritableStreamImpl(handler.path, call, requestMetadata, requestMessage); + try { + handler.func(stream, respond); + } + catch (err) { + call.sendStatus({ + code: constants_1.Status.UNKNOWN, + details: `Server method handler threw error ${err.message}`, + metadata: null, + }); + } + }, + onCancel() { + if (stream) { + stream.cancelled = true; + stream.emit('cancelled', 'cancelled'); + } + }, + }); +} +function handleClientStreaming(call, handler) { + let stream; + function respond(err, value, trailer, flags) { + if (err) { + call.sendStatus((0, server_call_1.serverErrorToStatus)(err, trailer)); + return; + } + call.sendMessage(value, () => { + call.sendStatus({ + code: constants_1.Status.OK, + details: 'OK', + metadata: trailer !== null && trailer !== void 0 ? trailer : null, + }); + }); + } + call.start({ + onReceiveMetadata(metadata) { + stream = new server_call_1.ServerDuplexStreamImpl(handler.path, call, metadata); + try { + handler.func(stream, respond); + } + catch (err) { + call.sendStatus({ + code: constants_1.Status.UNKNOWN, + details: `Server method handler threw error ${err.message}`, + metadata: null, + }); + } + }, + onReceiveMessage(message) { + stream.push(message); + }, + onReceiveHalfClose() { + stream.push(null); + }, + onCancel() { + if (stream) { + stream.cancelled = true; + stream.emit('cancelled', 'cancelled'); + stream.destroy(); + } + }, + }); +} +function handleServerStreaming(call, handler) { + let stream; + let requestMetadata; + let requestMessage = null; + call.start({ + onReceiveMetadata(metadata) { + requestMetadata = metadata; + call.startRead(); + }, + onReceiveMessage(message) { + if (requestMessage) { + call.sendStatus({ + code: constants_1.Status.UNIMPLEMENTED, + details: `Received a second request message for server streaming method ${handler.path}`, + metadata: null, + }); + return; + } + requestMessage = message; + call.startRead(); + }, + onReceiveHalfClose() { + if (!requestMessage) { + call.sendStatus({ + code: constants_1.Status.UNIMPLEMENTED, + details: `Received no request message for server streaming method ${handler.path}`, + metadata: null, + }); + return; + } + stream = new server_call_1.ServerWritableStreamImpl(handler.path, call, requestMetadata, requestMessage); + try { + handler.func(stream); + } + catch (err) { + call.sendStatus({ + code: constants_1.Status.UNKNOWN, + details: `Server method handler threw error ${err.message}`, + metadata: null, + }); + } + }, + onCancel() { + if (stream) { + stream.cancelled = true; + stream.emit('cancelled', 'cancelled'); + stream.destroy(); + } + }, + }); +} +function handleBidiStreaming(call, handler) { + let stream; + call.start({ + onReceiveMetadata(metadata) { + stream = new server_call_1.ServerDuplexStreamImpl(handler.path, call, metadata); + try { + handler.func(stream); + } + catch (err) { + call.sendStatus({ + code: constants_1.Status.UNKNOWN, + details: `Server method handler threw error ${err.message}`, + metadata: null, + }); + } + }, + onReceiveMessage(message) { + stream.push(message); + }, + onReceiveHalfClose() { + stream.push(null); + }, + onCancel() { + if (stream) { + stream.cancelled = true; + stream.emit('cancelled', 'cancelled'); + stream.destroy(); + } + }, + }); +} +//# sourceMappingURL=server.js.map + +/***/ }), + +/***/ 21761: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.extractAndSelectServiceConfig = exports.validateServiceConfig = exports.validateRetryThrottling = void 0; +/* This file implements gRFC A2 and the service config spec: + * https://github.com/grpc/proposal/blob/master/A2-service-configs-in-dns.md + * https://github.com/grpc/grpc/blob/master/doc/service_config.md. Each + * function here takes an object with unknown structure and returns its + * specific object type if the input has the right structure, and throws an + * error otherwise. */ +/* 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 constants_1 = __nccwpck_require__(90634); +/** + * Recognizes a number with up to 9 digits after the decimal point, followed by + * an "s", representing a number of seconds. + */ +const DURATION_REGEX = /^\d+(\.\d{1,9})?s$/; +/** + * Client language name used for determining whether this client matches a + * `ServiceConfigCanaryConfig`'s `clientLanguage` list. + */ +const CLIENT_LANGUAGE_STRING = 'node'; +function validateName(obj) { + // In this context, and unset field and '' are considered the same + if ('service' in obj && obj.service !== '') { + if (typeof obj.service !== 'string') { + throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof obj.service}`); + } + if ('method' in obj && obj.method !== '') { + if (typeof obj.method !== 'string') { + throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof obj.service}`); + } + return { + service: obj.service, + method: obj.method, + }; + } + else { + return { + service: obj.service, + }; + } + } + else { + if ('method' in obj && obj.method !== undefined) { + throw new Error(`Invalid method config name: method set with empty or unset service`); + } + return {}; + } +} +function validateRetryPolicy(obj) { + if (!('maxAttempts' in obj) || + !Number.isInteger(obj.maxAttempts) || + obj.maxAttempts < 2) { + throw new Error('Invalid method config retry policy: maxAttempts must be an integer at least 2'); + } + if (!('initialBackoff' in obj) || + typeof obj.initialBackoff !== 'string' || + !DURATION_REGEX.test(obj.initialBackoff)) { + throw new Error('Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer followed by s'); + } + if (!('maxBackoff' in obj) || + typeof obj.maxBackoff !== 'string' || + !DURATION_REGEX.test(obj.maxBackoff)) { + throw new Error('Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer followed by s'); + } + if (!('backoffMultiplier' in obj) || + typeof obj.backoffMultiplier !== 'number' || + obj.backoffMultiplier <= 0) { + throw new Error('Invalid method config retry policy: backoffMultiplier must be a number greater than 0'); + } + if (!('retryableStatusCodes' in obj && Array.isArray(obj.retryableStatusCodes))) { + throw new Error('Invalid method config retry policy: retryableStatusCodes is required'); + } + if (obj.retryableStatusCodes.length === 0) { + throw new Error('Invalid method config retry policy: retryableStatusCodes must be non-empty'); + } + for (const value of obj.retryableStatusCodes) { + if (typeof value === 'number') { + if (!Object.values(constants_1.Status).includes(value)) { + throw new Error('Invalid method config retry policy: retryableStatusCodes value not in status code range'); + } + } + else if (typeof value === 'string') { + if (!Object.values(constants_1.Status).includes(value.toUpperCase())) { + throw new Error('Invalid method config retry policy: retryableStatusCodes value not a status code name'); + } + } + else { + throw new Error('Invalid method config retry policy: retryableStatusCodes value must be a string or number'); + } + } + return { + maxAttempts: obj.maxAttempts, + initialBackoff: obj.initialBackoff, + maxBackoff: obj.maxBackoff, + backoffMultiplier: obj.backoffMultiplier, + retryableStatusCodes: obj.retryableStatusCodes, + }; +} +function validateHedgingPolicy(obj) { + if (!('maxAttempts' in obj) || + !Number.isInteger(obj.maxAttempts) || + obj.maxAttempts < 2) { + throw new Error('Invalid method config hedging policy: maxAttempts must be an integer at least 2'); + } + if ('hedgingDelay' in obj && + (typeof obj.hedgingDelay !== 'string' || + !DURATION_REGEX.test(obj.hedgingDelay))) { + throw new Error('Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s'); + } + if ('nonFatalStatusCodes' in obj && Array.isArray(obj.nonFatalStatusCodes)) { + for (const value of obj.nonFatalStatusCodes) { + if (typeof value === 'number') { + if (!Object.values(constants_1.Status).includes(value)) { + throw new Error('Invlid method config hedging policy: nonFatalStatusCodes value not in status code range'); + } + } + else if (typeof value === 'string') { + if (!Object.values(constants_1.Status).includes(value.toUpperCase())) { + throw new Error('Invlid method config hedging policy: nonFatalStatusCodes value not a status code name'); + } + } + else { + throw new Error('Invlid method config hedging policy: nonFatalStatusCodes value must be a string or number'); + } + } + } + const result = { + maxAttempts: obj.maxAttempts, + }; + if (obj.hedgingDelay) { + result.hedgingDelay = obj.hedgingDelay; + } + if (obj.nonFatalStatusCodes) { + result.nonFatalStatusCodes = obj.nonFatalStatusCodes; + } + return result; +} +function validateMethodConfig(obj) { + var _a; + const result = { + name: [], + }; + if (!('name' in obj) || !Array.isArray(obj.name)) { + throw new Error('Invalid method config: invalid name array'); + } + for (const name of obj.name) { + result.name.push(validateName(name)); + } + if ('waitForReady' in obj) { + if (typeof obj.waitForReady !== 'boolean') { + throw new Error('Invalid method config: invalid waitForReady'); + } + result.waitForReady = obj.waitForReady; + } + if ('timeout' in obj) { + if (typeof obj.timeout === 'object') { + if (!('seconds' in obj.timeout) || + !(typeof obj.timeout.seconds === 'number')) { + throw new Error('Invalid method config: invalid timeout.seconds'); + } + if (!('nanos' in obj.timeout) || + !(typeof obj.timeout.nanos === 'number')) { + throw new Error('Invalid method config: invalid timeout.nanos'); + } + result.timeout = obj.timeout; + } + else if (typeof obj.timeout === 'string' && + DURATION_REGEX.test(obj.timeout)) { + const timeoutParts = obj.timeout + .substring(0, obj.timeout.length - 1) + .split('.'); + result.timeout = { + seconds: timeoutParts[0] | 0, + nanos: ((_a = timeoutParts[1]) !== null && _a !== void 0 ? _a : 0) | 0, + }; + } + else { + throw new Error('Invalid method config: invalid timeout'); + } + } + if ('maxRequestBytes' in obj) { + if (typeof obj.maxRequestBytes !== 'number') { + throw new Error('Invalid method config: invalid maxRequestBytes'); + } + result.maxRequestBytes = obj.maxRequestBytes; + } + if ('maxResponseBytes' in obj) { + if (typeof obj.maxResponseBytes !== 'number') { + throw new Error('Invalid method config: invalid maxRequestBytes'); + } + result.maxResponseBytes = obj.maxResponseBytes; + } + if ('retryPolicy' in obj) { + if ('hedgingPolicy' in obj) { + throw new Error('Invalid method config: retryPolicy and hedgingPolicy cannot both be specified'); + } + else { + result.retryPolicy = validateRetryPolicy(obj.retryPolicy); + } + } + else if ('hedgingPolicy' in obj) { + result.hedgingPolicy = validateHedgingPolicy(obj.hedgingPolicy); + } + return result; +} +function validateRetryThrottling(obj) { + if (!('maxTokens' in obj) || + typeof obj.maxTokens !== 'number' || + obj.maxTokens <= 0 || + obj.maxTokens > 1000) { + throw new Error('Invalid retryThrottling: maxTokens must be a number in (0, 1000]'); + } + if (!('tokenRatio' in obj) || + typeof obj.tokenRatio !== 'number' || + obj.tokenRatio <= 0) { + throw new Error('Invalid retryThrottling: tokenRatio must be a number greater than 0'); + } + return { + maxTokens: +obj.maxTokens.toFixed(3), + tokenRatio: +obj.tokenRatio.toFixed(3), + }; +} +exports.validateRetryThrottling = validateRetryThrottling; +function validateLoadBalancingConfig(obj) { + if (!(typeof obj === 'object' && obj !== null)) { + throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof obj}`); + } + const keys = Object.keys(obj); + if (keys.length > 1) { + throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${keys}`); + } + if (keys.length === 0) { + throw new Error('Invalid loadBalancingConfig: load balancing policy name required'); + } + return { + [keys[0]]: obj[keys[0]], + }; +} +function validateServiceConfig(obj) { + const result = { + loadBalancingConfig: [], + methodConfig: [], + }; + if ('loadBalancingPolicy' in obj) { + if (typeof obj.loadBalancingPolicy === 'string') { + result.loadBalancingPolicy = obj.loadBalancingPolicy; + } + else { + throw new Error('Invalid service config: invalid loadBalancingPolicy'); + } + } + if ('loadBalancingConfig' in obj) { + if (Array.isArray(obj.loadBalancingConfig)) { + for (const config of obj.loadBalancingConfig) { + result.loadBalancingConfig.push(validateLoadBalancingConfig(config)); + } + } + else { + throw new Error('Invalid service config: invalid loadBalancingConfig'); + } + } + if ('methodConfig' in obj) { + if (Array.isArray(obj.methodConfig)) { + for (const methodConfig of obj.methodConfig) { + result.methodConfig.push(validateMethodConfig(methodConfig)); + } + } + } + if ('retryThrottling' in obj) { + result.retryThrottling = validateRetryThrottling(obj.retryThrottling); + } + // Validate method name uniqueness + const seenMethodNames = []; + for (const methodConfig of result.methodConfig) { + for (const name of methodConfig.name) { + for (const seenName of seenMethodNames) { + if (name.service === seenName.service && + name.method === seenName.method) { + throw new Error(`Invalid service config: duplicate name ${name.service}/${name.method}`); + } + } + seenMethodNames.push(name); + } + } + return result; +} +exports.validateServiceConfig = validateServiceConfig; +function validateCanaryConfig(obj) { + if (!('serviceConfig' in obj)) { + throw new Error('Invalid service config choice: missing service config'); + } + const result = { + serviceConfig: validateServiceConfig(obj.serviceConfig), + }; + if ('clientLanguage' in obj) { + if (Array.isArray(obj.clientLanguage)) { + result.clientLanguage = []; + for (const lang of obj.clientLanguage) { + if (typeof lang === 'string') { + result.clientLanguage.push(lang); + } + else { + throw new Error('Invalid service config choice: invalid clientLanguage'); + } + } + } + else { + throw new Error('Invalid service config choice: invalid clientLanguage'); + } + } + if ('clientHostname' in obj) { + if (Array.isArray(obj.clientHostname)) { + result.clientHostname = []; + for (const lang of obj.clientHostname) { + if (typeof lang === 'string') { + result.clientHostname.push(lang); + } + else { + throw new Error('Invalid service config choice: invalid clientHostname'); + } + } + } + else { + throw new Error('Invalid service config choice: invalid clientHostname'); + } + } + if ('percentage' in obj) { + if (typeof obj.percentage === 'number' && + 0 <= obj.percentage && + obj.percentage <= 100) { + result.percentage = obj.percentage; + } + else { + throw new Error('Invalid service config choice: invalid percentage'); + } + } + // Validate that no unexpected fields are present + const allowedFields = [ + 'clientLanguage', + 'percentage', + 'clientHostname', + 'serviceConfig', + ]; + for (const field in obj) { + if (!allowedFields.includes(field)) { + throw new Error(`Invalid service config choice: unexpected field ${field}`); + } + } + return result; +} +function validateAndSelectCanaryConfig(obj, percentage) { + if (!Array.isArray(obj)) { + throw new Error('Invalid service config list'); + } + for (const config of obj) { + const validatedConfig = validateCanaryConfig(config); + /* For each field, we check if it is present, then only discard the + * config if the field value does not match the current client */ + if (typeof validatedConfig.percentage === 'number' && + percentage > validatedConfig.percentage) { + continue; + } + if (Array.isArray(validatedConfig.clientHostname)) { + let hostnameMatched = false; + for (const hostname of validatedConfig.clientHostname) { + if (hostname === os.hostname()) { + hostnameMatched = true; + } + } + if (!hostnameMatched) { + continue; + } + } + if (Array.isArray(validatedConfig.clientLanguage)) { + let languageMatched = false; + for (const language of validatedConfig.clientLanguage) { + if (language === CLIENT_LANGUAGE_STRING) { + languageMatched = true; + } + } + if (!languageMatched) { + continue; + } + } + return validatedConfig.serviceConfig; + } + throw new Error('No matching service config found'); +} +/** + * Find the "grpc_config" record among the TXT records, parse its value as JSON, validate its contents, + * and select a service config with selection fields that all match this client. Most of these steps + * can fail with an error; the caller must handle any errors thrown this way. + * @param txtRecord The TXT record array that is output from a successful call to dns.resolveTxt + * @param percentage A number chosen from the range [0, 100) that is used to select which config to use + * @return The service configuration to use, given the percentage value, or null if the service config + * data has a valid format but none of the options match the current client. + */ +function extractAndSelectServiceConfig(txtRecord, percentage) { + for (const record of txtRecord) { + if (record.length > 0 && record[0].startsWith('grpc_config=')) { + /* Treat the list of strings in this record as a single string and remove + * "grpc_config=" from the beginning. The rest should be a JSON string */ + const recordString = record.join('').substring('grpc_config='.length); + const recordJson = JSON.parse(recordString); + return validateAndSelectCanaryConfig(recordJson, percentage); + } + } + return null; +} +exports.extractAndSelectServiceConfig = extractAndSelectServiceConfig; +//# sourceMappingURL=service-config.js.map + +/***/ }), + +/***/ 73155: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.StatusBuilder = void 0; +/** + * A builder for gRPC status objects. + */ +class StatusBuilder { + constructor() { + this.code = null; + this.details = null; + this.metadata = null; + } + /** + * Adds a status code to the builder. + */ + withCode(code) { + this.code = code; + return this; + } + /** + * Adds details to the builder. + */ + withDetails(details) { + this.details = details; + return this; + } + /** + * Adds metadata to the builder. + */ + withMetadata(metadata) { + this.metadata = metadata; + return this; + } + /** + * Builds the status object. + */ + build() { + const status = {}; + if (this.code !== null) { + status.code = this.code; + } + if (this.details !== null) { + status.details = this.details; + } + if (this.metadata !== null) { + status.metadata = this.metadata; + } + return status; + } +} +exports.StatusBuilder = StatusBuilder; +//# sourceMappingURL=status-builder.js.map + +/***/ }), + +/***/ 16575: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.StreamDecoder = void 0; +var ReadState; +(function (ReadState) { + ReadState[ReadState["NO_DATA"] = 0] = "NO_DATA"; + ReadState[ReadState["READING_SIZE"] = 1] = "READING_SIZE"; + ReadState[ReadState["READING_MESSAGE"] = 2] = "READING_MESSAGE"; +})(ReadState || (ReadState = {})); +class StreamDecoder { + constructor(maxReadMessageLength) { + this.maxReadMessageLength = maxReadMessageLength; + this.readState = ReadState.NO_DATA; + this.readCompressFlag = Buffer.alloc(1); + this.readPartialSize = Buffer.alloc(4); + this.readSizeRemaining = 4; + this.readMessageSize = 0; + this.readPartialMessage = []; + this.readMessageRemaining = 0; + } + write(data) { + let readHead = 0; + let toRead; + const result = []; + while (readHead < data.length) { + switch (this.readState) { + case ReadState.NO_DATA: + this.readCompressFlag = data.slice(readHead, readHead + 1); + readHead += 1; + this.readState = ReadState.READING_SIZE; + this.readPartialSize.fill(0); + this.readSizeRemaining = 4; + this.readMessageSize = 0; + this.readMessageRemaining = 0; + this.readPartialMessage = []; + break; + case ReadState.READING_SIZE: + toRead = Math.min(data.length - readHead, this.readSizeRemaining); + data.copy(this.readPartialSize, 4 - this.readSizeRemaining, readHead, readHead + toRead); + this.readSizeRemaining -= toRead; + readHead += toRead; + // readSizeRemaining >=0 here + if (this.readSizeRemaining === 0) { + this.readMessageSize = this.readPartialSize.readUInt32BE(0); + if (this.maxReadMessageLength !== -1 && this.readMessageSize > this.maxReadMessageLength) { + throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`); + } + this.readMessageRemaining = this.readMessageSize; + if (this.readMessageRemaining > 0) { + this.readState = ReadState.READING_MESSAGE; + } + else { + const message = Buffer.concat([this.readCompressFlag, this.readPartialSize], 5); + this.readState = ReadState.NO_DATA; + result.push(message); + } + } + break; + case ReadState.READING_MESSAGE: + toRead = Math.min(data.length - readHead, this.readMessageRemaining); + this.readPartialMessage.push(data.slice(readHead, readHead + toRead)); + this.readMessageRemaining -= toRead; + readHead += toRead; + // readMessageRemaining >=0 here + if (this.readMessageRemaining === 0) { + // At this point, we have read a full message + const framedMessageBuffers = [ + this.readCompressFlag, + this.readPartialSize, + ].concat(this.readPartialMessage); + const framedMessage = Buffer.concat(framedMessageBuffers, this.readMessageSize + 5); + this.readState = ReadState.NO_DATA; + result.push(framedMessage); + } + break; + default: + throw new Error('Unexpected read state'); + } + } + return result; + } +} +exports.StreamDecoder = StreamDecoder; +//# sourceMappingURL=stream-decoder.js.map + +/***/ }), + +/***/ 99905: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2021 gRPC authors. + * + * 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 })); +exports.EndpointMap = exports.endpointHasAddress = exports.endpointToString = exports.endpointEqual = exports.stringToSubchannelAddress = exports.subchannelAddressToString = exports.subchannelAddressEqual = exports.isTcpSubchannelAddress = void 0; +const net_1 = __nccwpck_require__(41808); +function isTcpSubchannelAddress(address) { + return 'port' in address; +} +exports.isTcpSubchannelAddress = isTcpSubchannelAddress; +function subchannelAddressEqual(address1, address2) { + if (!address1 && !address2) { + return true; + } + if (!address1 || !address2) { + return false; + } + if (isTcpSubchannelAddress(address1)) { + return (isTcpSubchannelAddress(address2) && + address1.host === address2.host && + address1.port === address2.port); + } + else { + return !isTcpSubchannelAddress(address2) && address1.path === address2.path; + } +} +exports.subchannelAddressEqual = subchannelAddressEqual; +function subchannelAddressToString(address) { + if (isTcpSubchannelAddress(address)) { + if ((0, net_1.isIPv6)(address.host)) { + return '[' + address.host + ']:' + address.port; + } + else { + return address.host + ':' + address.port; + } + } + else { + return address.path; + } +} +exports.subchannelAddressToString = subchannelAddressToString; +const DEFAULT_PORT = 443; +function stringToSubchannelAddress(addressString, port) { + if ((0, net_1.isIP)(addressString)) { + return { + host: addressString, + port: port !== null && port !== void 0 ? port : DEFAULT_PORT, + }; + } + else { + return { + path: addressString, + }; + } +} +exports.stringToSubchannelAddress = stringToSubchannelAddress; +function endpointEqual(endpoint1, endpoint2) { + if (endpoint1.addresses.length !== endpoint2.addresses.length) { + return false; + } + for (let i = 0; i < endpoint1.addresses.length; i++) { + if (!subchannelAddressEqual(endpoint1.addresses[i], endpoint2.addresses[i])) { + return false; + } + } + return true; +} +exports.endpointEqual = endpointEqual; +function endpointToString(endpoint) { + return ('[' + endpoint.addresses.map(subchannelAddressToString).join(', ') + ']'); +} +exports.endpointToString = endpointToString; +function endpointHasAddress(endpoint, expectedAddress) { + for (const address of endpoint.addresses) { + if (subchannelAddressEqual(address, expectedAddress)) { + return true; + } + } + return false; +} +exports.endpointHasAddress = endpointHasAddress; +function endpointEqualUnordered(endpoint1, endpoint2) { + if (endpoint1.addresses.length !== endpoint2.addresses.length) { + return false; + } + for (const address1 of endpoint1.addresses) { + let matchFound = false; + for (const address2 of endpoint2.addresses) { + if (subchannelAddressEqual(address1, address2)) { + matchFound = true; + break; + } + } + if (!matchFound) { + return false; + } + } + return true; +} +class EndpointMap { + constructor() { + this.map = new Set(); + } + get size() { + return this.map.size; + } + getForSubchannelAddress(address) { + for (const entry of this.map) { + if (endpointHasAddress(entry.key, address)) { + return entry.value; + } + } + return undefined; + } + /** + * Delete any entries in this map with keys that are not in endpoints + * @param endpoints + */ + deleteMissing(endpoints) { + const removedValues = []; + for (const entry of this.map) { + let foundEntry = false; + for (const endpoint of endpoints) { + if (endpointEqualUnordered(endpoint, entry.key)) { + foundEntry = true; + } + } + if (!foundEntry) { + removedValues.push(entry.value); + this.map.delete(entry); + } + } + return removedValues; + } + get(endpoint) { + for (const entry of this.map) { + if (endpointEqualUnordered(endpoint, entry.key)) { + return entry.value; + } + } + return undefined; + } + set(endpoint, mapEntry) { + for (const entry of this.map) { + if (endpointEqualUnordered(endpoint, entry.key)) { + entry.value = mapEntry; + return; + } + } + this.map.add({ key: endpoint, value: mapEntry }); + } + delete(endpoint) { + for (const entry of this.map) { + if (endpointEqualUnordered(endpoint, entry.key)) { + this.map.delete(entry); + return; + } + } + } + has(endpoint) { + for (const entry of this.map) { + if (endpointEqualUnordered(endpoint, entry.key)) { + return true; + } + } + return false; + } + clear() { + this.map.clear(); + } + *keys() { + for (const entry of this.map) { + yield entry.key; + } + } + *values() { + for (const entry of this.map) { + yield entry.value; + } + } + *entries() { + for (const entry of this.map) { + yield [entry.key, entry.value]; + } + } +} +exports.EndpointMap = EndpointMap; +//# sourceMappingURL=subchannel-address.js.map + +/***/ }), + +/***/ 86940: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.Http2SubchannelCall = void 0; +const http2 = __nccwpck_require__(85158); +const os = __nccwpck_require__(22037); +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 constants_2 = __nccwpck_require__(90634); +const TRACER_NAME = 'subchannel_call'; +/** + * Should do approximately the same thing as util.getSystemErrorName but the + * TypeScript types don't have that function for some reason so I just made my + * own. + * @param errno + */ +function getSystemErrorName(errno) { + for (const [name, num] of Object.entries(os.constants.errno)) { + if (num === errno) { + return name; + } + } + return 'Unknown system error ' + errno; +} +function mapHttpStatusCode(code) { + const details = `Received HTTP status code ${code}`; + let mappedStatusCode; + switch (code) { + // TODO(murgatroid99): handle 100 and 101 + case 400: + mappedStatusCode = constants_1.Status.INTERNAL; + break; + case 401: + mappedStatusCode = constants_1.Status.UNAUTHENTICATED; + break; + case 403: + mappedStatusCode = constants_1.Status.PERMISSION_DENIED; + break; + case 404: + mappedStatusCode = constants_1.Status.UNIMPLEMENTED; + break; + case 429: + case 502: + case 503: + case 504: + mappedStatusCode = constants_1.Status.UNAVAILABLE; + break; + default: + mappedStatusCode = constants_1.Status.UNKNOWN; + } + return { + code: mappedStatusCode, + details: details, + metadata: new metadata_1.Metadata() + }; +} +class Http2SubchannelCall { + constructor(http2Stream, callEventTracker, listener, transport, callId) { + var _a; + this.http2Stream = http2Stream; + this.callEventTracker = callEventTracker; + this.listener = listener; + this.transport = transport; + this.callId = callId; + this.isReadFilterPending = false; + this.isPushPending = false; + this.canPush = false; + /** + * Indicates that an 'end' event has come from the http2 stream, so there + * will be no more data events. + */ + this.readsClosed = false; + this.statusOutput = false; + this.unpushedReadMessages = []; + // This is populated (non-null) if and only if the call has ended + this.finalStatus = null; + this.internalError = null; + this.serverEndedCall = false; + const maxReceiveMessageLength = (_a = transport.getOptions()['grpc.max_receive_message_length']) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; + this.decoder = new stream_decoder_1.StreamDecoder(maxReceiveMessageLength); + http2Stream.on('response', (headers, flags) => { + let headersString = ''; + for (const header of Object.keys(headers)) { + headersString += '\t\t' + header + ': ' + headers[header] + '\n'; + } + this.trace('Received server headers:\n' + headersString); + this.httpStatusCode = headers[':status']; + if (flags & http2.constants.NGHTTP2_FLAG_END_STREAM) { + this.handleTrailers(headers); + } + else { + let metadata; + try { + metadata = metadata_1.Metadata.fromHttp2Headers(headers); + } + catch (error) { + this.endCall({ + code: constants_1.Status.UNKNOWN, + details: error.message, + metadata: new metadata_1.Metadata(), + }); + return; + } + this.listener.onReceiveMetadata(metadata); + } + }); + http2Stream.on('trailers', (headers) => { + this.handleTrailers(headers); + }); + http2Stream.on('data', (data) => { + /* If the status has already been output, allow the http2 stream to + * drain without processing the data. */ + if (this.statusOutput) { + return; + } + this.trace('receive HTTP/2 data frame of length ' + data.length); + let messages; + try { + messages = this.decoder.write(data); + } + catch (e) { + this.cancelWithStatus(constants_1.Status.RESOURCE_EXHAUSTED, e.message); + return; + } + for (const message of messages) { + this.trace('parsed message of length ' + message.length); + this.callEventTracker.addMessageReceived(); + this.tryPush(message); + } + }); + http2Stream.on('end', () => { + this.readsClosed = true; + this.maybeOutputStatus(); + }); + http2Stream.on('close', () => { + this.serverEndedCall = true; + /* Use process.next tick to ensure that this code happens after any + * "error" event that may be emitted at about the same time, so that + * we can bubble up the error message from that event. */ + process.nextTick(() => { + var _a; + this.trace('HTTP/2 stream closed with code ' + http2Stream.rstCode); + /* If we have a final status with an OK status code, that means that + * we have received all of the messages and we have processed the + * trailers and the call completed successfully, so it doesn't matter + * how the stream ends after that */ + if (((_a = this.finalStatus) === null || _a === void 0 ? void 0 : _a.code) === constants_1.Status.OK) { + return; + } + let code; + let details = ''; + switch (http2Stream.rstCode) { + case http2.constants.NGHTTP2_NO_ERROR: + /* If we get a NO_ERROR code and we already have a status, the + * stream completed properly and we just haven't fully processed + * it yet */ + if (this.finalStatus !== null) { + return; + } + if (this.httpStatusCode && this.httpStatusCode !== 200) { + const mappedStatus = mapHttpStatusCode(this.httpStatusCode); + code = mappedStatus.code; + details = mappedStatus.details; + } + else { + code = constants_1.Status.INTERNAL; + details = `Received RST_STREAM with code ${http2Stream.rstCode} (Call ended without gRPC status)`; + } + break; + case http2.constants.NGHTTP2_REFUSED_STREAM: + code = constants_1.Status.UNAVAILABLE; + details = 'Stream refused by server'; + break; + case http2.constants.NGHTTP2_CANCEL: + code = constants_1.Status.CANCELLED; + details = 'Call cancelled'; + break; + case http2.constants.NGHTTP2_ENHANCE_YOUR_CALM: + code = constants_1.Status.RESOURCE_EXHAUSTED; + details = 'Bandwidth exhausted or memory limit exceeded'; + break; + case http2.constants.NGHTTP2_INADEQUATE_SECURITY: + code = constants_1.Status.PERMISSION_DENIED; + details = 'Protocol not secure enough'; + break; + case http2.constants.NGHTTP2_INTERNAL_ERROR: + code = constants_1.Status.INTERNAL; + if (this.internalError === null) { + /* This error code was previously handled in the default case, and + * there are several instances of it online, so I wanted to + * preserve the original error message so that people find existing + * information in searches, but also include the more recognizable + * "Internal server error" message. */ + details = `Received RST_STREAM with code ${http2Stream.rstCode} (Internal server error)`; + } + else { + if (this.internalError.code === 'ECONNRESET' || + this.internalError.code === 'ETIMEDOUT') { + code = constants_1.Status.UNAVAILABLE; + details = this.internalError.message; + } + else { + /* The "Received RST_STREAM with code ..." error is preserved + * here for continuity with errors reported online, but the + * error message at the end will probably be more relevant in + * most cases. */ + details = `Received RST_STREAM with code ${http2Stream.rstCode} triggered by internal client error: ${this.internalError.message}`; + } + } + break; + default: + code = constants_1.Status.INTERNAL; + details = `Received RST_STREAM with code ${http2Stream.rstCode}`; + } + // This is a no-op if trailers were received at all. + // This is OK, because status codes emitted here correspond to more + // catastrophic issues that prevent us from receiving trailers in the + // first place. + this.endCall({ + code, + details, + metadata: new metadata_1.Metadata(), + rstCode: http2Stream.rstCode, + }); + }); + }); + http2Stream.on('error', (err) => { + /* We need an error handler here to stop "Uncaught Error" exceptions + * from bubbling up. However, errors here should all correspond to + * "close" events, where we will handle the error more granularly */ + /* Specifically looking for stream errors that were *not* constructed + * from a RST_STREAM response here: + * https://github.com/nodejs/node/blob/8b8620d580314050175983402dfddf2674e8e22a/lib/internal/http2/core.js#L2267 + */ + if (err.code !== 'ERR_HTTP2_STREAM_ERROR') { + this.trace('Node error event: message=' + + err.message + + ' code=' + + err.code + + ' errno=' + + getSystemErrorName(err.errno) + + ' syscall=' + + err.syscall); + this.internalError = err; + } + this.callEventTracker.onStreamEnd(false); + }); + } + getDeadlineInfo() { + return [`remote_addr=${this.getPeer()}`]; + } + onDisconnect() { + this.endCall({ + code: constants_1.Status.UNAVAILABLE, + details: 'Connection dropped', + metadata: new metadata_1.Metadata(), + }); + } + outputStatus() { + /* Precondition: this.finalStatus !== null */ + if (!this.statusOutput) { + this.statusOutput = true; + this.trace('ended with status: code=' + + this.finalStatus.code + + ' details="' + + this.finalStatus.details + + '"'); + this.callEventTracker.onCallEnd(this.finalStatus); + /* We delay the actual action of bubbling up the status to insulate the + * cleanup code in this class from any errors that may be thrown in the + * upper layers as a result of bubbling up the status. In particular, + * if the status is not OK, the "error" event may be emitted + * synchronously at the top level, which will result in a thrown error if + * the user does not handle that event. */ + process.nextTick(() => { + this.listener.onReceiveStatus(this.finalStatus); + }); + /* Leave the http2 stream in flowing state to drain incoming messages, to + * ensure that the stream closure completes. The call stream already does + * not push more messages after the status is output, so the messages go + * nowhere either way. */ + this.http2Stream.resume(); + } + } + trace(text) { + logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callId + '] ' + text); + } + /** + * On first call, emits a 'status' event with the given StatusObject. + * Subsequent calls are no-ops. + * @param status The status of the call. + */ + endCall(status) { + /* If the status is OK and a new status comes in (e.g. from a + * deserialization failure), that new status takes priority */ + if (this.finalStatus === null || this.finalStatus.code === constants_1.Status.OK) { + this.finalStatus = status; + this.maybeOutputStatus(); + } + this.destroyHttp2Stream(); + } + maybeOutputStatus() { + if (this.finalStatus !== null) { + /* The combination check of readsClosed and that the two message buffer + * arrays are empty checks that there all incoming data has been fully + * processed */ + if (this.finalStatus.code !== constants_1.Status.OK || + (this.readsClosed && + this.unpushedReadMessages.length === 0 && + !this.isReadFilterPending && + !this.isPushPending)) { + this.outputStatus(); + } + } + } + push(message) { + this.trace('pushing to reader message of length ' + + (message instanceof Buffer ? message.length : null)); + this.canPush = false; + this.isPushPending = true; + process.nextTick(() => { + this.isPushPending = false; + /* If we have already output the status any later messages should be + * ignored, and can cause out-of-order operation errors higher up in the + * stack. Checking as late as possible here to avoid any race conditions. + */ + if (this.statusOutput) { + return; + } + this.listener.onReceiveMessage(message); + this.maybeOutputStatus(); + }); + } + tryPush(messageBytes) { + if (this.canPush) { + this.http2Stream.pause(); + this.push(messageBytes); + } + else { + this.trace('unpushedReadMessages.push message of length ' + messageBytes.length); + this.unpushedReadMessages.push(messageBytes); + } + } + handleTrailers(headers) { + this.serverEndedCall = true; + this.callEventTracker.onStreamEnd(true); + let headersString = ''; + for (const header of Object.keys(headers)) { + headersString += '\t\t' + header + ': ' + headers[header] + '\n'; + } + this.trace('Received server trailers:\n' + headersString); + let metadata; + try { + metadata = metadata_1.Metadata.fromHttp2Headers(headers); + } + catch (e) { + metadata = new metadata_1.Metadata(); + } + const metadataMap = metadata.getMap(); + let status; + if (typeof metadataMap['grpc-status'] === 'string') { + const receivedStatus = Number(metadataMap['grpc-status']); + this.trace('received status code ' + receivedStatus + ' from server'); + metadata.remove('grpc-status'); + let details = ''; + if (typeof metadataMap['grpc-message'] === 'string') { + try { + details = decodeURI(metadataMap['grpc-message']); + } + catch (e) { + details = metadataMap['grpc-message']; + } + metadata.remove('grpc-message'); + this.trace('received status details string "' + details + '" from server'); + } + status = { + code: receivedStatus, + details: details, + metadata: metadata + }; + } + else if (this.httpStatusCode) { + status = mapHttpStatusCode(this.httpStatusCode); + status.metadata = metadata; + } + else { + status = { + code: constants_1.Status.UNKNOWN, + details: 'No status information received', + metadata: metadata + }; + } + // This is a no-op if the call was already ended when handling headers. + this.endCall(status); + } + destroyHttp2Stream() { + var _a; + // The http2 stream could already have been destroyed if cancelWithStatus + // is called in response to an internal http2 error. + if (this.http2Stream.destroyed) { + return; + } + /* If the server ended the call, sending an RST_STREAM is redundant, so we + * just half close on the client side instead to finish closing the stream. + */ + if (this.serverEndedCall) { + this.http2Stream.end(); + } + else { + /* If the call has ended with an OK status, communicate that when closing + * the stream, partly to avoid a situation in which we detect an error + * RST_STREAM as a result after we have the status */ + let code; + if (((_a = this.finalStatus) === null || _a === void 0 ? void 0 : _a.code) === constants_1.Status.OK) { + code = http2.constants.NGHTTP2_NO_ERROR; + } + else { + code = http2.constants.NGHTTP2_CANCEL; + } + this.trace('close http2 stream with code ' + code); + this.http2Stream.close(code); + } + } + cancelWithStatus(status, details) { + this.trace('cancelWithStatus code: ' + status + ' details: "' + details + '"'); + this.endCall({ code: status, details, metadata: new metadata_1.Metadata() }); + } + getStatus() { + return this.finalStatus; + } + getPeer() { + return this.transport.getPeerName(); + } + getCallNumber() { + return this.callId; + } + startRead() { + /* If the stream has ended with an error, we should not emit any more + * messages and we should communicate that the stream has ended */ + if (this.finalStatus !== null && this.finalStatus.code !== constants_1.Status.OK) { + this.readsClosed = true; + this.maybeOutputStatus(); + return; + } + this.canPush = true; + if (this.unpushedReadMessages.length > 0) { + const nextMessage = this.unpushedReadMessages.shift(); + this.push(nextMessage); + return; + } + /* Only resume reading from the http2Stream if we don't have any pending + * messages to emit */ + this.http2Stream.resume(); + } + sendMessageWithContext(context, message) { + this.trace('write() called with message of length ' + message.length); + const cb = (error) => { + /* nextTick here ensures that no stream action can be taken in the call + * stack of the write callback, in order to hopefully work around + * https://github.com/nodejs/node/issues/49147 */ + process.nextTick(() => { + var _a; + let code = constants_1.Status.UNAVAILABLE; + if ((error === null || error === void 0 ? void 0 : error.code) === + 'ERR_STREAM_WRITE_AFTER_END') { + code = constants_1.Status.INTERNAL; + } + if (error) { + this.cancelWithStatus(code, `Write error: ${error.message}`); + } + (_a = context.callback) === null || _a === void 0 ? void 0 : _a.call(context); + }); + }; + this.trace('sending data chunk of length ' + message.length); + this.callEventTracker.addMessageSent(); + try { + this.http2Stream.write(message, cb); + } + catch (error) { + this.endCall({ + code: constants_1.Status.UNAVAILABLE, + details: `Write failed with error ${error.message}`, + metadata: new metadata_1.Metadata(), + }); + } + } + halfClose() { + this.trace('end() called'); + this.trace('calling end() on HTTP/2 stream'); + this.http2Stream.end(); + } +} +exports.Http2SubchannelCall = Http2SubchannelCall; +//# sourceMappingURL=subchannel-call.js.map + +/***/ }), + +/***/ 12258: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2022 gRPC authors. + * + * 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 })); +exports.BaseSubchannelWrapper = void 0; +class BaseSubchannelWrapper { + constructor(child) { + this.child = child; + this.healthy = true; + this.healthListeners = new Set(); + child.addHealthStateWatcher(childHealthy => { + /* A change to the child health state only affects this wrapper's overall + * health state if this wrapper is reporting healthy. */ + if (this.healthy) { + this.updateHealthListeners(); + } + }); + } + updateHealthListeners() { + for (const listener of this.healthListeners) { + listener(this.isHealthy()); + } + } + getConnectivityState() { + return this.child.getConnectivityState(); + } + addConnectivityStateListener(listener) { + this.child.addConnectivityStateListener(listener); + } + removeConnectivityStateListener(listener) { + this.child.removeConnectivityStateListener(listener); + } + startConnecting() { + this.child.startConnecting(); + } + getAddress() { + return this.child.getAddress(); + } + throttleKeepalive(newKeepaliveTime) { + this.child.throttleKeepalive(newKeepaliveTime); + } + ref() { + this.child.ref(); + } + unref() { + this.child.unref(); + } + getChannelzRef() { + return this.child.getChannelzRef(); + } + isHealthy() { + return this.healthy && this.child.isHealthy(); + } + addHealthStateWatcher(listener) { + this.healthListeners.add(listener); + } + removeHealthStateWatcher(listener) { + this.healthListeners.delete(listener); + } + setHealthy(healthy) { + if (healthy !== this.healthy) { + this.healthy = healthy; + /* A change to this wrapper's health state only affects the overall + * reported health state if the child is healthy. */ + if (this.child.isHealthy()) { + this.updateHealthListeners(); + } + } + } + getRealSubchannel() { + return this.child.getRealSubchannel(); + } + realSubchannelEquals(other) { + return this.getRealSubchannel() === other.getRealSubchannel(); + } +} +exports.BaseSubchannelWrapper = BaseSubchannelWrapper; +//# sourceMappingURL=subchannel-interface.js.map + +/***/ }), + +/***/ 39780: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.getSubchannelPool = exports.SubchannelPool = void 0; +const channel_options_1 = __nccwpck_require__(99810); +const subchannel_1 = __nccwpck_require__(84764); +const subchannel_address_1 = __nccwpck_require__(99905); +const uri_parser_1 = __nccwpck_require__(65974); +const transport_1 = __nccwpck_require__(46690); +// 10 seconds in milliseconds. This value is arbitrary. +/** + * The amount of time in between checks for dropping subchannels that have no + * other references + */ +const REF_CHECK_INTERVAL = 10000; +class SubchannelPool { + /** + * A pool of subchannels use for making connections. Subchannels with the + * exact same parameters will be reused. + */ + constructor() { + this.pool = Object.create(null); + /** + * A timer of a task performing a periodic subchannel cleanup. + */ + this.cleanupTimer = null; + } + /** + * Unrefs all unused subchannels and cancels the cleanup task if all + * subchannels have been unrefed. + */ + unrefUnusedSubchannels() { + let allSubchannelsUnrefed = true; + /* These objects are created with Object.create(null), so they do not + * have a prototype, which means that for (... in ...) loops over them + * do not need to be filtered */ + // eslint-disable-disable-next-line:forin + for (const channelTarget in this.pool) { + const subchannelObjArray = this.pool[channelTarget]; + const refedSubchannels = subchannelObjArray.filter(value => !value.subchannel.unrefIfOneRef()); + if (refedSubchannels.length > 0) { + allSubchannelsUnrefed = false; + } + /* For each subchannel in the pool, try to unref it if it has + * exactly one ref (which is the ref from the pool itself). If that + * does happen, remove the subchannel from the pool */ + this.pool[channelTarget] = refedSubchannels; + } + /* Currently we do not delete keys with empty values. If that results + * in significant memory usage we should change it. */ + // Cancel the cleanup task if all subchannels have been unrefed. + if (allSubchannelsUnrefed && this.cleanupTimer !== null) { + clearInterval(this.cleanupTimer); + this.cleanupTimer = null; + } + } + /** + * Ensures that the cleanup task is spawned. + */ + ensureCleanupTask() { + var _a, _b; + if (this.cleanupTimer === null) { + this.cleanupTimer = setInterval(() => { + this.unrefUnusedSubchannels(); + }, REF_CHECK_INTERVAL); + // Unref because this timer should not keep the event loop running. + // Call unref only if it exists to address electron/electron#21162 + (_b = (_a = this.cleanupTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + } + /** + * Get a subchannel if one already exists with exactly matching parameters. + * Otherwise, create and save a subchannel with those parameters. + * @param channelTarget + * @param subchannelTarget + * @param channelArguments + * @param channelCredentials + */ + getOrCreateSubchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials) { + this.ensureCleanupTask(); + const channelTarget = (0, uri_parser_1.uriToString)(channelTargetUri); + if (channelTarget in this.pool) { + const subchannelObjArray = this.pool[channelTarget]; + for (const subchannelObj of subchannelObjArray) { + if ((0, subchannel_address_1.subchannelAddressEqual)(subchannelTarget, subchannelObj.subchannelAddress) && + (0, channel_options_1.channelOptionsEqual)(channelArguments, subchannelObj.channelArguments) && + channelCredentials._equals(subchannelObj.channelCredentials)) { + return subchannelObj.subchannel; + } + } + } + // If we get here, no matching subchannel was found + const subchannel = new subchannel_1.Subchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials, new transport_1.Http2SubchannelConnector(channelTargetUri)); + if (!(channelTarget in this.pool)) { + this.pool[channelTarget] = []; + } + this.pool[channelTarget].push({ + subchannelAddress: subchannelTarget, + channelArguments, + channelCredentials, + subchannel, + }); + subchannel.ref(); + return subchannel; + } +} +exports.SubchannelPool = SubchannelPool; +const globalSubchannelPool = new SubchannelPool(); +/** + * Get either the global subchannel pool, or a new subchannel pool. + * @param global + */ +function getSubchannelPool(global) { + if (global) { + return globalSubchannelPool; + } + else { + return new SubchannelPool(); + } +} +exports.getSubchannelPool = getSubchannelPool; +//# sourceMappingURL=subchannel-pool.js.map + +/***/ }), + +/***/ 84764: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.Subchannel = void 0; +const connectivity_state_1 = __nccwpck_require__(80878); +const backoff_timeout_1 = __nccwpck_require__(34186); +const logging = __nccwpck_require__(35993); +const constants_1 = __nccwpck_require__(90634); +const uri_parser_1 = __nccwpck_require__(65974); +const subchannel_address_1 = __nccwpck_require__(99905); +const channelz_1 = __nccwpck_require__(79975); +const TRACER_NAME = 'subchannel'; +/* setInterval and setTimeout only accept signed 32 bit integers. JS doesn't + * have a constant for the max signed 32 bit integer, so this is a simple way + * to calculate it */ +const KEEPALIVE_MAX_TIME_MS = ~(1 << 31); +class Subchannel { + /** + * A class representing a connection to a single backend. + * @param channelTarget The target string for the channel as a whole + * @param subchannelAddress The address for the backend that this subchannel + * will connect to + * @param options The channel options, plus any specific subchannel options + * for this subchannel + * @param credentials The channel credentials used to establish this + * connection + */ + constructor(channelTarget, subchannelAddress, options, credentials, connector) { + var _a; + this.channelTarget = channelTarget; + this.subchannelAddress = subchannelAddress; + this.options = options; + this.credentials = credentials; + this.connector = connector; + /** + * The subchannel's current connectivity state. Invariant: `session` === `null` + * if and only if `connectivityState` is IDLE or TRANSIENT_FAILURE. + */ + this.connectivityState = connectivity_state_1.ConnectivityState.IDLE; + /** + * The underlying http2 session used to make requests. + */ + this.transport = null; + /** + * Indicates that the subchannel should transition from TRANSIENT_FAILURE to + * CONNECTING instead of IDLE when the backoff timeout ends. + */ + this.continueConnecting = false; + /** + * A list of listener functions that will be called whenever the connectivity + * state changes. Will be modified by `addConnectivityStateListener` and + * `removeConnectivityStateListener` + */ + this.stateListeners = new Set(); + /** + * Tracks channels and subchannel pools with references to this subchannel + */ + this.refcount = 0; + // Channelz info + this.channelzEnabled = true; + const backoffOptions = { + initialDelay: options['grpc.initial_reconnect_backoff_ms'], + maxDelay: options['grpc.max_reconnect_backoff_ms'], + }; + this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => { + this.handleBackoffTimer(); + }, backoffOptions); + this.backoffTimeout.unref(); + this.subchannelAddressString = (0, subchannel_address_1.subchannelAddressToString)(subchannelAddress); + this.keepaliveTime = (_a = options['grpc.keepalive_time_ms']) !== null && _a !== void 0 ? _a : -1; + if (options['grpc.enable_channelz'] === 0) { + this.channelzEnabled = false; + this.channelzTrace = new channelz_1.ChannelzTraceStub(); + this.callTracker = new channelz_1.ChannelzCallTrackerStub(); + this.childrenTracker = new channelz_1.ChannelzChildrenTrackerStub(); + this.streamTracker = new channelz_1.ChannelzCallTrackerStub(); + } + else { + this.channelzTrace = new channelz_1.ChannelzTrace(); + this.callTracker = new channelz_1.ChannelzCallTracker(); + this.childrenTracker = new channelz_1.ChannelzChildrenTracker(); + this.streamTracker = new channelz_1.ChannelzCallTracker(); + } + this.channelzRef = (0, channelz_1.registerChannelzSubchannel)(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled); + this.channelzTrace.addTrace('CT_INFO', 'Subchannel created'); + this.trace('Subchannel constructed with options ' + + JSON.stringify(options, undefined, 2)); + } + getChannelzInfo() { + return { + state: this.connectivityState, + trace: this.channelzTrace, + callTracker: this.callTracker, + children: this.childrenTracker.getChildLists(), + target: this.subchannelAddressString, + }; + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' + + this.channelzRef.id + + ') ' + + this.subchannelAddressString + + ' ' + + text); + } + refTrace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, 'subchannel_refcount', '(' + + this.channelzRef.id + + ') ' + + this.subchannelAddressString + + ' ' + + text); + } + handleBackoffTimer() { + if (this.continueConnecting) { + this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING); + } + else { + this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.IDLE); + } + } + /** + * Start a backoff timer with the current nextBackoff timeout + */ + startBackoff() { + this.backoffTimeout.runOnce(); + } + stopBackoff() { + this.backoffTimeout.stop(); + this.backoffTimeout.reset(); + } + startConnectingInternal() { + let options = this.options; + if (options['grpc.keepalive_time_ms']) { + const adjustedKeepaliveTime = Math.min(this.keepaliveTime, KEEPALIVE_MAX_TIME_MS); + options = Object.assign(Object.assign({}, options), { 'grpc.keepalive_time_ms': adjustedKeepaliveTime }); + } + this.connector + .connect(this.subchannelAddress, this.credentials, options) + .then(transport => { + if (this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.READY)) { + this.transport = transport; + if (this.channelzEnabled) { + this.childrenTracker.refChild(transport.getChannelzRef()); + } + transport.addDisconnectListener(tooManyPings => { + this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE); + if (tooManyPings && this.keepaliveTime > 0) { + this.keepaliveTime *= 2; + logging.log(constants_1.LogVerbosity.ERROR, `Connection to ${(0, uri_parser_1.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`); + } + }); + } + else { + /* If we can't transition from CONNECTING to READY here, we will + * not be using this transport, so release its resources. */ + transport.shutdown(); + } + }, error => { + this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, `${error}`); + }); + } + /** + * Initiate a state transition from any element of oldStates to the new + * state. If the current connectivityState is not in oldStates, do nothing. + * @param oldStates The set of states to transition from + * @param newState The state to transition to + * @returns True if the state changed, false otherwise + */ + transitionToState(oldStates, newState, errorMessage) { + var _a, _b; + if (oldStates.indexOf(this.connectivityState) === -1) { + return false; + } + this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] + + ' -> ' + + connectivity_state_1.ConnectivityState[newState]); + if (this.channelzEnabled) { + this.channelzTrace.addTrace('CT_INFO', 'Connectivity state change to ' + connectivity_state_1.ConnectivityState[newState]); + } + const previousState = this.connectivityState; + this.connectivityState = newState; + switch (newState) { + case connectivity_state_1.ConnectivityState.READY: + this.stopBackoff(); + break; + case connectivity_state_1.ConnectivityState.CONNECTING: + this.startBackoff(); + this.startConnectingInternal(); + this.continueConnecting = false; + break; + case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE: + if (this.channelzEnabled && this.transport) { + this.childrenTracker.unrefChild(this.transport.getChannelzRef()); + } + (_a = this.transport) === null || _a === void 0 ? void 0 : _a.shutdown(); + this.transport = null; + /* If the backoff timer has already ended by the time we get to the + * TRANSIENT_FAILURE state, we want to immediately transition out of + * TRANSIENT_FAILURE as though the backoff timer is ending right now */ + if (!this.backoffTimeout.isRunning()) { + process.nextTick(() => { + this.handleBackoffTimer(); + }); + } + break; + case connectivity_state_1.ConnectivityState.IDLE: + if (this.channelzEnabled && this.transport) { + this.childrenTracker.unrefChild(this.transport.getChannelzRef()); + } + (_b = this.transport) === null || _b === void 0 ? void 0 : _b.shutdown(); + this.transport = null; + break; + default: + throw new Error(`Invalid state: unknown ConnectivityState ${newState}`); + } + for (const listener of this.stateListeners) { + listener(this, previousState, newState, this.keepaliveTime, errorMessage); + } + return true; + } + ref() { + this.refTrace('refcount ' + this.refcount + ' -> ' + (this.refcount + 1)); + this.refcount += 1; + } + unref() { + this.refTrace('refcount ' + this.refcount + ' -> ' + (this.refcount - 1)); + this.refcount -= 1; + if (this.refcount === 0) { + this.channelzTrace.addTrace('CT_INFO', 'Shutting down'); + (0, channelz_1.unregisterChannelzRef)(this.channelzRef); + process.nextTick(() => { + this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING, connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE); + }); + } + } + unrefIfOneRef() { + if (this.refcount === 1) { + this.unref(); + return true; + } + return false; + } + createCall(metadata, host, method, listener) { + if (!this.transport) { + throw new Error('Cannot create call, subchannel not READY'); + } + let statsTracker; + if (this.channelzEnabled) { + this.callTracker.addCallStarted(); + this.streamTracker.addCallStarted(); + statsTracker = { + onCallEnd: status => { + if (status.code === constants_1.Status.OK) { + this.callTracker.addCallSucceeded(); + } + else { + this.callTracker.addCallFailed(); + } + }, + }; + } + else { + statsTracker = {}; + } + return this.transport.createCall(metadata, host, method, listener, statsTracker); + } + /** + * If the subchannel is currently IDLE, start connecting and switch to the + * CONNECTING state. If the subchannel is current in TRANSIENT_FAILURE, + * the next time it would transition to IDLE, start connecting again instead. + * Otherwise, do nothing. + */ + startConnecting() { + process.nextTick(() => { + /* First, try to transition from IDLE to connecting. If that doesn't happen + * because the state is not currently IDLE, check if it is + * TRANSIENT_FAILURE, and if so indicate that it should go back to + * connecting after the backoff timer ends. Otherwise do nothing */ + if (!this.transitionToState([connectivity_state_1.ConnectivityState.IDLE], connectivity_state_1.ConnectivityState.CONNECTING)) { + if (this.connectivityState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { + this.continueConnecting = true; + } + } + }); + } + /** + * Get the subchannel's current connectivity state. + */ + getConnectivityState() { + return this.connectivityState; + } + /** + * Add a listener function to be called whenever the subchannel's + * connectivity state changes. + * @param listener + */ + addConnectivityStateListener(listener) { + this.stateListeners.add(listener); + } + /** + * Remove a listener previously added with `addConnectivityStateListener` + * @param listener A reference to a function previously passed to + * `addConnectivityStateListener` + */ + removeConnectivityStateListener(listener) { + this.stateListeners.delete(listener); + } + /** + * Reset the backoff timeout, and immediately start connecting if in backoff. + */ + resetBackoff() { + process.nextTick(() => { + this.backoffTimeout.reset(); + this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING); + }); + } + getAddress() { + return this.subchannelAddressString; + } + getChannelzRef() { + return this.channelzRef; + } + isHealthy() { + return true; + } + addHealthStateWatcher(listener) { + // Do nothing with the listener + } + removeHealthStateWatcher(listener) { + // Do nothing with the listener + } + getRealSubchannel() { + return this; + } + realSubchannelEquals(other) { + return other.getRealSubchannel() === this; + } + throttleKeepalive(newKeepaliveTime) { + if (newKeepaliveTime > this.keepaliveTime) { + this.keepaliveTime = newKeepaliveTime; + } + } +} +exports.Subchannel = Subchannel; +//# sourceMappingURL=subchannel.js.map + +/***/ }), + +/***/ 86581: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2019 gRPC authors. + * + * 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 })); +exports.getDefaultRootsData = exports.CIPHER_SUITES = void 0; +const fs = __nccwpck_require__(57147); +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; +function getDefaultRootsData() { + if (DEFAULT_ROOTS_FILE_PATH) { + if (defaultRootsData === null) { + defaultRootsData = fs.readFileSync(DEFAULT_ROOTS_FILE_PATH); + } + return defaultRootsData; + } + return null; +} +exports.getDefaultRootsData = getDefaultRootsData; +//# sourceMappingURL=tls-helpers.js.map + +/***/ }), + +/***/ 46690: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright 2023 gRPC authors. + * + * 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 })); +exports.Http2SubchannelConnector = void 0; +const http2 = __nccwpck_require__(85158); +const tls_1 = __nccwpck_require__(24404); +const channelz_1 = __nccwpck_require__(79975); +const constants_1 = __nccwpck_require__(90634); +const http_proxy_1 = __nccwpck_require__(24000); +const logging = __nccwpck_require__(35993); +const resolver_1 = __nccwpck_require__(31594); +const subchannel_address_1 = __nccwpck_require__(99905); +const uri_parser_1 = __nccwpck_require__(65974); +const net = __nccwpck_require__(41808); +const subchannel_call_1 = __nccwpck_require__(86940); +const call_number_1 = __nccwpck_require__(70380); +const TRACER_NAME = 'transport'; +const FLOW_CONTROL_TRACER_NAME = 'transport_flowctrl'; +const clientVersion = (__nccwpck_require__(56569)/* .version */ .i8); +const { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_TE, HTTP2_HEADER_USER_AGENT, } = http2.constants; +const KEEPALIVE_TIMEOUT_MS = 20000; +const tooManyPingsData = Buffer.from('too_many_pings', 'ascii'); +class Http2Transport { + constructor(session, subchannelAddress, options, + /** + * Name of the remote server, if it is not the same as the subchannel + * address, i.e. if connecting through an HTTP CONNECT proxy. + */ + remoteName) { + this.session = session; + this.options = options; + this.remoteName = remoteName; + /** + * The amount of time in between sending pings + */ + this.keepaliveTimeMs = -1; + /** + * The amount of time to wait for an acknowledgement after sending a ping + */ + this.keepaliveTimeoutMs = KEEPALIVE_TIMEOUT_MS; + /** + * Timer reference for timeout that indicates when to send the next ping + */ + this.keepaliveTimerId = null; + /** + * Indicates that the keepalive timer ran out while there were no active + * calls, and a ping should be sent the next time a call starts. + */ + this.pendingSendKeepalivePing = false; + /** + * Timer reference tracking when the most recent ping will be considered lost + */ + this.keepaliveTimeoutId = null; + /** + * Indicates whether keepalive pings should be sent without any active calls + */ + this.keepaliveWithoutCalls = false; + this.activeCalls = new Set(); + this.disconnectListeners = []; + this.disconnectHandled = false; + this.channelzEnabled = true; + this.keepalivesSent = 0; + this.messagesSent = 0; + this.messagesReceived = 0; + this.lastMessageSentTimestamp = null; + this.lastMessageReceivedTimestamp = null; + /* Populate subchannelAddressString and channelzRef before doing anything + * else, because they are used in the trace methods. */ + this.subchannelAddressString = (0, subchannel_address_1.subchannelAddressToString)(subchannelAddress); + if (options['grpc.enable_channelz'] === 0) { + this.channelzEnabled = false; + this.streamTracker = new channelz_1.ChannelzCallTrackerStub(); + } + else { + this.streamTracker = new channelz_1.ChannelzCallTracker(); + } + this.channelzRef = (0, channelz_1.registerChannelzSocket)(this.subchannelAddressString, () => this.getChannelzInfo(), this.channelzEnabled); + // Build user-agent string. + this.userAgent = [ + options['grpc.primary_user_agent'], + `grpc-node-js/${clientVersion}`, + options['grpc.secondary_user_agent'], + ] + .filter(e => e) + .join(' '); // remove falsey values first + if ('grpc.keepalive_time_ms' in options) { + this.keepaliveTimeMs = options['grpc.keepalive_time_ms']; + } + if ('grpc.keepalive_timeout_ms' in options) { + this.keepaliveTimeoutMs = options['grpc.keepalive_timeout_ms']; + } + if ('grpc.keepalive_permit_without_calls' in options) { + this.keepaliveWithoutCalls = + options['grpc.keepalive_permit_without_calls'] === 1; + } + else { + this.keepaliveWithoutCalls = false; + } + session.once('close', () => { + this.trace('session closed'); + this.stopKeepalivePings(); + this.handleDisconnect(); + }); + session.once('goaway', (errorCode, lastStreamID, opaqueData) => { + let tooManyPings = false; + /* See the last paragraph of + * https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#basic-keepalive */ + if (errorCode === http2.constants.NGHTTP2_ENHANCE_YOUR_CALM && + opaqueData && + opaqueData.equals(tooManyPingsData)) { + tooManyPings = true; + } + this.trace('connection closed by GOAWAY with code ' + + errorCode + + ' and data ' + + (opaqueData === null || opaqueData === void 0 ? void 0 : opaqueData.toString())); + this.reportDisconnectToOwner(tooManyPings); + }); + session.once('error', error => { + /* Do nothing here. Any error should also trigger a close event, which is + * where we want to handle that. */ + this.trace('connection closed with error ' + error.message); + }); + if (logging.isTracerEnabled(TRACER_NAME)) { + session.on('remoteSettings', (settings) => { + this.trace('new settings received' + + (this.session !== session ? ' on the old connection' : '') + + ': ' + + JSON.stringify(settings)); + }); + session.on('localSettings', (settings) => { + this.trace('local settings acknowledged by remote' + + (this.session !== session ? ' on the old connection' : '') + + ': ' + + JSON.stringify(settings)); + }); + } + /* Start the keepalive timer last, because this can trigger trace logs, + * which should only happen after everything else is set up. */ + if (this.keepaliveWithoutCalls) { + this.maybeStartKeepalivePingTimer(); + } + } + getChannelzInfo() { + var _a, _b, _c; + const sessionSocket = this.session.socket; + const remoteAddress = sessionSocket.remoteAddress + ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.remoteAddress, sessionSocket.remotePort) + : null; + const localAddress = sessionSocket.localAddress + ? (0, subchannel_address_1.stringToSubchannelAddress)(sessionSocket.localAddress, sessionSocket.localPort) + : null; + let tlsInfo; + if (this.session.encrypted) { + const tlsSocket = sessionSocket; + const cipherInfo = tlsSocket.getCipher(); + const certificate = tlsSocket.getCertificate(); + const peerCertificate = tlsSocket.getPeerCertificate(); + tlsInfo = { + cipherSuiteStandardName: (_a = cipherInfo.standardName) !== null && _a !== void 0 ? _a : null, + cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name, + localCertificate: certificate && 'raw' in certificate ? certificate.raw : null, + remoteCertificate: peerCertificate && 'raw' in peerCertificate + ? peerCertificate.raw + : null, + }; + } + else { + tlsInfo = null; + } + const socketInfo = { + remoteAddress: remoteAddress, + localAddress: localAddress, + security: tlsInfo, + remoteName: this.remoteName, + streamsStarted: this.streamTracker.callsStarted, + streamsSucceeded: this.streamTracker.callsSucceeded, + streamsFailed: this.streamTracker.callsFailed, + messagesSent: this.messagesSent, + messagesReceived: this.messagesReceived, + keepAlivesSent: this.keepalivesSent, + lastLocalStreamCreatedTimestamp: this.streamTracker.lastCallStartedTimestamp, + lastRemoteStreamCreatedTimestamp: null, + lastMessageSentTimestamp: this.lastMessageSentTimestamp, + lastMessageReceivedTimestamp: this.lastMessageReceivedTimestamp, + localFlowControlWindow: (_b = this.session.state.localWindowSize) !== null && _b !== void 0 ? _b : null, + remoteFlowControlWindow: (_c = this.session.state.remoteWindowSize) !== null && _c !== void 0 ? _c : null, + }; + return socketInfo; + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' + + this.channelzRef.id + + ') ' + + this.subchannelAddressString + + ' ' + + text); + } + keepaliveTrace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, 'keepalive', '(' + + this.channelzRef.id + + ') ' + + this.subchannelAddressString + + ' ' + + text); + } + flowControlTrace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, FLOW_CONTROL_TRACER_NAME, '(' + + this.channelzRef.id + + ') ' + + this.subchannelAddressString + + ' ' + + text); + } + internalsTrace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, 'transport_internals', '(' + + this.channelzRef.id + + ') ' + + this.subchannelAddressString + + ' ' + + text); + } + /** + * Indicate to the owner of this object that this transport should no longer + * be used. That happens if the connection drops, or if the server sends a + * GOAWAY. + * @param tooManyPings If true, this was triggered by a GOAWAY with data + * indicating that the session was closed becaues the client sent too many + * pings. + * @returns + */ + reportDisconnectToOwner(tooManyPings) { + if (this.disconnectHandled) { + return; + } + this.disconnectHandled = true; + this.disconnectListeners.forEach(listener => listener(tooManyPings)); + } + /** + * Handle connection drops, but not GOAWAYs. + */ + handleDisconnect() { + this.reportDisconnectToOwner(false); + /* Give calls an event loop cycle to finish naturally before reporting the + * disconnnection to them. */ + setImmediate(() => { + for (const call of this.activeCalls) { + call.onDisconnect(); + } + }); + } + addDisconnectListener(listener) { + this.disconnectListeners.push(listener); + } + clearKeepaliveTimer() { + if (!this.keepaliveTimerId) { + return; + } + clearTimeout(this.keepaliveTimerId); + this.keepaliveTimerId = null; + } + clearKeepaliveTimeout() { + if (!this.keepaliveTimeoutId) { + return; + } + clearTimeout(this.keepaliveTimeoutId); + this.keepaliveTimeoutId = null; + } + canSendPing() { + return (this.keepaliveTimeMs > 0 && + (this.keepaliveWithoutCalls || this.activeCalls.size > 0)); + } + maybeSendPing() { + var _a, _b; + this.clearKeepaliveTimer(); + if (!this.canSendPing()) { + this.pendingSendKeepalivePing = true; + return; + } + if (this.channelzEnabled) { + this.keepalivesSent += 1; + } + this.keepaliveTrace('Sending ping with timeout ' + this.keepaliveTimeoutMs + 'ms'); + if (!this.keepaliveTimeoutId) { + this.keepaliveTimeoutId = setTimeout(() => { + this.keepaliveTrace('Ping timeout passed without response'); + this.handleDisconnect(); + }, this.keepaliveTimeoutMs); + (_b = (_a = this.keepaliveTimeoutId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + try { + this.session.ping((err, duration, payload) => { + if (err) { + this.keepaliveTrace('Ping failed with error ' + err.message); + this.handleDisconnect(); + } + this.keepaliveTrace('Received ping response'); + this.clearKeepaliveTimeout(); + this.maybeStartKeepalivePingTimer(); + }); + } + catch (e) { + /* If we fail to send a ping, the connection is no longer functional, so + * we should discard it. */ + this.handleDisconnect(); + } + } + /** + * Starts the keepalive ping timer if appropriate. If the timer already ran + * out while there were no active requests, instead send a ping immediately. + * If the ping timer is already running or a ping is currently in flight, + * instead do nothing and wait for them to resolve. + */ + maybeStartKeepalivePingTimer() { + var _a, _b; + if (!this.canSendPing()) { + return; + } + if (this.pendingSendKeepalivePing) { + this.pendingSendKeepalivePing = false; + this.maybeSendPing(); + } + else if (!this.keepaliveTimerId && !this.keepaliveTimeoutId) { + this.keepaliveTrace('Starting keepalive timer for ' + this.keepaliveTimeMs + 'ms'); + this.keepaliveTimerId = setTimeout(() => { + this.maybeSendPing(); + }, this.keepaliveTimeMs); + (_b = (_a = this.keepaliveTimerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); + } + /* Otherwise, there is already either a keepalive timer or a ping pending, + * wait for those to resolve. */ + } + stopKeepalivePings() { + if (this.keepaliveTimerId) { + clearTimeout(this.keepaliveTimerId); + this.keepaliveTimerId = null; + } + this.clearKeepaliveTimeout(); + } + removeActiveCall(call) { + this.activeCalls.delete(call); + if (this.activeCalls.size === 0) { + this.session.unref(); + } + } + addActiveCall(call) { + this.activeCalls.add(call); + if (this.activeCalls.size === 1) { + this.session.ref(); + if (!this.keepaliveWithoutCalls) { + this.maybeStartKeepalivePingTimer(); + } + } + } + createCall(metadata, host, method, listener, subchannelCallStatsTracker) { + const headers = metadata.toHttp2Headers(); + headers[HTTP2_HEADER_AUTHORITY] = host; + headers[HTTP2_HEADER_USER_AGENT] = this.userAgent; + headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/grpc'; + headers[HTTP2_HEADER_METHOD] = 'POST'; + headers[HTTP2_HEADER_PATH] = method; + headers[HTTP2_HEADER_TE] = 'trailers'; + let http2Stream; + /* In theory, if an error is thrown by session.request because session has + * become unusable (e.g. because it has received a goaway), this subchannel + * should soon see the corresponding close or goaway event anyway and leave + * READY. But we have seen reports that this does not happen + * (https://github.com/googleapis/nodejs-firestore/issues/1023#issuecomment-653204096) + * so for defense in depth, we just discard the session when we see an + * error here. + */ + try { + http2Stream = this.session.request(headers); + } + catch (e) { + this.handleDisconnect(); + throw e; + } + this.flowControlTrace('local window size: ' + + this.session.state.localWindowSize + + ' remote window size: ' + + this.session.state.remoteWindowSize); + this.internalsTrace('session.closed=' + + this.session.closed + + ' session.destroyed=' + + this.session.destroyed + + ' session.socket.destroyed=' + + this.session.socket.destroyed); + let eventTracker; + // eslint-disable-next-line prefer-const + let call; + if (this.channelzEnabled) { + this.streamTracker.addCallStarted(); + eventTracker = { + addMessageSent: () => { + var _a; + this.messagesSent += 1; + this.lastMessageSentTimestamp = new Date(); + (_a = subchannelCallStatsTracker.addMessageSent) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker); + }, + addMessageReceived: () => { + var _a; + this.messagesReceived += 1; + this.lastMessageReceivedTimestamp = new Date(); + (_a = subchannelCallStatsTracker.addMessageReceived) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker); + }, + onCallEnd: status => { + var _a; + (_a = subchannelCallStatsTracker.onCallEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, status); + this.removeActiveCall(call); + }, + onStreamEnd: success => { + var _a; + if (success) { + this.streamTracker.addCallSucceeded(); + } + else { + this.streamTracker.addCallFailed(); + } + (_a = subchannelCallStatsTracker.onStreamEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, success); + }, + }; + } + else { + eventTracker = { + addMessageSent: () => { + var _a; + (_a = subchannelCallStatsTracker.addMessageSent) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker); + }, + addMessageReceived: () => { + var _a; + (_a = subchannelCallStatsTracker.addMessageReceived) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker); + }, + onCallEnd: status => { + var _a; + (_a = subchannelCallStatsTracker.onCallEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, status); + this.removeActiveCall(call); + }, + onStreamEnd: success => { + var _a; + (_a = subchannelCallStatsTracker.onStreamEnd) === null || _a === void 0 ? void 0 : _a.call(subchannelCallStatsTracker, success); + }, + }; + } + call = new subchannel_call_1.Http2SubchannelCall(http2Stream, eventTracker, listener, this, (0, call_number_1.getNextCallNumber)()); + this.addActiveCall(call); + return call; + } + getChannelzRef() { + return this.channelzRef; + } + getPeerName() { + return this.subchannelAddressString; + } + getOptions() { + return this.options; + } + shutdown() { + this.session.close(); + (0, channelz_1.unregisterChannelzRef)(this.channelzRef); + } +} +class Http2SubchannelConnector { + constructor(channelTarget) { + this.channelTarget = channelTarget; + this.session = null; + this.isShutdown = false; + } + trace(text) { + logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, (0, uri_parser_1.uriToString)(this.channelTarget) + ' ' + text); + } + createSession(address, credentials, options, proxyConnectionResult) { + if (this.isShutdown) { + return Promise.reject(); + } + return new Promise((resolve, reject) => { + var _a, _b, _c, _d; + let remoteName; + if (proxyConnectionResult.realTarget) { + remoteName = (0, uri_parser_1.uriToString)(proxyConnectionResult.realTarget); + this.trace('creating HTTP/2 session through proxy to ' + + (0, uri_parser_1.uriToString)(proxyConnectionResult.realTarget)); + } + else { + remoteName = null; + this.trace('creating HTTP/2 session to ' + (0, subchannel_address_1.subchannelAddressToString)(address)); + } + const targetAuthority = (0, resolver_1.getDefaultAuthority)((_a = proxyConnectionResult.realTarget) !== null && _a !== void 0 ? _a : this.channelTarget); + let connectionOptions = credentials._getConnectionOptions() || {}; + connectionOptions.maxSendHeaderBlockLength = Number.MAX_SAFE_INTEGER; + if ('grpc-node.max_session_memory' in options) { + connectionOptions.maxSessionMemory = + options['grpc-node.max_session_memory']; + } + else { + /* By default, set a very large max session memory limit, to effectively + * disable enforcement of the limit. Some testing indicates that Node's + * behavior degrades badly when this limit is reached, so we solve that + * by disabling the check entirely. */ + connectionOptions.maxSessionMemory = Number.MAX_SAFE_INTEGER; + } + let addressScheme = 'http://'; + if ('secureContext' in connectionOptions) { + addressScheme = 'https://'; + // If provided, the value of grpc.ssl_target_name_override should be used + // to override the target hostname when checking server identity. + // This option is used for testing only. + if (options['grpc.ssl_target_name_override']) { + const sslTargetNameOverride = options['grpc.ssl_target_name_override']; + const originalCheckServerIdentity = (_b = connectionOptions.checkServerIdentity) !== null && _b !== void 0 ? _b : tls_1.checkServerIdentity; + connectionOptions.checkServerIdentity = (host, cert) => { + return originalCheckServerIdentity(sslTargetNameOverride, cert); + }; + connectionOptions.servername = sslTargetNameOverride; + } + else { + const authorityHostname = (_d = (_c = (0, uri_parser_1.splitHostPort)(targetAuthority)) === null || _c === void 0 ? void 0 : _c.host) !== null && _d !== void 0 ? _d : 'localhost'; + // We want to always set servername to support SNI + connectionOptions.servername = authorityHostname; + } + if (proxyConnectionResult.socket) { + /* This is part of the workaround for + * https://github.com/nodejs/node/issues/32922. Without that bug, + * proxyConnectionResult.socket would always be a plaintext socket and + * this would say + * connectionOptions.socket = proxyConnectionResult.socket; */ + connectionOptions.createConnection = (authority, option) => { + return proxyConnectionResult.socket; + }; + } + } + else { + /* In all but the most recent versions of Node, http2.connect does not use + * the options when establishing plaintext connections, so we need to + * establish that connection explicitly. */ + connectionOptions.createConnection = (authority, option) => { + if (proxyConnectionResult.socket) { + return proxyConnectionResult.socket; + } + else { + /* net.NetConnectOpts is declared in a way that is more restrictive + * than what net.connect will actually accept, so we use the type + * assertion to work around that. */ + return net.connect(address); + } + }; + } + connectionOptions = Object.assign(Object.assign(Object.assign({}, connectionOptions), address), { enableTrace: options['grpc-node.tls_enable_trace'] === 1 }); + /* http2.connect uses the options here: + * https://github.com/nodejs/node/blob/70c32a6d190e2b5d7b9ff9d5b6a459d14e8b7d59/lib/internal/http2/core.js#L3028-L3036 + * The spread operator overides earlier values with later ones, so any port + * or host values in the options will be used rather than any values extracted + * from the first argument. In addition, the path overrides the host and port, + * as documented for plaintext connections here: + * https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener + * and for TLS connections here: + * https://nodejs.org/api/tls.html#tls_tls_connect_options_callback. In + * earlier versions of Node, http2.connect passes these options to + * tls.connect but not net.connect, so in the insecure case we still need + * to set the createConnection option above to create the connection + * explicitly. We cannot do that in the TLS case because http2.connect + * passes necessary additional options to tls.connect. + * The first argument just needs to be parseable as a URL and the scheme + * determines whether the connection will be established over TLS or not. + */ + const session = http2.connect(addressScheme + targetAuthority, connectionOptions); + this.session = session; + let errorMessage = 'Failed to connect'; + session.unref(); + session.once('connect', () => { + session.removeAllListeners(); + resolve(new Http2Transport(session, address, options, remoteName)); + this.session = null; + }); + session.once('close', () => { + this.session = null; + // Leave time for error event to happen before rejecting + setImmediate(() => { + reject(`${errorMessage} (${new Date().toISOString()})`); + }); + }); + session.once('error', error => { + errorMessage = error.message; + this.trace('connection failed with error ' + errorMessage); + }); + }); + } + connect(address, credentials, options) { + var _a, _b, _c; + if (this.isShutdown) { + return Promise.reject(); + } + /* Pass connection options through to the proxy so that it's able to + * upgrade it's connection to support tls if needed. + * This is a workaround for https://github.com/nodejs/node/issues/32922 + * See https://github.com/grpc/grpc-node/pull/1369 for more info. */ + const connectionOptions = credentials._getConnectionOptions() || {}; + if ('secureContext' in connectionOptions) { + connectionOptions.ALPNProtocols = ['h2']; + // If provided, the value of grpc.ssl_target_name_override should be used + // to override the target hostname when checking server identity. + // This option is used for testing only. + if (options['grpc.ssl_target_name_override']) { + const sslTargetNameOverride = options['grpc.ssl_target_name_override']; + const originalCheckServerIdentity = (_a = connectionOptions.checkServerIdentity) !== null && _a !== void 0 ? _a : tls_1.checkServerIdentity; + connectionOptions.checkServerIdentity = (host, cert) => { + return originalCheckServerIdentity(sslTargetNameOverride, cert); + }; + connectionOptions.servername = sslTargetNameOverride; + } + else { + if ('grpc.http_connect_target' in options) { + /* This is more or less how servername will be set in createSession + * if a connection is successfully established through the proxy. + * If the proxy is not used, these connectionOptions are discarded + * anyway */ + const targetPath = (0, resolver_1.getDefaultAuthority)((_b = (0, uri_parser_1.parseUri)(options['grpc.http_connect_target'])) !== null && _b !== void 0 ? _b : { + path: 'localhost', + }); + const hostPort = (0, uri_parser_1.splitHostPort)(targetPath); + connectionOptions.servername = (_c = hostPort === null || hostPort === void 0 ? void 0 : hostPort.host) !== null && _c !== void 0 ? _c : targetPath; + } + } + if (options['grpc-node.tls_enable_trace']) { + connectionOptions.enableTrace = true; + } + } + return (0, http_proxy_1.getProxiedConnection)(address, options, connectionOptions).then(result => this.createSession(address, credentials, options, result)); + } + shutdown() { + var _a; + this.isShutdown = true; + (_a = this.session) === null || _a === void 0 ? void 0 : _a.close(); + this.session = null; + } +} +exports.Http2SubchannelConnector = Http2SubchannelConnector; +//# sourceMappingURL=transport.js.map + +/***/ }), + +/***/ 65974: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright 2020 gRPC authors. + * + * 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 })); +exports.uriToString = exports.combineHostPort = exports.splitHostPort = exports.parseUri = void 0; +/* + * The groups correspond to URI parts as follows: + * 1. scheme + * 2. authority + * 3. path + */ +const URI_REGEX = /^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/; +function parseUri(uriString) { + const parsedUri = URI_REGEX.exec(uriString); + if (parsedUri === null) { + return null; + } + return { + scheme: parsedUri[1], + authority: parsedUri[2], + path: parsedUri[3], + }; +} +exports.parseUri = parseUri; +const NUMBER_REGEX = /^\d+$/; +function splitHostPort(path) { + if (path.startsWith('[')) { + const hostEnd = path.indexOf(']'); + if (hostEnd === -1) { + return null; + } + const host = path.substring(1, hostEnd); + /* Only an IPv6 address should be in bracketed notation, and an IPv6 + * address should have at least one colon */ + if (host.indexOf(':') === -1) { + return null; + } + if (path.length > hostEnd + 1) { + if (path[hostEnd + 1] === ':') { + const portString = path.substring(hostEnd + 2); + if (NUMBER_REGEX.test(portString)) { + return { + host: host, + port: +portString, + }; + } + else { + return null; + } + } + else { + return null; + } + } + else { + return { + host, + }; + } + } + else { + const splitPath = path.split(':'); + /* Exactly one colon means that this is host:port. Zero colons means that + * there is no port. And multiple colons means that this is a bare IPv6 + * address with no port */ + if (splitPath.length === 2) { + if (NUMBER_REGEX.test(splitPath[1])) { + return { + host: splitPath[0], + port: +splitPath[1], + }; + } + else { + return null; + } + } + else { + return { + host: path, + }; + } + } +} +exports.splitHostPort = splitHostPort; +function combineHostPort(hostPort) { + if (hostPort.port === undefined) { + return hostPort.host; + } + else { + // Only an IPv6 host should include a colon + if (hostPort.host.includes(':')) { + return `[${hostPort.host}]:${hostPort.port}`; + } + else { + return `${hostPort.host}:${hostPort.port}`; + } + } +} +exports.combineHostPort = combineHostPort; +function uriToString(uri) { + let result = ''; + if (uri.scheme !== undefined) { + result += uri.scheme + ':'; + } + if (uri.authority !== undefined) { + result += '//' + uri.authority + '/'; + } + result += uri.path; + return result; +} +exports.uriToString = uriToString; +//# sourceMappingURL=uri-parser.js.map + +/***/ }), + +/***/ 98171: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + +/** + * @license + * Copyright 2018 gRPC authors. + * + * 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. + * + */ +__webpack_unused_export__ = ({ value: true }); +__webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.J_ = __webpack_unused_export__ = exports.Cp = __webpack_unused_export__ = __webpack_unused_export__ = void 0; +const camelCase = __nccwpck_require__(7994); +const Protobuf = __nccwpck_require__(85881); +const descriptor = __nccwpck_require__(21629); +const util_1 = __nccwpck_require__(13245); +const Long = __nccwpck_require__(52694); +__webpack_unused_export__ = Long; +function isAnyExtension(obj) { + return ('@type' in obj) && (typeof obj['@type'] === 'string'); +} +__webpack_unused_export__ = isAnyExtension; +var IdempotencyLevel; +(function (IdempotencyLevel) { + IdempotencyLevel["IDEMPOTENCY_UNKNOWN"] = "IDEMPOTENCY_UNKNOWN"; + IdempotencyLevel["NO_SIDE_EFFECTS"] = "NO_SIDE_EFFECTS"; + IdempotencyLevel["IDEMPOTENT"] = "IDEMPOTENT"; +})(IdempotencyLevel = exports.Cp || (exports.Cp = {})); +const descriptorOptions = { + longs: String, + enums: String, + bytes: String, + defaults: true, + oneofs: true, + json: true, +}; +function joinName(baseName, name) { + if (baseName === '') { + return name; + } + else { + return baseName + '.' + name; + } +} +function isHandledReflectionObject(obj) { + return (obj instanceof Protobuf.Service || + obj instanceof Protobuf.Type || + obj instanceof Protobuf.Enum); +} +function isNamespaceBase(obj) { + return obj instanceof Protobuf.Namespace || obj instanceof Protobuf.Root; +} +function getAllHandledReflectionObjects(obj, parentName) { + const objName = joinName(parentName, obj.name); + if (isHandledReflectionObject(obj)) { + return [[objName, obj]]; + } + else { + if (isNamespaceBase(obj) && typeof obj.nested !== 'undefined') { + return Object.keys(obj.nested) + .map(name => { + return getAllHandledReflectionObjects(obj.nested[name], objName); + }) + .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []); + } + } + return []; +} +function createDeserializer(cls, options) { + return function deserialize(argBuf) { + return cls.toObject(cls.decode(argBuf), options); + }; +} +function createSerializer(cls) { + return function serialize(arg) { + if (Array.isArray(arg)) { + throw new Error(`Failed to serialize message: expected object with ${cls.name} structure, got array instead`); + } + const message = cls.fromObject(arg); + return cls.encode(message).finish(); + }; +} +function mapMethodOptions(options) { + return (options || []).reduce((obj, item) => { + for (const [key, value] of Object.entries(item)) { + switch (key) { + case 'uninterpreted_option': + obj.uninterpreted_option.push(item.uninterpreted_option); + break; + default: + obj[key] = value; + } + } + return obj; + }, { + deprecated: false, + idempotency_level: IdempotencyLevel.IDEMPOTENCY_UNKNOWN, + uninterpreted_option: [], + }); +} +function createMethodDefinition(method, serviceName, options, fileDescriptors) { + /* This is only ever called after the corresponding root.resolveAll(), so we + * can assume that the resolved request and response types are non-null */ + const requestType = method.resolvedRequestType; + const responseType = method.resolvedResponseType; + return { + path: '/' + serviceName + '/' + method.name, + requestStream: !!method.requestStream, + responseStream: !!method.responseStream, + requestSerialize: createSerializer(requestType), + requestDeserialize: createDeserializer(requestType, options), + responseSerialize: createSerializer(responseType), + responseDeserialize: createDeserializer(responseType, options), + // TODO(murgatroid99): Find a better way to handle this + originalName: camelCase(method.name), + requestType: createMessageDefinition(requestType, fileDescriptors), + responseType: createMessageDefinition(responseType, fileDescriptors), + options: mapMethodOptions(method.parsedOptions), + }; +} +function createServiceDefinition(service, name, options, fileDescriptors) { + const def = {}; + for (const method of service.methodsArray) { + def[method.name] = createMethodDefinition(method, name, options, fileDescriptors); + } + return def; +} +function createMessageDefinition(message, fileDescriptors) { + const messageDescriptor = message.toDescriptor('proto3'); + return { + format: 'Protocol Buffer 3 DescriptorProto', + type: messageDescriptor.$type.toObject(messageDescriptor, descriptorOptions), + fileDescriptorProtos: fileDescriptors, + }; +} +function createEnumDefinition(enumType, fileDescriptors) { + const enumDescriptor = enumType.toDescriptor('proto3'); + return { + format: 'Protocol Buffer 3 EnumDescriptorProto', + type: enumDescriptor.$type.toObject(enumDescriptor, descriptorOptions), + fileDescriptorProtos: fileDescriptors, + }; +} +/** + * function createDefinition(obj: Protobuf.Service, name: string, options: + * Options): ServiceDefinition; function createDefinition(obj: Protobuf.Type, + * name: string, options: Options): MessageTypeDefinition; function + * createDefinition(obj: Protobuf.Enum, name: string, options: Options): + * EnumTypeDefinition; + */ +function createDefinition(obj, name, options, fileDescriptors) { + if (obj instanceof Protobuf.Service) { + return createServiceDefinition(obj, name, options, fileDescriptors); + } + else if (obj instanceof Protobuf.Type) { + return createMessageDefinition(obj, fileDescriptors); + } + else if (obj instanceof Protobuf.Enum) { + return createEnumDefinition(obj, fileDescriptors); + } + else { + throw new Error('Type mismatch in reflection object handling'); + } +} +function createPackageDefinition(root, options) { + const def = {}; + root.resolveAll(); + const descriptorList = root.toDescriptor('proto3').file; + const bufferList = descriptorList.map(value => Buffer.from(descriptor.FileDescriptorProto.encode(value).finish())); + for (const [name, obj] of getAllHandledReflectionObjects(root, '')) { + def[name] = createDefinition(obj, name, options, bufferList); + } + return def; +} +function createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options) { + options = options || {}; + const root = Protobuf.Root.fromDescriptor(decodedDescriptorSet); + root.resolveAll(); + return createPackageDefinition(root, options); +} +/** + * Load a .proto file with the specified options. + * @param filename One or multiple file paths to load. Can be an absolute path + * or relative to an include path. + * @param options.keepCase Preserve field names. The default is to change them + * to camel case. + * @param options.longs The type that should be used to represent `long` values. + * Valid options are `Number` and `String`. Defaults to a `Long` object type + * from a library. + * @param options.enums The type that should be used to represent `enum` values. + * The only valid option is `String`. Defaults to the numeric value. + * @param options.bytes The type that should be used to represent `bytes` + * values. Valid options are `Array` and `String`. The default is to use + * `Buffer`. + * @param options.defaults Set default values on output objects. Defaults to + * `false`. + * @param options.arrays Set empty arrays for missing array values even if + * `defaults` is `false`. Defaults to `false`. + * @param options.objects Set empty objects for missing object values even if + * `defaults` is `false`. Defaults to `false`. + * @param options.oneofs Set virtual oneof properties to the present field's + * name + * @param options.json Represent Infinity and NaN as strings in float fields, + * and automatically decode google.protobuf.Any values. + * @param options.includeDirs Paths to search for imported `.proto` files. + */ +function load(filename, options) { + return (0, util_1.loadProtosWithOptions)(filename, options).then(loadedRoot => { + return createPackageDefinition(loadedRoot, options); + }); +} +__webpack_unused_export__ = load; +function loadSync(filename, options) { + const loadedRoot = (0, util_1.loadProtosWithOptionsSync)(filename, options); + return createPackageDefinition(loadedRoot, options); +} +exports.J_ = loadSync; +function fromJSON(json, options) { + options = options || {}; + const loadedRoot = Protobuf.Root.fromJSON(json); + loadedRoot.resolveAll(); + return createPackageDefinition(loadedRoot, options); +} +__webpack_unused_export__ = fromJSON; +function loadFileDescriptorSetFromBuffer(descriptorSet, options) { + const decodedDescriptorSet = descriptor.FileDescriptorSet.decode(descriptorSet); + return createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options); +} +__webpack_unused_export__ = loadFileDescriptorSetFromBuffer; +function loadFileDescriptorSetFromObject(descriptorSet, options) { + const decodedDescriptorSet = descriptor.FileDescriptorSet.fromObject(descriptorSet); + return createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options); +} +__webpack_unused_export__ = loadFileDescriptorSetFromObject; +(0, util_1.addCommonProtos)(); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 13245: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/** + * @license + * Copyright 2018 gRPC authors. + * + * 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 })); +exports.addCommonProtos = exports.loadProtosWithOptionsSync = exports.loadProtosWithOptions = void 0; +const fs = __nccwpck_require__(57147); +const path = __nccwpck_require__(71017); +const Protobuf = __nccwpck_require__(85881); +function addIncludePathResolver(root, includePaths) { + const originalResolvePath = root.resolvePath; + root.resolvePath = (origin, target) => { + if (path.isAbsolute(target)) { + return target; + } + for (const directory of includePaths) { + const fullPath = path.join(directory, target); + try { + fs.accessSync(fullPath, fs.constants.R_OK); + return fullPath; + } + catch (err) { + continue; + } + } + process.emitWarning(`${target} not found in any of the include paths ${includePaths}`); + return originalResolvePath(origin, target); + }; +} +async function loadProtosWithOptions(filename, options) { + const root = new Protobuf.Root(); + options = options || {}; + if (!!options.includeDirs) { + if (!Array.isArray(options.includeDirs)) { + return Promise.reject(new Error('The includeDirs option must be an array')); + } + addIncludePathResolver(root, options.includeDirs); + } + const loadedRoot = await root.load(filename, options); + loadedRoot.resolveAll(); + return loadedRoot; +} +exports.loadProtosWithOptions = loadProtosWithOptions; +function loadProtosWithOptionsSync(filename, options) { + const root = new Protobuf.Root(); + options = options || {}; + if (!!options.includeDirs) { + if (!Array.isArray(options.includeDirs)) { + throw new Error('The includeDirs option must be an array'); + } + addIncludePathResolver(root, options.includeDirs); + } + const loadedRoot = root.loadSync(filename, options); + loadedRoot.resolveAll(); + return loadedRoot; +} +exports.loadProtosWithOptionsSync = loadProtosWithOptionsSync; +/** + * Load Google's well-known proto files that aren't exposed by Protobuf.js. + */ +function addCommonProtos() { + // Protobuf.js exposes: any, duration, empty, field_mask, struct, timestamp, + // and wrappers. compiler/plugin is excluded in Protobuf.js and here. + // Using constant strings for compatibility with tools like Webpack + const apiDescriptor = __nccwpck_require__(44784); + const descriptorDescriptor = __nccwpck_require__(43571); + const sourceContextDescriptor = __nccwpck_require__(73342); + const typeDescriptor = __nccwpck_require__(58783); + Protobuf.common('api', apiDescriptor.nested.google.nested.protobuf.nested); + Protobuf.common('descriptor', descriptorDescriptor.nested.google.nested.protobuf.nested); + Protobuf.common('source_context', sourceContextDescriptor.nested.google.nested.protobuf.nested); + Protobuf.common('type', typeDescriptor.nested.google.nested.protobuf.nested); +} +exports.addCommonProtos = addCommonProtos; +//# sourceMappingURL=util.js.map + +/***/ }), + +/***/ 12592: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "t", ({ + value: true +})); + +class TreeNode { + constructor(t, e, s = 1) { + this.i = undefined; + this.h = undefined; + this.o = undefined; + this.u = t; + this.l = e; + this.p = s; + } + I() { + let t = this; + const e = t.o.o === t; + if (e && t.p === 1) { + t = t.h; + } else if (t.i) { + t = t.i; + while (t.h) { + t = t.h; + } + } else { + if (e) { + return t.o; + } + let s = t.o; + while (s.i === t) { + t = s; + s = t.o; + } + t = s; + } + return t; + } + B() { + let t = this; + if (t.h) { + t = t.h; + while (t.i) { + t = t.i; + } + return t; + } else { + let e = t.o; + while (e.h === t) { + t = e; + e = t.o; + } + if (t.h !== e) { + return e; + } else return t; + } + } + _() { + const t = this.o; + const e = this.h; + const s = e.i; + if (t.o === this) t.o = e; else if (t.i === this) t.i = e; else t.h = e; + e.o = t; + e.i = this; + this.o = e; + this.h = s; + if (s) s.o = this; + return e; + } + g() { + const t = this.o; + const e = this.i; + const s = e.h; + if (t.o === this) t.o = e; else if (t.i === this) t.i = e; else t.h = e; + e.o = t; + e.h = this; + this.o = e; + this.i = s; + if (s) s.o = this; + return e; + } +} + +class TreeNodeEnableIndex extends TreeNode { + constructor() { + super(...arguments); + this.M = 1; + } + _() { + const t = super._(); + this.O(); + t.O(); + return t; + } + g() { + const t = super.g(); + this.O(); + t.O(); + return t; + } + O() { + this.M = 1; + if (this.i) { + this.M += this.i.M; + } + if (this.h) { + this.M += this.h.M; + } + } +} + +class ContainerIterator { + constructor(t = 0) { + this.iteratorType = t; + } + equals(t) { + return this.T === t.T; + } +} + +class Base { + constructor() { + this.m = 0; + } + get length() { + return this.m; + } + size() { + return this.m; + } + empty() { + return this.m === 0; + } +} + +class Container extends Base {} + +function throwIteratorAccessError() { + throw new RangeError("Iterator access denied!"); +} + +class TreeContainer extends Container { + constructor(t = function(t, e) { + if (t < e) return -1; + if (t > e) return 1; + return 0; + }, e = false) { + super(); + this.v = undefined; + this.A = t; + this.enableIndex = e; + this.N = e ? TreeNodeEnableIndex : TreeNode; + this.C = new this.N; + } + R(t, e) { + let s = this.C; + while (t) { + const i = this.A(t.u, e); + if (i < 0) { + t = t.h; + } else if (i > 0) { + s = t; + t = t.i; + } else return t; + } + return s; + } + K(t, e) { + let s = this.C; + while (t) { + const i = this.A(t.u, e); + if (i <= 0) { + t = t.h; + } else { + s = t; + t = t.i; + } + } + return s; + } + L(t, e) { + let s = this.C; + while (t) { + const i = this.A(t.u, e); + if (i < 0) { + s = t; + t = t.h; + } else if (i > 0) { + t = t.i; + } else return t; + } + return s; + } + k(t, e) { + let s = this.C; + while (t) { + const i = this.A(t.u, e); + if (i < 0) { + s = t; + t = t.h; + } else { + t = t.i; + } + } + return s; + } + P(t) { + while (true) { + const e = t.o; + if (e === this.C) return; + if (t.p === 1) { + t.p = 0; + return; + } + if (t === e.i) { + const s = e.h; + if (s.p === 1) { + s.p = 0; + e.p = 1; + if (e === this.v) { + this.v = e._(); + } else e._(); + } else { + if (s.h && s.h.p === 1) { + s.p = e.p; + e.p = 0; + s.h.p = 0; + if (e === this.v) { + this.v = e._(); + } else e._(); + return; + } else if (s.i && s.i.p === 1) { + s.p = 1; + s.i.p = 0; + s.g(); + } else { + s.p = 1; + t = e; + } + } + } else { + const s = e.i; + if (s.p === 1) { + s.p = 0; + e.p = 1; + if (e === this.v) { + this.v = e.g(); + } else e.g(); + } else { + if (s.i && s.i.p === 1) { + s.p = e.p; + e.p = 0; + s.i.p = 0; + if (e === this.v) { + this.v = e.g(); + } else e.g(); + return; + } else if (s.h && s.h.p === 1) { + s.p = 1; + s.h.p = 0; + s._(); + } else { + s.p = 1; + t = e; + } + } + } + } + } + S(t) { + if (this.m === 1) { + this.clear(); + return; + } + let e = t; + while (e.i || e.h) { + if (e.h) { + e = e.h; + while (e.i) e = e.i; + } else { + e = e.i; + } + const s = t.u; + t.u = e.u; + e.u = s; + const i = t.l; + t.l = e.l; + e.l = i; + t = e; + } + if (this.C.i === e) { + this.C.i = e.o; + } else if (this.C.h === e) { + this.C.h = e.o; + } + this.P(e); + let s = e.o; + if (e === s.i) { + s.i = undefined; + } else s.h = undefined; + this.m -= 1; + this.v.p = 0; + if (this.enableIndex) { + while (s !== this.C) { + s.M -= 1; + s = s.o; + } + } + } + U(t) { + const e = typeof t === "number" ? t : undefined; + const s = typeof t === "function" ? t : undefined; + const i = typeof t === "undefined" ? [] : undefined; + let r = 0; + let n = this.v; + const h = []; + while (h.length || n) { + if (n) { + h.push(n); + n = n.i; + } else { + n = h.pop(); + if (r === e) return n; + i && i.push(n); + s && s(n, r, this); + r += 1; + n = n.h; + } + } + return i; + } + j(t) { + while (true) { + const e = t.o; + if (e.p === 0) return; + const s = e.o; + if (e === s.i) { + const i = s.h; + if (i && i.p === 1) { + i.p = e.p = 0; + if (s === this.v) return; + s.p = 1; + t = s; + continue; + } else if (t === e.h) { + t.p = 0; + if (t.i) { + t.i.o = e; + } + if (t.h) { + t.h.o = s; + } + e.h = t.i; + s.i = t.h; + t.i = e; + t.h = s; + if (s === this.v) { + this.v = t; + this.C.o = t; + } else { + const e = s.o; + if (e.i === s) { + e.i = t; + } else e.h = t; + } + t.o = s.o; + e.o = t; + s.o = t; + s.p = 1; + } else { + e.p = 0; + if (s === this.v) { + this.v = s.g(); + } else s.g(); + s.p = 1; + return; + } + } else { + const i = s.i; + if (i && i.p === 1) { + i.p = e.p = 0; + if (s === this.v) return; + s.p = 1; + t = s; + continue; + } else if (t === e.i) { + t.p = 0; + if (t.i) { + t.i.o = s; + } + if (t.h) { + t.h.o = e; + } + s.h = t.i; + e.i = t.h; + t.i = s; + t.h = e; + if (s === this.v) { + this.v = t; + this.C.o = t; + } else { + const e = s.o; + if (e.i === s) { + e.i = t; + } else e.h = t; + } + t.o = s.o; + e.o = t; + s.o = t; + s.p = 1; + } else { + e.p = 0; + if (s === this.v) { + this.v = s._(); + } else s._(); + s.p = 1; + return; + } + } + if (this.enableIndex) { + e.O(); + s.O(); + t.O(); + } + return; + } + } + q(t, e, s) { + if (this.v === undefined) { + this.m += 1; + this.v = new this.N(t, e, 0); + this.v.o = this.C; + this.C.o = this.C.i = this.C.h = this.v; + return this.m; + } + let i; + const r = this.C.i; + const n = this.A(r.u, t); + if (n === 0) { + r.l = e; + return this.m; + } else if (n > 0) { + r.i = new this.N(t, e); + r.i.o = r; + i = r.i; + this.C.i = i; + } else { + const r = this.C.h; + const n = this.A(r.u, t); + if (n === 0) { + r.l = e; + return this.m; + } else if (n < 0) { + r.h = new this.N(t, e); + r.h.o = r; + i = r.h; + this.C.h = i; + } else { + if (s !== undefined) { + const r = s.T; + if (r !== this.C) { + const s = this.A(r.u, t); + if (s === 0) { + r.l = e; + return this.m; + } else if (s > 0) { + const s = r.I(); + const n = this.A(s.u, t); + if (n === 0) { + s.l = e; + return this.m; + } else if (n < 0) { + i = new this.N(t, e); + if (s.h === undefined) { + s.h = i; + i.o = s; + } else { + r.i = i; + i.o = r; + } + } + } + } + } + if (i === undefined) { + i = this.v; + while (true) { + const s = this.A(i.u, t); + if (s > 0) { + if (i.i === undefined) { + i.i = new this.N(t, e); + i.i.o = i; + i = i.i; + break; + } + i = i.i; + } else if (s < 0) { + if (i.h === undefined) { + i.h = new this.N(t, e); + i.h.o = i; + i = i.h; + break; + } + i = i.h; + } else { + i.l = e; + return this.m; + } + } + } + } + } + if (this.enableIndex) { + let t = i.o; + while (t !== this.C) { + t.M += 1; + t = t.o; + } + } + this.j(i); + this.m += 1; + return this.m; + } + H(t, e) { + while (t) { + const s = this.A(t.u, e); + if (s < 0) { + t = t.h; + } else if (s > 0) { + t = t.i; + } else return t; + } + return t || this.C; + } + clear() { + this.m = 0; + this.v = undefined; + this.C.o = undefined; + this.C.i = this.C.h = undefined; + } + updateKeyByIterator(t, e) { + const s = t.T; + if (s === this.C) { + throwIteratorAccessError(); + } + if (this.m === 1) { + s.u = e; + return true; + } + const i = s.B().u; + if (s === this.C.i) { + if (this.A(i, e) > 0) { + s.u = e; + return true; + } + return false; + } + const r = s.I().u; + if (s === this.C.h) { + if (this.A(r, e) < 0) { + s.u = e; + return true; + } + return false; + } + if (this.A(r, e) >= 0 || this.A(i, e) <= 0) return false; + s.u = e; + return true; + } + eraseElementByPos(t) { + if (t < 0 || t > this.m - 1) { + throw new RangeError; + } + const e = this.U(t); + this.S(e); + return this.m; + } + eraseElementByKey(t) { + if (this.m === 0) return false; + const e = this.H(this.v, t); + if (e === this.C) return false; + this.S(e); + return true; + } + eraseElementByIterator(t) { + const e = t.T; + if (e === this.C) { + throwIteratorAccessError(); + } + const s = e.h === undefined; + const i = t.iteratorType === 0; + if (i) { + if (s) t.next(); + } else { + if (!s || e.i === undefined) t.next(); + } + this.S(e); + return t; + } + getHeight() { + if (this.m === 0) return 0; + function traversal(t) { + if (!t) return 0; + return Math.max(traversal(t.i), traversal(t.h)) + 1; + } + return traversal(this.v); + } +} + +class TreeIterator extends ContainerIterator { + constructor(t, e, s) { + super(s); + this.T = t; + this.C = e; + if (this.iteratorType === 0) { + this.pre = function() { + if (this.T === this.C.i) { + throwIteratorAccessError(); + } + this.T = this.T.I(); + return this; + }; + this.next = function() { + if (this.T === this.C) { + throwIteratorAccessError(); + } + this.T = this.T.B(); + return this; + }; + } else { + this.pre = function() { + if (this.T === this.C.h) { + throwIteratorAccessError(); + } + this.T = this.T.B(); + return this; + }; + this.next = function() { + if (this.T === this.C) { + throwIteratorAccessError(); + } + this.T = this.T.I(); + return this; + }; + } + } + get index() { + let t = this.T; + const e = this.C.o; + if (t === this.C) { + if (e) { + return e.M - 1; + } + return 0; + } + let s = 0; + if (t.i) { + s += t.i.M; + } + while (t !== e) { + const e = t.o; + if (t === e.h) { + s += 1; + if (e.i) { + s += e.i.M; + } + } + t = e; + } + return s; + } + isAccessible() { + return this.T !== this.C; + } +} + +class OrderedMapIterator extends TreeIterator { + constructor(t, e, s, i) { + super(t, e, i); + this.container = s; + } + get pointer() { + if (this.T === this.C) { + throwIteratorAccessError(); + } + const t = this; + return new Proxy([], { + get(e, s) { + if (s === "0") return t.T.u; else if (s === "1") return t.T.l; + e[0] = t.T.u; + e[1] = t.T.l; + return e[s]; + }, + set(e, s, i) { + if (s !== "1") { + throw new TypeError("prop must be 1"); + } + t.T.l = i; + return true; + } + }); + } + copy() { + return new OrderedMapIterator(this.T, this.C, this.container, this.iteratorType); + } +} + +class OrderedMap extends TreeContainer { + constructor(t = [], e, s) { + super(e, s); + const i = this; + t.forEach((function(t) { + i.setElement(t[0], t[1]); + })); + } + begin() { + return new OrderedMapIterator(this.C.i || this.C, this.C, this); + } + end() { + return new OrderedMapIterator(this.C, this.C, this); + } + rBegin() { + return new OrderedMapIterator(this.C.h || this.C, this.C, this, 1); + } + rEnd() { + return new OrderedMapIterator(this.C, this.C, this, 1); + } + front() { + if (this.m === 0) return; + const t = this.C.i; + return [ t.u, t.l ]; + } + back() { + if (this.m === 0) return; + const t = this.C.h; + return [ t.u, t.l ]; + } + lowerBound(t) { + const e = this.R(this.v, t); + return new OrderedMapIterator(e, this.C, this); + } + upperBound(t) { + const e = this.K(this.v, t); + return new OrderedMapIterator(e, this.C, this); + } + reverseLowerBound(t) { + const e = this.L(this.v, t); + return new OrderedMapIterator(e, this.C, this); + } + reverseUpperBound(t) { + const e = this.k(this.v, t); + return new OrderedMapIterator(e, this.C, this); + } + forEach(t) { + this.U((function(e, s, i) { + t([ e.u, e.l ], s, i); + })); + } + setElement(t, e, s) { + return this.q(t, e, s); + } + getElementByPos(t) { + if (t < 0 || t > this.m - 1) { + throw new RangeError; + } + const e = this.U(t); + return [ e.u, e.l ]; + } + find(t) { + const e = this.H(this.v, t); + return new OrderedMapIterator(e, this.C, this); + } + getElementByKey(t) { + const e = this.H(this.v, t); + return e.l; + } + union(t) { + const e = this; + t.forEach((function(t) { + e.setElement(t[0], t[1]); + })); + return this.m; + } + * [Symbol.iterator]() { + const t = this.m; + const e = this.U(); + for (let s = 0; s < t; ++s) { + const t = e[s]; + yield [ t.u, t.l ]; + } + } +} + +exports.OrderedMap = OrderedMap; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 725: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = __nccwpck_require__(73701) + + +/***/ }), + +/***/ 73701: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const {Readable} = __nccwpck_require__(12781) +const fs = __nccwpck_require__(57147) +const {once} = __nccwpck_require__(82361) + +const kOpts = Symbol('opts') +const kFileName = Symbol('filename') +const kPollFileIntervalMs = Symbol('pollFileIntervalMs') +const kPollFailureRetryMs = Symbol('pollFailureRetryMs') +const kMaxPollFailures = Symbol('maxPollFailures') +const kPollFailureCount = Symbol('pollFailureCount') +const kStartPos = Symbol('startPos') +const kStream = Symbol('stream') +const kFileHandle = Symbol('fileHandle') +const kPollTimer = Symbol('pollTimer') +const kQuitting = Symbol('quitting') +const kInode = Symbol('inode') + +function NOOP() {} + +class TailFile extends Readable { + constructor(filename, opts) { + opts = opts || {} + + const { + pollFileIntervalMs + , pollFailureRetryMs + , maxPollFailures + , readStreamOpts + , startPos + , ...superOpts + } = opts + + if (typeof filename !== 'string' || !filename.length) { + const err = new TypeError('filename must be a non-empty string') + err.code = 'EFILENAME' + throw err + } + if (pollFileIntervalMs && typeof pollFileIntervalMs !== 'number') { + const err = new TypeError('pollFileIntervalMs must be a number') + err.code = 'EPOLLINTERVAL' + err.meta = { + got: pollFileIntervalMs + } + throw err + } + if (pollFailureRetryMs && typeof pollFailureRetryMs !== 'number') { + const err = new TypeError('pollFailureRetryMs must be a number') + err.code = 'EPOLLRETRY' + err.meta = { + got: pollFailureRetryMs + } + throw err + } + if (maxPollFailures && typeof maxPollFailures !== 'number') { + const err = new TypeError('maxPollFailures must be a number') + err.code = 'EMAXPOLLFAIL' + err.meta = { + got: maxPollFailures + } + throw err + } + if (readStreamOpts && typeof readStreamOpts !== 'object') { + const err = new TypeError('readStreamOpts must be an object') + err.code = 'EREADSTREAMOPTS' + err.meta = { + got: typeof readStreamOpts + } + throw err + } + if (startPos !== null && startPos !== undefined) { + if (typeof startPos !== 'number') { + const err = new TypeError('startPos must be an integer >= 0') + err.code = 'ESTARTPOS' + err.meta = { + got: typeof startPos + } + throw err + } + if (startPos < 0 || !Number.isInteger(startPos)) { + const err = new RangeError('startPos must be an integer >= 0') + err.code = 'ESTARTPOS' + err.meta = { + got: startPos + } + throw err + } + } + + super(superOpts) + + this[kOpts] = opts + this[kFileName] = filename + this[kPollFileIntervalMs] = pollFileIntervalMs || 1000 + this[kPollFailureRetryMs] = pollFailureRetryMs || 200 + this[kMaxPollFailures] = maxPollFailures || 10 + this[kPollFailureCount] = 0 + this[kStartPos] = startPos >= 0 + ? startPos + : null + this[kStream] = null + this[kFileHandle] = null + this[kPollTimer] = null + this[kQuitting] = false + this[kInode] = null + } + + async start() { + await this._openFile() + await this._pollFileForChanges() + return + } + + async _openFile() { + this[kFileHandle] = await fs.promises.open(this[kFileName], 'r') + return + } + + async _readRemainderFromFileHandle() { + // Read the end of a renamed file before re-opening the new file. + // Use the file handle since it remains open even if the file name has changed + const fileHandleTemp = this[kFileHandle] // Prevent races when closing + this[kFileHandle] = null + const stats = await fileHandleTemp.stat() + const lengthToEnd = stats.size - this[kStartPos] + const {buffer} = await fileHandleTemp.read( + Buffer.alloc(lengthToEnd) + , 0 + , lengthToEnd + , this[kStartPos] + ) + this.push(buffer) + await fileHandleTemp.close() + return + } + + async _readChunks(stream) { + // For node 16 and higher: https://nodejs.org/docs/latest-v16.x/api/stream.html#readableiteratoroptions + /* istanbul ignore next */ + const iterator = stream.iterator + ? stream.iterator({destroyOnReturn: false}) + : stream + + for await (const chunk of iterator) { + this[kStartPos] += chunk.length + if (!this.push(chunk)) { + this[kStream] = stream + this[kPollTimer] = null + return + } + } + // Chunks read successfully (no backpressure) + if (this[kStream]) { + // Backpressure had been on, and polling was paused. Resume here. + this._scheduleTimer(this[kPollFileIntervalMs]) + } + this[kStream] = null + setImmediate(this.emit.bind(this), 'flush', { + lastReadPosition: this[kStartPos] + }) + return + } + + async _pollFileForChanges() { + try { + const stats = await fs.promises.stat(this[kFileName]) + + this[kPollFailureCount] = 0 // reset + const eof = stats.size + let fileHasChanged = false + + if (!this[kInode]) this[kInode] = stats.ino + + if (this[kStartPos] === null) { + // First iteration - nothing has been polled yet + this[kStartPos] = eof + } else if (this[kInode] !== stats.ino) { + // File renamed/rolled between polls without triggering `ENOENT`. + // Conditional since this *may* have already been done if `ENOENT` threw earlier. + if (this[kFileHandle]) { + try { + await this._readRemainderFromFileHandle() + } catch (error) { + const err = new Error('Could not read remaining bytes from old FH') + err.meta = { + error: error.message + , code: error.code + } + this.emit('tail_error', err) + } + } + await this._openFile() + this[kStartPos] = 0 + this[kInode] = stats.ino + fileHasChanged = true + this.emit('renamed', { + message: 'The file was renamed or rolled. Tailing resumed from the beginning.' + , filename: this[kFileName] + , when: new Date() + }) + } else if (eof < this[kStartPos]) { + // Same file, but smaller/truncated + this[kStartPos] = 0 + this[kInode] = stats.ino + fileHasChanged = true + this.emit('truncated', { + message: 'The file was truncated. Tailing resumed from the beginning.' + , filename: this[kFileName] + , when: new Date() + }) + } else if (this[kStartPos] !== eof) { + fileHasChanged = true + } + + if (fileHasChanged) { + await this._streamFileChanges() + if (this[kStream]) return // Pause polling if backpressure is on + } else { + setImmediate(this.emit.bind(this), 'flush', { + lastReadPosition: this[kStartPos] + }) + } + + this._scheduleTimer(this[kPollFileIntervalMs]) + + } catch (err) { + if (err.code === 'ENOENT') { + if (this[kFileHandle]) { + // The .stat() via polling may have happened during a file rename/roll. + // Don't lose the last lines in the file if it previously existed. + // Perhaps it has not been re-created yet (or won't be) + try { + await this._readRemainderFromFileHandle() + } catch (error) { + this.emit('tail_error', error) + } + } + this[kPollFailureCount]++ + if (this[kPollFailureCount] >= this[kMaxPollFailures]) { + return this.quit(err) + } + this.emit('retry', { + message: 'File disappeared. Retrying.' + , filename: this[kFileName] + , attempts: this[kPollFailureCount] + , when: new Date() + }) + this._scheduleTimer(this[kPollFailureRetryMs]) + return + } + // Some other error like EACCES + // TODO: Retries for certain error codes can be put here + return this.quit(err) + } + return + } + + _scheduleTimer(ms) { + clearTimeout(this[kPollTimer]) + if (this[kQuitting]) return + this[kPollTimer] = setTimeout(this._pollFileForChanges.bind(this), ms) + return + } + + async _streamFileChanges() { + try { + const stream = fs.createReadStream(this[kFileName], { + ...this[kOpts].readStreamOpts + , start: this[kStartPos] + }) + await this._readChunks(stream) + } catch (err) { + // Possible file removal. Let auto-retry handle it. + this[kPollFailureCount]++ + const error = new Error('An error was encountered while tailing the file') + error.code = 'ETAIL' + error.meta = {actual: err} + // Emitting on 'error' would bork the parent Readstream + this.emit('tail_error', error) + } + return + } + + _read() { + if (this[kStream]) { + this._readChunks(this[kStream]) + } + return + } + + async quit(err) { + this[kQuitting] = true + clearTimeout(this[kPollTimer]) + + if (err) { + this.emit('error', err) + } else { + // One last read to get lines added in high throughput + this._pollFileForChanges().catch(NOOP) + await once(this, 'flush') + } + + // Signal the end of this Readstream + this.push(null) + + // Clean open file handles and streams + if (this[kFileHandle]) { + this[kFileHandle].close().catch(NOOP) + } + if (this[kStream]) { + this[kStream].destroy() + } + + process.nextTick(() => { + if (this._readableState && !this._readableState.endEmitted) { + // 'end' is not emitted unless data is flowing, but this makes + // confusing inconsistencies, so emit it all the time + this.emit('end') + } + }) + return + } +} + +module.exports = TailFile + + +/***/ }), + +/***/ 252: +/***/ ((module) => { + +"use strict"; + +module.exports = asPromise; + +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); +} + + +/***/ }), + +/***/ 26718: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = new Array(64); + +// Base64 decoding table +var s64 = new Array(123); + +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; + + +/***/ }), + +/***/ 58882: +/***/ ((module) => { + +"use strict"; + +module.exports = codegen; + +/** + * Begins generating a function. + * @memberof util + * @param {string[]} functionParams Function parameter names + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + */ +function codegen(functionParams, functionName) { + + /* istanbul ignore if */ + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = undefined; + } + + var body = []; + + /** + * Appends code to the function's body or finishes generation. + * @typedef Codegen + * @type {function} + * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any + * @param {...*} [formatParams] Format parameters + * @returns {Codegen|Function} Itself or the generated function if finished + * @throws {Error} If format parameter counts do not match + */ + + function Codegen(formatStringOrScope) { + // note that explicit array handling below makes this ~50% faster + + // finish the function + if (typeof formatStringOrScope !== "string") { + var source = toString(); + if (codegen.verbose) + console.log("codegen: " + source); // eslint-disable-line no-console + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), + scopeParams = new Array(scopeKeys.length + 1), + scopeValues = new Array(scopeKeys.length), + scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func + } + return Function(source)(); // eslint-disable-line no-new-func + } + + // otherwise append to body + var formatParams = new Array(arguments.length - 1), + formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { + var value = formatParams[formatOffset++]; + switch ($1) { + case "d": case "f": return String(Number(value)); + case "i": return String(Math.floor(value)); + case "j": return JSON.stringify(value); + case "s": return String(value); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + + function toString(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + + Codegen.toString = toString; + return Codegen; +} + +/** + * Begins generating a function. + * @memberof util + * @function codegen + * @param {string} [functionName] Function name if not anonymous + * @returns {Codegen} Appender that appends code to the function's body + * @variation 2 + */ + +/** + * When set to `true`, codegen will log generated code to console. Useful for debugging. + * @name util.codegen.verbose + * @type {boolean} + */ +codegen.verbose = false; + + +/***/ }), + +/***/ 86850: +/***/ ((module) => { + +"use strict"; + +module.exports = EventEmitter; + +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { + + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this + }); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; +}; + +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; + + +/***/ }), + +/***/ 50663: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +module.exports = fetch; + +var asPromise = __nccwpck_require__(252), + inquire = __nccwpck_require__(99490); + +var fs = inquire("fs"); + +/** + * Node-style callback as used by {@link util.fetch}. + * @typedef FetchCallback + * @type {function} + * @param {?Error} error Error, if any, otherwise `null` + * @param {string} [contents] File contents, if there hasn't been an error + * @returns {undefined} + */ + +/** + * Options as used by {@link util.fetch}. + * @typedef FetchOptions + * @type {Object} + * @property {boolean} [binary=false] Whether expecting a binary response + * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest + */ + +/** + * Fetches the contents of a file. + * @memberof util + * @param {string} filename File path or url + * @param {FetchOptions} options Fetch options + * @param {FetchCallback} callback Callback function + * @returns {undefined} + */ +function fetch(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + + if (!callback) + return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this + + // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" + ? fetch.xhr(filename, options, callback) + : err + ? callback(err) + : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + + // use the XHR version otherwise. + return fetch.xhr(filename, options, callback); +} + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchCallback} callback Callback function + * @returns {undefined} + * @variation 2 + */ + +/** + * Fetches the contents of a file. + * @name util.fetch + * @function + * @param {string} path File path or url + * @param {FetchOptions} [options] Fetch options + * @returns {Promise} Promise + * @variation 3 + */ + +/**/ +fetch.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { + + if (xhr.readyState !== 4) + return undefined; + + // local cors security errors return status 0 / empty string, too. afaik this cannot be + // reliably distinguished from an actually empty file for security reasons. feel free + // to send a pull request if you are aware of a solution. + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + + // if binary data is expected, make sure that some sort of array is returned, even if + // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. + if (options.binary) { + var buffer = xhr.response; + if (!buffer) { + buffer = []; + for (var i = 0; i < xhr.responseText.length; ++i) + buffer.push(xhr.responseText.charCodeAt(i) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); + } + return callback(null, xhr.responseText); + }; + + if (options.binary) { + // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + + xhr.open("GET", filename); + xhr.send(); +}; + + +/***/ }), + +/***/ 21843: +/***/ ((module) => { + +"use strict"; + + +module.exports = factory(factory); + +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { + + // float: typed array + if (typeof Float32Array !== "undefined") (function() { + + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; + + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + + // float: ieee754 + })(); else (function() { + + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + + })(); + + // double: typed array + if (typeof Float64Array !== "undefined") (function() { + + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; + + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + + // double: ieee754 + })(); else (function() { + + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + + })(); + + return exports; +} + +// uint helpers + +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} + +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} + +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} + +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} + + +/***/ }), + +/***/ 99490: +/***/ ((module) => { + +"use strict"; + +module.exports = inquire; + +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} + + +/***/ }), + +/***/ 24761: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +/** + * A minimal path module to resolve Unix, Windows and URL paths alike. + * @memberof util + * @namespace + */ +var path = exports; + +var isAbsolute = +/** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ +path.isAbsolute = function isAbsolute(path) { + return /^(?:\/|\w+:)/.test(path); +}; + +var normalize = +/** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ +path.normalize = function normalize(path) { + path = path.replace(/\\/g, "/") + .replace(/\/{2,}/g, "/"); + var parts = path.split("/"), + absolute = isAbsolute(path), + prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i = 0; i < parts.length;) { + if (parts[i] === "..") { + if (i > 0 && parts[i - 1] !== "..") + parts.splice(--i, 2); + else if (absolute) + parts.splice(i, 1); + else + ++i; + } else if (parts[i] === ".") + parts.splice(i, 1); + else + ++i; + } + return prefix + parts.join("/"); +}; + +/** + * Resolves the specified include path against the specified origin path. + * @param {string} originPath Path to the origin file + * @param {string} includePath Include path relative to origin path + * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized + * @returns {string} Path to the include file + */ +path.resolve = function resolve(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize(includePath); + if (isAbsolute(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; +}; + + +/***/ }), + +/***/ 47743: +/***/ ((module) => { + +"use strict"; + +module.exports = pool; + +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + + +/***/ }), + +/***/ 99049: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; + + +/***/ }), + +/***/ 36892: +/***/ (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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __importStar(__nccwpck_require__(21888)); +/** + * An Archive represents a collection of named assets. + */ +class Archive { + constructor() { + /** + * A private field to help with RTTI that works in SxS scenarios. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiArchive = true; + } + /** + * Returns true if the given object is an instance of an Archive. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiArchive"); + } +} +exports.Archive = Archive; +/** + * An AssetArchive is an archive created from an in-memory collection of named assets or other archives. + */ +class AssetArchive extends Archive { + constructor(assets) { + super(); + this.assets = Promise.resolve(assets); + } +} +exports.AssetArchive = AssetArchive; +/** + * A FileArchive is a file-based archive, or a collection of file-based assets. This can be a raw directory or a + * single archive file in one of the supported formats (.tar, .tar.gz, or .zip). + */ +class FileArchive extends Archive { + constructor(path) { + super(); + this.path = Promise.resolve(path); + } +} +exports.FileArchive = FileArchive; +/** + * A RemoteArchive is a file-based archive fetched from a remote location. The URI's scheme dictates the + * protocol for fetching the archive's contents: `file://` is a local file (just like a FileArchive), `http://` and + * `https://` specify HTTP and HTTPS, respectively, and specific providers may recognize custom schemes. + */ +class RemoteArchive extends Archive { + constructor(uri) { + super(); + this.uri = Promise.resolve(uri); + } +} +exports.RemoteArchive = RemoteArchive; +//# sourceMappingURL=archive.js.map + +/***/ }), + +/***/ 33886: +/***/ (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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __importStar(__nccwpck_require__(21888)); +/** + * Asset represents a single blob of text or data that is managed as a first class entity. + */ +class Asset { + constructor() { + /** + * A private field to help with RTTI that works in SxS scenarios. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiAsset = true; + } + /** + * Returns true if the given object is an instance of an Asset. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiAsset"); + } +} +exports.Asset = Asset; +/** + * Blob is a kind of asset produced from an in-memory blob represented as a byte array. + */ +/* IDEA: enable this once Uint8Array is supported. +export class Blob extends Asset { + constructor(data: Uint8Array) { + super(); + } +} +*/ +/** + * FileAsset is a kind of asset produced from a given path to a file on the local filesystem. + */ +class FileAsset extends Asset { + constructor(path) { + super(); + this.path = Promise.resolve(path); + } +} +exports.FileAsset = FileAsset; +/** + * StringAsset is a kind of asset produced from an in-memory UTF8-encoded string. + */ +class StringAsset extends Asset { + constructor(text) { + super(); + this.text = Promise.resolve(text); + } +} +exports.StringAsset = StringAsset; +/** + * RemoteAsset is a kind of asset produced from a given URI string. The URI's scheme dictates the protocol for fetching + * contents: `file://` specifies a local file, `http://` and `https://` specify HTTP and HTTPS, respectively. Note that + * specific providers may recognize alternative schemes; this is merely the base-most set that all providers support. + */ +class RemoteAsset extends Asset { + constructor(uri) { + super(); + this.uri = Promise.resolve(uri); + } +} +exports.RemoteAsset = RemoteAsset; +//# sourceMappingURL=asset.js.map + +/***/ }), + +/***/ 83031: +/***/ ((__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 })); +__export(__nccwpck_require__(36892)); +__export(__nccwpck_require__(33886)); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 79586: +/***/ (function(__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. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const execa_1 = __importDefault(__nccwpck_require__(55447)); +const fs = __importStar(__nccwpck_require__(57147)); +const got_1 = __importDefault(__nccwpck_require__(93061)); +const os = __importStar(__nccwpck_require__(22037)); +const path = __importStar(__nccwpck_require__(71017)); +const semver = __importStar(__nccwpck_require__(11383)); +const tmp = __importStar(__nccwpck_require__(8517)); +const version_1 = __nccwpck_require__(86921); +const minimumVersion_1 = __nccwpck_require__(88410); +const errors_1 = __nccwpck_require__(71369); +const SKIP_VERSION_CHECK_VAR = "PULUMI_AUTOMATION_API_SKIP_VERSION_CHECK"; +/** @internal */ +class CommandResult { + constructor(stdout, stderr, code, err) { + this.stdout = stdout; + this.stderr = stderr; + this.code = code; + this.err = err; + } + toString() { + let errStr = ""; + if (this.err) { + errStr = this.err.toString(); + } + return `code: ${this.code}\n stdout: ${this.stdout}\n stderr: ${this.stderr}\n err?: ${errStr}\n`; + } +} +exports.CommandResult = CommandResult; +class PulumiCommand { + constructor(command, version) { + this.command = command; + this.version = version; + } + /** + * Get a new Pulumi instance that uses the installation in `opts.root`. + * Defaults to using the pulumi binary found in $PATH if no installation + * root is specified. If `opts.version` is specified, it validates that + * the CLI is compatible with the requested version and throws an error if + * not. This validation can be skipped by setting the environment variable + * `PULUMI_AUTOMATION_API_SKIP_VERSION_CHECK` or setting + * `opts.skipVersionCheck` to `true`. Note that the environment variable + * always takes precedence. If it is set it is not possible to re-enable + * the validation with `opts.skipVersionCheck`. + */ + static get(opts) { + return __awaiter(this, void 0, void 0, function* () { + const command = (opts === null || opts === void 0 ? void 0 : opts.root) ? path.resolve(path.join(opts.root, "bin/pulumi")) : "pulumi"; + const { stdout } = yield exec(command, ["version"]); + const skipVersionCheck = !!(opts === null || opts === void 0 ? void 0 : opts.skipVersionCheck) || !!process.env[SKIP_VERSION_CHECK_VAR]; + let min = minimumVersion_1.minimumVersion; + if ((opts === null || opts === void 0 ? void 0 : opts.version) && semver.gt(opts.version, minimumVersion_1.minimumVersion)) { + min = opts.version; + } + const version = parseAndValidatePulumiVersion(min, stdout.trim(), skipVersionCheck); + return new PulumiCommand(command, version); + }); + } + /** + * Installs the Pulumi CLI. + */ + static install(opts) { + return __awaiter(this, void 0, void 0, function* () { + const optsWithDefaults = withDefaults(opts); + try { + return yield PulumiCommand.get(optsWithDefaults); + } + catch (err) { + // ignore + } + if (process.platform === "win32") { + yield PulumiCommand.installWindows(optsWithDefaults); + } + else { + yield PulumiCommand.installPosix(optsWithDefaults); + } + return yield PulumiCommand.get(optsWithDefaults); + }); + } + static installWindows(opts) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield got_1.default("https://get.pulumi.com/install.ps1"); + const script = yield writeTempFile(response.body, { extension: ".ps1" }); + try { + const command = process.env.SystemRoot + ? path.join(process.env.SystemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe") + : "powershell.exe"; + const args = [ + "-NoProfile", + "-InputFormat", + "None", + "-ExecutionPolicy", + "Bypass", + "-File", + script.path, + "-NoEditPath", + "-InstallRoot", + opts.root, + "-Version", + `${opts.version}`, + ]; + yield exec(command, args); + } + finally { + script.cleanup(); + } + }); + } + static installPosix(opts) { + return __awaiter(this, void 0, void 0, function* () { + const response = yield got_1.default("https://get.pulumi.com/install.sh"); + const script = yield writeTempFile(response.body); + try { + const args = [script.path, "--no-edit-path", "--install-root", opts.root, "--version", `${opts.version}`]; + yield exec("/bin/sh", args); + } + finally { + script.cleanup(); + } + }); + } + /** @internal */ + run(args, cwd, additionalEnv, onOutput) { + // all commands should be run in non-interactive mode. + // this causes commands to fail rather than prompting for input (and thus hanging indefinitely) + if (!args.includes("--non-interactive")) { + args.push("--non-interactive"); + } + // Prepend the folder where the CLI is installed to the path to ensure + // we pickup the matching bundled plugins. + if (path.isAbsolute(this.command)) { + const pulumiBin = path.dirname(this.command); + const sep = os.platform() === "win32" ? ";" : ":"; + const envPath = pulumiBin + sep + (additionalEnv["PATH"] || process.env.PATH); + additionalEnv["PATH"] = envPath; + } + return exec(this.command, args, cwd, additionalEnv, onOutput); + } +} +exports.PulumiCommand = PulumiCommand; +function exec(command, args, cwd, additionalEnv, onOutput) { + return __awaiter(this, void 0, void 0, function* () { + const unknownErrCode = -2; + const env = additionalEnv ? Object.assign({}, additionalEnv) : undefined; + try { + const proc = execa_1.default(command, args, { env, cwd }); + if (onOutput && proc.stdout) { + proc.stdout.on("data", (data) => { + if (data === null || data === void 0 ? void 0 : data.toString) { + data = data.toString(); + } + onOutput(data); + }); + } + const { stdout, stderr, exitCode } = yield proc; + const commandResult = new CommandResult(stdout, stderr, exitCode); + if (exitCode !== 0) { + throw errors_1.createCommandError(commandResult); + } + return commandResult; + } + catch (err) { + const error = err; + throw errors_1.createCommandError(new CommandResult("", error.message, unknownErrCode, error)); + } + }); +} +function withDefaults(opts) { + let version = opts === null || opts === void 0 ? void 0 : opts.version; + if (!version) { + version = new semver.SemVer(version_1.version); + } + let root = opts === null || opts === void 0 ? void 0 : opts.root; + if (!root) { + root = path.join(os.homedir(), ".pulumi", "versions", `${version}`); + } + const skipVersionCheck = (opts === null || opts === void 0 ? void 0 : opts.skipVersionCheck) !== undefined ? opts.skipVersionCheck : false; + return { version, root, skipVersionCheck }; +} +function writeTempFile(contents, options) { + return new Promise((resolve, reject) => { + tmp.file({ + // Powershell requires a `.ps1` extension. + postfix: options === null || options === void 0 ? void 0 : options.extension, + // Powershell won't execute the script if the file descriptor is open. + discardDescriptor: true, + }, (tmpErr, tmpPath, _fd, cleanup) => { + if (tmpErr) { + reject(tmpErr); + } + else { + fs.writeFile(tmpPath, contents, (writeErr) => { + if (writeErr) { + cleanup(); + reject(writeErr); + } + else { + resolve({ path: tmpPath, cleanup }); + } + }); + } + }); + }); +} +/** + * @internal + * Throws an error if the Pulumi CLI version is not valid. + * + * @param minVersion The minimum acceptable version of the Pulumi CLI. + * @param currentVersion The currently known version. `null` indicates that the current version is unknown. + * @param optOut If the user has opted out of the version check. + */ +function parseAndValidatePulumiVersion(minVersion, currentVersion, optOut) { + const version = semver.parse(currentVersion); + if (optOut) { + return version; + } + if (version == null) { + throw new Error(`Failed to parse Pulumi CLI version. This is probably an internal error. You can override this by setting "${SKIP_VERSION_CHECK_VAR}" to "true".`); + } + if (minVersion.major < version.major) { + throw new Error(`Major version mismatch. You are using Pulumi CLI version ${currentVersion} with Automation SDK v${minVersion.major}. Please update the SDK.`); + } + if (minVersion.compare(version) === 1) { + throw new Error(`Minimum version requirement failed. The minimum CLI version requirement is ${minVersion.toString()}, your current CLI version is ${currentVersion}. Please update the Pulumi CLI.`); + } + return version; +} +exports.parseAndValidatePulumiVersion = parseAndValidatePulumiVersion; +//# sourceMappingURL=cmd.js.map + +/***/ }), + +/***/ 71369: +/***/ ((__unused_webpack_module, exports) => { + +"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. +Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * CommandError is an error resulting from invocation of a Pulumi Command. + * @alpha + */ +class CommandError extends Error { + /** @internal */ + constructor(commandResult) { + super(commandResult.toString()); + this.commandResult = commandResult; + this.name = "CommandError"; + } +} +exports.CommandError = CommandError; +/** + * ConcurrentUpdateError is thrown when attempting to update a stack that already has an update in progress. + */ +class ConcurrentUpdateError extends CommandError { + /** @internal */ + constructor(commandResult) { + super(commandResult); + this.name = "ConcurrentUpdateError"; + } +} +exports.ConcurrentUpdateError = ConcurrentUpdateError; +/** + * StackNotFoundError is thrown when attempting to select a stack that does not exist. + */ +class StackNotFoundError extends CommandError { + /** @internal */ + constructor(commandResult) { + super(commandResult); + this.name = "StackNotFoundError"; + } +} +exports.StackNotFoundError = StackNotFoundError; +/** + * StackAlreadyExistsError is thrown when attempting to create a stack that already exists. + */ +class StackAlreadyExistsError extends CommandError { + /** @internal */ + constructor(commandResult) { + super(commandResult); + this.name = "StackAlreadyExistsError"; + } +} +exports.StackAlreadyExistsError = StackAlreadyExistsError; +const notFoundRegex = new RegExp("no stack named.*found"); +const alreadyExistsRegex = new RegExp("stack.*already exists"); +const conflictText = "[409] Conflict: Another update is currently in progress."; +const diyBackendConflictText = "the stack is currently locked by"; +/** @internal */ +function createCommandError(result) { + const stderr = result.stderr; + return notFoundRegex.test(stderr) + ? new StackNotFoundError(result) + : alreadyExistsRegex.test(stderr) + ? new StackAlreadyExistsError(result) + : stderr.indexOf(conflictText) >= 0 + ? new ConcurrentUpdateError(result) + : stderr.indexOf(diyBackendConflictText) >= 0 + ? new ConcurrentUpdateError(result) + : new CommandError(result); +} +exports.createCommandError = createCommandError; +//# sourceMappingURL=errors.js.map + +/***/ }), + +/***/ 6568: +/***/ ((__unused_webpack_module, exports) => { + +"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. +Object.defineProperty(exports, "__esModule", ({ value: true })); +var DiffKind; +(function (DiffKind) { + /** + * add indicates that the property was added. + */ + DiffKind["add"] = "add"; + /** + * addReplace indicates that the property was added and requires that the resource be replaced. + */ + DiffKind["addReplace"] = "add-replace"; + /** + * delete indicates that the property was deleted. + */ + DiffKind["delete"] = "delete"; + /** + * deleteReplace indicates that the property was deleted and requires that the resource be replaced. + */ + DiffKind["deleteReplace"] = "delete-replace"; + /** + * update indicates that the property was updated. + */ + DiffKind["update"] = "update"; + /** + * updateReplace indicates that the property was updated and requires that the resource be replaced. + */ + DiffKind["updateReplace"] = "update-replace"; +})(DiffKind = exports.DiffKind || (exports.DiffKind = {})); +//# sourceMappingURL=events.js.map + +/***/ }), + +/***/ 34925: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// 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. +// 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__(79586)); +__export(__nccwpck_require__(71369)); +__export(__nccwpck_require__(29010)); +__export(__nccwpck_require__(25973)); +__export(__nccwpck_require__(5142)); +__export(__nccwpck_require__(6568)); +__export(__nccwpck_require__(55740)); +__export(__nccwpck_require__(8106)); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 5142: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// Copyright 2016-2023, 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const fs = __importStar(__nccwpck_require__(57147)); +const yaml = __importStar(__nccwpck_require__(65789)); +const os = __importStar(__nccwpck_require__(22037)); +const semver = __importStar(__nccwpck_require__(11383)); +const upath = __importStar(__nccwpck_require__(8004)); +const cmd_1 = __nccwpck_require__(79586); +const stack_1 = __nccwpck_require__(29010); +const stackSettings_1 = __nccwpck_require__(25973); +const SKIP_VERSION_CHECK_VAR = "PULUMI_AUTOMATION_API_SKIP_VERSION_CHECK"; +/** + * LocalWorkspace is a default implementation of the Workspace interface. + * A Workspace is the execution context containing a single Pulumi project, a program, + * and multiple stacks. Workspaces are used to manage the execution environment, + * providing various utilities such as plugin installation, environment configuration + * ($PULUMI_HOME), and creation, deletion, and listing of Stacks. + * LocalWorkspace relies on Pulumi.yaml and Pulumi..yaml as the intermediate format + * for Project and Stack settings. Modifying ProjectSettings will + * alter the Workspace Pulumi.yaml file, and setting config on a Stack will modify the Pulumi..yaml file. + * This is identical to the behavior of Pulumi CLI driven workspaces. + * + * @alpha + */ +class LocalWorkspace { + constructor(opts) { + let dir = ""; + let envs = {}; + if (opts) { + const { workDir, pulumiHome, program, envVars, secretsProvider, remote, remoteGitProgramArgs, remotePreRunCommands, remoteEnvVars, remoteSkipInstallDependencies, remoteInheritSettings, } = opts; + if (workDir) { + // Verify that the workdir exists. + if (!fs.existsSync(workDir)) { + throw new Error(`Invalid workDir passed to local workspace: '${workDir}' does not exist`); + } + dir = workDir; + } + this.pulumiHome = pulumiHome; + this.program = program; + this.secretsProvider = secretsProvider; + this.remote = remote; + this.remoteGitProgramArgs = remoteGitProgramArgs; + this.remotePreRunCommands = remotePreRunCommands; + this.remoteEnvVars = Object.assign({}, remoteEnvVars); + this.remoteSkipInstallDependencies = remoteSkipInstallDependencies; + this.remoteInheritSettings = remoteInheritSettings; + envs = Object.assign({}, envVars); + } + if (!dir) { + dir = fs.mkdtempSync(upath.joinSafe(os.tmpdir(), "automation-")); + } + this.workDir = dir; + this.envVars = envs; + const skipVersionCheck = !!this.envVars[SKIP_VERSION_CHECK_VAR] || !!process.env[SKIP_VERSION_CHECK_VAR]; + const pulumiCommand = (opts === null || opts === void 0 ? void 0 : opts.pulumiCommand) ? Promise.resolve(opts.pulumiCommand) + : cmd_1.PulumiCommand.get({ skipVersionCheck }); + const readinessPromises = [ + pulumiCommand.then((p) => { + this._pulumiCommand = p; + if (p.version) { + this._pulumiVersion = p.version; + } + return this.checkRemoteSupport(); + }), + ]; + if (opts === null || opts === void 0 ? void 0 : opts.projectSettings) { + readinessPromises.push(this.saveProjectSettings(opts.projectSettings)); + } + if (opts === null || opts === void 0 ? void 0 : opts.stackSettings) { + for (const [name, value] of Object.entries(opts.stackSettings)) { + readinessPromises.push(this.saveStackSettings(name, value)); + } + } + this.ready = Promise.all(readinessPromises); + } + /** + * The underlying Pulumi CLI. + */ + get pulumiCommand() { + if (this._pulumiCommand === undefined) { + throw new Error("Failed to get Pulumi CLI"); + } + return this._pulumiCommand; + } + /** + * The version of the underlying Pulumi CLI/Engine. + * + * @returns A string representation of the version, if available. `null` otherwise. + */ + get pulumiVersion() { + if (this._pulumiVersion === undefined) { + throw new Error(`Failed to get Pulumi version`); + } + return this._pulumiVersion.toString(); + } + /** + * Creates a workspace using the specified options. Used for maximal control and customization + * of the underlying environment before any stacks are created or selected. + * + * @param opts Options used to configure the Workspace + */ + static create(opts) { + return __awaiter(this, void 0, void 0, function* () { + const ws = new LocalWorkspace(opts); + yield ws.ready; + return ws; + }); + } + static createStack(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + if (isInlineProgramArgs(args)) { + return yield this.inlineSourceStackHelper(args, stack_1.Stack.create, opts); + } + else if (isLocalProgramArgs(args)) { + return yield this.localSourceStackHelper(args, stack_1.Stack.create, opts); + } + throw new Error(`unexpected args: ${args}`); + }); + } + static selectStack(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + if (isInlineProgramArgs(args)) { + return yield this.inlineSourceStackHelper(args, stack_1.Stack.select, opts); + } + else if (isLocalProgramArgs(args)) { + return yield this.localSourceStackHelper(args, stack_1.Stack.select, opts); + } + throw new Error(`unexpected args: ${args}`); + }); + } + static createOrSelectStack(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + if (isInlineProgramArgs(args)) { + return yield this.inlineSourceStackHelper(args, stack_1.Stack.createOrSelect, opts); + } + else if (isLocalProgramArgs(args)) { + return yield this.localSourceStackHelper(args, stack_1.Stack.createOrSelect, opts); + } + throw new Error(`unexpected args: ${args}`); + }); + } + static localSourceStackHelper(args, initFn, opts) { + return __awaiter(this, void 0, void 0, function* () { + let wsOpts = { workDir: args.workDir }; + if (opts) { + wsOpts = Object.assign(Object.assign({}, opts), { workDir: args.workDir }); + } + const ws = new LocalWorkspace(wsOpts); + yield ws.ready; + return yield initFn(args.stackName, ws); + }); + } + static inlineSourceStackHelper(args, initFn, opts) { + return __awaiter(this, void 0, void 0, function* () { + let wsOpts = { program: args.program }; + if (opts) { + wsOpts = Object.assign(Object.assign({}, opts), { program: args.program }); + } + if (!wsOpts.projectSettings) { + if (wsOpts.workDir) { + try { + // Try to load the project settings. + loadProjectSettings(wsOpts.workDir); + } + catch (e) { + // If it failed to find the project settings file, set a default project. + if (e.toString().includes("failed to find project settings")) { + wsOpts.projectSettings = defaultProject(args.projectName); + } + else { + throw e; + } + } + } + else { + wsOpts.projectSettings = defaultProject(args.projectName); + } + } + const ws = new LocalWorkspace(wsOpts); + yield ws.ready; + return yield initFn(args.stackName, ws); + }); + } + /** + * Returns the settings object for the current project if any + * LocalWorkspace reads settings from the Pulumi.yaml in the workspace. + * A workspace can contain only a single project at a time. + */ + projectSettings() { + return __awaiter(this, void 0, void 0, function* () { + return loadProjectSettings(this.workDir); + }); + } + /** + * Overwrites the settings object in the current project. + * There can only be a single project per workspace. Fails if new project name does not match old. + * LocalWorkspace writes this value to a Pulumi.yaml file in Workspace.WorkDir(). + * + * @param settings The settings object to save to the Workspace. + */ + saveProjectSettings(settings) { + return __awaiter(this, void 0, void 0, function* () { + let foundExt = ".yaml"; + for (const ext of settingsExtensions) { + const testPath = upath.joinSafe(this.workDir, `Pulumi${ext}`); + if (fs.existsSync(testPath)) { + foundExt = ext; + break; + } + } + const path = upath.joinSafe(this.workDir, `Pulumi${foundExt}`); + let contents; + if (foundExt === ".json") { + contents = JSON.stringify(settings, null, 4); + } + else { + contents = yaml.safeDump(settings, { skipInvalid: true }); + } + return fs.writeFileSync(path, contents); + }); + } + /** + * Returns the settings object for the stack matching the specified stack name if any. + * LocalWorkspace reads this from a Pulumi..yaml file in Workspace.WorkDir(). + * + * @param stackName The stack to retrieve settings from. + */ + stackSettings(stackName) { + return __awaiter(this, void 0, void 0, function* () { + const stackSettingsName = getStackSettingsName(stackName); + for (const ext of settingsExtensions) { + const isJSON = ext === ".json"; + const path = upath.joinSafe(this.workDir, `Pulumi.${stackSettingsName}${ext}`); + if (!fs.existsSync(path)) { + continue; + } + const contents = fs.readFileSync(path).toString(); + let stackSettings; + if (isJSON) { + stackSettings = JSON.parse(contents); + } + stackSettings = yaml.safeLoad(contents); + // Transform the serialized representation back to what we expect. + for (const key of stackSettings_1.stackSettingsSerDeKeys) { + if (stackSettings.hasOwnProperty(key[0])) { + stackSettings[key[1]] = stackSettings[key[0]]; + delete stackSettings[key[0]]; + } + } + return stackSettings; + } + throw new Error(`failed to find stack settings file in workdir: ${this.workDir}`); + }); + } + /** + * Overwrites the settings object for the stack matching the specified stack name. + * LocalWorkspace writes this value to a Pulumi..yaml file in Workspace.WorkDir() + * + * @param stackName The stack to operate on. + * @param settings The settings object to save. + */ + saveStackSettings(stackName, settings) { + return __awaiter(this, void 0, void 0, function* () { + const stackSettingsName = getStackSettingsName(stackName); + let foundExt = ".yaml"; + for (const ext of settingsExtensions) { + const testPath = upath.joinSafe(this.workDir, `Pulumi.${stackSettingsName}${ext}`); + if (fs.existsSync(testPath)) { + foundExt = ext; + break; + } + } + const path = upath.joinSafe(this.workDir, `Pulumi.${stackSettingsName}${foundExt}`); + const serializeSettings = Object.assign({}, settings); + let contents; + // Transform the keys to the serialized representation that we expect. + for (const key of stackSettings_1.stackSettingsSerDeKeys) { + if (serializeSettings.hasOwnProperty(key[1])) { + serializeSettings[key[0]] = serializeSettings[key[1]]; + delete serializeSettings[key[1]]; + } + } + if (foundExt === ".json") { + contents = JSON.stringify(serializeSettings, null, 4); + } + else { + contents = yaml.safeDump(serializeSettings, { skipInvalid: true }); + } + return fs.writeFileSync(path, contents); + }); + } + /** + * Creates and sets a new stack with the stack name, failing if one already exists. + * + * @param stackName The stack to create. + */ + createStack(stackName) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["stack", "init", stackName]; + if (this.secretsProvider) { + args.push("--secrets-provider", this.secretsProvider); + } + if (this.isRemote) { + args.push("--no-select"); + } + yield this.runPulumiCmd(args); + }); + } + /** + * Selects and sets an existing stack matching the stack name, failing if none exists. + * + * @param stackName The stack to select. + */ + selectStack(stackName) { + return __awaiter(this, void 0, void 0, function* () { + // If this is a remote workspace, we don't want to actually select the stack (which would modify global state); + // but we will ensure the stack exists by calling `pulumi stack`. + const args = ["stack"]; + if (!this.isRemote) { + args.push("select"); + } + args.push("--stack", stackName); + yield this.runPulumiCmd(args); + }); + } + /** + * Deletes the stack and all associated configuration and history. + * + * @param stackName The stack to remove + */ + removeStack(stackName) { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["stack", "rm", "--yes", stackName]); + }); + } + /** + * Adds environments to the end of a stack's import list. Imported environments are merged in order + * per the ESC merge rules. The list of environments behaves as if it were the import list in an anonymous + * environment. + * + * @param stackName The stack to operate on + * @param environments The names of the environments to add to the stack's configuration + */ + addEnvironments(stackName, ...environments) { + return __awaiter(this, void 0, void 0, function* () { + let ver = this._pulumiVersion; + if (ver === undefined) { + // Assume an old version. Doesn't really matter what this is as long as it's pre-3.95. + ver = semver.parse("3.0.0"); + } + // 3.95 added this command (https://github.com/pulumi/pulumi/releases/tag/v3.95.0) + if (ver.compare("3.95.0") < 0) { + throw new Error(`addEnvironments requires Pulumi version >= 3.95.0`); + } + yield this.runPulumiCmd(["config", "env", "add", ...environments, "--stack", stackName, "--yes"]); + }); + } + /** + * Returns the list of environments associated with the specified stack name. + * + * @param stackName The stack to operate on + */ + listEnvironments(stackName) { + return __awaiter(this, void 0, void 0, function* () { + let ver = this._pulumiVersion; + if (ver === undefined) { + // Assume an old version. Doesn't really matter what this is as long as it's pre-3.99. + ver = semver.parse("3.0.0"); + } + // 3.99 added this command (https://github.com/pulumi/pulumi/releases/tag/v3.99.0) + if (ver.compare("3.99.0") < 0) { + throw new Error(`listEnvironments requires Pulumi version >= 3.99.0`); + } + const result = yield this.runPulumiCmd(["config", "env", "ls", "--stack", stackName, "--json"]); + return JSON.parse(result.stdout); + }); + } + /** + * Removes an environment from a stack's import list. + * + * @param stackName The stack to operate on + * @param environment The name of the environment to remove from the stack's configuration + */ + removeEnvironment(stackName, environment) { + return __awaiter(this, void 0, void 0, function* () { + let ver = this._pulumiVersion; + if (ver === undefined) { + // Assume an old version. Doesn't really matter what this is as long as it's pre-3.95. + ver = semver.parse("3.0.0"); + } + // 3.95 added this command (https://github.com/pulumi/pulumi/releases/tag/v3.95.0) + if (ver.compare("3.95.0") < 0) { + throw new Error(`removeEnvironments requires Pulumi version >= 3.95.0`); + } + yield this.runPulumiCmd(["config", "env", "rm", environment, "--stack", stackName, "--yes"]); + }); + } + /** + * Returns the value associated with the specified stack name and key, + * scoped to the current workspace. LocalWorkspace reads this config from the matching Pulumi.stack.yaml file. + * + * @param stackName The stack to read config from + * @param key The key to use for the config lookup + * @param path The key contains a path to a property in a map or list to get + */ + getConfig(stackName, key, path) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["config", "get"]; + if (path) { + args.push("--path"); + } + args.push(key, "--json", "--stack", stackName); + const result = yield this.runPulumiCmd(args); + return JSON.parse(result.stdout); + }); + } + /** + * Returns the config map for the specified stack name, scoped to the current workspace. + * LocalWorkspace reads this config from the matching Pulumi.stack.yaml file. + * + * @param stackName The stack to read config from + */ + getAllConfig(stackName) { + return __awaiter(this, void 0, void 0, function* () { + const result = yield this.runPulumiCmd(["config", "--show-secrets", "--json", "--stack", stackName]); + return JSON.parse(result.stdout); + }); + } + /** + * Sets the specified key-value pair on the provided stack name. + * LocalWorkspace writes this value to the matching Pulumi..yaml file in Workspace.WorkDir(). + * + * @param stackName The stack to operate on + * @param key The config key to set + * @param value The value to set + * @param path The key contains a path to a property in a map or list to set + */ + setConfig(stackName, key, value, path) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["config", "set"]; + if (path) { + args.push("--path"); + } + const secretArg = value.secret ? "--secret" : "--plaintext"; + args.push(key, "--stack", stackName, secretArg, "--non-interactive", "--", value.value); + yield this.runPulumiCmd(args); + }); + } + /** + * Sets all values in the provided config map for the specified stack name. + * LocalWorkspace writes the config to the matching Pulumi..yaml file in Workspace.WorkDir(). + * + * @param stackName The stack to operate on + * @param config The `ConfigMap` to upsert against the existing config + * @param path The keys contain a path to a property in a map or list to set + */ + setAllConfig(stackName, config, path) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["config", "set-all", "--stack", stackName]; + if (path) { + args.push("--path"); + } + for (const [key, value] of Object.entries(config)) { + const secretArg = value.secret ? "--secret" : "--plaintext"; + args.push(secretArg, `${key}=${value.value}`); + } + yield this.runPulumiCmd(args); + }); + } + /** + * Removes the specified key-value pair on the provided stack name. + * It will remove any matching values in the Pulumi..yaml file in Workspace.WorkDir(). + * + * @param stackName The stack to operate on + * @param key The config key to remove + * @param path The key contains a path to a property in a map or list to remove + */ + removeConfig(stackName, key, path) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["config", "rm", key, "--stack", stackName]; + if (path) { + args.push("--path"); + } + yield this.runPulumiCmd(args); + }); + } + /** + * + * Removes all values in the provided key list for the specified stack name + * It will remove any matching values in the Pulumi..yaml file in Workspace.WorkDir(). + * + * @param stackName The stack to operate on + * @param keys The list of keys to remove from the underlying config + * @param path The keys contain a path to a property in a map or list to remove + */ + removeAllConfig(stackName, keys, path) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["config", "rm-all", "--stack", stackName]; + if (path) { + args.push("--path"); + } + args.push(...keys); + yield this.runPulumiCmd(args); + }); + } + /** + * Gets and sets the config map used with the last update for Stack matching stack name. + * It will overwrite all configuration in the Pulumi..yaml file in Workspace.WorkDir(). + * + * @param stackName The stack to refresh + */ + refreshConfig(stackName) { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["config", "refresh", "--force", "--stack", stackName]); + return this.getAllConfig(stackName); + }); + } + /** + * Returns the value associated with the specified stack name and key, + * scoped to the LocalWorkspace. + * + * @param stackName The stack to read tag metadata from. + * @param key The key to use for the tag lookup. + */ + getTag(stackName, key) { + return __awaiter(this, void 0, void 0, function* () { + const result = yield this.runPulumiCmd(["stack", "tag", "get", key, "--stack", stackName]); + return result.stdout.trim(); + }); + } + /** + * Sets the specified key-value pair on the provided stack name. + * + * @param stackName The stack to operate on. + * @param key The tag key to set. + * @param value The tag value to set. + */ + setTag(stackName, key, value) { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["stack", "tag", "set", key, value, "--stack", stackName]); + }); + } + /** + * Removes the specified key-value pair on the provided stack name. + * + * @param stackName The stack to operate on. + * @param key The tag key to remove. + */ + removeTag(stackName, key) { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["stack", "tag", "rm", key, "--stack", stackName]); + }); + } + /** + * Returns the tag map for the specified tag name, scoped to the current LocalWorkspace. + * + * @param stackName The stack to read tag metadata from. + */ + listTags(stackName) { + return __awaiter(this, void 0, void 0, function* () { + const result = yield this.runPulumiCmd(["stack", "tag", "ls", "--json", "--stack", stackName]); + return JSON.parse(result.stdout); + }); + } + /** + * Returns the currently authenticated user. + */ + whoAmI() { + return __awaiter(this, void 0, void 0, function* () { + let ver = this._pulumiVersion; + if (ver === undefined) { + // Assume an old version. Doesn't really matter what this is as long as it's pre-3.58. + ver = semver.parse("3.0.0"); + } + // 3.58 added the --json flag (https://github.com/pulumi/pulumi/releases/tag/v3.58.0) + if (ver.compare("3.58.0") >= 0) { + const result = yield this.runPulumiCmd(["whoami", "--json"]); + return JSON.parse(result.stdout); + } + else { + const result = yield this.runPulumiCmd(["whoami"]); + return { user: result.stdout.trim() }; + } + }); + } + /** + * Returns a summary of the currently selected stack, if any. + */ + stack() { + return __awaiter(this, void 0, void 0, function* () { + const stacks = yield this.listStacks(); + for (const stack of stacks) { + if (stack.current) { + return stack; + } + } + return undefined; + }); + } + /** + * Returns all Stacks from the underlying backend based on the provided options. + * This queries underlying backend and may return stacks not present in the Workspace (as Pulumi..yaml files). + * + * @param opts Options to customize the behavior of the list. + */ + listStacks(opts) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["stack", "ls", "--json"]; + if (opts) { + if (opts.all) { + args.push("--all"); + } + } + const result = yield this.runPulumiCmd(args); + return JSON.parse(result.stdout); + }); + } + /** + * Installs a plugin in the Workspace, for example to use cloud providers like AWS or GCP. + * + * @param name the name of the plugin. + * @param version the version of the plugin e.g. "v1.0.0". + * @param kind the kind of plugin, defaults to "resource" + */ + installPlugin(name, version, kind = "resource") { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["plugin", "install", kind, name, version]); + }); + } + /** + * Installs a plugin in the Workspace, from a third party server. + * + * @param name the name of the plugin. + * @param version the version of the plugin e.g. "v1.0.0". + * @param server the server to install the plugin from + */ + installPluginFromServer(name, version, server) { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["plugin", "install", "resource", name, version, "--server", server]); + }); + } + /** + * Removes a plugin from the Workspace matching the specified name and version. + * + * @param name the optional name of the plugin. + * @param versionRange optional semver range to check when removing plugins matching the given name + * e.g. "1.0.0", ">1.0.0". + * @param kind he kind of plugin, defaults to "resource". + */ + removePlugin(name, versionRange, kind = "resource") { + return __awaiter(this, void 0, void 0, function* () { + const args = ["plugin", "rm", kind]; + if (name) { + args.push(name); + } + if (versionRange) { + args.push(versionRange); + } + args.push("--yes"); + yield this.runPulumiCmd(args); + }); + } + /** + * Returns a list of all plugins installed in the Workspace. + */ + listPlugins() { + return __awaiter(this, void 0, void 0, function* () { + const result = yield this.runPulumiCmd(["plugin", "ls", "--json"]); + return JSON.parse(result.stdout, (key, value) => { + if (key === "installTime" || key === "lastUsedTime") { + return new Date(value); + } + return value; + }); + }); + } + /** + * exportStack exports the deployment state of the stack. + * This can be combined with Workspace.importStack to edit a stack's state (such as recovery from failed deployments). + * + * @param stackName the name of the stack. + */ + exportStack(stackName) { + return __awaiter(this, void 0, void 0, function* () { + const result = yield this.runPulumiCmd(["stack", "export", "--show-secrets", "--stack", stackName]); + return JSON.parse(result.stdout); + }); + } + /** + * importStack imports the specified deployment state into a pre-existing stack. + * This can be combined with Workspace.exportStack to edit a stack's state (such as recovery from failed deployments). + * + * @param stackName the name of the stack. + * @param state the stack state to import. + */ + importStack(stackName, state) { + return __awaiter(this, void 0, void 0, function* () { + const randomSuffix = Math.floor(100000 + Math.random() * 900000); + const filepath = upath.joinSafe(os.tmpdir(), `automation-${randomSuffix}`); + const contents = JSON.stringify(state, null, 4); + fs.writeFileSync(filepath, contents); + yield this.runPulumiCmd(["stack", "import", "--file", filepath, "--stack", stackName]); + fs.unlinkSync(filepath); + }); + } + /** + * Gets the current set of Stack outputs from the last Stack.up(). + * @param stackName the name of the stack. + */ + stackOutputs(stackName) { + return __awaiter(this, void 0, void 0, function* () { + // TODO: do this in parallel after this is fixed https://github.com/pulumi/pulumi/issues/6050 + const maskedResult = yield this.runPulumiCmd(["stack", "output", "--json", "--stack", stackName]); + const plaintextResult = yield this.runPulumiCmd([ + "stack", + "output", + "--json", + "--show-secrets", + "--stack", + stackName, + ]); + const maskedOuts = JSON.parse(maskedResult.stdout); + const plaintextOuts = JSON.parse(plaintextResult.stdout); + const outputs = {}; + for (const [key, value] of Object.entries(plaintextOuts)) { + const secret = maskedOuts[key] === "[secret]"; + outputs[key] = { value, secret }; + } + return outputs; + }); + } + /** + * serializeArgsForOp is hook to provide additional args to every CLI commands before they are executed. + * Provided with stack name, + * returns a list of args to append to an invoked command ["--config=...", ] + * LocalWorkspace does not utilize this extensibility point. + */ + serializeArgsForOp(_) { + return __awaiter(this, void 0, void 0, function* () { + // LocalWorkspace does not utilize this extensibility point. + return []; + }); + } + /** + * postCommandCallback is a hook executed after every command. Called with the stack name. + * An extensibility point to perform workspace cleanup (CLI operations may create/modify a Pulumi.stack.yaml) + * LocalWorkspace does not utilize this extensibility point. + */ + postCommandCallback(_) { + return __awaiter(this, void 0, void 0, function* () { + // LocalWorkspace does not utilize this extensibility point. + return; + }); + } + checkRemoteSupport() { + return __awaiter(this, void 0, void 0, function* () { + const optOut = !!this.envVars[SKIP_VERSION_CHECK_VAR] || !!process.env[SKIP_VERSION_CHECK_VAR]; + // If remote was specified, ensure the CLI supports it. + if (!optOut && this.isRemote) { + // See if `--remote` is present in `pulumi preview --help`'s output. + const previewResult = yield this.runPulumiCmd(["preview", "--help"]); + const previewOutput = previewResult.stdout.trim(); + if (!previewOutput.includes("--remote")) { + throw new Error("The Pulumi CLI does not support remote operations. Please upgrade."); + } + } + }); + } + runPulumiCmd(args) { + return __awaiter(this, void 0, void 0, function* () { + let envs = {}; + if (this.pulumiHome) { + envs["PULUMI_HOME"] = this.pulumiHome; + } + if (this.isRemote) { + envs["PULUMI_EXPERIMENTAL"] = "true"; + } + envs = Object.assign(Object.assign({}, envs), this.envVars); + return this.pulumiCommand.run(args, this.workDir, envs); + }); + } + /** @internal */ + get isRemote() { + return !!this.remote; + } + /** @internal */ + remoteArgs() { + var _a, _b; + const args = []; + if (!this.isRemote) { + return args; + } + args.push("--remote"); + if (this.remoteGitProgramArgs) { + const { url, projectPath, branch, commitHash, auth } = this.remoteGitProgramArgs; + if (url) { + args.push(url); + } + if (projectPath) { + args.push("--remote-git-repo-dir", projectPath); + } + if (branch) { + args.push("--remote-git-branch", branch); + } + if (commitHash) { + args.push("--remote-git-commit", commitHash); + } + if (auth) { + const { personalAccessToken, sshPrivateKey, sshPrivateKeyPath, password, username } = auth; + if (personalAccessToken) { + args.push("--remote-git-auth-access-token", personalAccessToken); + } + if (sshPrivateKey) { + args.push("--remote-git-auth-ssh-private-key", sshPrivateKey); + } + if (sshPrivateKeyPath) { + args.push("--remote-git-auth-ssh-private-key-path", sshPrivateKeyPath); + } + if (password) { + args.push("--remote-git-auth-password", password); + } + if (username) { + args.push("--remote-git-auth-username", username); + } + } + } + for (const key of Object.keys((_a = this.remoteEnvVars) !== null && _a !== void 0 ? _a : {})) { + const val = this.remoteEnvVars[key]; + if (typeof val === "string") { + args.push("--remote-env", `${key}=${val}`); + } + else if ("secret" in val) { + args.push("--remote-env-secret", `${key}=${val.secret}`); + } + else { + throw new Error(`unexpected env value '${val}' for key '${key}'`); + } + } + for (const command of (_b = this.remotePreRunCommands) !== null && _b !== void 0 ? _b : []) { + args.push("--remote-pre-run-command", command); + } + if (this.remoteSkipInstallDependencies) { + args.push("--remote-skip-install-dependencies"); + } + if (this.remoteInheritSettings) { + args.push("--remote-inherit-settings"); + } + return args; + } +} +exports.LocalWorkspace = LocalWorkspace; +/** + * Returns true if the provided `args` object satisfies the `LocalProgramArgs` interface. + * + * @param args The args object to evaluate + */ +function isLocalProgramArgs(args) { + return args.workDir !== undefined; +} +/** + * Returns true if the provided `args` object satisfies the `InlineProgramArgs` interface. + * + * @param args The args object to evaluate + */ +function isInlineProgramArgs(args) { + return args.projectName !== undefined && args.program !== undefined; +} +const settingsExtensions = [".yaml", ".yml", ".json"]; +function getStackSettingsName(name) { + const parts = name.split("/"); + if (parts.length < 1) { + return name; + } + return parts[parts.length - 1]; +} +function defaultProject(projectName) { + const settings = { name: projectName, runtime: "nodejs", main: process.cwd() }; + return settings; +} +function loadProjectSettings(workDir) { + for (const ext of settingsExtensions) { + const isJSON = ext === ".json"; + const path = upath.joinSafe(workDir, `Pulumi${ext}`); + if (!fs.existsSync(path)) { + continue; + } + const contents = fs.readFileSync(path).toString(); + if (isJSON) { + return JSON.parse(contents); + } + return yaml.safeLoad(contents); + } + throw new Error(`failed to find project settings file in workdir: ${workDir}`); +} +//# sourceMappingURL=localWorkspace.js.map + +/***/ }), + +/***/ 88410: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"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. +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const semver = __importStar(__nccwpck_require__(11383)); +/** @internal */ +exports.minimumVersion = new semver.SemVer("v3.2.0-alpha"); +//# sourceMappingURL=minimumVersion.js.map + +/***/ }), + +/***/ 55740: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// 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. +// 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 localWorkspace_1 = __nccwpck_require__(5142); +/** + * RemoteStack is an isolated, independencly configurable instance of a Pulumi program that is + * operated on remotely (up/preview/refresh/destroy). + */ +class RemoteStack { + constructor(stack) { + this.stack = stack; + const ws = stack.workspace; + if (!(ws instanceof localWorkspace_1.LocalWorkspace)) { + throw new Error("expected workspace to be an instance of LocalWorkspace"); + } + } + /** @internal */ + static create(stack) { + return new RemoteStack(stack); + } + /** + * The name identifying the Stack. + */ + get name() { + return this.stack.name; + } + /** + * Creates or updates the resources in a stack by executing the program in the Workspace. + * https://www.pulumi.com/docs/cli/commands/pulumi_up/ + * This operation runs remotely. + * + * @param opts Options to customize the behavior of the update. + */ + up(opts) { + return this.stack.up(opts); + } + /** + * Performs a dry-run update to a stack, returning pending changes. + * https://www.pulumi.com/docs/cli/commands/pulumi_preview/ + * This operation runs remotely. + * + * @param opts Options to customize the behavior of the preview. + */ + preview(opts) { + return this.stack.preview(opts); + } + /** + * Compares the current stack’s resource state with the state known to exist in the actual + * cloud provider. Any such changes are adopted into the current stack. + * This operation runs remotely. + * + * @param opts Options to customize the behavior of the refresh. + */ + refresh(opts) { + return this.stack.refresh(opts); + } + /** + * Destroy deletes all resources in a stack, leaving all history and configuration intact. + * This operation runs remotely. + * + * @param opts Options to customize the behavior of the destroy. + */ + destroy(opts) { + return this.stack.destroy(opts); + } + /** + * Gets the current set of Stack outputs from the last Stack.up(). + */ + outputs() { + return this.stack.outputs(); + } + /** + * Returns a list summarizing all previous and current results from Stack lifecycle operations + * (up/preview/refresh/destroy). + */ + history(pageSize, page) { + // TODO: Find a way to allow showSecrets as an option that doesn't require loading the project. + return this.stack.history(pageSize, page, false); + } + /** + * Cancel stops a stack's currently running update. It returns an error if no update is currently running. + * Note that this operation is _very dangerous_, and may leave the stack in an inconsistent state + * if a resource operation was pending when the update was canceled. + * This command is not supported for diy backends. + */ + cancel() { + return this.stack.cancel(); + } + /** + * exportStack exports the deployment state of the stack. + * This can be combined with Stack.importStack to edit a stack's state (such as recovery from failed deployments). + */ + exportStack() { + return this.stack.exportStack(); + } + /** + * importStack imports the specified deployment state into a pre-existing stack. + * This can be combined with Stack.exportStack to edit a stack's state (such as recovery from failed deployments). + * + * @param state the stack state to import. + */ + importStack(state) { + return this.stack.importStack(state); + } +} +exports.RemoteStack = RemoteStack; +//# sourceMappingURL=remoteStack.js.map + +/***/ }), + +/***/ 8106: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// 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. +// 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 localWorkspace_1 = __nccwpck_require__(5142); +const remoteStack_1 = __nccwpck_require__(55740); +const stack_1 = __nccwpck_require__(29010); +/** + * RemoteWorkspace is the execution context containing a single remote Pulumi project. + */ +class RemoteWorkspace { + /** + * PREVIEW: Creates a Stack backed by a RemoteWorkspace with source code from the specified Git repository. + * Pulumi operations on the stack (Preview, Update, Refresh, and Destroy) are performed remotely. + * + * @param args A set of arguments to initialize a RemoteStack with a remote Pulumi program from a Git repository. + * @param opts Additional customizations to be applied to the Workspace. + */ + static createStack(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + const ws = yield createLocalWorkspace(args, opts); + const stack = yield stack_1.Stack.create(args.stackName, ws); + return remoteStack_1.RemoteStack.create(stack); + }); + } + /** + * PREVIEW: Selects an existing Stack backed by a RemoteWorkspace with source code from the specified Git + * repository. Pulumi operations on the stack (Preview, Update, Refresh, and Destroy) are performed remotely. + * + * @param args A set of arguments to initialize a RemoteStack with a remote Pulumi program from a Git repository. + * @param opts Additional customizations to be applied to the Workspace. + */ + static selectStack(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + const ws = yield createLocalWorkspace(args, opts); + const stack = yield stack_1.Stack.select(args.stackName, ws); + return remoteStack_1.RemoteStack.create(stack); + }); + } + /** + * PREVIEW: Creates or selects an existing Stack backed by a RemoteWorkspace with source code from the specified + * Git repository. Pulumi operations on the stack (Preview, Update, Refresh, and Destroy) are performed remotely. + * + * @param args A set of arguments to initialize a RemoteStack with a remote Pulumi program from a Git repository. + * @param opts Additional customizations to be applied to the Workspace. + */ + static createOrSelectStack(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + const ws = yield createLocalWorkspace(args, opts); + const stack = yield stack_1.Stack.createOrSelect(args.stackName, ws); + return remoteStack_1.RemoteStack.create(stack); + }); + } + constructor() { } // eslint-disable-line @typescript-eslint/no-empty-function +} +exports.RemoteWorkspace = RemoteWorkspace; +function createLocalWorkspace(args, opts) { + return __awaiter(this, void 0, void 0, function* () { + if (!isFullyQualifiedStackName(args.stackName)) { + throw new Error(`stack name "${args.stackName}" must be fully qualified.`); + } + if (!args.url && !(opts === null || opts === void 0 ? void 0 : opts.inheritSettings)) { + throw new Error("url is required if inheritSettings is not set."); + } + if (args.branch && args.commitHash) { + throw new Error("branch and commitHash cannot both be specified."); + } + if (!args.branch && !args.commitHash && !(opts === null || opts === void 0 ? void 0 : opts.inheritSettings)) { + throw new Error("either branch or commitHash is required if inheritSettings is not set."); + } + if (args.auth) { + if (args.auth.sshPrivateKey && args.auth.sshPrivateKeyPath) { + throw new Error("sshPrivateKey and sshPrivateKeyPath cannot both be specified."); + } + } + const localOpts = { + remote: true, + remoteGitProgramArgs: args, + remoteEnvVars: opts === null || opts === void 0 ? void 0 : opts.envVars, + remotePreRunCommands: opts === null || opts === void 0 ? void 0 : opts.preRunCommands, + remoteSkipInstallDependencies: opts === null || opts === void 0 ? void 0 : opts.skipInstallDependencies, + remoteInheritSettings: opts === null || opts === void 0 ? void 0 : opts.inheritSettings, + }; + return yield localWorkspace_1.LocalWorkspace.create(localOpts); + }); +} +/** @internal exported only so it can be tested */ +function isFullyQualifiedStackName(stackName) { + if (!stackName) { + return false; + } + const split = stackName.split("/"); + return split.length === 3 && !!split[0] && !!split[1] && !!split[2]; +} +exports.isFullyQualifiedStackName = isFullyQualifiedStackName; +//# sourceMappingURL=remoteWorkspace.js.map + +/***/ }), + +/***/ 63621: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// 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. +// 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const errors_1 = __nccwpck_require__(89693); +const log = __importStar(__nccwpck_require__(80642)); +const runtimeConfig = __importStar(__nccwpck_require__(67146)); +const debuggable = __importStar(__nccwpck_require__(20257)); +const settings = __importStar(__nccwpck_require__(34530)); +const stack = __importStar(__nccwpck_require__(26664)); +const localState = __importStar(__nccwpck_require__(24741)); +const langproto = __importStar(__nccwpck_require__(53979)); +const plugproto = __importStar(__nccwpck_require__(38008)); +// maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) +/** @internal */ +exports.maxRPCMessageSize = 1024 * 1024 * 400; +/** @internal */ +class LanguageServer { + constructor(program) { + this.program = program; + } + 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] = debuggable.leakedPromises(); + if (leaks.size !== 0) { + throw new Error(leakMessage); + } + } + } + getRequiredPlugins(call, callback) { + const resp = new langproto.GetRequiredPluginsResponse(); + resp.setPluginsList([]); + callback(undefined, resp); + } + run(call, callback) { + const req = call.request; + const resp = new langproto.RunResponse(); + // Setup a new async state store for this run + const store = new localState.LocalStore(); + return localState.asyncLocalStorage.run(store, () => __awaiter(this, void 0, void 0, function* () { + var _a; + const errorSet = new Set(); + const uncaughtHandler = newUncaughtHandler(errorSet); + try { + const args = req.getArgsList(); + const engineAddr = args && args.length > 0 ? args[0] : ""; + settings.resetOptions(req.getProject(), req.getStack(), req.getParallel(), engineAddr, req.getMonitorAddress(), req.getDryrun(), req.getOrganization()); + const config = {}; + for (const [k, v] of ((_a = req.getConfigMap()) === null || _a === void 0 ? void 0 : _a.entries()) || []) { + config[k] = v; + } + runtimeConfig.setAllConfig(config, req.getConfigsecretkeysList() || []); + process.setMaxListeners(settings.getMaximumListeners()); + 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 stack.runInPulumiStack(this.program); + yield settings.disconnect(); + process.off("uncaughtException", uncaughtHandler); + process.off("unhandledRejection", uncaughtHandler); + } + catch (e) { + yield settings.disconnect(); + process.off("uncaughtException", uncaughtHandler); + process.off("unhandledRejection", uncaughtHandler); + if (!errors_1.isGrpcError(e)) { + throw e; + } + } + if (errorSet.size !== 0 || log.hasErrors()) { + let errorMessage = ""; + if (errorSet.size !== 0) { + errorMessage = ": "; + errorSet.forEach((error) => { + errorMessage += `${error.message}, `; + }); + errorMessage = errorMessage.slice(0, -2); + } + else { + errorMessage = ". Check logs for more details"; + } + throw new Error(`One or more errors occurred${errorMessage}`); + } + } + catch (e) { + const err = e instanceof Error ? e : new Error(`unknown error ${e}`); + resp.setError(err.message); + callback(err, undefined); + } + callback(undefined, resp); + })); + } + getPluginInfo(call, callback) { + const resp = new plugproto.PluginInfo(); + resp.setVersion("1.0.0"); + callback(undefined, resp); + } +} +exports.LanguageServer = LanguageServer; +function newUncaughtHandler(errorSet) { + return (err) => { + // In node, if you throw an error in a chained promise, but the exception is not finally + // handled, then you can end up getting an unhandledRejection for each exception/promise + // pair. Because the exception is the same through all of these, we keep track of it and + // only report it once so the user doesn't get N messages for the same thing. + if (errorSet.has(err)) { + return; + } + errorSet.add(err); + // Default message should be to include the full stack (which includes the message), or + // fallback to just the message if we can't get the stack. + // + // If both the stack and message are empty, then just stringify the err object itself. This + // is also necessary as users can throw arbitrary things in JS (including non-Errors). + let defaultMessage = ""; + if (err) { + defaultMessage = err.stack || err.message || "" + err; + } + // First, log the error. + if (errors_1.RunError.isInstance(err)) { + // Always hide the stack for RunErrors. + log.error(err.message); + } + else if (errors_1.ResourceError.isInstance(err)) { + // Hide the stack if requested to by the ResourceError creator. + const message = err.hideStack ? err.message : defaultMessage; + log.error(message, err.resource); + } + else if (!errors_1.isGrpcError(err)) { + log.error(`Unhandled exception: ${defaultMessage}`); + } + }; +} +//# sourceMappingURL=server.js.map + +/***/ }), + +/***/ 29010: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// 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. +// 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const fs = __importStar(__nccwpck_require__(57147)); +const os = __importStar(__nccwpck_require__(22037)); +const pathlib = __importStar(__nccwpck_require__(71017)); +const readline = __importStar(__nccwpck_require__(14521)); +const upath = __importStar(__nccwpck_require__(8004)); +const grpc = __importStar(__nccwpck_require__(7025)); +const tail_file_1 = __importDefault(__nccwpck_require__(725)); +const log = __importStar(__nccwpck_require__(80642)); +const errors_1 = __nccwpck_require__(71369); +const localWorkspace_1 = __nccwpck_require__(5142); +const server_1 = __nccwpck_require__(63621); +const langrpc = __importStar(__nccwpck_require__(75628)); +/** + * 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. + * Multiple Stacks are commonly used to denote different phases of development + * (such as development, staging and production) or feature branches (such as feature-x-dev, jane-feature-x-dev). + * + * @alpha + */ +class Stack { + constructor(name, workspace, mode) { + this.name = name; + this.workspace = workspace; + switch (mode) { + case "create": + this.ready = workspace.createStack(name); + return this; + case "select": + this.ready = workspace.selectStack(name); + return this; + case "createOrSelect": + this.ready = workspace.selectStack(name).catch((err) => { + if (err instanceof errors_1.StackNotFoundError) { + return workspace.createStack(name); + } + throw err; + }); + return this; + default: + throw new Error(`unexpected Stack creation mode: ${mode}`); + } + } + /** + * Creates a new stack using the given workspace, and stack name. + * It fails if a stack with that name already exists + * + * @param name The name identifying the Stack. + * @param workspace The Workspace the Stack was created from. + */ + static create(name, workspace) { + return __awaiter(this, void 0, void 0, function* () { + const stack = new Stack(name, workspace, "create"); + yield stack.ready; + return stack; + }); + } + /** + * Selects stack using the given workspace, and stack name. + * It returns an error if the given Stack does not exist. + * + * @param name The name identifying the Stack. + * @param workspace The Workspace the Stack was created from. + */ + static select(name, workspace) { + return __awaiter(this, void 0, void 0, function* () { + const stack = new Stack(name, workspace, "select"); + yield stack.ready; + return stack; + }); + } + /** + * Tries to create a new stack using the given workspace and + * stack name if the stack does not already exist, + * or falls back to selecting the existing stack. If the stack does not exist, + * it will be created and selected. + * + * @param name The name identifying the Stack. + * @param workspace The Workspace the Stack was created from. + */ + static createOrSelect(name, workspace) { + return __awaiter(this, void 0, void 0, function* () { + const stack = new Stack(name, workspace, "createOrSelect"); + yield stack.ready; + return stack; + }); + } + readLines(logPath, callback) { + return __awaiter(this, void 0, void 0, function* () { + const eventLogTail = new tail_file_1.default(logPath, { startPos: 0, pollFileIntervalMs: 200 }).on("tail_error", (err) => { + throw err; + }); + yield eventLogTail.start(); + const lineSplitter = readline.createInterface({ input: eventLogTail }); + lineSplitter.on("line", (line) => { + let event; + try { + event = JSON.parse(line); + callback(event); + } + catch (e) { + log.warn(`Failed to parse engine event +If you're seeing this warning, please comment on https://github.com/pulumi/pulumi/issues/6768 with the event and any +details about your environment. +Event: ${line}\n${e.toString()}`); + } + }); + return { + tail: eventLogTail, + rl: lineSplitter, + }; + }); + } + /** + * Creates or updates the resources in a stack by executing the program in the Workspace. + * https://www.pulumi.com/docs/cli/commands/pulumi_up/ + * + * @param opts Options to customize the behavior of the update. + */ + up(opts) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["up", "--yes", "--skip-preview"]; + let kind = execKind.local; + let program = this.workspace.program; + args.push(...this.remoteArgs()); + if (opts) { + if (opts.program) { + program = opts.program; + } + if (opts.message) { + args.push("--message", opts.message); + } + if (opts.expectNoChanges) { + args.push("--expect-no-changes"); + } + if (opts.refresh) { + args.push("--refresh"); + } + if (opts.diff) { + args.push("--diff"); + } + if (opts.replace) { + for (const rURN of opts.replace) { + args.push("--replace", rURN); + } + } + if (opts.target) { + for (const tURN of opts.target) { + args.push("--target", tURN); + } + } + if (opts.policyPacks) { + for (const pack of opts.policyPacks) { + args.push("--policy-pack", pack); + } + } + if (opts.policyPackConfigs) { + for (const packConfig of opts.policyPackConfigs) { + args.push("--policy-pack-config", packConfig); + } + } + if (opts.targetDependents) { + args.push("--target-dependents"); + } + if (opts.parallel) { + args.push("--parallel", opts.parallel.toString()); + } + if (opts.userAgent) { + args.push("--exec-agent", opts.userAgent); + } + if (opts.plan) { + args.push("--plan", opts.plan); + } + if (opts.continueOnError) { + args.push("--continue-on-error"); + } + applyGlobalOpts(opts, args); + } + let onExit = (hasError) => { + return; + }; + let didError = false; + if (program) { + kind = execKind.inline; + const server = new grpc.Server({ + "grpc.max_receive_message_length": server_1.maxRPCMessageSize, + }); + const languageServer = new server_1.LanguageServer(program); + server.addService(langrpc.LanguageRuntimeService, languageServer); + const port = yield new Promise((resolve, reject) => { + server.bindAsync(`127.0.0.1:0`, grpc.ServerCredentials.createInsecure(), (err, p) => { + if (err) { + reject(err); + } + else { + resolve(p); + } + }); + }); + onExit = (hasError) => { + languageServer.onPulumiExit(hasError); + server.forceShutdown(); + }; + args.push(`--client=127.0.0.1:${port}`); + } + args.push("--exec-kind", kind); + let logPromise; + let logFile; + // Set up event log tailing + if (opts === null || opts === void 0 ? void 0 : opts.onEvent) { + const onEvent = opts.onEvent; + logFile = createLogFile("up"); + args.push("--event-log", logFile); + logPromise = this.readLines(logFile, (event) => { + onEvent(event); + }); + } + let upResult; + try { + upResult = yield this.runPulumiCmd(args, opts === null || opts === void 0 ? void 0 : opts.onOutput); + } + catch (e) { + didError = true; + throw e; + } + finally { + onExit(didError); + yield cleanUp(logFile, yield logPromise); + } + // TODO: do this in parallel after this is fixed https://github.com/pulumi/pulumi/issues/6050 + const outputs = yield this.outputs(); + // If it's a remote workspace, explicitly set showSecrets to false to prevent attempting to + // load the project file. + const summary = yield this.info(!this.isRemote && (opts === null || opts === void 0 ? void 0 : opts.showSecrets)); + return { + stdout: upResult.stdout, + stderr: upResult.stderr, + summary: summary, + outputs: outputs, + }; + }); + } + /** + * Performs a dry-run update to a stack, returning pending changes. + * https://www.pulumi.com/docs/cli/commands/pulumi_preview/ + * + * @param opts Options to customize the behavior of the preview. + */ + preview(opts) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["preview"]; + let kind = execKind.local; + let program = this.workspace.program; + args.push(...this.remoteArgs()); + if (opts) { + if (opts.program) { + program = opts.program; + } + if (opts.message) { + args.push("--message", opts.message); + } + if (opts.expectNoChanges) { + args.push("--expect-no-changes"); + } + if (opts.refresh) { + args.push("--refresh"); + } + if (opts.diff) { + args.push("--diff"); + } + if (opts.replace) { + for (const rURN of opts.replace) { + args.push("--replace", rURN); + } + } + if (opts.target) { + for (const tURN of opts.target) { + args.push("--target", tURN); + } + } + if (opts.policyPacks) { + for (const pack of opts.policyPacks) { + args.push("--policy-pack", pack); + } + } + if (opts.policyPackConfigs) { + for (const packConfig of opts.policyPackConfigs) { + args.push("--policy-pack-config", packConfig); + } + } + if (opts.targetDependents) { + args.push("--target-dependents"); + } + if (opts.parallel) { + args.push("--parallel", opts.parallel.toString()); + } + if (opts.userAgent) { + args.push("--exec-agent", opts.userAgent); + } + if (opts.plan) { + args.push("--save-plan", opts.plan); + } + if (opts.importFile) { + args.push("--import-file", opts.importFile); + } + applyGlobalOpts(opts, args); + } + let onExit = (hasError) => { + return; + }; + let didError = false; + if (program) { + kind = execKind.inline; + const server = new grpc.Server({ + "grpc.max_receive_message_length": server_1.maxRPCMessageSize, + }); + const languageServer = new server_1.LanguageServer(program); + server.addService(langrpc.LanguageRuntimeService, languageServer); + const port = yield new Promise((resolve, reject) => { + server.bindAsync(`127.0.0.1:0`, grpc.ServerCredentials.createInsecure(), (err, p) => { + if (err) { + reject(err); + } + else { + resolve(p); + } + }); + }); + onExit = (hasError) => { + languageServer.onPulumiExit(hasError); + server.forceShutdown(); + }; + args.push(`--client=127.0.0.1:${port}`); + } + args.push("--exec-kind", kind); + // Set up event log tailing + const logFile = createLogFile("preview"); + args.push("--event-log", logFile); + let summaryEvent; + const logPromise = this.readLines(logFile, (event) => { + if (event.summaryEvent) { + summaryEvent = event.summaryEvent; + } + if (opts === null || opts === void 0 ? void 0 : opts.onEvent) { + const onEvent = opts.onEvent; + onEvent(event); + } + }); + let previewResult; + try { + previewResult = yield this.runPulumiCmd(args, opts === null || opts === void 0 ? void 0 : opts.onOutput); + } + catch (e) { + didError = true; + throw e; + } + finally { + onExit(didError); + yield cleanUp(logFile, yield logPromise); + } + if (!summaryEvent) { + log.warn("Failed to parse summary event, but preview succeeded. PreviewResult `changeSummary` will be empty."); + } + return { + stdout: previewResult.stdout, + stderr: previewResult.stderr, + changeSummary: (summaryEvent === null || summaryEvent === void 0 ? void 0 : summaryEvent.resourceChanges) || {}, + }; + }); + } + /** + * Compares the current stack’s resource state with the state known to exist in the actual + * cloud provider. Any such changes are adopted into the current stack. + * + * @param opts Options to customize the behavior of the refresh. + */ + refresh(opts) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["refresh", "--yes", "--skip-preview"]; + args.push(...this.remoteArgs()); + if (opts) { + if (opts.message) { + args.push("--message", opts.message); + } + if (opts.expectNoChanges) { + args.push("--expect-no-changes"); + } + if (opts.target) { + for (const tURN of opts.target) { + args.push("--target", tURN); + } + } + if (opts.parallel) { + args.push("--parallel", opts.parallel.toString()); + } + if (opts.userAgent) { + args.push("--exec-agent", opts.userAgent); + } + applyGlobalOpts(opts, args); + } + let logPromise; + let logFile; + // Set up event log tailing + if (opts === null || opts === void 0 ? void 0 : opts.onEvent) { + const onEvent = opts.onEvent; + logFile = createLogFile("refresh"); + args.push("--event-log", logFile); + logPromise = this.readLines(logFile, (event) => { + onEvent(event); + }); + } + const kind = this.workspace.program ? execKind.inline : execKind.local; + args.push("--exec-kind", kind); + let refResult; + try { + refResult = yield this.runPulumiCmd(args, opts === null || opts === void 0 ? void 0 : opts.onOutput); + } + finally { + yield cleanUp(logFile, yield logPromise); + } + // If it's a remote workspace, explicitly set showSecrets to false to prevent attempting to + // load the project file. + const summary = yield this.info(!this.isRemote && (opts === null || opts === void 0 ? void 0 : opts.showSecrets)); + return { + stdout: refResult.stdout, + stderr: refResult.stderr, + summary: summary, + }; + }); + } + /** + * Destroy deletes all resources in a stack, leaving all history and configuration intact. + * + * @param opts Options to customize the behavior of the destroy. + */ + destroy(opts) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["destroy", "--yes", "--skip-preview"]; + args.push(...this.remoteArgs()); + if (opts) { + if (opts.message) { + args.push("--message", opts.message); + } + if (opts.target) { + for (const tURN of opts.target) { + args.push("--target", tURN); + } + } + if (opts.targetDependents) { + args.push("--target-dependents"); + } + if (opts.excludeProtected) { + args.push("--exclude-protected"); + } + if (opts.continueOnError) { + args.push("--continue-on-error"); + } + if (opts.parallel) { + args.push("--parallel", opts.parallel.toString()); + } + if (opts.userAgent) { + args.push("--exec-agent", opts.userAgent); + } + applyGlobalOpts(opts, args); + } + let logPromise; + let logFile; + // Set up event log tailing + if (opts === null || opts === void 0 ? void 0 : opts.onEvent) { + const onEvent = opts.onEvent; + logFile = createLogFile("destroy"); + args.push("--event-log", logFile); + logPromise = this.readLines(logFile, (event) => { + onEvent(event); + }); + } + const kind = this.workspace.program ? execKind.inline : execKind.local; + args.push("--exec-kind", kind); + let desResult; + try { + desResult = yield this.runPulumiCmd(args, opts === null || opts === void 0 ? void 0 : opts.onOutput); + } + finally { + yield cleanUp(logFile, yield logPromise); + } + // If it's a remote workspace, explicitly set showSecrets to false to prevent attempting to + // load the project file. + const summary = yield this.info(!this.isRemote && (opts === null || opts === void 0 ? void 0 : opts.showSecrets)); + return { + stdout: desResult.stdout, + stderr: desResult.stderr, + summary: summary, + }; + }); + } + /** + * Adds environments to the end of a stack's import list. Imported environments are merged in order + * per the ESC merge rules. The list of environments behaves as if it were the import list in an anonymous + * environment. + * + * @param environments The names of the environments to add to the stack's configuration + */ + addEnvironments(...environments) { + return __awaiter(this, void 0, void 0, function* () { + yield this.workspace.addEnvironments(this.name, ...environments); + }); + } + /** + * Returns the list of environments currently in the stack's import list. + */ + listEnvironments() { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.listEnvironments(this.name); + }); + } + /** + * Removes an environment from a stack's import list. + * + * @param environment The name of the environment to remove from the stack's configuration + */ + removeEnvironment(environment) { + return __awaiter(this, void 0, void 0, function* () { + yield this.workspace.removeEnvironment(this.name, environment); + }); + } + /** + * Returns the config value associated with the specified key. + * + * @param key The key to use for the config lookup + * @param path The key contains a path to a property in a map or list to get + */ + getConfig(key, path) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.getConfig(this.name, key, path); + }); + } + /** + * Returns the full config map associated with the stack in the Workspace. + */ + getAllConfig() { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.getAllConfig(this.name); + }); + } + /** + * Sets a config key-value pair on the Stack in the associated Workspace. + * + * @param key The key to set. + * @param value The config value to set. + * @param path The key contains a path to a property in a map or list to set. + */ + setConfig(key, value, path) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.setConfig(this.name, key, value, path); + }); + } + /** + * Sets all specified config values on the stack in the associated Workspace. + * + * @param config The map of config key-value pairs to set. + * @param path The keys contain a path to a property in a map or list to set. + */ + setAllConfig(config, path) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.setAllConfig(this.name, config, path); + }); + } + /** + * Removes the specified config key from the Stack in the associated Workspace. + * + * @param key The config key to remove. + * @param path The key contains a path to a property in a map or list to remove. + */ + removeConfig(key, path) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.removeConfig(this.name, key, path); + }); + } + /** + * Removes the specified config keys from the Stack in the associated Workspace. + * + * @param keys The config keys to remove. + * @param path The keys contain a path to a property in a map or list to remove. + */ + removeAllConfig(keys, path) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.removeAllConfig(this.name, keys, path); + }); + } + /** + * Gets and sets the config map used with the last update. + */ + refreshConfig() { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.refreshConfig(this.name); + }); + } + /** + * Returns the tag value associated with specified key. + * + * @param key The key to use for the tag lookup. + */ + getTag(key) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.getTag(this.name, key); + }); + } + /** + * Sets a tag key-value pair on the Stack in the associated Workspace. + * + * @param key The tag key to set. + * @param value The tag value to set. + */ + setTag(key, value) { + return __awaiter(this, void 0, void 0, function* () { + yield this.workspace.setTag(this.name, key, value); + }); + } + /** + * Removes the specified tag key-value pair from the Stack in the associated Workspace. + * + * @param key The tag key to remove. + */ + removeTag(key) { + return __awaiter(this, void 0, void 0, function* () { + yield this.workspace.removeTag(this.name, key); + }); + } + /** + * Returns the full tag map associated with the stack in the Workspace. + */ + listTags() { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.listTags(this.name); + }); + } + /** + * Gets the current set of Stack outputs from the last Stack.up(). + */ + outputs() { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.stackOutputs(this.name); + }); + } + /** + * Returns a list summarizing all previous and current results from Stack lifecycle operations + * (up/preview/refresh/destroy). + */ + history(pageSize, page, showSecrets) { + return __awaiter(this, void 0, void 0, function* () { + const args = ["stack", "history", "--json"]; + if (showSecrets !== null && showSecrets !== void 0 ? showSecrets : true) { + args.push("--show-secrets"); + } + if (pageSize) { + if (!page || page < 1) { + page = 1; + } + args.push("--page-size", Math.floor(pageSize).toString(), "--page", Math.floor(page).toString()); + } + const result = yield this.runPulumiCmd(args); + return JSON.parse(result.stdout, (key, value) => { + if (key === "startTime" || key === "endTime") { + return new Date(value); + } + return value; + }); + }); + } + info(showSecrets) { + return __awaiter(this, void 0, void 0, function* () { + const history = yield this.history(1 /*pageSize*/, undefined, showSecrets); + if (!history || history.length === 0) { + return undefined; + } + return history[0]; + }); + } + /** + * Cancel stops a stack's currently running update. It returns an error if no update is currently running. + * Note that this operation is _very dangerous_, and may leave the stack in an inconsistent state + * if a resource operation was pending when the update was canceled. + * This command is not supported for diy backends. + */ + cancel() { + return __awaiter(this, void 0, void 0, function* () { + yield this.runPulumiCmd(["cancel", "--yes"]); + }); + } + /** + * exportStack exports the deployment state of the stack. + * This can be combined with Stack.importStack to edit a stack's state (such as recovery from failed deployments). + */ + exportStack() { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.exportStack(this.name); + }); + } + /** + * importStack imports the specified deployment state into a pre-existing stack. + * This can be combined with Stack.exportStack to edit a stack's state (such as recovery from failed deployments). + * + * @param state the stack state to import. + */ + importStack(state) { + return __awaiter(this, void 0, void 0, function* () { + return this.workspace.importStack(this.name, state); + }); + } + runPulumiCmd(args, onOutput) { + return __awaiter(this, void 0, void 0, function* () { + let envs = { + PULUMI_DEBUG_COMMANDS: "true", + }; + if (this.isRemote) { + envs["PULUMI_EXPERIMENTAL"] = "true"; + } + const pulumiHome = this.workspace.pulumiHome; + if (pulumiHome) { + envs["PULUMI_HOME"] = pulumiHome; + } + envs = Object.assign(Object.assign({}, envs), this.workspace.envVars); + const additionalArgs = yield this.workspace.serializeArgsForOp(this.name); + args = [...args, "--stack", this.name, ...additionalArgs]; + const result = yield this.workspace.pulumiCommand.run(args, this.workspace.workDir, envs, onOutput); + yield this.workspace.postCommandCallback(this.name); + return result; + }); + } + get isRemote() { + const ws = this.workspace; + return ws instanceof localWorkspace_1.LocalWorkspace ? ws.isRemote : false; + } + remoteArgs() { + const ws = this.workspace; + return ws instanceof localWorkspace_1.LocalWorkspace ? ws.remoteArgs() : []; + } +} +exports.Stack = Stack; +function applyGlobalOpts(opts, args) { + if (opts.color) { + args.push("--color", opts.color); + } + if (opts.logFlow) { + args.push("--logflow"); + } + if (opts.logVerbosity) { + args.push("--verbose", opts.logVerbosity.toString()); + } + if (opts.logToStdErr) { + args.push("--logtostderr"); + } + if (opts.tracing) { + args.push("--tracing", opts.tracing); + } + if (opts.debug) { + args.push("--debug"); + } + if (opts.suppressOutputs) { + args.push("--suppress-outputs"); + } + if (opts.suppressProgress) { + args.push("--suppress-progress"); + } +} +/** + * Returns a stack name formatted with the greatest possible specificity: + * org/project/stack or user/project/stack + * Using this format avoids ambiguity in stack identity guards creating or selecting the wrong stack. + * Note that legacy diy backends (local file, S3, Azure Blob) do not support stack names in this + * format, and instead only use the stack name without an org/user or project to qualify it. + * See: https://github.com/pulumi/pulumi/issues/2522 + * Non-legacy diy backends do support the org/project/stack format but org must be set to "organization". + * + * @param org The org (or user) that contains the Stack. + * @param project The project that parents the Stack. + * @param stack The name of the Stack. + */ +function fullyQualifiedStackName(org, project, stack) { + return `${org}/${project}/${stack}`; +} +exports.fullyQualifiedStackName = fullyQualifiedStackName; +const execKind = { + local: "auto.local", + inline: "auto.inline", +}; +const createLogFile = (command) => { + const logDir = fs.mkdtempSync(upath.joinSafe(os.tmpdir(), `automation-logs-${command}-`)); + const logFile = upath.joinSafe(logDir, "eventlog.txt"); + // just open/close the file to make sure it exists when we start polling. + fs.closeSync(fs.openSync(logFile, "w")); + return logFile; +}; +const cleanUp = (logFile, rl) => __awaiter(void 0, void 0, void 0, function* () { + if (rl) { + // stop tailing + yield rl.tail.quit(); + // close the readline interface + rl.rl.close(); + } + if (logFile) { + // remove the logfile + if (fs.rm) { + // remove with Node JS 15.X+ + fs.rm(pathlib.dirname(logFile), { recursive: true }, () => { + return; + }); + } + else { + // remove with Node JS 14.X + fs.rmdir(pathlib.dirname(logFile), { recursive: true }, () => { + return; + }); + } + } +}); +//# sourceMappingURL=stack.js.map + +/***/ }), + +/***/ 25973: +/***/ ((__unused_webpack_module, exports) => { + +"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. +Object.defineProperty(exports, "__esModule", ({ value: true })); +/** @internal */ +exports.stackSettingsSerDeKeys = [ + ["secretsprovider", "secretsProvider"], + ["encryptedkey", "encryptedKey"], + ["encryptionsalt", "encryptionSalt"], +]; +//# sourceMappingURL=stackSettings.js.map + +/***/ }), + +/***/ 89693: +/***/ (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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const grpc = __importStar(__nccwpck_require__(7025)); +const utils = __importStar(__nccwpck_require__(21888)); +/** + * 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 + * stack trace. This type should be rarely used. Ideally ResourceError should always be used so + * that as many errors as possible can be associated with a Resource. + */ +class RunError extends Error { + constructor() { + super(...arguments); + /** + * A private field to help with RTTI that works in SxS scenarios. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiRunError = true; + } + /** + * Returns true if the given object is an instance of a RunError. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiRunError"); + } +} +exports.RunError = RunError; +/** + * ResourceError can be used for terminating a program abruptly, specifically associating the + * problem with a Resource. Depending on the nature of the problem, clients can choose whether or + * not a call stack should be returned as well. This should be very rare, and would only indicate + * no usefulness of presenting that stack to the user. + */ +class ResourceError extends Error { + constructor(message, resource, hideStack) { + super(message); + this.resource = resource; + this.hideStack = hideStack; + /** + * A private field to help with RTTI that works in SxS scenarios. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle, id-blacklist, id-match + this.__pulumResourceError = true; + } + /** + * Returns true if the given object is an instance of a ResourceError. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumResourceError"); + } +} +exports.ResourceError = ResourceError; +function isGrpcError(err) { + const code = err.code; + return code === grpc.status.UNAVAILABLE || code === grpc.status.CANCELLED; +} +exports.isGrpcError = isGrpcError; +//# sourceMappingURL=errors.js.map + +/***/ }), + +/***/ 80642: +/***/ (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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const engproto = __importStar(__nccwpck_require__(10986)); +const settings_1 = __nccwpck_require__(34530); +const state_1 = __nccwpck_require__(24741); +let lastLog = Promise.resolve(); +const messageLevels = { + [engproto.LogSeverity.DEBUG]: "debug", + [engproto.LogSeverity.INFO]: "info", + [engproto.LogSeverity.WARNING]: "warn", + [engproto.LogSeverity.ERROR]: "error", +}; +/** + * hasErrors returns true if any errors have occurred in the program. + */ +function hasErrors() { + return state_1.getStore().logErrorCount > 0; +} +exports.hasErrors = hasErrors; +/** + * debug logs a debug-level message that is generally hidden from end-users. + */ +function debug(msg, resource, streamId, ephemeral) { + const engine = settings_1.getEngine(); + if (engine) { + return log(engine, engproto.LogSeverity.DEBUG, msg, resource, streamId, ephemeral); + } + else { + return Promise.resolve(); + } +} +exports.debug = debug; +/** + * info logs an informational message that is generally printed to stdout during resource operations. + */ +function info(msg, resource, streamId, ephemeral) { + const engine = settings_1.getEngine(); + if (engine) { + return log(engine, engproto.LogSeverity.INFO, msg, resource, streamId, ephemeral); + } + else { + console.log(`info: [runtime] ${msg}`); + return Promise.resolve(); + } +} +exports.info = info; +/** + * warn logs a warning to indicate that something went wrong, but not catastrophically so. + */ +function warn(msg, resource, streamId, ephemeral) { + const engine = settings_1.getEngine(); + if (engine) { + return log(engine, engproto.LogSeverity.WARNING, msg, resource, streamId, ephemeral); + } + else { + console.warn(`warning: [runtime] ${msg}`); + return Promise.resolve(); + } +} +exports.warn = warn; +/** + * error logs a fatal condition. Consider raising an exception after calling error to stop the Pulumi program. + */ +function error(msg, resource, streamId, ephemeral) { + state_1.getStore().logErrorCount++; // remember the error so we can suppress leaks. + const engine = settings_1.getEngine(); + if (engine) { + return log(engine, engproto.LogSeverity.ERROR, msg, resource, streamId, ephemeral); + } + else { + console.error(`error: [runtime] ${msg}`); + return Promise.resolve(); + } +} +exports.error = error; +function log(engine, sev, msg, resource, streamId, ephemeral) { + // Ensure we log everything in serial order. + const keepAlive = settings_1.rpcKeepAlive(); + const urnPromise = resource ? resource.urn.promise() : Promise.resolve(""); + lastLog = Promise.all([lastLog, urnPromise]).then(([_, urn]) => { + return new Promise((resolve, reject) => { + try { + const req = new engproto.LogRequest(); + req.setSeverity(sev); + req.setMessage(msg); + req.setUrn(urn); + req.setStreamid(streamId === undefined ? 0 : streamId); + req.setEphemeral(ephemeral === true); + engine.log(req, () => { + resolve(); // let the next log through + keepAlive(); // permit RPC channel tear-downs + }); + } + catch (err) { + reject(err); + } + }); + }); + return lastLog.catch((err) => { + // debug messages never go to stdout/err + if (sev !== engproto.LogSeverity.DEBUG) { + // if we're unable to deliver the log message, deliver to stderr instead + console.error(`failed to deliver log message. \nerror: ${err} \noriginal message: ${msg}\n message severity: ${messageLevels[sev]}`); + } + // we still need to free up the outstanding promise chain, whether or not delivery succeeded. + keepAlive(); + }); +} +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 8085: +/***/ (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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +// This file exports metadata about the context in which a program is being run. +const settings = __importStar(__nccwpck_require__(34530)); +/** + * getOrganization returns the current organization name. + */ +function getOrganization() { + return settings.getOrganization(); +} +exports.getOrganization = getOrganization; +/** + * getProject returns the current project name. It throws an exception if none is registered. + */ +function getProject() { + return settings.getProject(); +} +exports.getProject = getProject; +/** + * getStack returns the current stack name. It throws an exception if none is registered. + */ +function getStack() { + return settings.getStack(); +} +exports.getStack = getStack; +//# sourceMappingURL=metadata.js.map + +/***/ }), + +/***/ 65789: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + + +var yaml = __nccwpck_require__(67391); + + +module.exports = yaml; + + +/***/ }), + +/***/ 67391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + + +var loader = __nccwpck_require__(84521); +var dumper = __nccwpck_require__(39039); + + +function deprecated(name) { + return function () { + throw new Error('Function ' + name + ' is deprecated and cannot be used.'); + }; +} + + +module.exports.Type = __nccwpck_require__(44851); +module.exports.Schema = __nccwpck_require__(39681); +module.exports.FAILSAFE_SCHEMA = __nccwpck_require__(82730); +module.exports.JSON_SCHEMA = __nccwpck_require__(61765); +module.exports.CORE_SCHEMA = __nccwpck_require__(50105); +module.exports.DEFAULT_SAFE_SCHEMA = __nccwpck_require__(32974); +module.exports.DEFAULT_FULL_SCHEMA = __nccwpck_require__(71148); +module.exports.load = loader.load; +module.exports.loadAll = loader.loadAll; +module.exports.safeLoad = loader.safeLoad; +module.exports.safeLoadAll = loader.safeLoadAll; +module.exports.dump = dumper.dump; +module.exports.safeDump = dumper.safeDump; +module.exports.YAMLException = __nccwpck_require__(79590); + +// Deprecated schema names from JS-YAML 2.0.x +module.exports.MINIMAL_SCHEMA = __nccwpck_require__(82730); +module.exports.SAFE_SCHEMA = __nccwpck_require__(32974); +module.exports.DEFAULT_SCHEMA = __nccwpck_require__(71148); + +// Deprecated functions from JS-YAML 1.x.x +module.exports.scan = deprecated('scan'); +module.exports.parse = deprecated('parse'); +module.exports.compose = deprecated('compose'); +module.exports.addConstructor = deprecated('addConstructor'); + + +/***/ }), + +/***/ 40110: +/***/ ((module) => { + +"use strict"; + + + +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} + + +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; + + +/***/ }), + +/***/ 39039: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable no-use-before-define*/ + +var common = __nccwpck_require__(40110); +var YAMLException = __nccwpck_require__(79590); +var DEFAULT_FULL_SCHEMA = __nccwpck_require__(71148); +var DEFAULT_SAFE_SCHEMA = __nccwpck_require__(32974); + +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; + + +/***/ }), + +/***/ 79590: +/***/ ((module) => { + +"use strict"; +// YAML error class. http://stackoverflow.com/questions/8458984 +// + + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; + + +/***/ }), + +/***/ 84521: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable max-len,no-use-before-define*/ + +var common = __nccwpck_require__(40110); +var YAMLException = __nccwpck_require__(79590); +var Mark = __nccwpck_require__(73544); +var DEFAULT_SAFE_SCHEMA = __nccwpck_require__(32974); +var DEFAULT_FULL_SCHEMA = __nccwpck_require__(71148); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; + + +/***/ }), + +/***/ 73544: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + + +var common = __nccwpck_require__(40110); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; + + +/***/ }), + +/***/ 39681: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable max-len*/ + +var common = __nccwpck_require__(40110); +var YAMLException = __nccwpck_require__(79590); +var Type = __nccwpck_require__(44851); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; + + +/***/ }), + +/***/ 50105: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + + + + +var Schema = __nccwpck_require__(39681); + + +module.exports = new Schema({ + include: [ + __nccwpck_require__(61765) + ] +}); + + +/***/ }), + +/***/ 71148: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + + + + +var Schema = __nccwpck_require__(39681); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + __nccwpck_require__(32974) + ], + explicit: [ + __nccwpck_require__(25532), + __nccwpck_require__(93579), + __nccwpck_require__(88511) + ] +}); + + +/***/ }), + +/***/ 32974: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + + + + +var Schema = __nccwpck_require__(39681); + + +module.exports = new Schema({ + include: [ + __nccwpck_require__(50105) + ], + implicit: [ + __nccwpck_require__(73233), + __nccwpck_require__(7724) + ], + explicit: [ + __nccwpck_require__(64200), + __nccwpck_require__(91677), + __nccwpck_require__(48727), + __nccwpck_require__(21864) + ] +}); + + +/***/ }), + +/***/ 82730: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + + + + +var Schema = __nccwpck_require__(39681); + + +module.exports = new Schema({ + explicit: [ + __nccwpck_require__(91667), + __nccwpck_require__(14928), + __nccwpck_require__(76373) + ] +}); + + +/***/ }), + +/***/ 61765: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + + + + +var Schema = __nccwpck_require__(39681); + + +module.exports = new Schema({ + include: [ + __nccwpck_require__(82730) + ], + implicit: [ + __nccwpck_require__(20966), + __nccwpck_require__(85250), + __nccwpck_require__(49592), + __nccwpck_require__(87106) + ] +}); + + +/***/ }), + +/***/ 44851: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var YAMLException = __nccwpck_require__(79590); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + + +/***/ }), + +/***/ 64200: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = __nccwpck_require__(44851); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + + +/***/ }), + +/***/ 85250: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + + +/***/ }), + +/***/ 87106: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var common = __nccwpck_require__(40110); +var Type = __nccwpck_require__(44851); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + + +/***/ }), + +/***/ 49592: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var common = __nccwpck_require__(40110); +var Type = __nccwpck_require__(44851); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + + +/***/ }), + +/***/ 88511: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = __nccwpck_require__(44851); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); + + +/***/ }), + +/***/ 93579: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); + + +/***/ }), + +/***/ 25532: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); + + +/***/ }), + +/***/ 76373: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + + +/***/ }), + +/***/ 7724: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + + +/***/ }), + +/***/ 20966: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); + + +/***/ }), + +/***/ 91677: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + + +/***/ }), + +/***/ 48727: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + + +/***/ }), + +/***/ 14928: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + + +/***/ }), + +/***/ 21864: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + + +/***/ }), + +/***/ 91667: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + + +/***/ }), + +/***/ 73233: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var Type = __nccwpck_require__(44851); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + + +/***/ }), + +/***/ 43037: +/***/ (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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const resource_1 = __nccwpck_require__(90796); +const utils = __importStar(__nccwpck_require__(21888)); +/* eslint-disable no-shadow, @typescript-eslint/no-shadow */ +/** + * Output helps encode the relationship between Resources in a Pulumi application. Specifically an + * Output holds onto a piece of Data and the Resource it was generated from. An Output value can + * then be provided when constructing new Resources, allowing that new Resource to know both the + * value as well as the Resource the value came from. This allows for a precise 'Resource + * dependency graph' to be created, which properly tracks the relationship between resources. + */ +class OutputImpl { + /** @internal */ + constructor(resources, promise, isKnown, isSecret, allResources) { + /** + * A private field to help with RTTI that works in SxS scenarios. + * + * This is internal instead of being truly private, to support mixins and our serialization model. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiOutput = true; + // Always create a copy so that no one accidentally modifies our Resource list. + const resourcesCopy = copyResources(resources); + // Create a copy of the async resources. Populate this with the sync-resources if that's + // all we have. That way this is always ensured to be a superset of the list of sync resources. + allResources = allResources || Promise.resolve([]); + const allResourcesCopy = allResources.then((r) => utils.union(copyResources(r), resourcesCopy)); + // We are only known if we are not explicitly unknown and the resolved value of the output + // contains no distinguished unknown values. + isKnown = Promise.all([isKnown, promise]).then(([known, val]) => known && !containsUnknowns(val)); + const lifted = Promise.all([allResourcesCopy, promise, isKnown, isSecret]).then(([liftedResources, value, liftedIsKnown, liftedIsSecret]) => liftInnerOutput(liftedResources, value, liftedIsKnown, liftedIsSecret)); + this.resources = () => resourcesCopy; + this.allResources = () => lifted.then((l) => l.allResources); + this.isKnown = lifted.then((l) => l.isKnown); + this.isSecret = lifted.then((l) => l.isSecret); + this.promise = (withUnknowns) => OutputImpl.getPromisedValue(lifted.then((l) => l.value), withUnknowns); + this.toString = () => { + let message = `Calling [toString] on an [Output] is not supported. + +To get the value of an Output as an Output consider either: +1: o.apply(v => \`prefix\${v}suffix\`) +2: pulumi.interpolate \`prefix\${v}suffix\` + +See https://www.pulumi.com/docs/concepts/inputs-outputs for more details.`; + if (utils.errorOutputString) { + throw new Error(message); + } + message += `\nThis function may throw in a future version of @pulumi/pulumi.`; + return message; + }; + this.toJSON = () => { + let message = `Calling [toJSON] on an [Output] is not supported. + +To get the value of an Output as a JSON value or JSON string consider either: + 1: o.apply(v => v.toJSON()) + 2: o.apply(v => JSON.stringify(v)) + +See https://www.pulumi.com/docs/concepts/inputs-outputs for more details.`; + if (utils.errorOutputString) { + throw new Error(message); + } + message += `\nThis function may throw in a future version of @pulumi/pulumi.`; + return message; + }; + return new Proxy(this, { + get: (obj, prop) => { + // Recreate the prototype walk to ensure we find any actual members defined directly + // on `Output`. + for (let o = obj; o; o = Object.getPrototypeOf(o)) { + if (o.hasOwnProperty(prop)) { + return o[prop]; + } + } + // Always explicitly fail on a member called 'then'. It is used by other systems to + // determine if this is a Promise, and we do not want to indicate that that's what + // we are. + if (prop === "then") { + return undefined; + } + // Do not lift members that start with __. Technically, if all libraries were + // using this version of pulumi/pulumi we would not need this. However, this is + // so that downstream consumers can use this version of pulumi/pulumi while also + // passing these new Outputs to older versions of pulumi/pulumi. The reason this + // can be a problem is that older versions do an RTTI check that simply asks questions + // like: + // + // Is there a member on this object called '__pulumiResource' + // + // If we automatically lift such a member (even if it eventually points to 'undefined'), + // then those RTTI checks will succeed. + // + // Note: this should be safe to not lift as, in general, properties with this prefix + // are not at all common (and in general are used to represent private things anyway + // that likely should not be exposed). + // + // Similarly, do not respond to the 'doNotCapture' member name. It serves a similar + // RTTI purpose. + if (typeof prop === "string") { + if (prop.startsWith("__") || prop === "doNotCapture" || prop === "deploymentOnlyModule") { + return undefined; + } + } + // Fail out if we are being accessed using a symbol. Many APIs will access with a + // well known symbol (like 'Symbol.toPrimitive') to check for the presence of something. + // They will only check for the existence of that member, and we don't want to make it + // appear that have those. + // + // Another way of putting this is that we only forward 'string/number' members to our + // underlying value. + if (typeof prop === "symbol") { + return undefined; + } + // Else for *any other* property lookup, succeed the lookup and return a lifted + // `apply` on the underlying `Output`. + return obj.apply((ob) => { + if (ob === undefined || ob === null) { + return undefined; + } + else if (isUnknown(ob)) { + // If the value of this output is unknown, the result of the access should also be unknown. + // This is conceptually consistent, and also prevents us from returning a "known undefined" + // value from the `ob[prop]` expression below. + return exports.unknown; + } + return ob[prop]; + }, /*runWithUnknowns:*/ true); + }, + }); + } + static create(val) { + return output(val); + } + /** + * Returns true if the given object is an instance of Output. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiOutput"); + } + /** @internal */ + static getPromisedValue(promise, withUnknowns) { + return __awaiter(this, void 0, void 0, function* () { + // If the caller did not explicitly ask to see unknown values and val contains unknowns, return undefined. This + // preserves compatibility with earlier versions of the Pulumi SDK. + const val = yield promise; + if (!withUnknowns && containsUnknowns(val)) { + return undefined; + } + return val; + }); + } + get() { + throw new Error(`Cannot call '.get' during update or preview. +To manipulate the value of this Output, use '.apply' instead.`); + } + // runWithUnknowns requests that `func` is run even if `isKnown` resolves to `false`. This is used to allow + // callers to process fully- or partially-unknown values and return a known result. the output proxy takes + // advantage of this to allow proxied property accesses to return known values even if other properties of + // the containing object are unknown. + apply(func, runWithUnknowns) { + // we're inside the modern `output` code, so it's safe to call `.allResources!` here. + const applied = Promise.all([ + this.allResources(), + this.promise(/*withUnknowns*/ true), + this.isKnown, + this.isSecret, + ]).then(([allResources, value, isKnown, isSecret]) => applyHelperAsync(allResources, value, isKnown, isSecret, func, !!runWithUnknowns)); + const result = new OutputImpl(this.resources(), applied.then((a) => a.value), applied.then((a) => a.isKnown), applied.then((a) => a.isSecret), applied.then((a) => a.allResources)); + return result; + } +} +/** @internal */ +function getAllResources(op) { + return op.allResources instanceof Function ? op.allResources() : Promise.resolve(op.resources()); +} +exports.getAllResources = getAllResources; +function copyResources(resources) { + const copy = Array.isArray(resources) + ? new Set(resources) + : resources instanceof Set + ? new Set(resources) + : new Set([resources]); + return copy; +} +function liftInnerOutput(allResources, value, isKnown, isSecret) { + return __awaiter(this, void 0, void 0, function* () { + if (!exports.Output.isInstance(value)) { + // 'value' itself wasn't an output, no need to transform any of the data we got. + return { allResources, value, isKnown, isSecret }; + } + // 'value' was an Output. So we unwrap that to get the inner value/isKnown/isSecret/resources + // returned by that Output and merge with the state passed in to get the state of the final Output. + // Note: we intentionally await all the promises of the inner output. This way we properly + // propagate any rejections of any of these promises through the outer output as well. + const innerValue = yield value.promise(/*withUnknowns*/ true); + const innerIsKnown = yield value.isKnown; + const innerIsSecret = yield (value.isSecret || Promise.resolve(false)); + // If we're working with a new-style output, grab all its resources and merge into ours. + // Otherwise, if this is an old-style output, just grab the resources it was known to have + // at construction time. + const innerResources = yield getAllResources(value); + const totalResources = utils.union(allResources, innerResources); + return { + allResources: totalResources, + value: innerValue, + isKnown: innerIsKnown, + isSecret: isSecret || innerIsSecret, + }; + }); +} +/* eslint-disable max-len */ +function applyHelperAsync(allResources, value, isKnown, isSecret, func, runWithUnknowns) { + return __awaiter(this, void 0, void 0, function* () { + // Only perform the apply if the engine was able to give us an actual value + // for this Output. + const doApply = isKnown || runWithUnknowns; + if (!doApply) { + // We didn't actually run the function, our new Output is definitely **not** known. + return { + allResources, + value: undefined, + isKnown: false, + isSecret, + }; + } + // If we are running with unknown values and the value is explicitly unknown but does not actually + // contain any unknown values, collapse its value to the unknown value. This ensures that callbacks + // that expect to see unknowns during preview in outputs that are not known will always do so. + if (!isKnown && runWithUnknowns && !containsUnknowns(value)) { + value = exports.unknown; + } + const transformed = yield func(value); + // We successfully ran the inner function. Our new Output should be considered known. We + // preserve secretness from our original Output to the new one we're creating. + return liftInnerOutput(allResources, transformed, /*isKnown*/ true, isSecret); + }); +} +/** + * Returns a promise denoting if the output is a secret or not. This is not the same as just calling `.isSecret` + * because in cases where the output does not have a `isSecret` property and it is a Proxy, we need to ignore + * the isSecret member that the proxy reports back. + * + * This calls the public implementation so that we only make any calculations in a single place. + * + * @internal + */ +function isSecretOutput(o) { + return isSecret(o); +} +exports.isSecretOutput = isSecretOutput; +/** + * Helper function for `output`. This function trivially recurses through an object, copying it, + * while also lifting any inner Outputs (with all their respective state) to a top-level Output at + * the end. If there are no inner outputs, this will not affect the data (except by producing a new + * copy of it). + * + * Importantly: + * + * 1. Resources encountered while recursing are not touched. This helps ensure they stay Resources + * (with an appropriate prototype chain). + * 2. Primitive values (string, number, etc.) are returned as is. + * 3. Arrays and Record are recursed into. An Array<...> that contains any Outputs wil become an + * Output>. A Record that contains any Output values will be an + * Output>. In both cases of recursion, the outer Output's + * known/secret/resources will be computed from the nested Outputs. + */ +function outputRec(val) { + if (val === null || typeof val !== "object") { + // strings, numbers, booleans, functions, symbols, undefineds, nulls are all returned as + // themselves. They are always 'known' (i.e. we can safely 'apply' off of them even during + // preview). + return val; + } + else if (resource_1.Resource.isInstance(val)) { + // Don't unwrap Resources, there are existing codepaths that return Resources through + // Outputs and we want to preserve them as is when flattening. + return val; + } + else if (isUnknown(val)) { + return val; + } + else if (val instanceof Promise) { + // Recurse into the value the Promise points to. This may end up producing a + // Promise. Wrap this in another Output as the final result. This Output's + // construction will be able to merge the inner Output's data with its own. See + // liftInnerOutput for more details. + return createSimpleOutput(val.then((v) => outputRec(v))); + } + else if (exports.Output.isInstance(val)) { + // We create a new output here from the raw pieces of the original output in order to + // accommodate outputs from downlevel SxS SDKs. This ensures that within this package it is + // safe to assume the implementation of any Output returned by the `output` function. + // + // This includes: + // 1. that first-class unknowns are properly represented in the system: if this was a + // downlevel output where val.isKnown resolves to false, this guarantees that the + // returned output's promise resolves to unknown. + // 2. That the `isSecret` property is available. + // 3. That the `.allResources` is available. + const allResources = getAllResources(val); + const newOutput = new OutputImpl(val.resources(), val.promise(/*withUnknowns*/ true), val.isKnown, val.isSecret, allResources); + return newOutput.apply(outputRec, /*runWithUnknowns*/ true); + } + else if (val instanceof Array) { + const allValues = []; + let hasOutputs = false; + for (const v of val) { + const ev = outputRec(v); + allValues.push(ev); + if (exports.Output.isInstance(ev)) { + hasOutputs = true; + } + } + // If we didn't encounter any nested Outputs, we don't need to do anything. We can just + // return this value as is. + if (!hasOutputs) { + // Note: we intentionally return 'allValues' here and not 'val'. This ensures we get a + // copy. This has been behavior we've had since the beginning and there may be subtle + // logic out there that depends on this that we would not want ot break. + return allValues; + } + // Otherwise, combine the data from all the outputs/non-outputs to one final output. + const promisedArray = Promise.all(allValues.map((v) => getAwaitableValue(v))); + const [syncResources, isKnown, isSecret, allResources] = getResourcesAndDetails(allValues); + return new exports.Output(syncResources, promisedArray, isKnown, isSecret, allResources); + } + else { + const promisedValues = []; + let hasOutputs = false; + for (const k of Object.keys(val)) { + const ev = outputRec(val[k]); + promisedValues.push({ key: k, value: ev }); + if (exports.Output.isInstance(ev)) { + hasOutputs = true; + } + } + if (!hasOutputs) { + // Note: we intentionally return a new value here and not 'val'. This ensures we get a + // copy. This has been behavior we've had since the beginning and there may be subtle + // logic out there that depends on this that we would not want ot break. + return promisedValues.reduce((o, kvp) => { + o[kvp.key] = kvp.value; + return o; + }, {}); + } + const promisedObject = getPromisedObject(promisedValues); + const [syncResources, isKnown, isSecret, allResources] = getResourcesAndDetails(promisedValues.map((kvp) => kvp.value)); + return new exports.Output(syncResources, promisedObject, isKnown, isSecret, allResources); + } +} +function output(val) { + const ov = outputRec(val); + return exports.Output.isInstance(ov) ? ov : createSimpleOutput(ov); +} +exports.output = output; +function secret(val) { + const o = output(val); + // we called `output` right above this, so it's safe to call `.allResources` on the result. + return new exports.Output(o.resources(), o.promise(/*withUnknowns*/ true), o.isKnown, Promise.resolve(true), o.allResources()); +} +exports.secret = secret; +/** + * [unsecret] behaves the same as [output] except the returned output takes the existing output and unwraps the secret + */ +function unsecret(val) { + return new exports.Output(val.resources(), val.promise(/*withUnknowns*/ true), val.isKnown, Promise.resolve(false), val.allResources()); +} +exports.unsecret = unsecret; +/** + * [isSecret] returns `true` if and only if the provided [Output] is a secret. + */ +function isSecret(val) { + return exports.Output.isInstance(val.isSecret) ? Promise.resolve(false) : val.isSecret; +} +exports.isSecret = isSecret; +function createSimpleOutput(val) { + return new exports.Output(new Set(), val instanceof Promise ? val : Promise.resolve(val), + /*isKnown*/ Promise.resolve(true), + /*isSecret */ Promise.resolve(false), Promise.resolve(new Set())); +} +function all(val) { + // Our recursive `output` helper already does exactly what `all` needs to do in terms of the + // implementation. Why have both `output` and `all` then? Currently, to the best of our + // abilities, we haven't been able to make a single signature for both that can unify tuples and + // arrays for TypeScript. So `all` is much better when dealing with a tuple of heterogenous + // values, while `output` is good for everything else. + // + // Specifically ``all` can take an `[Output, Output]` and produce an + // `Output<[string, number]>` However, `output` for that same type will produce an + // `Output<(string|number)[]>` which is definitely suboptimal. + return output(val); +} +exports.all = all; +function getAwaitableValue(v) { + if (exports.Output.isInstance(v)) { + return v.promise(/* withUnknowns */ true); + } + else { + return v; + } +} +function getPromisedObject(keysAndOutputs) { + return __awaiter(this, void 0, void 0, function* () { + const result = {}; + for (const kvp of keysAndOutputs) { + result[kvp.key] = yield getAwaitableValue(kvp.value); + } + return result; + }); +} +function getResourcesAndDetails(allValues) { + const syncResources = new Set(); + const allOutputs = []; + for (const v of allValues) { + if (exports.Output.isInstance(v)) { + allOutputs.push(v); + for (const res of v.resources()) { + syncResources.add(res); + } + } + } + // All the outputs were generated in `function all` using `output(v)`. So it's safe + // to call `.allResources!` here. + const allResources = Promise.all(allOutputs.map((o) => o.allResources())).then((arr) => { + const result = new Set(); + for (const set of arr) { + for (const res of set) { + result.add(res); + } + } + return result; + }); + // A merged output is known if all of its inputs are known. + const isKnown = Promise.all(allOutputs.map((o) => o.isKnown)).then((ps) => ps.every((b) => b)); + // A merged output is secret if any of its inputs are secret. + const isSecret = Promise.all(allOutputs.map((o) => isSecretOutput(o))).then((ps) => ps.some((b) => b)); + return [syncResources, isKnown, isSecret, allResources]; +} +/** + * Unknown represents a value that is unknown. These values correspond to unknown property values received from the + * Pulumi engine as part of the result of a resource registration (see runtime/rpc.ts). User code is not typically + * exposed to these values: any Output<> that contains an Unknown will itself be unknown, so any user callbacks + * passed to `apply` will not be run. Internal callers of `apply` can request that they are run even with unknown + * values; the output proxy takes advantage of this to allow proxied property accesses to return known values even + * if other properties of the containing object are unknown. + */ +class Unknown { + constructor() { + /** + * A private field to help with RTTI that works in SxS scenarios. + * + * This is internal instead of being truly private, to support mixins and our serialization model. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiUnknown = true; + } + /** + * Returns true if the given object is an instance of Unknown. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiUnknown"); + } +} +/** + * unknown is the singleton unknown value. + * @internal + */ +exports.unknown = new Unknown(); +/** + * isUnknown returns true if the given value is unknown. + */ +function isUnknown(val) { + return Unknown.isInstance(val); +} +exports.isUnknown = isUnknown; +/** + * containsUnknowns returns true if the given value is or contains unknown values. + */ +function containsUnknowns(value) { + return impl(value, new Set()); + function impl(val, seen) { + if (val === null || typeof val !== "object") { + return false; + } + else if (isUnknown(val)) { + return true; + } + else if (seen.has(val)) { + return false; + } + seen.add(val); + if (val instanceof Array) { + return val.some((e) => impl(e, seen)); + } + else { + return Object.keys(val).some((k) => impl(val[k], seen)); + } + } +} +exports.containsUnknowns = containsUnknowns; +// eslint-disable-next-line @typescript-eslint/naming-convention,@typescript-eslint/no-redeclare,no-underscore-dangle,id-blacklist,id-match +exports.Output = OutputImpl; +/** + * [concat] takes a sequence of [Inputs], stringifies each, and concatenates all values into one + * final string. Individual inputs can be any sort of [Input] value. i.e. they can be [Promise]s, + * [Output]s, or just plain JavaScript values. This can be used like so: + * + * ```ts + * // 'server' and 'loadBalancer' are both resources that expose [Output] properties. + * let val: Output = pulumi.concat("http://", server.hostname, ":", loadBalancer.port); + * ``` + * + */ +function concat(...params) { + return output(params).apply((array) => array.join("")); +} +exports.concat = concat; +/** + * [interpolate] is similar to [concat] but is designed to be used as a tagged template expression. + * i.e.: + * + * ```ts + * // 'server' and 'loadBalancer' are both resources that expose [Output] properties. + * let val: Output = pulumi.interpolate `http://${server.hostname}:${loadBalancer.port}` + * ``` + * + * As with [concat] the 'placeholders' between `${}` can be any Inputs. i.e. they can be + * [Promise]s, [Output]s, or just plain JavaScript values. + */ +function interpolate(literals, ...placeholders) { + return output(placeholders).apply((unwrapped) => { + let result = ""; + // interleave the literals with the placeholders + for (let i = 0; i < unwrapped.length; i++) { + result += literals[i]; + result += unwrapped[i]; + } + // add the last literal + result += literals[literals.length - 1]; + return result; + }); +} +exports.interpolate = interpolate; +/** + * [jsonStringify] Uses JSON.stringify to serialize the given Input value into a JSON string. + */ +function jsonStringify(obj, replacer, space) { + return output(obj).apply((o) => { + return JSON.stringify(o, replacer, space); + }); +} +exports.jsonStringify = jsonStringify; +/** + * [jsonParse] Uses JSON.parse to deserialize the given Input JSON string into a value. + */ +function jsonParse(text, reviver) { + return output(text).apply((t) => { + return JSON.parse(t, reviver); + }); +} +exports.jsonParse = jsonParse; +//# sourceMappingURL=output.js.map + +/***/ }), + +/***/ 36489: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/alias.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +goog.exportSymbol('proto.pulumirpc.Alias', null, global); +goog.exportSymbol('proto.pulumirpc.Alias.AliasCase', null, global); +goog.exportSymbol('proto.pulumirpc.Alias.Spec', null, global); +goog.exportSymbol('proto.pulumirpc.Alias.Spec.ParentCase', 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.Alias = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.pulumirpc.Alias.oneofGroups_); +}; +goog.inherits(proto.pulumirpc.Alias, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.Alias.displayName = 'proto.pulumirpc.Alias'; +} +/** + * 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.Alias.Spec = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.pulumirpc.Alias.Spec.oneofGroups_); +}; +goog.inherits(proto.pulumirpc.Alias.Spec, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.Alias.Spec.displayName = 'proto.pulumirpc.Alias.Spec'; +} + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.pulumirpc.Alias.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.pulumirpc.Alias.AliasCase = { + ALIAS_NOT_SET: 0, + URN: 1, + SPEC: 2 +}; + +/** + * @return {proto.pulumirpc.Alias.AliasCase} + */ +proto.pulumirpc.Alias.prototype.getAliasCase = function() { + return /** @type {proto.pulumirpc.Alias.AliasCase} */(jspb.Message.computeOneofCase(this, proto.pulumirpc.Alias.oneofGroups_[0])); +}; + + + +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.Alias.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.Alias.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.Alias} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.Alias.toObject = function(includeInstance, msg) { + var f, obj = { + urn: jspb.Message.getFieldWithDefault(msg, 1, ""), + spec: (f = msg.getSpec()) && proto.pulumirpc.Alias.Spec.toObject(includeInstance, f) + }; + + 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.Alias} + */ +proto.pulumirpc.Alias.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.Alias; + return proto.pulumirpc.Alias.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.Alias} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.Alias} + */ +proto.pulumirpc.Alias.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.setUrn(value); + break; + case 2: + var value = new proto.pulumirpc.Alias.Spec; + reader.readMessage(value,proto.pulumirpc.Alias.Spec.deserializeBinaryFromReader); + msg.setSpec(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.Alias.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.Alias.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.Alias} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.Alias.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getSpec(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.pulumirpc.Alias.Spec.serializeBinaryToWriter + ); + } +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.pulumirpc.Alias.Spec.oneofGroups_ = [[5,6]]; + +/** + * @enum {number} + */ +proto.pulumirpc.Alias.Spec.ParentCase = { + PARENT_NOT_SET: 0, + PARENTURN: 5, + NOPARENT: 6 +}; + +/** + * @return {proto.pulumirpc.Alias.Spec.ParentCase} + */ +proto.pulumirpc.Alias.Spec.prototype.getParentCase = function() { + return /** @type {proto.pulumirpc.Alias.Spec.ParentCase} */(jspb.Message.computeOneofCase(this, proto.pulumirpc.Alias.Spec.oneofGroups_[0])); +}; + + + +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.Alias.Spec.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.Alias.Spec.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.Alias.Spec} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.Alias.Spec.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, ""), + stack: jspb.Message.getFieldWithDefault(msg, 3, ""), + project: jspb.Message.getFieldWithDefault(msg, 4, ""), + parenturn: jspb.Message.getFieldWithDefault(msg, 5, ""), + noparent: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) + }; + + 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.Alias.Spec} + */ +proto.pulumirpc.Alias.Spec.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.Alias.Spec; + return proto.pulumirpc.Alias.Spec.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.Alias.Spec} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.Alias.Spec} + */ +proto.pulumirpc.Alias.Spec.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.setType(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setStack(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setProject(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setParenturn(value); + break; + case 6: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setNoparent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.Alias.Spec.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.Alias.Spec.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.Alias.Spec} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.Alias.Spec.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getStack(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeString( + 5, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBool( + 6, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.Alias.Spec.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string type = 2; + * @return {string} + */ +proto.pulumirpc.Alias.Spec.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string stack = 3; + * @return {string} + */ +proto.pulumirpc.Alias.Spec.prototype.getStack = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.setStack = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string project = 4; + * @return {string} + */ +proto.pulumirpc.Alias.Spec.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string parentUrn = 5; + * @return {string} + */ +proto.pulumirpc.Alias.Spec.prototype.getParenturn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.setParenturn = function(value) { + return jspb.Message.setOneofField(this, 5, proto.pulumirpc.Alias.Spec.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.clearParenturn = function() { + return jspb.Message.setOneofField(this, 5, proto.pulumirpc.Alias.Spec.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.Alias.Spec.prototype.hasParenturn = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bool noParent = 6; + * @return {boolean} + */ +proto.pulumirpc.Alias.Spec.prototype.getNoparent = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.setNoparent = function(value) { + return jspb.Message.setOneofField(this, 6, proto.pulumirpc.Alias.Spec.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.Alias.Spec} returns this + */ +proto.pulumirpc.Alias.Spec.prototype.clearNoparent = function() { + return jspb.Message.setOneofField(this, 6, proto.pulumirpc.Alias.Spec.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.Alias.Spec.prototype.hasNoparent = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.Alias.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Alias} returns this + */ +proto.pulumirpc.Alias.prototype.setUrn = function(value) { + return jspb.Message.setOneofField(this, 1, proto.pulumirpc.Alias.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.Alias} returns this + */ +proto.pulumirpc.Alias.prototype.clearUrn = function() { + return jspb.Message.setOneofField(this, 1, proto.pulumirpc.Alias.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.Alias.prototype.hasUrn = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Spec spec = 2; + * @return {?proto.pulumirpc.Alias.Spec} + */ +proto.pulumirpc.Alias.prototype.getSpec = function() { + return /** @type{?proto.pulumirpc.Alias.Spec} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.Alias.Spec, 2)); +}; + + +/** + * @param {?proto.pulumirpc.Alias.Spec|undefined} value + * @return {!proto.pulumirpc.Alias} returns this +*/ +proto.pulumirpc.Alias.prototype.setSpec = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.pulumirpc.Alias.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.Alias} returns this + */ +proto.pulumirpc.Alias.prototype.clearSpec = function() { + return this.setSpec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.Alias.prototype.hasSpec = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 88149: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright 2016-2023, 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_callback_pb = __nccwpck_require__(89619); + +function serialize_pulumirpc_CallbackInvokeRequest(arg) { + if (!(arg instanceof pulumi_callback_pb.CallbackInvokeRequest)) { + throw new Error('Expected argument of type pulumirpc.CallbackInvokeRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_CallbackInvokeRequest(buffer_arg) { + return pulumi_callback_pb.CallbackInvokeRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_CallbackInvokeResponse(arg) { + if (!(arg instanceof pulumi_callback_pb.CallbackInvokeResponse)) { + throw new Error('Expected argument of type pulumirpc.CallbackInvokeResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_CallbackInvokeResponse(buffer_arg) { + return pulumi_callback_pb.CallbackInvokeResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Callbacks is a service for invoking functions in one runtime from other processes. +var CallbacksService = exports.CallbacksService = { + // Invoke invokes a given callback, identified by its token. +invoke: { + path: '/pulumirpc.Callbacks/Invoke', + requestStream: false, + responseStream: false, + requestType: pulumi_callback_pb.CallbackInvokeRequest, + responseType: pulumi_callback_pb.CallbackInvokeResponse, + requestSerialize: serialize_pulumirpc_CallbackInvokeRequest, + requestDeserialize: deserialize_pulumirpc_CallbackInvokeRequest, + responseSerialize: serialize_pulumirpc_CallbackInvokeResponse, + responseDeserialize: deserialize_pulumirpc_CallbackInvokeResponse, + }, +}; + +exports.CallbacksClient = grpc.makeGenericClientConstructor(CallbacksService); + + +/***/ }), + +/***/ 89619: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/callback.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +goog.exportSymbol('proto.pulumirpc.Callback', null, global); +goog.exportSymbol('proto.pulumirpc.CallbackInvokeRequest', null, global); +goog.exportSymbol('proto.pulumirpc.CallbackInvokeResponse', 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.Callback = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.Callback, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.Callback.displayName = 'proto.pulumirpc.Callback'; +} +/** + * 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.CallbackInvokeRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.CallbackInvokeRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CallbackInvokeRequest.displayName = 'proto.pulumirpc.CallbackInvokeRequest'; +} +/** + * 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.CallbackInvokeResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.CallbackInvokeResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.CallbackInvokeResponse.displayName = 'proto.pulumirpc.CallbackInvokeResponse'; +} + + + +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.Callback.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.Callback.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.Callback} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.Callback.toObject = function(includeInstance, msg) { + var f, obj = { + target: jspb.Message.getFieldWithDefault(msg, 1, ""), + token: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.Callback} + */ +proto.pulumirpc.Callback.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.Callback; + return proto.pulumirpc.Callback.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.Callback} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.Callback} + */ +proto.pulumirpc.Callback.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.setTarget(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setToken(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.Callback.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.Callback.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.Callback} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.Callback.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTarget(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getToken(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string target = 1; + * @return {string} + */ +proto.pulumirpc.Callback.prototype.getTarget = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Callback} returns this + */ +proto.pulumirpc.Callback.prototype.setTarget = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string token = 2; + * @return {string} + */ +proto.pulumirpc.Callback.prototype.getToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.Callback} returns this + */ +proto.pulumirpc.Callback.prototype.setToken = function(value) { + return jspb.Message.setProto3StringField(this, 2, 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.CallbackInvokeRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CallbackInvokeRequest.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.CallbackInvokeRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallbackInvokeRequest.toObject = function(includeInstance, msg) { + var f, obj = { + token: jspb.Message.getFieldWithDefault(msg, 1, ""), + request: msg.getRequest_asB64() + }; + + 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.CallbackInvokeRequest} + */ +proto.pulumirpc.CallbackInvokeRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CallbackInvokeRequest; + return proto.pulumirpc.CallbackInvokeRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CallbackInvokeRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CallbackInvokeRequest} + */ +proto.pulumirpc.CallbackInvokeRequest.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.setToken(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CallbackInvokeRequest.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.CallbackInvokeRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallbackInvokeRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getToken(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRequest_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional string token = 1; + * @return {string} + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.getToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CallbackInvokeRequest} returns this + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.setToken = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes request = 2; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.getRequest = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes request = 2; + * This is a type-conversion wrapper around `getRequest()` + * @return {string} + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.getRequest_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getRequest())); +}; + + +/** + * optional bytes request = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getRequest()` + * @return {!Uint8Array} + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.getRequest_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getRequest())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.CallbackInvokeRequest} returns this + */ +proto.pulumirpc.CallbackInvokeRequest.prototype.setRequest = function(value) { + return jspb.Message.setProto3BytesField(this, 2, 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.CallbackInvokeResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CallbackInvokeResponse.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.CallbackInvokeResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallbackInvokeResponse.toObject = function(includeInstance, msg) { + var f, obj = { + response: msg.getResponse_asB64() + }; + + 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.CallbackInvokeResponse} + */ +proto.pulumirpc.CallbackInvokeResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CallbackInvokeResponse; + return proto.pulumirpc.CallbackInvokeResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CallbackInvokeResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CallbackInvokeResponse} + */ +proto.pulumirpc.CallbackInvokeResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CallbackInvokeResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CallbackInvokeResponse.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.CallbackInvokeResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallbackInvokeResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getResponse_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes response = 1; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.CallbackInvokeResponse.prototype.getResponse = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes response = 1; + * This is a type-conversion wrapper around `getResponse()` + * @return {string} + */ +proto.pulumirpc.CallbackInvokeResponse.prototype.getResponse_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getResponse())); +}; + + +/** + * optional bytes response = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getResponse()` + * @return {!Uint8Array} + */ +proto.pulumirpc.CallbackInvokeResponse.prototype.getResponse_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getResponse())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.CallbackInvokeResponse} returns this + */ +proto.pulumirpc.CallbackInvokeResponse.prototype.setResponse = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 82179: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/codegen/hcl.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +goog.exportSymbol('proto.pulumirpc.codegen.Diagnostic', null, global); +goog.exportSymbol('proto.pulumirpc.codegen.DiagnosticSeverity', null, global); +goog.exportSymbol('proto.pulumirpc.codegen.Pos', null, global); +goog.exportSymbol('proto.pulumirpc.codegen.Range', 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.codegen.Pos = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.codegen.Pos, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.codegen.Pos.displayName = 'proto.pulumirpc.codegen.Pos'; +} +/** + * 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.codegen.Range = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.codegen.Range, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.codegen.Range.displayName = 'proto.pulumirpc.codegen.Range'; +} +/** + * 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.codegen.Diagnostic = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.codegen.Diagnostic, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.codegen.Diagnostic.displayName = 'proto.pulumirpc.codegen.Diagnostic'; +} + + + +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.codegen.Pos.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.codegen.Pos.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.codegen.Pos} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.codegen.Pos.toObject = function(includeInstance, msg) { + var f, obj = { + line: jspb.Message.getFieldWithDefault(msg, 1, 0), + column: jspb.Message.getFieldWithDefault(msg, 2, 0), + pb_byte: jspb.Message.getFieldWithDefault(msg, 3, 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.codegen.Pos} + */ +proto.pulumirpc.codegen.Pos.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.codegen.Pos; + return proto.pulumirpc.codegen.Pos.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.codegen.Pos} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.codegen.Pos} + */ +proto.pulumirpc.codegen.Pos.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLine(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setColumn(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setByte(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.codegen.Pos.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.codegen.Pos.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.codegen.Pos} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.codegen.Pos.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLine(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getColumn(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getByte(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional int64 line = 1; + * @return {number} + */ +proto.pulumirpc.codegen.Pos.prototype.getLine = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.codegen.Pos} returns this + */ +proto.pulumirpc.codegen.Pos.prototype.setLine = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 column = 2; + * @return {number} + */ +proto.pulumirpc.codegen.Pos.prototype.getColumn = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.codegen.Pos} returns this + */ +proto.pulumirpc.codegen.Pos.prototype.setColumn = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 byte = 3; + * @return {number} + */ +proto.pulumirpc.codegen.Pos.prototype.getByte = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.codegen.Pos} returns this + */ +proto.pulumirpc.codegen.Pos.prototype.setByte = function(value) { + return jspb.Message.setProto3IntField(this, 3, 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.codegen.Range.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.codegen.Range.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.codegen.Range} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.codegen.Range.toObject = function(includeInstance, msg) { + var f, obj = { + filename: jspb.Message.getFieldWithDefault(msg, 1, ""), + start: (f = msg.getStart()) && proto.pulumirpc.codegen.Pos.toObject(includeInstance, f), + end: (f = msg.getEnd()) && proto.pulumirpc.codegen.Pos.toObject(includeInstance, f) + }; + + 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.codegen.Range} + */ +proto.pulumirpc.codegen.Range.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.codegen.Range; + return proto.pulumirpc.codegen.Range.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.codegen.Range} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.codegen.Range} + */ +proto.pulumirpc.codegen.Range.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.setFilename(value); + break; + case 2: + var value = new proto.pulumirpc.codegen.Pos; + reader.readMessage(value,proto.pulumirpc.codegen.Pos.deserializeBinaryFromReader); + msg.setStart(value); + break; + case 3: + var value = new proto.pulumirpc.codegen.Pos; + reader.readMessage(value,proto.pulumirpc.codegen.Pos.deserializeBinaryFromReader); + msg.setEnd(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.codegen.Range.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.codegen.Range.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.codegen.Range} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.codegen.Range.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFilename(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStart(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.pulumirpc.codegen.Pos.serializeBinaryToWriter + ); + } + f = message.getEnd(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.pulumirpc.codegen.Pos.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string filename = 1; + * @return {string} + */ +proto.pulumirpc.codegen.Range.prototype.getFilename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.codegen.Range} returns this + */ +proto.pulumirpc.codegen.Range.prototype.setFilename = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional Pos start = 2; + * @return {?proto.pulumirpc.codegen.Pos} + */ +proto.pulumirpc.codegen.Range.prototype.getStart = function() { + return /** @type{?proto.pulumirpc.codegen.Pos} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.codegen.Pos, 2)); +}; + + +/** + * @param {?proto.pulumirpc.codegen.Pos|undefined} value + * @return {!proto.pulumirpc.codegen.Range} returns this +*/ +proto.pulumirpc.codegen.Range.prototype.setStart = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.codegen.Range} returns this + */ +proto.pulumirpc.codegen.Range.prototype.clearStart = function() { + return this.setStart(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.codegen.Range.prototype.hasStart = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Pos end = 3; + * @return {?proto.pulumirpc.codegen.Pos} + */ +proto.pulumirpc.codegen.Range.prototype.getEnd = function() { + return /** @type{?proto.pulumirpc.codegen.Pos} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.codegen.Pos, 3)); +}; + + +/** + * @param {?proto.pulumirpc.codegen.Pos|undefined} value + * @return {!proto.pulumirpc.codegen.Range} returns this +*/ +proto.pulumirpc.codegen.Range.prototype.setEnd = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.codegen.Range} returns this + */ +proto.pulumirpc.codegen.Range.prototype.clearEnd = function() { + return this.setEnd(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.codegen.Range.prototype.hasEnd = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +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.codegen.Diagnostic.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.codegen.Diagnostic.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.codegen.Diagnostic} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.codegen.Diagnostic.toObject = function(includeInstance, msg) { + var f, obj = { + severity: jspb.Message.getFieldWithDefault(msg, 1, 0), + summary: jspb.Message.getFieldWithDefault(msg, 2, ""), + detail: jspb.Message.getFieldWithDefault(msg, 3, ""), + subject: (f = msg.getSubject()) && proto.pulumirpc.codegen.Range.toObject(includeInstance, f), + context: (f = msg.getContext()) && proto.pulumirpc.codegen.Range.toObject(includeInstance, f) + }; + + 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.codegen.Diagnostic} + */ +proto.pulumirpc.codegen.Diagnostic.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.codegen.Diagnostic; + return proto.pulumirpc.codegen.Diagnostic.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.codegen.Diagnostic} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.codegen.Diagnostic} + */ +proto.pulumirpc.codegen.Diagnostic.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pulumirpc.codegen.DiagnosticSeverity} */ (reader.readEnum()); + msg.setSeverity(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSummary(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDetail(value); + break; + case 4: + var value = new proto.pulumirpc.codegen.Range; + reader.readMessage(value,proto.pulumirpc.codegen.Range.deserializeBinaryFromReader); + msg.setSubject(value); + break; + case 5: + var value = new proto.pulumirpc.codegen.Range; + reader.readMessage(value,proto.pulumirpc.codegen.Range.deserializeBinaryFromReader); + msg.setContext(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.codegen.Diagnostic.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.codegen.Diagnostic} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.codegen.Diagnostic.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSeverity(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getSummary(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDetail(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getSubject(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.pulumirpc.codegen.Range.serializeBinaryToWriter + ); + } + f = message.getContext(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.pulumirpc.codegen.Range.serializeBinaryToWriter + ); + } +}; + + +/** + * optional DiagnosticSeverity severity = 1; + * @return {!proto.pulumirpc.codegen.DiagnosticSeverity} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.getSeverity = function() { + return /** @type {!proto.pulumirpc.codegen.DiagnosticSeverity} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.pulumirpc.codegen.DiagnosticSeverity} value + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this + */ +proto.pulumirpc.codegen.Diagnostic.prototype.setSeverity = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string summary = 2; + * @return {string} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.getSummary = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this + */ +proto.pulumirpc.codegen.Diagnostic.prototype.setSummary = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string detail = 3; + * @return {string} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.getDetail = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this + */ +proto.pulumirpc.codegen.Diagnostic.prototype.setDetail = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional Range subject = 4; + * @return {?proto.pulumirpc.codegen.Range} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.getSubject = function() { + return /** @type{?proto.pulumirpc.codegen.Range} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.codegen.Range, 4)); +}; + + +/** + * @param {?proto.pulumirpc.codegen.Range|undefined} value + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this +*/ +proto.pulumirpc.codegen.Diagnostic.prototype.setSubject = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this + */ +proto.pulumirpc.codegen.Diagnostic.prototype.clearSubject = function() { + return this.setSubject(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.hasSubject = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional Range context = 5; + * @return {?proto.pulumirpc.codegen.Range} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.getContext = function() { + return /** @type{?proto.pulumirpc.codegen.Range} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.codegen.Range, 5)); +}; + + +/** + * @param {?proto.pulumirpc.codegen.Range|undefined} value + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this +*/ +proto.pulumirpc.codegen.Diagnostic.prototype.setContext = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.codegen.Diagnostic} returns this + */ +proto.pulumirpc.codegen.Diagnostic.prototype.clearContext = function() { + return this.setContext(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.codegen.Diagnostic.prototype.hasContext = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * @enum {number} + */ +proto.pulumirpc.codegen.DiagnosticSeverity = { + DIAG_INVALID: 0, + DIAG_ERROR: 1, + DIAG_WARNING: 2 +}; + +goog.object.extend(exports, proto.pulumirpc.codegen); + + +/***/ }), + +/***/ 5053: +/***/ ((__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_engine_pb = __nccwpck_require__(10986); +var google_protobuf_empty_pb = __nccwpck_require__(40291); + +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_GetRootResourceRequest(arg) { + if (!(arg instanceof pulumi_engine_pb.GetRootResourceRequest)) { + throw new Error('Expected argument of type pulumirpc.GetRootResourceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GetRootResourceRequest(buffer_arg) { + return pulumi_engine_pb.GetRootResourceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GetRootResourceResponse(arg) { + if (!(arg instanceof pulumi_engine_pb.GetRootResourceResponse)) { + throw new Error('Expected argument of type pulumirpc.GetRootResourceResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GetRootResourceResponse(buffer_arg) { + return pulumi_engine_pb.GetRootResourceResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_LogRequest(arg) { + if (!(arg instanceof pulumi_engine_pb.LogRequest)) { + throw new Error('Expected argument of type pulumirpc.LogRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_LogRequest(buffer_arg) { + return pulumi_engine_pb.LogRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_SetRootResourceRequest(arg) { + if (!(arg instanceof pulumi_engine_pb.SetRootResourceRequest)) { + throw new Error('Expected argument of type pulumirpc.SetRootResourceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_SetRootResourceRequest(buffer_arg) { + return pulumi_engine_pb.SetRootResourceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_SetRootResourceResponse(arg) { + if (!(arg instanceof pulumi_engine_pb.SetRootResourceResponse)) { + throw new Error('Expected argument of type pulumirpc.SetRootResourceResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_SetRootResourceResponse(buffer_arg) { + return pulumi_engine_pb.SetRootResourceResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Engine is an auxiliary service offered to language and resource provider plugins. Its main purpose today is +// to serve as a common logging endpoint, but it also serves as a state storage mechanism for language hosts +// that can't store their own global state. +var EngineService = exports.EngineService = { + // Log logs a global message in the engine, including errors and warnings. +log: { + path: '/pulumirpc.Engine/Log', + requestStream: false, + responseStream: false, + requestType: pulumi_engine_pb.LogRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_pulumirpc_LogRequest, + requestDeserialize: deserialize_pulumirpc_LogRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // GetRootResource gets the URN of the root resource, the resource that should be the root of all +// otherwise-unparented resources. +getRootResource: { + path: '/pulumirpc.Engine/GetRootResource', + requestStream: false, + responseStream: false, + requestType: pulumi_engine_pb.GetRootResourceRequest, + responseType: pulumi_engine_pb.GetRootResourceResponse, + requestSerialize: serialize_pulumirpc_GetRootResourceRequest, + requestDeserialize: deserialize_pulumirpc_GetRootResourceRequest, + responseSerialize: serialize_pulumirpc_GetRootResourceResponse, + responseDeserialize: deserialize_pulumirpc_GetRootResourceResponse, + }, + // SetRootResource sets the URN of the root resource. +setRootResource: { + path: '/pulumirpc.Engine/SetRootResource', + requestStream: false, + responseStream: false, + requestType: pulumi_engine_pb.SetRootResourceRequest, + responseType: pulumi_engine_pb.SetRootResourceResponse, + requestSerialize: serialize_pulumirpc_SetRootResourceRequest, + requestDeserialize: deserialize_pulumirpc_SetRootResourceRequest, + responseSerialize: serialize_pulumirpc_SetRootResourceResponse, + responseDeserialize: deserialize_pulumirpc_SetRootResourceResponse, + }, +}; + +exports.EngineClient = grpc.makeGenericClientConstructor(EngineService); + + +/***/ }), + +/***/ 10986: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/engine.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +var google_protobuf_empty_pb = __nccwpck_require__(40291); +goog.object.extend(proto, google_protobuf_empty_pb); +goog.exportSymbol('proto.pulumirpc.GetRootResourceRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GetRootResourceResponse', null, global); +goog.exportSymbol('proto.pulumirpc.LogRequest', null, global); +goog.exportSymbol('proto.pulumirpc.LogSeverity', null, global); +goog.exportSymbol('proto.pulumirpc.SetRootResourceRequest', null, global); +goog.exportSymbol('proto.pulumirpc.SetRootResourceResponse', 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.LogRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.LogRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.LogRequest.displayName = 'proto.pulumirpc.LogRequest'; +} +/** + * 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.GetRootResourceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetRootResourceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetRootResourceRequest.displayName = 'proto.pulumirpc.GetRootResourceRequest'; +} +/** + * 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.GetRootResourceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetRootResourceResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetRootResourceResponse.displayName = 'proto.pulumirpc.GetRootResourceResponse'; +} +/** + * 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.SetRootResourceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.SetRootResourceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.SetRootResourceRequest.displayName = 'proto.pulumirpc.SetRootResourceRequest'; +} +/** + * 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.SetRootResourceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.SetRootResourceResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.SetRootResourceResponse.displayName = 'proto.pulumirpc.SetRootResourceResponse'; +} + + + +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.LogRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.LogRequest.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.LogRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.LogRequest.toObject = function(includeInstance, msg) { + var f, obj = { + severity: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: jspb.Message.getFieldWithDefault(msg, 2, ""), + urn: jspb.Message.getFieldWithDefault(msg, 3, ""), + streamid: jspb.Message.getFieldWithDefault(msg, 4, 0), + ephemeral: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + 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.LogRequest} + */ +proto.pulumirpc.LogRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.LogRequest; + return proto.pulumirpc.LogRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.LogRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.LogRequest} + */ +proto.pulumirpc.LogRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pulumirpc.LogSeverity} */ (reader.readEnum()); + msg.setSeverity(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setUrn(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setStreamid(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setEphemeral(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.LogRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.LogRequest.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.LogRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.LogRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSeverity(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getStreamid(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } + f = message.getEphemeral(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional LogSeverity severity = 1; + * @return {!proto.pulumirpc.LogSeverity} + */ +proto.pulumirpc.LogRequest.prototype.getSeverity = function() { + return /** @type {!proto.pulumirpc.LogSeverity} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.pulumirpc.LogSeverity} value + * @return {!proto.pulumirpc.LogRequest} returns this + */ +proto.pulumirpc.LogRequest.prototype.setSeverity = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.pulumirpc.LogRequest.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.LogRequest} returns this + */ +proto.pulumirpc.LogRequest.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string urn = 3; + * @return {string} + */ +proto.pulumirpc.LogRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.LogRequest} returns this + */ +proto.pulumirpc.LogRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional int32 streamId = 4; + * @return {number} + */ +proto.pulumirpc.LogRequest.prototype.getStreamid = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.LogRequest} returns this + */ +proto.pulumirpc.LogRequest.prototype.setStreamid = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional bool ephemeral = 5; + * @return {boolean} + */ +proto.pulumirpc.LogRequest.prototype.getEphemeral = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.LogRequest} returns this + */ +proto.pulumirpc.LogRequest.prototype.setEphemeral = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, 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.GetRootResourceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetRootResourceRequest.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.GetRootResourceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRootResourceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + 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.GetRootResourceRequest} + */ +proto.pulumirpc.GetRootResourceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetRootResourceRequest; + return proto.pulumirpc.GetRootResourceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetRootResourceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetRootResourceRequest} + */ +proto.pulumirpc.GetRootResourceRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetRootResourceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetRootResourceRequest.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.GetRootResourceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRootResourceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.GetRootResourceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetRootResourceResponse.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.GetRootResourceResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRootResourceResponse.toObject = function(includeInstance, msg) { + var f, obj = { + urn: 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.GetRootResourceResponse} + */ +proto.pulumirpc.GetRootResourceResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetRootResourceResponse; + return proto.pulumirpc.GetRootResourceResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetRootResourceResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetRootResourceResponse} + */ +proto.pulumirpc.GetRootResourceResponse.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.setUrn(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetRootResourceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetRootResourceResponse.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.GetRootResourceResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRootResourceResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.GetRootResourceResponse.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetRootResourceResponse} returns this + */ +proto.pulumirpc.GetRootResourceResponse.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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.SetRootResourceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.SetRootResourceRequest.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.SetRootResourceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SetRootResourceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + urn: 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.SetRootResourceRequest} + */ +proto.pulumirpc.SetRootResourceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.SetRootResourceRequest; + return proto.pulumirpc.SetRootResourceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.SetRootResourceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.SetRootResourceRequest} + */ +proto.pulumirpc.SetRootResourceRequest.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.setUrn(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.SetRootResourceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.SetRootResourceRequest.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.SetRootResourceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SetRootResourceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.SetRootResourceRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.SetRootResourceRequest} returns this + */ +proto.pulumirpc.SetRootResourceRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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.SetRootResourceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.SetRootResourceResponse.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.SetRootResourceResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SetRootResourceResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + 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.SetRootResourceResponse} + */ +proto.pulumirpc.SetRootResourceResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.SetRootResourceResponse; + return proto.pulumirpc.SetRootResourceResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.SetRootResourceResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.SetRootResourceResponse} + */ +proto.pulumirpc.SetRootResourceResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.SetRootResourceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.SetRootResourceResponse.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.SetRootResourceResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SetRootResourceResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +/** + * @enum {number} + */ +proto.pulumirpc.LogSeverity = { + DEBUG: 0, + INFO: 1, + WARNING: 2, + ERROR: 3 +}; + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 75628: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright 2016-2023, 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_language_pb = __nccwpck_require__(53979); +var pulumi_codegen_hcl_pb = __nccwpck_require__(82179); +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_AboutRequest(arg) { + if (!(arg instanceof pulumi_language_pb.AboutRequest)) { + throw new Error('Expected argument of type pulumirpc.AboutRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_AboutRequest(buffer_arg) { + return pulumi_language_pb.AboutRequest.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_GeneratePackageRequest(arg) { + if (!(arg instanceof pulumi_language_pb.GeneratePackageRequest)) { + throw new Error('Expected argument of type pulumirpc.GeneratePackageRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GeneratePackageRequest(buffer_arg) { + return pulumi_language_pb.GeneratePackageRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GeneratePackageResponse(arg) { + if (!(arg instanceof pulumi_language_pb.GeneratePackageResponse)) { + throw new Error('Expected argument of type pulumirpc.GeneratePackageResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GeneratePackageResponse(buffer_arg) { + return pulumi_language_pb.GeneratePackageResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GenerateProgramRequest(arg) { + if (!(arg instanceof pulumi_language_pb.GenerateProgramRequest)) { + throw new Error('Expected argument of type pulumirpc.GenerateProgramRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GenerateProgramRequest(buffer_arg) { + return pulumi_language_pb.GenerateProgramRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GenerateProgramResponse(arg) { + if (!(arg instanceof pulumi_language_pb.GenerateProgramResponse)) { + throw new Error('Expected argument of type pulumirpc.GenerateProgramResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GenerateProgramResponse(buffer_arg) { + return pulumi_language_pb.GenerateProgramResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GenerateProjectRequest(arg) { + if (!(arg instanceof pulumi_language_pb.GenerateProjectRequest)) { + throw new Error('Expected argument of type pulumirpc.GenerateProjectRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GenerateProjectRequest(buffer_arg) { + return pulumi_language_pb.GenerateProjectRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GenerateProjectResponse(arg) { + if (!(arg instanceof pulumi_language_pb.GenerateProjectResponse)) { + throw new Error('Expected argument of type pulumirpc.GenerateProjectResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GenerateProjectResponse(buffer_arg) { + return pulumi_language_pb.GenerateProjectResponse.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'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GetRequiredPluginsRequest(buffer_arg) { + return pulumi_language_pb.GetRequiredPluginsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_GetRequiredPluginsResponse(arg) { + if (!(arg instanceof pulumi_language_pb.GetRequiredPluginsResponse)) { + throw new Error('Expected argument of type pulumirpc.GetRequiredPluginsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_GetRequiredPluginsResponse(buffer_arg) { + return pulumi_language_pb.GetRequiredPluginsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_InstallDependenciesRequest(arg) { + if (!(arg instanceof pulumi_language_pb.InstallDependenciesRequest)) { + throw new Error('Expected argument of type pulumirpc.InstallDependenciesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_InstallDependenciesRequest(buffer_arg) { + return pulumi_language_pb.InstallDependenciesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_InstallDependenciesResponse(arg) { + if (!(arg instanceof pulumi_language_pb.InstallDependenciesResponse)) { + throw new Error('Expected argument of type pulumirpc.InstallDependenciesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_InstallDependenciesResponse(buffer_arg) { + return pulumi_language_pb.InstallDependenciesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_PackRequest(arg) { + if (!(arg instanceof pulumi_language_pb.PackRequest)) { + throw new Error('Expected argument of type pulumirpc.PackRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_PackRequest(buffer_arg) { + return pulumi_language_pb.PackRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_PackResponse(arg) { + if (!(arg instanceof pulumi_language_pb.PackResponse)) { + throw new Error('Expected argument of type pulumirpc.PackResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_PackResponse(buffer_arg) { + return pulumi_language_pb.PackResponse.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)); +} + +function serialize_pulumirpc_RunPluginRequest(arg) { + if (!(arg instanceof pulumi_language_pb.RunPluginRequest)) { + throw new Error('Expected argument of type pulumirpc.RunPluginRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RunPluginRequest(buffer_arg) { + return pulumi_language_pb.RunPluginRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RunPluginResponse(arg) { + if (!(arg instanceof pulumi_language_pb.RunPluginResponse)) { + throw new Error('Expected argument of type pulumirpc.RunPluginResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RunPluginResponse(buffer_arg) { + return pulumi_language_pb.RunPluginResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RunRequest(arg) { + if (!(arg instanceof pulumi_language_pb.RunRequest)) { + throw new Error('Expected argument of type pulumirpc.RunRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RunRequest(buffer_arg) { + return pulumi_language_pb.RunRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RunResponse(arg) { + if (!(arg instanceof pulumi_language_pb.RunResponse)) { + throw new Error('Expected argument of type pulumirpc.RunResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RunResponse(buffer_arg) { + return pulumi_language_pb.RunResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible +// for confguring and creating resource objects. +var LanguageRuntimeService = exports.LanguageRuntimeService = { + // GetRequiredPlugins computes the complete set of anticipated plugins required by a program. +getRequiredPlugins: { + path: '/pulumirpc.LanguageRuntime/GetRequiredPlugins', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.GetRequiredPluginsRequest, + responseType: pulumi_language_pb.GetRequiredPluginsResponse, + requestSerialize: serialize_pulumirpc_GetRequiredPluginsRequest, + requestDeserialize: deserialize_pulumirpc_GetRequiredPluginsRequest, + responseSerialize: serialize_pulumirpc_GetRequiredPluginsResponse, + responseDeserialize: deserialize_pulumirpc_GetRequiredPluginsResponse, + }, + // Run executes a program and returns its result. +run: { + path: '/pulumirpc.LanguageRuntime/Run', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.RunRequest, + responseType: pulumi_language_pb.RunResponse, + requestSerialize: serialize_pulumirpc_RunRequest, + requestDeserialize: deserialize_pulumirpc_RunRequest, + responseSerialize: serialize_pulumirpc_RunResponse, + responseDeserialize: deserialize_pulumirpc_RunResponse, + }, + // GetPluginInfo returns generic information about this plugin, like its version. +getPluginInfo: { + path: '/pulumirpc.LanguageRuntime/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, + }, + // InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects. +installDependencies: { + path: '/pulumirpc.LanguageRuntime/InstallDependencies', + requestStream: false, + responseStream: true, + requestType: pulumi_language_pb.InstallDependenciesRequest, + responseType: pulumi_language_pb.InstallDependenciesResponse, + requestSerialize: serialize_pulumirpc_InstallDependenciesRequest, + requestDeserialize: deserialize_pulumirpc_InstallDependenciesRequest, + 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: pulumi_language_pb.AboutRequest, + responseType: pulumi_language_pb.AboutResponse, + requestSerialize: serialize_pulumirpc_AboutRequest, + requestDeserialize: deserialize_pulumirpc_AboutRequest, + 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, + }, + // RunPlugin executes a plugin program and returns its result asynchronously. +runPlugin: { + path: '/pulumirpc.LanguageRuntime/RunPlugin', + requestStream: false, + responseStream: true, + requestType: pulumi_language_pb.RunPluginRequest, + responseType: pulumi_language_pb.RunPluginResponse, + requestSerialize: serialize_pulumirpc_RunPluginRequest, + requestDeserialize: deserialize_pulumirpc_RunPluginRequest, + responseSerialize: serialize_pulumirpc_RunPluginResponse, + responseDeserialize: deserialize_pulumirpc_RunPluginResponse, + }, + // GenerateProgram generates a given PCL program into a program for this language. +generateProgram: { + path: '/pulumirpc.LanguageRuntime/GenerateProgram', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.GenerateProgramRequest, + responseType: pulumi_language_pb.GenerateProgramResponse, + requestSerialize: serialize_pulumirpc_GenerateProgramRequest, + requestDeserialize: deserialize_pulumirpc_GenerateProgramRequest, + responseSerialize: serialize_pulumirpc_GenerateProgramResponse, + responseDeserialize: deserialize_pulumirpc_GenerateProgramResponse, + }, + // GenerateProject generates a given PCL program into a project for this language. +generateProject: { + path: '/pulumirpc.LanguageRuntime/GenerateProject', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.GenerateProjectRequest, + responseType: pulumi_language_pb.GenerateProjectResponse, + requestSerialize: serialize_pulumirpc_GenerateProjectRequest, + requestDeserialize: deserialize_pulumirpc_GenerateProjectRequest, + responseSerialize: serialize_pulumirpc_GenerateProjectResponse, + responseDeserialize: deserialize_pulumirpc_GenerateProjectResponse, + }, + // GeneratePackage generates a given pulumi package into a package for this language. +generatePackage: { + path: '/pulumirpc.LanguageRuntime/GeneratePackage', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.GeneratePackageRequest, + responseType: pulumi_language_pb.GeneratePackageResponse, + requestSerialize: serialize_pulumirpc_GeneratePackageRequest, + requestDeserialize: deserialize_pulumirpc_GeneratePackageRequest, + responseSerialize: serialize_pulumirpc_GeneratePackageResponse, + responseDeserialize: deserialize_pulumirpc_GeneratePackageResponse, + }, + // Pack packs a package into a language specific artifact. +pack: { + path: '/pulumirpc.LanguageRuntime/Pack', + requestStream: false, + responseStream: false, + requestType: pulumi_language_pb.PackRequest, + responseType: pulumi_language_pb.PackResponse, + requestSerialize: serialize_pulumirpc_PackRequest, + requestDeserialize: deserialize_pulumirpc_PackRequest, + responseSerialize: serialize_pulumirpc_PackResponse, + responseDeserialize: deserialize_pulumirpc_PackResponse, + }, +}; + +exports.LanguageRuntimeClient = grpc.makeGenericClientConstructor(LanguageRuntimeService); + + +/***/ }), + +/***/ 53979: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/language.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +var pulumi_codegen_hcl_pb = __nccwpck_require__(82179); +goog.object.extend(proto, pulumi_codegen_hcl_pb); +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.AboutRequest', null, global); +goog.exportSymbol('proto.pulumirpc.AboutResponse', null, global); +goog.exportSymbol('proto.pulumirpc.DependencyInfo', null, global); +goog.exportSymbol('proto.pulumirpc.GeneratePackageRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GeneratePackageResponse', null, global); +goog.exportSymbol('proto.pulumirpc.GenerateProgramRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GenerateProgramResponse', null, global); +goog.exportSymbol('proto.pulumirpc.GenerateProjectRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GenerateProjectResponse', 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.PackRequest', null, global); +goog.exportSymbol('proto.pulumirpc.PackResponse', null, global); +goog.exportSymbol('proto.pulumirpc.ProgramInfo', null, global); +goog.exportSymbol('proto.pulumirpc.RunPluginRequest', null, global); +goog.exportSymbol('proto.pulumirpc.RunPluginResponse', null, global); +goog.exportSymbol('proto.pulumirpc.RunPluginResponse.OutputCase', 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.ProgramInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ProgramInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ProgramInfo.displayName = 'proto.pulumirpc.ProgramInfo'; +} +/** + * 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.AboutRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.AboutRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.AboutRequest.displayName = 'proto.pulumirpc.AboutRequest'; +} +/** + * 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 + * 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.GetRequiredPluginsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetRequiredPluginsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetRequiredPluginsRequest.displayName = 'proto.pulumirpc.GetRequiredPluginsRequest'; +} +/** + * 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.GetRequiredPluginsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GetRequiredPluginsResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.GetRequiredPluginsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetRequiredPluginsResponse.displayName = 'proto.pulumirpc.GetRequiredPluginsResponse'; +} +/** + * 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.RunRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RunRequest.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.RunRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RunRequest.displayName = 'proto.pulumirpc.RunRequest'; +} +/** + * 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.RunResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.RunResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RunResponse.displayName = 'proto.pulumirpc.RunResponse'; +} +/** + * 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.InstallDependenciesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.InstallDependenciesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.InstallDependenciesRequest.displayName = 'proto.pulumirpc.InstallDependenciesRequest'; +} +/** + * 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.InstallDependenciesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.InstallDependenciesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.InstallDependenciesResponse.displayName = 'proto.pulumirpc.InstallDependenciesResponse'; +} +/** + * 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.RunPluginRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RunPluginRequest.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.RunPluginRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RunPluginRequest.displayName = 'proto.pulumirpc.RunPluginRequest'; +} +/** + * 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.RunPluginResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.pulumirpc.RunPluginResponse.oneofGroups_); +}; +goog.inherits(proto.pulumirpc.RunPluginResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RunPluginResponse.displayName = 'proto.pulumirpc.RunPluginResponse'; +} +/** + * 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.GenerateProgramRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GenerateProgramRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GenerateProgramRequest.displayName = 'proto.pulumirpc.GenerateProgramRequest'; +} +/** + * 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.GenerateProgramResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GenerateProgramResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.GenerateProgramResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GenerateProgramResponse.displayName = 'proto.pulumirpc.GenerateProgramResponse'; +} +/** + * 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.GenerateProjectRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GenerateProjectRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GenerateProjectRequest.displayName = 'proto.pulumirpc.GenerateProjectRequest'; +} +/** + * 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.GenerateProjectResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GenerateProjectResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.GenerateProjectResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GenerateProjectResponse.displayName = 'proto.pulumirpc.GenerateProjectResponse'; +} +/** + * 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.GeneratePackageRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GeneratePackageRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GeneratePackageRequest.displayName = 'proto.pulumirpc.GeneratePackageRequest'; +} +/** + * 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.GeneratePackageResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GeneratePackageResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.GeneratePackageResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GeneratePackageResponse.displayName = 'proto.pulumirpc.GeneratePackageResponse'; +} +/** + * 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.PackRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.PackRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.PackRequest.displayName = 'proto.pulumirpc.PackRequest'; +} +/** + * 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.PackResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.PackResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.PackResponse.displayName = 'proto.pulumirpc.PackResponse'; +} + + + +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.ProgramInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ProgramInfo.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.ProgramInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ProgramInfo.toObject = function(includeInstance, msg) { + var f, obj = { + rootDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""), + programDirectory: jspb.Message.getFieldWithDefault(msg, 2, ""), + entryPoint: jspb.Message.getFieldWithDefault(msg, 3, ""), + options: (f = msg.getOptions()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.ProgramInfo} + */ +proto.pulumirpc.ProgramInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ProgramInfo; + return proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ProgramInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.ProgramInfo.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.setRootDirectory(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setProgramDirectory(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setEntryPoint(value); + break; + case 4: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ProgramInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ProgramInfo.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.ProgramInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ProgramInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRootDirectory(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProgramDirectory(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getEntryPoint(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string root_directory = 1; + * @return {string} + */ +proto.pulumirpc.ProgramInfo.prototype.getRootDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ProgramInfo} returns this + */ +proto.pulumirpc.ProgramInfo.prototype.setRootDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string program_directory = 2; + * @return {string} + */ +proto.pulumirpc.ProgramInfo.prototype.getProgramDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ProgramInfo} returns this + */ +proto.pulumirpc.ProgramInfo.prototype.setProgramDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string entry_point = 3; + * @return {string} + */ +proto.pulumirpc.ProgramInfo.prototype.getEntryPoint = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ProgramInfo} returns this + */ +proto.pulumirpc.ProgramInfo.prototype.setEntryPoint = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional google.protobuf.Struct options = 4; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ProgramInfo.prototype.getOptions = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ProgramInfo} returns this +*/ +proto.pulumirpc.ProgramInfo.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ProgramInfo} returns this + */ +proto.pulumirpc.ProgramInfo.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ProgramInfo.prototype.hasOptions = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +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.AboutRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.AboutRequest.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.AboutRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.AboutRequest.toObject = function(includeInstance, msg) { + var f, obj = { + info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f) + }; + + 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.AboutRequest} + */ +proto.pulumirpc.AboutRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.AboutRequest; + return proto.pulumirpc.AboutRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.AboutRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.AboutRequest} + */ +proto.pulumirpc.AboutRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.pulumirpc.ProgramInfo; + reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader); + msg.setInfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.AboutRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.AboutRequest.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.AboutRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.AboutRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInfo(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.pulumirpc.ProgramInfo.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ProgramInfo info = 1; + * @return {?proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.AboutRequest.prototype.getInfo = function() { + return /** @type{?proto.pulumirpc.ProgramInfo} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 1)); +}; + + +/** + * @param {?proto.pulumirpc.ProgramInfo|undefined} value + * @return {!proto.pulumirpc.AboutRequest} returns this +*/ +proto.pulumirpc.AboutRequest.prototype.setInfo = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.AboutRequest} returns this + */ +proto.pulumirpc.AboutRequest.prototype.clearInfo = function() { + return this.setInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.AboutRequest.prototype.hasInfo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +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.AboutResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.AboutResponse.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.AboutResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.AboutResponse.toObject = function(includeInstance, msg) { + var f, obj = { + executable: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.AboutResponse} + */ +proto.pulumirpc.AboutResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.AboutResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.AboutResponse} + */ +proto.pulumirpc.AboutResponse.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.setExecutable(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 3: + 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(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.AboutResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.AboutResponse.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.AboutResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.AboutResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExecutable(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string executable = 1; + * @return {string} + */ +proto.pulumirpc.AboutResponse.prototype.getExecutable = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.AboutResponse} returns this + */ +proto.pulumirpc.AboutResponse.prototype.setExecutable = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.pulumirpc.AboutResponse.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.AboutResponse} returns this + */ +proto.pulumirpc.AboutResponse.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.AboutResponse.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.AboutResponse} returns this + */ +proto.pulumirpc.AboutResponse.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +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.GetProgramDependenciesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetProgramDependenciesRequest.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.GetProgramDependenciesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetProgramDependenciesRequest.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, ""), + transitivedependencies: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f) + }; + + 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.GetProgramDependenciesRequest} + */ +proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.GetProgramDependenciesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} + */ +proto.pulumirpc.GetProgramDependenciesRequest.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.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; + case 5: + var value = new proto.pulumirpc.ProgramInfo; + reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader); + msg.setInfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetProgramDependenciesRequest.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.GetProgramDependenciesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetProgramDependenciesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 1, + 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 + ); + } + f = message.getInfo(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.pulumirpc.ProgramInfo.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string project = 1; + * @return {string} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string pwd = 2; + * @return {string} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this + */ +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, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this + */ +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); +}; + + +/** + * optional ProgramInfo info = 5; + * @return {?proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.getInfo = function() { + return /** @type{?proto.pulumirpc.ProgramInfo} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 5)); +}; + + +/** + * @param {?proto.pulumirpc.ProgramInfo|undefined} value + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this +*/ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.setInfo = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.clearInfo = function() { + return this.setInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.GetProgramDependenciesRequest.prototype.hasInfo = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +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.DependencyInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.DependencyInfo.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.DependencyInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DependencyInfo.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.DependencyInfo} + */ +proto.pulumirpc.DependencyInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.DependencyInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.DependencyInfo} + */ +proto.pulumirpc.DependencyInfo.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.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.DependencyInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.DependencyInfo.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.DependencyInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DependencyInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.DependencyInfo.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.DependencyInfo} returns this + */ +proto.pulumirpc.DependencyInfo.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.pulumirpc.DependencyInfo.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.DependencyInfo} returns this + */ +proto.pulumirpc.DependencyInfo.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GetProgramDependenciesResponse.repeatedFields_ = [1]; + + + +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.GetProgramDependenciesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetProgramDependenciesResponse.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.GetProgramDependenciesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +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; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pulumirpc.GetProgramDependenciesResponse} + */ +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); +}; + + +/** + * 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.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; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetProgramDependenciesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetProgramDependenciesResponse.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.GetProgramDependenciesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +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 DependencyInfo dependencies = 1; + * @return {!Array} + */ +proto.pulumirpc.GetProgramDependenciesResponse.prototype.getDependenciesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.DependencyInfo, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.GetProgramDependenciesResponse} returns this +*/ +proto.pulumirpc.GetProgramDependenciesResponse.prototype.setDependenciesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.pulumirpc.DependencyInfo=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.DependencyInfo} + */ +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.GetProgramDependenciesResponse} returns this + */ +proto.pulumirpc.GetProgramDependenciesResponse.prototype.clearDependenciesList = function() { + return this.setDependenciesList([]); +}; + + + + + +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.GetRequiredPluginsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetRequiredPluginsRequest.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.GetRequiredPluginsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRequiredPluginsRequest.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, ""), + info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f) + }; + + 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.GetRequiredPluginsRequest} + */ +proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.GetRequiredPluginsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} + */ +proto.pulumirpc.GetRequiredPluginsRequest.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.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 = new proto.pulumirpc.ProgramInfo; + reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader); + msg.setInfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetRequiredPluginsRequest.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.GetRequiredPluginsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 1, + 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.getInfo(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.pulumirpc.ProgramInfo.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string project = 1; + * @return {string} + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string pwd = 2; + * @return {string} + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + */ +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); +}; + + +/** + * optional ProgramInfo info = 4; + * @return {?proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.getInfo = function() { + return /** @type{?proto.pulumirpc.ProgramInfo} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 4)); +}; + + +/** + * @param {?proto.pulumirpc.ProgramInfo|undefined} value + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this +*/ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.setInfo = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.clearInfo = function() { + return this.setInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.GetRequiredPluginsRequest.prototype.hasInfo = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GetRequiredPluginsResponse.repeatedFields_ = [1]; + + + +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.GetRequiredPluginsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetRequiredPluginsResponse.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.GetRequiredPluginsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRequiredPluginsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + pluginsList: jspb.Message.toObjectList(msg.getPluginsList(), + pulumi_plugin_pb.PluginDependency.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.pulumirpc.GetRequiredPluginsResponse} + */ +proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.GetRequiredPluginsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetRequiredPluginsResponse} + */ +proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + 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); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetRequiredPluginsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetRequiredPluginsResponse.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.GetRequiredPluginsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPluginsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + pulumi_plugin_pb.PluginDependency.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated PluginDependency plugins = 1; + * @return {!Array} + */ +proto.pulumirpc.GetRequiredPluginsResponse.prototype.getPluginsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_plugin_pb.PluginDependency, 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 {!proto.pulumirpc.PluginDependency=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.PluginDependency} + */ +proto.pulumirpc.GetRequiredPluginsResponse.prototype.addPlugins = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.PluginDependency, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this + */ +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) { +/** + * 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.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RunRequest.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.RunRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunRequest.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, + organization: jspb.Message.getFieldWithDefault(msg, 12, ""), + configpropertymap: (f = msg.getConfigpropertymap()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f) + }; + + 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.RunRequest} + */ +proto.pulumirpc.RunRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.RunRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RunRequest} + */ +proto.pulumirpc.RunRequest.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.setProject(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); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setOrganization(value); + break; + case 13: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setConfigpropertymap(value); + break; + case 14: + var value = new proto.pulumirpc.ProgramInfo; + reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader); + msg.setInfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RunRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RunRequest.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.RunRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStack(); + 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 + ); + } + f = message.getOrganization(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } + f = message.getConfigpropertymap(); + if (f != null) { + writer.writeMessage( + 13, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getInfo(); + if (f != null) { + writer.writeMessage( + 14, + f, + proto.pulumirpc.ProgramInfo.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string project = 1; + * @return {string} + */ +proto.pulumirpc.RunRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @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.RunRequest.prototype.getStack = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setStack = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string pwd = 3; + * @return {string} + */ +proto.pulumirpc.RunRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setPwd = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string program = 4; + * @return {string} + */ +proto.pulumirpc.RunRequest.prototype.getProgram = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setProgram = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated string args = 5; + * @return {!Array} + */ +proto.pulumirpc.RunRequest.prototype.getArgsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @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); +}; + + +/** + * 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 + */ +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([]); +}; + + +/** + * optional string organization = 12; + * @return {string} + */ +proto.pulumirpc.RunRequest.prototype.getOrganization = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.setOrganization = function(value) { + return jspb.Message.setProto3StringField(this, 12, value); +}; + + +/** + * optional google.protobuf.Struct configPropertyMap = 13; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.RunRequest.prototype.getConfigpropertymap = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 13)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.RunRequest} returns this +*/ +proto.pulumirpc.RunRequest.prototype.setConfigpropertymap = function(value) { + return jspb.Message.setWrapperField(this, 13, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.clearConfigpropertymap = function() { + return this.setConfigpropertymap(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RunRequest.prototype.hasConfigpropertymap = function() { + return jspb.Message.getField(this, 13) != null; +}; + + +/** + * optional ProgramInfo info = 14; + * @return {?proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.RunRequest.prototype.getInfo = function() { + return /** @type{?proto.pulumirpc.ProgramInfo} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 14)); +}; + + +/** + * @param {?proto.pulumirpc.ProgramInfo|undefined} value + * @return {!proto.pulumirpc.RunRequest} returns this +*/ +proto.pulumirpc.RunRequest.prototype.setInfo = function(value) { + return jspb.Message.setWrapperField(this, 14, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RunRequest} returns this + */ +proto.pulumirpc.RunRequest.prototype.clearInfo = function() { + return this.setInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RunRequest.prototype.hasInfo = function() { + return jspb.Message.getField(this, 14) != null; +}; + + + + + +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.RunResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RunResponse.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.RunResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunResponse.toObject = function(includeInstance, msg) { + var f, obj = { + error: jspb.Message.getFieldWithDefault(msg, 1, ""), + bail: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + 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.RunResponse} + */ +proto.pulumirpc.RunResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.RunResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RunResponse} + */ +proto.pulumirpc.RunResponse.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.setError(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setBail(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RunResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RunResponse.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.RunResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getError(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getBail(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * optional string error = 1; + * @return {string} + */ +proto.pulumirpc.RunResponse.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunResponse} returns this + */ +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); +}; + + + + + +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.InstallDependenciesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.InstallDependenciesRequest.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.InstallDependenciesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InstallDependenciesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + directory: jspb.Message.getFieldWithDefault(msg, 1, ""), + isTerminal: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f) + }; + + 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.InstallDependenciesRequest} + */ +proto.pulumirpc.InstallDependenciesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.InstallDependenciesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.InstallDependenciesRequest} + */ +proto.pulumirpc.InstallDependenciesRequest.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.setDirectory(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsTerminal(value); + break; + case 3: + var value = new proto.pulumirpc.ProgramInfo; + reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader); + msg.setInfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.InstallDependenciesRequest.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.InstallDependenciesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDirectory(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getIsTerminal(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getInfo(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.pulumirpc.ProgramInfo.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string directory = 1; + * @return {string} + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.getDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.setDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bool is_terminal = 2; + * @return {boolean} + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.getIsTerminal = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.setIsTerminal = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional ProgramInfo info = 3; + * @return {?proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.getInfo = function() { + return /** @type{?proto.pulumirpc.ProgramInfo} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 3)); +}; + + +/** + * @param {?proto.pulumirpc.ProgramInfo|undefined} value + * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this +*/ +proto.pulumirpc.InstallDependenciesRequest.prototype.setInfo = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.InstallDependenciesRequest} returns this + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.clearInfo = function() { + return this.setInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.InstallDependenciesRequest.prototype.hasInfo = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +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.InstallDependenciesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.InstallDependenciesResponse.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.InstallDependenciesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InstallDependenciesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + stdout: msg.getStdout_asB64(), + stderr: msg.getStderr_asB64() + }; + + 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.InstallDependenciesResponse} + */ +proto.pulumirpc.InstallDependenciesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + 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.InstallDependenciesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.InstallDependenciesResponse} + */ +proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + 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(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.InstallDependenciesResponse.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.InstallDependenciesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStdout_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getStderr_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes stdout = 1; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes stdout = 1; + * This is a type-conversion wrapper around `getStdout()` + * @return {string} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStdout())); +}; + + +/** + * 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())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.InstallDependenciesResponse} returns this + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.setStdout = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes stderr = 2; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * 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())); +}; + + +/** + * 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())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.InstallDependenciesResponse} returns this + */ +proto.pulumirpc.InstallDependenciesResponse.prototype.setStderr = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.RunPluginRequest.repeatedFields_ = [3,4]; + + + +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.RunPluginRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RunPluginRequest.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.RunPluginRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunPluginRequest.toObject = function(includeInstance, msg) { + var f, obj = { + pwd: jspb.Message.getFieldWithDefault(msg, 1, ""), + program: jspb.Message.getFieldWithDefault(msg, 2, ""), + argsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + envList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f) + }; + + 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.RunPluginRequest} + */ +proto.pulumirpc.RunPluginRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RunPluginRequest; + return proto.pulumirpc.RunPluginRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RunPluginRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RunPluginRequest} + */ +proto.pulumirpc.RunPluginRequest.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.setPwd(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setProgram(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addArgs(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addEnv(value); + break; + case 5: + var value = new proto.pulumirpc.ProgramInfo; + reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader); + msg.setInfo(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RunPluginRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RunPluginRequest.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.RunPluginRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunPluginRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPwd(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProgram(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getArgsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getEnvList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getInfo(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.pulumirpc.ProgramInfo.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string pwd = 1; + * @return {string} + */ +proto.pulumirpc.RunPluginRequest.prototype.getPwd = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.setPwd = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string program = 2; + * @return {string} + */ +proto.pulumirpc.RunPluginRequest.prototype.getProgram = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.setProgram = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string args = 3; + * @return {!Array} + */ +proto.pulumirpc.RunPluginRequest.prototype.getArgsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.setArgsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.addArgs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.clearArgsList = function() { + return this.setArgsList([]); +}; + + +/** + * repeated string env = 4; + * @return {!Array} + */ +proto.pulumirpc.RunPluginRequest.prototype.getEnvList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.setEnvList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.addEnv = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.clearEnvList = function() { + return this.setEnvList([]); +}; + + +/** + * optional ProgramInfo info = 5; + * @return {?proto.pulumirpc.ProgramInfo} + */ +proto.pulumirpc.RunPluginRequest.prototype.getInfo = function() { + return /** @type{?proto.pulumirpc.ProgramInfo} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 5)); +}; + + +/** + * @param {?proto.pulumirpc.ProgramInfo|undefined} value + * @return {!proto.pulumirpc.RunPluginRequest} returns this +*/ +proto.pulumirpc.RunPluginRequest.prototype.setInfo = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RunPluginRequest} returns this + */ +proto.pulumirpc.RunPluginRequest.prototype.clearInfo = function() { + return this.setInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RunPluginRequest.prototype.hasInfo = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.pulumirpc.RunPluginResponse.oneofGroups_ = [[1,2,3]]; + +/** + * @enum {number} + */ +proto.pulumirpc.RunPluginResponse.OutputCase = { + OUTPUT_NOT_SET: 0, + STDOUT: 1, + STDERR: 2, + EXITCODE: 3 +}; + +/** + * @return {proto.pulumirpc.RunPluginResponse.OutputCase} + */ +proto.pulumirpc.RunPluginResponse.prototype.getOutputCase = function() { + return /** @type {proto.pulumirpc.RunPluginResponse.OutputCase} */(jspb.Message.computeOneofCase(this, proto.pulumirpc.RunPluginResponse.oneofGroups_[0])); +}; + + + +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.RunPluginResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RunPluginResponse.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.RunPluginResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunPluginResponse.toObject = function(includeInstance, msg) { + var f, obj = { + stdout: msg.getStdout_asB64(), + stderr: msg.getStderr_asB64(), + exitcode: jspb.Message.getFieldWithDefault(msg, 3, 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.RunPluginResponse} + */ +proto.pulumirpc.RunPluginResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RunPluginResponse; + return proto.pulumirpc.RunPluginResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RunPluginResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RunPluginResponse} + */ +proto.pulumirpc.RunPluginResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStdout(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStderr(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setExitcode(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RunPluginResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RunPluginResponse.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.RunPluginResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RunPluginResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBytes( + 1, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBytes( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt32( + 3, + f + ); + } +}; + + +/** + * optional bytes stdout = 1; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.RunPluginResponse.prototype.getStdout = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes stdout = 1; + * This is a type-conversion wrapper around `getStdout()` + * @return {string} + */ +proto.pulumirpc.RunPluginResponse.prototype.getStdout_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStdout())); +}; + + +/** + * 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.RunPluginResponse.prototype.getStdout_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStdout())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.RunPluginResponse} returns this + */ +proto.pulumirpc.RunPluginResponse.prototype.setStdout = function(value) { + return jspb.Message.setOneofField(this, 1, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.RunPluginResponse} returns this + */ +proto.pulumirpc.RunPluginResponse.prototype.clearStdout = function() { + return jspb.Message.setOneofField(this, 1, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RunPluginResponse.prototype.hasStdout = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes stderr = 2; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.RunPluginResponse.prototype.getStderr = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes stderr = 2; + * This is a type-conversion wrapper around `getStderr()` + * @return {string} + */ +proto.pulumirpc.RunPluginResponse.prototype.getStderr_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStderr())); +}; + + +/** + * 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.RunPluginResponse.prototype.getStderr_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStderr())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.RunPluginResponse} returns this + */ +proto.pulumirpc.RunPluginResponse.prototype.setStderr = function(value) { + return jspb.Message.setOneofField(this, 2, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.RunPluginResponse} returns this + */ +proto.pulumirpc.RunPluginResponse.prototype.clearStderr = function() { + return jspb.Message.setOneofField(this, 2, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RunPluginResponse.prototype.hasStderr = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int32 exitcode = 3; + * @return {number} + */ +proto.pulumirpc.RunPluginResponse.prototype.getExitcode = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.RunPluginResponse} returns this + */ +proto.pulumirpc.RunPluginResponse.prototype.setExitcode = function(value) { + return jspb.Message.setOneofField(this, 3, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.RunPluginResponse} returns this + */ +proto.pulumirpc.RunPluginResponse.prototype.clearExitcode = function() { + return jspb.Message.setOneofField(this, 3, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RunPluginResponse.prototype.hasExitcode = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +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.GenerateProgramRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GenerateProgramRequest.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.GenerateProgramRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProgramRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sourceMap: (f = msg.getSourceMap()) ? f.toObject(includeInstance, undefined) : [], + loaderTarget: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.GenerateProgramRequest} + */ +proto.pulumirpc.GenerateProgramRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GenerateProgramRequest; + return proto.pulumirpc.GenerateProgramRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GenerateProgramRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GenerateProgramRequest} + */ +proto.pulumirpc.GenerateProgramRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSourceMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLoaderTarget(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GenerateProgramRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GenerateProgramRequest.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.GenerateProgramRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProgramRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSourceMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getLoaderTarget(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * map source = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.GenerateProgramRequest.prototype.getSourceMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.GenerateProgramRequest} returns this + */ +proto.pulumirpc.GenerateProgramRequest.prototype.clearSourceMap = function() { + this.getSourceMap().clear(); + return this;}; + + +/** + * optional string loader_target = 2; + * @return {string} + */ +proto.pulumirpc.GenerateProgramRequest.prototype.getLoaderTarget = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GenerateProgramRequest} returns this + */ +proto.pulumirpc.GenerateProgramRequest.prototype.setLoaderTarget = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GenerateProgramResponse.repeatedFields_ = [1]; + + + +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.GenerateProgramResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GenerateProgramResponse.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.GenerateProgramResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProgramResponse.toObject = function(includeInstance, msg) { + var f, obj = { + diagnosticsList: jspb.Message.toObjectList(msg.getDiagnosticsList(), + pulumi_codegen_hcl_pb.Diagnostic.toObject, includeInstance), + sourceMap: (f = msg.getSourceMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.GenerateProgramResponse} + */ +proto.pulumirpc.GenerateProgramResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GenerateProgramResponse; + return proto.pulumirpc.GenerateProgramResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GenerateProgramResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GenerateProgramResponse} + */ +proto.pulumirpc.GenerateProgramResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pulumi_codegen_hcl_pb.Diagnostic; + reader.readMessage(value,pulumi_codegen_hcl_pb.Diagnostic.deserializeBinaryFromReader); + msg.addDiagnostics(value); + break; + case 2: + var value = msg.getSourceMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GenerateProgramResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GenerateProgramResponse.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.GenerateProgramResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProgramResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDiagnosticsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + pulumi_codegen_hcl_pb.Diagnostic.serializeBinaryToWriter + ); + } + f = message.getSourceMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } +}; + + +/** + * repeated codegen.Diagnostic diagnostics = 1; + * @return {!Array} + */ +proto.pulumirpc.GenerateProgramResponse.prototype.getDiagnosticsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_codegen_hcl_pb.Diagnostic, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.GenerateProgramResponse} returns this +*/ +proto.pulumirpc.GenerateProgramResponse.prototype.setDiagnosticsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.pulumirpc.codegen.Diagnostic=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.codegen.Diagnostic} + */ +proto.pulumirpc.GenerateProgramResponse.prototype.addDiagnostics = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.codegen.Diagnostic, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.GenerateProgramResponse} returns this + */ +proto.pulumirpc.GenerateProgramResponse.prototype.clearDiagnosticsList = function() { + return this.setDiagnosticsList([]); +}; + + +/** + * map source = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.GenerateProgramResponse.prototype.getSourceMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.GenerateProgramResponse} returns this + */ +proto.pulumirpc.GenerateProgramResponse.prototype.clearSourceMap = function() { + this.getSourceMap().clear(); + return this;}; + + + + + +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.GenerateProjectRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GenerateProjectRequest.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.GenerateProjectRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProjectRequest.toObject = function(includeInstance, msg) { + var f, obj = { + sourceDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""), + targetDirectory: jspb.Message.getFieldWithDefault(msg, 2, ""), + project: jspb.Message.getFieldWithDefault(msg, 3, ""), + strict: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + loaderTarget: jspb.Message.getFieldWithDefault(msg, 5, ""), + localDependenciesMap: (f = msg.getLocalDependenciesMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.GenerateProjectRequest} + */ +proto.pulumirpc.GenerateProjectRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GenerateProjectRequest; + return proto.pulumirpc.GenerateProjectRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GenerateProjectRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GenerateProjectRequest} + */ +proto.pulumirpc.GenerateProjectRequest.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.setSourceDirectory(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTargetDirectory(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProject(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setStrict(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setLoaderTarget(value); + break; + case 6: + var value = msg.getLocalDependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GenerateProjectRequest.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.GenerateProjectRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProjectRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSourceDirectory(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTargetDirectory(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getStrict(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getLoaderTarget(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getLocalDependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string source_directory = 1; + * @return {string} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.getSourceDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GenerateProjectRequest} returns this + */ +proto.pulumirpc.GenerateProjectRequest.prototype.setSourceDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string target_directory = 2; + * @return {string} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.getTargetDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GenerateProjectRequest} returns this + */ +proto.pulumirpc.GenerateProjectRequest.prototype.setTargetDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string project = 3; + * @return {string} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GenerateProjectRequest} returns this + */ +proto.pulumirpc.GenerateProjectRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool strict = 4; + * @return {boolean} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.getStrict = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.GenerateProjectRequest} returns this + */ +proto.pulumirpc.GenerateProjectRequest.prototype.setStrict = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional string loader_target = 5; + * @return {string} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.getLoaderTarget = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GenerateProjectRequest} returns this + */ +proto.pulumirpc.GenerateProjectRequest.prototype.setLoaderTarget = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * map local_dependencies = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.GenerateProjectRequest.prototype.getLocalDependenciesMap = 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.GenerateProjectRequest} returns this + */ +proto.pulumirpc.GenerateProjectRequest.prototype.clearLocalDependenciesMap = function() { + this.getLocalDependenciesMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GenerateProjectResponse.repeatedFields_ = [1]; + + + +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.GenerateProjectResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GenerateProjectResponse.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.GenerateProjectResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProjectResponse.toObject = function(includeInstance, msg) { + var f, obj = { + diagnosticsList: jspb.Message.toObjectList(msg.getDiagnosticsList(), + pulumi_codegen_hcl_pb.Diagnostic.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.pulumirpc.GenerateProjectResponse} + */ +proto.pulumirpc.GenerateProjectResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GenerateProjectResponse; + return proto.pulumirpc.GenerateProjectResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GenerateProjectResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GenerateProjectResponse} + */ +proto.pulumirpc.GenerateProjectResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pulumi_codegen_hcl_pb.Diagnostic; + reader.readMessage(value,pulumi_codegen_hcl_pb.Diagnostic.deserializeBinaryFromReader); + msg.addDiagnostics(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GenerateProjectResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GenerateProjectResponse.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.GenerateProjectResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GenerateProjectResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDiagnosticsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + pulumi_codegen_hcl_pb.Diagnostic.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated codegen.Diagnostic diagnostics = 1; + * @return {!Array} + */ +proto.pulumirpc.GenerateProjectResponse.prototype.getDiagnosticsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_codegen_hcl_pb.Diagnostic, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.GenerateProjectResponse} returns this +*/ +proto.pulumirpc.GenerateProjectResponse.prototype.setDiagnosticsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.pulumirpc.codegen.Diagnostic=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.codegen.Diagnostic} + */ +proto.pulumirpc.GenerateProjectResponse.prototype.addDiagnostics = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.codegen.Diagnostic, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.GenerateProjectResponse} returns this + */ +proto.pulumirpc.GenerateProjectResponse.prototype.clearDiagnosticsList = function() { + return this.setDiagnosticsList([]); +}; + + + + + +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.GeneratePackageRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GeneratePackageRequest.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.GeneratePackageRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GeneratePackageRequest.toObject = function(includeInstance, msg) { + var f, obj = { + directory: jspb.Message.getFieldWithDefault(msg, 1, ""), + schema: jspb.Message.getFieldWithDefault(msg, 2, ""), + extraFilesMap: (f = msg.getExtraFilesMap()) ? f.toObject(includeInstance, undefined) : [], + loaderTarget: jspb.Message.getFieldWithDefault(msg, 4, ""), + localDependenciesMap: (f = msg.getLocalDependenciesMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.GeneratePackageRequest} + */ +proto.pulumirpc.GeneratePackageRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GeneratePackageRequest; + return proto.pulumirpc.GeneratePackageRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GeneratePackageRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GeneratePackageRequest} + */ +proto.pulumirpc.GeneratePackageRequest.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.setDirectory(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSchema(value); + break; + case 3: + var value = msg.getExtraFilesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setLoaderTarget(value); + break; + case 5: + var value = msg.getLocalDependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GeneratePackageRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GeneratePackageRequest.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.GeneratePackageRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GeneratePackageRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDirectory(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSchema(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getExtraFilesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getLoaderTarget(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getLocalDependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string directory = 1; + * @return {string} + */ +proto.pulumirpc.GeneratePackageRequest.prototype.getDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GeneratePackageRequest} returns this + */ +proto.pulumirpc.GeneratePackageRequest.prototype.setDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string schema = 2; + * @return {string} + */ +proto.pulumirpc.GeneratePackageRequest.prototype.getSchema = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GeneratePackageRequest} returns this + */ +proto.pulumirpc.GeneratePackageRequest.prototype.setSchema = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map extra_files = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.GeneratePackageRequest.prototype.getExtraFilesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.GeneratePackageRequest} returns this + */ +proto.pulumirpc.GeneratePackageRequest.prototype.clearExtraFilesMap = function() { + this.getExtraFilesMap().clear(); + return this;}; + + +/** + * optional string loader_target = 4; + * @return {string} + */ +proto.pulumirpc.GeneratePackageRequest.prototype.getLoaderTarget = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GeneratePackageRequest} returns this + */ +proto.pulumirpc.GeneratePackageRequest.prototype.setLoaderTarget = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map local_dependencies = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.GeneratePackageRequest.prototype.getLocalDependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.GeneratePackageRequest} returns this + */ +proto.pulumirpc.GeneratePackageRequest.prototype.clearLocalDependenciesMap = function() { + this.getLocalDependenciesMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GeneratePackageResponse.repeatedFields_ = [1]; + + + +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.GeneratePackageResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GeneratePackageResponse.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.GeneratePackageResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GeneratePackageResponse.toObject = function(includeInstance, msg) { + var f, obj = { + diagnosticsList: jspb.Message.toObjectList(msg.getDiagnosticsList(), + pulumi_codegen_hcl_pb.Diagnostic.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.pulumirpc.GeneratePackageResponse} + */ +proto.pulumirpc.GeneratePackageResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GeneratePackageResponse; + return proto.pulumirpc.GeneratePackageResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GeneratePackageResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GeneratePackageResponse} + */ +proto.pulumirpc.GeneratePackageResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pulumi_codegen_hcl_pb.Diagnostic; + reader.readMessage(value,pulumi_codegen_hcl_pb.Diagnostic.deserializeBinaryFromReader); + msg.addDiagnostics(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GeneratePackageResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GeneratePackageResponse.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.GeneratePackageResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GeneratePackageResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDiagnosticsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + pulumi_codegen_hcl_pb.Diagnostic.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated codegen.Diagnostic diagnostics = 1; + * @return {!Array} + */ +proto.pulumirpc.GeneratePackageResponse.prototype.getDiagnosticsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_codegen_hcl_pb.Diagnostic, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.GeneratePackageResponse} returns this +*/ +proto.pulumirpc.GeneratePackageResponse.prototype.setDiagnosticsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.pulumirpc.codegen.Diagnostic=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.codegen.Diagnostic} + */ +proto.pulumirpc.GeneratePackageResponse.prototype.addDiagnostics = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.codegen.Diagnostic, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.GeneratePackageResponse} returns this + */ +proto.pulumirpc.GeneratePackageResponse.prototype.clearDiagnosticsList = function() { + return this.setDiagnosticsList([]); +}; + + + + + +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.PackRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PackRequest.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.PackRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PackRequest.toObject = function(includeInstance, msg) { + var f, obj = { + packageDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""), + destinationDirectory: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.PackRequest} + */ +proto.pulumirpc.PackRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.PackRequest; + return proto.pulumirpc.PackRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.PackRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.PackRequest} + */ +proto.pulumirpc.PackRequest.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.setPackageDirectory(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDestinationDirectory(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.PackRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PackRequest.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.PackRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PackRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPackageDirectory(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDestinationDirectory(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string package_directory = 1; + * @return {string} + */ +proto.pulumirpc.PackRequest.prototype.getPackageDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PackRequest} returns this + */ +proto.pulumirpc.PackRequest.prototype.setPackageDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string destination_directory = 2; + * @return {string} + */ +proto.pulumirpc.PackRequest.prototype.getDestinationDirectory = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PackRequest} returns this + */ +proto.pulumirpc.PackRequest.prototype.setDestinationDirectory = function(value) { + return jspb.Message.setProto3StringField(this, 2, 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.PackResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PackResponse.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.PackResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PackResponse.toObject = function(includeInstance, msg) { + var f, obj = { + artifactPath: 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.PackResponse} + */ +proto.pulumirpc.PackResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.PackResponse; + return proto.pulumirpc.PackResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.PackResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.PackResponse} + */ +proto.pulumirpc.PackResponse.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.setArtifactPath(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.PackResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PackResponse.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.PackResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PackResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getArtifactPath(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string artifact_path = 1; + * @return {string} + */ +proto.pulumirpc.PackResponse.prototype.getArtifactPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PackResponse} returns this + */ +proto.pulumirpc.PackResponse.prototype.setArtifactPath = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 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 + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = __nccwpck_require__(69917); +var goog = jspb; +var proto = { pulumirpc: { codegen: { }, testing: { } } }, 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 + */ +proto.pulumirpc.PluginInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, 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 + */ +proto.pulumirpc.PluginDependency = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +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 + */ +proto.pulumirpc.PluginAttach = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.PluginAttach, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.PluginAttach.displayName = 'proto.pulumirpc.PluginAttach'; +} + + + +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.PluginInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PluginInfo.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.PluginInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PluginInfo.toObject = function(includeInstance, msg) { + var f, obj = { + version: 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.PluginInfo} + */ +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); +}; + + +/** + * 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.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; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.PluginInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PluginInfo.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.PluginInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PluginInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string version = 1; + * @return {string} + */ +proto.pulumirpc.PluginInfo.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PluginInfo} returns this + */ +proto.pulumirpc.PluginInfo.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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.PluginDependency.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PluginDependency.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.PluginDependency} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +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, ""), + checksumsMap: (f = msg.getChecksumsMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.PluginDependency} + */ +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); +}; + + +/** + * 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.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; + case 5: + var value = msg.getChecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.PluginDependency.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PluginDependency.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.PluginDependency} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +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 + ); + } + f = message.getChecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.PluginDependency.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.PluginDependency} returns this + */ +proto.pulumirpc.PluginDependency.prototype.setName = 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} + */ +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); +}; + + +/** + * map checksums = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.PluginDependency.prototype.getChecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.PluginDependency} returns this + */ +proto.pulumirpc.PluginDependency.prototype.clearChecksumsMap = function() { + this.getChecksumsMap().clear(); + return this;}; + + + + + +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); + + +/***/ }), + +/***/ 68870: +/***/ ((__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__(69917); +var goog = jspb; +var proto = { pulumirpc: { codegen: { }, testing: { } } }, 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.CustomTimeouts', 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.GetMappingRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GetMappingResponse', null, global); +goog.exportSymbol('proto.pulumirpc.GetMappingsRequest', null, global); +goog.exportSymbol('proto.pulumirpc.GetMappingsResponse', 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.ParameterizeRequest', null, global); +goog.exportSymbol('proto.pulumirpc.ParameterizeRequest.ParametersArgs', null, global); +goog.exportSymbol('proto.pulumirpc.ParameterizeRequest.ParametersCase', null, global); +goog.exportSymbol('proto.pulumirpc.ParameterizeRequest.ParametersValue', null, global); +goog.exportSymbol('proto.pulumirpc.ParameterizeResponse', 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.ParameterizeRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.pulumirpc.ParameterizeRequest.oneofGroups_); +}; +goog.inherits(proto.pulumirpc.ParameterizeRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ParameterizeRequest.displayName = 'proto.pulumirpc.ParameterizeRequest'; +} +/** + * 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.ParameterizeRequest.ParametersArgs = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ParameterizeRequest.ParametersArgs.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ParameterizeRequest.ParametersArgs, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ParameterizeRequest.ParametersArgs.displayName = 'proto.pulumirpc.ParameterizeRequest.ParametersArgs'; +} +/** + * 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.ParameterizeRequest.ParametersValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ParameterizeRequest.ParametersValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ParameterizeRequest.ParametersValue.displayName = 'proto.pulumirpc.ParameterizeRequest.ParametersValue'; +} +/** + * 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.ParameterizeResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ParameterizeResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ParameterizeResponse.displayName = 'proto.pulumirpc.ParameterizeResponse'; +} +/** + * 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.GetSchemaRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetSchemaRequest.displayName = '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.GetSchemaResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetSchemaResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetSchemaResponse.displayName = 'proto.pulumirpc.GetSchemaResponse'; +} +/** + * 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.ConfigureRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ConfigureRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ConfigureRequest.displayName = 'proto.pulumirpc.ConfigureRequest'; +} +/** + * 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.ConfigureResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +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 + */ +proto.pulumirpc.ConfigureErrorMissingKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ConfigureErrorMissingKeys.repeatedFields_, null); +}; +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 + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +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 + */ +proto.pulumirpc.InvokeRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +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 + */ +proto.pulumirpc.InvokeResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.InvokeResponse.repeatedFields_, null); +}; +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 + */ +proto.pulumirpc.CallRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.CallRequest.repeatedFields_, null); +}; +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 + */ +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'; +} +/** + * 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.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'; +} +/** + * 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.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'; +} +/** + * 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.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'; +} +/** + * 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.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'; +} +/** + * 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.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'; +} +/** + * 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.DiffRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.DiffRequest.repeatedFields_, null); +}; +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.ConstructRequest.CustomTimeouts = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ConstructRequest.CustomTimeouts, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ConstructRequest.CustomTimeouts.displayName = 'proto.pulumirpc.ConstructRequest.CustomTimeouts'; +} +/** + * 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'; +} +/** + * 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.GetMappingRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetMappingRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetMappingRequest.displayName = 'proto.pulumirpc.GetMappingRequest'; +} +/** + * 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.GetMappingResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetMappingResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetMappingResponse.displayName = 'proto.pulumirpc.GetMappingResponse'; +} +/** + * 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.GetMappingsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.GetMappingsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetMappingsRequest.displayName = 'proto.pulumirpc.GetMappingsRequest'; +} +/** + * 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.GetMappingsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GetMappingsResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.GetMappingsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.GetMappingsResponse.displayName = 'proto.pulumirpc.GetMappingsResponse'; +} + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.pulumirpc.ParameterizeRequest.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.pulumirpc.ParameterizeRequest.ParametersCase = { + PARAMETERS_NOT_SET: 0, + ARGS: 1, + VALUE: 2 +}; + +/** + * @return {proto.pulumirpc.ParameterizeRequest.ParametersCase} + */ +proto.pulumirpc.ParameterizeRequest.prototype.getParametersCase = function() { + return /** @type {proto.pulumirpc.ParameterizeRequest.ParametersCase} */(jspb.Message.computeOneofCase(this, proto.pulumirpc.ParameterizeRequest.oneofGroups_[0])); +}; + + + +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.ParameterizeRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ParameterizeRequest.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.ParameterizeRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeRequest.toObject = function(includeInstance, msg) { + var f, obj = { + args: (f = msg.getArgs()) && proto.pulumirpc.ParameterizeRequest.ParametersArgs.toObject(includeInstance, f), + value: (f = msg.getValue()) && proto.pulumirpc.ParameterizeRequest.ParametersValue.toObject(includeInstance, f) + }; + + 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.ParameterizeRequest} + */ +proto.pulumirpc.ParameterizeRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ParameterizeRequest; + return proto.pulumirpc.ParameterizeRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ParameterizeRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ParameterizeRequest} + */ +proto.pulumirpc.ParameterizeRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.pulumirpc.ParameterizeRequest.ParametersArgs; + reader.readMessage(value,proto.pulumirpc.ParameterizeRequest.ParametersArgs.deserializeBinaryFromReader); + msg.setArgs(value); + break; + case 2: + var value = new proto.pulumirpc.ParameterizeRequest.ParametersValue; + reader.readMessage(value,proto.pulumirpc.ParameterizeRequest.ParametersValue.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ParameterizeRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ParameterizeRequest.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.ParameterizeRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getArgs(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.pulumirpc.ParameterizeRequest.ParametersArgs.serializeBinaryToWriter + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.pulumirpc.ParameterizeRequest.ParametersValue.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.repeatedFields_ = [1]; + + + +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.ParameterizeRequest.ParametersArgs.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ParameterizeRequest.ParametersArgs.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.ParameterizeRequest.ParametersArgs} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.toObject = function(includeInstance, msg) { + var f, obj = { + argsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.ParameterizeRequest.ParametersArgs} + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ParameterizeRequest.ParametersArgs; + return proto.pulumirpc.ParameterizeRequest.ParametersArgs.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ParameterizeRequest.ParametersArgs} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersArgs} + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.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.addArgs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ParameterizeRequest.ParametersArgs.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.ParameterizeRequest.ParametersArgs} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getArgsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string args = 1; + * @return {!Array} + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.prototype.getArgsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersArgs} returns this + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.prototype.setArgsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersArgs} returns this + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.prototype.addArgs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersArgs} returns this + */ +proto.pulumirpc.ParameterizeRequest.ParametersArgs.prototype.clearArgsList = function() { + return this.setArgsList([]); +}; + + + + + +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.ParameterizeRequest.ParametersValue.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ParameterizeRequest.ParametersValue.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.ParameterizeRequest.ParametersValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, ""), + value: (f = msg.getValue()) && google_protobuf_struct_pb.Value.toObject(includeInstance, f) + }; + + 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.ParameterizeRequest.ParametersValue} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ParameterizeRequest.ParametersValue; + return proto.pulumirpc.ParameterizeRequest.ParametersValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ParameterizeRequest.ParametersValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersValue} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.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.setVersion(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Value; + reader.readMessage(value,google_protobuf_struct_pb.Value.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ParameterizeRequest.ParametersValue.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.ParameterizeRequest.ParametersValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Value.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersValue} returns this + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersValue} returns this + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Value value = 3; + * @return {?proto.google.protobuf.Value} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.getValue = function() { + return /** @type{?proto.google.protobuf.Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Value|undefined} value + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersValue} returns this +*/ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ParameterizeRequest.ParametersValue} returns this + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ParameterizeRequest.ParametersValue.prototype.hasValue = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional ParametersArgs args = 1; + * @return {?proto.pulumirpc.ParameterizeRequest.ParametersArgs} + */ +proto.pulumirpc.ParameterizeRequest.prototype.getArgs = function() { + return /** @type{?proto.pulumirpc.ParameterizeRequest.ParametersArgs} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ParameterizeRequest.ParametersArgs, 1)); +}; + + +/** + * @param {?proto.pulumirpc.ParameterizeRequest.ParametersArgs|undefined} value + * @return {!proto.pulumirpc.ParameterizeRequest} returns this +*/ +proto.pulumirpc.ParameterizeRequest.prototype.setArgs = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.pulumirpc.ParameterizeRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ParameterizeRequest} returns this + */ +proto.pulumirpc.ParameterizeRequest.prototype.clearArgs = function() { + return this.setArgs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ParameterizeRequest.prototype.hasArgs = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ParametersValue value = 2; + * @return {?proto.pulumirpc.ParameterizeRequest.ParametersValue} + */ +proto.pulumirpc.ParameterizeRequest.prototype.getValue = function() { + return /** @type{?proto.pulumirpc.ParameterizeRequest.ParametersValue} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ParameterizeRequest.ParametersValue, 2)); +}; + + +/** + * @param {?proto.pulumirpc.ParameterizeRequest.ParametersValue|undefined} value + * @return {!proto.pulumirpc.ParameterizeRequest} returns this +*/ +proto.pulumirpc.ParameterizeRequest.prototype.setValue = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.pulumirpc.ParameterizeRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ParameterizeRequest} returns this + */ +proto.pulumirpc.ParameterizeRequest.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ParameterizeRequest.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +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.ParameterizeResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ParameterizeResponse.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.ParameterizeResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeResponse.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.ParameterizeResponse} + */ +proto.pulumirpc.ParameterizeResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ParameterizeResponse; + return proto.pulumirpc.ParameterizeResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ParameterizeResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ParameterizeResponse} + */ +proto.pulumirpc.ParameterizeResponse.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.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ParameterizeResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ParameterizeResponse.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.ParameterizeResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ParameterizeResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.ParameterizeResponse.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ParameterizeResponse} returns this + */ +proto.pulumirpc.ParameterizeResponse.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.pulumirpc.ParameterizeResponse.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ParameterizeResponse} returns this + */ +proto.pulumirpc.ParameterizeResponse.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, 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.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), + subpackageName: jspb.Message.getFieldWithDefault(msg, 2, ""), + subpackageVersion: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSubpackageName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setSubpackageVersion(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 + ); + } + f = message.getSubpackageName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSubpackageVersion(); + if (f.length > 0) { + writer.writeString( + 3, + 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); +}; + + +/** + * optional string subpackage_name = 2; + * @return {string} + */ +proto.pulumirpc.GetSchemaRequest.prototype.getSubpackageName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetSchemaRequest} returns this + */ +proto.pulumirpc.GetSchemaRequest.prototype.setSubpackageName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string subpackage_version = 3; + * @return {string} + */ +proto.pulumirpc.GetSchemaRequest.prototype.getSubpackageVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetSchemaRequest} returns this + */ +proto.pulumirpc.GetSchemaRequest.prototype.setSubpackageVersion = function(value) { + return jspb.Message.setProto3StringField(this, 3, 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.GetSchemaResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetSchemaResponse.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.GetSchemaResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetSchemaResponse.toObject = function(includeInstance, msg) { + var f, obj = { + schema: 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.GetSchemaResponse} + */ +proto.pulumirpc.GetSchemaResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetSchemaResponse; + return proto.pulumirpc.GetSchemaResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetSchemaResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetSchemaResponse} + */ +proto.pulumirpc.GetSchemaResponse.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.setSchema(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetSchemaResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetSchemaResponse.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.GetSchemaResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetSchemaResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSchema(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string schema = 1; + * @return {string} + */ +proto.pulumirpc.GetSchemaResponse.prototype.getSchema = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetSchemaResponse} returns this + */ +proto.pulumirpc.GetSchemaResponse.prototype.setSchema = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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.ConfigureRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConfigureRequest.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.ConfigureRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureRequest.toObject = function(includeInstance, msg) { + var f, obj = { + variablesMap: (f = msg.getVariablesMap()) ? f.toObject(includeInstance, undefined) : [], + args: (f = msg.getArgs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + acceptsecrets: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + acceptresources: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + sendsOldInputs: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + sendsOldInputsToDelete: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) + }; + + 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.ConfigureRequest} + */ +proto.pulumirpc.ConfigureRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConfigureRequest; + return proto.pulumirpc.ConfigureRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConfigureRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConfigureRequest} + */ +proto.pulumirpc.ConfigureRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getVariablesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setArgs(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptsecrets(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptresources(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSendsOldInputs(value); + break; + case 6: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSendsOldInputsToDelete(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConfigureRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConfigureRequest.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.ConfigureRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVariablesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getArgs(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getAcceptsecrets(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getAcceptresources(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getSendsOldInputs(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getSendsOldInputsToDelete(); + if (f) { + writer.writeBool( + 6, + f + ); + } +}; + + +/** + * map variables = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ConfigureRequest.prototype.getVariablesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ConfigureRequest} returns this + */ +proto.pulumirpc.ConfigureRequest.prototype.clearVariablesMap = function() { + this.getVariablesMap().clear(); + return this;}; + + +/** + * optional google.protobuf.Struct args = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ConfigureRequest.prototype.getArgs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ConfigureRequest} returns this +*/ +proto.pulumirpc.ConfigureRequest.prototype.setArgs = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ConfigureRequest} returns this + */ +proto.pulumirpc.ConfigureRequest.prototype.clearArgs = function() { + return this.setArgs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ConfigureRequest.prototype.hasArgs = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional bool acceptSecrets = 3; + * @return {boolean} + */ +proto.pulumirpc.ConfigureRequest.prototype.getAcceptsecrets = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureRequest} returns this + */ +proto.pulumirpc.ConfigureRequest.prototype.setAcceptsecrets = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional bool acceptResources = 4; + * @return {boolean} + */ +proto.pulumirpc.ConfigureRequest.prototype.getAcceptresources = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureRequest} returns this + */ +proto.pulumirpc.ConfigureRequest.prototype.setAcceptresources = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional bool sends_old_inputs = 5; + * @return {boolean} + */ +proto.pulumirpc.ConfigureRequest.prototype.getSendsOldInputs = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureRequest} returns this + */ +proto.pulumirpc.ConfigureRequest.prototype.setSendsOldInputs = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional bool sends_old_inputs_to_delete = 6; + * @return {boolean} + */ +proto.pulumirpc.ConfigureRequest.prototype.getSendsOldInputsToDelete = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureRequest} returns this + */ +proto.pulumirpc.ConfigureRequest.prototype.setSendsOldInputsToDelete = function(value) { + return jspb.Message.setProto3BooleanField(this, 6, 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.ConfigureResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConfigureResponse.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.ConfigureResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureResponse.toObject = function(includeInstance, msg) { + var f, obj = { + acceptsecrets: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + supportspreview: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + acceptresources: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + acceptoutputs: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + }; + + 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.ConfigureResponse} + */ +proto.pulumirpc.ConfigureResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConfigureResponse; + return proto.pulumirpc.ConfigureResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConfigureResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConfigureResponse} + */ +proto.pulumirpc.ConfigureResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptsecrets(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupportspreview(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptresources(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptoutputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConfigureResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConfigureResponse.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.ConfigureResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAcceptsecrets(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getSupportspreview(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getAcceptresources(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getAcceptoutputs(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional bool acceptSecrets = 1; + * @return {boolean} + */ +proto.pulumirpc.ConfigureResponse.prototype.getAcceptsecrets = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureResponse} returns this + */ +proto.pulumirpc.ConfigureResponse.prototype.setAcceptsecrets = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * optional bool supportsPreview = 2; + * @return {boolean} + */ +proto.pulumirpc.ConfigureResponse.prototype.getSupportspreview = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureResponse} returns this + */ +proto.pulumirpc.ConfigureResponse.prototype.setSupportspreview = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional bool acceptResources = 3; + * @return {boolean} + */ +proto.pulumirpc.ConfigureResponse.prototype.getAcceptresources = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureResponse} returns this + */ +proto.pulumirpc.ConfigureResponse.prototype.setAcceptresources = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional bool acceptOutputs = 4; + * @return {boolean} + */ +proto.pulumirpc.ConfigureResponse.prototype.getAcceptoutputs = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConfigureResponse} returns this + */ +proto.pulumirpc.ConfigureResponse.prototype.setAcceptoutputs = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ConfigureErrorMissingKeys.repeatedFields_ = [1]; + + + +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.ConfigureErrorMissingKeys.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConfigureErrorMissingKeys.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.ConfigureErrorMissingKeys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureErrorMissingKeys.toObject = function(includeInstance, msg) { + var f, obj = { + missingkeysList: jspb.Message.toObjectList(msg.getMissingkeysList(), + proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.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.pulumirpc.ConfigureErrorMissingKeys} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConfigureErrorMissingKeys; + return proto.pulumirpc.ConfigureErrorMissingKeys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConfigureErrorMissingKeys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey; + reader.readMessage(value,proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.deserializeBinaryFromReader); + msg.addMissingkeys(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConfigureErrorMissingKeys.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.ConfigureErrorMissingKeys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureErrorMissingKeys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMissingkeysList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.serializeBinaryToWriter + ); + } +}; + + + + + +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.ConfigureErrorMissingKeys.MissingKey.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.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.ConfigureErrorMissingKeys.MissingKey} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + description: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.ConfigureErrorMissingKeys.MissingKey} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey; + return proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.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.setDescription(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.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.ConfigureErrorMissingKeys.MissingKey} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey} returns this + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string description = 2; + * @return {string} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey} returns this + */ +proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey.prototype.setDescription = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated MissingKey missingKeys = 1; + * @return {!Array} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.prototype.getMissingkeysList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys} returns this +*/ +proto.pulumirpc.ConfigureErrorMissingKeys.prototype.setMissingkeysList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey} + */ +proto.pulumirpc.ConfigureErrorMissingKeys.prototype.addMissingkeys = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.ConfigureErrorMissingKeys.MissingKey, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConfigureErrorMissingKeys} returns this + */ +proto.pulumirpc.ConfigureErrorMissingKeys.prototype.clearMissingkeysList = function() { + return this.setMissingkeysList([]); +}; + + + + + +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.InvokeRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.InvokeRequest.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.InvokeRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InvokeRequest.toObject = function(includeInstance, msg) { + var f, obj = { + tok: jspb.Message.getFieldWithDefault(msg, 1, ""), + args: (f = msg.getArgs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.InvokeRequest} + */ +proto.pulumirpc.InvokeRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.InvokeRequest; + return proto.pulumirpc.InvokeRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.InvokeRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.InvokeRequest} + */ +proto.pulumirpc.InvokeRequest.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.setTok(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setArgs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.InvokeRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.InvokeRequest.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.InvokeRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InvokeRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTok(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getArgs(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string tok = 1; + * @return {string} + */ +proto.pulumirpc.InvokeRequest.prototype.getTok = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.InvokeRequest} returns this + */ +proto.pulumirpc.InvokeRequest.prototype.setTok = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct args = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.InvokeRequest.prototype.getArgs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.InvokeRequest} returns this +*/ +proto.pulumirpc.InvokeRequest.prototype.setArgs = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.InvokeRequest} returns this + */ +proto.pulumirpc.InvokeRequest.prototype.clearArgs = function() { + return this.setArgs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.InvokeRequest.prototype.hasArgs = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.InvokeResponse.repeatedFields_ = [2]; + + + +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.InvokeResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.InvokeResponse.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.InvokeResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InvokeResponse.toObject = function(includeInstance, msg) { + var f, obj = { + pb_return: (f = msg.getReturn()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + failuresList: jspb.Message.toObjectList(msg.getFailuresList(), + proto.pulumirpc.CheckFailure.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.pulumirpc.InvokeResponse} + */ +proto.pulumirpc.InvokeResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.InvokeResponse; + return proto.pulumirpc.InvokeResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.InvokeResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.InvokeResponse} + */ +proto.pulumirpc.InvokeResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setReturn(value); + break; + case 2: + var value = new proto.pulumirpc.CheckFailure; + reader.readMessage(value,proto.pulumirpc.CheckFailure.deserializeBinaryFromReader); + msg.addFailures(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.InvokeResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.InvokeResponse.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.InvokeResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.InvokeResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReturn(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getFailuresList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.pulumirpc.CheckFailure.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.Struct return = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.InvokeResponse.prototype.getReturn = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.InvokeResponse} returns this +*/ +proto.pulumirpc.InvokeResponse.prototype.setReturn = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.InvokeResponse} returns this + */ +proto.pulumirpc.InvokeResponse.prototype.clearReturn = function() { + return this.setReturn(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.InvokeResponse.prototype.hasReturn = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated CheckFailure failures = 2; + * @return {!Array} + */ +proto.pulumirpc.InvokeResponse.prototype.getFailuresList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.CheckFailure, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.InvokeResponse} returns this +*/ +proto.pulumirpc.InvokeResponse.prototype.setFailuresList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.pulumirpc.CheckFailure=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.CheckFailure} + */ +proto.pulumirpc.InvokeResponse.prototype.addFailures = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.pulumirpc.CheckFailure, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.InvokeResponse} returns this + */ +proto.pulumirpc.InvokeResponse.prototype.clearFailuresList = function() { + return this.setFailuresList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.CallRequest.repeatedFields_ = [9]; + + + +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.CallRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CallRequest.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.CallRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallRequest.toObject = function(includeInstance, msg) { + var f, obj = { + tok: jspb.Message.getFieldWithDefault(msg, 1, ""), + args: (f = msg.getArgs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + argdependenciesMap: (f = msg.getArgdependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.CallRequest.ArgumentDependencies.toObject) : [], + project: jspb.Message.getFieldWithDefault(msg, 6, ""), + stack: jspb.Message.getFieldWithDefault(msg, 7, ""), + configMap: (f = msg.getConfigMap()) ? f.toObject(includeInstance, undefined) : [], + configsecretkeysList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, + dryrun: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + parallel: jspb.Message.getFieldWithDefault(msg, 11, 0), + monitorendpoint: jspb.Message.getFieldWithDefault(msg, 12, ""), + organization: jspb.Message.getFieldWithDefault(msg, 14, ""), + acceptsOutputValues: jspb.Message.getBooleanFieldWithDefault(msg, 17, false) + }; + + 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.CallRequest} + */ +proto.pulumirpc.CallRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CallRequest; + return proto.pulumirpc.CallRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CallRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CallRequest} + */ +proto.pulumirpc.CallRequest.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.setTok(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setArgs(value); + break; + case 3: + var value = msg.getArgdependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.CallRequest.ArgumentDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.CallRequest.ArgumentDependencies()); + }); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setProject(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setStack(value); + break; + case 8: + 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 9: + var value = /** @type {string} */ (reader.readString()); + msg.addConfigsecretkeys(value); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDryrun(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt32()); + msg.setParallel(value); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setMonitorendpoint(value); + break; + case 14: + var value = /** @type {string} */ (reader.readString()); + msg.setOrganization(value); + break; + case 17: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptsOutputValues(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CallRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CallRequest.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.CallRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTok(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getArgs(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getArgdependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.CallRequest.ArgumentDependencies.serializeBinaryToWriter); + } + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getStack(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getConfigMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getConfigsecretkeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 9, + f + ); + } + f = message.getDryrun(); + if (f) { + writer.writeBool( + 10, + f + ); + } + f = message.getParallel(); + if (f !== 0) { + writer.writeInt32( + 11, + f + ); + } + f = message.getMonitorendpoint(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } + f = message.getOrganization(); + if (f.length > 0) { + writer.writeString( + 14, + f + ); + } + f = message.getAcceptsOutputValues(); + if (f) { + writer.writeBool( + 17, + f + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.repeatedFields_ = [1]; + + + +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.CallRequest.ArgumentDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CallRequest.ArgumentDependencies.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.CallRequest.ArgumentDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.CallRequest.ArgumentDependencies} + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CallRequest.ArgumentDependencies; + return proto.pulumirpc.CallRequest.ArgumentDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CallRequest.ArgumentDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CallRequest.ArgumentDependencies} + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CallRequest.ArgumentDependencies.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.CallRequest.ArgumentDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.CallRequest.ArgumentDependencies} returns this + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.CallRequest.ArgumentDependencies} returns this + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.CallRequest.ArgumentDependencies} returns this + */ +proto.pulumirpc.CallRequest.ArgumentDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + +/** + * optional string tok = 1; + * @return {string} + */ +proto.pulumirpc.CallRequest.prototype.getTok = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setTok = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct args = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CallRequest.prototype.getArgs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CallRequest} returns this +*/ +proto.pulumirpc.CallRequest.prototype.setArgs = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.clearArgs = function() { + return this.setArgs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CallRequest.prototype.hasArgs = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * map argDependencies = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.CallRequest.prototype.getArgdependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + proto.pulumirpc.CallRequest.ArgumentDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.clearArgdependenciesMap = function() { + this.getArgdependenciesMap().clear(); + return this;}; + + +/** + * optional string project = 6; + * @return {string} + */ +proto.pulumirpc.CallRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string stack = 7; + * @return {string} + */ +proto.pulumirpc.CallRequest.prototype.getStack = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setStack = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * map config = 8; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.CallRequest.prototype.getConfigMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 8, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.clearConfigMap = function() { + this.getConfigMap().clear(); + return this;}; + + +/** + * repeated string configSecretKeys = 9; + * @return {!Array} + */ +proto.pulumirpc.CallRequest.prototype.getConfigsecretkeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 9)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setConfigsecretkeysList = function(value) { + return jspb.Message.setField(this, 9, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.addConfigsecretkeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 9, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.clearConfigsecretkeysList = function() { + return this.setConfigsecretkeysList([]); +}; + + +/** + * optional bool dryRun = 10; + * @return {boolean} + */ +proto.pulumirpc.CallRequest.prototype.getDryrun = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setDryrun = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +/** + * optional int32 parallel = 11; + * @return {number} + */ +proto.pulumirpc.CallRequest.prototype.getParallel = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setParallel = function(value) { + return jspb.Message.setProto3IntField(this, 11, value); +}; + + +/** + * optional string monitorEndpoint = 12; + * @return {string} + */ +proto.pulumirpc.CallRequest.prototype.getMonitorendpoint = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setMonitorendpoint = function(value) { + return jspb.Message.setProto3StringField(this, 12, value); +}; + + +/** + * optional string organization = 14; + * @return {string} + */ +proto.pulumirpc.CallRequest.prototype.getOrganization = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 14, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setOrganization = function(value) { + return jspb.Message.setProto3StringField(this, 14, value); +}; + + +/** + * optional bool accepts_output_values = 17; + * @return {boolean} + */ +proto.pulumirpc.CallRequest.prototype.getAcceptsOutputValues = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 17, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.CallRequest} returns this + */ +proto.pulumirpc.CallRequest.prototype.setAcceptsOutputValues = function(value) { + return jspb.Message.setProto3BooleanField(this, 17, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.CallResponse.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.pulumirpc.CallResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CallResponse.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.CallResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallResponse.toObject = function(includeInstance, msg) { + var f, obj = { + pb_return: (f = msg.getReturn()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + returndependenciesMap: (f = msg.getReturndependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.CallResponse.ReturnDependencies.toObject) : [], + failuresList: jspb.Message.toObjectList(msg.getFailuresList(), + proto.pulumirpc.CheckFailure.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.pulumirpc.CallResponse} + */ +proto.pulumirpc.CallResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CallResponse; + return proto.pulumirpc.CallResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CallResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CallResponse} + */ +proto.pulumirpc.CallResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setReturn(value); + break; + case 2: + var value = msg.getReturndependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.CallResponse.ReturnDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.CallResponse.ReturnDependencies()); + }); + break; + case 3: + var value = new proto.pulumirpc.CheckFailure; + reader.readMessage(value,proto.pulumirpc.CheckFailure.deserializeBinaryFromReader); + msg.addFailures(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CallResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CallResponse.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.CallResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReturn(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getReturndependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.CallResponse.ReturnDependencies.serializeBinaryToWriter); + } + f = message.getFailuresList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.pulumirpc.CheckFailure.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.CallResponse.ReturnDependencies.repeatedFields_ = [1]; + + + +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.CallResponse.ReturnDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CallResponse.ReturnDependencies.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.CallResponse.ReturnDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallResponse.ReturnDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.CallResponse.ReturnDependencies} + */ +proto.pulumirpc.CallResponse.ReturnDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CallResponse.ReturnDependencies; + return proto.pulumirpc.CallResponse.ReturnDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CallResponse.ReturnDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CallResponse.ReturnDependencies} + */ +proto.pulumirpc.CallResponse.ReturnDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CallResponse.ReturnDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CallResponse.ReturnDependencies.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.CallResponse.ReturnDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CallResponse.ReturnDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.CallResponse.ReturnDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.CallResponse.ReturnDependencies} returns this + */ +proto.pulumirpc.CallResponse.ReturnDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.CallResponse.ReturnDependencies} returns this + */ +proto.pulumirpc.CallResponse.ReturnDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.CallResponse.ReturnDependencies} returns this + */ +proto.pulumirpc.CallResponse.ReturnDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + +/** + * optional google.protobuf.Struct return = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CallResponse.prototype.getReturn = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CallResponse} returns this +*/ +proto.pulumirpc.CallResponse.prototype.setReturn = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CallResponse} returns this + */ +proto.pulumirpc.CallResponse.prototype.clearReturn = function() { + return this.setReturn(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CallResponse.prototype.hasReturn = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * map returnDependencies = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.CallResponse.prototype.getReturndependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.pulumirpc.CallResponse.ReturnDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.CallResponse} returns this + */ +proto.pulumirpc.CallResponse.prototype.clearReturndependenciesMap = function() { + this.getReturndependenciesMap().clear(); + return this;}; + + +/** + * repeated CheckFailure failures = 3; + * @return {!Array} + */ +proto.pulumirpc.CallResponse.prototype.getFailuresList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.CheckFailure, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.CallResponse} returns this +*/ +proto.pulumirpc.CallResponse.prototype.setFailuresList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.pulumirpc.CheckFailure=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.CheckFailure} + */ +proto.pulumirpc.CallResponse.prototype.addFailures = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.pulumirpc.CheckFailure, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.CallResponse} returns this + */ +proto.pulumirpc.CallResponse.prototype.clearFailuresList = function() { + return this.setFailuresList([]); +}; + + + + + +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.CheckRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CheckRequest.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.CheckRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CheckRequest.toObject = function(includeInstance, msg) { + var f, obj = { + 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), + randomseed: msg.getRandomseed_asB64() + }; + + 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.CheckRequest} + */ +proto.pulumirpc.CheckRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CheckRequest; + return proto.pulumirpc.CheckRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CheckRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CheckRequest} + */ +proto.pulumirpc.CheckRequest.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.setUrn(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOlds(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setNews(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRandomseed(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CheckRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CheckRequest.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.CheckRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CheckRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOlds(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getNews(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getRandomseed_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, + f + ); + } +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.CheckRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CheckRequest} returns this + */ +proto.pulumirpc.CheckRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct olds = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CheckRequest.prototype.getOlds = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CheckRequest} returns this +*/ +proto.pulumirpc.CheckRequest.prototype.setOlds = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CheckRequest} returns this + */ +proto.pulumirpc.CheckRequest.prototype.clearOlds = function() { + return this.setOlds(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CheckRequest.prototype.hasOlds = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.Struct news = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CheckRequest.prototype.getNews = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CheckRequest} returns this +*/ +proto.pulumirpc.CheckRequest.prototype.setNews = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CheckRequest} returns this + */ +proto.pulumirpc.CheckRequest.prototype.clearNews = function() { + return this.setNews(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CheckRequest.prototype.hasNews = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional bytes randomSeed = 5; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.CheckRequest.prototype.getRandomseed = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * 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.setRandomseed = function(value) { + return jspb.Message.setProto3BytesField(this, 5, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.CheckResponse.repeatedFields_ = [2]; + + + +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.CheckResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CheckResponse.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.CheckResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CheckResponse.toObject = function(includeInstance, msg) { + var f, obj = { + inputs: (f = msg.getInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + failuresList: jspb.Message.toObjectList(msg.getFailuresList(), + proto.pulumirpc.CheckFailure.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.pulumirpc.CheckResponse} + */ +proto.pulumirpc.CheckResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CheckResponse; + return proto.pulumirpc.CheckResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CheckResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CheckResponse} + */ +proto.pulumirpc.CheckResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setInputs(value); + break; + case 2: + var value = new proto.pulumirpc.CheckFailure; + reader.readMessage(value,proto.pulumirpc.CheckFailure.deserializeBinaryFromReader); + msg.addFailures(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CheckResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CheckResponse.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.CheckResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CheckResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInputs(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getFailuresList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.pulumirpc.CheckFailure.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.Struct inputs = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CheckResponse.prototype.getInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CheckResponse} returns this +*/ +proto.pulumirpc.CheckResponse.prototype.setInputs = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CheckResponse} returns this + */ +proto.pulumirpc.CheckResponse.prototype.clearInputs = function() { + return this.setInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CheckResponse.prototype.hasInputs = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated CheckFailure failures = 2; + * @return {!Array} + */ +proto.pulumirpc.CheckResponse.prototype.getFailuresList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.CheckFailure, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.CheckResponse} returns this +*/ +proto.pulumirpc.CheckResponse.prototype.setFailuresList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.pulumirpc.CheckFailure=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.CheckFailure} + */ +proto.pulumirpc.CheckResponse.prototype.addFailures = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.pulumirpc.CheckFailure, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.CheckResponse} returns this + */ +proto.pulumirpc.CheckResponse.prototype.clearFailuresList = function() { + return this.setFailuresList([]); +}; + + + + + +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.CheckFailure.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CheckFailure.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.CheckFailure} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CheckFailure.toObject = function(includeInstance, msg) { + var f, obj = { + property: jspb.Message.getFieldWithDefault(msg, 1, ""), + reason: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.CheckFailure} + */ +proto.pulumirpc.CheckFailure.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CheckFailure; + return proto.pulumirpc.CheckFailure.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CheckFailure} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CheckFailure} + */ +proto.pulumirpc.CheckFailure.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.setProperty(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setReason(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CheckFailure.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CheckFailure.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.CheckFailure} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CheckFailure.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProperty(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getReason(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string property = 1; + * @return {string} + */ +proto.pulumirpc.CheckFailure.prototype.getProperty = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CheckFailure} returns this + */ +proto.pulumirpc.CheckFailure.prototype.setProperty = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string reason = 2; + * @return {string} + */ +proto.pulumirpc.CheckFailure.prototype.getReason = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CheckFailure} returns this + */ +proto.pulumirpc.CheckFailure.prototype.setReason = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.DiffRequest.repeatedFields_ = [5]; + + + +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.DiffRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.DiffRequest.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.DiffRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DiffRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + urn: jspb.Message.getFieldWithDefault(msg, 2, ""), + olds: (f = msg.getOlds()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + news: (f = msg.getNews()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + ignorechangesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + oldInputs: (f = msg.getOldInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.DiffRequest} + */ +proto.pulumirpc.DiffRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.DiffRequest; + return proto.pulumirpc.DiffRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.DiffRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.DiffRequest} + */ +proto.pulumirpc.DiffRequest.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.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUrn(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOlds(value); + break; + case 4: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setNews(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addIgnorechanges(value); + break; + case 6: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOldInputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.DiffRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.DiffRequest.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.DiffRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DiffRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getOlds(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getNews(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getIgnorechangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getOldInputs(); + if (f != null) { + writer.writeMessage( + 6, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.DiffRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string urn = 2; + * @return {string} + */ +proto.pulumirpc.DiffRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Struct olds = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.DiffRequest.prototype.getOlds = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.DiffRequest} returns this +*/ +proto.pulumirpc.DiffRequest.prototype.setOlds = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.clearOlds = function() { + return this.setOlds(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.DiffRequest.prototype.hasOlds = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.Struct news = 4; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.DiffRequest.prototype.getNews = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.DiffRequest} returns this +*/ +proto.pulumirpc.DiffRequest.prototype.setNews = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.clearNews = function() { + return this.setNews(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.DiffRequest.prototype.hasNews = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * repeated string ignoreChanges = 5; + * @return {!Array} + */ +proto.pulumirpc.DiffRequest.prototype.getIgnorechangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.setIgnorechangesList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.addIgnorechanges = 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.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.clearIgnorechangesList = function() { + return this.setIgnorechangesList([]); +}; + + +/** + * optional google.protobuf.Struct old_inputs = 6; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.DiffRequest.prototype.getOldInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 6)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.DiffRequest} returns this +*/ +proto.pulumirpc.DiffRequest.prototype.setOldInputs = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.DiffRequest} returns this + */ +proto.pulumirpc.DiffRequest.prototype.clearOldInputs = function() { + return this.setOldInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.DiffRequest.prototype.hasOldInputs = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +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.PropertyDiff.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.PropertyDiff.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.PropertyDiff} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PropertyDiff.toObject = function(includeInstance, msg) { + var f, obj = { + kind: jspb.Message.getFieldWithDefault(msg, 1, 0), + inputdiff: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + 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.PropertyDiff} + */ +proto.pulumirpc.PropertyDiff.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.PropertyDiff; + return proto.pulumirpc.PropertyDiff.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.PropertyDiff} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.PropertyDiff} + */ +proto.pulumirpc.PropertyDiff.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.pulumirpc.PropertyDiff.Kind} */ (reader.readEnum()); + msg.setKind(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setInputdiff(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.PropertyDiff.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.PropertyDiff.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.PropertyDiff} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.PropertyDiff.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKind(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getInputdiff(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pulumirpc.PropertyDiff.Kind = { + ADD: 0, + ADD_REPLACE: 1, + DELETE: 2, + DELETE_REPLACE: 3, + UPDATE: 4, + UPDATE_REPLACE: 5 +}; + +/** + * optional Kind kind = 1; + * @return {!proto.pulumirpc.PropertyDiff.Kind} + */ +proto.pulumirpc.PropertyDiff.prototype.getKind = function() { + return /** @type {!proto.pulumirpc.PropertyDiff.Kind} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.pulumirpc.PropertyDiff.Kind} value + * @return {!proto.pulumirpc.PropertyDiff} returns this + */ +proto.pulumirpc.PropertyDiff.prototype.setKind = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional bool inputDiff = 2; + * @return {boolean} + */ +proto.pulumirpc.PropertyDiff.prototype.getInputdiff = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.PropertyDiff} returns this + */ +proto.pulumirpc.PropertyDiff.prototype.setInputdiff = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.DiffResponse.repeatedFields_ = [1,2,5]; + + + +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.DiffResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.DiffResponse.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.DiffResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DiffResponse.toObject = function(includeInstance, msg) { + var f, obj = { + replacesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + stablesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + deletebeforereplace: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + changes: jspb.Message.getFieldWithDefault(msg, 4, 0), + diffsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + detaileddiffMap: (f = msg.getDetaileddiffMap()) ? f.toObject(includeInstance, proto.pulumirpc.PropertyDiff.toObject) : [], + hasdetaileddiff: jspb.Message.getBooleanFieldWithDefault(msg, 7, false) + }; + + 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.DiffResponse} + */ +proto.pulumirpc.DiffResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.DiffResponse; + return proto.pulumirpc.DiffResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.DiffResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.DiffResponse} + */ +proto.pulumirpc.DiffResponse.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.addReplaces(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addStables(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDeletebeforereplace(value); + break; + case 4: + var value = /** @type {!proto.pulumirpc.DiffResponse.DiffChanges} */ (reader.readEnum()); + msg.setChanges(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addDiffs(value); + break; + case 6: + var value = msg.getDetaileddiffMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.PropertyDiff.deserializeBinaryFromReader, "", new proto.pulumirpc.PropertyDiff()); + }); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasdetaileddiff(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.DiffResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.DiffResponse.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.DiffResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DiffResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReplacesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getStablesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getDeletebeforereplace(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getChanges(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } + f = message.getDiffsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getDetaileddiffMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.PropertyDiff.serializeBinaryToWriter); + } + f = message.getHasdetaileddiff(); + if (f) { + writer.writeBool( + 7, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.pulumirpc.DiffResponse.DiffChanges = { + DIFF_UNKNOWN: 0, + DIFF_NONE: 1, + DIFF_SOME: 2 +}; + +/** + * repeated string replaces = 1; + * @return {!Array} + */ +proto.pulumirpc.DiffResponse.prototype.getReplacesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.setReplacesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.addReplaces = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.clearReplacesList = function() { + return this.setReplacesList([]); +}; + + +/** + * repeated string stables = 2; + * @return {!Array} + */ +proto.pulumirpc.DiffResponse.prototype.getStablesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.setStablesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.addStables = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.clearStablesList = function() { + return this.setStablesList([]); +}; + + +/** + * optional bool deleteBeforeReplace = 3; + * @return {boolean} + */ +proto.pulumirpc.DiffResponse.prototype.getDeletebeforereplace = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.setDeletebeforereplace = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional DiffChanges changes = 4; + * @return {!proto.pulumirpc.DiffResponse.DiffChanges} + */ +proto.pulumirpc.DiffResponse.prototype.getChanges = function() { + return /** @type {!proto.pulumirpc.DiffResponse.DiffChanges} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.pulumirpc.DiffResponse.DiffChanges} value + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.setChanges = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); +}; + + +/** + * repeated string diffs = 5; + * @return {!Array} + */ +proto.pulumirpc.DiffResponse.prototype.getDiffsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.setDiffsList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.addDiffs = 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.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.clearDiffsList = function() { + return this.setDiffsList([]); +}; + + +/** + * map detailedDiff = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.DiffResponse.prototype.getDetaileddiffMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + proto.pulumirpc.PropertyDiff)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.clearDetaileddiffMap = function() { + this.getDetaileddiffMap().clear(); + return this;}; + + +/** + * optional bool hasDetailedDiff = 7; + * @return {boolean} + */ +proto.pulumirpc.DiffResponse.prototype.getHasdetaileddiff = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.DiffResponse} returns this + */ +proto.pulumirpc.DiffResponse.prototype.setHasdetaileddiff = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, 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.CreateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CreateRequest.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.CreateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CreateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + urn: jspb.Message.getFieldWithDefault(msg, 1, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + timeout: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), + preview: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) + }; + + 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.CreateRequest} + */ +proto.pulumirpc.CreateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CreateRequest; + return proto.pulumirpc.CreateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CreateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CreateRequest} + */ +proto.pulumirpc.CreateRequest.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.setUrn(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 3: + var value = /** @type {number} */ (reader.readDouble()); + msg.setTimeout(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setPreview(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CreateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CreateRequest.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.CreateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CreateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getTimeout(); + if (f !== 0.0) { + writer.writeDouble( + 3, + f + ); + } + f = message.getPreview(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.CreateRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CreateRequest} returns this + */ +proto.pulumirpc.CreateRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct properties = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CreateRequest.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CreateRequest} returns this +*/ +proto.pulumirpc.CreateRequest.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CreateRequest} returns this + */ +proto.pulumirpc.CreateRequest.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CreateRequest.prototype.hasProperties = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional double timeout = 3; + * @return {number} + */ +proto.pulumirpc.CreateRequest.prototype.getTimeout = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.CreateRequest} returns this + */ +proto.pulumirpc.CreateRequest.prototype.setTimeout = function(value) { + return jspb.Message.setProto3FloatField(this, 3, value); +}; + + +/** + * optional bool preview = 4; + * @return {boolean} + */ +proto.pulumirpc.CreateRequest.prototype.getPreview = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.CreateRequest} returns this + */ +proto.pulumirpc.CreateRequest.prototype.setPreview = function(value) { + return jspb.Message.setProto3BooleanField(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.CreateResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.CreateResponse.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.CreateResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CreateResponse.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.CreateResponse} + */ +proto.pulumirpc.CreateResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.CreateResponse; + return proto.pulumirpc.CreateResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.CreateResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.CreateResponse} + */ +proto.pulumirpc.CreateResponse.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.setId(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.CreateResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.CreateResponse.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.CreateResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.CreateResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.CreateResponse.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.CreateResponse} returns this + */ +proto.pulumirpc.CreateResponse.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct properties = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.CreateResponse.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.CreateResponse} returns this +*/ +proto.pulumirpc.CreateResponse.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.CreateResponse} returns this + */ +proto.pulumirpc.CreateResponse.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.CreateResponse.prototype.hasProperties = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +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.ReadRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ReadRequest.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.ReadRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + urn: jspb.Message.getFieldWithDefault(msg, 2, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + inputs: (f = msg.getInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.ReadRequest} + */ +proto.pulumirpc.ReadRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ReadRequest; + return proto.pulumirpc.ReadRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ReadRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ReadRequest} + */ +proto.pulumirpc.ReadRequest.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.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUrn(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 4: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setInputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ReadRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ReadRequest.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.ReadRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getInputs(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.ReadRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadRequest} returns this + */ +proto.pulumirpc.ReadRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string urn = 2; + * @return {string} + */ +proto.pulumirpc.ReadRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadRequest} returns this + */ +proto.pulumirpc.ReadRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Struct properties = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ReadRequest.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ReadRequest} returns this +*/ +proto.pulumirpc.ReadRequest.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadRequest} returns this + */ +proto.pulumirpc.ReadRequest.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadRequest.prototype.hasProperties = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.Struct inputs = 4; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ReadRequest.prototype.getInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ReadRequest} returns this +*/ +proto.pulumirpc.ReadRequest.prototype.setInputs = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadRequest} returns this + */ +proto.pulumirpc.ReadRequest.prototype.clearInputs = function() { + return this.setInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadRequest.prototype.hasInputs = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +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.ReadResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ReadResponse.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.ReadResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadResponse.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + inputs: (f = msg.getInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.ReadResponse} + */ +proto.pulumirpc.ReadResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ReadResponse; + return proto.pulumirpc.ReadResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ReadResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ReadResponse} + */ +proto.pulumirpc.ReadResponse.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.setId(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setInputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ReadResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ReadResponse.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.ReadResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getInputs(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.ReadResponse.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResponse} returns this + */ +proto.pulumirpc.ReadResponse.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct properties = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ReadResponse.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ReadResponse} returns this +*/ +proto.pulumirpc.ReadResponse.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadResponse} returns this + */ +proto.pulumirpc.ReadResponse.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadResponse.prototype.hasProperties = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.Struct inputs = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ReadResponse.prototype.getInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ReadResponse} returns this +*/ +proto.pulumirpc.ReadResponse.prototype.setInputs = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadResponse} returns this + */ +proto.pulumirpc.ReadResponse.prototype.clearInputs = function() { + return this.setInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadResponse.prototype.hasInputs = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.UpdateRequest.repeatedFields_ = [6]; + + + +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.UpdateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.UpdateRequest.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.UpdateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.UpdateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + urn: jspb.Message.getFieldWithDefault(msg, 2, ""), + olds: (f = msg.getOlds()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + news: (f = msg.getNews()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + timeout: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0), + ignorechangesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + preview: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + oldInputs: (f = msg.getOldInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.UpdateRequest} + */ +proto.pulumirpc.UpdateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.UpdateRequest; + return proto.pulumirpc.UpdateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.UpdateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.UpdateRequest} + */ +proto.pulumirpc.UpdateRequest.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.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUrn(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOlds(value); + break; + case 4: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setNews(value); + break; + case 5: + var value = /** @type {number} */ (reader.readDouble()); + msg.setTimeout(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.addIgnorechanges(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setPreview(value); + break; + case 8: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOldInputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.UpdateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.UpdateRequest.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.UpdateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.UpdateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getOlds(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getNews(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getTimeout(); + if (f !== 0.0) { + writer.writeDouble( + 5, + f + ); + } + f = message.getIgnorechangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 6, + f + ); + } + f = message.getPreview(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getOldInputs(); + if (f != null) { + writer.writeMessage( + 8, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.UpdateRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string urn = 2; + * @return {string} + */ +proto.pulumirpc.UpdateRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Struct olds = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.UpdateRequest.prototype.getOlds = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.UpdateRequest} returns this +*/ +proto.pulumirpc.UpdateRequest.prototype.setOlds = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.clearOlds = function() { + return this.setOlds(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.UpdateRequest.prototype.hasOlds = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.Struct news = 4; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.UpdateRequest.prototype.getNews = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.UpdateRequest} returns this +*/ +proto.pulumirpc.UpdateRequest.prototype.setNews = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.clearNews = function() { + return this.setNews(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.UpdateRequest.prototype.hasNews = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional double timeout = 5; + * @return {number} + */ +proto.pulumirpc.UpdateRequest.prototype.getTimeout = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.setTimeout = function(value) { + return jspb.Message.setProto3FloatField(this, 5, value); +}; + + +/** + * repeated string ignoreChanges = 6; + * @return {!Array} + */ +proto.pulumirpc.UpdateRequest.prototype.getIgnorechangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.setIgnorechangesList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.addIgnorechanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.clearIgnorechangesList = function() { + return this.setIgnorechangesList([]); +}; + + +/** + * optional bool preview = 7; + * @return {boolean} + */ +proto.pulumirpc.UpdateRequest.prototype.getPreview = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.setPreview = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + +/** + * optional google.protobuf.Struct old_inputs = 8; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.UpdateRequest.prototype.getOldInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 8)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.UpdateRequest} returns this +*/ +proto.pulumirpc.UpdateRequest.prototype.setOldInputs = function(value) { + return jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.UpdateRequest} returns this + */ +proto.pulumirpc.UpdateRequest.prototype.clearOldInputs = function() { + return this.setOldInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.UpdateRequest.prototype.hasOldInputs = function() { + return jspb.Message.getField(this, 8) != null; +}; + + + + + +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.UpdateResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.UpdateResponse.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.UpdateResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.UpdateResponse.toObject = function(includeInstance, msg) { + var f, obj = { + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.UpdateResponse} + */ +proto.pulumirpc.UpdateResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.UpdateResponse; + return proto.pulumirpc.UpdateResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.UpdateResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.UpdateResponse} + */ +proto.pulumirpc.UpdateResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.UpdateResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.UpdateResponse.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.UpdateResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.UpdateResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.Struct properties = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.UpdateResponse.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.UpdateResponse} returns this +*/ +proto.pulumirpc.UpdateResponse.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.UpdateResponse} returns this + */ +proto.pulumirpc.UpdateResponse.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.UpdateResponse.prototype.hasProperties = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +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.DeleteRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.DeleteRequest.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.DeleteRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DeleteRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + urn: jspb.Message.getFieldWithDefault(msg, 2, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + timeout: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), + oldInputs: (f = msg.getOldInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.DeleteRequest} + */ +proto.pulumirpc.DeleteRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.DeleteRequest; + return proto.pulumirpc.DeleteRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.DeleteRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.DeleteRequest} + */ +proto.pulumirpc.DeleteRequest.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.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUrn(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 4: + var value = /** @type {number} */ (reader.readDouble()); + msg.setTimeout(value); + break; + case 5: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOldInputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.DeleteRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.DeleteRequest.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.DeleteRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.DeleteRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getTimeout(); + if (f !== 0.0) { + writer.writeDouble( + 4, + f + ); + } + f = message.getOldInputs(); + if (f != null) { + writer.writeMessage( + 5, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.DeleteRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.DeleteRequest} returns this + */ +proto.pulumirpc.DeleteRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string urn = 2; + * @return {string} + */ +proto.pulumirpc.DeleteRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.DeleteRequest} returns this + */ +proto.pulumirpc.DeleteRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Struct properties = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.DeleteRequest.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.DeleteRequest} returns this +*/ +proto.pulumirpc.DeleteRequest.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.DeleteRequest} returns this + */ +proto.pulumirpc.DeleteRequest.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.DeleteRequest.prototype.hasProperties = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional double timeout = 4; + * @return {number} + */ +proto.pulumirpc.DeleteRequest.prototype.getTimeout = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.DeleteRequest} returns this + */ +proto.pulumirpc.DeleteRequest.prototype.setTimeout = function(value) { + return jspb.Message.setProto3FloatField(this, 4, value); +}; + + +/** + * optional google.protobuf.Struct old_inputs = 5; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.DeleteRequest.prototype.getOldInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.DeleteRequest} returns this +*/ +proto.pulumirpc.DeleteRequest.prototype.setOldInputs = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.DeleteRequest} returns this + */ +proto.pulumirpc.DeleteRequest.prototype.clearOldInputs = function() { + return this.setOldInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.DeleteRequest.prototype.hasOldInputs = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ConstructRequest.repeatedFields_ = [15,16,14,18,22,23]; + + + +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.ConstructRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConstructRequest.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.ConstructRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructRequest.toObject = function(includeInstance, msg) { + var f, obj = { + project: jspb.Message.getFieldWithDefault(msg, 1, ""), + stack: jspb.Message.getFieldWithDefault(msg, 2, ""), + configMap: (f = msg.getConfigMap()) ? f.toObject(includeInstance, undefined) : [], + dryrun: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + parallel: jspb.Message.getFieldWithDefault(msg, 5, 0), + monitorendpoint: jspb.Message.getFieldWithDefault(msg, 6, ""), + type: jspb.Message.getFieldWithDefault(msg, 7, ""), + name: jspb.Message.getFieldWithDefault(msg, 8, ""), + parent: jspb.Message.getFieldWithDefault(msg, 9, ""), + inputs: (f = msg.getInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + inputdependenciesMap: (f = msg.getInputdependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.ConstructRequest.PropertyDependencies.toObject) : [], + providersMap: (f = msg.getProvidersMap()) ? f.toObject(includeInstance, undefined) : [], + dependenciesList: (f = jspb.Message.getRepeatedField(msg, 15)) == null ? undefined : f, + configsecretkeysList: (f = jspb.Message.getRepeatedField(msg, 16)) == null ? undefined : f, + organization: jspb.Message.getFieldWithDefault(msg, 17, ""), + protect: jspb.Message.getBooleanFieldWithDefault(msg, 12, false), + aliasesList: (f = jspb.Message.getRepeatedField(msg, 14)) == null ? undefined : f, + additionalsecretoutputsList: (f = jspb.Message.getRepeatedField(msg, 18)) == null ? undefined : f, + customtimeouts: (f = msg.getCustomtimeouts()) && proto.pulumirpc.ConstructRequest.CustomTimeouts.toObject(includeInstance, f), + deletedwith: jspb.Message.getFieldWithDefault(msg, 20, ""), + deletebeforereplace: jspb.Message.getBooleanFieldWithDefault(msg, 21, false), + ignorechangesList: (f = jspb.Message.getRepeatedField(msg, 22)) == null ? undefined : f, + replaceonchangesList: (f = jspb.Message.getRepeatedField(msg, 23)) == null ? undefined : f, + retainondelete: jspb.Message.getBooleanFieldWithDefault(msg, 24, false), + acceptsOutputValues: jspb.Message.getBooleanFieldWithDefault(msg, 25, false) + }; + + 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.ConstructRequest} + */ +proto.pulumirpc.ConstructRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConstructRequest; + return proto.pulumirpc.ConstructRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConstructRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConstructRequest} + */ +proto.pulumirpc.ConstructRequest.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.setProject(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setStack(value); + break; + case 3: + 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 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDryrun(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt32()); + msg.setParallel(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setMonitorendpoint(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setParent(value); + break; + case 10: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setInputs(value); + break; + case 11: + var value = msg.getInputdependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.ConstructRequest.PropertyDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.ConstructRequest.PropertyDependencies()); + }); + break; + case 13: + var value = msg.getProvidersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 15: + var value = /** @type {string} */ (reader.readString()); + msg.addDependencies(value); + break; + case 16: + var value = /** @type {string} */ (reader.readString()); + msg.addConfigsecretkeys(value); + break; + case 17: + var value = /** @type {string} */ (reader.readString()); + msg.setOrganization(value); + break; + case 12: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProtect(value); + break; + case 14: + var value = /** @type {string} */ (reader.readString()); + msg.addAliases(value); + break; + case 18: + var value = /** @type {string} */ (reader.readString()); + msg.addAdditionalsecretoutputs(value); + break; + case 19: + var value = new proto.pulumirpc.ConstructRequest.CustomTimeouts; + reader.readMessage(value,proto.pulumirpc.ConstructRequest.CustomTimeouts.deserializeBinaryFromReader); + msg.setCustomtimeouts(value); + break; + case 20: + var value = /** @type {string} */ (reader.readString()); + msg.setDeletedwith(value); + break; + case 21: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDeletebeforereplace(value); + break; + case 22: + var value = /** @type {string} */ (reader.readString()); + msg.addIgnorechanges(value); + break; + case 23: + var value = /** @type {string} */ (reader.readString()); + msg.addReplaceonchanges(value); + break; + case 24: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRetainondelete(value); + break; + case 25: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptsOutputValues(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConstructRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConstructRequest.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.ConstructRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProject(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStack(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getConfigMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getDryrun(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getParallel(); + if (f !== 0) { + writer.writeInt32( + 5, + f + ); + } + f = message.getMonitorendpoint(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getParent(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getInputs(); + if (f != null) { + writer.writeMessage( + 10, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getInputdependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.ConstructRequest.PropertyDependencies.serializeBinaryToWriter); + } + f = message.getProvidersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(13, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getDependenciesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 15, + f + ); + } + f = message.getConfigsecretkeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 16, + f + ); + } + f = message.getOrganization(); + if (f.length > 0) { + writer.writeString( + 17, + f + ); + } + f = message.getProtect(); + if (f) { + writer.writeBool( + 12, + f + ); + } + f = message.getAliasesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 14, + f + ); + } + f = message.getAdditionalsecretoutputsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 18, + f + ); + } + f = message.getCustomtimeouts(); + if (f != null) { + writer.writeMessage( + 19, + f, + proto.pulumirpc.ConstructRequest.CustomTimeouts.serializeBinaryToWriter + ); + } + f = message.getDeletedwith(); + if (f.length > 0) { + writer.writeString( + 20, + f + ); + } + f = message.getDeletebeforereplace(); + if (f) { + writer.writeBool( + 21, + f + ); + } + f = message.getIgnorechangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 22, + f + ); + } + f = message.getReplaceonchangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 23, + f + ); + } + f = message.getRetainondelete(); + if (f) { + writer.writeBool( + 24, + f + ); + } + f = message.getAcceptsOutputValues(); + if (f) { + writer.writeBool( + 25, + f + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.repeatedFields_ = [1]; + + + +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.ConstructRequest.PropertyDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConstructRequest.PropertyDependencies.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.ConstructRequest.PropertyDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.ConstructRequest.PropertyDependencies} + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConstructRequest.PropertyDependencies; + return proto.pulumirpc.ConstructRequest.PropertyDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConstructRequest.PropertyDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConstructRequest.PropertyDependencies} + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConstructRequest.PropertyDependencies.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.ConstructRequest.PropertyDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest.PropertyDependencies} returns this + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest.PropertyDependencies} returns this + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest.PropertyDependencies} returns this + */ +proto.pulumirpc.ConstructRequest.PropertyDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + + + + +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.ConstructRequest.CustomTimeouts.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConstructRequest.CustomTimeouts.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.ConstructRequest.CustomTimeouts} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.toObject = function(includeInstance, msg) { + var f, obj = { + create: jspb.Message.getFieldWithDefault(msg, 1, ""), + update: jspb.Message.getFieldWithDefault(msg, 2, ""), + pb_delete: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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.ConstructRequest.CustomTimeouts} + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConstructRequest.CustomTimeouts; + return proto.pulumirpc.ConstructRequest.CustomTimeouts.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConstructRequest.CustomTimeouts} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConstructRequest.CustomTimeouts} + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.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.setCreate(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUpdate(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDelete(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConstructRequest.CustomTimeouts.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.ConstructRequest.CustomTimeouts} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCreate(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUpdate(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDelete(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string create = 1; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.getCreate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest.CustomTimeouts} returns this + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.setCreate = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string update = 2; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.getUpdate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest.CustomTimeouts} returns this + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.setUpdate = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string delete = 3; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.getDelete = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest.CustomTimeouts} returns this + */ +proto.pulumirpc.ConstructRequest.CustomTimeouts.prototype.setDelete = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string project = 1; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getProject = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setProject = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string stack = 2; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getStack = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setStack = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map config = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ConstructRequest.prototype.getConfigMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearConfigMap = function() { + this.getConfigMap().clear(); + return this;}; + + +/** + * optional bool dryRun = 4; + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.getDryrun = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setDryrun = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional int32 parallel = 5; + * @return {number} + */ +proto.pulumirpc.ConstructRequest.prototype.getParallel = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setParallel = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional string monitorEndpoint = 6; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getMonitorendpoint = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setMonitorendpoint = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string type = 7; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string name = 8; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional string parent = 9; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getParent = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setParent = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional google.protobuf.Struct inputs = 10; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ConstructRequest.prototype.getInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 10)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ConstructRequest} returns this +*/ +proto.pulumirpc.ConstructRequest.prototype.setInputs = function(value) { + return jspb.Message.setWrapperField(this, 10, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearInputs = function() { + return this.setInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.hasInputs = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * map inputDependencies = 11; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ConstructRequest.prototype.getInputdependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 11, opt_noLazyCreate, + proto.pulumirpc.ConstructRequest.PropertyDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearInputdependenciesMap = function() { + this.getInputdependenciesMap().clear(); + return this;}; + + +/** + * map providers = 13; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ConstructRequest.prototype.getProvidersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 13, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearProvidersMap = function() { + this.getProvidersMap().clear(); + return this;}; + + +/** + * repeated string dependencies = 15; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.prototype.getDependenciesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 15)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setDependenciesList = function(value) { + return jspb.Message.setField(this, 15, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.addDependencies = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 15, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearDependenciesList = function() { + return this.setDependenciesList([]); +}; + + +/** + * repeated string configSecretKeys = 16; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.prototype.getConfigsecretkeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 16)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setConfigsecretkeysList = function(value) { + return jspb.Message.setField(this, 16, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.addConfigsecretkeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 16, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearConfigsecretkeysList = function() { + return this.setConfigsecretkeysList([]); +}; + + +/** + * optional string organization = 17; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getOrganization = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 17, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setOrganization = function(value) { + return jspb.Message.setProto3StringField(this, 17, value); +}; + + +/** + * optional bool protect = 12; + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.getProtect = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setProtect = function(value) { + return jspb.Message.setProto3BooleanField(this, 12, value); +}; + + +/** + * repeated string aliases = 14; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.prototype.getAliasesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 14)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setAliasesList = function(value) { + return jspb.Message.setField(this, 14, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.addAliases = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 14, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearAliasesList = function() { + return this.setAliasesList([]); +}; + + +/** + * repeated string additionalSecretOutputs = 18; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.prototype.getAdditionalsecretoutputsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 18)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setAdditionalsecretoutputsList = function(value) { + return jspb.Message.setField(this, 18, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.addAdditionalsecretoutputs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 18, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearAdditionalsecretoutputsList = function() { + return this.setAdditionalsecretoutputsList([]); +}; + + +/** + * optional CustomTimeouts customTimeouts = 19; + * @return {?proto.pulumirpc.ConstructRequest.CustomTimeouts} + */ +proto.pulumirpc.ConstructRequest.prototype.getCustomtimeouts = function() { + return /** @type{?proto.pulumirpc.ConstructRequest.CustomTimeouts} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ConstructRequest.CustomTimeouts, 19)); +}; + + +/** + * @param {?proto.pulumirpc.ConstructRequest.CustomTimeouts|undefined} value + * @return {!proto.pulumirpc.ConstructRequest} returns this +*/ +proto.pulumirpc.ConstructRequest.prototype.setCustomtimeouts = function(value) { + return jspb.Message.setWrapperField(this, 19, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearCustomtimeouts = function() { + return this.setCustomtimeouts(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.hasCustomtimeouts = function() { + return jspb.Message.getField(this, 19) != null; +}; + + +/** + * optional string deletedWith = 20; + * @return {string} + */ +proto.pulumirpc.ConstructRequest.prototype.getDeletedwith = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 20, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setDeletedwith = function(value) { + return jspb.Message.setProto3StringField(this, 20, value); +}; + + +/** + * optional bool deleteBeforeReplace = 21; + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.getDeletebeforereplace = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 21, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setDeletebeforereplace = function(value) { + return jspb.Message.setProto3BooleanField(this, 21, value); +}; + + +/** + * repeated string ignoreChanges = 22; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.prototype.getIgnorechangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 22)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setIgnorechangesList = function(value) { + return jspb.Message.setField(this, 22, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.addIgnorechanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 22, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearIgnorechangesList = function() { + return this.setIgnorechangesList([]); +}; + + +/** + * repeated string replaceOnChanges = 23; + * @return {!Array} + */ +proto.pulumirpc.ConstructRequest.prototype.getReplaceonchangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 23)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setReplaceonchangesList = function(value) { + return jspb.Message.setField(this, 23, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.addReplaceonchanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 23, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.clearReplaceonchangesList = function() { + return this.setReplaceonchangesList([]); +}; + + +/** + * optional bool retainOnDelete = 24; + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.getRetainondelete = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 24, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setRetainondelete = function(value) { + return jspb.Message.setProto3BooleanField(this, 24, value); +}; + + +/** + * optional bool accepts_output_values = 25; + * @return {boolean} + */ +proto.pulumirpc.ConstructRequest.prototype.getAcceptsOutputValues = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 25, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ConstructRequest} returns this + */ +proto.pulumirpc.ConstructRequest.prototype.setAcceptsOutputValues = function(value) { + return jspb.Message.setProto3BooleanField(this, 25, 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.ConstructResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConstructResponse.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.ConstructResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructResponse.toObject = function(includeInstance, msg) { + var f, obj = { + urn: jspb.Message.getFieldWithDefault(msg, 1, ""), + state: (f = msg.getState()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + statedependenciesMap: (f = msg.getStatedependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.ConstructResponse.PropertyDependencies.toObject) : [] + }; + + 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.ConstructResponse} + */ +proto.pulumirpc.ConstructResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConstructResponse; + return proto.pulumirpc.ConstructResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConstructResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConstructResponse} + */ +proto.pulumirpc.ConstructResponse.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.setUrn(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setState(value); + break; + case 3: + var value = msg.getStatedependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.ConstructResponse.PropertyDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.ConstructResponse.PropertyDependencies()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConstructResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConstructResponse.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.ConstructResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getState(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getStatedependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.ConstructResponse.PropertyDependencies.serializeBinaryToWriter); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.repeatedFields_ = [1]; + + + +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.ConstructResponse.PropertyDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ConstructResponse.PropertyDependencies.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.ConstructResponse.PropertyDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.ConstructResponse.PropertyDependencies} + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ConstructResponse.PropertyDependencies; + return proto.pulumirpc.ConstructResponse.PropertyDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ConstructResponse.PropertyDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ConstructResponse.PropertyDependencies} + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ConstructResponse.PropertyDependencies.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.ConstructResponse.PropertyDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ConstructResponse.PropertyDependencies} returns this + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ConstructResponse.PropertyDependencies} returns this + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ConstructResponse.PropertyDependencies} returns this + */ +proto.pulumirpc.ConstructResponse.PropertyDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.ConstructResponse.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ConstructResponse} returns this + */ +proto.pulumirpc.ConstructResponse.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct state = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ConstructResponse.prototype.getState = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ConstructResponse} returns this +*/ +proto.pulumirpc.ConstructResponse.prototype.setState = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ConstructResponse} returns this + */ +proto.pulumirpc.ConstructResponse.prototype.clearState = function() { + return this.setState(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ConstructResponse.prototype.hasState = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * map stateDependencies = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ConstructResponse.prototype.getStatedependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + proto.pulumirpc.ConstructResponse.PropertyDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ConstructResponse} returns this + */ +proto.pulumirpc.ConstructResponse.prototype.clearStatedependenciesMap = function() { + this.getStatedependenciesMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ErrorResourceInitFailed.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.pulumirpc.ErrorResourceInitFailed.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ErrorResourceInitFailed.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.ErrorResourceInitFailed} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ErrorResourceInitFailed.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + reasonsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + inputs: (f = msg.getInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.ErrorResourceInitFailed} + */ +proto.pulumirpc.ErrorResourceInitFailed.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ErrorResourceInitFailed; + return proto.pulumirpc.ErrorResourceInitFailed.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ErrorResourceInitFailed} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ErrorResourceInitFailed} + */ +proto.pulumirpc.ErrorResourceInitFailed.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.setId(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addReasons(value); + break; + case 4: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setInputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ErrorResourceInitFailed.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.ErrorResourceInitFailed} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ErrorResourceInitFailed.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getReasonsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getInputs(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct properties = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this +*/ +proto.pulumirpc.ErrorResourceInitFailed.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.hasProperties = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated string reasons = 3; + * @return {!Array} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.getReasonsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.setReasonsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.addReasons = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.clearReasonsList = function() { + return this.setReasonsList([]); +}; + + +/** + * optional google.protobuf.Struct inputs = 4; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.getInputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this +*/ +proto.pulumirpc.ErrorResourceInitFailed.prototype.setInputs = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ErrorResourceInitFailed} returns this + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.clearInputs = function() { + return this.setInputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ErrorResourceInitFailed.prototype.hasInputs = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +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.GetMappingRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetMappingRequest.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.GetMappingRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingRequest.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + provider: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + 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.GetMappingRequest} + */ +proto.pulumirpc.GetMappingRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetMappingRequest; + return proto.pulumirpc.GetMappingRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetMappingRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetMappingRequest} + */ +proto.pulumirpc.GetMappingRequest.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.setKey(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setProvider(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetMappingRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetMappingRequest.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.GetMappingRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.pulumirpc.GetMappingRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetMappingRequest} returns this + */ +proto.pulumirpc.GetMappingRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string provider = 2; + * @return {string} + */ +proto.pulumirpc.GetMappingRequest.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetMappingRequest} returns this + */ +proto.pulumirpc.GetMappingRequest.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 2, 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.GetMappingResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetMappingResponse.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.GetMappingResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingResponse.toObject = function(includeInstance, msg) { + var f, obj = { + provider: jspb.Message.getFieldWithDefault(msg, 1, ""), + data: msg.getData_asB64() + }; + + 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.GetMappingResponse} + */ +proto.pulumirpc.GetMappingResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetMappingResponse; + return proto.pulumirpc.GetMappingResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetMappingResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetMappingResponse} + */ +proto.pulumirpc.GetMappingResponse.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.setProvider(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetMappingResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetMappingResponse.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.GetMappingResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional string provider = 1; + * @return {string} + */ +proto.pulumirpc.GetMappingResponse.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetMappingResponse} returns this + */ +proto.pulumirpc.GetMappingResponse.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.pulumirpc.GetMappingResponse.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.pulumirpc.GetMappingResponse.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.pulumirpc.GetMappingResponse.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.pulumirpc.GetMappingResponse} returns this + */ +proto.pulumirpc.GetMappingResponse.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, 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.GetMappingsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetMappingsRequest.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.GetMappingsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + key: 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.GetMappingsRequest} + */ +proto.pulumirpc.GetMappingsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetMappingsRequest; + return proto.pulumirpc.GetMappingsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetMappingsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetMappingsRequest} + */ +proto.pulumirpc.GetMappingsRequest.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.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetMappingsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetMappingsRequest.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.GetMappingsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.pulumirpc.GetMappingsRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.GetMappingsRequest} returns this + */ +proto.pulumirpc.GetMappingsRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.GetMappingsResponse.repeatedFields_ = [1]; + + + +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.GetMappingsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.GetMappingsResponse.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.GetMappingsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + providersList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.GetMappingsResponse} + */ +proto.pulumirpc.GetMappingsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.GetMappingsResponse; + return proto.pulumirpc.GetMappingsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.GetMappingsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.GetMappingsResponse} + */ +proto.pulumirpc.GetMappingsResponse.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.addProviders(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.GetMappingsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.GetMappingsResponse.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.GetMappingsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.GetMappingsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProvidersList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string providers = 1; + * @return {!Array} + */ +proto.pulumirpc.GetMappingsResponse.prototype.getProvidersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.GetMappingsResponse} returns this + */ +proto.pulumirpc.GetMappingsResponse.prototype.setProvidersList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.GetMappingsResponse} returns this + */ +proto.pulumirpc.GetMappingsResponse.prototype.addProviders = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.GetMappingsResponse} returns this + */ +proto.pulumirpc.GetMappingsResponse.prototype.clearProvidersList = function() { + return this.setProvidersList([]); +}; + + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 25815: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// 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. +// 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_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_alias_pb = __nccwpck_require__(36489); +var pulumi_source_pb = __nccwpck_require__(32093); +var pulumi_callback_pb = __nccwpck_require__(89619); + +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_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_Callback(arg) { + if (!(arg instanceof pulumi_callback_pb.Callback)) { + throw new Error('Expected argument of type pulumirpc.Callback'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_Callback(buffer_arg) { + return pulumi_callback_pb.Callback.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_ReadResourceRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.ReadResourceRequest)) { + throw new Error('Expected argument of type pulumirpc.ReadResourceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_ReadResourceRequest(buffer_arg) { + return pulumi_resource_pb.ReadResourceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_ReadResourceResponse(arg) { + if (!(arg instanceof pulumi_resource_pb.ReadResourceResponse)) { + throw new Error('Expected argument of type pulumirpc.ReadResourceResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_ReadResourceResponse(buffer_arg) { + return pulumi_resource_pb.ReadResourceResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RegisterProviderRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.RegisterProviderRequest)) { + throw new Error('Expected argument of type pulumirpc.RegisterProviderRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RegisterProviderRequest(buffer_arg) { + return pulumi_resource_pb.RegisterProviderRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RegisterProviderResponse(arg) { + if (!(arg instanceof pulumi_resource_pb.RegisterProviderResponse)) { + throw new Error('Expected argument of type pulumirpc.RegisterProviderResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RegisterProviderResponse(buffer_arg) { + return pulumi_resource_pb.RegisterProviderResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RegisterResourceOutputsRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.RegisterResourceOutputsRequest)) { + throw new Error('Expected argument of type pulumirpc.RegisterResourceOutputsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RegisterResourceOutputsRequest(buffer_arg) { + return pulumi_resource_pb.RegisterResourceOutputsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RegisterResourceRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.RegisterResourceRequest)) { + throw new Error('Expected argument of type pulumirpc.RegisterResourceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RegisterResourceRequest(buffer_arg) { + return pulumi_resource_pb.RegisterResourceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_RegisterResourceResponse(arg) { + if (!(arg instanceof pulumi_resource_pb.RegisterResourceResponse)) { + throw new Error('Expected argument of type pulumirpc.RegisterResourceResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_RegisterResourceResponse(buffer_arg) { + return pulumi_resource_pb.RegisterResourceResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_ResourceCallRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.ResourceCallRequest)) { + throw new Error('Expected argument of type pulumirpc.ResourceCallRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_ResourceCallRequest(buffer_arg) { + return pulumi_resource_pb.ResourceCallRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_ResourceInvokeRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.ResourceInvokeRequest)) { + throw new Error('Expected argument of type pulumirpc.ResourceInvokeRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_ResourceInvokeRequest(buffer_arg) { + return pulumi_resource_pb.ResourceInvokeRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_SupportsFeatureRequest(arg) { + if (!(arg instanceof pulumi_resource_pb.SupportsFeatureRequest)) { + throw new Error('Expected argument of type pulumirpc.SupportsFeatureRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_SupportsFeatureRequest(buffer_arg) { + return pulumi_resource_pb.SupportsFeatureRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pulumirpc_SupportsFeatureResponse(arg) { + if (!(arg instanceof pulumi_resource_pb.SupportsFeatureResponse)) { + throw new Error('Expected argument of type pulumirpc.SupportsFeatureResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pulumirpc_SupportsFeatureResponse(buffer_arg) { + return pulumi_resource_pb.SupportsFeatureResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// ResourceMonitor is the interface a source uses to talk back to the planning monitor orchestrating the execution. +var ResourceMonitorService = exports.ResourceMonitorService = { + supportsFeature: { + path: '/pulumirpc.ResourceMonitor/SupportsFeature', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.SupportsFeatureRequest, + responseType: pulumi_resource_pb.SupportsFeatureResponse, + requestSerialize: serialize_pulumirpc_SupportsFeatureRequest, + requestDeserialize: deserialize_pulumirpc_SupportsFeatureRequest, + responseSerialize: serialize_pulumirpc_SupportsFeatureResponse, + responseDeserialize: deserialize_pulumirpc_SupportsFeatureResponse, + }, + invoke: { + path: '/pulumirpc.ResourceMonitor/Invoke', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.ResourceInvokeRequest, + responseType: pulumi_provider_pb.InvokeResponse, + requestSerialize: serialize_pulumirpc_ResourceInvokeRequest, + requestDeserialize: deserialize_pulumirpc_ResourceInvokeRequest, + responseSerialize: serialize_pulumirpc_InvokeResponse, + responseDeserialize: deserialize_pulumirpc_InvokeResponse, + }, + streamInvoke: { + path: '/pulumirpc.ResourceMonitor/StreamInvoke', + requestStream: false, + responseStream: true, + requestType: pulumi_resource_pb.ResourceInvokeRequest, + responseType: pulumi_provider_pb.InvokeResponse, + requestSerialize: serialize_pulumirpc_ResourceInvokeRequest, + requestDeserialize: deserialize_pulumirpc_ResourceInvokeRequest, + responseSerialize: serialize_pulumirpc_InvokeResponse, + responseDeserialize: deserialize_pulumirpc_InvokeResponse, + }, + call: { + path: '/pulumirpc.ResourceMonitor/Call', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.ResourceCallRequest, + responseType: pulumi_provider_pb.CallResponse, + requestSerialize: serialize_pulumirpc_ResourceCallRequest, + requestDeserialize: deserialize_pulumirpc_ResourceCallRequest, + responseSerialize: serialize_pulumirpc_CallResponse, + responseDeserialize: deserialize_pulumirpc_CallResponse, + }, + readResource: { + path: '/pulumirpc.ResourceMonitor/ReadResource', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.ReadResourceRequest, + responseType: pulumi_resource_pb.ReadResourceResponse, + requestSerialize: serialize_pulumirpc_ReadResourceRequest, + requestDeserialize: deserialize_pulumirpc_ReadResourceRequest, + responseSerialize: serialize_pulumirpc_ReadResourceResponse, + responseDeserialize: deserialize_pulumirpc_ReadResourceResponse, + }, + registerResource: { + path: '/pulumirpc.ResourceMonitor/RegisterResource', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.RegisterResourceRequest, + responseType: pulumi_resource_pb.RegisterResourceResponse, + requestSerialize: serialize_pulumirpc_RegisterResourceRequest, + requestDeserialize: deserialize_pulumirpc_RegisterResourceRequest, + responseSerialize: serialize_pulumirpc_RegisterResourceResponse, + responseDeserialize: deserialize_pulumirpc_RegisterResourceResponse, + }, + registerResourceOutputs: { + path: '/pulumirpc.ResourceMonitor/RegisterResourceOutputs', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.RegisterResourceOutputsRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_pulumirpc_RegisterResourceOutputsRequest, + requestDeserialize: deserialize_pulumirpc_RegisterResourceOutputsRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + registerStackTransform: { + path: '/pulumirpc.ResourceMonitor/RegisterStackTransform', + requestStream: false, + responseStream: false, + requestType: pulumi_callback_pb.Callback, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_pulumirpc_Callback, + requestDeserialize: deserialize_pulumirpc_Callback, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + registerProvider: { + path: '/pulumirpc.ResourceMonitor/RegisterProvider', + requestStream: false, + responseStream: false, + requestType: pulumi_resource_pb.RegisterProviderRequest, + responseType: pulumi_resource_pb.RegisterProviderResponse, + requestSerialize: serialize_pulumirpc_RegisterProviderRequest, + requestDeserialize: deserialize_pulumirpc_RegisterProviderRequest, + responseSerialize: serialize_pulumirpc_RegisterProviderResponse, + responseDeserialize: deserialize_pulumirpc_RegisterProviderResponse, + }, +}; + +exports.ResourceMonitorClient = grpc.makeGenericClientConstructor(ResourceMonitorService); + + +/***/ }), + +/***/ 52480: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/resource.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +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); +var pulumi_provider_pb = __nccwpck_require__(68870); +goog.object.extend(proto, pulumi_provider_pb); +var pulumi_alias_pb = __nccwpck_require__(36489); +goog.object.extend(proto, pulumi_alias_pb); +var pulumi_source_pb = __nccwpck_require__(32093); +goog.object.extend(proto, pulumi_source_pb); +var pulumi_callback_pb = __nccwpck_require__(89619); +goog.object.extend(proto, pulumi_callback_pb); +goog.exportSymbol('proto.pulumirpc.ProviderParameter', null, global); +goog.exportSymbol('proto.pulumirpc.ReadResourceRequest', null, global); +goog.exportSymbol('proto.pulumirpc.ReadResourceResponse', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterProviderRequest', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterProviderResponse', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterResourceOutputsRequest', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterResourceRequest', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterResourceRequest.CustomTimeouts', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterResourceRequest.PropertyDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterResourceResponse', null, global); +goog.exportSymbol('proto.pulumirpc.RegisterResourceResponse.PropertyDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.ResourceCallRequest', null, global); +goog.exportSymbol('proto.pulumirpc.ResourceCallRequest.ArgumentDependencies', null, global); +goog.exportSymbol('proto.pulumirpc.ResourceInvokeRequest', null, global); +goog.exportSymbol('proto.pulumirpc.Result', null, global); +goog.exportSymbol('proto.pulumirpc.SupportsFeatureRequest', null, global); +goog.exportSymbol('proto.pulumirpc.SupportsFeatureResponse', null, global); +goog.exportSymbol('proto.pulumirpc.TransformRequest', null, global); +goog.exportSymbol('proto.pulumirpc.TransformResourceOptions', null, global); +goog.exportSymbol('proto.pulumirpc.TransformResponse', 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.SupportsFeatureRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.SupportsFeatureRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.SupportsFeatureRequest.displayName = 'proto.pulumirpc.SupportsFeatureRequest'; +} +/** + * 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.SupportsFeatureResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.SupportsFeatureResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.SupportsFeatureResponse.displayName = 'proto.pulumirpc.SupportsFeatureResponse'; +} +/** + * 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.ReadResourceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ReadResourceRequest.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ReadResourceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ReadResourceRequest.displayName = 'proto.pulumirpc.ReadResourceRequest'; +} +/** + * 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.ReadResourceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ReadResourceResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ReadResourceResponse.displayName = 'proto.pulumirpc.ReadResourceResponse'; +} +/** + * 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.RegisterResourceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RegisterResourceRequest.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.RegisterResourceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterResourceRequest.displayName = 'proto.pulumirpc.RegisterResourceRequest'; +} +/** + * 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.RegisterResourceRequest.PropertyDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.RegisterResourceRequest.PropertyDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.displayName = 'proto.pulumirpc.RegisterResourceRequest.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.RegisterResourceRequest.CustomTimeouts = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.RegisterResourceRequest.CustomTimeouts, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.displayName = 'proto.pulumirpc.RegisterResourceRequest.CustomTimeouts'; +} +/** + * 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.RegisterResourceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RegisterResourceResponse.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.RegisterResourceResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterResourceResponse.displayName = 'proto.pulumirpc.RegisterResourceResponse'; +} +/** + * 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.RegisterResourceResponse.PropertyDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.RegisterResourceResponse.PropertyDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.displayName = 'proto.pulumirpc.RegisterResourceResponse.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.RegisterResourceOutputsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.RegisterResourceOutputsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterResourceOutputsRequest.displayName = 'proto.pulumirpc.RegisterResourceOutputsRequest'; +} +/** + * 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.ResourceInvokeRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ResourceInvokeRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ResourceInvokeRequest.displayName = 'proto.pulumirpc.ResourceInvokeRequest'; +} +/** + * 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.ResourceCallRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ResourceCallRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ResourceCallRequest.displayName = 'proto.pulumirpc.ResourceCallRequest'; +} +/** + * 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.ResourceCallRequest.ArgumentDependencies = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.ResourceCallRequest.ArgumentDependencies, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.displayName = 'proto.pulumirpc.ResourceCallRequest.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 + */ +proto.pulumirpc.TransformResourceOptions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.TransformResourceOptions.repeatedFields_, null); +}; +goog.inherits(proto.pulumirpc.TransformResourceOptions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.TransformResourceOptions.displayName = 'proto.pulumirpc.TransformResourceOptions'; +} +/** + * 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.TransformRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.TransformRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.TransformRequest.displayName = 'proto.pulumirpc.TransformRequest'; +} +/** + * 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.TransformResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.TransformResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.TransformResponse.displayName = 'proto.pulumirpc.TransformResponse'; +} +/** + * 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.RegisterProviderRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.RegisterProviderRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterProviderRequest.displayName = 'proto.pulumirpc.RegisterProviderRequest'; +} +/** + * 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.RegisterProviderResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.RegisterProviderResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.RegisterProviderResponse.displayName = 'proto.pulumirpc.RegisterProviderResponse'; +} +/** + * 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.ProviderParameter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.ProviderParameter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.ProviderParameter.displayName = 'proto.pulumirpc.ProviderParameter'; +} + + + +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.SupportsFeatureRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.SupportsFeatureRequest.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.SupportsFeatureRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SupportsFeatureRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: 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.SupportsFeatureRequest} + */ +proto.pulumirpc.SupportsFeatureRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.SupportsFeatureRequest; + return proto.pulumirpc.SupportsFeatureRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.SupportsFeatureRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.SupportsFeatureRequest} + */ +proto.pulumirpc.SupportsFeatureRequest.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.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.SupportsFeatureRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.SupportsFeatureRequest.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.SupportsFeatureRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SupportsFeatureRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.SupportsFeatureRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.SupportsFeatureRequest} returns this + */ +proto.pulumirpc.SupportsFeatureRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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.SupportsFeatureResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.SupportsFeatureResponse.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.SupportsFeatureResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SupportsFeatureResponse.toObject = function(includeInstance, msg) { + var f, obj = { + hassupport: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) + }; + + 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.SupportsFeatureResponse} + */ +proto.pulumirpc.SupportsFeatureResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.SupportsFeatureResponse; + return proto.pulumirpc.SupportsFeatureResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.SupportsFeatureResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.SupportsFeatureResponse} + */ +proto.pulumirpc.SupportsFeatureResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHassupport(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.SupportsFeatureResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.SupportsFeatureResponse.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.SupportsFeatureResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SupportsFeatureResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHassupport(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool hasSupport = 1; + * @return {boolean} + */ +proto.pulumirpc.SupportsFeatureResponse.prototype.getHassupport = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.SupportsFeatureResponse} returns this + */ +proto.pulumirpc.SupportsFeatureResponse.prototype.setHassupport = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ReadResourceRequest.repeatedFields_ = [6,10]; + + + +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.ReadResourceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ReadResourceRequest.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.ReadResourceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadResourceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, ""), + name: jspb.Message.getFieldWithDefault(msg, 3, ""), + parent: jspb.Message.getFieldWithDefault(msg, 4, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + dependenciesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + provider: jspb.Message.getFieldWithDefault(msg, 7, ""), + version: jspb.Message.getFieldWithDefault(msg, 8, ""), + acceptsecrets: jspb.Message.getBooleanFieldWithDefault(msg, 9, false), + additionalsecretoutputsList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, + acceptresources: jspb.Message.getBooleanFieldWithDefault(msg, 12, false), + plugindownloadurl: jspb.Message.getFieldWithDefault(msg, 13, ""), + pluginchecksumsMap: (f = msg.getPluginchecksumsMap()) ? f.toObject(includeInstance, undefined) : [], + sourceposition: (f = msg.getSourceposition()) && pulumi_source_pb.SourcePosition.toObject(includeInstance, f) + }; + + 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.ReadResourceRequest} + */ +proto.pulumirpc.ReadResourceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ReadResourceRequest; + return proto.pulumirpc.ReadResourceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ReadResourceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ReadResourceRequest} + */ +proto.pulumirpc.ReadResourceRequest.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.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setParent(value); + break; + case 5: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.addDependencies(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setProvider(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptsecrets(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.addAdditionalsecretoutputs(value); + break; + case 12: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptresources(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setPlugindownloadurl(value); + break; + case 15: + var value = msg.getPluginchecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 14: + var value = new pulumi_source_pb.SourcePosition; + reader.readMessage(value,pulumi_source_pb.SourcePosition.deserializeBinaryFromReader); + msg.setSourceposition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ReadResourceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ReadResourceRequest.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.ReadResourceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadResourceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getParent(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 5, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getDependenciesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 6, + f + ); + } + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getAcceptsecrets(); + if (f) { + writer.writeBool( + 9, + f + ); + } + f = message.getAdditionalsecretoutputsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 10, + f + ); + } + f = message.getAcceptresources(); + if (f) { + writer.writeBool( + 12, + f + ); + } + f = message.getPlugindownloadurl(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } + f = message.getPluginchecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getSourceposition(); + if (f != null) { + writer.writeMessage( + 14, + f, + pulumi_source_pb.SourcePosition.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string type = 2; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string name = 3; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string parent = 4; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getParent = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setParent = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional google.protobuf.Struct properties = 5; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this +*/ +proto.pulumirpc.ReadResourceRequest.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadResourceRequest.prototype.hasProperties = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * repeated string dependencies = 6; + * @return {!Array} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getDependenciesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setDependenciesList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.addDependencies = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.clearDependenciesList = function() { + return this.setDependenciesList([]); +}; + + +/** + * optional string provider = 7; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional string version = 8; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional bool acceptSecrets = 9; + * @return {boolean} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getAcceptsecrets = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setAcceptsecrets = function(value) { + return jspb.Message.setProto3BooleanField(this, 9, value); +}; + + +/** + * repeated string additionalSecretOutputs = 10; + * @return {!Array} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getAdditionalsecretoutputsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setAdditionalsecretoutputsList = function(value) { + return jspb.Message.setField(this, 10, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.addAdditionalsecretoutputs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 10, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.clearAdditionalsecretoutputsList = function() { + return this.setAdditionalsecretoutputsList([]); +}; + + +/** + * optional bool acceptResources = 12; + * @return {boolean} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getAcceptresources = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setAcceptresources = function(value) { + return jspb.Message.setProto3BooleanField(this, 12, value); +}; + + +/** + * optional string pluginDownloadURL = 13; + * @return {string} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getPlugindownloadurl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.setPlugindownloadurl = function(value) { + return jspb.Message.setProto3StringField(this, 13, value); +}; + + +/** + * map pluginChecksums = 15; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getPluginchecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 15, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.clearPluginchecksumsMap = function() { + this.getPluginchecksumsMap().clear(); + return this;}; + + +/** + * optional SourcePosition sourcePosition = 14; + * @return {?proto.pulumirpc.SourcePosition} + */ +proto.pulumirpc.ReadResourceRequest.prototype.getSourceposition = function() { + return /** @type{?proto.pulumirpc.SourcePosition} */ ( + jspb.Message.getWrapperField(this, pulumi_source_pb.SourcePosition, 14)); +}; + + +/** + * @param {?proto.pulumirpc.SourcePosition|undefined} value + * @return {!proto.pulumirpc.ReadResourceRequest} returns this +*/ +proto.pulumirpc.ReadResourceRequest.prototype.setSourceposition = function(value) { + return jspb.Message.setWrapperField(this, 14, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadResourceRequest} returns this + */ +proto.pulumirpc.ReadResourceRequest.prototype.clearSourceposition = function() { + return this.setSourceposition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadResourceRequest.prototype.hasSourceposition = function() { + return jspb.Message.getField(this, 14) != null; +}; + + + + + +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.ReadResourceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ReadResourceResponse.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.ReadResourceResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadResourceResponse.toObject = function(includeInstance, msg) { + var f, obj = { + urn: jspb.Message.getFieldWithDefault(msg, 1, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.ReadResourceResponse} + */ +proto.pulumirpc.ReadResourceResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ReadResourceResponse; + return proto.pulumirpc.ReadResourceResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ReadResourceResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ReadResourceResponse} + */ +proto.pulumirpc.ReadResourceResponse.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.setUrn(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ReadResourceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ReadResourceResponse.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.ReadResourceResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ReadResourceResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.ReadResourceResponse.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ReadResourceResponse} returns this + */ +proto.pulumirpc.ReadResourceResponse.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct properties = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ReadResourceResponse.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ReadResourceResponse} returns this +*/ +proto.pulumirpc.ReadResourceResponse.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ReadResourceResponse} returns this + */ +proto.pulumirpc.ReadResourceResponse.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ReadResourceResponse.prototype.hasProperties = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.RegisterResourceRequest.repeatedFields_ = [7,12,14,15,23,26,31]; + + + +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.RegisterResourceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterResourceRequest.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.RegisterResourceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + parent: jspb.Message.getFieldWithDefault(msg, 3, ""), + custom: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + object: (f = msg.getObject()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + protect: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), + dependenciesList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, + provider: jspb.Message.getFieldWithDefault(msg, 8, ""), + propertydependenciesMap: (f = msg.getPropertydependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.toObject) : [], + deletebeforereplace: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + version: jspb.Message.getFieldWithDefault(msg, 11, ""), + ignorechangesList: (f = jspb.Message.getRepeatedField(msg, 12)) == null ? undefined : f, + acceptsecrets: jspb.Message.getBooleanFieldWithDefault(msg, 13, false), + additionalsecretoutputsList: (f = jspb.Message.getRepeatedField(msg, 14)) == null ? undefined : f, + aliasurnsList: (f = jspb.Message.getRepeatedField(msg, 15)) == null ? undefined : f, + importid: jspb.Message.getFieldWithDefault(msg, 16, ""), + customtimeouts: (f = msg.getCustomtimeouts()) && proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.toObject(includeInstance, f), + deletebeforereplacedefined: jspb.Message.getBooleanFieldWithDefault(msg, 18, false), + supportspartialvalues: jspb.Message.getBooleanFieldWithDefault(msg, 19, false), + remote: jspb.Message.getBooleanFieldWithDefault(msg, 20, false), + acceptresources: jspb.Message.getBooleanFieldWithDefault(msg, 21, false), + providersMap: (f = msg.getProvidersMap()) ? f.toObject(includeInstance, undefined) : [], + replaceonchangesList: (f = jspb.Message.getRepeatedField(msg, 23)) == null ? undefined : f, + plugindownloadurl: jspb.Message.getFieldWithDefault(msg, 24, ""), + pluginchecksumsMap: (f = msg.getPluginchecksumsMap()) ? f.toObject(includeInstance, undefined) : [], + retainondelete: jspb.Message.getBooleanFieldWithDefault(msg, 25, false), + aliasesList: jspb.Message.toObjectList(msg.getAliasesList(), + pulumi_alias_pb.Alias.toObject, includeInstance), + deletedwith: jspb.Message.getFieldWithDefault(msg, 27, ""), + aliasspecs: jspb.Message.getBooleanFieldWithDefault(msg, 28, false), + sourceposition: (f = msg.getSourceposition()) && pulumi_source_pb.SourcePosition.toObject(includeInstance, f), + transformsList: jspb.Message.toObjectList(msg.getTransformsList(), + pulumi_callback_pb.Callback.toObject, includeInstance), + supportsresultreporting: jspb.Message.getBooleanFieldWithDefault(msg, 32, false) + }; + + 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.RegisterResourceRequest} + */ +proto.pulumirpc.RegisterResourceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterResourceRequest; + return proto.pulumirpc.RegisterResourceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterResourceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterResourceRequest} + */ +proto.pulumirpc.RegisterResourceRequest.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.setType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setParent(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setCustom(value); + break; + case 5: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setObject(value); + break; + case 6: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProtect(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.addDependencies(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setProvider(value); + break; + case 9: + var value = msg.getPropertydependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.RegisterResourceRequest.PropertyDependencies()); + }); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDeletebeforereplace(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.addIgnorechanges(value); + break; + case 13: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptsecrets(value); + break; + case 14: + var value = /** @type {string} */ (reader.readString()); + msg.addAdditionalsecretoutputs(value); + break; + case 15: + var value = /** @type {string} */ (reader.readString()); + msg.addAliasurns(value); + break; + case 16: + var value = /** @type {string} */ (reader.readString()); + msg.setImportid(value); + break; + case 17: + var value = new proto.pulumirpc.RegisterResourceRequest.CustomTimeouts; + reader.readMessage(value,proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.deserializeBinaryFromReader); + msg.setCustomtimeouts(value); + break; + case 18: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDeletebeforereplacedefined(value); + break; + case 19: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupportspartialvalues(value); + break; + case 20: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRemote(value); + break; + case 21: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptresources(value); + break; + case 22: + var value = msg.getProvidersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 23: + var value = /** @type {string} */ (reader.readString()); + msg.addReplaceonchanges(value); + break; + case 24: + var value = /** @type {string} */ (reader.readString()); + msg.setPlugindownloadurl(value); + break; + case 30: + var value = msg.getPluginchecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 25: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRetainondelete(value); + break; + case 26: + var value = new pulumi_alias_pb.Alias; + reader.readMessage(value,pulumi_alias_pb.Alias.deserializeBinaryFromReader); + msg.addAliases(value); + break; + case 27: + var value = /** @type {string} */ (reader.readString()); + msg.setDeletedwith(value); + break; + case 28: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAliasspecs(value); + break; + case 29: + var value = new pulumi_source_pb.SourcePosition; + reader.readMessage(value,pulumi_source_pb.SourcePosition.deserializeBinaryFromReader); + msg.setSourceposition(value); + break; + case 31: + var value = new pulumi_callback_pb.Callback; + reader.readMessage(value,pulumi_callback_pb.Callback.deserializeBinaryFromReader); + msg.addTransforms(value); + break; + case 32: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSupportsresultreporting(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterResourceRequest.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.RegisterResourceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getParent(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getCustom(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getObject(); + if (f != null) { + writer.writeMessage( + 5, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getProtect(); + if (f) { + writer.writeBool( + 6, + f + ); + } + f = message.getDependenciesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 7, + f + ); + } + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getPropertydependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.serializeBinaryToWriter); + } + f = message.getDeletebeforereplace(); + if (f) { + writer.writeBool( + 10, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } + f = message.getIgnorechangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 12, + f + ); + } + f = message.getAcceptsecrets(); + if (f) { + writer.writeBool( + 13, + f + ); + } + f = message.getAdditionalsecretoutputsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 14, + f + ); + } + f = message.getAliasurnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 15, + f + ); + } + f = message.getImportid(); + if (f.length > 0) { + writer.writeString( + 16, + f + ); + } + f = message.getCustomtimeouts(); + if (f != null) { + writer.writeMessage( + 17, + f, + proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.serializeBinaryToWriter + ); + } + f = message.getDeletebeforereplacedefined(); + if (f) { + writer.writeBool( + 18, + f + ); + } + f = message.getSupportspartialvalues(); + if (f) { + writer.writeBool( + 19, + f + ); + } + f = message.getRemote(); + if (f) { + writer.writeBool( + 20, + f + ); + } + f = message.getAcceptresources(); + if (f) { + writer.writeBool( + 21, + f + ); + } + f = message.getProvidersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(22, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getReplaceonchangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 23, + f + ); + } + f = message.getPlugindownloadurl(); + if (f.length > 0) { + writer.writeString( + 24, + f + ); + } + f = message.getPluginchecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(30, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getRetainondelete(); + if (f) { + writer.writeBool( + 25, + f + ); + } + f = message.getAliasesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 26, + f, + pulumi_alias_pb.Alias.serializeBinaryToWriter + ); + } + f = message.getDeletedwith(); + if (f.length > 0) { + writer.writeString( + 27, + f + ); + } + f = message.getAliasspecs(); + if (f) { + writer.writeBool( + 28, + f + ); + } + f = message.getSourceposition(); + if (f != null) { + writer.writeMessage( + 29, + f, + pulumi_source_pb.SourcePosition.serializeBinaryToWriter + ); + } + f = message.getTransformsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 31, + f, + pulumi_callback_pb.Callback.serializeBinaryToWriter + ); + } + f = message.getSupportsresultreporting(); + if (f) { + writer.writeBool( + 32, + f + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.repeatedFields_ = [1]; + + + +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.RegisterResourceRequest.PropertyDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.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.RegisterResourceRequest.PropertyDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.RegisterResourceRequest.PropertyDependencies} + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterResourceRequest.PropertyDependencies; + return proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterResourceRequest.PropertyDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterResourceRequest.PropertyDependencies} + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.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.RegisterResourceRequest.PropertyDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest.PropertyDependencies} returns this + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceRequest.PropertyDependencies} returns this + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest.PropertyDependencies} returns this + */ +proto.pulumirpc.RegisterResourceRequest.PropertyDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + + + + +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.RegisterResourceRequest.CustomTimeouts.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.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.RegisterResourceRequest.CustomTimeouts} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.toObject = function(includeInstance, msg) { + var f, obj = { + create: jspb.Message.getFieldWithDefault(msg, 1, ""), + update: jspb.Message.getFieldWithDefault(msg, 2, ""), + pb_delete: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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.RegisterResourceRequest.CustomTimeouts} + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterResourceRequest.CustomTimeouts; + return proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.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.setCreate(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUpdate(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDelete(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.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.RegisterResourceRequest.CustomTimeouts} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCreate(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getUpdate(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDelete(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string create = 1; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.getCreate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} returns this + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.setCreate = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string update = 2; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.getUpdate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} returns this + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.setUpdate = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string delete = 3; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.getDelete = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} returns this + */ +proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.prototype.setDelete = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string type = 1; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string parent = 3; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getParent = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setParent = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool custom = 4; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getCustom = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setCustom = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional google.protobuf.Struct object = 5; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getObject = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this +*/ +proto.pulumirpc.RegisterResourceRequest.prototype.setObject = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearObject = function() { + return this.setObject(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.hasObject = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bool protect = 6; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getProtect = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setProtect = function(value) { + return jspb.Message.setProto3BooleanField(this, 6, value); +}; + + +/** + * repeated string dependencies = 7; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getDependenciesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setDependenciesList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addDependencies = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearDependenciesList = function() { + return this.setDependenciesList([]); +}; + + +/** + * optional string provider = 8; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * map propertyDependencies = 9; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getPropertydependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 9, opt_noLazyCreate, + proto.pulumirpc.RegisterResourceRequest.PropertyDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearPropertydependenciesMap = function() { + this.getPropertydependenciesMap().clear(); + return this;}; + + +/** + * optional bool deleteBeforeReplace = 10; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getDeletebeforereplace = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setDeletebeforereplace = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +/** + * optional string version = 11; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + +/** + * repeated string ignoreChanges = 12; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getIgnorechangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 12)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setIgnorechangesList = function(value) { + return jspb.Message.setField(this, 12, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addIgnorechanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 12, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearIgnorechangesList = function() { + return this.setIgnorechangesList([]); +}; + + +/** + * optional bool acceptSecrets = 13; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getAcceptsecrets = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 13, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setAcceptsecrets = function(value) { + return jspb.Message.setProto3BooleanField(this, 13, value); +}; + + +/** + * repeated string additionalSecretOutputs = 14; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getAdditionalsecretoutputsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 14)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setAdditionalsecretoutputsList = function(value) { + return jspb.Message.setField(this, 14, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addAdditionalsecretoutputs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 14, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearAdditionalsecretoutputsList = function() { + return this.setAdditionalsecretoutputsList([]); +}; + + +/** + * repeated string aliasURNs = 15; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getAliasurnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 15)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setAliasurnsList = function(value) { + return jspb.Message.setField(this, 15, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addAliasurns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 15, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearAliasurnsList = function() { + return this.setAliasurnsList([]); +}; + + +/** + * optional string importId = 16; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getImportid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 16, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setImportid = function(value) { + return jspb.Message.setProto3StringField(this, 16, value); +}; + + +/** + * optional CustomTimeouts customTimeouts = 17; + * @return {?proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getCustomtimeouts = function() { + return /** @type{?proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.RegisterResourceRequest.CustomTimeouts, 17)); +}; + + +/** + * @param {?proto.pulumirpc.RegisterResourceRequest.CustomTimeouts|undefined} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this +*/ +proto.pulumirpc.RegisterResourceRequest.prototype.setCustomtimeouts = function(value) { + return jspb.Message.setWrapperField(this, 17, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearCustomtimeouts = function() { + return this.setCustomtimeouts(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.hasCustomtimeouts = function() { + return jspb.Message.getField(this, 17) != null; +}; + + +/** + * optional bool deleteBeforeReplaceDefined = 18; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getDeletebeforereplacedefined = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 18, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setDeletebeforereplacedefined = function(value) { + return jspb.Message.setProto3BooleanField(this, 18, value); +}; + + +/** + * optional bool supportsPartialValues = 19; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getSupportspartialvalues = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 19, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setSupportspartialvalues = function(value) { + return jspb.Message.setProto3BooleanField(this, 19, value); +}; + + +/** + * optional bool remote = 20; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getRemote = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 20, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setRemote = function(value) { + return jspb.Message.setProto3BooleanField(this, 20, value); +}; + + +/** + * optional bool acceptResources = 21; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getAcceptresources = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 21, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setAcceptresources = function(value) { + return jspb.Message.setProto3BooleanField(this, 21, value); +}; + + +/** + * map providers = 22; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getProvidersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 22, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearProvidersMap = function() { + this.getProvidersMap().clear(); + return this;}; + + +/** + * repeated string replaceOnChanges = 23; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getReplaceonchangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 23)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setReplaceonchangesList = function(value) { + return jspb.Message.setField(this, 23, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addReplaceonchanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 23, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearReplaceonchangesList = function() { + return this.setReplaceonchangesList([]); +}; + + +/** + * optional string pluginDownloadURL = 24; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getPlugindownloadurl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 24, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setPlugindownloadurl = function(value) { + return jspb.Message.setProto3StringField(this, 24, value); +}; + + +/** + * map pluginChecksums = 30; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getPluginchecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 30, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearPluginchecksumsMap = function() { + this.getPluginchecksumsMap().clear(); + return this;}; + + +/** + * optional bool retainOnDelete = 25; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getRetainondelete = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 25, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setRetainondelete = function(value) { + return jspb.Message.setProto3BooleanField(this, 25, value); +}; + + +/** + * repeated Alias aliases = 26; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getAliasesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_alias_pb.Alias, 26)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this +*/ +proto.pulumirpc.RegisterResourceRequest.prototype.setAliasesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 26, value); +}; + + +/** + * @param {!proto.pulumirpc.Alias=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.Alias} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addAliases = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 26, opt_value, proto.pulumirpc.Alias, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearAliasesList = function() { + return this.setAliasesList([]); +}; + + +/** + * optional string deletedWith = 27; + * @return {string} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getDeletedwith = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 27, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setDeletedwith = function(value) { + return jspb.Message.setProto3StringField(this, 27, value); +}; + + +/** + * optional bool aliasSpecs = 28; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getAliasspecs = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 28, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setAliasspecs = function(value) { + return jspb.Message.setProto3BooleanField(this, 28, value); +}; + + +/** + * optional SourcePosition sourcePosition = 29; + * @return {?proto.pulumirpc.SourcePosition} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getSourceposition = function() { + return /** @type{?proto.pulumirpc.SourcePosition} */ ( + jspb.Message.getWrapperField(this, pulumi_source_pb.SourcePosition, 29)); +}; + + +/** + * @param {?proto.pulumirpc.SourcePosition|undefined} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this +*/ +proto.pulumirpc.RegisterResourceRequest.prototype.setSourceposition = function(value) { + return jspb.Message.setWrapperField(this, 29, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearSourceposition = function() { + return this.setSourceposition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.hasSourceposition = function() { + return jspb.Message.getField(this, 29) != null; +}; + + +/** + * repeated Callback transforms = 31; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getTransformsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_callback_pb.Callback, 31)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this +*/ +proto.pulumirpc.RegisterResourceRequest.prototype.setTransformsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 31, value); +}; + + +/** + * @param {!proto.pulumirpc.Callback=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.Callback} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.addTransforms = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 31, opt_value, proto.pulumirpc.Callback, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.clearTransformsList = function() { + return this.setTransformsList([]); +}; + + +/** + * optional bool supportsResultReporting = 32; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceRequest.prototype.getSupportsresultreporting = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 32, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceRequest} returns this + */ +proto.pulumirpc.RegisterResourceRequest.prototype.setSupportsresultreporting = function(value) { + return jspb.Message.setProto3BooleanField(this, 32, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.RegisterResourceResponse.repeatedFields_ = [5]; + + + +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.RegisterResourceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterResourceResponse.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.RegisterResourceResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceResponse.toObject = function(includeInstance, msg) { + var f, obj = { + urn: jspb.Message.getFieldWithDefault(msg, 1, ""), + id: jspb.Message.getFieldWithDefault(msg, 2, ""), + object: (f = msg.getObject()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + stable: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + stablesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + propertydependenciesMap: (f = msg.getPropertydependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.toObject) : [], + result: jspb.Message.getFieldWithDefault(msg, 7, 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.RegisterResourceResponse} + */ +proto.pulumirpc.RegisterResourceResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterResourceResponse; + return proto.pulumirpc.RegisterResourceResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterResourceResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterResourceResponse} + */ +proto.pulumirpc.RegisterResourceResponse.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.setUrn(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setObject(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setStable(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addStables(value); + break; + case 6: + var value = msg.getPropertydependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.RegisterResourceResponse.PropertyDependencies()); + }); + break; + case 7: + var value = /** @type {!proto.pulumirpc.Result} */ (reader.readEnum()); + msg.setResult(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterResourceResponse.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.RegisterResourceResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getObject(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getStable(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getStablesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getPropertydependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.serializeBinaryToWriter); + } + f = message.getResult(); + if (f !== 0.0) { + writer.writeEnum( + 7, + f + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.repeatedFields_ = [1]; + + + +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.RegisterResourceResponse.PropertyDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.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.RegisterResourceResponse.PropertyDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.RegisterResourceResponse.PropertyDependencies} + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterResourceResponse.PropertyDependencies; + return proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterResourceResponse.PropertyDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterResourceResponse.PropertyDependencies} + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.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.RegisterResourceResponse.PropertyDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceResponse.PropertyDependencies} returns this + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceResponse.PropertyDependencies} returns this + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.RegisterResourceResponse.PropertyDependencies} returns this + */ +proto.pulumirpc.RegisterResourceResponse.PropertyDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string id = 2; + * @return {string} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Struct object = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getObject = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this +*/ +proto.pulumirpc.RegisterResourceResponse.prototype.setObject = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.clearObject = function() { + return this.setObject(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.hasObject = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional bool stable = 4; + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getStable = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.setStable = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * repeated string stables = 5; + * @return {!Array} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getStablesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.setStablesList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.addStables = 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.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.clearStablesList = function() { + return this.setStablesList([]); +}; + + +/** + * map propertyDependencies = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getPropertydependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + proto.pulumirpc.RegisterResourceResponse.PropertyDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.clearPropertydependenciesMap = function() { + this.getPropertydependenciesMap().clear(); + return this;}; + + +/** + * optional Result result = 7; + * @return {!proto.pulumirpc.Result} + */ +proto.pulumirpc.RegisterResourceResponse.prototype.getResult = function() { + return /** @type {!proto.pulumirpc.Result} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** + * @param {!proto.pulumirpc.Result} value + * @return {!proto.pulumirpc.RegisterResourceResponse} returns this + */ +proto.pulumirpc.RegisterResourceResponse.prototype.setResult = function(value) { + return jspb.Message.setProto3EnumField(this, 7, 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.RegisterResourceOutputsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterResourceOutputsRequest.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.RegisterResourceOutputsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceOutputsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + urn: jspb.Message.getFieldWithDefault(msg, 1, ""), + outputs: (f = msg.getOutputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + 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.RegisterResourceOutputsRequest} + */ +proto.pulumirpc.RegisterResourceOutputsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterResourceOutputsRequest; + return proto.pulumirpc.RegisterResourceOutputsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterResourceOutputsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterResourceOutputsRequest} + */ +proto.pulumirpc.RegisterResourceOutputsRequest.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.setUrn(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setOutputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterResourceOutputsRequest.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.RegisterResourceOutputsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterResourceOutputsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrn(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOutputs(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string urn = 1; + * @return {string} + */ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.getUrn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterResourceOutputsRequest} returns this + */ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.setUrn = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct outputs = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.getOutputs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.RegisterResourceOutputsRequest} returns this +*/ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.setOutputs = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RegisterResourceOutputsRequest} returns this + */ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.clearOutputs = function() { + return this.setOutputs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RegisterResourceOutputsRequest.prototype.hasOutputs = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +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.ResourceInvokeRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ResourceInvokeRequest.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.ResourceInvokeRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ResourceInvokeRequest.toObject = function(includeInstance, msg) { + var f, obj = { + tok: jspb.Message.getFieldWithDefault(msg, 1, ""), + args: (f = msg.getArgs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + provider: jspb.Message.getFieldWithDefault(msg, 3, ""), + version: jspb.Message.getFieldWithDefault(msg, 4, ""), + acceptresources: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + plugindownloadurl: jspb.Message.getFieldWithDefault(msg, 6, ""), + pluginchecksumsMap: (f = msg.getPluginchecksumsMap()) ? f.toObject(includeInstance, undefined) : [], + sourceposition: (f = msg.getSourceposition()) && pulumi_source_pb.SourcePosition.toObject(includeInstance, f) + }; + + 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.ResourceInvokeRequest} + */ +proto.pulumirpc.ResourceInvokeRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ResourceInvokeRequest; + return proto.pulumirpc.ResourceInvokeRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ResourceInvokeRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ResourceInvokeRequest} + */ +proto.pulumirpc.ResourceInvokeRequest.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.setTok(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setArgs(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setProvider(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAcceptresources(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setPlugindownloadurl(value); + break; + case 8: + var value = msg.getPluginchecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 7: + var value = new pulumi_source_pb.SourcePosition; + reader.readMessage(value,pulumi_source_pb.SourcePosition.deserializeBinaryFromReader); + msg.setSourceposition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ResourceInvokeRequest.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.ResourceInvokeRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ResourceInvokeRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTok(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getArgs(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getAcceptresources(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getPlugindownloadurl(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getPluginchecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getSourceposition(); + if (f != null) { + writer.writeMessage( + 7, + f, + pulumi_source_pb.SourcePosition.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string tok = 1; + * @return {string} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getTok = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.setTok = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct args = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getArgs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this +*/ +proto.pulumirpc.ResourceInvokeRequest.prototype.setArgs = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.clearArgs = function() { + return this.setArgs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.hasArgs = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string provider = 3; + * @return {string} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string version = 4; + * @return {string} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional bool acceptResources = 5; + * @return {boolean} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getAcceptresources = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.setAcceptresources = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional string pluginDownloadURL = 6; + * @return {string} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getPlugindownloadurl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.setPlugindownloadurl = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * map pluginChecksums = 8; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getPluginchecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 8, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.clearPluginchecksumsMap = function() { + this.getPluginchecksumsMap().clear(); + return this;}; + + +/** + * optional SourcePosition sourcePosition = 7; + * @return {?proto.pulumirpc.SourcePosition} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.getSourceposition = function() { + return /** @type{?proto.pulumirpc.SourcePosition} */ ( + jspb.Message.getWrapperField(this, pulumi_source_pb.SourcePosition, 7)); +}; + + +/** + * @param {?proto.pulumirpc.SourcePosition|undefined} value + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this +*/ +proto.pulumirpc.ResourceInvokeRequest.prototype.setSourceposition = function(value) { + return jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ResourceInvokeRequest} returns this + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.clearSourceposition = function() { + return this.setSourceposition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ResourceInvokeRequest.prototype.hasSourceposition = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + + + +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.ResourceCallRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ResourceCallRequest.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.ResourceCallRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ResourceCallRequest.toObject = function(includeInstance, msg) { + var f, obj = { + tok: jspb.Message.getFieldWithDefault(msg, 1, ""), + args: (f = msg.getArgs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + argdependenciesMap: (f = msg.getArgdependenciesMap()) ? f.toObject(includeInstance, proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.toObject) : [], + provider: jspb.Message.getFieldWithDefault(msg, 4, ""), + version: jspb.Message.getFieldWithDefault(msg, 5, ""), + plugindownloadurl: jspb.Message.getFieldWithDefault(msg, 13, ""), + pluginchecksumsMap: (f = msg.getPluginchecksumsMap()) ? f.toObject(includeInstance, undefined) : [], + sourceposition: (f = msg.getSourceposition()) && pulumi_source_pb.SourcePosition.toObject(includeInstance, f) + }; + + 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.ResourceCallRequest} + */ +proto.pulumirpc.ResourceCallRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ResourceCallRequest; + return proto.pulumirpc.ResourceCallRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ResourceCallRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ResourceCallRequest} + */ +proto.pulumirpc.ResourceCallRequest.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.setTok(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setArgs(value); + break; + case 3: + var value = msg.getArgdependenciesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.deserializeBinaryFromReader, "", new proto.pulumirpc.ResourceCallRequest.ArgumentDependencies()); + }); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setProvider(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setPlugindownloadurl(value); + break; + case 16: + var value = msg.getPluginchecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 15: + var value = new pulumi_source_pb.SourcePosition; + reader.readMessage(value,pulumi_source_pb.SourcePosition.deserializeBinaryFromReader); + msg.setSourceposition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ResourceCallRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ResourceCallRequest.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.ResourceCallRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ResourceCallRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTok(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getArgs(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getArgdependenciesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.serializeBinaryToWriter); + } + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getPlugindownloadurl(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } + f = message.getPluginchecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(16, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getSourceposition(); + if (f != null) { + writer.writeMessage( + 15, + f, + pulumi_source_pb.SourcePosition.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.repeatedFields_ = [1]; + + + +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.ResourceCallRequest.ArgumentDependencies.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.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.ResourceCallRequest.ArgumentDependencies} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.toObject = function(includeInstance, msg) { + var f, obj = { + urnsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.ResourceCallRequest.ArgumentDependencies} + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ResourceCallRequest.ArgumentDependencies; + return proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ResourceCallRequest.ArgumentDependencies} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ResourceCallRequest.ArgumentDependencies} + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.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.addUrns(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.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.ResourceCallRequest.ArgumentDependencies} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrnsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string urns = 1; + * @return {!Array} + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.prototype.getUrnsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.ResourceCallRequest.ArgumentDependencies} returns this + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.prototype.setUrnsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.ResourceCallRequest.ArgumentDependencies} returns this + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.prototype.addUrns = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.ResourceCallRequest.ArgumentDependencies} returns this + */ +proto.pulumirpc.ResourceCallRequest.ArgumentDependencies.prototype.clearUrnsList = function() { + return this.setUrnsList([]); +}; + + +/** + * optional string tok = 1; + * @return {string} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getTok = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.setTok = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Struct args = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getArgs = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.ResourceCallRequest} returns this +*/ +proto.pulumirpc.ResourceCallRequest.prototype.setArgs = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.clearArgs = function() { + return this.setArgs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ResourceCallRequest.prototype.hasArgs = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * map argDependencies = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getArgdependenciesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + proto.pulumirpc.ResourceCallRequest.ArgumentDependencies)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.clearArgdependenciesMap = function() { + this.getArgdependenciesMap().clear(); + return this;}; + + +/** + * optional string provider = 4; + * @return {string} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string version = 5; + * @return {string} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string pluginDownloadURL = 13; + * @return {string} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getPlugindownloadurl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.setPlugindownloadurl = function(value) { + return jspb.Message.setProto3StringField(this, 13, value); +}; + + +/** + * map pluginChecksums = 16; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getPluginchecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 16, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.clearPluginchecksumsMap = function() { + this.getPluginchecksumsMap().clear(); + return this;}; + + +/** + * optional SourcePosition sourcePosition = 15; + * @return {?proto.pulumirpc.SourcePosition} + */ +proto.pulumirpc.ResourceCallRequest.prototype.getSourceposition = function() { + return /** @type{?proto.pulumirpc.SourcePosition} */ ( + jspb.Message.getWrapperField(this, pulumi_source_pb.SourcePosition, 15)); +}; + + +/** + * @param {?proto.pulumirpc.SourcePosition|undefined} value + * @return {!proto.pulumirpc.ResourceCallRequest} returns this +*/ +proto.pulumirpc.ResourceCallRequest.prototype.setSourceposition = function(value) { + return jspb.Message.setWrapperField(this, 15, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ResourceCallRequest} returns this + */ +proto.pulumirpc.ResourceCallRequest.prototype.clearSourceposition = function() { + return this.setSourceposition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ResourceCallRequest.prototype.hasSourceposition = function() { + return jspb.Message.getField(this, 15) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pulumirpc.TransformResourceOptions.repeatedFields_ = [1,3,4,6,13]; + + + +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.TransformResourceOptions.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.TransformResourceOptions.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.TransformResourceOptions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.TransformResourceOptions.toObject = function(includeInstance, msg) { + var f, obj = { + dependsOnList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + protect: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + ignoreChangesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + replaceOnChangesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + version: jspb.Message.getFieldWithDefault(msg, 5, ""), + aliasesList: jspb.Message.toObjectList(msg.getAliasesList(), + pulumi_alias_pb.Alias.toObject, includeInstance), + provider: jspb.Message.getFieldWithDefault(msg, 7, ""), + customTimeouts: (f = msg.getCustomTimeouts()) && proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.toObject(includeInstance, f), + pluginDownloadUrl: jspb.Message.getFieldWithDefault(msg, 9, ""), + retainOnDelete: jspb.Message.getBooleanFieldWithDefault(msg, 10, false), + deletedWith: jspb.Message.getFieldWithDefault(msg, 11, ""), + deleteBeforeReplace: jspb.Message.getBooleanFieldWithDefault(msg, 12, false), + additionalSecretOutputsList: (f = jspb.Message.getRepeatedField(msg, 13)) == null ? undefined : f, + providersMap: (f = msg.getProvidersMap()) ? f.toObject(includeInstance, undefined) : [], + pluginChecksumsMap: (f = msg.getPluginChecksumsMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + 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.TransformResourceOptions} + */ +proto.pulumirpc.TransformResourceOptions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.TransformResourceOptions; + return proto.pulumirpc.TransformResourceOptions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.TransformResourceOptions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.TransformResourceOptions} + */ +proto.pulumirpc.TransformResourceOptions.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.addDependsOn(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProtect(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addIgnoreChanges(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addReplaceOnChanges(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setVersion(value); + break; + case 6: + var value = new pulumi_alias_pb.Alias; + reader.readMessage(value,pulumi_alias_pb.Alias.deserializeBinaryFromReader); + msg.addAliases(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setProvider(value); + break; + case 8: + var value = new proto.pulumirpc.RegisterResourceRequest.CustomTimeouts; + reader.readMessage(value,proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.deserializeBinaryFromReader); + msg.setCustomTimeouts(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setPluginDownloadUrl(value); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRetainOnDelete(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setDeletedWith(value); + break; + case 12: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDeleteBeforeReplace(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.addAdditionalSecretOutputs(value); + break; + case 14: + var value = msg.getProvidersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 15: + var value = msg.getPluginChecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.TransformResourceOptions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.TransformResourceOptions.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.TransformResourceOptions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.TransformResourceOptions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDependsOnList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getProtect(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getIgnoreChangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getReplaceOnChangesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getAliasesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 6, + f, + pulumi_alias_pb.Alias.serializeBinaryToWriter + ); + } + f = message.getProvider(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getCustomTimeouts(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.pulumirpc.RegisterResourceRequest.CustomTimeouts.serializeBinaryToWriter + ); + } + f = message.getPluginDownloadUrl(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getRetainOnDelete(); + if (f) { + writer.writeBool( + 10, + f + ); + } + f = message.getDeletedWith(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 12)); + if (f != null) { + writer.writeBool( + 12, + f + ); + } + f = message.getAdditionalSecretOutputsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 13, + f + ); + } + f = message.getProvidersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(14, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getPluginChecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } +}; + + +/** + * repeated string depends_on = 1; + * @return {!Array} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getDependsOnList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setDependsOnList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.addDependsOn = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearDependsOnList = function() { + return this.setDependsOnList([]); +}; + + +/** + * optional bool protect = 2; + * @return {boolean} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getProtect = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setProtect = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * repeated string ignore_changes = 3; + * @return {!Array} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getIgnoreChangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setIgnoreChangesList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.addIgnoreChanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearIgnoreChangesList = function() { + return this.setIgnoreChangesList([]); +}; + + +/** + * repeated string replace_on_changes = 4; + * @return {!Array} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getReplaceOnChangesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setReplaceOnChangesList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.addReplaceOnChanges = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearReplaceOnChangesList = function() { + return this.setReplaceOnChangesList([]); +}; + + +/** + * optional string version = 5; + * @return {string} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * repeated Alias aliases = 6; + * @return {!Array} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getAliasesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, pulumi_alias_pb.Alias, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this +*/ +proto.pulumirpc.TransformResourceOptions.prototype.setAliasesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 6, value); +}; + + +/** + * @param {!proto.pulumirpc.Alias=} opt_value + * @param {number=} opt_index + * @return {!proto.pulumirpc.Alias} + */ +proto.pulumirpc.TransformResourceOptions.prototype.addAliases = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.pulumirpc.Alias, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearAliasesList = function() { + return this.setAliasesList([]); +}; + + +/** + * optional string provider = 7; + * @return {string} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getProvider = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setProvider = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional RegisterResourceRequest.CustomTimeouts custom_timeouts = 8; + * @return {?proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getCustomTimeouts = function() { + return /** @type{?proto.pulumirpc.RegisterResourceRequest.CustomTimeouts} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.RegisterResourceRequest.CustomTimeouts, 8)); +}; + + +/** + * @param {?proto.pulumirpc.RegisterResourceRequest.CustomTimeouts|undefined} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this +*/ +proto.pulumirpc.TransformResourceOptions.prototype.setCustomTimeouts = function(value) { + return jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearCustomTimeouts = function() { + return this.setCustomTimeouts(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.TransformResourceOptions.prototype.hasCustomTimeouts = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional string plugin_download_url = 9; + * @return {string} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getPluginDownloadUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setPluginDownloadUrl = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional bool retain_on_delete = 10; + * @return {boolean} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getRetainOnDelete = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setRetainOnDelete = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + +/** + * optional string deleted_with = 11; + * @return {string} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getDeletedWith = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setDeletedWith = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + +/** + * optional bool delete_before_replace = 12; + * @return {boolean} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getDeleteBeforeReplace = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setDeleteBeforeReplace = function(value) { + return jspb.Message.setField(this, 12, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearDeleteBeforeReplace = function() { + return jspb.Message.setField(this, 12, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.TransformResourceOptions.prototype.hasDeleteBeforeReplace = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * repeated string additional_secret_outputs = 13; + * @return {!Array} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getAdditionalSecretOutputsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 13)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.setAdditionalSecretOutputsList = function(value) { + return jspb.Message.setField(this, 13, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.addAdditionalSecretOutputs = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 13, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearAdditionalSecretOutputsList = function() { + return this.setAdditionalSecretOutputsList([]); +}; + + +/** + * map providers = 14; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getProvidersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 14, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearProvidersMap = function() { + this.getProvidersMap().clear(); + return this;}; + + +/** + * map plugin_checksums = 15; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.TransformResourceOptions.prototype.getPluginChecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 15, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.TransformResourceOptions} returns this + */ +proto.pulumirpc.TransformResourceOptions.prototype.clearPluginChecksumsMap = function() { + this.getPluginChecksumsMap().clear(); + return this;}; + + + + + +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.TransformRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.TransformRequest.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.TransformRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.TransformRequest.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + custom: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + parent: jspb.Message.getFieldWithDefault(msg, 4, ""), + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + options: (f = msg.getOptions()) && proto.pulumirpc.TransformResourceOptions.toObject(includeInstance, f) + }; + + 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.TransformRequest} + */ +proto.pulumirpc.TransformRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.TransformRequest; + return proto.pulumirpc.TransformRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.TransformRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.TransformRequest} + */ +proto.pulumirpc.TransformRequest.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.setType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setCustom(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setParent(value); + break; + case 5: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 6: + var value = new proto.pulumirpc.TransformResourceOptions; + reader.readMessage(value,proto.pulumirpc.TransformResourceOptions.deserializeBinaryFromReader); + msg.setOptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.TransformRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.TransformRequest.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.TransformRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.TransformRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getCustom(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getParent(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 5, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.pulumirpc.TransformResourceOptions.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string type = 1; + * @return {string} + */ +proto.pulumirpc.TransformRequest.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformRequest} returns this + */ +proto.pulumirpc.TransformRequest.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.pulumirpc.TransformRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformRequest} returns this + */ +proto.pulumirpc.TransformRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bool custom = 3; + * @return {boolean} + */ +proto.pulumirpc.TransformRequest.prototype.getCustom = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.pulumirpc.TransformRequest} returns this + */ +proto.pulumirpc.TransformRequest.prototype.setCustom = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional string parent = 4; + * @return {string} + */ +proto.pulumirpc.TransformRequest.prototype.getParent = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.TransformRequest} returns this + */ +proto.pulumirpc.TransformRequest.prototype.setParent = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional google.protobuf.Struct properties = 5; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.TransformRequest.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.TransformRequest} returns this +*/ +proto.pulumirpc.TransformRequest.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.TransformRequest} returns this + */ +proto.pulumirpc.TransformRequest.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.TransformRequest.prototype.hasProperties = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional TransformResourceOptions options = 6; + * @return {?proto.pulumirpc.TransformResourceOptions} + */ +proto.pulumirpc.TransformRequest.prototype.getOptions = function() { + return /** @type{?proto.pulumirpc.TransformResourceOptions} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.TransformResourceOptions, 6)); +}; + + +/** + * @param {?proto.pulumirpc.TransformResourceOptions|undefined} value + * @return {!proto.pulumirpc.TransformRequest} returns this +*/ +proto.pulumirpc.TransformRequest.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.TransformRequest} returns this + */ +proto.pulumirpc.TransformRequest.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.TransformRequest.prototype.hasOptions = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +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.TransformResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.TransformResponse.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.TransformResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.TransformResponse.toObject = function(includeInstance, msg) { + var f, obj = { + properties: (f = msg.getProperties()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + options: (f = msg.getOptions()) && proto.pulumirpc.TransformResourceOptions.toObject(includeInstance, f) + }; + + 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.TransformResponse} + */ +proto.pulumirpc.TransformResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.TransformResponse; + return proto.pulumirpc.TransformResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.TransformResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.TransformResponse} + */ +proto.pulumirpc.TransformResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setProperties(value); + break; + case 2: + var value = new proto.pulumirpc.TransformResourceOptions; + reader.readMessage(value,proto.pulumirpc.TransformResourceOptions.deserializeBinaryFromReader); + msg.setOptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.TransformResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.TransformResponse.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.TransformResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.TransformResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProperties(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.pulumirpc.TransformResourceOptions.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.Struct properties = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.pulumirpc.TransformResponse.prototype.getProperties = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.pulumirpc.TransformResponse} returns this +*/ +proto.pulumirpc.TransformResponse.prototype.setProperties = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.TransformResponse} returns this + */ +proto.pulumirpc.TransformResponse.prototype.clearProperties = function() { + return this.setProperties(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.TransformResponse.prototype.hasProperties = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional TransformResourceOptions options = 2; + * @return {?proto.pulumirpc.TransformResourceOptions} + */ +proto.pulumirpc.TransformResponse.prototype.getOptions = function() { + return /** @type{?proto.pulumirpc.TransformResourceOptions} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.TransformResourceOptions, 2)); +}; + + +/** + * @param {?proto.pulumirpc.TransformResourceOptions|undefined} value + * @return {!proto.pulumirpc.TransformResponse} returns this +*/ +proto.pulumirpc.TransformResponse.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.TransformResponse} returns this + */ +proto.pulumirpc.TransformResponse.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.TransformResponse.prototype.hasOptions = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +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.RegisterProviderRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterProviderRequest.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.RegisterProviderRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterProviderRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, ""), + pluginDownloadUrl: jspb.Message.getFieldWithDefault(msg, 3, ""), + pluginChecksumsMap: (f = msg.getPluginChecksumsMap()) ? f.toObject(includeInstance, undefined) : [], + parameter: (f = msg.getParameter()) && proto.pulumirpc.ProviderParameter.toObject(includeInstance, f) + }; + + 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.RegisterProviderRequest} + */ +proto.pulumirpc.RegisterProviderRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterProviderRequest; + return proto.pulumirpc.RegisterProviderRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterProviderRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterProviderRequest} + */ +proto.pulumirpc.RegisterProviderRequest.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.setVersion(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPluginDownloadUrl(value); + break; + case 4: + var value = msg.getPluginChecksumsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); + }); + break; + case 5: + var value = new proto.pulumirpc.ProviderParameter; + reader.readMessage(value,proto.pulumirpc.ProviderParameter.deserializeBinaryFromReader); + msg.setParameter(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterProviderRequest.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.RegisterProviderRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterProviderRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getPluginDownloadUrl(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getPluginChecksumsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); + } + f = message.getParameter(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.pulumirpc.ProviderParameter.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterProviderRequest} returns this + */ +proto.pulumirpc.RegisterProviderRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterProviderRequest} returns this + */ +proto.pulumirpc.RegisterProviderRequest.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string plugin_download_url = 3; + * @return {string} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.getPluginDownloadUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterProviderRequest} returns this + */ +proto.pulumirpc.RegisterProviderRequest.prototype.setPluginDownloadUrl = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * map plugin_checksums = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.getPluginChecksumsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pulumirpc.RegisterProviderRequest} returns this + */ +proto.pulumirpc.RegisterProviderRequest.prototype.clearPluginChecksumsMap = function() { + this.getPluginChecksumsMap().clear(); + return this;}; + + +/** + * optional ProviderParameter parameter = 5; + * @return {?proto.pulumirpc.ProviderParameter} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.getParameter = function() { + return /** @type{?proto.pulumirpc.ProviderParameter} */ ( + jspb.Message.getWrapperField(this, proto.pulumirpc.ProviderParameter, 5)); +}; + + +/** + * @param {?proto.pulumirpc.ProviderParameter|undefined} value + * @return {!proto.pulumirpc.RegisterProviderRequest} returns this +*/ +proto.pulumirpc.RegisterProviderRequest.prototype.setParameter = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.RegisterProviderRequest} returns this + */ +proto.pulumirpc.RegisterProviderRequest.prototype.clearParameter = function() { + return this.setParameter(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.RegisterProviderRequest.prototype.hasParameter = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +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.RegisterProviderResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.RegisterProviderResponse.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.RegisterProviderResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterProviderResponse.toObject = function(includeInstance, msg) { + var f, obj = { + ref: 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.RegisterProviderResponse} + */ +proto.pulumirpc.RegisterProviderResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.RegisterProviderResponse; + return proto.pulumirpc.RegisterProviderResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.RegisterProviderResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.RegisterProviderResponse} + */ +proto.pulumirpc.RegisterProviderResponse.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.setRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.RegisterProviderResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.RegisterProviderResponse.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.RegisterProviderResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.RegisterProviderResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string ref = 1; + * @return {string} + */ +proto.pulumirpc.RegisterProviderResponse.prototype.getRef = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.RegisterProviderResponse} returns this + */ +proto.pulumirpc.RegisterProviderResponse.prototype.setRef = function(value) { + return jspb.Message.setProto3StringField(this, 1, 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.ProviderParameter.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.ProviderParameter.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.ProviderParameter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ProviderParameter.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + version: jspb.Message.getFieldWithDefault(msg, 2, ""), + value: (f = msg.getValue()) && google_protobuf_struct_pb.Value.toObject(includeInstance, f) + }; + + 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.ProviderParameter} + */ +proto.pulumirpc.ProviderParameter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.ProviderParameter; + return proto.pulumirpc.ProviderParameter.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.ProviderParameter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.ProviderParameter} + */ +proto.pulumirpc.ProviderParameter.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.setVersion(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Value; + reader.readMessage(value,google_protobuf_struct_pb.Value.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.ProviderParameter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.ProviderParameter.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.ProviderParameter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.ProviderParameter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getVersion(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Value.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.pulumirpc.ProviderParameter.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ProviderParameter} returns this + */ +proto.pulumirpc.ProviderParameter.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string version = 2; + * @return {string} + */ +proto.pulumirpc.ProviderParameter.prototype.getVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.ProviderParameter} returns this + */ +proto.pulumirpc.ProviderParameter.prototype.setVersion = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Value value = 3; + * @return {?proto.google.protobuf.Value} + */ +proto.pulumirpc.ProviderParameter.prototype.getValue = function() { + return /** @type{?proto.google.protobuf.Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Value|undefined} value + * @return {!proto.pulumirpc.ProviderParameter} returns this +*/ +proto.pulumirpc.ProviderParameter.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pulumirpc.ProviderParameter} returns this + */ +proto.pulumirpc.ProviderParameter.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pulumirpc.ProviderParameter.prototype.hasValue = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * @enum {number} + */ +proto.pulumirpc.Result = { + SUCCESS: 0, + FAIL: 1, + SKIP: 2 +}; + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 32093: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// source: pulumi/source.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 proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto; + +goog.exportSymbol('proto.pulumirpc.SourcePosition', 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.SourcePosition = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pulumirpc.SourcePosition, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pulumirpc.SourcePosition.displayName = 'proto.pulumirpc.SourcePosition'; +} + + + +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.SourcePosition.prototype.toObject = function(opt_includeInstance) { + return proto.pulumirpc.SourcePosition.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.SourcePosition} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SourcePosition.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + line: jspb.Message.getFieldWithDefault(msg, 2, 0), + column: jspb.Message.getFieldWithDefault(msg, 3, 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.SourcePosition} + */ +proto.pulumirpc.SourcePosition.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pulumirpc.SourcePosition; + return proto.pulumirpc.SourcePosition.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pulumirpc.SourcePosition} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pulumirpc.SourcePosition} + */ +proto.pulumirpc.SourcePosition.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.setUri(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setLine(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setColumn(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pulumirpc.SourcePosition.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pulumirpc.SourcePosition.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.SourcePosition} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pulumirpc.SourcePosition.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLine(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getColumn(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.pulumirpc.SourcePosition.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.pulumirpc.SourcePosition} returns this + */ +proto.pulumirpc.SourcePosition.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional int32 line = 2; + * @return {number} + */ +proto.pulumirpc.SourcePosition.prototype.getLine = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.SourcePosition} returns this + */ +proto.pulumirpc.SourcePosition.prototype.setLine = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int32 column = 3; + * @return {number} + */ +proto.pulumirpc.SourcePosition.prototype.getColumn = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pulumirpc.SourcePosition} returns this + */ +proto.pulumirpc.SourcePosition.prototype.setColumn = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +goog.object.extend(exports, proto.pulumirpc); + + +/***/ }), + +/***/ 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const url = __importStar(__nccwpck_require__(57310)); +const errors_1 = __nccwpck_require__(89693); +const log = __importStar(__nccwpck_require__(80642)); +const output_1 = __nccwpck_require__(43037); +const resource_1 = __nccwpck_require__(30140); +const rpc_1 = __nccwpck_require__(25158); +const settings_1 = __nccwpck_require__(34530); +const state_1 = __nccwpck_require__(24741); +const utils = __importStar(__nccwpck_require__(21888)); +/** + * createUrn computes a URN from the combination of a resource name, resource type, optional parent, + * optional project and optional stack. + */ +function createUrn(name, type, parent, project, stack) { + let parentPrefix; + if (parent) { + let parentUrn; + if (Resource.isInstance(parent)) { + parentUrn = parent.urn; + } + else { + parentUrn = output_1.output(parent); + } + parentPrefix = parentUrn.apply((parentUrnString) => { + const prefix = parentUrnString.substring(0, parentUrnString.lastIndexOf("::")) + "$"; + if (prefix.endsWith("::pulumi:pulumi:Stack$")) { + // Don't prefix the stack type as a parent type + return `urn:pulumi:${stack || settings_1.getStack()}::${project || settings_1.getProject()}::`; + } + return prefix; + }); + } + else { + parentPrefix = output_1.output(`urn:pulumi:${stack || settings_1.getStack()}::${project || settings_1.getProject()}::`); + } + return output_1.interpolate `${parentPrefix}${type}::${name}`; +} +exports.createUrn = createUrn; +/** + * inheritedChildAlias computes the alias that should be applied to a child based on an alias applied to it's parent. + * This may involve changing the name of the resource in cases where the resource has a named derived from the name of + * the parent, and the parent name changed. + */ +function inheritedChildAlias(childName, parentName, parentAlias, childType) { + // If the child name has the parent name as a prefix, then we make the assumption that it was + // constructed from the convention of using `{name}-details` as the name of the child resource. To + // ensure this is aliased correctly, we must then also replace the parent aliases name in the prefix of + // the child resource name. + // + // For example: + // * name: "newapp-function" + // * opts.parent.__name: "newapp" + // * parentAlias: "urn:pulumi:stackname::projectname::awsx:ec2:Vpc::app" + // * parentAliasName: "app" + // * aliasName: "app-function" + // * childAlias: "urn:pulumi:stackname::projectname::aws:s3/bucket:Bucket::app-function" + let aliasName = output_1.output(childName); + if (childName.startsWith(parentName)) { + aliasName = output_1.output(parentAlias).apply((parentAliasUrn) => { + const parentAliasName = parentAliasUrn.substring(parentAliasUrn.lastIndexOf("::") + 2); + return parentAliasName + childName.substring(parentName.length); + }); + } + return createUrn(aliasName, childType, parentAlias); +} +/** + * Extracts the type and name from a URN. + */ +function urnTypeAndName(urn) { + const parts = urn.split("::"); + const typeParts = parts[2].split("$"); + return { + name: parts[3], + type: typeParts[typeParts.length - 1], + }; +} +/** + * allAliases computes the full set of aliases for a child resource given a set of aliases applied to the child and + * parent resources. This includes the child resource's own aliases, as well as aliases inherited from the parent. + * If there are N child aliases, and M parent aliases, there will be (M+1)*(N+1)-1 total aliases, + * or, as calculated in the logic below, N+(M*(1+N)). + */ +function allAliases(childAliases, childName, childType, parent, parentName) { + const aliases = []; + for (const childAlias of childAliases) { + aliases.push(collapseAliasToUrn(childAlias, childName, childType, parent)); + } + for (const parentAlias of parent.__aliases || []) { + // For each parent alias, add an alias that uses that base child name and the parent alias + aliases.push(inheritedChildAlias(childName, parentName, parentAlias, childType)); + // Also add an alias for each child alias and the parent alias + for (const childAlias of childAliases) { + const inheritedAlias = collapseAliasToUrn(childAlias, childName, childType, parent).apply((childAliasURN) => { + const { name: aliasedChildName, type: aliasedChildType } = urnTypeAndName(childAliasURN); + return inheritedChildAlias(aliasedChildName, parentName, parentAlias, aliasedChildType); + }); + aliases.push(inheritedAlias); + } + } + return aliases; +} +exports.allAliases = allAliases; +/** + * Resource represents a class whose CRUD operations are implemented by a provider plugin. + */ +class Resource { + /** + * Creates and registers a new resource object. [t] is the fully qualified type token and + * [name] is the "name" part to use in creating a stable and globally unique URN for the object. + * dependsOn is an optional list of other resources that this resource depends on, controlling + * the order in which we perform resource operations. + * + * @param t The type of the resource. + * @param name The _unique_ name of the resource. + * @param custom True to indicate that this is a custom resource, managed by a plugin. + * @param props The arguments to use to populate the new resource. + * @param opts A bag of options that control this resource's behavior. + * @param remote True if this is a remote component resource. + * @param dependency True if this is a synthetic resource used internally for dependency tracking. + */ + constructor(t, name, custom, props = {}, opts = {}, remote = false, dependency = false) { + /** + * A private field to help with RTTI that works in SxS scenarios. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiResource = true; + this.__pulumiType = t; + if (dependency) { + this.__protect = false; + this.__providers = {}; + return; + } + if (opts.parent && !Resource.isInstance(opts.parent)) { + throw new Error(`Resource parent is not a valid Resource: ${opts.parent}`); + } + if (!t) { + throw new errors_1.ResourceError("Missing resource type argument", opts.parent); + } + if (!name) { + throw new errors_1.ResourceError("Missing resource name argument (for URN creation)", opts.parent); + } + // 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 || state_1.getStackResource(); + this.__transformations = [...(opts.transformations || []), ...((parent === null || parent === void 0 ? void 0 : parent.__transformations) || [])]; + for (const transformation of this.__transformations) { + const tres = transformation({ resource: this, type: t, name, props, opts }); + if (tres) { + if (tres.opts.parent !== opts.parent) { + // This is currently not allowed because the parent tree is needed to establish what + // transformation to apply in the first place, and to compute inheritance of other + // resource options in the Resource constructor before transformations are run (so + // modifying it here would only even partially take affect). It's theoretically + // possible this restriction could be lifted in the future, but for now just + // disallow re-parenting resources in transformations to be safe. + throw new Error("Transformations cannot currently be used to change the `parent` of a resource."); + } + props = tres.props; + opts = tres.opts; + } + } + this.__name = name; + // Make a shallow clone of opts to ensure we don't modify the value passed in. + opts = Object.assign({}, opts); + // Check the parent type if one exists and fill in any default options. + this.__providers = {}; + if (parent) { + this.__parentResource = parent; + this.__parentResource.__childResources = this.__parentResource.__childResources || new Set(); + this.__parentResource.__childResources.add(this); + if (opts.protect === undefined) { + opts.protect = parent.__protect; + } + this.__providers = parent.__providers; + } + // providers is found by combining (in ascending order of priority) + // 1. provider + // 2. self_providers + // 3. opts.providers + this.__providers = Object.assign(Object.assign(Object.assign({}, this.__providers), convertToProvidersMap(opts.providers)), convertToProvidersMap(opts.provider ? [opts.provider] : {})); + const pkg = resource_1.pkgFromType(t); + // provider is the first option that does not return none + // 1. opts.provider + // 2. a matching provider in opts.providers + // 3. a matching provider inherited from opts.parent + if ((custom || remote) && opts.provider === undefined) { + const parentProvider = parent === null || parent === void 0 ? void 0 : parent.getProvider(t); + if (pkg && pkg in this.__providers) { + opts.provider = this.__providers[pkg]; + } + else if (parentProvider) { + opts.provider = parentProvider; + } + } + // Custom and remote resources have a backing provider. If this is a custom or + // remote resource and a provider has been specified that has the same package + // as the resource's package, save it in `__prov`. + // If the provider's package isn't the same as the resource's package, don't + // save it in `__prov` because the user specified `provider: someProvider` as + // shorthand for `providers: [someProvider]`, which is a provider intended for + // the component's children and not for this resource itself. + // `__prov` is passed along in `Call` gRPC requests for resource method calls + // (when set) so that the call goes to the same provider as the resource. + if ((custom || remote) && opts.provider) { + if (pkg && pkg === opts.provider.getPackage()) { + this.__prov = opts.provider; + } + } + this.__protect = !!opts.protect; + this.__version = opts.version; + this.__pluginDownloadURL = opts.pluginDownloadURL; + // Collapse any `Alias`es down to URNs. We have to wait until this point to do so because we do not know the + // default `name` and `type` to apply until we are inside the resource constructor. + this.__aliases = []; + if (opts.aliases) { + for (const alias of opts.aliases) { + this.__aliases.push(collapseAliasToUrn(alias, name, t, parent)); + } + } + const sourcePosition = Resource.sourcePosition(); + if (opts.urn) { + // This is a resource that already exists. Read its state from the engine. + resource_1.getResource(this, parent, props, custom, opts.urn); + } + else if (opts.id) { + // If this is a custom resource that already exists, read its state from the provider. + if (!custom) { + throw new errors_1.ResourceError("Cannot read an existing resource unless it has a custom provider", opts.parent); + } + resource_1.readResource(this, parent, t, name, props, opts, sourcePosition); + } + else { + // Kick off the resource registration. If we are actually performing a deployment, this + // resource's properties will be resolved asynchronously after the operation completes, so + // that dependent computations resolve normally. If we are just planning, on the other + // hand, values will never resolve. + resource_1.registerResource(this, parent, t, name, custom, remote, (urn) => new DependencyResource(urn), props, opts, sourcePosition); + } + } + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiResource"); + } + /** + * sourcePosition returns the source position of the user code that instantiated this resource. + * + * This is somewhat brittle in that it expects a call stack of the form: + * - Resource class constructor + * - abstract Resource subclass constructor + * - concrete Resource subclass constructor + * - user code + * + * This stack reflects the expected class hierarchy of "cloud resource / component resource < customresource/componentresource < resource". + * + * For example, consider the AWS S3 Bucket resource. When user code instantiates a Bucket, the stack will look like + * this: + * + * new Resource (/path/to/resource.ts:123:45) + * new CustomResource (/path/to/resource.ts:678:90) + * new Bucket (/path/to/bucket.ts:987:65) + * (/path/to/index.ts:4:3) + * + * Because Node can only give us the stack trace as text, we parse out the source position using a regex that + * matches traces of this form (see stackTraceRegExp above). + */ + static sourcePosition() { + var _a; + const stackObj = {}; + Error.captureStackTrace(stackObj, Resource.sourcePosition); + // Parse out the source position of the user code. If any part of the match is missing, return undefined. + const { file, line, col } = ((_a = Resource.sourcePositionRegExp.exec(stackObj.stack)) === null || _a === void 0 ? void 0 : _a.groups) || {}; + if (!file || !line || !col) { + return undefined; + } + // Parse the line and column numbers. If either fails to parse, return undefined. + // + // Note: this really shouldn't happen given the regex; this is just a bit of defensive coding. + const lineNum = parseInt(line, 10); + const colNum = parseInt(col, 10); + if (Number.isNaN(lineNum) || Number.isNaN(colNum)) { + return undefined; + } + return { + uri: url.pathToFileURL(file).toString(), + line: lineNum, + column: colNum, + }; + } + /** + * Returns the provider for the given module member, if one exists. + */ + getProvider(moduleMember) { + const pkg = resource_1.pkgFromType(moduleMember); + if (pkg === undefined) { + return undefined; + } + return this.__providers[pkg]; + } +} +exports.Resource = Resource; +/** + * A regexp for use with sourcePosition. + */ +Resource.sourcePositionRegExp = /Error:\s*\n\s*at new Resource \(.*\)\n\s*at new \S*Resource \(.*\)\n(\s*at new \S* \(.*\)\n)?[^(]*\((?.*):(?[0-9]+):(?[0-9]+)\)\n/; +function convertToProvidersMap(providers) { + if (!providers) { + return {}; + } + if (!Array.isArray(providers)) { + return providers; + } + const result = {}; + for (const provider of providers) { + result[provider.getPackage()] = provider; + } + return result; +} +Resource.doNotCapture = true; +/** + * Constant to represent the 'root stack' resource for a Pulumi application. The purpose of this is + * solely to make it easy to write an [Alias] like so: + * + * `aliases: [{ parent: rootStackResource }]`. + * + * This indicates that the prior name for a resource was created based on it being parented directly + * by the stack itself and no other resources. Note: this is equivalent to: + * + * `aliases: [{ parent: undefined }]` + * + * However, the former form is preferable as it is more self-descriptive, while the latter may look + * a bit confusing and may incorrectly look like something that could be removed without changing + * semantics. + */ +exports.rootStackResource = undefined; +/** + * Converts an alias into a URN given a set of default data for the missing + * values. + */ +function collapseAliasToUrn(alias, defaultName, defaultType, defaultParent) { + return output_1.output(alias).apply((a) => { + if (typeof a === "string") { + return output_1.output(a); + } + const name = a.hasOwnProperty("name") ? a.name : defaultName; + const type = a.hasOwnProperty("type") ? a.type : defaultType; + const parent = a.hasOwnProperty("parent") ? a.parent : defaultParent; + const project = a.hasOwnProperty("project") ? a.project : settings_1.getProject(); + const stack = a.hasOwnProperty("stack") ? a.stack : settings_1.getStack(); + if (name === undefined) { + throw new Error("No valid 'name' passed in for alias."); + } + if (type === undefined) { + throw new Error("No valid 'type' passed in for alias."); + } + return createUrn(name, type, parent, project, stack); + }); +} +/** + * CustomResource is a resource whose create, read, update, and delete (CRUD) operations are managed + * by performing external operations on some physical entity. The engine understands how to diff + * and perform partial updates of them, and these CRUD operations are implemented in a dynamically + * loaded plugin for the defining package. + */ +class CustomResource extends Resource { + /** + * Creates and registers a new managed resource. t is the fully qualified type token and name + * is the "name" part to use in creating a stable and globally unique URN for the object. + * dependsOn is an optional list of other resources that this resource depends on, controlling + * the order in which we perform resource operations. Creating an instance does not necessarily + * perform a create on the physical entity which it represents, and instead, this is dependent + * upon the diffing of the new goal state compared to the current known resource state. + * + * @param t The type of the resource. + * @param name The _unique_ name of the resource. + * @param props The arguments to use to populate the new resource. + * @param opts A bag of options that control this resource's behavior. + * @param dependency True if this is a synthetic resource used internally for dependency tracking. + */ + constructor(t, name, props, opts = {}, dependency = false) { + if (opts.providers) { + throw new errors_1.ResourceError("Do not supply 'providers' option to a CustomResource. Did you mean 'provider' instead?", opts.parent); + } + super(t, name, true, props, opts, false, dependency); + this.__pulumiCustomResource = true; + } + /** + * Returns true if the given object is an instance of CustomResource. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiCustomResource"); + } +} +exports.CustomResource = CustomResource; +CustomResource.doNotCapture = true; +/** + * ProviderResource is a resource that implements CRUD operations for other custom resources. These resources are + * managed similarly to other resources, including the usual diffing and update semantics. + */ +class ProviderResource extends CustomResource { + /** + * Creates and registers a new provider resource for a particular package. + * + * @param pkg The package associated with this provider. + * @param name The _unique_ name of the provider. + * @param props The configuration to use for this provider. + * @param opts A bag of options that control this provider's behavior. + * @param dependency True if this is a synthetic resource used internally for dependency tracking. + */ + constructor(pkg, name, props, opts = {}, dependency = false) { + super(`pulumi:providers:${pkg}`, name, props, opts, dependency); + this.pkg = pkg; + } + static register(provider) { + return __awaiter(this, void 0, void 0, function* () { + if (provider === undefined) { + return undefined; + } + if (!provider.__registrationId) { + const providerURN = yield provider.urn.promise(); + const providerID = (yield provider.id.promise()) || rpc_1.unknownValue; + provider.__registrationId = `${providerURN}::${providerID}`; + } + return provider.__registrationId; + }); + } + /** @internal */ + getPackage() { + return this.pkg; + } +} +exports.ProviderResource = ProviderResource; +/** + * ComponentResource is a resource that aggregates one or more other child resources into a higher + * level abstraction. The component resource itself is a resource, but does not require custom CRUD + * operations for provisioning. + */ +class ComponentResource extends Resource { + /** + * Creates and registers a new component resource. [type] is the fully qualified type token and + * [name] is the "name" part to use in creating a stable and globally unique URN for the object. + * [opts.parent] is the optional parent for this component, and [opts.dependsOn] is an optional + * list of other resources that this resource depends on, controlling the order in which we + * perform resource operations. + * + * @param type The type of the resource. + * @param name The _unique_ name of the resource. + * @param args Information passed to [initialize] method. + * @param opts A bag of options that control this resource's behavior. + * @param remote True if this is a remote component resource. + */ + constructor(type, name, args = {}, opts = {}, remote = false) { + // Explicitly ignore the props passed in. We allow them for back compat reasons. However, + // we explicitly do not want to pass them along to the engine. The ComponentResource acts + // only as a container for other resources. Another way to think about this is that a normal + // 'custom resource' corresponds to real piece of cloud infrastructure. So, when it changes + // in some way, the cloud resource needs to be updated (and vice versa). That is not true + // for a component resource. The component is just used for organizational purposes and does + // not correspond to a real piece of cloud infrastructure. As such, changes to it *itself* + // do not have any effect on the cloud side of things at all. + super(type, name, /*custom:*/ false, /*props:*/ remote || (opts === null || opts === void 0 ? void 0 : opts.urn) ? args : {}, opts, remote); + /** + * A private field to help with RTTI that works in SxS scenarios. + * @internal + */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__pulumiComponentResource = true; + /** @internal */ + // eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match + this.__registered = false; + this.__remote = remote; + this.__registered = remote || !!(opts === null || opts === void 0 ? void 0 : opts.urn); + this.__data = remote || (opts === null || opts === void 0 ? void 0 : opts.urn) ? Promise.resolve({}) : this.initializeAndRegisterOutputs(args); + } + /** + * Returns true if the given object is an instance of CustomResource. This is designed to work even when + * multiple copies of the Pulumi SDK have been loaded into the same process. + */ + static isInstance(obj) { + return utils.isInstance(obj, "__pulumiComponentResource"); + } + /** @internal */ + initializeAndRegisterOutputs(args) { + return __awaiter(this, void 0, void 0, function* () { + const data = yield this.initialize(args); + this.registerOutputs(); + return data; + }); + } + /** + * Can be overridden by a subclass to asynchronously initialize data for this Component + * automatically when constructed. The data will be available immediately for subclass + * constructors to use. To access the data use `.getData`. + */ + initialize(args) { + return __awaiter(this, void 0, void 0, function* () { + return undefined; + }); + } + /** + * Retrieves the data produces by [initialize]. The data is immediately available in a + * derived class's constructor after the `super(...)` call to `ComponentResource`. + */ + getData() { + return this.__data; + } + /** + * registerOutputs registers synthetic outputs that a component has initialized, usually by + * allocating other child sub-resources and propagating their resulting property values. + * + * ComponentResources can call this at the end of their constructor to indicate that they are + * done creating child resources. This is not strictly necessary as this will automatically be + * called after the `initialize` method completes. + */ + registerOutputs(outputs) { + if (this.__registered) { + return; + } + this.__registered = true; + resource_1.registerResourceOutputs(this, outputs || {}); + } +} +exports.ComponentResource = ComponentResource; +ComponentResource.doNotCapture = true; +ComponentResource.prototype.registerOutputs.doNotCapture = true; +ComponentResource.prototype.initialize.doNotCapture = true; +ComponentResource.prototype.initializeAndRegisterOutputs.doNotCapture = true; +/** @internal */ +exports.testingOptions = { + isDryRun: false, +}; +function mergeOptions(opts1, opts2) { + const dest = Object.assign({}, opts1); + const source = Object.assign({}, opts2); + // Ensure provider/providers are all expanded into the `ProviderResource[]` form. + // This makes merging simple. + expandProviders(dest); + expandProviders(source); + // iterate specifically over the supplied properties in [source]. Note: there may not be an + // corresponding value in [dest]. + for (const key of Object.keys(source)) { + const destVal = dest[key]; + const sourceVal = source[key]; + // For 'dependsOn' we might have singleton resources in both options bags. We + // want to make sure we combine them into a collection. + if (key === "dependsOn") { + dest[key] = merge(destVal, sourceVal, /*alwaysCreateArray:*/ true); + continue; + } + dest[key] = merge(destVal, sourceVal, /*alwaysCreateArray:*/ false); + } + // Now, if we are left with a .providers that is just a single key/value pair, then + // collapse that down into .provider form. + normalizeProviders(dest); + return dest; +} +exports.mergeOptions = mergeOptions; +function isPromiseOrOutput(val) { + return val instanceof Promise || output_1.Output.isInstance(val); +} +/** @internal */ +function expandProviders(options) { + // Convert 'providers' map to array form. + if (options.providers && !Array.isArray(options.providers)) { + for (const k in options.providers) { + if (Object.prototype.hasOwnProperty.call(options.providers, k)) { + const v = options.providers[k]; + if (k !== v.getPackage()) { + const message = `provider resource map where key ${k} doesn't match provider ${v.getPackage()}`; + log.warn(message); + } + } + } + options.providers = utils.values(options.providers); + } +} +exports.expandProviders = expandProviders; +function normalizeProviders(opts) { + // If we have 0 providers, delete providers. Otherwise, convert providers into a map. + const providers = opts.providers; + if (providers) { + if (providers.length === 0) { + opts.providers = undefined; + } + else { + opts.providers = {}; + for (const res of providers) { + opts.providers[res.getPackage()] = res; + } + } + } +} +/** @internal for testing purposes. */ +function merge(dest, source, alwaysCreateArray) { + // unwind any top level promise/outputs. + if (isPromiseOrOutput(dest)) { + return output_1.output(dest).apply((d) => merge(d, source, alwaysCreateArray)); + } + if (isPromiseOrOutput(source)) { + return output_1.output(source).apply((s) => merge(dest, s, alwaysCreateArray)); + } + // If either are an array, make a new array and merge the values into it. + // Otherwise, just overwrite the destination with the source value. + if (alwaysCreateArray || Array.isArray(dest) || Array.isArray(source)) { + const result = []; + addToArray(result, dest); + addToArray(result, source); + return result; + } + return source; +} +exports.merge = merge; +function addToArray(resultArray, value) { + if (Array.isArray(value)) { + resultArray.push(...value); + } + else if (value !== undefined && value !== null) { + resultArray.push(value); + } +} +/** + * A DependencyResource is a resource that is used to indicate that an Output has a dependency on a particular + * resource. These resources are only created when dealing with remote component resources. + */ +class DependencyResource extends CustomResource { + constructor(urn) { + super("", "", {}, {}, true); + this.urn = new output_1.Output(this, Promise.resolve(urn), Promise.resolve(true), Promise.resolve(false), Promise.resolve([])); + } +} +exports.DependencyResource = DependencyResource; +/** + * A DependencyProviderResource is a resource that is used by the provider SDK as a stand-in for a provider that + * is only used for its reference. Its only valid properties are its URN and ID. + */ +class DependencyProviderResource extends ProviderResource { + constructor(ref) { + const [urn, id] = parseResourceReference(ref); + const urnParts = urn.split("::"); + const qualifiedType = urnParts[2]; + const type = qualifiedType.split("$").pop(); + // type will be "pulumi:providers:" and we want the last part. + const typeParts = type.split(":"); + const pkg = typeParts.length > 2 ? typeParts[2] : ""; + super(pkg, "", {}, {}, true); + this.urn = new output_1.Output(this, Promise.resolve(urn), Promise.resolve(true), Promise.resolve(false), Promise.resolve([])); + this.id = new output_1.Output(this, Promise.resolve(id), Promise.resolve(true), Promise.resolve(false), Promise.resolve([])); + } +} +exports.DependencyProviderResource = DependencyProviderResource; +/** + * parseResourceReference parses the URN and ID out of the provider reference. + * @internal + */ +function parseResourceReference(ref) { + const lastSep = ref.lastIndexOf("::"); + if (lastSep === -1) { + throw new Error(`expected '::' in provider reference ${ref}`); + } + const urn = ref.slice(0, lastSep); + const id = ref.slice(lastSep + 2); + return [urn, id]; +} +exports.parseResourceReference = parseResourceReference; +//# sourceMappingURL=resource.js.map + +/***/ }), + +/***/ 86358: +/***/ (function(__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 __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 closeValue = "7473659d-924c-414d-84e5-b1640b2a6296"; +// PushableAsyncIterable is an `AsyncIterable` that data can be pushed to. It is useful for turning +// push-based callback APIs into pull-based `AsyncIterable` APIs. For example, a user can write: +// +// const queue = new PushableAsyncIterable(); +// call.on("data", (thing: any) => queue.push(live)); +// +// And then later consume `queue` as any other `AsyncIterable`: +// +// for await (const l of list) { +// console.log(l.metadata.name); +// } +// +// Note that this class implements `AsyncIterable`. This is for a fundamental reason: +// the user can call `complete` at any time. `AsyncIteratable` would normally know when an element +// is the last, but in this case it can't. Or, another way to look at it is, the last element is +// guaranteed to be `undefined`. +/** @internal */ +class PushableAsyncIterable { + constructor() { + this.bufferedData = []; + this.nextQueue = []; + this.completed = false; + } + push(payload) { + if (this.nextQueue.length === 0) { + this.bufferedData.push(payload); + } + else { + const resolve = this.nextQueue.shift(); + resolve(payload); + } + } + complete() { + this.completed = true; + if (this.nextQueue.length > 0) { + const resolve = this.nextQueue.shift(); + resolve(closeValue); + } + } + shift() { + return new Promise((resolve) => { + if (this.bufferedData.length === 0) { + if (this.completed === true) { + resolve(closeValue); + } + this.nextQueue.push(resolve); + } + else { + resolve(this.bufferedData.shift()); + } + }); + } + [Symbol.asyncIterator]() { + const t = this; + return { + next() { + return __awaiter(this, void 0, void 0, function* () { + const value = yield t.shift(); + if (value === closeValue) { + return { value: undefined, done: true }; + } + return { value, done: false }; + }); + }, + }; + } +} +exports.PushableAsyncIterable = PushableAsyncIterable; +//# sourceMappingURL=asyncIterableUtil.js.map + +/***/ }), + +/***/ 38673: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// Copyright 2016-2024, 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const grpc = __importStar(__nccwpck_require__(7025)); +const crypto_1 = __nccwpck_require__(6113); +const gstruct = __importStar(__nccwpck_require__(68152)); +const log = __importStar(__nccwpck_require__(80642)); +const output_1 = __nccwpck_require__(43037); +const callrpc = __importStar(__nccwpck_require__(88149)); +const callback_pb_1 = __nccwpck_require__(89619); +const resproto = __importStar(__nccwpck_require__(52480)); +const resource_1 = __nccwpck_require__(90796); +const resource_2 = __nccwpck_require__(30140); +const rpc_1 = __nccwpck_require__(25158); +// maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) +/** @internal */ +const maxRPCMessageSize = 1024 * 1024 * 400; +class CallbackServer { + constructor(monitor) { + this._callbacks = new Map(); + this._pendingRegistrations = 0; + this._awaitQueue = []; + this._monitor = monitor; + this._server = new grpc.Server({ + "grpc.max_receive_message_length": maxRPCMessageSize, + }); + const implementation = { + invoke: this.invoke.bind(this), + }; + this._server.addService(callrpc.CallbacksService, implementation); + const self = this; + this._target = new Promise((resolve, reject) => { + self._server.bindAsync(`127.0.0.1:0`, grpc.ServerCredentials.createInsecure(), (err, port) => { + if (err !== null) { + reject(err); + return; + } + // The server takes a while to _actually_ startup so we need to keep trying to send an invoke + // to ourselves before we resolve the address to tell the engine about it. + const target = `127.0.0.1:${port}`; + const client = new callrpc.CallbacksClient(target, grpc.credentials.createInsecure()); + const connect = () => { + client.invoke(new callback_pb_1.CallbackInvokeRequest(), (error, _) => { + if ((error === null || error === void 0 ? void 0 : error.code) === grpc.status.UNAVAILABLE) { + setTimeout(connect, 1000); + return; + } + // The expected error given we didn't give a token to the invoke. + if ((error === null || error === void 0 ? void 0 : error.details) === "callback not found: ") { + resolve(target); + return; + } + reject(error); + }); + }; + connect(); + }); + }); + } + awaitStackRegistrations() { + if (this._pendingRegistrations === 0) { + return Promise.resolve(); + } + return new Promise((resolve, reject) => { + this._awaitQueue.push((reason) => { + if (reason !== undefined) { + reject(reason); + } + else { + resolve(); + } + }); + }); + } + shutdown() { + this._server.forceShutdown(); + } + invoke(call, callback) { + return __awaiter(this, void 0, void 0, function* () { + const req = call.request; + const cb = this._callbacks.get(req.getToken()); + if (cb === undefined) { + const err = new grpc.StatusBuilder(); + err.withCode(grpc.status.INVALID_ARGUMENT); + err.withDetails("callback not found: " + req.getToken()); + callback(err.build()); + return; + } + try { + const response = yield cb(req.getRequest_asU8()); + const resp = new callback_pb_1.CallbackInvokeResponse(); + resp.setResponse(response.serializeBinary()); + callback(null, resp); + } + catch (e) { + const err = new grpc.StatusBuilder(); + err.withCode(grpc.status.UNKNOWN); + if (e instanceof Error) { + err.withDetails(e.message); + } + else { + err.withDetails(JSON.stringify(e)); + } + callback(err.build()); + } + }); + } + registerTransform(transform) { + return __awaiter(this, void 0, void 0, function* () { + const cb = (bytes) => __awaiter(this, void 0, void 0, function* () { + const request = resproto.TransformRequest.deserializeBinary(bytes); + let opts = request.getOptions() || new resproto.TransformResourceOptions(); + let ropts; + if (request.getCustom()) { + ropts = { + deleteBeforeReplace: opts.getDeleteBeforeReplace(), + additionalSecretOutputs: opts.getAdditionalSecretOutputsList(), + }; + } + else { + const providers = {}; + for (const [key, value] of opts.getProvidersMap().entries()) { + providers[key] = new resource_1.DependencyProviderResource(value); + } + ropts = { + providers: providers, + }; + } + ropts.aliases = opts.getAliasesList().map((alias) => { + if (alias.hasUrn()) { + return alias.getUrn(); + } + else { + const spec = alias.getSpec(); + if (spec === undefined) { + throw new Error("alias must have either a urn or a spec"); + } + const nodeAlias = { + name: spec.getName(), + type: spec.getType(), + project: spec.getProject(), + stack: spec.getStack(), + parent: spec.getParenturn() !== "" ? new resource_1.DependencyResource(spec.getParenturn()) : undefined, + }; + if (spec.getNoparent()) { + nodeAlias.parent = resource_1.rootStackResource; + } + return nodeAlias; + } + }); + const timeouts = opts.getCustomTimeouts(); + if (timeouts !== undefined) { + ropts.customTimeouts = { + create: timeouts.getCreate(), + update: timeouts.getUpdate(), + delete: timeouts.getDelete(), + }; + } + ropts.deletedWith = + opts.getDeletedWith() !== "" ? new resource_1.DependencyResource(opts.getDeletedWith()) : undefined; + ropts.dependsOn = opts.getDependsOnList().map((dep) => new resource_1.DependencyResource(dep)); + ropts.ignoreChanges = opts.getIgnoreChangesList(); + ropts.parent = request.getParent() !== "" ? new resource_1.DependencyResource(request.getParent()) : undefined; + ropts.pluginDownloadURL = opts.getPluginDownloadUrl() !== "" ? opts.getPluginDownloadUrl() : undefined; + ropts.protect = opts.getProtect(); + ropts.provider = opts.getProvider() !== "" ? new resource_1.DependencyProviderResource(opts.getProvider()) : undefined; + ropts.replaceOnChanges = opts.getReplaceOnChangesList(); + ropts.retainOnDelete = opts.getRetainOnDelete(); + ropts.version = opts.getVersion() !== "" ? opts.getVersion() : undefined; + const props = request.getProperties(); + const args = { + custom: request.getCustom(), + type: request.getType(), + name: request.getName(), + props: props === undefined ? {} : rpc_1.deserializeProperties(props), + opts: ropts, + }; + const result = yield transform(args); + const response = new resproto.TransformResponse(); + if (result === undefined) { + response.setProperties(request.getProperties()); + response.setOptions(request.getOptions()); + } + else { + const mprops = yield rpc_1.serializeProperties("props", result.props); + response.setProperties(gstruct.Struct.fromJavaScript(mprops)); + // Copy the options over. + if (result.opts !== undefined) { + opts = new resproto.TransformResourceOptions(); + if (result.opts.aliases !== undefined) { + const aliases = []; + const uniqueAliases = new Set(); + for (const alias of result.opts.aliases || []) { + const aliasVal = yield output_1.output(alias).promise(); + if (!uniqueAliases.has(aliasVal)) { + uniqueAliases.add(aliasVal); + aliases.push(aliasVal); + } + } + opts.setAliasesList(yield resource_2.mapAliasesForRequest(aliases, request.getParent())); + } + if (result.opts.customTimeouts !== undefined) { + const customTimeouts = new resproto.RegisterResourceRequest.CustomTimeouts(); + if (result.opts.customTimeouts.create !== undefined) { + customTimeouts.setCreate(result.opts.customTimeouts.create); + } + if (result.opts.customTimeouts.update !== undefined) { + customTimeouts.setUpdate(result.opts.customTimeouts.update); + } + if (result.opts.customTimeouts.delete !== undefined) { + customTimeouts.setDelete(result.opts.customTimeouts.delete); + } + opts.setCustomTimeouts(customTimeouts); + } + if (result.opts.deletedWith !== undefined) { + opts.setDeletedWith(yield result.opts.deletedWith.urn.promise()); + } + if (result.opts.dependsOn !== undefined) { + const resolvedDeps = yield output_1.output(result.opts.dependsOn).promise(); + const deps = []; + if (resource_1.Resource.isInstance(resolvedDeps)) { + deps.push(yield resolvedDeps.urn.promise()); + } + else { + for (const dep of resolvedDeps) { + deps.push(yield dep.urn.promise()); + } + } + opts.setDependsOnList(deps); + } + if (result.opts.ignoreChanges !== undefined) { + opts.setIgnoreChangesList(result.opts.ignoreChanges); + } + if (result.opts.pluginDownloadURL !== undefined) { + opts.setPluginDownloadUrl(result.opts.pluginDownloadURL); + } + if (result.opts.protect !== undefined) { + opts.setProtect(result.opts.protect); + } + if (result.opts.provider !== undefined) { + const providerURN = yield result.opts.provider.urn.promise(); + const providerID = (yield result.opts.provider.id.promise()) || rpc_1.unknownValue; + opts.setProvider(`${providerURN}::${providerID}`); + } + if (result.opts.replaceOnChanges !== undefined) { + opts.setReplaceOnChangesList(result.opts.replaceOnChanges); + } + if (result.opts.retainOnDelete !== undefined) { + opts.setRetainOnDelete(result.opts.retainOnDelete); + } + if (result.opts.version !== undefined) { + opts.setVersion(result.opts.version); + } + if (request.getCustom()) { + const copts = result.opts; + if (copts.deleteBeforeReplace !== undefined) { + opts.setDeleteBeforeReplace(copts.deleteBeforeReplace); + } + if (copts.additionalSecretOutputs !== undefined) { + opts.setAdditionalSecretOutputsList(copts.additionalSecretOutputs); + } + } + else { + const copts = result.opts; + if (copts.providers !== undefined) { + const providers = opts.getProvidersMap(); + if (copts.providers && !Array.isArray(copts.providers)) { + for (const k in copts.providers) { + if (Object.prototype.hasOwnProperty.call(copts.providers, k)) { + const v = copts.providers[k]; + if (k !== v.getPackage()) { + const message = `provider resource map where key ${k} doesn't match provider ${v.getPackage()}`; + log.warn(message); + } + } + } + } + const provs = Object.values(copts.providers); + for (const prov of provs) { + const providerURN = yield prov.urn.promise(); + const providerID = (yield prov.id.promise()) || rpc_1.unknownValue; + providers.set(prov.getPackage(), `${providerURN}::${providerID}`); + } + opts.clearProvidersMap(); + } + } + } + response.setOptions(opts); + } + return response; + }); + const tryCb = (bytes) => __awaiter(this, void 0, void 0, function* () { + try { + return yield cb(bytes); + } + catch (e) { + throw new Error(`transform failed: ${e}`); + } + }); + const uuid = crypto_1.randomUUID(); + this._callbacks.set(uuid, tryCb); + const req = new callback_pb_1.Callback(); + req.setToken(uuid); + req.setTarget(yield this._target); + return req; + }); + } + registerStackTransform(transform) { + this._pendingRegistrations++; + this.registerTransform(transform) + .then((req) => { + this._monitor.registerStackTransform(req, (err, _) => { + if (err !== null) { + // Remove this from the list of callbacks given we didn't manage to actually register it. + this._callbacks.delete(req.getToken()); + return; + } + }); + }, (err) => log.error(`failed to register stack transform: ${err}`)) + .finally(() => { + this._pendingRegistrations--; + if (this._pendingRegistrations === 0) { + const queue = this._awaitQueue; + this._awaitQueue = []; + for (const waiter of queue) { + waiter(); + } + } + }); + } +} +exports.CallbackServer = CallbackServer; +//# sourceMappingURL=callbacks.js.map + +/***/ }), + +/***/ 67146: +/***/ ((__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 state_1 = __nccwpck_require__(24741); +/** + * configEnvKey is the environment variable key that the language plugin uses to set configuration values. + * + * @internal + */ +exports.configEnvKey = "PULUMI_CONFIG"; +/** + * configSecretKeysEnvKey is the environment variable key that the language plugin uses to set configuration keys that + * contain secrets. + * + * @internal + */ +exports.configSecretKeysEnvKey = "PULUMI_CONFIG_SECRET_KEYS"; +/** + * allConfig returns a copy of the full config map. + */ +function allConfig() { + const config = parseConfig(); + return Object.assign({}, config); +} +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]; + } + persistConfig(obj, secretKeys); +} +exports.setAllConfig = setAllConfig; +/** + * setConfig sets a configuration variable. + */ +function setConfig(k, v) { + const config = parseConfig(); + config[cleanKey(k)] = v; + persistConfig(config, []); +} +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 { config } = state_1.getStore(); + const envConfigSecretKeys = config[exports.configSecretKeysEnvKey]; + if (envConfigSecretKeys) { + const envConfigSecretArray = JSON.parse(envConfigSecretKeys); + if (Array.isArray(envConfigSecretArray)) { + return envConfigSecretArray.includes(k); + } + } + return false; +} +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 { config } = state_1.getStore(); + const parsedConfig = {}; + const envConfig = config[exports.configEnvKey]; + if (envConfig) { + const envObject = JSON.parse(envConfig); + for (const k of Object.keys(envObject)) { + parsedConfig[cleanKey(k)] = envObject[k]; + } + } + return parsedConfig; +} +/** + * 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 store = state_1.getStore(); + const serializedConfig = JSON.stringify(config); + const serializedSecretKeys = Array.isArray(secretKeys) ? JSON.stringify(secretKeys) : "[]"; + store.config[exports.configEnvKey] = serializedConfig; + store.config[exports.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 key; +} +//# sourceMappingURL=config.js.map + +/***/ }), + +/***/ 20257: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// 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. +// 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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const log = __importStar(__nccwpck_require__(80642)); +const state = __importStar(__nccwpck_require__(24741)); +/** @internal + * debugPromiseLeaks can be set to enable promises leaks debugging. + */ +exports.debugPromiseLeaks = !!process.env.PULUMI_DEBUG_PROMISE_LEAKS; +/** + * leakDetectorScheduled is true when the promise leak detector is scheduled for process exit. + */ +let leakDetectorScheduled = false; +/** @internal */ +function leakedPromises() { + const localStore = state.getStore(); + const leaked = localStore.leakCandidates; + const promisePlural = leaked.size === 1 ? "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 (exports.debugPromiseLeaks) { + for (const leak of leaked) { + console.error("Promise leak detected:"); + console.error(promiseDebugString(leak)); + } + } + localStore.leakCandidates = new Set(); + return [leaked, message]; +} +exports.leakedPromises = leakedPromises; +/** @internal */ +function promiseDebugString(p) { + return `CONTEXT(${p._debugId}): ${p._debugCtx}\n` + `STACK_TRACE:\n` + `${p._debugStackTrace}`; +} +exports.promiseDebugString = promiseDebugString; +let promiseId = 0; +/** + * debuggablePromise optionally wraps a promise with some goo to make it easier to debug common problems. + * @internal + */ +function debuggablePromise(p, ctx) { + const localStore = state.getStore(); + // 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 (!exports.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. + localStore.leakCandidates.add(p); + return p + .then((val) => { + localStore.leakCandidates.delete(p); + return val; + }) + .catch((err) => { + localStore.leakCandidates.delete(p); + err.promise = p; + throw err; + }); +} +exports.debuggablePromise = debuggablePromise; +/** + * errorString produces a string from an error, conditionally including additional diagnostics. + * @internal + */ +function errorString(err) { + if (err.stack) { + return err.stack; + } + return err.toString(); +} +exports.errorString = errorString; +//# sourceMappingURL=debuggable.js.map + +/***/ }), + +/***/ 84800: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"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. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const grpc = __importStar(__nccwpck_require__(7025)); +const log = __importStar(__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 = __importStar(__nccwpck_require__(21888)); +const asyncIterableUtil_1 = __nccwpck_require__(86358); +const gstruct = __importStar(__nccwpck_require__(68152)); +const resourceproto = __importStar(__nccwpck_require__(52480)); +/** + * `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); +} +exports.invoke = invoke; +/* + * `invokeSingle` dynamically invokes the function, `tok`, which is offered by a provider plugin. + * Similar to `invoke`, but returns a single value instead of an object with a single key. + */ +function invokeSingle(tok, props, opts = {}) { + return invokeAsync(tok, props, opts).then((outputs) => { + // assume outputs have a single key + const keys = Object.keys(outputs); + // return the first key's value from the outputs + return outputs[keys[0]]; + }); +} +exports.invokeSingle = invokeSingle; +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.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(); + } + }); +} +// 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; + } + // cancel signals the `streamInvoke` should be cancelled and cleaned up gracefully. + cancel() { + this.cancelSource(); + } + [Symbol.asyncIterator]() { + return this.source[Symbol.asyncIterator](); + } +} +exports.StreamInvokeResponse = StreamInvokeResponse; +function createInvokeRequest(tok, serialized, provider, opts) { + if (provider !== undefined && typeof provider !== "string") { + throw new Error("Incorrect provider type."); + } + 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; +} +function getProvider(tok, opts) { + return opts.provider ? opts.provider : opts.parent ? opts.parent.getProvider(tok) : undefined; +} +function deserializeResponse(tok, resp) { + const failures = resp.getFailuresList(); + if (failures === null || failures === void 0 ? void 0 : 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); +} +/** + * `call` dynamically calls the function, `tok`, which is offered by a provider plugin. + */ +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; + } + // 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) => { + if (monitor === undefined) { + throw new Error("No monitor available"); + } + 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. + if (deserialized !== undefined) { + 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); + } + finally { + done(); + } + })), 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 { + resolveValue(v); + resolveIsKnown(isKnown); + resolveIsSecret(isSecret); + resolveDeps(deps); + } + }; + 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]; +} +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 resourceproto.ResourceCallRequest(); + 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 resourceproto.ResourceCallRequest.ArgumentDependencies(); + deps.setUrnsList(Array.from(urns)); + argDependencies.set(key, deps); + } + return req; + }); +} +//# sourceMappingURL=invoke.js.map + +/***/ }), + +/***/ 30140: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"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. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const grpc = __importStar(__nccwpck_require__(7025)); +const query = __importStar(__nccwpck_require__(39160)); +const log = __importStar(__nccwpck_require__(80642)); +const utils = __importStar(__nccwpck_require__(21888)); +const output_1 = __nccwpck_require__(43037); +const resource_1 = __nccwpck_require__(90796); +const debuggable_1 = __nccwpck_require__(20257); +const invoke_1 = __nccwpck_require__(84800); +const state_1 = __nccwpck_require__(24741); +const errors_1 = __nccwpck_require__(89693); +const rpc_1 = __nccwpck_require__(25158); +const settings_1 = __nccwpck_require__(34530); +const gstruct = __importStar(__nccwpck_require__(68152)); +const aliasproto = __importStar(__nccwpck_require__(36489)); +const resproto = __importStar(__nccwpck_require__(52480)); +const sourceproto = __importStar(__nccwpck_require__(32093)); +function marshalSourcePosition(sourcePosition) { + if (sourcePosition === undefined) { + return undefined; + } + const pos = new sourceproto.SourcePosition(); + pos.setUri(sourcePosition.uri); + pos.setLine(sourcePosition.line); + pos.setColumn(sourcePosition.column); + return pos; +} +/** + * 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}`); + // Wait for all values to be available, and then perform the RPC. + const done = settings_1.rpcKeepAlive(); + 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(""); + req.setAcceptresources(!utils.disableResourceReferences); + // 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 === null || failures === void 0 ? void 0 : 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(), + }; + } + } + 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); + done(); + })); + })), 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, sourcePosition) { + if (!opts.id) { + throw new Error("Cannot read resource whose options are lacking an ID value"); + } + const id = output_1.output(opts.id).promise(true); + const label = `resource:${name}[${t}]#...`; + log.debug(`Reading resource: t=${t}, name=${name}`); + // Wait for all values to be available, and then perform the RPC. + const done = settings_1.rpcKeepAlive(); + 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, yield 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 || []); + req.setSourceposition(marshalSourcePosition(sourcePosition)); + // 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 { + // If we aren't attached to the engine, in test mode, mock up a fake response for testing purposes. + const mockurn = yield resource_1.createUrn(req.getName(), req.getType(), req.getParent()).promise(); + resp = { + getUrn: () => mockurn, + getProperties: () => req.getProperties(), + }; + } + } + 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); + done(); + })); + })), label); +} +exports.readResource = readResource; +function getParentURN(parent) { + if (resource_1.Resource.isInstance(parent)) { + return parent.urn; + } + return output_1.output(parent); +} +function mapAliasesForRequest(aliases, parentURN) { + if (aliases === undefined) { + return Promise.resolve([]); + } + return Promise.all(aliases.map((a) => __awaiter(this, void 0, void 0, function* () { + const newAlias = new aliasproto.Alias(); + if (typeof a === "string") { + newAlias.setUrn(a); + } + else { + const newAliasSpec = new aliasproto.Alias.Spec(); + const name = a.name === undefined ? undefined : yield output_1.output(a.name).promise(); + const type = a.type === undefined ? undefined : yield output_1.output(a.type).promise(); + const stack = a.stack === undefined ? undefined : yield output_1.output(a.stack).promise(); + const project = a.project === undefined ? undefined : yield output_1.output(a.project).promise(); + newAliasSpec.setName(name || ""); + newAliasSpec.setType(type || ""); + newAliasSpec.setStack(stack || ""); + newAliasSpec.setProject(project || ""); + if (a.hasOwnProperty("parent")) { + if (a.parent === undefined) { + newAliasSpec.setNoparent(true); + } + else { + const aliasParentUrn = getParentURN(a.parent); + const urn = yield aliasParentUrn.promise(); + if (urn !== undefined) { + newAliasSpec.setParenturn(urn); + } + } + } + else if (parentURN) { + // If a parent isn't specified for the alias and the resource has a parent, + // pass along the resource's parent in the alias spec. + // It shouldn't be necessary to do this because the engine should fill-in the + // resource's parent if one wasn't specified for the alias. + // However, some older versions of the CLI don't do this correctly, and this + // SDK has always passed along the parent in this way, so we continue doing it + // to maintain compatibility with these versions of the CLI. + newAliasSpec.setParenturn(parentURN); + } + newAlias.setSpec(newAliasSpec); + } + return newAlias; + }))); +} +exports.mapAliasesForRequest = mapAliasesForRequest; +/** + * 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, sourcePosition) { + const label = `resource:${name}[${t}]`; + log.debug(`Registering resource: t=${t}, name=${name}, custom=${custom}, remote=${remote}`); + // Wait for all values to be available, and then perform the RPC. + const done = settings_1.rpcKeepAlive(); + const monitor = settings_1.getMonitor(); + const resopAsync = prepareResource(label, res, parent, custom, remote, props, opts, t, name); + // 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)}` : ``)); + yield settings_1.awaitStackRegistrations(); + const callbacks = []; + if (opts.transforms !== undefined && opts.transforms.length > 0) { + if (!state_1.getStore().supportsTransforms) { + throw new Error("The Pulumi CLI does not support transforms. Please update the Pulumi CLI"); + } + const callbackServer = settings_1.getCallbacks(); + if (callbackServer === undefined) { + throw new Error("Callback server could not initialize"); + } + for (const transform of opts.transforms) { + callbacks.push(yield callbackServer.registerTransform(transform)); + } + } + 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 || false); + 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 || []); + if (resop.monitorSupportsStructuredAliases) { + const aliasesList = yield mapAliasesForRequest(resop.aliases, resop.parentURN); + req.setAliasesList(aliasesList); + } + else { + const urns = new Array(); + resop.aliases.forEach((v) => { + if (typeof v === "string") { + urns.push(v); + } + }); + req.setAliasurnsList(urns); + } + req.setImportid(resop.import || ""); + req.setSupportspartialvalues(true); + req.setRemote(remote); + req.setReplaceonchangesList(opts.replaceOnChanges || []); + req.setPlugindownloadurl(opts.pluginDownloadURL || ""); + req.setRetainondelete(opts.retainOnDelete || false); + req.setDeletedwith(resop.deletedWithURN || ""); + req.setAliasspecs(true); + req.setSourceposition(marshalSourcePosition(sourcePosition)); + req.setTransformsList(callbacks); + req.setSupportsresultreporting(true); + if (resop.deletedWithURN && !state_1.getStore().supportsDeletedWith) { + throw new Error("The Pulumi CLI does not support the DeletedWith option. Please update the Pulumi CLI."); + } + 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_1.createUrn(req.getName(), req.getType(), req.getParent()).promise(); + resp = { + getUrn: () => mockurn, + getId: () => undefined, + getObject: () => req.getObject(), + getPropertydependenciesMap: () => undefined, + getResult: () => 0, + }; + } + } + catch (e) { + err = e; + resp = { + getUrn: () => "", + getId: () => undefined, + getObject: () => req.getObject(), + getPropertydependenciesMap: () => undefined, + getResult: () => 0, + }; + } + 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. + const keepUnknowns = resp.getResult() !== resproto.Result.SUCCESS; + yield resolveOutputs(res, t, name, props, resp.getObject(), deps, resop.resolvers, err, keepUnknowns); + done(); + })); + })), label); +} +exports.registerResource = registerResource; +/** @internal + * 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, type, name) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + // 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) { + if (errors_1.isGrpcError(err)) { + if (debuggable_1.debugPromiseLeaks) { + console.error("info: skipped rejection in resolveURN"); + } + return; + } + 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) { + if (errors_1.isGrpcError(err)) { + if (debuggable_1.debugPromiseLeaks) { + console.error("info: skipped rejection in resolveID"); + } + return; + } + 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 importID; + if (custom) { + const customOpts = opts; + importID = customOpts.import; + } + let providerRef; + let sendProvider = custom; + if (remote && opts.provider) { + // If it's a remote component and a provider was specified, only + // send the provider in the request if the provider's package is + // the same as the component's package. Otherwise, don't send it + // because the user specified `provider: someProvider` as shorthand + // for `providers: [someProvider]`. + const pkg = pkgFromType(type); + if (pkg && pkg === opts.provider.getPackage()) { + sendProvider = true; + } + } + if (sendProvider) { + providerRef = yield resource_1.ProviderResource.register(opts.provider); + } + const providerRefs = new Map(); + if (remote || !custom) { + 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 in a future version. 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_1.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); + } + const monitorSupportsStructuredAliases = state_1.getStore().supportsAliasSpecs; + let computedAliases; + if (!monitorSupportsStructuredAliases && parent) { + computedAliases = resource_1.allAliases(opts.aliases || [], name, type, parent, parent.__name); + } + else { + computedAliases = opts.aliases || []; + } + // Wait for all aliases. + const aliases = []; + const uniqueAliases = new Set(); + for (const alias of computedAliases || []) { + const aliasVal = yield output_1.output(alias).promise(); + if (!uniqueAliases.has(aliasVal)) { + uniqueAliases.add(aliasVal); + aliases.push(aliasVal); + } + } + const deletedWithURN = (opts === null || opts === void 0 ? void 0 : opts.deletedWith) ? yield opts.deletedWith.urn.promise() : undefined; + return { + resolveURN: resolveURN, + resolveID: resolveID, + resolvers: resolvers, + serializedProps: serializedProps, + parentURN: parentURN, + providerRef: providerRef, + providerRefs: providerRefs, + allDirectDependencyURNs: allDirectDependencyURNs, + propertyToDirectDependencyURNs: propertyToDirectDependencyURNs, + aliases: aliases, + import: importID, + monitorSupportsStructuredAliases, + deletedWithURN, + }; + }); +} +exports.prepareResource = prepareResource; +function addAll(to, from) { + for (const val of from) { + to.add(val); + } +} +/** @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, exclude); + // Then we filter to only include Custom and Remote resources. + const transitivelyReachableCustomResources = [...transitivelyReachableResources].filter((r) => (resource_1.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.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, exclude) { + 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, exclude, result); + return result; + }); +} +function addTransitivelyReferencedChildResourcesOfComponentResources(resources, exclude, 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_1.ComponentResource.isInstance(resource)) { + // Skip including children of a resource in the excluded set to avoid depending on + // children that haven't been registered yet. + if (exclude.has(resource)) { + continue; + } + // 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; + const children = resource.__childResources; + addTransitivelyReferencedChildResourcesOfComponentResources(children, exclude, result); + } + } + } + } + }); +} +/** + * 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_1.Resource.isInstance(dependsOn)) { + throw new Error("'dependsOn' was passed a value that was not a Resource."); + } + return [dependsOn]; + } + } + return []; + }); +} +/** + * 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, keepUnknowns) { + 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, keepUnknowns)); + } + 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, keepUnknowns); + } + } + } + rpc_1.resolveProperties(res, resolvers, t, name, allProps, deps, err, keepUnknowns); + }); +} +/** + * 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(...)`; + const done = settings_1.rpcKeepAlive(); + 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); + } + done(); + }), 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`); + } + return callback(); + })), label + "-initial")); + const finalOp = debuggable_1.debuggablePromise(resourceOp, 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}`); + } + } +} +/** + * Extract the pkg from the type token of the form "pkg:module:member". + * @internal + */ +function pkgFromType(type) { + const parts = type.split(":"); + if (parts.length === 3) { + return parts[0]; + } + return undefined; +} +exports.pkgFromType = pkgFromType; +//# sourceMappingURL=resource.js.map + +/***/ }), + +/***/ 25158: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// Copyright 2016-2024, 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const asset = __importStar(__nccwpck_require__(83031)); +const errors_1 = __nccwpck_require__(89693); +const log = __importStar(__nccwpck_require__(80642)); +const output_1 = __nccwpck_require__(43037); +const resource_1 = __nccwpck_require__(90796); +const debuggable_1 = __nccwpck_require__(20257); +const resource_2 = __nccwpck_require__(30140); +const settings_1 = __nccwpck_require__(34530); +const state_1 = __nccwpck_require__(24741); +const semver = __importStar(__nccwpck_require__(11383)); +/** + * 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) { + if (errors_1.isGrpcError(err)) { + if (debuggable_1.debugPromiseLeaks) { + console.error("info: skipped rejection in transferProperties"); + } + return; + } + 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.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); + } + } + } + return [result, propertyToDependentResources]; + }); +} +/** + * 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.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.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; +/** + * deserializeProperties fetches the raw outputs and deserializes them from a gRPC call result. + */ +function deserializeProperties(outputsStruct, keepUnknowns) { + 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], keepUnknowns); + } + } + return props; +} +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, keepUnknowns) { + // 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 updates when the update of the resource was either skipped or failed we'll mark them as `unknown`. + for (const k of Object.keys(resolvers)) { + if (!allProps.hasOwnProperty(k)) { + const resolve = resolvers[k]; + if (!settings_1.isDryRun && keepUnknowns) { + resolve(output_1.unknown, true, false); + } + else { + resolve(undefined, !settings_1.isDryRun() && !keepUnknowns, false); + } + } + } +} +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) { + 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 ((opts === null || opts === void 0 ? void 0 : opts.keepOutputValues) && state_1.getStore().supportsOutputValues) { + 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 && state_1.getStore().supportsSecrets) { + 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 (state_1.getStore().supportsResourceReferences) { + // 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 (state_1.getStore().supportsResourceReferences) { + // 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.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; +} +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.unwrapRpcSecret = unwrapRpcSecret; +/** + * deserializeProperty unpacks some special types, reversing the above process. + */ +function deserializeProperty(prop, keepUnknowns) { + if (prop === undefined) { + throw new Error("unexpected undefined property value during deserialization"); + } + else if (prop === exports.unknownValue) { + return settings_1.isDryRun() || keepUnknowns ? 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, keepUnknowns); + 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], keepUnknowns); + 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"], keepUnknowns), + }; + 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, keepUnknowns); + } + return urn; + case exports.specialOutputValueSig: + let value = prop["value"]; + const isKnown = value !== undefined; + if (isKnown) { + value = deserializeProperty(value, keepUnknowns); + } + 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], keepUnknowns); + hadSecrets = hadSecrets || isRpcSecret(o); + obj[k] = unwrapRpcSecret(o); + } + if (hadSecrets) { + return { + [exports.specialSigKey]: exports.specialSecretSig, + value: obj, + }; + } + return obj; + } +} +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)) !== 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 + +/***/ }), + +/***/ 34530: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"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. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const grpc = __importStar(__nccwpck_require__(7025)); +const fs = __importStar(__nccwpck_require__(57147)); +const path = __importStar(__nccwpck_require__(71017)); +const callbacks_1 = __nccwpck_require__(38673); +const debuggable_1 = __nccwpck_require__(20257); +const state_1 = __nccwpck_require__(24741); +const engrpc = __importStar(__nccwpck_require__(5053)); +const engproto = __importStar(__nccwpck_require__(10986)); +const resrpc = __importStar(__nccwpck_require__(25815)); +const resproto = __importStar(__nccwpck_require__(52480)); +// maxRPCMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb) +/** @internal */ +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; +let monitor; +let engine; +// 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, organization) { + const store = state_1.getStore(); + monitor = undefined; + engine = undefined; + store.settings.monitor = undefined; + store.settings.engine = undefined; + store.settings.rpcDone = Promise.resolve(); + store.settings.featureSupport = {}; + // reset node specific environment variables in the process + store.settings.options.project = project; + store.settings.options.stack = stack; + store.settings.options.dryRun = preview; + store.settings.options.queryMode = isQueryMode(); + store.settings.options.parallel = parallel; + store.settings.options.monitorAddr = monitorAddr; + store.settings.options.engineAddr = engineAddr; + store.settings.options.organization = organization; + store.leakCandidates = new Set(); + store.logErrorCount = 0; + store.stackResource = undefined; + store.supportsSecrets = false; + store.supportsResourceReferences = false; + store.supportsOutputValues = false; + store.supportsDeletedWith = false; + store.supportsAliasSpecs = false; + store.supportsTransforms = false; + store.callbacks = undefined; +} +exports.resetOptions = resetOptions; +function setMockOptions(mockMonitor, project, stack, preview, organization) { + const opts = options(); + resetOptions(project || opts.project || "project", stack || opts.stack || "stack", opts.parallel || -1, opts.engineAddr || "", opts.monitorAddr || "", preview || false, organization || ""); + monitor = mockMonitor; +} +exports.setMockOptions = setMockOptions; +/** @internal Used only for testing purposes. */ +function _setIsDryRun(val) { + const { settings } = state_1.getStore(); + settings.options.dryRun = val; +} +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.isDryRun = isDryRun; +/** + * monitorSupportsFeature returns a promise that when resolved tells you if the resource monitor we are connected + * to is able to support a particular feature. + * + * @internal + */ +function monitorSupportsFeature(monitorClient, feature) { + return __awaiter(this, void 0, void 0, function* () { + const req = new resproto.SupportsFeatureRequest(); + req.setId(feature); + const result = yield new Promise((resolve, reject) => { + monitorClient.supportsFeature(req, (err, resp) => { + // Back-compat case - if the monitor doesn't let us ask if it supports a feature, it doesn't support + // any features. + if (err && err.code === grpc.status.UNIMPLEMENTED) { + return resolve(false); + } + if (err) { + return reject(err); + } + if (resp === undefined) { + return reject(new Error("No response from resource monitor")); + } + return resolve(resp.getHassupport()); + }); + }); + return result; + }); +} +/** + * Queries the resource monitor for its capabilities and sets the appropriate flags in the store. + * + * @internal + **/ +function awaitFeatureSupport() { + return __awaiter(this, void 0, void 0, function* () { + const monitorRef = getMonitor(); + if (monitorRef !== undefined) { + const store = state_1.getStore(); + store.supportsSecrets = yield monitorSupportsFeature(monitorRef, "secrets"); + store.supportsResourceReferences = yield monitorSupportsFeature(monitorRef, "resourceReferences"); + store.supportsOutputValues = yield monitorSupportsFeature(monitorRef, "outputValues"); + store.supportsDeletedWith = yield monitorSupportsFeature(monitorRef, "deletedWith"); + store.supportsAliasSpecs = yield monitorSupportsFeature(monitorRef, "aliasSpecs"); + store.supportsTransforms = yield monitorSupportsFeature(monitorRef, "transforms"); + } + }); +} +exports.awaitFeatureSupport = awaitFeatureSupport; +/** @internal Used only for testing purposes. */ +function _setQueryMode(val) { + const { settings } = state_1.getStore(); + settings.options.queryMode = val; +} +exports._setQueryMode = _setQueryMode; +/** @internal Used only for testing purposes */ +function _reset() { + resetOptions("", "", -1, "", "", false, ""); +} +exports._reset = _reset; +/** + * 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 organization being run by the current update. + */ +function getOrganization() { + const organization = options().organization; + if (organization) { + return organization; + } + // If the organization is missing, specialize the error. + // Throw an error if test mode is enabled, instructing how to manually configure the organization: + throw new Error("Missing organization name; for test mode, please call `pulumi.runtime.setMocks`"); +} +exports.getOrganization = getOrganization; +/** @internal Used only for testing purposes. */ +function _setOrganization(val) { + const { settings } = state_1.getStore(); + settings.options.organization = val; + return settings.options.organization; +} +exports._setOrganization = _setOrganization; +/** + * Get the project being run by the current update. + */ +function getProject() { + const { project } = options(); + return project || ""; +} +exports.getProject = getProject; +/** @internal Used only for testing purposes. */ +function _setProject(val) { + const { settings } = state_1.getStore(); + settings.options.project = val; + return settings.options.project; +} +exports._setProject = _setProject; +/** + * Get the stack being targeted by the current update. + */ +function getStack() { + const { stack } = options(); + return stack || ""; +} +exports.getStack = getStack; +/** @internal Used only for testing purposes. */ +function _setStack(val) { + const { settings } = state_1.getStore(); + settings.options.stack = val; + return settings.options.stack; +} +exports._setStack = _setStack; +/** + * 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() { + const { settings } = state_1.getStore(); + const addr = options().monitorAddr; + if (state_1.getLocalStore() === undefined) { + if (monitor === undefined) { + if (addr) { + // Lazily initialize the RPC connection to the monitor. + monitor = new resrpc.ResourceMonitorClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); + settings.options.monitorAddr = addr; + } + } + return monitor; + } + else { + if (settings.monitor === undefined) { + if (addr) { + // Lazily initialize the RPC connection to the monitor. + settings.monitor = new resrpc.ResourceMonitorClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); + settings.options.monitorAddr = addr; + } + } + return settings.monitor; + } +} +exports.getMonitor = getMonitor; +/** + * Waits for any pending stack transforms to register. + */ +function awaitStackRegistrations() { + return __awaiter(this, void 0, void 0, function* () { + const store = state_1.getStore(); + const callbacks = store.callbacks; + if (callbacks === undefined) { + return; + } + return yield callbacks.awaitStackRegistrations(); + }); +} +exports.awaitStackRegistrations = awaitStackRegistrations; +/** + * getCallbacks returns the current callbacks for RPC communications. + */ +function getCallbacks() { + const store = state_1.getStore(); + const callbacks = store.callbacks; + if (callbacks !== undefined) { + return callbacks; + } + const monitorRef = getMonitor(); + if (monitorRef === undefined) { + return undefined; + } + const callbackServer = new callbacks_1.CallbackServer(monitorRef); + store.callbacks = callbackServer; + return callbackServer; +} +exports.getCallbacks = getCallbacks; +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 }; + } + return syncInvokes; +} +exports.tryGetSyncInvokes = tryGetSyncInvokes; +/** + * 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() { + const { settings } = state_1.getStore(); + if (state_1.getLocalStore() === undefined) { + 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); + } + } + return engine; + } + else { + if (settings.engine === undefined) { + const addr = options().engineAddr; + if (addr) { + // Lazily initialize the RPC connection to the engine. + settings.engine = new engrpc.EngineClient(addr, grpc.credentials.createInsecure(), grpcChannelOptions); + } + } + return settings.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() { + const { settings } = state_1.getStore(); + return settings.options; +} +/** + * 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) { + const localStore = state_1.getStore(); + let done; + const closeCallback = () => { + if (done !== localStore.settings.rpcDone) { + // If the done promise has changed, some activity occurred in between callbacks. Wait again. + done = localStore.settings.rpcDone; + return debuggable_1.debuggablePromise(done.then(closeCallback), "disconnect"); + } + if (disconnectFromServers) { + disconnectSync(); + } + return Promise.resolve(); + }; + return closeCallback(); +} +exports.waitForRPCs = waitForRPCs; +/** + * getMaximumListeners returns the configured number of process listeners available + */ +function getMaximumListeners() { + const { settings } = state_1.getStore(); + return settings.options.maximumProcessListeners; +} +exports.getMaximumListeners = getMaximumListeners; +/** + * 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). + const store = state_1.getStore(); + if (store.callbacks) { + store.callbacks.shutdown(); + store.callbacks = undefined; + } + if (monitor) { + try { + monitor.close(); + } + catch (err) { + // ignore. + } + monitor = undefined; + } + if (engine) { + try { + engine.close(); + } + catch (err) { + // ignore. + } + engine = undefined; + } +} +exports.disconnectSync = disconnectSync; +/** + * 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() { + const localStore = state_1.getStore(); + let done = undefined; + const donePromise = debuggable_1.debuggablePromise(new Promise((resolve) => { + done = resolve; + return done; + }), "rpcKeepAlive"); + localStore.settings.rpcDone = localStore.settings.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* () { + // This is the first async point of program startup where we can query the resource monitor for its capabilities. + yield awaitFeatureSupport(); + 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; +//# 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()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const asset = __importStar(__nccwpck_require__(83031)); +const log_1 = __nccwpck_require__(80642); +const metadata_1 = __nccwpck_require__(8085); +const output_1 = __nccwpck_require__(43037); +const resource_1 = __nccwpck_require__(90796); +const settings_1 = __nccwpck_require__(34530); +const state_1 = __nccwpck_require__(24741); +/** + * 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"; +/** + * 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. + state_1.setStackResource(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 args.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 + state_1.setStackResource(this); + let outputs; + try { + const inputs = yield args.init(); + outputs = yield massage(undefined, 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; + }); + } +} +exports.Stack = Stack; +function massage(key, prop, objectStack) { + return __awaiter(this, void 0, void 0, function* () { + if (prop === undefined && objectStack.length === 1) { + // This is a top level undefined value, it will not show up in stack outputs, warn the user about + // this. + log_1.warn(`Undefined value (${key}) will not show as a stack output.`); + return undefined; + } + if (prop === undefined || + prop === null || + typeof prop === "boolean" || + typeof prop === "number" || + typeof prop === "string") { + return prop; + } + if (prop instanceof Promise) { + return yield massage(key, yield prop, objectStack); + } + if (output_1.Output.isInstance(prop)) { + const result = prop.apply((v) => massage(key, 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(key, 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("assets", 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(undefined, 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(k, prop[k], objectStack); + } + } + return obj; + }); + } + }); +} +/** + * Add a transformation to all future resources constructed in this Pulumi stack. + */ +function registerStackTransformation(t) { + const stackResource = getStackResource(); + if (!stackResource) { + throw new Error("The root stack resource was referenced before it was initialized."); + } + stackResource.__transformations = [...(stackResource.__transformations || []), t]; +} +exports.registerStackTransformation = registerStackTransformation; +/** + * Add a transformation to all future resources constructed in this Pulumi stack. + */ +function registerStackTransform(t) { + if (!state_1.getStore().supportsTransforms) { + throw new Error("The Pulumi CLI does not support transforms. Please update the Pulumi CLI"); + } + const callbacks = settings_1.getCallbacks(); + if (!callbacks) { + throw new Error("No callback server registered."); + } + callbacks.registerStackTransform(t); +} +exports.registerStackTransform = registerStackTransform; +function getStackResource() { + return state_1.getStackResource(); +} +exports.getStackResource = getStackResource; +//# sourceMappingURL=stack.js.map + +/***/ }), + +/***/ 24741: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +// 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. +// 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 __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const async_hooks_1 = __nccwpck_require__(50852); +const config = __importStar(__nccwpck_require__(67146)); +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", + organization: "PULUMI_NODEJS_ORGANIZATION", +}; +const pulumiEnvKeys = { + legacyApply: "PULUMI_ENABLE_LEGACY_APPLY", +}; +/** @internal */ +exports.asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); +/** @internal */ +class LocalStore { + constructor() { + this.settings = { + options: { + organization: process.env[nodeEnvKeys.organization], + project: process.env[nodeEnvKeys.project] || "project", + stack: process.env[nodeEnvKeys.stack] || "stack", + dryRun: process.env[nodeEnvKeys.dryRun] === "true", + queryMode: process.env[nodeEnvKeys.queryMode] === "true", + monitorAddr: process.env[nodeEnvKeys.monitorAddr], + engineAddr: process.env[nodeEnvKeys.engineAddr], + syncDir: process.env[nodeEnvKeys.syncDir], + cacheDynamicProviders: process.env[nodeEnvKeys.cacheDynamicProviders] !== "false", + legacyApply: process.env[pulumiEnvKeys.legacyApply] === "true", + maximumProcessListeners: 30, + }, + rpcDone: Promise.resolve(), + featureSupport: {}, + }; + this.config = { + [config.configEnvKey]: process.env[config.configEnvKey] || "", + [config.configSecretKeysEnvKey]: process.env[config.configSecretKeysEnvKey] || "", + }; + this.stackResource = undefined; + /** + * leakCandidates tracks the list of potential leak candidates. + */ + this.leakCandidates = new Set(); + this.logErrorCount = 0; + this.supportsSecrets = false; + this.supportsResourceReferences = false; + this.supportsOutputValues = false; + this.supportsDeletedWith = false; + this.supportsAliasSpecs = false; + this.supportsTransforms = false; + } +} +exports.LocalStore = LocalStore; +/** Get the root stack resource for the current stack deployment + * @internal + */ +function getStackResource() { + const { stackResource } = exports.getStore(); + return stackResource; +} +exports.getStackResource = getStackResource; +/** @internal */ +function setStackResource(newStackResource) { + const localStore = exports.getStore(); + globalThis.stackResource = newStackResource; + localStore.stackResource = newStackResource; +} +exports.setStackResource = setStackResource; +/** @internal */ +function getLocalStore() { + return exports.asyncLocalStorage.getStore(); +} +exports.getLocalStore = getLocalStore; +getLocalStore.captureReplacement = () => { + const returnFunc = () => { + if (global.globalStore === undefined) { + global.globalStore = new LocalStore(); + } + return global.globalStore; + }; + return returnFunc; +}; +/** @internal */ +exports.getStore = () => { + const localStore = getLocalStore(); + if (localStore === undefined) { + if (global.globalStore === undefined) { + global.globalStore = new LocalStore(); + } + return global.globalStore; + } + return localStore; +}; +exports.getStore.captureReplacement = () => { + const returnFunc = () => { + if (global.globalStore === undefined) { + global.globalStore = new LocalStore(); + } + return global.globalStore; + }; + return returnFunc; +}; +//# sourceMappingURL=state.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, _b; +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) { + return false; + } + const val = obj[memberName]; + if (typeof val !== "boolean") { + return false; + } + return val === true; +} +exports.hasTrueBooleanMember = hasTrueBooleanMember; +/** @internal */ +function hasFunctionMember(obj, memberName) { + if (obj === undefined || obj === null) { + return false; + } + const val = obj[memberName]; + if (typeof val !== "function") { + return false; + } + return true; +} +exports.hasFunctionMember = hasFunctionMember; +// Workaround errors we sometimes get on some machines saying that Object.values is not available. +/** + * A polyfill for Object.values + * + * @internal + */ +function values(obj) { + const result = []; + for (const key of Object.keys(obj)) { + result.push(obj[key]); + } + 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) !== null && _a !== void 0 ? _a : "").toUpperCase() === "TRUE"; +/** @internal */ +exports.errorOutputString = process.env.PULUMI_ERROR_OUTPUT_STRING === "1" || ((_b = process.env.PULUMI_ERROR_OUTPUT_STRING) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === "TRUE"; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 86921: +/***/ ((__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. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.version = "3.120.0"; +//# sourceMappingURL=version.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()); + }); +}; +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 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); + } + // + // 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.AsyncQueryableImpl = AsyncQueryableImpl; +class GroupingImpl extends AsyncQueryableImpl { + constructor(key, group) { + super(group); + this.key = key; + } +} +exports.GroupingImpl = GroupingImpl; + + +/***/ }), + +/***/ 44139: +/***/ ((__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); + } +} +exports.IterableBase = IterableBase; +class GroupedAsyncIterableIteratorImpl extends IterableBase { + constructor(key, core) { + super(core); + this.key = key; + } +} +exports.GroupedAsyncIterableIteratorImpl = GroupedAsyncIterableIteratorImpl; + + +/***/ }), + +/***/ 39160: +/***/ (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__(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); +} +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)); +} +exports.range = range; +/** + * Returns an empty sequence of `TResult`. + * @example + * const noNumbers = await empty().toArray(); // == [] + */ +function empty() { + return asyncQueryable_1.AsyncQueryableImpl.from(sources.from([])); +} +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); + } + }); + })()); +} +exports.repeat = repeat; + + +/***/ }), + +/***/ 2830: +/***/ ((__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.isAsyncIterable = isAsyncIterable; +function isIterable(o) { + return typeof o[Symbol.iterator] === "function"; +} +exports.isIterable = isIterable; + + +/***/ }), + +/***/ 20327: +/***/ (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__(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; } + } + }); + }; +} +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; } + } + }); + }; +} +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); + } + }); + }; +} +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); + } + } + 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]); + } + 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))); + } + }); + }; +} +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.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); + } + } + } + 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 { + dist.add(t); + } + } + } + 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.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.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.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; } + } + }); + }; +} +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; + } + } + } + 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.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.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.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; + + +/***/ }), + +/***/ 48396: +/***/ (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]); } +}; +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); } +}; +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) => { + +"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"; +} +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); +} +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'; +} +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; + + +/***/ }), + +/***/ 48097: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + +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; + + +/***/ }), + +/***/ 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; +} + + +/***/ }), + +/***/ 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; + + +/***/ }), + +/***/ 24340: +/***/ ((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; +}; + + +/***/ }), + +/***/ 97040: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const {constants: BufferConstants} = __nccwpck_require__(14300); +const pump = __nccwpck_require__(18341); +const bufferStream = __nccwpck_require__(24340); + +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; + + +/***/ }), + +/***/ 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__(97040); +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; + + +/***/ }), + +/***/ 81312: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const PassThrough = (__nccwpck_require__(12781).PassThrough); +const mimicResponse = __nccwpck_require__(42610); + +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; + + +/***/ }), + +/***/ 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]'; +}; + + +/***/ }), + +/***/ 72746: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const cp = __nccwpck_require__(32081); +const parse = __nccwpck_require__(66855); +const enoent = __nccwpck_require__(44101); + +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); + + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); + + return spawned; +} + +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); + + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); + + // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); + + return result; +} + +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; + +module.exports._parse = parse; +module.exports._enoent = enoent; + + +/***/ }), + +/***/ 44101: +/***/ ((module) => { + +"use strict"; + + +const isWin = process.platform === 'win32'; + +function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: 'ENOENT', + errno: 'ENOENT', + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args, + }); +} + +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } + + const originalEmit = cp.emit; + + cp.emit = function (name, arg1) { + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + const err = verifyENOENT(arg1, parsed, 'spawn'); + + if (err) { + return originalEmit.call(cp, 'error', err); + } + } + + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + }; +} + +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } + + return null; +} + +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + + return null; +} + +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, +}; + + +/***/ }), + +/***/ 66855: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const path = __nccwpck_require__(71017); +const resolveCommand = __nccwpck_require__(87274); +const escape = __nccwpck_require__(34274); +const readShebang = __nccwpck_require__(41252); + +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; + +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); + + const shebang = parsed.file && readShebang(parsed.file); + + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; + + return resolveCommand(parsed); + } + + return parsed.file; +} + +function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } + + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); + + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); + + // If a shell is required, use cmd.exe and take care of escaping everything correctly + // Note that `forceShell` is an hidden option used only in tests + if (parsed.options.forceShell || needsShell) { + // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` + // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument + // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, + // we need to double escape them + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); + + // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) + // This is necessary otherwise it will always fail with ENOENT in those cases + parsed.command = path.normalize(parsed.command); + + // Escape command & arguments + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); + + const shellCommand = [parsed.command].concat(parsed.args).join(' '); + + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } + + return parsed; +} + +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } + + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original + + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; + + // Delegate further parsing to shell or non-shell + return options.shell ? parsed : parseNonShell(parsed); +} + +module.exports = parse; + + +/***/ }), + +/***/ 34274: +/***/ ((module) => { + +"use strict"; + + +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; + +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); + + return arg; +} + +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; + + // Algorithm below is based on https://qntm.org/cmd + + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); + + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); + + // All other backslashes occur literally + + // Quote the whole thing: + arg = `"${arg}"`; + + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); + + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); + } + + return arg; +} + +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; + + +/***/ }), + +/***/ 41252: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const fs = __nccwpck_require__(57147); +const shebangCommand = __nccwpck_require__(67032); + +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + const buffer = Buffer.alloc(size); + + let fd; + + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } + + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} + +module.exports = readShebang; + + +/***/ }), + +/***/ 87274: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const path = __nccwpck_require__(71017); +const which = __nccwpck_require__(34207); +const getPathKey = __nccwpck_require__(20539); + +function resolveCommandAttempt(parsed, withoutPathExt) { + const env = parsed.options.env || process.env; + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + // Worker threads do not have process.chdir() + const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled; + + // If a custom `cwd` was specified, we need to change the process cwd + // because `which` will do stat calls but does not support a custom cwd + if (shouldSwitchCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + /* Empty */ + } + } + + let resolved; + + try { + resolved = which.sync(parsed.command, { + path: env[getPathKey({ env })], + pathExt: withoutPathExt ? path.delimiter : undefined, + }); + } catch (e) { + /* Empty */ + } finally { + if (shouldSwitchCwd) { + process.chdir(cwd); + } + } + + // If we successfully resolved, ensure that an absolute path is returned + // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it + if (resolved) { + resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + } + + return resolved; +} + +function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +} + +module.exports = resolveCommand; + + +/***/ }), + +/***/ 82391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const {Transform, PassThrough} = __nccwpck_require__(12781); +const zlib = __nccwpck_require__(59796); +const mimicResponse = __nccwpck_require__(23877); + +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; +}; + + +/***/ }), + +/***/ 23877: +/***/ ((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 knownProperties = [ + 'aborted', + 'complete', + 'headers', + 'httpVersion', + 'httpVersionMinor', + 'httpVersionMajor', + 'method', + 'rawHeaders', + 'rawTrailers', + 'setTimeout', + 'socket', + 'statusCode', + 'statusMessage', + 'trailers', + 'url' +]; + +module.exports = (fromStream, toStream) => { + if (toStream._readableState.autoDestroy) { + throw new Error('The second stream must have the `autoDestroy` option set to `false`'); + } + + const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties)); + + const properties = {}; + + for (const property of fromProperties) { + // Don't overwrite existing properties. + if (property in toStream) { + continue; + } + + properties[property] = { + get() { + const value = fromStream[property]; + const isFunction = typeof value === 'function'; + + return isFunction ? value.bind(fromStream) : value; + }, + set(value) { + fromStream[property] = value; + }, + enumerable: true, + configurable: false + }; + } + + Object.defineProperties(toStream, properties); + + fromStream.once('aborted', () => { + toStream.destroy(); + + toStream.emit('aborted'); + }); + + fromStream.once('close', () => { + if (fromStream.complete) { + if (toStream.readable) { + toStream.once('end', () => { + toStream.emit('close'); + }); + } else { + toStream.emit('close'); + } + } else { + toStream.emit('close'); + } + }); + + return toStream; +}; + + +/***/ }), + +/***/ 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; + + +/***/ }), + +/***/ 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; + + +/***/ }), + +/***/ 55447: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const path = __nccwpck_require__(71017); +const childProcess = __nccwpck_require__(32081); +const crossSpawn = __nccwpck_require__(72746); +const stripFinalNewline = __nccwpck_require__(88174); +const npmRunPath = __nccwpck_require__(20502); +const onetime = __nccwpck_require__(89082); +const makeError = __nccwpck_require__(62187); +const normalizeStdio = __nccwpck_require__(10166); +const {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} = __nccwpck_require__(39819); +const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = __nccwpck_require__(32592); +const {mergePromise, getSpawnedPromise} = __nccwpck_require__(97814); +const {joinCommand, parseCommand, getEscapedCommand} = __nccwpck_require__(88286); + +const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100; + +const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { + const env = extendEnv ? {...process.env, ...envOption} : envOption; + + if (preferLocal) { + return npmRunPath.env({env, cwd: localDir, execPath}); + } + + return env; +}; + +const handleArguments = (file, args, options = {}) => { + const parsed = crossSpawn._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; + + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || process.cwd(), + execPath: process.execPath, + encoding: 'utf8', + reject: true, + cleanup: true, + all: false, + windowsHide: true, + ...options + }; + + options.env = getEnv(options); + + options.stdio = normalizeStdio(options); + + if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') { + // #116 + args.unshift('/q'); + } + + return {file, args, options, parsed}; +}; + +const handleOutput = (options, value, error) => { + if (typeof value !== 'string' && !Buffer.isBuffer(value)) { + // When `execa.sync()` errors, we normalize it to '' to mimic `execa()` + return error === undefined ? undefined : ''; + } + + if (options.stripFinalNewline) { + return stripFinalNewline(value); + } + + return value; +}; + +const execa = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); + + validateTimeout(parsed.options); + + let spawned; + try { + spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options); + } catch (error) { + // Ensure the returned error is always both a promise and a child process + const dummySpawned = new childProcess.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + return mergePromise(dummySpawned, errorPromise); + } + + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); + + const context = {isCanceled: false}; + + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context); + + const handlePromise = async () => { + const [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr = handleOutput(parsed.options, stderrResult); + const all = handleOutput(parsed.options, allResult); + + if (error || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error, + exitCode, + signal, + stdout, + stderr, + all, + command, + escapedCommand, + parsed, + timedOut, + isCanceled: context.isCanceled, + killed: spawned.killed + }); + + if (!parsed.options.reject) { + return returnedError; + } + + throw returnedError; + } + + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr, + all, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; + + const handlePromiseOnce = onetime(handlePromise); + + handleInput(spawned, parsed.options.input); + + spawned.all = makeAllStream(spawned, parsed.options); + + return mergePromise(spawned, handlePromiseOnce); +}; + +module.exports = execa; + +module.exports.sync = (file, args, options) => { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); + + validateInputSync(parsed.options); + + let result; + try { + result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options); + } catch (error) { + throw makeError({ + error, + stdout: '', + stderr: '', + all: '', + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + }); + } + + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr = handleOutput(parsed.options, result.stderr, result.error); + + if (result.error || result.status !== 0 || result.signal !== null) { + const error = makeError({ + stdout, + stderr, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + escapedCommand, + parsed, + timedOut: result.error && result.error.code === 'ETIMEDOUT', + isCanceled: false, + killed: result.signal !== null + }); + + if (!parsed.options.reject) { + return error; + } + + throw error; + } + + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; +}; + +module.exports.command = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa(file, args, options); +}; + +module.exports.commandSync = (command, options) => { + const [file, ...args] = parseCommand(command); + return execa.sync(file, args, options); +}; + +module.exports.node = (scriptPath, args, options = {}) => { + if (args && !Array.isArray(args) && typeof args === 'object') { + options = args; + args = []; + } + + const stdio = normalizeStdio.node(options); + const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect')); + + const { + nodePath = process.execPath, + nodeOptions = defaultExecArgv + } = options; + + return execa( + nodePath, + [ + ...nodeOptions, + scriptPath, + ...(Array.isArray(args) ? args : []) + ], + { + ...options, + stdin: undefined, + stdout: undefined, + stderr: undefined, + stdio, + shell: false + } + ); +}; + + +/***/ }), + +/***/ 88286: +/***/ ((module) => { + +"use strict"; + +const normalizeArgs = (file, args = []) => { + if (!Array.isArray(args)) { + return [file]; + } + + return [file, ...args]; +}; + +const NO_ESCAPE_REGEXP = /^[\w.-]+$/; +const DOUBLE_QUOTES_REGEXP = /"/g; + +const escapeArg = arg => { + if (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) { + return arg; + } + + return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; +}; + +const joinCommand = (file, args) => { + return normalizeArgs(file, args).join(' '); +}; + +const getEscapedCommand = (file, args) => { + return normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' '); +}; + +const SPACES_REGEXP = / +/g; + +// Handle `execa.command()` +const parseCommand = command => { + const tokens = []; + for (const token of command.trim().split(SPACES_REGEXP)) { + // Allow spaces to be escaped by a backslash if not meant as a delimiter + const previousToken = tokens[tokens.length - 1]; + if (previousToken && previousToken.endsWith('\\')) { + // Merge previous token with current one + tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; + } else { + tokens.push(token); + } + } + + return tokens; +}; + +module.exports = { + joinCommand, + getEscapedCommand, + parseCommand +}; + + +/***/ }), + +/***/ 62187: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const {signalsByName} = __nccwpck_require__(2779); + +const getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; + } + + if (isCanceled) { + return 'was canceled'; + } + + if (errorCode !== undefined) { + return `failed with ${errorCode}`; + } + + if (signal !== undefined) { + return `was killed with ${signal} (${signalDescription})`; + } + + if (exitCode !== undefined) { + return `failed with exit code ${exitCode}`; + } + + return 'failed'; +}; + +const makeError = ({ + stdout, + stderr, + all, + error, + signal, + exitCode, + command, + escapedCommand, + timedOut, + isCanceled, + killed, + parsed: {options: {timeout}} +}) => { + // `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`. + // We normalize them to `undefined` + exitCode = exitCode === null ? undefined : exitCode; + signal = signal === null ? undefined : signal; + const signalDescription = signal === undefined ? undefined : signalsByName[signal].description; + + const errorCode = error && error.code; + + const prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}); + const execaMessage = `Command ${prefix}: ${command}`; + const isError = Object.prototype.toString.call(error) === '[object Error]'; + const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage; + const message = [shortMessage, stderr, stdout].filter(Boolean).join('\n'); + + if (isError) { + error.originalMessage = error.message; + error.message = message; + } else { + error = new Error(message); + } + + error.shortMessage = shortMessage; + error.command = command; + error.escapedCommand = escapedCommand; + error.exitCode = exitCode; + error.signal = signal; + error.signalDescription = signalDescription; + error.stdout = stdout; + error.stderr = stderr; + + if (all !== undefined) { + error.all = all; + } + + if ('bufferedData' in error) { + delete error.bufferedData; + } + + error.failed = true; + error.timedOut = Boolean(timedOut); + error.isCanceled = isCanceled; + error.killed = killed && !timedOut; + + return error; +}; + +module.exports = makeError; + + +/***/ }), + +/***/ 39819: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const os = __nccwpck_require__(22037); +const onExit = __nccwpck_require__(24931); + +const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5; + +// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior +const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; +}; + +const setKillTimeout = (kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } + + const timeout = getForceKillAfterTimeout(options); + const t = setTimeout(() => { + kill('SIGKILL'); + }, timeout); + + // Guarded because there's no `.unref()` when `execa` is used in the renderer + // process in Electron. This cannot be tested since we don't run tests in + // Electron. + // istanbul ignore else + if (t.unref) { + t.unref(); + } +}; + +const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => { + return isSigterm(signal) && forceKillAfterTimeout !== false && killResult; +}; + +const isSigterm = signal => { + return signal === os.constants.signals.SIGTERM || + (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM'); +}; + +const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; + } + + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); + } + + return forceKillAfterTimeout; +}; + +// `childProcess.cancel()` +const spawnedCancel = (spawned, context) => { + const killResult = spawned.kill(); + + if (killResult) { + context.isCanceled = true; + } +}; + +const timeoutKill = (spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error('Timed out'), {timedOut: true, signal})); +}; + +// `timeout` option handling +const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => { + if (timeout === 0 || timeout === undefined) { + return spawnedPromise; + } + + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); + }); + + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); + }); + + return Promise.race([timeoutPromise, safeSpawnedPromise]); +}; + +const validateTimeout = ({timeout}) => { + if (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); + } +}; + +// `cleanup` option handling +const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; + } + + const removeExitHandler = onExit(() => { + spawned.kill(); + }); + + return timedPromise.finally(() => { + removeExitHandler(); + }); +}; + +module.exports = { + spawnedKill, + spawnedCancel, + setupTimeout, + validateTimeout, + setExitHandler +}; + + +/***/ }), + +/***/ 97814: +/***/ ((module) => { + +"use strict"; + + +const nativePromisePrototype = (async () => {})().constructor.prototype; +const descriptors = ['then', 'catch', 'finally'].map(property => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) +]); + +// The return value is a mixin of `childProcess` and `Promise` +const mergePromise = (spawned, promise) => { + for (const [property, descriptor] of descriptors) { + // Starting the main `promise` is deferred to avoid consuming streams + const value = typeof promise === 'function' ? + (...args) => Reflect.apply(descriptor.value, promise(), args) : + descriptor.value.bind(promise); + + Reflect.defineProperty(spawned, property, {...descriptor, value}); + } + + return spawned; +}; + +// Use promises instead of `child_process` events +const getSpawnedPromise = spawned => { + return new Promise((resolve, reject) => { + spawned.on('exit', (exitCode, signal) => { + resolve({exitCode, signal}); + }); + + spawned.on('error', error => { + reject(error); + }); + + if (spawned.stdin) { + spawned.stdin.on('error', error => { + reject(error); + }); + } + }); +}; + +module.exports = { + mergePromise, + getSpawnedPromise +}; + + + +/***/ }), + +/***/ 10166: +/***/ ((module) => { + +"use strict"; + +const aliases = ['stdin', 'stdout', 'stderr']; + +const hasAlias = options => aliases.some(alias => options[alias] !== undefined); + +const normalizeStdio = options => { + if (!options) { + return; + } + + const {stdio} = options; + + if (stdio === undefined) { + return aliases.map(alias => options[alias]); + } + + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`); + } + + if (typeof stdio === 'string') { + return stdio; + } + + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } + + const length = Math.max(stdio.length, aliases.length); + return Array.from({length}, (value, index) => stdio[index]); +}; + +module.exports = normalizeStdio; + +// `ipc` is pushed unless it is already present +module.exports.node = options => { + const stdio = normalizeStdio(options); + + if (stdio === 'ipc') { + return 'ipc'; + } + + if (stdio === undefined || typeof stdio === 'string') { + return [stdio, stdio, stdio, 'ipc']; + } + + if (stdio.includes('ipc')) { + return stdio; + } + + return [...stdio, 'ipc']; +}; + + +/***/ }), + +/***/ 32592: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const isStream = __nccwpck_require__(41554); +const getStream = __nccwpck_require__(21766); +const mergeStream = __nccwpck_require__(2621); + +// `input` option +const handleInput = (spawned, input) => { + // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 + // @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 + if (input === undefined || spawned.stdin === undefined) { + return; + } + + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +}; + +// `all` interleaves `stdout` and `stderr` +const makeAllStream = (spawned, {all}) => { + if (!all || (!spawned.stdout && !spawned.stderr)) { + return; + } + + const mixed = mergeStream(); + + if (spawned.stdout) { + mixed.add(spawned.stdout); + } + + if (spawned.stderr) { + mixed.add(spawned.stderr); + } + + return mixed; +}; + +// On failure, `result.stdout|stderr|all` should contain the currently buffered stream +const getBufferedData = async (stream, streamPromise) => { + if (!stream) { + return; + } + + stream.destroy(); + + try { + return await streamPromise; + } catch (error) { + return error.bufferedData; + } +}; + +const getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => { + if (!stream || !buffer) { + return; + } + + if (encoding) { + return getStream(stream, {encoding, maxBuffer}); + } + + return getStream.buffer(stream, {maxBuffer}); +}; + +// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all) +const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => { + const stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer}); + const stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer}); + const allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2}); + + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error) { + return Promise.all([ + {error, signal: error.signal, timedOut: error.timedOut}, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr, stderrPromise), + getBufferedData(all, allPromise) + ]); + } +}; + +const validateInputSync = ({input}) => { + if (isStream(input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } +}; + +module.exports = { + handleInput, + makeAllStream, + getSpawnedResult, + validateInputSync +}; + + + +/***/ }), + +/***/ 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(); + } +}; + + +/***/ }), + +/***/ 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 stream = __nccwpck_require__(12781); +const {promisify} = __nccwpck_require__(73837); +const bufferStream = __nccwpck_require__(91585); + +const streamPipelinePromisified = promisify(stream.pipeline); + +class MaxBufferError extends Error { + constructor() { + super('maxBuffer exceeded'); + this.name = 'MaxBufferError'; + } +} + +async function getStream(inputStream, options) { + if (!inputStream) { + throw new Error('Expected a stream'); + } + + options = { + maxBuffer: Infinity, + ...options + }; + + const {maxBuffer} = options; + const stream = bufferStream(options); + + 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); + }; + + (async () => { + try { + await streamPipelinePromisified(inputStream, stream); + resolve(); + } catch (error) { + rejectPromise(error); + } + })(); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); + + return stream.getBufferedValue(); +} + +module.exports = 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__(36453) +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__(36453) +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) +} + + +/***/ }), + +/***/ 51046: +/***/ ((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; +} + + + +/***/ }), + +/***/ 36453: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return __nccwpck_require__(71017) } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = __nccwpck_require__(51046) + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + + +/***/ }), + +/***/ 84579: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(36453) +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) { + +/* + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/ +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.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||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b}; +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("string"!==typeof 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]&&null!=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?'