@microsoft/applicationinsights-core-js 2.7.3-nightly.2112-07 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-core-js.integrity.json +9 -9
- package/browser/applicationinsights-core-js.js +44 -32
- package/browser/applicationinsights-core-js.js.map +1 -1
- package/browser/applicationinsights-core-js.min.js +2 -2
- package/browser/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.api.json +1 -1
- package/dist/applicationinsights-core-js.d.ts +1 -1
- package/dist/applicationinsights-core-js.js +44 -32
- package/dist/applicationinsights-core-js.js.map +1 -1
- package/dist/applicationinsights-core-js.min.js +2 -2
- package/dist/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.rollup.d.ts +1 -1
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +6 -3
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +24 -17
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
- package/dist-esm/applicationinsights-core-js.js +1 -1
- package/package.json +67 -70
- package/src/JavaScriptSDK/CookieMgr.ts +1 -1
- package/src/JavaScriptSDK/EnvUtils.ts +5 -2
- package/src/JavaScriptSDK/HelperFuncs.ts +23 -15
- package/src/JavaScriptSDK/PerfManager.ts +2 -2
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +1 -1
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 2.7.3
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 2.7.3
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
export { MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";
|
package/package.json
CHANGED
|
@@ -1,70 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@microsoft/applicationinsights-core-js",
|
|
3
|
-
"author": "Microsoft Application Insights Team",
|
|
4
|
-
"version": "2.7.3
|
|
5
|
-
"description": "Microsoft Application Insights Core Javascript SDK",
|
|
6
|
-
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"azure",
|
|
9
|
-
"cloud",
|
|
10
|
-
"script errors",
|
|
11
|
-
"microsoft",
|
|
12
|
-
"application insights",
|
|
13
|
-
"browser performance monitoring",
|
|
14
|
-
"web analytics"
|
|
15
|
-
],
|
|
16
|
-
"main": "dist/applicationinsights-core-js.js",
|
|
17
|
-
"module": "dist-esm/applicationinsights-core-js.js",
|
|
18
|
-
"types": "types/applicationinsights-core-js.d.ts",
|
|
19
|
-
"scripts": {
|
|
20
|
-
"clean": "grunt clean",
|
|
21
|
-
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
|
|
22
|
-
"build:esm": "grunt core",
|
|
23
|
-
"build:browser": "rollup -c rollup.config.js",
|
|
24
|
-
"rebuild": "npm run build",
|
|
25
|
-
"test": "grunt coreunittest",
|
|
26
|
-
"perftest": "grunt coreperftest",
|
|
27
|
-
"lint": "tslint -p tsconfig.json",
|
|
28
|
-
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights Core Javascript SDK\"",
|
|
29
|
-
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js"
|
|
30
|
-
},
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/shared/AppInsightsCore"
|
|
34
|
-
},
|
|
35
|
-
"license": "MIT",
|
|
36
|
-
"sideEffects": false,
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@microsoft/ai-test-framework": "0.0.1",
|
|
39
|
-
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
40
|
-
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
|
41
|
-
"@microsoft/api-extractor": "^7.18.1",
|
|
42
|
-
"grunt": "^1.4.1",
|
|
43
|
-
"grunt-cli": "^1.4.3",
|
|
44
|
-
"grunt-contrib-qunit": "^5.0.1",
|
|
45
|
-
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
46
|
-
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
47
|
-
"globby": "^11.0.0",
|
|
48
|
-
"magic-string": "^0.25.7",
|
|
49
|
-
"pako": "^2.0.3",
|
|
50
|
-
"@rollup/plugin-commonjs": "^18.0.0",
|
|
51
|
-
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
52
|
-
"@rollup/plugin-replace": "^2.3.3",
|
|
53
|
-
"rollup-plugin-cleanup": "3.2.1",
|
|
54
|
-
"rollup": "^2.32.0",
|
|
55
|
-
"typescript": "^4.3.4",
|
|
56
|
-
"tslib": "^2.0.0",
|
|
57
|
-
"qunit": "^2.11.2",
|
|
58
|
-
"sinon": "^7.3.1"
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"tslib": "*"
|
|
62
|
-
},
|
|
63
|
-
"dependencies": {
|
|
64
|
-
"@microsoft/applicationinsights-shims": "2.0.
|
|
65
|
-
"@microsoft/dynamicproto-js": "^1.1.4"
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
"tag": "nightly"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/applicationinsights-core-js",
|
|
3
|
+
"author": "Microsoft Application Insights Team",
|
|
4
|
+
"version": "2.7.3",
|
|
5
|
+
"description": "Microsoft Application Insights Core Javascript SDK",
|
|
6
|
+
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"azure",
|
|
9
|
+
"cloud",
|
|
10
|
+
"script errors",
|
|
11
|
+
"microsoft",
|
|
12
|
+
"application insights",
|
|
13
|
+
"browser performance monitoring",
|
|
14
|
+
"web analytics"
|
|
15
|
+
],
|
|
16
|
+
"main": "dist/applicationinsights-core-js.js",
|
|
17
|
+
"module": "dist-esm/applicationinsights-core-js.js",
|
|
18
|
+
"types": "types/applicationinsights-core-js.d.ts",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "grunt clean",
|
|
21
|
+
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
|
|
22
|
+
"build:esm": "grunt core",
|
|
23
|
+
"build:browser": "rollup -c rollup.config.js",
|
|
24
|
+
"rebuild": "npm run build",
|
|
25
|
+
"test": "grunt coreunittest",
|
|
26
|
+
"perftest": "grunt coreperftest",
|
|
27
|
+
"lint": "tslint -p tsconfig.json",
|
|
28
|
+
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights Core Javascript SDK\"",
|
|
29
|
+
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/shared/AppInsightsCore"
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@microsoft/ai-test-framework": "0.0.1",
|
|
39
|
+
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
40
|
+
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
|
41
|
+
"@microsoft/api-extractor": "^7.18.1",
|
|
42
|
+
"grunt": "^1.4.1",
|
|
43
|
+
"grunt-cli": "^1.4.3",
|
|
44
|
+
"grunt-contrib-qunit": "^5.0.1",
|
|
45
|
+
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
46
|
+
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
47
|
+
"globby": "^11.0.0",
|
|
48
|
+
"magic-string": "^0.25.7",
|
|
49
|
+
"pako": "^2.0.3",
|
|
50
|
+
"@rollup/plugin-commonjs": "^18.0.0",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
52
|
+
"@rollup/plugin-replace": "^2.3.3",
|
|
53
|
+
"rollup-plugin-cleanup": "3.2.1",
|
|
54
|
+
"rollup": "^2.32.0",
|
|
55
|
+
"typescript": "^4.3.4",
|
|
56
|
+
"tslib": "^2.0.0",
|
|
57
|
+
"qunit": "^2.11.2",
|
|
58
|
+
"sinon": "^7.3.1"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"tslib": "*"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@microsoft/applicationinsights-shims": "2.0.1",
|
|
65
|
+
"@microsoft/dynamicproto-js": "^1.1.4"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -140,7 +140,7 @@ export function createCookieMgr(rootConfig?: IConfiguration, logger?: IDiagnosti
|
|
|
140
140
|
if (_isMgrEnabled(cookieMgr)) {
|
|
141
141
|
let values: any = {};
|
|
142
142
|
let theValue = strTrim(value || strEmpty);
|
|
143
|
-
let idx = theValue.indexOf(";")
|
|
143
|
+
let idx = theValue.indexOf(";");
|
|
144
144
|
if (idx !== -1) {
|
|
145
145
|
theValue = strTrim(value.substring(0, idx));
|
|
146
146
|
values = _extractParts(value.substring(idx + 1));
|
|
@@ -19,6 +19,7 @@ declare var XDomainRequest: any;
|
|
|
19
19
|
|
|
20
20
|
const strWindow = "window";
|
|
21
21
|
const strDocument = "document";
|
|
22
|
+
const strDocumentMode = "documentMode";
|
|
22
23
|
const strNavigator = "navigator";
|
|
23
24
|
const strHistory = "history";
|
|
24
25
|
const strLocation = "location";
|
|
@@ -311,8 +312,10 @@ export function getIEVersion(userAgentStr: string = null): number {
|
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
var ua = (userAgentStr || "").toLowerCase();
|
|
315
|
+
// Also check for documentMode in case X-UA-Compatible meta tag was included in HTML.
|
|
314
316
|
if (strContains(ua, strMsie)) {
|
|
315
|
-
|
|
317
|
+
let doc = getDocument() || {} as Document;
|
|
318
|
+
return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));
|
|
316
319
|
} else if (strContains(ua, strTrident)) {
|
|
317
320
|
let tridentVer = parseInt(ua.split(strTrident)[1]);
|
|
318
321
|
if (tridentVer) {
|
|
@@ -383,7 +386,7 @@ export function isFetchSupported(withKeepAlive?: boolean): boolean {
|
|
|
383
386
|
|
|
384
387
|
export function useXDomainRequest(): boolean | undefined {
|
|
385
388
|
if (_useXDomainRequest === null) {
|
|
386
|
-
_useXDomainRequest = (typeof XDomainRequest !== undefined);
|
|
389
|
+
_useXDomainRequest = (typeof XDomainRequest !== "undefined");
|
|
387
390
|
if (_useXDomainRequest && isXhrSupported()) {
|
|
388
391
|
_useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst("XMLHttpRequest"), "withCredentials");
|
|
389
392
|
}
|
|
@@ -13,6 +13,7 @@ const strAttachEvent = "attachEvent";
|
|
|
13
13
|
const strAddEventHelper = "addEventListener";
|
|
14
14
|
const strDetachEvent = "detachEvent";
|
|
15
15
|
const strRemoveEventListener = "removeEventListener";
|
|
16
|
+
const strToISOString = "toISOString";
|
|
16
17
|
|
|
17
18
|
const _objDefineProperty = ObjDefineProperty;
|
|
18
19
|
const _objFreeze = ObjClass["freeze"];
|
|
@@ -271,24 +272,31 @@ export function isSymbol(value: any): boolean {
|
|
|
271
272
|
* Convert a date to I.S.O. format in IE8
|
|
272
273
|
*/
|
|
273
274
|
export function toISOString(date: Date) {
|
|
274
|
-
if (
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
275
|
+
if (date) {
|
|
276
|
+
if (date[strToISOString]) {
|
|
277
|
+
// For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification
|
|
278
|
+
return date[strToISOString]();
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (isDate(date)) {
|
|
282
|
+
const pad = (num: number) => {
|
|
283
|
+
let r = String(num);
|
|
284
|
+
if (r.length === 1) {
|
|
285
|
+
r = "0" + r;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return r;
|
|
279
289
|
}
|
|
280
290
|
|
|
281
|
-
return
|
|
291
|
+
return date.getUTCFullYear()
|
|
292
|
+
+ "-" + pad(date.getUTCMonth() + 1)
|
|
293
|
+
+ "-" + pad(date.getUTCDate())
|
|
294
|
+
+ "T" + pad(date.getUTCHours())
|
|
295
|
+
+ ":" + pad(date.getUTCMinutes())
|
|
296
|
+
+ ":" + pad(date.getUTCSeconds())
|
|
297
|
+
+ "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
|
|
298
|
+
+ "Z";
|
|
282
299
|
}
|
|
283
|
-
|
|
284
|
-
return date.getUTCFullYear()
|
|
285
|
-
+ "-" + pad(date.getUTCMonth() + 1)
|
|
286
|
-
+ "-" + pad(date.getUTCDate())
|
|
287
|
-
+ "T" + pad(date.getUTCHours())
|
|
288
|
-
+ ":" + pad(date.getUTCMinutes())
|
|
289
|
-
+ ":" + pad(date.getUTCSeconds())
|
|
290
|
-
+ "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
|
|
291
|
-
+ "Z";
|
|
292
300
|
}
|
|
293
301
|
}
|
|
294
302
|
|
|
@@ -135,7 +135,7 @@ export class PerfEvent implements IPerfEvent {
|
|
|
135
135
|
// If we couldn't define the property set during complete -- to minimize the perf impact until after the time
|
|
136
136
|
_self.payload = payloadDetails();
|
|
137
137
|
}
|
|
138
|
-
}
|
|
138
|
+
};
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -232,7 +232,7 @@ export function doPerf<T>(mgrSource: IPerfManagerProvider | IPerfManager, getSou
|
|
|
232
232
|
let perfMgr: IPerfManager = mgrSource as IPerfManager;
|
|
233
233
|
if (isFunction(perfMgr["getPerfMgr"])) {
|
|
234
234
|
// Looks like a perf manager provider object
|
|
235
|
-
perfMgr = perfMgr["getPerfMgr"]()
|
|
235
|
+
perfMgr = perfMgr["getPerfMgr"]();
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
if (perfMgr) {
|
|
@@ -9,7 +9,7 @@ import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
|
9
9
|
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
10
10
|
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
11
11
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
12
|
-
import {
|
|
12
|
+
import { safeGetLogger } from "./DiagnosticLogger";
|
|
13
13
|
import { TelemetryPluginChain } from "./TelemetryPluginChain";
|
|
14
14
|
import { arrForEach, isFunction, isNullOrUndefined, isUndefined } from "./HelperFuncs";
|
|
15
15
|
|