@microsoft/1ds-post-js 3.1.9 → 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.
- package/README.md +124 -5
- package/bundle/{ms.post-3.1.9.gbl.js → ms.post-3.2.0.gbl.js} +1706 -825
- package/bundle/ms.post-3.2.0.gbl.js.map +1 -0
- package/bundle/ms.post-3.2.0.gbl.min.js +7 -0
- package/bundle/ms.post-3.2.0.gbl.min.js.map +1 -0
- package/bundle/ms.post-3.2.0.integrity.json +46 -0
- package/bundle/{ms.post-3.1.9.js → ms.post-3.2.0.js} +1706 -825
- package/bundle/ms.post-3.2.0.js.map +1 -0
- package/bundle/ms.post-3.2.0.min.js +7 -0
- package/bundle/ms.post-3.2.0.min.js.map +1 -0
- package/bundle/ms.post.gbl.js +1705 -824
- package/bundle/ms.post.gbl.js.map +1 -1
- package/bundle/ms.post.gbl.min.js +2 -2
- package/bundle/ms.post.gbl.min.js.map +1 -1
- package/bundle/ms.post.integrity.json +17 -17
- package/bundle/ms.post.js +1705 -824
- package/bundle/ms.post.js.map +1 -1
- package/bundle/ms.post.min.js +2 -2
- package/bundle/ms.post.min.js.map +1 -1
- package/dist/ms.post.js +395 -212
- package/dist/ms.post.js.map +1 -1
- package/dist/ms.post.min.js +2 -2
- package/dist/ms.post.min.js.map +1 -1
- package/dist-esm/src/BatchNotificationActions.js +1 -1
- package/dist-esm/src/ClockSkewManager.js +1 -1
- package/dist-esm/src/Constants.d.ts +25 -0
- package/dist-esm/src/Constants.js +31 -0
- package/dist-esm/src/Constants.js.map +1 -0
- package/dist-esm/src/DataModels.d.ts +55 -0
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/EventBatch.d.ts +5 -2
- package/dist-esm/src/EventBatch.js +35 -15
- package/dist-esm/src/EventBatch.js.map +1 -1
- package/dist-esm/src/HttpManager.d.ts +2 -2
- package/dist-esm/src/HttpManager.js +186 -94
- package/dist-esm/src/HttpManager.js.map +1 -1
- package/dist-esm/src/Index.js +1 -1
- package/dist-esm/src/KillSwitch.js +1 -1
- package/dist-esm/src/PostChannel.d.ts +0 -4
- package/dist-esm/src/PostChannel.js +175 -107
- package/dist-esm/src/PostChannel.js.map +1 -1
- package/dist-esm/src/RetryPolicy.d.ts +20 -25
- package/dist-esm/src/RetryPolicy.js +35 -44
- package/dist-esm/src/RetryPolicy.js.map +1 -1
- package/dist-esm/src/Serializer.js +1 -1
- package/dist-esm/src/typings/XDomainRequest.js +1 -1
- package/package.json +3 -3
- package/src/Constants.ts +28 -0
- package/src/DataModels.ts +68 -0
- package/src/EventBatch.ts +47 -14
- package/src/HttpManager.ts +216 -98
- package/src/PostChannel.ts +207 -130
- package/src/RetryPolicy.ts +33 -38
- package/bundle/ms.post-3.1.9.gbl.js.map +0 -1
- package/bundle/ms.post-3.1.9.gbl.min.js +0 -7
- package/bundle/ms.post-3.1.9.gbl.min.js.map +0 -1
- package/bundle/ms.post-3.1.9.integrity.json +0 -46
- package/bundle/ms.post-3.1.9.js.map +0 -1
- package/bundle/ms.post-3.1.9.min.js +0 -7
- package/bundle/ms.post-3.1.9.min.js.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const Method = "POST";
|
|
2
|
+
export declare const DisabledPropertyName: string;
|
|
3
|
+
export declare const strDropped = "drop";
|
|
4
|
+
export declare const strSending = "send";
|
|
5
|
+
export declare const strRequeue = "requeue";
|
|
6
|
+
export declare const strResponseFail = "rspFail";
|
|
7
|
+
export declare const strOther = "oth";
|
|
8
|
+
export declare const defaultCacheControl = "no-cache, no-store";
|
|
9
|
+
export declare const defaultContentType = "application/x-json-stream";
|
|
10
|
+
export declare const strCacheControl = "cache-control";
|
|
11
|
+
export declare const strContentTypeHeader = "content-type";
|
|
12
|
+
export declare const strKillTokensHeader = "kill-tokens";
|
|
13
|
+
export declare const strKillDurationHeader = "kill-duration";
|
|
14
|
+
export declare const strKillDurationSecondsHeader = "kill-duration-seconds";
|
|
15
|
+
export declare const strTimeDeltaHeader = "time-delta-millis";
|
|
16
|
+
export declare const strClientVersion = "client-version";
|
|
17
|
+
export declare const strClientId = "client-id";
|
|
18
|
+
export declare const strTimeDeltaToApply = "time-delta-to-apply-millis";
|
|
19
|
+
export declare const strUploadTime = "upload-time";
|
|
20
|
+
export declare const strApiKey = "apikey";
|
|
21
|
+
export declare const strMsaDeviceTicket = "AuthMsaDeviceTicket";
|
|
22
|
+
export declare const strAuthXToken = "AuthXToken";
|
|
23
|
+
export declare const strSdkVersion = "sdk-version";
|
|
24
|
+
export declare const strNoResponseBody = "NoResponseBody";
|
|
25
|
+
export declare const strMsfpc = "msfpc";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK POST plugin, 3.2.0
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
export var Method = "POST";
|
|
7
|
+
export var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
8
|
+
export var strDropped = "drop";
|
|
9
|
+
export var strSending = "send";
|
|
10
|
+
export var strRequeue = "requeue";
|
|
11
|
+
export var strResponseFail = "rspFail";
|
|
12
|
+
export var strOther = "oth";
|
|
13
|
+
export var defaultCacheControl = "no-cache, no-store";
|
|
14
|
+
export var defaultContentType = "application/x-json-stream";
|
|
15
|
+
export var strCacheControl = "cache-control";
|
|
16
|
+
export var strContentTypeHeader = "content-type";
|
|
17
|
+
export var strKillTokensHeader = "kill-tokens";
|
|
18
|
+
export var strKillDurationHeader = "kill-duration";
|
|
19
|
+
export var strKillDurationSecondsHeader = "kill-duration-seconds";
|
|
20
|
+
export var strTimeDeltaHeader = "time-delta-millis";
|
|
21
|
+
export var strClientVersion = "client-version";
|
|
22
|
+
export var strClientId = "client-id";
|
|
23
|
+
export var strTimeDeltaToApply = "time-delta-to-apply-millis";
|
|
24
|
+
export var strUploadTime = "upload-time";
|
|
25
|
+
export var strApiKey = "apikey";
|
|
26
|
+
export var strMsaDeviceTicket = "AuthMsaDeviceTicket";
|
|
27
|
+
export var strAuthXToken = "AuthXToken";
|
|
28
|
+
export var strSdkVersion = "sdk-version";
|
|
29
|
+
export var strNoResponseBody = "NoResponseBody";
|
|
30
|
+
export var strMsfpc = "msfpc";
|
|
31
|
+
//# sourceMappingURL=Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.js.map","sources":["Constants.js"],"sourcesContent":["export var Method = \"POST\";\r\nexport var DisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nexport var strDropped = \"drop\";\r\nexport var strSending = \"send\";\r\nexport var strRequeue = \"requeue\";\r\nexport var strResponseFail = \"rspFail\";\r\nexport var strOther = \"oth\";\r\nexport var defaultCacheControl = \"no-cache, no-store\";\r\nexport var defaultContentType = \"application/x-json-stream\";\r\nexport var strCacheControl = \"cache-control\";\r\nexport var strContentTypeHeader = \"content-type\";\r\nexport var strKillTokensHeader = \"kill-tokens\";\r\nexport var strKillDurationHeader = \"kill-duration\";\r\nexport var strKillDurationSecondsHeader = \"kill-duration-seconds\";\r\nexport var strTimeDeltaHeader = \"time-delta-millis\";\r\nexport var strClientVersion = \"client-version\";\r\nexport var strClientId = \"client-id\";\r\nexport var strTimeDeltaToApply = \"time-delta-to-apply-millis\";\r\nexport var strUploadTime = \"upload-time\";\r\nexport var strApiKey = \"apikey\";\r\nexport var strMsaDeviceTicket = \"AuthMsaDeviceTicket\";\r\nexport var strAuthXToken = \"AuthXToken\";\r\nexport var strSdkVersion = \"sdk-version\";\r\nexport var strNoResponseBody = \"NoResponseBody\";\r\nexport var strMsfpc = \"msfpc\";\r\n//# sourceMappingURL=Constants.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -12,6 +12,8 @@ export interface IPayloadData {
|
|
|
12
12
|
headers?: {
|
|
13
13
|
[name: string]: string;
|
|
14
14
|
};
|
|
15
|
+
timeout?: number;
|
|
16
|
+
disableXhrSync?: boolean;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* Defines the function signature for the Payload Preprocessor.
|
|
@@ -60,6 +62,10 @@ export interface IChannelConfiguration {
|
|
|
60
62
|
disableAutoBatchFlushLimit?: boolean;
|
|
61
63
|
/**
|
|
62
64
|
* [Optional] The HTTP override that should be used to send requests, as an IXHROverride object.
|
|
65
|
+
* By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive),
|
|
66
|
+
* this override will NOT be called. You can now change this behavior by enabling the 'alwaysUseXhrOverride' configuration value.
|
|
67
|
+
* The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid
|
|
68
|
+
* creating any synchronous XHR requests 'disableXhrSync' (defaults to false/undefined)
|
|
63
69
|
*/
|
|
64
70
|
httpXHROverride?: IXHROverride;
|
|
65
71
|
/**
|
|
@@ -132,6 +138,55 @@ export interface IChannelConfiguration {
|
|
|
132
138
|
* This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided.
|
|
133
139
|
*/
|
|
134
140
|
transports?: number | number[];
|
|
141
|
+
/**
|
|
142
|
+
* [Optional] Avoid adding request headers to the outgoing request that would cause a pre-flight (OPTIONS) request to be sent for each request.
|
|
143
|
+
* This currently defaults to true but will be changed once the collector handles additional settings to allow the browser to better cache any
|
|
144
|
+
* previous OPTIONS response, at which point some of the current dynamic values sent on the query string will be moved to a header.
|
|
145
|
+
*/
|
|
146
|
+
avoidOptions?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* [Optional] Specify a timeout (in ms) to apply to requests when sending requests using XHR, XDR or fetch requests. Defaults to undefined
|
|
149
|
+
* and therefore the runtime defaults (normally zero for browser environments)
|
|
150
|
+
*/
|
|
151
|
+
xhrTimeout?: number;
|
|
152
|
+
/**
|
|
153
|
+
* [Optional] When using Xhr for sending requests disable sending as synchronous during unload or synchronous flush.
|
|
154
|
+
* You should enable this feature for IE (when there is no sendBeacon() or fetch (with keep-alive)) and you have clients
|
|
155
|
+
* that end up blocking the UI during page unloading. This will cause ALL XHR requests to be sent asynchronously which
|
|
156
|
+
* during page unload may result in the lose of telemetry.
|
|
157
|
+
*/
|
|
158
|
+
disableXhrSync?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* [Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK
|
|
161
|
+
* ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available.
|
|
162
|
+
* When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will
|
|
163
|
+
* also need to "handle" the synchronous unload scenario.
|
|
164
|
+
*/
|
|
165
|
+
alwaysUseXhrOverride?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* [Optional] Identifies the number of times any single event will be retried if it receives a failed (retirable) response, this
|
|
168
|
+
* causes the event to be internally "requeued" and resent in the next batch. As each normal batched send request is retried at
|
|
169
|
+
* least once before starting to increase the internal backoff send interval, normally batched events will generally be attempted
|
|
170
|
+
* the next nearest even number of times. This means that the total number of actual send attempts will almost always be even
|
|
171
|
+
* (setting to 5 will cause 6 requests), unless using manual synchronous flushing (calling flush(false)) which is not subject to
|
|
172
|
+
* request level retry attempts.
|
|
173
|
+
* Defaults to 6 times.
|
|
174
|
+
*/
|
|
175
|
+
maxEventRetryAttempts?: number;
|
|
176
|
+
/**
|
|
177
|
+
* [Optional] Identifies the number of times any single event will be retried if it receives a failed (retriable) response as part
|
|
178
|
+
* of processing / flushing events once a page unload state has been detected, this causes the event to be internally "requeued"
|
|
179
|
+
* and resent in the next batch, which during page unload. Unlike the normal batching process, send requests are never retried,
|
|
180
|
+
* so the value listed here is always the maximum number of attempts for any single event.
|
|
181
|
+
* Defaults to 2 times.
|
|
182
|
+
* Notes:
|
|
183
|
+
* The SDK by default will use the sendBeacon() API if it exists which is treated as a fire and forget successful response, so for
|
|
184
|
+
* environments that support or supply this API the events won't be retried (because they will be deeded to be successfully sent).
|
|
185
|
+
* When an environment (IE) doesn't support sendBeacon(), this will cause multiple synchronous (by default) XMLHttpRequests to be sent,
|
|
186
|
+
* which will block the UI until a response is received. You can disable ALL synchronous XHR requests by setting the 'disableXhrSync'
|
|
187
|
+
* configuration setting and/or changing this value to 0 or 1.
|
|
188
|
+
*/
|
|
189
|
+
maxUnloadEventRetryAttempts?: number;
|
|
135
190
|
}
|
|
136
191
|
/**
|
|
137
192
|
* SendPOSTFunction type defines how an HTTP POST request is sent to an ingestion server
|
|
@@ -20,6 +20,10 @@ export declare class EventBatch {
|
|
|
20
20
|
* Returns the iKey associated with this batch of events
|
|
21
21
|
*/
|
|
22
22
|
iKey: () => string;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the first msfpc value from the batch
|
|
25
|
+
*/
|
|
26
|
+
Msfpc: () => string;
|
|
23
27
|
/**
|
|
24
28
|
* Returns the number of events contained in the batch
|
|
25
29
|
*/
|
|
@@ -29,10 +33,9 @@ export declare class EventBatch {
|
|
|
29
33
|
* Add all of the events to the current batch, if the max number of events would be exceeded then no
|
|
30
34
|
* events are added.
|
|
31
35
|
* @param theEvents - The events that needs to be batched.
|
|
32
|
-
* @param append - True (default) add the event to the end of the queue otherwise prepend (used for re-queuing)
|
|
33
36
|
* @returns The number of events added.
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
addEvent: (theEvents: IPostTransmissionTelemetryItem) => boolean;
|
|
36
39
|
/**
|
|
37
40
|
* Split this batch into 2 with any events > fromEvent returned in the new batch and all other
|
|
38
41
|
* events are kept in the current batch.
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* 1DS JS SDK POST plugin, 3.
|
|
2
|
+
* 1DS JS SDK POST plugin, 3.2.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
6
|
-
import { isNullOrUndefined } from "@microsoft/1ds-core-js";
|
|
6
|
+
import { isNullOrUndefined, isValueAssigned } from "@microsoft/1ds-core-js";
|
|
7
|
+
import { strMsfpc } from "./Constants";
|
|
8
|
+
function _getEventMsfpc(theEvent) {
|
|
9
|
+
var intWeb = ((theEvent.ext || {})["intweb"]);
|
|
10
|
+
if (intWeb && isValueAssigned(intWeb[strMsfpc])) {
|
|
11
|
+
return intWeb[strMsfpc];
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
function _getMsfpc(theEvents) {
|
|
16
|
+
var msfpc = null;
|
|
17
|
+
for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) {
|
|
18
|
+
msfpc = _getEventMsfpc(theEvents[lp]);
|
|
19
|
+
}
|
|
20
|
+
return msfpc;
|
|
21
|
+
}
|
|
7
22
|
/**
|
|
8
23
|
* This class defines a "batch" events related to a specific iKey, it is used by the PostChannel and HttpManager
|
|
9
24
|
* to collect and transfer ownership of events without duplicating them in-memory. This reduces the previous
|
|
@@ -19,39 +34,44 @@ var EventBatch = /** @class */ (function () {
|
|
|
19
34
|
function EventBatch(iKey, addEvents) {
|
|
20
35
|
var events = addEvents ? [].concat(addEvents) : [];
|
|
21
36
|
var _self = this;
|
|
37
|
+
var _msfpc = _getMsfpc(events);
|
|
22
38
|
_self.iKey = function () {
|
|
23
39
|
return iKey;
|
|
24
40
|
};
|
|
41
|
+
_self.Msfpc = function () {
|
|
42
|
+
// return the cached value unless it's undefined -- used to avoid cpu
|
|
43
|
+
return _msfpc || "";
|
|
44
|
+
};
|
|
25
45
|
_self.count = function () {
|
|
26
46
|
return events.length;
|
|
27
47
|
};
|
|
28
48
|
_self.events = function () {
|
|
29
49
|
return events;
|
|
30
50
|
};
|
|
31
|
-
_self.
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
else {
|
|
38
|
-
events = theEvents.concat(events);
|
|
51
|
+
_self.addEvent = function (theEvent) {
|
|
52
|
+
if (theEvent) {
|
|
53
|
+
events.push(theEvent);
|
|
54
|
+
if (!_msfpc) {
|
|
55
|
+
// Not found so try and find one
|
|
56
|
+
_msfpc = _getEventMsfpc(theEvent);
|
|
39
57
|
}
|
|
40
|
-
return
|
|
58
|
+
return true;
|
|
41
59
|
}
|
|
42
|
-
return
|
|
60
|
+
return false;
|
|
43
61
|
};
|
|
44
62
|
_self.split = function (fromEvent, numEvents) {
|
|
45
63
|
// Create a new batch with the same iKey
|
|
46
|
-
var
|
|
64
|
+
var theEvents;
|
|
47
65
|
if (fromEvent < events.length) {
|
|
48
66
|
var cnt = events.length - fromEvent;
|
|
49
67
|
if (!isNullOrUndefined(numEvents)) {
|
|
50
68
|
cnt = numEvents < cnt ? numEvents : cnt;
|
|
51
69
|
}
|
|
52
|
-
|
|
70
|
+
theEvents = events.splice(fromEvent, cnt);
|
|
71
|
+
// reset the fetched msfpc value
|
|
72
|
+
_msfpc = _getMsfpc(events);
|
|
53
73
|
}
|
|
54
|
-
return
|
|
74
|
+
return new EventBatch(iKey, theEvents);
|
|
55
75
|
};
|
|
56
76
|
}
|
|
57
77
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventBatch.js.map","sources":["EventBatch.js"],"sourcesContent":["import { isNullOrUndefined } from \"@microsoft/1ds-core-js\";\r\n/**\r\n* This class defines a \"batch\" events related to a specific iKey, it is used by the PostChannel and HttpManager\r\n* to collect and transfer ownership of events without duplicating them in-memory. This reduces the previous\r\n* array duplication and shared ownership issues that occurred due to race conditions caused by the async nature\r\n* of sending requests.\r\n*/\r\nvar EventBatch = /** @class */ (function () {\r\n /**\r\n * Private constructor so that caller is forced to use the static create method.\r\n * @param iKey - The iKey to associate with the events (not validated)\r\n * @param addEvents - The optional collection of events to assign to this batch - defaults to an empty array.\r\n */\r\n function EventBatch(iKey, addEvents) {\r\n var events = addEvents ? [].concat(addEvents) : [];\r\n var _self = this;\r\n _self.iKey = function () {\r\n return iKey;\r\n };\r\n _self.
|
|
1
|
+
{"version":3,"file":"EventBatch.js.map","sources":["EventBatch.js"],"sourcesContent":["import { isNullOrUndefined, isValueAssigned } from \"@microsoft/1ds-core-js\";\r\nimport { strMsfpc } from \"./Constants\";\r\nfunction _getEventMsfpc(theEvent) {\r\n var intWeb = ((theEvent.ext || {})[\"intweb\"]);\r\n if (intWeb && isValueAssigned(intWeb[strMsfpc])) {\r\n return intWeb[strMsfpc];\r\n }\r\n return null;\r\n}\r\nfunction _getMsfpc(theEvents) {\r\n var msfpc = null;\r\n for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) {\r\n msfpc = _getEventMsfpc(theEvents[lp]);\r\n }\r\n return msfpc;\r\n}\r\n/**\r\n* This class defines a \"batch\" events related to a specific iKey, it is used by the PostChannel and HttpManager\r\n* to collect and transfer ownership of events without duplicating them in-memory. This reduces the previous\r\n* array duplication and shared ownership issues that occurred due to race conditions caused by the async nature\r\n* of sending requests.\r\n*/\r\nvar EventBatch = /** @class */ (function () {\r\n /**\r\n * Private constructor so that caller is forced to use the static create method.\r\n * @param iKey - The iKey to associate with the events (not validated)\r\n * @param addEvents - The optional collection of events to assign to this batch - defaults to an empty array.\r\n */\r\n function EventBatch(iKey, addEvents) {\r\n var events = addEvents ? [].concat(addEvents) : [];\r\n var _self = this;\r\n var _msfpc = _getMsfpc(events);\r\n _self.iKey = function () {\r\n return iKey;\r\n };\r\n _self.Msfpc = function () {\r\n // return the cached value unless it's undefined -- used to avoid cpu\r\n return _msfpc || \"\";\r\n };\r\n _self.count = function () {\r\n return events.length;\r\n };\r\n _self.events = function () {\r\n return events;\r\n };\r\n _self.addEvent = function (theEvent) {\r\n if (theEvent) {\r\n events.push(theEvent);\r\n if (!_msfpc) {\r\n // Not found so try and find one\r\n _msfpc = _getEventMsfpc(theEvent);\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n _self.split = function (fromEvent, numEvents) {\r\n // Create a new batch with the same iKey\r\n var theEvents;\r\n if (fromEvent < events.length) {\r\n var cnt = events.length - fromEvent;\r\n if (!isNullOrUndefined(numEvents)) {\r\n cnt = numEvents < cnt ? numEvents : cnt;\r\n }\r\n theEvents = events.splice(fromEvent, cnt);\r\n // reset the fetched msfpc value\r\n _msfpc = _getMsfpc(events);\r\n }\r\n return new EventBatch(iKey, theEvents);\r\n };\r\n }\r\n /**\r\n * Creates a new Event Batch object\r\n * @param iKey The iKey associated with this batch of events\r\n */\r\n EventBatch.create = function (iKey, theEvents) {\r\n return new EventBatch(iKey, theEvents);\r\n };\r\n return EventBatch;\r\n}());\r\nexport { EventBatch };\r\n//# sourceMappingURL=EventBatch.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -11,7 +11,7 @@ import { IChannelConfiguration } from "./Index";
|
|
|
11
11
|
/**
|
|
12
12
|
* Class managing the sending of requests.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare class HttpManager {
|
|
15
15
|
sendHook: PayloadPreprocessorFunction | undefined;
|
|
16
16
|
sendListener: PayloadListenerFunction | undefined;
|
|
17
17
|
_responseHandlers: Array<(responseText: string) => void>;
|
|
@@ -19,7 +19,7 @@ export default class HttpManager {
|
|
|
19
19
|
* @constructor
|
|
20
20
|
* @param requestQueue - The queue that contains the requests to be sent.
|
|
21
21
|
*/
|
|
22
|
-
constructor(maxEventsPerBatch: number, maxConnections: number,
|
|
22
|
+
constructor(maxEventsPerBatch: number, maxConnections: number, maxRequestRetriesBeforeBackoff: number, actions: BatchNotificationActions);
|
|
23
23
|
/**
|
|
24
24
|
* @constructor
|
|
25
25
|
* @param requestQueue - The queue that contains the requests to be sent.
|