@azure-rest/purview-workflow 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +16 -20
  3. package/dist/browser/clientDefinitions.d.ts +85 -0
  4. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  5. package/dist/browser/clientDefinitions.js +4 -0
  6. package/dist/browser/clientDefinitions.js.map +1 -0
  7. package/dist/browser/index.d.ts +11 -0
  8. package/dist/browser/index.d.ts.map +1 -0
  9. package/dist/browser/index.js +13 -0
  10. package/dist/browser/index.js.map +1 -0
  11. package/dist/browser/isUnexpected.d.ts +16 -0
  12. package/dist/browser/isUnexpected.d.ts.map +1 -0
  13. package/{dist-esm/src → dist/browser}/isUnexpected.js +1 -1
  14. package/dist/browser/isUnexpected.js.map +1 -0
  15. package/dist/browser/logger.d.ts +2 -0
  16. package/dist/browser/logger.d.ts.map +1 -0
  17. package/dist/browser/logger.js +5 -0
  18. package/dist/browser/logger.js.map +1 -0
  19. package/dist/browser/models.d.ts +70 -0
  20. package/dist/browser/models.d.ts.map +1 -0
  21. package/dist/browser/models.js +4 -0
  22. package/{dist-esm/src → dist/browser}/models.js.map +1 -1
  23. package/dist/browser/outputModels.d.ts +325 -0
  24. package/dist/browser/outputModels.d.ts.map +1 -0
  25. package/dist/browser/outputModels.js +4 -0
  26. package/{dist-esm/src → dist/browser}/outputModels.js.map +1 -1
  27. package/dist/browser/package.json +3 -0
  28. package/dist/browser/paginateHelper.d.ts +68 -0
  29. package/dist/browser/paginateHelper.d.ts.map +1 -0
  30. package/dist/browser/paginateHelper.js +167 -0
  31. package/dist/browser/paginateHelper.js.map +1 -0
  32. package/dist/browser/parameters.d.ts +109 -0
  33. package/dist/browser/parameters.d.ts.map +1 -0
  34. package/dist/browser/parameters.js +4 -0
  35. package/dist/browser/parameters.js.map +1 -0
  36. package/dist/browser/purviewWorkflow.d.ts +16 -0
  37. package/dist/browser/purviewWorkflow.d.ts.map +1 -0
  38. package/dist/browser/purviewWorkflow.js +43 -0
  39. package/dist/browser/purviewWorkflow.js.map +1 -0
  40. package/dist/browser/responses.d.ts +137 -0
  41. package/dist/browser/responses.d.ts.map +1 -0
  42. package/dist/browser/responses.js +4 -0
  43. package/dist/browser/responses.js.map +1 -0
  44. package/dist/commonjs/clientDefinitions.d.ts +85 -0
  45. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  46. package/dist/commonjs/clientDefinitions.js +5 -0
  47. package/dist/commonjs/clientDefinitions.js.map +1 -0
  48. package/dist/commonjs/index.d.ts +11 -0
  49. package/dist/commonjs/index.d.ts.map +1 -0
  50. package/dist/commonjs/index.js +16 -0
  51. package/dist/commonjs/index.js.map +1 -0
  52. package/dist/commonjs/isUnexpected.d.ts +16 -0
  53. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  54. package/dist/commonjs/isUnexpected.js +86 -0
  55. package/dist/commonjs/isUnexpected.js.map +1 -0
  56. package/dist/commonjs/logger.d.ts +2 -0
  57. package/dist/commonjs/logger.d.ts.map +1 -0
  58. package/dist/commonjs/logger.js +8 -0
  59. package/dist/commonjs/logger.js.map +1 -0
  60. package/dist/commonjs/models.d.ts +70 -0
  61. package/dist/commonjs/models.d.ts.map +1 -0
  62. package/dist/commonjs/models.js +5 -0
  63. package/dist/commonjs/models.js.map +1 -0
  64. package/dist/commonjs/outputModels.d.ts +325 -0
  65. package/dist/commonjs/outputModels.d.ts.map +1 -0
  66. package/dist/commonjs/outputModels.js +5 -0
  67. package/dist/commonjs/outputModels.js.map +1 -0
  68. package/dist/commonjs/package.json +3 -0
  69. package/dist/commonjs/paginateHelper.d.ts +68 -0
  70. package/dist/commonjs/paginateHelper.d.ts.map +1 -0
  71. package/dist/commonjs/paginateHelper.js +170 -0
  72. package/dist/commonjs/paginateHelper.js.map +1 -0
  73. package/dist/commonjs/parameters.d.ts +109 -0
  74. package/dist/commonjs/parameters.d.ts.map +1 -0
  75. package/dist/commonjs/parameters.js +5 -0
  76. package/dist/commonjs/parameters.js.map +1 -0
  77. package/dist/commonjs/purviewWorkflow.d.ts +16 -0
  78. package/dist/commonjs/purviewWorkflow.d.ts.map +1 -0
  79. package/dist/commonjs/purviewWorkflow.js +46 -0
  80. package/dist/commonjs/purviewWorkflow.js.map +1 -0
  81. package/dist/commonjs/responses.d.ts +137 -0
  82. package/dist/commonjs/responses.d.ts.map +1 -0
  83. package/dist/commonjs/responses.js +5 -0
  84. package/dist/commonjs/responses.js.map +1 -0
  85. package/dist/commonjs/tsdoc-metadata.json +11 -0
  86. package/dist/esm/clientDefinitions.d.ts +85 -0
  87. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  88. package/dist/esm/clientDefinitions.js +4 -0
  89. package/dist/esm/clientDefinitions.js.map +1 -0
  90. package/dist/esm/index.d.ts +11 -0
  91. package/dist/esm/index.d.ts.map +1 -0
  92. package/dist/esm/index.js +13 -0
  93. package/dist/esm/index.js.map +1 -0
  94. package/dist/esm/isUnexpected.d.ts +16 -0
  95. package/dist/esm/isUnexpected.d.ts.map +1 -0
  96. package/dist/esm/isUnexpected.js +83 -0
  97. package/dist/esm/isUnexpected.js.map +1 -0
  98. package/dist/esm/logger.d.ts +2 -0
  99. package/dist/esm/logger.d.ts.map +1 -0
  100. package/dist/esm/logger.js +5 -0
  101. package/dist/esm/logger.js.map +1 -0
  102. package/dist/esm/models.d.ts +70 -0
  103. package/dist/esm/models.d.ts.map +1 -0
  104. package/dist/esm/models.js +4 -0
  105. package/dist/esm/models.js.map +1 -0
  106. package/dist/esm/outputModels.d.ts +325 -0
  107. package/dist/esm/outputModels.d.ts.map +1 -0
  108. package/dist/esm/outputModels.js +4 -0
  109. package/dist/esm/outputModels.js.map +1 -0
  110. package/dist/esm/package.json +3 -0
  111. package/dist/esm/paginateHelper.d.ts +68 -0
  112. package/dist/esm/paginateHelper.d.ts.map +1 -0
  113. package/dist/esm/paginateHelper.js +167 -0
  114. package/dist/esm/paginateHelper.js.map +1 -0
  115. package/dist/esm/parameters.d.ts +109 -0
  116. package/dist/esm/parameters.d.ts.map +1 -0
  117. package/dist/esm/parameters.js +4 -0
  118. package/dist/esm/parameters.js.map +1 -0
  119. package/dist/esm/purviewWorkflow.d.ts +16 -0
  120. package/dist/esm/purviewWorkflow.d.ts.map +1 -0
  121. package/dist/esm/purviewWorkflow.js +43 -0
  122. package/dist/esm/purviewWorkflow.js.map +1 -0
  123. package/dist/esm/responses.d.ts +137 -0
  124. package/dist/esm/responses.d.ts.map +1 -0
  125. package/dist/esm/responses.js +4 -0
  126. package/dist/esm/responses.js.map +1 -0
  127. package/dist/react-native/clientDefinitions.d.ts +85 -0
  128. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  129. package/dist/react-native/clientDefinitions.js +4 -0
  130. package/dist/react-native/clientDefinitions.js.map +1 -0
  131. package/dist/react-native/index.d.ts +11 -0
  132. package/dist/react-native/index.d.ts.map +1 -0
  133. package/dist/react-native/index.js +13 -0
  134. package/dist/react-native/index.js.map +1 -0
  135. package/dist/react-native/isUnexpected.d.ts +16 -0
  136. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  137. package/dist/react-native/isUnexpected.js +83 -0
  138. package/dist/react-native/isUnexpected.js.map +1 -0
  139. package/dist/react-native/logger.d.ts +2 -0
  140. package/dist/react-native/logger.d.ts.map +1 -0
  141. package/dist/react-native/logger.js +5 -0
  142. package/dist/react-native/logger.js.map +1 -0
  143. package/dist/react-native/models.d.ts +70 -0
  144. package/dist/react-native/models.d.ts.map +1 -0
  145. package/dist/react-native/models.js +4 -0
  146. package/dist/react-native/models.js.map +1 -0
  147. package/dist/react-native/outputModels.d.ts +325 -0
  148. package/dist/react-native/outputModels.d.ts.map +1 -0
  149. package/dist/react-native/outputModels.js +4 -0
  150. package/dist/react-native/outputModels.js.map +1 -0
  151. package/dist/react-native/package.json +3 -0
  152. package/dist/react-native/paginateHelper.d.ts +68 -0
  153. package/dist/react-native/paginateHelper.d.ts.map +1 -0
  154. package/dist/react-native/paginateHelper.js +167 -0
  155. package/dist/react-native/paginateHelper.js.map +1 -0
  156. package/dist/react-native/parameters.d.ts +109 -0
  157. package/dist/react-native/parameters.d.ts.map +1 -0
  158. package/dist/react-native/parameters.js +4 -0
  159. package/dist/react-native/parameters.js.map +1 -0
  160. package/dist/react-native/purviewWorkflow.d.ts +16 -0
  161. package/dist/react-native/purviewWorkflow.d.ts.map +1 -0
  162. package/dist/react-native/purviewWorkflow.js +43 -0
  163. package/dist/react-native/purviewWorkflow.js.map +1 -0
  164. package/dist/react-native/responses.d.ts +137 -0
  165. package/dist/react-native/responses.d.ts.map +1 -0
  166. package/dist/react-native/responses.js +4 -0
  167. package/dist/react-native/responses.js.map +1 -0
  168. package/package.json +81 -67
  169. package/dist/index.js +0 -188
  170. package/dist/index.js.map +0 -1
  171. package/dist-esm/src/clientDefinitions.js +0 -4
  172. package/dist-esm/src/clientDefinitions.js.map +0 -1
  173. package/dist-esm/src/index.js +0 -13
  174. package/dist-esm/src/index.js.map +0 -1
  175. package/dist-esm/src/isUnexpected.js.map +0 -1
  176. package/dist-esm/src/models.js +0 -4
  177. package/dist-esm/src/outputModels.js +0 -4
  178. package/dist-esm/src/paginateHelper.js +0 -70
  179. package/dist-esm/src/paginateHelper.js.map +0 -1
  180. package/dist-esm/src/parameters.js +0 -4
  181. package/dist-esm/src/parameters.js.map +0 -1
  182. package/dist-esm/src/purviewWorkflow.js +0 -27
  183. package/dist-esm/src/purviewWorkflow.js.map +0 -1
  184. package/dist-esm/src/responses.js +0 -4
  185. package/dist-esm/src/responses.js.map +0 -1
  186. package/review/purview-workflow.api.md +0 -805
  187. package/types/purview-workflow.d.ts +0 -920
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n WorkflowMetadataListOutput,\n ErrorResponseOutput,\n WorkflowOutput,\n UserRequestResponseOutput,\n WorkflowRunListOutput,\n WorkflowRunOutput,\n TasksListOutput,\n WorkflowTaskOutput,\n} from \"./outputModels.js\";\n\n/** List all workflows. */\nexport interface ListWorkflows200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowMetadataListOutput;\n}\n\n/** List all workflows. */\nexport interface ListWorkflowsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get a specific workflow. */\nexport interface GetWorkflow200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowOutput;\n}\n\n/** Get a specific workflow. */\nexport interface GetWorkflowDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Create or replace a workflow. */\nexport interface CreateOrReplaceWorkflow200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowOutput;\n}\n\n/** Create or replace a workflow. */\nexport interface CreateOrReplaceWorkflowDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Delete a workflow. */\nexport interface DeleteWorkflow204Response extends HttpResponse {\n status: \"204\";\n}\n\n/** Delete a workflow. */\nexport interface DeleteWorkflowDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any workflow's trigger matches with an operation in request, a run of the workflow is created. */\nexport interface SubmitUserRequests200Response extends HttpResponse {\n status: \"200\";\n body: UserRequestResponseOutput;\n}\n\n/** Submit a user request for requestor, a user request describes user ask to do operation(s) on Purview. If any workflow's trigger matches with an operation in request, a run of the workflow is created. */\nexport interface SubmitUserRequestsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** List workflow runs. */\nexport interface ListWorkflowRuns200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowRunListOutput;\n}\n\n/** List workflow runs. */\nexport interface ListWorkflowRunsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get a workflow run. */\nexport interface GetWorkflowRun200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowRunOutput;\n}\n\n/** Get a workflow run. */\nexport interface GetWorkflowRunDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Cancel a workflow run. */\nexport interface CancelWorkflowRun200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Cancel a workflow run. */\nexport interface CancelWorkflowRunDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get all workflow tasks. */\nexport interface ListWorkflowTasks200Response extends HttpResponse {\n status: \"200\";\n body: TasksListOutput;\n}\n\n/** Get all workflow tasks. */\nexport interface ListWorkflowTasksDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Get a workflow task. */\nexport interface GetWorkflowTask200Response extends HttpResponse {\n status: \"200\";\n body: WorkflowTaskOutput;\n}\n\n/** Get a workflow task. */\nexport interface GetWorkflowTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Approve an approval task. */\nexport interface ApproveApprovalTask200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Approve an approval task. */\nexport interface ApproveApprovalTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Reject an approval task. */\nexport interface RejectApprovalTask200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Reject an approval task. */\nexport interface RejectApprovalTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Reassign a workflow task. */\nexport interface ReassignWorkflowTask200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Reassign a workflow task. */\nexport interface ReassignWorkflowTaskDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n\n/** Update the status of a workflow task request. */\nexport interface UpdateTaskStatus200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Update the status of a workflow task request. */\nexport interface UpdateTaskStatusDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}
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-beta.1",
5
+ "version": "1.0.0-beta.2",
6
6
  "description": "A generated SDK for PurviewWorkflow.",
7
7
  "keywords": [
8
8
  "node",
@@ -13,94 +13,73 @@
13
13
  "isomorphic"
14
14
  ],
15
15
  "license": "MIT",
16
- "main": "dist/index.js",
17
- "module": "./dist-esm/src/index.js",
18
- "types": "./types/purview-workflow.d.ts",
16
+ "main": "./dist/commonjs/index.js",
17
+ "module": "./dist/esm/index.js",
18
+ "types": "./dist/commonjs/index.d.ts",
19
19
  "repository": "github:Azure/azure-sdk-for-js",
20
20
  "bugs": {
21
21
  "url": "https://github.com/Azure/azure-sdk-for-js/issues"
22
22
  },
23
23
  "files": [
24
24
  "dist/",
25
- "dist-esm/src/",
26
- "types/purview-workflow.d.ts",
27
25
  "README.md",
28
- "LICENSE",
29
- "review/*"
26
+ "LICENSE"
30
27
  ],
31
28
  "engines": {
32
- "node": ">=14.0.0"
29
+ "node": ">=18.0.0"
33
30
  },
34
31
  "scripts": {
35
- "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
36
- "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
37
- "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
32
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
33
+ "build:browser": "dev-tool run build-package && dev-tool run bundle",
34
+ "build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api",
35
+ "build:node": "dev-tool run build-package && dev-tool run bundle --browser-test false",
38
36
  "build:samples": "echo skipped.",
39
- "build:test": "tsc -p . && dev-tool run bundle",
40
- "build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
41
- "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
42
- "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
37
+ "build:test": "dev-tool run build-package && dev-tool run bundle",
38
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
39
+ "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
43
40
  "execute:samples": "dev-tool samples run samples-dev",
44
- "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
45
- "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
41
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
42
+ "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
46
43
  "generate:client": "autorest --typescript swagger/README.md && npm run format",
47
- "integration-test:browser": "dev-tool run test:browser",
48
- "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
49
44
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
50
- "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
51
- "lint": "eslint package.json api-extractor.json src test --ext .ts",
45
+ "integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
46
+ "integration-test:node": "dev-tool run test:vitest --esm",
47
+ "lint": "eslint package.json api-extractor.json src test",
48
+ "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
52
49
  "pack": "npm pack 2>&1",
50
+ "test": "npm run clean && npm run build:test && npm run unit-test",
53
51
  "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
54
52
  "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
53
  "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
- "unit-test:browser": "dev-tool run test:browser",
59
- "build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local"
54
+ "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
55
+ "unit-test:node": "dev-tool run test:vitest",
56
+ "update-snippets": "echo skipped"
60
57
  },
61
58
  "sideEffects": false,
62
59
  "autoPublish": false,
63
60
  "dependencies": {
64
- "@azure/core-auth": "^1.3.0",
65
- "@azure-rest/core-client": "^1.0.0",
66
- "@azure/core-rest-pipeline": "^1.8.0",
67
- "@azure/logger": "^1.0.0",
68
- "tslib": "^2.2.0",
69
- "@azure/core-paging": "^1.2.0"
61
+ "@azure-rest/core-client": "^2.3.1",
62
+ "@azure/core-auth": "^1.9.0",
63
+ "@azure/core-rest-pipeline": "^1.18.0",
64
+ "@azure/logger": "^1.1.4",
65
+ "tslib": "^2.8.1"
70
66
  },
71
67
  "devDependencies": {
72
- "@microsoft/api-extractor": "^7.31.1",
73
- "autorest": "latest",
74
- "@types/node": "^14.0.0",
75
- "dotenv": "^16.0.0",
76
- "eslint": "^8.0.0",
77
- "mkdirp": "^2.1.2",
78
- "prettier": "^2.5.1",
79
- "rimraf": "^3.0.0",
80
- "source-map-support": "^0.5.9",
81
- "typescript": "~4.8.0",
68
+ "@azure-tools/test-credential": "^2.0.0",
69
+ "@azure-tools/test-recorder": "^4.1.0",
70
+ "@azure-tools/test-utils-vitest": "^1.0.0",
82
71
  "@azure/dev-tool": "^1.0.0",
83
72
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
84
- "@azure-tools/test-credential": "^1.0.0",
85
- "@azure/identity": "^2.0.1",
86
- "@azure-tools/test-recorder": "^3.0.0",
87
- "mocha": "^7.1.1",
88
- "@types/mocha": "^7.0.2",
89
- "mocha-junit-reporter": "^1.18.0",
90
- "cross-env": "^7.0.2",
91
- "@types/chai": "^4.2.8",
92
- "chai": "^4.2.0",
93
- "karma-chrome-launcher": "^3.0.0",
94
- "karma-coverage": "^2.0.0",
95
- "karma-env-preprocessor": "^0.1.1",
96
- "karma-firefox-launcher": "^1.1.0",
97
- "karma-junit-reporter": "^2.0.1",
98
- "karma-mocha-reporter": "^2.2.5",
99
- "karma-mocha": "^2.0.1",
100
- "karma-source-map-support": "~1.4.0",
101
- "karma-sourcemap-loader": "^0.3.8",
102
- "karma": "^6.2.0",
103
- "nyc": "^15.0.0"
73
+ "@azure/identity": "^4.5.0",
74
+ "@types/node": "^18.0.0",
75
+ "@vitest/browser": "^3.0.3",
76
+ "@vitest/coverage-istanbul": "^3.0.3",
77
+ "autorest": "latest",
78
+ "dotenv": "^16.0.0",
79
+ "eslint": "^9.9.0",
80
+ "playwright": "^1.49.0",
81
+ "typescript": "~5.7.2",
82
+ "vitest": "^3.0.3"
104
83
  },
105
84
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-workflow-rest/README.md",
106
85
  "//metadata": {
@@ -115,15 +94,50 @@
115
94
  }
116
95
  ]
117
96
  },
118
- "browser": {
119
- "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
120
- },
97
+ "browser": "./dist/browser/index.js",
121
98
  "//sampleConfiguration": {
122
99
  "productName": "Purview Workflow",
123
100
  "productSlugs": [
124
101
  "azure"
125
102
  ],
126
- "disableDocsMs": true,
127
- "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/purview-workflow?view=azure-node-preview"
103
+ "disableDocsMs": true
104
+ },
105
+ "type": "module",
106
+ "tshy": {
107
+ "exports": {
108
+ "./package.json": "./package.json",
109
+ ".": "./src/index.ts"
110
+ },
111
+ "dialects": [
112
+ "esm",
113
+ "commonjs"
114
+ ],
115
+ "esmDialects": [
116
+ "browser",
117
+ "react-native"
118
+ ],
119
+ "selfLink": false,
120
+ "project": "./tsconfig.src.json"
121
+ },
122
+ "exports": {
123
+ "./package.json": "./package.json",
124
+ ".": {
125
+ "browser": {
126
+ "types": "./dist/browser/index.d.ts",
127
+ "default": "./dist/browser/index.js"
128
+ },
129
+ "react-native": {
130
+ "types": "./dist/react-native/index.d.ts",
131
+ "default": "./dist/react-native/index.js"
132
+ },
133
+ "import": {
134
+ "types": "./dist/esm/index.d.ts",
135
+ "default": "./dist/esm/index.js"
136
+ },
137
+ "require": {
138
+ "types": "./dist/commonjs/index.d.ts",
139
+ "default": "./dist/commonjs/index.js"
140
+ }
141
+ }
128
142
  }
129
143
  }
package/dist/index.js DELETED
@@ -1,188 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var coreClient = require('@azure-rest/core-client');
6
- var corePaging = require('@azure/core-paging');
7
-
8
- // Copyright (c) Microsoft Corporation.
9
- /**
10
- * Initialize a new instance of `PurviewWorkflowClient`
11
- * @param endpoint type: string, The account endpoint of your Purview account. Example: https://{accountName}.purview.azure.com/
12
- * @param credentials type: TokenCredential, uniquely identify client credential
13
- * @param options type: ClientOptions, the parameter for all optional parameters
14
- */
15
- function createClient(endpoint, credentials, options = {}) {
16
- var _a, _b;
17
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}/workflow`;
18
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2022-05-01-preview";
19
- options = Object.assign(Object.assign({}, options), { credentials: {
20
- scopes: ["https://purview.azure.net/.default"],
21
- } });
22
- const userAgentInfo = `azsdk-js-purview-workflow-rest/1.0.0-beta.1`;
23
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
24
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
25
- : `${userAgentInfo}`;
26
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
27
- userAgentPrefix,
28
- } });
29
- const client = coreClient.getClient(baseUrl, credentials, options);
30
- return client;
31
- }
32
-
33
- // Copyright (c) Microsoft Corporation.
34
- // Licensed under the MIT license.
35
- const responseMap = {
36
- "GET /workflows": ["200"],
37
- "GET /workflows/{workflowId}": ["200"],
38
- "PUT /workflows/{workflowId}": ["200"],
39
- "DELETE /workflows/{workflowId}": ["204"],
40
- "POST /userrequests": ["200"],
41
- "GET /workflowruns": ["200"],
42
- "GET /workflowruns/{workflowRunId}": ["200"],
43
- "POST /workflowruns/{workflowRunId}/cancel": ["200"],
44
- "GET /workflowtasks": ["200"],
45
- "GET /workflowtasks/{taskId}": ["200"],
46
- "POST /workflowtasks/{taskId}/approve-approval": ["200"],
47
- "POST /workflowtasks/{taskId}/reject-approval": ["200"],
48
- "POST /workflowtasks/{taskId}/reassign": ["200"],
49
- "POST /workflowtasks/{taskId}/change-task-status": ["200"],
50
- };
51
- function isUnexpected(response) {
52
- const lroOriginal = response.headers["x-ms-original-url"];
53
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
54
- const method = response.request.method;
55
- let pathDetails = responseMap[`${method} ${url.pathname}`];
56
- if (!pathDetails) {
57
- pathDetails = getParametrizedPathSuccess(method, url.pathname);
58
- }
59
- return !pathDetails.includes(response.status);
60
- }
61
- function getParametrizedPathSuccess(method, path) {
62
- var _a, _b, _c, _d;
63
- const pathParts = path.split("/");
64
- // Traverse list to match the longest candidate
65
- // matchedLen: the length of candidate path
66
- // matchedValue: the matched status code array
67
- let matchedLen = -1, matchedValue = [];
68
- // Iterate the responseMap to find a match
69
- for (const [key, value] of Object.entries(responseMap)) {
70
- // Extracting the path from the map key which is in format
71
- // GET /path/foo
72
- if (!key.startsWith(method)) {
73
- continue;
74
- }
75
- const candidatePath = getPathFromMapKey(key);
76
- // Get each part of the url path
77
- const candidateParts = candidatePath.split("/");
78
- // track if we have found a match to return the values found.
79
- let found = true;
80
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
81
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
82
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
83
- // If the current part of the candidate is a "template" part
84
- // Try to use the suffix of pattern to match the path
85
- // {guid} ==> $
86
- // {guid}:export ==> :export$
87
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
88
- if (!isMatched) {
89
- found = false;
90
- break;
91
- }
92
- continue;
93
- }
94
- // If the candidate part is not a template and
95
- // the parts don't match mark the candidate as not found
96
- // to move on with the next candidate path.
97
- if (candidateParts[i] !== pathParts[j]) {
98
- found = false;
99
- break;
100
- }
101
- }
102
- // We finished evaluating the current candidate parts
103
- // Update the matched value if and only if we found the longer pattern
104
- if (found && candidatePath.length > matchedLen) {
105
- matchedLen = candidatePath.length;
106
- matchedValue = value;
107
- }
108
- }
109
- return matchedValue;
110
- }
111
- function getPathFromMapKey(mapKey) {
112
- const pathStart = mapKey.indexOf("/");
113
- return mapKey.slice(pathStart);
114
- }
115
-
116
- // Copyright (c) Microsoft Corporation.
117
- /**
118
- * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
119
- * @param client - Client to use for sending the next page requests
120
- * @param initialResponse - Initial response containing the nextLink and current page of elements
121
- * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
122
- * @returns - PagedAsyncIterableIterator to iterate the elements
123
- */
124
- function paginate(client, initialResponse, options = {}) {
125
- let firstRun = true;
126
- const itemName = "value";
127
- const nextLinkName = "nextLink";
128
- const { customGetPage } = options;
129
- const pagedResult = {
130
- firstPageLink: "",
131
- getPage: typeof customGetPage === "function"
132
- ? customGetPage
133
- : async (pageLink) => {
134
- const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
135
- firstRun = false;
136
- checkPagingRequest(result);
137
- const nextLink = getNextLink(result.body, nextLinkName);
138
- const values = getElements(result.body, itemName);
139
- return {
140
- page: values,
141
- nextPageLink: nextLink,
142
- };
143
- },
144
- };
145
- return corePaging.getPagedAsyncIterator(pagedResult);
146
- }
147
- /**
148
- * Gets for the value of nextLink in the body
149
- */
150
- function getNextLink(body, nextLinkName) {
151
- if (!nextLinkName) {
152
- return undefined;
153
- }
154
- const nextLink = body[nextLinkName];
155
- if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
156
- throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
157
- }
158
- return nextLink;
159
- }
160
- /**
161
- * Gets the elements of the current request in the body.
162
- */
163
- function getElements(body, itemName) {
164
- const value = body[itemName];
165
- // value has to be an array according to the x-ms-pageable extension.
166
- // The fact that this must be an array is used above to calculate the
167
- // type of elements in the page in PaginateReturn
168
- if (!Array.isArray(value)) {
169
- throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
170
- }
171
- return value !== null && value !== void 0 ? value : [];
172
- }
173
- /**
174
- * Checks if a request failed
175
- */
176
- function checkPagingRequest(response) {
177
- const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
178
- if (!Http2xxStatusCodes.includes(response.status)) {
179
- throw coreClient.createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
180
- }
181
- }
182
-
183
- // Copyright (c) Microsoft Corporation.
184
-
185
- exports["default"] = createClient;
186
- exports.isUnexpected = isUnexpected;
187
- exports.paginate = paginate;
188
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
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.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as 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;AAOA;;;;;AAKG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,OAAA,GAAyB,EAAE,EAAA;;IAE3B,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,QAAQ,CAAA,SAAA,CAAW,CAAC;IAC1D,OAAO,CAAC,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,oBAAoB,CAAC;AAChE,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,oCAAoC,CAAC;AAC/C,SAAA,EAAA,CACF,CAAC;IAEF,MAAM,aAAa,GAAG,CAAA,2CAAA,CAA6C,CAAC;IACpE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,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IT license.
3
- export {};
4
- //# sourceMappingURL=clientDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n 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 {\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 { 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"]}
@@ -1,13 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import PurviewWorkflow from "./purviewWorkflow";
4
- export * from "./purviewWorkflow";
5
- export * from "./parameters";
6
- export * from "./responses";
7
- export * from "./clientDefinitions";
8
- export * from "./isUnexpected";
9
- export * from "./models";
10
- export * from "./outputModels";
11
- export * from "./paginateHelper";
12
- export default PurviewWorkflow;
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,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\nex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C,0CAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE;oBACd,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;gBACD,SAAS;aACV;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;gBACtC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;aACP;SACF;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;YAC9C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;SACtB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n 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,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=models.js.map
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=outputModels.js.map
@@ -1,70 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { getPagedAsyncIterator } from "@azure/core-paging";
4
- import { createRestError } from "@azure-rest/core-client";
5
- /**
6
- * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
7
- * @param client - Client to use for sending the next page requests
8
- * @param initialResponse - Initial response containing the nextLink and current page of elements
9
- * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
10
- * @returns - PagedAsyncIterableIterator to iterate the elements
11
- */
12
- export function paginate(client, initialResponse, options = {}) {
13
- let firstRun = true;
14
- const itemName = "value";
15
- const nextLinkName = "nextLink";
16
- const { customGetPage } = options;
17
- const pagedResult = {
18
- firstPageLink: "",
19
- getPage: typeof customGetPage === "function"
20
- ? customGetPage
21
- : async (pageLink) => {
22
- const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
23
- firstRun = false;
24
- checkPagingRequest(result);
25
- const nextLink = getNextLink(result.body, nextLinkName);
26
- const values = getElements(result.body, itemName);
27
- return {
28
- page: values,
29
- nextPageLink: nextLink,
30
- };
31
- },
32
- };
33
- return getPagedAsyncIterator(pagedResult);
34
- }
35
- /**
36
- * Gets for the value of nextLink in the body
37
- */
38
- function getNextLink(body, nextLinkName) {
39
- if (!nextLinkName) {
40
- return undefined;
41
- }
42
- const nextLink = body[nextLinkName];
43
- if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
44
- throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
45
- }
46
- return nextLink;
47
- }
48
- /**
49
- * Gets the elements of the current request in the body.
50
- */
51
- function getElements(body, itemName) {
52
- const value = body[itemName];
53
- // value has to be an array according to the x-ms-pageable extension.
54
- // The fact that this must be an array is used above to calculate the
55
- // type of elements in the page in PaginateReturn
56
- if (!Array.isArray(value)) {
57
- throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
58
- }
59
- return value !== null && value !== void 0 ? value : [];
60
- }
61
- /**
62
- * Checks if a request failed
63
- */
64
- function checkPagingRequest(response) {
65
- const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
66
- if (!Http2xxStatusCodes.includes(response.status)) {
67
- throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
68
- }
69
- }
70
- //# sourceMappingURL=paginateHelper.js.map