@azure-rest/purview-workflow 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/LICENSE +4 -4
- package/README.md +65 -92
- package/dist/browser/clientDefinitions.d.ts +85 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +13 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +16 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/isUnexpected.js +5 -6
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models.d.ts +70 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/{dist-esm/src → dist/browser}/models.js.map +1 -1
- package/dist/browser/outputModels.d.ts +325 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/{dist-esm/src → dist/browser}/outputModels.js.map +1 -1
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/paginateHelper.js +70 -3
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +109 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/purviewWorkflow.d.ts +16 -0
- package/dist/browser/purviewWorkflow.d.ts.map +1 -0
- package/dist/browser/purviewWorkflow.js +45 -0
- package/dist/browser/purviewWorkflow.js.map +1 -0
- package/dist/browser/responses.d.ts +137 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +85 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +11 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +16 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +85 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +70 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +325 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +140 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +109 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/purviewWorkflow.d.ts +16 -0
- package/dist/commonjs/purviewWorkflow.d.ts.map +1 -0
- package/dist/commonjs/purviewWorkflow.js +48 -0
- package/dist/commonjs/purviewWorkflow.js.map +1 -0
- package/dist/commonjs/responses.d.ts +137 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/clientDefinitions.d.ts +85 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +16 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +82 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +70 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +325 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +137 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +109 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/purviewWorkflow.d.ts +16 -0
- package/dist/esm/purviewWorkflow.d.ts.map +1 -0
- package/dist/esm/purviewWorkflow.js +45 -0
- package/dist/esm/purviewWorkflow.js.map +1 -0
- package/dist/esm/responses.d.ts +137 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +85 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +11 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +13 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +16 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +82 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +70 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +325 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +137 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +109 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/purviewWorkflow.d.ts +16 -0
- package/dist/react-native/purviewWorkflow.d.ts.map +1 -0
- package/dist/react-native/purviewWorkflow.js +45 -0
- package/dist/react-native/purviewWorkflow.js.map +1 -0
- package/dist/react-native/responses.d.ts +137 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +84 -76
- package/review/{purview-workflow.api.md → purview-workflow-node.api.md} +26 -20
- package/dist/index.js +0 -188
- package/dist/index.js.map +0 -1
- package/dist-esm/src/clientDefinitions.js +0 -4
- package/dist-esm/src/clientDefinitions.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/isUnexpected.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/outputModels.js +0 -4
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/purviewWorkflow.js +0 -27
- package/dist-esm/src/purviewWorkflow.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/types/purview-workflow.d.ts +0 -920
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.
|
|
5
|
+
"version": "1.0.0-beta.3",
|
|
6
6
|
"description": "A generated SDK for PurviewWorkflow.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -13,94 +13,48 @@
|
|
|
13
13
|
"isomorphic"
|
|
14
14
|
],
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"module": "./dist
|
|
18
|
-
"types": "./
|
|
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
26
|
"LICENSE",
|
|
29
|
-
"review
|
|
27
|
+
"review/",
|
|
28
|
+
"CHANGELOG.md"
|
|
30
29
|
],
|
|
31
30
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
33
|
-
},
|
|
34
|
-
"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",
|
|
38
|
-
"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",
|
|
43
|
-
"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\"",
|
|
46
|
-
"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
|
-
"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",
|
|
52
|
-
"pack": "npm pack 2>&1",
|
|
53
|
-
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
|
|
54
|
-
"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
|
-
"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"
|
|
31
|
+
"node": ">=20.0.0"
|
|
60
32
|
},
|
|
61
33
|
"sideEffects": false,
|
|
62
34
|
"autoPublish": false,
|
|
63
35
|
"dependencies": {
|
|
64
|
-
"@azure/core-
|
|
65
|
-
"@azure
|
|
66
|
-
"@azure/core-rest-pipeline": "^1.
|
|
67
|
-
"@azure/logger": "^1.
|
|
68
|
-
"tslib": "^2.
|
|
69
|
-
"@azure/core-paging": "^1.2.0"
|
|
36
|
+
"@azure-rest/core-client": "^2.3.1",
|
|
37
|
+
"@azure/core-auth": "^1.9.0",
|
|
38
|
+
"@azure/core-rest-pipeline": "^1.19.0",
|
|
39
|
+
"@azure/logger": "^1.1.4",
|
|
40
|
+
"tslib": "^2.8.1"
|
|
70
41
|
},
|
|
71
42
|
"devDependencies": {
|
|
72
|
-
"@
|
|
43
|
+
"@azure/identity": "4.11.1",
|
|
44
|
+
"@types/node": "^20.19.0",
|
|
45
|
+
"@vitest/browser": "^3.2.3",
|
|
46
|
+
"@vitest/coverage-istanbul": "^3.2.3",
|
|
73
47
|
"autorest": "latest",
|
|
74
|
-
"@types/node": "^14.0.0",
|
|
75
48
|
"dotenv": "^16.0.0",
|
|
76
|
-
"eslint": "^
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
49
|
+
"eslint": "^9.33.0",
|
|
50
|
+
"playwright": "^1.50.1",
|
|
51
|
+
"typescript": "~5.8.3",
|
|
52
|
+
"vitest": "^3.2.3",
|
|
53
|
+
"@azure-tools/test-credential": "^2.1.1",
|
|
54
|
+
"@azure-tools/test-recorder": "^4.1.0",
|
|
82
55
|
"@azure/dev-tool": "^1.0.0",
|
|
83
|
-
"@azure/
|
|
84
|
-
"@azure
|
|
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"
|
|
56
|
+
"@azure-tools/test-utils-vitest": "^1.0.0",
|
|
57
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
104
58
|
},
|
|
105
59
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-workflow-rest/README.md",
|
|
106
60
|
"//metadata": {
|
|
@@ -115,15 +69,69 @@
|
|
|
115
69
|
}
|
|
116
70
|
]
|
|
117
71
|
},
|
|
118
|
-
"browser":
|
|
119
|
-
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
|
|
120
|
-
},
|
|
72
|
+
"browser": "./dist/browser/index.js",
|
|
121
73
|
"//sampleConfiguration": {
|
|
122
74
|
"productName": "Purview Workflow",
|
|
123
75
|
"productSlugs": [
|
|
124
76
|
"azure"
|
|
125
77
|
],
|
|
126
|
-
"disableDocsMs": true
|
|
127
|
-
|
|
78
|
+
"disableDocsMs": true
|
|
79
|
+
},
|
|
80
|
+
"type": "module",
|
|
81
|
+
"tshy": {
|
|
82
|
+
"project": "../../../tsconfig.src.build.json",
|
|
83
|
+
"exports": {
|
|
84
|
+
"./package.json": "./package.json",
|
|
85
|
+
".": "./src/index.ts"
|
|
86
|
+
},
|
|
87
|
+
"dialects": [
|
|
88
|
+
"esm",
|
|
89
|
+
"commonjs"
|
|
90
|
+
],
|
|
91
|
+
"esmDialects": [
|
|
92
|
+
"browser",
|
|
93
|
+
"react-native"
|
|
94
|
+
],
|
|
95
|
+
"selfLink": false
|
|
96
|
+
},
|
|
97
|
+
"exports": {
|
|
98
|
+
"./package.json": "./package.json",
|
|
99
|
+
".": {
|
|
100
|
+
"browser": {
|
|
101
|
+
"types": "./dist/browser/index.d.ts",
|
|
102
|
+
"default": "./dist/browser/index.js"
|
|
103
|
+
},
|
|
104
|
+
"react-native": {
|
|
105
|
+
"types": "./dist/react-native/index.d.ts",
|
|
106
|
+
"default": "./dist/react-native/index.js"
|
|
107
|
+
},
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./dist/esm/index.d.ts",
|
|
110
|
+
"default": "./dist/esm/index.js"
|
|
111
|
+
},
|
|
112
|
+
"require": {
|
|
113
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
114
|
+
"default": "./dist/commonjs/index.js"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"react-native": "./dist/react-native/index.js",
|
|
119
|
+
"scripts": {
|
|
120
|
+
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
|
121
|
+
"build:samples": "tsc -p tsconfig.samples.json",
|
|
122
|
+
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
|
|
123
|
+
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
124
|
+
"execute:samples": "dev-tool samples run samples-dev",
|
|
125
|
+
"extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
|
|
126
|
+
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\" \"samples-dev/**/*.ts\"",
|
|
127
|
+
"generate:client": "autorest --typescript swagger/README.md && npm run format",
|
|
128
|
+
"lint": "eslint package.json src test",
|
|
129
|
+
"lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
|
|
130
|
+
"pack": "pnpm pack 2>&1",
|
|
131
|
+
"test": "npm run test:node && npm run test:browser",
|
|
132
|
+
"test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
133
|
+
"test:node": "dev-tool run test:vitest",
|
|
134
|
+
"test:node:esm": "dev-tool run test:vitest --esm",
|
|
135
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
128
136
|
}
|
|
129
|
-
}
|
|
137
|
+
}
|
|
@@ -4,14 +4,13 @@
|
|
|
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 {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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 { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
11
|
+
import type { RequestParameters } from '@azure-rest/core-client';
|
|
12
|
+
import type { StreamableMethod } from '@azure-rest/core-client';
|
|
13
|
+
import type { TokenCredential } from '@azure/core-auth';
|
|
15
14
|
|
|
16
15
|
// @public
|
|
17
16
|
export interface ApprovalDetailOutput {
|
|
@@ -39,8 +38,6 @@ export interface ApproveApprovalTask {
|
|
|
39
38
|
|
|
40
39
|
// @public
|
|
41
40
|
export interface ApproveApprovalTask200Response extends HttpResponse {
|
|
42
|
-
// (undocumented)
|
|
43
|
-
body: Record<string, unknown>;
|
|
44
41
|
// (undocumented)
|
|
45
42
|
status: "200";
|
|
46
43
|
}
|
|
@@ -80,8 +77,6 @@ export interface CancelWorkflowRun {
|
|
|
80
77
|
|
|
81
78
|
// @public
|
|
82
79
|
export interface CancelWorkflowRun200Response extends HttpResponse {
|
|
83
|
-
// (undocumented)
|
|
84
|
-
body: Record<string, unknown>;
|
|
85
80
|
// (undocumented)
|
|
86
81
|
status: "200";
|
|
87
82
|
}
|
|
@@ -108,7 +103,7 @@ export interface CancelWorkflowRunMediaTypesParam {
|
|
|
108
103
|
export type CancelWorkflowRunParameters = CancelWorkflowRunMediaTypesParam & CancelWorkflowRunBodyParam & RequestParameters;
|
|
109
104
|
|
|
110
105
|
// @public
|
|
111
|
-
function createClient(endpoint: string, credentials: TokenCredential, options?:
|
|
106
|
+
function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: PurviewWorkflowClientOptions): PurviewWorkflowClient;
|
|
112
107
|
export default createClient;
|
|
113
108
|
|
|
114
109
|
// @public
|
|
@@ -174,7 +169,7 @@ export interface ErrorResponseOutput {
|
|
|
174
169
|
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
|
|
175
170
|
|
|
176
171
|
// @public
|
|
177
|
-
export type GetPage<TPage> = (pageLink: string
|
|
172
|
+
export type GetPage<TPage> = (pageLink: string) => Promise<{
|
|
178
173
|
page: TPage;
|
|
179
174
|
nextPageLink?: string;
|
|
180
175
|
}>;
|
|
@@ -406,6 +401,18 @@ export interface Operation {
|
|
|
406
401
|
type: "CreateTerm" | "UpdateTerm" | "DeleteTerm" | "ImportTerms" | "UpdateAsset" | "GrantDataAccess";
|
|
407
402
|
}
|
|
408
403
|
|
|
404
|
+
// @public
|
|
405
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
406
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
407
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
408
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// @public
|
|
412
|
+
export interface PageSettings {
|
|
413
|
+
continuationToken?: string;
|
|
414
|
+
}
|
|
415
|
+
|
|
409
416
|
// @public
|
|
410
417
|
export function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
|
|
411
418
|
|
|
@@ -426,6 +433,11 @@ export type PurviewWorkflowClient = Client & {
|
|
|
426
433
|
path: Routes;
|
|
427
434
|
};
|
|
428
435
|
|
|
436
|
+
// @public
|
|
437
|
+
export interface PurviewWorkflowClientOptions extends ClientOptions {
|
|
438
|
+
apiVersion?: string;
|
|
439
|
+
}
|
|
440
|
+
|
|
429
441
|
// @public
|
|
430
442
|
export interface ReassignCommand {
|
|
431
443
|
reassignments?: Array<ReassignCommandReassignmentsItem>;
|
|
@@ -444,8 +456,6 @@ export interface ReassignWorkflowTask {
|
|
|
444
456
|
|
|
445
457
|
// @public
|
|
446
458
|
export interface ReassignWorkflowTask200Response extends HttpResponse {
|
|
447
|
-
// (undocumented)
|
|
448
|
-
body: Record<string, unknown>;
|
|
449
459
|
// (undocumented)
|
|
450
460
|
status: "200";
|
|
451
461
|
}
|
|
@@ -478,8 +488,6 @@ export interface RejectApprovalTask {
|
|
|
478
488
|
|
|
479
489
|
// @public
|
|
480
490
|
export interface RejectApprovalTask200Response extends HttpResponse {
|
|
481
|
-
// (undocumented)
|
|
482
|
-
body: Record<string, unknown>;
|
|
483
491
|
// (undocumented)
|
|
484
492
|
status: "200";
|
|
485
493
|
}
|
|
@@ -615,8 +623,6 @@ export interface UpdateTaskStatus {
|
|
|
615
623
|
|
|
616
624
|
// @public
|
|
617
625
|
export interface UpdateTaskStatus200Response extends HttpResponse {
|
|
618
|
-
// (undocumented)
|
|
619
|
-
body: Record<string, unknown>;
|
|
620
626
|
// (undocumented)
|
|
621
627
|
status: "200";
|
|
622
628
|
}
|
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,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E,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;AACH,KAAA;AACH;;AClIA;;;;;;"}
|
|
@@ -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"]}
|
package/dist-esm/src/index.js
DELETED
|
@@ -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\nexport default PurviewWorkflow;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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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G,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"]}
|
package/dist-esm/src/models.js
DELETED