Skip to content
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
10 changes: 9 additions & 1 deletion .aiAutoMinify.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,19 @@
"eLoggingSeverity",
"_eInternalMessageId",
"SendRequestReason",
"TransportType",
"eStatsType",
"TelemetryUnloadReason",
"TelemetryUpdateReason",
"eTraceHeadersMode",
"eValueKind",
"EventLatencyValue",
"eEventPropertyType",
"EventSendType",
"eTraceLevel",
"_eExtendedInternalMessageId",
"GuidStyle",
"FieldValueSanitizerType",
"TransportType",
"eAttributeChangeOp",
"eOTelSeverityNumber",
"eOTelSamplingDecision",
Expand Down
30 changes: 11 additions & 19 deletions AISKU/Tests/Unit/src/CdnThrottle.tests.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { AppInsightsSku } from "../../../src/AISku";
import { ApplicationInsightsContainer } from "../../../src/ApplicationInsightsContainer";
import { IApplicationInsights } from "../../../src/IApplicationInsights";
import { Snippet } from "../../../src/Snippet";
import { AITestClass, Assert, IFetchArgs, PollingAssert } from "@microsoft/ai-test-framework";
import { IConfig, IConfiguration, LoggingSeverity, _eInternalMessageId, IThrottleInterval, IThrottleLimit, IThrottleMgrConfig } from "@microsoft/otel-core-js";
import { SinonSpy } from "sinon";
import { createSnippetV5 } from "./testSnippetV5";
import { CdnFeatureMode, FeatureOptInMode, getGlobal, getGlobalInst, isFunction, newId } from "@microsoft/otel-core-js";
import { createSnippetV6 } from "./testSnippetV6";
import { IConfig, IConfiguration, _eInternalMessageId, IThrottleMgrConfig } from "@microsoft/otel-core-js";
import { CdnFeatureMode, FeatureOptInMode, getGlobal, getGlobalInst } from "@microsoft/otel-core-js";
import { CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode } from "@microsoft/applicationinsights-cfgsync-js";
import { createSyncPromise, doAwait } from "@nevware21/ts-async";
import { ICfgSyncCdnConfig } from "@microsoft/applicationinsights-cfgsync-js/src/Interfaces/ICfgSyncCdnConfig";
const ApplicationInsights = AppInsightsSku;
import { createSyncPromise } from "@nevware21/ts-async";


const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11';
Expand Down Expand Up @@ -87,11 +79,11 @@ const sampleConfig = {

export class CdnThrottle extends AITestClass {
private _ai: AppInsightsSku;
private getAi: ApplicationInsights;
private getAi: AppInsightsSku;
private _config: IConfiguration | IConfig;
private identifier: string;
private fetchStub: any;
init: ApplicationInsights;
init: AppInsightsSku;
private res: any;
private _fetch: any;
loggingSpy: any;
Expand Down Expand Up @@ -185,7 +177,7 @@ export class CdnThrottle extends AITestClass {
}, 0);
});
this.fetchStub = this.sandbox.spy((doc as any), "fetch");
this.init = new ApplicationInsights({
this.init = new AppInsightsSku({
config: {
instrumentationKey: TestInstrumentationKey,
featureOptIn : {["iKeyUsage"]: {mode: FeatureOptInMode.disable}},
Expand Down Expand Up @@ -240,7 +232,7 @@ export class CdnThrottle extends AITestClass {
});

this.fetchStub = this.sandbox.spy((doc as any), "fetch");
this.init = new ApplicationInsights({
this.init = new AppInsightsSku({
config: this._config,
});
this.init.loadAppInsights();
Expand Down Expand Up @@ -283,7 +275,7 @@ export class CdnThrottle extends AITestClass {
};

this.fetchStub = this.sandbox.spy((doc as any), "fetch");
this.init = new ApplicationInsights({
this.init = new AppInsightsSku({
config: noSetconfig,
});
this.init.loadAppInsights();
Expand Down Expand Up @@ -341,7 +333,7 @@ export class CdnThrottle extends AITestClass {
}}
};

this.init = new ApplicationInsights({
this.init = new AppInsightsSku({
config: config,
});
this.init.loadAppInsights();
Expand Down Expand Up @@ -382,7 +374,7 @@ export class CdnThrottle extends AITestClass {
}, 0);
});
this.fetchStub = this.sandbox.spy((doc as any), "fetch");
this.init = new ApplicationInsights({
this.init = new AppInsightsSku({
config: {
instrumentationKey: TestInstrumentationKey,
extensionConfig : {["AppInsightsCfgSyncPlugin"] : {
Expand Down Expand Up @@ -426,7 +418,7 @@ export class CdnThrottle extends AITestClass {
}, 0);
});
this.fetchStub = this.sandbox.spy((doc as any), "fetch");
this.init = new ApplicationInsights({
this.init = new AppInsightsSku({
config: {
instrumentationKey: TestInstrumentationKey,
extensionConfig : {["AppInsightsCfgSyncPlugin"] : {
Expand Down
5 changes: 2 additions & 3 deletions AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
BreezeChannelIdentifier, ContextTagKeys, DistributedTracingModes, IConfig, IDependencyTelemetry, RequestHeaders,
utlRemoveSessionStorage, utlSetSessionStorage
} from "@microsoft/otel-core-js";
import { getGlobal } from "@microsoft/applicationinsights-shims";
import { IPropTelemetryContext } from "@microsoft/applicationinsights-properties-js";
import { dumpObj, isPromiseLike, objHasOwnProperty, strSubstring } from "@nevware21/ts-utils";
import { AppInsightsSku } from "../../../src/AISku";
Expand Down Expand Up @@ -1060,12 +1059,12 @@ export class SnippetInitializationTests extends AITestClass {
});
}

private _initializeSnippet(snippet: Snippet): IApplicationInsights {
private _initializeSnippet(snippet: Snippet): AppInsightsSku {
try {
//this.useFakeServer = false;

// Call the initialization
((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as IApplicationInsights);
((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as AppInsightsSku);

// Setup Sinon stuff
const appInsights: AppInsightsSku = (snippet as any).appInsights;
Expand Down
14 changes: 6 additions & 8 deletions AISKU/Tests/Unit/src/ThrottleSentMessage.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { ApplicationInsightsContainer } from "../../../src/ApplicationInsightsCo
import { IApplicationInsights } from "../../../src/IApplicationInsights";
import { Snippet } from "../../../src/Snippet";
import { AITestClass, Assert } from "@microsoft/ai-test-framework";
import { IConfig, IConfiguration, LoggingSeverity, _eInternalMessageId, IThrottleInterval, IThrottleLimit, IThrottleMgrConfig } from "@microsoft/otel-core-js";
import { SinonSpy } from "sinon";
import { IConfig, IConfiguration, _eInternalMessageId, IThrottleInterval, IThrottleLimit, IThrottleMgrConfig } from "@microsoft/otel-core-js";
import { createSnippetV5 } from "./testSnippetV5";
import { FeatureOptInMode, newId } from "@microsoft/otel-core-js";
import { createSnippetV6 } from "./testSnippetV6";
const ApplicationInsights = AppInsightsSku;

const TestInstrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11';

Expand All @@ -27,7 +25,7 @@ const tconfig = {

export class ThrottleSentMessage extends AITestClass {
private _ai: IApplicationInsights;
private getAi: ApplicationInsights;
private getAi: AppInsightsSku;
private _config: IConfiguration | IConfig;
private _logger;

Expand Down Expand Up @@ -65,7 +63,7 @@ export class ThrottleSentMessage extends AITestClass {
this.useFakeServer = false;
this._config = this._getTestConfig();

const init = new ApplicationInsights({
const init = new AppInsightsSku({
config: this._config
});

Expand Down Expand Up @@ -197,7 +195,7 @@ export class ThrottleSentMessage extends AITestClass {
let config = this._getTestConfig();
config.throttleMgrCfg= {[_eInternalMessageId.InstrumentationKeyDeprecation]:tconfig, [_eInternalMessageId.DefaultThrottleMsgKey]:tconfig};
config.featureOptIn = {["iKeyUsage"]: {mode: FeatureOptInMode.disable}}
let init = new ApplicationInsights({
let init = new AppInsightsSku({
config: config
});

Expand Down Expand Up @@ -257,12 +255,12 @@ export class ThrottleSentMessage extends AITestClass {
}


private _initializeSnippet(snippet: Snippet): ApplicationInsights {
private _initializeSnippet(snippet: Snippet): AppInsightsSku {
try {
//this.useFakeServer = false;

// Call the initialization
((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as IApplicationInsights);
((ApplicationInsightsContainer.getAppInsights(snippet, snippet.version)) as AppInsightsSku);

// Setup Sinon stuff
const appInsights: AppInsightsSku = (snippet as any).appInsights;
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ApplicationInsightsTests extends AITestClass {

// Context
private tagKeys = new ContextTagKeys();
private _config;
private _config: IConfiguration;
private _appId: string;
private _ctx: any;

Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Unit/src/sanitizer.e2e.tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppInsightsSku is imported as a named import alongside the alias AppInsightsSku as ApplicationInsights, but only the ApplicationInsights alias is used in this file. The bare AppInsightsSku import is unused and can be removed.

Suggested change
import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku";

Copilot uses AI. Check for mistakes.
import { IApplicationInsights } from "../../../src/IApplicationInsights";
import { Sender } from "@microsoft/applicationinsights-channel-js";
import { AITestClass, Assert, PollingAssert } from "@microsoft/ai-test-framework";
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Unit/src/sender.e2e.tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppInsightsSku is imported as a named import alongside the alias AppInsightsSku as ApplicationInsights, but only the ApplicationInsights alias is used in this file. The bare AppInsightsSku import is unused and can be removed to keep the import clean: import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku";

Suggested change
import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku";

Copilot uses AI. Check for mistakes.
import { IApplicationInsights } from "../../../src/IApplicationInsights";
import { Sender } from "@microsoft/applicationinsights-channel-js";
import { BreezeChannelIdentifier, utlGetSessionStorage, utlRemoveSessionStorage } from "@microsoft/otel-core-js";
Expand Down
4 changes: 3 additions & 1 deletion AISKU/Tests/es6-module-type-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"module": "dist-es5/applicationinsights-test-module-type-check.js",
"types": "types/applicationinsights-test-module-type-check.d.ts",
"scripts": {
"clean": "git clean -xdf",
"clean": "node -e \"['dist','dist-es5','build','browser','types','temp','rush-logs'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"clean-modules": "node -e \"['node_modules'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"full-clean": "npm run clean-modules && npm run clean && git clean -xdf",
"build": "tsc --project tsconfig.json --noEmit",
"rebuild": "npm run build",
"test": "",
Expand Down
10 changes: 6 additions & 4 deletions AISKU/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"url": "https://github.com/microsoft/ApplicationInsights-JS"
},
"scripts": {
"clean": "rimraf dist dist-es5 build browser types temp rush-logs",
"clean": "node -e \"['dist','dist-es5','build','browser','types','temp','rush-logs'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"full-clean-es6-tests": "cd Tests/es6-module-type-check && npm run full-clean && cd ../..",
"full-clean": "npm run full-clean-es6-tests && git clean -xdf",
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
"build:esm": "grunt aisku",
"build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
Expand Down Expand Up @@ -42,8 +44,8 @@
"grunt-cli": "^1.4.3",
"@nevware21/ts-async": ">= 0.5.5 < 2.x",
"grunt-rollup": "^12.0.0",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"@nevware21/grunt-ts-plugin": "^0.5.2",
"@nevware21/grunt-eslint-ts": "^0.5.2",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"pako": "^2.0.3",
Expand Down Expand Up @@ -73,7 +75,7 @@
"@microsoft/otel-core-js": "0.0.1-alpha",
"@microsoft/applicationinsights-dependencies-js": "3.3.11",
"@microsoft/applicationinsights-properties-js": "3.3.11",
"@nevware21/ts-utils": ">= 0.12.6 < 2.x",
"@nevware21/ts-utils": ">= 0.13.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 2.x"
},
"license": "MIT"
Expand Down
3 changes: 1 addition & 2 deletions AISKU/src/ApplicationInsightsContainer.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { throwUnsupported } from "@nevware21/ts-utils";
import { AppInsightsSku } from "./AISku";
import { IApplicationInsights } from "./IApplicationInsights";
import { Snippet } from "./Snippet";

export class ApplicationInsightsContainer {

public static getAppInsights(snippet: Snippet, version: number) : IApplicationInsights {
public static getAppInsights(snippet: Snippet, version: number) : AppInsightsSku {
const theSku = new AppInsightsSku(snippet);

// Two target scenarios:
Expand Down
9 changes: 5 additions & 4 deletions AISKULight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"types": "types/applicationinsights-web-basic.d.ts",
"sideEffects": false,
"scripts": {
"clean": "rimraf dist dist-es5 build browser types temp rush-logs",
"clean": "node -e \"['dist','dist-es5','build','browser','types','temp','rush-logs'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"full-clean": "git clean -xdf",
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
"build:esm": "grunt aiskulite",
"build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
Expand Down Expand Up @@ -37,8 +38,8 @@
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"grunt-rollup": "^12.0.0",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"@nevware21/grunt-ts-plugin": "^0.5.2",
"@nevware21/grunt-eslint-ts": "^0.5.2",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"pako": "^2.0.3",
Expand All @@ -62,7 +63,7 @@
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-channel-js": "3.3.11",
"@microsoft/otel-core-js": "0.0.1-alpha",
"@nevware21/ts-utils": ">= 0.12.6 < 2.x",
"@nevware21/ts-utils": ">= 0.13.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 2.x"
},
"license": "MIT"
Expand Down
9 changes: 5 additions & 4 deletions channels/applicationinsights-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/applicationinsights-channel-js"
},
"scripts": {
"clean": "rimraf dist dist-es5 build browser types temp rush-logs",
"clean": "node -e \"['dist','dist-es5','build','browser','types','temp','rush-logs'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"full-clean": "git clean -xdf",
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
"build:esm": "grunt aichannel",
"build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
Expand All @@ -36,8 +37,8 @@
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"@nevware21/grunt-ts-plugin": "^0.5.2",
"@nevware21/grunt-eslint-ts": "^0.5.2",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^24.0.0",
Expand All @@ -58,7 +59,7 @@
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/otel-core-js": "0.0.1-alpha",
"@nevware21/ts-utils": ">= 0.12.6 < 2.x",
"@nevware21/ts-utils": ">= 0.13.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 2.x"
},
"license": "MIT"
Expand Down
9 changes: 5 additions & 4 deletions channels/tee-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/tee-channel-js"
},
"scripts": {
"clean": "git clean -xdf",
"clean": "node -e \"['dist','dist-es5','build','browser','types','temp','rush-logs'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"full-clean": "git clean -xdf",
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
"build:esm": "grunt teechannel",
"build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
Expand All @@ -37,8 +38,8 @@
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"grunt-cli": "^1.4.3",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-eslint-ts": "^0.5.1",
"@nevware21/grunt-ts-plugin": "^0.5.2",
"@nevware21/grunt-eslint-ts": "^0.5.2",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^24.0.0",
Expand All @@ -59,7 +60,7 @@
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/otel-core-js": "0.0.1-alpha",
"@nevware21/ts-utils": ">= 0.12.6 < 2.x",
"@nevware21/ts-utils": ">= 0.13.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 2.x"
},
"license": "MIT"
Expand Down
7 changes: 4 additions & 3 deletions common/Tests/Framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"module": "dist-es5/ai-test-framework.js",
"types": "types/ai-test-framework.d.ts",
"scripts": {
"clean": "git clean -xdf",
"clean": "node -e \"['dist','dist-es5','build','browser','types','temp','rush-logs'].forEach(d=>{try{require('fs').rmSync(d,{recursive:true,force:true})}catch(e){}})\"",
"full-clean": "git clean -xdf",
"build": "npm run build:esm && npm run build:browser",
"build:esm": "grunt tst-framework",
"build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
Expand All @@ -34,7 +35,7 @@
"@types/sinon": "4.3.3",
"grunt": "^1.5.3",
"grunt-rollup": "^12.0.0",
"@nevware21/grunt-ts-plugin": "^0.5.1",
"@nevware21/grunt-ts-plugin": "^0.5.2",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
Expand All @@ -54,7 +55,7 @@
},
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@nevware21/ts-utils": ">= 0.12.6 < 2.x",
"@nevware21/ts-utils": ">= 0.13.0 < 2.x",
"@nevware21/ts-async": ">= 0.5.5 < 2.x"
}
}
10 changes: 10 additions & 0 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@
"ignoreMissingScript": true,
"allowWarningsInSuccessfulBuild": true
},
{
"commandKind": "bulk",
"name": "full-clean",
"summary": "Run all full clean tasks to clean each project",
"description": "Run all full clean tasks to clean each project",
"safeForSimultaneousRushProcesses": true,
"enableParallelism": true,
"ignoreMissingScript": true,
"allowWarningsInSuccessfulBuild": true
},
{
"commandKind": "bulk",
"name": "api-docs",
Expand Down
Loading
Loading