@azure-rest/purview-sharing 1.0.0-beta.1 → 1.0.0-beta.3

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 (207) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +2 -2
  3. package/dist/browser/clientDefinitions.d.ts +87 -0
  4. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  5. package/dist/browser/clientDefinitions.js +4 -0
  6. package/dist/browser/clientDefinitions.js.map +1 -0
  7. package/dist/browser/index.d.ts +12 -0
  8. package/dist/browser/index.d.ts.map +1 -0
  9. package/dist/browser/index.js +15 -0
  10. package/dist/browser/index.js.map +1 -0
  11. package/dist/browser/isUnexpected.d.ts +19 -0
  12. package/dist/browser/isUnexpected.d.ts.map +1 -0
  13. package/{dist-esm/src → dist/browser}/isUnexpected.js +2 -1
  14. package/dist/browser/isUnexpected.js.map +1 -0
  15. package/dist/browser/logger.d.ts +2 -0
  16. package/dist/browser/logger.d.ts.map +1 -0
  17. package/dist/browser/logger.js +5 -0
  18. package/dist/browser/logger.js.map +1 -0
  19. package/dist/browser/models.d.ts +201 -0
  20. package/dist/browser/models.d.ts.map +1 -0
  21. package/dist/browser/models.js +4 -0
  22. package/dist/browser/models.js.map +1 -0
  23. package/dist/browser/outputModels.d.ts +352 -0
  24. package/dist/browser/outputModels.d.ts.map +1 -0
  25. package/dist/browser/outputModels.js +4 -0
  26. package/dist/browser/outputModels.js.map +1 -0
  27. package/dist/browser/package.json +3 -0
  28. package/dist/browser/paginateHelper.d.ts +68 -0
  29. package/dist/browser/paginateHelper.d.ts.map +1 -0
  30. package/dist/browser/paginateHelper.js +167 -0
  31. package/dist/browser/paginateHelper.js.map +1 -0
  32. package/dist/browser/parameters.d.ts +123 -0
  33. package/dist/browser/parameters.d.ts.map +1 -0
  34. package/dist/browser/parameters.js +4 -0
  35. package/dist/browser/parameters.js.map +1 -0
  36. package/dist/browser/pollingHelper.d.ts +76 -0
  37. package/dist/browser/pollingHelper.d.ts.map +1 -0
  38. package/dist/browser/pollingHelper.js +104 -0
  39. package/dist/browser/pollingHelper.js.map +1 -0
  40. package/dist/browser/purviewSharing.d.ts +16 -0
  41. package/dist/browser/purviewSharing.d.ts.map +1 -0
  42. package/dist/browser/purviewSharing.js +43 -0
  43. package/dist/browser/purviewSharing.js.map +1 -0
  44. package/dist/browser/responses.d.ts +304 -0
  45. package/dist/browser/responses.d.ts.map +1 -0
  46. package/dist/browser/responses.js +4 -0
  47. package/dist/browser/responses.js.map +1 -0
  48. package/dist/commonjs/clientDefinitions.d.ts +87 -0
  49. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  50. package/dist/commonjs/clientDefinitions.js +5 -0
  51. package/dist/commonjs/clientDefinitions.js.map +1 -0
  52. package/dist/commonjs/index.d.ts +12 -0
  53. package/dist/commonjs/index.d.ts.map +1 -0
  54. package/dist/commonjs/index.js +18 -0
  55. package/dist/commonjs/index.js.map +1 -0
  56. package/dist/commonjs/isUnexpected.d.ts +19 -0
  57. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  58. package/dist/commonjs/isUnexpected.js +89 -0
  59. package/dist/commonjs/isUnexpected.js.map +1 -0
  60. package/dist/commonjs/logger.d.ts +2 -0
  61. package/dist/commonjs/logger.d.ts.map +1 -0
  62. package/dist/commonjs/logger.js +8 -0
  63. package/dist/commonjs/logger.js.map +1 -0
  64. package/dist/commonjs/models.d.ts +201 -0
  65. package/dist/commonjs/models.d.ts.map +1 -0
  66. package/dist/commonjs/models.js +5 -0
  67. package/dist/commonjs/models.js.map +1 -0
  68. package/dist/commonjs/outputModels.d.ts +352 -0
  69. package/dist/commonjs/outputModels.d.ts.map +1 -0
  70. package/dist/commonjs/outputModels.js +5 -0
  71. package/dist/commonjs/outputModels.js.map +1 -0
  72. package/dist/commonjs/package.json +3 -0
  73. package/dist/commonjs/paginateHelper.d.ts +68 -0
  74. package/dist/commonjs/paginateHelper.d.ts.map +1 -0
  75. package/dist/commonjs/paginateHelper.js +170 -0
  76. package/dist/commonjs/paginateHelper.js.map +1 -0
  77. package/dist/commonjs/parameters.d.ts +123 -0
  78. package/dist/commonjs/parameters.d.ts.map +1 -0
  79. package/dist/commonjs/parameters.js +5 -0
  80. package/dist/commonjs/parameters.js.map +1 -0
  81. package/dist/commonjs/pollingHelper.d.ts +76 -0
  82. package/dist/commonjs/pollingHelper.d.ts.map +1 -0
  83. package/dist/commonjs/pollingHelper.js +107 -0
  84. package/dist/commonjs/pollingHelper.js.map +1 -0
  85. package/dist/commonjs/purviewSharing.d.ts +16 -0
  86. package/dist/commonjs/purviewSharing.d.ts.map +1 -0
  87. package/dist/commonjs/purviewSharing.js +46 -0
  88. package/dist/commonjs/purviewSharing.js.map +1 -0
  89. package/dist/commonjs/responses.d.ts +304 -0
  90. package/dist/commonjs/responses.d.ts.map +1 -0
  91. package/dist/commonjs/responses.js +5 -0
  92. package/dist/commonjs/responses.js.map +1 -0
  93. package/dist/commonjs/tsdoc-metadata.json +11 -0
  94. package/dist/esm/clientDefinitions.d.ts +87 -0
  95. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  96. package/dist/esm/clientDefinitions.js +4 -0
  97. package/dist/esm/clientDefinitions.js.map +1 -0
  98. package/dist/esm/index.d.ts +12 -0
  99. package/dist/esm/index.d.ts.map +1 -0
  100. package/dist/esm/index.js +15 -0
  101. package/dist/esm/index.js.map +1 -0
  102. package/dist/esm/isUnexpected.d.ts +19 -0
  103. package/dist/esm/isUnexpected.d.ts.map +1 -0
  104. package/dist/esm/isUnexpected.js +86 -0
  105. package/dist/esm/isUnexpected.js.map +1 -0
  106. package/dist/esm/logger.d.ts +2 -0
  107. package/dist/esm/logger.d.ts.map +1 -0
  108. package/dist/esm/logger.js +5 -0
  109. package/dist/esm/logger.js.map +1 -0
  110. package/dist/esm/models.d.ts +201 -0
  111. package/dist/esm/models.d.ts.map +1 -0
  112. package/dist/esm/models.js +4 -0
  113. package/dist/esm/models.js.map +1 -0
  114. package/dist/esm/outputModels.d.ts +352 -0
  115. package/dist/esm/outputModels.d.ts.map +1 -0
  116. package/dist/esm/outputModels.js +4 -0
  117. package/dist/esm/outputModels.js.map +1 -0
  118. package/dist/esm/package.json +3 -0
  119. package/dist/esm/paginateHelper.d.ts +68 -0
  120. package/dist/esm/paginateHelper.d.ts.map +1 -0
  121. package/dist/esm/paginateHelper.js +167 -0
  122. package/dist/esm/paginateHelper.js.map +1 -0
  123. package/dist/esm/parameters.d.ts +123 -0
  124. package/dist/esm/parameters.d.ts.map +1 -0
  125. package/dist/esm/parameters.js +4 -0
  126. package/dist/esm/parameters.js.map +1 -0
  127. package/dist/esm/pollingHelper.d.ts +76 -0
  128. package/dist/esm/pollingHelper.d.ts.map +1 -0
  129. package/dist/esm/pollingHelper.js +104 -0
  130. package/dist/esm/pollingHelper.js.map +1 -0
  131. package/dist/esm/purviewSharing.d.ts +16 -0
  132. package/dist/esm/purviewSharing.d.ts.map +1 -0
  133. package/dist/esm/purviewSharing.js +43 -0
  134. package/dist/esm/purviewSharing.js.map +1 -0
  135. package/dist/esm/responses.d.ts +304 -0
  136. package/dist/esm/responses.d.ts.map +1 -0
  137. package/dist/esm/responses.js +4 -0
  138. package/dist/esm/responses.js.map +1 -0
  139. package/dist/react-native/clientDefinitions.d.ts +87 -0
  140. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  141. package/dist/react-native/clientDefinitions.js +4 -0
  142. package/dist/react-native/clientDefinitions.js.map +1 -0
  143. package/dist/react-native/index.d.ts +12 -0
  144. package/dist/react-native/index.d.ts.map +1 -0
  145. package/dist/react-native/index.js +15 -0
  146. package/dist/react-native/index.js.map +1 -0
  147. package/dist/react-native/isUnexpected.d.ts +19 -0
  148. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  149. package/dist/react-native/isUnexpected.js +86 -0
  150. package/dist/react-native/isUnexpected.js.map +1 -0
  151. package/dist/react-native/logger.d.ts +2 -0
  152. package/dist/react-native/logger.d.ts.map +1 -0
  153. package/dist/react-native/logger.js +5 -0
  154. package/dist/react-native/logger.js.map +1 -0
  155. package/dist/react-native/models.d.ts +201 -0
  156. package/dist/react-native/models.d.ts.map +1 -0
  157. package/dist/react-native/models.js +4 -0
  158. package/dist/react-native/models.js.map +1 -0
  159. package/dist/react-native/outputModels.d.ts +352 -0
  160. package/dist/react-native/outputModels.d.ts.map +1 -0
  161. package/dist/react-native/outputModels.js +4 -0
  162. package/dist/react-native/outputModels.js.map +1 -0
  163. package/dist/react-native/package.json +3 -0
  164. package/dist/react-native/paginateHelper.d.ts +68 -0
  165. package/dist/react-native/paginateHelper.d.ts.map +1 -0
  166. package/dist/react-native/paginateHelper.js +167 -0
  167. package/dist/react-native/paginateHelper.js.map +1 -0
  168. package/dist/react-native/parameters.d.ts +123 -0
  169. package/dist/react-native/parameters.d.ts.map +1 -0
  170. package/dist/react-native/parameters.js +4 -0
  171. package/dist/react-native/parameters.js.map +1 -0
  172. package/dist/react-native/pollingHelper.d.ts +76 -0
  173. package/dist/react-native/pollingHelper.d.ts.map +1 -0
  174. package/dist/react-native/pollingHelper.js +104 -0
  175. package/dist/react-native/pollingHelper.js.map +1 -0
  176. package/dist/react-native/purviewSharing.d.ts +16 -0
  177. package/dist/react-native/purviewSharing.d.ts.map +1 -0
  178. package/dist/react-native/purviewSharing.js +43 -0
  179. package/dist/react-native/purviewSharing.js.map +1 -0
  180. package/dist/react-native/responses.d.ts +304 -0
  181. package/dist/react-native/responses.d.ts.map +1 -0
  182. package/dist/react-native/responses.js +4 -0
  183. package/dist/react-native/responses.js.map +1 -0
  184. package/package.json +83 -69
  185. package/dist/index.js +0 -240
  186. package/dist/index.js.map +0 -1
  187. package/dist-esm/src/clientDefinitions.js +0 -4
  188. package/dist-esm/src/clientDefinitions.js.map +0 -1
  189. package/dist-esm/src/index.js +0 -14
  190. package/dist-esm/src/index.js.map +0 -1
  191. package/dist-esm/src/isUnexpected.js.map +0 -1
  192. package/dist-esm/src/models.js +0 -4
  193. package/dist-esm/src/models.js.map +0 -1
  194. package/dist-esm/src/outputModels.js +0 -4
  195. package/dist-esm/src/outputModels.js.map +0 -1
  196. package/dist-esm/src/paginateHelper.js +0 -70
  197. package/dist-esm/src/paginateHelper.js.map +0 -1
  198. package/dist-esm/src/parameters.js +0 -4
  199. package/dist-esm/src/parameters.js.map +0 -1
  200. package/dist-esm/src/pollingHelper.js +0 -50
  201. package/dist-esm/src/pollingHelper.js.map +0 -1
  202. package/dist-esm/src/purviewSharing.js +0 -27
  203. package/dist-esm/src/purviewSharing.js.map +0 -1
  204. package/dist-esm/src/responses.js +0 -4
  205. package/dist-esm/src/responses.js.map +0 -1
  206. package/review/purview-sharing.api.md +0 -1234
  207. package/types/purview-sharing.d.ts +0 -1270
package/dist/index.js DELETED
@@ -1,240 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var coreClient = require('@azure-rest/core-client');
6
- var corePaging = require('@azure/core-paging');
7
- var coreLro = require('@azure/core-lro');
8
-
9
- // Copyright (c) Microsoft Corporation.
10
- /**
11
- * Initialize a new instance of `PurviewSharingClient`
12
- * @param endpoint type: string, The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share
13
- * @param credentials type: TokenCredential, uniquely identify client credential
14
- * @param options type: ClientOptions, the parameter for all optional parameters
15
- */
16
- function createClient(endpoint, credentials, options = {}) {
17
- var _a, _b;
18
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}`;
19
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2023-02-15-preview";
20
- options = Object.assign(Object.assign({}, options), { credentials: {
21
- scopes: ["https://purview.azure.net/.default"],
22
- } });
23
- const userAgentInfo = `azsdk-js-purview-sharing-rest/1.0.0-beta.1`;
24
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
25
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
26
- : `${userAgentInfo}`;
27
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
28
- userAgentPrefix,
29
- } });
30
- const client = coreClient.getClient(baseUrl, credentials, options);
31
- return client;
32
- }
33
-
34
- // Copyright (c) Microsoft Corporation.
35
- // Licensed under the MIT license.
36
- const responseMap = {
37
- "GET /receivedShares/{receivedShareId}": ["200"],
38
- "PUT /receivedShares/{receivedShareId}": ["200", "201"],
39
- "DELETE /receivedShares/{receivedShareId}": ["202"],
40
- "GET /receivedShares/attached": ["200"],
41
- "GET /receivedShares/detached": ["200"],
42
- "POST /emails:activate": ["200"],
43
- "POST /emails:register": ["200"],
44
- "GET /sentShares": ["200"],
45
- "GET /sentShares/{sentShareId}": ["200"],
46
- "PUT /sentShares/{sentShareId}": ["200", "201"],
47
- "DELETE /sentShares/{sentShareId}": ["202"],
48
- "GET /sentShares/{sentShareId}/sentShareInvitations": ["200"],
49
- "GET /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}": ["200"],
50
- "PUT /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}": ["201"],
51
- "DELETE /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}": ["202"],
52
- "POST /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}:notify": ["200"],
53
- };
54
- function isUnexpected(response) {
55
- const lroOriginal = response.headers["x-ms-original-url"];
56
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
57
- const method = response.request.method;
58
- let pathDetails = responseMap[`${method} ${url.pathname}`];
59
- if (!pathDetails) {
60
- pathDetails = getParametrizedPathSuccess(method, url.pathname);
61
- }
62
- return !pathDetails.includes(response.status);
63
- }
64
- function getParametrizedPathSuccess(method, path) {
65
- var _a, _b, _c, _d;
66
- const pathParts = path.split("/");
67
- // Traverse list to match the longest candidate
68
- // matchedLen: the length of candidate path
69
- // matchedValue: the matched status code array
70
- let matchedLen = -1, matchedValue = [];
71
- // Iterate the responseMap to find a match
72
- for (const [key, value] of Object.entries(responseMap)) {
73
- // Extracting the path from the map key which is in format
74
- // GET /path/foo
75
- if (!key.startsWith(method)) {
76
- continue;
77
- }
78
- const candidatePath = getPathFromMapKey(key);
79
- // Get each part of the url path
80
- const candidateParts = candidatePath.split("/");
81
- // track if we have found a match to return the values found.
82
- let found = true;
83
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
84
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
85
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
86
- // If the current part of the candidate is a "template" part
87
- // Try to use the suffix of pattern to match the path
88
- // {guid} ==> $
89
- // {guid}:export ==> :export$
90
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
91
- if (!isMatched) {
92
- found = false;
93
- break;
94
- }
95
- continue;
96
- }
97
- // If the candidate part is not a template and
98
- // the parts don't match mark the candidate as not found
99
- // to move on with the next candidate path.
100
- if (candidateParts[i] !== pathParts[j]) {
101
- found = false;
102
- break;
103
- }
104
- }
105
- // We finished evaluating the current candidate parts
106
- // Update the matched value if and only if we found the longer pattern
107
- if (found && candidatePath.length > matchedLen) {
108
- matchedLen = candidatePath.length;
109
- matchedValue = value;
110
- }
111
- }
112
- return matchedValue;
113
- }
114
- function getPathFromMapKey(mapKey) {
115
- const pathStart = mapKey.indexOf("/");
116
- return mapKey.slice(pathStart);
117
- }
118
-
119
- // Copyright (c) Microsoft Corporation.
120
- /**
121
- * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
122
- * @param client - Client to use for sending the next page requests
123
- * @param initialResponse - Initial response containing the nextLink and current page of elements
124
- * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
125
- * @returns - PagedAsyncIterableIterator to iterate the elements
126
- */
127
- function paginate(client, initialResponse, options = {}) {
128
- let firstRun = true;
129
- const itemName = "value";
130
- const nextLinkName = "nextLink";
131
- const { customGetPage } = options;
132
- const pagedResult = {
133
- firstPageLink: "",
134
- getPage: typeof customGetPage === "function"
135
- ? customGetPage
136
- : async (pageLink) => {
137
- const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
138
- firstRun = false;
139
- checkPagingRequest(result);
140
- const nextLink = getNextLink(result.body, nextLinkName);
141
- const values = getElements(result.body, itemName);
142
- return {
143
- page: values,
144
- nextPageLink: nextLink,
145
- };
146
- },
147
- };
148
- return corePaging.getPagedAsyncIterator(pagedResult);
149
- }
150
- /**
151
- * Gets for the value of nextLink in the body
152
- */
153
- function getNextLink(body, nextLinkName) {
154
- if (!nextLinkName) {
155
- return undefined;
156
- }
157
- const nextLink = body[nextLinkName];
158
- if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
159
- throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
160
- }
161
- return nextLink;
162
- }
163
- /**
164
- * Gets the elements of the current request in the body.
165
- */
166
- function getElements(body, itemName) {
167
- const value = body[itemName];
168
- // value has to be an array according to the x-ms-pageable extension.
169
- // The fact that this must be an array is used above to calculate the
170
- // type of elements in the page in PaginateReturn
171
- if (!Array.isArray(value)) {
172
- throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
173
- }
174
- return value !== null && value !== void 0 ? value : [];
175
- }
176
- /**
177
- * Checks if a request failed
178
- */
179
- function checkPagingRequest(response) {
180
- const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
181
- if (!Http2xxStatusCodes.includes(response.status)) {
182
- throw coreClient.createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
183
- }
184
- }
185
-
186
- // Copyright (c) Microsoft Corporation.
187
- /**
188
- * Helper function that builds a Poller object to help polling a long running operation.
189
- * @param client - Client to use for sending the request to get additional pages.
190
- * @param initialResponse - The initial response.
191
- * @param options - Options to set a resume state or custom polling interval.
192
- * @returns - A poller object to poll for operation state updates and eventually get the final response.
193
- */
194
- async function getLongRunningPoller(client, initialResponse, options = {}) {
195
- var _a;
196
- const poller = {
197
- requestMethod: initialResponse.request.method,
198
- requestPath: initialResponse.request.url,
199
- sendInitialRequest: async () => {
200
- // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
201
- // we are not triggering the initial request here, just extracting the information from the
202
- // response we were provided.
203
- return getLroResponse(initialResponse);
204
- },
205
- sendPollRequest: async (path) => {
206
- // This is the callback that is going to be called to poll the service
207
- // to get the latest status. We use the client provided and the polling path
208
- // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
209
- // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
210
- const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
211
- const lroResponse = getLroResponse(response);
212
- lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
213
- return lroResponse;
214
- },
215
- };
216
- options.resolveOnUnsuccessful = (_a = options.resolveOnUnsuccessful) !== null && _a !== void 0 ? _a : true;
217
- return coreLro.createHttpPoller(poller, options);
218
- }
219
- /**
220
- * Converts a Rest Client response to a response that the LRO implementation understands
221
- * @param response - a rest client http response
222
- * @returns - An LRO response that the LRO implementation understands
223
- */
224
- function getLroResponse(response) {
225
- if (Number.isNaN(response.status)) {
226
- throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
227
- }
228
- return {
229
- flatResponse: response,
230
- rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
231
- };
232
- }
233
-
234
- // Copyright (c) Microsoft Corporation.
235
-
236
- exports["default"] = createClient;
237
- exports.getLongRunningPoller = getLongRunningPoller;
238
- exports.isUnexpected = isUnexpected;
239
- exports.paginate = paginate;
240
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/purviewSharing.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/pollingHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { PurviewSharingClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `PurviewSharingClient`\n * @param endpoint type: string, The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share\n * @param credentials type: TokenCredential, uniquely identify client credential\n * @param options type: ClientOptions, the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): PurviewSharingClient {\n const baseUrl = options.baseUrl ?? `${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2023-02-15-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-purview-sharing-rest/1.0.0-beta.1`;\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 };\n\n const client = getClient(baseUrl, credentials, options) as PurviewSharingClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ReceivedSharesGetReceivedShare200Response,\n ReceivedSharesGetReceivedShareDefaultResponse,\n ReceivedSharesCreateOrReplace200Response,\n ReceivedSharesCreateOrReplace201Response,\n ReceivedSharesCreateOrReplaceDefaultResponse,\n ReceivedSharesDeleteReceivedShare202Response,\n ReceivedSharesDeleteReceivedShareDefaultResponse,\n ReceivedSharesGetAllAttachedReceivedShares200Response,\n ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse,\n ReceivedSharesGetAllDetachedReceivedShares200Response,\n ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse,\n ReceivedSharesActivateTenantEmailRegistration200Response,\n ReceivedSharesActivateTenantEmailRegistrationDefaultResponse,\n ReceivedSharesRegisterTenantEmailRegistration200Response,\n ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse,\n SentSharesGetAllSentShares200Response,\n SentSharesGetAllSentSharesDefaultResponse,\n SentSharesGetSentShare200Response,\n SentSharesGetSentShareDefaultResponse,\n SentSharesCreateOrReplace200Response,\n SentSharesCreateOrReplace201Response,\n SentSharesCreateOrReplaceDefaultResponse,\n SentSharesDeleteSentShare202Response,\n SentSharesDeleteSentShareDefaultResponse,\n SentSharesGetAllSentShareInvitations200Response,\n SentSharesGetAllSentShareInvitationsDefaultResponse,\n SentSharesGetSentShareInvitation200Response,\n SentSharesGetSentShareInvitationDefaultResponse,\n SentSharesCreateSentShareInvitation201Response,\n SentSharesCreateSentShareInvitationDefaultResponse,\n SentSharesDeleteSentShareInvitation202Response,\n SentSharesDeleteSentShareInvitationDefaultResponse,\n SentSharesNotifyUserSentShareInvitation200Response,\n SentSharesNotifyUserSentShareInvitationDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /receivedShares/{receivedShareId}\": [\"200\"],\n \"PUT /receivedShares/{receivedShareId}\": [\"200\", \"201\"],\n \"DELETE /receivedShares/{receivedShareId}\": [\"202\"],\n \"GET /receivedShares/attached\": [\"200\"],\n \"GET /receivedShares/detached\": [\"200\"],\n \"POST /emails:activate\": [\"200\"],\n \"POST /emails:register\": [\"200\"],\n \"GET /sentShares\": [\"200\"],\n \"GET /sentShares/{sentShareId}\": [\"200\"],\n \"PUT /sentShares/{sentShareId}\": [\"200\", \"201\"],\n \"DELETE /sentShares/{sentShareId}\": [\"202\"],\n \"GET /sentShares/{sentShareId}/sentShareInvitations\": [\"200\"],\n \"GET /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"200\"],\n \"PUT /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"201\"],\n \"DELETE /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"202\"],\n \"POST /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}:notify\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | ReceivedSharesGetReceivedShare200Response\n | ReceivedSharesGetReceivedShareDefaultResponse\n): response is ReceivedSharesGetReceivedShareDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse\n): response is ReceivedSharesCreateOrReplaceDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesDeleteReceivedShare202Response\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n): response is ReceivedSharesDeleteReceivedShareDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n): response is ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n): response is ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n): response is ReceivedSharesActivateTenantEmailRegistrationDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n): response is ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse;\nexport function isUnexpected(\n response: SentSharesGetAllSentShares200Response | SentSharesGetAllSentSharesDefaultResponse\n): response is SentSharesGetAllSentSharesDefaultResponse;\nexport function isUnexpected(\n response: SentSharesGetSentShare200Response | SentSharesGetSentShareDefaultResponse\n): response is SentSharesGetSentShareDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse\n): response is SentSharesCreateOrReplaceDefaultResponse;\nexport function isUnexpected(\n response: SentSharesDeleteSentShare202Response | SentSharesDeleteSentShareDefaultResponse\n): response is SentSharesDeleteSentShareDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n): response is SentSharesGetAllSentShareInvitationsDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesGetSentShareInvitation200Response\n | SentSharesGetSentShareInvitationDefaultResponse\n): response is SentSharesGetSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse\n): response is SentSharesCreateSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse\n): response is SentSharesDeleteSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n): response is SentSharesNotifyUserSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetReceivedShare200Response\n | ReceivedSharesGetReceivedShareDefaultResponse\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse\n | ReceivedSharesDeleteReceivedShare202Response\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n | SentSharesGetAllSentShares200Response\n | SentSharesGetAllSentSharesDefaultResponse\n | SentSharesGetSentShare200Response\n | SentSharesGetSentShareDefaultResponse\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse\n | SentSharesDeleteSentShare202Response\n | SentSharesDeleteSentShareDefaultResponse\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n | SentSharesGetSentShareInvitation200Response\n | SentSharesGetSentShareInvitationDefaultResponse\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n): response is\n | ReceivedSharesGetReceivedShareDefaultResponse\n | ReceivedSharesCreateOrReplaceDefaultResponse\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n | SentSharesGetAllSentSharesDefaultResponse\n | SentSharesGetSentShareDefaultResponse\n | SentSharesCreateOrReplaceDefaultResponse\n | SentSharesDeleteSentShareDefaultResponse\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n | SentSharesGetSentShareInvitationDefaultResponse\n | SentSharesCreateSentShareInvitationDefaultResponse\n | SentSharesDeleteSentShareInvitationDefaultResponse\n | SentSharesNotifyUserSentShareInvitationDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\"\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n CreateHttpPollerOptions,\n LongRunningOperation,\n LroResponse,\n OperationState,\n SimplePollerLike,\n createHttpPoller,\n} from \"@azure/core-lro\";\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 poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\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) => {\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 const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\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 return createHttpPoller(poller, options);\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>(response: TResult): LroResponse<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","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport PurviewSharing from \"./purviewSharing\";\n\nexport * from \"./purviewSharing\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default PurviewSharing;\n"],"names":["getClient","getPagedAsyncIterator","createRestError","createHttpPoller"],"mappings":";;;;;;;;AAAA;AAOA;;;;;AAKG;AACW,S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,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AACvF,YAAA,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;AACxD,YAAA,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;AACnF,YAAA,OAAO,WAAW,CAAC;SACpB;KACF,CAAC;IAEF,OAAO,CAAC,qBAAqB,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,qBAAqB,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,IAAI,CAAC;AACtE,IAAA,OAAOC,wBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;;;AAIG;AACH,SAAS,cAAc,CAA+B,QAAiB,EAAA;IACrE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,CAAA,oDAAA,EAAuD,QAAQ,CAAC,MAAM,CAAE,CAAA,CAAC,CAAC;AAC/F,KAAA;IAED,OAAO;AACL,QAAA,YAAY,EAAE,QAAQ;AACtB,QAAA,WAAW,kCACN,QAAQ,CAAA,EAAA,EACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,EACpB,CAAA;KACF,CAAC;AACJ;;ACnEA;;;;;;;"}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=clientDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ReceivedSharesGetReceivedShareParameters,\n ReceivedSharesCreateOrReplaceParameters,\n ReceivedSharesDeleteReceivedShareParameters,\n ReceivedSharesGetAllAttachedReceivedSharesParameters,\n ReceivedSharesGetAllDetachedReceivedSharesParameters,\n ReceivedSharesActivateTenantEmailRegistrationParameters,\n ReceivedSharesRegisterTenantEmailRegistrationParameters,\n SentSharesGetAllSentSharesParameters,\n SentSharesGetSentShareParameters,\n SentSharesCreateOrReplaceParameters,\n SentSharesDeleteSentShareParameters,\n SentSharesGetAllSentShareInvitationsParameters,\n SentSharesGetSentShareInvitationParameters,\n SentSharesCreateSentShareInvitationParameters,\n SentSharesDeleteSentShareInvitationParameters,\n SentSharesNotifyUserSentShareInvitationParameters,\n} from \"./parameters\";\nimport {\n ReceivedSharesGetReceivedShare200Response,\n ReceivedSharesGetReceivedShareDefaultResponse,\n ReceivedSharesCreateOrReplace200Response,\n ReceivedSharesCreateOrReplace201Response,\n ReceivedSharesCreateOrReplaceDefaultResponse,\n ReceivedSharesDeleteReceivedShare202Response,\n ReceivedSharesDeleteReceivedShareDefaultResponse,\n ReceivedSharesGetAllAttachedReceivedShares200Response,\n ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse,\n ReceivedSharesGetAllDetachedReceivedShares200Response,\n ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse,\n ReceivedSharesActivateTenantEmailRegistration200Response,\n ReceivedSharesActivateTenantEmailRegistrationDefaultResponse,\n ReceivedSharesRegisterTenantEmailRegistration200Response,\n ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse,\n SentSharesGetAllSentShares200Response,\n SentSharesGetAllSentSharesDefaultResponse,\n SentSharesGetSentShare200Response,\n SentSharesGetSentShareDefaultResponse,\n SentSharesCreateOrReplace200Response,\n SentSharesCreateOrReplace201Response,\n SentSharesCreateOrReplaceDefaultResponse,\n SentSharesDeleteSentShare202Response,\n SentSharesDeleteSentShareDefaultResponse,\n SentSharesGetAllSentShareInvitations200Response,\n SentSharesGetAllSentShareInvitationsDefaultResponse,\n SentSharesGetSentShareInvitation200Response,\n SentSharesGetSentShareInvitationDefaultResponse,\n SentSharesCreateSentShareInvitation201Response,\n SentSharesCreateSentShareInvitationDefaultResponse,\n SentSharesDeleteSentShareInvitation202Response,\n SentSharesDeleteSentShareInvitationDefaultResponse,\n SentSharesNotifyUserSentShareInvitation200Response,\n SentSharesNotifyUserSentShareInvitationDefaultResponse,\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ReceivedSharesGetReceivedShare {\n /** Get a received share */\n get(\n options?: ReceivedSharesGetReceivedShareParameters\n ): StreamableMethod<\n ReceivedSharesGetReceivedShare200Response | ReceivedSharesGetReceivedShareDefaultResponse\n >;\n /** Update changes to a received share */\n put(\n options: ReceivedSharesCreateOrReplaceParameters\n ): StreamableMethod<\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse\n >;\n /** Delete a received share */\n delete(\n options?: ReceivedSharesDeleteReceivedShareParameters\n ): StreamableMethod<\n ReceivedSharesDeleteReceivedShare202Response | ReceivedSharesDeleteReceivedShareDefaultResponse\n >;\n}\n\nexport interface ReceivedSharesGetAllAttachedReceivedShares {\n /** List attached received shares */\n get(\n options: ReceivedSharesGetAllAttachedReceivedSharesParameters\n ): StreamableMethod<\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n >;\n}\n\nexport interface ReceivedSharesGetAllDetachedReceivedShares {\n /** List detached received shares */\n get(\n options?: ReceivedSharesGetAllDetachedReceivedSharesParameters\n ): StreamableMethod<\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n >;\n}\n\nexport interface ReceivedSharesActivateTenantEmailRegistration {\n /** Activates the email registration for current tenant */\n post(\n options: ReceivedSharesActivateTenantEmailRegistrationParameters\n ): StreamableMethod<\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n >;\n}\n\nexport interface ReceivedSharesRegisterTenantEmailRegistration {\n /** Register an email for the current tenant */\n post(\n options?: ReceivedSharesRegisterTenantEmailRegistrationParameters\n ): StreamableMethod<\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n >;\n}\n\nexport interface SentSharesGetAllSentShares {\n /** List sent shares */\n get(\n options: SentSharesGetAllSentSharesParameters\n ): StreamableMethod<\n SentSharesGetAllSentShares200Response | SentSharesGetAllSentSharesDefaultResponse\n >;\n}\n\nexport interface SentSharesGetSentShare {\n /** Get a sent share */\n get(\n options?: SentSharesGetSentShareParameters\n ): StreamableMethod<SentSharesGetSentShare200Response | SentSharesGetSentShareDefaultResponse>;\n /** Create or replace a sent share */\n put(\n options: SentSharesCreateOrReplaceParameters\n ): StreamableMethod<\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse\n >;\n /** Delete a sent share */\n delete(\n options?: SentSharesDeleteSentShareParameters\n ): StreamableMethod<\n SentSharesDeleteSentShare202Response | SentSharesDeleteSentShareDefaultResponse\n >;\n}\n\nexport interface SentSharesGetAllSentShareInvitations {\n /** List sent share recipients */\n get(\n options?: SentSharesGetAllSentShareInvitationsParameters\n ): StreamableMethod<\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n >;\n}\n\nexport interface SentSharesGetSentShareInvitation {\n /** Get recipient for a given sent share */\n get(\n options?: SentSharesGetSentShareInvitationParameters\n ): StreamableMethod<\n SentSharesGetSentShareInvitation200Response | SentSharesGetSentShareInvitationDefaultResponse\n >;\n /** Create a recipient for a given sent share */\n put(\n options: SentSharesCreateSentShareInvitationParameters\n ): StreamableMethod<\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse\n >;\n /** Delete a sent share invitation */\n delete(\n options?: SentSharesDeleteSentShareInvitationParameters\n ): StreamableMethod<\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse\n >;\n}\n\nexport interface SentSharesNotifyUserSentShareInvitation {\n /** Notifies the user recipient of the sent share invitation, does not apply to service invitations. */\n post(\n options?: SentSharesNotifyUserSentShareInvitationParameters\n ): StreamableMethod<\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/receivedShares/\\{receivedShareId\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/receivedShares/{receivedShareId}\",\n receivedShareId: string\n ): ReceivedSharesGetReceivedShare;\n /** Resource for '/receivedShares/attached' has methods for the following verbs: get */\n (path: \"/receivedShares/attached\"): ReceivedSharesGetAllAttachedReceivedShares;\n /** Resource for '/receivedShares/detached' has methods for the following verbs: get */\n (path: \"/receivedShares/detached\"): ReceivedSharesGetAllDetachedReceivedShares;\n /** Resource for '/emails:activate' has methods for the following verbs: post */\n (path: \"/emails:activate\"): ReceivedSharesActivateTenantEmailRegistration;\n /** Resource for '/emails:register' has methods for the following verbs: post */\n (path: \"/emails:register\"): ReceivedSharesRegisterTenantEmailRegistration;\n /** Resource for '/sentShares' has methods for the following verbs: get */\n (path: \"/sentShares\"): SentSharesGetAllSentShares;\n /** Resource for '/sentShares/\\{sentShareId\\}' has methods for the following verbs: get, put, delete */\n (path: \"/sentShares/{sentShareId}\", sentShareId: string): SentSharesGetSentShare;\n /** Resource for '/sentShares/\\{sentShareId\\}/sentShareInvitations' has methods for the following verbs: get */\n (\n path: \"/sentShares/{sentShareId}/sentShareInvitations\",\n sentShareId: string\n ): SentSharesGetAllSentShareInvitations;\n /** Resource for '/sentShares/\\{sentShareId\\}/sentShareInvitations/\\{sentShareInvitationId\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\",\n sentShareId: string,\n sentShareInvitationId: string\n ): SentSharesGetSentShareInvitation;\n /** Resource for '/sentShares/\\{sentShareId\\}/sentShareInvitations/\\{sentShareInvitationId\\}:notify' has methods for the following verbs: post */\n (\n path: \"/sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}:notify\",\n sentShareId: string,\n sentShareInvitationId: string\n ): SentSharesNotifyUserSentShareInvitation;\n}\n\nexport type PurviewSharingClient = Client & {\n path: Routes;\n};\n"]}
@@ -1,14 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import PurviewSharing from "./purviewSharing";
4
- export * from "./purviewSharing";
5
- export * from "./parameters";
6
- export * from "./responses";
7
- export * from "./clientDefinitions";
8
- export * from "./isUnexpected";
9
- export * from "./models";
10
- export * from "./outputModels";
11
- export * from "./paginateHelper";
12
- export * from "./pollingHelper";
13
- export default PurviewSharing;
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,eAAe,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport PurviewSharing from \"./purviewSharing\";\n\nexport * from \"./purviewSharing\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default PurviewSharing;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuClC,MAAM,WAAW,GAA6B;IAC5C,uCAAuC,EAAE,CAAC,KAAK,CAAC;IAChD,uCAAuC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACvD,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,uBAAuB,EAAE,CAAC,KAAK,CAAC;IAChC,uBAAuB,EAAE,CAAC,KAAK,CAAC;IAChC,iBAAiB,EAAE,CAAC,KAAK,CAAC;IAC1B,+BAA+B,EAAE,CAAC,KAAK,CAAC;IACxC,+BAA+B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,oDAAoD,EAAE,CAAC,KAAK,CAAC;IAC7D,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,+EAA+E,EAAE,CAAC,KAAK,CAAC;IACxF,oFAAoF,EAAE,CAAC,KAAK,CAAC;CAC9F,CAAC;AA8EF,MAAM,UAAU,YAAY,CAC1B,QAkC0D;IAkB1D,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE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MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE;oBACd,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;gBACD,SAAS;aACV;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;gBACtC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;aACP;SACF;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;YAC9C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;SACtB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ReceivedSharesGetReceivedShare200Response,\n ReceivedSharesGetReceivedShareDefaultResponse,\n ReceivedSharesCreateOrReplace200Response,\n ReceivedSharesCreateOrReplace201Response,\n ReceivedSharesCreateOrReplaceDefaultResponse,\n ReceivedSharesDeleteReceivedShare202Response,\n ReceivedSharesDeleteReceivedShareDefaultResponse,\n ReceivedSharesGetAllAttachedReceivedShares200Response,\n ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse,\n ReceivedSharesGetAllDetachedReceivedShares200Response,\n ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse,\n ReceivedSharesActivateTenantEmailRegistration200Response,\n ReceivedSharesActivateTenantEmailRegistrationDefaultResponse,\n ReceivedSharesRegisterTenantEmailRegistration200Response,\n ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse,\n SentSharesGetAllSentShares200Response,\n SentSharesGetAllSentSharesDefaultResponse,\n SentSharesGetSentShare200Response,\n SentSharesGetSentShareDefaultResponse,\n SentSharesCreateOrReplace200Response,\n SentSharesCreateOrReplace201Response,\n SentSharesCreateOrReplaceDefaultResponse,\n SentSharesDeleteSentShare202Response,\n SentSharesDeleteSentShareDefaultResponse,\n SentSharesGetAllSentShareInvitations200Response,\n SentSharesGetAllSentShareInvitationsDefaultResponse,\n SentSharesGetSentShareInvitation200Response,\n SentSharesGetSentShareInvitationDefaultResponse,\n SentSharesCreateSentShareInvitation201Response,\n SentSharesCreateSentShareInvitationDefaultResponse,\n SentSharesDeleteSentShareInvitation202Response,\n SentSharesDeleteSentShareInvitationDefaultResponse,\n SentSharesNotifyUserSentShareInvitation200Response,\n SentSharesNotifyUserSentShareInvitationDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /receivedShares/{receivedShareId}\": [\"200\"],\n \"PUT /receivedShares/{receivedShareId}\": [\"200\", \"201\"],\n \"DELETE /receivedShares/{receivedShareId}\": [\"202\"],\n \"GET /receivedShares/attached\": [\"200\"],\n \"GET /receivedShares/detached\": [\"200\"],\n \"POST /emails:activate\": [\"200\"],\n \"POST /emails:register\": [\"200\"],\n \"GET /sentShares\": [\"200\"],\n \"GET /sentShares/{sentShareId}\": [\"200\"],\n \"PUT /sentShares/{sentShareId}\": [\"200\", \"201\"],\n \"DELETE /sentShares/{sentShareId}\": [\"202\"],\n \"GET /sentShares/{sentShareId}/sentShareInvitations\": [\"200\"],\n \"GET /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"200\"],\n \"PUT /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"201\"],\n \"DELETE /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"202\"],\n \"POST /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}:notify\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | ReceivedSharesGetReceivedShare200Response\n | ReceivedSharesGetReceivedShareDefaultResponse\n): response is ReceivedSharesGetReceivedShareDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse\n): response is ReceivedSharesCreateOrReplaceDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesDeleteReceivedShare202Response\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n): response is ReceivedSharesDeleteReceivedShareDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n): response is ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n): response is ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n): response is ReceivedSharesActivateTenantEmailRegistrationDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n): response is ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse;\nexport function isUnexpected(\n response: SentSharesGetAllSentShares200Response | SentSharesGetAllSentSharesDefaultResponse\n): response is SentSharesGetAllSentSharesDefaultResponse;\nexport function isUnexpected(\n response: SentSharesGetSentShare200Response | SentSharesGetSentShareDefaultResponse\n): response is SentSharesGetSentShareDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse\n): response is SentSharesCreateOrReplaceDefaultResponse;\nexport function isUnexpected(\n response: SentSharesDeleteSentShare202Response | SentSharesDeleteSentShareDefaultResponse\n): response is SentSharesDeleteSentShareDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n): response is SentSharesGetAllSentShareInvitationsDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesGetSentShareInvitation200Response\n | SentSharesGetSentShareInvitationDefaultResponse\n): response is SentSharesGetSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse\n): response is SentSharesCreateSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse\n): response is SentSharesDeleteSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n): response is SentSharesNotifyUserSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetReceivedShare200Response\n | ReceivedSharesGetReceivedShareDefaultResponse\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse\n | ReceivedSharesDeleteReceivedShare202Response\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n | SentSharesGetAllSentShares200Response\n | SentSharesGetAllSentSharesDefaultResponse\n | SentSharesGetSentShare200Response\n | SentSharesGetSentShareDefaultResponse\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse\n | SentSharesDeleteSentShare202Response\n | SentSharesDeleteSentShareDefaultResponse\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n | SentSharesGetSentShareInvitation200Response\n | SentSharesGetSentShareInvitationDefaultResponse\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n): response is\n | ReceivedSharesGetReceivedShareDefaultResponse\n | ReceivedSharesCreateOrReplaceDefaultResponse\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n | SentSharesGetAllSentSharesDefaultResponse\n | SentSharesGetSentShareDefaultResponse\n | SentSharesCreateOrReplaceDefaultResponse\n | SentSharesDeleteSentShareDefaultResponse\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n | SentSharesGetSentShareInvitationDefaultResponse\n | SentSharesCreateSentShareInvitationDefaultResponse\n | SentSharesDeleteSentShareInvitationDefaultResponse\n | SentSharesNotifyUserSentShareInvitationDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\"\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.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 ReceivedShareParent extends ProxyResource {\n shareKind: \"ReceivedShare\" | \"InPlace\";\n}\n\n/** Base data transfer object implementation for proxy resources. */\nexport interface ProxyResource {}\n\n/** A sent share data transfer object. */\nexport interface SentShareParent extends ProxyResource {\n shareKind: \"SentShare\" | \"InPlace\";\n}\n\n/** A sent share invitation data transfer object. */\nexport interface SentShareInvitationParent extends ProxyResource {\n invitationKind: \"SentShareInvitation\" | \"Service\" | \"User\";\n}\n\n/** A tenant email registration data transfer object. */\nexport interface TenantEmailRegistration extends ProxyResource {\n /** Tenant email registration property bag. */\n properties?: TenantEmailRegistrationProperties;\n}\n\n/** Tenant email registration property bag. */\nexport interface TenantEmailRegistrationProperties {\n /** Activation code for the registration. */\n activationCode: string;\n}\n\n/** AdlsGen2 Sink */\nexport interface AdlsGen2AccountSink extends SinkParent {\n /** Properties for AdlsGen2 storage account */\n properties: AdlsGen2AccountSinkProperties;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for AdlsGen2 storage account */\nexport interface AdlsGen2AccountSinkProperties {\n /** Adls Gen 2 Container Name */\n containerName: string;\n /** Adls Gen 2 Folder */\n folder: string;\n /** Adls Gen 2 Mount Path */\n mountPath?: string;\n}\n\n/** Holds details on the destination of the mapped artifact */\nexport interface SinkParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReference;\n storeKind: \"Sink\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** A Store Reference for an artifact or sink. */\nexport interface StoreReference {\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/** An Adls Gen2 storage account artifact. */\nexport interface AdlsGen2Artifact extends ArtifactParent {\n /** Properties for Adls Gen2 storage account. */\n properties: AdlsGen2ArtifactProperties;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for Adls Gen2 storage account. */\nexport interface AdlsGen2ArtifactProperties {\n /** A list of Adls Gen2 storage account paths. */\n paths: Array<StorageAccountPath>;\n}\n\n/** Defines a single StorageAccountPath path */\nexport interface StorageAccountPath {\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 ArtifactParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReference;\n storeKind: \"Artifact\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** Blob Sink */\nexport interface BlobAccountSink extends SinkParent {\n /** Properties for blob storage account */\n properties: BlobAccountSinkProperties;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account */\nexport interface BlobAccountSinkProperties {\n /** Blob Container Name */\n containerName: string;\n /** Blob Folder */\n folder: string;\n /** Blob Mount Path */\n mountPath?: string;\n}\n\n/** Blob storage account artifact. */\nexport interface BlobStorageArtifact extends ArtifactParent {\n /** Properties for blob storage account. */\n properties: BlobStorageArtifactProperties;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account. */\nexport interface BlobStorageArtifactProperties {\n /** A list of blob storage account paths. */\n paths: Array<StorageAccountPath>;\n}\n\n/** An InPlace received share kind. */\nexport interface InPlaceReceivedShare extends ReceivedShareParent {\n /** Properties of in place received share. */\n properties: InPlaceReceivedShareProperties;\n shareKind: \"InPlace\";\n}\n\n/** Properties of in place received share. */\nexport interface InPlaceReceivedShareProperties {\n /** The types of asset. */\n assetStoreKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** Received Share Name */\n displayName?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** Holds details on the destination of the mapped artifact */\n sink?: Sink;\n}\n\n/** An InPlace share kind. */\nexport interface InPlaceSentShare extends SentShareParent {\n /** Properties for InPlace sent share. */\n properties: InPlaceSentShareProperties;\n shareKind: \"InPlace\";\n}\n\n/** Properties for InPlace sent share. */\nexport interface InPlaceSentShareProperties {\n /** A class for sent share artifact. */\n artifact: Artifact;\n /** Sent share description. */\n description?: string;\n /** The name of the sent share */\n displayName: string;\n}\n\n/** An service invitation kind. */\nexport interface ServiceInvitation extends SentShareInvitationParent {\n /** Properties of the service invitation type. */\n properties: ServiceInvitationProperties;\n invitationKind: \"Service\";\n}\n\n/** Properties of the service invitation type. */\nexport interface ServiceInvitationProperties {\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?: Date | string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\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 UserInvitation extends SentShareInvitationParent {\n /** Properties of the user invitation type. */\n properties: UserInvitationProperties;\n invitationKind: \"User\";\n}\n\n/** Properties of the user invitation type. */\nexport interface UserInvitationProperties {\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?: Date | string;\n /** Whether or not the recipient was notified via email. */\n notify?: boolean;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** The receiver email for the invitation is being sent. */\n targetEmail: string;\n}\n\n/** A received share data transfer object. */\nexport type ReceivedShare = InPlaceReceivedShare;\n/** A sent share data transfer object. */\nexport type SentShare = InPlaceSentShare;\n/** A sent share invitation data transfer object. */\nexport type SentShareInvitation = ServiceInvitation | UserInvitation;\n/** Holds details on the destination of the mapped artifact */\nexport type Sink = AdlsGen2AccountSink | BlobAccountSink;\n/** A class for sent share artifact. */\nexport type Artifact = AdlsGen2Artifact | BlobStorageArtifact;\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=outputModels.js.map
@@ -1 +0,0 @@
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 DataTransferObjects. */\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 DataTransferObjects. */\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 DataTransferObjects. */\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 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/** 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/** 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,70 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { getPagedAsyncIterator } from "@azure/core-paging";
4
- import { createRestError } from "@azure-rest/core-client";
5
- /**
6
- * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
7
- * @param client - Client to use for sending the next page requests
8
- * @param initialResponse - Initial response containing the nextLink and current page of elements
9
- * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
10
- * @returns - PagedAsyncIterableIterator to iterate the elements
11
- */
12
- export function paginate(client, initialResponse, options = {}) {
13
- let firstRun = true;
14
- const itemName = "value";
15
- const nextLinkName = "nextLink";
16
- const { customGetPage } = options;
17
- const pagedResult = {
18
- firstPageLink: "",
19
- getPage: typeof customGetPage === "function"
20
- ? customGetPage
21
- : async (pageLink) => {
22
- const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
23
- firstRun = false;
24
- checkPagingRequest(result);
25
- const nextLink = getNextLink(result.body, nextLinkName);
26
- const values = getElements(result.body, itemName);
27
- return {
28
- page: values,
29
- nextPageLink: nextLink,
30
- };
31
- },
32
- };
33
- return getPagedAsyncIterator(pagedResult);
34
- }
35
- /**
36
- * Gets for the value of nextLink in the body
37
- */
38
- function getNextLink(body, nextLinkName) {
39
- if (!nextLinkName) {
40
- return undefined;
41
- }
42
- const nextLink = body[nextLinkName];
43
- if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
44
- throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
45
- }
46
- return nextLink;
47
- }
48
- /**
49
- * Gets the elements of the current request in the body.
50
- */
51
- function getElements(body, itemName) {
52
- const value = body[itemName];
53
- // value has to be an array according to the x-ms-pageable extension.
54
- // The fact that this must be an array is used above to calculate the
55
- // type of elements in the page in PaginateReturn
56
- if (!Array.isArray(value)) {
57
- throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
58
- }
59
- return value !== null && value !== void 0 ? value : [];
60
- }
61
- /**
62
- * Checks if a request failed
63
- */
64
- function checkPagingRequest(response) {
65
- const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
66
- if (!Http2xxStatusCodes.includes(response.status)) {
67
- throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
68
- }
69
- }
70
- //# sourceMappingURL=paginateHelper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AAyCzF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC;gBACjB,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,WA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gD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=parameters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport { ReceivedShare, TenantEmailRegistration, SentShare, SentShareInvitation } from \"./models\";\n\nexport type ReceivedSharesGetReceivedShareParameters = RequestParameters;\n\nexport interface ReceivedSharesCreateOrReplaceBodyParam {\n /** The received share to create or replace */\n body: ReceivedShare;\n}\n\nexport interface ReceivedSharesCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ReceivedSharesCreateOrReplaceParameters = ReceivedSharesCreateOrReplaceMediaTypesParam &\n ReceivedSharesCreateOrReplaceBodyParam &\n RequestParameters;\nexport type ReceivedSharesDeleteReceivedShareParameters = RequestParameters;\n\nexport interface ReceivedSharesGetAllAttachedReceivedSharesQueryParamProperties {\n /** A name that references a data store. */\n referenceName: string;\n /** The continuation token to list the next page */\n skipToken?: string;\n /** Filters the results using OData syntax */\n filter?: string;\n /** Sorts the results using OData syntax */\n orderby?: string;\n}\n\nexport interface ReceivedSharesGetAllAttachedReceivedSharesQueryParam {\n queryParameters: ReceivedSharesGetAllAttachedReceivedSharesQueryParamProperties;\n}\n\nexport type ReceivedSharesGetAllAttachedReceivedSharesParameters =\n ReceivedSharesGetAllAttachedReceivedSharesQueryParam & RequestParameters;\n\nexport interface ReceivedSharesGetAllDetachedReceivedSharesQueryParamProperties {\n /** The continuation token to list the next page */\n skipToken?: string;\n /** Filters the results using OData syntax */\n filter?: string;\n /** Sorts the results using OData syntax */\n orderby?: string;\n}\n\nexport interface ReceivedSharesGetAllDetachedReceivedSharesQueryParam {\n queryParameters?: ReceivedSharesGetAllDetachedReceivedSharesQueryParamProperties;\n}\n\nexport type ReceivedSharesGetAllDetachedReceivedSharesParameters =\n ReceivedSharesGetAllDetachedReceivedSharesQueryParam & RequestParameters;\n\nexport interface ReceivedSharesActivateTenantEmailRegistrationHeaders {\n /** If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. */\n \"repeatability-request-id\"?: string;\n}\n\nexport interface ReceivedSharesActivateTenantEmailRegistrationBodyParam {\n /** The tenant email registration payload */\n body: TenantEmailRegistration;\n}\n\nexport interface ReceivedSharesActivateTenantEmailRegistrationHeaderParam {\n headers?: RawHttpHeadersInput & ReceivedSharesActivateTenantEmailRegistrationHeaders;\n}\n\nexport interface ReceivedSharesActivateTenantEmailRegistrationMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ReceivedSharesActivateTenantEmailRegistrationParameters =\n ReceivedSharesActivateTenantEmailRegistrationHeaderParam &\n ReceivedSharesActivateTenantEmailRegistrationMediaTypesParam &\n ReceivedSharesActivateTenantEmailRegistrationBodyParam &\n RequestParameters;\n\nexport interface ReceivedSharesRegisterTenantEmailRegistrationHeaders {\n /** If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. */\n \"repeatability-request-id\"?: string;\n}\n\nexport interface ReceivedSharesRegisterTenantEmailRegistrationHeaderParam {\n headers?: RawHttpHeadersInput & ReceivedSharesRegisterTenantEmailRegistrationHeaders;\n}\n\nexport type ReceivedSharesRegisterTenantEmailRegistrationParameters =\n ReceivedSharesRegisterTenantEmailRegistrationHeaderParam & RequestParameters;\n\nexport interface SentSharesGetAllSentSharesQueryParamProperties {\n /** A name that references a data store. */\n referenceName: string;\n /** The continuation token to list the next page */\n skipToken?: string;\n /** Filters the results using OData syntax */\n filter?: string;\n /** Sorts the results using OData syntax */\n orderby?: string;\n}\n\nexport interface SentSharesGetAllSentSharesQueryParam {\n queryParameters: SentSharesGetAllSentSharesQueryParamProperties;\n}\n\nexport type SentSharesGetAllSentSharesParameters = SentSharesGetAllSentSharesQueryParam &\n RequestParameters;\nexport type SentSharesGetSentShareParameters = RequestParameters;\n\nexport interface SentSharesCreateOrReplaceBodyParam {\n /** The sent share to create or replace. */\n body: SentShare;\n}\n\nexport interface SentSharesCreateOrReplaceMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SentSharesCreateOrReplaceParameters = SentSharesCreateOrReplaceMediaTypesParam &\n SentSharesCreateOrReplaceBodyParam &\n RequestParameters;\nexport type SentSharesDeleteSentShareParameters = RequestParameters;\n\nexport interface SentSharesGetAllSentShareInvitationsQueryParamProperties {\n /** The continuation token to list the next page */\n skipToken?: string;\n /** Filters the results using OData syntax */\n filter?: string;\n /** Sorts the results using OData syntax */\n orderby?: string;\n}\n\nexport interface SentSharesGetAllSentShareInvitationsQueryParam {\n queryParameters?: SentSharesGetAllSentShareInvitationsQueryParamProperties;\n}\n\nexport type SentSharesGetAllSentShareInvitationsParameters =\n SentSharesGetAllSentShareInvitationsQueryParam & RequestParameters;\nexport type SentSharesGetSentShareInvitationParameters = RequestParameters;\n\nexport interface SentSharesCreateSentShareInvitationBodyParam {\n /** The sent share invitation to create. */\n body: SentShareInvitation;\n}\n\nexport interface SentSharesCreateSentShareInvitationMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SentSharesCreateSentShareInvitationParameters =\n SentSharesCreateSentShareInvitationMediaTypesParam &\n SentSharesCreateSentShareInvitationBodyParam &\n RequestParameters;\nexport type SentSharesDeleteSentShareInvitationParameters = RequestParameters;\n\nexport interface SentSharesNotifyUserSentShareInvitationHeaders {\n /** If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. */\n \"repeatability-request-id\"?: string;\n}\n\nexport interface SentSharesNotifyUserSentShareInvitationHeaderParam {\n headers?: RawHttpHeadersInput & SentSharesNotifyUserSentShareInvitationHeaders;\n}\n\nexport type SentSharesNotifyUserSentShareInvitationParameters =\n SentSharesNotifyUserSentShareInvitationHeaderParam & RequestParameters;\n"]}