@microsoft/applicationinsights-web 2.8.0-beta.2203-02 → 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.
Files changed (50) hide show
  1. package/browser/{ai.2.8.0-beta.2203-02.cjs.js → ai.2.8.0-beta.2203-05.cjs.js} +828 -359
  2. package/browser/ai.2.8.0-beta.2203-05.cjs.js.map +1 -0
  3. package/browser/ai.2.8.0-beta.2203-05.cjs.min.js +6 -0
  4. package/browser/ai.2.8.0-beta.2203-05.cjs.min.js.map +1 -0
  5. package/browser/{ai.2.8.0-beta.2203-02.gbl.js → ai.2.8.0-beta.2203-05.gbl.js} +828 -359
  6. package/browser/ai.2.8.0-beta.2203-05.gbl.js.map +1 -0
  7. package/browser/ai.2.8.0-beta.2203-05.gbl.min.js +6 -0
  8. package/browser/ai.2.8.0-beta.2203-05.gbl.min.js.map +1 -0
  9. package/browser/ai.2.8.0-beta.2203-05.integrity.json +66 -0
  10. package/browser/{ai.2.8.0-beta.2203-02.js → ai.2.8.0-beta.2203-05.js} +828 -359
  11. package/browser/ai.2.8.0-beta.2203-05.js.map +1 -0
  12. package/browser/ai.2.8.0-beta.2203-05.min.js +6 -0
  13. package/browser/ai.2.8.0-beta.2203-05.min.js.map +1 -0
  14. package/browser/ai.2.cjs.js +827 -358
  15. package/browser/ai.2.cjs.js.map +1 -1
  16. package/browser/ai.2.cjs.min.js +2 -2
  17. package/browser/ai.2.cjs.min.js.map +1 -1
  18. package/browser/ai.2.gbl.js +827 -358
  19. package/browser/ai.2.gbl.js.map +1 -1
  20. package/browser/ai.2.gbl.min.js +2 -2
  21. package/browser/ai.2.gbl.min.js.map +1 -1
  22. package/browser/ai.2.js +827 -358
  23. package/browser/ai.2.js.map +1 -1
  24. package/browser/ai.2.min.js +2 -2
  25. package/browser/ai.2.min.js.map +1 -1
  26. package/dist/applicationinsights-web.api.json +735 -167
  27. package/dist/applicationinsights-web.api.md +22 -19
  28. package/dist/applicationinsights-web.d.ts +168 -106
  29. package/dist/applicationinsights-web.js +828 -359
  30. package/dist/applicationinsights-web.js.map +1 -1
  31. package/dist/applicationinsights-web.min.js +2 -2
  32. package/dist/applicationinsights-web.min.js.map +1 -1
  33. package/dist/applicationinsights-web.rollup.d.ts +168 -106
  34. package/dist-esm/ApplicationInsightsContainer.js +1 -1
  35. package/dist-esm/ApplicationInsightsDeprecated.js +1 -1
  36. package/dist-esm/Init.js +1 -1
  37. package/dist-esm/Initialization.js +1 -1
  38. package/dist-esm/applicationinsights-web.js +1 -1
  39. package/package.json +7 -7
  40. package/types/Initialization.d.ts +1 -1
  41. package/browser/ai.2.8.0-beta.2203-02.cjs.js.map +0 -1
  42. package/browser/ai.2.8.0-beta.2203-02.cjs.min.js +0 -6
  43. package/browser/ai.2.8.0-beta.2203-02.cjs.min.js.map +0 -1
  44. package/browser/ai.2.8.0-beta.2203-02.gbl.js.map +0 -1
  45. package/browser/ai.2.8.0-beta.2203-02.gbl.min.js +0 -6
  46. package/browser/ai.2.8.0-beta.2203-02.gbl.min.js.map +0 -1
  47. package/browser/ai.2.8.0-beta.2203-02.integrity.json +0 -66
  48. package/browser/ai.2.8.0-beta.2203-02.js.map +0 -1
  49. package/browser/ai.2.8.0-beta.2203-02.min.js +0 -6
  50. package/browser/ai.2.8.0-beta.2203-02.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 2.8.0-beta.2203-02
2
+ * Microsoft.ApplicationInsights, 2.8.0-beta.2203-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -54,16 +54,12 @@ export declare class AppInsightsCore extends BaseCore implements IAppInsightsCor
54
54
 
55
55
  export declare class ApplicationAnalytics extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal {
56
56
  static Version: string;
57
- static getDefaultConfig(config?: IConfig): IConfig;
57
+ static getDefaultConfig: typeof _getDefaultConfig;
58
58
  identifier: string;
59
59
  priority: number;
60
60
  config: IConfig;
61
61
  queue: Array<() => void>;
62
62
  autoRoutePVDelay: number;
63
- protected _telemetryInitializers: Array<(envelope: ITelemetryItem) => boolean | void>;
64
- protected _pageViewManager: PageViewManager;
65
- protected _pageViewPerformanceManager: PageViewPerformanceManager;
66
- protected _pageVisitTimeManager: PageVisitTimeManager;
67
63
  constructor();
68
64
  /**
69
65
  * Get the current cookie manager for this instance
@@ -187,7 +183,7 @@ export declare class ApplicationAnalytics extends BaseTelemetryPlugin implements
187
183
  * @memberof ApplicationInsights
188
184
  */
189
185
  _onerror(exception: IAutoExceptionTelemetry): void;
190
- addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
186
+ addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler | void;
191
187
  initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
192
188
  }
193
189
 
@@ -298,7 +294,7 @@ export declare class ApplicationInsights implements IApplicationInsights {
298
294
  }, measurements?: {
299
295
  [key: string]: number;
300
296
  }): void;
301
- addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
297
+ addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void | ITelemetryInitializerHandler;
302
298
  /**
303
299
  * Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|
304
300
  *
@@ -423,12 +419,34 @@ export declare class BaseCore implements IAppInsightsCore {
423
419
  * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
424
420
  */
425
421
  addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
422
+ /**
423
+ * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
424
+ * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
425
+ * unload call return `true` stating that all plugins reported that they also unloaded, the recommended
426
+ * approach is to create a new instance and initialize that instance.
427
+ * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
428
+ * to successfully remove any global references or they may just be completing the unload process asynchronously.
429
+ */
430
+ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
426
431
  getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
432
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
427
433
  /**
428
434
  * Returns the unique event namespace that should be used
429
435
  */
430
436
  evtNamespace(): string;
437
+ /**
438
+ * Add an unload handler that will be called when the SDK is being unloaded
439
+ * @param handler - the handler
440
+ */
441
+ addUnloadCb(handler: UnloadHandler): void;
431
442
  protected releaseQueue(): void;
443
+ /**
444
+ * Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
445
+ * @param updateCtx - The plugin update context
446
+ * @param updateState - The Update State
447
+ * @returns boolean - True means the extension class will call updateState otherwise the Core will
448
+ */
449
+ protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
432
450
  }
433
451
 
434
452
  /**
@@ -485,6 +503,14 @@ export declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
485
503
  * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
486
504
  */
487
505
  protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
506
+ /**
507
+ * Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
508
+ * @param updateCtx - This is the context that should be used during updating.
509
+ * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
510
+ * @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.
511
+ * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
512
+ */
513
+ protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean;
488
514
  constructor();
489
515
  initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
490
516
  /**
@@ -497,6 +523,18 @@ export declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
497
523
  */
498
524
  teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
499
525
  abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
526
+ /**
527
+ * The the plugin should re-evaluate configuration and update any cached configuration settings.
528
+ * @param updateCtx - This is the context that should be used during updating.
529
+ * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
530
+ * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
531
+ */
532
+ update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
533
+ /**
534
+ * Add an unload handler that will be called when the SDK is being unloaded
535
+ * @param handler - the handler
536
+ */
537
+ protected _addUnloadCb(handler: UnloadHandler): void;
500
538
  /**
501
539
  * Add this hook so that it is automatically removed during unloading
502
540
  * @param hooks - The single hook or an array of IInstrumentHook objects
@@ -963,6 +1001,8 @@ declare const enum FieldType {
963
1001
  */
964
1002
  declare function _formatErrorCode(errorObj: any): any;
965
1003
 
1004
+ declare function _getDefaultConfig(config?: IConfig): IConfig;
1005
+
966
1006
  declare const enum GetExtCfgMergeType {
967
1007
  None = 0,
968
1008
  MergeDefaultOnly = 1,
@@ -1056,15 +1096,36 @@ export declare interface IAppInsightsCore extends IPerfManagerProvider {
1056
1096
  * Return a new instance of the IProcessTelemetryContext for processing events
1057
1097
  */
1058
1098
  getProcessTelContext(): IProcessTelemetryContext;
1099
+ /**
1100
+ * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
1101
+ * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
1102
+ * unload call return `true` stating that all plugins reported that they also unloaded, the recommended
1103
+ * approach is to create a new instance and initialize that instance.
1104
+ * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
1105
+ * to successfully remove any global references or they may just be completing the unload process asynchronously.
1106
+ */
1107
+ unload(isAsync?: boolean, unloadComplete?: () => void): void;
1059
1108
  /**
1060
1109
  * Find and return the (first) plugin with the specified identifier if present
1061
1110
  * @param pluginIdentifier
1062
1111
  */
1063
1112
  getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
1113
+ /**
1114
+ * Add a new plugin to the installation
1115
+ * @param plugin - The new plugin to add
1116
+ * @param replaceExisting - should any existing plugin be replaced
1117
+ * @param doAsync - Should the add be performed asynchronously
1118
+ */
1119
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
1064
1120
  /**
1065
1121
  * Returns the unique event namespace that should be used when registering events
1066
1122
  */
1067
1123
  evtNamespace(): string;
1124
+ /**
1125
+ * Add a handler that will be called when the SDK is being unloaded
1126
+ * @param handler - the handler
1127
+ */
1128
+ addUnloadCb(handler: UnloadHandler): void;
1068
1129
  }
1069
1130
 
1070
1131
  export declare interface IAppInsightsDeprecated {
@@ -2684,6 +2745,11 @@ declare interface IInstrumentHook {
2684
2745
  * You must always supply the error callback
2685
2746
  */
2686
2747
  declare interface IInstrumentHooksCallbacks {
2748
+ /**
2749
+ * [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
2750
+ * identify the source of the instrumented hooks
2751
+ */
2752
+ ns?: string | string[];
2687
2753
  /**
2688
2754
  * The hook callback to call before the original function is called
2689
2755
  */
@@ -2742,6 +2808,7 @@ declare interface ILoadedPlugin<T extends IPlugin> {
2742
2808
  * (unless it's also been re-initialized)
2743
2809
  */
2744
2810
  setEnabled: (isEnabled: boolean) => void;
2811
+ remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
2745
2812
  }
2746
2813
 
2747
2814
  declare interface ILocation {
@@ -3263,8 +3330,8 @@ export declare interface IProcessTelemetryContext extends IBaseProcessingContext
3263
3330
  }
3264
3331
 
3265
3332
  /**
3266
- * The current context for the current call to processTelemetry(), used to support sharing the same plugin instance
3267
- * between multiple AppInsights instances
3333
+ * The current context for the current call to teardown() implementations, used to support when plugins are being removed
3334
+ * or the SDK is being unloaded.
3268
3335
  */
3269
3336
  declare interface IProcessTelemetryUnloadContext extends IBaseProcessingContext {
3270
3337
  /**
@@ -3283,6 +3350,27 @@ declare interface IProcessTelemetryUnloadContext extends IBaseProcessingContext
3283
3350
  createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUnloadContext;
3284
3351
  }
3285
3352
 
3353
+ /**
3354
+ * The current context for the current call to the plugin update() implementations, used to support the notifications
3355
+ * for when plugins are added, removed or the configuration was changed.
3356
+ */
3357
+ declare interface IProcessTelemetryUpdateContext extends IBaseProcessingContext {
3358
+ /**
3359
+ * This Plugin has finished unloading, so unload the next one
3360
+ * @param updateState - The update State
3361
+ * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
3362
+ */
3363
+ processNext: (updateState: ITelemetryUpdateState) => boolean | void;
3364
+ /**
3365
+ * Create a new context using the core and config from the current instance, returns a new instance of the same type
3366
+ * @param plugins - The execution order to process the plugins, if null or not supplied
3367
+ * then the current execution order will be copied.
3368
+ * @param startAt - The plugin to start processing from, if missing from the execution
3369
+ * order then the next plugin will be NOT set.
3370
+ */
3371
+ createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUpdateContext;
3372
+ }
3373
+
3286
3374
  declare interface IPropertiesPlugin {
3287
3375
  readonly context: ITelemetryContext;
3288
3376
  }
@@ -3679,6 +3767,15 @@ declare interface ITelemetryProcessor {
3679
3767
  * to later plugins (vs appending items to the telemetry item)
3680
3768
  */
3681
3769
  processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
3770
+ /**
3771
+ * The the plugin should re-evaluate configuration and update any cached configuration settings or
3772
+ * plugins. If implemented this method will be called whenever a plugin is added or removed and if
3773
+ * the configuration has bee updated.
3774
+ * @param updateCtx - This is the context that should be used during updating.
3775
+ * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
3776
+ * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
3777
+ */
3778
+ update?: (updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) => void | boolean;
3682
3779
  }
3683
3780
 
3684
3781
  declare interface ITelemetryTrace {
@@ -3706,6 +3803,27 @@ declare interface ITelemetryUnloadState {
3706
3803
  flushComplete?: boolean;
3707
3804
  }
3708
3805
 
3806
+ declare interface ITelemetryUpdateState {
3807
+ /**
3808
+ * Identifies the reason for the update notification, this is a bitwise numeric value
3809
+ */
3810
+ reason: TelemetryUpdateReason;
3811
+ /**
3812
+ * If this is a configuration update this was the previous configuration that was used
3813
+ */
3814
+ /**
3815
+ * If this is a configuration update is the new configuration that is being used
3816
+ */
3817
+ /**
3818
+ * This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
3819
+ */
3820
+ added?: IPlugin[];
3821
+ /**
3822
+ * This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
3823
+ */
3824
+ removed?: IPlugin[];
3825
+ }
3826
+
3709
3827
  declare interface ITraceState {
3710
3828
  }
3711
3829
 
@@ -4151,26 +4269,6 @@ declare class PageViewData extends EventData {
4151
4269
  constructor();
4152
4270
  }
4153
4271
 
4154
- /**
4155
- * Class encapsulates sending page views and page view performance telemetry.
4156
- */
4157
- declare class PageViewManager {
4158
- constructor(appInsights: IAppInsightsInternal, overridePageViewDuration: boolean, core: IAppInsightsCore, pageViewPerformanceManager: PageViewPerformanceManager);
4159
- /**
4160
- * Currently supported cases:
4161
- * 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available.
4162
- * a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent.
4163
- * 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away.
4164
- * 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported).
4165
- * 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration.
4166
- *
4167
- * In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported.
4168
- */
4169
- trackPageView(pageView: IPageViewTelemetry, customProperties?: {
4170
- [key: string]: any;
4171
- }): void;
4172
- }
4173
-
4174
4272
  /**
4175
4273
  * An instance of PageViewPerf represents: a page view with no performance data, a page view with performance data, or just the performance data of an earlier page request.
4176
4274
  */
@@ -4248,81 +4346,6 @@ export declare class PageViewPerformance extends PageViewPerfData implements ISe
4248
4346
  }, cs4BaseData?: IPageViewPerformanceTelemetry);
4249
4347
  }
4250
4348
 
4251
- /**
4252
- * Class encapsulates sending page view performance telemetry.
4253
- */
4254
- declare class PageViewPerformanceManager {
4255
- private _logger;
4256
- private MAX_DURATION_ALLOWED;
4257
- constructor(core: IAppInsightsCore);
4258
- populatePageViewPerformanceEvent(pageViewPerformance: IPageViewPerformanceTelemetryInternal): void;
4259
- getPerformanceTiming(): PerformanceTiming | null;
4260
- getPerformanceNavigationTiming(): PerformanceNavigationTiming | null;
4261
- /**
4262
- * Returns true is window PerformanceNavigationTiming API is supported, false otherwise.
4263
- */
4264
- isPerformanceNavigationTimingSupported(): boolean;
4265
- /**
4266
- * Returns true is window performance timing API is supported, false otherwise.
4267
- */
4268
- isPerformanceTimingSupported(): PerformanceTiming;
4269
- /**
4270
- * As page loads different parts of performance timing numbers get set. When all of them are set we can report it.
4271
- * Returns true if ready, false otherwise.
4272
- */
4273
- isPerformanceTimingDataReady(): boolean;
4274
- /**
4275
- * This method tells if given durations should be excluded from collection.
4276
- */
4277
- shouldCollectDuration(...durations: number[]): boolean;
4278
- }
4279
-
4280
- declare class PageVisitData {
4281
- pageName: string;
4282
- pageUrl: string;
4283
- pageVisitStartTime: number;
4284
- pageVisitTime: number;
4285
- constructor(pageName: string, pageUrl: string);
4286
- }
4287
-
4288
- /**
4289
- * Used to track page visit durations
4290
- */
4291
- declare class PageVisitTimeManager {
4292
- private prevPageVisitDataKeyName;
4293
- private pageVisitTimeTrackingHandler;
4294
- private _logger;
4295
- /**
4296
- * Creates a new instance of PageVisitTimeManager
4297
- * @param pageVisitTimeTrackingHandler Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)
4298
- * @returns {}
4299
- */
4300
- constructor(logger: IDiagnosticLogger, pageVisitTimeTrackingHandler: (pageName: string, pageUrl: string, pageVisitTime: number) => void);
4301
- /**
4302
- * Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time
4303
- * @param currentPageName Name of page to begin timing for visit duration
4304
- * @param currentPageUrl Url of page to begin timing for visit duration
4305
- */
4306
- trackPreviousPageVisit(currentPageName: string, currentPageUrl: string): void;
4307
- /**
4308
- * Stops timing of current page (if exists) and starts timing for duration of visit to pageName
4309
- * @param pageName Name of page to begin timing visit duration
4310
- * @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.
4311
- */
4312
- restartPageVisitTimer(pageName: string, pageUrl: string): PageVisitData;
4313
- /**
4314
- * Starts timing visit duration of pageName
4315
- * @param pageName
4316
- * @returns {}
4317
- */
4318
- startPageVisitTimer(pageName: string, pageUrl: string): void;
4319
- /**
4320
- * Stops timing of current page, if exists.
4321
- * @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.
4322
- */
4323
- stopPageVisitTimer(): PageVisitData;
4324
- }
4325
-
4326
4349
  declare function parseConnectionString(connectionString?: string): ConnectionString;
4327
4350
 
4328
4351
  export declare class PerfEvent implements IPerfEvent {
@@ -4610,6 +4633,10 @@ declare const enum SendRequestReason {
4610
4633
  * The event(s) being sent as a retry
4611
4634
  */
4612
4635
  Retry = 5,
4636
+ /**
4637
+ * The SDK is unloading
4638
+ */
4639
+ SdkUnload = 6,
4613
4640
  /**
4614
4641
  * Maximum batch size would be exceeded
4615
4642
  */
@@ -4795,7 +4822,40 @@ declare const enum TelemetryUnloadReason {
4795
4822
  /**
4796
4823
  * Teardown has been called without any context.
4797
4824
  */
4798
- ManualTeardown = 0
4825
+ ManualTeardown = 0,
4826
+ /**
4827
+ * Just this plugin is being removed
4828
+ */
4829
+ PluginUnload = 1,
4830
+ /**
4831
+ * This instance of the plugin is being removed and replaced
4832
+ */
4833
+ PluginReplace = 2,
4834
+ /**
4835
+ * The entire SDK is being unloaded
4836
+ */
4837
+ SdkUnload = 50
4838
+ }
4839
+
4840
+ /**
4841
+ * The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
4842
+ */
4843
+ declare const enum TelemetryUpdateReason {
4844
+ /**
4845
+ * Unknown.
4846
+ */
4847
+ Unknown = 0,
4848
+ /**
4849
+ * The configuration has ben updated or changed
4850
+ */
4851
+ /**
4852
+ * One or more plugins have been added
4853
+ */
4854
+ PluginAdded = 16,
4855
+ /**
4856
+ * One or more plugins have been removed
4857
+ */
4858
+ PluginRemoved = 32
4799
4859
  }
4800
4860
 
4801
4861
  export declare class Trace extends MessageData implements ISerializable {
@@ -4815,6 +4875,8 @@ export declare class Trace extends MessageData implements ISerializable {
4815
4875
  });
4816
4876
  }
4817
4877
 
4878
+ declare type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
4879
+
4818
4880
  export declare const Util: IUtil;
4819
4881
 
4820
4882
  declare interface XDomainRequest extends XMLHttpRequestEventTarget {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-02
2
+ * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  import { AppInsightsDeprecated } from "./ApplicationInsightsDeprecated";
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-02
2
+ * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  import { stringToBoolOrDefault, ProcessLegacy } from "@microsoft/applicationinsights-common";
package/dist-esm/Init.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-02
2
+ * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-02
2
+ * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-02
2
+ * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  export { Initialization as ApplicationInsights, Telemetry } from "./Initialization";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-web",
3
- "version": "2.8.0-beta.2203-02",
3
+ "version": "2.8.0-beta.2203-05",
4
4
  "description": "Microsoft Application Insights JavaScript SDK - Web",
5
5
  "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
6
  "author": "Microsoft Application Insights Team",
@@ -66,12 +66,12 @@
66
66
  "dependencies": {
67
67
  "@microsoft/dynamicproto-js": "^1.1.4",
68
68
  "@microsoft/applicationinsights-shims": "2.0.1",
69
- "@microsoft/applicationinsights-analytics-js": "2.8.0-beta.2203-02",
70
- "@microsoft/applicationinsights-channel-js": "2.8.0-beta.2203-02",
71
- "@microsoft/applicationinsights-common": "2.8.0-beta.2203-02",
72
- "@microsoft/applicationinsights-core-js": "2.8.0-beta.2203-02",
73
- "@microsoft/applicationinsights-dependencies-js": "2.8.0-beta.2203-02",
74
- "@microsoft/applicationinsights-properties-js": "2.8.0-beta.2203-02"
69
+ "@microsoft/applicationinsights-analytics-js": "2.8.0-beta.2203-05",
70
+ "@microsoft/applicationinsights-channel-js": "2.8.0-beta.2203-05",
71
+ "@microsoft/applicationinsights-common": "2.8.0-beta.2203-05",
72
+ "@microsoft/applicationinsights-core-js": "2.8.0-beta.2203-05",
73
+ "@microsoft/applicationinsights-dependencies-js": "2.8.0-beta.2203-05",
74
+ "@microsoft/applicationinsights-properties-js": "2.8.0-beta.2203-05"
75
75
  },
76
76
  "license": "MIT",
77
77
  "publishConfig": {
@@ -191,7 +191,7 @@ export declare class Initialization implements IApplicationInsights {
191
191
  }, measurements?: {
192
192
  [key: string]: number;
193
193
  }): void;
194
- addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
194
+ addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void | import("@microsoft/applicationinsights-core-js").ITelemetryInitializerHandler;
195
195
  /**
196
196
  * Set the authenticated user id and the account id. Used for identifying a specific signed-in user. Parameters must not contain whitespace or ,;=|
197
197
  *