@microsoft/applicationinsights-channel-js 2.8.12-nightly.2304-31 → 2.8.12

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 (35) hide show
  1. package/browser/applicationinsights-channel-js.integrity.json +9 -9
  2. package/browser/applicationinsights-channel-js.js +15 -9
  3. package/browser/applicationinsights-channel-js.js.map +1 -1
  4. package/browser/applicationinsights-channel-js.min.js +2 -2
  5. package/browser/applicationinsights-channel-js.min.js.map +1 -1
  6. package/dist/applicationinsights-channel-js.api.md +1 -0
  7. package/dist/applicationinsights-channel-js.d.ts +7 -1
  8. package/dist/applicationinsights-channel-js.js +15 -9
  9. package/dist/applicationinsights-channel-js.js.map +1 -1
  10. package/dist/applicationinsights-channel-js.min.js +2 -2
  11. package/dist/applicationinsights-channel-js.min.js.map +1 -1
  12. package/dist/applicationinsights-channel-js.rollup.d.ts +7 -1
  13. package/dist-esm/EnvelopeCreator.js +2 -2
  14. package/dist-esm/EnvelopeCreator.js.map +1 -1
  15. package/dist-esm/Interfaces.js +1 -1
  16. package/dist-esm/InternalConstants.js +1 -1
  17. package/dist-esm/Offline.js +1 -1
  18. package/dist-esm/SendBuffer.js +6 -5
  19. package/dist-esm/SendBuffer.js.map +1 -1
  20. package/dist-esm/Sender.js +8 -4
  21. package/dist-esm/Sender.js.map +1 -1
  22. package/dist-esm/Serializer.js +1 -1
  23. package/dist-esm/TelemetryProcessors/Sample.js +1 -1
  24. package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js +1 -1
  25. package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js +1 -1
  26. package/dist-esm/__DynamicConstants.js +3 -2
  27. package/dist-esm/__DynamicConstants.js.map +1 -1
  28. package/dist-esm/applicationinsights-channel-js.js +1 -1
  29. package/package.json +58 -61
  30. package/src/Interfaces.ts +8 -0
  31. package/src/SendBuffer.ts +4 -3
  32. package/src/Sender.ts +6 -2
  33. package/src/__DynamicConstants.ts +2 -1
  34. package/types/Interfaces.d.ts +6 -0
  35. package/types/__DynamicConstants.d.ts +2 -1
package/src/Sender.ts CHANGED
@@ -52,6 +52,7 @@ function _getDefaultAppInsightsChannelConfig(): ISenderConfig {
52
52
  maxBatchSizeInBytes: () => 102400, // 100kb
53
53
  disableTelemetry: () => false,
54
54
  enableSessionStorageBuffer: () => true,
55
+ bufferOverride: () => false,
55
56
  isRetryDisabled: () => false,
56
57
  isBeaconApiDisabled: () => true,
57
58
  disableXhr: () => false,
@@ -231,8 +232,11 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
231
232
  }
232
233
  });
233
234
 
234
- _self._buffer = (_self._senderConfig.enableSessionStorageBuffer() && utlCanUseSessionStorage())
235
- ? new SessionStorageSendBuffer(diagLog, _self._senderConfig) : new ArraySendBuffer(diagLog, _self._senderConfig);
235
+ const useSessionStorage = _self._senderConfig.enableSessionStorageBuffer() &&
236
+ !!(_self._senderConfig.bufferOverride() || utlCanUseSessionStorage())
237
+ _self._buffer = useSessionStorage
238
+ ? new SessionStorageSendBuffer(diagLog, _self._senderConfig)
239
+ : new ArraySendBuffer(diagLog, _self._senderConfig);
236
240
  _self._sample = new Sample(_self._senderConfig.samplingPercentage(), diagLog);
237
241
 
238
242
  if(!_validateInstrumentationKey(config)) {
@@ -31,6 +31,7 @@ export const _DYN_CLEAR = "clear"; // Count: 6
31
31
  export const _DYN_BATCH_PAYLOADS = "batchPayloads"; // Count: 5
32
32
  export const _DYN_MARK_AS_SENT = "markAsSent"; // Count: 6
33
33
  export const _DYN_CLEAR_SENT = "clearSent"; // Count: 5
34
+ export const _DYN_BUFFER_OVERRIDE = "bufferOverride"; // Count: 3
34
35
  export const _DYN__BUFFER__KEY = "BUFFER_KEY"; // Count: 5
35
36
  export const _DYN__SENT__BUFFER__KEY = "SENT_BUFFER_KEY"; // Count: 7
36
37
  export const _DYN__MAX__BUFFER__SIZE = "MAX_BUFFER_SIZE"; // Count: 5
@@ -42,8 +43,8 @@ export const _DYN_ONUNLOAD_DISABLE_BEA2 = "onunloadDisableBeacon"; // Count: 2
42
43
  export const _DYN_IS_BEACON_API_DISABL3 = "isBeaconApiDisabled"; // Count: 3
43
44
  export const _DYN__SENDER = "_sender"; // Count: 5
44
45
  export const _DYN__SENDER_CONFIG = "_senderConfig"; // Count: 4
45
- export const _DYN__BUFFER = "_buffer"; // Count: 7
46
46
  export const _DYN_ENABLE_SESSION_STORA4 = "enableSessionStorageBuffer"; // Count: 2
47
+ export const _DYN__BUFFER = "_buffer"; // Count: 7
47
48
  export const _DYN_SAMPLING_PERCENTAGE = "samplingPercentage"; // Count: 2
48
49
  export const _DYN_INSTRUMENTATION_KEY = "instrumentationKey"; // Count: 4
49
50
  export const _DYN_ENDPOINT_URL = "endpointUrl"; // Count: 8
@@ -1,3 +1,4 @@
1
+ import { IStorageBuffer } from "@microsoft/applicationinsights-common";
1
2
  export interface ISenderConfig {
2
3
  /**
3
4
  * The url to which payloads will be sent
@@ -23,6 +24,11 @@ export interface ISenderConfig {
23
24
  * Store a copy of a send buffer in the session storage
24
25
  */
25
26
  enableSessionStorageBuffer: () => boolean;
27
+ /**
28
+ * Specify the storage buffer type implementation.
29
+ * @since 2.8.12
30
+ */
31
+ bufferOverride: () => IStorageBuffer | false;
26
32
  /**
27
33
  * Is retry handler disabled.
28
34
  * If enabled, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error) and 503 (service unavailable).
@@ -19,6 +19,7 @@ export declare const _DYN_CLEAR = "clear";
19
19
  export declare const _DYN_BATCH_PAYLOADS = "batchPayloads";
20
20
  export declare const _DYN_MARK_AS_SENT = "markAsSent";
21
21
  export declare const _DYN_CLEAR_SENT = "clearSent";
22
+ export declare const _DYN_BUFFER_OVERRIDE = "bufferOverride";
22
23
  export declare const _DYN__BUFFER__KEY = "BUFFER_KEY";
23
24
  export declare const _DYN__SENT__BUFFER__KEY = "SENT_BUFFER_KEY";
24
25
  export declare const _DYN__MAX__BUFFER__SIZE = "MAX_BUFFER_SIZE";
@@ -30,8 +31,8 @@ export declare const _DYN_ONUNLOAD_DISABLE_BEA2 = "onunloadDisableBeacon";
30
31
  export declare const _DYN_IS_BEACON_API_DISABL3 = "isBeaconApiDisabled";
31
32
  export declare const _DYN__SENDER = "_sender";
32
33
  export declare const _DYN__SENDER_CONFIG = "_senderConfig";
33
- export declare const _DYN__BUFFER = "_buffer";
34
34
  export declare const _DYN_ENABLE_SESSION_STORA4 = "enableSessionStorageBuffer";
35
+ export declare const _DYN__BUFFER = "_buffer";
35
36
  export declare const _DYN_SAMPLING_PERCENTAGE = "samplingPercentage";
36
37
  export declare const _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
37
38
  export declare const _DYN_ENDPOINT_URL = "endpointUrl";