@azure-rest/purview-workflow 1.0.0-alpha.20240307.1 → 1.0.0-alpha.20241111.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist-esm/src/clientDefinitions.js +1 -1
- package/dist-esm/src/clientDefinitions.js.map +1 -1
- package/dist-esm/src/index.js +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/isUnexpected.js +1 -1
- package/dist-esm/src/isUnexpected.js.map +1 -1
- package/dist-esm/src/models.js +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/outputModels.js +1 -1
- package/dist-esm/src/outputModels.js.map +1 -1
- package/dist-esm/src/paginateHelper.js +1 -1
- package/dist-esm/src/paginateHelper.js.map +1 -1
- package/dist-esm/src/parameters.js +1 -1
- package/dist-esm/src/parameters.js.map +1 -1
- package/dist-esm/src/purviewWorkflow.js +1 -1
- package/dist-esm/src/purviewWorkflow.js.map +1 -1
- package/dist-esm/src/responses.js +1 -1
- package/dist-esm/src/responses.js.map +1 -1
- package/package.json +27 -32
- package/review/purview-workflow.api.md +8 -8
- package/types/purview-workflow.d.ts +8 -8
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var coreClient = require('@azure-rest/core-client');
|
|
|
6
6
|
var corePaging = require('@azure/core-paging');
|
|
7
7
|
|
|
8
8
|
// Copyright (c) Microsoft Corporation.
|
|
9
|
-
// Licensed under the MIT
|
|
9
|
+
// Licensed under the MIT License.
|
|
10
10
|
/**
|
|
11
11
|
* Initialize a new instance of `PurviewWorkflowClient`
|
|
12
12
|
* @param endpoint type: string, The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/
|
|
@@ -32,7 +32,7 @@ function createClient(endpoint, credentials, options = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Copyright (c) Microsoft Corporation.
|
|
35
|
-
// Licensed under the MIT
|
|
35
|
+
// Licensed under the MIT License.
|
|
36
36
|
const responseMap = {
|
|
37
37
|
"GET /workflows": ["200"],
|
|
38
38
|
"GET /workflows/{workflowId}": ["200"],
|
|
@@ -115,7 +115,7 @@ function getPathFromMapKey(mapKey) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// Copyright (c) Microsoft Corporation.
|
|
118
|
-
// Licensed under the MIT
|
|
118
|
+
// Licensed under the MIT License.
|
|
119
119
|
/**
|
|
120
120
|
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
121
121
|
* @param client - Client to use for sending the next page requests
|
|
@@ -183,7 +183,7 @@ function checkPagingRequest(response) {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
// Copyright (c) Microsoft Corporation.
|
|
186
|
-
// Licensed under the MIT
|
|
186
|
+
// Licensed under the MIT License.
|
|
187
187
|
|
|
188
188
|
exports.default = createClient;
|
|
189
189
|
exports.isUnexpected = isUnexpected;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/purviewWorkflow.ts","../src/isUnexpected.ts","../src/paginateHelper.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 { PurviewWorkflowClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `PurviewWorkflowClient`\n * @param endpoint type: string, The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/\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): PurviewWorkflowClient {\n const baseUrl = options.baseUrl ?? `${endpoint}/workflow`;\n options.apiVersion = options.apiVersion ?? \"2022-05-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-purview-workflow-rest/1.0.0-beta.2`;\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 PurviewWorkflowClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ListWorkflows200Response,\n ListWorkflowsDefaultResponse,\n GetWorkflow200Response,\n GetWorkflowDefaultResponse,\n CreateOrReplaceWorkflow200Response,\n CreateOrReplaceWorkflowDefaultResponse,\n DeleteWorkflow204Response,\n DeleteWorkflowDefaultResponse,\n SubmitUserRequests200Response,\n SubmitUserRequestsDefaultResponse,\n ListWorkflowRuns200Response,\n ListWorkflowRunsDefaultResponse,\n GetWorkflowRun200Response,\n GetWorkflowRunDefaultResponse,\n CancelWorkflowRun200Response,\n CancelWorkflowRunDefaultResponse,\n ListWorkflowTasks200Response,\n ListWorkflowTasksDefaultResponse,\n GetWorkflowTask200Response,\n GetWorkflowTaskDefaultResponse,\n ApproveApprovalTask200Response,\n ApproveApprovalTaskDefaultResponse,\n RejectApprovalTask200Response,\n RejectApprovalTaskDefaultResponse,\n ReassignWorkflowTask200Response,\n ReassignWorkflowTaskDefaultResponse,\n UpdateTaskStatus200Response,\n UpdateTaskStatusDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /workflows\": [\"200\"],\n \"GET /workflows/{workflowId}\": [\"200\"],\n \"PUT /workflows/{workflowId}\": [\"200\"],\n \"DELETE /workflows/{workflowId}\": [\"204\"],\n \"POST /userrequests\": [\"200\"],\n \"GET /workflowruns\": [\"200\"],\n \"GET /workflowruns/{workflowRunId}\": [\"200\"],\n \"POST /workflowruns/{workflowRunId}/cancel\": [\"200\"],\n \"GET /workflowtasks\": [\"200\"],\n \"GET /workflowtasks/{taskId}\": [\"200\"],\n \"POST /workflowtasks/{taskId}/approve-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reject-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reassign\": [\"200\"],\n \"POST /workflowtasks/{taskId}/change-task-status\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListWorkflows200Response | ListWorkflowsDefaultResponse,\n): response is ListWorkflowsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflow200Response | GetWorkflowDefaultResponse,\n): response is GetWorkflowDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceWorkflow200Response | CreateOrReplaceWorkflowDefaultResponse,\n): response is CreateOrReplaceWorkflowDefaultResponse;\nexport function isUnexpected(\n response: DeleteWorkflow204Response | DeleteWorkflowDefaultResponse,\n): response is DeleteWorkflowDefaultResponse;\nexport function isUnexpected(\n response: SubmitUserRequests200Response | SubmitUserRequestsDefaultResponse,\n): response is SubmitUserRequestsDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowRuns200Response | ListWorkflowRunsDefaultResponse,\n): response is ListWorkflowRunsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowRun200Response | GetWorkflowRunDefaultResponse,\n): response is GetWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: CancelWorkflowRun200Response | CancelWorkflowRunDefaultResponse,\n): response is CancelWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowTasks200Response | ListWorkflowTasksDefaultResponse,\n): response is ListWorkflowTasksDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowTask200Response | GetWorkflowTaskDefaultResponse,\n): response is GetWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: ApproveApprovalTask200Response | ApproveApprovalTaskDefaultResponse,\n): response is ApproveApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: RejectApprovalTask200Response | RejectApprovalTaskDefaultResponse,\n): response is RejectApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: ReassignWorkflowTask200Response | ReassignWorkflowTaskDefaultResponse,\n): response is ReassignWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: UpdateTaskStatus200Response | UpdateTaskStatusDefaultResponse,\n): response is UpdateTaskStatusDefaultResponse;\nexport function isUnexpected(\n response:\n | ListWorkflows200Response\n | ListWorkflowsDefaultResponse\n | GetWorkflow200Response\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflow200Response\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflow204Response\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequests200Response\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRuns200Response\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRun200Response\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRun200Response\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasks200Response\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTask200Response\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTask200Response\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTask200Response\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTask200Response\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatus200Response\n | UpdateTaskStatusDefaultResponse,\n): response is\n | ListWorkflowsDefaultResponse\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatusDefaultResponse {\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 PurviewWorkflow from \"./purviewWorkflow\";\n\nexport * from \"./purviewWorkflow\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default PurviewWorkflow;\n"],"names":["getClient","getPagedAsyncIterator","createRestError"],"mappings":";;;;;;;AAAA;AACA;AAMA;;;;;AAKG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,OAAA,GAAy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AA,OAAO,KAAK,KAAL,IAAA,IAAA,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;AAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAA;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAMC,0BAAe,CACnB,CAAA,6CAAA,EAAgD,QAAQ,CAAC,MAAM,CAAE,CAAA,EACjE,QAAQ,CACT,CAAC;KACH;AACH;;AClIA;AACA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/purviewWorkflow.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/index.ts"],"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 type { TokenCredential } from \"@azure/core-auth\";\nimport type { PurviewWorkflowClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `PurviewWorkflowClient`\n * @param endpoint type: string, The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/\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): PurviewWorkflowClient {\n const baseUrl = options.baseUrl ?? `${endpoint}/workflow`;\n options.apiVersion = options.apiVersion ?? \"2022-05-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-purview-workflow-rest/1.0.0-beta.2`;\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 PurviewWorkflowClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ListWorkflows200Response,\n ListWorkflowsDefaultResponse,\n GetWorkflow200Response,\n GetWorkflowDefaultResponse,\n CreateOrReplaceWorkflow200Response,\n CreateOrReplaceWorkflowDefaultResponse,\n DeleteWorkflow204Response,\n DeleteWorkflowDefaultResponse,\n SubmitUserRequests200Response,\n SubmitUserRequestsDefaultResponse,\n ListWorkflowRuns200Response,\n ListWorkflowRunsDefaultResponse,\n GetWorkflowRun200Response,\n GetWorkflowRunDefaultResponse,\n CancelWorkflowRun200Response,\n CancelWorkflowRunDefaultResponse,\n ListWorkflowTasks200Response,\n ListWorkflowTasksDefaultResponse,\n GetWorkflowTask200Response,\n GetWorkflowTaskDefaultResponse,\n ApproveApprovalTask200Response,\n ApproveApprovalTaskDefaultResponse,\n RejectApprovalTask200Response,\n RejectApprovalTaskDefaultResponse,\n ReassignWorkflowTask200Response,\n ReassignWorkflowTaskDefaultResponse,\n UpdateTaskStatus200Response,\n UpdateTaskStatusDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /workflows\": [\"200\"],\n \"GET /workflows/{workflowId}\": [\"200\"],\n \"PUT /workflows/{workflowId}\": [\"200\"],\n \"DELETE /workflows/{workflowId}\": [\"204\"],\n \"POST /userrequests\": [\"200\"],\n \"GET /workflowruns\": [\"200\"],\n \"GET /workflowruns/{workflowRunId}\": [\"200\"],\n \"POST /workflowruns/{workflowRunId}/cancel\": [\"200\"],\n \"GET /workflowtasks\": [\"200\"],\n \"GET /workflowtasks/{taskId}\": [\"200\"],\n \"POST /workflowtasks/{taskId}/approve-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reject-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reassign\": [\"200\"],\n \"POST /workflowtasks/{taskId}/change-task-status\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListWorkflows200Response | ListWorkflowsDefaultResponse,\n): response is ListWorkflowsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflow200Response | GetWorkflowDefaultResponse,\n): response is GetWorkflowDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceWorkflow200Response | CreateOrReplaceWorkflowDefaultResponse,\n): response is CreateOrReplaceWorkflowDefaultResponse;\nexport function isUnexpected(\n response: DeleteWorkflow204Response | DeleteWorkflowDefaultResponse,\n): response is DeleteWorkflowDefaultResponse;\nexport function isUnexpected(\n response: SubmitUserRequests200Response | SubmitUserRequestsDefaultResponse,\n): response is SubmitUserRequestsDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowRuns200Response | ListWorkflowRunsDefaultResponse,\n): response is ListWorkflowRunsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowRun200Response | GetWorkflowRunDefaultResponse,\n): response is GetWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: CancelWorkflowRun200Response | CancelWorkflowRunDefaultResponse,\n): response is CancelWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowTasks200Response | ListWorkflowTasksDefaultResponse,\n): response is ListWorkflowTasksDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowTask200Response | GetWorkflowTaskDefaultResponse,\n): response is GetWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: ApproveApprovalTask200Response | ApproveApprovalTaskDefaultResponse,\n): response is ApproveApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: RejectApprovalTask200Response | RejectApprovalTaskDefaultResponse,\n): response is RejectApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: ReassignWorkflowTask200Response | ReassignWorkflowTaskDefaultResponse,\n): response is ReassignWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: UpdateTaskStatus200Response | UpdateTaskStatusDefaultResponse,\n): response is UpdateTaskStatusDefaultResponse;\nexport function isUnexpected(\n response:\n | ListWorkflows200Response\n | ListWorkflowsDefaultResponse\n | GetWorkflow200Response\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflow200Response\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflow204Response\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequests200Response\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRuns200Response\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRun200Response\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRun200Response\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasks200Response\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTask200Response\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTask200Response\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTask200Response\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTask200Response\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatus200Response\n | UpdateTaskStatusDefaultResponse,\n): response is\n | ListWorkflowsDefaultResponse\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatusDefaultResponse {\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 type { PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { getPagedAsyncIterator } from \"@azure/core-paging\";\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } 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 PurviewWorkflow from \"./purviewWorkflow\";\n\nexport * from \"./purviewWorkflow\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default PurviewWorkflow;\n"],"names":["getClient","getPagedAsyncIterator","createRestError"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;AAKG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,OAAA,GAAyB,EAAE,EAAA;;IAE3B,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OA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pIA;AACA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 type {\n ListWorkflowsParameters,\n GetWorkflowParameters,\n CreateOrReplaceWorkflowParameters,\n DeleteWorkflowParameters,\n SubmitUserRequestsParameters,\n ListWorkflowRunsParameters,\n GetWorkflowRunParameters,\n CancelWorkflowRunParameters,\n ListWorkflowTasksParameters,\n GetWorkflowTaskParameters,\n ApproveApprovalTaskParameters,\n RejectApprovalTaskParameters,\n ReassignWorkflowTaskParameters,\n UpdateTaskStatusParameters,\n} from \"./parameters\";\nimport type {\n ListWorkflows200Response,\n ListWorkflowsDefaultResponse,\n GetWorkflow200Response,\n GetWorkflowDefaultResponse,\n CreateOrReplaceWorkflow200Response,\n CreateOrReplaceWorkflowDefaultResponse,\n DeleteWorkflow204Response,\n DeleteWorkflowDefaultResponse,\n SubmitUserRequests200Response,\n SubmitUserRequestsDefaultResponse,\n ListWorkflowRuns200Response,\n ListWorkflowRunsDefaultResponse,\n GetWorkflowRun200Response,\n GetWorkflowRunDefaultResponse,\n CancelWorkflowRun200Response,\n CancelWorkflowRunDefaultResponse,\n ListWorkflowTasks200Response,\n ListWorkflowTasksDefaultResponse,\n GetWorkflowTask200Response,\n GetWorkflowTaskDefaultResponse,\n ApproveApprovalTask200Response,\n ApproveApprovalTaskDefaultResponse,\n RejectApprovalTask200Response,\n RejectApprovalTaskDefaultResponse,\n ReassignWorkflowTask200Response,\n ReassignWorkflowTaskDefaultResponse,\n UpdateTaskStatus200Response,\n UpdateTaskStatusDefaultResponse,\n} from \"./responses\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ListWorkflows {\n /** List all workflows. */\n get(\n options?: ListWorkflowsParameters,\n ): StreamableMethod<ListWorkflows200Response | ListWorkflowsDefaultResponse>;\n}\n\nexport interface GetWorkflow {\n /** Get a specific workflow. */\n get(\n options?: GetWorkflowParameters,\n ): StreamableMethod<GetWorkflow200Response | GetWorkflowDefaultResponse>;\n /** Create or replace a workflow. */\n put(\n options: CreateOrReplaceWorkflowParameters,\n ): StreamableMethod<CreateOrReplaceWorkflow200Response | CreateOrReplaceWorkflowDefaultResponse>;\n /** Delete a workflow. */\n delete(\n options?: DeleteWorkflowParameters,\n ): StreamableMethod<DeleteWorkflow204Response | DeleteWorkflowDefaultResponse>;\n}\n\nexport interface SubmitUserRequests {\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. */\n post(\n options: SubmitUserRequestsParameters,\n ): StreamableMethod<SubmitUserRequests200Response | SubmitUserRequestsDefaultResponse>;\n}\n\nexport interface ListWorkflowRuns {\n /** List workflow runs. */\n get(\n options?: ListWorkflowRunsParameters,\n ): StreamableMethod<ListWorkflowRuns200Response | ListWorkflowRunsDefaultResponse>;\n}\n\nexport interface GetWorkflowRun {\n /** Get a workflow run. */\n get(\n options?: GetWorkflowRunParameters,\n ): StreamableMethod<GetWorkflowRun200Response | GetWorkflowRunDefaultResponse>;\n}\n\nexport interface CancelWorkflowRun {\n /** Cancel a workflow run. */\n post(\n options: CancelWorkflowRunParameters,\n ): StreamableMethod<CancelWorkflowRun200Response | CancelWorkflowRunDefaultResponse>;\n}\n\nexport interface ListWorkflowTasks {\n /** Get all workflow tasks. */\n get(\n options?: ListWorkflowTasksParameters,\n ): StreamableMethod<ListWorkflowTasks200Response | ListWorkflowTasksDefaultResponse>;\n}\n\nexport interface GetWorkflowTask {\n /** Get a workflow task. */\n get(\n options?: GetWorkflowTaskParameters,\n ): StreamableMethod<GetWorkflowTask200Response | GetWorkflowTaskDefaultResponse>;\n}\n\nexport interface ApproveApprovalTask {\n /** Approve an approval task. */\n post(\n options: ApproveApprovalTaskParameters,\n ): StreamableMethod<ApproveApprovalTask200Response | ApproveApprovalTaskDefaultResponse>;\n}\n\nexport interface RejectApprovalTask {\n /** Reject an approval task. */\n post(\n options: RejectApprovalTaskParameters,\n ): StreamableMethod<RejectApprovalTask200Response | RejectApprovalTaskDefaultResponse>;\n}\n\nexport interface ReassignWorkflowTask {\n /** Reassign a workflow task. */\n post(\n options: ReassignWorkflowTaskParameters,\n ): StreamableMethod<ReassignWorkflowTask200Response | ReassignWorkflowTaskDefaultResponse>;\n}\n\nexport interface UpdateTaskStatus {\n /** Update the status of a workflow task request. */\n post(\n options: UpdateTaskStatusParameters,\n ): StreamableMethod<UpdateTaskStatus200Response | UpdateTaskStatusDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/workflows' has methods for the following verbs: get */\n (path: \"/workflows\"): ListWorkflows;\n /** Resource for '/workflows/\\{workflowId\\}' has methods for the following verbs: get, put, delete */\n (path: \"/workflows/{workflowId}\", workflowId: string): GetWorkflow;\n /** Resource for '/userrequests' has methods for the following verbs: post */\n (path: \"/userrequests\"): SubmitUserRequests;\n /** Resource for '/workflowruns' has methods for the following verbs: get */\n (path: \"/workflowruns\"): ListWorkflowRuns;\n /** Resource for '/workflowruns/\\{workflowRunId\\}' has methods for the following verbs: get */\n (path: \"/workflowruns/{workflowRunId}\", workflowRunId: string): GetWorkflowRun;\n /** Resource for '/workflowruns/\\{workflowRunId\\}/cancel' has methods for the following verbs: post */\n (path: \"/workflowruns/{workflowRunId}/cancel\", workflowRunId: string): CancelWorkflowRun;\n /** Resource for '/workflowtasks' has methods for the following verbs: get */\n (path: \"/workflowtasks\"): ListWorkflowTasks;\n /** Resource for '/workflowtasks/\\{taskId\\}' has methods for the following verbs: get */\n (path: \"/workflowtasks/{taskId}\", taskId: string): GetWorkflowTask;\n /** Resource for '/workflowtasks/\\{taskId\\}/approve-approval' has methods for the following verbs: post */\n (path: \"/workflowtasks/{taskId}/approve-approval\", taskId: string): ApproveApprovalTask;\n /** Resource for '/workflowtasks/\\{taskId\\}/reject-approval' has methods for the following verbs: post */\n (path: \"/workflowtasks/{taskId}/reject-approval\", taskId: string): RejectApprovalTask;\n /** Resource for '/workflowtasks/\\{taskId\\}/reassign' has methods for the following verbs: post */\n (path: \"/workflowtasks/{taskId}/reassign\", taskId: string): ReassignWorkflowTask;\n /** Resource for '/workflowtasks/\\{taskId\\}/change-task-status' has methods for the following verbs: post */\n (path: \"/workflowtasks/{taskId}/change-task-status\", taskId: string): UpdateTaskStatus;\n}\n\nexport type PurviewWorkflowClient = Client & {\n path: Routes;\n};\n"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc,mBAAmB,CAAC;AAClC,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;AAEjC,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc,mBAAmB,CAAC;AAClC,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;AAEjC,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport PurviewWorkflow from \"./purviewWorkflow\";\n\nexport * from \"./purviewWorkflow\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default PurviewWorkflow;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,WAAW,GAA6B;IAC5C,gBAAgB,EAAE,CAAC,KAAK,CAAC;IACzB,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,gCAAgC,EAAE,CAAC,KAAK,CAAC;IACzC,oBAAoB,EAAE,CAAC,KAAK,CAAC;IAC7B,mBAAmB,EAAE,CAAC,KAAK,CAAC;IAC5B,mCAAmC,EAAE,CAAC,KAAK,CAAC;IAC5C,2CAA2C,EAAE,CAAC,KAAK,CAAC;IACpD,oBAAoB,EAAE,CAAC,KAAK,CAAC;IAC7B,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,+CAA+C,EAAE,CAAC,KAAK,CAAC;IACxD,8CAA8C,EAAE,CAAC,KAAK,CAAC;IACvD,uCAAuC,EAAE,CAAC,KAAK,CAAC;IAChD,iDAAiD,EAAE,CAAC,KAAK,CAAC;CAC3D,CAAC;AA4CF,MAAM,UAAU,YAAY,CAC1B,QA4BmC;IAgBnC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG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AAC,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 ListWorkflows200Response,\n ListWorkflowsDefaultResponse,\n GetWorkflow200Response,\n GetWorkflowDefaultResponse,\n CreateOrReplaceWorkflow200Response,\n CreateOrReplaceWorkflowDefaultResponse,\n DeleteWorkflow204Response,\n DeleteWorkflowDefaultResponse,\n SubmitUserRequests200Response,\n SubmitUserRequestsDefaultResponse,\n ListWorkflowRuns200Response,\n ListWorkflowRunsDefaultResponse,\n GetWorkflowRun200Response,\n GetWorkflowRunDefaultResponse,\n CancelWorkflowRun200Response,\n CancelWorkflowRunDefaultResponse,\n ListWorkflowTasks200Response,\n ListWorkflowTasksDefaultResponse,\n GetWorkflowTask200Response,\n GetWorkflowTaskDefaultResponse,\n ApproveApprovalTask200Response,\n ApproveApprovalTaskDefaultResponse,\n RejectApprovalTask200Response,\n RejectApprovalTaskDefaultResponse,\n ReassignWorkflowTask200Response,\n ReassignWorkflowTaskDefaultResponse,\n UpdateTaskStatus200Response,\n UpdateTaskStatusDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /workflows\": [\"200\"],\n \"GET /workflows/{workflowId}\": [\"200\"],\n \"PUT /workflows/{workflowId}\": [\"200\"],\n \"DELETE /workflows/{workflowId}\": [\"204\"],\n \"POST /userrequests\": [\"200\"],\n \"GET /workflowruns\": [\"200\"],\n \"GET /workflowruns/{workflowRunId}\": [\"200\"],\n \"POST /workflowruns/{workflowRunId}/cancel\": [\"200\"],\n \"GET /workflowtasks\": [\"200\"],\n \"GET /workflowtasks/{taskId}\": [\"200\"],\n \"POST /workflowtasks/{taskId}/approve-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reject-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reassign\": [\"200\"],\n \"POST /workflowtasks/{taskId}/change-task-status\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListWorkflows200Response | ListWorkflowsDefaultResponse,\n): response is ListWorkflowsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflow200Response | GetWorkflowDefaultResponse,\n): response is GetWorkflowDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceWorkflow200Response | CreateOrReplaceWorkflowDefaultResponse,\n): response is CreateOrReplaceWorkflowDefaultResponse;\nexport function isUnexpected(\n response: DeleteWorkflow204Response | DeleteWorkflowDefaultResponse,\n): response is DeleteWorkflowDefaultResponse;\nexport function isUnexpected(\n response: SubmitUserRequests200Response | SubmitUserRequestsDefaultResponse,\n): response is SubmitUserRequestsDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowRuns200Response | ListWorkflowRunsDefaultResponse,\n): response is ListWorkflowRunsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowRun200Response | GetWorkflowRunDefaultResponse,\n): response is GetWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: CancelWorkflowRun200Response | CancelWorkflowRunDefaultResponse,\n): response is CancelWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowTasks200Response | ListWorkflowTasksDefaultResponse,\n): response is ListWorkflowTasksDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowTask200Response | GetWorkflowTaskDefaultResponse,\n): response is GetWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: ApproveApprovalTask200Response | ApproveApprovalTaskDefaultResponse,\n): response is ApproveApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: RejectApprovalTask200Response | RejectApprovalTaskDefaultResponse,\n): response is RejectApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: ReassignWorkflowTask200Response | ReassignWorkflowTaskDefaultResponse,\n): response is ReassignWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: UpdateTaskStatus200Response | UpdateTaskStatusDefaultResponse,\n): response is UpdateTaskStatusDefaultResponse;\nexport function isUnexpected(\n response:\n | ListWorkflows200Response\n | ListWorkflowsDefaultResponse\n | GetWorkflow200Response\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflow200Response\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflow204Response\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequests200Response\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRuns200Response\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRun200Response\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRun200Response\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasks200Response\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTask200Response\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTask200Response\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTask200Response\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTask200Response\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatus200Response\n | UpdateTaskStatusDefaultResponse,\n): response is\n | ListWorkflowsDefaultResponse\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatusDefaultResponse {\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
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,WAAW,GAA6B;IAC5C,gBAAgB,EAAE,CAAC,KAAK,CAAC;IACzB,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,6BAA6B,EAAE,C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AAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;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 type {\n ListWorkflows200Response,\n ListWorkflowsDefaultResponse,\n GetWorkflow200Response,\n GetWorkflowDefaultResponse,\n CreateOrReplaceWorkflow200Response,\n CreateOrReplaceWorkflowDefaultResponse,\n DeleteWorkflow204Response,\n DeleteWorkflowDefaultResponse,\n SubmitUserRequests200Response,\n SubmitUserRequestsDefaultResponse,\n ListWorkflowRuns200Response,\n ListWorkflowRunsDefaultResponse,\n GetWorkflowRun200Response,\n GetWorkflowRunDefaultResponse,\n CancelWorkflowRun200Response,\n CancelWorkflowRunDefaultResponse,\n ListWorkflowTasks200Response,\n ListWorkflowTasksDefaultResponse,\n GetWorkflowTask200Response,\n GetWorkflowTaskDefaultResponse,\n ApproveApprovalTask200Response,\n ApproveApprovalTaskDefaultResponse,\n RejectApprovalTask200Response,\n RejectApprovalTaskDefaultResponse,\n ReassignWorkflowTask200Response,\n ReassignWorkflowTaskDefaultResponse,\n UpdateTaskStatus200Response,\n UpdateTaskStatusDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /workflows\": [\"200\"],\n \"GET /workflows/{workflowId}\": [\"200\"],\n \"PUT /workflows/{workflowId}\": [\"200\"],\n \"DELETE /workflows/{workflowId}\": [\"204\"],\n \"POST /userrequests\": [\"200\"],\n \"GET /workflowruns\": [\"200\"],\n \"GET /workflowruns/{workflowRunId}\": [\"200\"],\n \"POST /workflowruns/{workflowRunId}/cancel\": [\"200\"],\n \"GET /workflowtasks\": [\"200\"],\n \"GET /workflowtasks/{taskId}\": [\"200\"],\n \"POST /workflowtasks/{taskId}/approve-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reject-approval\": [\"200\"],\n \"POST /workflowtasks/{taskId}/reassign\": [\"200\"],\n \"POST /workflowtasks/{taskId}/change-task-status\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListWorkflows200Response | ListWorkflowsDefaultResponse,\n): response is ListWorkflowsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflow200Response | GetWorkflowDefaultResponse,\n): response is GetWorkflowDefaultResponse;\nexport function isUnexpected(\n response: CreateOrReplaceWorkflow200Response | CreateOrReplaceWorkflowDefaultResponse,\n): response is CreateOrReplaceWorkflowDefaultResponse;\nexport function isUnexpected(\n response: DeleteWorkflow204Response | DeleteWorkflowDefaultResponse,\n): response is DeleteWorkflowDefaultResponse;\nexport function isUnexpected(\n response: SubmitUserRequests200Response | SubmitUserRequestsDefaultResponse,\n): response is SubmitUserRequestsDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowRuns200Response | ListWorkflowRunsDefaultResponse,\n): response is ListWorkflowRunsDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowRun200Response | GetWorkflowRunDefaultResponse,\n): response is GetWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: CancelWorkflowRun200Response | CancelWorkflowRunDefaultResponse,\n): response is CancelWorkflowRunDefaultResponse;\nexport function isUnexpected(\n response: ListWorkflowTasks200Response | ListWorkflowTasksDefaultResponse,\n): response is ListWorkflowTasksDefaultResponse;\nexport function isUnexpected(\n response: GetWorkflowTask200Response | GetWorkflowTaskDefaultResponse,\n): response is GetWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: ApproveApprovalTask200Response | ApproveApprovalTaskDefaultResponse,\n): response is ApproveApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: RejectApprovalTask200Response | RejectApprovalTaskDefaultResponse,\n): response is RejectApprovalTaskDefaultResponse;\nexport function isUnexpected(\n response: ReassignWorkflowTask200Response | ReassignWorkflowTaskDefaultResponse,\n): response is ReassignWorkflowTaskDefaultResponse;\nexport function isUnexpected(\n response: UpdateTaskStatus200Response | UpdateTaskStatusDefaultResponse,\n): response is UpdateTaskStatusDefaultResponse;\nexport function isUnexpected(\n response:\n | ListWorkflows200Response\n | ListWorkflowsDefaultResponse\n | GetWorkflow200Response\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflow200Response\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflow204Response\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequests200Response\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRuns200Response\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRun200Response\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRun200Response\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasks200Response\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTask200Response\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTask200Response\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTask200Response\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTask200Response\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatus200Response\n | UpdateTaskStatusDefaultResponse,\n): response is\n | ListWorkflowsDefaultResponse\n | GetWorkflowDefaultResponse\n | CreateOrReplaceWorkflowDefaultResponse\n | DeleteWorkflowDefaultResponse\n | SubmitUserRequestsDefaultResponse\n | ListWorkflowRunsDefaultResponse\n | GetWorkflowRunDefaultResponse\n | CancelWorkflowRunDefaultResponse\n | ListWorkflowTasksDefaultResponse\n | GetWorkflowTaskDefaultResponse\n | ApproveApprovalTaskDefaultResponse\n | RejectApprovalTaskDefaultResponse\n | ReassignWorkflowTaskDefaultResponse\n | UpdateTaskStatusDefaultResponse {\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"]}
|
package/dist-esm/src/models.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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/** Describes under what condition a workflow will run. */\nexport interface Trigger {\n type:\n | \"when_term_creation_is_requested\"\n | \"when_term_deletion_is_requested\"\n | \"when_term_update_is_requested\"\n | \"when_terms_import_is_requested\"\n | \"when_data_access_grant_is_requested\"\n | \"when_asset_update_is_requested\";\n /** Glossary term hierarchy path. */\n underGlossaryHierarchy?: string;\n /** The collection name. */\n underCollection?: string;\n /** The glossary guid. */\n underGlossary?: string;\n}\n\n/** Create or update workflow payload. */\nexport interface WorkflowCreateOrUpdateCommand {\n /** It describes under what condition a workflow will run. */\n triggers: Array<Trigger>;\n /** The workflow name. */\n name: string;\n /** Whether the workflow enabled or not. */\n isEnabled: boolean;\n /** Description of a workflow. */\n description: string;\n /** The action DAG(Directed Acyclic Graph), it defines actual flow. */\n actionDag?: Record<string, unknown>;\n}\n\nexport interface UserRequestPayload {\n /** The list of operations user want to submit, each operation matches one Purview API call and will do the operation directly. */\n operations: Array<Operation>;\n /** The comment when submit a user request. */\n comment?: string;\n}\n\n/** The operation user wants to perform. */\nexport interface Operation {\n /** The operation type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The payload of each operation which user want to submit. */\n payload: Record<string, unknown>;\n}\n\nexport interface WorkflowRunCancelRequest {\n /** The comment of canceling a workflow run. */\n comment?: string;\n}\n\nexport interface ApprovalResponseComment {\n /** The comment of approving or rejecting an approval request. */\n comment?: string;\n}\n\n/** The request payload of reassigning a workflow task. */\nexport interface ReassignCommand {\n /** The request body of reassigning a workflow task. */\n reassignments?: Array<ReassignCommandReassignmentsItem>;\n}\n\nexport interface ReassignCommandReassignmentsItem {\n /**\n * Reassign a workflow task from a user or a group.\n *\n * Value may contain a UUID\n */\n reassignFrom: string;\n /**\n * Reassign a workflow task to a user or a group.\n *\n * Value may contain a UUID\n */\n reassignTo: string;\n}\n\nexport interface TaskUpdateCommand {\n /** The new status will be used to update the task. */\n newStatus: \"NotStarted\" | \"InProgress\" | \"Completed\" | \"Canceled\";\n /** The comment when update a task. */\n comment?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** The workflow list. */\nexport interface WorkflowMetadataListOutput {\n /** The value of workflow list. */\n value: Array<WorkflowMetadataOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** The workflow metadata, action DAGs are not included. */\nexport interface WorkflowMetadataOutput {\n /**\n * The id of workflow.\n *\n * Value may contain a UUID\n */\n id: string;\n /** It describes under what condition a workflow will run. */\n triggers: Array<TriggerOutput>;\n /** The created time of workflow. */\n createdTime?: string;\n /** The person who created the workflow. */\n createdBy?: string;\n /** The last update time. */\n lastUpdateTime?: string;\n /** The person who updated the workflow. */\n updatedBy?: string;\n /** The name of a workflow. */\n name: string;\n /** Whether the workflow is enabled or not. */\n isEnabled: boolean;\n /** Description of a workflow. */\n description: string;\n}\n\n/** Describes under what condition a workflow will run. */\nexport interface TriggerOutput {\n type:\n | \"when_term_creation_is_requested\"\n | \"when_term_deletion_is_requested\"\n | \"when_term_update_is_requested\"\n | \"when_terms_import_is_requested\"\n | \"when_data_access_grant_is_requested\"\n | \"when_asset_update_is_requested\";\n /** Glossary term hierarchy path. */\n underGlossaryHierarchy?: string;\n /** The collection name. */\n underCollection?: string;\n /** The glossary guid. */\n underGlossary?: string;\n}\n\n/** Default error response model */\nexport interface ErrorResponseOutput {\n /** Default error model */\n error: ErrorModelOutput;\n}\n\n/** Default error model */\nexport interface ErrorModelOutput {\n /** Gets or sets the code. */\n code: string;\n /** Gets or sets the details. */\n details?: Array<ErrorModelOutput>;\n /** Gets or sets the messages. */\n message: string;\n /** Gets or sets the target. */\n target?: string;\n}\n\n/** The workflow properties. It includes the triggers, actual flow and other properties of a workflow. */\nexport interface WorkflowOutput extends WorkflowMetadataOutput {\n /** The action DAG(Directed Acyclic Graph), it defines steps to be executed in a workflow run and their order. */\n actionDag: Record<string, unknown>;\n}\n\n/** Describes user ask to do operation(s) on Purview. */\nexport interface UserRequestResponseOutput {\n /**\n * The user request id.\n *\n * Value may contain a UUID\n */\n requestId: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor: string;\n /** The list of operations user want to submit, each operation matches one Purview API call and will do the operation directly. */\n operations: Array<UserRequestResponseOperationsItemOutput>;\n /** The comment when submit a user request. */\n comment?: string;\n /** The status. */\n status:\n | \"NotStarted\"\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\";\n}\n\n/** The operation user wants to perform. */\nexport interface UserRequestResponseOperationsItemOutput {\n /** The operation type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The payload of each operation which user want to submit. */\n payload: Record<string, unknown>;\n workflowRunIds?: Array<string>;\n}\n\nexport interface WorkflowRunListOutput {\n /** The value of workflow run list. */\n value: Array<WorkflowRunMetadataOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** The execution of a workflow. It includes status of the entire run and other properties of a run. */\nexport interface WorkflowRunMetadataOutput {\n /**\n * The workflow run id.\n *\n * Value may contain a UUID\n */\n id: string;\n /**\n * The workflow id.\n *\n * Value may contain a UUID\n */\n workflowId: string;\n /** Workflow run start time. */\n startTime: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor: string;\n /**\n * The user request id.\n *\n * Value may contain a UUID\n */\n userRequestId?: string;\n /** The input of a workflow run. Align with operation in user request. */\n runPayload: WorkflowRunPayloadOutput;\n /** The status. */\n status:\n | \"NotStarted\"\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\";\n /** The time of workflow run completed. */\n endTime?: string;\n /** The time of workflow run be canceled. */\n cancelTime?: string;\n /** The comment when cancel a workflow run. */\n cancelComment?: string;\n}\n\n/** The input of a workflow run. Align with operation in user request. */\nexport interface WorkflowRunPayloadOutput {\n /** The workflow run payload type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The target value which need involve workflow to update. */\n targetValue: string;\n}\n\n/** The execution of a workflow. It includes workflow action DAG at run time (action DAG snapshot), run payload, status of the entire run and other properties of a run. */\nexport interface WorkflowRunOutput {\n /**\n * The workflow run id.\n *\n * Value may contain a UUID\n */\n id?: string;\n /**\n * The workflow id.\n *\n * Value may contain a UUID\n */\n workflowId?: string;\n /** Workflow run start time. */\n startTime?: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor?: string;\n /**\n * The user request id.\n *\n * Value may contain a UUID\n */\n userRequestId?: string;\n /** The input of a workflow run. Align with operation in user request. */\n runPayload?: WorkflowRunRunPayloadOutput;\n /** The status. */\n status?:\n | \"NotStarted\"\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\";\n /** The time of workflow run completed. */\n endTime?: string;\n /** The time of workflow run be canceled. */\n cancelTime?: string;\n /** The comment when cancel a workflow run. */\n cancelComment?: string;\n /** The action DAG(Directed Acyclic Graph), it defines actual flow. */\n actionDag: Record<string, unknown>;\n /** It refers to the \"detail\" property of a workflow run object, which contains run context and runtime information of actions. */\n detail: WorkflowRunDetailOutput;\n}\n\n/** The input of a workflow run. Align with operation in user request. */\nexport interface WorkflowRunRunPayloadOutput {\n /** The workflow run payload type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The target value which need involve workflow to update. */\n targetValue: string;\n /** The payload of each operation which user want to submit. */\n payload: Record<string, unknown>;\n}\n\n/** It refers to the \"detail\" property of a workflow run object, which contains run context and runtime information of actions. */\nexport interface WorkflowRunDetailOutput {\n /** Built-in variables starts with @runInput. Its properties are determined by trigger type at workflow run time. */\n runInput: Record<string, unknown>;\n /** Any object */\n actions: Record<string, unknown>;\n}\n\nexport interface TasksListOutput {\n /** The value of workflow tasks list. */\n value: Array<WorkflowTaskOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** An actionable item assigned to assignees. It is created when approval or task action starts to execute. Approval is one kind of task. */\nexport interface WorkflowTaskOutputParent {\n /**\n * The workflow task id.\n *\n * Value may contain a UUID\n */\n id: string;\n /** The workflow task title. */\n title?: string;\n /**\n * The workflow run id.\n *\n * Value may contain a UUID\n */\n workflowRunId: string;\n /**\n * The workflow id.\n *\n * Value may contain a UUID\n */\n workflowId: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor: string;\n /** The created time. */\n createdTime: string;\n /** The last update time. */\n lastUpdateTime: string;\n /** Info and material that helps assignees to take action. */\n payload: TaskPayloadOutput;\n /** Info of task reminder. */\n reminderInfo?: WorkflowTaskReminderInfoOutput;\n /** Info of task expiry. */\n expiryInfo?: WorkflowTaskExpiryInfoOutput;\n type: \"WorkflowTask\" | \"Approval\" | \"SimpleTask\";\n}\n\n/** Info and material that helps assignees to take action. */\nexport interface TaskPayloadOutput {\n /** The task payload type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The target value of entity which user want to involve workflow to update. */\n targetValue: string;\n /** The payload of the task. */\n payload?: Record<string, unknown>;\n}\n\n/** Info of task reminder. */\nexport interface WorkflowTaskReminderInfoOutput {\n /** The last update time. */\n lastRemindTime?: string;\n /** The next remind time. */\n nextRemindTime: string;\n /** The reminder settings. */\n reminderSettings: Record<string, unknown>;\n}\n\n/** Info of task expiry. */\nexport interface WorkflowTaskExpiryInfoOutput {\n /** The last expiry notification time. */\n lastExpiryNotificationTime?: string;\n /** The next expiry notification time. */\n nextExpiryNotificationTime: string;\n /** The expiry time. */\n expiryTime: string;\n expirySettings: WorkflowTaskExpiryInfoExpirySettingsOutput;\n}\n\nexport interface WorkflowTaskExpiryInfoExpirySettingsOutput {\n /** The time of expiry. */\n expireAfter: Record<string, unknown>;\n notifyOnExpiration?: Array<string>;\n}\n\n/** The workflow approval task properties. */\nexport interface ApprovalOutput extends WorkflowTaskOutputParent {\n /** The approval task details */\n approvalDetail?: ApprovalDetailOutput;\n type: \"Approval\";\n}\n\n/** The approval task details */\nexport interface ApprovalDetailOutput {\n /** The approval type of an approval task. */\n approvalType: \"PendingOnAny\" | \"PendingOnAll\";\n /** The status of an approval task. */\n status: \"Pending\" | \"Approved\" | \"Rejected\" | \"Canceled\";\n /** The list of approvers with reply. */\n approvers: Record<string, ApproverResponseOutput>;\n}\n\n/** The response of approvers for a workflow task. */\nexport interface ApproverResponseOutput {\n /** The response for an approval task. */\n reply: \"Approved\" | \"Rejected\" | \"Pending\";\n /** The comment of approving or rejecting an approval request. */\n comment?: string;\n /** The reply time of approver to a workflow task. */\n responseTime?: string;\n}\n\n/** The workflow simple task properties. */\nexport interface SimpleTaskOutput extends WorkflowTaskOutputParent {\n /** Workflow simple task details. */\n taskDetail?: SimpleTaskDetailOutput;\n type: \"SimpleTask\";\n}\n\n/** Workflow simple task details. */\nexport interface SimpleTaskDetailOutput {\n /** The simple task body. */\n taskBody: string;\n /** The users or groups were assigned the simple task. */\n assignedTo: Array<string>;\n /** Simple task status. */\n status: \"NotStarted\" | \"InProgress\" | \"Completed\" | \"Canceled\";\n changeHistory: Array<Record<string, unknown>>;\n}\n\n/** An actionable item assigned to assignees. It is created when approval or task action starts to execute. Approval is one kind of task. */\nexport type WorkflowTaskOutput = ApprovalOutput | SimpleTaskOutput;\n"]}
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** The workflow list. */\nexport interface WorkflowMetadataListOutput {\n /** The value of workflow list. */\n value: Array<WorkflowMetadataOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** The workflow metadata, action DAGs are not included. */\nexport interface WorkflowMetadataOutput {\n /**\n * The id of workflow.\n *\n * Value may contain a UUID\n */\n id: string;\n /** It describes under what condition a workflow will run. */\n triggers: Array<TriggerOutput>;\n /** The created time of workflow. */\n createdTime?: string;\n /** The person who created the workflow. */\n createdBy?: string;\n /** The last update time. */\n lastUpdateTime?: string;\n /** The person who updated the workflow. */\n updatedBy?: string;\n /** The name of a workflow. */\n name: string;\n /** Whether the workflow is enabled or not. */\n isEnabled: boolean;\n /** Description of a workflow. */\n description: string;\n}\n\n/** Describes under what condition a workflow will run. */\nexport interface TriggerOutput {\n type:\n | \"when_term_creation_is_requested\"\n | \"when_term_deletion_is_requested\"\n | \"when_term_update_is_requested\"\n | \"when_terms_import_is_requested\"\n | \"when_data_access_grant_is_requested\"\n | \"when_asset_update_is_requested\";\n /** Glossary term hierarchy path. */\n underGlossaryHierarchy?: string;\n /** The collection name. */\n underCollection?: string;\n /** The glossary guid. */\n underGlossary?: string;\n}\n\n/** Default error response model */\nexport interface ErrorResponseOutput {\n /** Default error model */\n error: ErrorModelOutput;\n}\n\n/** Default error model */\nexport interface ErrorModelOutput {\n /** Gets or sets the code. */\n code: string;\n /** Gets or sets the details. */\n details?: Array<ErrorModelOutput>;\n /** Gets or sets the messages. */\n message: string;\n /** Gets or sets the target. */\n target?: string;\n}\n\n/** The workflow properties. It includes the triggers, actual flow and other properties of a workflow. */\nexport interface WorkflowOutput extends WorkflowMetadataOutput {\n /** The action DAG(Directed Acyclic Graph), it defines steps to be executed in a workflow run and their order. */\n actionDag: Record<string, unknown>;\n}\n\n/** Describes user ask to do operation(s) on Purview. */\nexport interface UserRequestResponseOutput {\n /**\n * The user request id.\n *\n * Value may contain a UUID\n */\n requestId: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor: string;\n /** The list of operations user want to submit, each operation matches one Purview API call and will do the operation directly. */\n operations: Array<UserRequestResponseOperationsItemOutput>;\n /** The comment when submit a user request. */\n comment?: string;\n /** The status. */\n status:\n | \"NotStarted\"\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\";\n}\n\n/** The operation user wants to perform. */\nexport interface UserRequestResponseOperationsItemOutput {\n /** The operation type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The payload of each operation which user want to submit. */\n payload: Record<string, unknown>;\n workflowRunIds?: Array<string>;\n}\n\nexport interface WorkflowRunListOutput {\n /** The value of workflow run list. */\n value: Array<WorkflowRunMetadataOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** The execution of a workflow. It includes status of the entire run and other properties of a run. */\nexport interface WorkflowRunMetadataOutput {\n /**\n * The workflow run id.\n *\n * Value may contain a UUID\n */\n id: string;\n /**\n * The workflow id.\n *\n * Value may contain a UUID\n */\n workflowId: string;\n /** Workflow run start time. */\n startTime: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor: string;\n /**\n * The user request id.\n *\n * Value may contain a UUID\n */\n userRequestId?: string;\n /** The input of a workflow run. Align with operation in user request. */\n runPayload: WorkflowRunPayloadOutput;\n /** The status. */\n status:\n | \"NotStarted\"\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\";\n /** The time of workflow run completed. */\n endTime?: string;\n /** The time of workflow run be canceled. */\n cancelTime?: string;\n /** The comment when cancel a workflow run. */\n cancelComment?: string;\n}\n\n/** The input of a workflow run. Align with operation in user request. */\nexport interface WorkflowRunPayloadOutput {\n /** The workflow run payload type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The target value which need involve workflow to update. */\n targetValue: string;\n}\n\n/** The execution of a workflow. It includes workflow action DAG at run time (action DAG snapshot), run payload, status of the entire run and other properties of a run. */\nexport interface WorkflowRunOutput {\n /**\n * The workflow run id.\n *\n * Value may contain a UUID\n */\n id?: string;\n /**\n * The workflow id.\n *\n * Value may contain a UUID\n */\n workflowId?: string;\n /** Workflow run start time. */\n startTime?: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor?: string;\n /**\n * The user request id.\n *\n * Value may contain a UUID\n */\n userRequestId?: string;\n /** The input of a workflow run. Align with operation in user request. */\n runPayload?: WorkflowRunRunPayloadOutput;\n /** The status. */\n status?:\n | \"NotStarted\"\n | \"InProgress\"\n | \"Failed\"\n | \"Completed\"\n | \"Canceling\"\n | \"CancellationFailed\"\n | \"Canceled\";\n /** The time of workflow run completed. */\n endTime?: string;\n /** The time of workflow run be canceled. */\n cancelTime?: string;\n /** The comment when cancel a workflow run. */\n cancelComment?: string;\n /** The action DAG(Directed Acyclic Graph), it defines actual flow. */\n actionDag: Record<string, unknown>;\n /** It refers to the \"detail\" property of a workflow run object, which contains run context and runtime information of actions. */\n detail: WorkflowRunDetailOutput;\n}\n\n/** The input of a workflow run. Align with operation in user request. */\nexport interface WorkflowRunRunPayloadOutput {\n /** The workflow run payload type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The target value which need involve workflow to update. */\n targetValue: string;\n /** The payload of each operation which user want to submit. */\n payload: Record<string, unknown>;\n}\n\n/** It refers to the \"detail\" property of a workflow run object, which contains run context and runtime information of actions. */\nexport interface WorkflowRunDetailOutput {\n /** Built-in variables starts with @runInput. Its properties are determined by trigger type at workflow run time. */\n runInput: Record<string, unknown>;\n /** Any object */\n actions: Record<string, unknown>;\n}\n\nexport interface TasksListOutput {\n /** The value of workflow tasks list. */\n value: Array<WorkflowTaskOutput>;\n /** The URL to get the next set of results. */\n nextLink?: string;\n}\n\n/** An actionable item assigned to assignees. It is created when approval or task action starts to execute. Approval is one kind of task. */\nexport interface WorkflowTaskOutputParent {\n /**\n * The workflow task id.\n *\n * Value may contain a UUID\n */\n id: string;\n /** The workflow task title. */\n title?: string;\n /**\n * The workflow run id.\n *\n * Value may contain a UUID\n */\n workflowRunId: string;\n /**\n * The workflow id.\n *\n * Value may contain a UUID\n */\n workflowId: string;\n /**\n * The person who submitted the user request.\n *\n * Value may contain a UUID\n */\n requestor: string;\n /** The created time. */\n createdTime: string;\n /** The last update time. */\n lastUpdateTime: string;\n /** Info and material that helps assignees to take action. */\n payload: TaskPayloadOutput;\n /** Info of task reminder. */\n reminderInfo?: WorkflowTaskReminderInfoOutput;\n /** Info of task expiry. */\n expiryInfo?: WorkflowTaskExpiryInfoOutput;\n type: \"WorkflowTask\" | \"Approval\" | \"SimpleTask\";\n}\n\n/** Info and material that helps assignees to take action. */\nexport interface TaskPayloadOutput {\n /** The task payload type. */\n type:\n | \"CreateTerm\"\n | \"UpdateTerm\"\n | \"DeleteTerm\"\n | \"ImportTerms\"\n | \"UpdateAsset\"\n | \"GrantDataAccess\";\n /** The target value of entity which user want to involve workflow to update. */\n targetValue: string;\n /** The payload of the task. */\n payload?: Record<string, unknown>;\n}\n\n/** Info of task reminder. */\nexport interface WorkflowTaskReminderInfoOutput {\n /** The last update time. */\n lastRemindTime?: string;\n /** The next remind time. */\n nextRemindTime: string;\n /** The reminder settings. */\n reminderSettings: Record<string, unknown>;\n}\n\n/** Info of task expiry. */\nexport interface WorkflowTaskExpiryInfoOutput {\n /** The last expiry notification time. */\n lastExpiryNotificationTime?: string;\n /** The next expiry notification time. */\n nextExpiryNotificationTime: string;\n /** The expiry time. */\n expiryTime: string;\n expirySettings: WorkflowTaskExpiryInfoExpirySettingsOutput;\n}\n\nexport interface WorkflowTaskExpiryInfoExpirySettingsOutput {\n /** The time of expiry. */\n expireAfter: Record<string, unknown>;\n notifyOnExpiration?: Array<string>;\n}\n\n/** The workflow approval task properties. */\nexport interface ApprovalOutput extends WorkflowTaskOutputParent {\n /** The approval task details */\n approvalDetail?: ApprovalDetailOutput;\n type: \"Approval\";\n}\n\n/** The approval task details */\nexport interface ApprovalDetailOutput {\n /** The approval type of an approval task. */\n approvalType: \"PendingOnAny\" | \"PendingOnAll\";\n /** The status of an approval task. */\n status: \"Pending\" | \"Approved\" | \"Rejected\" | \"Canceled\";\n /** The list of approvers with reply. */\n approvers: Record<string, ApproverResponseOutput>;\n}\n\n/** The response of approvers for a workflow task. */\nexport interface ApproverResponseOutput {\n /** The response for an approval task. */\n reply: \"Approved\" | \"Rejected\" | \"Pending\";\n /** The comment of approving or rejecting an approval request. */\n comment?: string;\n /** The reply time of approver to a workflow task. */\n responseTime?: string;\n}\n\n/** The workflow simple task properties. */\nexport interface SimpleTaskOutput extends WorkflowTaskOutputParent {\n /** Workflow simple task details. */\n taskDetail?: SimpleTaskDetailOutput;\n type: \"SimpleTask\";\n}\n\n/** Workflow simple task details. */\nexport interface SimpleTaskDetailOutput {\n /** The simple task body. */\n taskBody: string;\n /** The users or groups were assigned the simple task. */\n assignedTo: Array<string>;\n /** Simple task status. */\n status: \"NotStarted\" | \"InProgress\" | \"Completed\" | \"Canceled\";\n changeHistory: Array<Record<string, unknown>>;\n}\n\n/** An actionable item assigned to assignees. It is created when approval or task action starts to execute. Approval is one kind of task. */\nexport type WorkflowTaskOutput = ApprovalOutput | SimpleTaskOutput;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAyC1D;;;;;;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,EA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,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { getPagedAsyncIterator } from \"@azure/core-paging\";\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } 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 +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
|
|
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\";\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purviewWorkflow.js","sourceRoot":"","sources":["../../src/purviewWorkflow.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
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;AAIpD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,WAAW,CAAC;IAC1D,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,oBAAoB,CAAC;IAChE,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,oCAAoC,CAAC;SAC/C,GACF,CAAC;IAEF,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,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA0B,CAAC;IAEjF,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 type { TokenCredential } from \"@azure/core-auth\";\nimport type { PurviewWorkflowClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `PurviewWorkflowClient`\n * @param endpoint type: string, The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/\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): PurviewWorkflowClient {\n const baseUrl = options.baseUrl ?? `${endpoint}/workflow`;\n options.apiVersion = options.apiVersion ?? \"2022-05-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-purview-workflow-rest/1.0.0-beta.2`;\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 PurviewWorkflowClient;\n\n return client;\n}\n"]}
|
|
@@ -1 +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
|
|
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\";\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 body: Record<string, unknown>;\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 body: Record<string, unknown>;\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 body: Record<string, unknown>;\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 body: Record<string, unknown>;\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 body: Record<string, unknown>;\n}\n\n/** Update the status of a workflow task request. */\nexport interface UpdateTaskStatusDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/purview-workflow",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.20241111.1",
|
|
6
6
|
"description": "A generated SDK for PurviewWorkflow.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -32,75 +32,70 @@
|
|
|
32
32
|
"node": ">=18.0.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"
|
|
35
|
+
"build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
|
|
36
36
|
"build:browser": "tsc -p . && dev-tool run bundle",
|
|
37
|
+
"build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
|
|
37
38
|
"build:node": "tsc -p . && dev-tool run bundle --browser-test false",
|
|
38
39
|
"build:samples": "echo skipped.",
|
|
39
40
|
"build:test": "tsc -p . && dev-tool run bundle",
|
|
40
|
-
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
|
|
41
41
|
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
|
|
42
|
-
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
42
|
+
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
43
43
|
"execute:samples": "dev-tool samples run samples-dev",
|
|
44
|
-
"extract-api": "rimraf review && mkdirp ./review &&
|
|
44
|
+
"extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
|
|
45
45
|
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
|
|
46
46
|
"generate:client": "autorest --typescript swagger/README.md && npm run format",
|
|
47
|
+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
47
48
|
"integration-test:browser": "dev-tool run test:browser",
|
|
48
49
|
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
|
|
49
|
-
"
|
|
50
|
-
"lint:fix": "eslint package.json api-extractor.json src test --
|
|
51
|
-
"lint": "eslint package.json api-extractor.json src test --ext .ts",
|
|
50
|
+
"lint": "eslint package.json api-extractor.json src test",
|
|
51
|
+
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
|
|
52
52
|
"pack": "npm pack 2>&1",
|
|
53
|
+
"test": "npm run clean && npm run build:test && npm run unit-test",
|
|
53
54
|
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
|
|
54
55
|
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
|
|
55
|
-
"test": "npm run clean && npm run build:test && npm run unit-test",
|
|
56
56
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
57
|
-
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
58
57
|
"unit-test:browser": "dev-tool run test:browser",
|
|
59
|
-
"
|
|
58
|
+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
59
|
+
"update-snippets": "echo skipped"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"autoPublish": false,
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@azure/core-auth": "^1.3.0",
|
|
65
64
|
"@azure-rest/core-client": "^1.0.0",
|
|
65
|
+
"@azure/core-auth": "^1.3.0",
|
|
66
|
+
"@azure/core-paging": "^1.2.0",
|
|
66
67
|
"@azure/core-rest-pipeline": "^1.8.0",
|
|
67
68
|
"@azure/logger": "^1.0.0",
|
|
68
|
-
"tslib": "^2.2.0"
|
|
69
|
-
"@azure/core-paging": "^1.2.0"
|
|
69
|
+
"tslib": "^2.2.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"
|
|
74
|
-
"@types/node": "^18.0.0",
|
|
75
|
-
"dotenv": "^16.0.0",
|
|
76
|
-
"eslint": "^8.0.0",
|
|
77
|
-
"mkdirp": "^2.1.2",
|
|
78
|
-
"rimraf": "^5.0.5",
|
|
79
|
-
"source-map-support": "^0.5.9",
|
|
80
|
-
"typescript": "~5.3.3",
|
|
72
|
+
"@azure-tools/test-credential": "^1.0.0",
|
|
73
|
+
"@azure-tools/test-recorder": "^3.0.0",
|
|
81
74
|
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
|
|
82
75
|
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
83
|
-
"@azure-tools/test-credential": "^1.0.0",
|
|
84
76
|
"@azure/identity": "^4.0.1",
|
|
85
|
-
"@azure-tools/test-recorder": "^3.0.0",
|
|
86
|
-
"mocha": "^10.0.0",
|
|
87
|
-
"@types/mocha": "^10.0.0",
|
|
88
|
-
"cross-env": "^7.0.2",
|
|
89
77
|
"@types/chai": "^4.2.8",
|
|
78
|
+
"@types/mocha": "^10.0.0",
|
|
79
|
+
"@types/node": "^18.0.0",
|
|
80
|
+
"autorest": "latest",
|
|
90
81
|
"chai": "^4.2.0",
|
|
82
|
+
"dotenv": "^16.0.0",
|
|
83
|
+
"eslint": "^9.9.0",
|
|
84
|
+
"karma": "^6.2.0",
|
|
91
85
|
"karma-chrome-launcher": "^3.0.0",
|
|
92
86
|
"karma-coverage": "^2.0.0",
|
|
93
87
|
"karma-env-preprocessor": "^0.1.1",
|
|
94
88
|
"karma-firefox-launcher": "^1.1.0",
|
|
95
89
|
"karma-junit-reporter": "^2.0.1",
|
|
96
|
-
"karma-mocha-reporter": "^2.2.5",
|
|
97
90
|
"karma-mocha": "^2.0.1",
|
|
91
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
98
92
|
"karma-source-map-support": "~1.4.0",
|
|
99
93
|
"karma-sourcemap-loader": "^0.3.8",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
94
|
+
"mocha": "^10.0.0",
|
|
95
|
+
"nyc": "^17.0.0",
|
|
96
|
+
"source-map-support": "^0.5.9",
|
|
102
97
|
"ts-node": "^10.0.0",
|
|
103
|
-
"
|
|
98
|
+
"typescript": "~5.6.2"
|
|
104
99
|
},
|
|
105
100
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-workflow-rest/README.md",
|
|
106
101
|
"//metadata": {
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
import { Client } from '@azure-rest/core-client';
|
|
8
|
-
import { ClientOptions } from '@azure-rest/core-client';
|
|
9
|
-
import { HttpResponse } from '@azure-rest/core-client';
|
|
10
|
-
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
11
|
-
import { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
12
|
-
import { RequestParameters } from '@azure-rest/core-client';
|
|
13
|
-
import { StreamableMethod } from '@azure-rest/core-client';
|
|
14
|
-
import { TokenCredential } from '@azure/core-auth';
|
|
7
|
+
import type { Client } from '@azure-rest/core-client';
|
|
8
|
+
import type { ClientOptions } from '@azure-rest/core-client';
|
|
9
|
+
import type { HttpResponse } from '@azure-rest/core-client';
|
|
10
|
+
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
11
|
+
import type { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
12
|
+
import type { RequestParameters } from '@azure-rest/core-client';
|
|
13
|
+
import type { StreamableMethod } from '@azure-rest/core-client';
|
|
14
|
+
import type { TokenCredential } from '@azure/core-auth';
|
|
15
15
|
|
|
16
16
|
// @public
|
|
17
17
|
export interface ApprovalDetailOutput {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Client } from '@azure-rest/core-client';
|
|
2
|
-
import { ClientOptions } from '@azure-rest/core-client';
|
|
3
|
-
import { HttpResponse } from '@azure-rest/core-client';
|
|
4
|
-
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
5
|
-
import { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
6
|
-
import { RequestParameters } from '@azure-rest/core-client';
|
|
7
|
-
import { StreamableMethod } from '@azure-rest/core-client';
|
|
8
|
-
import { TokenCredential } from '@azure/core-auth';
|
|
1
|
+
import type { Client } from '@azure-rest/core-client';
|
|
2
|
+
import type { ClientOptions } from '@azure-rest/core-client';
|
|
3
|
+
import type { HttpResponse } from '@azure-rest/core-client';
|
|
4
|
+
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
5
|
+
import type { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
6
|
+
import type { RequestParameters } from '@azure-rest/core-client';
|
|
7
|
+
import type { StreamableMethod } from '@azure-rest/core-client';
|
|
8
|
+
import type { TokenCredential } from '@azure/core-auth';
|
|
9
9
|
|
|
10
10
|
/** The approval task details */
|
|
11
11
|
export declare interface ApprovalDetailOutput {
|