This commit is contained in:
Jose Manuel Heredia Hidalgo 2022-02-09 14:42:55 -08:00 коммит произвёл GitHub
Родитель 0b02072848
Коммит d5e4c233fb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
68 изменённых файлов: 37 добавлений и 4661 удалений

Просмотреть файл

@ -166,8 +166,6 @@ specifiers:
'@rush-temp/core-auth': file:./projects/core-auth.tgz
'@rush-temp/core-client': file:./projects/core-client.tgz
'@rush-temp/core-client-1': file:./projects/core-client-1.tgz
'@rush-temp/core-client-lro': file:./projects/core-client-lro.tgz
'@rush-temp/core-client-paging': file:./projects/core-client-paging.tgz
'@rush-temp/core-crypto': file:./projects/core-crypto.tgz
'@rush-temp/core-http': file:./projects/core-http.tgz
'@rush-temp/core-lro': file:./projects/core-lro.tgz
@ -224,7 +222,6 @@ specifiers:
'@rush-temp/perf-storage-file-datalake': file:./projects/perf-storage-file-datalake.tgz
'@rush-temp/perf-storage-file-share': file:./projects/perf-storage-file-share.tgz
'@rush-temp/perf-template': file:./projects/perf-template.tgz
'@rush-temp/purview-account': file:./projects/purview-account.tgz
'@rush-temp/purview-administration': file:./projects/purview-administration.tgz
'@rush-temp/purview-catalog': file:./projects/purview-catalog.tgz
'@rush-temp/purview-scanning': file:./projects/purview-scanning.tgz
@ -421,8 +418,6 @@ dependencies:
'@rush-temp/core-auth': file:projects/core-auth.tgz
'@rush-temp/core-client': file:projects/core-client.tgz
'@rush-temp/core-client-1': file:projects/core-client-1.tgz
'@rush-temp/core-client-lro': file:projects/core-client-lro.tgz
'@rush-temp/core-client-paging': file:projects/core-client-paging.tgz
'@rush-temp/core-crypto': file:projects/core-crypto.tgz
'@rush-temp/core-http': file:projects/core-http.tgz
'@rush-temp/core-lro': file:projects/core-lro.tgz
@ -479,7 +474,6 @@ dependencies:
'@rush-temp/perf-storage-file-datalake': file:projects/perf-storage-file-datalake.tgz
'@rush-temp/perf-storage-file-share': file:projects/perf-storage-file-share.tgz
'@rush-temp/perf-template': file:projects/perf-template.tgz
'@rush-temp/purview-account': file:projects/purview-account.tgz
'@rush-temp/purview-administration': file:projects/purview-administration.tgz
'@rush-temp/purview-catalog': file:projects/purview-catalog.tgz
'@rush-temp/purview-scanning': file:projects/purview-scanning.tgz
@ -519,29 +513,6 @@ packages:
'@jridgewell/trace-mapping': 0.3.2
dev: false
/@azure-rest/core-client-paging/1.0.0-beta.1:
resolution: {integrity: sha512-khy3o4inJJL0Hz21TGrpcL0Zxiw8BI62+uIVkeiAo0hAaJ6JEl7AM5KOrebSmQDqx7CErVbdVSvQQNeuToSlcw==}
engines: {node: '>=12.0.0'}
dependencies:
'@azure-rest/core-client': 1.0.0-beta.6
'@azure/core-paging': 1.2.1
'@azure/core-rest-pipeline': 1.5.0
tslib: 2.3.1
transitivePeerDependencies:
- supports-color
dev: false
/@azure-rest/core-client/1.0.0-beta.6:
resolution: {integrity: sha512-JIHVi9ZlLN8truNMUBsCYzwbPNdlHCHvpihhiHYJM3fsTR8OV7Pg3/HpnshQ5G3XVg3F8ez0L+u+0XOTs/ZBPw==}
engines: {node: '>=12.0.0'}
dependencies:
'@azure/core-auth': 1.3.2
'@azure/core-rest-pipeline': 1.5.0
tslib: 2.3.1
transitivePeerDependencies:
- supports-color
dev: false
/@azure-rest/core-client/1.0.0-beta.7:
resolution: {integrity: sha512-6+HEW4uN4SBGLxgTtIwPc/wawFYBPTSUkZ8k7OqDaz3EsWYXyYC5UHftrUgG7QFkxpjMAFlwqh9tHzXgvxozHQ==}
engines: {node: '>=12.0.0'}
@ -967,7 +938,7 @@ packages:
resolution: {integrity: sha512-Q71Buur3RMcg6lCnisLL8Im562DBw+ybzgm+YQj/FbAaI8ZNu/zl/5z1fE4k3Q9LSIzYrz6HLRzlhdSBXpydlQ==}
engines: {node: '>=8.0.0'}
dependencies:
'@azure/core-http': 1.2.3
'@azure/core-http': 1.2.6
'@azure/core-tracing': 1.0.0-preview.9
'@azure/logger': 1.0.3
'@azure/msal-node': 1.0.0-beta.6_debug@4.3.3
@ -2128,7 +2099,7 @@ packages:
resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
dependencies:
'@types/connect': 3.4.35
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/chai-as-promised/7.1.4:
@ -2154,14 +2125,14 @@ packages:
/@types/concurrently/6.4.0:
resolution: {integrity: sha512-CYU1eyFHsIa2IZIsb8gfUOdiewfnZcyM2Hg1Zaq95xnmB0Ix/bTRM8SttqZ2Cjy6JGPZLttHjZewVsDg1yvnJg==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
chalk: 4.1.2
dev: false
/@types/connect/3.4.35:
resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/cookie/0.4.1:
@ -2196,7 +2167,7 @@ packages:
/@types/express-serve-static-core/4.17.28:
resolution: {integrity: sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
'@types/qs': 6.9.7
'@types/range-parser': 1.2.4
dev: false
@ -2213,26 +2184,26 @@ packages:
/@types/fs-extra/8.1.2:
resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/fs-extra/9.0.13:
resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/glob/7.2.0:
resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
dependencies:
'@types/minimatch': 3.0.5
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/is-buffer/2.0.0:
resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/json-schema/7.0.9:
@ -2246,13 +2217,13 @@ packages:
/@types/jsonwebtoken/8.5.8:
resolution: {integrity: sha512-zm6xBQpFDIDM6o9r6HSgDeIcLy82TKWctCXEPbJJcXb5AKmi5BNNdLXneixK4lplX3PqIVcwLBCGE/kAGnlD4A==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/jws/3.2.4:
resolution: {integrity: sha512-aqtH4dPw1wUjFZaeMD1ak/pf8iXlu/odFe+trJrvw0g1sTh93i+SCykg0Ek8C6B7rVK3oBORbfZAsKO7P10etg==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/long/4.0.1:
@ -2266,7 +2237,7 @@ packages:
/@types/md5/2.3.1:
resolution: {integrity: sha512-OK3oe+ALIoPSo262lnhAYwpqFNXbiwH2a+0+Z5YBnkQEwWD8fk5+PIeRhYA48PzvX9I4SGNpWy+9bLj8qz92RQ==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/mime/1.3.2:
@ -2292,13 +2263,13 @@ packages:
/@types/mock-fs/4.13.1:
resolution: {integrity: sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/mock-require/2.0.1:
resolution: {integrity: sha512-O7U5DVGboY/Crueb5/huUCIRjKtRVRaLmRDbZJBlDQgJn966z3aiFDN+6AtYviu2ExwMkl34LjT/IiC0OPtKuQ==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/ms/0.7.31:
@ -2312,7 +2283,7 @@ packages:
/@types/node-fetch/2.5.12:
resolution: {integrity: sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
form-data: 3.0.1
dev: false
@ -2351,7 +2322,7 @@ packages:
/@types/resolve/1.17.1:
resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/semaphore/1.1.1:
@ -2362,7 +2333,7 @@ packages:
resolution: {integrity: sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==}
dependencies:
'@types/mime': 1.3.2
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/sinon/10.0.10:
@ -2384,7 +2355,7 @@ packages:
/@types/stoppable/1.1.1:
resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/tough-cookie/4.0.1:
@ -2394,13 +2365,13 @@ packages:
/@types/tunnel/0.0.1:
resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/tunnel/0.0.3:
resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/underscore/1.11.4:
@ -2414,26 +2385,26 @@ packages:
/@types/ws/7.4.7:
resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/ws/8.2.2:
resolution: {integrity: sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/xml2js/0.4.9:
resolution: {integrity: sha512-CHiCKIihl1pychwR2RNX5mAYmJDACgFVCMT5OArMaO3erzwXVcBqPcusr+Vl8yeeXukxZqtF8mZioqX+mpjjdw==}
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
/@types/yauzl/2.9.2:
resolution: {integrity: sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==}
requiresBuild: true
dependencies:
'@types/node': 12.20.43
'@types/node': 17.0.15
dev: false
optional: true
@ -3422,7 +3393,7 @@ packages:
resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==}
deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
dependencies:
ms: 2.1.1
ms: 2.1.3
dev: false
/debug/3.2.7:
@ -3643,7 +3614,7 @@ packages:
dependencies:
semver: 7.3.5
shelljs: 0.8.5
typescript: 4.2.4
typescript: 4.5.5
dev: false
/ecdsa-sig-formatter/1.0.11:
@ -3696,7 +3667,7 @@ packages:
dependencies:
'@types/cookie': 0.4.1
'@types/cors': 2.8.12
'@types/node': 12.20.43
'@types/node': 17.0.15
accepts: 1.3.8
base64id: 2.0.0
cookie: 0.4.2
@ -4531,7 +4502,7 @@ packages:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 3.0.4
minimatch: 3.0.5
once: 1.4.0
path-is-absolute: 1.0.1
dev: false
@ -8342,7 +8313,7 @@ packages:
/wide-align/1.1.5:
resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}
dependencies:
string-width: 1.0.2
string-width: 4.2.3
dev: false
/word-wrap/1.2.3:
@ -8799,7 +8770,7 @@ packages:
dev: false
file:projects/ai-form-recognizer.tgz:
resolution: {integrity: sha512-P8TSFPYonsRq17g0lGwIkF+WP0G4EPS39m0rrFGbRB49fIQ2ZOTiACPH4pWPQWDa6q5CbXMKOvJZfDwkvArpHQ==, tarball: file:projects/ai-form-recognizer.tgz}
resolution: {integrity: sha512-ownHpGufsptjT7As1HseE8LnhkNj/td/UB99hRgXU0EcSo2f2FvKFmxvkhd2s9SGdoxt22yty5r1BzbkBIvrSw==, tarball: file:projects/ai-form-recognizer.tgz}
name: '@rush-temp/ai-form-recognizer'
version: 0.0.0
dependencies:
@ -8840,7 +8811,6 @@ packages:
transitivePeerDependencies:
- bufferutil
- debug
- encoding
- supports-color
- utf-8-validate
dev: false
@ -13183,86 +13153,6 @@ packages:
- utf-8-validate
dev: false
file:projects/core-client-lro.tgz:
resolution: {integrity: sha512-dA0KuMuSKw8szrqdSZJkGnZcpJp623JRTJafqRkGkdhNWGYxIeWwZgU8TsyfhIkHitYty4xKRIAu+MHOzh+ZBA==, tarball: file:projects/core-client-lro.tgz}
name: '@rush-temp/core-client-lro'
version: 0.0.0
dependencies:
'@azure-rest/core-client': 1.0.0-beta.7
'@microsoft/api-extractor': 7.19.4
'@types/chai': 4.3.0
'@types/mocha': 7.0.2
'@types/node': 12.20.43
chai: 4.3.6
cross-env: 7.0.3
eslint: 7.32.0
inherits: 2.0.4
karma: 6.3.15
karma-chrome-launcher: 3.1.0
karma-coverage: 2.1.1
karma-edge-launcher: 0.4.2_karma@6.3.15
karma-env-preprocessor: 0.1.1
karma-firefox-launcher: 1.3.0
karma-ie-launcher: 1.0.0_karma@6.3.15
karma-junit-reporter: 2.0.1_karma@6.3.15
karma-mocha: 2.0.1
karma-mocha-reporter: 2.2.5_karma@6.3.15
karma-sourcemap-loader: 0.3.8
mocha: 7.2.0
mocha-junit-reporter: 2.0.2_mocha@7.2.0
prettier: 2.5.1
rimraf: 3.0.2
sinon: 9.2.4
tslib: 2.3.1
typescript: 4.2.4
util: 0.12.4
transitivePeerDependencies:
- bufferutil
- debug
- supports-color
- utf-8-validate
dev: false
file:projects/core-client-paging.tgz:
resolution: {integrity: sha512-KPsf8E8N4I5aFVNJSfqxO1+++QuGA9J7349v/c6IuMpQk3um5maRI4lKLsLRuTGWvhH6qo5m+/WU3NiewQ2SWQ==, tarball: file:projects/core-client-paging.tgz}
name: '@rush-temp/core-client-paging'
version: 0.0.0
dependencies:
'@azure-rest/core-client': 1.0.0-beta.7
'@microsoft/api-extractor': 7.19.4
'@types/chai': 4.3.0
'@types/mocha': 7.0.2
'@types/node': 12.20.43
chai: 4.3.6
cross-env: 7.0.3
eslint: 7.32.0
inherits: 2.0.4
karma: 6.3.15
karma-chrome-launcher: 3.1.0
karma-coverage: 2.1.1
karma-edge-launcher: 0.4.2_karma@6.3.15
karma-env-preprocessor: 0.1.1
karma-firefox-launcher: 1.3.0
karma-ie-launcher: 1.0.0_karma@6.3.15
karma-junit-reporter: 2.0.1_karma@6.3.15
karma-mocha: 2.0.1
karma-mocha-reporter: 2.2.5_karma@6.3.15
karma-sourcemap-loader: 0.3.8
mocha: 7.2.0
mocha-junit-reporter: 2.0.2_mocha@7.2.0
prettier: 2.5.1
rimraf: 3.0.2
sinon: 9.2.4
tslib: 2.3.1
typescript: 4.2.4
util: 0.12.4
transitivePeerDependencies:
- bufferutil
- debug
- supports-color
- utf-8-validate
dev: false
file:projects/core-client.tgz:
resolution: {integrity: sha512-PtXu2tdeBOmMdUlWxsxh9SUxhJtzjYmhjy0BpwJFkGaLIqcriWwrRLJaXlNr6CMjB3v7cm5o3gV60MJDbzSyKA==, tarball: file:projects/core-client.tgz}
name: '@rush-temp/core-client'
@ -14022,7 +13912,7 @@ packages:
dev: false
file:projects/eventgrid.tgz:
resolution: {integrity: sha512-9BGMqsBlp2lJdjX4ZlpoQuRKM/sLcpaIHFI7xaztqIaCq17bheVkFsBqw6izuZ59sn4DkAmcsovdtlA4S+jO5w==, tarball: file:projects/eventgrid.tgz}
resolution: {integrity: sha512-cRipNDlfS0co7HptArkxqp6lbNAffyBqpvSVSDhMe/ZR5cBJs6ywzCsV/QxHhxBpp6Z7p5To9h98IYOOIhMp+A==, tarball: file:projects/eventgrid.tgz}
name: '@rush-temp/eventgrid'
version: 0.0.0
dependencies:
@ -14076,7 +13966,7 @@ packages:
dev: false
file:projects/eventhubs-checkpointstore-blob.tgz:
resolution: {integrity: sha512-mGcs2vWqVqLXm7vXEIvHN5fB82d0MGEuCUFxZkmnwISHGLgj0Eg/yGM4WsDouYtUFdboeTrNSg1gaORB+WrC5A==, tarball: file:projects/eventhubs-checkpointstore-blob.tgz}
resolution: {integrity: sha512-Zjderk9z4yJ2X0VCX+Bg2mv4sRQQVGvPYhz4bqwQe8ekduCFek0KT0230RKdGANBSmWtYN/zbxmPbjexRtOv8A==, tarball: file:projects/eventhubs-checkpointstore-blob.tgz}
name: '@rush-temp/eventhubs-checkpointstore-blob'
version: 0.0.0
dependencies:
@ -14330,7 +14220,7 @@ packages:
dev: false
file:projects/iot-device-update.tgz:
resolution: {integrity: sha512-XwF1/EW7RR/mN5meDZOLMADblUIf6RywLM7pIbHeDfDxcfkihfXEMTvl7aLF26rA04TPxRah4r+OKrCbi8Sv7g==, tarball: file:projects/iot-device-update.tgz}
resolution: {integrity: sha512-rsm9IpQrX4PDeRoGSnfHltpD9jmpulpHFNu/lxAyTKHQPAk2Ji9ag1panuQZwQp+2ASA3AoA6DzbB2Q2Mx29cQ==, tarball: file:projects/iot-device-update.tgz}
name: '@rush-temp/iot-device-update'
version: 0.0.0
dependencies:
@ -15216,7 +15106,7 @@ packages:
dev: false
file:projects/perf-service-bus.tgz:
resolution: {integrity: sha512-pKuhxHEjhyGAKk5t/XaVzB6JHLSGzv/PE9Q5zgt+fEkcKrw19H7qsWJsBqPU2TIHjX1ddRgv+GW0c79shGEWbg==, tarball: file:projects/perf-service-bus.tgz}
resolution: {integrity: sha512-I9NPyEoKnxP89clzbNdSHyCWIYH86+mEBa8PR9tZLv7waQHsjFtuQj6tBhkqEqODTLjmKpJgr5ikmc7ZufEKBQ==, tarball: file:projects/perf-service-bus.tgz}
name: '@rush-temp/perf-service-bus'
version: 0.0.0
dependencies:
@ -15234,7 +15124,6 @@ packages:
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- encoding
- supports-color
dev: false
@ -15325,53 +15214,6 @@ packages:
- supports-color
dev: false
file:projects/purview-account.tgz:
resolution: {integrity: sha512-JB2sJQZWmmoFemh9XYQ19qWt3N/8f5VclG4KG/QhPVKcJAzlslY68xX7Q6zmITztfKj7uFRIzyTXyC3E85nM6g==, tarball: file:projects/purview-account.tgz}
name: '@rush-temp/purview-account'
version: 0.0.0
dependencies:
'@azure-rest/core-client': 1.0.0-beta.7
'@azure-rest/core-client-paging': 1.0.0-beta.1
'@azure-tools/test-recorder': 1.0.2
'@microsoft/api-extractor': 7.19.4
'@types/chai': 4.3.0
'@types/mocha': 7.0.2
'@types/node': 12.20.43
chai: 4.3.6
cross-env: 7.0.3
dotenv: 8.6.0
eslint: 7.32.0
karma: 6.3.15
karma-chrome-launcher: 3.1.0
karma-coverage: 2.1.1
karma-edge-launcher: 0.4.2_karma@6.3.15
karma-env-preprocessor: 0.1.1
karma-firefox-launcher: 1.3.0
karma-ie-launcher: 1.0.0_karma@6.3.15
karma-json-preprocessor: 0.3.3_karma@6.3.15
karma-json-to-file-reporter: 1.0.1
karma-junit-reporter: 2.0.1_karma@6.3.15
karma-mocha: 2.0.1
karma-mocha-reporter: 2.2.5_karma@6.3.15
karma-source-map-support: 1.4.0
karma-sourcemap-loader: 0.3.8
mkdirp: 1.0.4
mocha: 7.2.0
mocha-junit-reporter: 2.0.2_mocha@7.2.0
nyc: 15.1.0
prettier: 2.5.1
rimraf: 3.0.2
source-map-support: 0.5.21
tslib: 2.3.1
typescript: 4.2.4
transitivePeerDependencies:
- bufferutil
- debug
- encoding
- supports-color
- utf-8-validate
dev: false
file:projects/purview-administration.tgz:
resolution: {integrity: sha512-qwAKjd1LG91KHMU3KDLYYcn4kaXGAAt9bOPSmQhdw+SfogUEnorWSRDpC8wiaJIkFGNaqLnLLxxTjGRIsnKv6g==, tarball: file:projects/purview-administration.tgz}
name: '@rush-temp/purview-administration'
@ -15560,7 +15402,7 @@ packages:
dev: false
file:projects/schema-registry-avro.tgz:
resolution: {integrity: sha512-oLhIB2Nqhk9vYYmhFaVfP0XdBJigpfdN37dHtNKbCjaUp9Vg5g9XyRCkqTdNrsDT6aNDpvQAW8g9Vm2V/roZgQ==, tarball: file:projects/schema-registry-avro.tgz}
resolution: {integrity: sha512-RzaQoBIbNzOWnTtlJWWGMSWRWwqeu2hPKKCXc32ZOnpj5F/VJHN+TXdCxB2luIMRam7ufqbhPSM218df4+nulA==, tarball: file:projects/schema-registry-avro.tgz}
name: '@rush-temp/schema-registry-avro'
version: 0.0.0
dependencies:
@ -16156,7 +15998,7 @@ packages:
dev: false
file:projects/synapse-access-control.tgz:
resolution: {integrity: sha512-r+K5go02ZzvB1eNv2HgJluelwAinqtfhWqRX4/yV5lfL7RMk3gizbot6n8Ne8aBVxiXRWPNRDKnEz9l8bTju7Q==, tarball: file:projects/synapse-access-control.tgz}
resolution: {integrity: sha512-8OFSsIvvqKFB4r7z6QtpS+ElPHWoYwnnd8q25qy7+sD5Y6Fke1y/IQ16i0Se/DEnUbO7qOMaLgs1vF0PT/VJkg==, tarball: file:projects/synapse-access-control.tgz}
name: '@rush-temp/synapse-access-control'
version: 0.0.0
dependencies:

Просмотреть файл

@ -60,10 +60,6 @@
"name": "core-client-rest",
"path": "sdk/core/core-client-rest"
},
{
"name": "core-client-lro-rest",
"path": "sdk/core/core-client-lro-rest"
},
{
"name": "ai-document-translator",
"path": "sdk/documenttranslator/ai-document-translator-rest"

Просмотреть файл

@ -256,7 +256,6 @@ function ValidatePackagesForDocs($packages, $DocValidationImageId) {
$PackageExclusions = @{
'@azure/identity-vscode' = 'Fails type2docfx execution https://github.com/Azure/azure-sdk-for-js/issues/16303';
'@azure/identity-cache-persistence' = 'Fails typedoc2fx execution https://github.com/Azure/azure-sdk-for-js/issues/16310';
'@azure-rest/core-client-paging' = 'Cannot find types/latest/core-client-paging-rest.d.ts https://github.com/Azure/azure-sdk-for-js/issues/16677';
'@azure/core-asynciterator-polyfill' = 'Docs CI fails https://github.com/Azure/azure-sdk-for-js/issues/16675';
}

Просмотреть файл

@ -5,9 +5,6 @@ const { spawnSync } = require("child_process");
const reducedDependencyTestMatrix = {
'core': ['@azure-rest/core-client',
'@azure-rest/core-client-lro',
'@azure-rest/core-client-paging',
'@azure-rest/purview-account',
'@azure-tests/perf-storage-blob',
'@azure/ai-text-analytics',
'@azure/arm-compute',
@ -24,7 +21,6 @@ const reducedDependencyTestMatrix = {
'@azure/synapse-monitoring'
],
'test-utils': [
'@azure-rest/purview-account',
'@azure-tests/perf-storage-blob',
'@azure-tests/perf-data-tables',
'@azure/arm-eventgrid',
@ -37,9 +33,6 @@ const reducedDependencyTestMatrix = {
],
'identity': [
'@azure-rest/core-client',
'@azure-rest/core-client-lro',
'@azure-rest/core-client-paging',
'@azure-rest/purview-account',
'@azure-tests/perf-storage-blob',
'@azure/ai-text-analytics',
'@azure/arm-compute',
@ -107,7 +100,7 @@ const getPackageJsons = (searchDir) => {
const getServicePackages = (baseDir, serviceDirs) => {
const packageNames = [];
const packageDirs = [];
const validSdkTypes = ["client", "mgmt", "perf-test", "utility"]; // valid "sdk-type"s that we are looking for, to be able to apply rush-runner jobs on
const validSdkTypes = ["client", "mgmt", "perf-test", "utility"]; // valid "sdk-type"s that we are looking for, to be able to apply rush-runner jobs on
for (const serviceDir of serviceDirs) {
const searchDir = path.resolve(path.join(baseDir, "sdk", serviceDir));
const packageJsons = getPackageJsons(searchDir);

Просмотреть файл

@ -336,11 +336,6 @@
"projectFolder": "sdk/agrifood/agrifood-farming-rest",
"versionPolicyName": "client"
},
{
"packageName": "@azure-rest/purview-account",
"projectFolder": "sdk/purview/purview-account-rest",
"versionPolicyName": "client"
},
{
"packageName": "@azure-rest/purview-administration",
"projectFolder": "sdk/purview/purview-administration-rest",
@ -446,21 +441,11 @@
"projectFolder": "sdk/core/core-amqp",
"versionPolicyName": "core"
},
{
"packageName": "@azure-rest/core-client-lro",
"projectFolder": "sdk/core/core-client-lro-rest",
"versionPolicyName": "core"
},
{
"packageName": "@azure-rest/core-client",
"projectFolder": "sdk/core/core-client-rest",
"versionPolicyName": "core"
},
{
"packageName": "@azure-rest/core-client-paging",
"projectFolder": "sdk/core/core-client-paging-rest",
"versionPolicyName": "core"
},
{
"packageName": "@azure/core-asynciterator-polyfill",
"projectFolder": "sdk/core/core-asynciterator-polyfill",

Просмотреть файл

@ -49,10 +49,6 @@ extends:
safeName: azurecoreclient
- name: azure-rest-core-client
safeName: azurerestcoreclient
- name: azure-rest-core-client-paging
safeName: azurerestcoreclientpaging
- name: azure-rest-core-client-lro
safeName: azurerestcoreclientlro
- name: azure-core-crypto
safeName: azurecorecrypto
- name: azure-core-http

Просмотреть файл

@ -1,5 +0,0 @@
# Release History
## 1.0.0-beta.1 (2021-08-10)
- First release of package, see README.md for details.

Просмотреть файл

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2021 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -1,37 +0,0 @@
# Azure Rest Core LRO library for JavaScript
This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript). Specifically for rest level clients, as a helper to handle long running operations. This package implements support for Autorest `x-ms-long-running-operation` specification.
## Getting started
### Requirements
- [Node.js](https://nodejs.org) LTS
### Installation
This package is primarily used in generated code and not meant to be consumed directly by end users.
## Key concepts
### Helper function `getLongRunningPoller`
## Examples
Examples can be found in the `samples` folder.
## Next steps
You can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes.
Learn more about [AutoRest](https://github.com/Azure/autorest) and the [autorest.typescript extension](https://github.com/Azure/autorest.typescript) for generating a compatible client on top of this package.
## Troubleshooting
If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore-rest%2Fcore-client%2FREADME.png)

Просмотреть файл

@ -1,31 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "types/latest/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/latest/core-client-lro-rest.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

Просмотреть файл

@ -1,121 +0,0 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["mocha"],
plugins: [
"karma-mocha",
"karma-mocha-reporter",
"karma-chrome-launcher",
"karma-edge-launcher",
"karma-firefox-launcher",
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
],
// list of files / patterns to load in the browser
files: [
// Uncomment the cdn link below for the polyfill service to support IE11 missing features
// Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys
// "https://cdn.polyfill.io/v2/polyfill.js?features=Symbol,Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always",
"dist-test/index.browser.js",
],
// list of files / patterns to exclude
exclude: [],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"dist-test/index.browser.js": ["coverage"]
},
// inject following environment values into browser testing with window.__env__
// environment values MUST be exported or set with same console running "karma start"
// https://www.npmjs.com/package/karma-env-preprocessor
// EXAMPLE: envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "junit"],
coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
],
},
junitReporter: {
outputDir: "", // results will be saved as $outputDir/$browserName.xml
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: "", // suite will become the package name attribute in xml testsuite element
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {}, // key value pair of properties to add to the <properties> section of the report
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE'
browsers: ["ChromeHeadlessNoSandbox"],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: "ChromeHeadless",
flags: ["--no-sandbox"],
},
},
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: 1,
browserNoActivityTimeout: 600000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000",
},
},
});
};

Просмотреть файл

@ -1,94 +0,0 @@
{
"name": "@azure-rest/core-client-lro",
"version": "1.0.0-beta.1",
"description": "A helper library which implements Autorest x-ms-long-running-operation spec to handle long running operations.",
"sdk-type": "client",
"main": "dist/index.js",
"module": "dist-esm/src/index.js",
"types": "types/latest/core-client-lro-rest.d.ts",
"browser": {
"./dist-esm/test/utils/url.js": "./dist-esm/test/utils/url.browser.js"
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:samples": "echo Obsolete",
"build:test": "tsc -p . && dev-tool run bundle",
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-* temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
"dist/",
"dist-esm/src/",
"types/latest/core-client-lro-rest.d.ts",
"README.md",
"LICENSE"
],
"repository": "github:Azure/azure-sdk-for-js",
"keywords": [
"azure",
"cloud"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"engines": {
"node": ">=12.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client-lro-rest/README.md",
"sideEffects": false,
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure-rest/core-client": "1.0.0-beta.7",
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@microsoft/api-extractor": "^7.18.11",
"@types/chai": "^4.1.6",
"@types/mocha": "^7.0.2",
"@types/node": "^12.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"eslint": "^7.15.0",
"inherits": "^2.0.3",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
"karma-edge-launcher": "^0.4.2",
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-junit-reporter": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-mocha": "^2.0.1",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^7.1.1",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.2.0",
"util": "^0.12.1"
}
}

Просмотреть файл

@ -1,32 +0,0 @@
## API Report File for "@azure-rest/core-client-lro"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { Client } from '@azure-rest/core-client';
import { HttpResponse } from '@azure-rest/core-client';
import { LroEngineOptions } from '@azure/core-lro';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
// @public
export function getLongRunningPoller<TResult extends HttpResponse>(client: Client, initialResponse: TResult): PollerLike<PollOperationState<TResult>, TResult>;
// @public
export function getLongRunningPoller<TResult extends HttpResponse>(client: Client, initialResponse: TResult, pollerOptions: LroEngineOptions<TResult, PollOperationState<TResult>>): PollerLike<PollOperationState<TResult>, TResult>;
export { LroEngineOptions }
export { PollerLike }
// @public
export interface PollerOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
export { PollOperationState }
```

Просмотреть файл

@ -1,95 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { Client, HttpResponse } from "@azure-rest/core-client";
import {
LongRunningOperation,
LroEngine,
LroEngineOptions,
LroResponse,
PollOperationState,
PollerLike,
} from "@azure/core-lro";
/**
* Options for the poller
*/
export interface PollerOptions {
/**
* Defines how much time the poller is going to wait before making a new request to the service.
*/
updateIntervalInMs?: number;
/**
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
*/
resumeFrom?: string;
}
/**
* Helper function that builds a Poller object to help polling a long running operation.
* @param client - Client to use for sending the request to get additional pages.
* @param initialResponse - The initial response.
* @returns - A poller object to poll for operation state updates and eventually get the final response.
*/
export function getLongRunningPoller<TResult extends HttpResponse>(
client: Client,
initialResponse: TResult
): PollerLike<PollOperationState<TResult>, TResult>;
/**
* Helper function that builds a Poller object to help polling a long running operation.
* @param client - Client to use for sending the request to get additional pages.
* @param initialResponse - The initial response.
* @param pollerOptions - Options to set a resume state or custom polling interval.
* @returns - A poller object to poll for operation state updates and eventually get the final response.
*/
export function getLongRunningPoller<TResult extends HttpResponse>(
client: Client,
initialResponse: TResult,
pollerOptions: LroEngineOptions<TResult, PollOperationState<TResult>>
): PollerLike<PollOperationState<TResult>, TResult>;
export function getLongRunningPoller<TResult extends HttpResponse>(
client: Client,
initialResponse: TResult,
pollerOptions?: LroEngineOptions<TResult, PollOperationState<TResult>>
): PollerLike<PollOperationState<TResult>, TResult> {
const poller: LongRunningOperation<TResult> = {
requestMethod: initialResponse.request.method,
requestPath: initialResponse.request.url,
sendInitialRequest: async () => {
// In the case of Rest Clients we are building the LRO poller object from a response that's the reason
// we are not triggering the initial request here, just extracting the information from the
// response we were provided.
return getLroResponse(initialResponse);
},
sendPollRequest: async (path) => {
// This is the callback that is going to be called to poll the service
// to get the latest status. We use the client provided and the polling path
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();
return getLroResponse(response as TResult);
},
};
return new LroEngine(poller, pollerOptions);
}
/**
* Converts a Rest Client response to a response that the LRO engine knows about
* @param response - a rest client http response
* @returns - An LRO response that the LRO engine can work with
*/
function getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {
if (Number.isNaN(response.status)) {
throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
}
return {
flatResponse: response,
rawResponse: {
...response,
statusCode: Number.parseInt(response.status),
body: response.body,
},
};
}

Просмотреть файл

@ -1,10 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* A helper library which implements Autorest x-ms-long-running-operation spec for long-running operations
*
* @packageDocumentation
*/
export { getLongRunningPoller, PollerOptions } from "./getLongRunningHelper";
export { PollerLike, PollOperationState, LroEngineOptions } from "@azure/core-lro";

Просмотреть файл

@ -1,289 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { assert } from "chai";
import { Client, getClient } from "@azure-rest/core-client";
import { getLongRunningPoller } from "../src/getLongRunningHelper";
import { createHttpHeaders, HttpHeaders, HttpMethods } from "@azure/core-rest-pipeline";
import { URL } from "./utils/url";
describe("LRO helper", () => {
let client: Client;
beforeEach(() => {
client = getClient("http://localhost:3000", { allowInsecureConnection: true });
client.pipeline.getOrderedPolicies().forEach(({ name }) => {
client.pipeline.removePolicy({ name });
});
});
it("LROs_put200Succeeded", async () => {
// Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=Succeeded.
const expectedBody = { properties: { provisioningState: "Succeeded" }, id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/200/succeeded",
method: "PUT",
response: { status: 200, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/200/succeeded").put();
const poller = getLongRunningPoller(client, initialResponse);
const result = await poller.pollUntilDone();
assert.equal(result.status, "200");
assert.deepEqual(result.body, expectedBody);
});
it("LROs_put201Succeeded", async () => {
// Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Succeeded.
const expectedBody = { properties: { provisioningState: "Succeeded" }, id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/201/succeeded",
method: "PUT",
response: { status: 201, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/201/succeeded").put();
const poller = getLongRunningPoller(client, initialResponse);
const result = await poller.pollUntilDone();
assert.equal(result.status, "201");
assert.deepEqual(result.body, expectedBody);
});
it("LROs_post202List", async () => {
// Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }].
const expectedBody = [{ id: "100", name: "foo" }];
mockResponse(client, [
{
path: "/lro/list",
method: "POST",
response: {
status: 202,
headers: createHttpHeaders({
// Set the location for polling
"azure-asyncoperation": "http://localhost:3000/lro/list/pollingGet",
// Set location for getting the result once polling finished
location: "http://localhost:3000/lro/list/finalGet",
}),
},
},
{
path: "/lro/list/pollingGet",
method: "GET",
response: { status: 200, body: { status: "Succeeded" } },
},
{ path: "/lro/list/finalGet", method: "GET", response: { status: 200, body: expectedBody } },
]);
const initialResponse = await client.pathUnchecked("/lro/list").post();
const poller = getLongRunningPoller(client, initialResponse, { intervalInMs: 1 });
const result = await poller.pollUntilDone();
assert.equal(result.status, "200");
assert.deepEqual(result.body, expectedBody);
});
it("LROs_put200SucceededNoState", async () => {
// Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=Succeeded.
const expectedBody = { id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/200/succeeded/nostate",
method: "PUT",
response: { status: 200, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/200/succeeded/nostate").put();
const poller = getLongRunningPoller(client, initialResponse);
const result = await poller.pollUntilDone();
assert.equal(result.status, "200");
assert.deepEqual(result.body, expectedBody);
});
it("LROs_put200UpdatingSucceeded200", async () => {
// Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Updating. Polls return this value until the last poll returns a 200 with ProvisioningState=Succeeded
const expectedBody = { properties: { provisioningState: "Succeeded" }, id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/200/updating/succeeded/200",
method: "PUT",
response: {
status: 200,
body: { properties: { provisioningState: "Updating" }, id: "100", name: "foo" },
},
},
{
path: "/lro/put/200/updating/succeeded/200",
method: "GET",
response: { status: 200, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/200/updating/succeeded/200").put();
const poller = getLongRunningPoller(client, initialResponse, { intervalInMs: 1 });
const result = await poller.pollUntilDone();
assert.equal(result.status, "200");
assert.deepEqual(result.body, expectedBody);
});
it("LROs_put201CreatingFailed200", async () => {
// Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Created. Polls return this value until the last poll returns a 200 with ProvisioningState=Failed const expectedBody = { "properties": { "provisioningState": "Succeeded"}, "id": "100", "name": "foo" }
const expectedBody = { properties: { provisioningState: "Failed" }, id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/201/created/failed/200",
method: "PUT",
response: {
status: 201,
body: { properties: { provisioningState: "Created" }, id: "100", name: "foo" },
},
},
{
path: "/lro/put/201/created/failed/200",
method: "GET",
response: { status: 200, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/201/created/failed/200").put();
const poller = getLongRunningPoller(client, initialResponse, { intervalInMs: 1 });
try {
await poller.pollUntilDone();
assert.fail("Expected exception");
} catch (error) {
assert.equal(
error.message,
"The long running operation has failed. The provisioning state: failed."
);
}
});
it("LROs_put200Acceptedcanceled200", async () => {
// Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Created. Polls return this value until the last poll returns a 200 with ProvisioningState=Failed const expectedBody = { "properties": { "provisioningState": "Succeeded"}, "id": "100", "name": "foo" }
const expectedBody = { properties: { provisioningState: "canceled" }, id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/200/accepted/canceled/200",
method: "PUT",
response: {
status: 200,
body: { properties: { provisioningState: "Accepted" }, id: "100", name: "foo" },
},
},
{
path: "/lro/put/200/accepted/canceled/200",
method: "GET",
response: { status: 200, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/200/accepted/canceled/200").put();
const poller = getLongRunningPoller(client, initialResponse, { intervalInMs: 1 });
try {
await poller.pollUntilDone();
assert.fail("Expected exception");
} catch (error) {
assert.equal(
error.message,
"The long running operation has failed. The provisioning state: canceled."
);
}
});
it("LROPutNoHeaderInRetry", async () => {
// Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=Created. Polls return this value until the last poll returns a 200 with ProvisioningState=Failed const expectedBody = { "properties": { "provisioningState": "Succeeded"}, "id": "100", "name": "foo" }
const expectedBody = { properties: { provisioningState: "Succeeded" }, id: "100", name: "foo" };
mockResponse(client, [
{
path: "/lro/put/noheader/202/200",
method: "PUT",
response: {
status: 200,
body: { properties: { provisioningState: "Accepted" }, id: "100", name: "foo" },
headers: createHttpHeaders({
location: "http://localhost:3000/lro/put/noheader/operationresults",
}),
},
},
{ path: "/lro/put/noheader/operationresults", method: "GET", response: { status: 202 } },
{
path: "/lro/put/noheader/operationresults",
method: "GET",
response: { status: 200, body: expectedBody },
},
]);
const initialResponse = await client.pathUnchecked("/lro/put/noheader/202/200").put();
const poller = getLongRunningPoller(client, initialResponse, { intervalInMs: 1 });
const result = await poller.pollUntilDone();
assert.equal(result.status, "200");
assert.deepEqual(result.body, expectedBody);
});
});
interface MockResponse {
path: string;
method: HttpMethods;
response: {
status: number;
body?: any;
headers?: HttpHeaders;
};
}
/**
* Creates a pipeline with a mocked service call
* @param client - client to mock requests for
* @param response - Responses to return, the actual request url is matched to one of the paths in the responses and the defined object is returned.
* if no path matches a 404 error is returned
*/
function mockResponse(client: Client, responses: MockResponse[]) {
let count = 0;
client.pipeline.addPolicy({
name: "mockClient",
sendRequest: async (request, _next) => {
if (count < responses.length) {
count++;
}
const path = new URL(request.url).pathname;
let responseIndex = -1;
const response = responses.find((r, index) => {
const match =
r.path === path && r.method.toLocaleLowerCase() === request.method.toLocaleLowerCase();
if (match) {
responseIndex = index;
}
return match;
});
if (!response) {
console.warn(`Didn't find a match for path ${path} and method: ${request.method}`);
return {
headers: createHttpHeaders(),
request,
status: 404,
};
}
const { body, status } = response.response;
const bodyAsText = JSON.stringify(body);
// remove the matched response from the list to avoid matching it again
responses.splice(responseIndex, 1);
return {
headers: response.response.headers ?? createHttpHeaders(),
request,
status,
bodyAsText,
};
},
});
}

Просмотреть файл

@ -1,9 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/// <reference lib="dom" />
const url = URL;
const urlSearchParams = URLSearchParams;
export { url as URL, urlSearchParams as URLSearchParams };

Просмотреть файл

@ -1,4 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { URL, URLSearchParams } from "url";

Просмотреть файл

@ -1,8 +0,0 @@
{
"extends": "../../../tsconfig.package",
"compilerOptions": {
"outDir": "./dist-esm",
"declarationDir": "./types/latest"
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}

Просмотреть файл

@ -1,4 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
"extends": ["../../../tsdoc.json"]
}

Просмотреть файл

@ -1,17 +0,0 @@
# Release History
## 1.0.0-beta.2 (Unreleased)
### Features Added
### Breaking Changes
### Bugs Fixed
### Other Changes
- Updates package to work with the react native bundler. Browser APIs may still need to be pollyfilled for this package to run in react native. [PR #17783](https://github.com/Azure/azure-sdk-for-js/pull/17783)
## 1.0.0-beta.1 (2021-08-05)
- First release of package, see README.md for details.

Просмотреть файл

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2020 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -1,112 +0,0 @@
# Azure Rest Core Paging library for JavaScript
This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript). Specifically for rest level clients, as a helper to handle Pageable operations. This package implements support for Autorest `x-ms-pageable` specification.
## Getting started
### Requirements
- [Node.js](https://nodejs.org) LTS
### Installation
This package is primarily used in generated code and not meant to be consumed directly by end users.
## Key concepts
### Helper function `paginateResponse`
Paginate response is a helper function to handle pagination for the user. Given a response that contains a body with a link to the next page and an array with the current page of results, this helper returns a PagedAsyncIterableIterator that can be used to get all the items or page by page.
In order to provide better typings, the library that consumes `paginateResponse` can wrap it providing additional types. For example a code generator may consume and export in the following way
#### Typescript
```typescript
/**
* This is the wrapper function that would be exposed. It is hiding the Pagination Options because it can be
* obtained in the case of a generator from the Swagger definition or by a developer context knowledge in case of a
* hand written library.
*/
export function paginate<TReturn extends PathUncheckedResponse>(
client: Client,
initialResponse: TReturn
): PagedAsyncIterableIterator<PaginateReturn<TReturn>, PaginateReturn<TReturn>[]> {
return paginateResponse<PaginateReturn<TReturn>>(client, initialResponse, {
// For example these values could come from the swagger
itemName: "items",
nextLinkName: "continuationLink",
});
}
// Helper type to extract the type of an array
type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
// Helper type to infer the Type of the paged elements from the response type
// This type will be generated based on the swagger information for x-ms-pageable
// specifically on the itemName property which indicates the property of the response
// where the page items are found. The default value is `value`.
// This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
export type PaginateReturn<TResult> = TResult extends {
body: { items: infer TPage };
}
? GetArrayType<TPage>
: Array<unknown>;
// Usage
const client = Client("https://example.org", new DefaultAzureCredentials());
const response = client.path("/foo").get();
const items = paginate(client, response);
for await (const item of items) {
console.log(item.name);
}
```
#### JavaScript
```javascript
/**
* This is the wrapper function that would be exposed. It is hiding the Pagination Options because it can be
* obtained in the case of a generator from the Swagger definition or by a developer context knowledge in case of a
* hand written library.
*/
export function paginate(client, initialResponse) {
return paginateResponse(client, initialResponse, {
// For example these values could come from the swagger
itemName: "items",
nextLinkName: "continuationLink",
});
}
// Usage
const client = Client("https://example.org", new DefaultAzureCredentials());
const response = client.path("/foo").get();
const items = paginate(client, response);
for await (const item of items) {
console.log(item.name);
}
```
## Examples
Examples can be found in the `samples` folder.
## Next steps
You can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes.
Learn more about [AutoRest](https://github.com/Azure/autorest) and the [autorest.typescript extension](https://github.com/Azure/autorest.typescript) for generating a compatible client on top of this package.
## Troubleshooting
If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore-rest%2Fcore-client%2FREADME.png)

Просмотреть файл

@ -1,31 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "types/latest/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/latest/core-client-paging-rest.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

Просмотреть файл

@ -1,121 +0,0 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["mocha"],
plugins: [
"karma-mocha",
"karma-mocha-reporter",
"karma-chrome-launcher",
"karma-edge-launcher",
"karma-firefox-launcher",
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
],
// list of files / patterns to load in the browser
files: [
// Uncomment the cdn link below for the polyfill service to support IE11 missing features
// Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys
// "https://cdn.polyfill.io/v2/polyfill.js?features=Symbol,Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always",
"dist-test/index.browser.js",
],
// list of files / patterns to exclude
exclude: [],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"dist-test/index.browser.js": ["coverage"]
},
// inject following environment values into browser testing with window.__env__
// environment values MUST be exported or set with same console running "karma start"
// https://www.npmjs.com/package/karma-env-preprocessor
// EXAMPLE: envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "junit"],
coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
],
},
junitReporter: {
outputDir: "", // results will be saved as $outputDir/$browserName.xml
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: "", // suite will become the package name attribute in xml testsuite element
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {}, // key value pair of properties to add to the <properties> section of the report
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE'
browsers: ["ChromeHeadlessNoSandbox"],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: "ChromeHeadless",
flags: ["--no-sandbox"],
},
},
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: 1,
browserNoActivityTimeout: 600000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000",
},
},
});
};

Просмотреть файл

@ -1,97 +0,0 @@
{
"name": "@azure-rest/core-client-paging",
"version": "1.0.0-beta.2",
"description": "A helper library which implements Autorest x-ms-pageable spec for pagination.",
"sdk-type": "client",
"main": "dist/index.js",
"module": "dist-esm/src/index.js",
"types": "types/latest/core-client-paging-rest.d.ts",
"browser": {
"./dist-esm/src/url.js": "./dist-esm/src/url.browser.js"
},
"react-native": {
"./dist/index.js": "./dist-esm/src/index.js"
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:samples": "echo Obsolete",
"build:test": "tsc -p . && dev-tool run bundle",
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-* temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
"dist/",
"dist-esm/src/",
"types/latest/core-client-paging-rest.d.ts",
"README.md",
"LICENSE"
],
"repository": "github:Azure/azure-sdk-for-js",
"keywords": [
"azure",
"cloud"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"engines": {
"node": ">=12.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client-paging-rest/",
"sideEffects": false,
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure-rest/core-client": "1.0.0-beta.7",
"tslib": "^2.2.0"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.18.11",
"@types/chai": "^4.1.6",
"@types/mocha": "^7.0.2",
"@types/node": "^12.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/dev-tool": "^1.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"eslint": "^7.15.0",
"inherits": "^2.0.3",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
"karma-edge-launcher": "^0.4.2",
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^7.1.1",
"mocha-junit-reporter": "^2.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.2.0",
"util": "^0.12.1"
}
}

Просмотреть файл

@ -1,24 +0,0 @@
## API Report File for "@azure-rest/core-client-paging"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference lib="esnext.asynciterable" />
import { Client } from '@azure-rest/core-client';
import { HttpResponse } from '@azure-rest/core-client';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
export { PagedAsyncIterableIterator }
// @public
export interface PaginateOptions {
itemNames?: string[];
nextLinkNames?: string[] | null;
}
// @public
export function paginateResponse<TElement>(client: Client, initialResponse: HttpResponse, options?: PaginateOptions): PagedAsyncIterableIterator<TElement>;
```

Просмотреть файл

@ -1,10 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* A helper library which implements Autorest x-ms-pageable spec for pagination
*
* @packageDocumentation
*/
export { paginateResponse, PaginateOptions } from "./paginate";
export { PagedAsyncIterableIterator } from "@azure/core-paging";

Просмотреть файл

@ -1,155 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/// <reference lib="esnext.asynciterable" />
import {
Client,
createRestError,
HttpResponse,
PathUncheckedResponse,
} from "@azure-rest/core-client";
import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging";
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
const DEFAULT_NEXTLINK = "nextLink";
const DEFAULT_VALUES = "value";
/**
* Options to indicate custom values for where to look for nextLink and values
* when paginating a response
*/
export interface PaginateOptions {
/**
* Property name in the body where the nextLink is located
* The default value is `nextLink`.
* nextLink is an opaque URL for the client, in which the next set of results is located.
* Note: if nextLinkName is set to `null` only the first page is returned, no additional
* requests are made.
*/
nextLinkNames?: string[] | null;
/**
* Indicates the name of the property in which the set of values is found. Default: `value`
*/
itemNames?: string[];
}
/**
* Helper to iterate pageable responses
* @param client - Client to use for sending the request to get additional pages
* @param initialResponse - The initial response
* @param options - Options to use custom property names for pagination
* @returns - return a PagedAsyncIterableIterator that can be used to iterate the elements
*/
export function paginateResponse<TElement>(
client: Client,
initialResponse: HttpResponse,
options: PaginateOptions = {}
): PagedAsyncIterableIterator<TElement> {
let firstRun = true;
const { itemName, nextLinkName } = getPaginationProperties(initialResponse, options);
const pagedResult: PagedResult<TElement[]> = {
firstPageLink: "",
async getPage(pageLink: string) {
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
firstRun = false;
checkPagingRequest(result);
const nextLink = getNextLink(result.body, nextLinkName);
const values = getElements<TElement>(result.body, itemName);
return {
page: values,
// According to x-ms-pageable is the nextLinkNames is set to null we should only
// return the first page and skip any additional queries even if the initial response
// contains a nextLink.
nextPageLink: options.nextLinkNames === null ? undefined : nextLink,
};
},
};
return getPagedAsyncIterator(pagedResult);
}
/**
* Checks if a request failed
*/
function checkPagingRequest(response: PathUncheckedResponse): void {
if (!Http2xxStatusCodes.includes(response.status)) {
throw createRestError(
`Pagination failed with unexpected statusCode ${response.status}`,
response
);
}
}
/**
* Extracts the itemName and nextLinkName from the initial response to use them for pagination
*/
function getPaginationProperties(initialResponse: HttpResponse, options: PaginateOptions = {}) {
// Build a set with the passed custom nextLinkNames
const nextLinkNames = new Set(options.nextLinkNames ?? DEFAULT_NEXTLINK);
// Add the default nextLinkName if it doesn't exist yet
nextLinkNames.add(DEFAULT_NEXTLINK);
// Build a set with the passed custom set of itemNames
const itemNames = new Set(options.itemNames ?? DEFAULT_VALUES);
// Add the default itemName if it doesn't exist yet
itemNames.add(DEFAULT_VALUES);
let nextLinkName: string | undefined;
let itemName: string | undefined;
for (const name of nextLinkNames) {
const nextLink = (initialResponse.body as Record<string, unknown>)[name] as string;
if (nextLink) {
nextLinkName = name;
break;
}
}
for (const name of itemNames) {
const item = (initialResponse.body as Record<string, unknown>)[name] as string;
if (item) {
itemName = name;
break;
}
}
if (!itemName) {
throw new Error(
`Couldn't paginate response\n Body doesn't contain an array property with name: ${[
...itemNames,
].join(" OR ")}`
);
}
return { itemName, nextLinkName };
}
/**
* Gets for the value of nextLink in the body. If a custom nextLinkNames was provided, it will be used instead of default
*/
function getNextLink(body: unknown, nextLinkName?: string): string | undefined {
// It is possible to get an undefined for nextLinkName, in the scenario where the initial response contains the last page.
const nextLink =
nextLinkName === undefined
? undefined
: ((body as Record<string, unknown>)[nextLinkName] as string);
return nextLink;
}
/**
* Gets the elements of the current request in the body. By default it will look in the `value` property unless
* a different value for itemNames has been provided as part of the options.
*/
function getElements<T = unknown>(body: unknown, itemName: string): T[] {
const value = (body as Record<string, unknown>)[itemName];
if (!Array.isArray(value)) {
throw new Error(
`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`
);
}
return (value as T[]) ?? [];
}

Просмотреть файл

@ -1,9 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/// <reference lib="dom" />
const url = URL;
const urlSearchParams = URLSearchParams;
export { url as URL, urlSearchParams as URLSearchParams };

Просмотреть файл

@ -1,4 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { URL, URLSearchParams } from "url";

Просмотреть файл

@ -1,258 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { assert } from "chai";
import { Client, getClient, PathUncheckedResponse } from "@azure-rest/core-client";
import { paginateResponse } from "../src/paginate";
import { createHttpHeaders } from "@azure/core-rest-pipeline";
import { URL } from "../src/url";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
/**
* This is a sample of how code generator can generate code around the Swagger spec for pagination to improve UX
*/
// Helper type to extract the type of an array
type GetArrayType<T> = T extends Array<infer TData> ? TData : unknown;
// Helper type to infer the Type of the paged elements from the response type
// This type will be generated based on the swagger information for x-ms-pageable
// specifically on the itemName property which indicates the property of the response
// where the page items are found. The default value is `value`
export type PaginateReturn<TResult> = TResult extends
| {
body: { value: infer TPage };
}
| {
// In the tests below we are using values as a custom pagination property
// In cases like this the generator will have to generate one of these
// entries for each unique value of itemName in the swagger. Most of the times
// the itemName remains constant throughout the swagger, but that is not a requirement
body: { values: infer TPage };
}
? GetArrayType<TPage>
: Array<unknown>;
/**
* Shapes of the test responses
*/
interface TestItem {
foo?: number;
}
interface TestResponse extends PathUncheckedResponse {
body: {
value: Array<TestItem>;
};
}
interface TestResponseValues extends PathUncheckedResponse {
body: {
values: Array<TestItem>;
};
}
/**
* This is the default paginate helper function
*/
export function paginate<TReturn extends PathUncheckedResponse>(
client: Client,
initialResponse: TReturn
): PagedAsyncIterableIterator<PaginateReturn<TReturn>, PaginateReturn<TReturn>[]> {
return paginateResponse<PaginateReturn<TReturn>>(client, initialResponse, {
itemNames: ["value", "values"],
nextLinkNames: ["nextLink", "continuationLink"],
});
}
describe("Paginate heleper", () => {
let client: Client;
beforeEach(() => {
client = getClient("http://localhost:3000", { allowInsecureConnection: true });
client.pipeline.getOrderedPolicies().forEach(({ name }) => {
client.pipeline.removePolicy({ name });
});
});
it("Paging_getNoItemNamePages", async () => {
// Paginate assumes the resource supports get and nextLink is an opaque url to which a get can be done
// by default and following autorest x-ms-pageable extension, Paginate assumes that the pageable result
// will contain a property nextLink which is the opaque url for the next page, and a value property containing
// an array with the results (the page);
const expectedPage = [{ foo: 1 }];
mockResponse(client, [
{ path: "/paging/noitemname", response: { status: 200, body: { value: expectedPage } } },
]);
const response: TestResponse = await client.pathUnchecked("/paging/noitemname").get();
const items = paginate(client, response);
const result = [];
for await (const item of items) {
result.push(item);
}
assert.deepEqual(result, expectedPage);
});
it("Paging_getNullNextLinkNamePages", async () => {
// A paging operation that must ignore any kind of nextLink, and stop after page 1.
const expectedPage = [{ foo: 1 }];
mockResponse(client, [
{
path: "/paging/nullnextlink",
response: { status: 200, body: { value: expectedPage, nextLink: "/paging/nullnextlink" } },
},
{
path: "/paging/nullnextlink",
response: { status: 400, body: { value: expectedPage, nextLink: "/paging/nullnextlink" } },
},
]);
const response: TestResponse = await client.pathUnchecked("/paging/nullnextlink").get();
const items = paginateResponse(client, response, { nextLinkNames: null });
const result = [];
for await (const item of items) {
result.push(item);
}
assert.deepEqual(result, expectedPage);
});
it("Paging_getSinglePages", async () => {
// Autorest x-ms-pageable extension allows setting a different name for the property that contains the page
// we can allow overriding this through the pagingOptions values.
// The extension also allows setting a custom nextLink property name.
const expectedPage = [{ foo: 1 }];
mockResponse(client, [
{ path: "/paging/single", response: { status: 200, body: { values: expectedPage } } },
]);
const response: TestResponseValues = await client.pathUnchecked("/paging/single").get();
const items = paginate(client, response);
const result = [];
for await (const item of items) {
// We get a strong type for item :)
result.push(item);
}
assert.deepEqual(result, expectedPage);
});
it("Paging_firstResponseEmpty", async () => {
// First response has an empty [] next page contains a page with an element
const expectedPage = [{ foo: 1 }];
mockResponse(client, [
{
path: "/paging/firstResponseEmpty/1",
response: {
status: 200,
body: { value: [], continuationLink: "/paging/firstResponseEmpty/2" },
},
},
{
path: "/paging/firstResponseEmpty/2",
response: { status: 200, body: { value: expectedPage } },
},
]);
const response: TestResponse = await client.pathUnchecked("/paging/firstResponseEmpty/1").get();
const items = paginate(client, response);
const result = [];
for await (const item of items) {
result.push(item);
}
assert.deepEqual(result, expectedPage);
});
it("Paging_getMultiplePages", async () => {
const expectedPages = [{ foo: 1 }, { foo: 2 }, { foo: 3 }];
const mockResponses: MockResponse[] = [
{
path: "/paging/multiple",
response: {
status: 200,
body: { value: [expectedPages[0]], nextLink: "/paging/multiple/1" },
},
},
{
path: "/paging/multiple/1",
response: {
status: 200,
body: { value: [expectedPages[1]], nextLink: "/paging/multiple/2" },
},
},
{
path: "/paging/multiple/2",
response: {
status: 200,
body: { value: [expectedPages[2]], nextLink: undefined },
},
},
];
mockResponse(client, mockResponses);
const response: TestResponse = await client.pathUnchecked("/paging/multiple").get();
const items = paginate(client, response);
const result = [];
for await (const item of items) {
result.push(item);
}
assert.deepEqual(result, [...expectedPages]);
});
});
interface MockResponse {
path: string;
response: {
status: number;
body: any;
};
}
/**
* Creates a pipeline with a mocked service call
* @param client - client to mock requests for
* @param response - Responses to return, the actual request url is matched to one of the paths in the responses and the defined object is returned.
* if no path matches a 404 error is returned
*/
function mockResponse(client: Client, responses: MockResponse[]): void {
let count = 0;
client.pipeline.addPolicy({
name: "mockClient",
sendRequest: async (request, _next) => {
if (count < responses.length) {
count++;
}
const path = new URL(request.url).pathname;
const response = responses.find((r) => r.path === path);
if (!response) {
return {
headers: createHttpHeaders(),
request,
status: 404,
};
}
const { body, status } = response.response;
const bodyAsText = JSON.stringify(body);
return {
headers: createHttpHeaders(),
request,
status,
bodyAsText,
};
},
});
}

Просмотреть файл

@ -1,8 +0,0 @@
{
"extends": "../../../tsconfig.package",
"compilerOptions": {
"outDir": "./dist-esm",
"declarationDir": "./types/latest"
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}

Просмотреть файл

@ -1,4 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
"extends": ["../../../tsdoc.json"]
}

Просмотреть файл

@ -29,8 +29,6 @@ extends:
safeName: azurerestpurviewcatalog
- name: azure-rest-purview-scanning
safeName: azurerestpurviewscanning
- name: azure-rest-purview-account
safeName: azurerestpurviewaccount
- name: azure-rest-purview-administration
safeName: azurerestpurviewadministration
- name: azure-arm-purview

Просмотреть файл

@ -1,11 +0,0 @@
{
"plugins": ["@azure/azure-sdk"],
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
"rules": {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"tsdoc/syntax": "warn"
}
}

Просмотреть файл

@ -1,5 +0,0 @@
# Release History
## 1.0.0-beta.1 (2021-08-13)
- First release of package, see README.md for details.

Просмотреть файл

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2021 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -1,141 +0,0 @@
# Azure Purview Account REST client library for JavaScript
Azure Purview Account is a fully managed cloud service whose users can discover the data sources they need and understand the data sources they find. At the same time, Data Account helps organizations get more value from their existing investments.
- Search for data using technical or business terms
- Browse associated technical, business, semantic, and operational metadata
- Identify the sensitivity level of data.
**Please rely heavily on the [service's documentation][account_product_documentation] and our [REST client docs][rest_client] to use this library**
Key links:
- [Source code][source_code]
- [Package (NPM)][account_npm]
- [API reference documentation][account_ref_docs]
- [Product documentation][account_product_documentation]
## Getting started
### Currently supported environments
- Node.js version 14.x.x or higher
### Prerequisites
- You must have an [Azure subscription][azure_subscription] and a [Purview][purview_resource] to use this package.
#### Create a Purview Resource
Follow [these][purview_resource] instructions to create your Purview resource
### Install the `@azure-rest/purview-account` package
Install the Azure Purview Account client library for JavaScript with `npm`:
```bash
npm install @azure-rest/purview-account
```
### Create and authenticate a `PurviewAccount`
To use an [Azure Active Directory (AAD) token credential][authenticate_with_token],
provide an instance of the desired credential type obtained from the
[@azure/identity][azure_identity_credentials] library.
To authenticate with AAD, you must first `npm` install [`@azure/identity`][azure_identity_npm] and
[enable AAD authentication on your Purview resource][enable_aad]
After setup, you can choose which type of [credential][azure_identity_credentials] from `@azure/identity` to use.
As an example, [DefaultAzureCredential][default_azure_credential]
can be used to authenticate the client:
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
Use the returned token credential to authenticate the client:
```typescript
import PurviewAccount from "@azure-rest/purview-account";
import { DefaultAzureCredential } from "@azure/identity";
const client = PurviewAccount(
"https://<my-account-name>.purview.azure.com",
new DefaultAzureCredential()
);
```
## Key concepts
### REST Client
This client is one of our REST clients. We highly recommend you read how to use a REST client [here][rest_client].
## Examples
The following section shows you how to initialize and authenticate your client, then get all of your type-defs.
- [Get A List of Collections](#get-a-list-of-collections "Get A List of Collections")
```typescript
import PurviewAccount from "@azure-rest/purview-account";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";
dotenv.config();
const endpoint = process.env["ENDPOINT"] || "";
async function main() {
console.log("== List collections sample ==");
const client = PurviewAccount(endpoint, new DefaultAzureCredential());
const response = await client.path("/collections").get();
if (response.status !== "200") {
console.log(`GET "/collections" failed with ${response.status}`);
}
console.log(response.body);
}
main().catch(console.error);
```
## Troubleshooting
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
```javascript
import { setLogLevel } from "@azure/logger";
setLogLevel("info");
```
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
## Next steps
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
## Related projects
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpurview%2Fpurview-account-rest%2FREADME.png)
[account_product_documentation]: https://azure.microsoft.com/services/purview/
[rest_client]: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md
[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-catalog-rest
[account_npm]: https://www.npmjs.com/org/azure-rest
[account_ref_docs]: https://azure.github.io/azure-sdk-for-js
[azure_subscription]: https://azure.microsoft.com/free/
[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials
[azure_identity_npm]: https://www.npmjs.com/package/@azure/identity
[enable_aad]: https://docs.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

Просмотреть файл

@ -1,31 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "types/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/purview-account-rest.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

Просмотреть файл

@ -1,127 +0,0 @@
{
"name": "@azure-rest/purview-account",
"sdk-type": "client",
"author": "Microsoft Corporation",
"description": "An isomorphic rest level client library for the Azure Purview Account service.",
"version": "1.0.0-beta.1",
"keywords": [
"node",
"azure",
"cloud",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/purview-account-rest.d.ts",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-account-rest/README.md",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/",
"dist-esm/src/",
"types/purview-account-rest.d.ts",
"README.md",
"LICENSE"
],
"engines": {
"node": ">=12.0.0"
},
"//metadata": {
"constantPaths": [
{
"path": "swagger/README.md",
"prefix": "package-version"
}
]
},
"//sampleConfiguration": {
"productName": "Azure Purview Scanning rest",
"productSlugs": [
"azure"
],
"requiredResources": {
"Azure Cognitive Services instance": "https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account"
}
},
"browser": {
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:browser": "tsc -p . && dev-tool run bundle",
"build:node": "tsc -p . && dev-tool run bundle",
"build:samples": "echo Obsolete.",
"build:test": "tsc -p . && dev-tool run bundle",
"build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local",
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"generate:client": "autorest --typescript swagger/README.md && npm run format",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}*.spec.js\"",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test",
"unit-test:browser": "echo skipped",
"unit-test:node": "cross-env mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"sideEffects": false,
"autoPublish": false,
"dependencies": {
"@azure-rest/core-client-paging": "1.0.0-beta.1",
"@azure/core-auth": "^1.3.0",
"@azure-rest/core-client": "1.0.0-beta.7",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"@microsoft/api-extractor": "^7.18.11",
"@types/chai": "^4.1.6",
"@types/mocha": "^7.0.2",
"@types/node": "^12.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"dotenv": "^8.2.0",
"eslint": "^7.15.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
"karma-edge-launcher": "^0.4.2",
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-json-preprocessor": "^0.3.3",
"karma-json-to-file-reporter": "^1.0.1",
"karma-junit-reporter": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-mocha": "^2.0.1",
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"mkdirp": "^1.0.4",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^7.1.1",
"nyc": "^15.0.0",
"prettier": "2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"typescript": "~4.2.0"
}
}

Просмотреть файл

@ -1,131 +0,0 @@
let nock = require('nock');
module.exports.hash = "2ff3b5a65daf079dc2f7d73b5d58f0de";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'61bade29-ae60-493d-870c-9ec9da9a2d02',
'x-ms-ests-server',
'2.1.12171.14 - SCUS ProdSlices',
'Set-Cookie',
'fpc=AkOWu2lqxhdDkHfaAu4_mAc; expires=Sat, 04-Dec-2021 16:28:36 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrwwGWw0lbyUzqjOsd4dMVmZ703FhEH64QevMVb1DwdXUQ9pzX6dsCWZS1EzIOGd0RLYwGbO2ZTgvv0HkIv-VYiLXEoUYaKqxmY4V1DckQeBmogaoiTxeqkC1nZHhGFYqrg4UD6yTozLUsCfVypo23SGT0xvgmFZaHAhc6klGQgokgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Thu, 04 Nov 2021 16:28:36 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'ade56010-2ac0-4cc1-a0be-cded17b71600',
'x-ms-ests-server',
'2.1.12197.4 - NCUS ProdSlices',
'Set-Cookie',
'fpc=AqLHQXHG3UZLg7y7k96PBq0; expires=Sat, 04-Dec-2021 16:28:36 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrnu6i2A3eqs6ZNxFIdssUx4EATaw4oyXk1xA5JLPYXTuWz1BUUISyqSS0uhjbeebVYjUMzAzGj1OBiOAU-VKGz30uoCkmV4x_tTT0Doe9JdYyuh-jYcxJJyHgZXoFfpbvjWlxPV_1Hd6gZgK1dATCq5Uki7Y-pL9_gTddqba-Q_wgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Thu, 04 Nov 2021 16:28:36 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=88eff70c-a995-4894-8e9c-0fb3bd1ec8e7&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'54cf00a4-bc0a-4482-b96a-a18e6f161e00',
'x-ms-ests-server',
'2.1.12197.4 - SCUS ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AqBWJWj6pUJBkzhkRKzZpZj__1r8AQAAADMBFtkOAAAA; expires=Sat, 04-Dec-2021 16:28:37 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Thu, 04 Nov 2021 16:28:37 GMT',
'Content-Length',
'1318'
]);
nock('https://endpoint', {"encodedQueryParams":true})
.get('/')
.query(true)
.reply(200, {"sku":{"name":"Standard","capacity":1},"properties":{"cloudConnectors":{"awsExternalId":"ec2bff3a-3cba-4be0-a9ca-6d6b0a5cc268"},"friendlyName":"joheredipv","createdBy":"joheredi@microsoft.com","createdByObjectId":"35ac9d32-a8ca-4324-9393-d4000746f07c","createdAt":"2021-08-10T17:25:46.5991716Z","endpoints":{"catalog":"https://endpoint/catalog","scan":"https://endpoint/scan","guardian":"https://endpoint/guardian"},"provisioningState":"Succeeded","privateEndpointConnections":[],"managedResources":{"resourceGroup":"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/managed-rg-joheredipv","storageAccount":"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/managed-rg-joheredipv/providers/Microsoft.Storage/storageAccounts/scaneastusgiaeeoh","eventHubNamespace":"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/managed-rg-joheredipv/providers/Microsoft.EventHub/namespaces/Atlas-9fe2f965-5f93-4bdf-a811-7221a78e2fdb"},"publicNetworkAccess":"Enabled","managedResourceGroupName":"managed-rg-joheredipv"},"id":"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/joheredi-test/providers/Microsoft.Purview/accounts/joheredipv","name":"joheredipv","type":"Microsoft.Purview/accounts","location":"eastus","identity":{"type":"SystemAssigned","principalId":"dab894e8-208b-4092-9ddc-71dbb9447e9d","tenantId":"88888888-8888-8888-8888-888888888888"},"tags":{},"systemData":{"createdBy":"joheredi@microsoft.com","createdByType":"User","createdAt":"2021-08-10T17:25:46.5991716Z","lastModifiedByType":"User","lastModifiedAt":"2021-09-15T23:38:59.768035Z"}}, [
'Date',
'Thu, 04 Nov 2021 16:28:36 GMT',
'Content-Type',
'application/json; charset=utf-8',
'Server',
'Kestrel',
'Transfer-Encoding',
'chunked',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-correlation-request-id',
'6f485cbb-2d8f-4bb8-99c4-59c3a114d0ff',
'x-ms-account-status',
'Succeeded'
]);

Просмотреть файл

@ -1,129 +0,0 @@
let nock = require('nock');
module.exports.hash = "79c0a4821517e16a01cb575ad9a8fa83";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'52c9e799-c1a5-4425-b1b3-45ed70fa2e00',
'x-ms-ests-server',
'2.1.12197.4 - SCUS ProdSlices',
'Set-Cookie',
'fpc=Aryk7ezWtMRKic3QcsRdIUY; expires=Sat, 04-Dec-2021 16:28:37 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrQnF04b-leBZRXhPeFplK0bTcKM8oL1UCUDPfAMrazwRYYPlcsEyWCM5G5hxRxixNW21_UmG7G07Gao8FaUU3Rs_i0PQC_90HLYTS3cTehR2BGGN88h6mhrtQkenrmD3SDucVB82tdEq95vzA_vtrlPKcGT4U8U9Hmy3hxWmeh8sgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Thu, 04 Nov 2021 16:28:37 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'c51f5b63-7ddc-4dc0-8ba5-89bf6f891e00',
'x-ms-ests-server',
'2.1.12197.4 - EUS ProdSlices',
'Set-Cookie',
'fpc=Ag01qgzza1JIr46xPI-vt8I; expires=Sat, 04-Dec-2021 16:28:37 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrnwMvAMsbPvv4gSMldZYTJo-WHQNozjyZCE0hP_GMXfSbp4mAedtHQMnj6m0cR9Jukh8uUi7mKxMDjbmEJ0BkamVHf_gtUEEBxWCxRpYrS_1aTvQYTjCz2ErQaNcoBqrQgmuORA-PcE8zwWdbKRXzfm_usVIxmenaLFeH2wxhRyEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Thu, 04 Nov 2021 16:28:37 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=66a6ba0e-c837-468f-9933-bc47f7f7d80e&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'c51f5b63-7ddc-4dc0-8ba5-89bf72891e00',
'x-ms-ests-server',
'2.1.12197.4 - EUS ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AiflO11QFGpLvDLB4_CyYEs; expires=Sat, 04-Dec-2021 16:28:37 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Thu, 04 Nov 2021 16:28:37 GMT',
'Content-Length',
'1318'
]);
nock('https://endpoint', {"encodedQueryParams":true})
.get('/collections')
.query(true)
.reply(200, {"value":[{"name":"joheredipv","friendlyName":"joheredipv","description":"The root collection.","systemData":{"createdBy":"35ac9d32-a8ca-4324-9393-d4000746f07c","createdByType":"User","createdAt":"2021-08-10T17:25:46.5991716Z","lastModifiedByType":"User","lastModifiedAt":"2021-09-15T23:38:59.768035Z"},"collectionProvisioningState":"Succeeded"},{"name":"Collection-lGe","friendlyName":"Collection-lGe","parentCollection":{"type":"CollectionReference","referenceName":"joheredipv"},"systemData":{"createdBy":"35ac9d32-a8ca-4324-9393-d4000746f07c","createdByType":"Application","createdAt":"2021-10-11T20:20:20.1813272Z","lastModifiedByType":"Application","lastModifiedAt":"2021-10-11T20:20:20.1813273Z"},"collectionProvisioningState":"Succeeded"}],"count":2}, [
'Date',
'Thu, 04 Nov 2021 16:28:37 GMT',
'Content-Type',
'application/json; charset=utf-8',
'Server',
'Kestrel',
'Transfer-Encoding',
'chunked',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'x-ms-correlation-request-id',
'719be534-7c8e-417a-8be7-25bd111391be'
]);

Просмотреть файл

@ -1,806 +0,0 @@
## API Report File for "@azure-rest/purview-account"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { Client } from '@azure-rest/core-client';
import { ClientOptions } from '@azure-rest/core-client';
import { HttpResponse } from '@azure-rest/core-client';
import { PagedAsyncIterableIterator } from '@azure-rest/core-client-paging';
import { PathUncheckedResponse } from '@azure-rest/core-client';
import { RequestParameters } from '@azure-rest/core-client';
import { TokenCredential } from '@azure/core-auth';
// @public (undocumented)
export interface AccessKeyOptions {
keyType?: "PrimaryAtlasKafkaKey" | "SecondaryAtlasKafkaKey";
}
// @public (undocumented)
export interface AccessKeys {
atlasKafkaPrimaryEndpoint?: string;
atlasKafkaSecondaryEndpoint?: string;
}
// @public (undocumented)
export interface Account {
id?: string;
identity?: Identity;
location?: string;
name?: string;
properties?: AccountProperties;
sku?: AccountSku;
systemData?: AccountSystemData;
tags?: Record<string, string>;
type?: string;
}
// @public (undocumented)
export interface AccountEndpoints {
catalog?: string;
guardian?: string;
scan?: string;
}
// @public (undocumented)
export interface AccountProperties {
cloudConnectors?: CloudConnectors;
createdAt?: Date;
createdBy?: string;
createdByObjectId?: string;
endpoints?: AccountPropertiesEndpoints;
friendlyName?: string;
managedResourceGroupName?: string;
managedResources?: AccountPropertiesManagedResources;
privateEndpointConnections?: Array<PrivateEndpointConnection>;
provisioningState?: "Unknown" | "Creating" | "Moving" | "Deleting" | "SoftDeleting" | "SoftDeleted" | "Failed" | "Succeeded" | "Canceled";
publicNetworkAccess?: "NotSpecified" | "Enabled" | "Disabled";
}
// @public (undocumented)
export interface AccountPropertiesEndpoints extends AccountEndpoints {
}
// @public (undocumented)
export interface AccountPropertiesManagedResources extends ManagedResources {
}
// @public (undocumented)
export interface AccountsGetAccessKeys {
post(options?: AccountsGetAccessKeysParameters): Promise<AccountsGetAccessKeys200Response | AccountsGetAccessKeysdefaultResponse>;
}
// @public
export interface AccountsGetAccessKeys200Response extends HttpResponse {
// (undocumented)
body: AccessKeys;
// (undocumented)
status: "200";
}
// @public
export interface AccountsGetAccessKeysdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type AccountsGetAccessKeysParameters = RequestParameters;
// @public (undocumented)
export interface AccountsGetAccountProperties {
get(options?: AccountsGetAccountPropertiesParameters): Promise<AccountsGetAccountProperties200Response | AccountsGetAccountPropertiesdefaultResponse>;
patch(options: AccountsUpdateAccountPropertiesParameters): Promise<AccountsUpdateAccountProperties200Response | AccountsUpdateAccountPropertiesdefaultResponse>;
}
// @public
export interface AccountsGetAccountProperties200Response extends HttpResponse {
// (undocumented)
body: Account;
// (undocumented)
status: "200";
}
// @public
export interface AccountsGetAccountPropertiesdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type AccountsGetAccountPropertiesParameters = RequestParameters;
// @public (undocumented)
export interface AccountSku {
capacity?: number;
name?: "Standard";
}
// @public (undocumented)
export interface AccountsRegenerateAccessKey {
post(options: AccountsRegenerateAccessKeyParameters): Promise<AccountsRegenerateAccessKey200Response | AccountsRegenerateAccessKeydefaultResponse>;
}
// @public
export interface AccountsRegenerateAccessKey200Response extends HttpResponse {
// (undocumented)
body: AccessKeys;
// (undocumented)
status: "200";
}
// @public (undocumented)
export interface AccountsRegenerateAccessKeyBodyParam {
// (undocumented)
body: AccessKeyOptions;
}
// @public
export interface AccountsRegenerateAccessKeydefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type AccountsRegenerateAccessKeyParameters = AccountsRegenerateAccessKeyBodyParam & RequestParameters;
// @public
export interface AccountsUpdateAccountProperties200Response extends HttpResponse {
// (undocumented)
body: Account;
// (undocumented)
status: "200";
}
// @public (undocumented)
export interface AccountsUpdateAccountPropertiesBodyParam {
// (undocumented)
body: DataPlaneAccountUpdateParameters;
}
// @public
export interface AccountsUpdateAccountPropertiesdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type AccountsUpdateAccountPropertiesParameters = AccountsUpdateAccountPropertiesBodyParam & RequestParameters;
// @public (undocumented)
export interface AccountSystemData extends SystemData {
}
// @public (undocumented)
export interface AdvancedResourceSet {
modifiedAt?: Date;
resourceSetProcessing?: "Default" | "Advanced";
}
// @public (undocumented)
export interface CloudConnectors {
awsExternalId?: string;
}
// @public (undocumented)
export interface Collection {
collectionProvisioningState?: "Unknown" | "Creating" | "Moving" | "Deleting" | "Failed" | "Succeeded";
description?: string;
friendlyName?: string;
name?: string;
parentCollection?: CollectionReference;
systemData?: CollectionSystemData;
}
// @public (undocumented)
export interface CollectionList {
count?: number;
nextLink?: string;
value: Array<Collection>;
}
// @public (undocumented)
export interface CollectionNameResponse {
friendlyName?: string;
name?: string;
}
// @public (undocumented)
export interface CollectionNameResponseList {
count?: number;
nextLink?: string;
value: Array<CollectionNameResponse>;
}
// @public (undocumented)
export interface CollectionPathResponse {
parentFriendlyNameChain?: Array<string>;
parentNameChain?: Array<string>;
}
// @public (undocumented)
export interface CollectionReference {
referenceName?: string;
type?: string;
}
// @public
export interface CollectionsCreateOrUpdateCollection200Response extends HttpResponse {
// (undocumented)
body: Collection;
// (undocumented)
status: "200";
}
// @public (undocumented)
export interface CollectionsCreateOrUpdateCollectionBodyParam {
// (undocumented)
body: Collection;
}
// @public
export interface CollectionsCreateOrUpdateCollectiondefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type CollectionsCreateOrUpdateCollectionParameters = CollectionsCreateOrUpdateCollectionBodyParam & RequestParameters;
// @public
export interface CollectionsDeleteCollection204Response extends HttpResponse {
// (undocumented)
body: Record<string, unknown>;
// (undocumented)
status: "204";
}
// @public
export interface CollectionsDeleteCollectiondefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type CollectionsDeleteCollectionParameters = RequestParameters;
// @public (undocumented)
export interface CollectionsGetCollection {
delete(options?: CollectionsDeleteCollectionParameters): Promise<CollectionsDeleteCollection204Response | CollectionsDeleteCollectiondefaultResponse>;
get(options?: CollectionsGetCollectionParameters): Promise<CollectionsGetCollection200Response | CollectionsGetCollectiondefaultResponse>;
put(options: CollectionsCreateOrUpdateCollectionParameters): Promise<CollectionsCreateOrUpdateCollection200Response | CollectionsCreateOrUpdateCollectiondefaultResponse>;
}
// @public
export interface CollectionsGetCollection200Response extends HttpResponse {
// (undocumented)
body: Collection;
// (undocumented)
status: "200";
}
// @public
export interface CollectionsGetCollectiondefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type CollectionsGetCollectionParameters = RequestParameters;
// @public (undocumented)
export interface CollectionsGetCollectionPath {
get(options?: CollectionsGetCollectionPathParameters): Promise<CollectionsGetCollectionPath200Response | CollectionsGetCollectionPathdefaultResponse>;
}
// @public
export interface CollectionsGetCollectionPath200Response extends HttpResponse {
// (undocumented)
body: CollectionPathResponse;
// (undocumented)
status: "200";
}
// @public
export interface CollectionsGetCollectionPathdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type CollectionsGetCollectionPathParameters = RequestParameters;
// @public (undocumented)
export interface CollectionsListChildCollectionNames {
get(options?: CollectionsListChildCollectionNamesParameters): Promise<CollectionsListChildCollectionNames200Response | CollectionsListChildCollectionNamesdefaultResponse>;
}
// @public
export interface CollectionsListChildCollectionNames200Response extends HttpResponse {
// (undocumented)
body: CollectionNameResponseList;
// (undocumented)
status: "200";
}
// @public
export interface CollectionsListChildCollectionNamesdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type CollectionsListChildCollectionNamesParameters = CollectionsListChildCollectionNamesQueryParam & RequestParameters;
// @public (undocumented)
export interface CollectionsListChildCollectionNamesQueryParam {
// (undocumented)
queryParameters?: CollectionsListChildCollectionNamesQueryParamProperties;
}
// @public (undocumented)
export interface CollectionsListChildCollectionNamesQueryParamProperties {
// (undocumented)
$skipToken?: string;
}
// @public (undocumented)
export interface CollectionsListCollections {
get(options?: CollectionsListCollectionsParameters): Promise<CollectionsListCollections200Response | CollectionsListCollectionsdefaultResponse>;
}
// @public
export interface CollectionsListCollections200Response extends HttpResponse {
// (undocumented)
body: CollectionList;
// (undocumented)
status: "200";
}
// @public
export interface CollectionsListCollectionsdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type CollectionsListCollectionsParameters = CollectionsListCollectionsQueryParam & RequestParameters;
// @public (undocumented)
export interface CollectionsListCollectionsQueryParam {
// (undocumented)
queryParameters?: CollectionsListCollectionsQueryParamProperties;
}
// @public (undocumented)
export interface CollectionsListCollectionsQueryParamProperties {
// (undocumented)
$skipToken?: string;
}
// @public (undocumented)
export interface CollectionSystemData extends SystemData {
}
// @public (undocumented)
export interface ComplexReplacerConfig {
// (undocumented)
createdBy?: string;
// (undocumented)
description?: string;
// (undocumented)
disabled?: boolean;
// (undocumented)
disableRecursiveReplacerApplication?: boolean;
// (undocumented)
lastUpdatedTimestamp?: number;
// (undocumented)
modifiedBy?: string;
// (undocumented)
name?: string;
// (undocumented)
typeName?: string;
}
// @public (undocumented)
export interface DataPlaneAccountUpdateParameters {
friendlyName?: string;
}
// @public (undocumented)
export interface ErrorModel {
code?: string;
details?: Array<ErrorModel>;
message?: string;
target?: string;
}
// @public (undocumented)
export interface ErrorResponseModel {
error?: ErrorResponseModelError;
}
// @public (undocumented)
export interface ErrorResponseModelError extends ErrorModel {
}
// @public (undocumented)
export interface FastRegex {
// (undocumented)
maxDigits?: number;
// (undocumented)
maxLetters?: number;
// (undocumented)
minDashes?: number;
// (undocumented)
minDigits?: number;
// (undocumented)
minDigitsOrLetters?: number;
// (undocumented)
minDots?: number;
// (undocumented)
minHex?: number;
// (undocumented)
minLetters?: number;
// (undocumented)
minUnderscores?: number;
// (undocumented)
options?: number;
// (undocumented)
regexStr?: string;
}
// @public (undocumented)
export interface Filter {
// (undocumented)
createdBy?: string;
// (undocumented)
filterType?: "Pattern" | "Regex";
// (undocumented)
lastUpdatedTimestamp?: number;
// (undocumented)
modifiedBy?: string;
// (undocumented)
name: string;
// (undocumented)
path: string;
}
// @public
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
// @public (undocumented)
export interface Identity {
principalId?: string;
tenantId?: string;
type?: "SystemAssigned";
}
// @public (undocumented)
export interface ManagedResources {
eventHubNamespace?: string;
resourceGroup?: string;
storageAccount?: string;
}
// @public (undocumented)
export interface NormalizationRule {
// (undocumented)
description?: string;
// (undocumented)
disabled?: boolean;
// (undocumented)
dynamicReplacement?: boolean;
// (undocumented)
entityTypes?: Array<string>;
// (undocumented)
lastUpdatedTimestamp?: number;
// (undocumented)
name?: string;
// (undocumented)
regex?: FastRegex;
// (undocumented)
replaceWith?: string;
// (undocumented)
version?: number;
}
// @public
export function paginate<TReturn extends PathUncheckedResponse>(client: Client, initialResponse: TReturn): PagedAsyncIterableIterator<PaginateReturn<TReturn>, PaginateReturn<TReturn>[]>;
// @public
export type PaginateReturn<TResult> = TResult extends {
body: {
value?: infer TPage;
};
} ? GetArrayType<TPage> : Array<unknown>;
// @public (undocumented)
export interface PathPatternExtractorConfig {
// (undocumented)
acceptedPatterns?: Array<Filter>;
// (undocumented)
complexReplacers?: Array<ComplexReplacerConfig>;
// (undocumented)
createdBy: string;
// (undocumented)
enableDefaultPatterns: boolean;
// (undocumented)
lastUpdatedTimestamp?: number;
// (undocumented)
modifiedBy?: string;
// (undocumented)
normalizationRules?: Array<NormalizationRule>;
// (undocumented)
regexReplacers?: Array<RegexReplacer>;
// (undocumented)
rejectedPatterns?: Array<Filter>;
// (undocumented)
scopedRules?: Array<ScopedRule>;
// (undocumented)
version?: number;
}
// @public (undocumented)
export interface PrivateEndpoint {
id?: string;
}
// @public (undocumented)
export interface PrivateEndpointConnection {
id?: string;
name?: string;
properties?: PrivateEndpointConnectionProperties;
type?: string;
}
// @public (undocumented)
export interface PrivateEndpointConnectionProperties {
privateEndpoint?: PrivateEndpoint;
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState;
provisioningState?: string;
}
// @public (undocumented)
export interface PrivateLinkServiceConnectionState {
actionsRequired?: string;
description?: string;
status?: "Unknown" | "Pending" | "Approved" | "Rejected" | "Disconnected";
}
// @public (undocumented)
function PurviewAccount(endpoint: string, credentials: TokenCredential, options?: ClientOptions): PurviewAccountRestClient;
export default PurviewAccount;
// @public (undocumented)
export type PurviewAccountRestClient = Client & {
path: Routes;
};
// @public (undocumented)
export interface RegexReplacer {
// (undocumented)
condition?: string;
// (undocumented)
createdBy?: string;
// (undocumented)
description?: string;
// (undocumented)
disabled: boolean;
// (undocumented)
disableRecursiveReplacerApplication?: boolean;
// (undocumented)
doNotReplaceRegex?: FastRegex;
// (undocumented)
lastUpdatedTimestamp?: number;
// (undocumented)
modifiedBy?: string;
// (undocumented)
name: string;
// (undocumented)
regex?: FastRegex;
// (undocumented)
replaceWith?: string;
}
// @public (undocumented)
export interface ResourceSetRuleConfig {
advancedResourceSet?: AdvancedResourceSet;
name?: string;
pathPatternConfig?: PathPatternExtractorConfig;
}
// @public (undocumented)
export interface ResourceSetRuleConfigList {
count?: number;
nextLink?: string;
value: Array<ResourceSetRuleConfig>;
}
// @public
export interface ResourceSetRulesCreateOrUpdateResourceSetRule200Response extends HttpResponse {
// (undocumented)
body: ResourceSetRuleConfig;
// (undocumented)
status: "200";
}
// @public (undocumented)
export interface ResourceSetRulesCreateOrUpdateResourceSetRuleBodyParam {
// (undocumented)
body: ResourceSetRuleConfig;
}
// @public
export interface ResourceSetRulesCreateOrUpdateResourceSetRuledefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type ResourceSetRulesCreateOrUpdateResourceSetRuleParameters = ResourceSetRulesCreateOrUpdateResourceSetRuleBodyParam & RequestParameters;
// @public
export interface ResourceSetRulesDeleteResourceSetRule200Response extends HttpResponse {
// (undocumented)
body: Record<string, unknown>;
// (undocumented)
status: "200";
}
// @public
export interface ResourceSetRulesDeleteResourceSetRule204Response extends HttpResponse {
// (undocumented)
body: Record<string, unknown>;
// (undocumented)
status: "204";
}
// @public
export interface ResourceSetRulesDeleteResourceSetRuledefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type ResourceSetRulesDeleteResourceSetRuleParameters = RequestParameters;
// @public (undocumented)
export interface ResourceSetRulesGetResourceSetRule {
delete(options?: ResourceSetRulesDeleteResourceSetRuleParameters): Promise<ResourceSetRulesDeleteResourceSetRule200Response | ResourceSetRulesDeleteResourceSetRule204Response | ResourceSetRulesDeleteResourceSetRuledefaultResponse>;
get(options?: ResourceSetRulesGetResourceSetRuleParameters): Promise<ResourceSetRulesGetResourceSetRule200Response | ResourceSetRulesGetResourceSetRuledefaultResponse>;
put(options: ResourceSetRulesCreateOrUpdateResourceSetRuleParameters): Promise<ResourceSetRulesCreateOrUpdateResourceSetRule200Response | ResourceSetRulesCreateOrUpdateResourceSetRuledefaultResponse>;
}
// @public
export interface ResourceSetRulesGetResourceSetRule200Response extends HttpResponse {
// (undocumented)
body: ResourceSetRuleConfig;
// (undocumented)
status: "200";
}
// @public
export interface ResourceSetRulesGetResourceSetRuledefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type ResourceSetRulesGetResourceSetRuleParameters = RequestParameters;
// @public (undocumented)
export interface ResourceSetRulesListResourceSetRules {
get(options?: ResourceSetRulesListResourceSetRulesParameters): Promise<ResourceSetRulesListResourceSetRules200Response | ResourceSetRulesListResourceSetRulesdefaultResponse>;
}
// @public
export interface ResourceSetRulesListResourceSetRules200Response extends HttpResponse {
// (undocumented)
body: ResourceSetRuleConfigList;
// (undocumented)
status: "200";
}
// @public
export interface ResourceSetRulesListResourceSetRulesdefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseModel;
// (undocumented)
status: "500";
}
// @public (undocumented)
export type ResourceSetRulesListResourceSetRulesParameters = ResourceSetRulesListResourceSetRulesQueryParam & RequestParameters;
// @public (undocumented)
export interface ResourceSetRulesListResourceSetRulesQueryParam {
// (undocumented)
queryParameters?: ResourceSetRulesListResourceSetRulesQueryParamProperties;
}
// @public (undocumented)
export interface ResourceSetRulesListResourceSetRulesQueryParamProperties {
// (undocumented)
$skipToken?: string;
}
// @public (undocumented)
export interface Routes {
(path: "/"): AccountsGetAccountProperties;
(path: "/listkeys"): AccountsGetAccessKeys;
(path: "/regeneratekeys"): AccountsRegenerateAccessKey;
(path: "/collections/{collectionName}", collectionName: string): CollectionsGetCollection;
(path: "/collections"): CollectionsListCollections;
(path: "/collections/{collectionName}/getChildCollectionNames", collectionName: string): CollectionsListChildCollectionNames;
(path: "/collections/{collectionName}/getCollectionPath", collectionName: string): CollectionsGetCollectionPath;
(path: "/resourceSetRuleConfigs/defaultResourceSetRuleConfig"): ResourceSetRulesGetResourceSetRule;
(path: "/resourceSetRuleConfigs"): ResourceSetRulesListResourceSetRules;
}
// @public (undocumented)
export interface Rule {
// (undocumented)
displayName?: string;
// (undocumented)
isResourceSet?: boolean;
// (undocumented)
lastUpdatedTimestamp?: number;
// (undocumented)
name?: string;
// (undocumented)
qualifiedName: string;
}
// @public (undocumented)
export interface ScopedRule {
// (undocumented)
bindingUrl: string;
// (undocumented)
rules?: Array<Rule>;
// (undocumented)
storeType: string;
}
// @public (undocumented)
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: "User" | "Application" | "ManagedIdentity" | "Key";
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: "User" | "Application" | "ManagedIdentity" | "Key";
}
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -1,7 +0,0 @@
# Purview Scanning resource endpoint
ENDPOINT=
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -1,36 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how get a list of collections
*
* @summary gets a list of collections
* @azsdk-weight 40
*/
import PurviewAccount, { paginate } from "@azure-rest/purview-account";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";
dotenv.config();
const endpoint = process.env["ENDPOINT"] || "";
async function main() {
console.log("== List collections sample ==");
const client = PurviewAccount(endpoint, new DefaultAzureCredential());
const response = await client.path("/collections").get();
if (response.status !== "200") {
console.log(`GET "/collections" failed with ${response.status}`);
}
const dataSources = paginate(client, response);
for await (const dataSource of dataSources) {
console.log(dataSource);
}
}
main().catch(console.error);

Просмотреть файл

@ -1,63 +0,0 @@
---
page_type: sample
languages:
- javascript
products:
- azure
urlFragment: purview-account-javascript
disableDocsMs: true
---
# Azure Purview Account rest client library samples for JavaScript
These sample programs show how to use the JavaScript client libraries for Azure Purview Account rest in some common scenarios.
| **File Name** | **Description** |
| ----------------------------- | -------------------------- |
| [collections.js][collections] | gets a list of collections |
## Prerequisites
The sample programs are compatible with Node.js >=14.0.0.
You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs:
- [Azure Purview Account][createpurviewaccount_portal]
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node collections.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env ENDPOINT="<endpoint>" node collections.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[collections]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/purview/purview-account-rest/samples/v1/javascript/collections.js
[apiref]: https://docs.microsoft.com/azure/purview/tutorial-using-rest-apis
[freesub]: https://azure.microsoft.com/free/
[createpurviewaccount_portal]: https://docs.microsoft.com/azure/purview/create-catalog-portal
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-account-rest/README.md

Просмотреть файл

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how get a list of collections
*
* @summary gets a list of collections
*/
const PurviewAccount = require("@azure-rest/purview-Account");
const { DefaultAzureCredential } = require("@azure/identity");
const dotenv = require("dotenv");
dotenv.config();
const endpoint = process.env["ENDPOINT"] || "";
async function main() {
console.log("== List collections sample ==");
const client = PurviewAccount(endpoint, new DefaultAzureCredential());
const response = await client.path("/collections").get();
if (response.status !== "200") {
console.log(`GET "/collections" failed with ${response.status}`);
}
console.log(response.body);
}
main().catch(console.error);

Просмотреть файл

@ -1,33 +0,0 @@
{
"name": "azure-purview-account-samples-js",
"private": true,
"version": "1.0.0",
"description": "Azure Purview Scanning rest client library samples for JavaScript",
"engine": {
"node": ">=12.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/purview/purview-account-rest"
},
"keywords": [
"node",
"azure",
"cloud",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-account-rest",
"dependencies": {
"@azure-rest/purview-account": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
}
}

Просмотреть файл

@ -1,7 +0,0 @@
# Purview Scanning resource endpoint
ENDPOINT=
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -1,76 +0,0 @@
---
page_type: sample
languages:
- typescript
products:
- azure
urlFragment: purview-account-typescript
disableDocsMs: true
---
# Azure Purview Scanning rest client library samples for TypeScript
These sample programs show how to use the TypeScript client libraries for Azure Purview Scanning rest in some common scenarios.
| **File Name** | **Description** |
| ----------------------------- | -------------------------- |
| [collections.ts][collections] | gets a list of collections |
## Prerequisites
The sample programs are compatible with Node.js >=14.0.0.
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs:
- [Azure Purview Account][createpurviewaccount_portal]
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/collections.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env ENDPOINT="<endpoint>" node dist/collections.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[collections]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/purview/purview-account-rest/samples/v1/javascript/collections.js
[apiref]: https://docs.microsoft.com/azure/purview/tutorial-using-rest-apis
[freesub]: https://azure.microsoft.com/free/
[createpurviewaccount_portal]: https://docs.microsoft.com/azure/purview/create-catalog-portal
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-account-rest/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -1,41 +0,0 @@
{
"name": "azure-purview-account-samples-ts",
"private": true,
"version": "1.0.0",
"description": "Azure Purview Scanning rest client library samples for TypeScript",
"engine": {
"node": ">=12.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/purview/purview-account-rest"
},
"keywords": [
"node",
"azure",
"cloud",
"typescript",
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/purview/purview-account-rest",
"dependencies": {
"@azure-rest/purview-account": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"typescript": "~4.2.0",
"rimraf": "latest"
}
}

Просмотреть файл

@ -1,7 +0,0 @@
# Purview Scanning resource endpoint
ENDPOINT=
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how get a list of collections
*
* @summary gets a list of collections
*/
import PurviewAccount from "@azure-rest/purview-account";
import { DefaultAzureCredential } from "@azure/identity";
import dotenv from "dotenv";
dotenv.config();
const endpoint = process.env["ENDPOINT"] || "";
async function main() {
console.log("== List collections sample ==");
const client = PurviewAccount(endpoint, new DefaultAzureCredential());
const response = await client.path("/collections").get();
if (response.status !== "200") {
console.log(`GET "/collections" failed with ${response.status}`);
}
console.log(response.body);
}
main().catch(console.error);

Просмотреть файл

@ -1,17 +0,0 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**.ts"
]
}

Просмотреть файл

@ -1,13 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import PurviewAccount from "./purviewAccount";
export * from "./purviewAccount";
export * from "./models";
export * from "./parameters";
export * from "./responses";
export { paginate, PaginateReturn, GetArrayType } from "./paginateHelper";
export default PurviewAccount;

Просмотреть файл

@ -1,367 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export interface Account {
/** Gets or sets the identifier. */
id?: string;
/** Identity Info on the tracked resource */
identity?: Identity;
/** Gets or sets the location. */
location?: string;
/** Gets or sets the name. */
name?: string;
/** Gets or sets the properties. */
properties?: AccountProperties;
/** Gets or sets the Sku. */
sku?: AccountSku;
/** Metadata pertaining to creation and last modification of the resource. */
systemData?: AccountSystemData;
/** Tags on the azure resource. */
tags?: Record<string, string>;
/** Gets or sets the type. */
type?: string;
}
export interface Identity {
/** Service principal object Id */
principalId?: string;
/** Tenant Id */
tenantId?: string;
/** Identity Type */
type?: "SystemAssigned";
}
export interface AccountProperties {
/**
* Cloud connectors.
* External cloud identifier used as part of scanning configuration.
*/
cloudConnectors?: CloudConnectors;
/** Gets the time at which the entity was created. */
createdAt?: Date;
/** Gets the creator of the entity. */
createdBy?: string;
/** Gets the creators of the entity's object id. */
createdByObjectId?: string;
/** The URIs that are the public endpoints of the account. */
endpoints?: AccountPropertiesEndpoints;
/** Gets or sets the friendly name. */
friendlyName?: string;
/** Gets or sets the managed resource group name */
managedResourceGroupName?: string;
/** Gets the resource identifiers of the managed resources. */
managedResources?: AccountPropertiesManagedResources;
/** Gets the private endpoint connections information. */
privateEndpointConnections?: Array<PrivateEndpointConnection>;
/** Gets or sets the state of the provisioning. */
provisioningState?:
| "Unknown"
| "Creating"
| "Moving"
| "Deleting"
| "SoftDeleting"
| "SoftDeleted"
| "Failed"
| "Succeeded"
| "Canceled";
/** Gets or sets the public network access. */
publicNetworkAccess?: "NotSpecified" | "Enabled" | "Disabled";
}
export interface CloudConnectors {
/**
* AWS external identifier.
* Configured in AWS to allow use of the role arn used for scanning
*/
awsExternalId?: string;
}
export interface AccountEndpoints {
/** Gets the catalog endpoint. */
catalog?: string;
/** Gets the guardian endpoint. */
guardian?: string;
/** Gets the scan endpoint. */
scan?: string;
}
export interface AccountPropertiesEndpoints extends AccountEndpoints {}
export interface ManagedResources {
/** Gets the managed event hub namespace resource identifier. */
eventHubNamespace?: string;
/** Gets the managed resource group resource identifier. This resource group will host resource dependencies for the account. */
resourceGroup?: string;
/** Gets the managed storage account resource identifier. */
storageAccount?: string;
}
export interface AccountPropertiesManagedResources extends ManagedResources {}
export interface PrivateEndpointConnection {
/** Gets or sets the identifier. */
id?: string;
/** Gets or sets the name. */
name?: string;
/** The connection identifier. */
properties?: PrivateEndpointConnectionProperties;
/** Gets or sets the type. */
type?: string;
}
export interface PrivateEndpointConnectionProperties {
/** The private endpoint information. */
privateEndpoint?: PrivateEndpoint;
/** The private link service connection state. */
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState;
/** The provisioning state. */
provisioningState?: string;
}
export interface PrivateEndpoint {
/** The private endpoint identifier. */
id?: string;
}
export interface PrivateLinkServiceConnectionState {
/** The required actions. */
actionsRequired?: string;
/** The description. */
description?: string;
/** The status. */
status?: "Unknown" | "Pending" | "Approved" | "Rejected" | "Disconnected";
}
export interface AccountSku {
/** Gets or sets the sku capacity. Possible values include: 4, 16 */
capacity?: number;
/** Gets or sets the sku name. */
name?: "Standard";
}
export interface SystemData {
/** The timestamp of resource creation (UTC). */
createdAt?: Date;
/** The identity that created the resource. */
createdBy?: string;
/** The type of identity that created the resource. */
createdByType?: "User" | "Application" | "ManagedIdentity" | "Key";
/** The timestamp of the last modification the resource (UTC). */
lastModifiedAt?: Date;
/** The identity that last modified the resource. */
lastModifiedBy?: string;
/** The type of identity that last modified the resource. */
lastModifiedByType?: "User" | "Application" | "ManagedIdentity" | "Key";
}
export interface AccountSystemData extends SystemData {}
export interface ErrorResponseModel {
/** Gets or sets the error. */
error?: ErrorResponseModelError;
}
export interface ErrorModel {
/** Gets or sets the code. */
code?: string;
/** Gets or sets the details. */
details?: Array<ErrorModel>;
/** Gets or sets the messages. */
message?: string;
/** Gets or sets the target. */
target?: string;
}
export interface ErrorResponseModelError extends ErrorModel {}
export interface DataPlaneAccountUpdateParameters {
/** The friendly name for the azure resource. */
friendlyName?: string;
}
export interface AccessKeys {
/** Gets or sets the primary connection string. */
atlasKafkaPrimaryEndpoint?: string;
/** Gets or sets the secondary connection string. */
atlasKafkaSecondaryEndpoint?: string;
}
export interface AccessKeyOptions {
/** The access key type. */
keyType?: "PrimaryAtlasKafkaKey" | "SecondaryAtlasKafkaKey";
}
export interface Collection {
/** Gets the state of the provisioning. */
collectionProvisioningState?:
| "Unknown"
| "Creating"
| "Moving"
| "Deleting"
| "Failed"
| "Succeeded";
/** Gets or sets the description. */
description?: string;
/** Gets or sets the friendly name of the collection. */
friendlyName?: string;
/** Gets the name. */
name?: string;
/** Gets or sets the parent collection reference. */
parentCollection?: CollectionReference;
/** Gets the system data that contains information about who and when created and updated the resource. */
systemData?: CollectionSystemData;
}
export interface CollectionReference {
/** Gets or sets the reference name. */
referenceName?: string;
/** Gets the reference type property. */
type?: string;
}
export interface CollectionSystemData extends SystemData {}
export interface CollectionList {
/** Total item count. */
count?: number;
/** The Url of next result page. */
nextLink?: string;
/** Collection of items of type results. */
value: Array<Collection>;
}
export interface CollectionNameResponseList {
/** Total item count. */
count?: number;
/** The Url of next result page. */
nextLink?: string;
/** Collection of items of type results. */
value: Array<CollectionNameResponse>;
}
export interface CollectionNameResponse {
/** Gets or sets the friendly name of the collection. */
friendlyName?: string;
/** Gets the name. */
name?: string;
}
export interface CollectionPathResponse {
/** The friendly names of ancestors starting from the default (root) collection and ending with the immediate parent. */
parentFriendlyNameChain?: Array<string>;
/** The names of ancestors starting from the default (root) collection and ending with the immediate parent. */
parentNameChain?: Array<string>;
}
export interface ResourceSetRuleConfig {
/** Gets or sets the advanced resource set property of the account. */
advancedResourceSet?: AdvancedResourceSet;
/** The name of the rule */
name?: string;
/** The configuration rules for path pattern extraction. */
pathPatternConfig?: PathPatternExtractorConfig;
}
export interface AdvancedResourceSet {
/** Date at which ResourceSetProcessing property of the account is updated. */
modifiedAt?: Date;
/** The advanced resource property of the account. */
resourceSetProcessing?: "Default" | "Advanced";
}
export interface PathPatternExtractorConfig {
acceptedPatterns?: Array<Filter>;
complexReplacers?: Array<ComplexReplacerConfig>;
createdBy: string;
enableDefaultPatterns: boolean;
lastUpdatedTimestamp?: number;
modifiedBy?: string;
normalizationRules?: Array<NormalizationRule>;
regexReplacers?: Array<RegexReplacer>;
rejectedPatterns?: Array<Filter>;
scopedRules?: Array<ScopedRule>;
version?: number;
}
export interface Filter {
createdBy?: string;
filterType?: "Pattern" | "Regex";
lastUpdatedTimestamp?: number;
modifiedBy?: string;
name: string;
path: string;
}
export interface ComplexReplacerConfig {
createdBy?: string;
description?: string;
disabled?: boolean;
disableRecursiveReplacerApplication?: boolean;
lastUpdatedTimestamp?: number;
modifiedBy?: string;
name?: string;
typeName?: string;
}
export interface NormalizationRule {
description?: string;
disabled?: boolean;
dynamicReplacement?: boolean;
entityTypes?: Array<string>;
lastUpdatedTimestamp?: number;
name?: string;
regex?: FastRegex;
replaceWith?: string;
version?: number;
}
export interface FastRegex {
maxDigits?: number;
maxLetters?: number;
minDashes?: number;
minDigits?: number;
minDigitsOrLetters?: number;
minDots?: number;
minHex?: number;
minLetters?: number;
minUnderscores?: number;
options?: number;
regexStr?: string;
}
export interface RegexReplacer {
condition?: string;
createdBy?: string;
description?: string;
disabled: boolean;
disableRecursiveReplacerApplication?: boolean;
doNotReplaceRegex?: FastRegex;
lastUpdatedTimestamp?: number;
modifiedBy?: string;
name: string;
regex?: FastRegex;
replaceWith?: string;
}
export interface ScopedRule {
bindingUrl: string;
rules?: Array<Rule>;
storeType: string;
}
export interface Rule {
displayName?: string;
isResourceSet?: boolean;
lastUpdatedTimestamp?: number;
name?: string;
qualifiedName: string;
}
export interface ResourceSetRuleConfigList {
/** Total item count. */
count?: number;
/** The Url of next result page. */
nextLink?: string;
/** Collection of items of type results. */
value: Array<ResourceSetRuleConfig>;
}

Просмотреть файл

@ -1,36 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { paginateResponse, PagedAsyncIterableIterator } from "@azure-rest/core-client-paging";
import { Client, PathUncheckedResponse } from "@azure-rest/core-client";
/**
* Helper type to extract the type of an array
*/
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
/**
* Helper type to infer the Type of the paged elements from the response type
* This type is generated based on the swagger information for x-ms-pageable
* specifically on the itemName property which indicates the property of the response
* where the page items are found. The default value is `value`.
* This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
*/
export type PaginateReturn<TResult> = TResult extends {
body: { value?: infer TPage };
}
? GetArrayType<TPage>
: Array<unknown>;
/**
* Helper function to get PagedAsyncIterableIterator to paginate results starting from a given response.
* @param client - Client to use for sending the next page requests
* @param initialResponse - Initial response containing the nextLink and current page of elements
* @returns - PagedAsyncIterableIterator to iterate the elements
*/
export function paginate<TReturn extends PathUncheckedResponse>(
client: Client,
initialResponse: TReturn
): PagedAsyncIterableIterator<PaginateReturn<TReturn>, PaginateReturn<TReturn>[]> {
return paginateResponse<PaginateReturn<TReturn>>(client, initialResponse);
}

Просмотреть файл

@ -1,79 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { RequestParameters } from "@azure-rest/core-client";
import {
DataPlaneAccountUpdateParameters,
AccessKeyOptions,
Collection,
ResourceSetRuleConfig,
} from "./models";
export type AccountsGetAccountPropertiesParameters = RequestParameters;
export interface AccountsUpdateAccountPropertiesBodyParam {
body: DataPlaneAccountUpdateParameters;
}
export type AccountsUpdateAccountPropertiesParameters = AccountsUpdateAccountPropertiesBodyParam &
RequestParameters;
export type AccountsGetAccessKeysParameters = RequestParameters;
export interface AccountsRegenerateAccessKeyBodyParam {
body: AccessKeyOptions;
}
export type AccountsRegenerateAccessKeyParameters = AccountsRegenerateAccessKeyBodyParam &
RequestParameters;
export type CollectionsGetCollectionParameters = RequestParameters;
export interface CollectionsCreateOrUpdateCollectionBodyParam {
body: Collection;
}
export type CollectionsCreateOrUpdateCollectionParameters =
CollectionsCreateOrUpdateCollectionBodyParam & RequestParameters;
export type CollectionsDeleteCollectionParameters = RequestParameters;
export interface CollectionsListCollectionsQueryParamProperties {
$skipToken?: string;
}
export interface CollectionsListCollectionsQueryParam {
queryParameters?: CollectionsListCollectionsQueryParamProperties;
}
export type CollectionsListCollectionsParameters = CollectionsListCollectionsQueryParam &
RequestParameters;
export interface CollectionsListChildCollectionNamesQueryParamProperties {
$skipToken?: string;
}
export interface CollectionsListChildCollectionNamesQueryParam {
queryParameters?: CollectionsListChildCollectionNamesQueryParamProperties;
}
export type CollectionsListChildCollectionNamesParameters =
CollectionsListChildCollectionNamesQueryParam & RequestParameters;
export type CollectionsGetCollectionPathParameters = RequestParameters;
export type ResourceSetRulesGetResourceSetRuleParameters = RequestParameters;
export interface ResourceSetRulesCreateOrUpdateResourceSetRuleBodyParam {
body: ResourceSetRuleConfig;
}
export type ResourceSetRulesCreateOrUpdateResourceSetRuleParameters =
ResourceSetRulesCreateOrUpdateResourceSetRuleBodyParam & RequestParameters;
export type ResourceSetRulesDeleteResourceSetRuleParameters = RequestParameters;
export interface ResourceSetRulesListResourceSetRulesQueryParamProperties {
$skipToken?: string;
}
export interface ResourceSetRulesListResourceSetRulesQueryParam {
queryParameters?: ResourceSetRulesListResourceSetRulesQueryParamProperties;
}
export type ResourceSetRulesListResourceSetRulesParameters =
ResourceSetRulesListResourceSetRulesQueryParam & RequestParameters;

Просмотреть файл

@ -1,206 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import {
AccountsGetAccountPropertiesParameters,
AccountsUpdateAccountPropertiesParameters,
AccountsGetAccessKeysParameters,
AccountsRegenerateAccessKeyParameters,
CollectionsGetCollectionParameters,
CollectionsCreateOrUpdateCollectionParameters,
CollectionsDeleteCollectionParameters,
CollectionsListCollectionsParameters,
CollectionsListChildCollectionNamesParameters,
CollectionsGetCollectionPathParameters,
ResourceSetRulesGetResourceSetRuleParameters,
ResourceSetRulesCreateOrUpdateResourceSetRuleParameters,
ResourceSetRulesDeleteResourceSetRuleParameters,
ResourceSetRulesListResourceSetRulesParameters,
} from "./parameters";
import {
AccountsGetAccountProperties200Response,
AccountsGetAccountPropertiesdefaultResponse,
AccountsUpdateAccountProperties200Response,
AccountsUpdateAccountPropertiesdefaultResponse,
AccountsGetAccessKeys200Response,
AccountsGetAccessKeysdefaultResponse,
AccountsRegenerateAccessKey200Response,
AccountsRegenerateAccessKeydefaultResponse,
CollectionsGetCollection200Response,
CollectionsGetCollectiondefaultResponse,
CollectionsCreateOrUpdateCollection200Response,
CollectionsCreateOrUpdateCollectiondefaultResponse,
CollectionsDeleteCollection204Response,
CollectionsDeleteCollectiondefaultResponse,
CollectionsListCollections200Response,
CollectionsListCollectionsdefaultResponse,
CollectionsListChildCollectionNames200Response,
CollectionsListChildCollectionNamesdefaultResponse,
CollectionsGetCollectionPath200Response,
CollectionsGetCollectionPathdefaultResponse,
ResourceSetRulesGetResourceSetRule200Response,
ResourceSetRulesGetResourceSetRuledefaultResponse,
ResourceSetRulesCreateOrUpdateResourceSetRule200Response,
ResourceSetRulesCreateOrUpdateResourceSetRuledefaultResponse,
ResourceSetRulesDeleteResourceSetRule200Response,
ResourceSetRulesDeleteResourceSetRule204Response,
ResourceSetRulesDeleteResourceSetRuledefaultResponse,
ResourceSetRulesListResourceSetRules200Response,
ResourceSetRulesListResourceSetRulesdefaultResponse,
} from "./responses";
import { getClient, ClientOptions, Client } from "@azure-rest/core-client";
import { TokenCredential } from "@azure/core-auth";
export interface AccountsGetAccountProperties {
/** Get an account */
get(
options?: AccountsGetAccountPropertiesParameters
): Promise<AccountsGetAccountProperties200Response | AccountsGetAccountPropertiesdefaultResponse>;
/** Updates an account */
patch(
options: AccountsUpdateAccountPropertiesParameters
): Promise<
AccountsUpdateAccountProperties200Response | AccountsUpdateAccountPropertiesdefaultResponse
>;
}
export interface AccountsGetAccessKeys {
/** List the authorization keys associated with this account. */
post(
options?: AccountsGetAccessKeysParameters
): Promise<AccountsGetAccessKeys200Response | AccountsGetAccessKeysdefaultResponse>;
}
export interface AccountsRegenerateAccessKey {
/** Regenerate the authorization keys associated with this data catalog. */
post(
options: AccountsRegenerateAccessKeyParameters
): Promise<AccountsRegenerateAccessKey200Response | AccountsRegenerateAccessKeydefaultResponse>;
}
export interface CollectionsGetCollection {
/** Get a collection */
get(
options?: CollectionsGetCollectionParameters
): Promise<CollectionsGetCollection200Response | CollectionsGetCollectiondefaultResponse>;
/** Creates or updates a collection entity. */
put(
options: CollectionsCreateOrUpdateCollectionParameters
): Promise<
| CollectionsCreateOrUpdateCollection200Response
| CollectionsCreateOrUpdateCollectiondefaultResponse
>;
/** Deletes a Collection entity. */
delete(
options?: CollectionsDeleteCollectionParameters
): Promise<CollectionsDeleteCollection204Response | CollectionsDeleteCollectiondefaultResponse>;
}
export interface CollectionsListCollections {
/** List the collections in the account. */
get(
options?: CollectionsListCollectionsParameters
): Promise<CollectionsListCollections200Response | CollectionsListCollectionsdefaultResponse>;
}
export interface CollectionsListChildCollectionNames {
/** Lists the child collections names in the collection. */
get(
options?: CollectionsListChildCollectionNamesParameters
): Promise<
| CollectionsListChildCollectionNames200Response
| CollectionsListChildCollectionNamesdefaultResponse
>;
}
export interface CollectionsGetCollectionPath {
/** Gets the parent name and parent friendly name chains that represent the collection path. */
get(
options?: CollectionsGetCollectionPathParameters
): Promise<CollectionsGetCollectionPath200Response | CollectionsGetCollectionPathdefaultResponse>;
}
export interface ResourceSetRulesGetResourceSetRule {
/** Get a resource set config service model. */
get(
options?: ResourceSetRulesGetResourceSetRuleParameters
): Promise<
| ResourceSetRulesGetResourceSetRule200Response
| ResourceSetRulesGetResourceSetRuledefaultResponse
>;
/** Creates or updates an resource set config. */
put(
options: ResourceSetRulesCreateOrUpdateResourceSetRuleParameters
): Promise<
| ResourceSetRulesCreateOrUpdateResourceSetRule200Response
| ResourceSetRulesCreateOrUpdateResourceSetRuledefaultResponse
>;
/** Deletes a ResourceSetRuleConfig resource. */
delete(
options?: ResourceSetRulesDeleteResourceSetRuleParameters
): Promise<
| ResourceSetRulesDeleteResourceSetRule200Response
| ResourceSetRulesDeleteResourceSetRule204Response
| ResourceSetRulesDeleteResourceSetRuledefaultResponse
>;
}
export interface ResourceSetRulesListResourceSetRules {
/** Get a resource set config service model. */
get(
options?: ResourceSetRulesListResourceSetRulesParameters
): Promise<
| ResourceSetRulesListResourceSetRules200Response
| ResourceSetRulesListResourceSetRulesdefaultResponse
>;
}
export interface Routes {
/** Resource for '/' has methods for the following verbs: get, patch */
(path: "/"): AccountsGetAccountProperties;
/** Resource for '/listkeys' has methods for the following verbs: post */
(path: "/listkeys"): AccountsGetAccessKeys;
/** Resource for '/regeneratekeys' has methods for the following verbs: post */
(path: "/regeneratekeys"): AccountsRegenerateAccessKey;
/** Resource for '/collections/\{collectionName\}' has methods for the following verbs: get, put, delete */
(path: "/collections/{collectionName}", collectionName: string): CollectionsGetCollection;
/** Resource for '/collections' has methods for the following verbs: get */
(path: "/collections"): CollectionsListCollections;
/** Resource for '/collections/\{collectionName\}/getChildCollectionNames' has methods for the following verbs: get */
(
path: "/collections/{collectionName}/getChildCollectionNames",
collectionName: string
): CollectionsListChildCollectionNames;
/** Resource for '/collections/\{collectionName\}/getCollectionPath' has methods for the following verbs: get */
(
path: "/collections/{collectionName}/getCollectionPath",
collectionName: string
): CollectionsGetCollectionPath;
/** Resource for '/resourceSetRuleConfigs/defaultResourceSetRuleConfig' has methods for the following verbs: get, put, delete */
(
path: "/resourceSetRuleConfigs/defaultResourceSetRuleConfig"
): ResourceSetRulesGetResourceSetRule;
/** Resource for '/resourceSetRuleConfigs' has methods for the following verbs: get */
(path: "/resourceSetRuleConfigs"): ResourceSetRulesListResourceSetRules;
}
export type PurviewAccountRestClient = Client & {
path: Routes;
};
export default function PurviewAccount(
endpoint: string,
credentials: TokenCredential,
options: ClientOptions = {}
): PurviewAccountRestClient {
const baseUrl = options.baseUrl ?? `${endpoint}`;
options.apiVersion = options.apiVersion ?? "2019-11-01-preview";
options = {
...options,
credentials: {
scopes: ["https://purview.azure.net/.default"],
},
};
return getClient(baseUrl, credentials, options) as PurviewAccountRestClient;
}

Просмотреть файл

@ -1,189 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { HttpResponse } from "@azure-rest/core-client";
import {
Account,
ErrorResponseModel,
AccessKeys,
Collection,
CollectionList,
CollectionNameResponseList,
CollectionPathResponse,
ResourceSetRuleConfig,
ResourceSetRuleConfigList,
} from "./models";
/** Get an account */
export interface AccountsGetAccountProperties200Response extends HttpResponse {
status: "200";
body: Account;
}
/** Get an account */
export interface AccountsGetAccountPropertiesdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Updates an account */
export interface AccountsUpdateAccountProperties200Response extends HttpResponse {
status: "200";
body: Account;
}
/** Updates an account */
export interface AccountsUpdateAccountPropertiesdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** List the authorization keys associated with this account. */
export interface AccountsGetAccessKeys200Response extends HttpResponse {
status: "200";
body: AccessKeys;
}
/** List the authorization keys associated with this account. */
export interface AccountsGetAccessKeysdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Regenerate the authorization keys associated with this data catalog. */
export interface AccountsRegenerateAccessKey200Response extends HttpResponse {
status: "200";
body: AccessKeys;
}
/** Regenerate the authorization keys associated with this data catalog. */
export interface AccountsRegenerateAccessKeydefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Get a collection */
export interface CollectionsGetCollection200Response extends HttpResponse {
status: "200";
body: Collection;
}
/** Get a collection */
export interface CollectionsGetCollectiondefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Creates or updates a collection entity. */
export interface CollectionsCreateOrUpdateCollection200Response extends HttpResponse {
status: "200";
body: Collection;
}
/** Creates or updates a collection entity. */
export interface CollectionsCreateOrUpdateCollectiondefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Deletes a Collection entity. */
export interface CollectionsDeleteCollection204Response extends HttpResponse {
status: "204";
body: Record<string, unknown>;
}
/** Deletes a Collection entity. */
export interface CollectionsDeleteCollectiondefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** List the collections in the account. */
export interface CollectionsListCollections200Response extends HttpResponse {
status: "200";
body: CollectionList;
}
/** List the collections in the account. */
export interface CollectionsListCollectionsdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Lists the child collections names in the collection. */
export interface CollectionsListChildCollectionNames200Response extends HttpResponse {
status: "200";
body: CollectionNameResponseList;
}
/** Lists the child collections names in the collection. */
export interface CollectionsListChildCollectionNamesdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Gets the parent name and parent friendly name chains that represent the collection path. */
export interface CollectionsGetCollectionPath200Response extends HttpResponse {
status: "200";
body: CollectionPathResponse;
}
/** Gets the parent name and parent friendly name chains that represent the collection path. */
export interface CollectionsGetCollectionPathdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Get a resource set config service model. */
export interface ResourceSetRulesGetResourceSetRule200Response extends HttpResponse {
status: "200";
body: ResourceSetRuleConfig;
}
/** Get a resource set config service model. */
export interface ResourceSetRulesGetResourceSetRuledefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Creates or updates an resource set config. */
export interface ResourceSetRulesCreateOrUpdateResourceSetRule200Response extends HttpResponse {
status: "200";
body: ResourceSetRuleConfig;
}
/** Creates or updates an resource set config. */
export interface ResourceSetRulesCreateOrUpdateResourceSetRuledefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Deletes a ResourceSetRuleConfig resource. */
export interface ResourceSetRulesDeleteResourceSetRule200Response extends HttpResponse {
status: "200";
body: Record<string, unknown>;
}
/** Deletes a ResourceSetRuleConfig resource. */
export interface ResourceSetRulesDeleteResourceSetRule204Response extends HttpResponse {
status: "204";
body: Record<string, unknown>;
}
/** Deletes a ResourceSetRuleConfig resource. */
export interface ResourceSetRulesDeleteResourceSetRuledefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}
/** Get a resource set config service model. */
export interface ResourceSetRulesListResourceSetRules200Response extends HttpResponse {
status: "200";
body: ResourceSetRuleConfigList;
}
/** Get a resource set config service model. */
export interface ResourceSetRulesListResourceSetRulesdefaultResponse extends HttpResponse {
status: "500";
body: ErrorResponseModel;
}

Просмотреть файл

@ -1,22 +0,0 @@
# Azure Purview Catalog TypeScript Protocol Layer
> see https://aka.ms/autorest
## Configuration
```yaml
package-name: "@azure-rest/purview-account"
title: PurviewAccount
description: Purview Account Client
generate-metadata: false
license-header: MICROSOFT_MIT_NO_VERSION
output-folder: ../
source-code-folder-path: ./src
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/purview/data-plane/Azure.Analytics.Purview.Account/preview/2019-11-01-preview/account.json
package-version: 1.0.0-beta.1
rest-level-client: true
add-credentials: true
credential-scopes: "https://purview.azure.net/.default"
use-extension:
"@autorest/typescript": "6.0.0-alpha.8.20210810.1"
```

Просмотреть файл

@ -1,32 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { PurviewAccountRestClient } from "../../src";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { createClient, createRecorder } from "./utils/recordedClient";
import { Context } from "mocha";
describe("Get account info", () => {
let recorder: Recorder;
let client: PurviewAccountRestClient;
beforeEach(function (this: Context) {
recorder = createRecorder(this);
client = createClient();
});
afterEach(async function () {
await recorder.stop();
});
it("should get the account info", async () => {
const result = await client.path("/").get();
if (result.status !== "200") {
assert.fail(`GET "/" failed with ${result.status}`);
}
assert.isDefined(result.body);
});
});

Просмотреть файл

@ -1,33 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { PurviewAccountRestClient } from "../../src";
import { Recorder } from "@azure-tools/test-recorder";
import { assert } from "chai";
import { createClient, createRecorder } from "./utils/recordedClient";
import { Context } from "mocha";
describe("List collections", () => {
let recorder: Recorder;
let client: PurviewAccountRestClient;
beforeEach(function (this: Context) {
recorder = createRecorder(this);
client = createClient();
});
afterEach(async function () {
await recorder.stop();
});
it("should list all available collections", async () => {
const result = await client.path("/collections").get();
if (result.status !== "200") {
assert.fail(`GET "/collections" failed with ${result.status}`);
}
assert.isDefined(result.body.count);
// assert(client);
});
});

Просмотреть файл

@ -1,2 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

Просмотреть файл

@ -1,6 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import * as dotenv from "dotenv";
dotenv.config();

Просмотреть файл

@ -1,55 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/// <reference lib="esnext.asynciterable" />
import { Context } from "mocha";
import { env, Recorder, record, RecorderEnvironmentSetup } from "@azure-tools/test-recorder";
import PurviewAccount, { PurviewAccountRestClient } from "../../../src";
import { ClientSecretCredential } from "@azure/identity";
import "./env";
import { ClientOptions } from "@azure-rest/core-client";
const replaceableVariables: { [k: string]: string } = {
ENDPOINT: "https://endpoint",
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
};
export const environmentSetup: RecorderEnvironmentSetup = {
replaceableVariables,
customizationsOnRecordings: [
(recording: string): string =>
recording.replace(/"access_token"\s?:\s?"[^"]*"/g, `"access_token":"access_token"`),
// If we put ENDPOINT in replaceableVariables above, it will not capture
// the endpoint string used with nock, which will be expanded to
// https://<endpoint>:443/ and therefore will not match, so we have to do
// this instead.
(recording: string): string => {
const replaced = recording.replace("endpoint:443", "endpoint");
return replaced;
},
],
queryParametersToSkip: [],
};
export function createClient(options?: ClientOptions): PurviewAccountRestClient {
const credential = new ClientSecretCredential(
env.AZURE_TENANT_ID,
env.AZURE_CLIENT_ID,
env.AZURE_CLIENT_SECRET
);
return PurviewAccount(env.ENDPOINT, credential, options);
}
/**
* creates the recorder and reads the environment variables from the `.env` file.
* Should be called first in the test suite to make sure environment variables are
* read before they are being used.
*/
export function createRecorder(context: Context): Recorder {
return record(context, environmentSetup);
}

Просмотреть файл

@ -1,11 +0,0 @@
{
"extends": "../../../tsconfig.package",
"compilerOptions": {
"outDir": "./dist-esm",
"declarationDir": "./types",
"paths": {
"@azure-rest/purview-account": ["./src/index"]
}
},
"include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"]
}