@azure-rest/purview-sharing 1.0.0-alpha.20241218.1 → 1.0.0-alpha.20241220.1
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/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/outputModels.d.ts +20 -4
- package/dist/browser/outputModels.d.ts.map +1 -1
- package/dist/browser/outputModels.js.map +1 -1
- package/dist/browser/paginateHelper.d.ts +27 -2
- package/dist/browser/paginateHelper.d.ts.map +1 -1
- package/dist/browser/paginateHelper.js +98 -1
- package/dist/browser/paginateHelper.js.map +1 -1
- package/dist/browser/pollingHelper.d.ts +66 -1
- package/dist/browser/pollingHelper.d.ts.map +1 -1
- package/dist/browser/pollingHelper.js +59 -5
- package/dist/browser/pollingHelper.js.map +1 -1
- package/dist/browser/purviewSharing.d.ts +9 -4
- package/dist/browser/purviewSharing.d.ts.map +1 -1
- package/dist/browser/purviewSharing.js +28 -12
- package/dist/browser/purviewSharing.js.map +1 -1
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +20 -4
- package/dist/commonjs/outputModels.d.ts.map +1 -1
- package/dist/commonjs/outputModels.js.map +1 -1
- package/dist/commonjs/paginateHelper.d.ts +27 -2
- package/dist/commonjs/paginateHelper.d.ts.map +1 -1
- package/dist/commonjs/paginateHelper.js +99 -2
- package/dist/commonjs/paginateHelper.js.map +1 -1
- package/dist/commonjs/pollingHelper.d.ts +66 -1
- package/dist/commonjs/pollingHelper.d.ts.map +1 -1
- package/dist/commonjs/pollingHelper.js +59 -5
- package/dist/commonjs/pollingHelper.js.map +1 -1
- package/dist/commonjs/purviewSharing.d.ts +9 -4
- package/dist/commonjs/purviewSharing.d.ts.map +1 -1
- package/dist/commonjs/purviewSharing.js +28 -12
- package/dist/commonjs/purviewSharing.js.map +1 -1
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/outputModels.d.ts +20 -4
- package/dist/esm/outputModels.d.ts.map +1 -1
- package/dist/esm/outputModels.js.map +1 -1
- package/dist/esm/paginateHelper.d.ts +27 -2
- package/dist/esm/paginateHelper.d.ts.map +1 -1
- package/dist/esm/paginateHelper.js +98 -1
- package/dist/esm/paginateHelper.js.map +1 -1
- package/dist/esm/pollingHelper.d.ts +66 -1
- package/dist/esm/pollingHelper.d.ts.map +1 -1
- package/dist/esm/pollingHelper.js +59 -5
- package/dist/esm/pollingHelper.js.map +1 -1
- package/dist/esm/purviewSharing.d.ts +9 -4
- package/dist/esm/purviewSharing.d.ts.map +1 -1
- package/dist/esm/purviewSharing.js +28 -12
- package/dist/esm/purviewSharing.js.map +1 -1
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +20 -4
- package/dist/react-native/outputModels.d.ts.map +1 -1
- package/dist/react-native/outputModels.js.map +1 -1
- package/dist/react-native/paginateHelper.d.ts +27 -2
- package/dist/react-native/paginateHelper.d.ts.map +1 -1
- package/dist/react-native/paginateHelper.js +98 -1
- package/dist/react-native/paginateHelper.js.map +1 -1
- package/dist/react-native/pollingHelper.d.ts +66 -1
- package/dist/react-native/pollingHelper.d.ts.map +1 -1
- package/dist/react-native/pollingHelper.js +59 -5
- package/dist/react-native/pollingHelper.js.map +1 -1
- package/dist/react-native/purviewSharing.d.ts +9 -4
- package/dist/react-native/purviewSharing.d.ts.map +1 -1
- package/dist/react-native/purviewSharing.js +28 -12
- package/dist/react-native/purviewSharing.js.map +1 -1
- package/package.json +2 -3
|
@@ -13,28 +13,82 @@ const core_lro_1 = require("@azure/core-lro");
|
|
|
13
13
|
*/
|
|
14
14
|
async function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
15
15
|
var _a;
|
|
16
|
+
const abortController = new AbortController();
|
|
16
17
|
const poller = {
|
|
17
|
-
requestMethod: initialResponse.request.method,
|
|
18
|
-
requestPath: initialResponse.request.url,
|
|
19
18
|
sendInitialRequest: async () => {
|
|
20
19
|
// In the case of Rest Clients we are building the LRO poller object from a response that's the reason
|
|
21
20
|
// we are not triggering the initial request here, just extracting the information from the
|
|
22
21
|
// response we were provided.
|
|
23
22
|
return getLroResponse(initialResponse);
|
|
24
23
|
},
|
|
25
|
-
sendPollRequest: async (path) => {
|
|
24
|
+
sendPollRequest: async (path, pollOptions) => {
|
|
26
25
|
// This is the callback that is going to be called to poll the service
|
|
27
26
|
// to get the latest status. We use the client provided and the polling path
|
|
28
27
|
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
29
28
|
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
30
|
-
|
|
29
|
+
function abortListener() {
|
|
30
|
+
abortController.abort();
|
|
31
|
+
}
|
|
32
|
+
const inputAbortSignal = pollOptions === null || pollOptions === void 0 ? void 0 : pollOptions.abortSignal;
|
|
33
|
+
const abortSignal = abortController.signal;
|
|
34
|
+
if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) {
|
|
35
|
+
abortController.abort();
|
|
36
|
+
}
|
|
37
|
+
else if (!abortSignal.aborted) {
|
|
38
|
+
inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, {
|
|
39
|
+
once: true,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
let response;
|
|
43
|
+
try {
|
|
44
|
+
response = await client
|
|
45
|
+
.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url)
|
|
46
|
+
.get({ abortSignal });
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener);
|
|
50
|
+
}
|
|
31
51
|
const lroResponse = getLroResponse(response);
|
|
32
52
|
lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
|
|
33
53
|
return lroResponse;
|
|
34
54
|
},
|
|
35
55
|
};
|
|
36
56
|
options.resolveOnUnsuccessful = (_a = options.resolveOnUnsuccessful) !== null && _a !== void 0 ? _a : true;
|
|
37
|
-
|
|
57
|
+
const httpPoller = (0, core_lro_1.createHttpPoller)(poller, options);
|
|
58
|
+
const simplePoller = {
|
|
59
|
+
isDone() {
|
|
60
|
+
return httpPoller.isDone;
|
|
61
|
+
},
|
|
62
|
+
isStopped() {
|
|
63
|
+
return abortController.signal.aborted;
|
|
64
|
+
},
|
|
65
|
+
getOperationState() {
|
|
66
|
+
if (!httpPoller.operationState) {
|
|
67
|
+
throw new Error("Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().");
|
|
68
|
+
}
|
|
69
|
+
return httpPoller.operationState;
|
|
70
|
+
},
|
|
71
|
+
getResult() {
|
|
72
|
+
return httpPoller.result;
|
|
73
|
+
},
|
|
74
|
+
toString() {
|
|
75
|
+
if (!httpPoller.operationState) {
|
|
76
|
+
throw new Error("Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().");
|
|
77
|
+
}
|
|
78
|
+
return JSON.stringify({
|
|
79
|
+
state: httpPoller.operationState,
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
stopPolling() {
|
|
83
|
+
abortController.abort();
|
|
84
|
+
},
|
|
85
|
+
onProgress: httpPoller.onProgress,
|
|
86
|
+
poll: httpPoller.poll,
|
|
87
|
+
pollUntilDone: httpPoller.pollUntilDone,
|
|
88
|
+
serialize: httpPoller.serialize,
|
|
89
|
+
submitted: httpPoller.submitted,
|
|
90
|
+
};
|
|
91
|
+
return simplePoller;
|
|
38
92
|
}
|
|
39
93
|
/**
|
|
40
94
|
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAsFlC,oDAoFC;AA/JD,8CAAmD;AAoEnD;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,eAAwB,EACxB,UAAqE,EAAE;;IAEvE,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9C,MAAM,MAAM,GAA8B;QACxC,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,sGAAsG;YACtG,2FAA2F;YAC3F,6BAA6B;YAC7B,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,IAAY,EAAE,WAA+C,EAAE,EAAE;YACvF,sEAAsE;YACtE,4EAA4E;YAC5E,0JAA0J;YAC1J,+GAA+G;YAC/G,SAAS,aAAa;gBACpB,eAAe,CAAC,KAAK,EAAE,CAAC;YAC1B,CAAC;YACD,MAAM,gBAAgB,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,CAAC;YAClD,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC;YAC3C,IAAI,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,EAAE,CAAC;gBAC9B,eAAe,CAAC,KAAK,EAAE,CAAC;YAC1B,CAAC;iBAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBAChC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,gBAAgB,CAAC,OAAO,EAAE,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AAI,KAAK,CACb,4IAA4I,CAC7I,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,KAAK,EAAE,UAAU,CAAC,cAAc;aACjC,CAAC,CAAC;QACL,CAAC;QACD,WAAW;YACT,eAAe,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;QACD,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,aAAa,EAAE,UAAU,CAAC,aAAa;QACvC,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC,CAAC;IACF,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CACrB,QAAiB;IAEjB,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,SAAS,CAAC,uDAAuD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,kCACN,QAAQ,KACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n CancelOnProgress,\n CreateHttpPollerOptions,\n RunningOperation,\n OperationResponse,\n OperationState,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\n\n/**\n * A simple poller that can be used to poll a long running operation.\n */\nexport interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Returns the state of the operation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n\n /**\n * Returns a promise that could be used for serialized version of the poller's operation\n * by invoking the operation's serialize method.\n */\n serialize(): Promise<string>;\n\n /**\n * Wait the poller to be submitted.\n */\n submitted(): Promise<void>;\n\n /**\n * Returns a string representation of the poller's operation. Similar to serialize but returns a string.\n * @deprecated Use serialize() instead.\n */\n toString(): string;\n\n /**\n * Stops the poller from continuing to poll. Please note this will only stop the client-side polling\n * @deprecated Use abortSignal to stop polling instead.\n */\n stopPolling(): void;\n\n /**\n * Returns true if the poller is stopped.\n * @deprecated Use abortSignal status to track this instead.\n */\n isStopped(): boolean;\n}\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport async function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {},\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {\n const abortController = new AbortController();\n const poller: RunningOperation<TResult> = {\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path: string, pollOptions?: { abortSignal?: AbortSignalLike }) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get({ abortSignal });\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;\n const httpPoller = createHttpPoller(poller, options);\n const simplePoller: SimplePollerLike<OperationState<TResult>, TResult> = {\n isDone() {\n return httpPoller.isDone;\n },\n isStopped() {\n return abortController.signal.aborted;\n },\n getOperationState() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return httpPoller.operationState;\n },\n getResult() {\n return httpPoller.result;\n },\n toString() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\",\n );\n }\n return JSON.stringify({\n state: httpPoller.operationState,\n });\n },\n stopPolling() {\n abortController.abort();\n },\n onProgress: httpPoller.onProgress,\n poll: httpPoller.poll,\n pollUntilDone: httpPoller.pollUntilDone,\n serialize: httpPoller.serialize,\n submitted: httpPoller.submitted,\n };\n return simplePoller;\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult,\n): OperationResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { ClientOptions } from "@azure-rest/core-client";
|
|
2
2
|
import type { TokenCredential } from "@azure/core-auth";
|
|
3
3
|
import type { PurviewSharingClient } from "./clientDefinitions.js";
|
|
4
|
+
/** The optional parameters for the client */
|
|
5
|
+
export interface PurviewSharingClientOptions extends ClientOptions {
|
|
6
|
+
/** The api version option of the client */
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
}
|
|
4
9
|
/**
|
|
5
10
|
* Initialize a new instance of `PurviewSharingClient`
|
|
6
|
-
* @param endpoint
|
|
7
|
-
* @param credentials
|
|
8
|
-
* @param options
|
|
11
|
+
* @param endpoint - The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share
|
|
12
|
+
* @param credentials - uniquely identify client credential
|
|
13
|
+
* @param options - the parameter for all optional parameters
|
|
9
14
|
*/
|
|
10
|
-
export default function createClient(endpoint: string, credentials: TokenCredential, options?:
|
|
15
|
+
export default function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: PurviewSharingClientOptions): PurviewSharingClient;
|
|
11
16
|
//# sourceMappingURL=purviewSharing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purviewSharing.d.ts","sourceRoot":"","sources":["../../src/purviewSharing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"purviewSharing.d.ts","sourceRoot":"","sources":["../../src/purviewSharing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,6CAA6C;AAC7C,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,2BAAgC,GAClF,oBAAoB,CAuCtB"}
|
|
@@ -3,28 +3,44 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.default = createClient;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
6
7
|
const core_client_1 = require("@azure-rest/core-client");
|
|
8
|
+
const logger_js_1 = require("./logger.js");
|
|
7
9
|
/**
|
|
8
10
|
* Initialize a new instance of `PurviewSharingClient`
|
|
9
|
-
* @param endpoint
|
|
10
|
-
* @param credentials
|
|
11
|
-
* @param options
|
|
11
|
+
* @param endpoint - The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share
|
|
12
|
+
* @param credentials - uniquely identify client credential
|
|
13
|
+
* @param options - the parameter for all optional parameters
|
|
12
14
|
*/
|
|
13
|
-
function createClient(endpoint, credentials,
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
scopes: ["https://purview.azure.net/.default"],
|
|
19
|
-
} });
|
|
20
|
-
const userAgentInfo = `azsdk-js-purview-sharing-rest/1.0.0-beta.2`;
|
|
15
|
+
function createClient(endpoint, credentials, _a = {}) {
|
|
16
|
+
var _b, _c, _d, _e;
|
|
17
|
+
var { apiVersion = "2023-05-30-preview" } = _a, options = tslib_1.__rest(_a, ["apiVersion"]);
|
|
18
|
+
const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpoint}`;
|
|
19
|
+
const userAgentInfo = `azsdk-js-purview-sharing-rest/1.0.0-beta.3`;
|
|
21
20
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
22
21
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
23
22
|
: `${userAgentInfo}`;
|
|
24
23
|
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
25
24
|
userAgentPrefix,
|
|
25
|
+
}, loggingOptions: {
|
|
26
|
+
logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger_js_1.logger.info,
|
|
27
|
+
}, credentials: {
|
|
28
|
+
scopes: ["https://purview.azure.net/.default"],
|
|
26
29
|
} });
|
|
27
|
-
const client = (0, core_client_1.getClient)(
|
|
30
|
+
const client = (0, core_client_1.getClient)(endpointUrl, credentials, options);
|
|
31
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
32
|
+
client.pipeline.addPolicy({
|
|
33
|
+
name: "ClientApiVersionPolicy",
|
|
34
|
+
sendRequest: (req, next) => {
|
|
35
|
+
// Use the apiVersion defined in request url directly
|
|
36
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
37
|
+
const url = new URL(req.url);
|
|
38
|
+
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
39
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
40
|
+
}
|
|
41
|
+
return next(req);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
28
44
|
return client;
|
|
29
45
|
}
|
|
30
46
|
//# sourceMappingURL=purviewSharing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purviewSharing.js","sourceRoot":"","sources":["../../src/purviewSharing.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"purviewSharing.js","sourceRoot":"","sources":["../../src/purviewSharing.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,+BA2CC;;AA5DD,yDAAoD;AACpD,2CAAqC;AAUrC;;;;;GAKG;AACH,SAAwB,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,KAAiF,EAAE;;QAAnF,EAAE,UAAU,GAAG,oBAAoB,OAAgD,EAA3C,OAAO,sBAA/C,cAAiD,CAAF;IAE/C,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,EAAE,CAAC;IACzE,MAAM,aAAa,GAAG,4CAA4C,CAAC;IACnE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,kBAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,oCAAoC,CAAC;SAC/C,GACF,CAAC;IACF,MAAM,MAAM,GAAG,IAAA,uBAAS,EAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAyB,CAAC;IAEpF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PurviewSharingClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface PurviewSharingClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `PurviewSharingClient`\n * @param endpoint - The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n { apiVersion = \"2023-05-30-preview\", ...options }: PurviewSharingClientOptions = {},\n): PurviewSharingClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}`;\n const userAgentInfo = `azsdk-js-purview-sharing-rest/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as PurviewSharingClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"purview-sharing\");\n"]}
|
|
@@ -40,14 +40,22 @@ export interface OperationResponseOutput {
|
|
|
40
40
|
}
|
|
41
41
|
/** List of received shares. */
|
|
42
42
|
export interface ReceivedShareListOutput {
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The Url of next result page.
|
|
45
|
+
*
|
|
46
|
+
* Value may contain a URL
|
|
47
|
+
*/
|
|
44
48
|
nextLink?: string;
|
|
45
49
|
/** Collection of items of type ReceivedShare */
|
|
46
50
|
value: Array<ReceivedShareOutput>;
|
|
47
51
|
}
|
|
48
52
|
/** List of sent shares. */
|
|
49
53
|
export interface SentShareListOutput {
|
|
50
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The Url of next result page.
|
|
56
|
+
*
|
|
57
|
+
* Value may contain a URL
|
|
58
|
+
*/
|
|
51
59
|
nextLink?: string;
|
|
52
60
|
/** Collection of items of type SentShare */
|
|
53
61
|
value: Array<SentShareOutput>;
|
|
@@ -58,7 +66,11 @@ export interface SentShareOutputParent extends ProxyResourceOutput {
|
|
|
58
66
|
}
|
|
59
67
|
/** List of the sent share invitations */
|
|
60
68
|
export interface SentShareInvitationListOutput {
|
|
61
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* The Url of next result page.
|
|
71
|
+
*
|
|
72
|
+
* Value may contain a URL
|
|
73
|
+
*/
|
|
62
74
|
nextLink?: string;
|
|
63
75
|
/** Collection of items of type SentShareInvitation */
|
|
64
76
|
value: Array<SentShareInvitationOutput>;
|
|
@@ -69,7 +81,11 @@ export interface SentShareInvitationOutputParent extends ProxyResourceOutput {
|
|
|
69
81
|
}
|
|
70
82
|
/** A page of ShareResource results. */
|
|
71
83
|
export interface ShareResourceListOutput {
|
|
72
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* The Url of next result page.
|
|
86
|
+
*
|
|
87
|
+
* Value may contain a URL
|
|
88
|
+
*/
|
|
73
89
|
nextLink?: string;
|
|
74
90
|
/** Collection of items of type ShareResource */
|
|
75
91
|
value: Array<ShareResourceOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAGA,6CAA6C;AAC7C,MAAM,WAAW,yBAA0B,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AC3E,uCAAuC;AACvC,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A received share data transfer object. */\nexport interface ReceivedShareOutputParent extends ProxyResourceOutput {\n shareKind: \"ReceivedShare\" | \"InPlace\";\n}\n\n/** Base data transfer object implementation for proxy resources. */\nexport interface ProxyResourceOutput {\n /** The unique id of the resource. */\n readonly id?: string;\n /** Type of the resource. */\n readonly type?: string;\n}\n\n/** The purview share error model. */\nexport interface PurviewShareErrorOutput {\n /** The purview share error body model. */\n error: PurviewShareErrorInfoOutput;\n}\n\n/** The purview share error body model. */\nexport interface PurviewShareErrorInfoOutput {\n /** Code of the error */\n code: string;\n /** Nested details of the error model */\n details?: Array<PurviewShareErrorInfoOutput>;\n /** Message of the error */\n message: string;\n /** Target of the error */\n target?: string;\n}\n\n/** Response for long running operation. */\nexport interface OperationResponseOutput {\n /** End time of the long running operation. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n endTime?: string;\n /** The purview share error body model. */\n error?: PurviewShareErrorInfoOutput;\n /** Job id of the long running operation */\n id?: string;\n /** Start time of the long running operation. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n startTime?: string;\n /** States for long running operations. */\n status: \"Running\" | \"TransientFailure\" | \"Succeeded\" | \"Failed\" | \"NotStarted\";\n}\n\n/** List of received shares. */\nexport interface ReceivedShareListOutput {\n /** The Url of next result page. */\n nextLink?: string;\n /** Collection of items of type ReceivedShare */\n value: Array<ReceivedShareOutput>;\n}\n\n/** List of sent shares. */\nexport interface SentShareListOutput {\n /** The Url of next result page. */\n nextLink?: string;\n /** Collection of items of type SentShare */\n value: Array<SentShareOutput>;\n}\n\n/** A sent share data transfer object. */\nexport interface SentShareOutputParent extends ProxyResourceOutput {\n shareKind: \"SentShare\" | \"InPlace\";\n}\n\n/** List of the sent share invitations */\nexport interface SentShareInvitationListOutput {\n /** The Url of next result page. */\n nextLink?: string;\n /** Collection of items of type SentShareInvitation */\n value: Array<SentShareInvitationOutput>;\n}\n\n/** A sent share invitation data transfer object. */\nexport interface SentShareInvitationOutputParent extends ProxyResourceOutput {\n invitationKind: \"SentShareInvitation\" | \"Service\" | \"User\";\n}\n\n/** A page of ShareResource results. */\nexport interface ShareResourceListOutput {\n /** The Url of next result page. */\n nextLink?: string;\n /** Collection of items of type ShareResource */\n value: Array<ShareResourceOutput>;\n}\n\n/** A share resource. */\nexport interface ShareResourceOutput extends ProxyResourceOutput {\n /** A count of Received Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */\n receivedSharesCount?: number;\n /** A count of Sent Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */\n sentSharesCount?: number;\n /** The types of asset. */\n storeKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** A Store Reference for an artifact or sink. */\n storeReference?: StoreReferenceOutput;\n}\n\n/** A Store Reference for an artifact or sink. */\nexport interface StoreReferenceOutput {\n /** Reference name for resource associated with the sink or artifact. */\n referenceName?: string;\n /** Defines the type of resource being shared */\n type?: \"ArmResourceReference\";\n}\n\n/** A tenant email registration data transfer object. */\nexport interface TenantEmailRegistrationOutput extends ProxyResourceOutput {\n /** Tenant email registration property bag. */\n properties?: TenantEmailRegistrationPropertiesOutput;\n}\n\n/** Tenant email registration property bag. */\nexport interface TenantEmailRegistrationPropertiesOutput {\n /** Activation code for the registration. */\n activationCode: string;\n /** Date of the activation expiration. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly activationExpiration?: string;\n /** The email to register. */\n readonly email?: string;\n /** Defines the supported types for registration. */\n readonly registrationStatus?: \"ActivationPending\" | \"Activated\" | \"ActivationAttemptsExhausted\";\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n /** The tenant id to register. */\n readonly tenantId?: string;\n}\n\n/** AdlsGen2 Sink */\nexport interface AdlsGen2AccountSinkOutput extends SinkOutputParent {\n /** Properties for AdlsGen2 storage account */\n properties: AdlsGen2AccountSinkPropertiesOutput;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for AdlsGen2 storage account */\nexport interface AdlsGen2AccountSinkPropertiesOutput {\n /** Adls Gen 2 Container Name */\n containerName: string;\n /** Adls Gen 2 Folder */\n folder: string;\n /** Adls Gen 2 Location */\n readonly location?: string;\n /** Adls Gen 2 Mount Path */\n mountPath?: string;\n}\n\n/** Holds details on the destination of the mapped artifact */\nexport interface SinkOutputParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReferenceOutput;\n storeKind: \"Sink\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** An Adls Gen2 storage account artifact. */\nexport interface AdlsGen2ArtifactOutput extends ArtifactOutputParent {\n /** Properties for Adls Gen2 storage account. */\n properties: AdlsGen2ArtifactPropertiesOutput;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for Adls Gen2 storage account. */\nexport interface AdlsGen2ArtifactPropertiesOutput {\n /** Location of the storage account. */\n readonly location?: string;\n /** A list of Adls Gen2 storage account paths. */\n paths: Array<StorageAccountPathOutput>;\n}\n\n/** Defines a single StorageAccountPath path */\nexport interface StorageAccountPathOutput {\n /** Gets or sets the container name */\n containerName: string;\n /** Gets or sets the path on the receiver side where the artifact is to be mapped */\n receiverPath?: string;\n /** Gets or sets the path to file/folder within the container to be shared */\n senderPath?: string;\n}\n\n/** A class for sent share artifact. */\nexport interface ArtifactOutputParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReferenceOutput;\n storeKind: \"Artifact\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** Blob Sink */\nexport interface BlobAccountSinkOutput extends SinkOutputParent {\n /** Properties for blob storage account */\n properties: BlobAccountSinkPropertiesOutput;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account */\nexport interface BlobAccountSinkPropertiesOutput {\n /** Blob Container Name */\n containerName: string;\n /** Blob Folder */\n folder: string;\n /** Blob Location */\n readonly location?: string;\n /** Blob Mount Path */\n mountPath?: string;\n}\n\n/** Blob storage account artifact. */\nexport interface BlobStorageArtifactOutput extends ArtifactOutputParent {\n /** Properties for blob storage account. */\n properties: BlobStorageArtifactPropertiesOutput;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account. */\nexport interface BlobStorageArtifactPropertiesOutput {\n /** Location of the storage account. */\n readonly location?: string;\n /** A list of blob storage account paths. */\n paths: Array<StorageAccountPathOutput>;\n}\n\n/** An InPlace received share kind. */\nexport interface InPlaceReceivedShareOutput extends ReceivedShareOutputParent {\n /** Properties of in place received share. */\n properties: InPlaceReceivedSharePropertiesOutput;\n shareKind: \"InPlace\";\n}\n\n/** Properties of in place received share. */\nexport interface InPlaceReceivedSharePropertiesOutput {\n /** Location of the shared Asset. */\n readonly assetLocation?: string;\n /** The types of asset. */\n assetStoreKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** Time at which the received share was created. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly createdAt?: string;\n /** Received Share Name */\n displayName?: string;\n /** The expiration date of the received share. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly expirationDate?: string;\n /** Email of the user/receiver who received the sent share invitation */\n readonly receiverEmail?: string;\n /** Name of the user/receiver who received the sent share invitation */\n readonly receiverName?: string;\n /** Tenant name of the user/receiver who received the sent share invitation */\n readonly receiverTenantName?: string;\n /** Email of the sender who created the sent share invitation */\n readonly senderEmail?: string;\n /** Name of the sender who created the sent share invitation */\n readonly senderName?: string;\n /** Tenant name of the sender who created the sent share invitation */\n readonly senderTenantName?: string;\n /** Share description. */\n readonly sentShareDescription?: string;\n /** Time at which the sent share was shared. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly sharedAt?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** Holds details on the destination of the mapped artifact */\n sink?: SinkOutput;\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n}\n\n/** An InPlace share kind. */\nexport interface InPlaceSentShareOutput extends SentShareOutputParent {\n /** Properties for InPlace sent share. */\n properties: InPlaceSentSharePropertiesOutput;\n shareKind: \"InPlace\";\n}\n\n/** Properties for InPlace sent share. */\nexport interface InPlaceSentSharePropertiesOutput {\n /** A class for sent share artifact. */\n artifact: ArtifactOutput;\n /** Time at which the sent share was created. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly createdAt?: string;\n /** List of shares on which the sent share depends. */\n readonly dependsOn?: Array<string>;\n /** Sent share description. */\n description?: string;\n /** The name of the sent share */\n displayName: string;\n /** Email of the sender who created the sent share. */\n readonly senderEmail?: string;\n /** Name of the sender who created the sent share. */\n readonly senderName?: string;\n /** Tenant name of the sender who created the sent share. */\n readonly senderTenantName?: string;\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n}\n\n/** An service invitation kind. */\nexport interface ServiceInvitationOutput extends SentShareInvitationOutputParent {\n /** Properties of the service invitation type. */\n properties: ServiceInvitationPropertiesOutput;\n invitationKind: \"Service\";\n}\n\n/** Properties of the service invitation type. */\nexport interface ServiceInvitationPropertiesOutput {\n /** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n expirationDate?: string;\n /** Email address of the sender. */\n readonly senderEmail?: string;\n /** Name of the sender */\n readonly senderName?: string;\n /** Tenant name of the sender */\n readonly senderTenantName?: string;\n /** Gets the time at which the invitation was sent. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly sentAt?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n /**\n * The target azure active directory id the invitation is sent to.\n *\n * Value may contain a UUID\n */\n targetActiveDirectoryId: string;\n /**\n * The target object id in the azure active directory the invitation is sent to.\n *\n * Value may contain a UUID\n */\n targetObjectId: string;\n}\n\n/** A user invitation kind. */\nexport interface UserInvitationOutput extends SentShareInvitationOutputParent {\n /** Properties of the user invitation type. */\n properties: UserInvitationPropertiesOutput;\n invitationKind: \"User\";\n}\n\n/** Properties of the user invitation type. */\nexport interface UserInvitationPropertiesOutput {\n /** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n expirationDate?: string;\n /** Whether or not the recipient was notified via email. */\n notify?: boolean;\n /** Email address of the sender. */\n readonly senderEmail?: string;\n /** Name of the sender */\n readonly senderName?: string;\n /** Tenant name of the sender */\n readonly senderTenantName?: string;\n /** Gets the time at which the invitation was sent. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly sentAt?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n /** The receiver email for the invitation is being sent. */\n targetEmail: string;\n}\n\n/** A received share data transfer object. */\nexport type ReceivedShareOutput = InPlaceReceivedShareOutput;\n/** A sent share data transfer object. */\nexport type SentShareOutput = InPlaceSentShareOutput;\n/** A sent share invitation data transfer object. */\nexport type SentShareInvitationOutput = ServiceInvitationOutput | UserInvitationOutput;\n/** Holds details on the destination of the mapped artifact */\nexport type SinkOutput = AdlsGen2AccountSinkOutput | BlobAccountSinkOutput;\n/** A class for sent share artifact. */\nexport type ArtifactOutput = AdlsGen2ArtifactOutput | BlobStorageArtifactOutput;\n"]}
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A received share data transfer object. */\nexport interface ReceivedShareOutputParent extends ProxyResourceOutput {\n shareKind: \"ReceivedShare\" | \"InPlace\";\n}\n\n/** Base data transfer object implementation for proxy resources. */\nexport interface ProxyResourceOutput {\n /** The unique id of the resource. */\n readonly id?: string;\n /** Type of the resource. */\n readonly type?: string;\n}\n\n/** The purview share error model. */\nexport interface PurviewShareErrorOutput {\n /** The purview share error body model. */\n error: PurviewShareErrorInfoOutput;\n}\n\n/** The purview share error body model. */\nexport interface PurviewShareErrorInfoOutput {\n /** Code of the error */\n code: string;\n /** Nested details of the error model */\n details?: Array<PurviewShareErrorInfoOutput>;\n /** Message of the error */\n message: string;\n /** Target of the error */\n target?: string;\n}\n\n/** Response for long running operation. */\nexport interface OperationResponseOutput {\n /** End time of the long running operation. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n endTime?: string;\n /** The purview share error body model. */\n error?: PurviewShareErrorInfoOutput;\n /** Job id of the long running operation */\n id?: string;\n /** Start time of the long running operation. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n startTime?: string;\n /** States for long running operations. */\n status: \"Running\" | \"TransientFailure\" | \"Succeeded\" | \"Failed\" | \"NotStarted\";\n}\n\n/** List of received shares. */\nexport interface ReceivedShareListOutput {\n /**\n * The Url of next result page.\n *\n * Value may contain a URL\n */\n nextLink?: string;\n /** Collection of items of type ReceivedShare */\n value: Array<ReceivedShareOutput>;\n}\n\n/** List of sent shares. */\nexport interface SentShareListOutput {\n /**\n * The Url of next result page.\n *\n * Value may contain a URL\n */\n nextLink?: string;\n /** Collection of items of type SentShare */\n value: Array<SentShareOutput>;\n}\n\n/** A sent share data transfer object. */\nexport interface SentShareOutputParent extends ProxyResourceOutput {\n shareKind: \"SentShare\" | \"InPlace\";\n}\n\n/** List of the sent share invitations */\nexport interface SentShareInvitationListOutput {\n /**\n * The Url of next result page.\n *\n * Value may contain a URL\n */\n nextLink?: string;\n /** Collection of items of type SentShareInvitation */\n value: Array<SentShareInvitationOutput>;\n}\n\n/** A sent share invitation data transfer object. */\nexport interface SentShareInvitationOutputParent extends ProxyResourceOutput {\n invitationKind: \"SentShareInvitation\" | \"Service\" | \"User\";\n}\n\n/** A page of ShareResource results. */\nexport interface ShareResourceListOutput {\n /**\n * The Url of next result page.\n *\n * Value may contain a URL\n */\n nextLink?: string;\n /** Collection of items of type ShareResource */\n value: Array<ShareResourceOutput>;\n}\n\n/** A share resource. */\nexport interface ShareResourceOutput extends ProxyResourceOutput {\n /** A count of Received Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */\n receivedSharesCount?: number;\n /** A count of Sent Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */\n sentSharesCount?: number;\n /** The types of asset. */\n storeKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** A Store Reference for an artifact or sink. */\n storeReference?: StoreReferenceOutput;\n}\n\n/** A Store Reference for an artifact or sink. */\nexport interface StoreReferenceOutput {\n /** Reference name for resource associated with the sink or artifact. */\n referenceName?: string;\n /** Defines the type of resource being shared */\n type?: \"ArmResourceReference\";\n}\n\n/** A tenant email registration data transfer object. */\nexport interface TenantEmailRegistrationOutput extends ProxyResourceOutput {\n /** Tenant email registration property bag. */\n properties?: TenantEmailRegistrationPropertiesOutput;\n}\n\n/** Tenant email registration property bag. */\nexport interface TenantEmailRegistrationPropertiesOutput {\n /** Activation code for the registration. */\n activationCode: string;\n /** Date of the activation expiration. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly activationExpiration?: string;\n /** The email to register. */\n readonly email?: string;\n /** Defines the supported types for registration. */\n readonly registrationStatus?: \"ActivationPending\" | \"Activated\" | \"ActivationAttemptsExhausted\";\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n /** The tenant id to register. */\n readonly tenantId?: string;\n}\n\n/** AdlsGen2 Sink */\nexport interface AdlsGen2AccountSinkOutput extends SinkOutputParent {\n /** Properties for AdlsGen2 storage account */\n properties: AdlsGen2AccountSinkPropertiesOutput;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for AdlsGen2 storage account */\nexport interface AdlsGen2AccountSinkPropertiesOutput {\n /** Adls Gen 2 Container Name */\n containerName: string;\n /** Adls Gen 2 Folder */\n folder: string;\n /** Adls Gen 2 Location */\n readonly location?: string;\n /** Adls Gen 2 Mount Path */\n mountPath?: string;\n}\n\n/** Holds details on the destination of the mapped artifact */\nexport interface SinkOutputParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReferenceOutput;\n storeKind: \"Sink\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** An Adls Gen2 storage account artifact. */\nexport interface AdlsGen2ArtifactOutput extends ArtifactOutputParent {\n /** Properties for Adls Gen2 storage account. */\n properties: AdlsGen2ArtifactPropertiesOutput;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for Adls Gen2 storage account. */\nexport interface AdlsGen2ArtifactPropertiesOutput {\n /** Location of the storage account. */\n readonly location?: string;\n /** A list of Adls Gen2 storage account paths. */\n paths: Array<StorageAccountPathOutput>;\n}\n\n/** Defines a single StorageAccountPath path */\nexport interface StorageAccountPathOutput {\n /** Gets or sets the container name */\n containerName: string;\n /** Gets or sets the path on the receiver side where the artifact is to be mapped */\n receiverPath?: string;\n /** Gets or sets the path to file/folder within the container to be shared */\n senderPath?: string;\n}\n\n/** A class for sent share artifact. */\nexport interface ArtifactOutputParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReferenceOutput;\n storeKind: \"Artifact\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** Blob Sink */\nexport interface BlobAccountSinkOutput extends SinkOutputParent {\n /** Properties for blob storage account */\n properties: BlobAccountSinkPropertiesOutput;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account */\nexport interface BlobAccountSinkPropertiesOutput {\n /** Blob Container Name */\n containerName: string;\n /** Blob Folder */\n folder: string;\n /** Blob Location */\n readonly location?: string;\n /** Blob Mount Path */\n mountPath?: string;\n}\n\n/** Blob storage account artifact. */\nexport interface BlobStorageArtifactOutput extends ArtifactOutputParent {\n /** Properties for blob storage account. */\n properties: BlobStorageArtifactPropertiesOutput;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account. */\nexport interface BlobStorageArtifactPropertiesOutput {\n /** Location of the storage account. */\n readonly location?: string;\n /** A list of blob storage account paths. */\n paths: Array<StorageAccountPathOutput>;\n}\n\n/** An InPlace received share kind. */\nexport interface InPlaceReceivedShareOutput extends ReceivedShareOutputParent {\n /** Properties of in place received share. */\n properties: InPlaceReceivedSharePropertiesOutput;\n shareKind: \"InPlace\";\n}\n\n/** Properties of in place received share. */\nexport interface InPlaceReceivedSharePropertiesOutput {\n /** Location of the shared Asset. */\n readonly assetLocation?: string;\n /** The types of asset. */\n assetStoreKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** Time at which the received share was created. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly createdAt?: string;\n /** Received Share Name */\n displayName?: string;\n /** The expiration date of the received share. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly expirationDate?: string;\n /** Email of the user/receiver who received the sent share invitation */\n readonly receiverEmail?: string;\n /** Name of the user/receiver who received the sent share invitation */\n readonly receiverName?: string;\n /** Tenant name of the user/receiver who received the sent share invitation */\n readonly receiverTenantName?: string;\n /** Email of the sender who created the sent share invitation */\n readonly senderEmail?: string;\n /** Name of the sender who created the sent share invitation */\n readonly senderName?: string;\n /** Tenant name of the sender who created the sent share invitation */\n readonly senderTenantName?: string;\n /** Share description. */\n readonly sentShareDescription?: string;\n /** Time at which the sent share was shared. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly sharedAt?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** Holds details on the destination of the mapped artifact */\n sink?: SinkOutput;\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n}\n\n/** An InPlace share kind. */\nexport interface InPlaceSentShareOutput extends SentShareOutputParent {\n /** Properties for InPlace sent share. */\n properties: InPlaceSentSharePropertiesOutput;\n shareKind: \"InPlace\";\n}\n\n/** Properties for InPlace sent share. */\nexport interface InPlaceSentSharePropertiesOutput {\n /** A class for sent share artifact. */\n artifact: ArtifactOutput;\n /** Time at which the sent share was created. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly createdAt?: string;\n /** List of shares on which the sent share depends. */\n readonly dependsOn?: Array<string>;\n /** Sent share description. */\n description?: string;\n /** The name of the sent share */\n displayName: string;\n /** Email of the sender who created the sent share. */\n readonly senderEmail?: string;\n /** Name of the sender who created the sent share. */\n readonly senderName?: string;\n /** Tenant name of the sender who created the sent share. */\n readonly senderTenantName?: string;\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n}\n\n/** An service invitation kind. */\nexport interface ServiceInvitationOutput extends SentShareInvitationOutputParent {\n /** Properties of the service invitation type. */\n properties: ServiceInvitationPropertiesOutput;\n invitationKind: \"Service\";\n}\n\n/** Properties of the service invitation type. */\nexport interface ServiceInvitationPropertiesOutput {\n /** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n expirationDate?: string;\n /** Email address of the sender. */\n readonly senderEmail?: string;\n /** Name of the sender */\n readonly senderName?: string;\n /** Tenant name of the sender */\n readonly senderTenantName?: string;\n /** Gets the time at which the invitation was sent. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly sentAt?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n /**\n * The target azure active directory id the invitation is sent to.\n *\n * Value may contain a UUID\n */\n targetActiveDirectoryId: string;\n /**\n * The target object id in the azure active directory the invitation is sent to.\n *\n * Value may contain a UUID\n */\n targetObjectId: string;\n}\n\n/** A user invitation kind. */\nexport interface UserInvitationOutput extends SentShareInvitationOutputParent {\n /** Properties of the user invitation type. */\n properties: UserInvitationPropertiesOutput;\n invitationKind: \"User\";\n}\n\n/** Properties of the user invitation type. */\nexport interface UserInvitationPropertiesOutput {\n /** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n expirationDate?: string;\n /** Whether or not the recipient was notified via email. */\n notify?: boolean;\n /** Email address of the sender. */\n readonly senderEmail?: string;\n /** Name of the sender */\n readonly senderName?: string;\n /** Tenant name of the sender */\n readonly senderTenantName?: string;\n /** Gets the time at which the invitation was sent. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n readonly sentAt?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** State of the resource */\n readonly state?: \"Unknown\" | \"Succeeded\" | \"Creating\" | \"Deleting\" | \"Moving\" | \"Failed\";\n /** The receiver email for the invitation is being sent. */\n targetEmail: string;\n}\n\n/** A received share data transfer object. */\nexport type ReceivedShareOutput = InPlaceReceivedShareOutput;\n/** A sent share data transfer object. */\nexport type SentShareOutput = InPlaceSentShareOutput;\n/** A sent share invitation data transfer object. */\nexport type SentShareInvitationOutput = ServiceInvitationOutput | UserInvitationOutput;\n/** Holds details on the destination of the mapped artifact */\nexport type SinkOutput = AdlsGen2AccountSinkOutput | BlobAccountSinkOutput;\n/** A class for sent share artifact. */\nexport type ArtifactOutput = AdlsGen2ArtifactOutput | BlobStorageArtifactOutput;\n"]}
|
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
import type { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
2
1
|
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* An interface that tracks the settings for paged iteration
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* The token that keeps track of where to continue the iterator
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
13
|
+
*/
|
|
14
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
15
|
+
/**
|
|
16
|
+
* The next method, part of the iteration protocol
|
|
17
|
+
*/
|
|
18
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
21
|
+
*/
|
|
22
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
23
|
+
/**
|
|
24
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
25
|
+
*/
|
|
26
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
27
|
+
}
|
|
3
28
|
/**
|
|
4
29
|
* Helper type to extract the type of an array
|
|
5
30
|
*/
|
|
@@ -7,7 +32,7 @@ export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
|
|
|
7
32
|
/**
|
|
8
33
|
* The type of a custom function that defines how to get a page and a link to the next one if any.
|
|
9
34
|
*/
|
|
10
|
-
export type GetPage<TPage> = (pageLink: string
|
|
35
|
+
export type GetPage<TPage> = (pageLink: string) => Promise<{
|
|
11
36
|
page: TPage;
|
|
12
37
|
nextPageLink?: string;
|
|
13
38
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAuF7E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B,CACzC,QAAQ,EACR,KAAK,GAAG,QAAQ,EAAE,EAClB,aAAa,GAAG,YAAY;IAE5B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C;;OAEG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,0BAA0B,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IACrF;;OAEG;IACH,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,aAAa,KAAK,qBAAqB,CAAC,KAAK,CAAC,CAAC;CACpE;AAyBD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;CACtD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,IAAI,OAAO,SAAS;IACpD,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;KAAE,CAAC;CAC/B,GACG,YAAY,CAAC,KAAK,CAAC,GACnB,KAAK,CAAC,OAAO,CAAC,CAAC;AAEnB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,SAAS,qBAAqB,EAC9D,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,SAAS,EAC1B,OAAO,GAAE,aAAa,CAAC,SAAS,CAAM,GACrC,0BAA0B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA0BvD"}
|
|
@@ -1,7 +1,104 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
3
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
4
4
|
import { createRestError } from "@azure-rest/core-client";
|
|
5
|
+
/**
|
|
6
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
7
|
+
* method that returns pages of items at once.
|
|
8
|
+
*
|
|
9
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
10
|
+
* @returns a paged async iterator that iterates over results.
|
|
11
|
+
*/
|
|
12
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
13
|
+
var _a;
|
|
14
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
15
|
+
return {
|
|
16
|
+
next() {
|
|
17
|
+
return iter.next();
|
|
18
|
+
},
|
|
19
|
+
[Symbol.asyncIterator]() {
|
|
20
|
+
return this;
|
|
21
|
+
},
|
|
22
|
+
byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
|
|
23
|
+
const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
|
|
24
|
+
return getPageAsyncIterator(pagedResult, {
|
|
25
|
+
pageLink: continuationToken,
|
|
26
|
+
});
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function getItemAsyncIterator(pagedResult) {
|
|
31
|
+
return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
|
|
32
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
|
33
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
34
|
+
const firstVal = yield __await(pages.next());
|
|
35
|
+
// if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
|
|
36
|
+
if (!Array.isArray(firstVal.value)) {
|
|
37
|
+
// can extract elements from this page
|
|
38
|
+
const { toElements } = pagedResult;
|
|
39
|
+
if (toElements) {
|
|
40
|
+
yield __await(yield* __asyncDelegator(__asyncValues(toElements(firstVal.value))));
|
|
41
|
+
try {
|
|
42
|
+
for (var _g = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _g = true) {
|
|
43
|
+
_c = pages_1_1.value;
|
|
44
|
+
_g = false;
|
|
45
|
+
const page = _c;
|
|
46
|
+
yield __await(yield* __asyncDelegator(__asyncValues(toElements(page))));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
50
|
+
finally {
|
|
51
|
+
try {
|
|
52
|
+
if (!_g && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
|
|
53
|
+
}
|
|
54
|
+
finally { if (e_1) throw e_1.error; }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
yield yield __await(firstVal.value);
|
|
59
|
+
// `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
|
|
60
|
+
yield __await(yield* __asyncDelegator(__asyncValues(pages)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
yield __await(yield* __asyncDelegator(__asyncValues(firstVal.value)));
|
|
65
|
+
try {
|
|
66
|
+
for (var _h = true, pages_2 = __asyncValues(pages), pages_2_1; pages_2_1 = yield __await(pages_2.next()), _d = pages_2_1.done, !_d; _h = true) {
|
|
67
|
+
_f = pages_2_1.value;
|
|
68
|
+
_h = false;
|
|
69
|
+
const page = _f;
|
|
70
|
+
// pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
|
|
71
|
+
// it must be the case that `TPage = TElement[]`
|
|
72
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
if (!_h && !_d && (_e = pages_2.return)) yield __await(_e.call(pages_2));
|
|
79
|
+
}
|
|
80
|
+
finally { if (e_2) throw e_2.error; }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function getPageAsyncIterator(pagedResult_1) {
|
|
86
|
+
return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
|
|
87
|
+
const { pageLink } = options;
|
|
88
|
+
let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
|
|
89
|
+
if (!response) {
|
|
90
|
+
return yield __await(void 0);
|
|
91
|
+
}
|
|
92
|
+
yield yield __await(response.page);
|
|
93
|
+
while (response.nextPageLink) {
|
|
94
|
+
response = yield __await(pagedResult.getPage(response.nextPageLink));
|
|
95
|
+
if (!response) {
|
|
96
|
+
return yield __await(void 0);
|
|
97
|
+
}
|
|
98
|
+
yield yield __await(response.page);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
5
102
|
/**
|
|
6
103
|
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
7
104
|
* @param client - Client to use for sending the next page requests
|