From 2b9baaffc53e2ac0032d06326803f60cb651b4ca Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Sat, 16 Aug 2025 14:49:31 -0700 Subject: [PATCH 1/2] update aisku tests --- AISKU/Tests/Unit/src/CdnThrottle.tests.ts | 229 ++++++++++++-------- AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts | 156 ++++++------- AISKU/Tests/Unit/src/validate.e2e.tests.ts | 204 ++++++++--------- common/config/rush/npm-shrinkwrap.json | 209 +++++++++--------- 4 files changed, 421 insertions(+), 377 deletions(-) diff --git a/AISKU/Tests/Unit/src/CdnThrottle.tests.ts b/AISKU/Tests/Unit/src/CdnThrottle.tests.ts index 91b14669f..2d3142132 100644 --- a/AISKU/Tests/Unit/src/CdnThrottle.tests.ts +++ b/AISKU/Tests/Unit/src/CdnThrottle.tests.ts @@ -7,7 +7,7 @@ import { createSnippetV5 } from './testSnippetV5'; import { CdnFeatureMode, FeatureOptInMode, getGlobal, getGlobalInst, isFunction, newId } from '@microsoft/applicationinsights-core-js'; import { createSnippetV6 } from './testSnippetV6'; import { CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode } from '@microsoft/applicationinsights-cfgsync-js'; -import { createSyncPromise } from '@nevware21/ts-async'; +import { createSyncPromise, doAwait } from '@nevware21/ts-async'; import { ICfgSyncCdnConfig } from '@microsoft/applicationinsights-cfgsync-js/src/Interfaces/ICfgSyncCdnConfig'; @@ -170,11 +170,11 @@ export class CdnThrottle extends AITestClass { } public registerTests() { - this.testCaseAsync({ + + this.testCase({ name: "CfgSyncPlugin: customer enable ikey messsage change, new config fetch from config url overwrite throttle setting and send message", - stepDelay: 10, useFakeTimers: true, - steps: [ () => { + test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { @@ -194,31 +194,41 @@ export class CdnThrottle extends AITestClass { }); this.init.loadAppInsights(); this._ai = this.init; - }].concat(PollingAssert.createPollingAssert(() => { - if (this.fetchStub.called){ - let core = this._ai['core']; - let _logger = core.logger; - let loggingSpy = this.sandbox.stub(_logger, 'throwInternal'); - Assert.equal(loggingSpy.called, 0); - - // now enable feature - this.init.config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.enable}}; - this.clock.tick(1); - Assert.equal(loggingSpy.called, 1); - Assert.equal(_eInternalMessageId.InstrumentationKeyDeprecation, loggingSpy.args[0][1]); - let message= loggingSpy.args[0][2]; - Assert.ok(message.includes("Instrumentation key")); - return true; - } - return false; + let core = this._ai['core']; + let _logger = core.logger; + this.loggingSpy = this.sandbox.stub(_logger, 'throwInternal'); - }, "response received", 60, 1000) as any) + return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + + Assert.equal(this.loggingSpy.called, 0); + + // now enable feature + this.init.config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.enable}} + + this.clock.tick(1); + return true; + } + return false; + + }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.loggingSpy.called){ + Assert.equal(this.loggingSpy.called, 1); + Assert.equal(_eInternalMessageId.InstrumentationKeyDeprecation, this.loggingSpy.args[0][1]); + let message= this.loggingSpy.args[0][2]; + Assert.ok(message.includes("Instrumentation key")); + return true; + } + return false; + + }, "response received", 60, 1000)) + } }); - this.testCaseAsync({ + + this.testCase({ name: "CfgSyncPlugin: customer didn't set throttle config, successfully fetch from config url", - stepDelay: 10, useFakeTimers: true, - steps: [ () => { + test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { @@ -232,27 +242,28 @@ export class CdnThrottle extends AITestClass { }); this.init.loadAppInsights(); this._ai = this.init; - }].concat(PollingAssert.createPollingAssert(() => { - - if (this.fetchStub.called){ - let plugin = this._ai.appInsights['core'].getPlugin(this.identifier).plugin; - let newCfg = plugin.getCfg(); - Assert.equal(JSON.stringify(newCfg.throttleMgrCfg), JSON.stringify(sampleConfig.throttleMgrCfg)); - // cdn should not be changed - let cdnCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation]; - Assert.equal(JSON.stringify(cdnCfg), JSON.stringify(default_throttle_config)); - return true; - } - return false; - }, "response received", 60, 1000) as any) + return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { + + if (this.fetchStub.called){ + let plugin = this._ai.appInsights['core'].getPlugin(this.identifier).plugin; + let newCfg = plugin.getCfg(); + Assert.equal(JSON.stringify(newCfg.throttleMgrCfg), JSON.stringify(sampleConfig.throttleMgrCfg)); + // cdn should not be changed + let cdnCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation]; + Assert.equal(JSON.stringify(cdnCfg), JSON.stringify(default_throttle_config)); + return true; + } + return false; + + }, "response received", 60, 1000)) + } }); - this.testCaseAsync({ + this.testCase({ name: "CfgSyncPlugin: customer didn't set feature opt in, successfully get aisku default and fetch from config url, get disable zip config to be true", - stepDelay: 10, useFakeTimers: true, - steps: [ () => { + test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { @@ -274,21 +285,29 @@ export class CdnThrottle extends AITestClass { }); this.init.loadAppInsights(); this._ai = this.init; - }].concat(PollingAssert.createPollingAssert(() => { - if (this.fetchStub.called){ - let newCfg = this._ai.config; - Assert.equal(newCfg.featureOptIn["zipPayload"]["mode"], FeatureOptInMode.enable); // aisku default is none, overwrite to true by cdn config - return true; - } - return false; - }, "response received", 60, 1000) as any) + + return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + this.clock.tick(1) + return true; + } + return false; + }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + let newCfg = this._ai.config; + this.clock.tick(1) + Assert.equal(newCfg.featureOptIn["zipPayload"]["mode"], FeatureOptInMode.enable); // aisku default is none, overwrite to true by cdn config + return true; + } + return false; + }, "response received", 60, 1000)); + } }); - this.testCaseAsync({ + this.testCase({ name: "CfgSyncPlugin: customer set throttle config, new config fetch from config url could overwrite original one", - stepDelay: 10, useFakeTimers: true, - steps: [ () => { + test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { @@ -324,28 +343,35 @@ export class CdnThrottle extends AITestClass { }); this.init.loadAppInsights(); this._ai = this.init; - }].concat(PollingAssert.createPollingAssert(() => { - - if (this.fetchStub.called){ - let plugin = this._ai.appInsights['core'].getPlugin(this.identifier).plugin; - let newCfg = plugin.getCfg(); - Assert.equal(JSON.stringify(newCfg.throttleMgrCfg), JSON.stringify(sampleConfig.throttleMgrCfg)); - // cdn should not be overwritten - let cdnCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation]; - Assert.equal(JSON.stringify(cdnCfg), JSON.stringify(default_throttle_config)); - let ikeyCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation]; - Assert.equal(JSON.stringify(ikeyCfg), JSON.stringify(sampleConfig.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation])); - return true; - } - return false; - }, "response received", 60, 1000) as any) + + return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + this.clock.tick(1) + return true; + } + return false; + }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { + + if (this.fetchStub.called){ + let plugin = this._ai.appInsights['core'].getPlugin(this.identifier).plugin; + let newCfg = plugin.getCfg(); + Assert.equal(JSON.stringify(newCfg.throttleMgrCfg), JSON.stringify(sampleConfig.throttleMgrCfg)); + // cdn should not be overwritten + let cdnCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation]; + Assert.equal(JSON.stringify(cdnCfg), JSON.stringify(default_throttle_config)); + let ikeyCfg = this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation]; + Assert.equal(JSON.stringify(ikeyCfg), JSON.stringify(sampleConfig.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation])); + return true; + } + return false; + }, "response received", 60, 1000)); + } }); - this.testCaseAsync({ + this.testCase({ name: "CfgSyncPlugin: customer enable feature opt in, then the config in cdn feature opt in is applied", - stepDelay: 10, useFakeTimers: true, - steps: [ () => { + test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { @@ -361,28 +387,35 @@ export class CdnThrottle extends AITestClass { cfgUrl: "testurl" }}, featureOptIn : {["iKeyUsage"]: {mode: FeatureOptInMode.enable}, - ["enableWParamFeature"]: {mode: FeatureOptInMode.enable}} + ["enableWParamFeature"]: {mode: FeatureOptInMode.enable}} } }); this.init.loadAppInsights(); this._ai = this.init; - }].concat(PollingAssert.createPollingAssert(() => { - - if (this.fetchStub.called){ - Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].disabled, false); - Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation].disabled, true); - Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber, throttleCfgDisable[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber); - return true; - } - return false; - }, "response received", 60, 1000) as any) + + return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + this.clock.tick(1) + return true; + } + return false; + }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { + + if (this.fetchStub.called){ + Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].disabled, false); + Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation].disabled, true); + Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber, throttleCfgDisable[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber); + return true; + } + return false; + }, "response received", 60, 1000)); + } }); - this.testCaseAsync({ + this.testCase({ name: "CfgSyncPlugin: customer disable feature opt in, the origin config on cdn will apply", - stepDelay: 10, useFakeTimers: true, - steps: [ () => { + test: () => { let doc = getGlobal(); hookFetch((resolve) => { // global instance cannot access test private instance AITestClass.orgSetTimeout(function() { @@ -398,20 +431,28 @@ export class CdnThrottle extends AITestClass { cfgUrl: "testurl" }}, featureOptIn : { - ["enableWParamFeature"]: {mode: FeatureOptInMode.enable}} + ["enableWParamFeature"]: {mode: FeatureOptInMode.enable}} } }); this.init.loadAppInsights(); this._ai = this.init; - }].concat(PollingAssert.createPollingAssert(() => { - if (this.fetchStub.called){ - Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].disabled, true); - Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation].disabled, true); - Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber, throttleCfgDisable[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber); - return true; - } - return false; - }, "response received", 60, 1000) as any) + + return this._asyncQueue().add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + this.clock.tick(1) + return true; + } + return false; + }, "response received", 60, 1000)).add(PollingAssert.asyncTaskPollingAssert(() => { + if (this.fetchStub.called){ + Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].disabled, true); + Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.CdnDeprecation].disabled, true); + Assert.equal(this.init.config.throttleMgrCfg[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber, throttleCfgDisable[_eInternalMessageId.InstrumentationKeyDeprecation].limit?.maxSendNumber); + return true; + } + return false; + }, "response received", 60, 1000) as any); + } }); diff --git a/AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts b/AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts index f0377cb40..3a6048f60 100644 --- a/AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts +++ b/AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts @@ -65,36 +65,35 @@ export class SanitizerE2ETests extends AITestClass { Assert.ok(!this.errorSpy.called, "no error sending"); } - this.testCaseAsync({ + this.testCase({ name: "SanitizerE2ETests: RDD Telemetry sanitizes long names", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { this._ai.trackDependencyData({ id: newId(), name: new Array(1234).join("a"), // exceeds max of 1024 responseCode: 200 }); - } - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called); - }, "Wait for response") as any) - .concat(() => { + }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called); + }, "Wait for response") as any) + .add(() => { boilerPlateAsserts(); }) - .concat(() => { + .add(() => { Assert.ok(this.loggingSpy.called); Assert.equal(LoggingSeverity.WARNING, this.loggingSpy.args[0][0]); Assert.equal(_eInternalMessageId.StringValueTooLong, this.loggingSpy.args[0][1]); - }) + }); + } }) - this.testCaseAsync({ + this.testCase({ name: "Sanitizer2ETests: Data platform accepts sanitized names", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { const properties = { "property1%^~`": "hello", @@ -106,21 +105,21 @@ export class SanitizerE2ETests extends AITestClass { }; this._ai.trackMetric({name: "test", average: 5}); - }, - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); - }, "Wait for response") as any) - .concat(() => { - boilerPlateAsserts(); }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); + }, "Wait for response") as any) + .add(() => { + boilerPlateAsserts(); + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Sanitizer2ETests: Data platform accepts legal charater set names", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { const properties = { "abcdefghijklmnopqrstuvwxyz": "hello", "ABCDEFGHIJKLMNOPQRSTUVWXYZ": "world" @@ -131,40 +130,40 @@ export class SanitizerE2ETests extends AITestClass { }; this._ai.trackMetric({name: "test", average: 5}); - }, - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); - }, "Wait for response") as any) - .concat(() => { - boilerPlateAsserts(); }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); + }, "Wait for response") as any) + .add(() => { + boilerPlateAsserts(); + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 150 charaters for names", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { const len = 150; const name = new Array(len + 1).join('a'); this._ai.trackMetric({name, average: 5}); - }, - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); - }, "Wait for response") as any) - .concat(() => { - boilerPlateAsserts(); }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); + }, "Wait for response") as any) + .add(() => { + boilerPlateAsserts(); + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 1024 charaters for values", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { const len = 1024; const value = new Array(len + 1).join('a'); @@ -173,53 +172,54 @@ export class SanitizerE2ETests extends AITestClass { }; this._ai.trackMetric({name: "test", average: 5}); - }, - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); - }, "Wait for response") as any) - .concat(() => { - boilerPlateAsserts(); }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); + }, "Wait for response") as any) + .add(() => { + boilerPlateAsserts(); + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 2048 characters for url", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { const len = 2048; let url = "http://hello.com/"; url = url + new Array(len - url.length + 1).join('a'); this._ai.trackPageView({name: "test", uri: url}); - }, - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); - }, "Wait for response") as any) - .concat(() => { - boilerPlateAsserts(); }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); + }, "Wait for response") as any) + .add(() => { + boilerPlateAsserts(); + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Sanitizer2ETests: Data platform accepts up to 32768 characters for messages", - stepDelay: this.delay, - steps: [ - () => { + test: () => { + return this._asyncQueue().add(() => { const len = 32768; const message = new Array(len + 1).join('a'); this._ai.trackTrace({message, severityLevel: 0}); - }, - ].concat(PollingAssert.createPollingAssert(() => { - Assert.ok(true, "waiting for response " + new Date().toISOString()); - return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); - }, "Wait for response") as any) - .concat(() => { - boilerPlateAsserts(); }) + .add(PollingAssert.asyncTaskPollingAssert(() => { + Assert.ok(true, "waiting for response " + new Date().toISOString()); + return (this.successSpy.called || this.errorSpy.called || this.loggingSpy.called); + }, "Wait for response") as any) + .add(() => { + boilerPlateAsserts(); + }); + } }); } } diff --git a/AISKU/Tests/Unit/src/validate.e2e.tests.ts b/AISKU/Tests/Unit/src/validate.e2e.tests.ts index 99ae6a31e..95b8045a7 100644 --- a/AISKU/Tests/Unit/src/validate.e2e.tests.ts +++ b/AISKU/Tests/Unit/src/validate.e2e.tests.ts @@ -64,123 +64,125 @@ export class ValidateE2ETests extends AITestClass { } private addAsyncTests(): void { - this.testCaseAsync({ + + this.testCase({ name: "Validate track event", - stepDelay: this.delay, - steps: [ - () => { - this._ai.trackTrace({message: "test"}); - this._ai.trackTrace({message: "test event"}, { p1: "value 1", p2: "value 2", m1: 123, m2: 456.7 }); - }] - .concat(this.waitForResponse()) - .concat(this.boilerPlateAsserts) - .concat(() => { - const acceptedItems = this.getPayloadMessages(this.successSpy).length; - Assert.equal(2, acceptedItems, "backend should accept two events"); - if (acceptedItems != 2) { - this.dumpPayloadMessages(this.successSpy); - } - }) + test: () => { + this._ai.trackTrace({message: "test"}); + this._ai.trackTrace({message: "test event"}, { p1: "value 1", p2: "value 2", m1: 123, m2: 456.7 }); + + return this._asyncQueue() + .add(this.waitForResponse()) + .add(() => { + this.boilerPlateAsserts(); + const acceptedItems = this.getPayloadMessages(this.successSpy).length; + Assert.equal(2, acceptedItems, "backend should accept two events"); + if (acceptedItems != 2) { + this.dumpPayloadMessages(this.successSpy); + } + }); + } }); - this.testCaseAsync({ + this.testCase({ name: 'E2E.GenericTests: trackEvent sends to backend with NaN value could be handled correctly', - stepDelay: this.delay, - steps: [ - () => { - const customeProperties = { - nanValue: NaN, - } - this._ai.trackEvent({ name: 'event', properties: { "prop1": NaN, "prop2": NaN }}, customeProperties); - }] - .concat(this.waitForResponse()) - .concat(this.boilerPlateAsserts) - .concat(() => { - const acceptedItems = this.getPayloadMessages(this.successSpy).length; - Assert.equal(1, acceptedItems, "backend should accept two events"); - if (acceptedItems != 1) { - this.dumpPayloadMessages(this.successSpy); - } - const payloadStr: string[] = this.getPayloadMessages(this.successSpy); - if (payloadStr.length > 0) { - const payload = JSON.parse(payloadStr[0]); - const data = payload.data; - Assert.ok(data && data.baseData); - Assert.equal(null, data.baseData.measurements["nanValue"]); - Assert.equal("NaN", data.baseData.properties["prop1"]); - } - }) + test: () => { + const customeProperties = { + nanValue: NaN, + } + this._ai.trackEvent({ name: 'event', properties: { "prop1": NaN, "prop2": NaN }}, customeProperties); + + return this._asyncQueue() + .add(this.waitForResponse()) + .add(() => { + this.boilerPlateAsserts(); + const acceptedItems = this.getPayloadMessages(this.successSpy).length; + Assert.equal(1, acceptedItems, "backend should accept two events"); + if (acceptedItems != 1) { + this.dumpPayloadMessages(this.successSpy); + } + const payloadStr: string[] = this.getPayloadMessages(this.successSpy); + if (payloadStr.length > 0) { + const payload = JSON.parse(payloadStr[0]); + const data = payload.data; + Assert.ok(data && data.baseData); + Assert.equal(null, data.baseData.measurements["nanValue"]); + Assert.equal("NaN", data.baseData.properties["prop1"]); + } + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Validate that track event takes all type of characters", - stepDelay: this.delay, - steps: [ - () => { - const s1 = "شلاؤيثبلاهتنمةىخحضقسفعشلاؤيصثبل"; - const s2 = "Ինչու՞ նրանք չեն խոսում Հայերեն"; - const s3 = "ওরা কন বাংলা বলেত পাের না"; - const s4 = "妣 啊 僜刓嘰塡奬〉媆孿 偁偄偙 偁A偄E偆I偊O偍U"; - const s5 = "ßüµ€ÄäÖö€ ερτυθιοπαδφγηξκλζχψωβνΔΦΓΗΞΚΛΨΩΘ რატომ"; - const s6 = "йцуукенгшщзхъфываполджэс"; - const s7 = "\x0000\x0001\x0002\x0003\x0004\x0005\x0006\x0007\x0008\x009F"; - - // white spaces - this._ai.trackTrace({message: " abcd efg "}, { " abc " : "value 1", " " : "value 2" }); - - // international characters - this._ai.trackTrace({message: s1}, { p: s2 }); - this._ai.trackTrace({message: s3}, { p: s4 }); - this._ai.trackTrace({message: s5}, { p: s6, p2: s7 }); - }] - .concat(this.waitForResponse()) - .concat(this.boilerPlateAsserts) - .concat(() => { - let acceptedItems = 0; - this.successSpy.args.forEach(call => { - call[0].forEach(item => { - let message = item; - if (typeof item !== "string") { - message = item.item; - } - // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) - if (message.indexOf("AI (Internal): 72 ") == -1) { - acceptedItems ++; - } + test: () => { + const s1 = "شلاؤيثبلاهتنمةىخحضقسفعشلاؤيصثبل"; + const s2 = "Ինչու՞ նրանք չեն խոսում Հայերեն"; + const s3 = "ওরা কন বাংলা বলেত পাের না"; + const s4 = "妣 啊 僜刓嘰塡奬〉媆孿 偁偄偙 偁A偄E偆I偊O偍U"; + const s5 = "ßüµ€ÄäÖö€ ερτυθιοπαδφγηξκλζχψωβνΔΦΓΗΞΚΛΨΩΘ რატომ"; + const s6 = "йцуукенгшщзхъфываполджэс"; + const s7 = "\x0000\x0001\x0002\x0003\x0004\x0005\x0006\x0007\x0008\x009F"; + + // white spaces + this._ai.trackTrace({message: " abcd efg "}, { " abc " : "value 1", " " : "value 2" }); + + // international characters + this._ai.trackTrace({message: s1}, { p: s2 }); + this._ai.trackTrace({message: s3}, { p: s4 }); + this._ai.trackTrace({message: s5}, { p: s6, p2: s7 }); + + return this._asyncQueue() + .add(this.waitForResponse()) + .add(() => { + this.boilerPlateAsserts(); + let acceptedItems = 0; + this.successSpy.args.forEach(call => { + call[0].forEach(item => { + let message = item; + if (typeof item !== "string") { + message = item.item; + } + // Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser) + if (message.indexOf("AI (Internal): 72 ") == -1) { + acceptedItems ++; + } + }); }); - }); - Assert.equal(4, acceptedItems, "backend should accept all four events"); - if (acceptedItems != 4) { - this.dumpPayloadMessages(this.successSpy); - } - }) + Assert.equal(4, acceptedItems, "backend should accept all four events"); + if (acceptedItems != 4) { + this.dumpPayloadMessages(this.successSpy); + } + }); + } }); - this.testCaseAsync({ + this.testCase({ name: "Validate that special characters are handled correctly", - stepDelay: this.delay, - steps: [ - () => { - const s1 = "[]{};,.)(*&^%$#@/\\"; - - this._ai.trackTrace({message: s1}, { p: s1 }); - this._ai.trackTrace({message: "a"}, { "[]{};,.)(*&^%$#@/\\": "b" }); - }] - .concat(this.waitForResponse()) - .concat(this.boilerPlateAsserts) - .concat(() => { - const acceptedItems = this.getPayloadMessages(this.successSpy).length; - Assert.equal(2, acceptedItems, "backend should accept the event"); - if (acceptedItems != 2) { - this.dumpPayloadMessages(this.successSpy); - } - }) + test: () => { + const s1 = "[]{};,.)(*&^%$#@/\\"; + + this._ai.trackTrace({message: s1}, { p: s1 }); + this._ai.trackTrace({message: "a"}, { "[]{};,.)(*&^%$#@/\\": "b" }); + + return this._asyncQueue() + .add(this.waitForResponse()) + .add(() => { + this.boilerPlateAsserts(); + const acceptedItems = this.getPayloadMessages(this.successSpy).length; + Assert.equal(2, acceptedItems, "backend should accept the event"); + if (acceptedItems != 2) { + this.dumpPayloadMessages(this.successSpy); + } + }); + } }); } + private waitForResponse() { - return PollingAssert.createPollingAssert(() => { + return PollingAssert.asyncTaskPollingAssert(() => { return (this.successSpy.called || this.errorSpy.called); }, "Wait for response" + new Date().toISOString(), 15, 1000) as any } diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index c6e71496d..b56c170c6 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -234,18 +234,18 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.0.tgz", - "integrity": "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", + "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.1.tgz", - "integrity": "sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", + "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", "peer": true, "dependencies": { "@types/json-schema": "^7.0.15" @@ -321,9 +321,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.32.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.32.0.tgz", - "integrity": "sha512-BBpRFZK3eX6uMLKz8WxFOBIFFcGFJ/g8XuwjTHCqHROSIsopI+ddn/d5Cfh36+7+e5edVS8dbSHnBNhrLEX0zg==", + "version": "9.33.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz", + "integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==", "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -342,12 +342,12 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.4.tgz", - "integrity": "sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", + "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", "peer": true, "dependencies": { - "@eslint/core": "^0.15.1", + "@eslint/core": "^0.15.2", "levn": "^0.4.1" }, "engines": { @@ -1734,9 +1734,9 @@ "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==" }, "node_modules/@types/qunit": { - "version": "2.19.12", - "resolved": "https://registry.npmjs.org/@types/qunit/-/qunit-2.19.12.tgz", - "integrity": "sha512-II+C1wgzUia0g+tGAH+PBb4XiTm8/C/i6sN23r21NNskBYOYrv+qnW0tFQ/IxZzKVwrK4CTglf8YO3poJUclQA==" + "version": "2.19.13", + "resolved": "https://registry.npmjs.org/@types/qunit/-/qunit-2.19.13.tgz", + "integrity": "sha512-N4xp3v4s7f0jb2Oij6+6xw5QhH7/IgHCoGIFLCWtbEWoPkGYp8Te4mIwIP21qaurr6ed5JiPMiy2/ZoiGPkLIw==" }, "node_modules/@types/react": { "version": "16.14.65", @@ -1786,16 +1786,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.38.0.tgz", - "integrity": "sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.1.tgz", + "integrity": "sha512-yYegZ5n3Yr6eOcqgj2nJH8cH/ZZgF+l0YIdKILSDjYFRjgYQMgv/lRjV5Z7Up04b9VYUondt8EPMqg7kTWgJ2g==", "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/type-utils": "8.38.0", - "@typescript-eslint/utils": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/scope-manager": "8.39.1", + "@typescript-eslint/type-utils": "8.39.1", + "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -1809,21 +1809,21 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.38.0", + "@typescript-eslint/parser": "^8.39.1", "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.38.0.tgz", - "integrity": "sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.39.1.tgz", + "integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==", "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/scope-manager": "8.39.1", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1", "debug": "^4.3.4" }, "engines": { @@ -1835,17 +1835,17 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz", - "integrity": "sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.39.1.tgz", + "integrity": "sha512-8fZxek3ONTwBu9ptw5nCKqZOSkXshZB7uAxuFF0J/wTMkKydjXCzqqga7MlFMpHi9DoG4BadhmTkITBcg8Aybw==", "peer": true, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.38.0", - "@typescript-eslint/types": "^8.38.0", + "@typescript-eslint/tsconfig-utils": "^8.39.1", + "@typescript-eslint/types": "^8.39.1", "debug": "^4.3.4" }, "engines": { @@ -1856,17 +1856,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.38.0.tgz", - "integrity": "sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.39.1.tgz", + "integrity": "sha512-RkBKGBrjgskFGWuyUGz/EtD8AF/GW49S21J8dvMzpJitOF1slLEbbHnNEtAHtnDAnx8qDEdRrULRnWVx27wGBw==", "peer": true, "dependencies": { - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0" + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1877,9 +1877,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz", - "integrity": "sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.1.tgz", + "integrity": "sha512-ePUPGVtTMR8XMU2Hee8kD0Pu4NDE1CN9Q1sxGSGd/mbOtGZDM7pnhXNJnzW63zk/q+Z54zVzj44HtwXln5CvHA==", "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1889,18 +1889,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz", - "integrity": "sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.39.1.tgz", + "integrity": "sha512-gu9/ahyatyAdQbKeHnhT4R+y3YLtqqHyvkfDxaBYk97EcbfChSJXyaJnIL3ygUv7OuZatePHmQvuH5ru0lnVeA==", "peer": true, "dependencies": { - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/utils": "8.38.0", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/utils": "8.39.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -1913,13 +1913,13 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz", - "integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.39.1.tgz", + "integrity": "sha512-7sPDKQQp+S11laqTrhHqeAbsCfMkwJMrV7oTDvtDds4mEofJYir414bYKUEb8YPUm9QL3U+8f6L6YExSoAGdQw==", "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1930,15 +1930,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz", - "integrity": "sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.1.tgz", + "integrity": "sha512-EKkpcPuIux48dddVDXyQBlKdeTPMmALqBUbEk38McWv0qVEZwOpVJBi7ugK5qVNgeuYjGNQxrrnoM/5+TI/BPw==", "peer": true, "dependencies": { - "@typescript-eslint/project-service": "8.38.0", - "@typescript-eslint/tsconfig-utils": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/project-service": "8.39.1", + "@typescript-eslint/tsconfig-utils": "8.39.1", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1954,7 +1954,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -1994,15 +1994,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz", - "integrity": "sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.39.1.tgz", + "integrity": "sha512-VF5tZ2XnUSTuiqZFXCZfZs1cgkdd3O/sSYmdo2EpSyDlC86UM/8YytTmKnehOW3TGAlivqTDT6bS87B/GQ/jyg==", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0" + "@typescript-eslint/scope-manager": "8.39.1", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2013,16 +2013,16 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.38.0.tgz", - "integrity": "sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==", + "version": "8.39.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.1.tgz", + "integrity": "sha512-W8FQi6kEh2e8zVhQ0eeRnxdvIoOkAp/CPAahcNio6nO9dsIwb9b34z90KOlheoyuVf6LSOEdjlkxSkapNEc+4A==", "peer": true, "dependencies": { - "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/types": "8.39.1", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -2347,9 +2347,9 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/bare-events": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz", - "integrity": "sha512-EKZ5BTXYExaNqi3I3f9RtEsaI/xBSGjE0XZCZilPzFAV/goswFHuPd9jEZlPIZ/iNZJwDSao9qRiScySz7MbQg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.1.tgz", + "integrity": "sha512-AuTJkq9XmE6Vk0FJVNq5QxETrSA/vKHarWVBG5l/JbdCL1prJemiyJqUS0jrlXO0MftuPq4m3YVYhoNc5+aE/g==", "optional": true }, "node_modules/bare-fs": { @@ -2471,9 +2471,9 @@ } }, "node_modules/browserslist": { - "version": "4.25.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.1.tgz", - "integrity": "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==", + "version": "4.25.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.2.tgz", + "integrity": "sha512-0si2SJK3ooGzIawRu61ZdPCO1IncZwS8IzuX73sPZsXW6EQ/w/DAfPyKI8l1ETTCr2MnvqWitmlCUxgdul45jA==", "funding": [ { "type": "opencollective", @@ -2489,8 +2489,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001726", - "electron-to-chromium": "^1.5.173", + "caniuse-lite": "^1.0.30001733", + "electron-to-chromium": "^1.5.199", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -2541,9 +2541,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001731", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz", - "integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==", + "version": "1.0.30001734", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001734.tgz", + "integrity": "sha512-uhE1Ye5vgqju6OI71HTQqcBCZrvHugk0MjLak7Q+HfoBgoq5Bi+5YnwjP4fjDgrtYr/l8MVRBvzz9dPD4KyK0A==", "funding": [ { "type": "opencollective", @@ -2921,9 +2921,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.5.194", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.194.tgz", - "integrity": "sha512-SdnWJwSUot04UR51I2oPD8kuP2VI37/CADR1OHsFOUzZIvfWJBO6q11k5P/uKNyTT3cdOsnyjkrZ+DDShqYqJA==" + "version": "1.5.200", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.200.tgz", + "integrity": "sha512-rFCxROw7aOe4uPTfIAx+rXv9cEcGx+buAF4npnhtTqCJk5KDFRnh3+KYj7rdVh6lsFt5/aPs+Irj9rZ33WMA7w==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -3024,19 +3024,19 @@ } }, "node_modules/eslint": { - "version": "9.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.32.0.tgz", - "integrity": "sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg==", + "version": "9.33.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.33.0.tgz", + "integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==", "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.0", - "@eslint/core": "^0.15.0", + "@eslint/config-helpers": "^0.3.1", + "@eslint/core": "^0.15.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.32.0", - "@eslint/plugin-kit": "^0.3.4", + "@eslint/js": "9.33.0", + "@eslint/plugin-kit": "^0.3.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", @@ -3562,9 +3562,9 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "node_modules/fs-extra": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", - "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.1.tgz", + "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -5381,6 +5381,7 @@ "version": "24.8.2", "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-24.8.2.tgz", "integrity": "sha512-Sn6SBPwJ6ASFvQ7knQkR+yG7pcmr4LfXzmoVp3NR0xXyBbPhJa8a8ybtb6fnw1g/DD/2t34//yirubVczko37w==", + "deprecated": "< 24.9.0 is no longer supported", "hasInstallScript": true, "dependencies": { "@puppeteer/browsers": "2.10.4", @@ -6775,9 +6776,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", - "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", "bin": { "yaml": "bin.mjs" }, From be482660a9afd8c7d3fe371db71577c4d17c710c Mon Sep 17 00:00:00 2001 From: Karlie Li Date: Sat, 16 Aug 2025 15:05:46 -0700 Subject: [PATCH 2/2] udpate --- common/config/rush/npm-shrinkwrap.json | 64 ++++++++++---------------- package.json | 3 +- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index b56c170c6..e6a155fa9 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -435,9 +435,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", - "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==" + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" }, "node_modules/@microsoft/api-extractor": { "version": "7.52.10", @@ -2353,9 +2353,9 @@ "optional": true }, "node_modules/bare-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.6.tgz", - "integrity": "sha512-25RsLF33BqooOEFNdMcEhMpJy8EoR88zSMrnOQOaM3USnOK2VmaJ1uaQEwPA6AQjrv1lXChScosN6CzbwbO9OQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.2.0.tgz", + "integrity": "sha512-oRfrw7gwwBVAWx9S5zPMo2iiOjxyiZE12DmblmMQREgcogbNO0AFaZ+QBxxkEXiPspcpvO/Qtqn8LabUx4uYXg==", "optional": true, "dependencies": { "bare-events": "^2.5.4", @@ -2393,9 +2393,9 @@ } }, "node_modules/bare-stream": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.5.tgz", - "integrity": "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.7.0.tgz", + "integrity": "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==", "optional": true, "dependencies": { "streamx": "^2.21.0" @@ -2541,9 +2541,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001734", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001734.tgz", - "integrity": "sha512-uhE1Ye5vgqju6OI71HTQqcBCZrvHugk0MjLak7Q+HfoBgoq5Bi+5YnwjP4fjDgrtYr/l8MVRBvzz9dPD4KyK0A==", + "version": "1.0.30001735", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001735.tgz", + "integrity": "sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==", "funding": [ { "type": "opencollective", @@ -2921,9 +2921,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.5.200", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.200.tgz", - "integrity": "sha512-rFCxROw7aOe4uPTfIAx+rXv9cEcGx+buAF4npnhtTqCJk5KDFRnh3+KYj7rdVh6lsFt5/aPs+Irj9rZ33WMA7w==" + "version": "1.5.203", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.203.tgz", + "integrity": "sha512-uz4i0vLhfm6dLZWbz/iH88KNDV+ivj5+2SA+utpgjKaj9Q0iDLuwk6Idhe9BTxciHudyx6IvTvijhkPvFGUQ0g==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -4202,22 +4202,13 @@ "integrity": "sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==" }, "node_modules/ip-address": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", - "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", - "dependencies": { - "jsbn": "1.1.0", - "sprintf-js": "^1.1.3" - }, + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", "engines": { "node": ">= 12" } }, - "node_modules/ip-address/node_modules/sprintf-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" - }, "node_modules/is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", @@ -4395,11 +4386,6 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "node_modules/jsbn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -4423,9 +4409,9 @@ "peer": true }, "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", "dependencies": { "universalify": "^2.0.0" }, @@ -6121,11 +6107,11 @@ } }, "node_modules/socks": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", - "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", "dependencies": { - "ip-address": "^9.0.5", + "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" }, "engines": { diff --git a/package.json b/package.json index 7ac081d12..1815e0407 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "rollup-plugin-sourcemaps": "^0.6.3", "typedoc": "^0.26.6", "typescript": "^4.9.3", - "whatwg-fetch": "^3.6.2" + "whatwg-fetch": "^3.6.2", + "@types/node": "18.19.121" } }