@azure/core-lro 3.0.0-beta.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/http/models.d.ts +2 -2
- package/dist/browser/http/models.d.ts.map +1 -1
- package/dist/browser/http/models.js.map +1 -1
- package/dist/browser/http/operation.d.ts +11 -12
- package/dist/browser/http/operation.d.ts.map +1 -1
- package/dist/browser/http/operation.js +22 -16
- package/dist/browser/http/operation.js.map +1 -1
- package/dist/browser/http/poller.d.ts +2 -2
- package/dist/browser/http/poller.d.ts.map +1 -1
- package/dist/browser/http/poller.js +1 -15
- package/dist/browser/http/poller.js.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/poller/models.d.ts +15 -39
- package/dist/browser/poller/models.d.ts.map +1 -1
- package/dist/browser/poller/models.js.map +1 -1
- package/dist/browser/poller/operation.d.ts +12 -14
- package/dist/browser/poller/operation.d.ts.map +1 -1
- package/dist/browser/poller/operation.js +25 -29
- package/dist/browser/poller/operation.js.map +1 -1
- package/dist/browser/poller/poller.d.ts +1 -1
- package/dist/browser/poller/poller.d.ts.map +1 -1
- package/dist/browser/poller/poller.js +9 -34
- package/dist/browser/poller/poller.js.map +1 -1
- package/dist/commonjs/http/models.d.ts +2 -2
- package/dist/commonjs/http/models.d.ts.map +1 -1
- package/dist/commonjs/http/models.js.map +1 -1
- package/dist/commonjs/http/operation.d.ts +11 -12
- package/dist/commonjs/http/operation.d.ts.map +1 -1
- package/dist/commonjs/http/operation.js +22 -16
- package/dist/commonjs/http/operation.js.map +1 -1
- package/dist/commonjs/http/poller.d.ts +2 -2
- package/dist/commonjs/http/poller.d.ts.map +1 -1
- package/dist/commonjs/http/poller.js +1 -15
- package/dist/commonjs/http/poller.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/poller/models.d.ts +15 -39
- package/dist/commonjs/poller/models.d.ts.map +1 -1
- package/dist/commonjs/poller/models.js.map +1 -1
- package/dist/commonjs/poller/operation.d.ts +12 -14
- package/dist/commonjs/poller/operation.d.ts.map +1 -1
- package/dist/commonjs/poller/operation.js +25 -29
- package/dist/commonjs/poller/operation.js.map +1 -1
- package/dist/commonjs/poller/poller.d.ts +1 -1
- package/dist/commonjs/poller/poller.d.ts.map +1 -1
- package/dist/commonjs/poller/poller.js +9 -34
- package/dist/commonjs/poller/poller.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/core-lro.d.ts +28 -32
- package/dist/esm/http/models.d.ts +2 -2
- package/dist/esm/http/models.d.ts.map +1 -1
- package/dist/esm/http/models.js.map +1 -1
- package/dist/esm/http/operation.d.ts +11 -12
- package/dist/esm/http/operation.d.ts.map +1 -1
- package/dist/esm/http/operation.js +22 -16
- package/dist/esm/http/operation.js.map +1 -1
- package/dist/esm/http/poller.d.ts +2 -2
- package/dist/esm/http/poller.d.ts.map +1 -1
- package/dist/esm/http/poller.js +1 -15
- package/dist/esm/http/poller.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/poller/models.d.ts +15 -39
- package/dist/esm/poller/models.d.ts.map +1 -1
- package/dist/esm/poller/models.js.map +1 -1
- package/dist/esm/poller/operation.d.ts +12 -14
- package/dist/esm/poller/operation.d.ts.map +1 -1
- package/dist/esm/poller/operation.js +25 -29
- package/dist/esm/poller/operation.js.map +1 -1
- package/dist/esm/poller/poller.d.ts +1 -1
- package/dist/esm/poller/poller.d.ts.map +1 -1
- package/dist/esm/poller/poller.js +9 -34
- package/dist/esm/poller/poller.js.map +1 -1
- package/dist/react-native/http/models.d.ts +2 -2
- package/dist/react-native/http/models.d.ts.map +1 -1
- package/dist/react-native/http/models.js.map +1 -1
- package/dist/react-native/http/operation.d.ts +11 -12
- package/dist/react-native/http/operation.d.ts.map +1 -1
- package/dist/react-native/http/operation.js +22 -16
- package/dist/react-native/http/operation.js.map +1 -1
- package/dist/react-native/http/poller.d.ts +2 -2
- package/dist/react-native/http/poller.d.ts.map +1 -1
- package/dist/react-native/http/poller.js +1 -15
- package/dist/react-native/http/poller.js.map +1 -1
- package/dist/react-native/index.d.ts +1 -1
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/poller/models.d.ts +15 -39
- package/dist/react-native/poller/models.d.ts.map +1 -1
- package/dist/react-native/poller/models.js.map +1 -1
- package/dist/react-native/poller/operation.d.ts +12 -14
- package/dist/react-native/poller/operation.d.ts.map +1 -1
- package/dist/react-native/poller/operation.js +25 -29
- package/dist/react-native/poller/operation.js.map +1 -1
- package/dist/react-native/poller/poller.d.ts +1 -1
- package/dist/react-native/poller/poller.d.ts.map +1 -1
- package/dist/react-native/poller/poller.js +9 -34
- package/dist/react-native/poller/poller.js.map +1 -1
- package/package.json +26 -20
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/operation/build_samples/all.log +0 -2
- package/.rush/temp/operation/build_samples/state.json +0 -3
- package/.rush/temp/shrinkwrap-deps.json +0 -510
- package/.tshy/browser.json +0 -12
- package/.tshy/build.json +0 -9
- package/.tshy/commonjs.json +0 -14
- package/.tshy/esm.json +0 -12
- package/.tshy/react-native.json +0 -12
- package/CHANGELOG.md +0 -179
- package/api-extractor.json +0 -31
- package/config/rush-project.json +0 -3
- package/core-lro.build.cache.error.log +0 -1
- package/core-lro.build_samples.cache.log +0 -1
- package/core-lro.build_samples.log +0 -2
- package/core-lro.pack.cache.log +0 -1
- package/core-lro.pack.log +0 -1
- package/docs/LROEngine.md +0 -158
- package/review/core-lro.api.md +0 -106
- package/samples/README.md +0 -284
- package/samples/typescript/samplesClient.ts +0 -254
- package/src/http/models.ts +0 -119
- package/src/http/operation.ts +0 -343
- package/src/http/poller.ts +0 -83
- package/src/index.ts +0 -21
- package/src/logger.ts +0 -10
- package/src/poller/constants.ts +0 -11
- package/src/poller/models.ts +0 -251
- package/src/poller/operation.ts +0 -315
- package/src/poller/poller.ts +0 -250
- package/temp/core-lro.api.json +0 -1892
- package/temp/core-lro.api.md +0 -106
- package/test/getYieldedValue.ts +0 -16
- package/test/lro.spec.ts +0 -3141
- package/test/matrix.ts +0 -46
- package/test/utils/coreRestPipelineLro.ts +0 -25
- package/test/utils/router.ts +0 -231
- package/test/utils/utils.ts +0 -144
- package/tsconfig.browser.config.json +0 -10
- package/tsconfig.json +0 -13
- package/tsdoc.json +0 -4
- package/tslint.json +0 -47
- package/vitest.browser.config.ts +0 -34
- package/vitest.config.ts +0 -31
package/temp/core-lro.api.md
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
## API Report File for "@azure/core-lro"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { AbortSignalLike } from '@azure/abort-controller';
|
|
8
|
-
|
|
9
|
-
// @public
|
|
10
|
-
export type CancelOnProgress = () => void;
|
|
11
|
-
|
|
12
|
-
// @public
|
|
13
|
-
export function createHttpPoller<TResult, TState extends OperationState<TResult>>(lro: LongRunningOperation, options?: CreateHttpPollerOptions<TResult, TState>): PollerLike<TState, TResult>;
|
|
14
|
-
|
|
15
|
-
// @public
|
|
16
|
-
export interface CreateHttpPollerOptions<TResult, TState> {
|
|
17
|
-
intervalInMs?: number;
|
|
18
|
-
processResult?: (result: unknown, state: TState) => TResult | Promise<TResult>;
|
|
19
|
-
resolveOnUnsuccessful?: boolean;
|
|
20
|
-
resourceLocationConfig?: ResourceLocationConfig;
|
|
21
|
-
restoreFrom?: string;
|
|
22
|
-
updateState?: (state: TState, response: OperationResponse) => void;
|
|
23
|
-
withOperationLocation?: (operationLocation: string) => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// @public
|
|
27
|
-
export function deserializeState<TState>(serializedState: string): RestorableOperationState<TState>;
|
|
28
|
-
|
|
29
|
-
// @public
|
|
30
|
-
export interface LongRunningOperation<T = unknown> {
|
|
31
|
-
sendInitialRequest: () => Promise<OperationResponse<unknown>>;
|
|
32
|
-
sendPollRequest: (path: string, options?: {
|
|
33
|
-
abortSignal?: AbortSignalLike;
|
|
34
|
-
}) => Promise<OperationResponse<T>>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// @public
|
|
38
|
-
export interface OperationConfig {
|
|
39
|
-
initialUrl?: string;
|
|
40
|
-
metadata?: Record<string, string>;
|
|
41
|
-
operationLocation?: string;
|
|
42
|
-
requestMethod?: string;
|
|
43
|
-
resourceLocation?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// @public
|
|
47
|
-
export interface OperationResponse<T = unknown, TRequest extends RawRequest = RawRequest> {
|
|
48
|
-
flatResponse: T;
|
|
49
|
-
rawResponse: RawResponse<TRequest>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// @public
|
|
53
|
-
export interface OperationState<TResult> {
|
|
54
|
-
error?: Error;
|
|
55
|
-
result?: TResult;
|
|
56
|
-
status: OperationStatus;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// @public
|
|
60
|
-
export type OperationStatus = "notStarted" | "running" | "succeeded" | "canceled" | "failed";
|
|
61
|
-
|
|
62
|
-
// @public
|
|
63
|
-
export interface PollerLike<TState extends OperationState<TResult>, TResult> extends Promise<TResult> {
|
|
64
|
-
readonly isDone: boolean;
|
|
65
|
-
readonly isStopped: boolean;
|
|
66
|
-
onProgress(callback: (state: TState) => void): CancelOnProgress;
|
|
67
|
-
readonly operationState: TState | undefined;
|
|
68
|
-
poll(options?: {
|
|
69
|
-
abortSignal?: AbortSignalLike;
|
|
70
|
-
}): Promise<TState>;
|
|
71
|
-
pollUntilDone(pollOptions?: {
|
|
72
|
-
abortSignal?: AbortSignalLike;
|
|
73
|
-
}): Promise<TResult>;
|
|
74
|
-
readonly result: TResult | undefined;
|
|
75
|
-
serialize(): Promise<string>;
|
|
76
|
-
submitted(): Promise<void>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// @public
|
|
80
|
-
export interface RawRequest {
|
|
81
|
-
body?: unknown;
|
|
82
|
-
method: string;
|
|
83
|
-
url: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// @public
|
|
87
|
-
export interface RawResponse<TRequest extends RawRequest = RawRequest> {
|
|
88
|
-
body?: unknown;
|
|
89
|
-
headers: {
|
|
90
|
-
[headerName: string]: string;
|
|
91
|
-
};
|
|
92
|
-
request: TRequest;
|
|
93
|
-
statusCode: number;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// @public
|
|
97
|
-
export type ResourceLocationConfig = "azure-async-operation" | "location" | "original-uri";
|
|
98
|
-
|
|
99
|
-
// @public
|
|
100
|
-
export type RestorableOperationState<T> = T & {
|
|
101
|
-
config: OperationConfig;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// (No @packageDocumentation comment for this package)
|
|
105
|
-
|
|
106
|
-
```
|
package/test/getYieldedValue.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
|
|
4
|
-
import { assert } from "vitest";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns the currently yielded value from an iterator if it exists, otherwise, it throws an assertion failure.
|
|
8
|
-
* @param iteratorResult - The result of the current iteration
|
|
9
|
-
* @returns the currently yielded value
|
|
10
|
-
*/
|
|
11
|
-
export function getYieldedValue<YT, RT>(iteratorResult: IteratorResult<YT, RT>): YT {
|
|
12
|
-
if (iteratorResult.done) {
|
|
13
|
-
assert.fail(`Expected an item but did not get any`);
|
|
14
|
-
}
|
|
15
|
-
return iteratorResult.value;
|
|
16
|
-
}
|