Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [#4490] Usage of a vulnerable package - Upgrade recognizers-text-number #4524

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/botbuilder-dialogs-adaptive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@microsoft/recognizers-text": "~1.1.4",
"@microsoft/recognizers-text-choice": "~1.1.4",
"@microsoft/recognizers-text-date-time": "~1.1.4",
"@microsoft/recognizers-text-number": "~1.1.4",
"@microsoft/recognizers-text-number": "~1.3.1",
"@microsoft/recognizers-text-number-with-unit": "~1.1.4",
"@microsoft/recognizers-text-sequence": "~1.1.4",
"@microsoft/recognizers-text-suite": "1.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('EntityRecognizer Tests', function () {
it('test datetime', async function () {
const dc = getDialogContext('testDatetime', 'Next thursday at 4pm.');
const results = await recognizers.recognizeEntities(dc, dc.context.activity.text, dc.context.activity.locale);
assert.strictEqual(results.length, 3); // should be 4 but ordinal entity is missing.
assert.strictEqual(results.length, 4);
assert.strictEqual(results.filter((e) => e.type === 'datetimeV2.datetime').length, 1);
// assert.strictEqual(results.filter((e) => e.type === 'ordinal').length, 1);
assert.strictEqual(results.filter((e) => e.type === 'dimension').length, 1);
Expand All @@ -119,7 +119,7 @@ describe('EntityRecognizer Tests', function () {
it('test guid', async function () {
const dc = getDialogContext('testGuid', 'my account number is 00000000-0000-0000-0000-000000000000...');
const results = await recognizers.recognizeEntities(dc, dc.context.activity.text, dc.context.activity.locale);
assert.strictEqual(results.length, 3); // should be 7, but some entitie are missing.
assert.strictEqual(results.length, 7);
assert.strictEqual(results.filter((e) => e.type === 'guid').length, 1);
});

Expand Down Expand Up @@ -168,7 +168,7 @@ describe('EntityRecognizer Tests', function () {
it('test phonenumber', async function () {
const dc = getDialogContext('testPhonenumber', 'Call 425-882-8080');
const results = await recognizers.recognizeEntities(dc, dc.context.activity.text, dc.context.activity.locale);
assert.strictEqual(results.length, 3); // should be 5, but some entities are missing.
assert.strictEqual(results.length, 5);
assert.strictEqual(results.filter((e) => e.type === 'phonenumber').length, 1);
});

Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-dialogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@microsoft/recognizers-text-choice": "1.1.4",
"@microsoft/recognizers-text-date-time": "1.1.4",
"@microsoft/recognizers-text-number": "1.1.4",
"@microsoft/recognizers-text-number": "1.3.1",
"@microsoft/recognizers-text-suite": "1.1.4",
"botbuilder-core": "4.1.6",
"botbuilder-dialogs-adaptive-runtime-core": "4.1.6",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"underscore": "1.13.1",
"json-schema": "0.4.0",
"jsonwebtoken": "9.0.0",
"@microsoft/recognizers-text-number": "~1.3.1",
"@xmldom/xmldom": "0.8.6",
"**/botbuilder-ai/@azure/cognitiveservices-luis-runtime/@azure/ms-rest-js": "^2.7.0",
"**/botbuilder-azure/@azure/core-auth/@azure/core-tracing": "1.0.0-preview.9",
Expand Down
29 changes: 11 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1504,16 +1504,14 @@
lodash.last "^3.0.0"
lodash.max "^4.0.1"

"@microsoft/recognizers-text-number@1.1.4", "@microsoft/recognizers-text-number@~1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@microsoft/recognizers-text-number/-/recognizers-text-number-1.1.4.tgz#1fbe0473322e6292bb93f9af86c6ca5ce05212d9"
integrity sha512-6EmlR+HR+eJBIX7sQby1vs6LJB64wxLowHaGpIU9OCXFvZ5Nb0QT8qh10rC40v3Mtrz4DpScXfSXr9tWkIO5MQ==
"@microsoft/recognizers-text-number@1.3.1", "@microsoft/recognizers-text-number@~1.1.4", "@microsoft/recognizers-text-number@~1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@microsoft/recognizers-text-number/-/recognizers-text-number-1.3.1.tgz#b2bffbb0b5c44eec77121f0c510c5bb40f77c668"
integrity sha512-JBxhSdihdQLQilCtqISEBw5kM+CNGTXzy5j5hNoZECNUEvBUPkAGNEJAeQPMP5abrYks29aSklnSvSyLObXaNQ==
dependencies:
"@microsoft/recognizers-text" "~1.1.4"
"@microsoft/recognizers-text" "~1.3.1"
bignumber.js "^7.2.1"
lodash.escaperegexp "^4.1.2"
lodash.sortby "^4.7.0"
lodash.trimend "^4.5.1"
lodash "^4.17.21"

"@microsoft/recognizers-text-sequence@~1.1.4":
version "1.1.4"
Expand All @@ -1540,6 +1538,11 @@
resolved "https://registry.yarnpkg.com/@microsoft/recognizers-text/-/recognizers-text-1.1.4.tgz#264530f748b2cad3fac54d53538f88ad2bf99b7e"
integrity sha512-hlSVXcaX5i8JcjuUJpVxmy2Z/GxvFXarF0KVySCFop57wNEnrLWMHe4I4DjP866G19VyIKRw+vPA32pkGhZgTg==

"@microsoft/recognizers-text@~1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@microsoft/recognizers-text/-/recognizers-text-1.3.1.tgz#eda98a9148101ecdb04ed1424082d472b04aabd9"
integrity sha512-HikLoRUgSzM4OKP3JVBzUUp3Q7L4wgI17p/3rERF01HVmopcujY3i6wgx8PenCwbenyTNxjr1AwSDSVuFlYedQ==

"@microsoft/tsdoc-config@~0.15.2":
version "0.15.2"
resolved "https://registry.yarnpkg.com/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz#eb353c93f3b62ab74bdc9ab6f4a82bcf80140f14"
Expand Down Expand Up @@ -8786,11 +8789,6 @@ lodash.set@^4.3.2:
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=

lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=

lodash.template@^3.0.0:
version "3.6.2"
resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f"
Expand Down Expand Up @@ -8843,11 +8841,6 @@ lodash.tonumber@^4.0.3:
resolved "https://registry.yarnpkg.com/lodash.tonumber/-/lodash.tonumber-4.0.3.tgz#0b96b31b35672793eb7f5a63ee791f1b9e9025d9"
integrity sha1-C5azGzVnJ5Prf1pj7nkfG56QJdk=

lodash.trimend@^4.5.1:
version "4.5.1"
resolved "https://registry.yarnpkg.com/lodash.trimend/-/lodash.trimend-4.5.1.tgz#12804437286b98cad8996b79414e11300114082f"
integrity sha1-EoBENyhrmMrYmWt5QU4RMAEUCC8=

lodash@^4.1.2, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@~4.17.15, lodash@~4.17.19:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
Expand Down
Loading