@microsoft/applicationinsights-web 2.8.0-beta.2203-06 → 2.8.0-beta.2203-09

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 (49) hide show
  1. package/browser/{ai.2.8.0-beta.2203-06.cjs.js → ai.2.8.0-beta.2203-09.cjs.js} +43 -21
  2. package/browser/ai.2.8.0-beta.2203-09.cjs.js.map +1 -0
  3. package/browser/ai.2.8.0-beta.2203-09.cjs.min.js +6 -0
  4. package/browser/ai.2.8.0-beta.2203-09.cjs.min.js.map +1 -0
  5. package/browser/{ai.2.8.0-beta.2203-06.gbl.js → ai.2.8.0-beta.2203-09.gbl.js} +43 -21
  6. package/browser/ai.2.8.0-beta.2203-09.gbl.js.map +1 -0
  7. package/browser/ai.2.8.0-beta.2203-09.gbl.min.js +6 -0
  8. package/browser/ai.2.8.0-beta.2203-09.gbl.min.js.map +1 -0
  9. package/browser/ai.2.8.0-beta.2203-09.integrity.json +66 -0
  10. package/browser/{ai.2.8.0-beta.2203-06.js → ai.2.8.0-beta.2203-09.js} +43 -21
  11. package/browser/ai.2.8.0-beta.2203-09.js.map +1 -0
  12. package/browser/ai.2.8.0-beta.2203-09.min.js +6 -0
  13. package/browser/ai.2.8.0-beta.2203-09.min.js.map +1 -0
  14. package/browser/ai.2.cjs.js +42 -20
  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 +42 -20
  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 +42 -20
  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 +202 -12
  27. package/dist/applicationinsights-web.api.md +6 -5
  28. package/dist/applicationinsights-web.d.ts +38 -5
  29. package/dist/applicationinsights-web.js +42 -20
  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 +38 -5
  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/browser/ai.2.8.0-beta.2203-06.cjs.js.map +0 -1
  41. package/browser/ai.2.8.0-beta.2203-06.cjs.min.js +0 -6
  42. package/browser/ai.2.8.0-beta.2203-06.cjs.min.js.map +0 -1
  43. package/browser/ai.2.8.0-beta.2203-06.gbl.js.map +0 -1
  44. package/browser/ai.2.8.0-beta.2203-06.gbl.min.js +0 -6
  45. package/browser/ai.2.8.0-beta.2203-06.gbl.min.js.map +0 -1
  46. package/browser/ai.2.8.0-beta.2203-06.integrity.json +0 -66
  47. package/browser/ai.2.8.0-beta.2203-06.js.map +0 -1
  48. package/browser/ai.2.8.0-beta.2203-06.min.js +0 -6
  49. package/browser/ai.2.8.0-beta.2203-06.min.js.map +0 -1
@@ -3591,7 +3591,7 @@
3591
3591
  {
3592
3592
  "kind": "Method",
3593
3593
  "canonicalReference": "@microsoft/applicationinsights-web!BaseCore#addPlugin:member(1)",
3594
- "docComment": "",
3594
+ "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced, default is false\n *\n * @param doAsync - Should the add be performed asynchronously\n *\n * @param addCb - [Optional] callback to call after the plugin has been added\n */\n",
3595
3595
  "excerptTokens": [
3596
3596
  {
3597
3597
  "kind": "Content",
@@ -3625,7 +3625,7 @@
3625
3625
  },
3626
3626
  {
3627
3627
  "kind": "Content",
3628
- "text": ", replaceExisting: "
3628
+ "text": ", replaceExisting?: "
3629
3629
  },
3630
3630
  {
3631
3631
  "kind": "Content",
@@ -3633,7 +3633,7 @@
3633
3633
  },
3634
3634
  {
3635
3635
  "kind": "Content",
3636
- "text": ", doAsync: "
3636
+ "text": ", doAsync?: "
3637
3637
  },
3638
3638
  {
3639
3639
  "kind": "Content",
@@ -3924,6 +3924,82 @@
3924
3924
  "parameters": [],
3925
3925
  "name": "evtNamespace"
3926
3926
  },
3927
+ {
3928
+ "kind": "Method",
3929
+ "canonicalReference": "@microsoft/applicationinsights-web!BaseCore#flush:member(1)",
3930
+ "docComment": "/**\n * Flush and send any batched / cached data immediately\n *\n * @param async - send data asynchronously when true (defaults to true)\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n",
3931
+ "excerptTokens": [
3932
+ {
3933
+ "kind": "Content",
3934
+ "text": "flush(isAsync?: "
3935
+ },
3936
+ {
3937
+ "kind": "Content",
3938
+ "text": "boolean"
3939
+ },
3940
+ {
3941
+ "kind": "Content",
3942
+ "text": ", callBack?: "
3943
+ },
3944
+ {
3945
+ "kind": "Content",
3946
+ "text": "(flushComplete?: boolean) => void"
3947
+ },
3948
+ {
3949
+ "kind": "Content",
3950
+ "text": ", sendReason?: "
3951
+ },
3952
+ {
3953
+ "kind": "Reference",
3954
+ "text": "SendRequestReason",
3955
+ "canonicalReference": "@microsoft/applicationinsights-web!SendRequestReason:enum"
3956
+ },
3957
+ {
3958
+ "kind": "Content",
3959
+ "text": "): "
3960
+ },
3961
+ {
3962
+ "kind": "Content",
3963
+ "text": "void"
3964
+ },
3965
+ {
3966
+ "kind": "Content",
3967
+ "text": ";"
3968
+ }
3969
+ ],
3970
+ "isOptional": false,
3971
+ "isStatic": false,
3972
+ "returnTypeTokenRange": {
3973
+ "startIndex": 7,
3974
+ "endIndex": 8
3975
+ },
3976
+ "releaseTag": "Public",
3977
+ "overloadIndex": 1,
3978
+ "parameters": [
3979
+ {
3980
+ "parameterName": "isAsync",
3981
+ "parameterTypeTokenRange": {
3982
+ "startIndex": 1,
3983
+ "endIndex": 2
3984
+ }
3985
+ },
3986
+ {
3987
+ "parameterName": "callBack",
3988
+ "parameterTypeTokenRange": {
3989
+ "startIndex": 3,
3990
+ "endIndex": 4
3991
+ }
3992
+ },
3993
+ {
3994
+ "parameterName": "sendReason",
3995
+ "parameterTypeTokenRange": {
3996
+ "startIndex": 5,
3997
+ "endIndex": 6
3998
+ }
3999
+ }
4000
+ ],
4001
+ "name": "flush"
4002
+ },
3927
4003
  {
3928
4004
  "kind": "Method",
3929
4005
  "canonicalReference": "@microsoft/applicationinsights-web!BaseCore#getCookieMgr:member(1)",
@@ -4606,7 +4682,7 @@
4606
4682
  {
4607
4683
  "kind": "Method",
4608
4684
  "canonicalReference": "@microsoft/applicationinsights-web!BaseCore#unload:member(1)",
4609
- "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n */\n",
4685
+ "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n *\n * @param isAsync - Can the unload be performed asynchronously (default)\n *\n * @param unloadComplete - An optional callback that will be called once the unload has completed\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n */\n",
4610
4686
  "excerptTokens": [
4611
4687
  {
4612
4688
  "kind": "Content",
@@ -8249,7 +8325,7 @@
8249
8325
  {
8250
8326
  "kind": "MethodSignature",
8251
8327
  "canonicalReference": "@microsoft/applicationinsights-web!IAppInsightsCore#addPlugin:member(1)",
8252
- "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced\n *\n * @param doAsync - Should the add be performed asynchronously\n */\n",
8328
+ "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced, default is false\n *\n * @param doAsync - Should the add be performed asynchronously\n *\n * @param addCb - [Optional] callback to call after the plugin has been added\n */\n",
8253
8329
  "excerptTokens": [
8254
8330
  {
8255
8331
  "kind": "Content",
@@ -8283,7 +8359,7 @@
8283
8359
  },
8284
8360
  {
8285
8361
  "kind": "Content",
8286
- "text": ", replaceExisting: "
8362
+ "text": ", replaceExisting?: "
8287
8363
  },
8288
8364
  {
8289
8365
  "kind": "Content",
@@ -8291,7 +8367,7 @@
8291
8367
  },
8292
8368
  {
8293
8369
  "kind": "Content",
8294
- "text": ", doAsync: "
8370
+ "text": ", doAsync?: "
8295
8371
  },
8296
8372
  {
8297
8373
  "kind": "Content",
@@ -8520,6 +8596,96 @@
8520
8596
  "parameters": [],
8521
8597
  "name": "evtNamespace"
8522
8598
  },
8599
+ {
8600
+ "kind": "MethodSignature",
8601
+ "canonicalReference": "@microsoft/applicationinsights-web!IAppInsightsCore#flush:member(1)",
8602
+ "docComment": "/**\n * Flush and send any batched / cached data immediately\n *\n * @param async - send data asynchronously when true (defaults to true)\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n",
8603
+ "excerptTokens": [
8604
+ {
8605
+ "kind": "Content",
8606
+ "text": "flush(isAsync?: "
8607
+ },
8608
+ {
8609
+ "kind": "Content",
8610
+ "text": "boolean"
8611
+ },
8612
+ {
8613
+ "kind": "Content",
8614
+ "text": ", callBack?: "
8615
+ },
8616
+ {
8617
+ "kind": "Content",
8618
+ "text": "(flushComplete?: boolean) => void"
8619
+ },
8620
+ {
8621
+ "kind": "Content",
8622
+ "text": ", sendReason?: "
8623
+ },
8624
+ {
8625
+ "kind": "Reference",
8626
+ "text": "SendRequestReason",
8627
+ "canonicalReference": "@microsoft/applicationinsights-web!SendRequestReason:enum"
8628
+ },
8629
+ {
8630
+ "kind": "Content",
8631
+ "text": ", cbTimeout?: "
8632
+ },
8633
+ {
8634
+ "kind": "Content",
8635
+ "text": "number"
8636
+ },
8637
+ {
8638
+ "kind": "Content",
8639
+ "text": "): "
8640
+ },
8641
+ {
8642
+ "kind": "Content",
8643
+ "text": "boolean | void"
8644
+ },
8645
+ {
8646
+ "kind": "Content",
8647
+ "text": ";"
8648
+ }
8649
+ ],
8650
+ "isOptional": false,
8651
+ "returnTypeTokenRange": {
8652
+ "startIndex": 9,
8653
+ "endIndex": 10
8654
+ },
8655
+ "releaseTag": "Public",
8656
+ "overloadIndex": 1,
8657
+ "parameters": [
8658
+ {
8659
+ "parameterName": "isAsync",
8660
+ "parameterTypeTokenRange": {
8661
+ "startIndex": 1,
8662
+ "endIndex": 2
8663
+ }
8664
+ },
8665
+ {
8666
+ "parameterName": "callBack",
8667
+ "parameterTypeTokenRange": {
8668
+ "startIndex": 3,
8669
+ "endIndex": 4
8670
+ }
8671
+ },
8672
+ {
8673
+ "parameterName": "sendReason",
8674
+ "parameterTypeTokenRange": {
8675
+ "startIndex": 5,
8676
+ "endIndex": 6
8677
+ }
8678
+ },
8679
+ {
8680
+ "parameterName": "cbTimeout",
8681
+ "parameterTypeTokenRange": {
8682
+ "startIndex": 7,
8683
+ "endIndex": 8
8684
+ }
8685
+ }
8686
+ ],
8687
+ "name": "flush"
8688
+ },
8523
8689
  {
8524
8690
  "kind": "MethodSignature",
8525
8691
  "canonicalReference": "@microsoft/applicationinsights-web!IAppInsightsCore#getCookieMgr:member(1)",
@@ -9084,7 +9250,7 @@
9084
9250
  {
9085
9251
  "kind": "MethodSignature",
9086
9252
  "canonicalReference": "@microsoft/applicationinsights-web!IAppInsightsCore#unload:member(1)",
9087
- "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n */\n",
9253
+ "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n *\n * @param isAsync - Can the unload be performed asynchronously (default)\n *\n * @param unloadComplete - An optional callback that will be called once the unload has completed\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n */\n",
9088
9254
  "excerptTokens": [
9089
9255
  {
9090
9256
  "kind": "Content",
@@ -9100,7 +9266,24 @@
9100
9266
  },
9101
9267
  {
9102
9268
  "kind": "Content",
9103
- "text": "() => void"
9269
+ "text": "(unloadState: "
9270
+ },
9271
+ {
9272
+ "kind": "Reference",
9273
+ "text": "ITelemetryUnloadState",
9274
+ "canonicalReference": "@microsoft/applicationinsights-web!ITelemetryUnloadState:interface"
9275
+ },
9276
+ {
9277
+ "kind": "Content",
9278
+ "text": ") => void"
9279
+ },
9280
+ {
9281
+ "kind": "Content",
9282
+ "text": ", cbTimeout?: "
9283
+ },
9284
+ {
9285
+ "kind": "Content",
9286
+ "text": "number"
9104
9287
  },
9105
9288
  {
9106
9289
  "kind": "Content",
@@ -9117,8 +9300,8 @@
9117
9300
  ],
9118
9301
  "isOptional": false,
9119
9302
  "returnTypeTokenRange": {
9120
- "startIndex": 5,
9121
- "endIndex": 6
9303
+ "startIndex": 9,
9304
+ "endIndex": 10
9122
9305
  },
9123
9306
  "releaseTag": "Public",
9124
9307
  "overloadIndex": 1,
@@ -9134,7 +9317,14 @@
9134
9317
  "parameterName": "unloadComplete",
9135
9318
  "parameterTypeTokenRange": {
9136
9319
  "startIndex": 3,
9137
- "endIndex": 4
9320
+ "endIndex": 6
9321
+ }
9322
+ },
9323
+ {
9324
+ "parameterName": "cbTimeout",
9325
+ "parameterTypeTokenRange": {
9326
+ "startIndex": 7,
9327
+ "endIndex": 8
9138
9328
  }
9139
9329
  }
9140
9330
  ],
@@ -147,8 +147,7 @@ export class ApplicationInsightsContainer {
147
147
  export class BaseCore implements IAppInsightsCore {
148
148
  constructor();
149
149
  addNotificationListener(listener: INotificationListener): void;
150
- // (undocumented)
151
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
150
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
152
151
  // Warning: (ae-forgotten-export) The symbol "TelemetryInitializerFunction" needs to be exported by the entry point applicationinsights-web.d.ts
153
152
  addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
154
153
  // Warning: (ae-forgotten-export) The symbol "UnloadHandler" needs to be exported by the entry point applicationinsights-web.d.ts
@@ -162,6 +161,8 @@ export class BaseCore implements IAppInsightsCore {
162
161
  evtNamespace(): string;
163
162
  // (undocumented)
164
163
  _extensions: IPlugin[];
164
+ // Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point applicationinsights-web.d.ts
165
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): void;
165
166
  getCookieMgr(): ICookieMgr;
166
167
  // (undocumented)
167
168
  getNotifyMgr(): INotificationManager;
@@ -391,12 +392,13 @@ export interface IAppInsights {
391
392
  // @public (undocumented)
392
393
  export interface IAppInsightsCore extends IPerfManagerProvider {
393
394
  addNotificationListener?(listener: INotificationListener): void;
394
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
395
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
395
396
  addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
396
397
  addUnloadCb(handler: UnloadHandler): void;
397
398
  // (undocumented)
398
399
  config: IConfiguration;
399
400
  evtNamespace(): string;
401
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
400
402
  getCookieMgr(): ICookieMgr;
401
403
  getNotifyMgr(): INotificationManager;
402
404
  getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
@@ -416,7 +418,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
416
418
  stopPollingInternalLogs?(): void;
417
419
  // (undocumented)
418
420
  track(telemetryItem: ITelemetryItem): void;
419
- unload(isAsync?: boolean, unloadComplete?: () => void): void;
421
+ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
420
422
  }
421
423
 
422
424
  // @public (undocumented)
@@ -1280,7 +1282,6 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
1280
1282
  readonly _senderConfig: ISenderConfig;
1281
1283
  // (undocumented)
1282
1284
  teardown(): void;
1283
- // Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point applicationinsights-web.d.ts
1284
1285
  triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void;
1285
1286
  // Warning: (ae-forgotten-export) The symbol "XDomainRequest" needs to be exported by the entry point applicationinsights-web.d.ts
1286
1287
  _xdrOnLoad(xdr: XDomainRequest, payload: string[]): void;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 2.8.0-beta.2203-06
2
+ * Microsoft.ApplicationInsights, 2.8.0-beta.2203-09
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -420,10 +420,20 @@ declare namespace ApplicationInsights {
420
420
  * approach is to create a new instance and initialize that instance.
421
421
  * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
422
422
  * to successfully remove any global references or they may just be completing the unload process asynchronously.
423
+ * @param isAsync - Can the unload be performed asynchronously (default)
424
+ * @param unloadComplete - An optional callback that will be called once the unload has completed
425
+ * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
423
426
  */
424
427
  unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
425
428
  getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
426
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
429
+ /**
430
+ * Add a new plugin to the installation
431
+ * @param plugin - The new plugin to add
432
+ * @param replaceExisting - should any existing plugin be replaced, default is false
433
+ * @param doAsync - Should the add be performed asynchronously
434
+ * @param addCb - [Optional] callback to call after the plugin has been added
435
+ */
436
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
427
437
  /**
428
438
  * Returns the unique event namespace that should be used
429
439
  */
@@ -433,6 +443,15 @@ declare namespace ApplicationInsights {
433
443
  * @param handler - the handler
434
444
  */
435
445
  addUnloadCb(handler: UnloadHandler): void;
446
+ /**
447
+ * Flush and send any batched / cached data immediately
448
+ * @param async - send data asynchronously when true (defaults to true)
449
+ * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
450
+ * If the caller doesn't return true the caller should assume that it may never be called.
451
+ * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
452
+ * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
453
+ */
454
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): void;
436
455
  protected releaseQueue(): void;
437
456
  /**
438
457
  * Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
@@ -1097,8 +1116,11 @@ declare namespace ApplicationInsights {
1097
1116
  * approach is to create a new instance and initialize that instance.
1098
1117
  * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
1099
1118
  * to successfully remove any global references or they may just be completing the unload process asynchronously.
1119
+ * @param isAsync - Can the unload be performed asynchronously (default)
1120
+ * @param unloadComplete - An optional callback that will be called once the unload has completed
1121
+ * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
1100
1122
  */
1101
- unload(isAsync?: boolean, unloadComplete?: () => void): void;
1123
+ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
1102
1124
  /**
1103
1125
  * Find and return the (first) plugin with the specified identifier if present
1104
1126
  * @param pluginIdentifier
@@ -1107,10 +1129,11 @@ declare namespace ApplicationInsights {
1107
1129
  /**
1108
1130
  * Add a new plugin to the installation
1109
1131
  * @param plugin - The new plugin to add
1110
- * @param replaceExisting - should any existing plugin be replaced
1132
+ * @param replaceExisting - should any existing plugin be replaced, default is false
1111
1133
  * @param doAsync - Should the add be performed asynchronously
1134
+ * @param addCb - [Optional] callback to call after the plugin has been added
1112
1135
  */
1113
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
1136
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
1114
1137
  /**
1115
1138
  * Returns the unique event namespace that should be used when registering events
1116
1139
  */
@@ -1120,6 +1143,16 @@ declare namespace ApplicationInsights {
1120
1143
  * @param handler - the handler
1121
1144
  */
1122
1145
  addUnloadCb(handler: UnloadHandler): void;
1146
+ /**
1147
+ * Flush and send any batched / cached data immediately
1148
+ * @param async - send data asynchronously when true (defaults to true)
1149
+ * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
1150
+ * If the caller doesn't return true the caller should assume that it may never be called.
1151
+ * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
1152
+ * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
1153
+ * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
1154
+ */
1155
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
1123
1156
  }
1124
1157
 
1125
1158
  interface IAppInsightsDeprecated {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-06
2
+ * Application Insights JavaScript SDK - Web, 2.8.0-beta.2203-09
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -2395,6 +2395,7 @@
2395
2395
  doneIterating = true;
2396
2396
  doCallback();
2397
2397
  });
2398
+ return true;
2398
2399
  },
2399
2400
  _a._setQueue = function (queue) {
2400
2401
  channelQueue = queue;
@@ -2751,7 +2752,7 @@
2751
2752
  _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions));
2752
2753
  _channelConfig = (config || {}).channels;
2753
2754
  _initPluginChain(config, null);
2754
- if (_self.getTransmissionControls().length === 0) {
2755
+ if (!_channelQueue || _channelQueue.length === 0) {
2755
2756
  throwError("No channels available");
2756
2757
  }
2757
2758
  _isInitialized = true;
@@ -2872,16 +2873,12 @@
2872
2873
  _self.stopPollingInternalLogs();
2873
2874
  processUnloadCtx.processNext(unloadState);
2874
2875
  }
2875
- if (_channelControl) {
2876
- _channelControl.flush(isAsync, _doUnload, 6 , cbTimeout);
2877
- }
2878
- else {
2879
- _doUnload(true);
2876
+ if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) {
2877
+ _doUnload(false);
2880
2878
  }
2881
2879
  };
2882
2880
  _self.getPlugin = _getPlugin;
2883
2881
  _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {
2884
- if (isAsync === void 0) { isAsync = true; }
2885
2882
  if (!plugin) {
2886
2883
  addCb && addCb(false);
2887
2884
  _logOrThrowError(strValidationError);
@@ -2926,6 +2923,7 @@
2926
2923
  _self.evtNamespace = function () {
2927
2924
  return _evtNamespace;
2928
2925
  };
2926
+ _self.flush = _flushChannels;
2929
2927
  proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add");
2930
2928
  function _initDefaults() {
2931
2929
  _isInitialized = false;
@@ -3091,6 +3089,13 @@
3091
3089
  queue.length = 0;
3092
3090
  }
3093
3091
  }
3092
+ function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {
3093
+ if (_channelControl) {
3094
+ return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout);
3095
+ }
3096
+ callBack && callBack(false);
3097
+ return true;
3098
+ }
3094
3099
  function _initDebugListener(config) {
3095
3100
  if (config.disableDbgExt === true && _debugListener) {
3096
3101
  _notificationManager[strRemoveNotificationListener](_debugListener);
@@ -3246,6 +3251,8 @@
3246
3251
  var strBeforeUnload = "beforeunload";
3247
3252
  var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide");
3248
3253
  createUniqueNamespace("aiEvtPageShow");
3254
+ var rRemoveEmptyNs = /\.[\.]+/g;
3255
+ var rRemoveTrailingEmptyNs = /[\.]+$/;
3249
3256
  var _guid = 1;
3250
3257
  var elmNodeData = createElmNodeData("events");
3251
3258
  var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
@@ -3283,7 +3290,7 @@
3283
3290
  var parsedEvent = (eventNamespace.exec(eventName) || []);
3284
3291
  return {
3285
3292
  type: parsedEvent[1],
3286
- ns: ((parsedEvent[2] || "").split(".").sort()).join(".")
3293
+ ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
3287
3294
  };
3288
3295
  }
3289
3296
  function _getRegisteredEvents(target, evtName, addDefault) {
@@ -3356,6 +3363,7 @@
3356
3363
  else {
3357
3364
  newNamespaces = [theNamespace, namespaces];
3358
3365
  }
3366
+ newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split(".");
3359
3367
  }
3360
3368
  else {
3361
3369
  newNamespaces = theNamespace;
@@ -5433,11 +5441,9 @@
5433
5441
  if (core) {
5434
5442
  _logger = core.logger;
5435
5443
  }
5436
- function _flushChannels() {
5444
+ function _flushChannels(isAsync) {
5437
5445
  if (core) {
5438
- arrForEach(core.getTransmissionControls(), function (queues) {
5439
- arrForEach(queues, function (q) { q.flush(true); });
5440
- });
5446
+ core.flush(isAsync);
5441
5447
  }
5442
5448
  }
5443
5449
  function _addQueue(cb) {
@@ -5460,7 +5466,7 @@
5460
5466
  intervalHandle = null;
5461
5467
  }
5462
5468
  if (doFlush) {
5463
- _flushChannels();
5469
+ _flushChannels(true);
5464
5470
  }
5465
5471
  }), 100);
5466
5472
  }
@@ -5478,7 +5484,7 @@
5478
5484
  }
5479
5485
  if (!pageViewPerformanceManager.isPerformanceTimingSupported()) {
5480
5486
  appInsights.sendPageViewInternal(pageView, customProperties);
5481
- _flushChannels();
5487
+ _flushChannels(true);
5482
5488
  _logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.NavigationTimingNotSupported, "trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");
5483
5489
  return;
5484
5490
  }
@@ -5504,7 +5510,7 @@
5504
5510
  customProperties["duration"] = customDuration;
5505
5511
  }
5506
5512
  appInsights.sendPageViewInternal(pageView, customProperties);
5507
- _flushChannels();
5513
+ _flushChannels(true);
5508
5514
  pageViewSent = true;
5509
5515
  }
5510
5516
  var maxDurationLimit = 60000;
@@ -5550,6 +5556,17 @@
5550
5556
  return processed;
5551
5557
  });
5552
5558
  };
5559
+ _self.teardown = function (unloadCtx, unloadState) {
5560
+ if (intervalHandle) {
5561
+ clearInterval(intervalHandle);
5562
+ intervalHandle = null;
5563
+ var allItems = itemQueue.slice(0);
5564
+ itemQueue = [];
5565
+ arrForEach(allItems, function (item) {
5566
+ if (item()) ;
5567
+ });
5568
+ }
5569
+ };
5553
5570
  });
5554
5571
  }
5555
5572
  return PageViewManager;
@@ -6039,7 +6056,7 @@
6039
6056
  }
6040
6057
  _base.initialize(config, core, extensions, pluginChain);
6041
6058
  try {
6042
- _evtNamespace = mergeEvtNamespace(createUniqueNamespace("AnalyticsPlugin"), core.evtNamespace && core.evtNamespace());
6059
+ _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());
6043
6060
  if (_preInitTelemetryInitializers) {
6044
6061
  arrForEach(_preInitTelemetryInitializers, function (initializer) {
6045
6062
  core.addTelemetryInitializer(initializer);
@@ -6086,6 +6103,7 @@
6086
6103
  }
6087
6104
  };
6088
6105
  _self._doTeardown = function (unloadCtx, unloadState) {
6106
+ _pageViewManager && _pageViewManager.teardown(unloadCtx, unloadState);
6089
6107
  eventOff(window, null, null, _evtNamespace);
6090
6108
  _initDefaults();
6091
6109
  };
@@ -6271,7 +6289,7 @@
6271
6289
  });
6272
6290
  return _this;
6273
6291
  }
6274
- AnalyticsPlugin.Version = "2.8.0-beta.2203-06";
6292
+ AnalyticsPlugin.Version = "2.8.0-beta.2203-09";
6275
6293
  AnalyticsPlugin.getDefaultConfig = _getDefaultConfig;
6276
6294
  return AnalyticsPlugin;
6277
6295
  }(BaseTelemetryPlugin));
@@ -6553,7 +6571,7 @@
6553
6571
  }
6554
6572
  }
6555
6573
  var EnvelopeCreator = {
6556
- Version: "2.8.0-beta.2203-06"
6574
+ Version: "2.8.0-beta.2203-09"
6557
6575
  };
6558
6576
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
6559
6577
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -7863,7 +7881,7 @@
7863
7881
  return Device;
7864
7882
  }());
7865
7883
 
7866
- var Version = "2.8.0-beta.2203-06";
7884
+ var Version = "2.8.0-beta.2203-09";
7867
7885
  var Internal = /** @class */ (function () {
7868
7886
  function Internal(config) {
7869
7887
  this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version;
@@ -8705,6 +8723,7 @@
8705
8723
  var isPolyfill = fetch.polyfill;
8706
8724
  if (_config.disableFetchTracking === false) {
8707
8725
  _addHook(InstrumentFunc(global, strFetch, {
8726
+ ns: _evtNamespace,
8708
8727
  req: function (callDetails, input, init) {
8709
8728
  var fetchData;
8710
8729
  if (_fetchInitialized &&
@@ -8753,6 +8772,7 @@
8753
8772
  }
8754
8773
  else if (isPolyfill) {
8755
8774
  _addHook(InstrumentFunc(global, strFetch, {
8775
+ ns: _evtNamespace,
8756
8776
  req: function (callDetails, input, init) {
8757
8777
  _isDisabledRequest(null, input, init);
8758
8778
  }
@@ -8768,6 +8788,7 @@
8768
8788
  function _instrumentXhr() {
8769
8789
  if (_supportsAjaxMonitoring(_self) && !_xhrInitialized) {
8770
8790
  _hookProto(XMLHttpRequest, "open", {
8791
+ ns: _evtNamespace,
8771
8792
  req: function (args, method, url, async) {
8772
8793
  var xhr = args.inst;
8773
8794
  var ajaxData = xhr[strAjaxData];
@@ -8781,6 +8802,7 @@
8781
8802
  hkErr: _createErrorCallbackFunc(_self, _InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")
8782
8803
  });
8783
8804
  _hookProto(XMLHttpRequest, "send", {
8805
+ ns: _evtNamespace,
8784
8806
  req: function (args, context) {
8785
8807
  var xhr = args.inst;
8786
8808
  var ajaxData = xhr[strAjaxData];