@microsoft/applicationinsights-web-basic 3.1.3-nightly3.240329-01 → 3.1.3-nightly3.2404-16

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 (45) hide show
  1. package/browser/es5/{aib.3.1.3-nightly3.240329-01.js → aib.3.1.3-nightly3.2404-16.cjs.js} +334 -263
  2. package/browser/es5/aib.3.1.3-nightly3.2404-16.cjs.js.map +1 -0
  3. package/browser/es5/aib.3.1.3-nightly3.2404-16.cjs.min.js +6 -0
  4. package/browser/es5/aib.3.1.3-nightly3.2404-16.cjs.min.js.map +1 -0
  5. package/browser/es5/{aib.3.1.3-nightly3.240329-01.gbl.js → aib.3.1.3-nightly3.2404-16.gbl.js} +336 -238
  6. package/browser/es5/aib.3.1.3-nightly3.2404-16.gbl.js.map +1 -0
  7. package/browser/es5/aib.3.1.3-nightly3.2404-16.gbl.min.js +6 -0
  8. package/browser/es5/aib.3.1.3-nightly3.2404-16.gbl.min.js.map +1 -0
  9. package/browser/es5/aib.3.1.3-nightly3.2404-16.integrity.json +66 -0
  10. package/browser/es5/{aib.3.1.3-nightly3.240329-01.cjs.js → aib.3.1.3-nightly3.2404-16.js} +361 -236
  11. package/browser/es5/aib.3.1.3-nightly3.2404-16.js.map +1 -0
  12. package/browser/es5/aib.3.1.3-nightly3.2404-16.min.js +6 -0
  13. package/browser/es5/aib.3.1.3-nightly3.2404-16.min.js.map +1 -0
  14. package/browser/es5/aib.3.cjs.js +333 -235
  15. package/browser/es5/aib.3.cjs.js.map +1 -1
  16. package/browser/es5/aib.3.cjs.min.js +2 -2
  17. package/browser/es5/aib.3.cjs.min.js.map +1 -1
  18. package/browser/es5/aib.3.gbl.js +335 -237
  19. package/browser/es5/aib.3.gbl.js.map +1 -1
  20. package/browser/es5/aib.3.gbl.min.js +2 -2
  21. package/browser/es5/aib.3.gbl.min.js.map +1 -1
  22. package/browser/es5/aib.3.integrity.json +25 -25
  23. package/browser/es5/aib.3.js +335 -237
  24. package/browser/es5/aib.3.js.map +1 -1
  25. package/browser/es5/aib.3.min.js +2 -2
  26. package/browser/es5/aib.3.min.js.map +1 -1
  27. package/dist/es5/applicationinsights-web-basic.js +333 -235
  28. package/dist/es5/applicationinsights-web-basic.js.map +1 -1
  29. package/dist/es5/applicationinsights-web-basic.min.js +2 -2
  30. package/dist/es5/applicationinsights-web-basic.min.js.map +1 -1
  31. package/dist-es5/__DynamicConstants.js +1 -1
  32. package/dist-es5/index.js +1 -1
  33. package/package.json +6 -6
  34. package/types/applicationinsights-web-basic.d.ts +1 -1
  35. package/types/applicationinsights-web-basic.namespaced.d.ts +59 -49
  36. package/browser/es5/aib.3.1.3-nightly3.240329-01.cjs.js.map +0 -1
  37. package/browser/es5/aib.3.1.3-nightly3.240329-01.cjs.min.js +0 -6
  38. package/browser/es5/aib.3.1.3-nightly3.240329-01.cjs.min.js.map +0 -1
  39. package/browser/es5/aib.3.1.3-nightly3.240329-01.gbl.js.map +0 -1
  40. package/browser/es5/aib.3.1.3-nightly3.240329-01.gbl.min.js +0 -6
  41. package/browser/es5/aib.3.1.3-nightly3.240329-01.gbl.min.js.map +0 -1
  42. package/browser/es5/aib.3.1.3-nightly3.240329-01.integrity.json +0 -66
  43. package/browser/es5/aib.3.1.3-nightly3.240329-01.js.map +0 -1
  44. package/browser/es5/aib.3.1.3-nightly3.240329-01.min.js +0 -6
  45. package/browser/es5/aib.3.1.3-nightly3.240329-01.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript Web SDK - Basic, 3.1.3-nightly3.240329-01
2
+ * Application Insights JavaScript Web SDK - Basic, 3.1.3-nightly3.2404-16
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
package/dist-es5/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript Web SDK - Basic, 3.1.3-nightly3.240329-01
2
+ * Application Insights JavaScript Web SDK - Basic, 3.1.3-nightly3.2404-16
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-web-basic",
3
- "version": "3.1.3-nightly3.240329-01",
3
+ "version": "3.1.3-nightly3.2404-16",
4
4
  "description": "Microsoft Application Insights JavaScript SDK - Web Basic",
5
5
  "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
6
  "author": "Microsoft Application Insights Team",
@@ -57,11 +57,11 @@
57
57
  "dependencies": {
58
58
  "@microsoft/dynamicproto-js": "^2.0.3",
59
59
  "@microsoft/applicationinsights-shims": "3.0.1",
60
- "@microsoft/applicationinsights-common": "3.1.3-nightly3.240329-01",
61
- "@microsoft/applicationinsights-channel-js": "3.1.3-nightly3.240329-01",
62
- "@microsoft/applicationinsights-core-js": "3.1.3-nightly3.240329-01",
63
- "@nevware21/ts-utils": ">= 0.11.0 < 2.x",
64
- "@nevware21/ts-async": ">= 0.3.0 < 2.x"
60
+ "@microsoft/applicationinsights-common": "3.1.3-nightly3.2404-16",
61
+ "@microsoft/applicationinsights-channel-js": "3.1.3-nightly3.2404-16",
62
+ "@microsoft/applicationinsights-core-js": "3.1.3-nightly3.2404-16",
63
+ "@nevware21/ts-utils": ">= 0.11.1 < 2.x",
64
+ "@nevware21/ts-async": ">= 0.5.1 < 2.x"
65
65
  },
66
66
  "license": "MIT",
67
67
  "publishConfig": {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 3.1.3-nightly3.240329-01
2
+ * Microsoft.ApplicationInsights, 3.1.3-nightly3.2404-16
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 3.1.3-nightly3.240329-01
2
+ * Microsoft.ApplicationInsights, 3.1.3-nightly3.2404-16
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -241,8 +241,8 @@ declare namespace ApplicationInsights {
241
241
 
242
242
  class ArraySendBuffer extends BaseSendBuffer implements ISendBuffer {
243
243
  constructor(logger: IDiagnosticLogger, config: ISenderConfig);
244
- markAsSent(payload: string[]): void;
245
- clearSent(payload: string[]): void;
244
+ markAsSent(payload: IInternalStorageItem[]): void;
245
+ clearSent(payload: IInternalStorageItem[]): void;
246
246
  }
247
247
 
248
248
  /**
@@ -290,15 +290,15 @@ declare namespace ApplicationInsights {
290
290
  function arrForEach<T = any>(theArray: ArrayLike<T>, callbackfn: (value: T, index: number, array: T[]) => void | number, thisArg?: any): void;
291
291
 
292
292
  abstract class BaseSendBuffer {
293
- protected _get: () => string[];
294
- protected _set: (buffer: string[]) => string[];
293
+ protected _get: () => IInternalStorageItem[];
294
+ protected _set: (buffer: IInternalStorageItem[]) => IInternalStorageItem[];
295
295
  constructor(logger: IDiagnosticLogger, config: ISenderConfig);
296
- enqueue(payload: string): void;
296
+ enqueue(payload: IInternalStorageItem): void;
297
297
  count(): number;
298
298
  size(): number;
299
299
  clear(): void;
300
- getItems(): string[];
301
- batchPayloads(payload: string[]): string;
300
+ getItems(): IInternalStorageItem[];
301
+ batchPayloads(payload: IInternalStorageItem[]): string;
302
302
  createNew(newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean): ArraySendBuffer | SessionStorageSendBuffer;
303
303
  }
304
304
 
@@ -1820,6 +1820,22 @@ declare namespace ApplicationInsights {
1820
1820
  shouldProcess?: (evt: ITelemetryItem) => boolean;
1821
1821
  }
1822
1822
 
1823
+ /**
1824
+ * Internal interface for sendBuffer, do not export it
1825
+ * @internal
1826
+ * @since 3.1.3
1827
+ */
1828
+ interface IInternalStorageItem {
1829
+ /**
1830
+ * serialized telemetry to be stored.
1831
+ */
1832
+ item: string;
1833
+ /**
1834
+ * total retry count
1835
+ */
1836
+ cnt?: number;
1837
+ }
1838
+
1823
1839
  /**
1824
1840
  * An alternate interface which provides automatic removal during unloading of the component
1825
1841
  */
@@ -2527,33 +2543,6 @@ declare namespace ApplicationInsights {
2527
2543
  * ```
2528
2544
  */
2529
2545
  finally(onfinally?: FinallyPromiseHandler): IPromise<T>;
2530
- /**
2531
- * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
2532
- * resolved value cannot be modified from the callback.
2533
- * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
2534
- * @returns A Promise for the completion of the callback.
2535
- * @example
2536
- * ```ts
2537
- * function doFunction() {
2538
- * return createPromise((resolve, reject) => {
2539
- * if (Math.random() > 0.5) {
2540
- * resolve('Function has completed');
2541
- * } else {
2542
- * reject(new Error('Function failed to process'));
2543
- * }
2544
- * });
2545
- * }
2546
- *
2547
- * doFunction().then((data) => {
2548
- * console.log(data);
2549
- * }).catch((err) => {
2550
- * console.error(err);
2551
- * }).finally(() => {
2552
- * console.log('Function processing completed');
2553
- * });
2554
- * ```
2555
- */
2556
- finally(onFinally?: FinallyPromiseHandler): Promise<T>;
2557
2546
  }
2558
2547
 
2559
2548
  interface IRequestContext {
@@ -2577,11 +2566,15 @@ declare namespace ApplicationInsights {
2577
2566
  isSampledIn(envelope: ITelemetryItem): boolean;
2578
2567
  }
2579
2568
 
2569
+ /**
2570
+ * Before 3.1.2, payload only allow string
2571
+ * After 3.2.0, IInternalStorageItem is accepted
2572
+ */
2580
2573
  interface ISendBuffer {
2581
2574
  /**
2582
2575
  * Enqueue the payload
2583
2576
  */
2584
- enqueue: (payload: string) => void;
2577
+ enqueue: (payload: IInternalStorageItem) => void;
2585
2578
  /**
2586
2579
  * Returns the number of elements in the buffer
2587
2580
  */
@@ -2597,20 +2590,20 @@ declare namespace ApplicationInsights {
2597
2590
  /**
2598
2591
  * Returns items stored in the buffer
2599
2592
  */
2600
- getItems: () => string[];
2593
+ getItems: () => IInternalStorageItem[];
2601
2594
  /**
2602
2595
  * Build a batch of all elements in the payload array
2603
2596
  */
2604
- batchPayloads: (payload: string[]) => string;
2597
+ batchPayloads: (payload: IInternalStorageItem[]) => string;
2605
2598
  /**
2606
2599
  * Moves items to the SENT_BUFFER.
2607
2600
  * The buffer holds items which were sent, but we haven't received any response from the backend yet.
2608
2601
  */
2609
- markAsSent: (payload: string[]) => void;
2602
+ markAsSent: (payload: IInternalStorageItem[]) => void;
2610
2603
  /**
2611
2604
  * Removes items from the SENT_BUFFER. Should be called on successful response from the backend.
2612
2605
  */
2613
- clearSent: (payload: string[]) => void;
2606
+ clearSent: (payload: IInternalStorageItem[]) => void;
2614
2607
  /**
2615
2608
  * Copy current buffer items to a new buffer.
2616
2609
  * if canUseSessionStorage is undefined, it will set to false.
@@ -2739,6 +2732,14 @@ declare namespace ApplicationInsights {
2739
2732
  * @since 3.1.1
2740
2733
  */
2741
2734
  retryCodes?: number[];
2735
+ /**
2736
+ * (Optional) The specific max retry count for each telemetry item.
2737
+ * Default: 10
2738
+ * if it is set to 0, means no retry allowed
2739
+ * if it is set to undefined, means no limit for retry times
2740
+ * @since 3.2.0
2741
+ */
2742
+ maxRetryCnt?: number;
2742
2743
  }
2743
2744
 
2744
2745
  interface ISerializable {
@@ -3302,8 +3303,9 @@ declare namespace ApplicationInsights {
3302
3303
  /**
3303
3304
  * xhr state changes
3304
3305
  * @deprecated
3306
+ * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)
3305
3307
  */
3306
- _xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[], countOfItemsInPayload: number): void;
3308
+ _xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number): void;
3307
3309
  /**
3308
3310
  * Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return
3309
3311
  * an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) that will resolve once the
@@ -3318,21 +3320,28 @@ declare namespace ApplicationInsights {
3318
3320
  triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void | IPromise<boolean>;
3319
3321
  /**
3320
3322
  * error handler
3323
+ * @Internal
3324
+ * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)
3321
3325
  */
3322
- _onError(payload: string[], message: string, event?: ErrorEvent): void;
3326
+ _onError(payload: string[] | IInternalStorageItem[], message: string, event?: ErrorEvent): void;
3323
3327
  /**
3324
3328
  * partial success handler
3329
+ * @Internal
3330
+ * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)
3325
3331
  */
3326
- _onPartialSuccess(payload: string[], results: IBackendResponse): void;
3332
+ _onPartialSuccess(payload: string[] | IInternalStorageItem[], results: IBackendResponse): void;
3327
3333
  /**
3328
3334
  * success handler
3335
+ * @Internal
3336
+ * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)
3329
3337
  */
3330
- _onSuccess(payload: string[], countOfItemsInPayload: number): void;
3338
+ _onSuccess(payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number): void;
3331
3339
  /**
3332
3340
  * xdr state changes
3333
3341
  * @deprecated
3342
+ * since version 3.2.0, if the payload is string[], this function is no-op (string[] is only used for backwards Compatibility)
3334
3343
  */
3335
- _xdrOnLoad(xdr: IXDomainRequest, payload: string[]): void;
3344
+ _xdrOnLoad(xdr: IXDomainRequest, payload: string[] | IInternalStorageItem[]): void;
3336
3345
  /**
3337
3346
  * Add header to request
3338
3347
  * @param name - Header name.
@@ -3351,7 +3360,7 @@ declare namespace ApplicationInsights {
3351
3360
  getOfflineSupport(): IInternalOfflineSupport;
3352
3361
  }
3353
3362
 
3354
- type SenderFunction = (payload: string[], isAsync: boolean) => void | IPromise<boolean>;
3363
+ type SenderFunction = (payload: string[] | IInternalStorageItem[], isAsync: boolean) => void | IPromise<boolean>;
3355
3364
 
3356
3365
  /**
3357
3366
  * SendPOSTFunction type defines how an HTTP POST request is sent to an ingestion server
@@ -3408,14 +3417,15 @@ declare namespace ApplicationInsights {
3408
3417
  }
3409
3418
 
3410
3419
  class SessionStorageSendBuffer extends BaseSendBuffer implements ISendBuffer {
3420
+ static VERSION: string;
3411
3421
  static BUFFER_KEY: string;
3412
3422
  static SENT_BUFFER_KEY: string;
3413
3423
  static MAX_BUFFER_SIZE: number;
3414
3424
  constructor(logger: IDiagnosticLogger, config: ISenderConfig);
3415
- enqueue(payload: string): void;
3425
+ enqueue(payload: IInternalStorageItem): void;
3416
3426
  clear(): void;
3417
- markAsSent(payload: string[]): void;
3418
- clearSent(payload: string[]): void;
3427
+ markAsSent(payload: IInternalStorageItem[]): void;
3428
+ clearSent(payload: IInternalStorageItem[]): void;
3419
3429
  createNew(newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean): ArraySendBuffer | SessionStorageSendBuffer;
3420
3430
  }
3421
3431