@microsoft/applicationinsights-core-js 2.8.5-nightly.2206-03 → 2.8.5-nightly.2207-01
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 +807 -711
- 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 +400 -336
- package/dist/applicationinsights-core-js.d.ts +1 -1
- package/dist/applicationinsights-core-js.js +807 -711
- 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 +14 -10
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +158 -139
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +39 -36
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +60 -61
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +46 -43
- package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +16 -15
- package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js +7 -5
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +4 -3
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +56 -56
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +21 -20
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +45 -39
- package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +49 -40
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +18 -16
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InternalConstants.js +19 -21
- package/dist-esm/JavaScriptSDK/InternalConstants.js.map +1 -1
- package/dist-esm/JavaScriptSDK/NotificationManager.js +26 -23
- package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +41 -35
- package/dist-esm/JavaScriptSDK/PerfManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +54 -53
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +5 -4
- package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +34 -34
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +11 -10
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +4 -3
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +1 -1
- package/dist-esm/JavaScriptSDK/W3cTraceParent.js +26 -23
- package/dist-esm/JavaScriptSDK/W3cTraceParent.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +103 -86
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.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/IDistributedTraceContext.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/ITelemetryInitializers.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/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
- package/dist-esm/__DynamicConstants.js +70 -0
- package/dist-esm/__DynamicConstants.js.map +1 -0
- package/dist-esm/applicationinsights-core-js.js +1 -1
- package/package.json +5 -2
- package/src/JavaScriptSDK/AppInsightsCore.ts +17 -17
- package/src/JavaScriptSDK/BaseCore.ts +112 -97
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +36 -32
- package/src/JavaScriptSDK/ChannelController.ts +39 -37
- package/src/JavaScriptSDK/CookieMgr.ts +27 -27
- package/src/JavaScriptSDK/CoreUtils.ts +19 -20
- package/src/JavaScriptSDK/DataCacheHelper.ts +12 -11
- package/src/JavaScriptSDK/DbgExtensionUtils.ts +9 -9
- package/src/JavaScriptSDK/DiagnosticLogger.ts +49 -50
- package/src/JavaScriptSDK/EnvUtils.ts +15 -17
- package/src/JavaScriptSDK/EventHelpers.ts +15 -14
- package/src/JavaScriptSDK/HelperFuncs.ts +20 -11
- package/src/JavaScriptSDK/InstrumentHooks.ts +11 -13
- package/src/JavaScriptSDK/InternalConstants.ts +20 -20
- package/src/JavaScriptSDK/NotificationManager.ts +27 -27
- package/src/JavaScriptSDK/PerfManager.ts +21 -19
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +38 -34
- package/src/JavaScriptSDK/RandomHelper.ts +8 -9
- package/src/JavaScriptSDK/TelemetryHelpers.ts +33 -34
- package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +17 -16
- package/src/JavaScriptSDK/UnloadHandlerContainer.ts +11 -11
- package/src/JavaScriptSDK/W3cTraceParent.ts +6 -6
- package/src/JavaScriptSDK.Enums/EventsDiscardedReason.ts +1 -1
- package/src/JavaScriptSDK.Enums/LoggingEnums.ts +72 -56
- package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +1 -1
- package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +2 -2
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +4 -4
- package/types/JavaScriptSDK/BaseCore.d.ts +11 -11
- package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +4 -4
- package/types/JavaScriptSDK/ChannelController.d.ts +1 -2
- package/types/JavaScriptSDK/CookieMgr.d.ts +3 -3
- package/types/JavaScriptSDK/DiagnosticLogger.d.ts +2 -2
- package/types/JavaScriptSDK/HelperFuncs.d.ts +6 -0
- package/types/JavaScriptSDK/InstrumentHooks.d.ts +1 -1
- package/types/JavaScriptSDK/InternalConstants.d.ts +16 -20
- package/types/JavaScriptSDK/NotificationManager.d.ts +1 -1
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +2 -2
- package/types/JavaScriptSDK/TelemetryHelpers.d.ts +4 -4
- package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +2 -2
- package/types/__DynamicConstants.d.ts +56 -0
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +0 -9
- package/dist-esm/JavaScriptSDK/Constants.js.map +0 -1
- package/src/JavaScriptSDK/Constants.ts +0 -5
- package/types/JavaScriptSDK/Constants.d.ts +0 -2
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
} from "
|
|
8
|
-
|
|
9
|
-
import { isString, isUndefined, strContains } from "./HelperFuncs";
|
|
10
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
import { getGlobal, strShimObject, strShimPrototype, strShimUndefined } from "@microsoft/applicationinsights-shims";
|
|
6
|
+
import { isString, isUndefined, strContains } from "./HelperFuncs";
|
|
7
|
+
import { STR_EMPTY } from "./InternalConstants";
|
|
8
|
+
|
|
11
9
|
// TypeScript removed this interface so we need to declare the global so we can check for it's existence.
|
|
12
10
|
declare var XDomainRequest: any;
|
|
13
11
|
|
|
@@ -297,7 +295,7 @@ export function isIE() {
|
|
|
297
295
|
if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) {
|
|
298
296
|
// Added to support test mocking of the user agent
|
|
299
297
|
_navUserAgentCheck = nav.userAgent;
|
|
300
|
-
let userAgent = (_navUserAgentCheck ||
|
|
298
|
+
let userAgent = (_navUserAgentCheck || STR_EMPTY).toLowerCase();
|
|
301
299
|
_isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident));
|
|
302
300
|
}
|
|
303
301
|
|
|
@@ -310,10 +308,10 @@ export function isIE() {
|
|
|
310
308
|
export function getIEVersion(userAgentStr: string = null): number {
|
|
311
309
|
if (!userAgentStr) {
|
|
312
310
|
let navigator = getNavigator() || ({} as Navigator);
|
|
313
|
-
userAgentStr = navigator ? (navigator.userAgent ||
|
|
311
|
+
userAgentStr = navigator ? (navigator.userAgent || STR_EMPTY).toLowerCase() : STR_EMPTY;
|
|
314
312
|
}
|
|
315
313
|
|
|
316
|
-
var ua = (userAgentStr ||
|
|
314
|
+
var ua = (userAgentStr || STR_EMPTY).toLowerCase();
|
|
317
315
|
// Also check for documentMode in case X-UA-Compatible meta tag was included in HTML.
|
|
318
316
|
if (strContains(ua, strMsie)) {
|
|
319
317
|
let doc = getDocument() || {} as Document;
|
|
@@ -333,7 +331,7 @@ export function getIEVersion(userAgentStr: string = null): number {
|
|
|
333
331
|
*/
|
|
334
332
|
export function dumpObj(object: any): string {
|
|
335
333
|
const objectTypeDump: string = Object[strShimPrototype].toString.call(object);
|
|
336
|
-
let propertyValueDump: string =
|
|
334
|
+
let propertyValueDump: string = STR_EMPTY;
|
|
337
335
|
if (objectTypeDump === "[object Error]") {
|
|
338
336
|
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
|
|
339
337
|
} else if (hasJSON()) {
|
|
@@ -346,10 +344,10 @@ export function dumpObj(object: any): string {
|
|
|
346
344
|
export function isSafari(userAgentStr ?: string) {
|
|
347
345
|
if (!userAgentStr || !isString(userAgentStr)) {
|
|
348
346
|
let navigator = getNavigator() || ({} as Navigator);
|
|
349
|
-
userAgentStr = navigator ? (navigator.userAgent ||
|
|
347
|
+
userAgentStr = navigator ? (navigator.userAgent || STR_EMPTY).toLowerCase() : STR_EMPTY;
|
|
350
348
|
}
|
|
351
349
|
|
|
352
|
-
var ua = (userAgentStr ||
|
|
350
|
+
var ua = (userAgentStr || STR_EMPTY).toLowerCase();
|
|
353
351
|
return (ua.indexOf("safari") >= 0);
|
|
354
352
|
}
|
|
355
353
|
|
|
@@ -455,4 +453,4 @@ export function findNamedServerTiming(name: string): any {
|
|
|
455
453
|
}
|
|
456
454
|
|
|
457
455
|
return value;
|
|
458
|
-
}
|
|
456
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { createElmNodeData, createUniqueNamespace } from "./DataCacheHelper";
|
|
4
|
-
import { getDocument, getWindow } from "./EnvUtils";
|
|
5
|
-
import { arrForEach, arrIndexOf, isArray, objForEachKey, objKeys } from "./HelperFuncs";
|
|
6
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createElmNodeData, createUniqueNamespace } from "./DataCacheHelper";
|
|
4
|
+
import { getDocument, getWindow } from "./EnvUtils";
|
|
5
|
+
import { arrForEach, arrIndexOf, isArray, objForEachKey, objKeys } from "./HelperFuncs";
|
|
6
|
+
import { STR_EMPTY } from "./InternalConstants";
|
|
7
|
+
|
|
7
8
|
// Added to help with minfication
|
|
8
9
|
const strOnPrefix = "on";
|
|
9
10
|
const strAttachEvent = "attachEvent";
|
|
@@ -46,7 +47,7 @@ const eventNamespace = /^([^.]*)(?:\.(.+)|)/
|
|
|
46
47
|
|
|
47
48
|
function _normalizeNamespace(name: string) {
|
|
48
49
|
if (name && name.replace) {
|
|
49
|
-
return name.replace(/^\s*\.*|\.*\s*$/g,
|
|
50
|
+
return name.replace(/^\s*\.*|\.*\s*$/g, STR_EMPTY);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
return name;
|
|
@@ -54,9 +55,9 @@ function _normalizeNamespace(name: string) {
|
|
|
54
55
|
|
|
55
56
|
function _getEvtNamespace(eventName: string | undefined, evtNamespace?: string | string[] | null): IEventDetails {
|
|
56
57
|
if (evtNamespace) {
|
|
57
|
-
let theNamespace: string =
|
|
58
|
+
let theNamespace: string = STR_EMPTY;
|
|
58
59
|
if (isArray(evtNamespace)) {
|
|
59
|
-
theNamespace =
|
|
60
|
+
theNamespace = STR_EMPTY;
|
|
60
61
|
arrForEach(evtNamespace, (name) => {
|
|
61
62
|
name = _normalizeNamespace(name);
|
|
62
63
|
if (name) {
|
|
@@ -77,15 +78,15 @@ function _getEvtNamespace(eventName: string | undefined, evtNamespace?: string |
|
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
// We may only have the namespace and not an eventName
|
|
80
|
-
eventName = (eventName ||
|
|
81
|
+
eventName = (eventName || STR_EMPTY) + theNamespace;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
let parsedEvent: any[] = (eventNamespace.exec(eventName ||
|
|
85
|
+
let parsedEvent: any[] = (eventNamespace.exec(eventName || STR_EMPTY) || []);
|
|
85
86
|
|
|
86
87
|
return {
|
|
87
88
|
type: parsedEvent[1],
|
|
88
|
-
ns: ((parsedEvent[2] ||
|
|
89
|
+
ns: ((parsedEvent[2] || STR_EMPTY).replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, STR_EMPTY).split(".").sort()).join(".")
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -113,7 +114,7 @@ export function __getRegisteredEvents(target: any, eventName?: string, evtNamesp
|
|
|
113
114
|
if (!evtName.type || evtName.type === value.evtName.type) {
|
|
114
115
|
if (!evtName.ns || evtName.ns === evtName.ns) {
|
|
115
116
|
theEvents.push({
|
|
116
|
-
name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns :
|
|
117
|
+
name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : STR_EMPTY),
|
|
117
118
|
handler: value.handler
|
|
118
119
|
});
|
|
119
120
|
}
|
|
@@ -547,4 +548,4 @@ export function removePageShowEventListener(listener: any, evtNamespace?: string
|
|
|
547
548
|
let newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace);
|
|
548
549
|
removeEventListeners([strPageShow], listener, newNamespaces);
|
|
549
550
|
removeEventListeners([strVisibilityChangeEvt], null, newNamespaces);
|
|
550
|
-
}
|
|
551
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "@microsoft/applicationinsights-shims";
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import {
|
|
4
|
+
ObjAssign, ObjClass, ObjDefineProperty, ObjHasOwnProperty, ObjProto, strShimFunction, strShimObject, strShimPrototype, strShimUndefined,
|
|
5
|
+
throwTypeError
|
|
6
|
+
} from "@microsoft/applicationinsights-shims";
|
|
7
|
+
import { STR_EMPTY } from "./InternalConstants";
|
|
8
|
+
|
|
9
9
|
// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly
|
|
10
10
|
|
|
11
11
|
// Added to help with minfication
|
|
@@ -519,7 +519,7 @@ export function arrReduce<T, R>(arr: T[], callbackfn: (previousValue: T | R, cur
|
|
|
519
519
|
export function strTrim(str: any): string {
|
|
520
520
|
if (str) {
|
|
521
521
|
// For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification
|
|
522
|
-
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g,
|
|
522
|
+
str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, STR_EMPTY) : str);
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
return str;
|
|
@@ -648,7 +648,7 @@ export function getExceptionName(object: any): string {
|
|
|
648
648
|
return object.name;
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
return
|
|
651
|
+
return STR_EMPTY;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
/**
|
|
@@ -697,6 +697,15 @@ export function getSetValue<T, K extends keyof T>(target: T, field: K, defValue?
|
|
|
697
697
|
return theValue;
|
|
698
698
|
}
|
|
699
699
|
|
|
700
|
+
/**
|
|
701
|
+
* Get the mapped config value, if null or undefined any supplied defaultValue will be returned.
|
|
702
|
+
* @param field - The name of the field as the named enum value (number) or the string name.
|
|
703
|
+
* @param defaultValue - The default value to return if the config field is not present, null or undefined.
|
|
704
|
+
*/
|
|
705
|
+
export function getCfgValue<V>(theValue: V, defaultValue?: V): V {
|
|
706
|
+
return !isNullOrUndefined(theValue) ? theValue : defaultValue;
|
|
707
|
+
}
|
|
708
|
+
|
|
700
709
|
export function isNotTruthy(value: any) {
|
|
701
710
|
return !value;
|
|
702
711
|
}
|
|
@@ -925,4 +934,4 @@ export function objExtend<T1, T2, T3, T4, T5, T6>(obj1?: T1 | any, obj2?: T2, ob
|
|
|
925
934
|
}
|
|
926
935
|
|
|
927
936
|
return extended;
|
|
928
|
-
}
|
|
937
|
+
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims";
|
|
5
|
+
import {
|
|
6
|
+
IInstrumentCallDetails, IInstrumentHook, IInstrumentHooks, IInstrumentHooksCallbacks, InstrumentorHooksCallback
|
|
7
|
+
} from "../JavaScriptSDK.Interfaces/IInstrumentHooks";
|
|
8
|
+
import { getGlobalInst } from "./EnvUtils";
|
|
9
|
+
import { _getObjProto, hasOwnProperty } from "./HelperFuncs";
|
|
10
|
+
|
|
12
11
|
const aiInstrumentHooks = "_aiHooks";
|
|
13
12
|
|
|
14
13
|
const enum CallbackType {
|
|
@@ -275,5 +274,4 @@ export function InstrumentEvent(target: any, evtName: string, callbacks: IInstru
|
|
|
275
274
|
}
|
|
276
275
|
|
|
277
276
|
return null;
|
|
278
|
-
}
|
|
279
|
-
|
|
277
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
4
5
|
// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
|
|
6
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
5
7
|
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const strDoTeardown = "_doTeardown";
|
|
16
|
-
export const strProcessNext = "processNext";
|
|
17
|
-
export const strResume = "resume";
|
|
18
|
-
export const strPause = "pause";
|
|
19
|
-
export const strNotificationListener = "NotificationListener";
|
|
20
|
-
export const strAddNotificationListener = "add" + strNotificationListener;
|
|
21
|
-
export const strRemoveNotificationListener = "remove" + strNotificationListener;
|
|
8
|
+
export const STR_EMPTY = "";
|
|
9
|
+
export const STR_CHANNELS = "channels";
|
|
10
|
+
export const STR_CORE = "core";
|
|
11
|
+
export const STR_CREATE_PERF_MGR = "createPerfMgr";
|
|
12
|
+
export const STR_DISABLED = "disabled";
|
|
13
|
+
export const STR_EXTENSION_CONFIG = "extensionConfig";
|
|
14
|
+
export const STR_EXTENSIONS = "extensions";
|
|
15
|
+
export const STR_PROCESS_TELEMETRY = "processTelemetry";
|
|
16
|
+
export const STR_PRIORITY = "priority";
|
|
22
17
|
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
18
|
+
export const STR_EVENTS_SENT = "eventsSent";
|
|
19
|
+
export const STR_EVENTS_DISCARDED = "eventsDiscarded";
|
|
20
|
+
export const STR_EVENTS_SEND_REQUEST = "eventsSendRequest";
|
|
21
|
+
export const STR_PERF_EVENT = "perfEvent";
|
|
22
|
+
|
|
23
|
+
export const STR_ERROR_TO_CONSOLE = "errorToConsole";
|
|
24
|
+
export const STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
25
|
+
|
|
26
|
+
export const STR_GET_PERF_MGR = "getPerfMgr";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { INotificationListener } from "../JavaScriptSDK.Interfaces/INotificationListener";
|
|
6
|
-
import { INotificationManager } from "../JavaScriptSDK.Interfaces/INotificationManager";
|
|
7
|
-
import { IPerfEvent } from "../JavaScriptSDK.Interfaces/IPerfEvent";
|
|
8
|
-
import
|
|
9
|
-
import { arrForEach, arrIndexOf } from "./HelperFuncs";
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
4
|
+
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
5
|
+
import { INotificationListener } from "../JavaScriptSDK.Interfaces/INotificationListener";
|
|
6
|
+
import { INotificationManager } from "../JavaScriptSDK.Interfaces/INotificationManager";
|
|
7
|
+
import { IPerfEvent } from "../JavaScriptSDK.Interfaces/IPerfEvent";
|
|
8
|
+
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
9
|
+
import { arrForEach, arrIndexOf } from "./HelperFuncs";
|
|
10
|
+
import { STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_PERF_EVENT } from "./InternalConstants";
|
|
11
|
+
|
|
12
12
|
function _runListeners(listeners: INotificationListener[], name: string, isAsync: boolean, callback: (listener: INotificationListener) => void) {
|
|
13
13
|
arrForEach(listeners, (listener) => {
|
|
14
14
|
if (listener && listener[name]) {
|
|
@@ -35,7 +35,7 @@ export class NotificationManager implements INotificationManager {
|
|
|
35
35
|
let perfEvtsSendAll = !!(config ||{}).perfEvtsSendAll;
|
|
36
36
|
|
|
37
37
|
dynamicProto(NotificationManager, this, (_self) => {
|
|
38
|
-
_self
|
|
38
|
+
_self.addNotificationListener = (listener: INotificationListener): void => {
|
|
39
39
|
_self.listeners.push(listener);
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ export class NotificationManager implements INotificationManager {
|
|
|
43
43
|
* Removes all instances of the listener.
|
|
44
44
|
* @param {INotificationListener} listener - AWTNotificationListener to remove.
|
|
45
45
|
*/
|
|
46
|
-
_self
|
|
46
|
+
_self.removeNotificationListener = (listener: INotificationListener): void => {
|
|
47
47
|
let index: number = arrIndexOf(_self.listeners, listener);
|
|
48
48
|
while (index > -1) {
|
|
49
49
|
_self.listeners.splice(index, 1);
|
|
@@ -55,9 +55,9 @@ export class NotificationManager implements INotificationManager {
|
|
|
55
55
|
* Notification for events sent.
|
|
56
56
|
* @param {ITelemetryItem[]} events - The array of events that have been sent.
|
|
57
57
|
*/
|
|
58
|
-
_self
|
|
59
|
-
_runListeners(_self.listeners,
|
|
60
|
-
listener
|
|
58
|
+
_self.eventsSent = (events: ITelemetryItem[]): void => {
|
|
59
|
+
_runListeners(_self.listeners, STR_EVENTS_SENT, true, (listener) => {
|
|
60
|
+
listener.eventsSent(events);
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
@@ -67,9 +67,9 @@ export class NotificationManager implements INotificationManager {
|
|
|
67
67
|
* @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason
|
|
68
68
|
* constant should be used to check the different values.
|
|
69
69
|
*/
|
|
70
|
-
_self
|
|
71
|
-
_runListeners(_self.listeners,
|
|
72
|
-
listener
|
|
70
|
+
_self.eventsDiscarded = (events: ITelemetryItem[], reason: number): void => {
|
|
71
|
+
_runListeners(_self.listeners, STR_EVENTS_DISCARDED, true, (listener) => {
|
|
72
|
+
listener.eventsDiscarded(events, reason);
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
|
|
@@ -78,22 +78,22 @@ export class NotificationManager implements INotificationManager {
|
|
|
78
78
|
* @param {number} sendReason - The reason why the event batch is being sent.
|
|
79
79
|
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
|
|
80
80
|
*/
|
|
81
|
-
_self
|
|
82
|
-
_runListeners(_self.listeners,
|
|
83
|
-
listener
|
|
81
|
+
_self.eventsSendRequest = (sendReason: number, isAsync: boolean): void => {
|
|
82
|
+
_runListeners(_self.listeners, STR_EVENTS_SEND_REQUEST, isAsync, (listener) => {
|
|
83
|
+
listener.eventsSendRequest(sendReason, isAsync);
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
_self
|
|
87
|
+
_self.perfEvent = (perfEvent?: IPerfEvent): void => {
|
|
88
88
|
if (perfEvent) {
|
|
89
89
|
|
|
90
90
|
// Send all events or only parent events
|
|
91
91
|
if (perfEvtsSendAll || !perfEvent.isChildEvt()) {
|
|
92
|
-
_runListeners(_self.listeners,
|
|
92
|
+
_runListeners(_self.listeners, STR_PERF_EVENT, false, (listener) => {
|
|
93
93
|
if (perfEvent.isAsync) {
|
|
94
|
-
setTimeout(() => listener
|
|
94
|
+
setTimeout(() => listener.perfEvent(perfEvent), 0);
|
|
95
95
|
} else {
|
|
96
|
-
listener
|
|
96
|
+
listener.perfEvent(perfEvent);
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -151,4 +151,4 @@ export class NotificationManager implements INotificationManager {
|
|
|
151
151
|
* @param perfEvent
|
|
152
152
|
*/
|
|
153
153
|
perfEvent?(perfEvent: IPerfEvent): void;
|
|
154
|
-
}
|
|
154
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
4
|
+
import { INotificationManager } from "../JavaScriptSDK.Interfaces/INotificationManager";
|
|
5
|
+
import { IPerfEvent } from "../JavaScriptSDK.Interfaces/IPerfEvent";
|
|
6
|
+
import { IPerfManager, IPerfManagerProvider } from "../JavaScriptSDK.Interfaces/IPerfManager";
|
|
7
|
+
import { dateNow, isArray, isFunction, objDefineAccessors } from "./HelperFuncs";
|
|
8
|
+
import { STR_GET_PERF_MGR } from "./InternalConstants";
|
|
9
|
+
|
|
10
10
|
const strExecutionContextKey = "ctx";
|
|
11
|
+
const strParentContextKey = "ParentContextKey";
|
|
12
|
+
const strChildrenContextKey = "ChildrenContextKey";
|
|
11
13
|
|
|
12
14
|
let _defaultPerfManager: IPerfManager = null;
|
|
13
15
|
|
|
@@ -85,7 +87,7 @@ export class PerfEvent implements IPerfEvent {
|
|
|
85
87
|
_self.getCtx = (key: string): any | null | undefined => {
|
|
86
88
|
if (key) {
|
|
87
89
|
// The parent and child links are located directly on the object (for better viewing in the DebugPlugin)
|
|
88
|
-
if (key === PerfEvent
|
|
90
|
+
if (key === PerfEvent[strParentContextKey] || key === PerfEvent[strChildrenContextKey]) {
|
|
89
91
|
return _self[key];
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -98,13 +100,13 @@ export class PerfEvent implements IPerfEvent {
|
|
|
98
100
|
_self.setCtx = (key: string, value: any) => {
|
|
99
101
|
if (key) {
|
|
100
102
|
// Put the parent and child links directly on the object (for better viewing in the DebugPlugin)
|
|
101
|
-
if (key === PerfEvent
|
|
103
|
+
if (key === PerfEvent[strParentContextKey]) {
|
|
102
104
|
// Simple assumption, if we are setting a parent then we must be a child
|
|
103
105
|
if (!_self[key]) {
|
|
104
106
|
_self.isChildEvt = (): boolean => true;
|
|
105
107
|
}
|
|
106
108
|
_self[key] = value;
|
|
107
|
-
} else if (key === PerfEvent
|
|
109
|
+
} else if (key === PerfEvent[strChildrenContextKey]) {
|
|
108
110
|
_self[key] = value;
|
|
109
111
|
} else {
|
|
110
112
|
let ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
|
|
@@ -115,7 +117,7 @@ export class PerfEvent implements IPerfEvent {
|
|
|
115
117
|
|
|
116
118
|
_self.complete = () => {
|
|
117
119
|
let childTime = 0;
|
|
118
|
-
let childEvts = _self.getCtx(PerfEvent
|
|
120
|
+
let childEvts = _self.getCtx(PerfEvent[strChildrenContextKey]);
|
|
119
121
|
if (isArray<IPerfEvent>(childEvts)) {
|
|
120
122
|
for (let lp = 0; lp < childEvts.length; lp++) {
|
|
121
123
|
let childEvt: IPerfEvent = childEvts[lp];
|
|
@@ -227,9 +229,9 @@ const doPerfActiveKey = "CoreUtils.doPerf";
|
|
|
227
229
|
export function doPerf<T>(mgrSource: IPerfManagerProvider | IPerfManager, getSource: () => string, func: (perfEvt?: IPerfEvent) => T, details?: () => any, isAsync?: boolean) {
|
|
228
230
|
if (mgrSource) {
|
|
229
231
|
let perfMgr: IPerfManager = mgrSource as IPerfManager;
|
|
230
|
-
if (
|
|
232
|
+
if (perfMgr[STR_GET_PERF_MGR]) {
|
|
231
233
|
// Looks like a perf manager provider object
|
|
232
|
-
perfMgr = perfMgr[
|
|
234
|
+
perfMgr = perfMgr[STR_GET_PERF_MGR]();
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
if (perfMgr) {
|
|
@@ -239,12 +241,12 @@ export function doPerf<T>(mgrSource: IPerfManagerProvider | IPerfManager, getSou
|
|
|
239
241
|
perfEvt = perfMgr.create(getSource(), details, isAsync);
|
|
240
242
|
if (perfEvt) {
|
|
241
243
|
if (currentActive && perfEvt.setCtx) {
|
|
242
|
-
perfEvt.setCtx(PerfEvent
|
|
244
|
+
perfEvt.setCtx(PerfEvent[strParentContextKey], currentActive);
|
|
243
245
|
if (currentActive.getCtx && currentActive.setCtx) {
|
|
244
|
-
let children: IPerfEvent[] = currentActive.getCtx(PerfEvent
|
|
246
|
+
let children: IPerfEvent[] = currentActive.getCtx(PerfEvent[strChildrenContextKey]);
|
|
245
247
|
if (!children) {
|
|
246
248
|
children = [];
|
|
247
|
-
currentActive.setCtx(PerfEvent
|
|
249
|
+
currentActive.setCtx(PerfEvent[strChildrenContextKey], children);
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
children.push(perfEvt);
|
|
@@ -288,4 +290,4 @@ export function setGblPerfMgr(perfManager: IPerfManager) {
|
|
|
288
290
|
*/
|
|
289
291
|
export function getGblPerfMgr(): IPerfManager {
|
|
290
292
|
return _defaultPerfManager;
|
|
291
|
-
}
|
|
293
|
+
}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
import { _eInternalMessageId, eLoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
|
|
6
|
+
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
7
|
+
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
8
|
+
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
9
|
+
import {
|
|
10
|
+
GetExtCfgMergeType, IBaseProcessingContext, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext
|
|
11
|
+
} from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
12
|
+
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
13
|
+
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
14
|
+
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
15
|
+
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
16
|
+
import { ITelemetryUpdateState } from "../JavaScriptSDK.Interfaces/ITelemetryUpdateState";
|
|
17
|
+
import { _throwInternal, safeGetLogger } from "./DiagnosticLogger";
|
|
18
|
+
import { dumpObj } from "./EnvUtils";
|
|
19
|
+
import {
|
|
20
|
+
arrForEach, isArray, isFunction, isNullOrUndefined, isObject, isUndefined, objExtend, objForEachKey, objFreeze, objKeys, proxyFunctions
|
|
21
|
+
} from "./HelperFuncs";
|
|
22
|
+
import { STR_CORE, STR_DISABLED, STR_EMPTY } from "./InternalConstants";
|
|
23
|
+
import { doPerf } from "./PerfManager";
|
|
24
|
+
import { _getPluginState } from "./TelemetryHelpers";
|
|
25
|
+
|
|
22
26
|
const strTelemetryPluginChain = "TelemetryPluginChain";
|
|
23
27
|
const strHasRunFlags = "_hasRun";
|
|
24
28
|
const strGetTelCtx = "_getTelCtx";
|
|
@@ -423,13 +427,13 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
|
|
|
423
427
|
itemCtx.setNext(nextProxy);
|
|
424
428
|
|
|
425
429
|
if (plugin) {
|
|
426
|
-
doPerf(itemCtx
|
|
430
|
+
doPerf(itemCtx.core(), () => identifier + ":" + name, () => {
|
|
427
431
|
// Mark this component as having run
|
|
428
432
|
hasRunContext[chainId] = true;
|
|
429
433
|
|
|
430
434
|
try {
|
|
431
435
|
// Set a flag on the next plugin so we know if it was attempted to be executed
|
|
432
|
-
let nextId = nextProxy ? nextProxy._id :
|
|
436
|
+
let nextId = nextProxy ? nextProxy._id : STR_EMPTY;
|
|
433
437
|
if (nextId) {
|
|
434
438
|
hasRunContext[nextId] = false;
|
|
435
439
|
}
|
|
@@ -468,7 +472,7 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
|
|
|
468
472
|
}
|
|
469
473
|
|
|
470
474
|
let pluginState = _getPluginState(plugin);
|
|
471
|
-
if (pluginState.teardown || pluginState[
|
|
475
|
+
if (pluginState.teardown || pluginState[STR_DISABLED]) {
|
|
472
476
|
return false;
|
|
473
477
|
}
|
|
474
478
|
|
|
@@ -500,15 +504,15 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
|
|
|
500
504
|
let hasRun = false;
|
|
501
505
|
if (plugin) {
|
|
502
506
|
let pluginState = _getPluginState(plugin);
|
|
503
|
-
let pluginCore = plugin[
|
|
507
|
+
let pluginCore = plugin[STR_CORE] || pluginState.core;
|
|
504
508
|
// Only teardown the plugin if it was initialized by the current core (i.e. It's not a shared plugin)
|
|
505
|
-
if (plugin && (!pluginCore || pluginCore === unloadCtx
|
|
509
|
+
if (plugin && (!pluginCore || pluginCore === unloadCtx.core()) && !pluginState.teardown) {
|
|
506
510
|
// Handle plugins that don't extend from the BaseTelemetryPlugin
|
|
507
|
-
pluginState
|
|
508
|
-
pluginState
|
|
509
|
-
pluginState
|
|
511
|
+
pluginState.core = null;
|
|
512
|
+
pluginState.teardown = true;
|
|
513
|
+
pluginState.isInitialized = false;
|
|
510
514
|
|
|
511
|
-
if (plugin
|
|
515
|
+
if (plugin.teardown && plugin.teardown(unloadCtx, unloadState) === true) {
|
|
512
516
|
// plugin told us that it was going to (or has) call unloadCtx.processNext()
|
|
513
517
|
hasRun = true;
|
|
514
518
|
}
|
|
@@ -531,11 +535,11 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
|
|
|
531
535
|
let hasRun = false;
|
|
532
536
|
if (plugin) {
|
|
533
537
|
let pluginState = _getPluginState(plugin);
|
|
534
|
-
let pluginCore = plugin[
|
|
538
|
+
let pluginCore = plugin[STR_CORE] || pluginState.core;
|
|
535
539
|
|
|
536
540
|
// Only update the plugin if it was initialized by the current core (i.e. It's not a shared plugin)
|
|
537
|
-
if (plugin && (!pluginCore || pluginCore === updateCtx
|
|
538
|
-
if (plugin
|
|
541
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx.core()) && !pluginState.teardown) {
|
|
542
|
+
if (plugin.update && plugin.update(updateCtx, updateState) === true) {
|
|
539
543
|
// plugin told us that it was going to (or has) call unloadCtx.processNext()
|
|
540
544
|
hasRun = true;
|
|
541
545
|
}
|
|
@@ -638,4 +642,4 @@ export class ProcessTelemetryContext implements IProcessTelemetryContext {
|
|
|
638
642
|
// Proxy all functions of the context to this object
|
|
639
643
|
proxyFunctions(_self, context, objKeys(context) as any);
|
|
640
644
|
}
|
|
641
|
-
}
|
|
645
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { getCrypto, getMsCrypto, isIE }
|
|
4
|
-
import { dateNow } from "./HelperFuncs";
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { getCrypto, getMsCrypto, isIE } from "./EnvUtils";
|
|
4
|
+
import { dateNow } from "./HelperFuncs";
|
|
5
|
+
import { STR_EMPTY } from "./InternalConstants";
|
|
6
|
+
|
|
7
7
|
const UInt32Mask = 0x100000000;
|
|
8
8
|
const MaxUInt32 = 0xffffffff;
|
|
9
9
|
|
|
@@ -128,7 +128,7 @@ export function newId(maxLength = 22): string {
|
|
|
128
128
|
// Start with an initial random number, consuming the value in reverse byte order
|
|
129
129
|
let number = random32() >>> 0; // Make sure it's a +ve number
|
|
130
130
|
let chars = 0;
|
|
131
|
-
let result =
|
|
131
|
+
let result = STR_EMPTY;
|
|
132
132
|
while (result.length < maxLength) {
|
|
133
133
|
chars ++;
|
|
134
134
|
result += base64chars.charAt(number & 0x3F);
|
|
@@ -142,5 +142,4 @@ export function newId(maxLength = 22): string {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
return result;
|
|
145
|
-
}
|
|
146
|
-
|
|
145
|
+
}
|