@microsoft/applicationinsights-core-js 2.8.0-beta.2203-04 → 2.8.0-beta.2203-05
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 +129 -26
- 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 +1667 -177
- package/dist/applicationinsights-core-js.api.md +62 -8
- package/dist/applicationinsights-core-js.d.ts +121 -7
- package/dist/applicationinsights-core-js.js +129 -26
- 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 +124 -10
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +29 -10
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +30 -2
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +14 -2
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +3 -2
- package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +14 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +18 -13
- package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +2 -12
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +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 +56 -5
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +3 -2
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +3 -2
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +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 +8 -0
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js.map +1 -0
- 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 +8 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js.map +1 -0
- package/dist-esm/applicationinsights-core-js.js +2 -2
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +1 -1
- package/src/JavaScriptSDK/BaseCore.ts +44 -9
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +54 -2
- package/src/JavaScriptSDK/ChannelController.ts +18 -1
- package/src/JavaScriptSDK/CookieMgr.ts +3 -1
- package/src/JavaScriptSDK/DiagnosticLogger.ts +14 -0
- package/src/JavaScriptSDK/EventHelpers.ts +18 -12
- package/src/JavaScriptSDK/HelperFuncs.ts +3 -1
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +71 -8
- package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +3 -1
- package/src/JavaScriptSDK/UnloadHandlerContainer.ts +3 -1
- package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +27 -0
- package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +11 -6
- package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +25 -2
- package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +12 -1
- package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +34 -0
- package/types/JavaScriptSDK/BaseCore.d.ts +11 -2
- package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +17 -1
- package/types/JavaScriptSDK/DiagnosticLogger.d.ts +10 -0
- package/types/JavaScriptSDK/EventHelpers.d.ts +4 -2
- package/types/JavaScriptSDK/HelperFuncs.d.ts +2 -1
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +9 -1
- package/types/JavaScriptSDK.Enums/TelemetryUpdateReason.d.ts +20 -0
- package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +5 -0
- package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +23 -2
- package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +11 -1
- package/types/JavaScriptSDK.Interfaces/ITelemetryUpdateState.d.ts +22 -0
- package/types/applicationinsights-core-js.d.ts +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryUpdateReason.js.map","sources":["TelemetryUpdateReason.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport {};\r\n//# sourceMappingURL=TelemetryUpdateReason.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITelemetryUpdateState.js.map","sources":["ITelemetryUpdateState.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport {};\r\n//# sourceMappingURL=ITelemetryUpdateState.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 2.8.0-beta.2203-
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 2.8.0-beta.2203-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
export { MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";
|
|
@@ -15,7 +15,7 @@ export { getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypt
|
|
|
15
15
|
export { getGlobal, objCreateFn as objCreate, strShimPrototype as strPrototype, strShimFunction as strFunction, strShimUndefined as strUndefined, strShimObject as strObject } from "@microsoft/applicationinsights-shims";
|
|
16
16
|
export { NotificationManager } from "./JavaScriptSDK/NotificationManager";
|
|
17
17
|
export { PerfEvent, PerfManager, doPerf, getGblPerfMgr, setGblPerfMgr } from "./JavaScriptSDK/PerfManager";
|
|
18
|
-
export { safeGetLogger, DiagnosticLogger, _InternalLogMessage } from "./JavaScriptSDK/DiagnosticLogger";
|
|
18
|
+
export { safeGetLogger, DiagnosticLogger, _InternalLogMessage, _throwInternal } from "./JavaScriptSDK/DiagnosticLogger";
|
|
19
19
|
export { ProcessTelemetryContext, createProcessTelemetryContext
|
|
20
20
|
// Explicitly NOT exporting createProcessTelemetryUnloadContext() and createProcessTelemetryUpdateContext() as these should only be created internally
|
|
21
21
|
} from "./JavaScriptSDK/ProcessTelemetryContext";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicationinsights-core-js.js.map","sources":["applicationinsights-core-js.js"],"sourcesContent":["export { MinChannelPriorty } from \"./JavaScriptSDK.Interfaces/IChannelControls\";\r\nexport { EventsDiscardedReason } from \"./JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nexport { AppInsightsCore } from \"./JavaScriptSDK/AppInsightsCore\";\r\nexport { BaseCore } from \"./JavaScriptSDK/BaseCore\";\r\nexport { BaseTelemetryPlugin } from \"./JavaScriptSDK/BaseTelemetryPlugin\";\r\nexport { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from \"./JavaScriptSDK/RandomHelper\";\r\nexport { CoreUtils, EventHelper, Undefined, newGuid, perfNow, generateW3CId, disableCookies, canUseCookies, getCookie, setCookie, deleteCookie, _legacyCookieMgr } from \"./JavaScriptSDK/CoreUtils\";\r\nexport { isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, normalizeJsName, objForEachKey, strEndsWith, strStartsWith, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, strTrim, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, strContains, isSymbol, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objFreeze, objSeal, createEnumStyle, objExtend } from \"./JavaScriptSDK/HelperFuncs\";\r\nexport { attachEvent, detachEvent, addEventHandler, addEventListeners, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, eventOn, eventOff, mergeEvtNamespace, __getRegisteredEvents } from \"./JavaScriptSDK/EventHelpers\";\r\nexport { getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, isSafari, setEnableEnvMocks, isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported } from \"./JavaScriptSDK/EnvUtils\";\r\nexport { getGlobal, objCreateFn as objCreate, strShimPrototype as strPrototype, strShimFunction as strFunction, strShimUndefined as strUndefined, strShimObject as strObject } from \"@microsoft/applicationinsights-shims\";\r\nexport { NotificationManager } from \"./JavaScriptSDK/NotificationManager\";\r\nexport { PerfEvent, PerfManager, doPerf, getGblPerfMgr, setGblPerfMgr } from \"./JavaScriptSDK/PerfManager\";\r\nexport { safeGetLogger, DiagnosticLogger, _InternalLogMessage } from \"./JavaScriptSDK/DiagnosticLogger\";\r\nexport { ProcessTelemetryContext, createProcessTelemetryContext\r\n// Explicitly NOT exporting createProcessTelemetryUnloadContext() and createProcessTelemetryUpdateContext() as these should only be created internally\r\n } from \"./JavaScriptSDK/ProcessTelemetryContext\";\r\nexport { initializePlugins, sortPlugins } from \"./JavaScriptSDK/TelemetryHelpers\";\r\nexport { _InternalMessageId, LoggingSeverity } from \"./JavaScriptSDK.Enums/LoggingEnums\";\r\nexport { InstrumentProto, InstrumentProtos, InstrumentFunc, InstrumentFuncs } from \"./JavaScriptSDK/InstrumentHooks\";\r\nexport { createCookieMgr, safeGetCookieMgr, uaDisallowsSameSiteNone, areCookiesSupported } from \"./JavaScriptSDK/CookieMgr\";\r\nexport { strIKey, strExtensionConfig } from \"./JavaScriptSDK/Constants\";\r\nexport { getDebugListener, getDebugExt } from \"./JavaScriptSDK/DbgExtensionUtils\";\r\nexport { createUniqueNamespace } from \"./JavaScriptSDK/DataCacheHelper\";\r\nexport { createUnloadHandlerContainer } from \"./JavaScriptSDK/UnloadHandlerContainer\";\r\n//# sourceMappingURL=applicationinsights-core-js.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"applicationinsights-core-js.js.map","sources":["applicationinsights-core-js.js"],"sourcesContent":["export { MinChannelPriorty } from \"./JavaScriptSDK.Interfaces/IChannelControls\";\r\nexport { EventsDiscardedReason } from \"./JavaScriptSDK.Enums/EventsDiscardedReason\";\r\nexport { AppInsightsCore } from \"./JavaScriptSDK/AppInsightsCore\";\r\nexport { BaseCore } from \"./JavaScriptSDK/BaseCore\";\r\nexport { BaseTelemetryPlugin } from \"./JavaScriptSDK/BaseTelemetryPlugin\";\r\nexport { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from \"./JavaScriptSDK/RandomHelper\";\r\nexport { CoreUtils, EventHelper, Undefined, newGuid, perfNow, generateW3CId, disableCookies, canUseCookies, getCookie, setCookie, deleteCookie, _legacyCookieMgr } from \"./JavaScriptSDK/CoreUtils\";\r\nexport { isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, normalizeJsName, objForEachKey, strEndsWith, strStartsWith, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, strTrim, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, strContains, isSymbol, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objFreeze, objSeal, createEnumStyle, objExtend } from \"./JavaScriptSDK/HelperFuncs\";\r\nexport { attachEvent, detachEvent, addEventHandler, addEventListeners, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, eventOn, eventOff, mergeEvtNamespace, __getRegisteredEvents } from \"./JavaScriptSDK/EventHelpers\";\r\nexport { getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, isSafari, setEnableEnvMocks, isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported } from \"./JavaScriptSDK/EnvUtils\";\r\nexport { getGlobal, objCreateFn as objCreate, strShimPrototype as strPrototype, strShimFunction as strFunction, strShimUndefined as strUndefined, strShimObject as strObject } from \"@microsoft/applicationinsights-shims\";\r\nexport { NotificationManager } from \"./JavaScriptSDK/NotificationManager\";\r\nexport { PerfEvent, PerfManager, doPerf, getGblPerfMgr, setGblPerfMgr } from \"./JavaScriptSDK/PerfManager\";\r\nexport { safeGetLogger, DiagnosticLogger, _InternalLogMessage, _throwInternal } from \"./JavaScriptSDK/DiagnosticLogger\";\r\nexport { ProcessTelemetryContext, createProcessTelemetryContext\r\n// Explicitly NOT exporting createProcessTelemetryUnloadContext() and createProcessTelemetryUpdateContext() as these should only be created internally\r\n } from \"./JavaScriptSDK/ProcessTelemetryContext\";\r\nexport { initializePlugins, sortPlugins } from \"./JavaScriptSDK/TelemetryHelpers\";\r\nexport { _InternalMessageId, LoggingSeverity } from \"./JavaScriptSDK.Enums/LoggingEnums\";\r\nexport { InstrumentProto, InstrumentProtos, InstrumentFunc, InstrumentFuncs } from \"./JavaScriptSDK/InstrumentHooks\";\r\nexport { createCookieMgr, safeGetCookieMgr, uaDisallowsSameSiteNone, areCookiesSupported } from \"./JavaScriptSDK/CookieMgr\";\r\nexport { strIKey, strExtensionConfig } from \"./JavaScriptSDK/Constants\";\r\nexport { getDebugListener, getDebugExt } from \"./JavaScriptSDK/DbgExtensionUtils\";\r\nexport { createUniqueNamespace } from \"./JavaScriptSDK/DataCacheHelper\";\r\nexport { createUnloadHandlerContainer } from \"./JavaScriptSDK/UnloadHandlerContainer\";\r\n//# sourceMappingURL=applicationinsights-core-js.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
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.0-beta.2203-
|
|
4
|
+
"version": "2.8.0-beta.2203-05",
|
|
5
5
|
"description": "Microsoft Application Insights Core Javascript SDK",
|
|
6
6
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
7
7
|
"keywords": [
|
|
@@ -12,8 +12,8 @@ import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
|
12
12
|
import { INotificationManager } from "../JavaScriptSDK.Interfaces/INotificationManager";
|
|
13
13
|
import { INotificationListener } from "../JavaScriptSDK.Interfaces/INotificationListener";
|
|
14
14
|
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
15
|
-
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
16
|
-
import { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createTelemetryProxyChain } from "./ProcessTelemetryContext";
|
|
15
|
+
import { IProcessTelemetryContext, IProcessTelemetryUpdateContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
16
|
+
import { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext, createTelemetryProxyChain } from "./ProcessTelemetryContext";
|
|
17
17
|
import { initializePlugins, sortPlugins, _getPluginState } from "./TelemetryHelpers";
|
|
18
18
|
import { eLoggingSeverity, _eInternalMessageId } from "../JavaScriptSDK.Enums/LoggingEnums";
|
|
19
19
|
import { IPerfManager } from "../JavaScriptSDK.Interfaces/IPerfManager";
|
|
@@ -22,7 +22,7 @@ import { ICookieMgr } from "../JavaScriptSDK.Interfaces/ICookieMgr";
|
|
|
22
22
|
import { createCookieMgr } from "./CookieMgr";
|
|
23
23
|
import { arrForEach, isNullOrUndefined, toISOString, getSetValue, setValue, throwError, isNotTruthy, isFunction, objFreeze, proxyFunctionAs, proxyFunctions } from "./HelperFuncs";
|
|
24
24
|
import { strExtensionConfig, strIKey } from "./Constants";
|
|
25
|
-
import { DiagnosticLogger, _InternalLogMessage } from "./DiagnosticLogger";
|
|
25
|
+
import { DiagnosticLogger, _InternalLogMessage, _throwInternal } from "./DiagnosticLogger";
|
|
26
26
|
import { getDebugListener } from "./DbgExtensionUtils";
|
|
27
27
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
28
28
|
import { ChannelControllerPriority, createChannelControllerPlugin, createChannelQueues, IChannelController, IInternalChannelController, _IInternalChannels } from "./ChannelController";
|
|
@@ -30,6 +30,8 @@ import { ITelemetryInitializerHandler, TelemetryInitializerFunction } from "../J
|
|
|
30
30
|
import { TelemetryInitializerPlugin } from "./TelemetryInitializerPlugin";
|
|
31
31
|
import { createUniqueNamespace } from "./DataCacheHelper";
|
|
32
32
|
import { createUnloadHandlerContainer, IUnloadHandlerContainer, UnloadHandler } from "./UnloadHandlerContainer";
|
|
33
|
+
import { TelemetryUpdateReason } from "../JavaScriptSDK.Enums/TelemetryUpdateReason";
|
|
34
|
+
import { ITelemetryUpdateState } from "../JavaScriptSDK.Interfaces/ITelemetryUpdateState";
|
|
33
35
|
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
34
36
|
import { TelemetryUnloadReason } from "../JavaScriptSDK.Enums/TelemetryUnloadReason";
|
|
35
37
|
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
@@ -190,7 +192,7 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
190
192
|
_configExtensions.push(...extensions, ...config.extensions);
|
|
191
193
|
_channelConfig = (config||{}).channels;
|
|
192
194
|
|
|
193
|
-
_initPluginChain(config);
|
|
195
|
+
_initPluginChain(config, null);
|
|
194
196
|
|
|
195
197
|
if (_self.getTransmissionControls().length === 0) {
|
|
196
198
|
throwError("No channels available");
|
|
@@ -401,11 +403,16 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
401
403
|
return;
|
|
402
404
|
}
|
|
403
405
|
|
|
406
|
+
let updateState: ITelemetryUpdateState = {
|
|
407
|
+
reason: TelemetryUpdateReason.PluginAdded
|
|
408
|
+
};
|
|
409
|
+
|
|
404
410
|
function _addPlugin(removed: boolean) {
|
|
405
411
|
_configExtensions.push(plugin);
|
|
412
|
+
updateState.added = [plugin];
|
|
406
413
|
|
|
407
414
|
// Re-Initialize the plugin chain
|
|
408
|
-
_initPluginChain(_self.config);
|
|
415
|
+
_initPluginChain(_self.config, updateState);
|
|
409
416
|
addCb && addCb(true);
|
|
410
417
|
}
|
|
411
418
|
|
|
@@ -421,6 +428,8 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
421
428
|
// Previous plugin was successfully removed or was not installed
|
|
422
429
|
addCb && addCb(false);
|
|
423
430
|
} else {
|
|
431
|
+
updateState.removed = removedPlugins
|
|
432
|
+
updateState.reason |= TelemetryUpdateReason.PluginRemoved;
|
|
424
433
|
_addPlugin(true);
|
|
425
434
|
}
|
|
426
435
|
});
|
|
@@ -467,7 +476,7 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
467
476
|
}
|
|
468
477
|
|
|
469
478
|
// Initialize or Re-initialize the plugins
|
|
470
|
-
function _initPluginChain(config: IConfiguration) {
|
|
479
|
+
function _initPluginChain(config: IConfiguration, updateState: ITelemetryUpdateState) {
|
|
471
480
|
// Extension validation
|
|
472
481
|
let theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions);
|
|
473
482
|
|
|
@@ -513,6 +522,10 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
513
522
|
|
|
514
523
|
// Now reset the extensions to just those being managed by Basecore
|
|
515
524
|
_self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice();
|
|
525
|
+
|
|
526
|
+
if (updateState) {
|
|
527
|
+
_doUpdate(updateState);
|
|
528
|
+
}
|
|
516
529
|
}
|
|
517
530
|
|
|
518
531
|
function _getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T> {
|
|
@@ -551,7 +564,10 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
551
564
|
_removePlugins(pluginsToRemove, unloadState, (removed) => {
|
|
552
565
|
if (removed) {
|
|
553
566
|
// Re-Initialize the plugin chain
|
|
554
|
-
_initPluginChain(_self.config
|
|
567
|
+
_initPluginChain(_self.config, {
|
|
568
|
+
reason: TelemetryUpdateReason.PluginRemoved,
|
|
569
|
+
removed: pluginsToRemove
|
|
570
|
+
});
|
|
555
571
|
}
|
|
556
572
|
|
|
557
573
|
removeCb && removeCb(removed);
|
|
@@ -677,11 +693,19 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
677
693
|
extConfig.NotificationManager = _notificationManager;
|
|
678
694
|
}
|
|
679
695
|
|
|
696
|
+
function _doUpdate(updateState: ITelemetryUpdateState): void {
|
|
697
|
+
let updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self.config, _self);
|
|
698
|
+
|
|
699
|
+
if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {
|
|
700
|
+
updateCtx.processNext(updateState);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
680
704
|
function _logOrThrowError(message: string) {
|
|
681
705
|
let logger = _self.logger;
|
|
682
706
|
if (logger) {
|
|
683
707
|
// there should always be a logger
|
|
684
|
-
logger
|
|
708
|
+
_throwInternal(logger, eLoggingSeverity.WARNING, _eInternalMessageId.PluginException, message);
|
|
685
709
|
} else {
|
|
686
710
|
throwError(message);
|
|
687
711
|
}
|
|
@@ -792,7 +816,7 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
792
816
|
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
793
817
|
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
794
818
|
*/
|
|
795
|
-
public unload(isAsync?: boolean, unloadComplete?: () => void): void {
|
|
819
|
+
public unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void {
|
|
796
820
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
797
821
|
return null;
|
|
798
822
|
}
|
|
@@ -825,4 +849,15 @@ export class BaseCore implements IAppInsightsCore {
|
|
|
825
849
|
protected releaseQueue() {
|
|
826
850
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
827
851
|
}
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
|
|
855
|
+
* @param updateCtx - The plugin update context
|
|
856
|
+
* @param updateState - The Update State
|
|
857
|
+
* @returns boolean - True means the extension class will call updateState otherwise the Core will
|
|
858
|
+
*/
|
|
859
|
+
protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean {
|
|
860
|
+
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
828
863
|
}
|
|
@@ -9,15 +9,17 @@ import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
|
9
9
|
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
10
10
|
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
11
11
|
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
12
|
-
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
12
|
+
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
13
13
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
14
|
-
import { createProcessTelemetryContext, createProcessTelemetryUnloadContext } from "./ProcessTelemetryContext";
|
|
14
|
+
import { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext } from "./ProcessTelemetryContext";
|
|
15
15
|
import { arrForEach, isArray, isFunction, isNullOrUndefined, proxyFunctionAs, setValue } from "./HelperFuncs";
|
|
16
16
|
import { strExtensionConfig } from "./Constants";
|
|
17
17
|
import { createUnloadHandlerContainer, IUnloadHandlerContainer, UnloadHandler } from "./UnloadHandlerContainer";
|
|
18
18
|
import { IInstrumentHook } from "../JavaScriptSDK.Interfaces/IInstrumentHooks";
|
|
19
19
|
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
20
20
|
import { TelemetryUnloadReason } from "../JavaScriptSDK.Enums/TelemetryUnloadReason";
|
|
21
|
+
import { ITelemetryUpdateState } from "../JavaScriptSDK.Interfaces/ITelemetryUpdateState";
|
|
22
|
+
import { TelemetryUpdateReason } from "../JavaScriptSDK.Enums/TelemetryUpdateReason";
|
|
21
23
|
import { strDoTeardown, strIsInitialized, strSetNextPlugin } from "./InternalConstants";
|
|
22
24
|
|
|
23
25
|
let strGetPlugin = "getPlugin";
|
|
@@ -87,6 +89,15 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
87
89
|
*/
|
|
88
90
|
protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
|
|
89
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
|
|
94
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
95
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
96
|
+
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
|
|
97
|
+
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
98
|
+
*/
|
|
99
|
+
protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean;
|
|
100
|
+
|
|
90
101
|
constructor() {
|
|
91
102
|
let _self = this; // Setting _self here as it's used outside of the dynamicProto as well
|
|
92
103
|
|
|
@@ -151,6 +162,37 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
151
162
|
|
|
152
163
|
return result;
|
|
153
164
|
};
|
|
165
|
+
|
|
166
|
+
_self.update = (updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) => {
|
|
167
|
+
// If this plugin has already been torn down (not operational) or is not initialized (core is not set)
|
|
168
|
+
// or the core being used for unload was not the same core used for initialization.
|
|
169
|
+
if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
|
|
170
|
+
// Do Nothing
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
let result: void | boolean;
|
|
175
|
+
let updateDone = false;
|
|
176
|
+
let theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
177
|
+
let theUpdateState: ITelemetryUpdateState = updateState || {
|
|
178
|
+
reason: TelemetryUpdateReason.Unknown
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
function _updateCallback() {
|
|
182
|
+
if (!updateDone) {
|
|
183
|
+
updateDone = true;
|
|
184
|
+
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
189
|
+
_updateCallback();
|
|
190
|
+
} else {
|
|
191
|
+
result = true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return result;
|
|
195
|
+
};
|
|
154
196
|
|
|
155
197
|
_self._addHook = (hooks: IInstrumentHook | IInstrumentHook[]) => {
|
|
156
198
|
if (hooks) {
|
|
@@ -268,6 +310,16 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
268
310
|
|
|
269
311
|
public abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
270
312
|
|
|
313
|
+
/**
|
|
314
|
+
* The the plugin should re-evaluate configuration and update any cached configuration settings.
|
|
315
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
316
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
317
|
+
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
318
|
+
*/
|
|
319
|
+
public update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean{
|
|
320
|
+
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
321
|
+
}
|
|
322
|
+
|
|
271
323
|
/**
|
|
272
324
|
* Add an unload handler that will be called when the SDK is being unloaded
|
|
273
325
|
* @param handler - the handler
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
5
5
|
import { TelemetryUnloadReason } from "../JavaScriptSDK.Enums/TelemetryUnloadReason";
|
|
6
|
+
import { TelemetryUpdateReason } from "../JavaScriptSDK.Enums/TelemetryUpdateReason";
|
|
6
7
|
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
7
8
|
import { IChannelControls } from "../JavaScriptSDK.Interfaces/IChannelControls";
|
|
8
9
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
9
|
-
import { IBaseProcessingContext, IProcessTelemetryContext, IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
10
|
+
import { IBaseProcessingContext, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
10
11
|
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
11
12
|
import { IPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
12
13
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
13
14
|
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
15
|
+
import { ITelemetryUpdateState } from "../JavaScriptSDK.Interfaces/ITelemetryUpdateState";
|
|
14
16
|
import { arrForEach, isArray, objFreeze, throwError } from "./HelperFuncs";
|
|
15
17
|
import { strPause, strProcessNext, strResume, strTeardown } from "./InternalConstants";
|
|
16
18
|
import { createProcessTelemetryContext, createTelemetryProxyChain } from "./ProcessTelemetryContext";
|
|
@@ -90,6 +92,20 @@ export function createChannelControllerPlugin(channelQueue: _IInternalChannels[]
|
|
|
90
92
|
_runChainOnComplete();
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
function _doUpdate(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) {
|
|
96
|
+
let theUpdateState: ITelemetryUpdateState = updateState || {
|
|
97
|
+
reason: TelemetryUpdateReason.Unknown
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
_processChannelQueue(channelQueue, updateCtx, (chainCtx: IProcessTelemetryUpdateContext) => {
|
|
101
|
+
chainCtx[strProcessNext](theUpdateState);
|
|
102
|
+
}, () => {
|
|
103
|
+
updateCtx[strProcessNext](theUpdateState);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
93
109
|
function _doTeardown(unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) {
|
|
94
110
|
let theUnloadState: ITelemetryUnloadState = unloadState || {
|
|
95
111
|
reason: TelemetryUnloadReason.ManualTeardown,
|
|
@@ -152,6 +168,7 @@ export function createChannelControllerPlugin(channelQueue: _IInternalChannels[]
|
|
|
152
168
|
itemCtx[strProcessNext](item);
|
|
153
169
|
});
|
|
154
170
|
},
|
|
171
|
+
update: _doUpdate,
|
|
155
172
|
[strPause]: () => {
|
|
156
173
|
_processChannelQueue(channelQueue, _getTelCtx(), (chainCtx: IProcessTelemetryContext) => {
|
|
157
174
|
chainCtx.iterate<IChannelControls>((plugin) => {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
12
12
|
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
13
13
|
import { strEmpty } from "./InternalConstants";
|
|
14
|
+
import { _throwInternal } from "./DiagnosticLogger";
|
|
14
15
|
|
|
15
16
|
const strToGMTString = "toGMTString";
|
|
16
17
|
const strToUTCString = "toUTCString";
|
|
@@ -252,7 +253,8 @@ export function areCookiesSupported(logger?: IDiagnosticLogger): any {
|
|
|
252
253
|
let doc = _doc || {} as Document;
|
|
253
254
|
_supportsCookies = doc[strCookie] !== undefined;
|
|
254
255
|
} catch (e) {
|
|
255
|
-
|
|
256
|
+
_throwInternal(
|
|
257
|
+
logger,
|
|
256
258
|
eLoggingSeverity.WARNING,
|
|
257
259
|
_eInternalMessageId.CannotAccessCookie,
|
|
258
260
|
"Cannot access document.cookie - " + getExceptionName(e),
|
|
@@ -320,3 +320,17 @@ export class DiagnosticLogger implements IDiagnosticLogger {
|
|
|
320
320
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* This is a helper method which will call throwInternal on the passed logger, will throw exceptions in
|
|
326
|
+
* debug mode or attempt to log the error as a console warning. This helper is provided mostly to better
|
|
327
|
+
* support minification as logger.throwInternal() will not compress the publish "throwInternal" used throughout
|
|
328
|
+
* the code.
|
|
329
|
+
* @param logger - The Diagnostic Logger instance to use.
|
|
330
|
+
* @param severity {LoggingSeverity} - The severity of the log message
|
|
331
|
+
* @param message {_InternalLogMessage} - The log message.
|
|
332
|
+
*/
|
|
333
|
+
export function _throwInternal(logger: IDiagnosticLogger, severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct = false) {
|
|
334
|
+
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
335
|
+
}
|
|
336
|
+
|
|
@@ -49,12 +49,12 @@ function _normalizeNamespace(name: string) {
|
|
|
49
49
|
return name;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function _getEvtNamespace(eventName: string,
|
|
53
|
-
if (
|
|
52
|
+
function _getEvtNamespace(eventName: string, evtNamespace?: string | string[]): IEventDetails {
|
|
53
|
+
if (evtNamespace) {
|
|
54
54
|
let theNamespace: string = "";
|
|
55
|
-
if (isArray(
|
|
55
|
+
if (isArray(evtNamespace)) {
|
|
56
56
|
theNamespace = "";
|
|
57
|
-
arrForEach(
|
|
57
|
+
arrForEach(evtNamespace, (name) => {
|
|
58
58
|
name = _normalizeNamespace(name);
|
|
59
59
|
if (name) {
|
|
60
60
|
if (name[0] !== ".") {
|
|
@@ -65,7 +65,7 @@ function _getEvtNamespace(eventName: string, namespaces: string | string[]): IEv
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
} else {
|
|
68
|
-
theNamespace = _normalizeNamespace(
|
|
68
|
+
theNamespace = _normalizeNamespace(evtNamespace);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (theNamespace) {
|
|
@@ -96,18 +96,24 @@ export interface _IRegisteredEvents {
|
|
|
96
96
|
* Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by
|
|
97
97
|
* applications to remove their own events
|
|
98
98
|
* @param target - The EventTarget that has registered events
|
|
99
|
-
* @param
|
|
99
|
+
* @param eventName - [Optional] The name of the event to return the registered handlers and full name (with namespaces)
|
|
100
|
+
* @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,
|
|
101
|
+
* if the eventName also includes a namespace the namespace(s) are merged into a single namespace
|
|
100
102
|
*/
|
|
101
|
-
export function __getRegisteredEvents(target: any,
|
|
103
|
+
export function __getRegisteredEvents(target: any, eventName?: string, evtNamespace?: string | string[]): _IRegisteredEvents[] {
|
|
102
104
|
let theEvents: _IRegisteredEvents[] = [];
|
|
103
105
|
let eventCache = elmNodeData.get<IAiEvents>(target, strEvents, {}, false);
|
|
106
|
+
let evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
107
|
+
|
|
104
108
|
objForEachKey(eventCache, (evtType, registeredEvents) => {
|
|
105
109
|
arrForEach(registeredEvents, (value) => {
|
|
106
|
-
if (!evtName || evtName === value.evtName.type) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
if (!evtName.type || evtName.type === value.evtName.type) {
|
|
111
|
+
if (!evtName.ns || evtName.ns === evtName.ns) {
|
|
112
|
+
theEvents.push({
|
|
113
|
+
name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""),
|
|
114
|
+
handler: value.handler
|
|
115
|
+
});
|
|
116
|
+
}
|
|
111
117
|
}
|
|
112
118
|
});
|
|
113
119
|
});
|
|
@@ -871,7 +871,9 @@ export function optimizeObject<T>(theObject: T): T {
|
|
|
871
871
|
* @param obj5 - object to merge.
|
|
872
872
|
* @returns The extended first object.
|
|
873
873
|
*/
|
|
874
|
-
|
|
874
|
+
export function objExtend<T2, T3, T4, T5, T6>(deepExtend?: boolean, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T2 & T3 & T4 & T5 & T6
|
|
875
|
+
export function objExtend<T1, T2, T3, T4, T5, T6>(obj1?: T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T1 & T2 & T3 & T4 & T5 & T6
|
|
876
|
+
export function objExtend<T1, T2, T3, T4, T5, T6>(obj1?: T1 | any, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T1 & T2 & T3 & T4 & T5 & T6 {
|
|
875
877
|
// Variables
|
|
876
878
|
let theArgs = arguments as any;
|
|
877
879
|
let extended: T1 & T2 & T3 & T4 & T5 & T6 = theArgs[0] || {};
|