From a595cb27e4ef5d8bb5800c8b1f60adee2d1ff942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0vihl=C3=ADk?= Date: Fri, 25 Feb 2022 07:39:49 +0100 Subject: [PATCH] @azure/communication-common Azure Core 2.0 Migration (#20337) * migrated clientArguments, removed circular deps * removed the dependency on @azure/core-http * policy converted to core rest pipeline * removed the old policy, bumped major version * added a changelog entry * added test * updated pnpm file --- common/config/rush/pnpm-lock.yaml | 426 +++++++++--------- .../communication-common/CHANGELOG.md | 5 +- .../communication-common/package.json | 7 +- .../review/communication-common.api.md | 13 +- .../src/autoRefreshTokenCredential.ts | 5 +- .../src/azureCommunicationTokenCredential.ts | 68 +++ .../src/communicationTokenCredential.ts | 63 +-- .../src/credential/clientArguments.ts | 13 +- .../communicationAccessKeyCredentialPolicy.ts | 125 ++--- .../src/credential/communicationAuthPolicy.ts | 20 +- .../src/credential/cryptoUtils.browser.ts | 20 +- .../src/credential/isNode.browser.ts | 7 + .../src/credential/isNode.ts | 8 + .../communication-common/src/index.ts | 2 +- .../communication-common/src/shims.d.ts | 34 -- .../src/staticTokenCredential.ts | 2 +- .../communication-common/src/tokenParser.ts | 2 +- .../test/clientArguments.spec.ts | 2 +- .../communicationKeyCredentialPolicy.spec.ts | 66 +++ .../test/communicationTokenCredential.spec.ts | 8 +- .../test/cryptoUtils.spec.ts | 2 +- .../test/identifierModelSerializer.spec.ts | 8 +- .../test/identifierModels.spec.ts | 8 +- 23 files changed, 471 insertions(+), 443 deletions(-) create mode 100644 sdk/communication/communication-common/src/azureCommunicationTokenCredential.ts create mode 100644 sdk/communication/communication-common/src/credential/isNode.browser.ts create mode 100644 sdk/communication/communication-common/src/credential/isNode.ts delete mode 100644 sdk/communication/communication-common/src/shims.d.ts create mode 100644 sdk/communication/communication-common/test/communicationKeyCredentialPolicy.spec.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e98765aabb60..9410607e4e08 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3030,8 +3030,8 @@ packages: peerDependencies: chai: '>= 4.0.0 < 5' dependencies: - chai: 4.3.6 fclone: 1.0.11 + chai: 4.3.6 dev: false /chai-string/1.5.0_chai@4.3.6: @@ -3047,9 +3047,9 @@ packages: engines: {node: '>=4'} dependencies: assertion-error: 1.1.0 - check-error: 1.0.2 deep-eql: 3.0.1 get-func-name: 2.0.0 + check-error: 1.0.2 loupe: 2.3.3 pathval: 1.1.1 type-detect: 4.0.8 @@ -3232,8 +3232,8 @@ packages: engines: {node: '>=10.0.0'} hasBin: true dependencies: - chalk: 4.1.2 date-fns: 2.28.0 + chalk: 4.1.2 lodash: 4.17.21 rxjs: 6.6.7 spawn-command: 0.0.2-1 @@ -3897,7 +3897,6 @@ packages: '@eslint/eslintrc': 0.4.3 '@humanwhocodes/config-array': 0.5.0 ajv: 6.12.6 - chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.3 doctrine: 3.0.0 @@ -3914,6 +3913,7 @@ packages: functional-red-black-tree: 1.0.1 glob-parent: 5.1.2 globals: 13.12.1 + chalk: 4.1.2 ignore: 4.0.6 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -5501,7 +5501,6 @@ packages: dependencies: body-parser: 1.19.1 braces: 3.0.2 - chokidar: 3.5.3 colors: 1.4.0 connect: 3.7.0 di: 0.0.1 @@ -5509,6 +5508,7 @@ packages: glob: 7.2.0 graceful-fs: 4.2.9 http-proxy: 1.18.1 + chokidar: 3.5.3 isbinaryfile: 4.0.8 lodash: 4.17.21 log4js: 6.4.1 @@ -5537,7 +5537,6 @@ packages: dependencies: body-parser: 1.19.1 braces: 3.0.2 - chokidar: 3.5.3 colors: 1.4.0 connect: 3.7.0 di: 0.0.1 @@ -5545,6 +5544,7 @@ packages: glob: 7.2.0 graceful-fs: 4.2.9 http-proxy: 1.18.1_debug@4.3.3 + chokidar: 3.5.3 isbinaryfile: 4.0.8 lodash: 4.17.21 log4js: 6.4.1 @@ -5792,8 +5792,8 @@ packages: /md5/2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} dependencies: - charenc: 0.0.2 crypt: 0.0.2 + charenc: 0.0.2 is-buffer: 1.1.6 dev: false @@ -5950,7 +5950,6 @@ packages: dependencies: ansi-colors: 3.2.3 browser-stdout: 1.3.1 - chokidar: 3.3.0 debug: 3.2.6 diff: 3.5.0 escape-string-regexp: 1.0.5 @@ -5958,6 +5957,7 @@ packages: glob: 7.1.3 growl: 1.10.5 he: 1.2.0 + chokidar: 3.3.0 js-yaml: 3.13.1 log-symbols: 3.0.0 minimatch: 3.0.4 @@ -6162,8 +6162,8 @@ packages: hasBin: true dependencies: ansi-styles: 3.2.1 - chalk: 2.4.2 cross-spawn: 6.0.5 + chalk: 2.4.2 memorystream: 0.3.1 minimatch: 3.0.5 pidtree: 0.3.1 @@ -7373,10 +7373,10 @@ packages: resolution: {integrity: sha512-bdwNOAGuKwPU+qsn0ASxTv+QfkXU+3VmkcDOkt965tes+JQQc8d6SfoLiEiRVhCey4v+ip2IjNUSbZm5nnkI9g==} engines: {node: '>=6'} dependencies: - check-more-types: 2.24.0 debug: 4.1.1 disparity: 3.0.0 folktale: 2.3.2 + check-more-types: 2.24.0 lazy-ass: 1.6.0 strip-ansi: 5.2.0 variable-diff: 1.1.0 @@ -7388,11 +7388,11 @@ packages: hasBin: true dependencies: arg: 4.1.3 - check-more-types: 2.24.0 common-tags: 1.8.0 debug: 4.3.1 escape-quotes: 1.0.2 folktale: 2.3.2 + check-more-types: 2.24.0 is-ci: 2.0.0 jsesc: 2.5.2 lazy-ass: 1.6.0 @@ -7409,10 +7409,10 @@ packages: engines: {node: '>=6'} dependencies: '@bahmutov/data-driven': 1.0.0 - check-more-types: 2.24.0 common-tags: 1.8.0 debug: 4.3.1 has-only: 1.1.1 + check-more-types: 2.24.0 its-name: 1.0.0 lazy-ass: 1.6.0 pluralize: 8.0.0 @@ -8628,16 +8628,16 @@ packages: '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -8671,16 +8671,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -8717,18 +8717,18 @@ packages: '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 cross-env: 7.0.3 csv-parse: 5.0.4 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -8759,16 +8759,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -8804,17 +8804,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -8850,17 +8850,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -8901,17 +8901,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -8958,17 +8958,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12108,8 +12108,8 @@ packages: '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 '@types/chai': 4.3.0 - chai: 4.3.6 cross-env: 7.0.3 + chai: 4.3.6 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 @@ -12585,21 +12585,21 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 buffer: 6.0.3 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 downlevel-dts: 0.8.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 inherits: 2.0.4 jsrsasign: 10.5.1 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-chrome-launcher: 3.1.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 @@ -12634,6 +12634,7 @@ packages: version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/communication-common': 1.1.0 '@azure/communication-identity': 1.0.0 '@azure/communication-signaling': 1.0.0-beta.12 '@azure/core-tracing': 1.0.0-preview.13 @@ -12643,18 +12644,18 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/uuid': 8.3.4 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12681,7 +12682,7 @@ packages: dev: false file:projects/communication-common.tgz: - resolution: {integrity: sha512-wOnmTjckWBwZi7PF2QhrMsY051qfW2MDFsLmwlAmiJHEfS2RJ7H4REF8UF8qeLUf3bHVUoK5ts78Fxua1PFjqw==, tarball: file:projects/communication-common.tgz} + resolution: {integrity: sha512-nZ4F/g5+8wwIhLSJRP7ADHcLgPvFZOj4U9w7MdeESveuLhdpiO/RDggXAD5hRo0bFrA5mu8Mj7PeuvBKsHdXYg==, tarball: file:projects/communication-common.tgz} name: '@rush-temp/communication-common' version: 0.0.0 dependencies: @@ -12692,19 +12693,19 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 inherits: 2.0.4 jwt-decode: 3.1.2 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-chrome-launcher: 3.1.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 @@ -12727,29 +12728,30 @@ packages: dev: false file:projects/communication-identity.tgz: - resolution: {integrity: sha512-k9Njp8MUIGI8StYq41q1UgvBbKfNFg1jqJrJ77p48ZxVjdNPEgqbowd33Luq48UA/jOqC6WI5vMnJcRq1byU8A==, tarball: file:projects/communication-identity.tgz} + resolution: {integrity: sha512-3KMUggy9VAdPjj9HyZeyJGz+miv2Hax+7yZPOsr5XUliBy3YKT7FlQoL9kuSEVv0kyed5WaqcwUSrAABI9OJyg==, tarball: file:projects/communication-identity.tgz} name: '@rush-temp/communication-identity' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/communication-common': 1.1.0 '@azure/core-tracing': 1.0.0-preview.13 '@microsoft/api-extractor': 7.19.4 '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12774,11 +12776,12 @@ packages: dev: false file:projects/communication-network-traversal.tgz: - resolution: {integrity: sha512-bhbCuvM5C95CQmy593VELfk/WK2+DwwVxRDdPN+eU3058xMUglY/yNE1IW/6KBeab/Yi/Id8I/DrKTCUhqQNlg==, tarball: file:projects/communication-network-traversal.tgz} + resolution: {integrity: sha512-cSn4oDnLrG4NKfWEDeps1XaSS5a9qLxDmyHebAsjlFb8MVscBbtPEiysFE3+zDWDaPaD1M6HbHYQNMDWQ0+5/Q==, tarball: file:projects/communication-network-traversal.tgz} name: '@rush-temp/communication-network-traversal' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/communication-common': 1.1.0 '@azure/communication-identity': 1.0.0 '@azure/core-tracing': 1.0.0-preview.13 '@microsoft/api-extractor': 7.19.4 @@ -12791,18 +12794,18 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12832,29 +12835,30 @@ packages: dev: false file:projects/communication-phone-numbers.tgz: - resolution: {integrity: sha512-0Ss+LuPwQEr+gxKbabczU300w9i+cbNsfp40GlcP59a15TOT+VgNu0ahwGJCvHCvnfTH9WrLPqqdM9SsTuBnmA==, tarball: file:projects/communication-phone-numbers.tgz} + resolution: {integrity: sha512-rRhGCLmHScAXIfu0DlqgtedWANSs00dq58UKw/quDQoboq4bKDUzBq1VEk14P7IeDdryEu3mgWLSkRAtMPwf6A==, tarball: file:projects/communication-phone-numbers.tgz} name: '@rush-temp/communication-phone-numbers' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/communication-common': 1.1.0 '@azure/core-tracing': 1.0.0-preview.13 '@microsoft/api-extractor': 7.19.4 '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12879,29 +12883,30 @@ packages: dev: false file:projects/communication-short-codes.tgz: - resolution: {integrity: sha512-mgHwx65bgeFi5MCm8V0of6PPpV1JNoJuqMg3A7xwZsBU1lUbl2godPkFuIm4DrckC8lNVGp1PPv9ud0VrmYOfg==, tarball: file:projects/communication-short-codes.tgz} + resolution: {integrity: sha512-XupWjB3VgESRQh1NitFSRM6RtMqOSeQTInfUlcBRkZBQV/YjtCSBstqTWW21RT4yFclbuj90IOqMc1uYdTnwuA==, tarball: file:projects/communication-short-codes.tgz} name: '@rush-temp/communication-short-codes' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/communication-common': 1.1.0 '@azure/core-tracing': 1.0.0-preview.13 '@microsoft/api-extractor': 7.19.4 '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12926,29 +12931,30 @@ packages: dev: false file:projects/communication-sms.tgz: - resolution: {integrity: sha512-iiXgF0X3LGg2S21TeXLAnj1QGWXhWRgU7PfAvpMpM16rZPpG8WrOwKr1yanelUdz4Jj5+RqtVvGKvIdYHfpXaA==, tarball: file:projects/communication-sms.tgz} + resolution: {integrity: sha512-ZsH9N6H587yOEboYqWjx4YjkqSCjs2cDPbcchzjPZuK6aeBFP2iRs2Wqhcrhi5yVW/TNZksCYmvtEnL76MCwSw==, tarball: file:projects/communication-sms.tgz} name: '@rush-temp/communication-sms' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/communication-common': 1.1.0 '@azure/core-tracing': 1.0.0-preview.13 '@microsoft/api-extractor': 7.19.4 '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -12982,16 +12988,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13028,18 +13034,18 @@ packages: '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -13074,19 +13080,19 @@ packages: '@rollup/plugin-multi-entry': 3.0.1_rollup@2.67.1 '@rollup/plugin-node-resolve': 8.4.0_rollup@2.67.1 '@rollup/plugin-replace': 2.4.2_rollup@2.67.1 - '@types/chai': 4.3.0 '@types/debug': 4.1.7 + '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/ws': 7.4.7 buffer: 6.0.3 - chai: 4.3.6 cross-env: 7.0.3 debug: 4.3.3 downlevel-dts: 0.8.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 jssha: 3.2.0 karma: 6.3.15_debug@4.3.3 karma-chrome-launcher: 3.1.0 @@ -13142,10 +13148,10 @@ packages: '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 inherits: 2.0.4 mocha: 7.2.0 mocha-junit-reporter: 2.0.2_mocha@7.2.0 @@ -13169,17 +13175,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13213,16 +13219,16 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13255,16 +13261,16 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13313,9 +13319,9 @@ packages: '@azure/logger-js': 1.3.2 '@microsoft/api-extractor': 7.19.4 '@opentelemetry/api': 1.0.4 - '@types/chai': 4.3.0 '@types/express': 4.17.13 '@types/glob': 7.2.0 + '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/node-fetch': 2.5.12 @@ -13325,7 +13331,6 @@ packages: '@types/uuid': 8.3.4 '@types/xml2js': 0.4.9 babel-runtime: 6.26.0 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 @@ -13333,11 +13338,12 @@ packages: fetch-mock: 9.11.0_node-fetch@2.6.7 form-data: 4.0.0 glob: 7.2.0 + chai: 4.3.6 karma: 6.3.15 - karma-chai: 0.1.0_chai@4.3.6+karma@6.3.15 - karma-chrome-launcher: 3.1.0 karma-edge-launcher: 0.4.2_karma@6.3.15 karma-firefox-launcher: 1.3.0 + karma-chai: 0.1.0_chai@4.3.6+karma@6.3.15 + karma-chrome-launcher: 3.1.0 karma-mocha: 2.0.1 karma-sourcemap-loader: 0.3.8 mocha: 7.2.0 @@ -13381,15 +13387,15 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13423,15 +13429,15 @@ packages: '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13463,20 +13469,20 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/uuid': 8.3.4 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 form-data: 4.0.0 http-proxy-agent: 4.0.1 https-proxy-agent: 5.0.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13509,16 +13515,16 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13549,17 +13555,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13591,18 +13597,18 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/xml2js': 0.4.9 - chai: 4.3.6 cross-env: 7.0.3 downlevel-dts: 0.8.0 eslint: 7.32.0 fast-xml-parser: 4.0.2 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13681,18 +13687,18 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/uuid': 8.3.4 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 downlevel-dts: 0.8.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13727,22 +13733,22 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.67.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 - '@types/chai': 4.3.0 - '@types/chai-as-promised': 7.1.4 '@types/concurrently': 6.4.0 '@types/fs-extra': 9.0.13 + '@types/chai': 4.3.0 + '@types/chai-as-promised': 7.1.4 '@types/minimist': 1.2.2 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/prettier': 2.4.3 builtin-modules: 3.2.0 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 - chalk: 4.1.2 concurrently: 6.5.1 dotenv: 8.6.0 eslint: 7.32.0 fs-extra: 10.0.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 + chalk: 4.1.2 minimist: 1.2.5 mocha: 7.2.0 prettier: 2.5.1 @@ -13774,17 +13780,17 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/uuid': 8.3.4 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -13826,17 +13832,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -13871,10 +13877,10 @@ packages: name: '@rush-temp/eslint-plugin-azure-sdk' version: 0.0.0 dependencies: - '@types/chai': 4.3.0 '@types/eslint': 7.2.14 '@types/estree': 0.0.51 '@types/glob': 7.2.0 + '@types/chai': 4.3.0 '@types/json-schema': 7.0.9 '@types/mocha': 7.0.2 '@types/node': 12.20.43 @@ -13882,7 +13888,6 @@ packages: '@typescript-eslint/experimental-utils': 4.19.0_eslint@7.32.0+typescript@4.2.4 '@typescript-eslint/parser': 4.19.0_eslint@7.32.0+typescript@4.2.4 '@typescript-eslint/typescript-estree': 4.19.0_typescript@4.2.4 - chai: 4.3.6 eslint: 7.32.0 eslint-config-prettier: 7.2.0_eslint@7.32.0 eslint-plugin-import: 2.25.4_eslint@7.32.0 @@ -13890,6 +13895,7 @@ packages: eslint-plugin-promise: 6.0.0_eslint@7.32.0 eslint-plugin-tsdoc: 0.2.14 glob: 7.2.0 + chai: 4.3.6 json-schema: 0.4.0 mocha: 7.2.0 mocha-junit-reporter: 2.0.2_mocha@7.2.0 @@ -13916,10 +13922,10 @@ packages: '@rollup/plugin-node-resolve': 8.4.0_rollup@2.67.1 '@rollup/plugin-replace': 2.4.2_rollup@2.67.1 '@types/async-lock': 1.1.3 + '@types/debug': 4.1.7 '@types/chai': 4.3.0 '@types/chai-as-promised': 7.1.4 '@types/chai-string': 1.4.2 - '@types/debug': 4.1.7 '@types/long': 4.0.1 '@types/mocha': 7.0.2 '@types/node': 12.20.43 @@ -13927,10 +13933,6 @@ packages: '@types/uuid': 8.3.4 '@types/ws': 7.4.7 buffer: 6.0.3 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 - chai-exclude: 2.1.0_chai@4.3.6 - chai-string: 1.5.0_chai@4.3.6 cross-env: 7.0.3 debug: 4.3.3 dotenv: 8.6.0 @@ -13938,14 +13940,18 @@ packages: eslint: 7.32.0 esm: 3.2.25 https-proxy-agent: 5.0.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 + chai-exclude: 2.1.0_chai@4.3.6 + chai-string: 1.5.0_chai@4.3.6 is-buffer: 2.0.5 jssha: 3.2.0 karma: 6.3.15_debug@4.3.3 - 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-chrome-launcher: 3.1.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 @@ -13993,17 +13999,17 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/uuid': 8.3.4 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -14038,15 +14044,12 @@ packages: dependencies: '@azure/storage-blob': 12.8.0 '@microsoft/api-extractor': 7.19.4 + '@types/debug': 4.1.7 '@types/chai': 4.3.0 '@types/chai-as-promised': 7.1.4 '@types/chai-string': 1.4.2 - '@types/debug': 4.1.7 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 - chai-string: 1.5.0_chai@4.3.6 cross-env: 7.0.3 debug: 4.3.3 dotenv: 8.6.0 @@ -14054,13 +14057,16 @@ packages: esm: 3.2.25 events: 3.3.0 guid-typescript: 1.0.9 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 + chai-string: 1.5.0_chai@4.3.6 inherits: 2.0.4 karma: 6.3.15_debug@4.3.3 - 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-chrome-launcher: 3.1.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 @@ -14092,28 +14098,28 @@ packages: '@azure/data-tables': 12.1.2 '@azure/event-hubs': 5.6.0 '@microsoft/api-extractor': 7.19.4 + '@types/debug': 4.1.7 '@types/chai': 4.3.0 '@types/chai-as-promised': 7.1.4 '@types/chai-string': 1.4.2 - '@types/debug': 4.1.7 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 - chai-string: 1.5.0_chai@4.3.6 cross-env: 7.0.3 debug: 4.3.3 dotenv: 8.6.0 eslint: 7.32.0 esm: 3.2.25 guid-typescript: 1.0.9 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 + chai-string: 1.5.0_chai@4.3.6 inherits: 2.0.4 karma: 6.3.15_debug@4.3.3 - 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-chrome-launcher: 3.1.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 @@ -14225,17 +14231,17 @@ packages: '@types/sinon': 9.0.11 '@types/stoppable': 1.1.1 '@types/uuid': 8.3.4 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 inherits: 2.0.4 jws: 4.0.0 karma: 6.3.15 - karma-chrome-launcher: 3.1.0 karma-coverage: 2.1.1 karma-env-preprocessor: 0.1.1 + karma-chrome-launcher: 3.1.0 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 @@ -14295,16 +14301,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -14341,17 +14347,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -14426,11 +14432,11 @@ packages: eslint: 7.32.0 esm: 3.2.25 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-chrome-launcher: 3.1.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 @@ -14489,11 +14495,11 @@ packages: eslint: 7.32.0 esm: 3.2.25 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-chrome-launcher: 3.1.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 @@ -14536,11 +14542,11 @@ packages: eslint: 7.32.0 esm: 3.2.25 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-chrome-launcher: 3.1.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 @@ -14577,17 +14583,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 delay: 4.4.1 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -14624,18 +14630,18 @@ packages: '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -14671,18 +14677,18 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/uuid': 8.3.4 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -14773,20 +14779,20 @@ packages: '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 downlevel-dts: 0.8.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -14824,19 +14830,19 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 10.0.10 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 downlevel-dts: 0.4.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15291,16 +15297,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15336,16 +15342,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15381,16 +15387,16 @@ packages: '@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 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15428,18 +15434,18 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15482,17 +15488,17 @@ packages: '@types/uuid': 8.3.4 avsc: 5.7.3 buffer: 6.0.3 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -15532,17 +15538,17 @@ packages: '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -15576,18 +15582,18 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15621,10 +15627,10 @@ packages: dependencies: '@azure/core-tracing': 1.0.0-preview.13 '@microsoft/api-extractor': 7.19.4 - '@types/chai': 4.3.0 - '@types/chai-as-promised': 7.1.4 '@types/debug': 4.1.7 '@types/glob': 7.2.0 + '@types/chai': 4.3.0 + '@types/chai-as-promised': 7.1.4 '@types/is-buffer': 2.0.0 '@types/long': 4.0.1 '@types/mocha': 7.0.2 @@ -15632,9 +15638,6 @@ packages: '@types/sinon': 9.0.11 '@types/ws': 7.4.7 buffer: 6.0.3 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 - chai-exclude: 2.1.0_chai@4.3.6 cross-env: 7.0.3 debug: 4.3.3 dotenv: 8.6.0 @@ -15644,14 +15647,17 @@ packages: events: 3.3.0 glob: 7.2.0 https-proxy-agent: 5.0.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 + chai-exclude: 2.1.0_chai@4.3.6 is-buffer: 2.0.5 jssha: 3.2.0 karma: 6.3.15_debug@4.3.3 - 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-chrome-launcher: 3.1.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 @@ -15695,7 +15701,6 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 downlevel-dts: 0.8.0 @@ -15703,13 +15708,14 @@ packages: eslint: 7.32.0 esm: 3.2.25 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15751,7 +15757,6 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/node-fetch': 2.5.12 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 downlevel-dts: 0.8.0 @@ -15759,13 +15764,14 @@ packages: eslint: 7.32.0 esm: 3.2.25 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15805,7 +15811,6 @@ packages: '@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 downlevel-dts: 0.8.0 @@ -15814,13 +15819,14 @@ packages: esm: 3.2.25 events: 3.3.0 execa: 6.0.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15860,7 +15866,6 @@ packages: '@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 downlevel-dts: 0.8.0 @@ -15868,13 +15873,14 @@ packages: eslint: 7.32.0 esm: 3.2.25 events: 3.3.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15913,19 +15919,19 @@ packages: '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 - chai: 4.3.6 dotenv: 8.6.0 downlevel-dts: 0.8.0 es6-promise: 4.2.8 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -15965,20 +15971,20 @@ packages: '@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 downlevel-dts: 0.8.0 es6-promise: 4.2.8 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -16020,17 +16026,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -16074,17 +16080,17 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/uuid': 8.3.4 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -16126,17 +16132,17 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -16176,17 +16182,17 @@ packages: '@types/chai': 4.3.0 '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -16242,17 +16248,17 @@ packages: '@types/chai': 4.3.0 '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -16287,19 +16293,19 @@ packages: '@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 downlevel-dts: 0.8.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -16343,24 +16349,24 @@ packages: name: '@rush-temp/test-recorder' version: 0.0.0 dependencies: - '@types/chai': 4.3.0 '@types/express': 4.17.13 '@types/fs-extra': 8.1.2 + '@types/chai': 4.3.0 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/uuid': 8.3.4 - chai: 4.3.6 concurrently: 6.5.1 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 express: 4.17.2 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -16392,9 +16398,9 @@ packages: '@types/node-fetch': 2.5.12 eslint: 7.32.0 karma: 6.3.15 - karma-chrome-launcher: 3.1.0 karma-coverage: 2.1.1 karma-env-preprocessor: 0.1.1 + karma-chrome-launcher: 3.1.0 minimist: 1.2.5 node-fetch: 2.6.7 prettier: 2.5.1 @@ -16430,9 +16436,9 @@ packages: cross-env: 7.0.3 eslint: 7.32.0 karma: 6.3.15 - karma-chrome-launcher: 3.1.0 karma-coverage: 2.1.1 karma-env-preprocessor: 0.1.1 + karma-chrome-launcher: 3.1.0 mocha: 7.2.0 prettier: 2.5.1 rimraf: 3.0.2 @@ -16455,21 +16461,21 @@ packages: '@azure/storage-queue': 12.7.0 '@types/chai': 4.3.0 '@types/md5': 2.3.1 - '@types/mocha': 7.0.2 '@types/mock-fs': 4.13.1 '@types/mock-require': 2.0.1 + '@types/mocha': 7.0.2 '@types/nise': 1.4.0 '@types/node': 12.20.43 '@types/uuid': 8.3.4 - chai: 4.3.6 dotenv: 8.6.0 eslint: 7.32.0 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -16477,10 +16483,10 @@ packages: 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 mock-fs: 5.1.2 mock-require: 3.0.3 + mocha: 7.2.0 + mocha-junit-reporter: 2.0.2_mocha@7.2.0 npm-run-all: 4.1.5 nyc: 15.1.0 prettier: 2.5.1 @@ -16508,19 +16514,19 @@ packages: '@types/mocha': 7.0.2 '@types/node': 12.20.43 azure-iothub: 1.14.6 - chai: 4.3.6 - chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 events: 3.3.0 + chai: 4.3.6 + chai-as-promised: 7.1.1_chai@4.3.6 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-chrome-launcher: 3.1.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 @@ -16549,24 +16555,24 @@ packages: dependencies: '@azure-tools/test-recorder': 1.0.2 '@microsoft/api-extractor': 7.19.4 - '@types/chai': 4.3.0 '@types/express': 4.17.13 '@types/express-serve-static-core': 4.17.28 + '@types/chai': 4.3.0 '@types/jsonwebtoken': 8.5.8 '@types/mocha': 7.0.2 '@types/node': 12.20.43 '@types/sinon': 9.0.11 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 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-chrome-launcher: 3.1.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 @@ -16606,18 +16612,18 @@ packages: '@types/node': 12.20.43 '@types/sinon': 9.0.11 '@types/ws': 8.2.2 - chai: 4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 eslint: 7.32.0 esm: 3.2.25 + chai: 4.3.6 jsonwebtoken: 8.5.1 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-chrome-launcher: 3.1.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 diff --git a/sdk/communication/communication-common/CHANGELOG.md b/sdk/communication/communication-common/CHANGELOG.md index 379009cee429..72f70504ae93 100644 --- a/sdk/communication/communication-common/CHANGELOG.md +++ b/sdk/communication/communication-common/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0 (Unreleased) +## 2.0.0 (Unreleased) ### Features Added @@ -8,6 +8,9 @@ ### Breaking Changes +- Migrated from using `@azure/core-http` to `@azure/core-rest-pipeline` for the handling of HTTP requests. See [Azure Core v1 vs v2](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/documentation/core2.md) for more on the difference and benefits of the move. + - `createCommunicationAccessKeyCredentialPolicy` and `createCommunicationAuthPolicy` newly return `PipelinePolicy` instead of `RequestPolicyFactory`. + ### Bugs Fixed ### Other Changes diff --git a/sdk/communication/communication-common/package.json b/sdk/communication/communication-common/package.json index 0d601a1428c2..b90d0056a6a9 100644 --- a/sdk/communication/communication-common/package.json +++ b/sdk/communication/communication-common/package.json @@ -1,13 +1,14 @@ { "name": "@azure/communication-common", - "version": "1.2.0", + "version": "2.0.0", "description": "Common package for Azure Communication services.", "sdk-type": "client", "main": "dist/index.js", "module": "dist-esm/src/index.js", "types": "types/communication-common.d.ts", "browser": { - "./dist-esm/src/credential/cryptoUtils.js": "./dist-esm/src/credential/cryptoUtils.browser.js" + "./dist-esm/src/credential/cryptoUtils.js": "./dist-esm/src/credential/cryptoUtils.browser.js", + "./dist-esm/src/credential/isNode.js": "./dist-esm/src/credential/isNode.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", @@ -63,7 +64,7 @@ "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-http": "^2.0.0", + "@azure/core-rest-pipeline": "^1.3.2", "@azure/core-tracing": "1.0.0-preview.13", "events": "^3.0.0", "jwt-decode": "^3.1.2", diff --git a/sdk/communication/communication-common/review/communication-common.api.md b/sdk/communication/communication-common/review/communication-common.api.md index ae3575ec1935..eb06a0a8b23e 100644 --- a/sdk/communication/communication-common/review/communication-common.api.md +++ b/sdk/communication/communication-common/review/communication-common.api.md @@ -4,10 +4,10 @@ ```ts -import { AbortSignalLike } from '@azure/core-http'; -import { AccessToken } from '@azure/core-http'; +import { AbortSignalLike } from '@azure/abort-controller'; +import { AccessToken } from '@azure/core-auth'; import { KeyCredential } from '@azure/core-auth'; -import { RequestPolicyFactory } from '@azure/core-http'; +import { PipelinePolicy } from '@azure/core-rest-pipeline'; import { TokenCredential } from '@azure/core-auth'; // @public @@ -16,7 +16,7 @@ export class AzureCommunicationTokenCredential implements CommunicationTokenCred constructor(refreshOptions: CommunicationTokenRefreshOptions); dispose(): void; getToken(options?: CommunicationGetTokenOptions): Promise; - } +} // @public export interface CommunicationGetTokenOptions { @@ -53,10 +53,10 @@ export interface CommunicationUserKind extends CommunicationUserIdentifier { } // @public -export const createCommunicationAccessKeyCredentialPolicy: (credential: KeyCredential) => RequestPolicyFactory; +export function createCommunicationAccessKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy; // @public -export const createCommunicationAuthPolicy: (credential: KeyCredential | TokenCredential) => RequestPolicyFactory; +export function createCommunicationAuthPolicy(credential: KeyCredential | TokenCredential): PipelinePolicy; // @public export const deserializeCommunicationIdentifier: (serializedIdentifier: SerializedCommunicationIdentifier) => CommunicationIdentifierKind; @@ -162,7 +162,6 @@ export type UrlWithCredential = { credential: TokenCredential | KeyCredential; }; - // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts b/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts index c6896faf08a2..3c9a6e024015 100644 --- a/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts +++ b/sdk/communication/communication-common/src/autoRefreshTokenCredential.ts @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike, AccessToken } from "@azure/core-http"; +import { CommunicationGetTokenOptions, TokenCredential } from "./communicationTokenCredential"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { AccessToken } from "@azure/core-auth"; import { parseToken } from "./tokenParser"; -import { TokenCredential, CommunicationGetTokenOptions } from "./communicationTokenCredential"; /** * Options for auto-refreshing a Communication Token credential. diff --git a/sdk/communication/communication-common/src/azureCommunicationTokenCredential.ts b/sdk/communication/communication-common/src/azureCommunicationTokenCredential.ts new file mode 100644 index 000000000000..68cdf2211dd6 --- /dev/null +++ b/sdk/communication/communication-common/src/azureCommunicationTokenCredential.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + AutoRefreshTokenCredential, + CommunicationTokenRefreshOptions, +} from "./autoRefreshTokenCredential"; +import { + CommunicationGetTokenOptions, + CommunicationTokenCredential, + TokenCredential, +} from "./communicationTokenCredential"; +import { AccessToken } from "@azure/core-auth"; +import { StaticTokenCredential } from "./staticTokenCredential"; +import { parseToken } from "./tokenParser"; + +/** + * The CommunicationTokenCredential implementation with support for proactive token refresh. + */ + +export class AzureCommunicationTokenCredential implements CommunicationTokenCredential { + private readonly tokenCredential: TokenCredential; + private disposed = false; + + /** + * Creates an instance of CommunicationTokenCredential with a static token and no proactive refreshing. + * @param token - A user access token issued by Communication Services. + */ + constructor(token: string); + /** + * Creates an instance of CommunicationTokenCredential with a lambda to get a token and options + * to configure proactive refreshing. + * @param refreshOptions - Options to configure refresh and opt-in to proactive refreshing. + */ + constructor(refreshOptions: CommunicationTokenRefreshOptions); + constructor(tokenOrRefreshOptions: string | CommunicationTokenRefreshOptions) { + if (typeof tokenOrRefreshOptions === "string") { + this.tokenCredential = new StaticTokenCredential(parseToken(tokenOrRefreshOptions)); + } else { + this.tokenCredential = new AutoRefreshTokenCredential(tokenOrRefreshOptions); + } + } + + /** + * Gets an `AccessToken` for the user. Throws if already disposed. + * @param abortSignal - An implementation of `AbortSignalLike` to cancel the operation. + */ + public async getToken(options?: CommunicationGetTokenOptions): Promise { + this.throwIfDisposed(); + const token = await this.tokenCredential.getToken(options); + this.throwIfDisposed(); + return token; + } + + /** + * Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation. + */ + public dispose(): void { + this.disposed = true; + this.tokenCredential.dispose(); + } + + private throwIfDisposed(): void { + if (this.disposed) { + throw new Error("User credential is disposed"); + } + } +} diff --git a/sdk/communication/communication-common/src/communicationTokenCredential.ts b/sdk/communication/communication-common/src/communicationTokenCredential.ts index fb17b403e103..d58c6956fbc0 100644 --- a/sdk/communication/communication-common/src/communicationTokenCredential.ts +++ b/sdk/communication/communication-common/src/communicationTokenCredential.ts @@ -1,15 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AbortSignalLike, AccessToken } from "@azure/core-http"; -import { parseToken } from "./tokenParser"; -import { StaticTokenCredential } from "./staticTokenCredential"; -import { - AutoRefreshTokenCredential, - CommunicationTokenRefreshOptions, -} from "./autoRefreshTokenCredential"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { AccessToken } from "@azure/core-auth"; -export type TokenCredential = Pick; +export type TokenCredential = Pick; /** * Options for `CommunicationTokenCredential`'s `getToken` function. @@ -35,55 +30,3 @@ export interface CommunicationTokenCredential { */ dispose(): void; } - -/** - * The CommunicationTokenCredential implementation with support for proactive token refresh. - */ -export class AzureCommunicationTokenCredential implements CommunicationTokenCredential { - private readonly tokenCredential: TokenCredential; - private disposed = false; - - /** - * Creates an instance of CommunicationTokenCredential with a static token and no proactive refreshing. - * @param token - A user access token issued by Communication Services. - */ - constructor(token: string); - /** - * Creates an instance of CommunicationTokenCredential with a lambda to get a token and options - * to configure proactive refreshing. - * @param refreshOptions - Options to configure refresh and opt-in to proactive refreshing. - */ - constructor(refreshOptions: CommunicationTokenRefreshOptions); - constructor(tokenOrRefreshOptions: string | CommunicationTokenRefreshOptions) { - if (typeof tokenOrRefreshOptions === "string") { - this.tokenCredential = new StaticTokenCredential(parseToken(tokenOrRefreshOptions)); - } else { - this.tokenCredential = new AutoRefreshTokenCredential(tokenOrRefreshOptions); - } - } - - /** - * Gets an `AccessToken` for the user. Throws if already disposed. - * @param abortSignal - An implementation of `AbortSignalLike` to cancel the operation. - */ - public async getToken(options?: CommunicationGetTokenOptions): Promise { - this.throwIfDisposed(); - const token = await this.tokenCredential.getToken(options); - this.throwIfDisposed(); - return token; - } - - /** - * Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation. - */ - public dispose(): void { - this.disposed = true; - this.tokenCredential.dispose(); - } - - private throwIfDisposed(): void { - if (this.disposed) { - throw new Error("User credential is disposed"); - } - } -} diff --git a/sdk/communication/communication-common/src/credential/clientArguments.ts b/sdk/communication/communication-common/src/credential/clientArguments.ts index b140521cd4d9..9db9142d87eb 100644 --- a/sdk/communication/communication-common/src/credential/clientArguments.ts +++ b/sdk/communication/communication-common/src/credential/clientArguments.ts @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { isTokenCredential, KeyCredential, TokenCredential } from "@azure/core-auth"; -import { URLBuilder } from "@azure/core-http"; +import { KeyCredential, TokenCredential, isTokenCredential } from "@azure/core-auth"; import { parseConnectionString } from "./connectionString"; const isValidEndpoint = (host: string): boolean => { - const url = URLBuilder.parse(host); + const url = new URL(host); return ( - !!url.getScheme()?.match(/^http[s]?/) && - url.getHost() !== undefined && - url.getHost() !== "" && - (url.getPath() === undefined || url.getPath() === "" || url.getPath() === "/") + !!url.protocol?.match(/^http[s]?/) && + url.host !== undefined && + url.host !== "" && + (url.pathname === undefined || url.pathname === "" || url.pathname === "/") ); }; diff --git a/sdk/communication/communication-common/src/credential/communicationAccessKeyCredentialPolicy.ts b/sdk/communication/communication-common/src/credential/communicationAccessKeyCredentialPolicy.ts index 73eebc0ab085..9af67e82cd82 100644 --- a/sdk/communication/communication-common/src/credential/communicationAccessKeyCredentialPolicy.ts +++ b/sdk/communication/communication-common/src/credential/communicationAccessKeyCredentialPolicy.ts @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { KeyCredential } from "@azure/core-auth"; import { - URLBuilder, - WebResource, - isNode, - RequestPolicy, - RequestPolicyOptionsLike, - RequestPolicyFactory, - WebResourceLike, - HttpOperationResponse, - BaseRequestPolicy, -} from "@azure/core-http"; -import { shaHash, shaHMAC } from "./cryptoUtils"; + PipelinePolicy, + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import { shaHMAC, shaHash } from "./cryptoUtils"; +import { KeyCredential } from "@azure/core-auth"; +import { isNode } from "./isNode"; + +/** + * CommunicationKeyCredentialPolicy provides a means of signing requests made through + * the SmsClient. + */ +const communicationAccessKeyCredentialPolicy = "CommunicationAccessKeyCredentialPolicy"; /** * Creates an HTTP pipeline policy to authenticate a request using a `KeyCredential`. @@ -21,77 +23,38 @@ import { shaHash, shaHMAC } from "./cryptoUtils"; * * @param credential - The key credential. */ -export const createCommunicationAccessKeyCredentialPolicy = ( +export function createCommunicationAccessKeyCredentialPolicy( credential: KeyCredential -): RequestPolicyFactory => { +): PipelinePolicy { return { - create: (nextpolicy: RequestPolicy, options: RequestPolicyOptionsLike) => { - return new CommunicationAccessKeyCredentialPolicy(credential, nextpolicy, options); + name: communicationAccessKeyCredentialPolicy, + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + const verb = request.method.toUpperCase(); + const utcNow = new Date().toUTCString(); + const contentHash = await shaHash(request.body?.toString() || ""); + const dateHeader = "x-ms-date"; + const signedHeaders = `${dateHeader};host;x-ms-content-sha256`; + + const url = new URL(request.url); + const query = url.searchParams; + const urlPathAndQuery = query ? `${url.pathname}?${query}` : url.pathname; + const port = url.port; + const hostAndPort = port ? `${url.host}:${port}` : url.host; + + const stringToSign = `${verb}\n${urlPathAndQuery}\n${utcNow};${hostAndPort};${contentHash}`; + const signature = await shaHMAC(credential.key, stringToSign); + + if (isNode) { + request.headers.set("Host", hostAndPort || ""); + } + + request.headers.set(dateHeader, utcNow); + request.headers.set("x-ms-content-sha256", contentHash); + request.headers.set( + "Authorization", + `HMAC-SHA256 SignedHeaders=${signedHeaders}&Signature=${signature}` + ); + return next(request); }, }; -}; - -/** - * CommunicationAccessKeyCredentialPolicy provides a means of signing requests made through - * the SmsClient. - */ -class CommunicationAccessKeyCredentialPolicy extends BaseRequestPolicy { - /** - * Initializes a new instance of the CommunicationAccessKeyCredential class - * using a base64 encoded key. - * @param accessKey - The base64 encoded key to be used for signing. - */ - constructor( - private readonly accessKey: KeyCredential, - nextPolicy: RequestPolicy, - options: RequestPolicyOptionsLike - ) { - super(nextPolicy, options); - } - - /** - * Signs a request with the provided access key. - * - * @param webResource - The WebResource to be signed. - */ - private async signRequest(webResource: WebResource): Promise { - const verb = webResource.method.toUpperCase(); - const utcNow = new Date().toUTCString(); - const contentHash = await shaHash(webResource.body || ""); - const dateHeader = "x-ms-date"; - const signedHeaders = `${dateHeader};host;x-ms-content-sha256`; - - const url = URLBuilder.parse(webResource.url); - const query = url.getQuery(); - const urlPathAndQuery = query ? `${url.getPath()}?${query}` : url.getPath(); - const port = url.getPort(); - const hostAndPort = port ? `${url.getHost()}:${port}` : url.getHost(); - - const stringToSign = `${verb}\n${urlPathAndQuery}\n${utcNow};${hostAndPort};${contentHash}`; - const signature = await shaHMAC(this.accessKey.key, stringToSign); - - if (isNode) { - webResource.headers.set("Host", hostAndPort || ""); - } - - webResource.headers.set(dateHeader, utcNow); - webResource.headers.set("x-ms-content-sha256", contentHash); - webResource.headers.set( - "Authorization", - `HMAC-SHA256 SignedHeaders=${signedHeaders}&Signature=${signature}` - ); - - return webResource; - } - - /** - * Signs the request and calls the next policy in the factory. - */ - public async sendRequest(webResource: WebResourceLike): Promise { - if (!webResource) { - throw new Error("webResource cannot be null or undefined"); - } - - return this._nextPolicy.sendRequest(await this.signRequest(webResource)); - } } diff --git a/sdk/communication/communication-common/src/credential/communicationAuthPolicy.ts b/sdk/communication/communication-common/src/credential/communicationAuthPolicy.ts index f3caec567916..001b7c51afdb 100644 --- a/sdk/communication/communication-common/src/credential/communicationAuthPolicy.ts +++ b/sdk/communication/communication-common/src/credential/communicationAuthPolicy.ts @@ -1,8 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { isTokenCredential, KeyCredential, TokenCredential } from "@azure/core-auth"; -import { bearerTokenAuthenticationPolicy, RequestPolicyFactory } from "@azure/core-http"; +import { + BearerTokenAuthenticationPolicyOptions, + PipelinePolicy, + bearerTokenAuthenticationPolicy, +} from "@azure/core-rest-pipeline"; +import { KeyCredential, TokenCredential, isTokenCredential } from "@azure/core-auth"; import { createCommunicationAccessKeyCredentialPolicy } from "./communicationAccessKeyCredentialPolicy"; /** * Creates a pipeline policy to authenticate request based @@ -11,12 +15,16 @@ import { createCommunicationAccessKeyCredentialPolicy } from "./communicationAcc * * @param credential - The KeyCredential or TokenCredential. */ -export const createCommunicationAuthPolicy = ( +export function createCommunicationAuthPolicy( credential: KeyCredential | TokenCredential -): RequestPolicyFactory => { +): PipelinePolicy { if (isTokenCredential(credential)) { - return bearerTokenAuthenticationPolicy(credential, "https://communication.azure.com//.default"); + const policyOptions: BearerTokenAuthenticationPolicyOptions = { + credential: credential, + scopes: ["https://communication.azure.com//.default"], + }; + return bearerTokenAuthenticationPolicy(policyOptions); } else { return createCommunicationAccessKeyCredentialPolicy(credential); } -}; +} diff --git a/sdk/communication/communication-common/src/credential/cryptoUtils.browser.ts b/sdk/communication/communication-common/src/credential/cryptoUtils.browser.ts index c0a2f5b74986..06ab819b6ff9 100644 --- a/sdk/communication/communication-common/src/credential/cryptoUtils.browser.ts +++ b/sdk/communication/communication-common/src/credential/cryptoUtils.browser.ts @@ -1,25 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { encodeUTF8, encodeBase64, encodeUTF8fromBase64 } from "./encodeUtils.browser"; +/// -const globalRef: any = globalThis; +import { encodeBase64, encodeUTF8, encodeUTF8fromBase64 } from "./encodeUtils.browser"; -const getCrypto = (): SubtleCrypto => { - if (!globalRef) { - throw new Error("Could not find global"); - } - - if (!globalRef.crypto || !globalRef.crypto.subtle) { - throw new Error("Browser does not support cryptography functions"); - } - - return globalRef.crypto.subtle; -}; +const subtle = (globalThis as any)?.crypto?.subtle as SubtleCrypto; export const shaHash = async (content: string): Promise => { const data = encodeUTF8(content); - const hash = await getCrypto().digest("SHA-256", data); + const hash = await subtle.digest("SHA-256", data); return encodeBase64(hash); }; @@ -27,7 +17,7 @@ export const shaHMAC = async (secret: string, content: string): Promise const importParams: HmacImportParams = { name: "HMAC", hash: { name: "SHA-256" } }; const encodedMessage = encodeUTF8(content); const encodedKey = encodeUTF8fromBase64(secret); - const crypto = getCrypto(); + const crypto = subtle; const cryptoKey = await crypto.importKey("raw", encodedKey, importParams, false, ["sign"]); const signature = await crypto.sign(importParams, cryptoKey, encodedMessage); return encodeBase64(signature); diff --git a/sdk/communication/communication-common/src/credential/isNode.browser.ts b/sdk/communication/communication-common/src/credential/isNode.browser.ts new file mode 100644 index 000000000000..603c1ba24548 --- /dev/null +++ b/sdk/communication/communication-common/src/credential/isNode.browser.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +export const isNode = false; diff --git a/sdk/communication/communication-common/src/credential/isNode.ts b/sdk/communication/communication-common/src/credential/isNode.ts new file mode 100644 index 000000000000..8e6aed4ba67f --- /dev/null +++ b/sdk/communication/communication-common/src/credential/isNode.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +export const isNode = + typeof process !== "undefined" && Boolean(process.version) && Boolean(process.versions?.node); diff --git a/sdk/communication/communication-common/src/index.ts b/sdk/communication/communication-common/src/index.ts index 645fa65f0c92..376f548476af 100644 --- a/sdk/communication/communication-common/src/index.ts +++ b/sdk/communication/communication-common/src/index.ts @@ -2,10 +2,10 @@ // Licensed under the MIT license. export { - AzureCommunicationTokenCredential, CommunicationTokenCredential, CommunicationGetTokenOptions, } from "./communicationTokenCredential"; +export { AzureCommunicationTokenCredential } from "./azureCommunicationTokenCredential"; export * from "./credential"; export { CommunicationTokenRefreshOptions } from "./autoRefreshTokenCredential"; export * from "./credential"; diff --git a/sdk/communication/communication-common/src/shims.d.ts b/sdk/communication/communication-common/src/shims.d.ts deleted file mode 100644 index be96c9b19b40..000000000000 --- a/sdk/communication/communication-common/src/shims.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -// d.ts shims provide types for things we use internally but are not part -// of this package's surface area. - -declare function atob(data: string): string; -declare function btoa(data: string): string; - -interface SubtleCrypto { - importKey: ( - format: string, - keyData: ArrayBuffer, - algo: HmacImportParams, - extractable: boolean, - usages: string[] - ) => Promise; - - sign: ( - algo: HmacImportParams, - key: CryptoKey, - encodedMessage: ArrayBuffer - ) => Promise; - - digest: (algo: string, data: ArrayBuffer) => Promise; -} - -interface HmacImportParams {} - -interface CryptoKey {} - -declare class TextEncoder { - encode(str: string): Uint8Array; -} diff --git a/sdk/communication/communication-common/src/staticTokenCredential.ts b/sdk/communication/communication-common/src/staticTokenCredential.ts index 7d8b1ee2f9d2..159dd87de5d4 100644 --- a/sdk/communication/communication-common/src/staticTokenCredential.ts +++ b/sdk/communication/communication-common/src/staticTokenCredential.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AccessToken } from "@azure/core-http"; +import { AccessToken } from "@azure/core-auth"; import { TokenCredential } from "./communicationTokenCredential"; /** diff --git a/sdk/communication/communication-common/src/tokenParser.ts b/sdk/communication/communication-common/src/tokenParser.ts index 3cb49094aad9..81d748591f34 100644 --- a/sdk/communication/communication-common/src/tokenParser.ts +++ b/sdk/communication/communication-common/src/tokenParser.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { AccessToken } from "@azure/core-auth"; import jwtDecode from "jwt-decode"; -import { AccessToken } from "@azure/core-http"; interface JwtToken { exp: number; diff --git a/sdk/communication/communication-common/test/clientArguments.spec.ts b/sdk/communication/communication-common/test/clientArguments.spec.ts index d5f4ed1ccde3..3355cbd99663 100644 --- a/sdk/communication/communication-common/test/clientArguments.spec.ts +++ b/sdk/communication/communication-common/test/clientArguments.spec.ts @@ -3,8 +3,8 @@ import { AzureKeyCredential } from "@azure/core-auth"; import { assert } from "chai"; -import { parseConnectionString } from "../src/credential/connectionString"; import { parseClientArguments } from "../src/credential/clientArguments"; +import { parseConnectionString } from "../src/credential/connectionString"; const mockCredential = new AzureKeyCredential("secret"); const host = "https://contoso.communicationservices.azure.com"; diff --git a/sdk/communication/communication-common/test/communicationKeyCredentialPolicy.spec.ts b/sdk/communication/communication-common/test/communicationKeyCredentialPolicy.spec.ts new file mode 100644 index 000000000000..63adc38bb170 --- /dev/null +++ b/sdk/communication/communication-common/test/communicationKeyCredentialPolicy.spec.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + HttpClient, + PipelineResponse, + createEmptyPipeline, + createHttpHeaders, + createPipelineRequest, +} from "@azure/core-rest-pipeline"; +import { KeyCredential } from "@azure/core-auth"; +import { assert } from "chai"; +import { createCommunicationAccessKeyCredentialPolicy } from "../src/credential/communicationAccessKeyCredentialPolicy"; +import { isNode } from "../src/credential/isNode"; + +describe("CommunicationKeyCredentialPolicy", () => { + it("signs the request", async () => { + const credential = new MockKeyCredential("pw=="); + const communicationKeyCredentialPolicy = + createCommunicationAccessKeyCredentialPolicy(credential); + + const pipelineRequest = createPipelineRequest({ url: "https://example.com" }); + + const responses: PipelineResponse[] = [ + { + headers: createHttpHeaders(), + request: pipelineRequest, + status: 200, + }, + ]; + + const testHttpsClient: HttpClient = { + sendRequest: async (req) => { + if (responses.length) { + const response = responses.shift()!; + response.request = req; + return response; + } + throw new Error("No responses found"); + }, + }; + + const pipeline = createEmptyPipeline(); + pipeline.addPolicy(communicationKeyCredentialPolicy); + const pipelineResponse = await pipeline.sendRequest(testHttpsClient, pipelineRequest); + + const authHeader = pipelineResponse.request.headers.get("Authorization"); + const dateHeader = pipelineResponse.request.headers.get("x-ms-date"); + const hashHeader = pipelineResponse.request.headers.get("x-ms-content-sha256"); + const hostHeader = pipelineResponse.request.headers.get("Host"); + + assert.isNotEmpty(authHeader); + assert.isNotEmpty(dateHeader); + assert.isNotEmpty(hashHeader); + if (isNode) { + assert.isNotEmpty(hostHeader); + } + }); +}); + +class MockKeyCredential implements KeyCredential { + key: string; + constructor(key: string) { + this.key = key; + } +} diff --git a/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts b/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts index a1a802b2f4a2..ab358409427c 100644 --- a/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts +++ b/sdk/communication/communication-common/test/communicationTokenCredential.spec.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import sinon from "sinon"; -import chaiAsPromised from "chai-as-promised"; import { assert, use } from "chai"; -import { isNode } from "@azure/core-http"; import { AbortSignal } from "@azure/abort-controller"; -import { AzureCommunicationTokenCredential } from "../src/communicationTokenCredential"; +import { AzureCommunicationTokenCredential } from "../src/azureCommunicationTokenCredential"; +import chaiAsPromised from "chai-as-promised"; +import { isNode } from "../src/credential/isNode"; +import sinon from "sinon"; use(chaiAsPromised); diff --git a/sdk/communication/communication-common/test/cryptoUtils.spec.ts b/sdk/communication/communication-common/test/cryptoUtils.spec.ts index a9b461fd3816..1d3e46317fd8 100644 --- a/sdk/communication/communication-common/test/cryptoUtils.spec.ts +++ b/sdk/communication/communication-common/test/cryptoUtils.spec.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { shaHMAC, shaHash } from "../src/credential/cryptoUtils"; import { assert } from "chai"; -import { shaHash, shaHMAC } from "../src/credential/cryptoUtils"; describe("CryptoUtils", () => { it("calculates correct hash", async () => { diff --git a/sdk/communication/communication-common/test/identifierModelSerializer.spec.ts b/sdk/communication/communication-common/test/identifierModelSerializer.spec.ts index 5485fa6becb5..8fd2198cdfc3 100644 --- a/sdk/communication/communication-common/test/identifierModelSerializer.spec.ts +++ b/sdk/communication/communication-common/test/identifierModelSerializer.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { assert } from "chai"; import { - serializeCommunicationIdentifier, - deserializeCommunicationIdentifier, CommunicationIdentifier, - SerializedCommunicationIdentifier, CommunicationIdentifierKind, + SerializedCommunicationIdentifier, + deserializeCommunicationIdentifier, + serializeCommunicationIdentifier, } from "../src"; +import { assert } from "chai"; const assertSerialize = ( identifier: CommunicationIdentifier, diff --git a/sdk/communication/communication-common/test/identifierModels.spec.ts b/sdk/communication/communication-common/test/identifierModels.spec.ts index e29377bba3f9..5709f146e9a2 100644 --- a/sdk/communication/communication-common/test/identifierModels.spec.ts +++ b/sdk/communication/communication-common/test/identifierModels.spec.ts @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { assert } from "chai"; import { + PhoneNumberIdentifier, + getIdentifierKind, isCommunicationUserIdentifier, + isMicrosoftTeamsUserIdentifier, isPhoneNumberIdentifier, - getIdentifierKind, - PhoneNumberIdentifier, isUnknownIdentifier, - isMicrosoftTeamsUserIdentifier, } from "../src"; +import { assert } from "chai"; describe("Identifier models", () => { it("type guards", () => {