mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 20:48:29 +02:00
feat: add @actions/cache
This commit is contained in:
parent
b15fb7d098
commit
16e8c96a41
1932 changed files with 261172 additions and 10 deletions
82
node_modules/@azure/core-lro/CHANGELOG.md
generated
vendored
Normal file
82
node_modules/@azure/core-lro/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
# Release History
|
||||
|
||||
## 2.2.4 (2022-03-07)
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
- Fix polling so that resources created in a different URL will be retrieved once polling is done. [PR #20656](https://github.com/Azure/azure-sdk-for-js/pull/20656)
|
||||
|
||||
## 2.2.3 (2022-01-06)
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
- Fix an issue where we treat Retry-After value as milliseconds. It is actually in seconds. [PR #19479](https://github.com/Azure/azure-sdk-for-js/pull/19479)
|
||||
|
||||
## 2.2.2 (2021-12-02)
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
- Fix LRO PATCH operations when their results are located in a different URL. [PR #18820](https://github.com/Azure/azure-sdk-for-js/pull/18820)
|
||||
|
||||
## 2.2.1 (2021-09-30)
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
- Check for string type before calling toLowerCase(). [PR #17573](https://github.com/Azure/azure-sdk-for-js/pull/17573)
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Updates package to work with the react native bundler. [PR #17783](https://github.com/Azure/azure-sdk-for-js/pull/17783)
|
||||
|
||||
## 2.2.0 (2021-08-05)
|
||||
|
||||
### Features Added
|
||||
|
||||
- `LroEngine` supports a new `isDone()` function in its options bag which can be used to provide a custom logic for determining when an LRO finished processing.
|
||||
|
||||
## 2.1.0 (2021-07-19)
|
||||
|
||||
### Features Added
|
||||
|
||||
- Provides a long-running operation engine.
|
||||
|
||||
## 2.0.0 (2021-06-30)
|
||||
|
||||
### New Features
|
||||
|
||||
- Changed TS compilation target to ES2017 in order to produce smaller bundles and use more native platform features
|
||||
|
||||
## 1.0.5 (2021-04-12)
|
||||
|
||||
- No functionality changes from 1.0.4. This release is to correct an issue where 1.0.4 shipped with modules in the wrong format (cjs instead of es6.)
|
||||
|
||||
## 1.0.4 (2021-03-30)
|
||||
|
||||
- Bug fix: Fix an issue where we might return stale state if the `update` implementation reassigns `operation.state`.
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- Updated @azure/core-tracing to version `1.0.0-preview.11`. See [@azure/core-tracing CHANGELOG](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-tracing/CHANGELOG.md) for details about breaking changes with tracing.
|
||||
|
||||
## 1.0.3 (2021-01-07)
|
||||
|
||||
- Updates the `tslib` dependency to version 2.x.
|
||||
|
||||
## 1.0.2 (2020-04-28)
|
||||
|
||||
- Moved `@opentelemetry/types` to the `devDependencies`.
|
||||
|
||||
## 1.0.1 (2020-02-28)
|
||||
|
||||
- `getOperationState()` now returns `TState`.
|
||||
- `TState` of `PollerLike` can be a subset of `TState` of `Poller`,
|
||||
|
||||
## 1.0.0 (2019-10-29)
|
||||
|
||||
This release marks the general availability of the `@azure/core-lro` package.
|
||||
|
||||
- Updated PollOperation to be more strictly typed.
|
||||
|
||||
## 1.0.0-preview.1 (2019-10-22)
|
||||
|
||||
- Initial implementation of an abstraction for Long Running Operations (LROs).
|
21
node_modules/@azure/core-lro/LICENSE
generated
vendored
Normal file
21
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.
|
92
node_modules/@azure/core-lro/README.md
generated
vendored
Normal file
92
node_modules/@azure/core-lro/README.md
generated
vendored
Normal file
|
@ -0,0 +1,92 @@
|
|||
# Azure Core LRO client library for JavaScript
|
||||
|
||||
`@azure/core-lro` is a JavaScript library that manages long running operations (LROs) against Azure services. Until completion, such operations require consecutive calls to Azure services to update a local representation of the remote operation status.
|
||||
|
||||
**Please note:** This library is included with other Azure SDK libraries that need it. It should not be used as a direct dependency in your projects.
|
||||
|
||||
`@azure/core-lro` is made following our [Long Running Operations guidelines](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
|
||||
|
||||
### Install the package
|
||||
|
||||
To install this library for a project under the `azure-sdk-for-js`, make sure you are at the root of that project, then use [Rush](https://rushjs.io/) as follows:
|
||||
|
||||
```
|
||||
rush add -p @azure/core-lro
|
||||
```
|
||||
|
||||
To install this package outside of the `azure-sdk-for-js`, use `npm install --save @azure/core-lro`.
|
||||
|
||||
### Configure TypeScript
|
||||
|
||||
TypeScript users need to have Node type definitions installed:
|
||||
|
||||
```bash
|
||||
npm install @types/node
|
||||
```
|
||||
|
||||
They will also need to enable `compilerOptions.allowSyntheticDefaultImports` in their
|
||||
`tsconfig.json`. Note that if you have enabled `compilerOptions.esModuleInterop`,
|
||||
`allowSyntheticDefaultImports` is enabled by default.
|
||||
See [TypeScript's compiler options handbook](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
|
||||
for more information.
|
||||
|
||||
## Key concepts
|
||||
|
||||
@azure/core-lro makes a distinction between the Long Running Operation and its Poller.
|
||||
|
||||
- Whenever we talk about an **operation**, we mean the static representation of a Long Running Operation.
|
||||
Any operation will have a definition of a **state**, which has an opinionated default set of properties.
|
||||
The definition of the operation will also have functions that will define how to request new information
|
||||
about the pending operation, how to request its cancellation, and how to serialize it.
|
||||
- A **Poller** is an object who's main function is to interact with an operation until the poller is manually stopped,
|
||||
the operation finishes (either by succeeding or failing) or if a manual request to cancel the operation has succeeded.
|
||||
Some characteristics of the pollers are:
|
||||
- Pollers show the status of the polling behavior.
|
||||
- Pollers support manual as well as automatic polling.
|
||||
- Pollers are serializable and can resume from a serialized operation.
|
||||
- Pollers also specify how much of the operation's state is going to be available to the public.
|
||||
- A **PollerLike** is the public interface of a Poller, which allows for different implementations to be used.
|
||||
|
||||
## Examples
|
||||
|
||||
You will be able to find some working examples of an implementation of an operation and a poller in:
|
||||
|
||||
- [The `@azure/core-lro` samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-lro/samples).
|
||||
- [The `@azure/core-lro` tests](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-lro/test).
|
||||
|
||||
## 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.
|
||||
|
||||

|
6
node_modules/@azure/core-lro/dist-esm/src/index.js
generated
vendored
Normal file
6
node_modules/@azure/core-lro/dist-esm/src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export * from "./pollOperation";
|
||||
export * from "./poller";
|
||||
export * from "./lroEngine";
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/index.js.map
generated
vendored
Normal file
1
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,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./pollOperation\";\nexport * from \"./poller\";\nexport * from \"./lroEngine\";\n"]}
|
25
node_modules/@azure/core-lro/dist-esm/src/lroEngine/bodyPolling.js
generated
vendored
Normal file
25
node_modules/@azure/core-lro/dist-esm/src/lroEngine/bodyPolling.js
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { failureStates, successStates, } from "./models";
|
||||
import { isUnexpectedPollingResponse } from "./requestUtils";
|
||||
function getProvisioningState(rawResponse) {
|
||||
var _a, _b;
|
||||
const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
|
||||
const state = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState;
|
||||
return typeof state === "string" ? state.toLowerCase() : "succeeded";
|
||||
}
|
||||
export function isBodyPollingDone(rawResponse) {
|
||||
const state = getProvisioningState(rawResponse);
|
||||
if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {
|
||||
throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);
|
||||
}
|
||||
return successStates.includes(state);
|
||||
}
|
||||
/**
|
||||
* Creates a polling strategy based on BodyPolling which uses the provisioning state
|
||||
* from the result to determine the current operation state
|
||||
*/
|
||||
export function processBodyPollingOperationResult(response) {
|
||||
return Object.assign(Object.assign({}, response), { done: isBodyPollingDone(response.rawResponse) });
|
||||
}
|
||||
//# sourceMappingURL=bodyPolling.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/bodyPolling.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/bodyPolling.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"bodyPolling.js","sourceRoot":"","sources":["../../../src/lroEngine/bodyPolling.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAKL,aAAa,EACb,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,SAAS,oBAAoB,CAAC,WAAwB;;IACpD,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,MAAC,WAAW,CAAC,IAAgB,mCAAI,EAAE,CAAC;IAC9E,MAAM,KAAK,GAAuB,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,iBAAiB,mCAAI,iBAAiB,CAAC;IACrF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,WAAwB;IACxD,MAAM,KAAK,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,2BAA2B,CAAC,WAAW,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC7E,MAAM,IAAI,KAAK,CAAC,kEAAkE,KAAK,GAAG,CAAC,CAAC;KAC7F;IACD,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iCAAiC,CAC/C,QAA8B;IAE9B,uCACK,QAAQ,KACX,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,WAAW,CAAC,IAC7C;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n LroBody,\n LroResponse,\n LroStatus,\n RawResponse,\n failureStates,\n successStates,\n} from \"./models\";\nimport { isUnexpectedPollingResponse } from \"./requestUtils\";\n\nfunction getProvisioningState(rawResponse: RawResponse): string {\n const { properties, provisioningState } = (rawResponse.body as LroBody) ?? {};\n const state: string | undefined = properties?.provisioningState ?? provisioningState;\n return typeof state === \"string\" ? state.toLowerCase() : \"succeeded\";\n}\n\nexport function isBodyPollingDone(rawResponse: RawResponse): boolean {\n const state = getProvisioningState(rawResponse);\n if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {\n throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);\n }\n return successStates.includes(state);\n}\n\n/**\n * Creates a polling strategy based on BodyPolling which uses the provisioning state\n * from the result to determine the current operation state\n */\nexport function processBodyPollingOperationResult<TResult>(\n response: LroResponse<TResult>\n): LroStatus<TResult> {\n return {\n ...response,\n done: isBodyPollingDone(response.rawResponse),\n };\n}\n"]}
|
4
node_modules/@azure/core-lro/dist-esm/src/lroEngine/index.js
generated
vendored
Normal file
4
node_modules/@azure/core-lro/dist-esm/src/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
node_modules/@azure/core-lro/dist-esm/src/lroEngine/index.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/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 {\n LroResourceLocationConfig,\n LongRunningOperation,\n LroResponse,\n LroEngineOptions,\n RawResponse,\n} from \"./models\";\n"]}
|
47
node_modules/@azure/core-lro/dist-esm/src/lroEngine/locationPolling.js
generated
vendored
Normal file
47
node_modules/@azure/core-lro/dist-esm/src/lroEngine/locationPolling.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { failureStates, successStates, } from "./models";
|
||||
import { isUnexpectedPollingResponse } from "./requestUtils";
|
||||
function isPollingDone(rawResponse) {
|
||||
var _a;
|
||||
if (isUnexpectedPollingResponse(rawResponse) || rawResponse.statusCode === 202) {
|
||||
return false;
|
||||
}
|
||||
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
|
||||
const state = typeof status === "string" ? status.toLowerCase() : "succeeded";
|
||||
if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {
|
||||
throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);
|
||||
}
|
||||
return successStates.includes(state);
|
||||
}
|
||||
/**
|
||||
* Sends a request to the URI of the provisioned resource if needed.
|
||||
*/
|
||||
async function sendFinalRequest(lro, resourceLocation, lroResourceLocationConfig) {
|
||||
switch (lroResourceLocationConfig) {
|
||||
case "original-uri":
|
||||
return lro.sendPollRequest(lro.requestPath);
|
||||
case "azure-async-operation":
|
||||
return undefined;
|
||||
case "location":
|
||||
default:
|
||||
return lro.sendPollRequest(resourceLocation !== null && resourceLocation !== void 0 ? resourceLocation : lro.requestPath);
|
||||
}
|
||||
}
|
||||
export function processLocationPollingOperationResult(lro, resourceLocation, lroResourceLocationConfig) {
|
||||
return (response) => {
|
||||
if (isPollingDone(response.rawResponse)) {
|
||||
if (resourceLocation === undefined) {
|
||||
return Object.assign(Object.assign({}, response), { done: true });
|
||||
}
|
||||
else {
|
||||
return Object.assign(Object.assign({}, response), { done: false, next: async () => {
|
||||
const finalResponse = await sendFinalRequest(lro, resourceLocation, lroResourceLocationConfig);
|
||||
return Object.assign(Object.assign({}, (finalResponse !== null && finalResponse !== void 0 ? finalResponse : response)), { done: true });
|
||||
} });
|
||||
}
|
||||
}
|
||||
return Object.assign(Object.assign({}, response), { done: false });
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=locationPolling.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/locationPolling.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/locationPolling.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"locationPolling.js","sourceRoot":"","sources":["../../../src/lroEngine/locationPolling.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAOL,aAAa,EACb,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,SAAS,aAAa,CAAC,WAAwB;;IAC7C,IAAI,2BAA2B,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,UAAU,KAAK,GAAG,EAAE;QAC9E,OAAO,KAAK,CAAC;KACd;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAC,WAAW,CAAC,IAAgB,mCAAI,EAAE,CAAC;IACvD,MAAM,KAAK,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAC9E,IAAI,2BAA2B,CAAC,WAAW,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC7E,MAAM,IAAI,KAAK,CAAC,kEAAkE,KAAK,GAAG,CAAC,CAAC;KAC7F;IACD,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,gBAAgB,CAC7B,GAAkC,EAClC,gBAAwB,EACxB,yBAAqD;IAErD,QAAQ,yBAAyB,EAAE;QACjC,KAAK,cAAc;YACjB,OAAO,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC9C,KAAK,uBAAuB;YAC1B,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU,CAAC;QAChB;YACE,OAAO,GAAG,CAAC,eAAe,CAAC,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,GAAG,CAAC,WAAW,CAAC,CAAC;KACnE;AACH,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,GAAkC,EAClC,gBAAyB,EACzB,yBAAqD;IAErD,OAAO,CAAC,QAA8B,EAAsB,EAAE;QAC5D,IAAI,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;YACvC,IAAI,gBAAgB,KAAK,SAAS,EAAE;gBAClC,uCAAY,QAAQ,KAAE,IAAI,EAAE,IAAI,IAAG;aACpC;iBAAM;gBACL,uCACK,QAAQ,KACX,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,KAAK,IAAI,EAAE;wBACf,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAC1C,GAAG,EACH,gBAAgB,EAChB,yBAAyB,CAC1B,CAAC;wBACF,uCACK,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,QAAQ,CAAC,KAC9B,IAAI,EAAE,IAAI,IACV;oBACJ,CAAC,IACD;aACH;SACF;QACD,uCACK,QAAQ,KACX,IAAI,EAAE,KAAK,IACX;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n LongRunningOperation,\n LroBody,\n LroResourceLocationConfig,\n LroResponse,\n LroStatus,\n RawResponse,\n failureStates,\n successStates,\n} from \"./models\";\nimport { isUnexpectedPollingResponse } from \"./requestUtils\";\n\nfunction isPollingDone(rawResponse: RawResponse): boolean {\n if (isUnexpectedPollingResponse(rawResponse) || rawResponse.statusCode === 202) {\n return false;\n }\n const { status } = (rawResponse.body as LroBody) ?? {};\n const state = typeof status === \"string\" ? status.toLowerCase() : \"succeeded\";\n if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {\n throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);\n }\n return successStates.includes(state);\n}\n\n/**\n * Sends a request to the URI of the provisioned resource if needed.\n */\nasync function sendFinalRequest<TResult>(\n lro: LongRunningOperation<TResult>,\n resourceLocation: string,\n lroResourceLocationConfig?: LroResourceLocationConfig\n): Promise<LroResponse<TResult> | undefined> {\n switch (lroResourceLocationConfig) {\n case \"original-uri\":\n return lro.sendPollRequest(lro.requestPath);\n case \"azure-async-operation\":\n return undefined;\n case \"location\":\n default:\n return lro.sendPollRequest(resourceLocation ?? lro.requestPath);\n }\n}\n\nexport function processLocationPollingOperationResult<TResult>(\n lro: LongRunningOperation<TResult>,\n resourceLocation?: string,\n lroResourceLocationConfig?: LroResourceLocationConfig\n): (response: LroResponse<TResult>) => LroStatus<TResult> {\n return (response: LroResponse<TResult>): LroStatus<TResult> => {\n if (isPollingDone(response.rawResponse)) {\n if (resourceLocation === undefined) {\n return { ...response, done: true };\n } else {\n return {\n ...response,\n done: false,\n next: async () => {\n const finalResponse = await sendFinalRequest(\n lro,\n resourceLocation,\n lroResourceLocationConfig\n );\n return {\n ...(finalResponse ?? response),\n done: true,\n };\n },\n };\n }\n }\n return {\n ...response,\n done: false,\n };\n };\n}\n"]}
|
9
node_modules/@azure/core-lro/dist-esm/src/lroEngine/logger.js
generated
vendored
Normal file
9
node_modules/@azure/core-lro/dist-esm/src/lroEngine/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
node_modules/@azure/core-lro/dist-esm/src/lroEngine/logger.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/logger.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/lroEngine/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"]}
|
34
node_modules/@azure/core-lro/dist-esm/src/lroEngine/lroEngine.js
generated
vendored
Normal file
34
node_modules/@azure/core-lro/dist-esm/src/lroEngine/lroEngine.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { GenericPollOperation } from "./operation";
|
||||
import { Poller } from "../poller";
|
||||
function deserializeState(serializedState) {
|
||||
try {
|
||||
return JSON.parse(serializedState).state;
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`LroEngine: Unable to deserialize state: ${serializedState}`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The LRO Engine, a class that performs polling.
|
||||
*/
|
||||
export class LroEngine extends Poller {
|
||||
constructor(lro, options) {
|
||||
const { intervalInMs = 2000, resumeFrom } = options || {};
|
||||
const state = resumeFrom
|
||||
? deserializeState(resumeFrom)
|
||||
: {};
|
||||
const operation = new GenericPollOperation(state, lro, options === null || options === void 0 ? void 0 : options.lroResourceLocationConfig, options === null || options === void 0 ? void 0 : options.processResult, options === null || options === void 0 ? void 0 : options.updateState, options === null || options === void 0 ? void 0 : options.isDone);
|
||||
super(operation);
|
||||
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
node_modules/@azure/core-lro/dist-esm/src/lroEngine/lroEngine.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/lroEngine.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"lroEngine.js","sourceRoot":"","sources":["../../../src/lroEngine/lroEngine.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,SAAS,gBAAgB,CACvB,eAAuB;IAEvB,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC;KAC1C;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,2CAA2C,eAAe,EAAE,CAAC,CAAC;KAC/E;AACH,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,SAA+D,SAAQ,MAGnF;IAGC,YAAY,GAAkC,EAAE,OAA2C;QACzF,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAC1D,MAAM,KAAK,GAAkD,UAAU;YACrE,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC;YAC9B,CAAC,CAAE,EAAoD,CAAC;QAE1D,MAAM,SAAS,GAAG,IAAI,oBAAoB,CACxC,KAAK,EACL,GAAG,EACH,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,yBAAyB,EAClC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,EACtB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EACpB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAChB,CAAC;QACF,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,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 {\n LongRunningOperation,\n LroEngineOptions,\n PollerConfig,\n ResumablePollOperationState,\n} from \"./models\";\nimport { GenericPollOperation } from \"./operation\";\nimport { PollOperationState } from \"../pollOperation\";\nimport { Poller } from \"../poller\";\n\nfunction deserializeState<TResult, TState>(\n serializedState: string\n): TState & ResumablePollOperationState<TResult> {\n try {\n return JSON.parse(serializedState).state;\n } catch (e) {\n throw new Error(`LroEngine: Unable to deserialize state: ${serializedState}`);\n }\n}\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 { intervalInMs = 2000, resumeFrom } = options || {};\n const state: TState & ResumablePollOperationState<TResult> = resumeFrom\n ? deserializeState(resumeFrom)\n : ({} as TState & ResumablePollOperationState<TResult>);\n\n const operation = new GenericPollOperation(\n state,\n lro,\n options?.lroResourceLocationConfig,\n options?.processResult,\n options?.updateState,\n options?.isDone\n );\n super(operation);\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"]}
|
9
node_modules/@azure/core-lro/dist-esm/src/lroEngine/models.js
generated
vendored
Normal file
9
node_modules/@azure/core-lro/dist-esm/src/lroEngine/models.js
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export const successStates = ["succeeded"];
|
||||
export const failureStates = ["failed", "canceled", "cancelled"];
|
||||
/**
|
||||
* The LRO states that signal that the LRO has completed.
|
||||
*/
|
||||
export const terminalStates = successStates.concat(failureStates);
|
||||
//# sourceMappingURL=models.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/models.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/models.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
93
node_modules/@azure/core-lro/dist-esm/src/lroEngine/operation.js
generated
vendored
Normal file
93
node_modules/@azure/core-lro/dist-esm/src/lroEngine/operation.js
generated
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { createGetLroStatusFromResponse, createInitializeState, createPoll } from "./stateMachine";
|
||||
import { getPollingUrl } from "./requestUtils";
|
||||
import { logger } from "./logger";
|
||||
export class GenericPollOperation {
|
||||
constructor(state, lro, lroResourceLocationConfig, processResult, updateState, isDone) {
|
||||
this.state = state;
|
||||
this.lro = lro;
|
||||
this.lroResourceLocationConfig = lroResourceLocationConfig;
|
||||
this.processResult = processResult;
|
||||
this.updateState = updateState;
|
||||
this.isDone = isDone;
|
||||
}
|
||||
setPollerConfig(pollerConfig) {
|
||||
this.pollerConfig = pollerConfig;
|
||||
}
|
||||
/**
|
||||
* General update function for LROPoller, the general process is as follows
|
||||
* 1. Check initial operation result to determine the strategy to use
|
||||
* - Strategies: Location, Azure-AsyncOperation, Original Uri
|
||||
* 2. Check if the operation result has a terminal state
|
||||
* - Terminal state will be determined by each strategy
|
||||
* 2.1 If it is terminal state Check if a final GET request is required, if so
|
||||
* send final GET request and return result from operation. If no final GET
|
||||
* is required, just return the result from operation.
|
||||
* - Determining what to call for final request is responsibility of each strategy
|
||||
* 2.2 If it is not terminal state, call the polling operation and go to step 1
|
||||
* - Determining what to call for polling is responsibility of each strategy
|
||||
* - Strategies will always use the latest URI for polling if provided otherwise
|
||||
* the last known one
|
||||
*/
|
||||
async update(options) {
|
||||
var _a, _b, _c;
|
||||
const state = this.state;
|
||||
let lastResponse = undefined;
|
||||
if (!state.isStarted) {
|
||||
const initializeState = createInitializeState(state, this.lro.requestPath, this.lro.requestMethod);
|
||||
lastResponse = await this.lro.sendInitialRequest();
|
||||
initializeState(lastResponse);
|
||||
}
|
||||
if (!state.isCompleted) {
|
||||
if (!this.poll || !this.getLroStatusFromResponse) {
|
||||
if (!state.config) {
|
||||
throw new Error("Bad state: LRO mode is undefined. Please check if the serialized state is well-formed.");
|
||||
}
|
||||
const isDone = this.isDone;
|
||||
this.getLroStatusFromResponse = isDone
|
||||
? (response) => (Object.assign(Object.assign({}, response), { done: isDone(response.flatResponse, this.state) }))
|
||||
: createGetLroStatusFromResponse(this.lro, state.config, this.lroResourceLocationConfig);
|
||||
this.poll = createPoll(this.lro);
|
||||
}
|
||||
if (!state.pollingURL) {
|
||||
throw new Error("Bad state: polling URL is undefined. Please check if the serialized state is well-formed.");
|
||||
}
|
||||
const currentState = await this.poll(state.pollingURL, this.pollerConfig, this.getLroStatusFromResponse);
|
||||
logger.verbose(`LRO: polling response: ${JSON.stringify(currentState.rawResponse)}`);
|
||||
if (currentState.done) {
|
||||
state.result = this.processResult
|
||||
? this.processResult(currentState.flatResponse, state)
|
||||
: currentState.flatResponse;
|
||||
state.isCompleted = true;
|
||||
}
|
||||
else {
|
||||
this.poll = (_a = currentState.next) !== null && _a !== void 0 ? _a : this.poll;
|
||||
state.pollingURL = getPollingUrl(currentState.rawResponse, state.pollingURL);
|
||||
}
|
||||
lastResponse = currentState;
|
||||
}
|
||||
logger.verbose(`LRO: current state: ${JSON.stringify(state)}`);
|
||||
if (lastResponse) {
|
||||
(_b = this.updateState) === null || _b === void 0 ? void 0 : _b.call(this, state, lastResponse === null || lastResponse === void 0 ? void 0 : lastResponse.rawResponse);
|
||||
}
|
||||
else {
|
||||
logger.error(`LRO: no response was received`);
|
||||
}
|
||||
(_c = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _c === void 0 ? void 0 : _c.call(options, state);
|
||||
return this;
|
||||
}
|
||||
async cancel() {
|
||||
this.state.isCancelled = true;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Serializes the Poller operation.
|
||||
*/
|
||||
toString() {
|
||||
return JSON.stringify({
|
||||
state: this.state,
|
||||
});
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=operation.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/operation.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/operation.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/@azure/core-lro/dist-esm/src/lroEngine/passthrough.js
generated
vendored
Normal file
6
node_modules/@azure/core-lro/dist-esm/src/lroEngine/passthrough.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
export function processPassthroughOperationResult(response) {
|
||||
return Object.assign(Object.assign({}, response), { done: true });
|
||||
}
|
||||
//# sourceMappingURL=passthrough.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/passthrough.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/passthrough.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"passthrough.js","sourceRoot":"","sources":["../../../src/lroEngine/passthrough.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,MAAM,UAAU,iCAAiC,CAC/C,QAA8B;IAE9B,uCACK,QAAQ,KACX,IAAI,EAAE,IAAI,IACV;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LroResponse, LroStatus } from \"./models\";\n\nexport function processPassthroughOperationResult<TResult>(\n response: LroResponse<TResult>\n): LroStatus<TResult> {\n return {\n ...response,\n done: true,\n };\n}\n"]}
|
78
node_modules/@azure/core-lro/dist-esm/src/lroEngine/requestUtils.js
generated
vendored
Normal file
78
node_modules/@azure/core-lro/dist-esm/src/lroEngine/requestUtils.js
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* Detects where the continuation token is and returns it. Notice that azure-asyncoperation
|
||||
* must be checked first before the other location headers because there are scenarios
|
||||
* where both azure-asyncoperation and location could be present in the same response but
|
||||
* azure-asyncoperation should be the one to use for polling.
|
||||
*/
|
||||
export function getPollingUrl(rawResponse, defaultPath) {
|
||||
var _a, _b, _c;
|
||||
return ((_c = (_b = (_a = getAzureAsyncOperation(rawResponse)) !== null && _a !== void 0 ? _a : getOperationLocation(rawResponse)) !== null && _b !== void 0 ? _b : getLocation(rawResponse)) !== null && _c !== void 0 ? _c : defaultPath);
|
||||
}
|
||||
function getLocation(rawResponse) {
|
||||
return rawResponse.headers["location"];
|
||||
}
|
||||
function getOperationLocation(rawResponse) {
|
||||
return rawResponse.headers["operation-location"];
|
||||
}
|
||||
function getAzureAsyncOperation(rawResponse) {
|
||||
return rawResponse.headers["azure-asyncoperation"];
|
||||
}
|
||||
function findResourceLocation(requestMethod, rawResponse, requestPath) {
|
||||
switch (requestMethod) {
|
||||
case "PUT": {
|
||||
return requestPath;
|
||||
}
|
||||
case "POST":
|
||||
case "PATCH": {
|
||||
return getLocation(rawResponse);
|
||||
}
|
||||
default: {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
export function inferLroMode(requestPath, requestMethod, rawResponse) {
|
||||
if (getAzureAsyncOperation(rawResponse) !== undefined ||
|
||||
getOperationLocation(rawResponse) !== undefined) {
|
||||
return {
|
||||
mode: "Location",
|
||||
resourceLocation: findResourceLocation(requestMethod, rawResponse, requestPath),
|
||||
};
|
||||
}
|
||||
else if (getLocation(rawResponse) !== undefined) {
|
||||
return {
|
||||
mode: "Location",
|
||||
};
|
||||
}
|
||||
else if (["PUT", "PATCH"].includes(requestMethod)) {
|
||||
return {
|
||||
mode: "Body",
|
||||
};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
class SimpleRestError extends Error {
|
||||
constructor(message, statusCode) {
|
||||
super(message);
|
||||
this.name = "RestError";
|
||||
this.statusCode = statusCode;
|
||||
Object.setPrototypeOf(this, SimpleRestError.prototype);
|
||||
}
|
||||
}
|
||||
export function isUnexpectedInitialResponse(rawResponse) {
|
||||
const code = rawResponse.statusCode;
|
||||
if (![203, 204, 202, 201, 200, 500].includes(code)) {
|
||||
throw new SimpleRestError(`Received unexpected HTTP status code ${code} in the initial response. This may indicate a server issue.`, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export function isUnexpectedPollingResponse(rawResponse) {
|
||||
const code = rawResponse.statusCode;
|
||||
if (![202, 201, 200, 500].includes(code)) {
|
||||
throw new SimpleRestError(`Received unexpected HTTP status code ${code} while polling. This may indicate a server issue.`, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//# sourceMappingURL=requestUtils.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/requestUtils.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/requestUtils.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
74
node_modules/@azure/core-lro/dist-esm/src/lroEngine/stateMachine.js
generated
vendored
Normal file
74
node_modules/@azure/core-lro/dist-esm/src/lroEngine/stateMachine.js
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
import { getPollingUrl, inferLroMode, isUnexpectedInitialResponse } from "./requestUtils";
|
||||
import { isBodyPollingDone, processBodyPollingOperationResult } from "./bodyPolling";
|
||||
import { logger } from "./logger";
|
||||
import { processLocationPollingOperationResult } from "./locationPolling";
|
||||
import { processPassthroughOperationResult } from "./passthrough";
|
||||
/**
|
||||
* creates a stepping function that maps an LRO state to another.
|
||||
*/
|
||||
export function createGetLroStatusFromResponse(lroPrimitives, config, lroResourceLocationConfig) {
|
||||
switch (config.mode) {
|
||||
case "Location": {
|
||||
return processLocationPollingOperationResult(lroPrimitives, config.resourceLocation, lroResourceLocationConfig);
|
||||
}
|
||||
case "Body": {
|
||||
return processBodyPollingOperationResult;
|
||||
}
|
||||
default: {
|
||||
return processPassthroughOperationResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates a polling operation.
|
||||
*/
|
||||
export function createPoll(lroPrimitives) {
|
||||
return async (path, pollerConfig, getLroStatusFromResponse) => {
|
||||
const response = await lroPrimitives.sendPollRequest(path);
|
||||
const retryAfter = response.rawResponse.headers["retry-after"];
|
||||
if (retryAfter !== undefined) {
|
||||
// Retry-After header value is either in HTTP date format, or in seconds
|
||||
const retryAfterInSeconds = parseInt(retryAfter);
|
||||
pollerConfig.intervalInMs = isNaN(retryAfterInSeconds)
|
||||
? calculatePollingIntervalFromDate(new Date(retryAfter), pollerConfig.intervalInMs)
|
||||
: retryAfterInSeconds * 1000;
|
||||
}
|
||||
return getLroStatusFromResponse(response);
|
||||
};
|
||||
}
|
||||
function calculatePollingIntervalFromDate(retryAfterDate, defaultIntervalInMs) {
|
||||
const timeNow = Math.floor(new Date().getTime());
|
||||
const retryAfterTime = retryAfterDate.getTime();
|
||||
if (timeNow < retryAfterTime) {
|
||||
return retryAfterTime - timeNow;
|
||||
}
|
||||
return defaultIntervalInMs;
|
||||
}
|
||||
/**
|
||||
* Creates a callback to be used to initialize the polling operation state.
|
||||
* @param state - of the polling operation
|
||||
* @param operationSpec - of the LRO
|
||||
* @param callback - callback to be called when the operation is done
|
||||
* @returns callback that initializes the state of the polling operation
|
||||
*/
|
||||
export function createInitializeState(state, requestPath, requestMethod) {
|
||||
return (response) => {
|
||||
if (isUnexpectedInitialResponse(response.rawResponse))
|
||||
return true;
|
||||
state.initialRawResponse = response.rawResponse;
|
||||
state.isStarted = true;
|
||||
state.pollingURL = getPollingUrl(state.initialRawResponse, requestPath);
|
||||
state.config = inferLroMode(requestPath, requestMethod, state.initialRawResponse);
|
||||
/** short circuit polling if body polling is done in the initial request */
|
||||
if (state.config.mode === undefined ||
|
||||
(state.config.mode === "Body" && isBodyPollingDone(state.initialRawResponse))) {
|
||||
state.result = response.flatResponse;
|
||||
state.isCompleted = true;
|
||||
}
|
||||
logger.verbose(`LRO: initial state: ${JSON.stringify(state)}`);
|
||||
return Boolean(state.isCompleted);
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=stateMachine.js.map
|
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/stateMachine.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/lroEngine/stateMachine.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
node_modules/@azure/core-lro/dist-esm/src/pollOperation.js
generated
vendored
Normal file
4
node_modules/@azure/core-lro/dist-esm/src/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
node_modules/@azure/core-lro/dist-esm/src/pollOperation.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/pollOperation.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"pollOperation.js","sourceRoot":"","sources":["../../src/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 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"]}
|
390
node_modules/@azure/core-lro/dist-esm/src/poller.js
generated
vendored
Normal file
390
node_modules/@azure/core-lro/dist-esm/src/poller.js
generated
vendored
Normal file
|
@ -0,0 +1,390 @@
|
|||
// 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 a poller is cancelled through the `cancelOperation` method,
|
||||
* 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) {
|
||||
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() {
|
||||
if (this.stopped) {
|
||||
this.stopped = false;
|
||||
}
|
||||
while (!this.isStopped() && !this.isDone()) {
|
||||
await this.poll();
|
||||
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 = {}) {
|
||||
try {
|
||||
if (!this.isDone()) {
|
||||
this.operation = await this.operation.update({
|
||||
abortSignal: options.abortSignal,
|
||||
fireProgress: this.fireProgress.bind(this),
|
||||
});
|
||||
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.operation.state.result);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
this.operation.state.error = e;
|
||||
if (this.reject) {
|
||||
this.reject(e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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, and rejects the
|
||||
* pollUntilDone promise.
|
||||
*/
|
||||
async cancelOnce(options = {}) {
|
||||
this.operation = await this.operation.cancel(options);
|
||||
if (this.reject) {
|
||||
this.reject(new PollerCancelledError("Poller cancelled"));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
async pollUntilDone() {
|
||||
if (this.stopped) {
|
||||
this.startPolling().catch(this.reject);
|
||||
}
|
||||
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.stopped) {
|
||||
this.stopped = true;
|
||||
}
|
||||
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
node_modules/@azure/core-lro/dist-esm/src/poller.js.map
generated
vendored
Normal file
1
node_modules/@azure/core-lro/dist-esm/src/poller.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
751
node_modules/@azure/core-lro/dist/index.js
generated
vendored
Normal file
751
node_modules/@azure/core-lro/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,751 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var logger$1 = require('@azure/logger');
|
||||
|
||||
// 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.
|
||||
*/
|
||||
class PollerStoppedError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "PollerStoppedError";
|
||||
Object.setPrototypeOf(this, PollerStoppedError.prototype);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* When a poller is cancelled through the `cancelOperation` method,
|
||||
* the poller will be rejected with an instance of the PollerCancelledError.
|
||||
*/
|
||||
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
|
||||
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) {
|
||||
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() {
|
||||
if (this.stopped) {
|
||||
this.stopped = false;
|
||||
}
|
||||
while (!this.isStopped() && !this.isDone()) {
|
||||
await this.poll();
|
||||
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 = {}) {
|
||||
try {
|
||||
if (!this.isDone()) {
|
||||
this.operation = await this.operation.update({
|
||||
abortSignal: options.abortSignal,
|
||||
fireProgress: this.fireProgress.bind(this),
|
||||
});
|
||||
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.operation.state.result);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
this.operation.state.error = e;
|
||||
if (this.reject) {
|
||||
this.reject(e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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, and rejects the
|
||||
* pollUntilDone promise.
|
||||
*/
|
||||
async cancelOnce(options = {}) {
|
||||
this.operation = await this.operation.cancel(options);
|
||||
if (this.reject) {
|
||||
this.reject(new PollerCancelledError("Poller cancelled"));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
async pollUntilDone() {
|
||||
if (this.stopped) {
|
||||
this.startPolling().catch(this.reject);
|
||||
}
|
||||
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.stopped) {
|
||||
this.stopped = true;
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* Detects where the continuation token is and returns it. Notice that azure-asyncoperation
|
||||
* must be checked first before the other location headers because there are scenarios
|
||||
* where both azure-asyncoperation and location could be present in the same response but
|
||||
* azure-asyncoperation should be the one to use for polling.
|
||||
*/
|
||||
function getPollingUrl(rawResponse, defaultPath) {
|
||||
var _a, _b, _c;
|
||||
return ((_c = (_b = (_a = getAzureAsyncOperation(rawResponse)) !== null && _a !== void 0 ? _a : getOperationLocation(rawResponse)) !== null && _b !== void 0 ? _b : getLocation(rawResponse)) !== null && _c !== void 0 ? _c : defaultPath);
|
||||
}
|
||||
function getLocation(rawResponse) {
|
||||
return rawResponse.headers["location"];
|
||||
}
|
||||
function getOperationLocation(rawResponse) {
|
||||
return rawResponse.headers["operation-location"];
|
||||
}
|
||||
function getAzureAsyncOperation(rawResponse) {
|
||||
return rawResponse.headers["azure-asyncoperation"];
|
||||
}
|
||||
function findResourceLocation(requestMethod, rawResponse, requestPath) {
|
||||
switch (requestMethod) {
|
||||
case "PUT": {
|
||||
return requestPath;
|
||||
}
|
||||
case "POST":
|
||||
case "PATCH": {
|
||||
return getLocation(rawResponse);
|
||||
}
|
||||
default: {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
function inferLroMode(requestPath, requestMethod, rawResponse) {
|
||||
if (getAzureAsyncOperation(rawResponse) !== undefined ||
|
||||
getOperationLocation(rawResponse) !== undefined) {
|
||||
return {
|
||||
mode: "Location",
|
||||
resourceLocation: findResourceLocation(requestMethod, rawResponse, requestPath),
|
||||
};
|
||||
}
|
||||
else if (getLocation(rawResponse) !== undefined) {
|
||||
return {
|
||||
mode: "Location",
|
||||
};
|
||||
}
|
||||
else if (["PUT", "PATCH"].includes(requestMethod)) {
|
||||
return {
|
||||
mode: "Body",
|
||||
};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
class SimpleRestError extends Error {
|
||||
constructor(message, statusCode) {
|
||||
super(message);
|
||||
this.name = "RestError";
|
||||
this.statusCode = statusCode;
|
||||
Object.setPrototypeOf(this, SimpleRestError.prototype);
|
||||
}
|
||||
}
|
||||
function isUnexpectedInitialResponse(rawResponse) {
|
||||
const code = rawResponse.statusCode;
|
||||
if (![203, 204, 202, 201, 200, 500].includes(code)) {
|
||||
throw new SimpleRestError(`Received unexpected HTTP status code ${code} in the initial response. This may indicate a server issue.`, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isUnexpectedPollingResponse(rawResponse) {
|
||||
const code = rawResponse.statusCode;
|
||||
if (![202, 201, 200, 500].includes(code)) {
|
||||
throw new SimpleRestError(`Received unexpected HTTP status code ${code} while polling. This may indicate a server issue.`, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
const successStates = ["succeeded"];
|
||||
const failureStates = ["failed", "canceled", "cancelled"];
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
function getProvisioningState(rawResponse) {
|
||||
var _a, _b;
|
||||
const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
|
||||
const state = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState;
|
||||
return typeof state === "string" ? state.toLowerCase() : "succeeded";
|
||||
}
|
||||
function isBodyPollingDone(rawResponse) {
|
||||
const state = getProvisioningState(rawResponse);
|
||||
if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {
|
||||
throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);
|
||||
}
|
||||
return successStates.includes(state);
|
||||
}
|
||||
/**
|
||||
* Creates a polling strategy based on BodyPolling which uses the provisioning state
|
||||
* from the result to determine the current operation state
|
||||
*/
|
||||
function processBodyPollingOperationResult(response) {
|
||||
return Object.assign(Object.assign({}, response), { done: isBodyPollingDone(response.rawResponse) });
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
/**
|
||||
* The `@azure/logger` configuration for this package.
|
||||
* @internal
|
||||
*/
|
||||
const logger = logger$1.createClientLogger("core-lro");
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
function isPollingDone(rawResponse) {
|
||||
var _a;
|
||||
if (isUnexpectedPollingResponse(rawResponse) || rawResponse.statusCode === 202) {
|
||||
return false;
|
||||
}
|
||||
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
|
||||
const state = typeof status === "string" ? status.toLowerCase() : "succeeded";
|
||||
if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {
|
||||
throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);
|
||||
}
|
||||
return successStates.includes(state);
|
||||
}
|
||||
/**
|
||||
* Sends a request to the URI of the provisioned resource if needed.
|
||||
*/
|
||||
async function sendFinalRequest(lro, resourceLocation, lroResourceLocationConfig) {
|
||||
switch (lroResourceLocationConfig) {
|
||||
case "original-uri":
|
||||
return lro.sendPollRequest(lro.requestPath);
|
||||
case "azure-async-operation":
|
||||
return undefined;
|
||||
case "location":
|
||||
default:
|
||||
return lro.sendPollRequest(resourceLocation !== null && resourceLocation !== void 0 ? resourceLocation : lro.requestPath);
|
||||
}
|
||||
}
|
||||
function processLocationPollingOperationResult(lro, resourceLocation, lroResourceLocationConfig) {
|
||||
return (response) => {
|
||||
if (isPollingDone(response.rawResponse)) {
|
||||
if (resourceLocation === undefined) {
|
||||
return Object.assign(Object.assign({}, response), { done: true });
|
||||
}
|
||||
else {
|
||||
return Object.assign(Object.assign({}, response), { done: false, next: async () => {
|
||||
const finalResponse = await sendFinalRequest(lro, resourceLocation, lroResourceLocationConfig);
|
||||
return Object.assign(Object.assign({}, (finalResponse !== null && finalResponse !== void 0 ? finalResponse : response)), { done: true });
|
||||
} });
|
||||
}
|
||||
}
|
||||
return Object.assign(Object.assign({}, response), { done: false });
|
||||
};
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
function processPassthroughOperationResult(response) {
|
||||
return Object.assign(Object.assign({}, response), { done: true });
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
/**
|
||||
* creates a stepping function that maps an LRO state to another.
|
||||
*/
|
||||
function createGetLroStatusFromResponse(lroPrimitives, config, lroResourceLocationConfig) {
|
||||
switch (config.mode) {
|
||||
case "Location": {
|
||||
return processLocationPollingOperationResult(lroPrimitives, config.resourceLocation, lroResourceLocationConfig);
|
||||
}
|
||||
case "Body": {
|
||||
return processBodyPollingOperationResult;
|
||||
}
|
||||
default: {
|
||||
return processPassthroughOperationResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates a polling operation.
|
||||
*/
|
||||
function createPoll(lroPrimitives) {
|
||||
return async (path, pollerConfig, getLroStatusFromResponse) => {
|
||||
const response = await lroPrimitives.sendPollRequest(path);
|
||||
const retryAfter = response.rawResponse.headers["retry-after"];
|
||||
if (retryAfter !== undefined) {
|
||||
// Retry-After header value is either in HTTP date format, or in seconds
|
||||
const retryAfterInSeconds = parseInt(retryAfter);
|
||||
pollerConfig.intervalInMs = isNaN(retryAfterInSeconds)
|
||||
? calculatePollingIntervalFromDate(new Date(retryAfter), pollerConfig.intervalInMs)
|
||||
: retryAfterInSeconds * 1000;
|
||||
}
|
||||
return getLroStatusFromResponse(response);
|
||||
};
|
||||
}
|
||||
function calculatePollingIntervalFromDate(retryAfterDate, defaultIntervalInMs) {
|
||||
const timeNow = Math.floor(new Date().getTime());
|
||||
const retryAfterTime = retryAfterDate.getTime();
|
||||
if (timeNow < retryAfterTime) {
|
||||
return retryAfterTime - timeNow;
|
||||
}
|
||||
return defaultIntervalInMs;
|
||||
}
|
||||
/**
|
||||
* Creates a callback to be used to initialize the polling operation state.
|
||||
* @param state - of the polling operation
|
||||
* @param operationSpec - of the LRO
|
||||
* @param callback - callback to be called when the operation is done
|
||||
* @returns callback that initializes the state of the polling operation
|
||||
*/
|
||||
function createInitializeState(state, requestPath, requestMethod) {
|
||||
return (response) => {
|
||||
if (isUnexpectedInitialResponse(response.rawResponse))
|
||||
;
|
||||
state.initialRawResponse = response.rawResponse;
|
||||
state.isStarted = true;
|
||||
state.pollingURL = getPollingUrl(state.initialRawResponse, requestPath);
|
||||
state.config = inferLroMode(requestPath, requestMethod, state.initialRawResponse);
|
||||
/** short circuit polling if body polling is done in the initial request */
|
||||
if (state.config.mode === undefined ||
|
||||
(state.config.mode === "Body" && isBodyPollingDone(state.initialRawResponse))) {
|
||||
state.result = response.flatResponse;
|
||||
state.isCompleted = true;
|
||||
}
|
||||
logger.verbose(`LRO: initial state: ${JSON.stringify(state)}`);
|
||||
return Boolean(state.isCompleted);
|
||||
};
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
class GenericPollOperation {
|
||||
constructor(state, lro, lroResourceLocationConfig, processResult, updateState, isDone) {
|
||||
this.state = state;
|
||||
this.lro = lro;
|
||||
this.lroResourceLocationConfig = lroResourceLocationConfig;
|
||||
this.processResult = processResult;
|
||||
this.updateState = updateState;
|
||||
this.isDone = isDone;
|
||||
}
|
||||
setPollerConfig(pollerConfig) {
|
||||
this.pollerConfig = pollerConfig;
|
||||
}
|
||||
/**
|
||||
* General update function for LROPoller, the general process is as follows
|
||||
* 1. Check initial operation result to determine the strategy to use
|
||||
* - Strategies: Location, Azure-AsyncOperation, Original Uri
|
||||
* 2. Check if the operation result has a terminal state
|
||||
* - Terminal state will be determined by each strategy
|
||||
* 2.1 If it is terminal state Check if a final GET request is required, if so
|
||||
* send final GET request and return result from operation. If no final GET
|
||||
* is required, just return the result from operation.
|
||||
* - Determining what to call for final request is responsibility of each strategy
|
||||
* 2.2 If it is not terminal state, call the polling operation and go to step 1
|
||||
* - Determining what to call for polling is responsibility of each strategy
|
||||
* - Strategies will always use the latest URI for polling if provided otherwise
|
||||
* the last known one
|
||||
*/
|
||||
async update(options) {
|
||||
var _a, _b, _c;
|
||||
const state = this.state;
|
||||
let lastResponse = undefined;
|
||||
if (!state.isStarted) {
|
||||
const initializeState = createInitializeState(state, this.lro.requestPath, this.lro.requestMethod);
|
||||
lastResponse = await this.lro.sendInitialRequest();
|
||||
initializeState(lastResponse);
|
||||
}
|
||||
if (!state.isCompleted) {
|
||||
if (!this.poll || !this.getLroStatusFromResponse) {
|
||||
if (!state.config) {
|
||||
throw new Error("Bad state: LRO mode is undefined. Please check if the serialized state is well-formed.");
|
||||
}
|
||||
const isDone = this.isDone;
|
||||
this.getLroStatusFromResponse = isDone
|
||||
? (response) => (Object.assign(Object.assign({}, response), { done: isDone(response.flatResponse, this.state) }))
|
||||
: createGetLroStatusFromResponse(this.lro, state.config, this.lroResourceLocationConfig);
|
||||
this.poll = createPoll(this.lro);
|
||||
}
|
||||
if (!state.pollingURL) {
|
||||
throw new Error("Bad state: polling URL is undefined. Please check if the serialized state is well-formed.");
|
||||
}
|
||||
const currentState = await this.poll(state.pollingURL, this.pollerConfig, this.getLroStatusFromResponse);
|
||||
logger.verbose(`LRO: polling response: ${JSON.stringify(currentState.rawResponse)}`);
|
||||
if (currentState.done) {
|
||||
state.result = this.processResult
|
||||
? this.processResult(currentState.flatResponse, state)
|
||||
: currentState.flatResponse;
|
||||
state.isCompleted = true;
|
||||
}
|
||||
else {
|
||||
this.poll = (_a = currentState.next) !== null && _a !== void 0 ? _a : this.poll;
|
||||
state.pollingURL = getPollingUrl(currentState.rawResponse, state.pollingURL);
|
||||
}
|
||||
lastResponse = currentState;
|
||||
}
|
||||
logger.verbose(`LRO: current state: ${JSON.stringify(state)}`);
|
||||
if (lastResponse) {
|
||||
(_b = this.updateState) === null || _b === void 0 ? void 0 : _b.call(this, state, lastResponse === null || lastResponse === void 0 ? void 0 : lastResponse.rawResponse);
|
||||
}
|
||||
else {
|
||||
logger.error(`LRO: no response was received`);
|
||||
}
|
||||
(_c = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _c === void 0 ? void 0 : _c.call(options, state);
|
||||
return this;
|
||||
}
|
||||
async cancel() {
|
||||
this.state.isCancelled = true;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Serializes the Poller operation.
|
||||
*/
|
||||
toString() {
|
||||
return JSON.stringify({
|
||||
state: this.state,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
function deserializeState(serializedState) {
|
||||
try {
|
||||
return JSON.parse(serializedState).state;
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`LroEngine: Unable to deserialize state: ${serializedState}`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The LRO Engine, a class that performs polling.
|
||||
*/
|
||||
class LroEngine extends Poller {
|
||||
constructor(lro, options) {
|
||||
const { intervalInMs = 2000, resumeFrom } = options || {};
|
||||
const state = resumeFrom
|
||||
? deserializeState(resumeFrom)
|
||||
: {};
|
||||
const operation = new GenericPollOperation(state, lro, options === null || options === void 0 ? void 0 : options.lroResourceLocationConfig, options === null || options === void 0 ? void 0 : options.processResult, options === null || options === void 0 ? void 0 : options.updateState, options === null || options === void 0 ? void 0 : options.isDone);
|
||||
super(operation);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
exports.LroEngine = LroEngine;
|
||||
exports.Poller = Poller;
|
||||
exports.PollerCancelledError = PollerCancelledError;
|
||||
exports.PollerStoppedError = PollerStoppedError;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@azure/core-lro/dist/index.js.map
generated
vendored
Normal file
1
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
node_modules/@azure/core-lro/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
15
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
node_modules/@azure/core-lro/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
12
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
node_modules/@azure/core-lro/node_modules/tslib/README.md
generated
vendored
Normal file
164
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](http://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/)
|
55
node_modules/@azure/core-lro/node_modules/tslib/modules/index.js
generated
vendored
Normal file
55
node_modules/@azure/core-lro/node_modules/tslib/modules/index.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
import tslib from '../tslib.js';
|
||||
const {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
} = tslib;
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
};
|
3
node_modules/@azure/core-lro/node_modules/tslib/modules/package.json
generated
vendored
Normal file
3
node_modules/@azure/core-lro/node_modules/tslib/modules/package.json
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
38
node_modules/@azure/core-lro/node_modules/tslib/package.json
generated
vendored
Normal file
38
node_modules/@azure/core-lro/node_modules/tslib/package.json
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "tslib",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "https://www.typescriptlang.org/",
|
||||
"version": "2.4.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": "./tslib.es6.js",
|
||||
"import": "./modules/index.js",
|
||||
"default": "./tslib.js"
|
||||
},
|
||||
"./*": "./*",
|
||||
"./": "./"
|
||||
}
|
||||
}
|
398
node_modules/@azure/core-lro/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
398
node_modules/@azure/core-lro/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,398 @@
|
|||
/******************************************************************************
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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;
|
1
node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
1
node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<script src="tslib.es6.js"></script>
|
248
node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
248
node_modules/@azure/core-lro/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
|
@ -0,0 +1,248 @@
|
|||
/******************************************************************************
|
||||
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 */
|
||||
|
||||
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 __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 (_) 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: n === "return" } : 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);
|
||||
}
|
1
node_modules/@azure/core-lro/node_modules/tslib/tslib.html
generated
vendored
Normal file
1
node_modules/@azure/core-lro/node_modules/tslib/tslib.html
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<script src="tslib.js"></script>
|
317
node_modules/@azure/core-lro/node_modules/tslib/tslib.js
generated
vendored
Normal file
317
node_modules/@azure/core-lro/node_modules/tslib/tslib.js
generated
vendored
Normal file
|
@ -0,0 +1,317 @@
|
|||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global global, define, System, Reflect, Promise */
|
||||
var __extends;
|
||||
var __assign;
|
||||
var __rest;
|
||||
var __decorate;
|
||||
var __param;
|
||||
var __metadata;
|
||||
var __awaiter;
|
||||
var __generator;
|
||||
var __exportStar;
|
||||
var __values;
|
||||
var __read;
|
||||
var __spread;
|
||||
var __spreadArrays;
|
||||
var __spreadArray;
|
||||
var __await;
|
||||
var __asyncGenerator;
|
||||
var __asyncDelegator;
|
||||
var __asyncValues;
|
||||
var __makeTemplateObject;
|
||||
var __importStar;
|
||||
var __importDefault;
|
||||
var __classPrivateFieldGet;
|
||||
var __classPrivateFieldSet;
|
||||
var __classPrivateFieldIn;
|
||||
var __createBinding;
|
||||
(function (factory) {
|
||||
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
|
||||
}
|
||||
else if (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); }
|
||||
};
|
||||
|
||||
__metadata = function (metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
};
|
||||
|
||||
__awaiter = function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
|
||||
__generator = function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
|
||||
__exportStar = function(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
};
|
||||
|
||||
__createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
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: n === "return" } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
|
||||
__asyncValues = function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
|
||||
__makeTemplateObject = function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
__importStar = function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
|
||||
__importDefault = function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
|
||||
__classPrivateFieldGet = function (receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
};
|
||||
|
||||
__classPrivateFieldSet = function (receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
|
||||
__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);
|
||||
};
|
||||
|
||||
exporter("__extends", __extends);
|
||||
exporter("__assign", __assign);
|
||||
exporter("__rest", __rest);
|
||||
exporter("__decorate", __decorate);
|
||||
exporter("__param", __param);
|
||||
exporter("__metadata", __metadata);
|
||||
exporter("__awaiter", __awaiter);
|
||||
exporter("__generator", __generator);
|
||||
exporter("__exportStar", __exportStar);
|
||||
exporter("__createBinding", __createBinding);
|
||||
exporter("__values", __values);
|
||||
exporter("__read", __read);
|
||||
exporter("__spread", __spread);
|
||||
exporter("__spreadArrays", __spreadArrays);
|
||||
exporter("__spreadArray", __spreadArray);
|
||||
exporter("__await", __await);
|
||||
exporter("__asyncGenerator", __asyncGenerator);
|
||||
exporter("__asyncDelegator", __asyncDelegator);
|
||||
exporter("__asyncValues", __asyncValues);
|
||||
exporter("__makeTemplateObject", __makeTemplateObject);
|
||||
exporter("__importStar", __importStar);
|
||||
exporter("__importDefault", __importDefault);
|
||||
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
||||
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
||||
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
||||
});
|
133
node_modules/@azure/core-lro/package.json
generated
vendored
Normal file
133
node_modules/@azure/core-lro/package.json
generated
vendored
Normal file
|
@ -0,0 +1,133 @@
|
|||
{
|
||||
"name": "@azure/core-lro",
|
||||
"author": "Microsoft Corporation",
|
||||
"sdk-type": "client",
|
||||
"version": "2.2.4",
|
||||
"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": ">=12.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-tracing": "1.0.0-preview.13",
|
||||
"@azure/logger": "^1.0.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@azure/core-http": "^2.0.0",
|
||||
"@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.18.11",
|
||||
"@types/chai": "^4.1.6",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^12.0.0",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"eslint": "^7.15.0",
|
||||
"karma": "^6.2.0",
|
||||
"karma-chrome-launcher": "^3.0.0",
|
||||
"karma-coverage": "^2.0.0",
|
||||
"karma-edge-launcher": "^0.4.2",
|
||||
"karma-env-preprocessor": "^0.1.1",
|
||||
"karma-firefox-launcher": "^1.1.0",
|
||||
"karma-ie-launcher": "^1.0.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",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^15.0.0",
|
||||
"prettier": "^2.5.1",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "~4.2.0",
|
||||
"uglify-js": "^3.4.9"
|
||||
}
|
||||
}
|
565
node_modules/@azure/core-lro/types/core-lro.d.ts
generated
vendored
Normal file
565
node_modules/@azure/core-lro/types/core-lro.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,565 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* Description of a long running operation.
|
||||
*/
|
||||
export declare interface LongRunningOperation<T> {
|
||||
/**
|
||||
* The request path.
|
||||
*/
|
||||
requestPath: string;
|
||||
/**
|
||||
* The HTTP request method.
|
||||
*/
|
||||
requestMethod: string;
|
||||
/**
|
||||
* A function that can be used to send initial request to the service.
|
||||
*/
|
||||
sendInitialRequest: () => Promise<LroResponse<T>>;
|
||||
/**
|
||||
* A function that can be used to poll for the current status of a long running operation.
|
||||
*/
|
||||
sendPollRequest: (path: string) => 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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> {
|
||||
/** The flattened response */
|
||||
flatResponse: T;
|
||||
/** The raw response */
|
||||
rawResponse: RawResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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> {
|
||||
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-http 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-http";
|
||||
*
|
||||
* 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, and rejects the
|
||||
* pollUntilDone promise.
|
||||
*/
|
||||
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>;
|
||||
/**
|
||||
* Returns a promise that will resolve once the underlying operation is completed.
|
||||
*/
|
||||
pollUntilDone(): 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 a poller is cancelled through the `cancelOperation` method,
|
||||
* 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(): 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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
export { }
|
Loading…
Add table
Add a link
Reference in a new issue