@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.
Files changed (147) hide show
  1. package/dist/browser/http/models.d.ts +2 -2
  2. package/dist/browser/http/models.d.ts.map +1 -1
  3. package/dist/browser/http/models.js.map +1 -1
  4. package/dist/browser/http/operation.d.ts +11 -12
  5. package/dist/browser/http/operation.d.ts.map +1 -1
  6. package/dist/browser/http/operation.js +22 -16
  7. package/dist/browser/http/operation.js.map +1 -1
  8. package/dist/browser/http/poller.d.ts +2 -2
  9. package/dist/browser/http/poller.d.ts.map +1 -1
  10. package/dist/browser/http/poller.js +1 -15
  11. package/dist/browser/http/poller.js.map +1 -1
  12. package/dist/browser/index.d.ts +1 -1
  13. package/dist/browser/index.d.ts.map +1 -1
  14. package/dist/browser/index.js.map +1 -1
  15. package/dist/browser/poller/models.d.ts +15 -39
  16. package/dist/browser/poller/models.d.ts.map +1 -1
  17. package/dist/browser/poller/models.js.map +1 -1
  18. package/dist/browser/poller/operation.d.ts +12 -14
  19. package/dist/browser/poller/operation.d.ts.map +1 -1
  20. package/dist/browser/poller/operation.js +25 -29
  21. package/dist/browser/poller/operation.js.map +1 -1
  22. package/dist/browser/poller/poller.d.ts +1 -1
  23. package/dist/browser/poller/poller.d.ts.map +1 -1
  24. package/dist/browser/poller/poller.js +9 -34
  25. package/dist/browser/poller/poller.js.map +1 -1
  26. package/dist/commonjs/http/models.d.ts +2 -2
  27. package/dist/commonjs/http/models.d.ts.map +1 -1
  28. package/dist/commonjs/http/models.js.map +1 -1
  29. package/dist/commonjs/http/operation.d.ts +11 -12
  30. package/dist/commonjs/http/operation.d.ts.map +1 -1
  31. package/dist/commonjs/http/operation.js +22 -16
  32. package/dist/commonjs/http/operation.js.map +1 -1
  33. package/dist/commonjs/http/poller.d.ts +2 -2
  34. package/dist/commonjs/http/poller.d.ts.map +1 -1
  35. package/dist/commonjs/http/poller.js +1 -15
  36. package/dist/commonjs/http/poller.js.map +1 -1
  37. package/dist/commonjs/index.d.ts +1 -1
  38. package/dist/commonjs/index.d.ts.map +1 -1
  39. package/dist/commonjs/index.js.map +1 -1
  40. package/dist/commonjs/poller/models.d.ts +15 -39
  41. package/dist/commonjs/poller/models.d.ts.map +1 -1
  42. package/dist/commonjs/poller/models.js.map +1 -1
  43. package/dist/commonjs/poller/operation.d.ts +12 -14
  44. package/dist/commonjs/poller/operation.d.ts.map +1 -1
  45. package/dist/commonjs/poller/operation.js +25 -29
  46. package/dist/commonjs/poller/operation.js.map +1 -1
  47. package/dist/commonjs/poller/poller.d.ts +1 -1
  48. package/dist/commonjs/poller/poller.d.ts.map +1 -1
  49. package/dist/commonjs/poller/poller.js +9 -34
  50. package/dist/commonjs/poller/poller.js.map +1 -1
  51. package/dist/commonjs/tsdoc-metadata.json +1 -1
  52. package/dist/core-lro.d.ts +28 -32
  53. package/dist/esm/http/models.d.ts +2 -2
  54. package/dist/esm/http/models.d.ts.map +1 -1
  55. package/dist/esm/http/models.js.map +1 -1
  56. package/dist/esm/http/operation.d.ts +11 -12
  57. package/dist/esm/http/operation.d.ts.map +1 -1
  58. package/dist/esm/http/operation.js +22 -16
  59. package/dist/esm/http/operation.js.map +1 -1
  60. package/dist/esm/http/poller.d.ts +2 -2
  61. package/dist/esm/http/poller.d.ts.map +1 -1
  62. package/dist/esm/http/poller.js +1 -15
  63. package/dist/esm/http/poller.js.map +1 -1
  64. package/dist/esm/index.d.ts +1 -1
  65. package/dist/esm/index.d.ts.map +1 -1
  66. package/dist/esm/index.js.map +1 -1
  67. package/dist/esm/poller/models.d.ts +15 -39
  68. package/dist/esm/poller/models.d.ts.map +1 -1
  69. package/dist/esm/poller/models.js.map +1 -1
  70. package/dist/esm/poller/operation.d.ts +12 -14
  71. package/dist/esm/poller/operation.d.ts.map +1 -1
  72. package/dist/esm/poller/operation.js +25 -29
  73. package/dist/esm/poller/operation.js.map +1 -1
  74. package/dist/esm/poller/poller.d.ts +1 -1
  75. package/dist/esm/poller/poller.d.ts.map +1 -1
  76. package/dist/esm/poller/poller.js +9 -34
  77. package/dist/esm/poller/poller.js.map +1 -1
  78. package/dist/react-native/http/models.d.ts +2 -2
  79. package/dist/react-native/http/models.d.ts.map +1 -1
  80. package/dist/react-native/http/models.js.map +1 -1
  81. package/dist/react-native/http/operation.d.ts +11 -12
  82. package/dist/react-native/http/operation.d.ts.map +1 -1
  83. package/dist/react-native/http/operation.js +22 -16
  84. package/dist/react-native/http/operation.js.map +1 -1
  85. package/dist/react-native/http/poller.d.ts +2 -2
  86. package/dist/react-native/http/poller.d.ts.map +1 -1
  87. package/dist/react-native/http/poller.js +1 -15
  88. package/dist/react-native/http/poller.js.map +1 -1
  89. package/dist/react-native/index.d.ts +1 -1
  90. package/dist/react-native/index.d.ts.map +1 -1
  91. package/dist/react-native/index.js.map +1 -1
  92. package/dist/react-native/poller/models.d.ts +15 -39
  93. package/dist/react-native/poller/models.d.ts.map +1 -1
  94. package/dist/react-native/poller/models.js.map +1 -1
  95. package/dist/react-native/poller/operation.d.ts +12 -14
  96. package/dist/react-native/poller/operation.d.ts.map +1 -1
  97. package/dist/react-native/poller/operation.js +25 -29
  98. package/dist/react-native/poller/operation.js.map +1 -1
  99. package/dist/react-native/poller/poller.d.ts +1 -1
  100. package/dist/react-native/poller/poller.d.ts.map +1 -1
  101. package/dist/react-native/poller/poller.js +9 -34
  102. package/dist/react-native/poller/poller.js.map +1 -1
  103. package/package.json +26 -20
  104. package/.rush/temp/operation/build/state.json +0 -3
  105. package/.rush/temp/operation/build_samples/all.log +0 -2
  106. package/.rush/temp/operation/build_samples/state.json +0 -3
  107. package/.rush/temp/shrinkwrap-deps.json +0 -510
  108. package/.tshy/browser.json +0 -12
  109. package/.tshy/build.json +0 -9
  110. package/.tshy/commonjs.json +0 -14
  111. package/.tshy/esm.json +0 -12
  112. package/.tshy/react-native.json +0 -12
  113. package/CHANGELOG.md +0 -179
  114. package/api-extractor.json +0 -31
  115. package/config/rush-project.json +0 -3
  116. package/core-lro.build.cache.error.log +0 -1
  117. package/core-lro.build_samples.cache.log +0 -1
  118. package/core-lro.build_samples.log +0 -2
  119. package/core-lro.pack.cache.log +0 -1
  120. package/core-lro.pack.log +0 -1
  121. package/docs/LROEngine.md +0 -158
  122. package/review/core-lro.api.md +0 -106
  123. package/samples/README.md +0 -284
  124. package/samples/typescript/samplesClient.ts +0 -254
  125. package/src/http/models.ts +0 -119
  126. package/src/http/operation.ts +0 -343
  127. package/src/http/poller.ts +0 -83
  128. package/src/index.ts +0 -21
  129. package/src/logger.ts +0 -10
  130. package/src/poller/constants.ts +0 -11
  131. package/src/poller/models.ts +0 -251
  132. package/src/poller/operation.ts +0 -315
  133. package/src/poller/poller.ts +0 -250
  134. package/temp/core-lro.api.json +0 -1892
  135. package/temp/core-lro.api.md +0 -106
  136. package/test/getYieldedValue.ts +0 -16
  137. package/test/lro.spec.ts +0 -3141
  138. package/test/matrix.ts +0 -46
  139. package/test/utils/coreRestPipelineLro.ts +0 -25
  140. package/test/utils/router.ts +0 -231
  141. package/test/utils/utils.ts +0 -144
  142. package/tsconfig.browser.config.json +0 -10
  143. package/tsconfig.json +0 -13
  144. package/tsdoc.json +0 -4
  145. package/tslint.json +0 -47
  146. package/vitest.browser.config.ts +0 -34
  147. package/vitest.config.ts +0 -31
package/test/matrix.ts DELETED
@@ -1,46 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- /**
5
- * Takes a jagged 2D array and a function and runs the function with every
6
- * possible combination of elements of each of the arrays
7
- *
8
- * For strong type-checking, it is important that the `matrix` have a strong
9
- * type, such as a `const` literal.
10
- *
11
- * @param values - jagged 2D array specifying the arguments and their possible
12
- * values
13
- * @param handler - the function to run with the different argument combinations
14
- *
15
- * @example
16
- * ```typescript
17
- * matrix([
18
- * [true, false],
19
- * [1, 2, 3]
20
- * ] as const,
21
- * (useLabels: boolean, attempts: number) => {
22
- * // This body will run six times with the following parameters:
23
- * // - true, 1
24
- * // - true, 2
25
- * // - true, 3
26
- * // - false, 1
27
- * // - false, 2
28
- * // - false, 3
29
- * });
30
- * ```
31
- */
32
- export function matrix<T extends ReadonlyArray<readonly unknown[]>>(
33
- values: T,
34
- handler: (
35
- ...args: { [idx in keyof T]: T[idx] extends ReadonlyArray<infer U> ? U : never }
36
- ) => Promise<void>,
37
- ): void {
38
- // Classic recursive approach
39
- if (values.length === 0) {
40
- (handler as () => Promise<void>)();
41
- } else {
42
- for (const v of values[0]) {
43
- matrix(values.slice(1), (...args) => (handler as any)(v, ...args));
44
- }
45
- }
46
- }
@@ -1,25 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import { LongRunningOperation, OperationResponse } from "../../src/index.js";
5
- import { AbortSignalLike } from "@azure/abort-controller";
6
- import { PipelineRequest } from "@azure/core-rest-pipeline";
7
-
8
- type SendOperationFn<T> = (request: PipelineRequest) => Promise<OperationResponse<T>>;
9
-
10
- export function createCoreRestPipelineLro<T>(inputs: {
11
- sendOperationFn: SendOperationFn<T>;
12
- request: PipelineRequest;
13
- }): LongRunningOperation<T> {
14
- const { request, sendOperationFn } = inputs;
15
- return {
16
- sendInitialRequest: () => sendOperationFn(request),
17
- sendPollRequest: (url: string, options?: { abortSignal?: AbortSignalLike }) =>
18
- sendOperationFn({
19
- ...request,
20
- method: "GET",
21
- url,
22
- abortSignal: options?.abortSignal,
23
- }),
24
- };
25
- }
@@ -1,231 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import {
5
- HttpClient,
6
- HttpMethods,
7
- PipelineRequest,
8
- PipelineResponse,
9
- RestError,
10
- createHttpHeaders,
11
- } from "@azure/core-rest-pipeline";
12
- import {
13
- ImplementationName,
14
- LroResponseSpec,
15
- Result,
16
- RouteProcessor,
17
- State,
18
- createProcessor,
19
- generate,
20
- } from "./utils.js";
21
- import { PollerLike, createHttpPoller } from "../../src/index.js";
22
- import {
23
- OperationResponse,
24
- RawResponse,
25
- ResourceLocationConfig,
26
- ResponseBody,
27
- } from "../../src/http/models.js";
28
- import { AbortError } from "@azure/abort-controller";
29
- import { createCoreRestPipelineLro } from "./coreRestPipelineLro.js";
30
- import { getYieldedValue } from "../getYieldedValue.js";
31
-
32
- /**
33
- * Dummy value for the path of the initial request
34
- */
35
- const initialPath = "path";
36
-
37
- /**
38
- * This helper creates an array of route processors where each processor is represented
39
- * as a generator. This generator representation is needed to handle a sequence of GET
40
- * requests to the same route. In particular, the first GET request may get
41
- * a response indicating that the LRO is still in progress but a subsequent
42
- * GET request may get a response indicating the LRO is in a terminal state.
43
- */
44
- export function toLroProcessors(responses: LroResponseSpec[]): RouteProcessor[] {
45
- const routeCountMap = new Map<
46
- string,
47
- {
48
- method: HttpMethods;
49
- path: string;
50
- responseProcessors: ((req: PipelineRequest) => PipelineResponse)[];
51
- }
52
- >();
53
- for (const response of responses) {
54
- const { method, path = initialPath, status, body, headers } = response;
55
- const key = createRouteKey({ method, path });
56
- const routeProcessor = routeCountMap.get(key);
57
- if (routeProcessor !== undefined) {
58
- routeProcessor.responseProcessors.push(createProcessor({ status, body, headers }));
59
- } else {
60
- routeCountMap.set(key, {
61
- method,
62
- path,
63
- responseProcessors: [createProcessor({ status, body, headers })],
64
- });
65
- }
66
- }
67
- return [...routeCountMap.values()].map(({ responseProcessors, ...rest }) => ({
68
- process: generate(...responseProcessors),
69
- ...rest,
70
- }));
71
- }
72
-
73
- function createRouteKey({ method, path }: { path: string; method: string }): string {
74
- return method + ":" + path;
75
- }
76
- export function createClient(inputs: {
77
- routes: RouteProcessor[];
78
- throwOnNon2xxResponse?: boolean;
79
- }): HttpClient {
80
- const { routes, throwOnNon2xxResponse = true } = inputs;
81
- const routesTable = new Map(routes.map((route) => [createRouteKey(route), route]));
82
- return {
83
- async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {
84
- if (request.abortSignal?.aborted) {
85
- throw new AbortError("The operation was aborted.");
86
- }
87
- const path = request.url;
88
- const method = request.method;
89
- const route = routesTable.get(createRouteKey({ method, path }));
90
- if (route !== undefined) {
91
- const response = getYieldedValue(route.process.next())(request);
92
- if (response.status >= 400 && throwOnNon2xxResponse) {
93
- throw new RestError(
94
- `Received unexpected HTTP status code ${response.status} while polling. This may indicate a server issue.`,
95
- { statusCode: response.status },
96
- );
97
- }
98
- return response;
99
- }
100
- const message = `Route for ${method} request to ${path} was not found`;
101
- if (throwOnNon2xxResponse) {
102
- throw new RestError(message, {
103
- statusCode: 404,
104
- });
105
- }
106
- return {
107
- bodyAsText: JSON.stringify({ message }),
108
- status: 404,
109
- request,
110
- headers: createHttpHeaders(),
111
- };
112
- },
113
- };
114
- }
115
-
116
- function createSendOp(settings: {
117
- client: HttpClient;
118
- }): (request: PipelineRequest) => Promise<OperationResponse<Result>> {
119
- const { client } = settings;
120
- return async function (request: PipelineRequest): Promise<OperationResponse<Result>> {
121
- const response = await client.sendRequest(request);
122
- const parsedBody: ResponseBody = response.bodyAsText
123
- ? JSON.parse(response.bodyAsText)
124
- : response.bodyAsText;
125
- const headers = response.headers.toJSON();
126
- return {
127
- flatResponse: { ...parsedBody, ...headers, statusCode: response.status },
128
- rawResponse: {
129
- headers: headers,
130
- statusCode: response.status,
131
- body: parsedBody,
132
- request,
133
- },
134
- };
135
- };
136
- }
137
-
138
- export function createTestPoller(settings: {
139
- routes: LroResponseSpec[];
140
- resourceLocationConfig?: ResourceLocationConfig;
141
- processResult?: (result: unknown, state: State) => Promise<Result> | Result;
142
- updateState?: (state: State, lastResponse: OperationResponse<Result>) => void;
143
- implName?: ImplementationName;
144
- throwOnNon2xxResponse?: boolean;
145
- restoreFrom?: string;
146
- }): PollerLike<State, Result> {
147
- const {
148
- routes,
149
- resourceLocationConfig,
150
- processResult,
151
- updateState,
152
- implName = "createPoller",
153
- throwOnNon2xxResponse = true,
154
- restoreFrom = undefined,
155
- } = settings;
156
- const client = createClient({ routes: toLroProcessors(routes), throwOnNon2xxResponse });
157
- const { method: requestMethod, path = initialPath } = restoreFrom
158
- ? { method: "GET" as HttpMethods, path: "FAKE" }
159
- : routes[0];
160
- const lro = createCoreRestPipelineLro({
161
- sendOperationFn: createSendOp({ client }),
162
- request: {
163
- method: requestMethod,
164
- url: path,
165
- headers: createHttpHeaders(),
166
- requestId: "",
167
- timeout: 0,
168
- withCredentials: false,
169
- },
170
- });
171
- switch (implName) {
172
- case "createPoller": {
173
- return createHttpPoller(lro, {
174
- intervalInMs: 0,
175
- resourceLocationConfig: resourceLocationConfig,
176
- processResult,
177
- updateState: updateState as
178
- | ((state: any, lastResponse: OperationResponse<unknown>) => void)
179
- | undefined,
180
- resolveOnUnsuccessful: !throwOnNon2xxResponse,
181
- restoreFrom,
182
- });
183
- }
184
- default: {
185
- throw new Error("Unreachable");
186
- }
187
- }
188
- }
189
-
190
- async function runLro<TState>(settings: {
191
- routes: LroResponseSpec[];
192
- onProgress?: (state: TState) => void;
193
- resourceLocationConfig?: ResourceLocationConfig;
194
- processResult?: (result: unknown, state: TState) => Promise<Result> | Result;
195
- updateState?: (state: TState, lastResponse: RawResponse) => void;
196
- implName?: ImplementationName;
197
- throwOnNon2xxResponse?: boolean;
198
- }): Promise<Result> {
199
- const {
200
- routes,
201
- onProgress,
202
- resourceLocationConfig,
203
- processResult,
204
- updateState,
205
- implName = "createPoller",
206
- throwOnNon2xxResponse = true,
207
- } = settings;
208
- const poller = createTestPoller({
209
- routes,
210
- resourceLocationConfig,
211
- processResult,
212
- updateState: (state, { rawResponse }) => updateState?.(state, rawResponse),
213
- implName,
214
- throwOnNon2xxResponse,
215
- });
216
- if (onProgress !== undefined) {
217
- poller.onProgress(onProgress);
218
- }
219
- return poller.pollUntilDone();
220
- }
221
-
222
- export const createRunLroWith =
223
- <TState>(variables: { implName: ImplementationName; throwOnNon2xxResponse?: boolean }) =>
224
- (settings: {
225
- routes: LroResponseSpec[];
226
- onProgress?: (state: TState) => void;
227
- resourceLocationConfig?: ResourceLocationConfig;
228
- processResult?: (result: unknown, state: TState) => Result | Promise<Result>;
229
- updateState?: (state: TState, lastResponse: RawResponse) => void;
230
- }): Promise<Result> =>
231
- runLro({ ...settings, ...variables });
@@ -1,144 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import {
5
- HttpMethods,
6
- PipelineRequest,
7
- PipelineResponse,
8
- createHttpHeaders,
9
- isRestError,
10
- } from "@azure/core-rest-pipeline";
11
- import { ResponseBody } from "../../src/http/models.js";
12
- import { assert } from "vitest";
13
-
14
- export interface RouteProcessor {
15
- method: string;
16
- path: string;
17
- process: Generator<(request: PipelineRequest) => PipelineResponse>;
18
- }
19
-
20
- export interface LroResponseSpec {
21
- method: HttpMethods;
22
- path?: string;
23
- status: number;
24
- body?: string;
25
- headers?: Record<string, string>;
26
- }
27
-
28
- export type ImplementationName = "createPoller";
29
-
30
- export type Result = ResponseBody & { statusCode: number };
31
- export type State = any;
32
-
33
- export function createProcessor(settings: {
34
- status: number;
35
- body?: string;
36
- headers?: Record<string, string>;
37
- }): (req: PipelineRequest) => PipelineResponse {
38
- const { status, body: bodyAsText, headers } = settings;
39
- return (request: PipelineRequest) => ({
40
- request,
41
- headers: createHttpHeaders(headers),
42
- status,
43
- bodyAsText,
44
- });
45
- }
46
-
47
- export function createDoubleHeaders(settings: {
48
- pollingPath: string;
49
- headers: Record<string, string>;
50
- }): Record<string, string> {
51
- const { headers, pollingPath } = settings;
52
- return {
53
- "Azure-AsyncOperation": pollingPath,
54
- Location: pollingPath,
55
- ...headers,
56
- };
57
- }
58
-
59
- export function* generate<T>(...input: T[]): Generator<T> {
60
- for (const item of input) {
61
- yield item;
62
- }
63
- }
64
-
65
- export async function assertError(
66
- error: Promise<unknown>,
67
- options: {
68
- statusCode?: number;
69
- messagePattern?: RegExp;
70
- name?: string;
71
- } = {},
72
- ): Promise<void> {
73
- const { statusCode, messagePattern, name } = options;
74
- try {
75
- await error;
76
- assert.fail(`Should have failed instead!`);
77
- } catch (e: unknown) {
78
- if (messagePattern) {
79
- if (e instanceof Error) {
80
- assert.match(e.message, messagePattern);
81
- } else {
82
- assert.fail(`Unexpected error: ${JSON.stringify(e)}`);
83
- }
84
- }
85
- if (statusCode) {
86
- if (isRestError(e)) {
87
- assert.equal(e.statusCode, statusCode);
88
- } else {
89
- assert.fail(`Unexpected error: ${JSON.stringify(e)}`);
90
- }
91
- }
92
- if (name) {
93
- if (e instanceof Error) {
94
- assert.equal(e.name, name);
95
- } else {
96
- assert.fail(`Unexpected error: ${JSON.stringify(e)}`);
97
- }
98
- }
99
- }
100
- }
101
-
102
- export async function assertDivergentBehavior(inputs: {
103
- op: Promise<Result>;
104
- throwOnNon2xxResponse: boolean;
105
- throwing: {
106
- statusCode?: number;
107
- messagePattern?: RegExp;
108
- };
109
- notThrowing: {
110
- result?: any;
111
- partResult?: any;
112
- statusCode?: number;
113
- messagePattern?: RegExp;
114
- };
115
- }): Promise<void> {
116
- const {
117
- op,
118
- throwOnNon2xxResponse,
119
- throwing: { messagePattern, statusCode },
120
- notThrowing: {
121
- messagePattern: notThrowingMessagePattern,
122
- statusCode: notThrowingStatusCode,
123
- result,
124
- partResult,
125
- },
126
- } = inputs;
127
- if (throwOnNon2xxResponse) {
128
- await assertError(op, {
129
- statusCode,
130
- messagePattern,
131
- });
132
- } else {
133
- if (notThrowingStatusCode !== undefined || notThrowingMessagePattern !== undefined) {
134
- await assertError(op, {
135
- statusCode: notThrowingStatusCode,
136
- messagePattern: notThrowingMessagePattern,
137
- });
138
- } else if (partResult !== undefined) {
139
- assert.deepInclude(await op, partResult);
140
- } else {
141
- assert.deepEqual(await op, result);
142
- }
143
- }
144
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./.tshy/build.json",
3
- "include": ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts"],
4
- "exclude": ["./test/**/node/**/*.ts"],
5
- "compilerOptions": {
6
- "outDir": "./dist-test/browser",
7
- "rootDir": ".",
8
- "skipLibCheck": true
9
- }
10
- }
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.package",
3
- "compilerOptions": {
4
- "paths": {
5
- "@azure/core-lro": ["./src/index.ts"]
6
- },
7
- "module": "NodeNext",
8
- "moduleResolution": "NodeNext",
9
- "rootDir": "."
10
- },
11
- "exclude": ["./samples/**/*.ts"],
12
- "include": ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.ts"]
13
- }
package/tsdoc.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3
- "extends": ["../../../tsdoc.json"]
4
- }
package/tslint.json DELETED
@@ -1,47 +0,0 @@
1
- {
2
- "rules": {
3
- "class-name": true,
4
- "comment-format": [true, "check-space"],
5
- "indent": [true, "spaces"],
6
- "linebreak-style": [true, "LF"],
7
- "one-line": [true, "check-open-brace", "check-whitespace"],
8
- "no-var-keyword": true,
9
- "quotemark": [true, "double", "avoid-escape"],
10
- "semicolon": [true, "always", "ignore-bound-class-methods"],
11
- "whitespace": [
12
- true,
13
- "check-branch",
14
- "check-decl",
15
- "check-operator",
16
- "check-module",
17
- "check-separator",
18
- "check-type"
19
- ],
20
- "typedef-whitespace": [
21
- true,
22
- {
23
- "call-signature": "nospace",
24
- "index-signature": "nospace",
25
- "parameter": "nospace",
26
- "property-declaration": "nospace",
27
- "variable-declaration": "nospace"
28
- },
29
- {
30
- "call-signature": "onespace",
31
- "index-signature": "onespace",
32
- "parameter": "onespace",
33
- "property-declaration": "onespace",
34
- "variable-declaration": "onespace"
35
- }
36
- ],
37
- "no-internal-module": true,
38
- "jsdoc-format": true,
39
- "no-inferrable-types": [true],
40
- "no-null-keyword": true,
41
- "no-return-await": true,
42
- "no-switch-case-fall-through": true,
43
- "no-trailing-whitespace": true,
44
- "prefer-const": true,
45
- "triple-equals": [true, "allow-undefined-check"]
46
- }
47
- }
@@ -1,34 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import { defineConfig } from "vitest/config";
5
-
6
- export default defineConfig({
7
- test: {
8
- reporters: ["basic", "junit"],
9
- outputFile: {
10
- junit: "test-results.browser.xml",
11
- },
12
- browser: {
13
- enabled: true,
14
- headless: true,
15
- name: "chromium",
16
- provider: "playwright",
17
- },
18
- fakeTimers: {
19
- toFake: ["setTimeout", "Date"],
20
- },
21
- watch: false,
22
- include: ["dist-test/browser/**/*.spec.js"],
23
- coverage: {
24
- include: ["dist-test/browser/**/*.js"],
25
- exclude: [
26
- "dist-test/browser/**/*./*-browser.mjs",
27
- "dist-test/browser/**/*./*-react-native.mjs",
28
- ],
29
- provider: "istanbul",
30
- reporter: ["text", "json", "html"],
31
- reportsDirectory: "coverage-browser",
32
- },
33
- },
34
- });
package/vitest.config.ts DELETED
@@ -1,31 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import { defineConfig } from "vitest/config";
5
-
6
- export default defineConfig({
7
- test: {
8
- reporters: ["basic", "junit"],
9
- outputFile: {
10
- junit: "test-results.browser.xml",
11
- },
12
- fakeTimers: {
13
- toFake: ["setTimeout", "Date"],
14
- },
15
- watch: false,
16
- include: ["test/**/*.spec.ts"],
17
- exclude: ["test/**/browser/*.spec.ts"],
18
- coverage: {
19
- include: ["src/**/*.ts"],
20
- exclude: [
21
- "src/**/*-browser.mts",
22
- "src/**/*-react-native.mts",
23
- "vitest*.config.ts",
24
- "samples-dev/**/*.ts",
25
- ],
26
- provider: "v8",
27
- reporter: ["text", "json", "html"],
28
- reportsDirectory: "coverage",
29
- },
30
- },
31
- });