From a22db68cc53ac58263442dba9baf5e746df173e4 Mon Sep 17 00:00:00 2001 From: Will Temple Date: Mon, 22 Mar 2021 19:05:13 -0700 Subject: [PATCH] [dev-tool] `samples publish` command and changes to samples workflow (#13960) * [dev-tool] Experimental samples publish command * Updated template samples structure * First generation of template samples * Update to ts-node 9 and use transpilation mode for speed. * Many improvements and fixes. - Fixed several bugs with generation. - Added environment variable analysis. - Refactored modules for code organization. - Added azsdk- JSDoc tags for weighting and ignoring samples. - Made almost all illogical situations yield errors instead of warnings. * Rework text analytics * Fixed a bug in the README template saying something about the Template package * Regenerate text analytics samples * Consistency changes to dev-tool/register * Updated TA and Template package.json * Fixed a couple of file name rendering bugs in the template * Added API ref link override and regenerated Template samples * Format * Fix broken link * Made typescript version reflect dev-tool ts dependency * Revert weird change to cosmosdb package.json * Alpha sort template deps * Added MIN_SUPPORTED_NODE_VERSION * Tweaked default tsconfig. * Use version 1.0.0 instead of 0.1.0 * Pull sample generation info types into their own module. * Added resource creation link generation. * Regenerate template samples * Regenerate text analytics samples * Regenerate text analytics samples * Regenerate template samples * Fix bug in TA samples --- .github/CODEOWNERS | 7 + common/config/rush/pnpm-lock.yaml | 931 +++++++++--------- common/tools/dev-tool/launch.js | 7 +- common/tools/dev-tool/package.json | 7 +- common/tools/dev-tool/register.d.ts | 6 + common/tools/dev-tool/register.js | 96 ++ .../dev-tool/src/commands/samples/index.ts | 1 + .../dev-tool/src/commands/samples/publish.ts | 484 +++++++++ .../dev-tool/src/commands/samples/run.ts | 23 +- .../dev-tool/src/commands/samples/tsToJs.ts | 74 +- .../tools/dev-tool/src/framework/command.ts | 8 +- .../dev-tool/src/templates/sampleReadme.md.ts | 239 +++++ common/tools/dev-tool/src/util/fileTree.ts | 108 ++ .../dev-tool/src/util/findMatchingFiles.ts | 2 +- .../tools/dev-tool/src/util/resolveProject.ts | 45 +- .../dev-tool/src/util/sampleConfiguration.ts | 111 +++ .../dev-tool/src/util/sampleGenerationInfo.ts | 207 ++++ common/tools/dev-tool/src/util/shouldSkip.ts | 51 - .../tools/dev-tool/test/samples/skips.spec.ts | 2 +- .../app-configuration/package.json | 2 +- sdk/attestation/attestation/package.json | 2 +- sdk/core/abort-controller/package.json | 2 +- sdk/core/core-amqp/package.json | 2 +- sdk/core/core-http/package.json | 2 +- sdk/core/core-lro/package.json | 2 +- sdk/core/logger/package.json | 2 +- sdk/cosmosdb/cosmos/package.json | 2 +- sdk/eventgrid/eventgrid/package.json | 2 +- .../perf-tests/eventgrid/package.json | 2 +- sdk/eventhub/event-hubs/package.json | 2 +- .../event-processor-host/package.json | 2 +- .../package.json | 2 +- .../ai-metrics-advisor/package.json | 2 +- .../package.json | 2 +- sdk/search/search-documents/package.json | 2 +- sdk/servicebus/service-bus/package.json | 2 +- .../perf-tests/storage-blob/package.json | 2 +- .../storage-file-datalake/package.json | 2 +- .../storage-file-share/package.json | 2 +- .../storage-blob-changefeed/package.json | 6 +- sdk/storage/storage-blob/package.json | 6 +- .../storage-file-datalake/package.json | 2 +- sdk/storage/storage-file-share/package.json | 6 +- .../storage-internal-avro/package.json | 2 +- sdk/storage/storage-queue/package.json | 6 +- sdk/tables/data-tables/package.json | 2 +- sdk/template/template/package.json | 17 +- sdk/template/template/sample.env | 25 +- .../getConfigurationSetting.ts | 2 +- .../template/samples/javascript/sample.env | 10 - sdk/template/template/samples/tsconfig.json | 10 - .../template/samples/typescript/sample.env | 10 - .../samples/{ => v1}/javascript/README.md | 46 +- .../javascript/getConfigurationSetting.js | 6 +- .../samples/{ => v1}/javascript/package.json | 19 +- .../template/samples/v1/javascript/sample.env | 7 + .../samples/{ => v1}/typescript/README.md | 50 +- .../samples/{ => v1}/typescript/package.json | 24 +- .../template/samples/v1/typescript/sample.env | 7 + .../typescript/src/getConfigurationSetting.ts | 25 + .../samples/v1}/typescript/tsconfig.json | 10 +- sdk/template/template/test.env | 26 + sdk/template/template/tsconfig.json | 16 +- sdk/textanalytics/ai-text-analytics/README.md | 2 +- .../ai-text-analytics/package.json | 23 +- .../ai-text-analytics/sample.env | 11 +- .../samples-dev/alternativeDocumentInput.ts | 95 ++ .../samples-dev/analyzeSentiment.ts | 57 ++ .../analyzeSentimentWithOpinionMining.ts | 92 ++ .../samples-dev/authenticationMethods.ts | 71 ++ .../samples-dev/beginAnalyzeBatchActions.ts | 120 +++ .../beginAnalyzeHealthcareEntities.ts | 86 ++ .../samples-dev/detectLanguage.ts | 54 + .../samples-dev/extractKeyPhrases.ts | 50 + .../samples-dev/recognizeEntities.ts | 49 + .../samples-dev/recognizeLinkedEntities.ts | 59 ++ .../samples-dev/recognizePii.ts | 82 ++ .../samples/javascript/README.md | 80 -- .../samples/javascript/package.json | 32 - .../ai-text-analytics/samples/tsconfig.json | 10 - .../samples/v5/javascript/README.md | 84 ++ .../javascript/alternativeDocumentInput.js | 8 +- .../{ => v5}/javascript/analyzeSentiment.js | 12 +- .../analyzeSentimentWithOpinionMining.js | 7 +- .../javascript/authenticationMethods.js | 7 +- .../javascript/beginAnalyzeBatchActions.js | 14 +- .../beginAnalyzeHealthcareEntities.js | 9 +- .../{ => v5}/javascript/detectLanguage.js | 7 +- .../{ => v5}/javascript/extractKeyPhrases.js | 7 +- .../samples/v5/javascript/package.json | 33 + .../{ => v5}/javascript/recognizeEntities.js | 6 +- .../javascript/recognizeLinkedEntities.js | 9 +- .../{ => v5}/javascript/recognizePii.js | 11 +- .../samples/{ => v5}/javascript/sample.env | 9 +- .../samples/{ => v5}/typescript/README.md | 72 +- .../samples/{ => v5}/typescript/package.json | 32 +- .../samples/{ => v5}/typescript/sample.env | 9 +- .../src/alternativeDocumentInput.ts | 18 +- .../typescript/src/analyzeSentiment.ts | 8 +- .../src/analyzeSentimentWithOpinionMining.ts | 7 +- .../typescript/src/authenticationMethods.ts | 7 +- .../src/beginAnalyzeBatchActions.ts | 13 +- .../src/beginAnalyzeHealthcareEntities.ts | 6 +- .../{ => v5}/typescript/src/detectLanguage.ts | 7 +- .../typescript/src/extractKeyPhrases.ts | 5 +- .../typescript/src/recognizeEntities.ts | 6 +- .../typescript/src/recognizeLinkedEntities.ts | 7 +- .../{ => v5}/typescript/src/recognizePii.ts | 8 +- .../samples/v5}/typescript/tsconfig.json | 8 +- .../ai-text-analytics/tsconfig.json | 16 +- .../perf-tests/text-analytics/package.json | 2 +- 111 files changed, 3202 insertions(+), 1014 deletions(-) create mode 100644 common/tools/dev-tool/register.d.ts create mode 100644 common/tools/dev-tool/register.js create mode 100644 common/tools/dev-tool/src/commands/samples/publish.ts create mode 100644 common/tools/dev-tool/src/templates/sampleReadme.md.ts create mode 100644 common/tools/dev-tool/src/util/fileTree.ts create mode 100644 common/tools/dev-tool/src/util/sampleConfiguration.ts create mode 100644 common/tools/dev-tool/src/util/sampleGenerationInfo.ts delete mode 100644 common/tools/dev-tool/src/util/shouldSkip.ts rename sdk/template/template/{samples/typescript/src => samples-dev}/getConfigurationSetting.ts (88%) delete mode 100644 sdk/template/template/samples/javascript/sample.env delete mode 100644 sdk/template/template/samples/tsconfig.json delete mode 100644 sdk/template/template/samples/typescript/sample.env rename sdk/template/template/samples/{ => v1}/javascript/README.md (62%) rename sdk/template/template/samples/{ => v1}/javascript/getConfigurationSetting.js (72%) rename sdk/template/template/samples/{ => v1}/javascript/package.json (66%) create mode 100644 sdk/template/template/samples/v1/javascript/sample.env rename sdk/template/template/samples/{ => v1}/typescript/README.md (64%) rename sdk/template/template/samples/{ => v1}/typescript/package.json (64%) create mode 100644 sdk/template/template/samples/v1/typescript/sample.env create mode 100644 sdk/template/template/samples/v1/typescript/src/getConfigurationSetting.ts rename sdk/{textanalytics/ai-text-analytics/samples => template/template/samples/v1}/typescript/tsconfig.json (79%) create mode 100644 sdk/template/template/test.env create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/alternativeDocumentInput.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentiment.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentimentWithOpinionMining.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/authenticationMethods.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeBatchActions.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeHealthcareEntities.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/detectLanguage.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/extractKeyPhrases.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/recognizeEntities.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/recognizeLinkedEntities.ts create mode 100644 sdk/textanalytics/ai-text-analytics/samples-dev/recognizePii.ts delete mode 100644 sdk/textanalytics/ai-text-analytics/samples/javascript/README.md delete mode 100644 sdk/textanalytics/ai-text-analytics/samples/javascript/package.json delete mode 100644 sdk/textanalytics/ai-text-analytics/samples/tsconfig.json create mode 100644 sdk/textanalytics/ai-text-analytics/samples/v5/javascript/README.md rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/alternativeDocumentInput.js (90%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/analyzeSentiment.js (77%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/analyzeSentimentWithOpinionMining.js (91%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/authenticationMethods.js (89%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/beginAnalyzeBatchActions.js (90%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/beginAnalyzeHealthcareEntities.js (86%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/detectLanguage.js (80%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/extractKeyPhrases.js (84%) create mode 100644 sdk/textanalytics/ai-text-analytics/samples/v5/javascript/package.json rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/recognizeEntities.js (85%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/recognizeLinkedEntities.js (81%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/recognizePii.js (85%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/javascript/sample.env (74%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/README.md (50%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/package.json (50%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/sample.env (74%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/alternativeDocumentInput.ts (88%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/analyzeSentiment.ts (83%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/analyzeSentimentWithOpinionMining.ts (91%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/authenticationMethods.ts (89%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/beginAnalyzeBatchActions.ts (92%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/beginAnalyzeHealthcareEntities.ts (92%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/detectLanguage.ts (80%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/extractKeyPhrases.ts (87%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/recognizeEntities.ts (85%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/recognizeLinkedEntities.ts (83%) rename sdk/textanalytics/ai-text-analytics/samples/{ => v5}/typescript/src/recognizePii.ts (87%) rename sdk/{template/template/samples => textanalytics/ai-text-analytics/samples/v5}/typescript/tsconfig.json (74%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e0996dc83498..b020c52f6eba 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -127,6 +127,13 @@ # PRLabel: %Monitor /sdk/monitor/ @hectorhdzg @applicationinsights-js-owners @richardpark-msft +########### +# Tools +########### + +# PRLabel: %dev-tool +/common/tools/dev-tool/ @witemple-msft + ########### # Eng Sys ########### diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index fb82b69e4f70..2b3f04363ce3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -160,20 +160,6 @@ packages: node: '>=8.0.0' resolution: integrity: sha512-KUl+Nwn/Sm6Lw5d3U90m1jZfNSL087SPcqHLxwn2T6PupNKmcgsEbDjHB25gDvHO4h7pBsTlrdJAY7dz+Qk8GA== - /@azure/core-client/1.0.0-beta.2: - dependencies: - '@azure/abort-controller': 1.0.4 - '@azure/core-asynciterator-polyfill': 1.0.0 - '@azure/core-auth': 1.2.0 - '@azure/core-rest-pipeline': 1.0.0-beta.2 - '@azure/core-tracing': 1.0.0-preview.10 - '@opentelemetry/api': 0.10.2 - tslib: 2.1.0 - dev: false - engines: - node: '>=8.0.0' - resolution: - integrity: sha512-DyfzqDElzCgpILWCLn217OGunRX5rqN4Lia0LHV1DfSulqGkdT9Q7JmFuRz0dJF0I5xDTNVyOWsgXigroB0Yng== /@azure/core-http/1.2.3: dependencies: '@azure/abort-controller': 1.0.4 @@ -215,22 +201,6 @@ packages: node: '>=8.0.0' resolution: integrity: sha512-his7Ah40ThEYORSpIAwuh6B8wkGwO/zG7gqVtmSE4WAJ46e36zUDXTKReUCLBDc6HmjjApQQxxcRFy5FruG79A== - /@azure/core-rest-pipeline/1.0.0-beta.2: - dependencies: - '@azure/abort-controller': 1.0.4 - '@azure/core-auth': 1.2.0 - '@azure/core-tracing': 1.0.0-preview.10 - '@azure/logger': 1.0.2 - '@opentelemetry/api': 0.10.2 - form-data: 3.0.1 - https-proxy-agent: 5.0.0 - tslib: 2.1.0 - uuid: 8.3.2 - dev: false - engines: - node: '>=8.0.0' - resolution: - integrity: sha512-g39Zg9e26blgoPctaoPDBBe3TXFsU7Zxhw3E0pnhG+BuaLDGuBrTLEaLQ9tWeop7423STon3CJW356PFMkAmvg== /@azure/core-tracing/1.0.0-preview.10: dependencies: '@opencensus/web-types': 0.0.7 @@ -284,9 +254,9 @@ packages: axios: 0.21.1 events: 3.3.0 jws: 4.0.0 - msal: 1.4.6 + msal: 1.4.8 open: 7.4.2 - qs: 6.9.6 + qs: 6.10.1 tslib: 2.1.0 uuid: 8.3.2 dev: false @@ -306,9 +276,9 @@ packages: axios: 0.21.1_debug@4.3.1 events: 3.3.0 jws: 4.0.0 - msal: 1.4.6 + msal: 1.4.8 open: 7.4.2 - qs: 6.9.6 + qs: 6.10.1 tslib: 2.1.0 uuid: 8.3.2 dev: false @@ -412,14 +382,14 @@ packages: node: '>=0.8.0' resolution: integrity: sha512-Y1Id+jG59S3eY2ZQQtUA/lxwbRcgjcWaiib9YX+SwV3zeRauKfEiZT7l3z+lwV+T+Sst20F6l1mJsfQcfE7CEQ== - /@azure/msal-common/4.0.2: + /@azure/msal-common/4.0.3: dependencies: debug: 4.3.1 dev: false engines: node: '>=0.8.0' resolution: - integrity: sha512-Z6FiDV+uWUZ4jcchRciKYYYKRWOc0sh/UaF5evfx7lXEp/8+KxO7cY1efgD7VOK75FkpRI5YyUzZAdX7I7sTAg== + integrity: sha512-EihnqHh2EE6xcB0Dh2LF30jE1Ga9cgh9PyRkX4fj+KpvYfL4ae57hvQwJGkynUgpf3V1xQxU5yaJVXOElfXiGw== /@azure/msal-node-extensions/1.0.0-alpha.6: dependencies: '@azure/msal-common': 1.7.2 @@ -434,7 +404,7 @@ packages: integrity: sha512-fVufHc02C+daYOMAHBnE998abB4qUIeJ9gmTxmSelHhGfBGvvzMbCohCu4sTlSVDKUndF3yD/Nxvw/cEtpcZKg== /@azure/msal-node/1.0.0-beta.6: dependencies: - '@azure/msal-common': 4.0.2 + '@azure/msal-common': 4.0.3 axios: 0.21.1 jsonwebtoken: 8.5.1 uuid: 8.3.2 @@ -443,7 +413,7 @@ packages: integrity: sha512-ZQI11Uz1j0HJohb9JZLRD8z0moVcPks1AFW4Q/Gcl67+QvH4aKEJti7fjCcipEEZYb/qzLSO8U6IZgPYytsiJQ== /@azure/msal-node/1.0.0-beta.6_debug@4.3.1: dependencies: - '@azure/msal-common': 4.0.2 + '@azure/msal-common': 4.0.3 axios: 0.21.1_debug@4.3.1 jsonwebtoken: 8.5.1 uuid: 8.3.2 @@ -454,7 +424,7 @@ packages: integrity: sha512-ZQI11Uz1j0HJohb9JZLRD8z0moVcPks1AFW4Q/Gcl67+QvH4aKEJti7fjCcipEEZYb/qzLSO8U6IZgPYytsiJQ== /@azure/msal-node/1.0.1: dependencies: - '@azure/msal-common': 4.0.2 + '@azure/msal-common': 4.0.3 axios: 0.21.1 jsonwebtoken: 8.5.1 uuid: 8.3.2 @@ -475,21 +445,21 @@ packages: dev: false resolution: integrity: sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== - /@babel/compat-data/7.13.8: + /@babel/compat-data/7.13.12: dev: false resolution: - integrity: sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog== + integrity: sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ== /@babel/core/7.13.10: dependencies: '@babel/code-frame': 7.12.13 '@babel/generator': 7.13.9 '@babel/helper-compilation-targets': 7.13.10_@babel+core@7.13.10 - '@babel/helper-module-transforms': 7.13.0 + '@babel/helper-module-transforms': 7.13.12 '@babel/helpers': 7.13.10 - '@babel/parser': 7.13.10 + '@babel/parser': 7.13.12 '@babel/template': 7.12.13 '@babel/traverse': 7.13.0 - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 convert-source-map: 1.7.0 debug: 4.3.1 gensync: 1.0.0-beta.2 @@ -504,7 +474,7 @@ packages: integrity: sha512-bfIYcT0BdKeAZrovpMqX2Mx5NrgAckGbwT982AkdS5GNfn3KMGiprlBAtmBcFZRUmpaufS6WZFP8trvx8ptFDw== /@babel/generator/7.13.9: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 jsesc: 2.5.2 source-map: 0.5.7 dev: false @@ -512,7 +482,7 @@ packages: integrity: sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== /@babel/helper-compilation-targets/7.13.10_@babel+core@7.13.10: dependencies: - '@babel/compat-data': 7.13.8 + '@babel/compat-data': 7.13.12 '@babel/core': 7.13.10 '@babel/helper-validator-option': 7.12.17 browserslist: 4.16.3 @@ -526,66 +496,65 @@ packages: dependencies: '@babel/helper-get-function-arity': 7.12.13 '@babel/template': 7.12.13 - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: integrity: sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== /@babel/helper-get-function-arity/7.12.13: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: integrity: sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== - /@babel/helper-member-expression-to-functions/7.13.0: + /@babel/helper-member-expression-to-functions/7.13.12: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: - integrity: sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ== - /@babel/helper-module-imports/7.12.13: + integrity: sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== + /@babel/helper-module-imports/7.13.12: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: - integrity: sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g== - /@babel/helper-module-transforms/7.13.0: + integrity: sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + /@babel/helper-module-transforms/7.13.12: dependencies: - '@babel/helper-module-imports': 7.12.13 - '@babel/helper-replace-supers': 7.13.0 - '@babel/helper-simple-access': 7.12.13 + '@babel/helper-module-imports': 7.13.12 + '@babel/helper-replace-supers': 7.13.12 + '@babel/helper-simple-access': 7.13.12 '@babel/helper-split-export-declaration': 7.12.13 '@babel/helper-validator-identifier': 7.12.11 '@babel/template': 7.12.13 '@babel/traverse': 7.13.0 - '@babel/types': 7.13.0 - lodash: 4.17.21 + '@babel/types': 7.13.12 dev: false resolution: - integrity: sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw== + integrity: sha512-7zVQqMO3V+K4JOOj40kxiCrMf6xlQAkewBB0eu2b03OO/Q21ZutOzjpfD79A5gtE/2OWi1nv625MrDlGlkbknQ== /@babel/helper-optimise-call-expression/7.12.13: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: integrity: sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== - /@babel/helper-replace-supers/7.13.0: + /@babel/helper-replace-supers/7.13.12: dependencies: - '@babel/helper-member-expression-to-functions': 7.13.0 + '@babel/helper-member-expression-to-functions': 7.13.12 '@babel/helper-optimise-call-expression': 7.12.13 '@babel/traverse': 7.13.0 - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: - integrity: sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw== - /@babel/helper-simple-access/7.12.13: + integrity: sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + /@babel/helper-simple-access/7.13.12: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: - integrity: sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA== + integrity: sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== /@babel/helper-split-export-declaration/7.12.13: dependencies: - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: integrity: sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== @@ -601,7 +570,7 @@ packages: dependencies: '@babel/template': 7.12.13 '@babel/traverse': 7.13.0 - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 dev: false resolution: integrity: sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ== @@ -613,13 +582,13 @@ packages: dev: false resolution: integrity: sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg== - /@babel/parser/7.13.10: + /@babel/parser/7.13.12: dev: false engines: node: '>=6.0.0' hasBin: true resolution: - integrity: sha512-0s7Mlrw9uTWkYua7xWr99Wpk2bnGa0ANleKfksYAES8LpWH4gW1OUr42vqKNf0us5UQNfru2wPqMqRITzq/SIQ== + integrity: sha512-4T7Pb244rxH24yR116LAuJ+adxXXnHhZaLJjegJVKSdoNCe4x1eDBaud5YIcQFcqzsaD5BHvJw5BQ0AZapdCRw== /@babel/runtime/7.13.10: dependencies: regenerator-runtime: 0.13.7 @@ -629,8 +598,8 @@ packages: /@babel/template/7.12.13: dependencies: '@babel/code-frame': 7.12.13 - '@babel/parser': 7.13.10 - '@babel/types': 7.13.0 + '@babel/parser': 7.13.12 + '@babel/types': 7.13.12 dev: false resolution: integrity: sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== @@ -640,22 +609,22 @@ packages: '@babel/generator': 7.13.9 '@babel/helper-function-name': 7.12.13 '@babel/helper-split-export-declaration': 7.12.13 - '@babel/parser': 7.13.10 - '@babel/types': 7.13.0 + '@babel/parser': 7.13.12 + '@babel/types': 7.13.12 debug: 4.3.1 globals: 11.12.0 lodash: 4.17.21 dev: false resolution: integrity: sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ== - /@babel/types/7.13.0: + /@babel/types/7.13.12: dependencies: '@babel/helper-validator-identifier': 7.12.11 lodash: 4.17.21 to-fast-properties: 2.0.0 dev: false resolution: - integrity: sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== + integrity: sha512-K4nY2xFN4QMvQwkQ+zmBDp6ANMbVNw6BbxWmYA4qNjhR9W+Lj/8ky5MEY2Me5r+B2c6/v6F53oMndG+f9s3IiA== /@bahmutov/data-driven/1.0.0: dependencies: check-more-types: 2.24.0 @@ -1014,7 +983,7 @@ packages: /@types/body-parser/1.19.0: dependencies: '@types/connect': 3.4.34 - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ== @@ -1036,7 +1005,7 @@ packages: integrity: sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ== /@types/chalk/2.2.0: dependencies: - chalk: 4.1.0 + chalk: 3.0.0 deprecated: This is a stub types definition for chalk (https://github.com/chalk/chalk). chalk provides its own type definitions, so you don't need @types/chalk installed! dev: false resolution: @@ -1047,7 +1016,7 @@ packages: integrity: sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg== /@types/connect/3.4.34: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ== @@ -1078,18 +1047,18 @@ packages: dev: false resolution: integrity: sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== - /@types/express-serve-static-core/4.17.18: + /@types/express-serve-static-core/4.17.19: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 '@types/qs': 6.9.6 '@types/range-parser': 1.2.3 dev: false resolution: - integrity: sha512-m4JTwx5RUBNZvky/JJ8swEJPKFd8si08pPF2PfizYjGZOKr/svUWPcoUmLow6MmPzhasphB7gSTINY67xn3JNA== + integrity: sha512-DJOSHzX7pCiSElWaGR8kCprwibCB/3yW6vcT8VG3P0SJjnv19gnWG/AZMfM60Xj/YJIp/YCaDHyvzsFVeniARA== /@types/express/4.17.11: dependencies: '@types/body-parser': 1.19.0 - '@types/express-serve-static-core': 4.17.18 + '@types/express-serve-static-core': 4.17.19 '@types/qs': 6.9.6 '@types/serve-static': 1.13.9 dev: false @@ -1101,20 +1070,20 @@ packages: integrity: sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ== /@types/fs-extra/8.1.1: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w== /@types/glob/7.1.3: dependencies: '@types/minimatch': 3.0.3 - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== /@types/is-buffer/2.0.0: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw== @@ -1132,7 +1101,7 @@ packages: integrity: sha512-TtLis3HRTt7wLfdpkDBem6vs+MbEGMsC7ob5gNYsJV40tHNAFxw00HMMsEHsg9FWduD38NtACWuSqQpXbFulUg== /@types/jws/3.2.3: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-g54CHxwvaHvyJyeuZqe7VQujV9SfCXwEkboJp355INPL+kjlS3Aq153EHptaeO/Cch/NPJ1i2sHz0sDDizn7LQ== @@ -1146,7 +1115,7 @@ packages: integrity: sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== /@types/md5/2.3.0: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-556YJ7ejzxIqSSxzyGGpctuZOarNZJt/zlEkhmmDc1f/slOEANHuwu2ZX7YaZ40rMiWoxt8GvAhoDpW1cmSy6A== @@ -1168,13 +1137,13 @@ packages: integrity: sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== /@types/mock-fs/4.10.0: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-FQ5alSzmHMmliqcL36JqIA4Yyn9jyJKvRSGV3mvPh108VFatX7naJDzSG4fnFQNZFq9dIx0Dzoe6ddflMB2Xkg== /@types/mock-require/2.0.0: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-nOgjoE5bBiDeiA+z41i95makyHUSMWQMOPocP+J67Pqx/68HAXaeWN1NFtrAYYV6LrISIZZ8vKHm/a50k0f6Sg== @@ -1184,7 +1153,7 @@ packages: integrity: sha512-DPxmjiDwubsNmguG5X4fEJ+XCyzWM3GXWsqQlvUcjJKa91IOoJUy51meDr0GkzK64qqNcq85ymLlyjoct9tInw== /@types/node-fetch/2.5.8: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 form-data: 3.0.1 dev: false resolution: @@ -1223,7 +1192,7 @@ packages: integrity: sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== /@types/resolve/1.17.1: dependencies: - '@types/node': 10.17.55 + '@types/node': 10.17.13 dev: false resolution: integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== @@ -1234,7 +1203,7 @@ packages: /@types/serve-static/1.13.9: dependencies: '@types/mime': 1.3.2 - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA== @@ -1250,7 +1219,7 @@ packages: integrity: sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg== /@types/stoppable/1.1.0: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-BRR23Q9CJduH7AM6mk4JRttd8XyFkb4qIPZu4mdLF+VoP+wcjIxIWIKiBbN78NBbEuynrAyMPtzOHnIp2B/JPQ== @@ -1260,7 +1229,7 @@ packages: integrity: sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A== /@types/tunnel/0.0.1: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A== @@ -1274,13 +1243,13 @@ packages: integrity: sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== /@types/ws/7.4.0: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw== /@types/xml2js/0.4.8: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false resolution: integrity: sha512-EyvT83ezOdec7BhDaEcsklWy7RSIdi6CNe95tmOAK0yx/Lm30C9K75snT3fYayK59ApC2oyW+rcHErdG05FHJA== @@ -1296,18 +1265,18 @@ packages: integrity: sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== /@types/yauzl/2.9.1: dependencies: - '@types/node': 10.17.55 + '@types/node': 8.10.66 dev: false optional: true resolution: integrity: sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA== - /@typescript-eslint/eslint-plugin/4.19.0_2a7f18f4779dbdda23f2fec22e20e2b6: + /@typescript-eslint/eslint-plugin/4.19.0_f26dcf5ec38a04241b14c26bc931244e: dependencies: - '@typescript-eslint/experimental-utils': 4.19.0_eslint@7.21.0+typescript@4.2.3 - '@typescript-eslint/parser': 4.19.0_eslint@7.21.0+typescript@4.2.3 + '@typescript-eslint/experimental-utils': 4.19.0_eslint@7.22.0+typescript@4.2.3 + '@typescript-eslint/parser': 4.19.0_eslint@7.22.0+typescript@4.2.3 '@typescript-eslint/scope-manager': 4.19.0 debug: 4.3.1 - eslint: 7.21.0 + eslint: 7.22.0 functional-red-black-tree: 1.0.1 lodash: 4.17.21 regexpp: 3.1.0 @@ -1326,13 +1295,13 @@ packages: optional: true resolution: integrity: sha512-CRQNQ0mC2Pa7VLwKFbrGVTArfdVDdefS+gTw0oC98vSI98IX5A8EVH4BzJ2FOB0YlCmm8Im36Elad/Jgtvveaw== - /@typescript-eslint/experimental-utils/4.19.0_eslint@7.21.0+typescript@4.2.3: + /@typescript-eslint/experimental-utils/4.19.0_eslint@7.22.0+typescript@4.2.3: dependencies: '@types/json-schema': 7.0.7 '@typescript-eslint/scope-manager': 4.19.0 '@typescript-eslint/types': 4.19.0 '@typescript-eslint/typescript-estree': 4.19.0_typescript@4.2.3 - eslint: 7.21.0 + eslint: 7.22.0 eslint-scope: 5.1.1 eslint-utils: 2.1.0 dev: false @@ -1343,13 +1312,13 @@ packages: typescript: '*' resolution: integrity: sha512-9/23F1nnyzbHKuoTqFN1iXwN3bvOm/PRIXSBR3qFAYotK/0LveEOHr5JT1WZSzcD6BESl8kPOG3OoDRKO84bHA== - /@typescript-eslint/parser/4.19.0_eslint@7.21.0+typescript@4.2.3: + /@typescript-eslint/parser/4.19.0_eslint@7.22.0+typescript@4.2.3: dependencies: '@typescript-eslint/scope-manager': 4.19.0 '@typescript-eslint/types': 4.19.0 '@typescript-eslint/typescript-estree': 4.19.0_typescript@4.2.3 debug: 4.3.1 - eslint: 7.21.0 + eslint: 7.22.0 typescript: 4.2.3 dev: false engines: @@ -1382,7 +1351,7 @@ packages: '@typescript-eslint/types': 4.19.0 '@typescript-eslint/visitor-keys': 4.19.0 debug: 4.3.1 - globby: 11.0.2 + globby: 11.0.3 is-glob: 4.0.1 semver: 7.3.4 tsutils: 3.21.0_typescript@4.2.3 @@ -1437,7 +1406,7 @@ packages: date-utils: 1.2.21 jws: 3.2.2 request: 2.88.2 - underscore: 1.12.0 + underscore: 1.12.1 uuid: 3.4.0 xmldom: 0.5.0 xpath.js: 1.1.0 @@ -1485,7 +1454,7 @@ packages: dev: false resolution: integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - /ajv/7.2.1: + /ajv/7.2.3: dependencies: fast-deep-equal: 3.1.3 json-schema-traverse: 1.0.0 @@ -1493,7 +1462,7 @@ packages: uri-js: 4.4.1 dev: false resolution: - integrity: sha512-+nu0HDv7kNSOua9apAVc979qd932rrZeb3WOvoiD31A/p1mIE5/9bN2027pE2rOPYEdS3UHzsvof4hY+lM9/WQ== + integrity: sha512-idv5WZvKVXDqKralOImQgPM9v6WOdLNa0IY3B3doOjw/YxRGT8I+allIJ6kd7Uaj+SF1xZUSU+nPM5aDNBVtnw== /ansi-colors/3.2.3: dev: false engines: @@ -1773,7 +1742,7 @@ packages: integrity: sha1-llxwWGaOgrVde/4E/yM3vItWR/4= /backbone/1.4.0: dependencies: - underscore: 1.12.0 + underscore: 1.12.1 dev: false resolution: integrity: sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ== @@ -1865,9 +1834,9 @@ packages: integrity: sha1-rrGvKN5sDXpqLOQK22j/GEIq8x8= /browserslist/4.16.3: dependencies: - caniuse-lite: 1.0.30001198 + caniuse-lite: 1.0.30001204 colorette: 1.2.2 - electron-to-chromium: 1.3.685 + electron-to-chromium: 1.3.693 escalade: 3.1.1 node-releases: 1.1.71 dev: false @@ -1949,41 +1918,41 @@ packages: node: '>=6' resolution: integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - /caniuse-lite/1.0.30001198: + /caniuse-lite/1.0.30001204: dev: false resolution: - integrity: sha512-r5GGgESqOPZzwvdLVER374FpQu2WluCF1Z2DSiFJ89KSmGjT0LVKjgv4NcAqHmGWF9ihNpqRI9KXO9Ex4sKsgA== + integrity: sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ== /caseless/0.12.0: dev: false resolution: integrity: sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - /chai-as-promised/7.1.1_chai@4.3.3: + /chai-as-promised/7.1.1_chai@4.3.4: dependencies: - chai: 4.3.3 + chai: 4.3.4 check-error: 1.0.2 dev: false peerDependencies: chai: '>= 2.1.2 < 5' resolution: integrity: sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA== - /chai-exclude/2.0.2_chai@4.3.3: + /chai-exclude/2.0.2_chai@4.3.4: dependencies: - chai: 4.3.3 + chai: 4.3.4 fclone: 1.0.11 dev: false peerDependencies: chai: '>= 4.0.0 < 5' resolution: integrity: sha512-QmNVnvdSw8Huccdjm49mKu3HtoHxvjdavgYkY0KPQ5MI5UWfbc9sX1YqRgaMPf2GGtDXPoF2ram3AeNS4945Xw== - /chai-string/1.5.0_chai@4.3.3: + /chai-string/1.5.0_chai@4.3.4: dependencies: - chai: 4.3.3 + chai: 4.3.4 dev: false peerDependencies: chai: ^4.1.2 resolution: integrity: sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw== - /chai/4.3.3: + /chai/4.3.4: dependencies: assertion-error: 1.1.0 check-error: 1.0.2 @@ -1995,7 +1964,7 @@ packages: engines: node: '>=4' resolution: - integrity: sha512-MPSLOZwxxnA0DhLE84klnGPojWFK5KuhP7/j5dTsxpr2S3XlkqJP5WbyYl1gCTWvG2Z5N+HD4F472WsbEZL6Pw== + integrity: sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== /chalk/1.1.3: dependencies: ansi-styles: 2.2.1 @@ -2288,6 +2257,10 @@ packages: node: '>=6' resolution: integrity: sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA== + /create-require/1.1.1: + dev: false + resolution: + integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== /cross-env/7.0.3: dependencies: cross-spawn: 7.0.3 @@ -2392,7 +2365,7 @@ packages: integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== /debug/3.2.6: dependencies: - ms: 2.1.3 + ms: 2.1.1 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) dev: false resolution: @@ -2479,6 +2452,12 @@ packages: node: '>=4' resolution: integrity: sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc= + /define-lazy-prop/2.0.0: + dev: false + engines: + node: '>=8' + resolution: + integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== /define-properties/1.1.3: dependencies: object-keys: 1.1.1 @@ -2627,10 +2606,10 @@ packages: dev: false resolution: integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - /electron-to-chromium/1.3.685: + /electron-to-chromium/1.3.693: dev: false resolution: - integrity: sha512-C3oFZNkJ8lz85ADqr3hzpjBc2ciejMRN2SCd/D0hwcqpr6MGxfdN/j89VN6l+ERTuCUvhg0VYsf40Q4qTz4bhQ== + integrity: sha512-vUdsE8yyeu30RecppQtI+XTz2++LWLVEIYmzeCaCRLSdtKZ2eXqdJcrs85KwLiPOPVc6PELgWyXBsfqIvzGZag== /emoji-regex/7.0.3: dev: false resolution: @@ -2774,9 +2753,9 @@ packages: source-map: 0.6.1 resolution: integrity: sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - /eslint-config-prettier/7.2.0_eslint@7.21.0: + /eslint-config-prettier/7.2.0_eslint@7.22.0: dependencies: - eslint: 7.21.0 + eslint: 7.22.0 dev: false hasBin: true peerDependencies: @@ -2799,9 +2778,9 @@ packages: node: '>=4' resolution: integrity: sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA== - /eslint-plugin-es/3.0.1_eslint@7.21.0: + /eslint-plugin-es/3.0.1_eslint@7.22.0: dependencies: - eslint: 7.21.0 + eslint: 7.22.0 eslint-utils: 2.1.0 regexpp: 3.1.0 dev: false @@ -2811,14 +2790,14 @@ packages: eslint: '>=4.19.1' resolution: integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== - /eslint-plugin-import/2.22.1_eslint@7.21.0: + /eslint-plugin-import/2.22.1_eslint@7.22.0: dependencies: array-includes: 3.1.3 array.prototype.flat: 1.2.4 contains-path: 0.1.0 debug: 2.6.9 doctrine: 1.5.0 - eslint: 7.21.0 + eslint: 7.22.0 eslint-import-resolver-node: 0.3.4 eslint-module-utils: 2.6.0 has: 1.0.3 @@ -2840,10 +2819,10 @@ packages: node: '>=4.0.0' resolution: integrity: sha512-azP9PwQYfGtXJjW273nIxQH9Ygr+5/UyeW2wEjYoDtVYPI+WPKwbj0+qcAKYUXFZLRumq4HKkFaoDBAwBoXImQ== - /eslint-plugin-node/11.1.0_eslint@7.21.0: + /eslint-plugin-node/11.1.0_eslint@7.22.0: dependencies: - eslint: 7.21.0 - eslint-plugin-es: 3.0.1_eslint@7.21.0 + eslint: 7.22.0 + eslint-plugin-es: 3.0.1_eslint@7.22.0 eslint-utils: 2.1.0 ignore: 5.1.8 minimatch: 3.0.4 @@ -2898,7 +2877,7 @@ packages: node: '>=10' resolution: integrity: sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== - /eslint/7.21.0: + /eslint/7.22.0: dependencies: '@babel/code-frame': 7.12.11 '@eslint/eslintrc': 0.4.0 @@ -2917,7 +2896,7 @@ packages: file-entry-cache: 6.0.1 functional-red-black-tree: 1.0.1 glob-parent: 5.1.2 - globals: 12.4.0 + globals: 13.7.0 ignore: 4.0.6 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -2942,7 +2921,7 @@ packages: node: ^10.12.0 || >=12.0.0 hasBin: true resolution: - integrity: sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg== + integrity: sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg== /esm/3.2.25: dev: false engines: @@ -3588,7 +3567,15 @@ packages: node: '>=8' resolution: integrity: sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - /globby/11.0.2: + /globals/13.7.0: + dependencies: + type-fest: 0.20.2 + dev: false + engines: + node: '>=8' + resolution: + integrity: sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA== + /globby/11.0.3: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 @@ -3600,7 +3587,7 @@ packages: engines: node: '>=10' resolution: - integrity: sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== + integrity: sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== /graceful-fs/4.2.6: dev: false resolution: @@ -3626,7 +3613,7 @@ packages: node: '>=0.4.7' hasBin: true optionalDependencies: - uglify-js: 3.13.0 + uglify-js: 3.13.2 resolution: integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== /har-schema/2.0.0: @@ -4209,10 +4196,10 @@ packages: /istanbul-lib-instrument/3.3.0: dependencies: '@babel/generator': 7.13.9 - '@babel/parser': 7.13.10 + '@babel/parser': 7.13.12 '@babel/template': 7.12.13 '@babel/traverse': 7.13.0 - '@babel/types': 7.13.0 + '@babel/types': 7.13.12 istanbul-lib-coverage: 2.0.5 semver: 6.3.0 dev: false @@ -4490,9 +4477,9 @@ packages: dev: false resolution: integrity: sha1-fYa9VmefWM5qhHBKZX3TkruoGnk= - /karma-chai/0.1.0_chai@4.3.3+karma@6.2.0: + /karma-chai/0.1.0_chai@4.3.4+karma@6.2.0: dependencies: - chai: 4.3.3 + chai: 4.3.4 karma: 6.2.0 dev: false peerDependencies: @@ -4592,7 +4579,7 @@ packages: dev: false resolution: integrity: sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ== - /karma-rollup-preprocessor/7.0.6_rollup@1.32.1: + /karma-rollup-preprocessor/7.0.7_rollup@1.32.1: dependencies: chokidar: 3.5.1 debounce: 1.2.1 @@ -4603,7 +4590,7 @@ packages: peerDependencies: rollup: '>= 1.0.0' resolution: - integrity: sha512-Qghr/oNnmNKB4Ry5n81QX+tB6+vSy0kjn+rwzH1dp80ZVf9WiA19NQqVFZLc0f76tBoE7is2Qef8dqbVNjVtjw== + integrity: sha512-Y1QwsTCiCBp8sSALZdqmqry/mWIWIy0V6zonUIpy+0/D/Kpb2XZvR+JZrWfacQvcvKQdZFJvg6EwlnKtjepu3Q== /karma-source-map-support/1.4.0: dependencies: source-map-support: 0.5.19 @@ -4842,7 +4829,7 @@ packages: date-format: 3.0.0 debug: 4.3.1 flatted: 2.0.2 - rfdc: 1.2.0 + rfdc: 1.3.0 streamroller: 2.2.4 dev: false engines: @@ -5139,25 +5126,25 @@ packages: dev: false resolution: integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - /msal/1.4.6: + /msal/1.4.8: dependencies: tslib: 1.14.1 dev: false engines: node: '>=0.8.0' resolution: - integrity: sha512-tPwgKoWBRf+d2YG4CgCm2C9MiRUwzdn2aOwlLtaBCj3ekM1afkWMKbAsbKuuWSdoMPhhxrvALIOV0FfX3WKJlg== + integrity: sha512-Xsh+jiizuC5tjjK9J0RB5i/VE9CvOzBukxtxexffFQTm7vO6vqfUDB6mrsmHn5ts+rdAL89KryQFaDpVJRf4Cw== /nan/2.14.2: dev: false resolution: integrity: sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== - /nanoid/3.1.20: + /nanoid/3.1.22: dev: false engines: node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 hasBin: true resolution: - integrity: sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== + integrity: sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ== /napi-build-utils/1.0.2: dev: false resolution: @@ -5217,10 +5204,10 @@ packages: dev: false resolution: integrity: sha512-smhrivuPqEM3H5LmnY3KU6HfYv0u4QklgAxfFyRNujKUzbUcYZ+Jc2EhukB9SRcD2VpqhxM7n/MIcp1Ua1/JMg== - /node-abort-controller/1.1.0: + /node-abort-controller/1.2.0: dev: false resolution: - integrity: sha512-dEYmUqjtbivotqjraOe8UvhT/poFfog1BQRNsZm/MSEDDESk2cQ1tvD8kGyuN07TM/zoW+n42odL8zTeJupYdQ== + integrity: sha512-x6Pv6ACfOUmYGDW/SRjSKBJs7waJRxRPQ9FeXFqfBtEtvJQBfuPl5P74p0Ow+vl0w6WURvXwn+xq/3S95Z7e5Q== /node-addon-api/3.1.0: dev: false resolution: @@ -5436,6 +5423,16 @@ packages: node: '>=8' resolution: integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + /open/8.0.4: + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.1.1 + is-wsl: 2.2.0 + dev: false + engines: + node: '>=12' + resolution: + integrity: sha512-Txc9FOcvjrr5Kv+Zb3w89uKMKiP7wH8mLdYj1xJa+YnhhntEYhbB6cQHjS4O6P+jFwMEzEQVVcpfnu9WkKNuLQ== /optionator/0.8.3: dependencies: deep-is: 0.1.3 @@ -5915,24 +5912,26 @@ packages: node: '>=0.9' resolution: integrity: sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - /qs/6.5.2: + /qs/6.10.1: + dependencies: + side-channel: 1.0.4 dev: false engines: node: '>=0.6' resolution: - integrity: sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - /qs/6.7.0: + integrity: sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== + /qs/6.5.2: dev: false engines: node: '>=0.6' resolution: - integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - /qs/6.9.6: + integrity: sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + /qs/6.7.0: dev: false engines: node: '>=0.6' resolution: - integrity: sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== + integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== /query-string/5.1.1: dependencies: decode-uri-component: 0.2.0 @@ -5955,10 +5954,10 @@ packages: node: '>=0.4.x' resolution: integrity: sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== - /queue-microtask/1.2.2: + /queue-microtask/1.2.3: dev: false resolution: - integrity: sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg== + integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== /quote/0.4.0: dev: false resolution: @@ -6249,10 +6248,10 @@ packages: node: '>=0.10.0' resolution: integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - /rfdc/1.2.0: + /rfdc/1.3.0: dev: false resolution: - integrity: sha512-ijLyszTMmUrXvjSooucVQwimGUk84eRcmCuLV8Xghe3UO85mjUtRAHRyoMM6XtyqbECaXuBWx18La3523sXINA== + integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== /rhea-promise/0.1.15: dependencies: debug: 3.2.7 @@ -6332,10 +6331,10 @@ packages: rollup: '>=0.66.0 <3' resolution: integrity: sha512-1pkwkervMJQGFYvM9nscrUoncPwiKR/K+bHdjv6PFgRo3cgPHoRT83y2Aa3GvINj4539S15t/tpFPb775TDs6w== - /rollup-plugin-visualizer/4.2.0_rollup@1.32.1: + /rollup-plugin-visualizer/4.2.1_rollup@1.32.1: dependencies: - nanoid: 3.1.20 - open: 7.4.2 + nanoid: 3.1.22 + open: 8.0.4 rollup: 1.32.1 source-map: 0.7.3 yargs: 16.2.0 @@ -6346,7 +6345,7 @@ packages: peerDependencies: rollup: '>=1.20.0' resolution: - integrity: sha512-xjfvoK4x0G7lBT3toMx8K/9tkCEWhRehnSJnn+PLY3Hjk8sNvyo407b68Cd3hdV9j42xcb8HXt0ZrmRi5NWeaQ== + integrity: sha512-GKXszY24T+WtSHVJclNcOpRaAU87E7bB6FZSdr71zcrnXY96QGgI8iyyGWOSfEH94qW4OQ+x5PcIB3zqWypYVQ== /rollup-pluginutils/2.8.2: dependencies: estree-walker: 0.6.1 @@ -6356,7 +6355,7 @@ packages: /rollup/1.32.1: dependencies: '@types/estree': 0.0.46 - '@types/node': 10.17.55 + '@types/node': 8.10.66 acorn: 7.4.1 dev: false hasBin: true @@ -6364,7 +6363,7 @@ packages: integrity: sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== /run-parallel/1.2.0: dependencies: - queue-microtask: 1.2.2 + queue-microtask: 1.2.3 dev: false resolution: integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== @@ -6516,6 +6515,14 @@ packages: hasBin: true resolution: integrity: sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA== + /side-channel/1.0.4: + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.1 + object-inspect: 1.9.0 + dev: false + resolution: + integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== /signal-exit/3.0.3: dev: false resolution: @@ -6637,7 +6644,7 @@ packages: dependencies: '@types/cookie': 0.4.0 '@types/cors': 2.8.10 - '@types/node': 10.17.55 + '@types/node': 10.17.13 accepts: 1.3.7 base64id: 2.0.0 debug: 4.3.1 @@ -6982,7 +6989,7 @@ packages: integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== /table/6.0.7: dependencies: - ajv: 7.2.1 + ajv: 7.2.3 lodash: 4.17.21 slice-ansi: 4.0.0 string-width: 4.2.2 @@ -7103,9 +7110,10 @@ packages: dev: false resolution: integrity: sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= - /ts-node/8.10.2_typescript@4.2.3: + /ts-node/9.1.1_typescript@4.2.3: dependencies: arg: 4.1.3 + create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 source-map-support: 0.5.19 @@ -7113,12 +7121,12 @@ packages: yn: 3.1.1 dev: false engines: - node: '>=6.0.0' + node: '>=10.0.0' hasBin: true peerDependencies: typescript: '>=2.7' resolution: - integrity: sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== + integrity: sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== /tsconfig-paths/3.9.0: dependencies: '@types/json5': 0.0.29 @@ -7185,6 +7193,12 @@ packages: node: '>=4' resolution: integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + /type-fest/0.20.2: + dev: false + engines: + node: '>=10' + resolution: + integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== /type-fest/0.8.1: dev: false engines: @@ -7205,7 +7219,7 @@ packages: backbone: 1.4.0 jquery: 3.6.0 lunr: 2.3.9 - underscore: 1.12.0 + underscore: 1.12.1 dev: false engines: node: '>= 8' @@ -7255,13 +7269,13 @@ packages: dev: false resolution: integrity: sha512-yo+miGzQx5gakzVK3QFfN0/L9uVhosXBBO7qmnk7c2iw1IhL212wfA3zbnI54B0obGwC/5NWub/iT9sReMx+Fw== - /uglify-js/3.13.0: + /uglify-js/3.13.2: dev: false engines: node: '>=0.8.0' hasBin: true resolution: - integrity: sha512-TWYSWa9T2pPN4DIJYbU9oAjQx+5qdV5RUDxwARg8fmJZrD/V27Zj0JngW5xg1DFz42G0uDYl2XhzF6alSzD62w== + integrity: sha512-SbMu4D2Vo95LMC/MetNaso1194M1htEA+JrqE9Hk+G2DhI+itfS9TRu9ZKeCahLDNa/J3n4MqUJ/fOHMzQpRWw== /unbox-primitive/1.0.0: dependencies: function-bind: 1.1.1 @@ -7278,10 +7292,10 @@ packages: dev: false resolution: integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== - /underscore/1.12.0: + /underscore/1.12.1: dev: false resolution: - integrity: sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ== + integrity: sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== /underscore/1.8.3: dev: false resolution: @@ -7629,6 +7643,12 @@ packages: dev: false resolution: integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + /yaml/1.10.2: + dev: false + engines: + node: '>= 6' + resolution: + integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== /yargs-parser/13.1.2: dependencies: camelcase: 5.3.1 @@ -7745,7 +7765,7 @@ packages: cross-env: 7.0.3 delay: 4.4.1 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -7765,14 +7785,14 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 dev: false name: '@rush-temp/abort-controller' resolution: - integrity: sha512-6vfbLdb83/8k7VZW0VRHijqn4TKSB3aBkgErkb46wh+tFvHyh9pCuIpPzYLNnwXHowDjkCqsDw64iNk6cZbjuw== + integrity: sha512-1VaqPBS+YkeUe/pXKV43zUAiFz2vKwP6UOF1hP+dhCe7SJ3uvoKNvGrnOtzmI1sT8VDfhhPezfUsxypmviNBtg== tarball: file:projects/abort-controller.tgz version: 0.0.0 file:projects/ai-anomaly-detector.tgz: @@ -7788,11 +7808,11 @@ packages: '@types/chai': 4.2.15 '@types/mocha': 7.0.2 '@types/node': 8.10.66 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 csv-parse: 4.15.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -7814,7 +7834,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -7834,11 +7854,11 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -7878,11 +7898,11 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -7904,20 +7924,18 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 dev: false name: '@rush-temp/ai-metrics-advisor' resolution: - integrity: sha512-icllEU7GvVtDopXLe1s48ytyFhsSzoXnVCzUF4n37SmYVRdL7UGfQWSMxzIWA3rQEwykaVW1wfsqG5w/pGUCGA== + integrity: sha512-6li9HOY5q8U+YX3Tl6wLcrLwtdDea0IqIgxsILlivDXccx8hiRohlaC4sZxNlDjrQXGFbwHzqKoKOAzkbTzsQw== tarball: file:projects/ai-metrics-advisor.tgz version: 0.0.0 file:projects/ai-text-analytics.tgz: dependencies: - '@azure/core-client': 1.0.0-beta.2 - '@azure/core-rest-pipeline': 1.0.0-beta.2 '@azure/identity': 1.2.4 '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 @@ -7926,11 +7944,11 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -7953,14 +7971,14 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 dev: false name: '@rush-temp/ai-text-analytics' resolution: - integrity: sha512-9BDxSJPa7Qh1itmUAVTO84qF9XLaESYWvwNXPvCCRICH6b6cE2Nep6LpFw1OTy2yHvi/Z3+U7zXPGzz0+Z9tQA== + integrity: sha512-Bnopq4PrjoV86PGrIujZ45xiumbyeq1sTbOP046sL6cKL9MNq/34MhhhwoT8oJRrmGFiuLATLGNY23wsuCT4IQ== tarball: file:projects/ai-text-analytics.tgz version: 0.0.0 file:projects/app-configuration.tgz: @@ -7979,10 +7997,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8006,15 +8024,15 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/app-configuration' resolution: - integrity: sha512-liLp6f/HT0e/HJ88aMP0U6ukqu9cxRx9651t0Vxr7VgQVzOfpQ85RxVXpJ9sHkm9xlLC4K5mO8odI6XgiFpCuQ== + integrity: sha512-1vA4+OmcUlUf3SeojOfIKrTeBH7ja1pu5cBEWgc0BvljwjUsTZsjJNw0cPYc9hs0Dyg1I5Zv98zEZVK2sLwpiA== tarball: file:projects/app-configuration.tgz version: 0.0.0 file:projects/attestation.tgz: @@ -8028,10 +8046,10 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 buffer: 5.7.1 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 jsrsasign: 10.1.13 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8055,19 +8073,18 @@ packages: rollup-plugin-node-resolve: 3.4.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 safe-buffer: 5.2.1 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 dev: false name: '@rush-temp/attestation' resolution: - integrity: sha512-k1TARgypt/PnQEnsNAjQ8pEXQVbKQ/l95LJ+GieOGVp638G9gbD9kE+filqznUA9mN2bVCeXs8CU/d2HB1Jmcw== + integrity: sha512-SazCe6W5MFh0qH9wbphB8GpN/z5KIqeuktcJ5BENwEqNCxau8DvwG/hszXdtf5ZM5aiot5IMTCR2pNUib0TMvg== tarball: file:projects/attestation.tgz version: 0.0.0 file:projects/communication-administration.tgz: dependencies: - '@azure/communication-common': 1.0.0-beta.6 '@azure/identity': 1.2.4 '@microsoft/api-documenter': 7.8.56 '@microsoft/api-extractor': 7.7.11 @@ -8082,10 +8099,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -8110,7 +8127,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8118,12 +8135,11 @@ packages: dev: false name: '@rush-temp/communication-administration' resolution: - integrity: sha512-+wz0kzoOjj0fSI4xQE1og61tZ15iLfWiV+tCUsknMfRdbqSo2gkOd2TE8k0PLF5JhUgUGHuiuT5lzBX5BZTQrg== + integrity: sha512-iyPzw0SEvuiMqXMxKE6DDJ758CT/cQ2ZIdBAFuu/jt6uvd+6Lr0cx2zM+xiqEXyd2ZekM6AwdWF8RtwVIBvBPg== tarball: file:projects/communication-administration.tgz version: 0.0.0 file:projects/communication-chat.tgz: dependencies: - '@azure/communication-common': 1.0.0-beta.6 '@azure/communication-identity': 1.0.0-beta.5 '@azure/communication-signaling': 1.0.0-beta.3 '@microsoft/api-extractor': 7.7.11 @@ -8138,10 +8154,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -8166,7 +8182,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8175,7 +8191,7 @@ packages: dev: false name: '@rush-temp/communication-chat' resolution: - integrity: sha512-+ZzAKbaK6pR11joOAy35MBjMOFm3y2O74VmZR1g/cTDnXH8z20EWBjPwsB8nqeaKQuIidlSyzJ9ugfk4ZxeSrQ== + integrity: sha512-vuWazAinRQ0cCL7PhGjZ1akW+c0PvzB/WM1JfrLgpe/A5OePugdE6M0niywt4PB49fhvEhfg4gbzG08doxmDsA== tarball: file:projects/communication-chat.tgz version: 0.0.0 file:projects/communication-common.tgz: @@ -8194,10 +8210,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 jwt-decode: 2.2.0 @@ -8220,7 +8236,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8234,7 +8250,6 @@ packages: version: 0.0.0 file:projects/communication-identity.tgz: dependencies: - '@azure/communication-common': 1.0.0-beta.6 '@azure/identity': 1.2.4 '@microsoft/api-documenter': 7.8.56 '@microsoft/api-extractor': 7.7.11 @@ -8249,10 +8264,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -8277,7 +8292,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8285,12 +8300,11 @@ packages: dev: false name: '@rush-temp/communication-identity' resolution: - integrity: sha512-W1tRVL0U8oEw648gMDGTKvNMYH56v9GwJTWMakBGwBd2vNkc0r2RMxScYgchUUCfLGP8E4FycmW/sR6MEo1U1g== + integrity: sha512-z/F3OQtwUIfIPXY9izwOILX7C2jm6C65t5jrvc5Lb8sWETyGZOtAJW+LBDrtFHe0Absp3dSLWuhdpQqVveYCSA== tarball: file:projects/communication-identity.tgz version: 0.0.0 file:projects/communication-phone-numbers.tgz: dependencies: - '@azure/communication-common': 1.0.0-beta.6 '@azure/identity': 1.2.4 '@microsoft/api-documenter': 7.8.56 '@microsoft/api-extractor': 7.7.11 @@ -8305,10 +8319,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -8333,7 +8347,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8341,12 +8355,11 @@ packages: dev: false name: '@rush-temp/communication-phone-numbers' resolution: - integrity: sha512-Oj9Ll87NbwbX0lxe65W8qSq7/2UhImQ1LBrV6knTh8cjQN9bQB0liGhVBAXdWBM96ruFnIoSy7jSt6KrqNfx1w== + integrity: sha512-AZ8a9kFJulAX3l5SMTAphMxaWj9IWAl/zMKYJBF5Fk/x0aLqLwKNdsEwto5SyG5PSmSzahDAbXGWNBW+a4bgBQ== tarball: file:projects/communication-phone-numbers.tgz version: 0.0.0 file:projects/communication-sms.tgz: dependencies: - '@azure/communication-common': 1.0.0-beta.6 '@azure/identity': 1.2.4 '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 @@ -8360,10 +8373,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -8386,7 +8399,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8395,7 +8408,7 @@ packages: dev: false name: '@rush-temp/communication-sms' resolution: - integrity: sha512-lw3KRP8qBREgl9SuUBSWWfQnSqjtMdhpZJ7REjtew3U/STXoljlF6gDgsWYuL7ItNrUrfVQNaieGqgMYQgSekQ== + integrity: sha512-D41yhZGKJ7lCkTUJ0k6XLTgoir3+7ySQZZ730khR3v0ligdLo0YbJxo/uYGl6mddJp0LY5u5byL4e9MxcMe9tg== tarball: file:projects/communication-sms.tgz version: 0.0.0 file:projects/container-registry.tgz: @@ -8407,11 +8420,11 @@ packages: '@types/chai-as-promised': 7.1.3 '@types/mocha': 7.0.2 '@types/node': 8.10.66 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8463,13 +8476,13 @@ packages: assert: 1.5.0 async-lock: 1.2.8 buffer: 5.7.1 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 debug: 4.3.1 dotenv: 8.2.0 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 is-buffer: 2.0.5 jssha: 3.2.0 @@ -8490,7 +8503,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -8500,13 +8513,13 @@ packages: dev: false name: '@rush-temp/core-amqp' resolution: - integrity: sha512-MrmJFRdhXmkbU7bZiLt0gQhD/m7DYxk2nmDxRnGi7gd0375OL0Ni9ckDe0E3eydDretw2kCHGLO5pS2CSUcw/g== + integrity: sha512-z7SqT63Ok/MydZ45TZXET7bBgZfErFUjfskGFEK6P6TnztNq+8ib3javWe4U1LGwcbHipEWZ3XTEm8pMjoWh/Q== tarball: file:projects/core-amqp.tgz version: 0.0.0 file:projects/core-asynciterator-polyfill.tgz: dependencies: '@types/node': 8.10.66 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 typedoc: 0.15.2 typescript: 4.2.3 @@ -8529,7 +8542,7 @@ packages: assert: 1.5.0 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 @@ -8538,7 +8551,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -8551,7 +8564,6 @@ packages: version: 0.0.0 file:projects/core-client.tgz: dependencies: - '@azure/core-rest-pipeline': 1.0.0-beta.2 '@azure/core-xml': 1.0.0-beta.1 '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 @@ -8564,10 +8576,10 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8587,7 +8599,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8612,10 +8624,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -8665,21 +8677,21 @@ packages: '@types/uuid': 8.3.0 '@types/xml2js': 0.4.8 babel-runtime: 6.26.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 express: 4.17.1 fetch-mock: 9.11.0_node-fetch@2.6.1 form-data: 3.0.1 glob: 7.1.6 karma: 6.2.0 - karma-chai: 0.1.0_chai@4.3.3+karma@6.2.0 + karma-chai: 0.1.0_chai@4.3.4+karma@6.2.0 karma-chrome-launcher: 3.1.0 karma-edge-launcher: 0.4.2_karma@6.2.0 karma-firefox-launcher: 1.3.0 karma-mocha: 2.0.1 - karma-rollup-preprocessor: 7.0.6_rollup@1.32.1 + karma-rollup-preprocessor: 7.0.7_rollup@1.32.1 karma-sourcemap-loader: 0.3.8 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 @@ -8693,23 +8705,23 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 shx: 0.3.3 sinon: 9.2.4 tough-cookie: 4.0.0 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 tunnel: 0.0.6 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 uuid: 8.3.2 xhr-mock: 2.5.1 xml2js: 0.4.23 dev: false name: '@rush-temp/core-http' resolution: - integrity: sha512-QbVpJUomxBwvIGDjZXwxEo2cTQUhiltjpcqtVmYhp12S0Q6k3ibqQR/+ftckcC5ONDYsQZ+hY5RObWVKOtNjyg== + integrity: sha512-8QeJfhWDxxUg1ZaSEam0vLS6uCHtocOiezojphkHnYG5YDM0f4xsALIJ92sVm85q5ZaBxinRaLn8CqEqN6KJdw== tarball: file:projects/core-http.tgz version: 0.0.0 file:projects/core-lro.tgz: @@ -8724,9 +8736,9 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8749,22 +8761,22 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 - ts-node: 8.10.2_typescript@4.2.3 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/core-lro' resolution: - integrity: sha512-FOomXdoxyLrZwgvSnsS5HMIVHc9qd71RNc3EFnblLNLBbPxdHVYMZQgrkwvjSgsZPStqcTf8Oic8fAlQFPyWZA== + integrity: sha512-MSHB1ALx87lU8u16Mocbl181meRWd6bRGL8VAM7aT613AxrhQzWc+TqtLngSGATHo5EMg5BwwS5T74OgFCrrzg== tarball: file:projects/core-lro.tgz version: 0.0.0 file:projects/core-paging.tgz: dependencies: '@types/node': 8.10.66 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rimraf: 3.0.2 typedoc: 0.15.2 @@ -8789,10 +8801,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 '@types/uuid': 8.3.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 form-data: 3.0.1 http-proxy-agent: 4.0.1 https-proxy-agent: 5.0.0 @@ -8815,7 +8827,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 tslib: 2.1.0 @@ -8844,7 +8856,7 @@ packages: '@types/sinon': 9.0.11 assert: 1.5.0 cross-env: 7.0.3 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 @@ -8853,7 +8865,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8877,10 +8889,10 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8900,7 +8912,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8925,10 +8937,10 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 '@types/xml2js': 0.4.8 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -8948,7 +8960,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -8982,14 +8994,14 @@ packages: debug: 4.3.1 dotenv: 8.2.0 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 execa: 3.4.0 fast-json-stable-stringify: 2.1.0 jsbi: 3.1.4 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 - node-abort-controller: 1.1.0 + node-abort-controller: 1.2.0 node-fetch: 2.6.1 prettier: 1.19.1 priorityqueuejs: 1.0.0 @@ -9002,7 +9014,7 @@ packages: sinon: 9.2.4 snap-shot-it: 7.9.6 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -9011,13 +9023,11 @@ packages: dev: false name: '@rush-temp/cosmos' resolution: - integrity: sha512-fU4hatTHbRMqlR/vZxEbfYGFHDTJMWJFoMRIAembPY8J5tMlRuWgeDJfJLhzr9toYtgZnSIJEcuSILo9D4gZ7A== + integrity: sha512-c6fyIXSKlKD115KDkLnklZRU87+Gv9xErWeGViv60Z1SAwkmqA/gLOL7l0tiaY50DwwsC5sZQqXOUAuatrhdlA== tarball: file:projects/cosmos.tgz version: 0.0.0 file:projects/data-tables.tgz: dependencies: - '@azure/core-client': 1.0.0-beta.2 - '@azure/core-rest-pipeline': 1.0.0-beta.2 '@azure/core-xml': 1.0.0-beta.1 '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 @@ -9032,11 +9042,11 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 '@types/uuid': 8.3.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -9058,9 +9068,9 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -9069,7 +9079,7 @@ packages: dev: false name: '@rush-temp/data-tables' resolution: - integrity: sha512-w5ULWdNfe1HCfDur8MK0Fl5/S/lopHxYA2x4SyXooY8thAptAdLyjwbJj7Un0fNWIDYFFuJ5rGR2Lhqyi+nBKQ== + integrity: sha512-jxKz4FUIGQbcjd1RL6J0FhZopzwX5UDaQZwDlwJptkzeMjYY8/P/6lIQ5+6fHWMMj6+cDgnFBxQjAYH4M7J7jg== tarball: file:projects/data-tables.tgz version: 0.0.0 file:projects/dev-tool.tgz: @@ -9087,10 +9097,11 @@ packages: '@types/node': 8.10.66 '@types/prettier': 2.0.2 builtin-modules: 3.1.0 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 chalk: 3.0.0 - eslint: 7.21.0 + dotenv: 8.2.0 + eslint: 7.22.0 fs-extra: 8.1.0 minimist: 1.2.5 mocha: 7.2.0 @@ -9098,14 +9109,16 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 - ts-node: 8.10.2_typescript@4.2.3 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 + ts-node: 9.1.1_typescript@4.2.3 + tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 + yaml: 1.10.2 dev: false name: '@rush-temp/dev-tool' resolution: - integrity: sha512-5RFe5cZvE8JynjK3XWVF0VMSClf8O2KnaP5qG8NZVK7p+Ddt8CynZGOtxB0t1TSp+MPx8sTUd+ZoUTWyEf1ZBQ== + integrity: sha512-MFQZmnuf8q7ZvEXEXDpNFFn2ZUBhNn7MPgAUg0etnL6Hu2RxL5eM1p74Qama+EfHkYJrwDvS8ZQGsWmRifK2pQ== tarball: file:projects/dev-tool.tgz version: 0.0.0 file:projects/digital-twins-core.tgz: @@ -9122,10 +9135,10 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -9149,7 +9162,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -9170,14 +9183,14 @@ packages: '@types/json-schema': 7.0.7 '@types/mocha': 7.0.2 '@types/node': 10.17.55 - '@typescript-eslint/eslint-plugin': 4.19.0_2a7f18f4779dbdda23f2fec22e20e2b6 - '@typescript-eslint/experimental-utils': 4.19.0_eslint@7.21.0+typescript@4.2.3 - '@typescript-eslint/parser': 4.19.0_eslint@7.21.0+typescript@4.2.3 + '@typescript-eslint/eslint-plugin': 4.19.0_f26dcf5ec38a04241b14c26bc931244e + '@typescript-eslint/experimental-utils': 4.19.0_eslint@7.22.0+typescript@4.2.3 + '@typescript-eslint/parser': 4.19.0_eslint@7.22.0+typescript@4.2.3 '@typescript-eslint/typescript-estree': 4.19.0_typescript@4.2.3 - chai: 4.3.3 - eslint: 7.21.0 - eslint-config-prettier: 7.2.0_eslint@7.21.0 - eslint-plugin-import: 2.22.1_eslint@7.21.0 + chai: 4.3.4 + eslint: 7.22.0 + eslint-config-prettier: 7.2.0_eslint@7.22.0 + eslint-plugin-import: 2.22.1_eslint@7.22.0 eslint-plugin-no-only-tests: 2.4.0 eslint-plugin-promise: 4.3.1 eslint-plugin-tsdoc: 0.2.11 @@ -9221,14 +9234,14 @@ packages: '@types/ws': 7.4.0 assert: 1.5.0 buffer: 5.7.1 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 - chai-string: 1.5.0_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + chai-string: 1.5.0_chai@4.3.4 cross-env: 7.0.3 debug: 4.3.1 dotenv: 8.2.0 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 https-proxy-agent: 5.0.0 is-buffer: 2.0.5 @@ -9258,7 +9271,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -9267,7 +9280,7 @@ packages: dev: false name: '@rush-temp/event-hubs' resolution: - integrity: sha512-na4fqgTqWsUWCjwqR7YtnD/FMrvzRLzPE6iJtvnnOq+tAqPUiAPyWOBdmzH0K4Il4stBSMlEd8+UdiHWQjufow== + integrity: sha512-y+pUU7wcfsa1Pbwlpd8CAy8/zcpLuXp9lUYxV7wXgy6lLb1aS2wEba/Qc0bawUSFdSO185tO8sU6o1rbAE2mjg== tarball: file:projects/event-hubs.tgz version: 0.0.0 file:projects/event-processor-host.tgz: @@ -9291,13 +9304,13 @@ packages: '@types/ws': 7.4.0 async-lock: 1.2.8 azure-storage: 2.10.3 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 - chai-string: 1.5.0_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + chai-string: 1.5.0_chai@4.3.4 cross-env: 7.0.3 debug: 4.3.1 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 https-proxy-agent: 5.0.0 mocha: 7.2.0 @@ -9308,7 +9321,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -9317,13 +9330,11 @@ packages: dev: false name: '@rush-temp/event-processor-host' resolution: - integrity: sha512-LPvk9yEyimWQgAXNKIVgcT8O90INeO8SaowpPy1agoiUTbkrkYemEUkYJbOWr8mnjP3mFq6CtIW0n5KtdT+hVw== + integrity: sha512-yShrxTmWGPufLf7C+gUIqFzc9Q2UHJ6Gc5eomvX3OMoFEyZxvAC3GWu9lyJMDeXZU89CJ7O4WvLhOre43ONRZQ== tarball: file:projects/event-processor-host.tgz version: 0.0.0 file:projects/eventgrid.tgz: dependencies: - '@azure/core-client': 1.0.0-beta.2 - '@azure/core-rest-pipeline': 1.0.0-beta.2 '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 @@ -9337,11 +9348,11 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 '@types/uuid': 8.3.0 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -9364,10 +9375,10 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -9375,7 +9386,7 @@ packages: dev: false name: '@rush-temp/eventgrid' resolution: - integrity: sha512-fCfPPsIZYzHiODZPXFB6sUjh0UaPtGLeEIM2f9+KZm1EETwxXz4mSIjkLeTU1/RuNL0f0x/605TIxSVdY5gC6Q== + integrity: sha512-eEMCru+C89qLacIFgkHKUlB6vtmKlSOck6kdndk7snU3i/BmO5izpNdiq30UdxcDNbpHh0wiT0XUDRgf38IinA== tarball: file:projects/eventgrid.tgz version: 0.0.0 file:projects/eventhubs-checkpointstore-blob.tgz: @@ -9394,13 +9405,13 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 assert: 1.5.0 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 - chai-string: 1.5.0_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + chai-string: 1.5.0_chai@4.3.4 cross-env: 7.0.3 debug: 4.3.1 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 events: 3.3.0 guid-typescript: 1.0.9 @@ -9425,8 +9436,8 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 - ts-node: 8.10.2_typescript@4.2.3 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -9434,13 +9445,13 @@ packages: dev: false name: '@rush-temp/eventhubs-checkpointstore-blob' resolution: - integrity: sha512-mEwM6b+65jIhnhFVZjpQ1pvVMdiC2v8L6qTr+dhfPcYXfxa/dbA/g3fcFM1zwglT1YbabIiWg8+L/n5D/sJN1Q== + integrity: sha512-HVGnI1U0A0SyBMpjRlQDZINX71Kaae+cfNmQRcgmRhnDtt0J4K5sUbUJRuSEUje7LX/cZrKB7JyYzH+U9bXmLQ== tarball: file:projects/eventhubs-checkpointstore-blob.tgz version: 0.0.0 file:projects/identity.tgz: dependencies: '@azure/msal-browser': 2.9.0 - '@azure/msal-common': 4.0.2 + '@azure/msal-common': 4.0.3 '@azure/msal-node': 1.0.1 '@azure/msal-node-extensions': 1.0.0-alpha.6 '@microsoft/api-extractor': 7.7.11 @@ -9458,10 +9469,9 @@ packages: '@types/stoppable': 1.1.0 '@types/uuid': 8.3.0 assert: 1.5.0 - axios: 0.21.1 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 jws: 4.0.0 @@ -9476,16 +9486,16 @@ packages: mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 mock-fs: 4.13.0 - msal: 1.4.6 + msal: 1.4.8 open: 7.4.2 prettier: 1.19.1 puppeteer: 3.3.0 - qs: 6.9.6 + qs: 6.10.1 rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 stoppable: 1.1.0 tslib: 2.1.0 @@ -9510,7 +9520,7 @@ packages: '@types/uuid': 8.3.0 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 mkdirp: 1.0.4 prettier: 1.19.1 rimraf: 3.0.2 @@ -9521,7 +9531,7 @@ packages: tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 uuid: 8.3.2 dev: false name: '@rush-temp/iot-device-update' @@ -9546,11 +9556,11 @@ packages: '@types/sinon': 9.0.11 '@types/uuid': 8.3.0 assert: 1.5.0 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 @@ -9561,7 +9571,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 tslib: 2.1.0 @@ -9590,10 +9600,10 @@ packages: '@types/query-string': 6.2.0 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -9619,7 +9629,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 tslib: 2.1.0 @@ -9635,7 +9645,7 @@ packages: file:projects/keyvault-common.tgz: dependencies: '@opentelemetry/api': 0.10.2 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rimraf: 3.0.2 tslib: 2.1.0 @@ -9663,11 +9673,11 @@ packages: '@types/query-string': 6.2.0 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -9693,7 +9703,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 tslib: 2.1.0 @@ -9722,10 +9732,10 @@ packages: '@types/query-string': 6.2.0 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -9751,7 +9761,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 tslib: 2.1.0 @@ -9776,11 +9786,11 @@ packages: '@types/node': 8.10.66 '@types/sinon': 9.0.11 assert: 1.5.0 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 delay: 4.4.1 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -9802,14 +9812,14 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 dev: false name: '@rush-temp/logger' resolution: - integrity: sha512-gfrlIZzW5k02WXvE12yG4yppLUDNIamPd2JoKlTbJOCrHnjVDOLUj6WoW8YdFlrzjp5pRNFy67p2xg5+u/PyDw== + integrity: sha512-SkIJX0/3mm4KHuQhl6O7ObJfULCR2PjCtmGN1R4oJvs9plCVjK7szoqsldgM5CQSZwI94t5S/d+8ckDQxr/4WQ== tarball: file:projects/logger.tgz version: 0.0.0 file:projects/mixedreality-authentication.tgz: @@ -9820,11 +9830,11 @@ packages: '@types/chai-as-promised': 7.1.3 '@types/mocha': 7.0.2 '@types/node': 8.10.66 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -9859,7 +9869,7 @@ packages: dependencies: '@types/node': 8.10.66 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rhea: 1.0.24 rimraf: 3.0.2 @@ -9881,8 +9891,8 @@ packages: '@opentelemetry/tracing': 0.17.0 '@types/mocha': 7.0.2 '@types/node': 10.17.55 - eslint: 7.21.0 - eslint-plugin-node: 11.1.0_eslint@7.21.0 + eslint: 7.22.0 + eslint-plugin-node: 11.1.0_eslint@7.22.0 execa: 3.4.0 mocha: 7.2.0 nock: 12.0.3 @@ -9891,14 +9901,14 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 dev: false name: '@rush-temp/monitor-opentelemetry-exporter' resolution: - integrity: sha512-ESgUSU/iUdWQTW2zFnX4RywbFvpMV0/9DHEiUbhhTSnbbwqWRzU+EZXouOOKLdx5nJntwCBadE9ZBLf4+kLlQw== + integrity: sha512-VwymU6Bc33z9Otnv/FEYSeP6wQwBrDF0/qLS9V7vMkulSlhOJbj2rGy5Uh1INa925qd2qvYr/OMvt5GpiK0waw== tarball: file:projects/monitor-opentelemetry-exporter.tgz version: 0.0.0 file:projects/perf-ai-text-analytics.tgz: @@ -9906,53 +9916,52 @@ packages: '@azure/identity': 1.2.4 '@types/node': 8.10.66 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typescript: 4.2.3 dev: false name: '@rush-temp/perf-ai-text-analytics' resolution: - integrity: sha512-MBZ9cSwFN7MYkURKdpAO01pysJ5W9dqy4+v+wRLaneU9h48eLhEN/JzF0vUc1T+U2JWSeaXwKsWJtnOS0Ksv4Q== + integrity: sha512-WRKlYq5E3/zAp5qMYA5yQagbJYlfuIUsxCBp+WSfENbW/m4WzpjkNC/01TLJ6tO2CEoLc+RRPXCDFpA30H432g== tarball: file:projects/perf-ai-text-analytics.tgz version: 0.0.0 file:projects/perf-eventgrid.tgz: dependencies: '@types/node': 8.10.66 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typescript: 4.2.3 dev: false name: '@rush-temp/perf-eventgrid' resolution: - integrity: sha512-Eq/Gi88kSUYM0M5/MPjQ1owr3BJDxNtYgsm16BomLMDMow+29NfwouF0wqvEzE7fDmbwgL00uVUJimw6+n7OYg== + integrity: sha512-IQoql5tEhOX/8VOIA+TIl95RGaqZpGF73Xho9DxQuJjcv1vpVKYUFh4tnWlsrFP3P4E64MbDFsVvCPd27mw3dQ== tarball: file:projects/perf-eventgrid.tgz version: 0.0.0 file:projects/perf-storage-blob.tgz: dependencies: - '@azure/core-rest-pipeline': 1.0.0-beta.2 '@types/node': 8.10.66 '@types/node-fetch': 2.5.8 '@types/uuid': 8.3.0 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 node-fetch: 2.6.1 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typescript: 4.2.3 uuid: 8.3.2 dev: false name: '@rush-temp/perf-storage-blob' resolution: - integrity: sha512-kd3MhpnXcMklGRyYsAHlRC6Y+SvKiHeLmIbMuBdephI93LyC6b2XgSF8Pbj7X6v4bz7EtsLeGMYtdUT1YRA8qQ== + integrity: sha512-CQP5Lrw+CR+EpibLFTir3/fZn3oIwh0UG1C9JsKtKkzfGaw0BO2V8vV5FoKCp4RwiEhbkvkHnu89DuBZMxZH7A== tarball: file:projects/perf-storage-blob.tgz version: 0.0.0 file:projects/perf-storage-file-datalake.tgz: @@ -9960,17 +9969,17 @@ packages: '@types/node': 8.10.66 '@types/uuid': 8.3.0 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typescript: 4.2.3 uuid: 8.3.2 dev: false name: '@rush-temp/perf-storage-file-datalake' resolution: - integrity: sha512-D6Esuv71iViCWWYFXhwcFo6F53l/9S22xVNmrlG2lYNcQE1sN4ZyGt/TqoKbLczAX6tVkQE+/bvJZJMtGC7w2A== + integrity: sha512-desRgzqog2aoFzH4xpp90a0NBZbUJ1eDUAgUQb3jaUiNOA3y0ER5mHOXFDQ8RuQ0Kjy6jbeNmZ8rcsmJ6OM1+w== tarball: file:projects/perf-storage-file-datalake.tgz version: 0.0.0 file:projects/perf-storage-file-share.tgz: @@ -9978,17 +9987,17 @@ packages: '@types/node': 8.10.66 '@types/uuid': 8.3.0 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typescript: 4.2.3 uuid: 8.3.2 dev: false name: '@rush-temp/perf-storage-file-share' resolution: - integrity: sha512-WBajfKF2jDceNHDe9KM2MbKHzzjvbzgfWA1xqk5ZhB9BEl9v/4nOis/X53X9ALqvjm10AsyvAVg1FK67M5pSjA== + integrity: sha512-mjYaV8s2WtZjhutOHaUUXmi2Ne5i+O/doHq+xoMo8aqmB50wVLSdyG52mRA3JITqy667rK95QQdjyzG6LflpOw== tarball: file:projects/perf-storage-file-share.tgz version: 0.0.0 file:projects/quantum-jobs.tgz: @@ -10005,10 +10014,10 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -10033,7 +10042,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 tslib: 2.1.0 typedoc: 0.15.2 @@ -10062,11 +10071,11 @@ packages: '@types/node': 8.10.66 avsc: 5.5.3 buffer: 5.7.1 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -10090,7 +10099,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 tslib: 2.1.0 typedoc: 0.15.2 @@ -10115,11 +10124,11 @@ packages: '@types/chai-as-promised': 7.1.3 '@types/mocha': 7.0.2 '@types/node': 8.10.66 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -10142,7 +10151,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 tslib: 2.1.0 typedoc: 0.15.2 @@ -10166,10 +10175,10 @@ packages: '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/sinon': 9.0.11 - chai: 4.3.3 + chai: 4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 events: 3.3.0 inherits: 2.0.4 karma: 6.2.0 @@ -10194,9 +10203,9 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10204,7 +10213,7 @@ packages: dev: false name: '@rush-temp/search-documents' resolution: - integrity: sha512-B9zjGNZi3/AQ95BgAelVhWnX2Rnv98/sadiGglDPURmB2R/gDp54owzhUL9h//eJJazOpkc6db5MsDbzbwn1NQ== + integrity: sha512-1rPzXPbAOl6PsZcAjh6SLMKF+F7YNus2F2ZH8biuJiVAi+QtdiVXWiNwHKxQ1OPQV0g0WjsEXjAHXGgig2xC1g== tarball: file:projects/search-documents.tgz version: 0.0.0 file:projects/service-bus.tgz: @@ -10230,15 +10239,15 @@ packages: '@types/ws': 7.4.0 assert: 1.5.0 buffer: 5.7.1 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 - chai-exclude: 2.0.2_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + chai-exclude: 2.0.2_chai@4.3.4 cross-env: 7.0.3 debug: 4.3.1 delay: 4.4.1 dotenv: 8.2.0 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 events: 3.3.0 glob: 7.1.6 @@ -10272,7 +10281,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10280,7 +10289,7 @@ packages: dev: false name: '@rush-temp/service-bus' resolution: - integrity: sha512-y4eWVR0aLbsTpR/2zOkmrY3uFx/RWWThlUQW5q+DnAgOmIXQPSbsgpFts5G6OB9PBnkj4cwOgEdcjFTMnR+EuQ== + integrity: sha512-Ecjku+11fP3LFQ8tEpEWY8WX7PzazJO404SRO229DlzQPT7cKW3ajUdI+5LOPXMVCeXcoVEVUP0UYgh6aYfKwg== tarball: file:projects/service-bus.tgz version: 0.0.0 file:projects/storage-blob-changefeed.tgz: @@ -10300,7 +10309,7 @@ packages: dotenv: 8.2.0 downlevel-dts: 0.4.0 es6-promise: 4.2.8 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 events: 3.3.0 inherits: 2.0.4 @@ -10327,10 +10336,10 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10338,12 +10347,11 @@ packages: dev: false name: '@rush-temp/storage-blob-changefeed' resolution: - integrity: sha512-yOMtBjyIcxJbULsAD/9ByNdTfA4aZvzvA8AYgA16dXKs20zaWfFp02h74hZCpYoCCurs4evrqFKUOZGhsY+DAg== + integrity: sha512-VYI7AZ4aHFJB+dmNZ1wvgzIC5TXrrFzqXrY7Fo6ujXN0zs1X6XDqVhNjMuzmuPR+1obhkE8AK9/MrZiUumL9EQ== tarball: file:projects/storage-blob-changefeed.tgz version: 0.0.0 file:projects/storage-blob.tgz: dependencies: - '@azure/core-rest-pipeline': 1.0.0-beta.2 '@azure/identity': 1.2.4 '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 @@ -10360,7 +10368,7 @@ packages: dotenv: 8.2.0 downlevel-dts: 0.4.0 es6-promise: 4.2.8 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 events: 3.3.0 inherits: 2.0.4 @@ -10388,9 +10396,9 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10398,7 +10406,7 @@ packages: dev: false name: '@rush-temp/storage-blob' resolution: - integrity: sha512-qt8Q6h/Z/lPTzoErnEFl+7CVaPeFjfeHLg2pk4zgpLPRcGPBXsOQp5fQ/3ZUYeckAnNKQ9JOA2efeDHDsQLfsw== + integrity: sha512-LdX8yTx4zjXDQP/tvmLumYImKKXx/qcu+F9rTjJD4X8/OZ3m0AavjiTMVMo4p6b5VIp/aly5YnY+ivNze9LXOQ== tarball: file:projects/storage-blob.tgz version: 0.0.0 file:projects/storage-file-datalake.tgz: @@ -10419,7 +10427,7 @@ packages: dotenv: 8.2.0 downlevel-dts: 0.4.0 es6-promise: 4.2.8 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 events: 3.3.0 execa: 3.4.0 @@ -10448,9 +10456,9 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10458,7 +10466,7 @@ packages: dev: false name: '@rush-temp/storage-file-datalake' resolution: - integrity: sha512-H28gKiOWP27CRz6Ce0aec9gHDSdWum0oCur5yNuqSXjX2JOE8Lht0WEdM5HGsJSTtgWhps94uyc9gXUW4bzeJA== + integrity: sha512-G9Jur2D/m4x840KpKA1bnoscFmyPHUV9ouqSkpddDZWHMlHVjabfpSdaDdybIHQCL5weOi4Mt+E9LHa+r9S5pQ== tarball: file:projects/storage-file-datalake.tgz version: 0.0.0 file:projects/storage-file-share.tgz: @@ -10476,7 +10484,7 @@ packages: dotenv: 8.2.0 downlevel-dts: 0.4.0 es6-promise: 4.2.8 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 events: 3.3.0 inherits: 2.0.4 @@ -10503,9 +10511,9 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10513,7 +10521,7 @@ packages: dev: false name: '@rush-temp/storage-file-share' resolution: - integrity: sha512-uwiF/ACYr8FzF+yfLFmpaMTi/RYMSIpzHP+j6zBMk42pPkssNrPxJSOdi7tr7S+PcLrGgrQ4hVNX//duDSud/w== + integrity: sha512-W1ajcailQav/LzdrfYq0u5Gm2Tmv0/ec9hnRhgFd8n5Mm+grNO+CXMJ/C/Y8NfE94wXVlgWXV51y2ZPJK/6jkA== tarball: file:projects/storage-file-share.tgz version: 0.0.0 file:projects/storage-internal-avro.tgz: @@ -10529,7 +10537,7 @@ packages: dotenv: 8.2.0 downlevel-dts: 0.4.0 es6-promise: 4.2.8 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 inherits: 2.0.4 karma: 6.2.0 @@ -10555,16 +10563,16 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typescript: 4.2.3 util: 0.12.3 dev: false name: '@rush-temp/storage-internal-avro' resolution: - integrity: sha512-bb1uNlpFqS2tT3s59q7U9iMxEM3d3eLAjGjUBuDRoqb5EyXV6VIg2bilmYztz4aGygpdDyyxX1oFpBEdvEmiKg== + integrity: sha512-76mOGWHDsIljnGxKC3fvW5sqTBSxEMxMnH1sqCgq5IUz/dfH8jdhTomWhcXZRQKMpMuL45bCfHHgc6QWc8anww== tarball: file:projects/storage-internal-avro.tgz version: 0.0.0 file:projects/storage-queue.tgz: @@ -10583,7 +10591,7 @@ packages: dotenv: 8.2.0 downlevel-dts: 0.4.0 es6-promise: 4.2.8 - eslint: 7.21.0 + eslint: 7.22.0 esm: 3.2.25 inherits: 2.0.4 karma: 6.2.0 @@ -10609,9 +10617,9 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 source-map-support: 0.5.19 - ts-node: 8.10.2_typescript@4.2.3 + ts-node: 9.1.1_typescript@4.2.3 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10619,7 +10627,7 @@ packages: dev: false name: '@rush-temp/storage-queue' resolution: - integrity: sha512-ZBc0gmT8VJ7KRRkobPt/FS72fbAtd9xjqCIZ51+rsZ19mPp0NDRr8pmCXvEyqOT96XJaYmOw19firrqwirNV+g== + integrity: sha512-THwIAiSCl29oavSf1OHWNyfJU/HpGnr2UHLzAZXozXfGG11Q76haPQRAcqzebXeJuEBU4uPFHgsEsKiXL+BAWQ== tarball: file:projects/storage-queue.tgz version: 0.0.0 file:projects/synapse-access-control.tgz: @@ -10627,7 +10635,7 @@ packages: '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - eslint: 7.21.0 + eslint: 7.22.0 rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-node-resolve: 3.4.0 @@ -10635,7 +10643,7 @@ packages: tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/synapse-access-control' resolution: @@ -10647,7 +10655,7 @@ packages: '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - eslint: 7.21.0 + eslint: 7.22.0 rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-node-resolve: 3.4.0 @@ -10655,7 +10663,7 @@ packages: tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/synapse-artifacts' resolution: @@ -10667,7 +10675,7 @@ packages: '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - eslint: 7.21.0 + eslint: 7.22.0 rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-node-resolve: 3.4.0 @@ -10675,7 +10683,7 @@ packages: tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/synapse-managed-private-endpoints' resolution: @@ -10687,7 +10695,7 @@ packages: '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - eslint: 7.21.0 + eslint: 7.22.0 rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-node-resolve: 3.4.0 @@ -10695,7 +10703,7 @@ packages: tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/synapse-monitoring' resolution: @@ -10707,7 +10715,7 @@ packages: '@microsoft/api-extractor': 7.7.11 '@opentelemetry/api': 0.10.2 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 - eslint: 7.21.0 + eslint: 7.22.0 rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-node-resolve: 3.4.0 @@ -10715,7 +10723,7 @@ packages: tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 - uglify-js: 3.13.0 + uglify-js: 3.13.2 dev: false name: '@rush-temp/synapse-spark' resolution: @@ -10731,12 +10739,13 @@ packages: '@types/chai-as-promised': 7.1.3 '@types/mocha': 7.0.2 '@types/node': 8.10.66 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 dotenv: 8.2.0 downlevel-dts: 0.4.0 - eslint: 7.21.0 + eslint: 7.22.0 + esm: 3.2.25 inherits: 2.0.4 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -10756,6 +10765,7 @@ packages: prettier: 1.19.1 rimraf: 3.0.2 rollup: 1.32.1 + source-map-support: 0.5.19 tslib: 2.1.0 typedoc: 0.15.2 typescript: 4.2.3 @@ -10763,7 +10773,7 @@ packages: dev: false name: '@rush-temp/template' resolution: - integrity: sha512-MrU8yuJnXACHzfIxM/HfZDm8f0WD7LgQYysX0J/OCKVK/bmBF27ILc7O2LzlRfK+P0K+U5HpdTWFAyvBHhJaxA== + integrity: sha512-lKQhDMJAbm63Hygwp0CpTeaF/vnmhcMV/3y3TVI52eWR/mGkK6D6ekeFoJmfYkeleLqDSpkDoYJcTPqg5WhpyQ== tarball: file:projects/template.tgz version: 0.0.0 file:projects/test-utils-multi-version.tgz: @@ -10772,9 +10782,9 @@ packages: '@types/chai': 4.2.15 '@types/mocha': 7.0.2 '@types/node': 8.10.66 - chai: 4.3.3 - chai-as-promised: 7.1.1_chai@4.3.3 - eslint: 7.21.0 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -10797,7 +10807,7 @@ packages: '@types/minimist': 1.2.1 '@types/node': 8.10.66 '@types/node-fetch': 2.5.8 - eslint: 7.21.0 + eslint: 7.22.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 @@ -10829,9 +10839,9 @@ packages: '@types/mock-require': 2.0.0 '@types/nise': 1.4.0 '@types/node': 8.10.66 - chai: 4.3.3 + chai: 4.3.4 dotenv: 8.2.0 - eslint: 7.21.0 + eslint: 7.22.0 fs-extra: 8.1.0 karma: 6.2.0 karma-chrome-launcher: 3.1.0 @@ -10861,7 +10871,7 @@ packages: rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 - rollup-plugin-visualizer: 4.2.0_rollup@1.32.1 + rollup-plugin-visualizer: 4.2.1_rollup@1.32.1 tslib: 2.1.0 typescript: 4.2.3 xhr-mock: 2.5.1 @@ -10880,7 +10890,7 @@ packages: async-lock: 1.2.8 death: 1.1.0 debug: 4.3.1 - eslint: 7.21.0 + eslint: 7.22.0 rhea: 1.0.24 rimraf: 3.0.2 tslib: 2.1.0 @@ -10893,7 +10903,6 @@ packages: integrity: sha512-qfEqZt22JDp6lEcpOXiMFtpxUSlNncnRkW9Oq1DCOWgLDMxBiHC1aqBA/csglDxhZ1v86t26+8SegRID9UZfrQ== tarball: file:projects/testhub.tgz version: 0.0.0 -registry: '' specifiers: '@rush-temp/abort-controller': file:./projects/abort-controller.tgz '@rush-temp/ai-anomaly-detector': file:./projects/ai-anomaly-detector.tgz diff --git a/common/tools/dev-tool/launch.js b/common/tools/dev-tool/launch.js index 908d0971110a..bae14a34dbe2 100755 --- a/common/tools/dev-tool/launch.js +++ b/common/tools/dev-tool/launch.js @@ -9,9 +9,6 @@ if (process.env.DEBUG) { console.info("Azure SDK for JS dev-tool: bootstrapping from", __dirname); } -// Shim to invoke true typescript source -require("ts-node").register({ - transpileOnly: true, - project: path.join(__dirname, "tsconfig.json") -}); +require("./register"); + require(path.join(__dirname, "src", "index.ts")); diff --git a/common/tools/dev-tool/package.json b/common/tools/dev-tool/package.json index c8a4abb287aa..87fffd47afb4 100644 --- a/common/tools/dev-tool/package.json +++ b/common/tools/dev-tool/package.json @@ -40,11 +40,14 @@ "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { "chalk": "~3.0.0", + "dotenv": "^8.2.0", "fs-extra": "^8.1.0", "minimist": "~1.2.5", "prettier": "^1.16.4", - "ts-node": "^8.3.0", - "typescript": "~4.2.0" + "ts-node": "^9.0.0", + "tslib": "^2.0.0", + "typescript": "~4.2.0", + "yaml": "~1.10.0" }, "devDependencies": { "@azure/eslint-plugin-azure-sdk": "^3.0.0", diff --git a/common/tools/dev-tool/register.d.ts b/common/tools/dev-tool/register.d.ts new file mode 100644 index 000000000000..105c9bb49136 --- /dev/null +++ b/common/tools/dev-tool/register.d.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation +// Licensed under the MIT license. + +// Required to allow importing this module within dev-tool +export default module; + diff --git a/common/tools/dev-tool/register.js b/common/tools/dev-tool/register.js new file mode 100644 index 000000000000..30baa8ecbfc6 --- /dev/null +++ b/common/tools/dev-tool/register.js @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * This file loads our monkey patch for module resolution in samples and + * tests. We use this to make sure that TS/ES loading is supported and that + * path-mapped imports work without rewriting them. + * + * As a forewarning to anyone who comes to this module and thinks: "Why can't + * we rewrite this in TypeScript," keep in mind that this module is used to + * bootstrap loading of typescript code at runtime within dev-tool. Rewriting + * this module in TypeScript is likely possible, but challenging. In plain + * old JavaScript, it is simple enough. + */ + +const path = require("path"); + +const ts = require("typescript"); + +const cwd = process.cwd(); + +// This is the calling module, which will be the node repl context. +const main = module.parent; + +// We need to know which package name to monkey patch +const { name: hostPackageName } = main.require("./package.json"); + +// If we're bootstrapping a dev-tool command, we need to patch the package from +// CWD instead. This will still end up being dev-tool if we end up in a +// self-hosting situation where dev-tool calls itself from its own scripts. +const packageNameToPatch = + hostPackageName === "@azure/dev-tool" + ? require(path.join(cwd, "package.json")).name + : hostPackageName; + +if (process.env.DEBUG) { + console.info( + "[dev-tool/register] patching module loader from:", + __dirname, + "; package:", + packageNameToPatch + ); +} + +require("dotenv").config(); + +/** + * The transformer we will use to handle imports of the host package. + * + * For example, if an @azure/template sample needs to import @azure/template, + * this transformer will handle rewriting the imports for us. + */ +const makeTransformers = () => ({ + before: [ + (transformationContext) => (sourceFile) => + ts.visitEachChild( + sourceFile, + (node) => { + // If the sample or test program is trying to import the host + // package, we'll rewrite it on the fly to make the import work. + if (ts.isImportDeclaration(node) && node.moduleSpecifier.text === packageNameToPatch) { + // rewrite the import to use a relative path + const oldName = node.moduleSpecifier.text; + const base = sourceFile.path.includes("dist-esm") ? path.join(cwd, "dist-esm") : cwd; + node.moduleSpecifier.text = path.relative( + // This is marked internal in the TS API, need to make sure there's not a better way + // to get the path from the sourceFile node + path.dirname(sourceFile.path), + path.join(base, "src", "index") + ); + console.log( + `[dev-tool/register] Rewrote import of "${oldName}" to "${node.moduleSpecifier.text}".` + ); + } + return node; + }, + transformationContext + ) + ] +}); + +require("ts-node").register({ + skipProject: true, + transpileOnly: true, + compilerOptions: { + ...require("../../../tsconfig.json").compilerOptions, + target: "es6", + module: "commonjs", + allowJs: true, + esModuleInterop: true, + paths: { + [packageNameToPatch]: ["./src/index"] + } + }, + transformers: makeTransformers() +}); diff --git a/common/tools/dev-tool/src/commands/samples/index.ts b/common/tools/dev-tool/src/commands/samples/index.ts index 5da429afee74..2dc2f1c0bb17 100644 --- a/common/tools/dev-tool/src/commands/samples/index.ts +++ b/common/tools/dev-tool/src/commands/samples/index.ts @@ -8,6 +8,7 @@ export const commandInfo = makeCommandInfo("samples", "manage samples in an SDK export default subCommand(commandInfo, { dev: () => import("./dev"), prep: () => import("./prep"), + publish: () => import("./publish"), run: () => import("./run"), "ts-to-js": () => import("./tsToJs"), "check-node-versions": () => import("./checkNodeVersions") diff --git a/common/tools/dev-tool/src/commands/samples/publish.ts b/common/tools/dev-tool/src/commands/samples/publish.ts new file mode 100644 index 000000000000..b70ad0e42be0 --- /dev/null +++ b/common/tools/dev-tool/src/commands/samples/publish.ts @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * This module is the core of the samples publication system. + * + * It handles collecting, checking, and processing all of the package's data + * that are eventually used to generate a coherent set of sample programs. + */ + +import fs from "fs-extra"; +import path from "path"; + +import nodeBuiltins from "builtin-modules"; +import ts from "typescript"; + +import { leafCommand, makeCommandInfo } from "../../framework/command"; +import { copy, dir, file, temp, FileTreeFactory } from "../../util/fileTree"; +import { createPrinter } from "../../util/printer"; +import { ProjectInfo, resolveProject } from "../../util/resolveProject"; +import { getSampleConfiguration, MIN_SUPPORTED_NODE_VERSION } from "../../util/sampleConfiguration"; +import { + AzSdkMetaTags, + AZSDK_META_TAG_PREFIX, + DEFAULT_TYPESCRIPT_CONFIG, + ModuleInfo, + OutputKind, + SampleGenerationInfo, + VALID_AZSDK_META_TAGS +} from "../../util/sampleGenerationInfo"; + +import instantiateSampleReadme from "../../templates/sampleReadme.md"; +import { convert } from "./tsToJs"; + +import devToolPackageJson from "../../../package.json"; + +const log = createPrinter("publish"); + +const DEV_SAMPLES_BASE = "samples-dev"; +const PUBLIC_SAMPLES_BASE = "samples"; + +export const commandInfo = makeCommandInfo( + "publish", + `make a "camera-ready" copy of a package's samples`, + { + "output-path": { + kind: "string", + description: "specify the path of the output directory where the samples will be written", + shortName: "o" + }, + force: { + kind: "boolean", + description: + "force writing of samples, even if the output directory is not empty (will delete everything in the output directory)", + shortName: "f", + default: false + }, + "override-major-version": { + kind: "string", + description: + "override the major version used for publication (ordinarily the version in package.json)" + } + } as const +); + +function createPackageJson(info: SampleGenerationInfo, outputKind: OutputKind): unknown { + const fullOutputKind = outputKind === OutputKind.TypeScript ? "TypeScript" : "JavaScript"; + return { + name: `azure-${info.baseName}-samples-${outputKind}`, + private: true, + version: "1.0.0", + description: `${info.productName} client library samples for ${fullOutputKind}`, + engine: { + node: `>=${MIN_SUPPORTED_NODE_VERSION}` + }, + ...(outputKind === OutputKind.TypeScript + ? { + // We only include these in TypeScript + scripts: { + build: "tsc", + prebuild: "rimraf dist/" + } + } + : {}), + repository: { + type: "git", + url: "git+https://github.com/Azure/azure-sdk-for-js.git", + directory: info.projectRepoPath + }, + keywords: info.packageKeywords, + 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/master/${info.projectRepoPath}`, + ...info.computeSampleDependencies(outputKind) + }; +} + +async function processSources( + projectInfo: ProjectInfo, + sources: string[], + fail: (...values: unknown[]) => never +): Promise { + const jobs = sources.map(async (source) => { + const sourceText = (await fs.readFile(source)).toString("utf8"); + + let summary: string | undefined = undefined; + + const importedModules: string[] = []; + const usedEnvironmentVariables: string[] = []; + const azSdkTags: AzSdkMetaTags = {}; + + const relativeSourcePath = path.relative(path.join(projectInfo.path, DEV_SAMPLES_BASE), source); + + const sourceProcessor: ts.TransformerFactory = (context) => ( + sourceFile: ts.SourceFile + ) => { + const visitor: ts.Visitor = (node: ts.Node) => { + if (ts.isImportDeclaration(node)) { + importedModules.push((node.moduleSpecifier as ts.StringLiteral).text); + } else if (ts.isImportEqualsDeclaration(node)) { + log.error( + `${relativeSourcePath}: unsupported \`import =\` declaration: \`${node.getText( + sourceFile + )}\`.` + ); + fail( + [ + "`import =` is not supported when targetting ECMAScript modules.", + "This dependency will NOT be included in your package's dependencies." + ].join(" ") + ); + } else if (ts.isCallExpression(node)) { + const { + expression, + arguments: [firstArgument] + } = node; + if ( + (ts.isIdentifier(expression) && expression.text === "require") || + expression.kind === ts.SyntaxKind.ImportKeyword + ) { + if (ts.isStringLiteralLike(firstArgument)) { + importedModules.push(firstArgument.text); + } else { + log.error( + `${relativeSourcePath}: unsupported dynamic import: \`${node.getText(sourceFile)}\`` + ); + fail( + "Dynamic imports (`import` expressions or `require` calls) cannot be statically analyzed." + ); + } + } + } else if ( + ts.isPropertyAccessExpression(node) || + (ts.isElementAccessExpression(node) && ts.isStringLiteral(node.argumentExpression)) + ) { + // Magic that finds out what environment variables you're using in the sources. + if (node.expression.getText(sourceFile) === "process.env") { + const value: string = ts.isElementAccessExpression(node) + ? (node.argumentExpression as ts.StringLiteral).text + : node.name.text; + + usedEnvironmentVariables.push(value); + } + } + const tags = ts.getJSDocTags(node); + + // Look for the @summary jsdoc tag block as well + if (summary === undefined && tags.some(({ tagName: { text } }) => text === "summary")) { + for (const tag of tags) { + if (tag.tagName.text === "summary") { + log.debug("Found summary tag on node:", node.getText(sourceFile)); + // Replace is required due to multi-line splitting messing with table formatting + summary = tag.comment?.replace(/\s*\n\s*/, " "); + } else if ( + tag.tagName.text.startsWith(`${AZSDK_META_TAG_PREFIX}`) && + tag.comment !== undefined + ) { + // We ran into an `azsdk` directive in the metadata + const metaTag = tag.tagName.text.replace( + new RegExp(`^${AZSDK_META_TAG_PREFIX}`), + "" + ) as keyof AzSdkMetaTags; + if (VALID_AZSDK_META_TAGS.includes(metaTag)) { + azSdkTags[metaTag as keyof AzSdkMetaTags] = JSON.parse(tag.comment); + } else { + log.warn( + `Invalid azsdk tag ${metaTag}. Valid tags include ${VALID_AZSDK_META_TAGS}` + ); + } + } + } + } + + ts.visitEachChild(node, visitor, context); + return node; + }; + + ts.visitNode(sourceFile, visitor); + return sourceFile; + }; + + return { + filePath: source, + relativeSourcePath, + text: sourceText, + jsModuleText: convert(sourceText, { + fileName: source, + transformers: { + before: [sourceProcessor] + } + }), + summary: summary ?? fail(`${relativeSourcePath} does not include an @summary tag.`), + importedModules: importedModules.filter((name) => !nodeBuiltins.includes(name)), + usedEnvironmentVariables, + azSdkTags + }; + }); + + return Promise.all(jobs); +} + +/** + * Extracts the sample generation metainformation from the sample sources and + * configuration in package.json. + * + * This is the function that assembles all the information that the templates + * use to generate good output. + */ +async function makeSampleGenerationInfo( + projectInfo: ProjectInfo, + topLevelDirectory: string, + onError: () => void +): Promise { + const sampleSourcesPath = path.join(projectInfo.path, DEV_SAMPLES_BASE); + const sampleSources = (await fs.readdir(sampleSourcesPath)) + .filter((name) => name.endsWith(".ts")) + .map((name) => path.join(sampleSourcesPath, name)); + + const sampleConfiguration = getSampleConfiguration(projectInfo.packageJson); + + const baseName = projectInfo.name.split("/").slice(-1)[0]; + + log.debug("Determined project baseName:", baseName); + + // A helper to handle configuration errors. + function fail(...values: unknown[]): never { + log.error(...values); + onError(); + return undefined as never; + } + + const moduleInfos = await processSources(projectInfo, sampleSources, fail); + + const defaultDependencies: Record = { + // If we are a beta package, use "next", otherwise we will use "latest" + [projectInfo.name]: projectInfo.version.includes("beta") ? "next" : "latest", + // We use this universally + dotenv: "latest" + }; + + const { packageJson } = projectInfo; + + if (!sampleConfiguration.productSlugs && !sampleConfiguration.disableDocsMs) { + log.error("No extra product slugs provided (`productSlugs` in the sample configuration)."); + log.warn( + "There is probably a more specific product that applies to this package! Reach out for help with the docs platform." + ); + log.warn( + 'If you do not want to publish samples to docs.microsoft.com, set `"disableDocsMs": true` in the sample configuration.' + ); + onError(); + } + + return { + ...sampleConfiguration, + baseName, + packageKeywords: + projectInfo.packageJson.keywords ?? + fail(`The package.json for ${projectInfo.name} does not specify "keywords".`), + projectRepoPath: + "sdk/" + + projectInfo.path + .split(path.sep + "sdk" + path.sep) + .slice(-1)[0] + .replace("\\", "/"), + // This'll be good enough most of the time, but products like Azure Form Recognizer will have + // too adjust using the sample configuration. + productName: + sampleConfiguration.productName ?? + fail(`The sample configuration does not specify a "productName".`), + apiRefLink: sampleConfiguration.apiRefLink, + sampleSourcesPath, + topLevelDirectory, + moduleInfos, + computeSampleDependencies(outputKind: OutputKind) { + return { + dependencies: moduleInfos.reduce((prev, source) => { + const current: Record = {}; + for (const dependency of source.importedModules) { + if (prev[dependency] === undefined) { + const dependencyVersion = + sampleConfiguration.dependencyOverrides?.[dependency] ?? + packageJson.devDependencies[dependency] ?? + packageJson.dependencies[dependency]; + if (dependencyVersion === undefined) { + log.error( + `Dependency "${dependency}", imported by ${source.filePath}, has an unknown version.` + ); + log.error( + "Specify a version for it by including it in the package's `devDependencies`." + ); + } + + current[dependency] = dependencyVersion; + } + } + return { + ...prev, + ...current + }; + }, defaultDependencies), + ...(outputKind === OutputKind.TypeScript + ? { + // In TypeScript samples, we include TypeScript and `rimraf`, because they're used + // in the package scripts. + devDependencies: { + typescript: devToolPackageJson.dependencies.typescript, + rimraf: "latest" + } + } + : {}) + }; + } + }; +} + +/** + * Calls the template to instantiate the sample README for this configuration + * and output kind. + */ +function createReadme(outputKind: OutputKind, info: SampleGenerationInfo): string { + const fullOutputKind = outputKind === OutputKind.TypeScript ? "typescript" : "javascript"; + + return instantiateSampleReadme({ + frontmatter: info.disableDocsMs + ? undefined + : { + page_type: "sample", + languages: [fullOutputKind], + products: info.productSlugs, + urlFragment: `${info.baseName}-${fullOutputKind}` + }, + publicationDirectory: PUBLIC_SAMPLES_BASE + "/" + info.topLevelDirectory, + useTypeScript: outputKind === OutputKind.TypeScript, + ...info + }); +} + +/** + * Create a filesystem tree factory representing a camera-ready samples + * tree. + * + * @param packageBasePath - the path to the SDK client package (where package.json resides) + * @param topLevelDirectory - the name of the top-level directory to create when instantiating the tree + * @param config - the SampleConfiguration to use during generation (ordinarily defined in package.json) + */ +async function makeSamplesFactory( + projectInfo: ProjectInfo, + topLevelDirectory: string +): Promise { + let hadError = false; + + const onError = () => { + hadError = true; + }; + + const info = await makeSampleGenerationInfo(projectInfo, topLevelDirectory, onError); + + if (hadError) { + throw new Error("Instantiation of sample metadata information failed with errors."); + } + + // Helper for writing JSON files with a terminating newline + const jsonify = (value: unknown) => { + let output = JSON.stringify(value, undefined, 2); + if (!output.endsWith("\n")) { + output += "\n"; + } + return output; + }; + + /** + * Helper to remove azsdk- directives from the resulting module code. + */ + function postProcess(moduleText: string | Buffer): string { + const content = Buffer.isBuffer(moduleText) ? moduleText.toString("utf8") : moduleText; + return content.replace(new RegExp(`^\\s*\\*\\s*@${AZSDK_META_TAG_PREFIX}.*\n`, "gm"), ""); + } + + // We use a tempdir at the outer layer to avoid creating dirty trees + return temp( + dir(topLevelDirectory, [ + dir("typescript", [ + file("README.md", () => createReadme(OutputKind.TypeScript, info)), + file("package.json", () => jsonify(createPackageJson(info, OutputKind.TypeScript))), + // All of the tsconfigs we use for samples should be the same. + file("tsconfig.json", () => jsonify(DEFAULT_TYPESCRIPT_CONFIG)), + copy("sample.env", path.join(projectInfo.path, "sample.env")), + // We copy the samples sources in to the `src` folder on the typescript side + dir( + "src", + info.moduleInfos.map(({ filePath }) => + file(path.basename(filePath), () => postProcess(fs.readFileSync(filePath))) + ) + ) + ]), + dir("javascript", [ + file("README.md", () => createReadme(OutputKind.JavaScript, info)), + file("package.json", () => jsonify(createPackageJson(info, OutputKind.JavaScript))), + copy("sample.env", path.join(projectInfo.path, "sample.env")), + // Extract the JS Module Text from the module info structures + ...info.moduleInfos.map(({ filePath, jsModuleText }) => + file(path.basename(filePath).replace(/\.ts$/, ".js"), () => postProcess(jsModuleText)) + ) + ]) + ]) + ); +} + +/** + * "Publishes" samples by creating copies of the existing samples sources that + * have the associated metadata used to publish samples. + */ +export default leafCommand(commandInfo, async (options) => { + const projectInfo = await resolveProject(process.cwd()); + + // This will become the name of the directory + const majorVersion = `v${options["override-major-version"] ?? projectInfo.version.split(".")[0]}`; + + log.info(`Creating camera-ready samples for ${projectInfo.name}@${projectInfo.version}`); + + const basePath = options["output-path"] ?? path.join(projectInfo.path, PUBLIC_SAMPLES_BASE); + + const outputDirectory = path.join(basePath, majorVersion); + + log.info("Using output path:", outputDirectory); + + // We'll do a few checks to make sure we don't blow up important files on accident. + if (await fs.pathExists(outputDirectory)) { + const stats = await fs.stat(outputDirectory); + if (!stats.isDirectory) { + log.error(`Output directory ${outputDirectory} exists and is a file.`); + log.error("Refusing to continue. Delete the file or specify a different output directory."); + return false; + } else if (!options.force) { + log.error( + `Output directory ${outputDirectory} exists. Pass --force to delete it and create the new directory anyway.` + ); + return false; + } else { + log.warn("Deleting existing samples directory:", outputDirectory); + await fs.remove(outputDirectory); + } + } + + // This creates the samples output + try { + // Gather sample metainformation and use it to assemble a template + await makeSamplesFactory(projectInfo, majorVersion).then((factory) => { + // This is where the actual magic of creating the output from the template happens + return factory(basePath); + }); + } catch (ex) { + log.error(ex.message); + return false; + } + + log.success("Created camera-ready samples at", outputDirectory); + + return true; +}); diff --git a/common/tools/dev-tool/src/commands/samples/run.ts b/common/tools/dev-tool/src/commands/samples/run.ts index 68a22ea21b52..2ec04bd149e4 100644 --- a/common/tools/dev-tool/src/commands/samples/run.ts +++ b/common/tools/dev-tool/src/commands/samples/run.ts @@ -8,14 +8,12 @@ import { findMatchingFiles } from "../../util/findMatchingFiles"; import { createPrinter } from "../../util/printer"; import { leafCommand, makeCommandInfo } from "../../framework/command"; import { resolveProject } from "../../util/resolveProject"; -import { SampleConfiguration } from "../../util/shouldSkip"; +import { getSampleConfiguration } from "../../util/sampleConfiguration"; const log = createPrinter("run-samples"); const IGNORE = ["node_modules"]; -const SAMPLE_CONFIGURATION_KEY = "//sampleConfiguration"; - export const commandInfo = makeCommandInfo( "run", "execute a sample or all samples within a directory" @@ -30,12 +28,12 @@ export const commandInfo = makeCommandInfo( async function runSingle(name: string, accumulatedErrors: Array<[string, string]>) { log("Running", name); try { - if (/.*[\\\/]samples[\\\/].*/.exec(name)) { + if (/.*[\\\/]samples(-dev)?[\\\/].*/.exec(name)) { // This is an un-prepared sample, so just require it and it will run. await import(name); } else if (!/.*[\\\/]dist-samples[\\\/].*/.exec(name)) { // This is not an unprepared or a prepared sample - log.warn("Executing a file that is neither in samples nor dist-samples."); + log.error("Skipped. This file is not in any samples folder."); } else { const { main: sampleMain } = await import(name); await sampleMain(); @@ -61,14 +59,19 @@ export default leafCommand(commandInfo, async (options) => { log.debug("Resolving samples metadata to:", packageLocation); - const sampleConfiguration = packageJson[SAMPLE_CONFIGURATION_KEY] as - | SampleConfiguration - | undefined; + const sampleConfiguration = getSampleConfiguration(packageJson); - const skips = sampleConfiguration?.skip ?? []; + const skips = sampleConfiguration.skip ?? []; log.debug("Skipping the following samples:", skips); + if (sampleConfiguration.skipFolder) { + log.warn( + "`skipFolder` is specified in the sample configuration, but it is ignored in this context." + ); + log.warn("To skip samples in live tests pipelines, disable them using the package's tests.yml"); + } + const samples = options.args.map((dir) => path.resolve(dir)); const errors: Array<[string, string]> = []; @@ -81,7 +84,7 @@ export default leafCommand(commandInfo, async (options) => { } else if (stats.isDirectory()) { for await (const fileName of findMatchingFiles( sample, - (name, entry) => entry.isFile() && name.endsWith(".js"), + (name, entry) => entry.isFile() && /\.[jt]s$/.exec(name) !== null, { ignore: IGNORE, skips diff --git a/common/tools/dev-tool/src/commands/samples/tsToJs.ts b/common/tools/dev-tool/src/commands/samples/tsToJs.ts index c9f0c9311ea3..b73317485e66 100644 --- a/common/tools/dev-tool/src/commands/samples/tsToJs.ts +++ b/common/tools/dev-tool/src/commands/samples/tsToJs.ts @@ -3,19 +3,27 @@ import fs from "fs-extra"; import path from "path"; +import { EOL } from "os"; import * as prettier from "prettier"; import ts from "typescript"; import { leafCommand, makeCommandInfo } from "../../framework/command"; +import untypedPrettierOptions from "@azure/eslint-plugin-azure-sdk/prettier.json"; + +import { createPrinter } from "../../util/printer"; + +const log = createPrinter("ts-to-js"); + export const commandInfo = makeCommandInfo( "ts-to-js", "convert a TypeScript sample to a JavaScript equivalent using our conventions for samples" ); - -import untypedPrettierOptions from "@azure/eslint-plugin-azure-sdk/prettier.json"; -const prettierOptions = untypedPrettierOptions as prettier.Options; +const prettierOptions: prettier.Options = { + ...(untypedPrettierOptions as prettier.Options), + parser: "typescript" +}; const compilerOptions: ts.CompilerOptions = { target: ts.ScriptTarget.ESNext, @@ -48,7 +56,7 @@ const REGEX_STACK: Array<[RegExp, string]> = [ /** * Handles the formatting of the resulting JS text. */ -function postTransform(outText: string, _inText: string): string { +function postTransform(outText: string): string { // Replace the sigils that we inserted let text = outText.split(NEWLINE_SIGIL_SEARCH).join("\n\n"); @@ -64,6 +72,52 @@ function postTransform(outText: string, _inText: string): string { return prettier.format(text, prettierOptions); } +/** + * A worker function that converts TypeScript source text to our standard + * JavaScript, preserving the newline structure of the input module. + * + * @param srcText - contents of a TypeScript module source to convert + * @param transpileOptions - optiona transpileOptions overrides (compilerOptions will be merged) + * @returns - an equivalent JavaScript module source + */ +export function convert(srcText: string, transpileOptions?: ts.TranspileOptions): string { + // TypeScript doesn't preserve newlines in compiled JS output, + // but we can pre-process each blank line by replacing it with a special + // sigil (in a comment, since TS preserves comments + const processedSrcText = srcText.split(/\n\s*\n/).join(NEWLINE_SIGIL); + + const extraCompilerOptions = transpileOptions?.compilerOptions; + + const extraTranspileOptions = { ...transpileOptions }; + delete transpileOptions?.compilerOptions; + + const output = ts.transpileModule(processedSrcText, { + compilerOptions: { + ...compilerOptions, + ...extraCompilerOptions + }, + ...extraTranspileOptions + }); + + if (output.diagnostics?.length) { + log.error("TypeScript to JavaScript transpilation emitted errors:"); + + const host: ts.FormatDiagnosticsHost = { + getNewLine: () => EOL, + getCanonicalFileName: (path) => path, + getCurrentDirectory: () => process.cwd() + }; + + for (const diagnostic of output.diagnostics) { + log(ts.formatDiagnostic(diagnostic, host)); + } + + log.warn("Continuing anyway."); + } + + return postTransform(output.outputText); +} + export default leafCommand(commandInfo, async (options) => { if (options.args.length !== 2) { throw new Error("Wrong number of arguments. Got " + options.args.length + " but expected 2."); @@ -73,18 +127,10 @@ export default leafCommand(commandInfo, async (options) => { const srcText = (await fs.readFile(src)).toString("utf-8"); - // TypeScript doesn't preserve newlines in compiled JS output, - // but we can pre-process each blank line by replacing it with a special - // sigil (in a comment, since TS preserves comments - const processedSrcText = srcText.split(/\n\s*\n/).join(NEWLINE_SIGIL); - - const output = ts.transpileModule(processedSrcText, { - compilerOptions, - fileName: src - }); + const outputText = convert(srcText, { fileName: src }); await fs.ensureDir(path.dirname(dest)); - await fs.writeFile(dest, postTransform(output.outputText, srcText)); + await fs.writeFile(dest, outputText); return true; }); diff --git a/common/tools/dev-tool/src/framework/command.ts b/common/tools/dev-tool/src/framework/command.ts index 0996eef7e8b9..a1e34a5dda50 100644 --- a/common/tools/dev-tool/src/framework/command.ts +++ b/common/tools/dev-tool/src/framework/command.ts @@ -104,9 +104,13 @@ export function subCommand>( const status = await commandModule.default(...commandArgs); if (!status) { - log.error("Errors occurred. See the output above."); + log.error(`Errors occurred in "${commandName}". See the output above.`); + process.exit(1); } - return status; + + // We used to bubble up status here, but now we exit if it's false + // to reduce the noise in the command output. + return true; } else { log.error("No such sub-command:", commandName); await printCommandUsage(info, commands, console.error); diff --git a/common/tools/dev-tool/src/templates/sampleReadme.md.ts b/common/tools/dev-tool/src/templates/sampleReadme.md.ts new file mode 100644 index 000000000000..c6c5de9afaec --- /dev/null +++ b/common/tools/dev-tool/src/templates/sampleReadme.md.ts @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft corporation. +// Licensed under the MIT license. + +import path from "path"; +import YAML from "yaml"; + +import prettier from "prettier"; + +import { MIN_SUPPORTED_NODE_VERSION } from "../util/sampleConfiguration"; +import { SampleReadmeConfiguration } from "../util/sampleGenerationInfo"; + +/** + * Renders the frontmatter of the sample README. + */ +function formatFrontmatter(frontmatter: unknown): string { + if (!frontmatter) return ""; + + return `\ +--- +${YAML.stringify(frontmatter, { indent: 2 })}\ +--- + +`; +} + +/** + * A helper for rendering code fences. (Useful because of the multi-line + * string literal using the same grave accent mark as its delimiter. + */ +function fence(language: string, ...contents: string[]): string { + return `\`\`\`${language}\n${contents.join("\n\n")}\n\`\`\``; +} + +/** + * Renders a sample file name into a simple linkable tag. + * + * Ex. recognizePii.ts -> recognizepii + */ +function sampleLinkTag(filePath: string): string { + return path + .basename(filePath) + .replace(/\.[a-z]*$/, "") + .replace(/\//, "_") + .toLowerCase(); +} + +/** + * Renders the sample file links. + */ +function fileLinks(info: SampleReadmeConfiguration) { + const packageSamplesPathFragment = [ + info.projectRepoPath, + info.publicationDirectory, + info.useTypeScript ? "typescript/src" : "javascript" + ].join("/"); + + return filterModules(info) + .map(({ filePath, relativeSourcePath }) => { + const sourcePath = info.useTypeScript + ? relativeSourcePath + : relativeSourcePath.replace(/\.ts$/, ".js"); + return `[${sampleLinkTag( + filePath + )}]: https://github.com/Azure/azure-sdk-for-js/blob/master/${packageSamplesPathFragment}/${sourcePath}`; + }) + .join("\n"); +} + +function resourceNameToLinkSlug(name: string) { + return `createinstance_${name.toLowerCase().replace(/\s+/g, "")}`; +} + +/** + * Renders the resource creation links. + */ +function resourceLinks(info: SampleReadmeConfiguration) { + const resources = Object.entries(info.requiredResources ?? {}); + + return resources.map(([name, link]) => `[${resourceNameToLinkSlug(name)}]: ${link}`).join("\n"); +} + +/** + * Renders the text describing and linking to the required Azure resources. + */ +function resources(info: SampleReadmeConfiguration) { + const resources = Object.entries(info.requiredResources ?? {}); + + const header = `You need [an Azure subscription][freesub] ${ + resources.length > 0 ? "and the following Azure resources " : "" + }to run these sample programs${resources.length > 0 ? ":\n\n" : "."}`; + + return ( + header + resources.map(([name]) => `- [${name}][${resourceNameToLinkSlug(name)}]`).join("\n") + ); +} + +/** + * Helper function for filtering the modules that are relevant to the sample README. + */ +function filterModules(info: SampleReadmeConfiguration): SampleReadmeConfiguration["moduleInfos"] { + // In JavaScript mode, we may have to skip a sample that specified "skip-javascript" + const modules = info.useTypeScript + ? info.moduleInfos + : info.moduleInfos.filter(({ azSdkTags: { "skip-javascript": skipJs } }) => !skipJs); + + return modules + .filter(({ azSdkTags: { ignore } }) => !ignore) + .sort((left, right) => { + // Descending order, default 0 + return (right.azSdkTags.weight ?? 0) - (left.azSdkTags.weight ?? 0); + }); +} + +/** + * Renders the sample file table. + */ +function table(info: SampleReadmeConfiguration) { + const contents = filterModules(info).map(({ filePath, summary, relativeSourcePath }) => { + const fileName = info.useTypeScript + ? relativeSourcePath + : relativeSourcePath.replace(/\.ts$/, ".js"); + return `| [${fileName}][${sampleLinkTag(filePath)}] | ${summary} |`; + }); + + return [ + "| **File Name** | **Description** |", + "| ------------- | --------------- |", + ...contents + ].join("\n"); +} + +/** + * Renders an example node invocation for the README. + */ +function exampleNodeInvocation(info: SampleReadmeConfiguration) { + const firstModule = filterModules(info)[0]; + const envVars = firstModule.usedEnvironmentVariables + .map((envVar) => `${envVar}="<${envVar.replace(/_/g, " ").toLowerCase()}>"`) + .join(" "); + + return `${envVars} node ${ + info.useTypeScript ? "dist/" : "" + }${firstModule.relativeSourcePath.replace(/\.ts$/, ".js")}`; +} + +/** + * Creates a README for a sample package from a SampleReadmeConfiguration. + */ +export default (info: SampleReadmeConfiguration) => { + let stepCount = 1; + const step = (content: string) => `${stepCount++}. ${content}`; + + const language = info.useTypeScript ? "TypeScript" : "JavaScript"; + + return prettier.format( + `${formatFrontmatter(info.frontmatter)}\ +# ${info.productName} client library samples for ${language} + +These sample programs show how to use the ${language} client libraries for ${ + info.productName + } in some common scenarios. + +${table(info)} + +## Prerequisites + +The sample programs are compatible with Node.js >=${MIN_SUPPORTED_NODE_VERSION}. + +${(() => { + if (info.useTypeScript) { + return [ + "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:", + "", + fence("bash", "npm install -g typescript"), + "" + ].join("\n"); + } else { + return ""; + } +})()}\ +${resources(info)} + +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: + +${step("Install the dependencies using `npm`:")} + +${fence("bash", "npm install")} +${(() => { + if (info.useTypeScript) { + return [step("Compile the samples:"), "", fence("bash", "npm run build"), ""].join("\n"); + } else { + return ""; + } +})()} +${step( + "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." +)} + +${step( + "Run whichever samples you like (note that some samples may require additional setup, see the table above):" +)} + +${fence( + "bash", + `node ${(() => { + const firstSource = filterModules(info)[0].relativeSourcePath; + const fileName = info.useTypeScript + ? "dist/" + firstSource + : firstSource.replace(/\.ts$/, ".js"); + return fileName; + })()}` +)} + +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): + +${fence("bash", `npx cross-env ${exampleNodeInvocation(info)}`)} + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +${fileLinks(info)} +[apiref]: ${info.apiRefLink ?? `https://docs.microsoft.com/javascript/api/@azure/${info.baseName}`} +[freesub]: https://azure.microsoft.com/free/ +${resourceLinks(info)} +[package]: https://github.com/Azure/azure-sdk-for-js/tree/master/${info.projectRepoPath}/README.md +${info.useTypeScript ? "[typescript]: https://www.typescriptlang.org/docs/home.html\n" : ""}\ +`, + { + parser: "markdown" + } + ); +}; diff --git a/common/tools/dev-tool/src/util/fileTree.ts b/common/tools/dev-tool/src/util/fileTree.ts new file mode 100644 index 000000000000..69d0181eb538 --- /dev/null +++ b/common/tools/dev-tool/src/util/fileTree.ts @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation +// Licensed under the MIT license. + +import fs from "fs-extra"; +import os from "os"; +import path from "path"; + +/** + * Provides a way to instantiate a file within a base path. + * + * Note that the factory is NOT guaranteed to run in one shot (i.e. it may fail + * partially and leave your directory in a dirty state). Please use the {@link + * `temp`} factory adapter to run a factory in a temporary directory and copy + * it to a destination directory for safety. + * + * @param basePath - the ABSOLUTE base path of the file tree + * @returns - a promise that will resolve if the instantiation is successful + * and reject otherwise. + */ +export type FileTreeFactory = (basePath: string) => Promise; + +function isAsyncIterable(it: Iterable | AsyncIterable): it is AsyncIterable { + return (it as AsyncIterable)[Symbol.asyncIterator] !== undefined; +} + +/** + * Runs a file tree factory in a temporary directory before copying it for + * safety. + * + * @param worker - the child factory to run in the temp directory + */ +export function temp(worker: FileTreeFactory): FileTreeFactory { + return async (basePath) => { + const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "devtool")); + await worker(tmp); + // Now copy and remove the temp + await fs.copy(tmp, basePath); + await fs.remove(tmp); + }; +} + +/** + * A file tree factory representing the creation of a directory named `name`, + * with contents specified by an (async) iterator of child file tree factories. + * + * @param name - the name of the directory to create + * @param contents - an Iterable or AsyncIterable of child factories to + * instantiate within the directory + * @returns - a factory for the directory + */ +export function dir( + name: string, + contents: Iterable | AsyncIterable +): FileTreeFactory { + return async (basePath) => { + // Create the directory for this model + const selfPath = path.join(basePath, name); + await fs.ensureDir(selfPath); + + if (isAsyncIterable(contents)) { + for await (const model of contents) { + await model(selfPath); + } + } else { + for (const model of contents) { + await model(selfPath); + } + } + }; +} + +/** + * A file tree factory that copies a file from a source. + * + * @param name - the name of the destination file (to create within the file + * tree) + * @param source - the path (absolute or relative to CWD) to the source file to + * copy + */ +export function copy(name: string, source: string): FileTreeFactory { + return (basePath) => fs.copy(source, path.join(basePath, name)); +} + +/** + * Contents of a file, represented as one of: + * + * - a `Buffer` of bytes to be written. + * - a string to be encoded as UTF-8 and written. + * - a deferred computation (function/thunk) that yields one of the above. + */ +export type FileContents = Buffer | string | (() => Buffer | string); + +/** + * A file tree factory that creates a file with the given contents. + * + * @param name - the name of the destination file + * @param contents - a `FileContents` representing the data to write + */ +export function file(name: string, contents: FileContents): FileTreeFactory { + const getContentsAsBuffer = (): Buffer => { + const immediateContents = typeof contents === "function" ? contents() : contents; + return Buffer.isBuffer(immediateContents) + ? immediateContents + : Buffer.from(immediateContents, "utf8"); + }; + + return async (basePath) => fs.writeFile(path.join(basePath, name), getContentsAsBuffer()); +} diff --git a/common/tools/dev-tool/src/util/findMatchingFiles.ts b/common/tools/dev-tool/src/util/findMatchingFiles.ts index caf191f4c74c..642caa887339 100644 --- a/common/tools/dev-tool/src/util/findMatchingFiles.ts +++ b/common/tools/dev-tool/src/util/findMatchingFiles.ts @@ -4,7 +4,7 @@ import fs from "fs-extra"; import path from "path"; import { createPrinter } from "./printer"; -import { shouldSkip } from "./shouldSkip"; +import { shouldSkip } from "./sampleConfiguration"; const { debug, info: logInfo } = createPrinter("find-matching-files"); diff --git a/common/tools/dev-tool/src/util/resolveProject.ts b/common/tools/dev-tool/src/util/resolveProject.ts index 71be20ebeb64..52cba4bcbb2f 100644 --- a/common/tools/dev-tool/src/util/resolveProject.ts +++ b/common/tools/dev-tool/src/util/resolveProject.ts @@ -8,8 +8,43 @@ import { createPrinter } from "./printer"; const { debug } = createPrinter("resolve-project"); -// eslint-disable-next-line @typescript-eslint/no-explicit-any -type PackageJson = any; +/** + * This is the base definition of PackageJson for our + * packages. Other modules in this project may extend + * this definition on their own by declaring an interface + * to merge with this one: + * + * ```typescript + * declare global { + * interface PackageJson { + * [MY_CUSTOM_PACKAGE_JSON_KEY]?: CustomType; + * } + * } + * ``` + */ +declare global { + interface PackageJson { + name: string; + version: string; + description: string; + bin?: Record; + files: string[]; + scripts: Record; + repository: string; + author: string; + keywords?: string[]; + license: string; + bugs: { + url: string; + }; + homepage: string; + sideEffects: boolean; + private: boolean; + + dependencies: Record; + devDependencies: Record; + } +} /** * Information about an Azure SDK for JS package @@ -89,6 +124,12 @@ export async function resolveProject(workingDirectory: string): Promise`. + */ + apiRefLink?: string; + /** + * Override sample dependency versions. These dependency versions will be + * preferred when publishing samples package.json files rather than the + * versions listed in the package's own dependencies or devDependencies. + */ + dependencyOverrides?: Record; + /** + * Specify Azure resources that must exist in order to run the samples. This + * object is a map from resource name (should be a noun, e.g. "Azure + * Cognitive Services instance") to URL providing documentation about how to + * instantiate that resource. You do not need to specify an "Azure + * Subscription" as a required resource, as this resource is _always_ + * included. + */ + requiredResources?: Record; +} + +export const SAMPLE_CONFIGURATION_KEY = "//sampleConfiguration"; + +declare global { + interface PackageJson { + /** + * The sample configuration for the package. + * + * Will be undefined for internal and non-client packages. + */ + [SAMPLE_CONFIGURATION_KEY]?: SampleConfiguration; + } +} + +export function getSampleConfiguration(packageJson: PackageJson): SampleConfiguration { + return packageJson[SAMPLE_CONFIGURATION_KEY] ?? {}; +} + +/** + * A helper function for removing ".js"/".ts" from the end of a string + */ +const removeJsTsExtensions = (name: string): string => name.replace(/\.[jt]s$/, ""); + +/** + * Determines whether or not a `skip` entry from the sample configuration + * should match a given sample `FileInfo`. + * + * A FileInfo is considered to be "skipped" if _any_ string in the `skips` + * matches the file according one of the following two rules, where a file + * extension of ".js"/".ts" is _always_ ignored in the file's name or full + * path, and a forward slash is _always_ added at the beginning of the skip + * string if it does not already exist: + * + * - the skip string does not contain a forward slash and the skip string is + * strictly equal to the file name + * - the file's full path ends with the entire skip string + * + * @param info - FileInfo of a sample file to be considered + * @param skips - a list of strings that identify files to be skipped + */ +export function shouldSkip(info: FileInfo, skips: string[]) { + // Add a slash to the skip if necessary + const addFirstSlash = (skip: string): string => (skip.startsWith("/") ? skip : "/" + skip); + + // Helper for testing against a single skip entry + const shouldSkipSingle = (skip: string): boolean => + removeJsTsExtensions(info.name) === skip || + removeJsTsExtensions(info.fullPath) === skip || + (skip.includes("/") && removeJsTsExtensions(info.fullPath).endsWith(addFirstSlash(skip))); + + return skips.map(removeJsTsExtensions).some((skip) => shouldSkipSingle(skip)); +} diff --git a/common/tools/dev-tool/src/util/sampleGenerationInfo.ts b/common/tools/dev-tool/src/util/sampleGenerationInfo.ts new file mode 100644 index 000000000000..3e05bba7495c --- /dev/null +++ b/common/tools/dev-tool/src/util/sampleGenerationInfo.ts @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation +// Licensed under the MIT license. + +/** + * This module contains some types and helper values related to information + * about generating samples. + */ + +import { SampleConfiguration } from "./sampleConfiguration"; + +/** + * Default TypeScript compiler configuration for sample projects. + */ +export const DEFAULT_TYPESCRIPT_CONFIG = { + compilerOptions: { + target: "ES6", + module: "commonjs", + moduleResolution: "node", + + esModuleInterop: true, + allowSyntheticDefaultImports: true, + + strict: true, + alwaysStrict: true, + + outDir: "dist", + rootDir: "src" + }, + include: ["src/**.ts"] +}; + +/** + * The type of samples to output, either: + * - "js" to output a plain JavaScript package, or + * - "ts" to output a TypeScript package + */ +export const enum OutputKind { + TypeScript = "ts", + JavaScript = "js" +} + +/** + * Information required for generating sample projects. + */ +export interface SampleGenerationInfo extends SampleConfiguration { + /** + * The base part of the package name. For example, the base part of "@azure/template" is "template". + */ + baseName: string; + /** + * The product name that should be used for prose rendering. For example, the product name for + * @azure/template is "Azure Template", and the product name for @azure/ai-text-analytics is + * "Azure Text Analytics". + */ + productName: string; + /** + * Optional link to the API reference. If not provided, one will be generated. + */ + apiRefLink?: string; + /** + * The path to the project in the azure-sdk-for-js repo. For example, the repo path for + * @azure/template is "sdk/template/template". This should _NOT_ include a leading slash. + */ + projectRepoPath: string; + /** + * The keywords associated with the project. For example ["azure", "cloud", "textanalytics", "typescript"]; + */ + packageKeywords: string[]; + /** + * The path to the sample source files + */ + sampleSourcesPath: string; + /** + * The top-level directory used for generating samples. + */ + topLevelDirectory: string; + /** + * Information about each of the sample sources, including their text in TypeScript and JavaScript, + * as well as their dependencies. + */ + moduleInfos: ModuleInfo[]; + /** + * A function for computing the dependencies to include in a sample package. + * + * @param outputKind - the kind of the samples, either "ts" for TypeScript or "js" for JavaScript + * @returns - an object with `dependencies` and `devDependencies` keys containing the samples' dependencies + */ + computeSampleDependencies( + outputKind: OutputKind + ): { + dependencies: Record; + devDependencies?: Record; + }; +} + +/** + * Information about a sample module (source file) + */ +export interface ModuleInfo { + /** + * The absolute path to the source. + */ + filePath: string; + /** + * The relative path to the source within the samples tree. + */ + relativeSourcePath: string; + /** + * The contents of the source file. + */ + text: string; + /** + * The transpiled JavaScript Module + */ + jsModuleText: string; + /** + * The description provided by the first doc comment. + */ + summary: string; + /** + * A list of module specifiers that are imported by this + * source file. + */ + importedModules: string[]; + /** + * A list of the environment variables that the source file uses. + * + * These are determined by analyzing the source code for syntactic forms + * like: + * + * `process.env.` and `process.env[]` + */ + usedEnvironmentVariables: string[]; + /** + * The contents of any `azsdk` JSDoc directives encountered in the module header. + * + * {@see AzSdkMetaTags} + */ + azSdkTags: AzSdkMetaTags; +} + +/** + * Information required to instantiate a sample README file. + */ +export interface SampleReadmeConfiguration extends SampleGenerationInfo { + /** + * YAML frontmatter used for publication on docs.microsoft.com. + */ + frontmatter: unknown; + /** + * Whether or not to add the TypeScript-specific bits. + */ + useTypeScript: boolean; + /** + * The camera-ready samples directory name + */ + publicationDirectory: string; +} + +// #region AZSDK Metadata JSDoc Tags + +/** + * Metainformation tags supported through `azsdk`-prefixed jsdoc tags. + * + * If you add a property to this type, then you should also add it to + * {@link VALID_AZSDK_META_TAGS}. + */ +export interface AzSdkMetaTags { + /** + * The weight of the sample when generating its entry in the table. + * + * Weighted entries are sorted in decreasing order, and unweighted entries + * are assigned a default value of zero. + * + * This field is used to control the ordering of samples, to force certain + * samples to appear first when they would ordinarily appear later in the + * table alphabetically. + */ + weight?: number; + /** + * Causes the sample file to be ignored entirely (will skip publication). + */ + ignore?: boolean; + /** + * Causes the sample file to skip JavaScript output. + */ + "skip-javascript"?: boolean; +} + +/** + * The prefix of an azsdk JSDoc metadata tag. + */ +export const AZSDK_META_TAG_PREFIX = "azsdk-"; + +/** + * An array of known metadata tags for validation. + * + * If you add a property to {@link AzSdkMetaTags}, then you should add it to + * the following array. + */ +export const VALID_AZSDK_META_TAGS: Array = [ + "weight", + "ignore", + "skip-javascript" +]; + +// #endregion diff --git a/common/tools/dev-tool/src/util/shouldSkip.ts b/common/tools/dev-tool/src/util/shouldSkip.ts deleted file mode 100644 index f1b9023d5edc..000000000000 --- a/common/tools/dev-tool/src/util/shouldSkip.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { FileInfo } from "./findMatchingFiles"; - -/** - * An interface for the sample configuration metadata within an Azure SDK for - * JavaScript package.json file - */ -export interface SampleConfiguration { - /** - * The names of sample files to skip (if a file extension is provided, it - * will be ignored) - */ - skip: string[]; -} - -/** - * A helper function for removing ".js"/".ts" from the end of a string - */ -const removeJsTsExtensions = (name: string): string => name.replace(/\.[jt]s$/, ""); - -/** - * Determines whether or not a `skip` entry from the sample configuration - * should match a given sample `FileInfo`. - * - * A FileInfo is considered to be "skipped" if _any_ string in the `skips` - * matches the file according one of the following two rules, where a file - * extension of ".js"/".ts" is _always_ ignored in the file's name or full - * path, and a forward slash is _always_ added at the beginning of the skip - * string if it does not already exist: - * - * - the skip string does not contain a forward slash and the skip string is - * strictly equal to the file name - * - the file's full path ends with the entire skip string - * - * @param info - FileInfo of a sample file to be considered - * @param skips - a list of strings that identify files to be skipped - */ -export function shouldSkip(info: FileInfo, skips: string[]) { - // Add a slash to the skip if necessary - const addFirstSlash = (skip: string): string => (skip.startsWith("/") ? skip : "/" + skip); - - // Helper for testing against a single skip entry - const shouldSkipSingle = (skip: string): boolean => - removeJsTsExtensions(info.name) === skip || - removeJsTsExtensions(info.fullPath) === skip || - (skip.includes("/") && removeJsTsExtensions(info.fullPath).endsWith(addFirstSlash(skip))); - - return skips.map(removeJsTsExtensions).some((skip) => shouldSkipSingle(skip)); -} diff --git a/common/tools/dev-tool/test/samples/skips.spec.ts b/common/tools/dev-tool/test/samples/skips.spec.ts index 57e880cb7578..671270fa6b2d 100644 --- a/common/tools/dev-tool/test/samples/skips.spec.ts +++ b/common/tools/dev-tool/test/samples/skips.spec.ts @@ -4,7 +4,7 @@ import { assert } from "chai"; import { FileInfo } from "../../src/util/findMatchingFiles"; -import { shouldSkip } from "../../src/util/shouldSkip"; +import { shouldSkip } from "../../src/util/sampleConfiguration"; import path from "path"; diff --git a/sdk/appconfiguration/app-configuration/package.json b/sdk/appconfiguration/app-configuration/package.json index bd0d76e20464..a2a74bd6712f 100644 --- a/sdk/appconfiguration/app-configuration/package.json +++ b/sdk/appconfiguration/app-configuration/package.json @@ -136,7 +136,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "cross-env": "^7.0.2", diff --git a/sdk/attestation/attestation/package.json b/sdk/attestation/attestation/package.json index db43cbfdc588..80566493cf90 100644 --- a/sdk/attestation/attestation/package.json +++ b/sdk/attestation/attestation/package.json @@ -63,7 +63,7 @@ "rollup-plugin-node-resolve": "^3.4.0", "rollup-plugin-sourcemaps": "^0.4.2", "safe-buffer": "^5.2.1", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "typedoc": "0.15.2" }, diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index c84666094555..31757ca7399c 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -115,7 +115,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "typedoc": "0.15.2" } diff --git a/sdk/core/core-amqp/package.json b/sdk/core/core-amqp/package.json index 066f24d9b7ab..f94a9872600d 100644 --- a/sdk/core/core-amqp/package.json +++ b/sdk/core/core-amqp/package.json @@ -124,7 +124,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "ws": "^7.1.1", "typedoc": "0.15.2" diff --git a/sdk/core/core-http/package.json b/sdk/core/core-http/package.json index 6d20f08f7f1e..b05d05982aae 100644 --- a/sdk/core/core-http/package.json +++ b/sdk/core/core-http/package.json @@ -191,7 +191,7 @@ "rollup-plugin-visualizer": "^4.0.4", "shx": "^0.3.2", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "xhr-mock": "^2.4.1", diff --git a/sdk/core/core-lro/package.json b/sdk/core/core-lro/package.json index e9e5557760ff..653c9a5488cb 100644 --- a/sdk/core/core-lro/package.json +++ b/sdk/core/core-lro/package.json @@ -137,7 +137,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "typedoc": "0.15.2" diff --git a/sdk/core/logger/package.json b/sdk/core/logger/package.json index 6a28b9d89f6f..d45ab260cd7b 100644 --- a/sdk/core/logger/package.json +++ b/sdk/core/logger/package.json @@ -111,7 +111,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "typedoc": "0.15.2" } diff --git a/sdk/cosmosdb/cosmos/package.json b/sdk/cosmosdb/cosmos/package.json index 2313ebf8e4f1..b233a8aed7ba 100644 --- a/sdk/cosmosdb/cosmos/package.json +++ b/sdk/cosmosdb/cosmos/package.json @@ -133,7 +133,7 @@ "sinon": "^9.0.2", "snap-shot-it": "^7.9.1", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typedoc": "0.15.2", "typescript": "~4.2.0" } diff --git a/sdk/eventgrid/eventgrid/package.json b/sdk/eventgrid/eventgrid/package.json index bda7ff8f85e6..fb825a68798a 100644 --- a/sdk/eventgrid/eventgrid/package.json +++ b/sdk/eventgrid/eventgrid/package.json @@ -133,7 +133,7 @@ "rollup-plugin-visualizer": "^4.0.4", "sinon": "^9.0.2", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "typedoc": "0.15.2" } diff --git a/sdk/eventgrid/perf-tests/eventgrid/package.json b/sdk/eventgrid/perf-tests/eventgrid/package.json index 539d81f0bc84..224834ec3d73 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/package.json +++ b/sdk/eventgrid/perf-tests/eventgrid/package.json @@ -17,7 +17,7 @@ "prettier": "^1.16.4", "rimraf": "^3.0.0", "tslib": "^2.0.0", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0" }, "private": true, diff --git a/sdk/eventhub/event-hubs/package.json b/sdk/eventhub/event-hubs/package.json index 43357c383cc8..b4e7d5705dcf 100644 --- a/sdk/eventhub/event-hubs/package.json +++ b/sdk/eventhub/event-hubs/package.json @@ -161,7 +161,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "ws": "^7.1.1", "typedoc": "0.15.2" diff --git a/sdk/eventhub/event-processor-host/package.json b/sdk/eventhub/event-processor-host/package.json index 148b46fc9026..7cbba2948a3b 100644 --- a/sdk/eventhub/event-processor-host/package.json +++ b/sdk/eventhub/event-processor-host/package.json @@ -118,7 +118,7 @@ "rimraf": "^3.0.0", "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "ws": "^7.1.1", "typedoc": "0.15.2" diff --git a/sdk/eventhub/eventhubs-checkpointstore-blob/package.json b/sdk/eventhub/eventhubs-checkpointstore-blob/package.json index 3dd7952cd951..bfbc66caae73 100644 --- a/sdk/eventhub/eventhubs-checkpointstore-blob/package.json +++ b/sdk/eventhub/eventhubs-checkpointstore-blob/package.json @@ -115,7 +115,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "util": "^0.12.1", "typedoc": "0.15.2" diff --git a/sdk/metricsadvisor/ai-metrics-advisor/package.json b/sdk/metricsadvisor/ai-metrics-advisor/package.json index 6439ff8d93f5..05a799960dfd 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/package.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/package.json @@ -121,7 +121,7 @@ "rimraf": "^3.0.0", "rollup": "^1.16.3", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "source-map-support": "^0.5.9", "typescript": "~4.2.0", "typedoc": "0.15.2" diff --git a/sdk/monitor/monitor-opentelemetry-exporter/package.json b/sdk/monitor/monitor-opentelemetry-exporter/package.json index 3943112cbdf1..ff6f8fb3ac96 100644 --- a/sdk/monitor/monitor-opentelemetry-exporter/package.json +++ b/sdk/monitor/monitor-opentelemetry-exporter/package.json @@ -80,7 +80,7 @@ "rimraf": "^3.0.0", "rollup": "^1.16.3", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "typedoc": "0.15.2" }, diff --git a/sdk/search/search-documents/package.json b/sdk/search/search-documents/package.json index 240ee9f52728..881299c20c37 100644 --- a/sdk/search/search-documents/package.json +++ b/sdk/search/search-documents/package.json @@ -127,7 +127,7 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "sinon": "^9.0.2", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "util": "^0.12.1", "typedoc": "0.15.2" diff --git a/sdk/servicebus/service-bus/package.json b/sdk/servicebus/service-bus/package.json index 6ccda2ea25f9..31eed082d0f8 100644 --- a/sdk/servicebus/service-bus/package.json +++ b/sdk/servicebus/service-bus/package.json @@ -169,7 +169,7 @@ "rollup-plugin-shim": "^1.0.0", "rollup-plugin-sourcemaps": "^0.4.2", "rollup-plugin-terser": "^5.1.1", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "ws": "^7.1.1", "sinon": "^9.0.2", diff --git a/sdk/storage/perf-tests/storage-blob/package.json b/sdk/storage/perf-tests/storage-blob/package.json index 740116b9709a..109cfa0453cf 100644 --- a/sdk/storage/perf-tests/storage-blob/package.json +++ b/sdk/storage/perf-tests/storage-blob/package.json @@ -23,7 +23,7 @@ "prettier": "^1.16.4", "rimraf": "^3.0.0", "tslib": "^2.0.0", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0" }, "private": true, diff --git a/sdk/storage/perf-tests/storage-file-datalake/package.json b/sdk/storage/perf-tests/storage-file-datalake/package.json index 87513535d389..365e14289c08 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/package.json +++ b/sdk/storage/perf-tests/storage-file-datalake/package.json @@ -19,7 +19,7 @@ "prettier": "^1.16.4", "rimraf": "^3.0.0", "tslib": "^2.0.0", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0" }, "private": true, diff --git a/sdk/storage/perf-tests/storage-file-share/package.json b/sdk/storage/perf-tests/storage-file-share/package.json index 9acd3696771e..388bdb20f76b 100644 --- a/sdk/storage/perf-tests/storage-file-share/package.json +++ b/sdk/storage/perf-tests/storage-file-share/package.json @@ -19,7 +19,7 @@ "prettier": "^1.16.4", "rimraf": "^3.0.0", "tslib": "^2.0.0", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0" }, "private": true, diff --git a/sdk/storage/storage-blob-changefeed/package.json b/sdk/storage/storage-blob-changefeed/package.json index 060322636e94..d3e3ef260525 100644 --- a/sdk/storage/storage-blob-changefeed/package.json +++ b/sdk/storage/storage-blob-changefeed/package.json @@ -151,11 +151,11 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", + "typedoc": "0.15.2", "typescript": "~4.2.0", "util": "^0.12.1", - "sinon": "^9.0.2", - "typedoc": "0.15.2" + "sinon": "^9.0.2" }, "//sampleConfiguration": { "skipFolder": true diff --git a/sdk/storage/storage-blob/package.json b/sdk/storage/storage-blob/package.json index 104490848f39..76c139fa4b2c 100644 --- a/sdk/storage/storage-blob/package.json +++ b/sdk/storage/storage-blob/package.json @@ -178,9 +178,9 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", - "util": "^0.12.1", - "typedoc": "0.15.2" + "typedoc": "0.15.2", + "util": "^0.12.1" } } diff --git a/sdk/storage/storage-file-datalake/package.json b/sdk/storage/storage-file-datalake/package.json index 325f4328d5d4..2c229670cb98 100644 --- a/sdk/storage/storage-file-datalake/package.json +++ b/sdk/storage/storage-file-datalake/package.json @@ -158,7 +158,7 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "util": "^0.12.1", "typedoc": "0.15.2" diff --git a/sdk/storage/storage-file-share/package.json b/sdk/storage/storage-file-share/package.json index 46c6f37451dd..dc470a9689b8 100644 --- a/sdk/storage/storage-file-share/package.json +++ b/sdk/storage/storage-file-share/package.json @@ -164,9 +164,9 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", + "typedoc": "0.15.2", "typescript": "~4.2.0", - "util": "^0.12.1", - "typedoc": "0.15.2" + "util": "^0.12.1" } } diff --git a/sdk/storage/storage-internal-avro/package.json b/sdk/storage/storage-internal-avro/package.json index 44f3edef003a..c09d7b5f84b3 100644 --- a/sdk/storage/storage-internal-avro/package.json +++ b/sdk/storage/storage-internal-avro/package.json @@ -110,7 +110,7 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", "util": "^0.12.1" } diff --git a/sdk/storage/storage-queue/package.json b/sdk/storage/storage-queue/package.json index 119817b50250..4f758b1ceb74 100644 --- a/sdk/storage/storage-queue/package.json +++ b/sdk/storage/storage-queue/package.json @@ -158,9 +158,9 @@ "rollup-plugin-terser": "^5.1.1", "rollup-plugin-visualizer": "^4.0.4", "source-map-support": "^0.5.9", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0", - "util": "^0.12.1", - "typedoc": "0.15.2" + "typedoc": "0.15.2", + "util": "^0.12.1" } } diff --git a/sdk/tables/data-tables/package.json b/sdk/tables/data-tables/package.json index 3d4709d3876f..1907e9e37d43 100644 --- a/sdk/tables/data-tables/package.json +++ b/sdk/tables/data-tables/package.json @@ -123,7 +123,7 @@ "@azure/test-utils-recorder": "^1.0.0", "rollup-plugin-shim": "^1.0.0", "@rollup/plugin-inject": "^4.0.0", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typedoc": "0.15.2" }, "//metadata": { diff --git a/sdk/template/template/package.json b/sdk/template/template/package.json index 41096bc8212e..9e4e369aecd3 100644 --- a/sdk/template/template/package.json +++ b/sdk/template/template/package.json @@ -31,16 +31,16 @@ "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", "build:nodebrowser": "rollup -c 2>&1", - "build:samples": "dev-tool samples prep && cd dist-samples && tsc -p .", + "build:samples": "echo Obsolete.", "build:test": "tsc -p . && rollup -c 2>&1", "build:types": "downlevel-dts types/latest types/3.1", "build": "tsc -p . && npm run build:nodebrowser && api-extractor run --local && npm run build:types", "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-* test-dist temp types *.tgz *.log", "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src", - "execute:samples": "npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/", + "execute:samples": "dev-tool samples run samples-dev", "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "generate:client": "autorest --typescript --v3 swagger", "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\"", @@ -104,6 +104,7 @@ "dotenv": "^8.2.0", "downlevel-dts": "~0.4.0", "eslint": "^7.15.0", + "esm": "^3.2.18", "inherits": "^2.0.3", "karma": "^6.2.0", "karma-chrome-launcher": "^3.0.0", @@ -123,11 +124,19 @@ "prettier": "^1.16.4", "rimraf": "^3.0.0", "rollup": "^1.16.3", + "source-map-support": "^0.5.9", "typedoc": "0.15.2", "typescript": "~4.2.0", "util": "^0.12.1" }, "//sampleConfiguration": { - "skipFolder": false + "skipFolder": false, + "disableDocsMs": true, + "productName": "Azure Template", + "productSlugs": [], + "apiRefLink": "https://docs.microsoft.com/javascript/api/", + "requiredResources": { + "Azure App Configuration": "https://docs.microsoft.com/azure/azure-app-configuration/" + } } } diff --git a/sdk/template/template/sample.env b/sdk/template/template/sample.env index 63d2520e7232..7ed36bca28c4 100644 --- a/sdk/template/template/sample.env +++ b/sdk/template/template/sample.env @@ -1,26 +1,7 @@ # Used in most samples. Retrieve these values from an instance in the Azure -# Portal. - -APPCONFIG_ENDPOINT: "https://.azconfig.io", - -# Used in the tests to indicate the key to use when retrieving a setting from -# the App Configuration and the expected value of that setting. +# Portal. The APPCONFIG_TEST_SETTING_KEY value indicates which key to use +# when retrieving an example setting. +APPCONFIG_ENDPOINT="https://.azconfig.io", APPCONFIG_TEST_SETTING_KEY="" -APPCONFIG_TEST_SETTING_EXPECTED_VALUE="" - -# Used to authenticate using Azure AD as a service principal for role-based -# authentication in the tokenAuth sample. -# -# See the documentation for `EnvironmentCredential` at the following link: -# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential - -AZURE_TENANT_ID="" -AZURE_CLIENT_ID="" -AZURE_CLIENT_SECRET="" - -# Our tests assume that TEST_MODE is "playback" by default. You can change it -# to "record" to generate new recordings, or "live" to bypass the recorder -# entirely. -# TEST_MODE="playback" diff --git a/sdk/template/template/samples/typescript/src/getConfigurationSetting.ts b/sdk/template/template/samples-dev/getConfigurationSetting.ts similarity index 88% rename from sdk/template/template/samples/typescript/src/getConfigurationSetting.ts rename to sdk/template/template/samples-dev/getConfigurationSetting.ts index 9c32cf8b46cc..c1a0a25c18a0 100644 --- a/sdk/template/template/samples/typescript/src/getConfigurationSetting.ts +++ b/sdk/template/template/samples-dev/getConfigurationSetting.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. /** - * Demonstrates the use of a ConfigurationClient to retrieve a setting value. + * @summary Demonstrates the use of a ConfigurationClient to retrieve a setting value. */ import { ConfigurationClient } from "@azure/template"; diff --git a/sdk/template/template/samples/javascript/sample.env b/sdk/template/template/samples/javascript/sample.env deleted file mode 100644 index c65006b76b34..000000000000 --- a/sdk/template/template/samples/javascript/sample.env +++ /dev/null @@ -1,10 +0,0 @@ -# Retrieve this value from an AppConfig instance in the Azure Portal. -ENDPOINT="Your Endpoint URL" - -# Used to authenticate using Azure AD as a service principal for role-based authentication -# -# See the documentation for `EnvironmentCredential` at the following link: -# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential -AZURE_TENANT_ID= -AZURE_CLIENT_ID= -AZURE_CLIENT_SECRET= diff --git a/sdk/template/template/samples/tsconfig.json b/sdk/template/template/samples/tsconfig.json deleted file mode 100644 index 0e83d1fd597c..000000000000 --- a/sdk/template/template/samples/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "typescript/dist", - "lib": ["ES6"] - }, - "include": ["typescript/src/**.ts"], - "exclude": ["typescript/*.json", "**/node_modules/", "../node_modules", "../typings"] -} diff --git a/sdk/template/template/samples/typescript/sample.env b/sdk/template/template/samples/typescript/sample.env deleted file mode 100644 index c65006b76b34..000000000000 --- a/sdk/template/template/samples/typescript/sample.env +++ /dev/null @@ -1,10 +0,0 @@ -# Retrieve this value from an AppConfig instance in the Azure Portal. -ENDPOINT="Your Endpoint URL" - -# Used to authenticate using Azure AD as a service principal for role-based authentication -# -# See the documentation for `EnvironmentCredential` at the following link: -# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential -AZURE_TENANT_ID= -AZURE_CLIENT_ID= -AZURE_CLIENT_SECRET= diff --git a/sdk/template/template/samples/javascript/README.md b/sdk/template/template/samples/v1/javascript/README.md similarity index 62% rename from sdk/template/template/samples/javascript/README.md rename to sdk/template/template/samples/v1/javascript/README.md index e44eee2f819a..0f60f04b60b6 100644 --- a/sdk/template/template/samples/javascript/README.md +++ b/sdk/template/template/samples/v1/javascript/README.md @@ -1,32 +1,3 @@ - - -## - # Azure Template client library samples for JavaScript These sample programs show how to use the JavaScript client libraries for Azure Template in some common scenarios. @@ -37,9 +8,13 @@ These sample programs show how to use the JavaScript client libraries for Azure ## Prerequisites -The samples are compatible with Node.js >= 8.0.0. +The sample programs are compatible with Node.js >=12.0.0. + +You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs: + +- [Azure App Configuration][createinstance_azureappconfiguration] -You need [an Azure subscription][freesub] to run these sample programs. Samples retrieve credentials to access the 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. +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]. @@ -61,17 +36,18 @@ npm install node getConfigurationSetting.js ``` -Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): +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="" API_KEY="" node getConfigurationSetting.js +npx cross-env APPCONFIG_ENDPOINT="" APPCONFIG_TEST_SETTING_KEY="" node getConfigurationSetting.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[getconfigurationsetting]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/template/template/samples/javascript/getConfigurationSetting.js -[apiref]: https://docs.microsoft.com/javascript/api +[getconfigurationsetting]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/template/template/samples/v1/javascript/getConfigurationSetting.js +[apiref]: https://docs.microsoft.com/javascript/api/ [freesub]: https://azure.microsoft.com/free/ +[createinstance_azureappconfiguration]: https://docs.microsoft.com/azure/azure-app-configuration/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template/README.md diff --git a/sdk/template/template/samples/javascript/getConfigurationSetting.js b/sdk/template/template/samples/v1/javascript/getConfigurationSetting.js similarity index 72% rename from sdk/template/template/samples/javascript/getConfigurationSetting.js rename to sdk/template/template/samples/v1/javascript/getConfigurationSetting.js index 3cd2c503a314..a5e6eadd1f39 100644 --- a/sdk/template/template/samples/javascript/getConfigurationSetting.js +++ b/sdk/template/template/samples/v1/javascript/getConfigurationSetting.js @@ -2,15 +2,15 @@ // Licensed under the MIT License. /** - * Demonstrates the use of a ConfigurationClient to retrieve a setting value. + * @summary Demonstrates the use of a ConfigurationClient to retrieve a setting value. */ const { ConfigurationClient } = require("@azure/template"); const { DefaultAzureCredential } = require("@azure/identity"); async function main() { - const endpoint = process.env.APPCONFIG_ENDPOINT || ""; - const key = process.env.APPCONFIG_TEST_SETTING_KEY || "test-key"; + const endpoint = process.env.APPCONFIG_ENDPOINT ?? ""; + const key = process.env.APPCONFIG_TEST_SETTING_KEY ?? "test-key"; const client = new ConfigurationClient(endpoint, new DefaultAzureCredential()); diff --git a/sdk/template/template/samples/javascript/package.json b/sdk/template/template/samples/v1/javascript/package.json similarity index 66% rename from sdk/template/template/samples/javascript/package.json rename to sdk/template/template/samples/v1/javascript/package.json index 0b17b289961e..af74504a330e 100644 --- a/sdk/template/template/samples/javascript/package.json +++ b/sdk/template/template/samples/v1/javascript/package.json @@ -1,10 +1,10 @@ { "name": "azure-template-samples-js", "private": true, - "version": "0.1.0", - "description": "Azure template client library samples for JavaScript", + "version": "1.0.0", + "description": "Azure Template client library samples for JavaScript", "engine": { - "node": ">=8.0.0" + "node": ">=12.0.0" }, "repository": { "type": "git", @@ -12,9 +12,9 @@ "directory": "sdk/template/template" }, "keywords": [ - "Azure", - "Node.js", - "JavaScript" + "azure", + "cloud", + "typescript" ], "author": "Microsoft Corporation", "license": "MIT", @@ -22,10 +22,9 @@ "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template", - "sideEffects": false, "dependencies": { - "@azure/template": "dev", - "@azure/identity": "latest", - "dotenv": "^8.2.0" + "@azure/template": "next", + "dotenv": "latest", + "@azure/identity": "^1.1.0" } } diff --git a/sdk/template/template/samples/v1/javascript/sample.env b/sdk/template/template/samples/v1/javascript/sample.env new file mode 100644 index 000000000000..7ed36bca28c4 --- /dev/null +++ b/sdk/template/template/samples/v1/javascript/sample.env @@ -0,0 +1,7 @@ +# Used in most samples. Retrieve these values from an instance in the Azure +# Portal. The APPCONFIG_TEST_SETTING_KEY value indicates which key to use +# when retrieving an example setting. + +APPCONFIG_ENDPOINT="https://.azconfig.io", +APPCONFIG_TEST_SETTING_KEY="" + diff --git a/sdk/template/template/samples/typescript/README.md b/sdk/template/template/samples/v1/typescript/README.md similarity index 64% rename from sdk/template/template/samples/typescript/README.md rename to sdk/template/template/samples/v1/typescript/README.md index 58f05e5082cf..7e55511d4435 100644 --- a/sdk/template/template/samples/typescript/README.md +++ b/sdk/template/template/samples/v1/typescript/README.md @@ -1,30 +1,3 @@ - - -## - # Azure Template client library samples for TypeScript These sample programs show how to use the TypeScript client libraries for Azure Template in some common scenarios. @@ -35,15 +8,19 @@ These sample programs show how to use the TypeScript client libraries for Azure ## Prerequisites -The samples are compatible with Node.js >= 8.0.0. +The sample programs are compatible with Node.js >=12.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 +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] to run these sample programs. Samples retrieve credentials to access the 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. +You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs: + +- [Azure App Configuration][createinstance_azureappconfiguration] + +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]. @@ -57,7 +34,7 @@ To run the samples using the published version of the package: npm install ``` -2. Compile the samples +2. Compile the samples: ```bash npm run build @@ -68,21 +45,22 @@ npm run build 4. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node dist/getConfigurationSetting.js +node dist/getConfigurationSetting.ts ``` -Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): +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="" API_KEY="" node dist/getConfigurationSetting.js +npx cross-env APPCONFIG_ENDPOINT="" APPCONFIG_TEST_SETTING_KEY="" node dist/getConfigurationSetting.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[getconfigurationsetting]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template/samples/typescript/src/getConfigurationSetting.ts -[apiref]: https://docs.microsoft.com/javascript/api +[getconfigurationsetting]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/template/template/samples/v1/typescript/src/getConfigurationSetting.ts +[apiref]: https://docs.microsoft.com/javascript/api/ [freesub]: https://azure.microsoft.com/free/ +[createinstance_azureappconfiguration]: https://docs.microsoft.com/azure/azure-app-configuration/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template/README.md [typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/template/template/samples/typescript/package.json b/sdk/template/template/samples/v1/typescript/package.json similarity index 64% rename from sdk/template/template/samples/typescript/package.json rename to sdk/template/template/samples/v1/typescript/package.json index 0f91bc48b94b..839bf6a27859 100644 --- a/sdk/template/template/samples/typescript/package.json +++ b/sdk/template/template/samples/v1/typescript/package.json @@ -1,10 +1,10 @@ { "name": "azure-template-samples-ts", "private": true, - "version": "0.1.0", - "description": "Azure template client library samples for TypeScript", + "version": "1.0.0", + "description": "Azure Template client library samples for TypeScript", "engine": { - "node": ">=8.0.0" + "node": ">=12.0.0" }, "scripts": { "build": "tsc", @@ -16,9 +16,9 @@ "directory": "sdk/template/template" }, "keywords": [ - "Azure", - "Node.js", - "TypeScript" + "azure", + "cloud", + "typescript" ], "author": "Microsoft Corporation", "license": "MIT", @@ -26,15 +26,13 @@ "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template", - "sideEffects": false, "dependencies": { - "@azure/template": "dev", - "@azure/identity": "latest", - "dotenv": "^8.2.0" + "@azure/template": "next", + "dotenv": "latest", + "@azure/identity": "^1.1.0" }, "devDependencies": { - "@types/node": "^8.0.0", - "rimraf": "^3.0.0", - "typescript": "~3.6.4" + "typescript": "~4.1.2", + "rimraf": "latest" } } diff --git a/sdk/template/template/samples/v1/typescript/sample.env b/sdk/template/template/samples/v1/typescript/sample.env new file mode 100644 index 000000000000..7ed36bca28c4 --- /dev/null +++ b/sdk/template/template/samples/v1/typescript/sample.env @@ -0,0 +1,7 @@ +# Used in most samples. Retrieve these values from an instance in the Azure +# Portal. The APPCONFIG_TEST_SETTING_KEY value indicates which key to use +# when retrieving an example setting. + +APPCONFIG_ENDPOINT="https://.azconfig.io", +APPCONFIG_TEST_SETTING_KEY="" + diff --git a/sdk/template/template/samples/v1/typescript/src/getConfigurationSetting.ts b/sdk/template/template/samples/v1/typescript/src/getConfigurationSetting.ts new file mode 100644 index 000000000000..c1a0a25c18a0 --- /dev/null +++ b/sdk/template/template/samples/v1/typescript/src/getConfigurationSetting.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates the use of a ConfigurationClient to retrieve a setting value. + */ + +import { ConfigurationClient } from "@azure/template"; +import { DefaultAzureCredential } from "@azure/identity"; + +export async function main() { + const endpoint = process.env.APPCONFIG_ENDPOINT ?? ""; + const key = process.env.APPCONFIG_TEST_SETTING_KEY ?? "test-key"; + + const client = new ConfigurationClient(endpoint, new DefaultAzureCredential()); + + const setting = await client.getConfigurationSetting(key); + + console.log("The setting has a value of:", setting.value); + console.log("Details:", setting); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/tsconfig.json b/sdk/template/template/samples/v1/typescript/tsconfig.json similarity index 79% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/tsconfig.json rename to sdk/template/template/samples/v1/typescript/tsconfig.json index 0832d0d715d3..30f88da73e00 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/tsconfig.json +++ b/sdk/template/template/samples/v1/typescript/tsconfig.json @@ -1,18 +1,14 @@ { "compilerOptions": { + "target": "ES6", "module": "commonjs", "moduleResolution": "node", - + "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "strict": true, "alwaysStrict": true, - - "target": "ES6", - "outDir": "dist", "rootDir": "src" }, - "include": ["src/**.ts"], - "exclude": ["node_modules"] + "include": ["src/**.ts"] } diff --git a/sdk/template/template/test.env b/sdk/template/template/test.env new file mode 100644 index 000000000000..8e507716433d --- /dev/null +++ b/sdk/template/template/test.env @@ -0,0 +1,26 @@ +# Used in most samples. Retrieve these values from an instance in the Azure +# Portal. + +APPCONFIG_ENDPOINT="https://.azconfig.io", + +# Used in the tests to indicate the key to use when retrieving a setting from +# the App Configuration and the expected value of that setting. + +APPCONFIG_TEST_SETTING_KEY="" +APPCONFIG_TEST_SETTING_EXPECTED_VALUE="" + +# Used to authenticate using Azure AD as a service principal for role-based +# authentication in the tokenAuth sample. +# +# See the documentation for `EnvironmentCredential` at the following link: +# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential + +AZURE_TENANT_ID="" +AZURE_CLIENT_ID="" +AZURE_CLIENT_SECRET="" + +# Our tests assume that TEST_MODE is "playback" by default. You can change it +# to "record" to generate new recordings, or "live" to bypass the recorder +# entirely. + +# TEST_MODE="playback" diff --git a/sdk/template/template/tsconfig.json b/sdk/template/template/tsconfig.json index 9784ff1f1ed3..3270f39ba148 100644 --- a/sdk/template/template/tsconfig.json +++ b/sdk/template/template/tsconfig.json @@ -2,16 +2,10 @@ "extends": "../../../tsconfig.package", "compilerOptions": { "outDir": "./dist-esm", - "declarationDir": "./types" + "declarationDir": "./types", + "paths": { + "@azure/template": ["./src/index"] + } }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-samples", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"] } diff --git a/sdk/textanalytics/ai-text-analytics/README.md b/sdk/textanalytics/ai-text-analytics/README.md index 2095aff0f41e..59e0f6ebd97c 100644 --- a/sdk/textanalytics/ai-text-analytics/README.md +++ b/sdk/textanalytics/ai-text-analytics/README.md @@ -542,4 +542,4 @@ If you'd like to contribute to this library, please read the [contributing guide [register_aad_app]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/identity/identity#defaultazurecredential [data_limits]: https://docs.microsoft.com/azure/cognitive-services/text-analytics/overview#data-limits -[analyze_sentiment_opinion_mining_sample]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentimentWithOpinionMining.ts +[analyze_sentiment_opinion_mining_sample]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentimentWithOpinionMining.ts diff --git a/sdk/textanalytics/ai-text-analytics/package.json b/sdk/textanalytics/ai-text-analytics/package.json index 9b8f2577f6d7..163a18519892 100644 --- a/sdk/textanalytics/ai-text-analytics/package.json +++ b/sdk/textanalytics/ai-text-analytics/package.json @@ -44,7 +44,15 @@ "node": ">=8.0.0" }, "//sampleConfiguration": { - "skipFolder": false + "productName": "Azure Text Analytics", + "productSlugs": [ + "azure", + "azure-cognitive-services", + "azure-text-analytics" + ], + "requiredResources": { + "Azure Cognitive Services instance": "https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account" + } }, "browser": { "./dist-esm/src/utils/url.js": "./dist-esm/src/utils/url.browser.js", @@ -54,16 +62,15 @@ "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 . && cross-env ONLY_BROWSER=true rollup -c 2>&1", "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", - "build:samples": "dev-tool samples prep && cd dist-samples && tsc -p .", + "build:samples": "echo Obsolete.", "build:test": "tsc -p . && rollup -c 2>&1", "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", "build:debug": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "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": "npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/", - "execute:sample": "npm run build:samples && dev-tool samples run", + "execute:samples": "dev-tool samples run samples-dev", "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "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", @@ -123,6 +130,7 @@ "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", "karma-sourcemap-loader": "^0.3.8", + "karma-source-map-support": "~1.4.0", "mocha": "^7.1.1", "mocha-junit-reporter": "^1.18.0", "nyc": "^14.0.0", @@ -131,9 +139,8 @@ "rollup": "^1.16.3", "sinon": "^9.0.2", "source-map-support": "^0.5.9", + "ts-node": "^9.0.0", "typescript": "~4.2.0", - "ts-node": "^8.3.0", - "karma-source-map-support": "~1.4.0", "typedoc": "0.15.2" } } diff --git a/sdk/textanalytics/ai-text-analytics/sample.env b/sdk/textanalytics/ai-text-analytics/sample.env index 846bc75c2286..614cea7d231b 100644 --- a/sdk/textanalytics/ai-text-analytics/sample.env +++ b/sdk/textanalytics/ai-text-analytics/sample.env @@ -1,10 +1,10 @@ -# Used in most samples. Retrieve these values from a Cognitive Services instance -# in the Azure Portal. +# Used to authenticate with the Azure Text Analytics service. Retrieve these +# values from a Cognitive Services instance in the Azure Portal. ENDPOINT="https://.cognitiveservies.azure.com/" TEXT_ANALYTICS_API_KEY="" -# Used to authenticate using Azure AD as a service principal for role-based authentication -# in the tokenAuth sample. +# Used to authenticate using Azure AD as a service principal for role-based +# authentication. # # See the documentation for `EnvironmentCredential` at the following link: # https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential @@ -12,6 +12,3 @@ AZURE_TENANT_ID= AZURE_CLIENT_ID= AZURE_CLIENT_SECRET= -# Our tests assume that TEST_MODE is "playback" by default. You can -# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. -# TEST_MODE=playback \ No newline at end of file diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/alternativeDocumentInput.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/alternativeDocumentInput.ts new file mode 100644 index 000000000000..b940470cbf7d --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/alternativeDocumentInput.ts @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample demonstrates how to use objects with additional metadata as + * inputs to the Text Analytics service as an alternative to passing arrays of + * simple strings in the client methods. + * + * @summary uses objects with attached metadata instead of simple strings as + * inputs for flexibility + * @azsdk-weight 40 + */ + +import { + TextAnalyticsClient, + AzureKeyCredential, + DetectLanguageInput, + TextDocumentInput +} from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +/** + * DetectLanguageInput objects allow for specification of country hints on a + * document-by-document basis. + * + * When using DetectLanguageInput, the `id` field is required and must be unique + * for each document in a given request. + */ +const detectLanguageInputs: DetectLanguageInput[] = [ + { id: "0", countryHint: "us", text: "I had the best day of my life." }, + { id: "1", countryHint: "us", text: "This was a waste of my time. The speaker put me to sleep." }, + { id: "2", countryHint: "us", text: "No tengo dinero ni nada que dar..." }, + { + id: "3", + countryHint: "fr", + text: "L'hôtel n'était pas très confortable. L'éclairage était trop sombre." + } +]; + +/** + * TextDocumentInput objects are used by all methods except for `detectLanguage`. + * They allow for specification of input language on a document-by-document basis. + * + * Like `DetectLanguageInput`, the `id` field is required and must be unique for + * each document in the request. + */ +const textDocumentInputs: TextDocumentInput[] = [ + { id: "0", language: "en", text: "I had the best day of my life." }, + { id: "1", language: "en", text: "This was a waste of my time. The speaker put me to sleep." }, + { id: "2", language: "es", text: "No tengo dinero ni nada que dar..." }, + { + id: "3", + language: "fr", + text: "L'hôtel n'était pas très confortable. L'éclairage était trop sombre." + } +]; + +export async function main() { + console.log("== Alternative Document Input Objects Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + console.log("-- Detect Language --"); + // DetectLanguageInput objects may be used with the detectLanguage method + for (const result of await client.detectLanguage(detectLanguageInputs)) { + if (!result.error) { + const { id, primaryLanguage } = result; + console.log(`Document ${id} is in ${primaryLanguage.name}.`); + } + } + + console.log("-- Extract Key Phrases --"); + // TextDocumentInput objects may be used with any other method + // (for example, extractKeyPhrases) + for (const result of await client.extractKeyPhrases(textDocumentInputs)) { + if (!result.error) { + const { id, keyPhrases } = result; + console.log(`Document ${id} has ${keyPhrases.length} key phrases:`); + for (const phrase of keyPhrases) { + console.log(`- ${phrase}`); + } + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentiment.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentiment.ts new file mode 100644 index 000000000000..c58d414d55d8 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentiment.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * In this sample, we use the sentiment analysis endpoint to retrieve + * estimations of document sentiment (positive, negative, or mixed) within some + * example text. The endpoint allows us to analyze sentiment on a per-sentence + * or overall (per-document) basis. + * + * @summary analyzes the sentiment of a piece of text + * @azsdk-weight 100 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "I had the best day of my life.", + "This was a waste of my time. The speaker put me to sleep." +]; + +export async function main() { + console.log("=== Analyze Sentiment Sample ==="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const results = await client.analyzeSentiment(documents); + + for (let i = 0; i < results.length; i++) { + const result = results[i]; + console.log(`- Document ${result.id}`); + if (!result.error) { + console.log(`\tDocument text: ${documents[i]}`); + console.log(`\tOverall Sentiment: ${result.sentiment}`); + console.log("\tSentiment confidence scores: ", result.confidenceScores); + console.log("\tSentences"); + for (const { sentiment, confidenceScores, text } of result.sentences) { + console.log(`\t- Sentence text: ${text}`); + console.log(`\t Sentence sentiment: ${sentiment}`); + console.log("\t Confidence scores:", confidenceScores); + } + } else { + console.error(` Error: ${result.error}`); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentimentWithOpinionMining.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentimentWithOpinionMining.ts new file mode 100644 index 000000000000..4830284e2a79 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/analyzeSentimentWithOpinionMining.ts @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample demonstrates how to analyze sentiment on a more granular level, + * mining individual assessments from reviews (also known as aspect-based + * sentiment analysis). In the example below, we analyze reviews about a hotel + * for sentiment and different assessments about targets in the reviews. + * + * @summary analyzes the sentiment of a piece of text and mine opinions about + * different targets + * @azsdk-weight 50 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + { + text: "The food and service were unacceptable, but the concierge were nice", + id: "0", + language: "en" + }, + { + text: + "The rooms were beautiful but dirty. The AC was good and quiet, but the elevator was broken", + id: "1", + language: "en" + }, + { + text: "The breakfast was good, but the toilet was smelly", + id: "2", + language: "en" + }, + { + text: "Loved this hotel - good breakfast - nice shuttle service.", + id: "3", + language: "en" + }, + { + text: "I had a great unobstructed view of the Microsoft campus", + id: "4", + language: "en" + } +]; + +export async function main() { + console.log("=== Opinion Mining Sample ==="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const results = await client.analyzeSentiment(documents, { includeOpinionMining: true }); + + for (let i = 0; i < results.length; i++) { + const result = results[i]; + console.log(`- Document ${result.id}`); + if (!result.error) { + console.log(`\tDocument text: ${documents[i].text}`); + console.log(`\tOverall Sentiment: ${result.sentiment}`); + console.log("\tSentiment confidence scores:", result.confidenceScores); + console.log("\tSentences"); + for (const { sentiment, confidenceScores, opinions } of result.sentences) { + console.log(`\t- Sentence sentiment: ${sentiment}`); + console.log("\t Confidence scores:", confidenceScores); + console.log("\t Mined opinions"); + for (const { target, assessments } of opinions) { + console.log(`\t\t- Target text: ${target.text}`); + console.log(`\t\t Target sentiment: ${target.sentiment}`); + console.log("\t\t Target confidence scores:", target.confidenceScores); + console.log("\t\t Target assessments"); + for (const { text, sentiment } of assessments) { + console.log(`\t\t\t- Text: ${text}`); + console.log(`\t\t\t Sentiment: ${sentiment}`); + } + } + } + } else { + console.error(`\tError: ${result.error}`); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/authenticationMethods.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/authenticationMethods.ts new file mode 100644 index 000000000000..ff9258797cf8 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/authenticationMethods.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample demonstrates how to use either an Azure Active Directory (RBAC) + * or an API Key to authenticate a TextAnalyticsClient. + * + * @summary authenticates a service client using both Azure Active Directory + * and an API key + * @azsdk-weight 40 + */ + +// To use an API Key, import `AzureKeyCredential` from the Text Analytics package +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// To use Azure AD, import `DefaultAzureCredential` from the `@azure/identity` package +import { DefaultAzureCredential } from "@azure/identity"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; + +async function useAad() { + console.log("-- Azure Active Directory --"); + + // DefaultAzureCredential expects the following three environment variables: + // - AZURE_TENANT_ID: The tenant ID in Azure Active Directory + // - AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant + // - AZURE_CLIENT_SECRET: The client secret for the registered application + const credential = new DefaultAzureCredential(); + + const client = new TextAnalyticsClient(endpoint, credential); + + const [result] = await client.detectLanguage(["hello world"]); + + if (!result.error) { + console.log(`Primary language detected as ${result.primaryLanguage.name}`); + } +} + +async function useApiKey() { + console.log("-- API Key --"); + + // If using an API Key, you will need to set this environment variable + const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + + const credential = new AzureKeyCredential(apiKey); + + const client = new TextAnalyticsClient(endpoint, credential); + + const [result] = await client.detectLanguage(["hello world"]); + + if (!result.error) { + console.log(`Primary language detected as ${result.primaryLanguage.name}`); + } +} + +export async function main() { + console.log("== Client Authentication Methods Sample =="); + + await useAad(); + + await useApiKey(); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeBatchActions.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeBatchActions.ts new file mode 100644 index 000000000000..752a14a3b016 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeBatchActions.ts @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample extracts key phrases, entities, and pii entities from several + * documents using a long-running operation. This functionality uses the + * generic analysis endpoint, which provides a way to group several different + * Text Analytics operations into a single batch job. + * + * @summary applies multiple Text Analytics actions per document + * @azsdk-weight 40 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "Microsoft was founded by Bill Gates and Paul Allen.", + "Redmond is a city in King County, Washington, United States, located 15 miles east of Seattle.", + "I need to take my cat to the veterinarian.", + "The employee's SSN is 555-55-5555.", + "We went to Contoso Steakhouse located at midtown NYC last week for a dinner party, and we adore the spot! They provide marvelous food and they have a great menu. The chief cook happens to be the owner (I think his name is John Doe) and he is super nice, coming out of the kitchen and greeted us all. We enjoyed very much dining in the place! The Sirloin steak I ordered was tender and juicy, and the place was impeccably clean. You can even pre-order from their online menu at www.contososteakhouse.com, call 312-555-0176 or send email to order@contososteakhouse.com! The only complaint I have is the food didn't come fast enough. Overall I highly recommend it!" +]; + +export async function main() { + console.log("== Analyze Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const actions = { + recognizeEntitiesActions: [{ modelVersion: "latest" }], + recognizePiiEntitiesActions: [{ modelVersion: "latest" }], + extractKeyPhrasesActions: [{ modelVersion: "latest" }] + }; + const poller = await client.beginAnalyzeBatchActions(documents, actions, "en", { + includeStatistics: true + }); + + poller.onProgress(() => { + console.log( + `Number of actions still in progress: ${poller.getOperationState().actionsInProgressCount}` + ); + }); + + console.log( + `The analyze batch actions operation created on ${poller.getOperationState().createdOn}` + ); + + console.log( + `The analyze batch actions operation results will expire on ${ + poller.getOperationState().expiresOn + }` + ); + + const resultPages = await poller.pollUntilDone(); + + for await (const page of resultPages) { + const keyPhrasesAction = page.extractKeyPhrasesResults[0]; + if (!keyPhrasesAction.error) { + for (const doc of keyPhrasesAction.results) { + console.log(`- Document ${doc.id}`); + if (!doc.error) { + console.log("\tKey phrases:"); + for (const phrase of doc.keyPhrases) { + console.log(`\t- ${phrase}`); + } + } else { + console.error("\tError:", doc.error); + } + } + console.log("Action statistics: "); + console.log(JSON.stringify(keyPhrasesAction.results.statistics)); + } + + const entitiesAction = page.recognizeEntitiesResults[0]; + if (!entitiesAction.error) { + for (const doc of entitiesAction.results) { + console.log(`- Document ${doc.id}`); + if (!doc.error) { + console.log("\tEntities:"); + for (const entity of doc.entities) { + console.log(`\t- Entity ${entity.text} of type ${entity.category}`); + } + } else { + console.error("\tError:", doc.error); + } + } + console.log("Action statistics: "); + console.log(JSON.stringify(entitiesAction.results.statistics)); + } + + const piiEntitiesAction = page.recognizePiiEntitiesResults[0]; + if (!piiEntitiesAction.error) { + for (const doc of piiEntitiesAction.results) { + console.log(`- Document ${doc.id}`); + if (!doc.error) { + console.log("\tPii Entities:"); + for (const entity of doc.entities) { + console.log(`\t- Entity ${entity.text} of type ${entity.category}`); + } + } else { + console.error("\tError:", doc.error); + } + } + console.log("Action statistics: "); + console.log(JSON.stringify(piiEntitiesAction.results.statistics)); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeHealthcareEntities.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeHealthcareEntities.ts new file mode 100644 index 000000000000..fb77fbeb7dc3 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/beginAnalyzeHealthcareEntities.ts @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample program uses the Text Analytics for Healthcare API to detect + * healthcare-related entities in some documents and prints them to the + * console. + * + * @summary detects healthcare entities in a piece of text + * @azsdk-weight 50 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "The patient is a 54-year-old gentleman with a history of progressive angina over the past several months.", + "Prescribed 100mg ibuprofen, taken twice daily.", + "Patient does not suffer from high blood pressure." +]; + +export async function main() { + console.log("== Recognize Healthcare Entities Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const poller = await client.beginAnalyzeHealthcareEntities(documents, "en", { + includeStatistics: true + }); + + poller.onProgress(() => { + console.log( + `Last time the operation was updated was on: ${poller.getOperationState().lastModifiedOn}` + ); + }); + console.log( + `The analyze healthcare entities operation was created on ${ + poller.getOperationState().createdOn + }` + ); + console.log( + `The analyze healthcare entities operation results will expire on ${ + poller.getOperationState().expiresOn + }` + ); + + const results = await poller.pollUntilDone(); + + for await (const result of results) { + console.log(`- Document ${result.id}`); + if (!result.error) { + console.log("\tRecognized Entities:"); + for (const entity of result.entities) { + console.log(`\t- Entity "${entity.text}" of type ${entity.category}`); + if (entity.dataSources.length > 0) { + console.log("\t and it can be referenced in the following data sources:"); + for (const ds of entity.dataSources) { + console.log(`\t\t- ${ds.name} with Entity ID: ${ds.entityId}`); + } + } + } + if (result.entityRelations?.length > 0) { + console.log(`\tRecognized relations between entities:`); + for (const relation of result.entityRelations) { + console.log( + `\t\t- Relation of type ${relation.relationType} found between the following entities:` + ); + for (const role of relation.roles) { + console.log(`\t\t\t- "${role.entity.text}" with the role ${role.name}`); + } + } + } + } else console.error("\tError:", result.error); + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/detectLanguage.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/detectLanguage.ts new file mode 100644 index 000000000000..f079e787cb89 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/detectLanguage.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * In this sample, we use the language detection endpoint to determine the + * written language of several documents written in different languages. The + * endpoint provides a primary language as well as a score representing the + * service's confidence in the correctness of its assessment. + * + * @summary detects the language of a piece of text + * @azsdk-weight 100 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "This document is written in English.", + "Este es un document escrito en Español.", + "这是一个用中文写的文件", + "Dies ist ein Dokument in deutsche Sprache.", + "Detta är ett dokument skrivet på engelska." +]; + +export async function main() { + console.log("== Detect Language Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const results = await client.detectLanguage(documents); + + for (const result of results) { + console.log(`- Document ${result.id}`); + if (!result.error) { + const primaryLanguage = result.primaryLanguage; + console.log( + `\tDetected language: ${primaryLanguage.name} (ISO 6391 code: ${primaryLanguage.iso6391Name})` + ); + } else { + console.error("\tError:", result.error); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/extractKeyPhrases.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/extractKeyPhrases.ts new file mode 100644 index 000000000000..f75c22f651aa --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/extractKeyPhrases.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample uses the key-phrase extraction endpoint to determine which + * words or phrases in a document are of particular importance. + * + * @summary extracts key phrases from a piece of text + * @azsdk-weight 100 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "Redmond is a city in King County, Washington, United States, located 15 miles east of Seattle.", + "I need to take my cat to the veterinarian.", + "I will travel to South America in the summer." +]; + +export async function main() { + console.log("== Extract Key Phrases Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const results = await client.extractKeyPhrases(documents); + + for (const result of results) { + console.log(`- Document ${result.id}`); + if (!result.error) { + console.log("\tKey phrases:"); + for (const phrase of result.keyPhrases) { + console.log(`\t- ${phrase}`); + } + } else { + console.error(" Error:", result.error); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/recognizeEntities.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/recognizeEntities.ts new file mode 100644 index 000000000000..7d4c69655c9a --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/recognizeEntities.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Uses the entity recognition endpoint to detect entities in a document using + * Named Entity Recognition (NER) and prints them along with their recognized + * entity type. + * + * @summary detects entites in a piece of text + * @azsdk-weight 100 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "Microsoft was founded by Bill Gates and Paul Allen.", + "I had a wonderful trip to Seattle last week.", + "I visited the Space Needle 2 times." +]; + +export async function main() { + console.log("== Recognize Entities Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const results = await client.recognizeEntities(documents); + + for (const result of results) { + console.log(`- Document ${result.id}`); + if (!result.error) { + console.log("\tRecognized Entities:"); + for (const entity of result.entities) { + console.log(`\t- Entity ${entity.text} of type ${entity.category}`); + } + } else console.error("\tError:", result.error); + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/recognizeLinkedEntities.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/recognizeLinkedEntities.ts new file mode 100644 index 000000000000..3e39ce5b068e --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/recognizeLinkedEntities.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample uses the linked entity recognition endpoint to detect + * well-known entities in a document and connect (link) them to entries in an + * external knowledge base (such as Wikipedia) that contain information about + * the entity. + * + * @summary detects entities that have links to more information on the web + * @azsdk-weight 100 + */ + +import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set these environment variables or edit the following values +const endpoint = process.env["ENDPOINT"] || ""; +const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + +const documents = [ + "Microsoft moved its headquarters to Bellevue, Washington in January 1979.", + "Steve Ballmer stepped down as CEO of Microsoft and was succeeded by Satya Nadella." +]; + +export async function main() { + console.log("== Recognize Linked Entities Sample =="); + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const results = await client.recognizeLinkedEntities(documents); + + for (const result of results) { + console.log(`- Document ${result.id}`); + if (!result.error) { + console.log("\tEntities:"); + for (const entity of result.entities) { + console.log( + `\t- Entity ${entity.name}; link ${entity.url}; datasource: ${entity.dataSource}` + ); + console.log("\t\tMatches:"); + for (const match of entity.matches) { + console.log( + `\t\t- Entity appears as "${match.text}" (confidence: ${match.confidenceScore}` + ); + } + } + } else { + console.error(" Error:", result.error); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples-dev/recognizePii.ts b/sdk/textanalytics/ai-text-analytics/samples-dev/recognizePii.ts new file mode 100644 index 000000000000..e406ff779a0f --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples-dev/recognizePii.ts @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This sample uses the PII-recognition endpoint to detect sensitive + * personally identifiable information in documents (such as social security + * numbers, addresses, and more). The API returns information about the + * location of the sensitive information in the text, which we use to perform + * redaction of the PII text. + * + * @summary detects personally-identifiable information + * @azsdk-weight 100 + */ + +import { + TextAnalyticsClient, + AzureKeyCredential, + PiiEntityDomainType +} from "@azure/ai-text-analytics"; +import { assert } from "console"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +export async function main() { + console.log(`Running recognizePii sample`); + + // You will need to set these environment variables or edit the following values + const endpoint = process.env["ENDPOINT"] || ""; + const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; + + const client = new TextAnalyticsClient(endpoint, new AzureKeyCredential(apiKey)); + + const textOnePii = "My phone number is 555-5555"; + const textNoPHI = "His EU passport number is X65097105"; + const textMultiplePIIs = "Patient name is Joe and SSN is 859-98-0987"; + + const [result] = await client.recognizePiiEntities([textOnePii]); + + if (!result.error) { + console.log( + `The redacted text is "${result.redactedText}" and found the following PII entities` + ); + for (const entity of result.entities) { + console.log(`\t- "${entity.text}" of type ${entity.category}`); + } + } + + console.log(`There are no PHI entities in this text: "${textNoPHI}"`); + const [resultWithPHI] = await client.recognizePiiEntities([textNoPHI], "en", { + domainFilter: PiiEntityDomainType.PROTECTED_HEALTH_INFORMATION + }); + if (!resultWithPHI.error) { + console.log(`Also there is nothing to redact: "${resultWithPHI.redactedText}"`); + assert(resultWithPHI.entities.length === 0, "did not expect any entities but got some"); + } + + console.log(`But there are other PII entities in that text:`); + const [resultWithoutPHI] = await client.recognizePiiEntities([textNoPHI]); + if (!resultWithoutPHI.error) { + for (const entity of resultWithoutPHI.entities) { + console.log(`\t- "${entity.text}" of type ${entity.category}`); + } + } + const [resultWithSSNPII] = await client.recognizePiiEntities([textMultiplePIIs], "en", { + categoriesFilter: ["USSocialSecurityNumber"] + }); + if (!resultWithSSNPII.error) { + console.log( + `You can choose to get SSN entities only, or any other PII category or a combination of them. For example, in this text: "${textMultiplePIIs}", this is the SSN number:` + ); + for (const entity of resultWithSSNPII.entities) { + console.log(`\t- "${entity.text}"`); + assert(entity.category === "USSocialSecurityNumber"); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/README.md b/sdk/textanalytics/ai-text-analytics/samples/javascript/README.md deleted file mode 100644 index c4755fc8ae17..000000000000 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/README.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -page_type: sample -languages: - - javascript -products: - - azure - - azure-cognitive-services - - azure-text-analytics -urlFragment: ai-text-analytics-javascript ---- - -# Azure Text Analytics client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for Azure Cognitive Services Text Analytics in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| [alternativeDocumentInput.js][alternativedocumentinput] | uses object document inputs with attached metadata rather than simple strings for more flexibility | -| [analyzeSentiment.js][analyzesentiment] | analyzes the sentiment of a piece of text | -| [analyzeSentimentWithOpinionMining.js][analyzesentimentwithopinionmining] | analyzes the sentiment of a piece of text and mine opinions about different targets | -| [detectLanguage.js][detectlanguages] | detects the language of a piece of text | -| [extractKeyPhrases.js][extractkeyphrases] | extracts key phrases from a piece of text | -| [recognizePii.js][recognizepii] | detects personally-identifiable information | -| [recognizeLinkedEntities.js][recognizelinkedentities] | detects entities that have links to more information on the web | -| [authenticationMethods.js][authenticationmethods] | authenticates a service client using both Azure Active Directory and an API key | -| [recognizeEntities.js][recognizeentities] | detects entites in a piece of text and prints them along with the entity type | -| [beginAnalyzeHealthcareEntities.js][beginanalyzehealthcareentities] | detects healthcare entities of a piece of text | -| [beginAnalyzeBatchActions.js][beginanalyzebatchactions] | applies multiple Text Analytics actions per document | - -## Prerequisites - -The samples are compatible with Node.js >= 8.0.0. - -You need [an Azure subscription][freesub] and [an Azure Cognitive Services Instance][azcogsvc] to run these sample programs. Samples retrieve credentials to access the Cognitive Services 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 analyzeSentiment.js -``` - -Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): - -```bash -npx cross-env ENDPOINT="" TEXT_ANALYTICS_API_KEY="" node analyzeSentiment.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[alternativedocumentinput]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/alternativeDocumentInput.js -[analyzesentiment]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentiment.js -[analyzesentimentwithopinionmining]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentimentWithOpinionMining.js -[authenticationmethods]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/authenticationMethods.js -[detectlanguages]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/detectLanguage.js -[extractkeyphrases]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/extractKeyPhrases.js -[recognizepii]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizePii.js -[recognizelinkedentities]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeLinkedEntities.js -[recognizeentities]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeEntities.js -[beginanalyzebatchactions]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeBatchActions.js -[beginanalyzehealthcare]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeHealthcare.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/ai-text-analytics -[azcogsvc]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/README.md diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/package.json b/sdk/textanalytics/ai-text-analytics/samples/javascript/package.json deleted file mode 100644 index 07b042192ed1..000000000000 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "azure-ai-text-analytics-samples-js", - "private": true, - "version": "0.1.0", - "description": "Azure Cognitive Services Text Analytics client library samples for JavaScript", - "engine": { - "node": ">=8.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git" - }, - "keywords": [ - "Azure", - "Cognitive Services", - "Text Analytics", - "Node.js", - "JavaScript" - ], - "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/master/sdk/textanalytics/ai-text-analytics", - "sideEffects": false, - "dependencies": { - "@azure/ai-text-analytics": "latest", - "@azure/identity": "latest", - "dotenv": "^8.2.0" - } -} diff --git a/sdk/textanalytics/ai-text-analytics/samples/tsconfig.json b/sdk/textanalytics/ai-text-analytics/samples/tsconfig.json deleted file mode 100644 index 8c89eac7173a..000000000000 --- a/sdk/textanalytics/ai-text-analytics/samples/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "typescript/dist", - "lib": ["DOM", "ES6"] - }, - "include": ["typescript/src/**.ts"], - "exclude": ["typescript/*.json", "**/node_modules/", "../node_modules", "../typings"] -} diff --git a/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/README.md b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/README.md new file mode 100644 index 000000000000..45bafe0c2f45 --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/README.md @@ -0,0 +1,84 @@ +--- +page_type: sample +languages: + - javascript +products: + - azure + - azure-cognitive-services + - azure-text-analytics +urlFragment: ai-text-analytics-javascript +--- + +# Azure Text Analytics client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for Azure Text Analytics in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| [analyzeSentiment.js][analyzesentiment] | analyzes the sentiment of a piece of text | +| [detectLanguage.js][detectlanguage] | detects the language of a piece of text | +| [extractKeyPhrases.js][extractkeyphrases] | extracts key phrases from a piece of text | +| [recognizeEntities.js][recognizeentities] | detects entites in a piece of text | +| [recognizeLinkedEntities.js][recognizelinkedentities] | detects entities that have links to more information on the web | +| [recognizePii.js][recognizepii] | detects personally-identifiable information | +| [analyzeSentimentWithOpinionMining.js][analyzesentimentwithopinionmining] | analyzes the sentiment of a piece of text and mine opinions about different targets | +| [beginAnalyzeHealthcareEntities.js][beginanalyzehealthcareentities] | detects healthcare entities in a piece of text | +| [alternativeDocumentInput.js][alternativedocumentinput] | uses objects with attached metadata instead of simple strings as inputs for flexibility | +| [authenticationMethods.js][authenticationmethods] | authenticates a service client using both Azure Active Directory and an API key | +| [beginAnalyzeBatchActions.js][beginanalyzebatchactions] | applies multiple Text Analytics actions per document | + +## Prerequisites + +The sample programs are compatible with Node.js >=12.0.0. + +You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs: + +- [Azure Cognitive Services instance][createinstance_azurecognitiveservicesinstance] + +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 analyzeSentiment.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="" TEXT_ANALYTICS_API_KEY="" node analyzeSentiment.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[analyzesentiment]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentiment.js +[detectlanguage]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/detectLanguage.js +[extractkeyphrases]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/extractKeyPhrases.js +[recognizeentities]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeEntities.js +[recognizelinkedentities]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeLinkedEntities.js +[recognizepii]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizePii.js +[analyzesentimentwithopinionmining]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentimentWithOpinionMining.js +[beginanalyzehealthcareentities]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeHealthcareEntities.js +[alternativedocumentinput]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/alternativeDocumentInput.js +[authenticationmethods]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/authenticationMethods.js +[beginanalyzebatchactions]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeBatchActions.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/ai-text-analytics +[freesub]: https://azure.microsoft.com/free/ +[createinstance_azurecognitiveservicesinstance]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account +[package]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/README.md diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/alternativeDocumentInput.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/alternativeDocumentInput.js similarity index 90% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/alternativeDocumentInput.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/alternativeDocumentInput.js index 394dd7694d61..50fa3ded700a 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/alternativeDocumentInput.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/alternativeDocumentInput.js @@ -2,8 +2,12 @@ // Licensed under the MIT License. /** - * Demonstrates how to use object inputs as alternatives to - * string arrays in client methods + * This sample demonstrates how to use objects with additional metadata as + * inputs to the Text Analytics service as an alternative to passing arrays of + * simple strings in the client methods. + * + * @summary uses objects with attached metadata instead of simple strings as + * inputs for flexibility */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentiment.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentiment.js similarity index 77% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentiment.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentiment.js index 590761c405a6..ee47ce559abf 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentiment.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentiment.js @@ -2,8 +2,12 @@ // Licensed under the MIT License. /** - * Demonstrates how to analyze sentiment in documents. - * An overall and per-sentence sentiment is returned. + * In this sample, we use the sentiment analysis endpoint to retrieve + * estimations of document sentiment (positive, negative, or mixed) within some + * example text. The endpoint allows us to analyze sentiment on a per-sentence + * or overall (per-document) basis. + * + * @summary analyzes the sentiment of a piece of text */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); @@ -39,10 +43,10 @@ async function main() { for (const { sentiment, confidenceScores, text } of result.sentences) { console.log(`\t- Sentence text: ${text}`); console.log(`\t Sentence sentiment: ${sentiment}`); - console.log("\t Confidence scores: ", confidenceScores); + console.log("\t Confidence scores:", confidenceScores); } } else { - console.error(`\tError: ${result.error}`); + console.error(` Error: ${result.error}`); } } } diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentimentWithOpinionMining.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentimentWithOpinionMining.js similarity index 91% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentimentWithOpinionMining.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentimentWithOpinionMining.js index 64a5cc8d2803..7a390b0a354c 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/analyzeSentimentWithOpinionMining.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/analyzeSentimentWithOpinionMining.js @@ -4,10 +4,11 @@ /** * This sample demonstrates how to analyze sentiment on a more granular level, * mining individual assessments from reviews (also known as aspect-based - * sentiment analysis). + * sentiment analysis). In the example below, we analyze reviews about a hotel + * for sentiment and different assessments about targets in the reviews. * - * In this sample, a bunch of reviews about a hotel are being analyzed for - * sentiment and different assessments about targets in the reviews are shown. + * @summary analyzes the sentiment of a piece of text and mine opinions about + * different targets */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/authenticationMethods.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/authenticationMethods.js similarity index 89% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/authenticationMethods.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/authenticationMethods.js index f9142a0b672d..d0cc3e0516db 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/authenticationMethods.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/authenticationMethods.js @@ -2,8 +2,11 @@ // Licensed under the MIT License. /** - * Demonstrates how to use either an Azure Active Directory (RBAC) or an - * API Key to authenticate a TextAnalyticsClient + * This sample demonstrates how to use either an Azure Active Directory (RBAC) + * or an API Key to authenticate a TextAnalyticsClient. + * + * @summary authenticates a service client using both Azure Active Directory + * and an API key */ // To use an API Key, import `AzureKeyCredential` from the Text Analytics package diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeBatchActions.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeBatchActions.js similarity index 90% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeBatchActions.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeBatchActions.js index 83f5bfba3a0f..9421b9fa56a6 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeBatchActions.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeBatchActions.js @@ -2,7 +2,12 @@ // Licensed under the MIT License. /** - * extracts key phrases, entities, and pii entities from a piece of text + * This sample extracts key phrases, entities, and pii entities from several + * documents using a long-running operation. This functionality uses the + * generic analysis endpoint, which provides a way to group several different + * Text Analytics operations into a single batch job. + * + * @summary applies multiple Text Analytics actions per document */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); @@ -36,20 +41,25 @@ async function main() { const poller = await client.beginAnalyzeBatchActions(documents, actions, "en", { includeStatistics: true }); + poller.onProgress(() => { console.log( `Number of actions still in progress: ${poller.getOperationState().actionsInProgressCount}` ); }); + console.log( - `The analyze batch actions operation was created on ${poller.getOperationState().createdOn}` + `The analyze batch actions operation created on ${poller.getOperationState().createdOn}` ); + console.log( `The analyze batch actions operation results will expire on ${ poller.getOperationState().expiresOn }` ); + const resultPages = await poller.pollUntilDone(); + for await (const page of resultPages) { const keyPhrasesAction = page.extractKeyPhrasesResults[0]; if (!keyPhrasesAction.error) { diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeHealthcareEntities.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeHealthcareEntities.js similarity index 86% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeHealthcareEntities.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeHealthcareEntities.js index ff804c4af162..422785e4b133 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/beginAnalyzeHealthcareEntities.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/beginAnalyzeHealthcareEntities.js @@ -2,7 +2,11 @@ // Licensed under the MIT License. /** - * detects healthcare entities in a piece of text and prints them + * This sample program uses the Text Analytics for Healthcare API to detect + * healthcare-related entities in some documents and prints them to the + * console. + * + * @summary detects healthcare entities in a piece of text */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); @@ -16,6 +20,7 @@ const endpoint = process.env["ENDPOINT"] || ""; const apiKey = process.env["TEXT_ANALYTICS_API_KEY"] || ""; const documents = [ + "The patient is a 54-year-old gentleman with a history of progressive angina over the past several months.", "Prescribed 100mg ibuprofen, taken twice daily.", "Patient does not suffer from high blood pressure." ]; @@ -60,7 +65,7 @@ async function main() { } } } - if (result.entityRelations !== undefined && result.entityRelations.length > 0) { + if (result.entityRelations?.length > 0) { console.log(`\tRecognized relations between entities:`); for (const relation of result.entityRelations) { console.log( diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/detectLanguage.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/detectLanguage.js similarity index 80% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/detectLanguage.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/detectLanguage.js index 09411ed3ffaa..340fa49311a4 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/detectLanguage.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/detectLanguage.js @@ -2,7 +2,12 @@ // Licensed under the MIT License. /** - * detects the language of a piece of text + * In this sample, we use the language detection endpoint to determine the + * written language of several documents written in different languages. The + * endpoint provides a primary language as well as a score representing the + * service's confidence in the correctness of its assessment. + * + * @summary detects the language of a piece of text */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/extractKeyPhrases.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/extractKeyPhrases.js similarity index 84% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/extractKeyPhrases.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/extractKeyPhrases.js index 076f6471ef9d..2914b0d35e85 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/extractKeyPhrases.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/extractKeyPhrases.js @@ -2,7 +2,10 @@ // Licensed under the MIT License. /** - * extracts key phrases from a piece of text + * This sample uses the key-phrase extraction endpoint to determine which + * words or phrases in a document are of particular importance. + * + * @summary extracts key phrases from a piece of text */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); @@ -36,7 +39,7 @@ async function main() { console.log(`\t- ${phrase}`); } } else { - console.error("\tError:", result.error); + console.error(" Error:", result.error); } } } diff --git a/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/package.json b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/package.json new file mode 100644 index 000000000000..355392a08bfb --- /dev/null +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/package.json @@ -0,0 +1,33 @@ +{ + "name": "azure-ai-text-analytics-samples-js", + "private": true, + "version": "1.0.0", + "description": "Azure Text Analytics 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/textanalytics/ai-text-analytics" + }, + "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/master/sdk/textanalytics/ai-text-analytics", + "dependencies": { + "@azure/ai-text-analytics": "next", + "dotenv": "latest", + "@azure/identity": "^1.1.0" + } +} diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeEntities.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeEntities.js similarity index 85% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeEntities.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeEntities.js index 86ec869cd1d0..583eac5fb2be 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeEntities.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeEntities.js @@ -2,7 +2,11 @@ // Licensed under the MIT License. /** - * detects entites in a piece of text and prints them along with the entity type + * Uses the entity recognition endpoint to detect entities in a document using + * Named Entity Recognition (NER) and prints them along with their recognized + * entity type. + * + * @summary detects entites in a piece of text */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeLinkedEntities.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeLinkedEntities.js similarity index 81% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeLinkedEntities.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeLinkedEntities.js index 1395fd6712c8..ed1e3690bb74 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizeLinkedEntities.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizeLinkedEntities.js @@ -2,7 +2,12 @@ // Licensed under the MIT License. /** - * detects entities that have links to more information on the web + * This sample uses the linked entity recognition endpoint to detect + * well-known entities in a document and connect (link) them to entries in an + * external knowledge base (such as Wikipedia) that contain information about + * the entity. + * + * @summary detects entities that have links to more information on the web */ const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); @@ -43,7 +48,7 @@ async function main() { } } } else { - console.error("\tError:", result.error); + console.error(" Error:", result.error); } } } diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizePii.js b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizePii.js similarity index 85% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/recognizePii.js rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizePii.js index a3d3d0cbda5c..5af0c5b97744 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/recognizePii.js +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/recognizePii.js @@ -2,7 +2,13 @@ // Licensed under the MIT License. /** - * detects personally-identifiable information + * This sample uses the PII-recognition endpoint to detect sensitive + * personally identifiable information in documents (such as social security + * numbers, addresses, and more). The API returns information about the + * location of the sensitive information in the text, which we use to perform + * redaction of the PII text. + * + * @summary detects personally-identifiable information */ const { @@ -13,7 +19,8 @@ const { const { assert } = require("console"); // Load the .env file if it exists -require("dotenv").config(); +const dotenv = require("dotenv"); +dotenv.config(); async function main() { console.log(`Running recognizePii sample`); diff --git a/sdk/textanalytics/ai-text-analytics/samples/javascript/sample.env b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/sample.env similarity index 74% rename from sdk/textanalytics/ai-text-analytics/samples/javascript/sample.env rename to sdk/textanalytics/ai-text-analytics/samples/v5/javascript/sample.env index 5eb547dc0972..614cea7d231b 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/javascript/sample.env +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/javascript/sample.env @@ -1,13 +1,14 @@ -# Used in most samples. Retrieve these values from a Cognitive Services instance -# in the Azure Portal. +# Used to authenticate with the Azure Text Analytics service. Retrieve these +# values from a Cognitive Services instance in the Azure Portal. ENDPOINT="https://.cognitiveservies.azure.com/" TEXT_ANALYTICS_API_KEY="" -# Used to authenticate using Azure AD as a service principal for role-based authentication -# in the tokenAuth sample. +# Used to authenticate using Azure AD as a service principal for role-based +# authentication. # # See the documentation for `EnvironmentCredential` at the following link: # https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential AZURE_TENANT_ID= AZURE_CLIENT_ID= AZURE_CLIENT_SECRET= + diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/README.md b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/README.md similarity index 50% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/README.md rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/README.md index 7309114a79e8..ead3ea6a4a17 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/README.md +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/README.md @@ -11,33 +11,37 @@ urlFragment: ai-text-analytics-typescript # Azure Text Analytics client library samples for TypeScript -These sample programs show how to use the TypeScript client libraries for Azure Cognitive Services Text Analytics in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| [alternativeDocumentInput.ts][alternativedocumentinput] | uses object document inputs with attached metadata rather than simple strings for more flexibility | -| [analyzeSentiment.ts][analyzesentiment] | analyzes the sentiment of a piece of text | -| [analyzeSentimentWithOpinionMining.ts][analyzesentimentwithopinionmining] | analyzes the sentiment of a piece of text and mine opinions about different targets | -| [detectLanguage.ts][detectlanguages] | detects the language of a piece of text | -| [extractKeyPhrases.ts][extractkeyphrases] | extracts key phrases from a piece of text | -| [recognizePii.ts][recognizepii] | detects personally-identifiable information | -| [recognizeLinkedEntities.ts][recognizelinkedentities] | detects entities that have links to more information on the web | -| [authenticationMethods.ts][authenticationmethods] | authenticates a service client using both Azure Active Directory and an API key | -| [recognizeEntities.ts][recognizeentities] | detects entites in a piece of text and prints them along with the entity type | -| [beginAnalyzeHealthcareEntities.ts][beginanalyzehealthcareentities] | detects healthcare entities of a piece of text | -| [beginAnalyzeBatchActions.ts][beginanalyzebatchactions] | applies multiple Text Analytics actions per document | +These sample programs show how to use the TypeScript client libraries for Azure Text Analytics in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| [analyzeSentiment.ts][analyzesentiment] | analyzes the sentiment of a piece of text | +| [detectLanguage.ts][detectlanguage] | detects the language of a piece of text | +| [extractKeyPhrases.ts][extractkeyphrases] | extracts key phrases from a piece of text | +| [recognizeEntities.ts][recognizeentities] | detects entites in a piece of text | +| [recognizeLinkedEntities.ts][recognizelinkedentities] | detects entities that have links to more information on the web | +| [recognizePii.ts][recognizepii] | detects personally-identifiable information | +| [analyzeSentimentWithOpinionMining.ts][analyzesentimentwithopinionmining] | analyzes the sentiment of a piece of text and mine opinions about different targets | +| [beginAnalyzeHealthcareEntities.ts][beginanalyzehealthcareentities] | detects healthcare entities in a piece of text | +| [alternativeDocumentInput.ts][alternativedocumentinput] | uses objects with attached metadata instead of simple strings as inputs for flexibility | +| [authenticationMethods.ts][authenticationmethods] | authenticates a service client using both Azure Active Directory and an API key | +| [beginAnalyzeBatchActions.ts][beginanalyzebatchactions] | applies multiple Text Analytics actions per document | ## Prerequisites -The samples are compatible with Node.js >= 8.0.0. +The sample programs are compatible with Node.js >=12.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 +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 [an Azure Cognitive Services Instance][azcogsvc] to run these sample programs. Samples retrieve credentials to access the Cognitive Services 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. +You need [an Azure subscription][freesub] and the following Azure resources to run these sample programs: + +- [Azure Cognitive Services instance][createinstance_azurecognitiveservicesinstance] + +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]. @@ -51,7 +55,7 @@ To run the samples using the published version of the package: npm install ``` -2. Compile the samples +2. Compile the samples: ```bash npm run build @@ -62,32 +66,32 @@ npm run build 4. Run whichever samples you like (note that some samples may require additional setup, see the table above): ```bash -node dist/analyzeSentiment.js +node dist/analyzeSentiment.ts ``` -Alternatively, run a single sample with the correct environment variables set (step 3 is not required if you do this), for example (cross-platform): +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="" TEXT_ANALYTICS_API_KEY="" node dist/analyzeSentiment.js +npx cross-env ENDPOINT="" TEXT_ANALYTICS_API_KEY="" node dist/analyzeSentiment.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[alternativedocumentinput]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/alternativeDocumentInput.ts -[analyzesentiment]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentiment.ts -[analyzesentimentwithopinionmining]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentimentWithOpinionMining.ts -[authenticationmethods]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/authenticationMethods.ts -[detectlanguages]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/detectLanguage.ts -[extractkeyphrases]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/extractKeyPhrases.ts -[recognizepii]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizePii.ts -[recognizelinkedentities]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeLinkedEntities.ts -[recognizeentities]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeEntities.ts -[beginanalyzebatchactions]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeBatchActions.ts -[beginanalyzehealthcare]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeHealthcare.ts +[analyzesentiment]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentiment.ts +[detectlanguage]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/detectLanguage.ts +[extractkeyphrases]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/extractKeyPhrases.ts +[recognizeentities]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeEntities.ts +[recognizelinkedentities]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeLinkedEntities.ts +[recognizepii]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizePii.ts +[analyzesentimentwithopinionmining]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentimentWithOpinionMining.ts +[beginanalyzehealthcareentities]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeHealthcareEntities.ts +[alternativedocumentinput]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/alternativeDocumentInput.ts +[authenticationmethods]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/authenticationMethods.ts +[beginanalyzebatchactions]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeBatchActions.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/ai-text-analytics -[azcogsvc]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [freesub]: https://azure.microsoft.com/free/ +[createinstance_azurecognitiveservicesinstance]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account [package]: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics/README.md [typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/package.json b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/package.json similarity index 50% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/package.json rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/package.json index 7146e2865d39..badf3aa44e14 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/package.json +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/package.json @@ -1,10 +1,10 @@ { "name": "azure-ai-text-analytics-samples-ts", "private": true, - "version": "0.1.0", - "description": "Azure Cognitive Services Text Analytics client library samples for TypeScript", + "version": "1.0.0", + "description": "Azure Text Analytics client library samples for TypeScript", "engine": { - "node": ">=8.0.0" + "node": ">=12.0.0" }, "scripts": { "build": "tsc", @@ -12,14 +12,16 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git" + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/textanalytics/ai-text-analytics" }, "keywords": [ - "Azure", - "Cognitive Services", - "Text Analytics", - "Node.js", - "TypeScript" + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" ], "author": "Microsoft Corporation", "license": "MIT", @@ -27,15 +29,13 @@ "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/textanalytics/ai-text-analytics", - "sideEffects": false, "dependencies": { - "@azure/ai-text-analytics": "latest", - "@azure/identity": "latest", - "dotenv": "^8.2.0" + "@azure/ai-text-analytics": "next", + "dotenv": "latest", + "@azure/identity": "^1.1.0" }, "devDependencies": { - "@types/node": "^8.0.0", - "rimraf": "^3.0.0", - "typescript": "latest" + "typescript": "~4.1.2", + "rimraf": "latest" } } diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/sample.env b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/sample.env similarity index 74% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/sample.env rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/sample.env index 5eb547dc0972..614cea7d231b 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/sample.env +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/sample.env @@ -1,13 +1,14 @@ -# Used in most samples. Retrieve these values from a Cognitive Services instance -# in the Azure Portal. +# Used to authenticate with the Azure Text Analytics service. Retrieve these +# values from a Cognitive Services instance in the Azure Portal. ENDPOINT="https://.cognitiveservies.azure.com/" TEXT_ANALYTICS_API_KEY="" -# Used to authenticate using Azure AD as a service principal for role-based authentication -# in the tokenAuth sample. +# Used to authenticate using Azure AD as a service principal for role-based +# authentication. # # See the documentation for `EnvironmentCredential` at the following link: # https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential AZURE_TENANT_ID= AZURE_CLIENT_ID= AZURE_CLIENT_SECRET= + diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/alternativeDocumentInput.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/alternativeDocumentInput.ts similarity index 88% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/alternativeDocumentInput.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/alternativeDocumentInput.ts index ff31124da51e..f3692989f90f 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/alternativeDocumentInput.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/alternativeDocumentInput.ts @@ -2,15 +2,19 @@ // Licensed under the MIT License. /** - * Demonstrates how to use object inputs as alternatives to - * string arrays in client methods + * This sample demonstrates how to use objects with additional metadata as + * inputs to the Text Analytics service as an alternative to passing arrays of + * simple strings in the client methods. + * + * @summary uses objects with attached metadata instead of simple strings as + * inputs for flexibility */ import { TextAnalyticsClient, AzureKeyCredential, DetectLanguageInput, - TextDocumentInput, + TextDocumentInput } from "@azure/ai-text-analytics"; // Load the .env file if it exists @@ -35,8 +39,8 @@ const detectLanguageInputs: DetectLanguageInput[] = [ { id: "3", countryHint: "fr", - text: "L'hôtel n'était pas très confortable. L'éclairage était trop sombre.", - }, + text: "L'hôtel n'était pas très confortable. L'éclairage était trop sombre." + } ]; /** @@ -53,8 +57,8 @@ const textDocumentInputs: TextDocumentInput[] = [ { id: "3", language: "fr", - text: "L'hôtel n'était pas très confortable. L'éclairage était trop sombre.", - }, + text: "L'hôtel n'était pas très confortable. L'éclairage était trop sombre." + } ]; export async function main() { diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentiment.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentiment.ts similarity index 83% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentiment.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentiment.ts index 5389a5cda3f1..eb764f142556 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentiment.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentiment.ts @@ -2,8 +2,12 @@ // Licensed under the MIT License. /** - * Demonstrates how to analyze sentiment in documents. - * An overall and per-sentence sentiment is returned. + * In this sample, we use the sentiment analysis endpoint to retrieve + * estimations of document sentiment (positive, negative, or mixed) within some + * example text. The endpoint allows us to analyze sentiment on a per-sentence + * or overall (per-document) basis. + * + * @summary analyzes the sentiment of a piece of text */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentimentWithOpinionMining.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentimentWithOpinionMining.ts similarity index 91% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentimentWithOpinionMining.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentimentWithOpinionMining.ts index b8c01ccb6ec8..ea2d27f04cde 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/analyzeSentimentWithOpinionMining.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/analyzeSentimentWithOpinionMining.ts @@ -4,10 +4,11 @@ /** * This sample demonstrates how to analyze sentiment on a more granular level, * mining individual assessments from reviews (also known as aspect-based - * sentiment analysis). + * sentiment analysis). In the example below, we analyze reviews about a hotel + * for sentiment and different assessments about targets in the reviews. * - * In this sample, a bunch of reviews about a hotel are being analyzed for - * sentiment and different assessments about targets in the reviews are shown. + * @summary analyzes the sentiment of a piece of text and mine opinions about + * different targets */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/authenticationMethods.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/authenticationMethods.ts similarity index 89% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/authenticationMethods.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/authenticationMethods.ts index 4996a32b1dc1..8d580e1b2c0f 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/authenticationMethods.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/authenticationMethods.ts @@ -2,8 +2,11 @@ // Licensed under the MIT License. /** - * Demonstrates how to use either an Azure Active Directory (RBAC) or an - * API Key to authenticate a TextAnalyticsClient + * This sample demonstrates how to use either an Azure Active Directory (RBAC) + * or an API Key to authenticate a TextAnalyticsClient. + * + * @summary authenticates a service client using both Azure Active Directory + * and an API key */ // To use an API Key, import `AzureKeyCredential` from the Text Analytics package diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeBatchActions.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeBatchActions.ts similarity index 92% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeBatchActions.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeBatchActions.ts index ecff836b1acb..536a3b49c2de 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeBatchActions.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeBatchActions.ts @@ -2,7 +2,12 @@ // Licensed under the MIT License. /** - * extracts key phrases, entities, and pii entities from a piece of text + * This sample extracts key phrases, entities, and pii entities from several + * documents using a long-running operation. This functionality uses the + * generic analysis endpoint, which provides a way to group several different + * Text Analytics operations into a single batch job. + * + * @summary applies multiple Text Analytics actions per document */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; @@ -36,21 +41,25 @@ export async function main() { const poller = await client.beginAnalyzeBatchActions(documents, actions, "en", { includeStatistics: true }); - const resultPages = await poller.pollUntilDone(); + poller.onProgress(() => { console.log( `Number of actions still in progress: ${poller.getOperationState().actionsInProgressCount}` ); }); + console.log( `The analyze batch actions operation created on ${poller.getOperationState().createdOn}` ); + console.log( `The analyze batch actions operation results will expire on ${ poller.getOperationState().expiresOn }` ); + const resultPages = await poller.pollUntilDone(); + for await (const page of resultPages) { const keyPhrasesAction = page.extractKeyPhrasesResults[0]; if (!keyPhrasesAction.error) { diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeHealthcareEntities.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeHealthcareEntities.ts similarity index 92% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeHealthcareEntities.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeHealthcareEntities.ts index 8c49c2340286..6acec1654103 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/beginAnalyzeHealthcareEntities.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/beginAnalyzeHealthcareEntities.ts @@ -2,7 +2,11 @@ // Licensed under the MIT License. /** - * detects healthcare entities in a piece of text and prints them + * This sample program uses the Text Analytics for Healthcare API to detect + * healthcare-related entities in some documents and prints them to the + * console. + * + * @summary detects healthcare entities in a piece of text */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/detectLanguage.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/detectLanguage.ts similarity index 80% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/detectLanguage.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/detectLanguage.ts index 0886f53f0f1f..929196308baf 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/detectLanguage.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/detectLanguage.ts @@ -2,7 +2,12 @@ // Licensed under the MIT License. /** - * detects the language of a piece of text + * In this sample, we use the language detection endpoint to determine the + * written language of several documents written in different languages. The + * endpoint provides a primary language as well as a score representing the + * service's confidence in the correctness of its assessment. + * + * @summary detects the language of a piece of text */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/extractKeyPhrases.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/extractKeyPhrases.ts similarity index 87% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/extractKeyPhrases.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/extractKeyPhrases.ts index 54127bcb3dba..88d435c01be2 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/extractKeyPhrases.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/extractKeyPhrases.ts @@ -2,7 +2,10 @@ // Licensed under the MIT License. /** - * extracts key phrases from a piece of text + * This sample uses the key-phrase extraction endpoint to determine which + * words or phrases in a document are of particular importance. + * + * @summary extracts key phrases from a piece of text */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeEntities.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeEntities.ts similarity index 85% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeEntities.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeEntities.ts index affabc349967..c7b2ced9aeb3 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeEntities.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeEntities.ts @@ -2,7 +2,11 @@ // Licensed under the MIT License. /** - * detects entites in a piece of text and prints them along with the entity type + * Uses the entity recognition endpoint to detect entities in a document using + * Named Entity Recognition (NER) and prints them along with their recognized + * entity type. + * + * @summary detects entites in a piece of text */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeLinkedEntities.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeLinkedEntities.ts similarity index 83% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeLinkedEntities.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeLinkedEntities.ts index 9c5055879eb8..839524ec1f8d 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizeLinkedEntities.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizeLinkedEntities.ts @@ -2,7 +2,12 @@ // Licensed under the MIT License. /** - * detects entities that have links to more information on the web + * This sample uses the linked entity recognition endpoint to detect + * well-known entities in a document and connect (link) them to entries in an + * external knowledge base (such as Wikipedia) that contain information about + * the entity. + * + * @summary detects entities that have links to more information on the web */ import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics"; diff --git a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizePii.ts b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizePii.ts similarity index 87% rename from sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizePii.ts rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizePii.ts index b2730c089359..7e5d3d9433ac 100644 --- a/sdk/textanalytics/ai-text-analytics/samples/typescript/src/recognizePii.ts +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/src/recognizePii.ts @@ -2,7 +2,13 @@ // Licensed under the MIT License. /** - * detects personally-identifiable information + * This sample uses the PII-recognition endpoint to detect sensitive + * personally identifiable information in documents (such as social security + * numbers, addresses, and more). The API returns information about the + * location of the sensitive information in the text, which we use to perform + * redaction of the PII text. + * + * @summary detects personally-identifiable information */ import { diff --git a/sdk/template/template/samples/typescript/tsconfig.json b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/tsconfig.json similarity index 74% rename from sdk/template/template/samples/typescript/tsconfig.json rename to sdk/textanalytics/ai-text-analytics/samples/v5/typescript/tsconfig.json index 5ed056486b40..30f88da73e00 100644 --- a/sdk/template/template/samples/typescript/tsconfig.json +++ b/sdk/textanalytics/ai-text-analytics/samples/v5/typescript/tsconfig.json @@ -1,16 +1,14 @@ { "compilerOptions": { + "target": "ES6", "module": "commonjs", "moduleResolution": "node", - + "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "strict": true, "alwaysStrict": true, - "outDir": "dist", "rootDir": "src" }, - "include": ["src/**.ts"], - "exclude": ["node_modules"] + "include": ["src/**.ts"] } diff --git a/sdk/textanalytics/ai-text-analytics/tsconfig.json b/sdk/textanalytics/ai-text-analytics/tsconfig.json index 9784ff1f1ed3..455ac455f5a7 100644 --- a/sdk/textanalytics/ai-text-analytics/tsconfig.json +++ b/sdk/textanalytics/ai-text-analytics/tsconfig.json @@ -2,16 +2,10 @@ "extends": "../../../tsconfig.package", "compilerOptions": { "outDir": "./dist-esm", - "declarationDir": "./types" + "declarationDir": "./types", + "paths": { + "@azure/ai-text-analytics": ["./src/index"] + } }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-samples", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"] } diff --git a/sdk/textanalytics/perf-tests/text-analytics/package.json b/sdk/textanalytics/perf-tests/text-analytics/package.json index df7354c53dc8..7fe7bcaaf016 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/package.json +++ b/sdk/textanalytics/perf-tests/text-analytics/package.json @@ -18,7 +18,7 @@ "prettier": "^1.16.4", "rimraf": "^3.0.0", "tslib": "^2.0.0", - "ts-node": "^8.3.0", + "ts-node": "^9.0.0", "typescript": "~4.2.0" }, "private": true,