@microsoft/applicationinsights-core-js 2.8.0-nightly.2204-18 → 2.8.1-nightly.2204-20
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 +30 -22
- 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 +26 -25
- package/dist/applicationinsights-core-js.d.ts +1 -4
- package/dist/applicationinsights-core-js.js +30 -22
- 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 -4
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +11 -7
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +7 -5
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +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 +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 +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 +16 -13
- 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 +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 +1 -1
- package/src/JavaScriptSDK/BaseCore.ts +14 -6
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +6 -4
- package/src/JavaScriptSDK/DataCacheHelper.ts +1 -1
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +18 -14
- package/src/JavaScriptSDK/TelemetryHelpers.ts +1 -1
- package/src/JavaScriptSDK.Interfaces/IConfiguration.ts +1 -3
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +2 -2
- package/types/JavaScriptSDK/TelemetryHelpers.d.ts +1 -1
- package/types/JavaScriptSDK.Interfaces/IConfiguration.d.ts +0 -3
- package/types/tsdoc-metadata.json +1 -1
|
@@ -43,7 +43,7 @@ interface IInternalContext<T extends IBaseProcessingContext> {
|
|
|
43
43
|
ctx: T
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
function _getNextProxyStart(proxy: ITelemetryPluginChain,
|
|
46
|
+
function _getNextProxyStart<T, C = IConfiguration>(proxy: ITelemetryPluginChain, core: IAppInsightsCore, startAt: IPlugin): ITelemetryPluginChain {
|
|
47
47
|
while (proxy) {
|
|
48
48
|
if (proxy.getPlugin() === startAt) {
|
|
49
49
|
return proxy;
|
|
@@ -53,7 +53,7 @@ function _getNextProxyStart(proxy: ITelemetryPluginChain, config: IConfiguration
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// This wasn't found in the existing chain so create an isolated one with just this plugin
|
|
56
|
-
return createTelemetryProxyChain([startAt], config, core);
|
|
56
|
+
return createTelemetryProxyChain([startAt], core.config || {}, core);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -64,7 +64,7 @@ function _getNextProxyStart(proxy: ITelemetryPluginChain, config: IConfiguration
|
|
|
64
64
|
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
65
65
|
* @returns
|
|
66
66
|
*/
|
|
67
|
-
function _createInternalContext<T extends IBaseProcessingContext>(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core:IAppInsightsCore, startAt?: IPlugin): IInternalContext<T> {
|
|
67
|
+
function _createInternalContext<T extends IBaseProcessingContext>(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IInternalContext<T> {
|
|
68
68
|
// We have a special case where we want to start execution from this specific plugin
|
|
69
69
|
// or we simply reuse the existing telemetry plugin chain (normal execution case)
|
|
70
70
|
let _nextProxy: ITelemetryPluginChain | null = null; // By Default set as no next plugin
|
|
@@ -72,7 +72,7 @@ function _createInternalContext<T extends IBaseProcessingContext>(telemetryChain
|
|
|
72
72
|
|
|
73
73
|
if (startAt !== null) {
|
|
74
74
|
// There is no next element (null) vs not defined (undefined) so use the full chain
|
|
75
|
-
_nextProxy = startAt ? _getNextProxyStart(telemetryChain,
|
|
75
|
+
_nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
let context: IInternalContext<T> = {
|
|
@@ -159,7 +159,7 @@ function _createInternalContext<T extends IBaseProcessingContext>(telemetryChain
|
|
|
159
159
|
let newConfig = objExtend(true, defaultValue, theConfig);
|
|
160
160
|
|
|
161
161
|
if (config && mergeDefault === GetExtCfgMergeType.MergeDefaultFromRootOrDefault) {
|
|
162
|
-
// Enumerate over the defaultValues and if not already
|
|
162
|
+
// Enumerate over the defaultValues and if not already populated attempt to
|
|
163
163
|
// find a value from the root config
|
|
164
164
|
objForEachKey(defaultValue, (field) => {
|
|
165
165
|
// for each unspecified field, set the default value
|
|
@@ -171,6 +171,8 @@ function _createInternalContext<T extends IBaseProcessingContext>(telemetryChain
|
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
theConfig = newConfig;
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
178
|
|
|
@@ -244,7 +246,8 @@ export function createProcessTelemetryContext(telemetryChain: ITelemetryPluginCh
|
|
|
244
246
|
* @param core - The current core instance
|
|
245
247
|
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
246
248
|
*/
|
|
247
|
-
export function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPluginChain,
|
|
249
|
+
export function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPluginChain, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUnloadContext {
|
|
250
|
+
let config = core.config || {};
|
|
248
251
|
let internalContext: IInternalContext<IProcessTelemetryUnloadContext> = _createInternalContext<IProcessTelemetryUnloadContext>(telemetryChain, config, core, startAt);
|
|
249
252
|
let context = internalContext.ctx;
|
|
250
253
|
|
|
@@ -260,7 +263,7 @@ export function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPl
|
|
|
260
263
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
261
264
|
}
|
|
262
265
|
|
|
263
|
-
return createProcessTelemetryUnloadContext(plugins || context.getNext(),
|
|
266
|
+
return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt);
|
|
264
267
|
}
|
|
265
268
|
|
|
266
269
|
context.processNext = _processNext;
|
|
@@ -276,14 +279,15 @@ export function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPl
|
|
|
276
279
|
* @param core - The current core instance
|
|
277
280
|
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
278
281
|
*/
|
|
279
|
-
export function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain,
|
|
282
|
+
export function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUpdateContext {
|
|
283
|
+
let config = core.config || {};
|
|
280
284
|
let internalContext: IInternalContext<IProcessTelemetryUpdateContext> = _createInternalContext<IProcessTelemetryUpdateContext>(telemetryChain, config, core, startAt);
|
|
281
285
|
let context = internalContext.ctx;
|
|
282
286
|
|
|
283
287
|
function _processNext(updateState: ITelemetryUpdateState) {
|
|
284
288
|
return context.iterate((plugin) => {
|
|
285
|
-
if (isFunction(plugin
|
|
286
|
-
plugin
|
|
289
|
+
if (isFunction(plugin.update)) {
|
|
290
|
+
plugin.update(context, updateState);
|
|
287
291
|
}
|
|
288
292
|
});
|
|
289
293
|
}
|
|
@@ -293,7 +297,7 @@ export function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPl
|
|
|
293
297
|
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
294
298
|
}
|
|
295
299
|
|
|
296
|
-
return createProcessTelemetryUpdateContext(plugins || context.getNext(),
|
|
300
|
+
return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt);
|
|
297
301
|
}
|
|
298
302
|
|
|
299
303
|
context.processNext = _processNext;
|
|
@@ -446,7 +450,7 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
|
|
|
446
450
|
itemCtx.diagLog(),
|
|
447
451
|
eLoggingSeverity.CRITICAL,
|
|
448
452
|
_eInternalMessageId.PluginException,
|
|
449
|
-
"Plugin [" +
|
|
453
|
+
"Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
450
454
|
}
|
|
451
455
|
}
|
|
452
456
|
}, details, isAsync);
|
|
@@ -464,7 +468,7 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
|
|
|
464
468
|
}
|
|
465
469
|
|
|
466
470
|
let pluginState = _getPluginState(plugin);
|
|
467
|
-
if (pluginState
|
|
471
|
+
if (pluginState.teardown || pluginState[strDisabled]) {
|
|
468
472
|
return false;
|
|
469
473
|
}
|
|
470
474
|
|
|
@@ -627,7 +631,7 @@ export class ProcessTelemetryContext implements IProcessTelemetryContext {
|
|
|
627
631
|
* @param config - The current config
|
|
628
632
|
* @param core - The current core instance
|
|
629
633
|
*/
|
|
630
|
-
constructor(pluginChain: ITelemetryPluginChain, config: IConfiguration, core:IAppInsightsCore, startAt?:IPlugin) {
|
|
634
|
+
constructor(pluginChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?:IPlugin) {
|
|
631
635
|
let _self = this;
|
|
632
636
|
|
|
633
637
|
let context = createProcessTelemetryContext(pluginChain, config, core, startAt);
|
|
@@ -84,9 +84,9 @@ export interface IConfiguration {
|
|
|
84
84
|
* If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
|
|
85
85
|
*/
|
|
86
86
|
channels?: IChannelControls[][];
|
|
87
|
+
|
|
87
88
|
/**
|
|
88
89
|
* @type {boolean}
|
|
89
|
-
* @memberof IConfiguration
|
|
90
90
|
* Flag that disables the Instrumentation Key validation.
|
|
91
91
|
*/
|
|
92
92
|
disableInstrumentationKeyValidation?: boolean;
|
|
@@ -123,7 +123,6 @@ export interface IConfiguration {
|
|
|
123
123
|
* @description Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains. It
|
|
124
124
|
* can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
|
|
125
125
|
* @type {string}
|
|
126
|
-
* @memberof IConfig
|
|
127
126
|
* @defaultValue ""
|
|
128
127
|
*/
|
|
129
128
|
cookieDomain?: string;
|
|
@@ -132,7 +131,6 @@ export interface IConfiguration {
|
|
|
132
131
|
* @description Custom cookie path. This is helpful if you want to share Application Insights cookies behind an application
|
|
133
132
|
* gateway. It can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
|
|
134
133
|
* @type {string}
|
|
135
|
-
* @memberof IConfig
|
|
136
134
|
* @defaultValue ""
|
|
137
135
|
*/
|
|
138
136
|
cookiePath?: string;
|
|
@@ -20,7 +20,7 @@ export declare function createProcessTelemetryContext(telemetryChain: ITelemetry
|
|
|
20
20
|
* @param core - The current core instance
|
|
21
21
|
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
22
22
|
*/
|
|
23
|
-
export declare function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPluginChain,
|
|
23
|
+
export declare function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPluginChain, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUnloadContext;
|
|
24
24
|
/**
|
|
25
25
|
* Creates a new Telemetry Item context with the current config, core and plugin execution chain for updating the configuration
|
|
26
26
|
* @param plugins - The plugin instances that will be executed
|
|
@@ -28,7 +28,7 @@ export declare function createProcessTelemetryUnloadContext(telemetryChain: ITel
|
|
|
28
28
|
* @param core - The current core instance
|
|
29
29
|
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
30
30
|
*/
|
|
31
|
-
export declare function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain,
|
|
31
|
+
export declare function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUpdateContext;
|
|
32
32
|
/**
|
|
33
33
|
* Creates an execution chain from the array of plugins
|
|
34
34
|
* @param plugins - The array of plugins that will be executed in this order
|
|
@@ -6,7 +6,7 @@ import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnl
|
|
|
6
6
|
export interface IPluginState {
|
|
7
7
|
core?: IAppInsightsCore;
|
|
8
8
|
isInitialized?: boolean;
|
|
9
|
-
|
|
9
|
+
teardown?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare function _getPluginState(plugin: IPlugin): IPluginState;
|
|
@@ -73,7 +73,6 @@ export interface IConfiguration {
|
|
|
73
73
|
channels?: IChannelControls[][];
|
|
74
74
|
/**
|
|
75
75
|
* @type {boolean}
|
|
76
|
-
* @memberof IConfiguration
|
|
77
76
|
* Flag that disables the Instrumentation Key validation.
|
|
78
77
|
*/
|
|
79
78
|
disableInstrumentationKeyValidation?: boolean;
|
|
@@ -105,7 +104,6 @@ export interface IConfiguration {
|
|
|
105
104
|
* @description Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains. It
|
|
106
105
|
* can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
|
|
107
106
|
* @type {string}
|
|
108
|
-
* @memberof IConfig
|
|
109
107
|
* @defaultValue ""
|
|
110
108
|
*/
|
|
111
109
|
cookieDomain?: string;
|
|
@@ -113,7 +111,6 @@ export interface IConfiguration {
|
|
|
113
111
|
* @description Custom cookie path. This is helpful if you want to share Application Insights cookies behind an application
|
|
114
112
|
* gateway. It can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
|
|
115
113
|
* @type {string}
|
|
116
|
-
* @memberof IConfig
|
|
117
114
|
* @defaultValue ""
|
|
118
115
|
*/
|
|
119
116
|
cookiePath?: string;
|