@azure-rest/purview-workflow 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 (187) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +4 -4
  3. package/README.md +65 -92
  4. package/dist/browser/clientDefinitions.d.ts +85 -0
  5. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  6. package/dist/browser/clientDefinitions.js +4 -0
  7. package/dist/browser/clientDefinitions.js.map +1 -0
  8. package/dist/browser/index.d.ts +11 -0
  9. package/dist/browser/index.d.ts.map +1 -0
  10. package/dist/browser/index.js +13 -0
  11. package/dist/browser/index.js.map +1 -0
  12. package/dist/browser/isUnexpected.d.ts +16 -0
  13. package/dist/browser/isUnexpected.d.ts.map +1 -0
  14. package/{dist-esm/src → dist/browser}/isUnexpected.js +5 -6
  15. package/dist/browser/isUnexpected.js.map +1 -0
  16. package/dist/browser/logger.d.ts +2 -0
  17. package/dist/browser/logger.d.ts.map +1 -0
  18. package/dist/browser/logger.js +5 -0
  19. package/dist/browser/logger.js.map +1 -0
  20. package/dist/browser/models.d.ts +70 -0
  21. package/dist/browser/models.d.ts.map +1 -0
  22. package/dist/browser/models.js +4 -0
  23. package/{dist-esm/src → dist/browser}/models.js.map +1 -1
  24. package/dist/browser/outputModels.d.ts +325 -0
  25. package/dist/browser/outputModels.d.ts.map +1 -0
  26. package/dist/browser/outputModels.js +4 -0
  27. package/{dist-esm/src → dist/browser}/outputModels.js.map +1 -1
  28. package/dist/browser/package.json +3 -0
  29. package/dist/browser/paginateHelper.d.ts +68 -0
  30. package/dist/browser/paginateHelper.d.ts.map +1 -0
  31. package/{dist-esm/src → dist/browser}/paginateHelper.js +70 -3
  32. package/dist/browser/paginateHelper.js.map +1 -0
  33. package/dist/browser/parameters.d.ts +109 -0
  34. package/dist/browser/parameters.d.ts.map +1 -0
  35. package/dist/browser/parameters.js +4 -0
  36. package/dist/browser/parameters.js.map +1 -0
  37. package/dist/browser/purviewWorkflow.d.ts +16 -0
  38. package/dist/browser/purviewWorkflow.d.ts.map +1 -0
  39. package/dist/browser/purviewWorkflow.js +45 -0
  40. package/dist/browser/purviewWorkflow.js.map +1 -0
  41. package/dist/browser/responses.d.ts +137 -0
  42. package/dist/browser/responses.d.ts.map +1 -0
  43. package/dist/browser/responses.js +4 -0
  44. package/dist/browser/responses.js.map +1 -0
  45. package/dist/commonjs/clientDefinitions.d.ts +85 -0
  46. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  47. package/dist/commonjs/clientDefinitions.js +5 -0
  48. package/dist/commonjs/clientDefinitions.js.map +1 -0
  49. package/dist/commonjs/index.d.ts +11 -0
  50. package/dist/commonjs/index.d.ts.map +1 -0
  51. package/dist/commonjs/index.js +16 -0
  52. package/dist/commonjs/index.js.map +1 -0
  53. package/dist/commonjs/isUnexpected.d.ts +16 -0
  54. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  55. package/dist/commonjs/isUnexpected.js +85 -0
  56. package/dist/commonjs/isUnexpected.js.map +1 -0
  57. package/dist/commonjs/logger.d.ts +2 -0
  58. package/dist/commonjs/logger.d.ts.map +1 -0
  59. package/dist/commonjs/logger.js +8 -0
  60. package/dist/commonjs/logger.js.map +1 -0
  61. package/dist/commonjs/models.d.ts +70 -0
  62. package/dist/commonjs/models.d.ts.map +1 -0
  63. package/dist/commonjs/models.js +5 -0
  64. package/dist/commonjs/models.js.map +1 -0
  65. package/dist/commonjs/outputModels.d.ts +325 -0
  66. package/dist/commonjs/outputModels.d.ts.map +1 -0
  67. package/dist/commonjs/outputModels.js +5 -0
  68. package/dist/commonjs/outputModels.js.map +1 -0
  69. package/dist/commonjs/package.json +3 -0
  70. package/dist/commonjs/paginateHelper.d.ts +68 -0
  71. package/dist/commonjs/paginateHelper.d.ts.map +1 -0
  72. package/dist/commonjs/paginateHelper.js +140 -0
  73. package/dist/commonjs/paginateHelper.js.map +1 -0
  74. package/dist/commonjs/parameters.d.ts +109 -0
  75. package/dist/commonjs/parameters.d.ts.map +1 -0
  76. package/dist/commonjs/parameters.js +5 -0
  77. package/dist/commonjs/parameters.js.map +1 -0
  78. package/dist/commonjs/purviewWorkflow.d.ts +16 -0
  79. package/dist/commonjs/purviewWorkflow.d.ts.map +1 -0
  80. package/dist/commonjs/purviewWorkflow.js +48 -0
  81. package/dist/commonjs/purviewWorkflow.js.map +1 -0
  82. package/dist/commonjs/responses.d.ts +137 -0
  83. package/dist/commonjs/responses.d.ts.map +1 -0
  84. package/dist/commonjs/responses.js +5 -0
  85. package/dist/commonjs/responses.js.map +1 -0
  86. package/dist/commonjs/tsdoc-metadata.json +11 -0
  87. package/dist/esm/clientDefinitions.d.ts +85 -0
  88. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  89. package/dist/esm/clientDefinitions.js +4 -0
  90. package/dist/esm/clientDefinitions.js.map +1 -0
  91. package/dist/esm/index.d.ts +11 -0
  92. package/dist/esm/index.d.ts.map +1 -0
  93. package/dist/esm/index.js +13 -0
  94. package/dist/esm/index.js.map +1 -0
  95. package/dist/esm/isUnexpected.d.ts +16 -0
  96. package/dist/esm/isUnexpected.d.ts.map +1 -0
  97. package/dist/esm/isUnexpected.js +82 -0
  98. package/dist/esm/isUnexpected.js.map +1 -0
  99. package/dist/esm/logger.d.ts +2 -0
  100. package/dist/esm/logger.d.ts.map +1 -0
  101. package/dist/esm/logger.js +5 -0
  102. package/dist/esm/logger.js.map +1 -0
  103. package/dist/esm/models.d.ts +70 -0
  104. package/dist/esm/models.d.ts.map +1 -0
  105. package/dist/esm/models.js +4 -0
  106. package/dist/esm/models.js.map +1 -0
  107. package/dist/esm/outputModels.d.ts +325 -0
  108. package/dist/esm/outputModels.d.ts.map +1 -0
  109. package/dist/esm/outputModels.js +4 -0
  110. package/dist/esm/outputModels.js.map +1 -0
  111. package/dist/esm/package.json +3 -0
  112. package/dist/esm/paginateHelper.d.ts +68 -0
  113. package/dist/esm/paginateHelper.d.ts.map +1 -0
  114. package/dist/esm/paginateHelper.js +137 -0
  115. package/dist/esm/paginateHelper.js.map +1 -0
  116. package/dist/esm/parameters.d.ts +109 -0
  117. package/dist/esm/parameters.d.ts.map +1 -0
  118. package/dist/esm/parameters.js +4 -0
  119. package/dist/esm/parameters.js.map +1 -0
  120. package/dist/esm/purviewWorkflow.d.ts +16 -0
  121. package/dist/esm/purviewWorkflow.d.ts.map +1 -0
  122. package/dist/esm/purviewWorkflow.js +45 -0
  123. package/dist/esm/purviewWorkflow.js.map +1 -0
  124. package/dist/esm/responses.d.ts +137 -0
  125. package/dist/esm/responses.d.ts.map +1 -0
  126. package/dist/esm/responses.js +4 -0
  127. package/dist/esm/responses.js.map +1 -0
  128. package/dist/react-native/clientDefinitions.d.ts +85 -0
  129. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  130. package/dist/react-native/clientDefinitions.js +4 -0
  131. package/dist/react-native/clientDefinitions.js.map +1 -0
  132. package/dist/react-native/index.d.ts +11 -0
  133. package/dist/react-native/index.d.ts.map +1 -0
  134. package/dist/react-native/index.js +13 -0
  135. package/dist/react-native/index.js.map +1 -0
  136. package/dist/react-native/isUnexpected.d.ts +16 -0
  137. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  138. package/dist/react-native/isUnexpected.js +82 -0
  139. package/dist/react-native/isUnexpected.js.map +1 -0
  140. package/dist/react-native/logger.d.ts +2 -0
  141. package/dist/react-native/logger.d.ts.map +1 -0
  142. package/dist/react-native/logger.js +5 -0
  143. package/dist/react-native/logger.js.map +1 -0
  144. package/dist/react-native/models.d.ts +70 -0
  145. package/dist/react-native/models.d.ts.map +1 -0
  146. package/dist/react-native/models.js +4 -0
  147. package/dist/react-native/models.js.map +1 -0
  148. package/dist/react-native/outputModels.d.ts +325 -0
  149. package/dist/react-native/outputModels.d.ts.map +1 -0
  150. package/dist/react-native/outputModels.js +4 -0
  151. package/dist/react-native/outputModels.js.map +1 -0
  152. package/dist/react-native/package.json +3 -0
  153. package/dist/react-native/paginateHelper.d.ts +68 -0
  154. package/dist/react-native/paginateHelper.d.ts.map +1 -0
  155. package/dist/react-native/paginateHelper.js +137 -0
  156. package/dist/react-native/paginateHelper.js.map +1 -0
  157. package/dist/react-native/parameters.d.ts +109 -0
  158. package/dist/react-native/parameters.d.ts.map +1 -0
  159. package/dist/react-native/parameters.js +4 -0
  160. package/dist/react-native/parameters.js.map +1 -0
  161. package/dist/react-native/purviewWorkflow.d.ts +16 -0
  162. package/dist/react-native/purviewWorkflow.d.ts.map +1 -0
  163. package/dist/react-native/purviewWorkflow.js +45 -0
  164. package/dist/react-native/purviewWorkflow.js.map +1 -0
  165. package/dist/react-native/responses.d.ts +137 -0
  166. package/dist/react-native/responses.d.ts.map +1 -0
  167. package/dist/react-native/responses.js +4 -0
  168. package/dist/react-native/responses.js.map +1 -0
  169. package/package.json +84 -76
  170. package/review/{purview-workflow.api.md → purview-workflow-node.api.md} +26 -20
  171. package/dist/index.js +0 -188
  172. package/dist/index.js.map +0 -1
  173. package/dist-esm/src/clientDefinitions.js +0 -4
  174. package/dist-esm/src/clientDefinitions.js.map +0 -1
  175. package/dist-esm/src/index.js +0 -13
  176. package/dist-esm/src/index.js.map +0 -1
  177. package/dist-esm/src/isUnexpected.js.map +0 -1
  178. package/dist-esm/src/models.js +0 -4
  179. package/dist-esm/src/outputModels.js +0 -4
  180. package/dist-esm/src/paginateHelper.js.map +0 -1
  181. package/dist-esm/src/parameters.js +0 -4
  182. package/dist-esm/src/parameters.js.map +0 -1
  183. package/dist-esm/src/purviewWorkflow.js +0 -27
  184. package/dist-esm/src/purviewWorkflow.js.map +0 -1
  185. package/dist-esm/src/responses.js +0 -4
  186. package/dist-esm/src/responses.js.map +0 -1
  187. package/types/purview-workflow.d.ts +0 -920
@@ -0,0 +1,68 @@
1
+ import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
2
+ /**
3
+ * An interface that tracks the settings for paged iteration
4
+ */
5
+ export interface PageSettings {
6
+ /**
7
+ * The token that keeps track of where to continue the iterator
8
+ */
9
+ continuationToken?: string;
10
+ }
11
+ /**
12
+ * An interface that allows async iterable iteration both to completion and by page.
13
+ */
14
+ export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
15
+ /**
16
+ * The next method, part of the iteration protocol
17
+ */
18
+ next(): Promise<IteratorResult<TElement>>;
19
+ /**
20
+ * The connection to the async iterator, part of the iteration protocol
21
+ */
22
+ [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
23
+ /**
24
+ * Return an AsyncIterableIterator that works a page at a time
25
+ */
26
+ byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
27
+ }
28
+ /**
29
+ * Helper type to extract the type of an array
30
+ */
31
+ export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
32
+ /**
33
+ * The type of a custom function that defines how to get a page and a link to the next one if any.
34
+ */
35
+ export type GetPage<TPage> = (pageLink: string) => Promise<{
36
+ page: TPage;
37
+ nextPageLink?: string;
38
+ }>;
39
+ /**
40
+ * Options for the paging helper
41
+ */
42
+ export interface PagingOptions<TResponse> {
43
+ /**
44
+ * Custom function to extract pagination details for crating the PagedAsyncIterableIterator
45
+ */
46
+ customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
47
+ }
48
+ /**
49
+ * Helper type to infer the Type of the paged elements from the response type
50
+ * This type is generated based on the swagger information for x-ms-pageable
51
+ * specifically on the itemName property which indicates the property of the response
52
+ * where the page items are found. The default value is `value`.
53
+ * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
54
+ */
55
+ export type PaginateReturn<TResult> = TResult extends {
56
+ body: {
57
+ value?: infer TPage;
58
+ };
59
+ } ? GetArrayType<TPage> : Array<unknown>;
60
+ /**
61
+ * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
62
+ * @param client - Client to use for sending the next page requests
63
+ * @param initialResponse - Initial response containing the nextLink and current page of elements
64
+ * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
65
+ * @returns - PagedAsyncIterableIterator to iterate the elements
66
+ */
67
+ export declare function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
68
+ //# sourceMappingURL=paginateHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAuF7E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B,CACzC,QAAQ,EACR,KAAK,GAAG,QAAQ,EAAE,EAClB,aAAa,GAAG,YAAY;IAE5B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C;;OAEG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,0BAA0B,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IACrF;;OAEG;IACH,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,aAAa,KAAK,qBAAqB,CAAC,KAAK,CAAC,CAAC;CACpE;AAyBD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;CACtD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,IAAI,OAAO,SAAS;IACpD,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;KAAE,CAAC;CAC/B,GACG,YAAY,CAAC,KAAK,CAAC,GACnB,KAAK,CAAC,OAAO,CAAC,CAAC;AAEnB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,SAAS,qBAAqB,EAC9D,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,SAAS,EAC1B,OAAO,GAAE,aAAa,CAAC,SAAS,CAAM,GACrC,0BAA0B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA0BvD"}
@@ -0,0 +1,137 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createRestError } from "@azure-rest/core-client";
4
+ /**
5
+ * returns an async iterator that iterates over results. It also has a `byPage`
6
+ * method that returns pages of items at once.
7
+ *
8
+ * @param pagedResult - an object that specifies how to get pages.
9
+ * @returns a paged async iterator that iterates over results.
10
+ */
11
+ function getPagedAsyncIterator(pagedResult) {
12
+ const iter = getItemAsyncIterator(pagedResult);
13
+ return {
14
+ next() {
15
+ return iter.next();
16
+ },
17
+ [Symbol.asyncIterator]() {
18
+ return this;
19
+ },
20
+ byPage: pagedResult?.byPage ??
21
+ ((settings) => {
22
+ const { continuationToken } = settings ?? {};
23
+ return getPageAsyncIterator(pagedResult, {
24
+ pageLink: continuationToken,
25
+ });
26
+ }),
27
+ };
28
+ }
29
+ async function* getItemAsyncIterator(pagedResult) {
30
+ const pages = getPageAsyncIterator(pagedResult);
31
+ const firstVal = await pages.next();
32
+ // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
33
+ if (!Array.isArray(firstVal.value)) {
34
+ // can extract elements from this page
35
+ const { toElements } = pagedResult;
36
+ if (toElements) {
37
+ yield* toElements(firstVal.value);
38
+ for await (const page of pages) {
39
+ yield* toElements(page);
40
+ }
41
+ }
42
+ else {
43
+ yield firstVal.value;
44
+ // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
45
+ yield* pages;
46
+ }
47
+ }
48
+ else {
49
+ yield* firstVal.value;
50
+ for await (const page of pages) {
51
+ // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
52
+ // it must be the case that `TPage = TElement[]`
53
+ yield* page;
54
+ }
55
+ }
56
+ }
57
+ async function* getPageAsyncIterator(pagedResult, options = {}) {
58
+ const { pageLink } = options;
59
+ let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
60
+ if (!response) {
61
+ return;
62
+ }
63
+ yield response.page;
64
+ while (response.nextPageLink) {
65
+ response = await pagedResult.getPage(response.nextPageLink);
66
+ if (!response) {
67
+ return;
68
+ }
69
+ yield response.page;
70
+ }
71
+ }
72
+ /**
73
+ * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
74
+ * @param client - Client to use for sending the next page requests
75
+ * @param initialResponse - Initial response containing the nextLink and current page of elements
76
+ * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
77
+ * @returns - PagedAsyncIterableIterator to iterate the elements
78
+ */
79
+ export function paginate(client, initialResponse, options = {}) {
80
+ let firstRun = true;
81
+ const itemName = "value";
82
+ const nextLinkName = "nextLink";
83
+ const { customGetPage } = options;
84
+ const pagedResult = {
85
+ firstPageLink: "",
86
+ getPage: typeof customGetPage === "function"
87
+ ? customGetPage
88
+ : async (pageLink) => {
89
+ const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
90
+ firstRun = false;
91
+ checkPagingRequest(result);
92
+ const nextLink = getNextLink(result.body, nextLinkName);
93
+ const values = getElements(result.body, itemName);
94
+ return {
95
+ page: values,
96
+ nextPageLink: nextLink,
97
+ };
98
+ },
99
+ };
100
+ return getPagedAsyncIterator(pagedResult);
101
+ }
102
+ /**
103
+ * Gets for the value of nextLink in the body
104
+ */
105
+ function getNextLink(body, nextLinkName) {
106
+ if (!nextLinkName) {
107
+ return undefined;
108
+ }
109
+ const nextLink = body[nextLinkName];
110
+ if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
111
+ throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
112
+ }
113
+ return nextLink;
114
+ }
115
+ /**
116
+ * Gets the elements of the current request in the body.
117
+ */
118
+ function getElements(body, itemName) {
119
+ const value = body[itemName];
120
+ // value has to be an array according to the x-ms-pageable extension.
121
+ // The fact that this must be an array is used above to calculate the
122
+ // type of elements in the page in PaginateReturn
123
+ if (!Array.isArray(value)) {
124
+ throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
125
+ }
126
+ return value ?? [];
127
+ }
128
+ /**
129
+ * Checks if a request failed
130
+ */
131
+ function checkPagingRequest(response) {
132
+ const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
133
+ if (!Http2xxStatusCodes.includes(response.status)) {
134
+ throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
135
+ }
136
+ }
137
+ //# sourceMappingURL=paginateHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;GAMG;AACH,SAAS,qBAAqB,CAM5B,WAAqD;IAErD,MAAM,IAAI,GAAG,oBAAoB,CAAwC,WAAW,CAAC,CAAC;IACtF,OAAO;QACL,IAAI;YACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QACD,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,EACJ,WAAW,EAAE,MAAM;YAClB,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C,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n TLink = string,\n>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n (((settings?: PageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken as unknown as TLink | undefined,\n });\n }) as unknown as (settings?: TPageSettings) => AsyncIterableIterator<TPage>),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = await pages.next();\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield* toElements(firstVal.value) as TElement[];\n for await (const page of pages) {\n yield* toElements(page) as TElement[];\n }\n } else {\n yield firstVal.value;\n // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case\n yield* pages as unknown as AsyncIterableIterator<TElement>;\n }\n } else {\n yield* firstVal.value;\n for await (const page of pages) {\n // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield* page as unknown as TElement[];\n }\n }\n}\n\nasync function* getPageAsyncIterator<TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n options: {\n pageLink?: TLink;\n } = {},\n): AsyncIterableIterator<TPage> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n }\n}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\ninterface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink: TLink) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\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> = (pageLink: string) => 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"]}
@@ -0,0 +1,109 @@
1
+ import type { RequestParameters } from "@azure-rest/core-client";
2
+ import type { WorkflowCreateOrUpdateCommand, UserRequestPayload, WorkflowRunCancelRequest, ApprovalResponseComment, ReassignCommand, TaskUpdateCommand } from "./models.js";
3
+ export type ListWorkflowsParameters = RequestParameters;
4
+ export type GetWorkflowParameters = RequestParameters;
5
+ export interface CreateOrReplaceWorkflowBodyParam {
6
+ /** Create or update workflow payload. */
7
+ body: WorkflowCreateOrUpdateCommand;
8
+ }
9
+ export interface CreateOrReplaceWorkflowMediaTypesParam {
10
+ /** Request content type */
11
+ contentType?: "application/json";
12
+ }
13
+ export type CreateOrReplaceWorkflowParameters = CreateOrReplaceWorkflowMediaTypesParam & CreateOrReplaceWorkflowBodyParam & RequestParameters;
14
+ export type DeleteWorkflowParameters = RequestParameters;
15
+ export interface SubmitUserRequestsBodyParam {
16
+ /** The payload of submitting a user request. */
17
+ body: UserRequestPayload;
18
+ }
19
+ export interface SubmitUserRequestsMediaTypesParam {
20
+ /** Request content type */
21
+ contentType?: "application/json";
22
+ }
23
+ export type SubmitUserRequestsParameters = SubmitUserRequestsMediaTypesParam & SubmitUserRequestsBodyParam & RequestParameters;
24
+ export interface ListWorkflowRunsQueryParamProperties {
25
+ /** Time window of filtering items. */
26
+ timeWindow?: "1d" | "7d" | "30d" | "90d";
27
+ /** The key word which used to sort the results. */
28
+ orderby?: "status desc" | "status asc" | "requestor desc" | "requestor asc" | "startTime desc" | "startTime asc" | "createdTime desc" | "createdTime asc";
29
+ /** Filter workflow runs by workflow run status. */
30
+ runStatuses?: Array<"InProgress" | "Failed" | "Completed" | "NotStarted" | "Canceling" | "CancellationFailed" | "Canceled" | "Pending" | "Approved" | "Rejected" | "sent" | "received" | "history">;
31
+ /** Filter items by workflow id list. */
32
+ workflowIds?: Array<string>;
33
+ /** The maximum page size to get the items at one time. */
34
+ maxpagesize?: number;
35
+ }
36
+ export interface ListWorkflowRunsQueryParam {
37
+ queryParameters?: ListWorkflowRunsQueryParamProperties;
38
+ }
39
+ export type ListWorkflowRunsParameters = ListWorkflowRunsQueryParam & RequestParameters;
40
+ export type GetWorkflowRunParameters = RequestParameters;
41
+ export interface CancelWorkflowRunBodyParam {
42
+ /** Reply of canceling a workflow run. */
43
+ body: WorkflowRunCancelRequest;
44
+ }
45
+ export interface CancelWorkflowRunMediaTypesParam {
46
+ /** Request content type */
47
+ contentType?: "application/json";
48
+ }
49
+ export type CancelWorkflowRunParameters = CancelWorkflowRunMediaTypesParam & CancelWorkflowRunBodyParam & RequestParameters;
50
+ export interface ListWorkflowTasksQueryParamProperties {
51
+ /** To filter user's sent, received or history workflow tasks. */
52
+ viewMode?: string;
53
+ /** Filter items by workflow id list. */
54
+ workflowIds?: Array<string>;
55
+ /** Time window of filtering items. */
56
+ timeWindow?: "1d" | "7d" | "30d" | "90d";
57
+ /** The maximum page size to get the items at one time. */
58
+ maxpagesize?: number;
59
+ /** The key word which used to sort the results. */
60
+ orderby?: "status desc" | "status asc" | "requestor desc" | "requestor asc" | "startTime desc" | "startTime asc" | "createdTime desc" | "createdTime asc";
61
+ /** Filter items by workflow task type. */
62
+ taskTypes?: Array<"Approval" | "SimpleTask" | "approval" | "simpleTask">;
63
+ /** Filter workflow tasks by status. */
64
+ taskStatuses?: Array<"InProgress" | "Failed" | "Completed" | "NotStarted" | "Canceling" | "CancellationFailed" | "Canceled" | "Pending" | "Approved" | "Rejected" | "sent" | "received" | "history">;
65
+ /** The key word which could used to filter workflow item with related workflow. */
66
+ workflowNameKeyword?: string;
67
+ }
68
+ export interface ListWorkflowTasksQueryParam {
69
+ queryParameters?: ListWorkflowTasksQueryParamProperties;
70
+ }
71
+ export type ListWorkflowTasksParameters = ListWorkflowTasksQueryParam & RequestParameters;
72
+ export type GetWorkflowTaskParameters = RequestParameters;
73
+ export interface ApproveApprovalTaskBodyParam {
74
+ /** The request body of approving an approval request. */
75
+ body: ApprovalResponseComment;
76
+ }
77
+ export interface ApproveApprovalTaskMediaTypesParam {
78
+ /** Request content type */
79
+ contentType?: "application/json";
80
+ }
81
+ export type ApproveApprovalTaskParameters = ApproveApprovalTaskMediaTypesParam & ApproveApprovalTaskBodyParam & RequestParameters;
82
+ export interface RejectApprovalTaskBodyParam {
83
+ /** The request body of rejecting an approval request. */
84
+ body: ApprovalResponseComment;
85
+ }
86
+ export interface RejectApprovalTaskMediaTypesParam {
87
+ /** Request content type */
88
+ contentType?: "application/json";
89
+ }
90
+ export type RejectApprovalTaskParameters = RejectApprovalTaskMediaTypesParam & RejectApprovalTaskBodyParam & RequestParameters;
91
+ export interface ReassignWorkflowTaskBodyParam {
92
+ /** The request body of reassigning a workflow task. */
93
+ body: ReassignCommand;
94
+ }
95
+ export interface ReassignWorkflowTaskMediaTypesParam {
96
+ /** Request content type */
97
+ contentType?: "application/json";
98
+ }
99
+ export type ReassignWorkflowTaskParameters = ReassignWorkflowTaskMediaTypesParam & ReassignWorkflowTaskBodyParam & RequestParameters;
100
+ export interface UpdateTaskStatusBodyParam {
101
+ /** Request body of updating workflow task request. */
102
+ body: TaskUpdateCommand;
103
+ }
104
+ export interface UpdateTaskStatusMediaTypesParam {
105
+ /** Request content type */
106
+ contentType?: "application/json";
107
+ }
108
+ export type UpdateTaskStatusParameters = UpdateTaskStatusMediaTypesParam & UpdateTaskStatusBodyParam & RequestParameters;
109
+ //# sourceMappingURL=parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EACV,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AACxD,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gCAAgC;IAC/C,yCAAyC;IACzC,IAAI,EAAE,6BAA6B,CAAC;CACrC;AAED,MAAM,WAAW,sCAAsC;IACrD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,iCAAiC,GAAG,sCAAsC,GACpF,gCAAgC,GAChC,iBAAiB,CAAC;AACpB,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAEzD,MAAM,WAAW,2BAA2B;IAC1C,gDAAgD;IAChD,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,MAAM,WAAW,iCAAiC;IAChD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,4BAA4B,GAAG,iCAAiC,GAC1E,2BAA2B,GAC3B,iBAAiB,CAAC;AAEpB,MAAM,WAAW,oCAAoC;IACnD,sCAAsC;IACtC,UAAU,CAAC,EA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AI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,mCAAmC;IAClD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,8BAA8B,GAAG,mCAAmC,GAC9E,6BAA6B,GAC7B,iBAAiB,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,+BAA+B;IAC9C,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,0BAA0B,GAAG,+BAA+B,GACtE,yBAAyB,GACzB,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
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 type { RequestParameters } from \"@azure-rest/core-client\";\nimport type {\n WorkflowCreateOrUpdateCommand,\n UserRequestPayload,\n WorkflowRunCancelRequest,\n ApprovalResponseComment,\n ReassignCommand,\n TaskUpdateCommand,\n} from \"./models.js\";\n\nexport type ListWorkflowsParameters = RequestParameters;\nexport type GetWorkflowParameters = RequestParameters;\n\nexport interface CreateOrReplaceWorkflowBodyParam {\n /** Create or update workflow payload. */\n body: WorkflowCreateOrUpdateCommand;\n}\n\nexport interface CreateOrReplaceWorkflowMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type CreateOrReplaceWorkflowParameters = CreateOrReplaceWorkflowMediaTypesParam &\n CreateOrReplaceWorkflowBodyParam &\n RequestParameters;\nexport type DeleteWorkflowParameters = RequestParameters;\n\nexport interface SubmitUserRequestsBodyParam {\n /** The payload of submitting a user request. */\n body: UserRequestPayload;\n}\n\nexport interface SubmitUserRequestsMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type SubmitUserRequestsParameters = SubmitUserRequestsMediaTypesParam &\n SubmitUserRequestsBodyParam &\n RequestParameters;\n\nexport interface ListWorkflowRunsQueryParamProperties {\n /** Time window of filtering items. */\n timeWindow?: \"1d\" | \"7d\" | \"30d\" | \"90d\";\n /** The key word which used to sort the results. */\n orderby?:\n | \"status desc\"\n | \"status asc\"\n | \"requestor desc\"\n | \"requestor asc\"\n | \"startTime desc\"\n | \"startTime asc\"\n | \"createdTime desc\"\n | \"createdTime asc\";\n /** Filter workflow runs by workflow run status. */\n runStatuses?: Array<\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"NotStarted\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\"\n | \"Pending\"\n | \"Approved\"\n | \"Rejected\"\n | \"sent\"\n | \"received\"\n | \"history\"\n >;\n /** Filter items by workflow id list. */\n workflowIds?: Array<string>;\n /** The maximum page size to get the items at one time. */\n maxpagesize?: number;\n}\n\nexport interface ListWorkflowRunsQueryParam {\n queryParameters?: ListWorkflowRunsQueryParamProperties;\n}\n\nexport type ListWorkflowRunsParameters = ListWorkflowRunsQueryParam & RequestParameters;\nexport type GetWorkflowRunParameters = RequestParameters;\n\nexport interface CancelWorkflowRunBodyParam {\n /** Reply of canceling a workflow run. */\n body: WorkflowRunCancelRequest;\n}\n\nexport interface CancelWorkflowRunMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type CancelWorkflowRunParameters = CancelWorkflowRunMediaTypesParam &\n CancelWorkflowRunBodyParam &\n RequestParameters;\n\nexport interface ListWorkflowTasksQueryParamProperties {\n /** To filter user's sent, received or history workflow tasks. */\n viewMode?: string;\n /** Filter items by workflow id list. */\n workflowIds?: Array<string>;\n /** Time window of filtering items. */\n timeWindow?: \"1d\" | \"7d\" | \"30d\" | \"90d\";\n /** The maximum page size to get the items at one time. */\n maxpagesize?: number;\n /** The key word which used to sort the results. */\n orderby?:\n | \"status desc\"\n | \"status asc\"\n | \"requestor desc\"\n | \"requestor asc\"\n | \"startTime desc\"\n | \"startTime asc\"\n | \"createdTime desc\"\n | \"createdTime asc\";\n /** Filter items by workflow task type. */\n taskTypes?: Array<\"Approval\" | \"SimpleTask\" | \"approval\" | \"simpleTask\">;\n /** Filter workflow tasks by status. */\n taskStatuses?: Array<\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"NotStarted\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\"\n | \"Pending\"\n | \"Approved\"\n | \"Rejected\"\n | \"sent\"\n | \"received\"\n | \"history\"\n >;\n /** The key word which could used to filter workflow item with related workflow. */\n workflowNameKeyword?: string;\n}\n\nexport interface ListWorkflowTasksQueryParam {\n queryParameters?: ListWorkflowTasksQueryParamProperties;\n}\n\nexport type ListWorkflowTasksParameters = ListWorkflowTasksQueryParam & RequestParameters;\nexport type GetWorkflowTaskParameters = RequestParameters;\n\nexport interface ApproveApprovalTaskBodyParam {\n /** The request body of approving an approval request. */\n body: ApprovalResponseComment;\n}\n\nexport interface ApproveApprovalTaskMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ApproveApprovalTaskParameters = ApproveApprovalTaskMediaTypesParam &\n ApproveApprovalTaskBodyParam &\n RequestParameters;\n\nexport interface RejectApprovalTaskBodyParam {\n /** The request body of rejecting an approval request. */\n body: ApprovalResponseComment;\n}\n\nexport interface RejectApprovalTaskMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type RejectApprovalTaskParameters = RejectApprovalTaskMediaTypesParam &\n RejectApprovalTaskBodyParam &\n RequestParameters;\n\nexport interface ReassignWorkflowTaskBodyParam {\n /** The request body of reassigning a workflow task. */\n body: ReassignCommand;\n}\n\nexport interface ReassignWorkflowTaskMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type ReassignWorkflowTaskParameters = ReassignWorkflowTaskMediaTypesParam &\n ReassignWorkflowTaskBodyParam &\n RequestParameters;\n\nexport interface UpdateTaskStatusBodyParam {\n /** Request body of updating workflow task request. */\n body: TaskUpdateCommand;\n}\n\nexport interface UpdateTaskStatusMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type UpdateTaskStatusParameters = UpdateTaskStatusMediaTypesParam &\n UpdateTaskStatusBodyParam &\n RequestParameters;\n"]}
@@ -0,0 +1,16 @@
1
+ import type { ClientOptions } from "@azure-rest/core-client";
2
+ import type { TokenCredential } from "@azure/core-auth";
3
+ import type { PurviewWorkflowClient } from "./clientDefinitions.js";
4
+ /** The optional parameters for the client */
5
+ export interface PurviewWorkflowClientOptions extends ClientOptions {
6
+ /** The api version option of the client */
7
+ apiVersion?: string;
8
+ }
9
+ /**
10
+ * Initialize a new instance of `PurviewWorkflowClient`
11
+ * @param endpoint - The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/
12
+ * @param credentials - uniquely identify client credential
13
+ * @param options - the parameter for all optional parameters
14
+ */
15
+ export default function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: PurviewWorkflowClientOptions): PurviewWorkflowClient;
16
+ //# sourceMappingURL=purviewWorkflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purviewWorkflow.d.ts","sourceRoot":"","sources":["../../src/purviewWorkflow.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,4BAAiC,GACnF,qBAAqB,CAuCvB"}
@@ -0,0 +1,45 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { getClient } from "@azure-rest/core-client";
4
+ import { logger } from "./logger.js";
5
+ /**
6
+ * Initialize a new instance of `PurviewWorkflowClient`
7
+ * @param endpoint - The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/
8
+ * @param credentials - uniquely identify client credential
9
+ * @param options - the parameter for all optional parameters
10
+ */
11
+ export default function createClient(endpoint, credentials, { apiVersion = "2022-05-01-preview", ...options } = {}) {
12
+ const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}/workflow`;
13
+ const userAgentInfo = `azsdk-js-purview-workflow-rest/1.0.0-beta.3`;
14
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
15
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
16
+ : `${userAgentInfo}`;
17
+ options = {
18
+ ...options,
19
+ userAgentOptions: {
20
+ userAgentPrefix,
21
+ },
22
+ loggingOptions: {
23
+ logger: options.loggingOptions?.logger ?? logger.info,
24
+ },
25
+ credentials: {
26
+ scopes: ["https://purview.azure.net/.default"],
27
+ },
28
+ };
29
+ const client = getClient(endpointUrl, credentials, options);
30
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
31
+ client.pipeline.addPolicy({
32
+ name: "ClientApiVersionPolicy",
33
+ sendRequest: (req, next) => {
34
+ // Use the apiVersion defined in request url directly
35
+ // Append one if there is no apiVersion and we have one at client options
36
+ const url = new URL(req.url);
37
+ if (!url.searchParams.get("api-version") && apiVersion) {
38
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
39
+ }
40
+ return next(req);
41
+ },
42
+ });
43
+ return client;
44
+ }
45
+ //# sourceMappingURL=purviewWorkflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purviewWorkflow.js","sourceRoot":"","sources":["../../src/purviewWorkflow.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAAmC,EAAE;IAEpF,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,QAAQ,WAAW,CAAC;IAClF,MAAM,aAAa,GAAG,6CAA6C,CAAC;IACpE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,oCAAoC,CAAC;SAC/C;KACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAA0B,CAAC;IAErF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PurviewWorkflowClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface PurviewWorkflowClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `PurviewWorkflowClient`\n * @param endpoint - The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n { apiVersion = \"2022-05-01-preview\", ...options }: PurviewWorkflowClientOptions = {},\n): PurviewWorkflowClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}/workflow`;\n const userAgentInfo = `azsdk-js-purview-workflow-rest/1.0.0-beta.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as PurviewWorkflowClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -0,0 +1,137 @@
1
+ import type { HttpResponse } from "@azure-rest/core-client";
2
+ import type { WorkflowMetadataListOutput, ErrorResponseOutput, WorkflowOutput, UserRequestResponseOutput, WorkflowRunListOutput, WorkflowRunOutput, TasksListOutput, WorkflowTaskOutput } from "./outputModels.js";
3
+ /** List all workflows. */
4
+ export interface ListWorkflows200Response extends HttpResponse {
5
+ status: "200";
6
+ body: WorkflowMetadataListOutput;
7
+ }
8
+ /** List all workflows. */
9
+ export interface ListWorkflowsDefaultResponse extends HttpResponse {
10
+ status: string;
11
+ body: ErrorResponseOutput;
12
+ }
13
+ /** Get a specific workflow. */
14
+ export interface GetWorkflow200Response extends HttpResponse {
15
+ status: "200";
16
+ body: WorkflowOutput;
17
+ }
18
+ /** Get a specific workflow. */
19
+ export interface GetWorkflowDefaultResponse extends HttpResponse {
20
+ status: string;
21
+ body: ErrorResponseOutput;
22
+ }
23
+ /** Create or replace a workflow. */
24
+ export interface CreateOrReplaceWorkflow200Response extends HttpResponse {
25
+ status: "200";
26
+ body: WorkflowOutput;
27
+ }
28
+ /** Create or replace a workflow. */
29
+ export interface CreateOrReplaceWorkflowDefaultResponse extends HttpResponse {
30
+ status: string;
31
+ body: ErrorResponseOutput;
32
+ }
33
+ /** Delete a workflow. */
34
+ export interface DeleteWorkflow204Response extends HttpResponse {
35
+ status: "204";
36
+ }
37
+ /** Delete a workflow. */
38
+ export interface DeleteWorkflowDefaultResponse extends HttpResponse {
39
+ status: string;
40
+ body: ErrorResponseOutput;
41
+ }
42
+ /** Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any workflow's trigger matches with an operation in request, a run of the workflow is created. */
43
+ export interface SubmitUserRequests200Response extends HttpResponse {
44
+ status: "200";
45
+ body: UserRequestResponseOutput;
46
+ }
47
+ /** Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any workflow's trigger matches with an operation in request, a run of the workflow is created. */
48
+ export interface SubmitUserRequestsDefaultResponse extends HttpResponse {
49
+ status: string;
50
+ body: ErrorResponseOutput;
51
+ }
52
+ /** List workflow runs. */
53
+ export interface ListWorkflowRuns200Response extends HttpResponse {
54
+ status: "200";
55
+ body: WorkflowRunListOutput;
56
+ }
57
+ /** List workflow runs. */
58
+ export interface ListWorkflowRunsDefaultResponse extends HttpResponse {
59
+ status: string;
60
+ body: ErrorResponseOutput;
61
+ }
62
+ /** Get a workflow run. */
63
+ export interface GetWorkflowRun200Response extends HttpResponse {
64
+ status: "200";
65
+ body: WorkflowRunOutput;
66
+ }
67
+ /** Get a workflow run. */
68
+ export interface GetWorkflowRunDefaultResponse extends HttpResponse {
69
+ status: string;
70
+ body: ErrorResponseOutput;
71
+ }
72
+ /** Cancel a workflow run. */
73
+ export interface CancelWorkflowRun200Response extends HttpResponse {
74
+ status: "200";
75
+ }
76
+ /** Cancel a workflow run. */
77
+ export interface CancelWorkflowRunDefaultResponse extends HttpResponse {
78
+ status: string;
79
+ body: ErrorResponseOutput;
80
+ }
81
+ /** Get all workflow tasks. */
82
+ export interface ListWorkflowTasks200Response extends HttpResponse {
83
+ status: "200";
84
+ body: TasksListOutput;
85
+ }
86
+ /** Get all workflow tasks. */
87
+ export interface ListWorkflowTasksDefaultResponse extends HttpResponse {
88
+ status: string;
89
+ body: ErrorResponseOutput;
90
+ }
91
+ /** Get a workflow task. */
92
+ export interface GetWorkflowTask200Response extends HttpResponse {
93
+ status: "200";
94
+ body: WorkflowTaskOutput;
95
+ }
96
+ /** Get a workflow task. */
97
+ export interface GetWorkflowTaskDefaultResponse extends HttpResponse {
98
+ status: string;
99
+ body: ErrorResponseOutput;
100
+ }
101
+ /** Approve an approval task. */
102
+ export interface ApproveApprovalTask200Response extends HttpResponse {
103
+ status: "200";
104
+ }
105
+ /** Approve an approval task. */
106
+ export interface ApproveApprovalTaskDefaultResponse extends HttpResponse {
107
+ status: string;
108
+ body: ErrorResponseOutput;
109
+ }
110
+ /** Reject an approval task. */
111
+ export interface RejectApprovalTask200Response extends HttpResponse {
112
+ status: "200";
113
+ }
114
+ /** Reject an approval task. */
115
+ export interface RejectApprovalTaskDefaultResponse extends HttpResponse {
116
+ status: string;
117
+ body: ErrorResponseOutput;
118
+ }
119
+ /** Reassign a workflow task. */
120
+ export interface ReassignWorkflowTask200Response extends HttpResponse {
121
+ status: "200";
122
+ }
123
+ /** Reassign a workflow task. */
124
+ export interface ReassignWorkflowTaskDefaultResponse extends HttpResponse {
125
+ status: string;
126
+ body: ErrorResponseOutput;
127
+ }
128
+ /** Update the status of a workflow task request. */
129
+ export interface UpdateTaskStatus200Response extends HttpResponse {
130
+ status: "200";
131
+ }
132
+ /** Update the status of a workflow task request. */
133
+ export interface UpdateTaskStatusDefaultResponse extends HttpResponse {
134
+ status: string;
135
+ body: ErrorResponseOutput;
136
+ }
137
+ //# sourceMappingURL=responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAA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A+B,SAAQ,YAAY;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,gCAAgC;AAChC,MAAM,WAAW,8BAA+B,SAAQ,YAAY;IAClE,MAAM,EAAE,KAAK,CAAC;CACf;AAED,gCAAgC;AAChC,MAAM,WAAW,kCAAmC,SAAQ,YAAY;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,+BAA+B;AAC/B,MAAM,WAAW,6BAA8B,SAAQ,YAAY;IACjE,MAAM,EAAE,KAAK,CAAC;CACf;AAED,+BAA+B;AAC/B,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,gCAAgC;AAChC,MAAM,WAAW,+BAAgC,SAAQ,YAAY;IACnE,MAAM,EAAE,KAAK,CAAC;CACf;AAED,gCAAgC;AAChC,MAAM,WAAW,mCAAoC,SAAQ,YAAY;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,oDAAoD;AACpD,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAC/D,MAAM,EAAE,KAAK,CAAC;CACf;AAED,oDAAoD;AACpD,MAAM,WAAW,+BAAgC,SAAQ,YAAY;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n WorkflowMetadataListOutput,\n ErrorResponseOutput,\n WorkflowOutput,\n UserRequestResponseOutput,\n WorkflowRunListOutput,\n WorkflowRunOutput,\n TasksListOutput,\n WorkflowTaskOutput,\n} from \"./outputModels.js\";\n\n/** List all workflows. */\nexport interface ListWorkflows200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowMetadataListOutput;\n}\n\n/** List all workflows. */\nexport interface ListWorkflowsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get a specific workflow. */\nexport interface GetWorkflow200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowOutput;\n}\n\n/** Get a specific workflow. */\nexport interface GetWorkflowDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Create or replace a workflow. */\nexport interface CreateOrReplaceWorkflow200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowOutput;\n}\n\n/** Create or replace a workflow. */\nexport interface CreateOrReplaceWorkflowDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Delete a workflow. */\nexport interface DeleteWorkflow204Response extends HttpResponse {\n status: \"204\";\n}\n\n/** Delete a workflow. */\nexport interface DeleteWorkflowDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any workflow's trigger matches with an operation in request, a run of the workflow is created. */\nexport interface SubmitUserRequests200Response extends HttpResponse {\n status: \"200\";\n body: UserRequestResponseOutput;\n}\n\n/** Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any workflow's trigger matches with an operation in request, a run of the workflow is created. */\nexport interface SubmitUserRequestsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** List workflow runs. */\nexport interface ListWorkflowRuns200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowRunListOutput;\n}\n\n/** List workflow runs. */\nexport interface ListWorkflowRunsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get a workflow run. */\nexport interface GetWorkflowRun200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowRunOutput;\n}\n\n/** Get a workflow run. */\nexport interface GetWorkflowRunDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Cancel a workflow run. */\nexport interface CancelWorkflowRun200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Cancel a workflow run. */\nexport interface CancelWorkflowRunDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get all workflow tasks. */\nexport interface ListWorkflowTasks200Response extends HttpResponse {\n status: \"200\";\n body: TasksListOutput;\n}\n\n/** Get all workflow tasks. */\nexport interface ListWorkflowTasksDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get a workflow task. */\nexport interface GetWorkflowTask200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowTaskOutput;\n}\n\n/** Get a workflow task. */\nexport interface GetWorkflowTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Approve an approval task. */\nexport interface ApproveApprovalTask200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Approve an approval task. */\nexport interface ApproveApprovalTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Reject an approval task. */\nexport interface RejectApprovalTask200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Reject an approval task. */\nexport interface RejectApprovalTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Reassign a workflow task. */\nexport interface ReassignWorkflowTask200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Reassign a workflow task. */\nexport interface ReassignWorkflowTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Update the status of a workflow task request. */\nexport interface UpdateTaskStatus200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Update the status of a workflow task request. */\nexport interface UpdateTaskStatusDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}