@microsoft/applicationinsights-web-basic 3.1.3-nightly3.240410-01 → 3.2.0

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.240410-01.js → aib.3.2.0.cjs.js} +262 -214
  2. package/browser/es5/aib.3.2.0.cjs.js.map +1 -0
  3. package/browser/es5/aib.3.2.0.cjs.min.js +6 -0
  4. package/browser/es5/aib.3.2.0.cjs.min.js.map +1 -0
  5. package/browser/es5/{aib.3.1.3-nightly3.240410-01.gbl.js → aib.3.2.0.gbl.js} +264 -189
  6. package/browser/es5/aib.3.2.0.gbl.js.map +1 -0
  7. package/browser/es5/aib.3.2.0.gbl.min.js +6 -0
  8. package/browser/es5/aib.3.2.0.gbl.min.js.map +1 -0
  9. package/browser/es5/aib.3.2.0.integrity.json +66 -0
  10. package/browser/es5/{aib.3.1.3-nightly3.240410-01.cjs.js → aib.3.2.0.js} +289 -187
  11. package/browser/es5/aib.3.2.0.js.map +1 -0
  12. package/browser/es5/aib.3.2.0.min.js +6 -0
  13. package/browser/es5/aib.3.2.0.min.js.map +1 -0
  14. package/browser/es5/aib.3.cjs.js +261 -186
  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 +263 -188
  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 +263 -188
  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 +261 -186
  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 +67 -70
  34. package/types/applicationinsights-web-basic.d.ts +1 -1
  35. package/types/applicationinsights-web-basic.namespaced.d.ts +59 -22
  36. package/browser/es5/aib.3.1.3-nightly3.240410-01.cjs.js.map +0 -1
  37. package/browser/es5/aib.3.1.3-nightly3.240410-01.cjs.min.js +0 -6
  38. package/browser/es5/aib.3.1.3-nightly3.240410-01.cjs.min.js.map +0 -1
  39. package/browser/es5/aib.3.1.3-nightly3.240410-01.gbl.js.map +0 -1
  40. package/browser/es5/aib.3.1.3-nightly3.240410-01.gbl.min.js +0 -6
  41. package/browser/es5/aib.3.1.3-nightly3.240410-01.gbl.min.js.map +0 -1
  42. package/browser/es5/aib.3.1.3-nightly3.240410-01.integrity.json +0 -66
  43. package/browser/es5/aib.3.1.3-nightly3.240410-01.js.map +0 -1
  44. package/browser/es5/aib.3.1.3-nightly3.240410-01.min.js +0 -6
  45. package/browser/es5/aib.3.1.3-nightly3.240410-01.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript Web SDK - Basic, 3.1.3-nightly3.240410-01
2
+ * Application Insights JavaScript Web SDK - Basic, 3.2.0
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.240410-01
2
+ * Application Insights JavaScript Web SDK - Basic, 3.2.0
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,70 +1,67 @@
1
- {
2
- "name": "@microsoft/applicationinsights-web-basic",
3
- "version": "3.1.3-nightly3.240410-01",
4
- "description": "Microsoft Application Insights JavaScript SDK - Web Basic",
5
- "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
- "author": "Microsoft Application Insights Team",
7
- "main": "dist/es5/applicationinsights-web-basic.js",
8
- "module": "dist-es5/index.js",
9
- "types": "types/applicationinsights-web-basic.d.ts",
10
- "sideEffects": false,
11
- "scripts": {
12
- "clean": "git clean -xdf",
13
- "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
14
- "build:esm": "grunt aiskulite",
15
- "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
16
- "rebuild": "npm run build",
17
- "test": "grunt aiskuliteunittests",
18
- "mintest": "grunt aiskulite-mintests",
19
- "lint": "tslint -p tsconfig.json",
20
- "dtsgen": "api-extractor run --local && node ../scripts/dtsgen.js 'Microsoft.ApplicationInsights'",
21
- "sri": "node ../tools/subResourceIntegrity/generateIntegrityFile.js",
22
- "ai-min": "grunt aiskulite-min",
23
- "ai-restore": "grunt aiskulite-restore",
24
- "npm-pack": "npm pack",
25
- "api-docs": "typedoc"
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/microsoft/ApplicationInsights-JS.git",
30
- "directory": "AISKULight"
31
- },
32
- "devDependencies": {
33
- "@microsoft/ai-test-framework": "0.0.1",
34
- "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
35
- "@microsoft/applicationinsights-rollup-es5": "1.0.2",
36
- "@microsoft/api-extractor": "^7.40.0",
37
- "grunt": "^1.5.3",
38
- "grunt-cli": "^1.4.3",
39
- "grunt-contrib-qunit": "^6.2.1",
40
- "@nevware21/grunt-ts-plugin": "^0.4.3",
41
- "@nevware21/grunt-eslint-ts": "^0.2.2",
42
- "globby": "^11.0.0",
43
- "magic-string": "^0.25.7",
44
- "pako": "^2.0.3",
45
- "@rollup/plugin-commonjs": "^24.0.0",
46
- "@rollup/plugin-node-resolve": "^15.0.1",
47
- "@rollup/plugin-replace": "^5.0.2",
48
- "rollup-plugin-cleanup": "^3.2.1",
49
- "rollup": "^3.20.0",
50
- "typescript": "^4.9.3",
51
- "typedoc": "^0.24.8",
52
- "tslib": "^2.0.0"
53
- },
54
- "peerDependencies": {
55
- "tslib": "*"
56
- },
57
- "dependencies": {
58
- "@microsoft/dynamicproto-js": "^2.0.3",
59
- "@microsoft/applicationinsights-shims": "3.0.1",
60
- "@microsoft/applicationinsights-common": "3.1.3-nightly3.240410-01",
61
- "@microsoft/applicationinsights-channel-js": "3.1.3-nightly3.240410-01",
62
- "@microsoft/applicationinsights-core-js": "3.1.3-nightly3.240410-01",
63
- "@nevware21/ts-utils": ">= 0.11.0 < 2.x",
64
- "@nevware21/ts-async": ">= 0.3.0 < 2.x"
65
- },
66
- "license": "MIT",
67
- "publishConfig": {
68
- "tag": "nightly3"
69
- }
70
- }
1
+ {
2
+ "name": "@microsoft/applicationinsights-web-basic",
3
+ "version": "3.2.0",
4
+ "description": "Microsoft Application Insights JavaScript SDK - Web Basic",
5
+ "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
+ "author": "Microsoft Application Insights Team",
7
+ "main": "dist/es5/applicationinsights-web-basic.js",
8
+ "module": "dist-es5/index.js",
9
+ "types": "types/applicationinsights-web-basic.d.ts",
10
+ "sideEffects": false,
11
+ "scripts": {
12
+ "clean": "git clean -xdf",
13
+ "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
14
+ "build:esm": "grunt aiskulite",
15
+ "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
16
+ "rebuild": "npm run build",
17
+ "test": "grunt aiskuliteunittests",
18
+ "mintest": "grunt aiskulite-mintests",
19
+ "lint": "tslint -p tsconfig.json",
20
+ "dtsgen": "api-extractor run --local && node ../scripts/dtsgen.js 'Microsoft.ApplicationInsights'",
21
+ "sri": "node ../tools/subResourceIntegrity/generateIntegrityFile.js",
22
+ "ai-min": "grunt aiskulite-min",
23
+ "ai-restore": "grunt aiskulite-restore",
24
+ "npm-pack": "npm pack",
25
+ "api-docs": "typedoc"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/microsoft/ApplicationInsights-JS.git",
30
+ "directory": "AISKULight"
31
+ },
32
+ "devDependencies": {
33
+ "@microsoft/ai-test-framework": "0.0.1",
34
+ "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
35
+ "@microsoft/applicationinsights-rollup-es5": "1.0.2",
36
+ "@microsoft/api-extractor": "^7.40.0",
37
+ "grunt": "^1.5.3",
38
+ "grunt-cli": "^1.4.3",
39
+ "grunt-contrib-qunit": "^6.2.1",
40
+ "@nevware21/grunt-ts-plugin": "^0.4.3",
41
+ "@nevware21/grunt-eslint-ts": "^0.2.2",
42
+ "globby": "^11.0.0",
43
+ "magic-string": "^0.25.7",
44
+ "pako": "^2.0.3",
45
+ "@rollup/plugin-commonjs": "^24.0.0",
46
+ "@rollup/plugin-node-resolve": "^15.0.1",
47
+ "@rollup/plugin-replace": "^5.0.2",
48
+ "rollup-plugin-cleanup": "^3.2.1",
49
+ "rollup": "^3.20.0",
50
+ "typescript": "^4.9.3",
51
+ "typedoc": "^0.24.8",
52
+ "tslib": "^2.0.0"
53
+ },
54
+ "peerDependencies": {
55
+ "tslib": "*"
56
+ },
57
+ "dependencies": {
58
+ "@microsoft/dynamicproto-js": "^2.0.3",
59
+ "@microsoft/applicationinsights-shims": "3.0.1",
60
+ "@microsoft/applicationinsights-common": "3.2.0",
61
+ "@microsoft/applicationinsights-channel-js": "3.2.0",
62
+ "@microsoft/applicationinsights-core-js": "3.2.0",
63
+ "@nevware21/ts-utils": ">= 0.11.1 < 2.x",
64
+ "@nevware21/ts-async": ">= 0.5.1 < 2.x"
65
+ },
66
+ "license": "MIT"
67
+ }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 3.1.3-nightly3.240410-01
2
+ * Microsoft.ApplicationInsights, 3.2.0
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.240410-01
2
+ * Microsoft.ApplicationInsights, 3.2.0
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
  */
@@ -2550,11 +2566,15 @@ declare namespace ApplicationInsights {
2550
2566
  isSampledIn(envelope: ITelemetryItem): boolean;
2551
2567
  }
2552
2568
 
2569
+ /**
2570
+ * Before 3.1.2, payload only allow string
2571
+ * After 3.2.0, IInternalStorageItem is accepted
2572
+ */
2553
2573
  interface ISendBuffer {
2554
2574
  /**
2555
2575
  * Enqueue the payload
2556
2576
  */
2557
- enqueue: (payload: string) => void;
2577
+ enqueue: (payload: IInternalStorageItem) => void;
2558
2578
  /**
2559
2579
  * Returns the number of elements in the buffer
2560
2580
  */
@@ -2570,20 +2590,20 @@ declare namespace ApplicationInsights {
2570
2590
  /**
2571
2591
  * Returns items stored in the buffer
2572
2592
  */
2573
- getItems: () => string[];
2593
+ getItems: () => IInternalStorageItem[];
2574
2594
  /**
2575
2595
  * Build a batch of all elements in the payload array
2576
2596
  */
2577
- batchPayloads: (payload: string[]) => string;
2597
+ batchPayloads: (payload: IInternalStorageItem[]) => string;
2578
2598
  /**
2579
2599
  * Moves items to the SENT_BUFFER.
2580
2600
  * The buffer holds items which were sent, but we haven't received any response from the backend yet.
2581
2601
  */
2582
- markAsSent: (payload: string[]) => void;
2602
+ markAsSent: (payload: IInternalStorageItem[]) => void;
2583
2603
  /**
2584
2604
  * Removes items from the SENT_BUFFER. Should be called on successful response from the backend.
2585
2605
  */
2586
- clearSent: (payload: string[]) => void;
2606
+ clearSent: (payload: IInternalStorageItem[]) => void;
2587
2607
  /**
2588
2608
  * Copy current buffer items to a new buffer.
2589
2609
  * if canUseSessionStorage is undefined, it will set to false.
@@ -2712,6 +2732,14 @@ declare namespace ApplicationInsights {
2712
2732
  * @since 3.1.1
2713
2733
  */
2714
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;
2715
2743
  }
2716
2744
 
2717
2745
  interface ISerializable {
@@ -3275,8 +3303,9 @@ declare namespace ApplicationInsights {
3275
3303
  /**
3276
3304
  * xhr state changes
3277
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)
3278
3307
  */
3279
- _xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[], countOfItemsInPayload: number): void;
3308
+ _xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number): void;
3280
3309
  /**
3281
3310
  * Trigger the immediate send of buffered data; If executing asynchronously (the default) this may (not required) return
3282
3311
  * an [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) that will resolve once the
@@ -3291,21 +3320,28 @@ declare namespace ApplicationInsights {
3291
3320
  triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void | IPromise<boolean>;
3292
3321
  /**
3293
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)
3294
3325
  */
3295
- _onError(payload: string[], message: string, event?: ErrorEvent): void;
3326
+ _onError(payload: string[] | IInternalStorageItem[], message: string, event?: ErrorEvent): void;
3296
3327
  /**
3297
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)
3298
3331
  */
3299
- _onPartialSuccess(payload: string[], results: IBackendResponse): void;
3332
+ _onPartialSuccess(payload: string[] | IInternalStorageItem[], results: IBackendResponse): void;
3300
3333
  /**
3301
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)
3302
3337
  */
3303
- _onSuccess(payload: string[], countOfItemsInPayload: number): void;
3338
+ _onSuccess(payload: string[] | IInternalStorageItem[], countOfItemsInPayload: number): void;
3304
3339
  /**
3305
3340
  * xdr state changes
3306
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)
3307
3343
  */
3308
- _xdrOnLoad(xdr: IXDomainRequest, payload: string[]): void;
3344
+ _xdrOnLoad(xdr: IXDomainRequest, payload: string[] | IInternalStorageItem[]): void;
3309
3345
  /**
3310
3346
  * Add header to request
3311
3347
  * @param name - Header name.
@@ -3324,7 +3360,7 @@ declare namespace ApplicationInsights {
3324
3360
  getOfflineSupport(): IInternalOfflineSupport;
3325
3361
  }
3326
3362
 
3327
- type SenderFunction = (payload: string[], isAsync: boolean) => void | IPromise<boolean>;
3363
+ type SenderFunction = (payload: string[] | IInternalStorageItem[], isAsync: boolean) => void | IPromise<boolean>;
3328
3364
 
3329
3365
  /**
3330
3366
  * SendPOSTFunction type defines how an HTTP POST request is sent to an ingestion server
@@ -3381,14 +3417,15 @@ declare namespace ApplicationInsights {
3381
3417
  }
3382
3418
 
3383
3419
  class SessionStorageSendBuffer extends BaseSendBuffer implements ISendBuffer {
3420
+ static VERSION: string;
3384
3421
  static BUFFER_KEY: string;
3385
3422
  static SENT_BUFFER_KEY: string;
3386
3423
  static MAX_BUFFER_SIZE: number;
3387
3424
  constructor(logger: IDiagnosticLogger, config: ISenderConfig);
3388
- enqueue(payload: string): void;
3425
+ enqueue(payload: IInternalStorageItem): void;
3389
3426
  clear(): void;
3390
- markAsSent(payload: string[]): void;
3391
- clearSent(payload: string[]): void;
3427
+ markAsSent(payload: IInternalStorageItem[]): void;
3428
+ clearSent(payload: IInternalStorageItem[]): void;
3392
3429
  createNew(newLogger?: IDiagnosticLogger, newConfig?: ISenderConfig, canUseSessionStorage?: boolean): ArraySendBuffer | SessionStorageSendBuffer;
3393
3430
  }
3394
3431