@microsoft/applicationinsights-core-js 2.8.1 → 2.8.2
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 +15 -11
- 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 +15 -11
- 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 +5 -5
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +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/DataCacheHelper.js +2 -2
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +3 -3
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +2 -3
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InternalConstants.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/TelemetryInitializerPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +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 +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/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/IUnloadableComponent.js +1 -1
- package/dist-esm/applicationinsights-core-js.js +1 -1
- package/package.json +2 -2
- package/src/JavaScriptSDK/BaseCore.ts +5 -4
- package/src/JavaScriptSDK/DataCacheHelper.ts +1 -1
- package/src/JavaScriptSDK/DiagnosticLogger.ts +2 -2
- package/src/JavaScriptSDK/InstrumentHooks.ts +3 -3
- package/types/tsdoc-metadata.json +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-core-js",
|
|
3
3
|
"author": "Microsoft Application Insights Team",
|
|
4
|
-
"version": "2.8.
|
|
4
|
+
"version": "2.8.2",
|
|
5
5
|
"description": "Microsoft Application Insights Core Javascript SDK",
|
|
6
6
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
7
7
|
"keywords": [
|
|
@@ -62,6 +62,6 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@microsoft/applicationinsights-shims": "2.0.1",
|
|
65
|
-
"@microsoft/dynamicproto-js": "^1.1.
|
|
65
|
+
"@microsoft/dynamicproto-js": "^1.1.5"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -22,7 +22,8 @@ import { ICookieMgr } from "../JavaScriptSDK.Interfaces/ICookieMgr";
|
|
|
22
22
|
import { createCookieMgr } from "./CookieMgr";
|
|
23
23
|
import {
|
|
24
24
|
arrForEach, isNullOrUndefined, getSetValue, setValue, isNotTruthy, isFunction, objExtend, objFreeze, proxyFunctionAs, proxyFunctions, throwError,
|
|
25
|
-
toISOString
|
|
25
|
+
toISOString,
|
|
26
|
+
arrIndexOf
|
|
26
27
|
} from "./HelperFuncs";
|
|
27
28
|
import { strExtensionConfig, strIKey } from "./Constants";
|
|
28
29
|
import { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from "./DiagnosticLogger";
|
|
@@ -503,12 +504,12 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
503
504
|
// But we also want the controller as the last, so remove if already present
|
|
504
505
|
// And reusing the existing instance, just in case an installed plugin has a reference and
|
|
505
506
|
// is using it.
|
|
506
|
-
let idx = allExtensions
|
|
507
|
+
let idx = arrIndexOf(allExtensions, _channelControl);
|
|
507
508
|
if (idx !== -1) {
|
|
508
509
|
allExtensions.splice(idx, 1);
|
|
509
510
|
}
|
|
510
511
|
|
|
511
|
-
idx = _coreExtensions
|
|
512
|
+
idx = arrIndexOf(_coreExtensions, _channelControl);
|
|
512
513
|
if (idx !== -1) {
|
|
513
514
|
_coreExtensions.splice(idx, 1);
|
|
514
515
|
}
|
|
@@ -595,7 +596,7 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
595
596
|
let extensions = (_coreExtensions || []).slice();
|
|
596
597
|
|
|
597
598
|
// During add / remove this may get called again, so don't readd if already present
|
|
598
|
-
if (extensions
|
|
599
|
+
if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {
|
|
599
600
|
extensions.push(_telemetryInitializerPlugin);
|
|
600
601
|
}
|
|
601
602
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration"
|
|
5
5
|
import { _InternalMessageId, _eInternalMessageId, LoggingSeverity, eLoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
|
|
6
6
|
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
7
|
-
import { hasJSON, getJSON, getConsole } from "./EnvUtils";
|
|
7
|
+
import { hasJSON, getJSON, getConsole, dumpObj } from "./EnvUtils";
|
|
8
8
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
9
9
|
import { isFunction, isNullOrUndefined, isUndefined } from "./HelperFuncs";
|
|
10
10
|
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
@@ -123,7 +123,7 @@ export class DiagnosticLogger implements IDiagnosticLogger {
|
|
|
123
123
|
const message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
|
|
124
124
|
|
|
125
125
|
if (_self.enableDebugExceptions()) {
|
|
126
|
-
throw message;
|
|
126
|
+
throw dumpObj(message);
|
|
127
127
|
} else {
|
|
128
128
|
// Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist
|
|
129
129
|
let logFunc = severity === eLoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
|
|
@@ -132,7 +132,7 @@ function _createFunctionHook(aiHook:IInstrumentHooks) {
|
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
/** @ignore */
|
|
135
|
-
function _getOwner(target:any, name:string, checkPrototype:boolean): any {
|
|
135
|
+
function _getOwner(target:any, name:string, checkPrototype: boolean): any {
|
|
136
136
|
let owner = null;
|
|
137
137
|
if (target) {
|
|
138
138
|
if (hasOwnProperty(target, name)) {
|
|
@@ -266,9 +266,9 @@ export function InstrumentFuncs(target:any, funcNames:string[], callbacks: IInst
|
|
|
266
266
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
267
267
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
268
268
|
*/
|
|
269
|
-
export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype
|
|
269
|
+
export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook {
|
|
270
270
|
if (target && evtName && callbacks) {
|
|
271
|
-
let owner = _getOwner(target, evtName, checkPrototype);
|
|
271
|
+
let owner = _getOwner(target, evtName, checkPrototype) || target;
|
|
272
272
|
if (owner) {
|
|
273
273
|
return _createInstrumentHook(owner, evtName, owner[evtName], callbacks);
|
|
274
274
|
}
|