@microsoft/1ds-post-js 3.2.2 → 3.2.5
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/CODE_OF_CONDUCT.md +9 -0
- package/CONTRIBUTING.md +14 -0
- package/LICENSE.TXT +3 -3
- package/NOTICE +17 -0
- package/PRIVACY +3 -0
- package/README.md +16 -2
- package/SECURITY.md +41 -0
- package/SUPPORT.md +14 -0
- package/bundle/{ms.post-3.2.2.gbl.js → ms.post-3.2.5.gbl.js} +933 -858
- package/bundle/ms.post-3.2.5.gbl.js.map +1 -0
- package/bundle/ms.post-3.2.5.gbl.min.js +7 -0
- package/bundle/ms.post-3.2.5.gbl.min.js.map +1 -0
- package/bundle/ms.post-3.2.5.integrity.json +46 -0
- package/bundle/{ms.post-3.2.2.js → ms.post-3.2.5.js} +933 -858
- package/bundle/ms.post-3.2.5.js.map +1 -0
- package/bundle/ms.post-3.2.5.min.js +7 -0
- package/bundle/ms.post-3.2.5.min.js.map +1 -0
- package/bundle/ms.post.gbl.js +932 -857
- 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 +932 -857
- 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 +213 -197
- 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 +6 -1
- package/dist-esm/src/ClockSkewManager.js.map +1 -1
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/EventBatch.d.ts +0 -5
- package/dist-esm/src/EventBatch.js +9 -4
- package/dist-esm/src/EventBatch.js.map +1 -1
- package/dist-esm/src/HttpManager.d.ts +2 -7
- package/dist-esm/src/HttpManager.js +116 -108
- package/dist-esm/src/HttpManager.js.map +1 -1
- package/dist-esm/src/Index.js +1 -1
- package/dist-esm/src/InternalConstants.d.ts +27 -0
- package/dist-esm/src/InternalConstants.js +40 -0
- package/dist-esm/src/InternalConstants.js.map +1 -0
- package/dist-esm/src/KillSwitch.js +7 -2
- package/dist-esm/src/KillSwitch.js.map +1 -1
- package/dist-esm/src/PostChannel.d.ts +1 -1
- package/dist-esm/src/PostChannel.js +79 -65
- package/dist-esm/src/PostChannel.js.map +1 -1
- package/dist-esm/src/RetryPolicy.js +1 -1
- package/dist-esm/src/Serializer.d.ts +1 -1
- package/dist-esm/src/Serializer.js +9 -3
- package/dist-esm/src/Serializer.js.map +1 -1
- package/dist-esm/src/TimeoutOverrideWrapper.d.ts +5 -5
- package/dist-esm/src/TimeoutOverrideWrapper.js +6 -6
- package/dist-esm/src/TimeoutOverrideWrapper.js.map +1 -1
- package/dist-esm/src/typings/XDomainRequest.js +1 -1
- package/package.json +4 -2
- package/src/EventBatch.ts +4 -4
- package/src/HttpManager.ts +70 -68
- package/src/InternalConstants.ts +41 -0
- package/src/KillSwitch.ts +1 -1
- package/src/PostChannel.ts +45 -36
- package/src/Serializer.ts +7 -5
- package/src/TimeoutOverrideWrapper.ts +6 -6
- package/bundle/ms.post-3.2.2.gbl.js.map +0 -1
- package/bundle/ms.post-3.2.2.gbl.min.js +0 -7
- package/bundle/ms.post-3.2.2.gbl.min.js.map +0 -1
- package/bundle/ms.post-3.2.2.integrity.json +0 -46
- package/bundle/ms.post-3.2.2.js.map +0 -1
- package/bundle/ms.post-3.2.2.min.js +0 -7
- package/bundle/ms.post-3.2.2.min.js.map +0 -1
- package/dist-esm/src/Constants.d.ts +0 -25
- package/dist-esm/src/Constants.js +0 -31
- package/dist-esm/src/Constants.js.map +0 -1
- package/src/Constants.ts +0 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* 1DS JS SDK POST plugin, 3.2.
|
|
2
|
+
* 1DS JS SDK POST plugin, 3.2.5
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -81,6 +81,11 @@ var ClockSkewManager = /** @class */ (function () {
|
|
|
81
81
|
// Removed Stub for ClockSkewManager.prototype.shouldAddClockSkewHeaders.
|
|
82
82
|
// Removed Stub for ClockSkewManager.prototype.getClockSkewHeaderValue.
|
|
83
83
|
// Removed Stub for ClockSkewManager.prototype.setClockSkew.
|
|
84
|
+
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
|
85
|
+
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
|
86
|
+
// this will be removed when ES3 support is dropped.
|
|
87
|
+
ClockSkewManager.__ieDyn=1;
|
|
88
|
+
|
|
84
89
|
return ClockSkewManager;
|
|
85
90
|
}());
|
|
86
91
|
export default ClockSkewManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClockSkewManager.js.map","sources":["ClockSkewManager.js"],"sourcesContent":["/**\r\n* ClockSkewManager.ts\r\n* @author Abhilash Panwar (abpanwar)\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/**\r\n* Class to manage clock skew correction.\r\n*/\r\nvar ClockSkewManager = /** @class */ (function () {\r\n function ClockSkewManager() {\r\n var _allowRequestSending = true;\r\n var _shouldAddClockSkewHeaders = true;\r\n var _isFirstRequest = true;\r\n var _clockSkewHeaderValue = \"use-collector-delta\";\r\n var _clockSkewSet = false;\r\n dynamicProto(ClockSkewManager, this, function (_self) {\r\n /**\r\n * Determine if requests can be sent.\r\n * @returns True if requests can be sent, false otherwise.\r\n */\r\n _self.allowRequestSending = function () {\r\n return _allowRequestSending;\r\n };\r\n /**\r\n * Tells the ClockSkewManager that it should assume that the first request has now been sent,\r\n * If this method had not yet been called AND the clock Skew had not been set this will set\r\n * allowRequestSending to false until setClockSet() is called.\r\n */\r\n _self.firstRequestSent = function () {\r\n if (_isFirstRequest) {\r\n _isFirstRequest = false;\r\n if (!_clockSkewSet) {\r\n // Block sending until we get the first clock Skew\r\n _allowRequestSending = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Determine if clock skew headers should be added to the request.\r\n * @returns True if clock skew headers should be added, false otherwise.\r\n */\r\n _self.shouldAddClockSkewHeaders = function () {\r\n return _shouldAddClockSkewHeaders;\r\n };\r\n /**\r\n * Gets the clock skew header value.\r\n * @returns The clock skew header value.\r\n */\r\n _self.getClockSkewHeaderValue = function () {\r\n return _clockSkewHeaderValue;\r\n };\r\n /**\r\n * Sets the clock skew header value. Once clock skew is set this method\r\n * is no-op.\r\n * @param timeDeltaInMillis - Time delta to be saved as the clock skew header value.\r\n */\r\n _self.setClockSkew = function (timeDeltaInMillis) {\r\n if (!_clockSkewSet) {\r\n if (timeDeltaInMillis) {\r\n _clockSkewHeaderValue = timeDeltaInMillis;\r\n _shouldAddClockSkewHeaders = true;\r\n _clockSkewSet = true;\r\n }\r\n else {\r\n _shouldAddClockSkewHeaders = false;\r\n }\r\n // Unblock sending\r\n _allowRequestSending = true;\r\n }\r\n };\r\n });\r\n }\r\n /**\r\n * Determine if the request can be sent.\r\n * @returns True if requests can be sent, false otherwise.\r\n */\r\n ClockSkewManager.prototype.allowRequestSending = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * Tells the ClockSkewManager that it should assume that the first request has now been sent,\r\n * If this method had not yet been called AND the clock Skew had not been set this will set\r\n * allowRequestSending to false until setClockSet() is called.\r\n */\r\n ClockSkewManager.prototype.firstRequestSent = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Determine if clock skew headers should be added to the request.\r\n * @returns True if clock skew headers should be added, false otherwise.\r\n */\r\n ClockSkewManager.prototype.shouldAddClockSkewHeaders = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * Gets the clock skew header value.\r\n * @returns The clock skew header value.\r\n */\r\n ClockSkewManager.prototype.getClockSkewHeaderValue = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Sets the clock skew header value. Once clock skew is set this method\r\n * is no-op.\r\n * @param timeDeltaInMillis - Time delta to be saved as the clock skew header value.\r\n */\r\n ClockSkewManager.prototype.setClockSkew = function (timeDeltaInMillis) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n return ClockSkewManager;\r\n}());\r\nexport default ClockSkewManager;\r\n//# sourceMappingURL=ClockSkewManager.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;;;;4DAuCM;
|
|
1
|
+
{"version":3,"file":"ClockSkewManager.js.map","sources":["ClockSkewManager.js"],"sourcesContent":["/**\r\n* ClockSkewManager.ts\r\n* @author Abhilash Panwar (abpanwar)\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\n/**\r\n* Class to manage clock skew correction.\r\n*/\r\nvar ClockSkewManager = /** @class */ (function () {\r\n function ClockSkewManager() {\r\n var _allowRequestSending = true;\r\n var _shouldAddClockSkewHeaders = true;\r\n var _isFirstRequest = true;\r\n var _clockSkewHeaderValue = \"use-collector-delta\";\r\n var _clockSkewSet = false;\r\n dynamicProto(ClockSkewManager, this, function (_self) {\r\n /**\r\n * Determine if requests can be sent.\r\n * @returns True if requests can be sent, false otherwise.\r\n */\r\n _self.allowRequestSending = function () {\r\n return _allowRequestSending;\r\n };\r\n /**\r\n * Tells the ClockSkewManager that it should assume that the first request has now been sent,\r\n * If this method had not yet been called AND the clock Skew had not been set this will set\r\n * allowRequestSending to false until setClockSet() is called.\r\n */\r\n _self.firstRequestSent = function () {\r\n if (_isFirstRequest) {\r\n _isFirstRequest = false;\r\n if (!_clockSkewSet) {\r\n // Block sending until we get the first clock Skew\r\n _allowRequestSending = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Determine if clock skew headers should be added to the request.\r\n * @returns True if clock skew headers should be added, false otherwise.\r\n */\r\n _self.shouldAddClockSkewHeaders = function () {\r\n return _shouldAddClockSkewHeaders;\r\n };\r\n /**\r\n * Gets the clock skew header value.\r\n * @returns The clock skew header value.\r\n */\r\n _self.getClockSkewHeaderValue = function () {\r\n return _clockSkewHeaderValue;\r\n };\r\n /**\r\n * Sets the clock skew header value. Once clock skew is set this method\r\n * is no-op.\r\n * @param timeDeltaInMillis - Time delta to be saved as the clock skew header value.\r\n */\r\n _self.setClockSkew = function (timeDeltaInMillis) {\r\n if (!_clockSkewSet) {\r\n if (timeDeltaInMillis) {\r\n _clockSkewHeaderValue = timeDeltaInMillis;\r\n _shouldAddClockSkewHeaders = true;\r\n _clockSkewSet = true;\r\n }\r\n else {\r\n _shouldAddClockSkewHeaders = false;\r\n }\r\n // Unblock sending\r\n _allowRequestSending = true;\r\n }\r\n };\r\n });\r\n }\r\n /**\r\n * Determine if the request can be sent.\r\n * @returns True if requests can be sent, false otherwise.\r\n */\r\n ClockSkewManager.prototype.allowRequestSending = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * Tells the ClockSkewManager that it should assume that the first request has now been sent,\r\n * If this method had not yet been called AND the clock Skew had not been set this will set\r\n * allowRequestSending to false until setClockSet() is called.\r\n */\r\n ClockSkewManager.prototype.firstRequestSent = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Determine if clock skew headers should be added to the request.\r\n * @returns True if clock skew headers should be added, false otherwise.\r\n */\r\n ClockSkewManager.prototype.shouldAddClockSkewHeaders = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return false;\r\n };\r\n /**\r\n * Gets the clock skew header value.\r\n * @returns The clock skew header value.\r\n */\r\n ClockSkewManager.prototype.getClockSkewHeaderValue = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Sets the clock skew header value. Once clock skew is set this method\r\n * is no-op.\r\n * @param timeDeltaInMillis - Time delta to be saved as the clock skew header value.\r\n */\r\n ClockSkewManager.prototype.setClockSkew = function (timeDeltaInMillis) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n return ClockSkewManager;\r\n}());\r\nexport default ClockSkewManager;\r\n//# sourceMappingURL=ClockSkewManager.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;;;;4DAuCM,CAAC;;;;;;4BACqB;AAC5B;AACA;AACA"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EventBatch.ts
|
|
3
|
-
* @author Nev Wylie (newylie)
|
|
4
|
-
* @copyright Microsoft 2020
|
|
5
|
-
*/
|
|
6
1
|
import { IPostTransmissionTelemetryItem } from "./DataModels";
|
|
7
2
|
/**
|
|
8
3
|
* This class defines a "batch" events related to a specific iKey, it is used by the PostChannel and HttpManager
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* 1DS JS SDK POST plugin, 3.2.
|
|
2
|
+
* 1DS JS SDK POST plugin, 3.2.5
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* EventBatch.ts
|
|
8
|
+
* @author Nev Wylie (newylie)
|
|
9
|
+
* @copyright Microsoft 2020
|
|
10
|
+
*/
|
|
6
11
|
import { isNullOrUndefined, isValueAssigned } from "@microsoft/1ds-core-js";
|
|
7
|
-
import {
|
|
12
|
+
import { STR_MSFPC } from "./InternalConstants";
|
|
8
13
|
function _getEventMsfpc(theEvent) {
|
|
9
14
|
var intWeb = ((theEvent.ext || {})["intweb"]);
|
|
10
|
-
if (intWeb && isValueAssigned(intWeb[
|
|
11
|
-
return intWeb[
|
|
15
|
+
if (intWeb && isValueAssigned(intWeb[STR_MSFPC])) {
|
|
16
|
+
return intWeb[STR_MSFPC];
|
|
12
17
|
}
|
|
13
18
|
return null;
|
|
14
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventBatch.js.map","sources":["EventBatch.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"EventBatch.js.map","sources":["EventBatch.js"],"sourcesContent":["/**\r\n* EventBatch.ts\r\n* @author Nev Wylie (newylie)\r\n* @copyright Microsoft 2020\r\n*/\r\nimport { isNullOrUndefined, isValueAssigned } from \"@microsoft/1ds-core-js\";\r\nimport { STR_MSFPC } from \"./InternalConstants\";\r\nfunction _getEventMsfpc(theEvent) {\r\n var intWeb = ((theEvent.ext || {})[\"intweb\"]);\r\n if (intWeb && isValueAssigned(intWeb[STR_MSFPC])) {\r\n return intWeb[STR_MSFPC];\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;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* HttpManager.ts
|
|
3
|
-
* @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie)
|
|
4
|
-
* @copyright Microsoft 2018-2020
|
|
5
|
-
*/
|
|
6
|
-
import { IExtendedAppInsightsCore, SendRequestReason, EventSendType } from "@microsoft/1ds-core-js";
|
|
7
|
-
import { IXHROverride, IPostChannel, PayloadPreprocessorFunction, PayloadListenerFunction } from "./DataModels";
|
|
1
|
+
import { EventSendType, IExtendedAppInsightsCore, SendRequestReason } from "@microsoft/1ds-core-js";
|
|
8
2
|
import { BatchNotificationActions } from "./BatchNotificationActions";
|
|
3
|
+
import { IPostChannel, IXHROverride, PayloadListenerFunction, PayloadPreprocessorFunction } from "./DataModels";
|
|
9
4
|
import { EventBatch } from "./EventBatch";
|
|
10
5
|
import { IChannelConfiguration } from "./Index";
|
|
11
6
|
import { ITimeoutOverrideWrapper } from "./TimeoutOverrideWrapper";
|