@microsoft/applicationinsights-core-js 3.0.0-beta.2302-04 → 3.0.0-beta.2302-06
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/README.md +2 -1
- package/browser/applicationinsights-core-js.integrity.json +9 -9
- package/browser/applicationinsights-core-js.js +236 -141
- 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 +813 -41
- package/dist/applicationinsights-core-js.api.md +27 -6
- package/dist/applicationinsights-core-js.d.ts +82 -7
- package/dist/applicationinsights-core-js.js +236 -141
- 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 +82 -7
- package/dist-esm/Config/ConfigDefaultHelpers.js +103 -0
- package/dist-esm/Config/ConfigDefaultHelpers.js.map +1 -0
- package/dist-esm/Config/ConfigDefaults.js +81 -11
- package/dist-esm/Config/ConfigDefaults.js.map +1 -1
- package/dist-esm/Config/DynamicConfig.js +3 -3
- package/dist-esm/Config/DynamicConfig.js.map +1 -1
- package/dist-esm/Config/DynamicProperty.js +1 -1
- package/dist-esm/Config/DynamicState.js +3 -3
- package/dist-esm/Config/DynamicState.js.map +1 -1
- package/dist-esm/Config/DynamicSupport.js +1 -1
- package/dist-esm/Config/IConfigDefaults.js +1 -1
- package/dist-esm/Config/IDynamicConfigHandler.js +1 -1
- package/dist-esm/Config/IDynamicPropertyHandler.js +1 -1
- package/dist-esm/Config/IDynamicWatcher.js +1 -1
- package/dist-esm/Config/_IDynamicConfigHandlerState.js +1 -1
- package/dist-esm/JavaScriptSDK/AggregationError.js +1 -1
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +2 -2
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +17 -15
- package/dist-esm/JavaScriptSDK/CookieMgr.js.map +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 +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +3 -3
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -10
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +12 -9
- 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/UnloadHookContainer.js +1 -1
- package/dist-esm/JavaScriptSDK/W3cTraceParent.js +6 -5
- 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 +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/IUnloadHook.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
- package/dist-esm/__DynamicConstants.js +6 -5
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-core-js.js +2 -1
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +1 -1
- package/src/JavaScriptSDK/CookieMgr.ts +14 -13
- package/src/JavaScriptSDK/HelperFuncs.ts +0 -11
- package/src/JavaScriptSDK/InstrumentHooks.ts +11 -8
- package/types/Config/ConfigDefaultHelpers.d.ts +47 -0
- package/types/Config/ConfigDefaults.d.ts +1 -2
- package/types/Config/IConfigDefaults.d.ts +24 -3
- package/types/JavaScriptSDK/InstrumentHooks.d.ts +6 -3
- package/types/__DynamicConstants.d.ts +2 -1
- package/types/applicationinsights-core-js.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2302-
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2302-06
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
// 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!!!
|
|
13
13
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
14
|
-
export var
|
|
14
|
+
export var _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 9
|
|
15
|
+
export var _DYN_LENGTH = "length"; // Count: 38
|
|
16
|
+
export var _DYN_RD_ONLY = "rdOnly"; // Count: 4
|
|
15
17
|
export var _DYN_NOTIFY = "notify"; // Count: 4
|
|
16
18
|
export var _DYN_THROW_INTERNAL = "throwInternal"; // Count: 4
|
|
17
|
-
export var _DYN_SET_DF = "setDf"; // Count:
|
|
19
|
+
export var _DYN_SET_DF = "setDf"; // Count: 6
|
|
18
20
|
export var _DYN_WATCH = "watch"; // Count: 12
|
|
19
21
|
export var _DYN_LOGGER = "logger"; // Count: 21
|
|
20
22
|
export var _DYN_CONFIGURABLE = "configurable"; // Count: 6
|
|
@@ -29,7 +31,7 @@ export var _DYN_IS_INITIALIZED = "isInitialized"; // Count: 10
|
|
|
29
31
|
export var _DYN_GET_PLUGIN = "getPlugin"; // Count: 6
|
|
30
32
|
export var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs"; // Count: 2
|
|
31
33
|
export var _DYN_NAME = "name"; // Count: 11
|
|
32
|
-
export var _DYN_TIME = "time"; // Count:
|
|
34
|
+
export var _DYN_TIME = "time"; // Count: 6
|
|
33
35
|
export var _DYN_PROCESS_NEXT = "processNext"; // Count: 15
|
|
34
36
|
export var _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext"; // Count: 2
|
|
35
37
|
export var _DYN_GET_NOTIFY_MGR = "getNotifyMgr"; // Count: 5
|
|
@@ -55,7 +57,6 @@ export var _DYN_NODE_TYPE = "nodeType"; // Count: 3
|
|
|
55
57
|
export var _DYN_REPLACE = "replace"; // Count: 8
|
|
56
58
|
export var _DYN_ENABLE_DEBUG_EXCEPTI5 = "enableDebugExceptions"; // Count: 3
|
|
57
59
|
export var _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage"; // Count: 2
|
|
58
|
-
export var _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 8
|
|
59
60
|
export var _DYN_TYPE = "type"; // Count: 14
|
|
60
61
|
export var _DYN_HANDLER = "handler"; // Count: 5
|
|
61
62
|
export var _DYN_LISTENERS = "listeners"; // Count: 6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// 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!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_LENGTH = \"length\"; // Count:
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// 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!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 9\r\nexport var _DYN_LENGTH = \"length\"; // Count: 38\r\nexport var _DYN_RD_ONLY = \"rdOnly\"; // Count: 4\r\nexport var _DYN_NOTIFY = \"notify\"; // Count: 4\r\nexport var _DYN_THROW_INTERNAL = \"throwInternal\"; // Count: 4\r\nexport var _DYN_SET_DF = \"setDf\"; // Count: 6\r\nexport var _DYN_WATCH = \"watch\"; // Count: 12\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 21\r\nexport var _DYN_CONFIGURABLE = \"configurable\"; // Count: 6\r\nexport var _DYN_ENUMERABLE = \"enumerable\"; // Count: 6\r\nexport var _DYN_APPLY = \"apply\"; // Count: 7\r\nexport var _DYN_PUSH = \"push\"; // Count: 31\r\nexport var _DYN_SPLICE = \"splice\"; // Count: 6\r\nexport var _DYN_CANCEL = \"cancel\"; // Count: 4\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 4\r\nexport var _DYN_IDENTIFIER = \"identifier\"; // Count: 10\r\nexport var _DYN_IS_INITIALIZED = \"isInitialized\"; // Count: 10\r\nexport var _DYN_GET_PLUGIN = \"getPlugin\"; // Count: 6\r\nexport var _DYN_POLL_INTERNAL_LOGS = \"pollInternalLogs\"; // Count: 2\r\nexport var _DYN_NAME = \"name\"; // Count: 11\r\nexport var _DYN_TIME = \"time\"; // Count: 6\r\nexport var _DYN_PROCESS_NEXT = \"processNext\"; // Count: 15\r\nexport var _DYN_GET_PROCESS_TEL_CONT0 = \"getProcessTelContext\"; // Count: 2\r\nexport var _DYN_GET_NOTIFY_MGR = \"getNotifyMgr\"; // Count: 5\r\nexport var _DYN_ADD_NOTIFICATION_LIS1 = \"addNotificationListener\"; // Count: 4\r\nexport var _DYN_REMOVE_NOTIFICATION_2 = \"removeNotificationListener\"; // Count: 4\r\nexport var _DYN_STOP_POLLING_INTERNA3 = \"stopPollingInternalLogs\"; // Count: 2\r\nexport var _DYN_ON_COMPLETE = \"onComplete\"; // Count: 3\r\nexport var _DYN_VERSION = \"version\"; // Count: 8\r\nexport var _DYN_LOGGING_LEVEL_CONSOL4 = \"loggingLevelConsole\"; // Count: 2\r\nexport var _DYN_CREATE_NEW = \"createNew\"; // Count: 7\r\nexport var _DYN_TEARDOWN = \"teardown\"; // Count: 9\r\nexport var _DYN_MESSAGE_ID = \"messageId\"; // Count: 4\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 6\r\nexport var _DYN_IS_ASYNC = \"isAsync\"; // Count: 6\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 9\r\nexport var _DYN__DO_TEARDOWN = \"_doTeardown\"; // Count: 4\r\nexport var _DYN_UPDATE = \"update\"; // Count: 6\r\nexport var _DYN_GET_NEXT = \"getNext\"; // Count: 12\r\nexport var _DYN_SET_NEXT_PLUGIN = \"setNextPlugin\"; // Count: 5\r\nexport var _DYN_USER_AGENT = \"userAgent\"; // Count: 5\r\nexport var _DYN_SPLIT = \"split\"; // Count: 5\r\nexport var _DYN_NODE_TYPE = \"nodeType\"; // Count: 3\r\nexport var _DYN_REPLACE = \"replace\"; // Count: 8\r\nexport var _DYN_ENABLE_DEBUG_EXCEPTI5 = \"enableDebugExceptions\"; // Count: 3\r\nexport var _DYN_LOG_INTERNAL_MESSAGE = \"logInternalMessage\"; // Count: 2\r\nexport var _DYN_TYPE = \"type\"; // Count: 14\r\nexport var _DYN_HANDLER = \"handler\"; // Count: 5\r\nexport var _DYN_LISTENERS = \"listeners\"; // Count: 6\r\nexport var _DYN_IS_CHILD_EVT = \"isChildEvt\"; // Count: 3\r\nexport var _DYN_GET_CTX = \"getCtx\"; // Count: 6\r\nexport var _DYN_SET_CTX = \"setCtx\"; // Count: 10\r\nexport var _DYN_COMPLETE = \"complete\"; // Count: 3\r\nexport var _DYN_TRACE_ID = \"traceId\"; // Count: 5\r\nexport var _DYN_SPAN_ID = \"spanId\"; // Count: 5\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 6\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2302-
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2302-06
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
export { MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";
|
|
@@ -32,4 +32,5 @@ export { createUnloadHookContainer } from "./JavaScriptSDK/UnloadHookContainer";
|
|
|
32
32
|
export { createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent } from "./JavaScriptSDK/W3cTraceParent";
|
|
33
33
|
export { createDynamicConfig, onConfigChange } from "./Config/DynamicConfig";
|
|
34
34
|
export { getDynamicConfigHandler } from "./Config/DynamicSupport";
|
|
35
|
+
export { cfgDfValidate, cfgDfMerge, cfgDfBoolean, cfgDfFunc, cfgDfString, cfgDfSet } from "./Config/ConfigDefaultHelpers";
|
|
35
36
|
//# sourceMappingURL=applicationinsights-core-js.js.map
|
|
@@ -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 { throwAggregationError } from \"./JavaScriptSDK/AggregationError\";\r\nexport { AppInsightsCore } from \"./JavaScriptSDK/AppInsightsCore\";\r\nexport { BaseTelemetryPlugin } from \"./JavaScriptSDK/BaseTelemetryPlugin\";\r\nexport { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from \"./JavaScriptSDK/RandomHelper\";\r\nexport { Undefined, newGuid, generateW3CId } from \"./JavaScriptSDK/CoreUtils\";\r\nexport { normalizeJsName, toISOString, getExceptionName, strContains, setValue, getSetValue, proxyAssign, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objExtend } from \"./JavaScriptSDK/HelperFuncs\";\r\nexport { isArray, isTypeof, isUndefined, isNullOrUndefined, objHasOwnProperty as hasOwnProperty, isObject, isFunction, strEndsWith, strStartsWith, isDate, isError, isString, isNumber, isBoolean, arrForEach, arrIndexOf, arrReduce, arrMap, strTrim, objKeys, objDefineAccessors, throwError, isSymbol, isNotTruthy, isTruthy, objFreeze, objSeal, objToString, objDeepFreeze as deepFreeze, getInst as getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, dumpObj, asString, objForEachKey, getPerformance, utcNow as dateNow, perfNow } from \"@nevware21/ts-utils\";\r\nexport { createEnumStyle, createValueMap } from \"./JavaScriptSDK.Enums/EnumHelperFuncs\";\r\nexport { attachEvent, detachEvent, addEventHandler, addEventListeners, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, __getRegisteredEvents } from \"./JavaScriptSDK/EventHelpers\";\r\nexport { getCrypto, getMsCrypto, getLocation, hasJSON, getJSON, isReactNative, getConsole, isIE, getIEVersion, isSafari, setEnableEnvMocks, isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported, findMetaTag, findNamedServerTiming } 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, _warnToConsole, _logInternalMessage } 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, unloadComponents } from \"./JavaScriptSDK/TelemetryHelpers\";\r\nexport { LoggingSeverity } from \"./JavaScriptSDK.Enums/LoggingEnums\";\r\nexport { InstrumentProto, InstrumentProtos, InstrumentFunc, InstrumentFuncs, InstrumentEvent } from \"./JavaScriptSDK/InstrumentHooks\";\r\nexport { createCookieMgr, safeGetCookieMgr, uaDisallowsSameSiteNone, areCookiesSupported } from \"./JavaScriptSDK/CookieMgr\";\r\nexport { getDebugListener, getDebugExt } from \"./JavaScriptSDK/DbgExtensionUtils\";\r\nexport { createUniqueNamespace } from \"./JavaScriptSDK/DataCacheHelper\";\r\nexport { createUnloadHandlerContainer } from \"./JavaScriptSDK/UnloadHandlerContainer\";\r\nexport { createUnloadHookContainer } from \"./JavaScriptSDK/UnloadHookContainer\";\r\nexport { createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent } from \"./JavaScriptSDK/W3cTraceParent\";\r\nexport { createDynamicConfig, onConfigChange } from \"./Config/DynamicConfig\";\r\nexport { getDynamicConfigHandler } from \"./Config/DynamicSupport\";\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;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 { throwAggregationError } from \"./JavaScriptSDK/AggregationError\";\r\nexport { AppInsightsCore } from \"./JavaScriptSDK/AppInsightsCore\";\r\nexport { BaseTelemetryPlugin } from \"./JavaScriptSDK/BaseTelemetryPlugin\";\r\nexport { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from \"./JavaScriptSDK/RandomHelper\";\r\nexport { Undefined, newGuid, generateW3CId } from \"./JavaScriptSDK/CoreUtils\";\r\nexport { normalizeJsName, toISOString, getExceptionName, strContains, setValue, getSetValue, proxyAssign, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objExtend } from \"./JavaScriptSDK/HelperFuncs\";\r\nexport { isArray, isTypeof, isUndefined, isNullOrUndefined, objHasOwnProperty as hasOwnProperty, isObject, isFunction, strEndsWith, strStartsWith, isDate, isError, isString, isNumber, isBoolean, arrForEach, arrIndexOf, arrReduce, arrMap, strTrim, objKeys, objDefineAccessors, throwError, isSymbol, isNotTruthy, isTruthy, objFreeze, objSeal, objToString, objDeepFreeze as deepFreeze, getInst as getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, dumpObj, asString, objForEachKey, getPerformance, utcNow as dateNow, perfNow } from \"@nevware21/ts-utils\";\r\nexport { createEnumStyle, createValueMap } from \"./JavaScriptSDK.Enums/EnumHelperFuncs\";\r\nexport { attachEvent, detachEvent, addEventHandler, addEventListeners, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, __getRegisteredEvents } from \"./JavaScriptSDK/EventHelpers\";\r\nexport { getCrypto, getMsCrypto, getLocation, hasJSON, getJSON, isReactNative, getConsole, isIE, getIEVersion, isSafari, setEnableEnvMocks, isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported, findMetaTag, findNamedServerTiming } 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, _warnToConsole, _logInternalMessage } 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, unloadComponents } from \"./JavaScriptSDK/TelemetryHelpers\";\r\nexport { LoggingSeverity } from \"./JavaScriptSDK.Enums/LoggingEnums\";\r\nexport { InstrumentProto, InstrumentProtos, InstrumentFunc, InstrumentFuncs, InstrumentEvent } from \"./JavaScriptSDK/InstrumentHooks\";\r\nexport { createCookieMgr, safeGetCookieMgr, uaDisallowsSameSiteNone, areCookiesSupported } from \"./JavaScriptSDK/CookieMgr\";\r\nexport { getDebugListener, getDebugExt } from \"./JavaScriptSDK/DbgExtensionUtils\";\r\nexport { createUniqueNamespace } from \"./JavaScriptSDK/DataCacheHelper\";\r\nexport { createUnloadHandlerContainer } from \"./JavaScriptSDK/UnloadHandlerContainer\";\r\nexport { createUnloadHookContainer } from \"./JavaScriptSDK/UnloadHookContainer\";\r\nexport { createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent } from \"./JavaScriptSDK/W3cTraceParent\";\r\nexport { createDynamicConfig, onConfigChange } from \"./Config/DynamicConfig\";\r\nexport { getDynamicConfigHandler } from \"./Config/DynamicSupport\";\r\nexport { cfgDfValidate, cfgDfMerge, cfgDfBoolean, cfgDfFunc, cfgDfString, cfgDfSet } from \"./Config/ConfigDefaultHelpers\";\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;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": "3.0.0-beta.2302-
|
|
4
|
+
"version": "3.0.0-beta.2302-06",
|
|
5
5
|
"description": "Microsoft Application Insights Core Javascript SDK",
|
|
6
6
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
7
7
|
"keywords": [
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import {
|
|
4
4
|
arrForEach, arrIndexOf, dumpObj, getDocument, getNavigator, isArray, isFunction, isNullOrUndefined, isString, isTruthy, isUndefined,
|
|
5
|
-
|
|
5
|
+
objForEachKey, strEndsWith, strIndexOf, strLeft, strSubstring, strTrim, utcNow
|
|
6
6
|
} from "@nevware21/ts-utils";
|
|
7
|
+
import { cfgDfMerge } from "../Config/ConfigDefaultHelpers";
|
|
7
8
|
import { createDynamicConfig, onConfigChange } from "../Config/DynamicConfig";
|
|
8
9
|
import { IConfigDefaults } from "../Config/IConfigDefaults";
|
|
9
10
|
import { _eInternalMessageId, eLoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
|
|
@@ -31,15 +32,9 @@ let _doc = getDocument();
|
|
|
31
32
|
let _cookieCache = {};
|
|
32
33
|
let _globalCookieConfig = {};
|
|
33
34
|
|
|
34
|
-
// `isCookieUseDisabled` is deprecated, so explicitly casting as a key of IConfiguration to avoid typing error
|
|
35
|
-
// when both isCookieUseDisabled and disableCookiesUsage are used disableCookiesUsage will take precedent, which is
|
|
36
|
-
// why its listed first
|
|
37
|
-
|
|
38
|
-
const defaultConfig: IConfigDefaults<ICookieMgrConfig> = objDeepFreeze({
|
|
39
|
-
[STR_DOMAIN]: { fb: "cookieDomain", dfVal: isNotNullOrUndefined },
|
|
40
|
-
path: { fb: "cookiePath", dfVal: isNotNullOrUndefined },
|
|
41
|
-
enabled: UNDEFINED_VALUE
|
|
42
|
-
});
|
|
35
|
+
// // `isCookieUseDisabled` is deprecated, so explicitly casting as a key of IConfiguration to avoid typing error
|
|
36
|
+
// // when both isCookieUseDisabled and disableCookiesUsage are used disableCookiesUsage will take precedent, which is
|
|
37
|
+
// // why its listed first
|
|
43
38
|
|
|
44
39
|
/**
|
|
45
40
|
* Set the supported dynamic config values as undefined (or an empty object) so that
|
|
@@ -47,8 +42,14 @@ const defaultConfig: IConfigDefaults<ICookieMgrConfig> = objDeepFreeze({
|
|
|
47
42
|
* Explicitly NOT including the deprecated `isCookieUseDisabled` as we don't want to support
|
|
48
43
|
* the v1 deprecated field as dynamic for updates
|
|
49
44
|
*/
|
|
50
|
-
const rootDefaultConfig = {
|
|
51
|
-
cookieCfg: {
|
|
45
|
+
const rootDefaultConfig: IConfigDefaults<IConfiguration> = {
|
|
46
|
+
cookieCfg: cfgDfMerge<ICookieMgrConfig>({
|
|
47
|
+
[STR_DOMAIN]: { fb: "cookieDomain", dfVal: isNotNullOrUndefined },
|
|
48
|
+
path: { fb: "cookiePath", dfVal: isNotNullOrUndefined },
|
|
49
|
+
enabled: UNDEFINED_VALUE,
|
|
50
|
+
ignoreCookies: UNDEFINED_VALUE,
|
|
51
|
+
blockedCookies: UNDEFINED_VALUE
|
|
52
|
+
}),
|
|
52
53
|
cookieDomain: UNDEFINED_VALUE,
|
|
53
54
|
cookiePath: UNDEFINED_VALUE,
|
|
54
55
|
[strDisableCookiesUsage]: UNDEFINED_VALUE
|
|
@@ -152,7 +153,7 @@ export function createCookieMgr(rootConfig?: IConfiguration, logger?: IDiagnosti
|
|
|
152
153
|
details.setDf(details.cfg, rootDefaultConfig);
|
|
153
154
|
|
|
154
155
|
// Create and apply the defaults to the cookieCfg element
|
|
155
|
-
cookieMgrConfig =
|
|
156
|
+
cookieMgrConfig = details.ref(details.cfg, "cookieCfg"); // details.setDf(details.cfg.cookieCfg, defaultConfig);
|
|
156
157
|
let isEnabled = cookieMgrConfig.enabled;
|
|
157
158
|
if (isNullOrUndefined(isEnabled)) {
|
|
158
159
|
// Set the enabled from the provided setting or the legacy root values
|
|
@@ -10,19 +10,8 @@ import { STR_EMPTY } from "./InternalConstants";
|
|
|
10
10
|
// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly
|
|
11
11
|
|
|
12
12
|
// Added to help with minification
|
|
13
|
-
const strToString = "toString";
|
|
14
13
|
const strGetPrototypeOf = "getPrototypeOf";
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* Constant string defined to support minimization
|
|
18
|
-
* @ignore
|
|
19
|
-
*/
|
|
20
|
-
const strConstructor = "constructor";
|
|
21
|
-
|
|
22
|
-
const _fnToString = ObjClass[strToString];
|
|
23
|
-
// Cache what this browser reports as the object function constructor (as a string)
|
|
24
|
-
const _objFunctionString = _fnToString.call(ObjClass);
|
|
25
|
-
|
|
26
15
|
const rCamelCase = /-([a-z])/g;
|
|
27
16
|
const rNormalizeInvalid = /([^\w\d_$])/g;
|
|
28
17
|
const rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
@@ -131,13 +131,13 @@ function _createFunctionHook(aiHook:IInstrumentHooks) {
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
/** @ignore */
|
|
134
|
-
function _getOwner(target:any, name:string, checkPrototype: boolean): any {
|
|
134
|
+
function _getOwner(target:any, name:string, checkPrototype: boolean, checkParentProto: boolean): any {
|
|
135
135
|
let owner = null;
|
|
136
136
|
if (target) {
|
|
137
137
|
if (objHasOwnProperty(target, name)) {
|
|
138
138
|
owner = target;
|
|
139
139
|
} else if (checkPrototype) {
|
|
140
|
-
owner = _getOwner(_getObjProto(target), name, false);
|
|
140
|
+
owner = _getOwner(_getObjProto(target), name, checkParentProto, false);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -219,10 +219,11 @@ function _createInstrumentHook(owner: any, funcName: string, fn: any, callbacks:
|
|
|
219
219
|
* @param funcName - The function name
|
|
220
220
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
221
221
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
222
|
+
* @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
|
|
222
223
|
*/
|
|
223
|
-
export function InstrumentFunc(target:any, funcName:string, callbacks: IInstrumentHooksCallbacks, checkPrototype:boolean = true): IInstrumentHook {
|
|
224
|
+
export function InstrumentFunc(target:any, funcName:string, callbacks: IInstrumentHooksCallbacks, checkPrototype: boolean = true, checkParentProto?: boolean): IInstrumentHook {
|
|
224
225
|
if (target && funcName && callbacks) {
|
|
225
|
-
let owner = _getOwner(target, funcName, checkPrototype);
|
|
226
|
+
let owner = _getOwner(target, funcName, checkPrototype, checkParentProto);
|
|
226
227
|
if (owner) {
|
|
227
228
|
let fn = owner[funcName]
|
|
228
229
|
if (typeof fn === strShimFunction) {
|
|
@@ -240,11 +241,12 @@ export function InstrumentFunc(target:any, funcName:string, callbacks: IInstrume
|
|
|
240
241
|
* @param funcNames - The function names to intercept and call
|
|
241
242
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
242
243
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
244
|
+
* @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
|
|
243
245
|
*/
|
|
244
|
-
export function InstrumentFuncs(target:any, funcNames:string[], callbacks: IInstrumentHooksCallbacks, checkPrototype:boolean = true): IInstrumentHook[] {
|
|
246
|
+
export function InstrumentFuncs(target:any, funcNames:string[], callbacks: IInstrumentHooksCallbacks, checkPrototype:boolean = true, checkParentProto?: boolean): IInstrumentHook[] {
|
|
245
247
|
let hooks: IInstrumentHook[] = null;
|
|
246
248
|
_arrLoop(funcNames, (funcName) => {
|
|
247
|
-
let hook = InstrumentFunc(target, funcName, callbacks, checkPrototype);
|
|
249
|
+
let hook = InstrumentFunc(target, funcName, callbacks, checkPrototype, checkParentProto);
|
|
248
250
|
if (hook) {
|
|
249
251
|
if (!hooks) {
|
|
250
252
|
hooks = [];
|
|
@@ -264,10 +266,11 @@ export function InstrumentFuncs(target:any, funcNames:string[], callbacks: IInst
|
|
|
264
266
|
* @param evtName - The name of the event
|
|
265
267
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
266
268
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
269
|
+
* @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
|
|
267
270
|
*/
|
|
268
|
-
export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook {
|
|
271
|
+
export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean, checkParentProto?: boolean): IInstrumentHook {
|
|
269
272
|
if (target && evtName && callbacks) {
|
|
270
|
-
let owner = _getOwner(target, evtName, checkPrototype) || target;
|
|
273
|
+
let owner = _getOwner(target, evtName, checkPrototype, checkParentProto) || target;
|
|
271
274
|
if (owner) {
|
|
272
275
|
return _createInstrumentHook(owner, evtName, owner[evtName], callbacks);
|
|
273
276
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IConfiguration } from "../applicationinsights-core-js";
|
|
2
|
+
import { IConfigCheckFn, IConfigDefaultCheck, IConfigDefaults, IConfigSetFn } from "./IConfigDefaults";
|
|
3
|
+
/**
|
|
4
|
+
* Helper which returns an IConfigDefaultCheck instance with the provided field validator
|
|
5
|
+
* @param validator - The IConfigCheckFn function to validate the user provided value
|
|
6
|
+
* @param defaultValue - The default value to apply it not provided or it's not valid
|
|
7
|
+
* @returns a new IConfigDefaultCheck structure
|
|
8
|
+
*/
|
|
9
|
+
export declare function cfgDfMerge<V, T = IConfiguration, C = IConfiguration>(defaultValue: V | IConfigDefaults<V, T>): IConfigDefaultCheck<T, V, C>;
|
|
10
|
+
/**
|
|
11
|
+
* Helper which returns an IConfigDefaultCheck instance with the provided field set function
|
|
12
|
+
* @param setter - The IConfigCheckFn function to validate the user provided value
|
|
13
|
+
* @param defaultValue - The default value to apply it not provided or it's not valid
|
|
14
|
+
* @returns a new IConfigDefaultCheck structure
|
|
15
|
+
*/
|
|
16
|
+
export declare function cfgDfSet<V, T, C = IConfiguration>(setter: IConfigSetFn<T, V>, defaultValue: V): IConfigDefaultCheck<T, V, C>;
|
|
17
|
+
/**
|
|
18
|
+
* Helper which returns an IConfigDefaultCheck instance with the provided field validator
|
|
19
|
+
* @param validator - The IConfigCheckFn function to validate the user provided value
|
|
20
|
+
* @param defaultValue - The default value to apply it not provided or it's not valid
|
|
21
|
+
* @param fallBackName - The fallback configuration name if the current value is not available
|
|
22
|
+
* @returns a new IConfigDefaultCheck structure
|
|
23
|
+
*/
|
|
24
|
+
export declare function cfgDfValidate<V, T, C = IConfiguration>(validator: IConfigCheckFn<V>, defaultValue: V, fallBackName?: keyof T | keyof C | Array<keyof T | keyof C>): IConfigDefaultCheck<T, V, C>;
|
|
25
|
+
/**
|
|
26
|
+
* Helper which returns an IConfigDefaultCheck instance that will validate and convert the user
|
|
27
|
+
* provided value to a boolean from a string or boolean value
|
|
28
|
+
* @param validator - The IConfigCheckFn function to validate the user provided value
|
|
29
|
+
* @param defaultValue - The default value to apply it not provided or it's not valid
|
|
30
|
+
* @param fallBackName - The fallback configuration name if the current value is not available
|
|
31
|
+
* @returns a new IConfigDefaultCheck structure
|
|
32
|
+
*/
|
|
33
|
+
export declare function cfgDfBoolean<T, C = IConfiguration>(defaultValue?: boolean, fallBackName?: keyof T | keyof C | Array<keyof T | keyof C>): IConfigDefaultCheck<T, boolean, C>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper which returns an IConfigDefaultCheck instance that will validate that the user
|
|
36
|
+
* provided value is a function.
|
|
37
|
+
* @param defaultValue - The default value to apply it not provided or it's not valid
|
|
38
|
+
* @returns a new IConfigDefaultCheck structure
|
|
39
|
+
*/
|
|
40
|
+
export declare function cfgDfFunc<V, T, C = IConfiguration>(defaultValue?: V): IConfigDefaultCheck<T, V, C>;
|
|
41
|
+
/**
|
|
42
|
+
* Helper which returns an IConfigDefaultCheck instance that will validate that the user
|
|
43
|
+
* provided value is a function.
|
|
44
|
+
* @param defaultValue - The default string value to apply it not provided or it's not valid, defaults to an empty string
|
|
45
|
+
* @returns a new IConfigDefaultCheck structure
|
|
46
|
+
*/
|
|
47
|
+
export declare function cfgDfString<T, C = IConfiguration>(defaultValue?: string): IConfigDefaultCheck<T, string, C>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
2
1
|
import { IConfigDefaultCheck } from "./IConfigDefaults";
|
|
3
2
|
import { IDynamicConfigHandler } from "./IDynamicConfigHandler";
|
|
4
3
|
/**
|
|
@@ -7,4 +6,4 @@ import { IDynamicConfigHandler } from "./IDynamicConfigHandler";
|
|
|
7
6
|
* @param name
|
|
8
7
|
* @param defaultValue
|
|
9
8
|
*/
|
|
10
|
-
export declare function _applyDefaultValue<T
|
|
9
|
+
export declare function _applyDefaultValue<T, C>(dynamicHandler: IDynamicConfigHandler<T>, theConfig: C, name: string, defaultValue: C[keyof C] | IConfigDefaultCheck<C, C[keyof C], T>): void;
|
|
@@ -10,7 +10,7 @@ export type IConfigSetFn<T, V> = (value: any, defValue: V, theConfig: T) => V;
|
|
|
10
10
|
/**
|
|
11
11
|
* The default values with a check function
|
|
12
12
|
*/
|
|
13
|
-
export interface IConfigDefaultCheck<T, V, C
|
|
13
|
+
export interface IConfigDefaultCheck<T, V, C = IConfiguration> {
|
|
14
14
|
/**
|
|
15
15
|
* Callback function to check if the user-supplied value is valid, if not the default will be applied
|
|
16
16
|
*/
|
|
@@ -22,7 +22,7 @@ export interface IConfigDefaultCheck<T, V, C extends IConfiguration = IConfigura
|
|
|
22
22
|
/**
|
|
23
23
|
* The default value to apply if the user-supplied value is not valid
|
|
24
24
|
*/
|
|
25
|
-
v?: V
|
|
25
|
+
v?: V | IConfigDefaults<V, T>;
|
|
26
26
|
/**
|
|
27
27
|
* The default fallback key if the main key is not present, this is the key value from the config
|
|
28
28
|
*/
|
|
@@ -32,11 +32,32 @@ export interface IConfigDefaultCheck<T, V, C extends IConfiguration = IConfigura
|
|
|
32
32
|
* therefore `null`; `""` are considered to be valid values.
|
|
33
33
|
*/
|
|
34
34
|
dfVal?: (value: any) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Specify that any provided value should have the default value(s) merged into the value rather than
|
|
37
|
+
* just using either the default of user provided values. Mergeed objects will automatically be marked
|
|
38
|
+
* as referenced.
|
|
39
|
+
*/
|
|
40
|
+
mrg?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Set this field of the target as referenced, which will cause any object or array instance
|
|
43
|
+
* to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.
|
|
44
|
+
* This is required for nested default objects to avoid multiple repetitive updates to listeners
|
|
45
|
+
* @returns The referenced properties current value
|
|
46
|
+
*/
|
|
47
|
+
ref?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Set this field of the target as read-only, which will block this single named property from
|
|
50
|
+
* ever being changed for the target instance.
|
|
51
|
+
* This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property,
|
|
52
|
+
* if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.
|
|
53
|
+
* @returns The referenced properties current value
|
|
54
|
+
*/
|
|
55
|
+
rdOnly?: boolean;
|
|
35
56
|
}
|
|
36
57
|
/**
|
|
37
58
|
* The Type definition to define default values to be applied to the config
|
|
38
59
|
* The value may be either the direct value or a ConfigDefaultCheck definition
|
|
39
60
|
*/
|
|
40
|
-
export type IConfigDefaults<T, C
|
|
61
|
+
export type IConfigDefaults<T, C = IConfiguration> = {
|
|
41
62
|
[key in keyof T]: T[key] | IConfigDefaultCheck<T, T[key], C>;
|
|
42
63
|
};
|
|
@@ -19,16 +19,18 @@ export declare function InstrumentProtos(target: any, funcNames: string[], callb
|
|
|
19
19
|
* @param funcName - The function name
|
|
20
20
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
21
21
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
22
|
+
* @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
|
|
22
23
|
*/
|
|
23
|
-
export declare function InstrumentFunc(target: any, funcName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook;
|
|
24
|
+
export declare function InstrumentFunc(target: any, funcName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean, checkParentProto?: boolean): IInstrumentHook;
|
|
24
25
|
/**
|
|
25
26
|
* Intercept the named functions for the target class / object
|
|
26
27
|
* @param target - The target object
|
|
27
28
|
* @param funcNames - The function names to intercept and call
|
|
28
29
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
29
30
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
31
|
+
* @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
|
|
30
32
|
*/
|
|
31
|
-
export declare function InstrumentFuncs(target: any, funcNames: string[], callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook[];
|
|
33
|
+
export declare function InstrumentFuncs(target: any, funcNames: string[], callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean, checkParentProto?: boolean): IInstrumentHook[];
|
|
32
34
|
/**
|
|
33
35
|
* Add an instrumentation hook to the provided named "event" for the target class / object, this doesn't check whether the
|
|
34
36
|
* named "event" is in fact a function and just assigns the instrumentation hook to the target[evtName]
|
|
@@ -36,5 +38,6 @@ export declare function InstrumentFuncs(target: any, funcNames: string[], callba
|
|
|
36
38
|
* @param evtName - The name of the event
|
|
37
39
|
* @param callbacks - The callbacks to configure and call whenever the function is called
|
|
38
40
|
* @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function
|
|
41
|
+
* @param checkParentProto - If the function doesn't exist on the target or it's prototype should it attempt to hook the parent's prototype
|
|
39
42
|
*/
|
|
40
|
-
export declare function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook;
|
|
43
|
+
export declare function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean, checkParentProto?: boolean): IInstrumentHook;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export declare const _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
1
2
|
export declare const _DYN_LENGTH = "length";
|
|
3
|
+
export declare const _DYN_RD_ONLY = "rdOnly";
|
|
2
4
|
export declare const _DYN_NOTIFY = "notify";
|
|
3
5
|
export declare const _DYN_THROW_INTERNAL = "throwInternal";
|
|
4
6
|
export declare const _DYN_SET_DF = "setDf";
|
|
@@ -42,7 +44,6 @@ export declare const _DYN_NODE_TYPE = "nodeType";
|
|
|
42
44
|
export declare const _DYN_REPLACE = "replace";
|
|
43
45
|
export declare const _DYN_ENABLE_DEBUG_EXCEPTI5 = "enableDebugExceptions";
|
|
44
46
|
export declare const _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
|
|
45
|
-
export declare const _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
46
47
|
export declare const _DYN_TYPE = "type";
|
|
47
48
|
export declare const _DYN_HANDLER = "handler";
|
|
48
49
|
export declare const _DYN_LISTENERS = "listeners";
|
|
@@ -54,3 +54,4 @@ export { IDynamicPropertyHandler } from "./Config/IDynamicPropertyHandler";
|
|
|
54
54
|
export { IWatchDetails, IWatcherHandler, WatcherFunction } from "./Config/IDynamicWatcher";
|
|
55
55
|
export { createDynamicConfig, onConfigChange } from "./Config/DynamicConfig";
|
|
56
56
|
export { getDynamicConfigHandler } from "./Config/DynamicSupport";
|
|
57
|
+
export { cfgDfValidate, cfgDfMerge, cfgDfBoolean, cfgDfFunc, cfgDfString, cfgDfSet } from "./Config/ConfigDefaultHelpers";
|