initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
21
github/codeql-action-v2/node_modules/@azure/core-lro/LICENSE
generated
vendored
Normal file
21
github/codeql-action-v2/node_modules/@azure/core-lro/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Microsoft
|
||||
|
||||
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.
|
||||
94
github/codeql-action-v2/node_modules/@azure/core-lro/README.md
generated
vendored
Normal file
94
github/codeql-action-v2/node_modules/@azure/core-lro/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
# Azure Core LRO client library for JavaScript
|
||||
|
||||
This is the default implementation of long running operations in Azure SDK JavaScript client libraries which work in both the browser and NodeJS. This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript).
|
||||
|
||||
`@azure/core-lro` follows [The Azure SDK Design Guidelines for Long Running Operations](https://azure.github.io/azure-sdk/typescript_design.html#ts-lro)
|
||||
|
||||
Key links:
|
||||
|
||||
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-lro)
|
||||
- [Package (npm)](https://www.npmjs.com/package/@azure/core-lro)
|
||||
- [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/core-lro)
|
||||
- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/samples)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Currently supported environments
|
||||
|
||||
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
||||
- Latest versions of Safari, Chrome, Edge, and Firefox.
|
||||
|
||||
### Installation
|
||||
|
||||
This package is primarily used in generated code and not meant to be consumed directly by end users.
|
||||
|
||||
## Key concepts
|
||||
|
||||
### `SimplePollerLike`
|
||||
|
||||
A poller is an object that can poll the long running operation on the server for its state until it reaches a terminal state. It provides the following methods:
|
||||
|
||||
- `getOperationState`: returns the state of the operation, typed as a type that extends `OperationState`
|
||||
- `getResult`: returns the result of the operation when it completes and `undefined` otherwise
|
||||
- `isDone`: returns whether the operation is in a terminal state
|
||||
- `isStopped`: returns whether the polling stopped
|
||||
- `onProgress`: registers callback functions to be called every time a polling response is received
|
||||
- `poll`: sends a single polling request
|
||||
- `pollUntilDone`: returns a promise that will resolve with the result of the operation
|
||||
- `stopPolling`: stops polling;
|
||||
- `toString`: serializes the state of the poller
|
||||
|
||||
### `OperationState`
|
||||
|
||||
A type for the operation state. It contains a `status` field with the following possible values: `notStarted`, `running`, `succeeded`, `failed`, and `canceled`. It can be accessed as follows:
|
||||
|
||||
```typescript
|
||||
switch(poller.getOperationState().status) {
|
||||
case "succeeded": // return poller.getResult();
|
||||
case "failed": // throw poller.getOperationState().error;
|
||||
case "canceled": // throw new Error("Operation was canceled");
|
||||
case "running": // ...
|
||||
case "notStarted": // ...
|
||||
}
|
||||
```
|
||||
|
||||
### `createHttpPoller`
|
||||
|
||||
A function that returns an object of type `SimplePollerLike`. This poller behaves as follows in the presence of errors:
|
||||
|
||||
- calls to `poll` and `pollUntilDone` will throw an error in case the operation has failed or canceled unless the `resolveOnUnsuccessful` option was set to true.
|
||||
- `poller.getOperationState().status` will be set to true when either the operation fails or it returns an error response.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
Examples can be found in the `samples` folder.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Logging
|
||||
|
||||
Logs can be added at the discretion of the library implementing the Long Running Operation poller.
|
||||
Packages inside of [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) use
|
||||
[@azure/logger](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
||||
|
||||
## Next steps
|
||||
|
||||
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/samples) directory for detailed examples on how to use this library.
|
||||
|
||||
## Contributing
|
||||
|
||||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
|
||||
|
||||
### Testing
|
||||
|
||||
To run our tests, first install the dependencies (with `npm install` or `rush install`),
|
||||
then run the unit tests with: `npm run unit-test`.
|
||||
|
||||
### Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||

|
||||
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/models.js
generated
vendored
Normal file
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/models.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export {};
|
||||
//# sourceMappingURL=models.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/models.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/models.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/http/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { LroError } from \"../poller/models\";\n\n// TODO: rename to ResourceLocationConfig\n/**\n * The potential location of the result of the LRO if specified by the LRO extension in the swagger.\n */\nexport type LroResourceLocationConfig = \"azure-async-operation\" | \"location\" | \"original-uri\";\n\n/**\n * The type of a LRO response body. This is just a convenience type for checking the status of the operation.\n */\n\nexport interface ResponseBody extends Record<string, unknown> {\n /** The status of the operation. */\n status?: unknown;\n /** The state of the provisioning process */\n provisioningState?: unknown;\n /** The properties of the provisioning process */\n properties?: { provisioningState?: unknown } & Record<string, unknown>;\n /** The error if the operation failed */\n error?: Partial<LroError>;\n}\n\n/**\n * Simple type of the raw response.\n */\nexport interface RawResponse {\n /** The HTTP status code */\n statusCode: number;\n /** A HttpHeaders collection in the response represented as a simple JSON object where all header names have been normalized to be lower-case. */\n headers: {\n [headerName: string]: string;\n };\n /** The parsed response body */\n body?: unknown;\n}\n\n// TODO: rename to OperationResponse\n/**\n * The type of the response of a LRO.\n */\nexport interface LroResponse<T = unknown> {\n /** The flattened response */\n flatResponse: T;\n /** The raw response */\n rawResponse: RawResponse;\n}\n\n/**\n * Description of a long running operation.\n */\nexport interface LongRunningOperation<T = unknown> {\n /**\n * The request path. This should be set if the operation is a PUT and needs\n * to poll from the same request path.\n */\n requestPath?: string;\n /**\n * The HTTP request method. This should be set if the operation is a PUT or a\n * DELETE.\n */\n requestMethod?: string;\n /**\n * A function that can be used to send initial request to the service.\n */\n sendInitialRequest: () => Promise<LroResponse<unknown>>;\n /**\n * A function that can be used to poll for the current status of a long running operation.\n */\n sendPollRequest: (\n path: string,\n options?: { abortSignal?: AbortSignalLike }\n ) => Promise<LroResponse<T>>;\n}\n\nexport type HttpOperationMode = \"OperationLocation\" | \"ResourceLocation\" | \"Body\";\n\n/**\n * Options for `createPoller`.\n */\nexport interface CreateHttpPollerOptions<TResult, TState> {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n intervalInMs?: number;\n /**\n * A serialized poller which can be used to resume an existing paused Long-Running-Operation.\n */\n restoreFrom?: string;\n /**\n * The potential location of the result of the LRO if specified by the LRO extension in the swagger.\n */\n resourceLocationConfig?: LroResourceLocationConfig;\n /**\n * A function to process the result of the LRO.\n */\n processResult?: (result: unknown, state: TState) => TResult;\n /**\n * A function to process the state of the LRO.\n */\n updateState?: (state: TState, response: LroResponse) => void;\n /**\n * A function to be called each time the operation location is updated by the\n * service.\n */\n withOperationLocation?: (operationLocation: string) => void;\n /**\n * Control whether to throw an exception if the operation failed or was canceled.\n */\n resolveOnUnsuccessful?: boolean;\n}\n"]}
|
||||
273
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/operation.js
generated
vendored
Normal file
273
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/operation.js
generated
vendored
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { initOperation, pollOperation } from "../poller/operation";
|
||||
import { logger } from "../logger";
|
||||
function getOperationLocationPollingUrl(inputs) {
|
||||
const { azureAsyncOperation, operationLocation } = inputs;
|
||||
return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation;
|
||||
}
|
||||
function getLocationHeader(rawResponse) {
|
||||
return rawResponse.headers["location"];
|
||||
}
|
||||
function getOperationLocationHeader(rawResponse) {
|
||||
return rawResponse.headers["operation-location"];
|
||||
}
|
||||
function getAzureAsyncOperationHeader(rawResponse) {
|
||||
return rawResponse.headers["azure-asyncoperation"];
|
||||
}
|
||||
function findResourceLocation(inputs) {
|
||||
const { location, requestMethod, requestPath, resourceLocationConfig } = inputs;
|
||||
switch (requestMethod) {
|
||||
case "PUT": {
|
||||
return requestPath;
|
||||
}
|
||||
case "DELETE": {
|
||||
return undefined;
|
||||
}
|
||||
default: {
|
||||
switch (resourceLocationConfig) {
|
||||
case "azure-async-operation": {
|
||||
return undefined;
|
||||
}
|
||||
case "original-uri": {
|
||||
return requestPath;
|
||||
}
|
||||
case "location":
|
||||
default: {
|
||||
return location;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export function inferLroMode(inputs) {
|
||||
const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs;
|
||||
const operationLocation = getOperationLocationHeader(rawResponse);
|
||||
const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse);
|
||||
const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation });
|
||||
const location = getLocationHeader(rawResponse);
|
||||
const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase();
|
||||
if (pollingUrl !== undefined) {
|
||||
return {
|
||||
mode: "OperationLocation",
|
||||
operationLocation: pollingUrl,
|
||||
resourceLocation: findResourceLocation({
|
||||
requestMethod: normalizedRequestMethod,
|
||||
location,
|
||||
requestPath,
|
||||
resourceLocationConfig,
|
||||
}),
|
||||
};
|
||||
}
|
||||
else if (location !== undefined) {
|
||||
return {
|
||||
mode: "ResourceLocation",
|
||||
operationLocation: location,
|
||||
};
|
||||
}
|
||||
else if (normalizedRequestMethod === "PUT" && requestPath) {
|
||||
return {
|
||||
mode: "Body",
|
||||
operationLocation: requestPath,
|
||||
};
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
function transformStatus(inputs) {
|
||||
const { status, statusCode } = inputs;
|
||||
if (typeof status !== "string" && status !== undefined) {
|
||||
throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);
|
||||
}
|
||||
switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) {
|
||||
case undefined:
|
||||
return toOperationStatus(statusCode);
|
||||
case "succeeded":
|
||||
return "succeeded";
|
||||
case "failed":
|
||||
return "failed";
|
||||
case "running":
|
||||
case "accepted":
|
||||
case "started":
|
||||
case "canceling":
|
||||
case "cancelling":
|
||||
return "running";
|
||||
case "canceled":
|
||||
case "cancelled":
|
||||
return "canceled";
|
||||
default: {
|
||||
logger.verbose(`LRO: unrecognized operation status: ${status}`);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getStatus(rawResponse) {
|
||||
var _a;
|
||||
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
|
||||
return transformStatus({ status, statusCode: rawResponse.statusCode });
|
||||
}
|
||||
function getProvisioningState(rawResponse) {
|
||||
var _a, _b;
|
||||
const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
|
||||
const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState;
|
||||
return transformStatus({ status, statusCode: rawResponse.statusCode });
|
||||
}
|
||||
function toOperationStatus(statusCode) {
|
||||
if (statusCode === 202) {
|
||||
return "running";
|
||||
}
|
||||
else if (statusCode < 300) {
|
||||
return "succeeded";
|
||||
}
|
||||
else {
|
||||
return "failed";
|
||||
}
|
||||
}
|
||||
export function parseRetryAfter({ rawResponse }) {
|
||||
const retryAfter = rawResponse.headers["retry-after"];
|
||||
if (retryAfter !== undefined) {
|
||||
// Retry-After header value is either in HTTP date format, or in seconds
|
||||
const retryAfterInSeconds = parseInt(retryAfter);
|
||||
return isNaN(retryAfterInSeconds)
|
||||
? calculatePollingIntervalFromDate(new Date(retryAfter))
|
||||
: retryAfterInSeconds * 1000;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
export function getErrorFromResponse(response) {
|
||||
const error = response.flatResponse.error;
|
||||
if (!error) {
|
||||
logger.warning(`The long-running operation failed but there is no error property in the response's body`);
|
||||
return;
|
||||
}
|
||||
if (!error.code || !error.message) {
|
||||
logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);
|
||||
return;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
function calculatePollingIntervalFromDate(retryAfterDate) {
|
||||
const timeNow = Math.floor(new Date().getTime());
|
||||
const retryAfterTime = retryAfterDate.getTime();
|
||||
if (timeNow < retryAfterTime) {
|
||||
return retryAfterTime - timeNow;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
export function getStatusFromInitialResponse(inputs) {
|
||||
const { response, state, operationLocation } = inputs;
|
||||
function helper() {
|
||||
var _a;
|
||||
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
|
||||
switch (mode) {
|
||||
case undefined:
|
||||
return toOperationStatus(response.rawResponse.statusCode);
|
||||
case "Body":
|
||||
return getOperationStatus(response, state);
|
||||
default:
|
||||
return "running";
|
||||
}
|
||||
}
|
||||
const status = helper();
|
||||
return status === "running" && operationLocation === undefined ? "succeeded" : status;
|
||||
}
|
||||
/**
|
||||
* Initiates the long-running operation.
|
||||
*/
|
||||
export async function initHttpOperation(inputs) {
|
||||
const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs;
|
||||
return initOperation({
|
||||
init: async () => {
|
||||
const response = await lro.sendInitialRequest();
|
||||
const config = inferLroMode({
|
||||
rawResponse: response.rawResponse,
|
||||
requestPath: lro.requestPath,
|
||||
requestMethod: lro.requestMethod,
|
||||
resourceLocationConfig,
|
||||
});
|
||||
return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}));
|
||||
},
|
||||
stateProxy,
|
||||
processResult: processResult
|
||||
? ({ flatResponse }, state) => processResult(flatResponse, state)
|
||||
: ({ flatResponse }) => flatResponse,
|
||||
getOperationStatus: getStatusFromInitialResponse,
|
||||
setErrorAsResult,
|
||||
});
|
||||
}
|
||||
export function getOperationLocation({ rawResponse }, state) {
|
||||
var _a;
|
||||
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
|
||||
switch (mode) {
|
||||
case "OperationLocation": {
|
||||
return getOperationLocationPollingUrl({
|
||||
operationLocation: getOperationLocationHeader(rawResponse),
|
||||
azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse),
|
||||
});
|
||||
}
|
||||
case "ResourceLocation": {
|
||||
return getLocationHeader(rawResponse);
|
||||
}
|
||||
case "Body":
|
||||
default: {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
export function getOperationStatus({ rawResponse }, state) {
|
||||
var _a;
|
||||
const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"];
|
||||
switch (mode) {
|
||||
case "OperationLocation": {
|
||||
return getStatus(rawResponse);
|
||||
}
|
||||
case "ResourceLocation": {
|
||||
return toOperationStatus(rawResponse.statusCode);
|
||||
}
|
||||
case "Body": {
|
||||
return getProvisioningState(rawResponse);
|
||||
}
|
||||
default:
|
||||
throw new Error(`Internal error: Unexpected operation mode: ${mode}`);
|
||||
}
|
||||
}
|
||||
export function getResourceLocation({ flatResponse }, state) {
|
||||
if (typeof flatResponse === "object") {
|
||||
const resourceLocation = flatResponse.resourceLocation;
|
||||
if (resourceLocation !== undefined) {
|
||||
state.config.resourceLocation = resourceLocation;
|
||||
}
|
||||
}
|
||||
return state.config.resourceLocation;
|
||||
}
|
||||
export function isOperationError(e) {
|
||||
return e.name === "RestError";
|
||||
}
|
||||
/** Polls the long-running operation. */
|
||||
export async function pollHttpOperation(inputs) {
|
||||
const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs;
|
||||
return pollOperation({
|
||||
state,
|
||||
stateProxy,
|
||||
setDelay,
|
||||
processResult: processResult
|
||||
? ({ flatResponse }, inputState) => processResult(flatResponse, inputState)
|
||||
: ({ flatResponse }) => flatResponse,
|
||||
getError: getErrorFromResponse,
|
||||
updateState,
|
||||
getPollingInterval: parseRetryAfter,
|
||||
getOperationLocation,
|
||||
getOperationStatus,
|
||||
isOperationError,
|
||||
getResourceLocation,
|
||||
options,
|
||||
/**
|
||||
* The expansion here is intentional because `lro` could be an object that
|
||||
* references an inner this, so we need to preserve a reference to it.
|
||||
*/
|
||||
poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions),
|
||||
setErrorAsResult,
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=operation.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/operation.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/operation.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
44
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/poller.js
generated
vendored
Normal file
44
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/poller.js
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { getErrorFromResponse, getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, isOperationError, parseRetryAfter, } from "./operation";
|
||||
import { buildCreatePoller } from "../poller/poller";
|
||||
/**
|
||||
* Creates a poller that can be used to poll a long-running operation.
|
||||
* @param lro - Description of the long-running operation
|
||||
* @param options - options to configure the poller
|
||||
* @returns an initialized poller
|
||||
*/
|
||||
export async function createHttpPoller(lro, options) {
|
||||
const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {};
|
||||
return buildCreatePoller({
|
||||
getStatusFromInitialResponse,
|
||||
getStatusFromPollResponse: getOperationStatus,
|
||||
isOperationError,
|
||||
getOperationLocation,
|
||||
getResourceLocation,
|
||||
getPollingInterval: parseRetryAfter,
|
||||
getError: getErrorFromResponse,
|
||||
resolveOnUnsuccessful,
|
||||
})({
|
||||
init: async () => {
|
||||
const response = await lro.sendInitialRequest();
|
||||
const config = inferLroMode({
|
||||
rawResponse: response.rawResponse,
|
||||
requestPath: lro.requestPath,
|
||||
requestMethod: lro.requestMethod,
|
||||
resourceLocationConfig,
|
||||
});
|
||||
return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}));
|
||||
},
|
||||
poll: lro.sendPollRequest,
|
||||
}, {
|
||||
intervalInMs,
|
||||
withOperationLocation,
|
||||
restoreFrom,
|
||||
updateState,
|
||||
processResult: processResult
|
||||
? ({ flatResponse }, state) => processResult(flatResponse, state)
|
||||
: ({ flatResponse }) => flatResponse,
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=poller.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/poller.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/http/poller.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../src/http/poller.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAyB,EACzB,OAAkD;IAElD,MAAM,EACJ,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,qBAAqB,GAAG,KAAK,GAC9B,GAAG,OAAO,IAAI,EAAE,CAAC;IAClB,OAAO,iBAAiB,CAA+B;QACrD,4BAA4B;QAC5B,yBAAyB,EAAE,kBAAkB;QAC7C,gBAAgB;QAChB,oBAAoB;QACpB,mBAAmB;QACnB,kBAAkB,EAAE,eAAe;QACnC,QAAQ,EAAE,oBAAoB;QAC9B,qBAAqB;KACtB,CAAC,CACA;QACE,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,kBAAkB,EAAE,CAAC;YAChD,MAAM,MAAM,GAAG,YAAY,CAAC;gBAC1B,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,aAAa,EAAE,GAAG,CAAC,aAAa;gBAChC,sBAAsB;aACvB,CAAC,CAAC;YACH,uBACE,QAAQ,EACR,iBAAiB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,EAC5C,gBAAgB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,IACvC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC5D;QACJ,CAAC;QACD,IAAI,EAAE,GAAG,CAAC,eAAe;KAC1B,EACD;QACE,YAAY;QACZ,qBAAqB;QACrB,WAAW;QACX,WAAW;QACX,aAAa,EAAE,aAAa;YAC1B,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC;YACjE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAuB;KAClD,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LongRunningOperation, LroResponse } from \"./models\";\nimport { OperationState, SimplePollerLike } from \"../poller/models\";\nimport {\n getErrorFromResponse,\n getOperationLocation,\n getOperationStatus,\n getResourceLocation,\n getStatusFromInitialResponse,\n inferLroMode,\n isOperationError,\n parseRetryAfter,\n} from \"./operation\";\nimport { CreateHttpPollerOptions } from \"./models\";\nimport { buildCreatePoller } from \"../poller/poller\";\n\n/**\n * Creates a poller that can be used to poll a long-running operation.\n * @param lro - Description of the long-running operation\n * @param options - options to configure the poller\n * @returns an initialized poller\n */\nexport async function createHttpPoller<TResult, TState extends OperationState<TResult>>(\n lro: LongRunningOperation,\n options?: CreateHttpPollerOptions<TResult, TState>\n): Promise<SimplePollerLike<TState, TResult>> {\n const {\n resourceLocationConfig,\n intervalInMs,\n processResult,\n restoreFrom,\n updateState,\n withOperationLocation,\n resolveOnUnsuccessful = false,\n } = options || {};\n return buildCreatePoller<LroResponse, TResult, TState>({\n getStatusFromInitialResponse,\n getStatusFromPollResponse: getOperationStatus,\n isOperationError,\n getOperationLocation,\n getResourceLocation,\n getPollingInterval: parseRetryAfter,\n getError: getErrorFromResponse,\n resolveOnUnsuccessful,\n })(\n {\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return {\n response,\n operationLocation: config?.operationLocation,\n resourceLocation: config?.resourceLocation,\n ...(config?.mode ? { metadata: { mode: config.mode } } : {}),\n };\n },\n poll: lro.sendPollRequest,\n },\n {\n intervalInMs,\n withOperationLocation,\n restoreFrom,\n updateState,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse as TResult,\n }\n );\n}\n"]}
|
||||
19
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/index.js
generated
vendored
Normal file
19
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export { createHttpPoller } from "./http/poller";
|
||||
/**
|
||||
* This can be uncommented to expose the protocol-agnostic poller
|
||||
*/
|
||||
// export {
|
||||
// BuildCreatePollerOptions,
|
||||
// Operation,
|
||||
// CreatePollerOptions,
|
||||
// OperationConfig,
|
||||
// RestorableOperationState,
|
||||
// } from "./poller/models";
|
||||
// export { buildCreatePoller } from "./poller/poller";
|
||||
/** legacy */
|
||||
export * from "./legacy/lroEngine";
|
||||
export * from "./legacy/poller";
|
||||
export * from "./legacy/pollOperation";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/index.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAejD;;GAEG;AACH,WAAW;AACX,8BAA8B;AAC9B,eAAe;AACf,yBAAyB;AACzB,qBAAqB;AACrB,8BAA8B;AAC9B,4BAA4B;AAC5B,uDAAuD;AAEvD,aAAa;AACb,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { createHttpPoller } from \"./http/poller\";\nexport {\n CancelOnProgress,\n OperationState,\n OperationStatus,\n SimplePollerLike,\n} from \"./poller/models\";\nexport { CreateHttpPollerOptions } from \"./http/models\";\nexport {\n LroResourceLocationConfig,\n LongRunningOperation,\n LroResponse,\n RawResponse,\n} from \"./http/models\";\n\n/**\n * This can be uncommented to expose the protocol-agnostic poller\n */\n// export {\n// BuildCreatePollerOptions,\n// Operation,\n// CreatePollerOptions,\n// OperationConfig,\n// RestorableOperationState,\n// } from \"./poller/models\";\n// export { buildCreatePoller } from \"./poller/poller\";\n\n/** legacy */\nexport * from \"./legacy/lroEngine\";\nexport * from \"./legacy/poller\";\nexport * from \"./legacy/pollOperation\";\nexport { PollerLike } from \"./legacy/models\";\n"]}
|
||||
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js
generated
vendored
Normal file
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export { LroEngine } from "./lroEngine";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/legacy/lroEngine/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { LroEngine } from \"./lroEngine\";\nexport { LroEngineOptions } from \"./models\";\n"]}
|
||||
29
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js
generated
vendored
Normal file
29
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { GenericPollOperation } from "./operation";
|
||||
import { POLL_INTERVAL_IN_MS } from "../../poller/constants";
|
||||
import { Poller } from "../poller";
|
||||
import { deserializeState } from "../../poller/operation";
|
||||
/**
|
||||
* The LRO Engine, a class that performs polling.
|
||||
*/
|
||||
export class LroEngine extends Poller {
|
||||
constructor(lro, options) {
|
||||
const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {};
|
||||
const state = resumeFrom
|
||||
? deserializeState(resumeFrom)
|
||||
: {};
|
||||
const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone);
|
||||
super(operation);
|
||||
this.resolveOnUnsuccessful = resolveOnUnsuccessful;
|
||||
this.config = { intervalInMs: intervalInMs };
|
||||
operation.setPollerConfig(this.config);
|
||||
}
|
||||
/**
|
||||
* The method used by the poller to wait before attempting to update its operation.
|
||||
*/
|
||||
delay() {
|
||||
return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs));
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=lroEngine.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"lroEngine.js","sourceRoot":"","sources":["../../../../src/legacy/lroEngine/lroEngine.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,SAA+D,SAAQ,MAGnF;IAGC,YAAY,GAAkC,EAAE,OAA2C;QACzF,MAAM,EACJ,YAAY,GAAG,mBAAmB,EAClC,UAAU,EACV,qBAAqB,GAAG,KAAK,EAC7B,MAAM,EACN,yBAAyB,EACzB,aAAa,EACb,WAAW,GACZ,GAAG,OAAO,IAAI,EAAE,CAAC;QAClB,MAAM,KAAK,GAAqC,UAAU;YACxD,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC;YAC9B,CAAC,CAAE,EAAuC,CAAC;QAC7C,MAAM,SAAS,GAAG,IAAI,oBAAoB,CACxC,KAAK,EACL,GAAG,EACH,CAAC,qBAAqB,EACtB,yBAAyB,EACzB,aAAa,EACb,WAAW,EACX,MAAM,CACP,CAAC;QACF,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QAEnD,IAAI,CAAC,MAAM,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;QAC7C,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACzF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LroEngineOptions, PollerConfig } from \"./models\";\nimport { GenericPollOperation } from \"./operation\";\nimport { LongRunningOperation } from \"../../http/models\";\nimport { POLL_INTERVAL_IN_MS } from \"../../poller/constants\";\nimport { PollOperationState } from \"../pollOperation\";\nimport { Poller } from \"../poller\";\nimport { RestorableOperationState } from \"../../poller/models\";\nimport { deserializeState } from \"../../poller/operation\";\n\n/**\n * The LRO Engine, a class that performs polling.\n */\nexport class LroEngine<TResult, TState extends PollOperationState<TResult>> extends Poller<\n TState,\n TResult\n> {\n private config: PollerConfig;\n\n constructor(lro: LongRunningOperation<TResult>, options?: LroEngineOptions<TResult, TState>) {\n const {\n intervalInMs = POLL_INTERVAL_IN_MS,\n resumeFrom,\n resolveOnUnsuccessful = false,\n isDone,\n lroResourceLocationConfig,\n processResult,\n updateState,\n } = options || {};\n const state: RestorableOperationState<TState> = resumeFrom\n ? deserializeState(resumeFrom)\n : ({} as RestorableOperationState<TState>);\n const operation = new GenericPollOperation(\n state,\n lro,\n !resolveOnUnsuccessful,\n lroResourceLocationConfig,\n processResult,\n updateState,\n isDone\n );\n super(operation);\n this.resolveOnUnsuccessful = resolveOnUnsuccessful;\n\n this.config = { intervalInMs: intervalInMs };\n operation.setPollerConfig(this.config);\n }\n\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n delay(): Promise<void> {\n return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs));\n }\n}\n"]}
|
||||
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/models.js
generated
vendored
Normal file
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/models.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export {};
|
||||
//# sourceMappingURL=models.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/models.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/models.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/legacy/lroEngine/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LroResourceLocationConfig, RawResponse } from \"../../http/models\";\n\n/**\n * Options for the LRO poller.\n */\nexport interface LroEngineOptions<TResult, TState> {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n intervalInMs?: number;\n /**\n * A serialized poller which can be used to resume an existing paused Long-Running-Operation.\n */\n resumeFrom?: string;\n /**\n * The potential location of the result of the LRO if specified by the LRO extension in the swagger.\n */\n lroResourceLocationConfig?: LroResourceLocationConfig;\n /**\n * A function to process the result of the LRO.\n */\n processResult?: (result: unknown, state: TState) => TResult;\n /**\n * A function to process the state of the LRO.\n */\n updateState?: (state: TState, lastResponse: RawResponse) => void;\n /**\n * A predicate to determine whether the LRO finished processing.\n */\n isDone?: (lastResponse: unknown, state: TState) => boolean;\n /**\n * Control whether to throw an exception if the operation failed or was canceled.\n */\n resolveOnUnsuccessful?: boolean;\n}\n\nexport interface PollerConfig {\n intervalInMs: number;\n}\n"]}
|
||||
84
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js
generated
vendored
Normal file
84
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js
generated
vendored
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { initHttpOperation, pollHttpOperation } from "../../http/operation";
|
||||
import { logger } from "../../logger";
|
||||
const createStateProxy = () => ({
|
||||
initState: (config) => ({ config, isStarted: true }),
|
||||
setCanceled: (state) => (state.isCancelled = true),
|
||||
setError: (state, error) => (state.error = error),
|
||||
setResult: (state, result) => (state.result = result),
|
||||
setRunning: (state) => (state.isStarted = true),
|
||||
setSucceeded: (state) => (state.isCompleted = true),
|
||||
setFailed: () => {
|
||||
/** empty body */
|
||||
},
|
||||
getError: (state) => state.error,
|
||||
getResult: (state) => state.result,
|
||||
isCanceled: (state) => !!state.isCancelled,
|
||||
isFailed: (state) => !!state.error,
|
||||
isRunning: (state) => !!state.isStarted,
|
||||
isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error),
|
||||
});
|
||||
export class GenericPollOperation {
|
||||
constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) {
|
||||
this.state = state;
|
||||
this.lro = lro;
|
||||
this.setErrorAsResult = setErrorAsResult;
|
||||
this.lroResourceLocationConfig = lroResourceLocationConfig;
|
||||
this.processResult = processResult;
|
||||
this.updateState = updateState;
|
||||
this.isDone = isDone;
|
||||
}
|
||||
setPollerConfig(pollerConfig) {
|
||||
this.pollerConfig = pollerConfig;
|
||||
}
|
||||
async update(options) {
|
||||
var _a;
|
||||
const stateProxy = createStateProxy();
|
||||
if (!this.state.isStarted) {
|
||||
this.state = Object.assign(Object.assign({}, this.state), (await initHttpOperation({
|
||||
lro: this.lro,
|
||||
stateProxy,
|
||||
resourceLocationConfig: this.lroResourceLocationConfig,
|
||||
processResult: this.processResult,
|
||||
setErrorAsResult: this.setErrorAsResult,
|
||||
})));
|
||||
}
|
||||
const updateState = this.updateState;
|
||||
const isDone = this.isDone;
|
||||
if (!this.state.isCompleted && this.state.error === undefined) {
|
||||
await pollHttpOperation({
|
||||
lro: this.lro,
|
||||
state: this.state,
|
||||
stateProxy,
|
||||
processResult: this.processResult,
|
||||
updateState: updateState
|
||||
? (state, { rawResponse }) => updateState(state, rawResponse)
|
||||
: undefined,
|
||||
isDone: isDone
|
||||
? ({ flatResponse }, state) => isDone(flatResponse, state)
|
||||
: undefined,
|
||||
options,
|
||||
setDelay: (intervalInMs) => {
|
||||
this.pollerConfig.intervalInMs = intervalInMs;
|
||||
},
|
||||
setErrorAsResult: this.setErrorAsResult,
|
||||
});
|
||||
}
|
||||
(_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state);
|
||||
return this;
|
||||
}
|
||||
async cancel() {
|
||||
logger.error("`cancelOperation` is deprecated because it wasn't implemented");
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Serializes the Poller operation.
|
||||
*/
|
||||
toString() {
|
||||
return JSON.stringify({
|
||||
state: this.state,
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=operation.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/models.js
generated
vendored
Normal file
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/models.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export {};
|
||||
//# sourceMappingURL=models.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/models.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/models.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/legacy/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress } from \"../poller/models\";\nimport { PollOperationState } from \"./pollOperation\";\n\n/**\n * Abstract representation of a poller, intended to expose just the minimal API that the user needs to work with.\n */\n// eslint-disable-next-line no-use-before-define\nexport interface PollerLike<TState extends PollOperationState<TResult>, TResult> {\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<void>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Stops the poller. After this, no manual or automated requests can be sent.\n */\n stopPolling(): void;\n /**\n * Returns true if the poller is stopped.\n */\n isStopped(): boolean;\n /**\n * Attempts to cancel the underlying operation.\n * @deprecated `cancelOperation` has been deprecated because it was not implemented.\n */\n cancelOperation(options?: { abortSignal?: AbortSignalLike }): Promise<void>;\n /**\n * Returns the state of the operation.\n * The TState defined in PollerLike can be a subset of the TState defined in\n * the Poller implementation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a serialized version of the poller's operation\n * by invoking the operation's toString method.\n */\n toString(): string;\n}\n"]}
|
||||
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js
generated
vendored
Normal file
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export {};
|
||||
//# sourceMappingURL=pollOperation.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"pollOperation.js","sourceRoot":"","sources":["../../../src/legacy/pollOperation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\n\n/**\n * PollOperationState contains an opinionated list of the smallest set of properties needed\n * to define any long running operation poller.\n *\n * While the Poller class works as the local control mechanism to start triggering, wait for,\n * and potentially cancel a long running operation, the PollOperationState documents the status\n * of the remote long running operation.\n *\n * It should be updated at least when the operation starts, when it's finished, and when it's cancelled.\n * Though, implementations can have any other number of properties that can be updated by other reasons.\n */\nexport interface PollOperationState<TResult> {\n /**\n * True if the operation has started.\n */\n isStarted?: boolean;\n /**\n * True if the operation has been completed.\n */\n isCompleted?: boolean;\n /**\n * True if the operation has been cancelled.\n */\n isCancelled?: boolean;\n /**\n * Will exist if the operation encountered any error.\n */\n error?: Error;\n /**\n * Will exist if the operation concluded in a result of an expected type.\n */\n result?: TResult;\n}\n\n/**\n * PollOperation is an interface that defines how to update the local reference of the state of the remote\n * long running operation, just as well as how to request the cancellation of the same operation.\n *\n * It also has a method to serialize the operation so that it can be stored and resumed at any time.\n */\nexport interface PollOperation<TState, TResult> {\n /**\n * The state of the operation.\n * It will be used to store the basic properties of PollOperationState<TResult>,\n * plus any custom property that the implementation may require.\n */\n state: TState;\n\n /**\n * Defines how to request the remote service for updates on the status of the long running operation.\n *\n * It optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n * Also optionally receives a \"fireProgress\" function, which, if called, is responsible for triggering the\n * poller's onProgress callbacks.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n update(options?: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: TState) => void;\n }): Promise<PollOperation<TState, TResult>>;\n\n /**\n * Attempts to cancel the underlying operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * It returns a promise that should be resolved with an updated version of the poller's operation.\n *\n * @param options - Optional properties passed to the operation's update method.\n *\n * @deprecated `cancel` has been deprecated because it was not implemented.\n */\n cancel(options?: { abortSignal?: AbortSignalLike }): Promise<PollOperation<TState, TResult>>;\n\n /**\n * Serializes the operation.\n * Useful when wanting to create a poller that monitors an existing operation.\n */\n toString(): string;\n}\n"]}
|
||||
397
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js
generated
vendored
Normal file
397
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js
generated
vendored
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* When a poller is manually stopped through the `stopPolling` method,
|
||||
* the poller will be rejected with an instance of the PollerStoppedError.
|
||||
*/
|
||||
export class PollerStoppedError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "PollerStoppedError";
|
||||
Object.setPrototypeOf(this, PollerStoppedError.prototype);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* When the operation is cancelled, the poller will be rejected with an instance
|
||||
* of the PollerCancelledError.
|
||||
*/
|
||||
export class PollerCancelledError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "PollerCancelledError";
|
||||
Object.setPrototypeOf(this, PollerCancelledError.prototype);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A class that represents the definition of a program that polls through consecutive requests
|
||||
* until it reaches a state of completion.
|
||||
*
|
||||
* A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed.
|
||||
* It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes.
|
||||
* Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation.
|
||||
*
|
||||
* ```ts
|
||||
* const poller = new MyPoller();
|
||||
*
|
||||
* // Polling just once:
|
||||
* await poller.poll();
|
||||
*
|
||||
* // We can try to cancel the request here, by calling:
|
||||
* //
|
||||
* // await poller.cancelOperation();
|
||||
* //
|
||||
*
|
||||
* // Getting the final result:
|
||||
* const result = await poller.pollUntilDone();
|
||||
* ```
|
||||
*
|
||||
* The Poller is defined by two types, a type representing the state of the poller, which
|
||||
* must include a basic set of properties from `PollOperationState<TResult>`,
|
||||
* and a return type defined by `TResult`, which can be anything.
|
||||
*
|
||||
* The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having
|
||||
* to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type.
|
||||
*
|
||||
* ```ts
|
||||
* class Client {
|
||||
* public async makePoller: PollerLike<MyOperationState, MyResult> {
|
||||
* const poller = new MyPoller({});
|
||||
* // It might be preferred to return the poller after the first request is made,
|
||||
* // so that some information can be obtained right away.
|
||||
* await poller.poll();
|
||||
* return poller;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const poller: PollerLike<MyOperationState, MyResult> = myClient.makePoller();
|
||||
* ```
|
||||
*
|
||||
* A poller can be created through its constructor, then it can be polled until it's completed.
|
||||
* At any point in time, the state of the poller can be obtained without delay through the getOperationState method.
|
||||
* At any point in time, the intermediate forms of the result type can be requested without delay.
|
||||
* Once the underlying operation is marked as completed, the poller will stop and the final value will be returned.
|
||||
*
|
||||
* ```ts
|
||||
* const poller = myClient.makePoller();
|
||||
* const state: MyOperationState = poller.getOperationState();
|
||||
*
|
||||
* // The intermediate result can be obtained at any time.
|
||||
* const result: MyResult | undefined = poller.getResult();
|
||||
*
|
||||
* // The final result can only be obtained after the poller finishes.
|
||||
* const result: MyResult = await poller.pollUntilDone();
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
export class Poller {
|
||||
/**
|
||||
* A poller needs to be initialized by passing in at least the basic properties of the `PollOperation<TState, TResult>`.
|
||||
*
|
||||
* When writing an implementation of a Poller, this implementation needs to deal with the initialization
|
||||
* of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's
|
||||
* operation has already been defined, at least its basic properties. The code below shows how to approach
|
||||
* the definition of the constructor of a new custom poller.
|
||||
*
|
||||
* ```ts
|
||||
* export class MyPoller extends Poller<MyOperationState, string> {
|
||||
* constructor({
|
||||
* // Anything you might need outside of the basics
|
||||
* }) {
|
||||
* let state: MyOperationState = {
|
||||
* privateProperty: private,
|
||||
* publicProperty: public,
|
||||
* };
|
||||
*
|
||||
* const operation = {
|
||||
* state,
|
||||
* update,
|
||||
* cancel,
|
||||
* toString
|
||||
* }
|
||||
*
|
||||
* // Sending the operation to the parent's constructor.
|
||||
* super(operation);
|
||||
*
|
||||
* // You can assign more local properties here.
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Inside of this constructor, a new promise is created. This will be used to
|
||||
* tell the user when the poller finishes (see `pollUntilDone()`). The promise's
|
||||
* resolve and reject methods are also used internally to control when to resolve
|
||||
* or reject anyone waiting for the poller to finish.
|
||||
*
|
||||
* The constructor of a custom implementation of a poller is where any serialized version of
|
||||
* a previous poller's operation should be deserialized into the operation sent to the
|
||||
* base constructor. For example:
|
||||
*
|
||||
* ```ts
|
||||
* export class MyPoller extends Poller<MyOperationState, string> {
|
||||
* constructor(
|
||||
* baseOperation: string | undefined
|
||||
* ) {
|
||||
* let state: MyOperationState = {};
|
||||
* if (baseOperation) {
|
||||
* state = {
|
||||
* ...JSON.parse(baseOperation).state,
|
||||
* ...state
|
||||
* };
|
||||
* }
|
||||
* const operation = {
|
||||
* state,
|
||||
* // ...
|
||||
* }
|
||||
* super(operation);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param operation - Must contain the basic properties of `PollOperation<State, TResult>`.
|
||||
*/
|
||||
constructor(operation) {
|
||||
/** controls whether to throw an error if the operation failed or was canceled. */
|
||||
this.resolveOnUnsuccessful = false;
|
||||
this.stopped = true;
|
||||
this.pollProgressCallbacks = [];
|
||||
this.operation = operation;
|
||||
this.promise = new Promise((resolve, reject) => {
|
||||
this.resolve = resolve;
|
||||
this.reject = reject;
|
||||
});
|
||||
// This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown.
|
||||
// The above warning would get thrown if `poller.poll` is called, it returns an error,
|
||||
// and pullUntilDone did not have a .catch or await try/catch on it's return value.
|
||||
this.promise.catch(() => {
|
||||
/* intentionally blank */
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Starts a loop that will break only if the poller is done
|
||||
* or if the poller is stopped.
|
||||
*/
|
||||
async startPolling(pollOptions = {}) {
|
||||
if (this.stopped) {
|
||||
this.stopped = false;
|
||||
}
|
||||
while (!this.isStopped() && !this.isDone()) {
|
||||
await this.poll(pollOptions);
|
||||
await this.delay();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* pollOnce does one polling, by calling to the update method of the underlying
|
||||
* poll operation to make any relevant change effective.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
async pollOnce(options = {}) {
|
||||
if (!this.isDone()) {
|
||||
this.operation = await this.operation.update({
|
||||
abortSignal: options.abortSignal,
|
||||
fireProgress: this.fireProgress.bind(this),
|
||||
});
|
||||
}
|
||||
this.processUpdatedState();
|
||||
}
|
||||
/**
|
||||
* fireProgress calls the functions passed in via onProgress the method of the poller.
|
||||
*
|
||||
* It loops over all of the callbacks received from onProgress, and executes them, sending them
|
||||
* the current operation state.
|
||||
*
|
||||
* @param state - The current operation state.
|
||||
*/
|
||||
fireProgress(state) {
|
||||
for (const callback of this.pollProgressCallbacks) {
|
||||
callback(state);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Invokes the underlying operation's cancel method.
|
||||
*/
|
||||
async cancelOnce(options = {}) {
|
||||
this.operation = await this.operation.cancel(options);
|
||||
}
|
||||
/**
|
||||
* Returns a promise that will resolve once a single polling request finishes.
|
||||
* It does this by calling the update method of the Poller's operation.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
poll(options = {}) {
|
||||
if (!this.pollOncePromise) {
|
||||
this.pollOncePromise = this.pollOnce(options);
|
||||
const clearPollOncePromise = () => {
|
||||
this.pollOncePromise = undefined;
|
||||
};
|
||||
this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject);
|
||||
}
|
||||
return this.pollOncePromise;
|
||||
}
|
||||
processUpdatedState() {
|
||||
if (this.operation.state.error) {
|
||||
this.stopped = true;
|
||||
if (!this.resolveOnUnsuccessful) {
|
||||
this.reject(this.operation.state.error);
|
||||
throw this.operation.state.error;
|
||||
}
|
||||
}
|
||||
if (this.operation.state.isCancelled) {
|
||||
this.stopped = true;
|
||||
if (!this.resolveOnUnsuccessful) {
|
||||
const error = new PollerCancelledError("Operation was canceled");
|
||||
this.reject(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
if (this.isDone() && this.resolve) {
|
||||
// If the poller has finished polling, this means we now have a result.
|
||||
// However, it can be the case that TResult is instantiated to void, so
|
||||
// we are not expecting a result anyway. To assert that we might not
|
||||
// have a result eventually after finishing polling, we cast the result
|
||||
// to TResult.
|
||||
this.resolve(this.getResult());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
async pollUntilDone(pollOptions = {}) {
|
||||
if (this.stopped) {
|
||||
this.startPolling(pollOptions).catch(this.reject);
|
||||
}
|
||||
// This is needed because the state could have been updated by
|
||||
// `cancelOperation`, e.g. the operation is canceled or an error occurred.
|
||||
this.processUpdatedState();
|
||||
return this.promise;
|
||||
}
|
||||
/**
|
||||
* Invokes the provided callback after each polling is completed,
|
||||
* sending the current state of the poller's operation.
|
||||
*
|
||||
* It returns a method that can be used to stop receiving updates on the given callback function.
|
||||
*/
|
||||
onProgress(callback) {
|
||||
this.pollProgressCallbacks.push(callback);
|
||||
return () => {
|
||||
this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns true if the poller has finished polling.
|
||||
*/
|
||||
isDone() {
|
||||
const state = this.operation.state;
|
||||
return Boolean(state.isCompleted || state.isCancelled || state.error);
|
||||
}
|
||||
/**
|
||||
* Stops the poller from continuing to poll.
|
||||
*/
|
||||
stopPolling() {
|
||||
if (!this.stopped) {
|
||||
this.stopped = true;
|
||||
if (this.reject) {
|
||||
this.reject(new PollerStoppedError("This poller is already stopped"));
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns true if the poller is stopped.
|
||||
*/
|
||||
isStopped() {
|
||||
return this.stopped;
|
||||
}
|
||||
/**
|
||||
* Attempts to cancel the underlying operation.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* If it's called again before it finishes, it will throw an error.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
cancelOperation(options = {}) {
|
||||
if (!this.cancelPromise) {
|
||||
this.cancelPromise = this.cancelOnce(options);
|
||||
}
|
||||
else if (options.abortSignal) {
|
||||
throw new Error("A cancel request is currently pending");
|
||||
}
|
||||
return this.cancelPromise;
|
||||
}
|
||||
/**
|
||||
* Returns the state of the operation.
|
||||
*
|
||||
* Even though TState will be the same type inside any of the methods of any extension of the Poller class,
|
||||
* implementations of the pollers can customize what's shared with the public by writing their own
|
||||
* version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller
|
||||
* and a public type representing a safe to share subset of the properties of the internal state.
|
||||
* Their definition of getOperationState can then return their public type.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```ts
|
||||
* // Let's say we have our poller's operation state defined as:
|
||||
* interface MyOperationState extends PollOperationState<ResultType> {
|
||||
* privateProperty?: string;
|
||||
* publicProperty?: string;
|
||||
* }
|
||||
*
|
||||
* // To allow us to have a true separation of public and private state, we have to define another interface:
|
||||
* interface PublicState extends PollOperationState<ResultType> {
|
||||
* publicProperty?: string;
|
||||
* }
|
||||
*
|
||||
* // Then, we define our Poller as follows:
|
||||
* export class MyPoller extends Poller<MyOperationState, ResultType> {
|
||||
* // ... More content is needed here ...
|
||||
*
|
||||
* public getOperationState(): PublicState {
|
||||
* const state: PublicState = this.operation.state;
|
||||
* return {
|
||||
* // Properties from PollOperationState<TResult>
|
||||
* isStarted: state.isStarted,
|
||||
* isCompleted: state.isCompleted,
|
||||
* isCancelled: state.isCancelled,
|
||||
* error: state.error,
|
||||
* result: state.result,
|
||||
*
|
||||
* // The only other property needed by PublicState.
|
||||
* publicProperty: state.publicProperty
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* You can see this in the tests of this repository, go to the file:
|
||||
* `../test/utils/testPoller.ts`
|
||||
* and look for the getOperationState implementation.
|
||||
*/
|
||||
getOperationState() {
|
||||
return this.operation.state;
|
||||
}
|
||||
/**
|
||||
* Returns the result value of the operation,
|
||||
* regardless of the state of the poller.
|
||||
* It can return undefined or an incomplete form of the final TResult value
|
||||
* depending on the implementation.
|
||||
*/
|
||||
getResult() {
|
||||
const state = this.operation.state;
|
||||
return state.result;
|
||||
}
|
||||
/**
|
||||
* Returns a serialized version of the poller's operation
|
||||
* by invoking the operation's toString method.
|
||||
*/
|
||||
toString() {
|
||||
return this.operation.toString();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=poller.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
9
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/logger.js
generated
vendored
Normal file
9
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/logger.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { createClientLogger } from "@azure/logger";
|
||||
/**
|
||||
* The `@azure/logger` configuration for this package.
|
||||
* @internal
|
||||
*/
|
||||
export const logger = createClientLogger("core-lro");
|
||||
//# sourceMappingURL=logger.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/logger.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/logger.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The `@azure/logger` configuration for this package.\n * @internal\n */\nexport const logger = createClientLogger(\"core-lro\");\n"]}
|
||||
11
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/constants.js
generated
vendored
Normal file
11
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/constants.js
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* The default time interval to wait before sending the next polling request.
|
||||
*/
|
||||
export const POLL_INTERVAL_IN_MS = 2000;
|
||||
/**
|
||||
* The closed set of terminal states.
|
||||
*/
|
||||
export const terminalStates = ["succeeded", "canceled", "failed"];
|
||||
//# sourceMappingURL=constants.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/constants.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/constants.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/poller/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * The default time interval to wait before sending the next polling request.\n */\nexport const POLL_INTERVAL_IN_MS = 2000;\n/**\n * The closed set of terminal states.\n */\nexport const terminalStates = [\"succeeded\", \"canceled\", \"failed\"];\n"]}
|
||||
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/models.js
generated
vendored
Normal file
4
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/models.js
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export {};
|
||||
//# sourceMappingURL=models.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/models.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/models.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
166
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/operation.js
generated
vendored
Normal file
166
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/operation.js
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { logger } from "../logger";
|
||||
import { terminalStates } from "./constants";
|
||||
/**
|
||||
* Deserializes the state
|
||||
*/
|
||||
export function deserializeState(serializedState) {
|
||||
try {
|
||||
return JSON.parse(serializedState).state;
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Unable to deserialize input state: ${serializedState}`);
|
||||
}
|
||||
}
|
||||
function setStateError(inputs) {
|
||||
const { state, stateProxy, isOperationError } = inputs;
|
||||
return (error) => {
|
||||
if (isOperationError(error)) {
|
||||
stateProxy.setError(state, error);
|
||||
stateProxy.setFailed(state);
|
||||
}
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
function appendReadableErrorMessage(currentMessage, innerMessage) {
|
||||
let message = currentMessage;
|
||||
if (message.slice(-1) !== ".") {
|
||||
message = message + ".";
|
||||
}
|
||||
return message + " " + innerMessage;
|
||||
}
|
||||
function simplifyError(err) {
|
||||
let message = err.message;
|
||||
let code = err.code;
|
||||
let curErr = err;
|
||||
while (curErr.innererror) {
|
||||
curErr = curErr.innererror;
|
||||
code = curErr.code;
|
||||
message = appendReadableErrorMessage(message, curErr.message);
|
||||
}
|
||||
return {
|
||||
code,
|
||||
message,
|
||||
};
|
||||
}
|
||||
function processOperationStatus(result) {
|
||||
const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result;
|
||||
switch (status) {
|
||||
case "succeeded": {
|
||||
stateProxy.setSucceeded(state);
|
||||
break;
|
||||
}
|
||||
case "failed": {
|
||||
const err = getError === null || getError === void 0 ? void 0 : getError(response);
|
||||
let postfix = "";
|
||||
if (err) {
|
||||
const { code, message } = simplifyError(err);
|
||||
postfix = `. ${code}. ${message}`;
|
||||
}
|
||||
const errStr = `The long-running operation has failed${postfix}`;
|
||||
stateProxy.setError(state, new Error(errStr));
|
||||
stateProxy.setFailed(state);
|
||||
logger.warning(errStr);
|
||||
break;
|
||||
}
|
||||
case "canceled": {
|
||||
stateProxy.setCanceled(state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) ||
|
||||
(isDone === undefined &&
|
||||
["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) {
|
||||
stateProxy.setResult(state, buildResult({
|
||||
response,
|
||||
state,
|
||||
processResult,
|
||||
}));
|
||||
}
|
||||
}
|
||||
function buildResult(inputs) {
|
||||
const { processResult, response, state } = inputs;
|
||||
return processResult ? processResult(response, state) : response;
|
||||
}
|
||||
/**
|
||||
* Initiates the long-running operation.
|
||||
*/
|
||||
export async function initOperation(inputs) {
|
||||
const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs;
|
||||
const { operationLocation, resourceLocation, metadata, response } = await init();
|
||||
if (operationLocation)
|
||||
withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false);
|
||||
const config = {
|
||||
metadata,
|
||||
operationLocation,
|
||||
resourceLocation,
|
||||
};
|
||||
logger.verbose(`LRO: Operation description:`, config);
|
||||
const state = stateProxy.initState(config);
|
||||
const status = getOperationStatus({ response, state, operationLocation });
|
||||
processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult });
|
||||
return state;
|
||||
}
|
||||
async function pollOperationHelper(inputs) {
|
||||
const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs;
|
||||
const response = await poll(operationLocation, options).catch(setStateError({
|
||||
state,
|
||||
stateProxy,
|
||||
isOperationError,
|
||||
}));
|
||||
const status = getOperationStatus(response, state);
|
||||
logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`);
|
||||
if (status === "succeeded") {
|
||||
const resourceLocation = getResourceLocation(response, state);
|
||||
if (resourceLocation !== undefined) {
|
||||
return {
|
||||
response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })),
|
||||
status,
|
||||
};
|
||||
}
|
||||
}
|
||||
return { response, status };
|
||||
}
|
||||
/** Polls the long-running operation. */
|
||||
export async function pollOperation(inputs) {
|
||||
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
|
||||
const { operationLocation } = state.config;
|
||||
if (operationLocation !== undefined) {
|
||||
const { response, status } = await pollOperationHelper({
|
||||
poll,
|
||||
getOperationStatus,
|
||||
state,
|
||||
stateProxy,
|
||||
operationLocation,
|
||||
getResourceLocation,
|
||||
isOperationError,
|
||||
options,
|
||||
});
|
||||
processOperationStatus({
|
||||
status,
|
||||
response,
|
||||
state,
|
||||
stateProxy,
|
||||
isDone,
|
||||
processResult,
|
||||
getError,
|
||||
setErrorAsResult,
|
||||
});
|
||||
if (!terminalStates.includes(status)) {
|
||||
const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response);
|
||||
if (intervalInMs)
|
||||
setDelay(intervalInMs);
|
||||
const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state);
|
||||
if (location !== undefined) {
|
||||
const isUpdated = operationLocation !== location;
|
||||
state.config.operationLocation = location;
|
||||
withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated);
|
||||
}
|
||||
else
|
||||
withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false);
|
||||
}
|
||||
updateState === null || updateState === void 0 ? void 0 : updateState(state, response);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=operation.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/operation.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/operation.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
158
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/poller.js
generated
vendored
Normal file
158
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/poller.js
generated
vendored
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { AbortController } from "@azure/abort-controller";
|
||||
import { deserializeState, initOperation, pollOperation } from "./operation";
|
||||
import { POLL_INTERVAL_IN_MS } from "./constants";
|
||||
import { delay } from "@azure/core-util";
|
||||
const createStateProxy = () => ({
|
||||
/**
|
||||
* The state at this point is created to be of type OperationState<TResult>.
|
||||
* It will be updated later to be of type TState when the
|
||||
* customer-provided callback, `updateState`, is called during polling.
|
||||
*/
|
||||
initState: (config) => ({ status: "running", config }),
|
||||
setCanceled: (state) => (state.status = "canceled"),
|
||||
setError: (state, error) => (state.error = error),
|
||||
setResult: (state, result) => (state.result = result),
|
||||
setRunning: (state) => (state.status = "running"),
|
||||
setSucceeded: (state) => (state.status = "succeeded"),
|
||||
setFailed: (state) => (state.status = "failed"),
|
||||
getError: (state) => state.error,
|
||||
getResult: (state) => state.result,
|
||||
isCanceled: (state) => state.status === "canceled",
|
||||
isFailed: (state) => state.status === "failed",
|
||||
isRunning: (state) => state.status === "running",
|
||||
isSucceeded: (state) => state.status === "succeeded",
|
||||
});
|
||||
/**
|
||||
* Returns a poller factory.
|
||||
*/
|
||||
export function buildCreatePoller(inputs) {
|
||||
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs;
|
||||
return async ({ init, poll }, options) => {
|
||||
const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};
|
||||
const stateProxy = createStateProxy();
|
||||
const withOperationLocation = withOperationLocationCallback
|
||||
? (() => {
|
||||
let called = false;
|
||||
return (operationLocation, isUpdated) => {
|
||||
if (isUpdated)
|
||||
withOperationLocationCallback(operationLocation);
|
||||
else if (!called)
|
||||
withOperationLocationCallback(operationLocation);
|
||||
called = true;
|
||||
};
|
||||
})()
|
||||
: undefined;
|
||||
const state = restoreFrom
|
||||
? deserializeState(restoreFrom)
|
||||
: await initOperation({
|
||||
init,
|
||||
stateProxy,
|
||||
processResult,
|
||||
getOperationStatus: getStatusFromInitialResponse,
|
||||
withOperationLocation,
|
||||
setErrorAsResult: !resolveOnUnsuccessful,
|
||||
});
|
||||
let resultPromise;
|
||||
const abortController = new AbortController();
|
||||
const handlers = new Map();
|
||||
const handleProgressEvents = async () => handlers.forEach((h) => h(state));
|
||||
const cancelErrMsg = "Operation was canceled";
|
||||
let currentPollIntervalInMs = intervalInMs;
|
||||
const poller = {
|
||||
getOperationState: () => state,
|
||||
getResult: () => state.result,
|
||||
isDone: () => ["succeeded", "failed", "canceled"].includes(state.status),
|
||||
isStopped: () => resultPromise === undefined,
|
||||
stopPolling: () => {
|
||||
abortController.abort();
|
||||
},
|
||||
toString: () => JSON.stringify({
|
||||
state,
|
||||
}),
|
||||
onProgress: (callback) => {
|
||||
const s = Symbol();
|
||||
handlers.set(s, callback);
|
||||
return () => handlers.delete(s);
|
||||
},
|
||||
pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => {
|
||||
const { abortSignal: inputAbortSignal } = pollOptions || {};
|
||||
const { signal: abortSignal } = inputAbortSignal
|
||||
? new AbortController([inputAbortSignal, abortController.signal])
|
||||
: abortController;
|
||||
if (!poller.isDone()) {
|
||||
await poller.poll({ abortSignal });
|
||||
while (!poller.isDone()) {
|
||||
await delay(currentPollIntervalInMs, { abortSignal });
|
||||
await poller.poll({ abortSignal });
|
||||
}
|
||||
}
|
||||
if (resolveOnUnsuccessful) {
|
||||
return poller.getResult();
|
||||
}
|
||||
else {
|
||||
switch (state.status) {
|
||||
case "succeeded":
|
||||
return poller.getResult();
|
||||
case "canceled":
|
||||
throw new Error(cancelErrMsg);
|
||||
case "failed":
|
||||
throw state.error;
|
||||
case "notStarted":
|
||||
case "running":
|
||||
throw new Error(`Polling completed without succeeding or failing`);
|
||||
}
|
||||
}
|
||||
})().finally(() => {
|
||||
resultPromise = undefined;
|
||||
}))),
|
||||
async poll(pollOptions) {
|
||||
if (resolveOnUnsuccessful) {
|
||||
if (poller.isDone())
|
||||
return;
|
||||
}
|
||||
else {
|
||||
switch (state.status) {
|
||||
case "succeeded":
|
||||
return;
|
||||
case "canceled":
|
||||
throw new Error(cancelErrMsg);
|
||||
case "failed":
|
||||
throw state.error;
|
||||
}
|
||||
}
|
||||
await pollOperation({
|
||||
poll,
|
||||
state,
|
||||
stateProxy,
|
||||
getOperationLocation,
|
||||
isOperationError,
|
||||
withOperationLocation,
|
||||
getPollingInterval,
|
||||
getOperationStatus: getStatusFromPollResponse,
|
||||
getResourceLocation,
|
||||
processResult,
|
||||
getError,
|
||||
updateState,
|
||||
options: pollOptions,
|
||||
setDelay: (pollIntervalInMs) => {
|
||||
currentPollIntervalInMs = pollIntervalInMs;
|
||||
},
|
||||
setErrorAsResult: !resolveOnUnsuccessful,
|
||||
});
|
||||
await handleProgressEvents();
|
||||
if (!resolveOnUnsuccessful) {
|
||||
switch (state.status) {
|
||||
case "canceled":
|
||||
throw new Error(cancelErrMsg);
|
||||
case "failed":
|
||||
throw state.error;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
return poller;
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=poller.js.map
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/poller.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist-esm/src/poller/poller.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1161
github/codeql-action-v2/node_modules/@azure/core-lro/dist/index.js
generated
vendored
Normal file
1161
github/codeql-action-v2/node_modules/@azure/core-lro/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist/index.js.map
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
15
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
12
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
12
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
164
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/README.md
generated
vendored
Normal file
164
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
# tslib
|
||||
|
||||
This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
|
||||
|
||||
This library is primarily used by the `--importHelpers` flag in TypeScript.
|
||||
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
|
||||
|
||||
```ts
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.x = {};
|
||||
exports.y = __assign({}, exports.x);
|
||||
|
||||
```
|
||||
|
||||
will instead be emitted as something like the following:
|
||||
|
||||
```ts
|
||||
var tslib_1 = require("tslib");
|
||||
exports.x = {};
|
||||
exports.y = tslib_1.__assign({}, exports.x);
|
||||
```
|
||||
|
||||
Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
|
||||
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
|
||||
|
||||
# Installing
|
||||
|
||||
For the latest stable version, run:
|
||||
|
||||
## npm
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
npm install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
npm install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
npm install tslib@1.6.1
|
||||
```
|
||||
|
||||
## yarn
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
yarn add tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
yarn add tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
yarn add tslib@1.6.1
|
||||
```
|
||||
|
||||
## bower
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
bower install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
bower install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
bower install tslib@1.6.1
|
||||
```
|
||||
|
||||
## JSPM
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
jspm install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
jspm install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
jspm install tslib@1.6.1
|
||||
```
|
||||
|
||||
# Usage
|
||||
|
||||
Set the `importHelpers` compiler option on the command line:
|
||||
|
||||
```
|
||||
tsc --importHelpers file.ts
|
||||
```
|
||||
|
||||
or in your tsconfig.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"importHelpers": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### For bower and JSPM users
|
||||
|
||||
You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "amd",
|
||||
"importHelpers": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"tslib" : ["bower_components/tslib/tslib.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For JSPM users:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "system",
|
||||
"importHelpers": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
- Choose your new version number
|
||||
- Set it in `package.json` and `bower.json`
|
||||
- Create a tag: `git tag [version]`
|
||||
- Push the tag: `git push --tags`
|
||||
- Create a [release in GitHub](https://github.com/microsoft/tslib/releases)
|
||||
- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow
|
||||
|
||||
Done.
|
||||
|
||||
# Contribute
|
||||
|
||||
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
|
||||
|
||||
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
|
||||
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
|
||||
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
|
||||
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
|
||||
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
|
||||
|
||||
# Documentation
|
||||
|
||||
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
|
||||
* [Programming handbook](http://www.typescriptlang.org/Handbook)
|
||||
* [Homepage](http://www.typescriptlang.org/)
|
||||
41
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/SECURITY.md
generated
vendored
Normal file
41
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/SECURITY.md
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
||||
37
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/modules/index.d.ts
generated
vendored
Normal file
37
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/modules/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Note: named reexports are used instead of `export *` because
|
||||
// TypeScript itself doesn't resolve the `export *` when checking
|
||||
// if a particular helper exists.
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__createBinding,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
} from '../tslib.js';
|
||||
export * as default from '../tslib.js';
|
||||
68
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/modules/index.js
generated
vendored
Normal file
68
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/modules/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import tslib from '../tslib.js';
|
||||
const {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
} = tslib;
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
};
|
||||
export default tslib;
|
||||
3
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/modules/package.json
generated
vendored
Normal file
3
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/modules/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
47
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/package.json
generated
vendored
Normal file
47
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "tslib",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "https://www.typescriptlang.org/",
|
||||
"version": "2.6.0",
|
||||
"license": "0BSD",
|
||||
"description": "Runtime library for TypeScript helper functions",
|
||||
"keywords": [
|
||||
"TypeScript",
|
||||
"Microsoft",
|
||||
"compiler",
|
||||
"language",
|
||||
"javascript",
|
||||
"tslib",
|
||||
"runtime"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/TypeScript/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/tslib.git"
|
||||
},
|
||||
"main": "tslib.js",
|
||||
"module": "tslib.es6.js",
|
||||
"jsnext:main": "tslib.es6.js",
|
||||
"typings": "tslib.d.ts",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"module": {
|
||||
"types": "./tslib/modules/index.d.ts",
|
||||
"default": "./tslib.es6.mjs"
|
||||
},
|
||||
"import": {
|
||||
"node": "./modules/index.js",
|
||||
"default": {
|
||||
"types": "./modules/index.d.ts",
|
||||
"default": "./tslib.es6.mjs"
|
||||
}
|
||||
},
|
||||
"default": "./tslib.js"
|
||||
},
|
||||
"./*": "./*",
|
||||
"./": "./"
|
||||
}
|
||||
}
|
||||
453
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
453
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,453 @@
|
|||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
/**
|
||||
* Used to shim class extends.
|
||||
*
|
||||
* @param d The derived class.
|
||||
* @param b The base class.
|
||||
*/
|
||||
export declare function __extends(d: Function, b: Function): void;
|
||||
|
||||
/**
|
||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
||||
* target object. Returns the target object.
|
||||
*
|
||||
* @param t The target object to copy to.
|
||||
* @param sources One or more source objects from which to copy properties
|
||||
*/
|
||||
export declare function __assign(t: any, ...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Performs a rest spread on an object.
|
||||
*
|
||||
* @param t The source value.
|
||||
* @param propertyNames The property names excluded from the rest spread.
|
||||
*/
|
||||
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
|
||||
|
||||
/**
|
||||
* Applies decorators to a target object
|
||||
*
|
||||
* @param decorators The set of decorators to apply.
|
||||
* @param target The target object.
|
||||
* @param key If specified, the own property to apply the decorators to.
|
||||
* @param desc The property descriptor, defaults to fetching the descriptor from the target object.
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
|
||||
|
||||
/**
|
||||
* Creates an observing function decorator from a parameter decorator.
|
||||
*
|
||||
* @param paramIndex The parameter index to apply the decorator to.
|
||||
* @param decorator The parameter decorator to apply. Note that the return value is ignored.
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __param(paramIndex: number, decorator: Function): Function;
|
||||
|
||||
/**
|
||||
* Applies decorators to a class or class member, following the native ECMAScript decorator specification.
|
||||
* @param ctor For non-field class members, the class constructor. Otherwise, `null`.
|
||||
* @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`.
|
||||
* @param decorators The decorators to apply
|
||||
* @param contextIn The `DecoratorContext` to clone for each decorator application.
|
||||
* @param initializers An array of field initializer mutation functions into which new initializers are written.
|
||||
* @param extraInitializers An array of extra initializer functions into which new initializers are written.
|
||||
*/
|
||||
export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void;
|
||||
|
||||
/**
|
||||
* Runs field initializers or extra initializers generated by `__esDecorate`.
|
||||
* @param thisArg The `this` argument to use.
|
||||
* @param initializers The array of initializers to evaluate.
|
||||
* @param value The initial value to pass to the initializers.
|
||||
*/
|
||||
export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any;
|
||||
|
||||
/**
|
||||
* Converts a computed property name into a `string` or `symbol` value.
|
||||
*/
|
||||
export declare function __propKey(x: any): string | symbol;
|
||||
|
||||
/**
|
||||
* Assigns the name of a function derived from the left-hand side of an assignment.
|
||||
* @param f The function to rename.
|
||||
* @param name The new name for the function.
|
||||
* @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name.
|
||||
*/
|
||||
export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function;
|
||||
|
||||
/**
|
||||
* Creates a decorator that sets metadata.
|
||||
*
|
||||
* @param metadataKey The metadata key
|
||||
* @param metadataValue The metadata value
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
|
||||
|
||||
/**
|
||||
* Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the generator function
|
||||
* @param _arguments The optional arguments array
|
||||
* @param P The optional promise constructor argument, defaults to the `Promise` property of the global object.
|
||||
* @param generator The generator function
|
||||
*/
|
||||
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
|
||||
|
||||
/**
|
||||
* Creates an Iterator object using the body as the implementation.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the function
|
||||
* @param body The generator state-machine based implementation.
|
||||
*
|
||||
* @see [./docs/generator.md]
|
||||
*/
|
||||
export declare function __generator(thisArg: any, body: Function): any;
|
||||
|
||||
/**
|
||||
* Creates bindings for all enumerable properties of `m` on `exports`
|
||||
*
|
||||
* @param m The source object
|
||||
* @param exports The `exports` object.
|
||||
*/
|
||||
export declare function __exportStar(m: any, o: any): void;
|
||||
|
||||
/**
|
||||
* Creates a value iterator from an `Iterable` or `ArrayLike` object.
|
||||
*
|
||||
* @param o The object.
|
||||
* @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`.
|
||||
*/
|
||||
export declare function __values(o: any): any;
|
||||
|
||||
/**
|
||||
* Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array.
|
||||
*
|
||||
* @param o The object to read from.
|
||||
* @param n The maximum number of arguments to read, defaults to `Infinity`.
|
||||
*/
|
||||
export declare function __read(o: any, n?: number): any[];
|
||||
|
||||
/**
|
||||
* Creates an array from iterable spread.
|
||||
*
|
||||
* @param args The Iterable objects to spread.
|
||||
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
|
||||
*/
|
||||
export declare function __spread(...args: any[][]): any[];
|
||||
|
||||
/**
|
||||
* Creates an array from array spread.
|
||||
*
|
||||
* @param args The ArrayLikes to spread into the resulting array.
|
||||
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
|
||||
*/
|
||||
export declare function __spreadArrays(...args: any[][]): any[];
|
||||
|
||||
/**
|
||||
* Spreads the `from` array into the `to` array.
|
||||
*
|
||||
* @param pack Replace empty elements with `undefined`.
|
||||
*/
|
||||
export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[];
|
||||
|
||||
/**
|
||||
* Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded,
|
||||
* and instead should be awaited and the resulting value passed back to the generator.
|
||||
*
|
||||
* @param v The value to await.
|
||||
*/
|
||||
export declare function __await(v: any): any;
|
||||
|
||||
/**
|
||||
* Converts a generator function into an async generator function, by using `yield __await`
|
||||
* in place of normal `await`.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the generator function
|
||||
* @param _arguments The optional arguments array
|
||||
* @param generator The generator function
|
||||
*/
|
||||
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
|
||||
|
||||
/**
|
||||
* Used to wrap a potentially async iterator in such a way so that it wraps the result
|
||||
* of calling iterator methods of `o` in `__await` instances, and then yields the awaited values.
|
||||
*
|
||||
* @param o The potentially async iterator.
|
||||
* @returns A synchronous iterator yielding `__await` instances on every odd invocation
|
||||
* and returning the awaited `IteratorResult` passed to `next` every even invocation.
|
||||
*/
|
||||
export declare function __asyncDelegator(o: any): any;
|
||||
|
||||
/**
|
||||
* Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object.
|
||||
*
|
||||
* @param o The object.
|
||||
* @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`.
|
||||
*/
|
||||
export declare function __asyncValues(o: any): any;
|
||||
|
||||
/**
|
||||
* Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays.
|
||||
*
|
||||
* @param cooked The cooked possibly-sparse array.
|
||||
* @param raw The raw string content.
|
||||
*/
|
||||
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
|
||||
|
||||
/**
|
||||
* Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS.
|
||||
*
|
||||
* ```js
|
||||
* import Default, { Named, Other } from "mod";
|
||||
* // or
|
||||
* import { default as Default, Named, Other } from "mod";
|
||||
* ```
|
||||
*
|
||||
* @param mod The CommonJS module exports object.
|
||||
*/
|
||||
export declare function __importStar<T>(mod: T): T;
|
||||
|
||||
/**
|
||||
* Used to shim default imports in ECMAScript Modules transpiled to CommonJS.
|
||||
*
|
||||
* ```js
|
||||
* import Default from "mod";
|
||||
* ```
|
||||
*
|
||||
* @param mod The CommonJS module exports object.
|
||||
*/
|
||||
export declare function __importDefault<T>(mod: T): T | { default: T };
|
||||
|
||||
/**
|
||||
* Emulates reading a private instance field.
|
||||
*
|
||||
* @param receiver The instance from which to read the private field.
|
||||
* @param state A WeakMap containing the private field value for an instance.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean, get(o: T): V | undefined },
|
||||
kind?: "f"
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private static field.
|
||||
*
|
||||
* @param receiver The object from which to read the private static field.
|
||||
* @param state The class constructor containing the definition of the static field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The descriptor that holds the static field value.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "f",
|
||||
f: { value: V }
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates evaluating a private instance "get" accessor.
|
||||
*
|
||||
* @param receiver The instance on which to evaluate the private "get" accessor.
|
||||
* @param state A WeakSet used to verify an instance supports the private "get" accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "get" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
kind: "a",
|
||||
f: () => V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates evaluating a private static "get" accessor.
|
||||
*
|
||||
* @param receiver The object on which to evaluate the private static "get" accessor.
|
||||
* @param state The class constructor containing the definition of the static "get" accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "get" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "a",
|
||||
f: () => V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private instance method.
|
||||
*
|
||||
* @param receiver The instance from which to read a private method.
|
||||
* @param state A WeakSet used to verify an instance supports the private method.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The function to return as the private instance method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V extends (...args: any[]) => unknown>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
kind: "m",
|
||||
f: V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private static method.
|
||||
*
|
||||
* @param receiver The object from which to read the private static method.
|
||||
* @param state The class constructor containing the definition of the static method.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The function to return as the private static method.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V extends (...args: any[]) => unknown>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "m",
|
||||
f: V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private instance field.
|
||||
*
|
||||
* @param receiver The instance on which to set a private field value.
|
||||
* @param state A WeakMap used to store the private field value for an instance.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean, set(o: T, value: V): unknown },
|
||||
value: V,
|
||||
kind?: "f"
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private static field.
|
||||
*
|
||||
* @param receiver The object on which to set the private static field.
|
||||
* @param state The class constructor containing the definition of the private static field.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The descriptor that holds the static field value.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
value: V,
|
||||
kind: "f",
|
||||
f: { value: V }
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private instance "set" accessor.
|
||||
*
|
||||
* @param receiver The instance on which to evaluate the private instance "set" accessor.
|
||||
* @param state A WeakSet used to verify an instance supports the private "set" accessor.
|
||||
* @param value The value to store in the private accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "set" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
value: V,
|
||||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private static "set" accessor.
|
||||
*
|
||||
* @param receiver The object on which to evaluate the private static "set" accessor.
|
||||
* @param state The class constructor containing the definition of the static "set" accessor.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "set" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
value: V,
|
||||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Checks for the existence of a private field/method/accessor.
|
||||
*
|
||||
* @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member.
|
||||
* @param receiver The object for which to test the presence of the private member.
|
||||
*/
|
||||
export declare function __classPrivateFieldIn(
|
||||
state: (new (...args: any[]) => unknown) | { has(o: any): boolean },
|
||||
receiver: unknown,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* Creates a re-export binding on `object` with key `objectKey` that references `target[key]`.
|
||||
*
|
||||
* @param object The local `exports` object.
|
||||
* @param target The object to re-export from.
|
||||
* @param key The property key of `target` to re-export.
|
||||
* @param objectKey The property key to re-export as. Defaults to `key`.
|
||||
*/
|
||||
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;
|
||||
|
||||
/**
|
||||
* Adds a disposable resource to a resource-tracking environment object.
|
||||
* @param env A resource-tracking environment object.
|
||||
* @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`.
|
||||
* @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added.
|
||||
* @returns The {@link value} argument.
|
||||
*
|
||||
* @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not
|
||||
* defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method.
|
||||
*/
|
||||
export declare function __addDisposableResource<T>(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T;
|
||||
|
||||
/**
|
||||
* Disposes all resources in a resource-tracking environment object.
|
||||
* @param env A resource-tracking environment object.
|
||||
* @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`.
|
||||
*
|
||||
* @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the
|
||||
* error recorded in the resource-tracking environment object.
|
||||
* @seealso {@link __addDisposableResource}
|
||||
*/
|
||||
export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any;
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
<script src="tslib.es6.js"></script>
|
||||
370
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
370
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
|
|
@ -0,0 +1,370 @@
|
|||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
export function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
export var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
export function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
export function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
export function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
export function __esDecorate(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;
|
||||
};
|
||||
|
||||
export function __runInitializers(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;
|
||||
};
|
||||
|
||||
export function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
export function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
export function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
export function __awaiter(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());
|
||||
});
|
||||
}
|
||||
|
||||
export function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
export var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
export function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
export function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
export function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
export function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
export function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
export function __asyncGenerator(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]); }
|
||||
}
|
||||
|
||||
export function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
export function __asyncValues(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); }
|
||||
}
|
||||
|
||||
export function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
export function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
export function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
export function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
export function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
function next() {
|
||||
while (env.stack.length) {
|
||||
var rec = env.stack.pop();
|
||||
try {
|
||||
var result = rec.dispose && rec.dispose.call(rec.value);
|
||||
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
export default {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__createBinding,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
};
|
||||
370
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.mjs
generated
vendored
Normal file
370
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,370 @@
|
|||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
export function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
export var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
export function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
export function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
export function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
export function __esDecorate(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;
|
||||
};
|
||||
|
||||
export function __runInitializers(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;
|
||||
};
|
||||
|
||||
export function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
export function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
export function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
export function __awaiter(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());
|
||||
});
|
||||
}
|
||||
|
||||
export function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
export var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
export function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
export function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
export function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
export function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
export function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
export function __asyncGenerator(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]); }
|
||||
}
|
||||
|
||||
export function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
export function __asyncValues(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); }
|
||||
}
|
||||
|
||||
export function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
export function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
export function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
export function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
export function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
function next() {
|
||||
while (env.stack.length) {
|
||||
var rec = env.stack.pop();
|
||||
try {
|
||||
var result = rec.dispose && rec.dispose.call(rec.value);
|
||||
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
export default {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__createBinding,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
};
|
||||
1
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.html
generated
vendored
Normal file
1
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.html
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
<script src="tslib.js"></script>
|
||||
421
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.js
generated
vendored
Normal file
421
github/codeql-action-v2/node_modules/@azure/core-lro/node_modules/tslib/tslib.js
generated
vendored
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global global, define, Symbol, Reflect, Promise, SuppressedError */
|
||||
var __extends;
|
||||
var __assign;
|
||||
var __rest;
|
||||
var __decorate;
|
||||
var __param;
|
||||
var __esDecorate;
|
||||
var __runInitializers;
|
||||
var __propKey;
|
||||
var __setFunctionName;
|
||||
var __metadata;
|
||||
var __awaiter;
|
||||
var __generator;
|
||||
var __exportStar;
|
||||
var __values;
|
||||
var __read;
|
||||
var __spread;
|
||||
var __spreadArrays;
|
||||
var __spreadArray;
|
||||
var __await;
|
||||
var __asyncGenerator;
|
||||
var __asyncDelegator;
|
||||
var __asyncValues;
|
||||
var __makeTemplateObject;
|
||||
var __importStar;
|
||||
var __importDefault;
|
||||
var __classPrivateFieldGet;
|
||||
var __classPrivateFieldSet;
|
||||
var __classPrivateFieldIn;
|
||||
var __createBinding;
|
||||
var __addDisposableResource;
|
||||
var __disposeResources;
|
||||
(function (factory) {
|
||||
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
|
||||
}
|
||||
else if (typeof module === "object" && typeof module.exports === "object") {
|
||||
factory(createExporter(root, createExporter(module.exports)));
|
||||
}
|
||||
else {
|
||||
factory(createExporter(root));
|
||||
}
|
||||
function createExporter(exports, previous) {
|
||||
if (exports !== root) {
|
||||
if (typeof Object.create === "function") {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
}
|
||||
else {
|
||||
exports.__esModule = true;
|
||||
}
|
||||
}
|
||||
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
|
||||
}
|
||||
})
|
||||
(function (exporter) {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
|
||||
__extends = function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
|
||||
__assign = Object.assign || function (t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
__rest = function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
__decorate = function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
|
||||
__param = function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
|
||||
__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;
|
||||
};
|
||||
|
||||
__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;
|
||||
};
|
||||
|
||||
__propKey = function (x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
__setFunctionName = function (f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
__metadata = function (metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
};
|
||||
|
||||
__awaiter = function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
|
||||
__generator = function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
|
||||
__exportStar = function(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
};
|
||||
|
||||
__createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
__values = function (o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
|
||||
__read = function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
__spread = function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
__spreadArrays = function () {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
};
|
||||
|
||||
__spreadArray = function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
|
||||
__await = function (v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
};
|
||||
|
||||
__asyncGenerator = function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
|
||||
__asyncDelegator = function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
|
||||
__asyncValues = function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
|
||||
__makeTemplateObject = function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
__importStar = function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
|
||||
__importDefault = function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
|
||||
__classPrivateFieldGet = function (receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
};
|
||||
|
||||
__classPrivateFieldSet = function (receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
|
||||
__classPrivateFieldIn = function (state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
};
|
||||
|
||||
__addDisposableResource = function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object") throw new TypeError("Object expected.");
|
||||
var dispose;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
__disposeResources = function (env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
function next() {
|
||||
while (env.stack.length) {
|
||||
var rec = env.stack.pop();
|
||||
try {
|
||||
var result = rec.dispose && rec.dispose.call(rec.value);
|
||||
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
};
|
||||
|
||||
exporter("__extends", __extends);
|
||||
exporter("__assign", __assign);
|
||||
exporter("__rest", __rest);
|
||||
exporter("__decorate", __decorate);
|
||||
exporter("__param", __param);
|
||||
exporter("__esDecorate", __esDecorate);
|
||||
exporter("__runInitializers", __runInitializers);
|
||||
exporter("__propKey", __propKey);
|
||||
exporter("__setFunctionName", __setFunctionName);
|
||||
exporter("__metadata", __metadata);
|
||||
exporter("__awaiter", __awaiter);
|
||||
exporter("__generator", __generator);
|
||||
exporter("__exportStar", __exportStar);
|
||||
exporter("__createBinding", __createBinding);
|
||||
exporter("__values", __values);
|
||||
exporter("__read", __read);
|
||||
exporter("__spread", __spread);
|
||||
exporter("__spreadArrays", __spreadArrays);
|
||||
exporter("__spreadArray", __spreadArray);
|
||||
exporter("__await", __await);
|
||||
exporter("__asyncGenerator", __asyncGenerator);
|
||||
exporter("__asyncDelegator", __asyncDelegator);
|
||||
exporter("__asyncValues", __asyncValues);
|
||||
exporter("__makeTemplateObject", __makeTemplateObject);
|
||||
exporter("__importStar", __importStar);
|
||||
exporter("__importDefault", __importDefault);
|
||||
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
||||
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
||||
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
||||
exporter("__addDisposableResource", __addDisposableResource);
|
||||
exporter("__disposeResources", __disposeResources);
|
||||
});
|
||||
126
github/codeql-action-v2/node_modules/@azure/core-lro/package.json
generated
vendored
Normal file
126
github/codeql-action-v2/node_modules/@azure/core-lro/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
{
|
||||
"name": "@azure/core-lro",
|
||||
"author": "Microsoft Corporation",
|
||||
"sdk-type": "client",
|
||||
"version": "2.5.3",
|
||||
"description": "Isomorphic client library for supporting long-running operations in node.js and browser.",
|
||||
"tags": [
|
||||
"isomorphic",
|
||||
"browser",
|
||||
"javascript",
|
||||
"node",
|
||||
"microsoft",
|
||||
"lro",
|
||||
"polling"
|
||||
],
|
||||
"keywords": [
|
||||
"isomorphic",
|
||||
"browser",
|
||||
"javascript",
|
||||
"node",
|
||||
"microsoft",
|
||||
"lro",
|
||||
"polling",
|
||||
"azure",
|
||||
"cloud"
|
||||
],
|
||||
"main": "./dist/index.js",
|
||||
"module": "dist-esm/src/index.js",
|
||||
"types": "./types/core-lro.d.ts",
|
||||
"files": [
|
||||
"types/core-lro.d.ts",
|
||||
"dist-esm/src",
|
||||
"dist/",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"browser": {
|
||||
"os": false,
|
||||
"process": false
|
||||
},
|
||||
"react-native": {
|
||||
"./dist/index.js": "./dist-esm/src/index.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md",
|
||||
"repository": "github:Azure/azure-sdk-for-js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"nyc": {
|
||||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"exclude": [
|
||||
"coverage/**/*",
|
||||
"**/*.d.ts",
|
||||
"**/*.js"
|
||||
],
|
||||
"reporter": [
|
||||
"text",
|
||||
"html",
|
||||
"cobertura"
|
||||
],
|
||||
"all": true
|
||||
},
|
||||
"scripts": {
|
||||
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
||||
"build:samples": "echo Obsolete",
|
||||
"build:test": "tsc -p . && dev-tool run bundle",
|
||||
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
|
||||
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
|
||||
"clean": "rimraf dist dist-* types *.log browser statistics.html coverage src/**/*.js test/**/*.js",
|
||||
"execute:samples": "echo skipped",
|
||||
"extract-api": "tsc -p . && api-extractor run --local",
|
||||
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
|
||||
"integration-test:browser": "echo skipped",
|
||||
"integration-test:node": "echo skipped",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
|
||||
"lint": "eslint package.json api-extractor.json src test --ext .ts",
|
||||
"pack": "npm pack 2>&1",
|
||||
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
|
||||
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
|
||||
"test": "npm run build:test && npm run unit-test",
|
||||
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
||||
"unit-test:browser": "karma start --single-run",
|
||||
"unit-test:node": "cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" nyc mocha -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\""
|
||||
},
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-util": "^1.2.0",
|
||||
"@azure/logger": "^1.0.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@azure/core-rest-pipeline": "^1.1.0",
|
||||
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
||||
"@azure/dev-tool": "^1.0.0",
|
||||
"@azure/test-utils": "^1.0.0",
|
||||
"@microsoft/api-extractor": "^7.31.1",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^14.0.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"eslint": "^8.0.0",
|
||||
"karma": "^6.2.0",
|
||||
"karma-chrome-launcher": "^3.0.0",
|
||||
"karma-coverage": "^2.0.0",
|
||||
"karma-env-preprocessor": "^0.1.1",
|
||||
"karma-firefox-launcher": "^1.1.0",
|
||||
"karma-junit-reporter": "^2.0.1",
|
||||
"karma-mocha": "^2.0.1",
|
||||
"karma-mocha-reporter": "^2.2.5",
|
||||
"karma-sourcemap-loader": "^0.3.8",
|
||||
"mocha": "^7.1.1",
|
||||
"mocha-junit-reporter": "^2.0.0",
|
||||
"nyc": "^15.0.0",
|
||||
"prettier": "^2.5.1",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "~5.0.0"
|
||||
}
|
||||
}
|
||||
704
github/codeql-action-v2/node_modules/@azure/core-lro/types/core-lro.d.ts
generated
vendored
Normal file
704
github/codeql-action-v2/node_modules/@azure/core-lro/types/core-lro.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,704 @@
|
|||
import { AbortSignalLike } from '@azure/abort-controller';
|
||||
|
||||
/**
|
||||
* CancelOnProgress is used as the return value of a Poller's onProgress method.
|
||||
* When a user invokes onProgress, they're required to pass in a function that will be
|
||||
* called as a callback with the new data received each time the poll operation is updated.
|
||||
* onProgress returns a function that will prevent any further update to reach the original callback.
|
||||
*/
|
||||
export declare type CancelOnProgress = () => void;
|
||||
|
||||
/**
|
||||
* Creates a poller that can be used to poll a long-running operation.
|
||||
* @param lro - Description of the long-running operation
|
||||
* @param options - options to configure the poller
|
||||
* @returns an initialized poller
|
||||
*/
|
||||
export declare function createHttpPoller<TResult, TState extends OperationState<TResult>>(lro: LongRunningOperation, options?: CreateHttpPollerOptions<TResult, TState>): Promise<SimplePollerLike<TState, TResult>>;
|
||||
|
||||
/**
|
||||
* Options for `createPoller`.
|
||||
*/
|
||||
export declare interface CreateHttpPollerOptions<TResult, TState> {
|
||||
/**
|
||||
* Defines how much time the poller is going to wait before making a new request to the service.
|
||||
*/
|
||||
intervalInMs?: number;
|
||||
/**
|
||||
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
|
||||
*/
|
||||
restoreFrom?: string;
|
||||
/**
|
||||
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
||||
*/
|
||||
resourceLocationConfig?: LroResourceLocationConfig;
|
||||
/**
|
||||
* A function to process the result of the LRO.
|
||||
*/
|
||||
processResult?: (result: unknown, state: TState) => TResult;
|
||||
/**
|
||||
* A function to process the state of the LRO.
|
||||
*/
|
||||
updateState?: (state: TState, response: LroResponse) => void;
|
||||
/**
|
||||
* A function to be called each time the operation location is updated by the
|
||||
* service.
|
||||
*/
|
||||
withOperationLocation?: (operationLocation: string) => void;
|
||||
/**
|
||||
* Control whether to throw an exception if the operation failed or was canceled.
|
||||
*/
|
||||
resolveOnUnsuccessful?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of a long running operation.
|
||||
*/
|
||||
export declare interface LongRunningOperation<T = unknown> {
|
||||
/**
|
||||
* The request path. This should be set if the operation is a PUT and needs
|
||||
* to poll from the same request path.
|
||||
*/
|
||||
requestPath?: string;
|
||||
/**
|
||||
* The HTTP request method. This should be set if the operation is a PUT or a
|
||||
* DELETE.
|
||||
*/
|
||||
requestMethod?: string;
|
||||
/**
|
||||
* A function that can be used to send initial request to the service.
|
||||
*/
|
||||
sendInitialRequest: () => Promise<LroResponse<unknown>>;
|
||||
/**
|
||||
* A function that can be used to poll for the current status of a long running operation.
|
||||
*/
|
||||
sendPollRequest: (path: string, options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}) => Promise<LroResponse<T>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LRO Engine, a class that performs polling.
|
||||
*/
|
||||
export declare class LroEngine<TResult, TState extends PollOperationState<TResult>> extends Poller<TState, TResult> {
|
||||
private config;
|
||||
constructor(lro: LongRunningOperation<TResult>, options?: LroEngineOptions<TResult, TState>);
|
||||
/**
|
||||
* The method used by the poller to wait before attempting to update its operation.
|
||||
*/
|
||||
delay(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for the LRO poller.
|
||||
*/
|
||||
export declare interface LroEngineOptions<TResult, TState> {
|
||||
/**
|
||||
* Defines how much time the poller is going to wait before making a new request to the service.
|
||||
*/
|
||||
intervalInMs?: number;
|
||||
/**
|
||||
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
|
||||
*/
|
||||
resumeFrom?: string;
|
||||
/**
|
||||
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
||||
*/
|
||||
lroResourceLocationConfig?: LroResourceLocationConfig;
|
||||
/**
|
||||
* A function to process the result of the LRO.
|
||||
*/
|
||||
processResult?: (result: unknown, state: TState) => TResult;
|
||||
/**
|
||||
* A function to process the state of the LRO.
|
||||
*/
|
||||
updateState?: (state: TState, lastResponse: RawResponse) => void;
|
||||
/**
|
||||
* A predicate to determine whether the LRO finished processing.
|
||||
*/
|
||||
isDone?: (lastResponse: unknown, state: TState) => boolean;
|
||||
/**
|
||||
* Control whether to throw an exception if the operation failed or was canceled.
|
||||
*/
|
||||
resolveOnUnsuccessful?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
||||
*/
|
||||
export declare type LroResourceLocationConfig = "azure-async-operation" | "location" | "original-uri";
|
||||
|
||||
/**
|
||||
* The type of the response of a LRO.
|
||||
*/
|
||||
export declare interface LroResponse<T = unknown> {
|
||||
/** The flattened response */
|
||||
flatResponse: T;
|
||||
/** The raw response */
|
||||
rawResponse: RawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* While the poller works as the local control mechanism to start triggering and
|
||||
* wait for a long-running operation, OperationState documents the status of
|
||||
* the remote long-running operation. It gets updated after each poll.
|
||||
*/
|
||||
export declare interface OperationState<TResult> {
|
||||
/**
|
||||
* The current status of the operation.
|
||||
*/
|
||||
status: OperationStatus;
|
||||
/**
|
||||
* Will exist if the operation encountered any error.
|
||||
*/
|
||||
error?: Error;
|
||||
/**
|
||||
* Will exist if the operation produced a result of the expected type.
|
||||
*/
|
||||
result?: TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of possible states an operation can be in at any given time.
|
||||
*/
|
||||
export declare type OperationStatus = "notStarted" | "running" | "succeeded" | "canceled" | "failed";
|
||||
|
||||
/**
|
||||
* A class that represents the definition of a program that polls through consecutive requests
|
||||
* until it reaches a state of completion.
|
||||
*
|
||||
* A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed.
|
||||
* It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes.
|
||||
* Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation.
|
||||
*
|
||||
* ```ts
|
||||
* const poller = new MyPoller();
|
||||
*
|
||||
* // Polling just once:
|
||||
* await poller.poll();
|
||||
*
|
||||
* // We can try to cancel the request here, by calling:
|
||||
* //
|
||||
* // await poller.cancelOperation();
|
||||
* //
|
||||
*
|
||||
* // Getting the final result:
|
||||
* const result = await poller.pollUntilDone();
|
||||
* ```
|
||||
*
|
||||
* The Poller is defined by two types, a type representing the state of the poller, which
|
||||
* must include a basic set of properties from `PollOperationState<TResult>`,
|
||||
* and a return type defined by `TResult`, which can be anything.
|
||||
*
|
||||
* The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having
|
||||
* to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type.
|
||||
*
|
||||
* ```ts
|
||||
* class Client {
|
||||
* public async makePoller: PollerLike<MyOperationState, MyResult> {
|
||||
* const poller = new MyPoller({});
|
||||
* // It might be preferred to return the poller after the first request is made,
|
||||
* // so that some information can be obtained right away.
|
||||
* await poller.poll();
|
||||
* return poller;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const poller: PollerLike<MyOperationState, MyResult> = myClient.makePoller();
|
||||
* ```
|
||||
*
|
||||
* A poller can be created through its constructor, then it can be polled until it's completed.
|
||||
* At any point in time, the state of the poller can be obtained without delay through the getOperationState method.
|
||||
* At any point in time, the intermediate forms of the result type can be requested without delay.
|
||||
* Once the underlying operation is marked as completed, the poller will stop and the final value will be returned.
|
||||
*
|
||||
* ```ts
|
||||
* const poller = myClient.makePoller();
|
||||
* const state: MyOperationState = poller.getOperationState();
|
||||
*
|
||||
* // The intermediate result can be obtained at any time.
|
||||
* const result: MyResult | undefined = poller.getResult();
|
||||
*
|
||||
* // The final result can only be obtained after the poller finishes.
|
||||
* const result: MyResult = await poller.pollUntilDone();
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
export declare abstract class Poller<TState extends PollOperationState<TResult>, TResult> implements PollerLike<TState, TResult> {
|
||||
/** controls whether to throw an error if the operation failed or was canceled. */
|
||||
protected resolveOnUnsuccessful: boolean;
|
||||
private stopped;
|
||||
private resolve?;
|
||||
private reject?;
|
||||
private pollOncePromise?;
|
||||
private cancelPromise?;
|
||||
private promise;
|
||||
private pollProgressCallbacks;
|
||||
/**
|
||||
* The poller's operation is available in full to any of the methods of the Poller class
|
||||
* and any class extending the Poller class.
|
||||
*/
|
||||
protected operation: PollOperation<TState, TResult>;
|
||||
/**
|
||||
* A poller needs to be initialized by passing in at least the basic properties of the `PollOperation<TState, TResult>`.
|
||||
*
|
||||
* When writing an implementation of a Poller, this implementation needs to deal with the initialization
|
||||
* of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's
|
||||
* operation has already been defined, at least its basic properties. The code below shows how to approach
|
||||
* the definition of the constructor of a new custom poller.
|
||||
*
|
||||
* ```ts
|
||||
* export class MyPoller extends Poller<MyOperationState, string> {
|
||||
* constructor({
|
||||
* // Anything you might need outside of the basics
|
||||
* }) {
|
||||
* let state: MyOperationState = {
|
||||
* privateProperty: private,
|
||||
* publicProperty: public,
|
||||
* };
|
||||
*
|
||||
* const operation = {
|
||||
* state,
|
||||
* update,
|
||||
* cancel,
|
||||
* toString
|
||||
* }
|
||||
*
|
||||
* // Sending the operation to the parent's constructor.
|
||||
* super(operation);
|
||||
*
|
||||
* // You can assign more local properties here.
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Inside of this constructor, a new promise is created. This will be used to
|
||||
* tell the user when the poller finishes (see `pollUntilDone()`). The promise's
|
||||
* resolve and reject methods are also used internally to control when to resolve
|
||||
* or reject anyone waiting for the poller to finish.
|
||||
*
|
||||
* The constructor of a custom implementation of a poller is where any serialized version of
|
||||
* a previous poller's operation should be deserialized into the operation sent to the
|
||||
* base constructor. For example:
|
||||
*
|
||||
* ```ts
|
||||
* export class MyPoller extends Poller<MyOperationState, string> {
|
||||
* constructor(
|
||||
* baseOperation: string | undefined
|
||||
* ) {
|
||||
* let state: MyOperationState = {};
|
||||
* if (baseOperation) {
|
||||
* state = {
|
||||
* ...JSON.parse(baseOperation).state,
|
||||
* ...state
|
||||
* };
|
||||
* }
|
||||
* const operation = {
|
||||
* state,
|
||||
* // ...
|
||||
* }
|
||||
* super(operation);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param operation - Must contain the basic properties of `PollOperation<State, TResult>`.
|
||||
*/
|
||||
constructor(operation: PollOperation<TState, TResult>);
|
||||
/**
|
||||
* Defines how much to wait between each poll request.
|
||||
* This has to be implemented by your custom poller.
|
||||
*
|
||||
* \@azure/core-util has a simple implementation of a delay function that waits as many milliseconds as specified.
|
||||
* This can be used as follows:
|
||||
*
|
||||
* ```ts
|
||||
* import { delay } from "@azure/core-util";
|
||||
*
|
||||
* export class MyPoller extends Poller<MyOperationState, string> {
|
||||
* // The other necessary definitions.
|
||||
*
|
||||
* async delay(): Promise<void> {
|
||||
* const milliseconds = 1000;
|
||||
* return delay(milliseconds);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
protected abstract delay(): Promise<void>;
|
||||
/**
|
||||
* Starts a loop that will break only if the poller is done
|
||||
* or if the poller is stopped.
|
||||
*/
|
||||
private startPolling;
|
||||
/**
|
||||
* pollOnce does one polling, by calling to the update method of the underlying
|
||||
* poll operation to make any relevant change effective.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
private pollOnce;
|
||||
/**
|
||||
* fireProgress calls the functions passed in via onProgress the method of the poller.
|
||||
*
|
||||
* It loops over all of the callbacks received from onProgress, and executes them, sending them
|
||||
* the current operation state.
|
||||
*
|
||||
* @param state - The current operation state.
|
||||
*/
|
||||
private fireProgress;
|
||||
/**
|
||||
* Invokes the underlying operation's cancel method.
|
||||
*/
|
||||
private cancelOnce;
|
||||
/**
|
||||
* Returns a promise that will resolve once a single polling request finishes.
|
||||
* It does this by calling the update method of the Poller's operation.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
poll(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<void>;
|
||||
private processUpdatedState;
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
pollUntilDone(pollOptions?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<TResult>;
|
||||
/**
|
||||
* Invokes the provided callback after each polling is completed,
|
||||
* sending the current state of the poller's operation.
|
||||
*
|
||||
* It returns a method that can be used to stop receiving updates on the given callback function.
|
||||
*/
|
||||
onProgress(callback: (state: TState) => void): CancelOnProgress;
|
||||
/**
|
||||
* Returns true if the poller has finished polling.
|
||||
*/
|
||||
isDone(): boolean;
|
||||
/**
|
||||
* Stops the poller from continuing to poll.
|
||||
*/
|
||||
stopPolling(): void;
|
||||
/**
|
||||
* Returns true if the poller is stopped.
|
||||
*/
|
||||
isStopped(): boolean;
|
||||
/**
|
||||
* Attempts to cancel the underlying operation.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* If it's called again before it finishes, it will throw an error.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
cancelOperation(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<void>;
|
||||
/**
|
||||
* Returns the state of the operation.
|
||||
*
|
||||
* Even though TState will be the same type inside any of the methods of any extension of the Poller class,
|
||||
* implementations of the pollers can customize what's shared with the public by writing their own
|
||||
* version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller
|
||||
* and a public type representing a safe to share subset of the properties of the internal state.
|
||||
* Their definition of getOperationState can then return their public type.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```ts
|
||||
* // Let's say we have our poller's operation state defined as:
|
||||
* interface MyOperationState extends PollOperationState<ResultType> {
|
||||
* privateProperty?: string;
|
||||
* publicProperty?: string;
|
||||
* }
|
||||
*
|
||||
* // To allow us to have a true separation of public and private state, we have to define another interface:
|
||||
* interface PublicState extends PollOperationState<ResultType> {
|
||||
* publicProperty?: string;
|
||||
* }
|
||||
*
|
||||
* // Then, we define our Poller as follows:
|
||||
* export class MyPoller extends Poller<MyOperationState, ResultType> {
|
||||
* // ... More content is needed here ...
|
||||
*
|
||||
* public getOperationState(): PublicState {
|
||||
* const state: PublicState = this.operation.state;
|
||||
* return {
|
||||
* // Properties from PollOperationState<TResult>
|
||||
* isStarted: state.isStarted,
|
||||
* isCompleted: state.isCompleted,
|
||||
* isCancelled: state.isCancelled,
|
||||
* error: state.error,
|
||||
* result: state.result,
|
||||
*
|
||||
* // The only other property needed by PublicState.
|
||||
* publicProperty: state.publicProperty
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* You can see this in the tests of this repository, go to the file:
|
||||
* `../test/utils/testPoller.ts`
|
||||
* and look for the getOperationState implementation.
|
||||
*/
|
||||
getOperationState(): TState;
|
||||
/**
|
||||
* Returns the result value of the operation,
|
||||
* regardless of the state of the poller.
|
||||
* It can return undefined or an incomplete form of the final TResult value
|
||||
* depending on the implementation.
|
||||
*/
|
||||
getResult(): TResult | undefined;
|
||||
/**
|
||||
* Returns a serialized version of the poller's operation
|
||||
* by invoking the operation's toString method.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* When the operation is cancelled, the poller will be rejected with an instance
|
||||
* of the PollerCancelledError.
|
||||
*/
|
||||
export declare class PollerCancelledError extends Error {
|
||||
constructor(message: string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract representation of a poller, intended to expose just the minimal API that the user needs to work with.
|
||||
*/
|
||||
export declare interface PollerLike<TState extends PollOperationState<TResult>, TResult> {
|
||||
/**
|
||||
* Returns a promise that will resolve once a single polling request finishes.
|
||||
* It does this by calling the update method of the Poller's operation.
|
||||
*/
|
||||
poll(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<void>;
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
pollUntilDone(pollOptions?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<TResult>;
|
||||
/**
|
||||
* Invokes the provided callback after each polling is completed,
|
||||
* sending the current state of the poller's operation.
|
||||
*
|
||||
* It returns a method that can be used to stop receiving updates on the given callback function.
|
||||
*/
|
||||
onProgress(callback: (state: TState) => void): CancelOnProgress;
|
||||
/**
|
||||
* Returns true if the poller has finished polling.
|
||||
*/
|
||||
isDone(): boolean;
|
||||
/**
|
||||
* Stops the poller. After this, no manual or automated requests can be sent.
|
||||
*/
|
||||
stopPolling(): void;
|
||||
/**
|
||||
* Returns true if the poller is stopped.
|
||||
*/
|
||||
isStopped(): boolean;
|
||||
/**
|
||||
* Attempts to cancel the underlying operation.
|
||||
* @deprecated `cancelOperation` has been deprecated because it was not implemented.
|
||||
*/
|
||||
cancelOperation(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<void>;
|
||||
/**
|
||||
* Returns the state of the operation.
|
||||
* The TState defined in PollerLike can be a subset of the TState defined in
|
||||
* the Poller implementation.
|
||||
*/
|
||||
getOperationState(): TState;
|
||||
/**
|
||||
* Returns the result value of the operation,
|
||||
* regardless of the state of the poller.
|
||||
* It can return undefined or an incomplete form of the final TResult value
|
||||
* depending on the implementation.
|
||||
*/
|
||||
getResult(): TResult | undefined;
|
||||
/**
|
||||
* Returns a serialized version of the poller's operation
|
||||
* by invoking the operation's toString method.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* When a poller is manually stopped through the `stopPolling` method,
|
||||
* the poller will be rejected with an instance of the PollerStoppedError.
|
||||
*/
|
||||
export declare class PollerStoppedError extends Error {
|
||||
constructor(message: string);
|
||||
}
|
||||
|
||||
/**
|
||||
* PollOperation is an interface that defines how to update the local reference of the state of the remote
|
||||
* long running operation, just as well as how to request the cancellation of the same operation.
|
||||
*
|
||||
* It also has a method to serialize the operation so that it can be stored and resumed at any time.
|
||||
*/
|
||||
export declare interface PollOperation<TState, TResult> {
|
||||
/**
|
||||
* The state of the operation.
|
||||
* It will be used to store the basic properties of PollOperationState<TResult>,
|
||||
* plus any custom property that the implementation may require.
|
||||
*/
|
||||
state: TState;
|
||||
/**
|
||||
* Defines how to request the remote service for updates on the status of the long running operation.
|
||||
*
|
||||
* It optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
* Also optionally receives a "fireProgress" function, which, if called, is responsible for triggering the
|
||||
* poller's onProgress callbacks.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*/
|
||||
update(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
fireProgress?: (state: TState) => void;
|
||||
}): Promise<PollOperation<TState, TResult>>;
|
||||
/**
|
||||
* Attempts to cancel the underlying operation.
|
||||
*
|
||||
* It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike.
|
||||
*
|
||||
* It returns a promise that should be resolved with an updated version of the poller's operation.
|
||||
*
|
||||
* @param options - Optional properties passed to the operation's update method.
|
||||
*
|
||||
* @deprecated `cancel` has been deprecated because it was not implemented.
|
||||
*/
|
||||
cancel(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<PollOperation<TState, TResult>>;
|
||||
/**
|
||||
* Serializes the operation.
|
||||
* Useful when wanting to create a poller that monitors an existing operation.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* PollOperationState contains an opinionated list of the smallest set of properties needed
|
||||
* to define any long running operation poller.
|
||||
*
|
||||
* While the Poller class works as the local control mechanism to start triggering, wait for,
|
||||
* and potentially cancel a long running operation, the PollOperationState documents the status
|
||||
* of the remote long running operation.
|
||||
*
|
||||
* It should be updated at least when the operation starts, when it's finished, and when it's cancelled.
|
||||
* Though, implementations can have any other number of properties that can be updated by other reasons.
|
||||
*/
|
||||
export declare interface PollOperationState<TResult> {
|
||||
/**
|
||||
* True if the operation has started.
|
||||
*/
|
||||
isStarted?: boolean;
|
||||
/**
|
||||
* True if the operation has been completed.
|
||||
*/
|
||||
isCompleted?: boolean;
|
||||
/**
|
||||
* True if the operation has been cancelled.
|
||||
*/
|
||||
isCancelled?: boolean;
|
||||
/**
|
||||
* Will exist if the operation encountered any error.
|
||||
*/
|
||||
error?: Error;
|
||||
/**
|
||||
* Will exist if the operation concluded in a result of an expected type.
|
||||
*/
|
||||
result?: TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* PollProgressCallback<TState> is the type of the callback functions sent to onProgress.
|
||||
* These functions will receive a TState that is defined by your implementation of
|
||||
* the Poller class.
|
||||
*/
|
||||
export declare type PollProgressCallback<TState> = (state: TState) => void;
|
||||
|
||||
/**
|
||||
* Simple type of the raw response.
|
||||
*/
|
||||
export declare interface RawResponse {
|
||||
/** The HTTP status code */
|
||||
statusCode: number;
|
||||
/** A HttpHeaders collection in the response represented as a simple JSON object where all header names have been normalized to be lower-case. */
|
||||
headers: {
|
||||
[headerName: string]: string;
|
||||
};
|
||||
/** The parsed response body */
|
||||
body?: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple poller interface.
|
||||
*/
|
||||
export declare interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {
|
||||
/**
|
||||
* Returns a promise that will resolve once a single polling request finishes.
|
||||
* It does this by calling the update method of the Poller's operation.
|
||||
*/
|
||||
poll(options?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<void>;
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
pollUntilDone(pollOptions?: {
|
||||
abortSignal?: AbortSignalLike;
|
||||
}): Promise<TResult>;
|
||||
/**
|
||||
* Invokes the provided callback after each polling is completed,
|
||||
* sending the current state of the poller's operation.
|
||||
*
|
||||
* It returns a method that can be used to stop receiving updates on the given callback function.
|
||||
*/
|
||||
onProgress(callback: (state: TState) => void): CancelOnProgress;
|
||||
/**
|
||||
* Returns true if the poller has finished polling.
|
||||
*/
|
||||
isDone(): boolean;
|
||||
/**
|
||||
* Stops the poller. After this, no manual or automated requests can be sent.
|
||||
*/
|
||||
stopPolling(): void;
|
||||
/**
|
||||
* Returns true if the poller is stopped.
|
||||
*/
|
||||
isStopped(): boolean;
|
||||
/**
|
||||
* Returns the state of the operation.
|
||||
*/
|
||||
getOperationState(): TState;
|
||||
/**
|
||||
* Returns the result value of the operation,
|
||||
* regardless of the state of the poller.
|
||||
* It can return undefined or an incomplete form of the final TResult value
|
||||
* depending on the implementation.
|
||||
*/
|
||||
getResult(): TResult | undefined;
|
||||
/**
|
||||
* Returns a serialized version of the poller's operation
|
||||
* by invoking the operation's toString method.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export { }
|
||||
Loading…
Add table
Add a link
Reference in a new issue