@microsoft/1ds-core-js 3.2.3 → 3.2.6
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 +15 -1
- package/SECURITY.md +41 -0
- package/SUPPORT.md +14 -0
- package/bundle/{ms.core-3.2.3.gbl.js → ms.core-3.2.6.gbl.js} +826 -725
- package/bundle/ms.core-3.2.6.gbl.js.map +1 -0
- package/bundle/ms.core-3.2.6.gbl.min.js +7 -0
- package/bundle/ms.core-3.2.6.gbl.min.js.map +1 -0
- package/bundle/ms.core-3.2.6.integrity.json +46 -0
- package/bundle/{ms.core-3.2.3.js → ms.core-3.2.6.js} +826 -725
- package/bundle/ms.core-3.2.6.js.map +1 -0
- package/bundle/ms.core-3.2.6.min.js +7 -0
- package/bundle/ms.core-3.2.6.min.js.map +1 -0
- package/bundle/ms.core.gbl.js +825 -724
- package/bundle/ms.core.gbl.js.map +1 -1
- package/bundle/ms.core.gbl.min.js +2 -2
- package/bundle/ms.core.gbl.min.js.map +1 -1
- package/bundle/ms.core.integrity.json +17 -17
- package/bundle/ms.core.js +825 -724
- package/bundle/ms.core.js.map +1 -1
- package/bundle/ms.core.min.js +2 -2
- package/bundle/ms.core.min.js.map +1 -1
- package/dist/ms.core.js +36 -35
- package/dist/ms.core.js.map +1 -1
- package/dist/ms.core.min.js +2 -2
- package/dist/ms.core.min.js.map +1 -1
- package/dist-esm/src/AppInsightsCore.d.ts +2 -7
- package/dist-esm/src/AppInsightsCore.js +25 -27
- package/dist-esm/src/AppInsightsCore.js.map +1 -1
- package/dist-esm/src/BaseCore.d.ts +2 -2
- package/dist-esm/src/BaseCore.js +17 -11
- package/dist-esm/src/BaseCore.js.map +1 -1
- package/dist-esm/src/DataModels.d.ts +5 -0
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/ESPromise.d.ts +5 -5
- package/dist-esm/src/ESPromise.js +7 -7
- package/dist-esm/src/ESPromise.js.map +1 -1
- package/dist-esm/src/ESPromiseScheduler.d.ts +4 -4
- package/dist-esm/src/ESPromiseScheduler.js +8 -8
- package/dist-esm/src/ESPromiseScheduler.js.map +1 -1
- package/dist-esm/src/Enums.d.ts +5 -5
- package/dist-esm/src/Enums.js +6 -6
- package/dist-esm/src/Enums.js.map +1 -1
- package/dist-esm/src/Index.d.ts +1 -2
- package/dist-esm/src/Index.js +2 -2
- package/dist-esm/src/Index.js.map +1 -1
- package/dist-esm/src/InternalConstants.d.ts +6 -0
- package/dist-esm/src/InternalConstants.js +19 -0
- package/dist-esm/src/InternalConstants.js.map +1 -0
- package/dist-esm/src/Utils.d.ts +9 -3
- package/dist-esm/src/Utils.js +19 -18
- package/dist-esm/src/Utils.js.map +1 -1
- package/dist-esm/src/ValueSanitizer.d.ts +1 -1
- package/dist-esm/src/ValueSanitizer.js +5 -4
- package/dist-esm/src/ValueSanitizer.js.map +1 -1
- package/package.json +4 -2
- package/src/AppInsightsCore.ts +29 -31
- package/src/BaseCore.ts +14 -11
- package/src/DataModels.ts +6 -0
- package/src/ESPromise.ts +6 -6
- package/src/ESPromiseScheduler.ts +8 -8
- package/src/Enums.ts +5 -5
- package/src/Index.ts +1 -1
- package/src/InternalConstants.ts +16 -0
- package/src/Utils.ts +24 -24
- package/src/ValueSanitizer.ts +5 -4
- package/bundle/ms.core-3.2.3.gbl.js.map +0 -1
- package/bundle/ms.core-3.2.3.gbl.min.js +0 -7
- package/bundle/ms.core-3.2.3.gbl.min.js.map +0 -1
- package/bundle/ms.core-3.2.3.integrity.json +0 -46
- package/bundle/ms.core-3.2.3.js.map +0 -1
- package/bundle/ms.core-3.2.3.min.js +0 -7
- package/bundle/ms.core-3.2.3.min.js.map +0 -1
package/dist/ms.core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* 1DS JS SDK Core, 3.2.
|
|
2
|
+
* 1DS JS SDK Core, 3.2.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -81,8 +81,13 @@
|
|
|
81
81
|
SDKNotInitialized: 520
|
|
82
82
|
})));
|
|
83
83
|
|
|
84
|
+
var STR_EMPTY = "";
|
|
85
|
+
var STR_DEFAULT_ENDPOINT_URL = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
|
|
86
|
+
var STR_VERSION = "version";
|
|
87
|
+
var STR_PROPERTIES = "properties";
|
|
88
|
+
|
|
84
89
|
var _a;
|
|
85
|
-
var Version = '3.2.
|
|
90
|
+
var Version = '3.2.6';
|
|
86
91
|
var FullVersionString = "1DS-Web-JS-" + Version;
|
|
87
92
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
88
93
|
var strWithCredentials = "withCredentials";
|
|
@@ -100,7 +105,7 @@
|
|
|
100
105
|
var isDocumentObjectAvailable = Boolean(applicationinsightsCoreJs.getDocument());
|
|
101
106
|
var isWindowObjectAvailable = Boolean(applicationinsightsCoreJs.getWindow());
|
|
102
107
|
function isValueAssigned(value) {
|
|
103
|
-
return !(value ===
|
|
108
|
+
return !(value === STR_EMPTY || applicationinsightsCoreJs.isNullOrUndefined(value));
|
|
104
109
|
}
|
|
105
110
|
function getTenantId(apiKey) {
|
|
106
111
|
if (apiKey) {
|
|
@@ -109,7 +114,7 @@
|
|
|
109
114
|
return apiKey.substring(0, indexTenantId);
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
|
-
return
|
|
117
|
+
return STR_EMPTY;
|
|
113
118
|
}
|
|
114
119
|
function isUint8ArrayAvailable() {
|
|
115
120
|
if (uInt8ArraySupported === null) {
|
|
@@ -131,11 +136,11 @@
|
|
|
131
136
|
if (propType === "string" || propType === "number" || propType === "boolean" || applicationinsightsCoreJs.isArray(property)) {
|
|
132
137
|
property = { value: property };
|
|
133
138
|
}
|
|
134
|
-
else if (propType === "object" && !
|
|
139
|
+
else if (propType === "object" && !applicationinsightsShims.ObjHasOwnProperty.call(property, "value")) {
|
|
135
140
|
property = { value: stringifyObjects ? JSON.stringify(property) : property };
|
|
136
141
|
}
|
|
137
142
|
else if (applicationinsightsCoreJs.isNullOrUndefined(property.value)
|
|
138
|
-
|| property.value ===
|
|
143
|
+
|| property.value === STR_EMPTY || (!applicationinsightsCoreJs.isString(property.value)
|
|
139
144
|
&& !applicationinsightsCoreJs.isNumber(property.value) && !applicationinsightsCoreJs.isBoolean(property.value)
|
|
140
145
|
&& !applicationinsightsCoreJs.isArray(property.value))) {
|
|
141
146
|
return null;
|
|
@@ -198,7 +203,7 @@
|
|
|
198
203
|
if (applicationinsightsCoreJs.areCookiesSupported(null)) {
|
|
199
204
|
return getCookieValue(applicationinsightsCoreJs.safeGetCookieMgr(null), name);
|
|
200
205
|
}
|
|
201
|
-
return
|
|
206
|
+
return STR_EMPTY;
|
|
202
207
|
}
|
|
203
208
|
function getCookieValue(cookieMgr, name, decode) {
|
|
204
209
|
if (decode === void 0) { decode = true; }
|
|
@@ -209,7 +214,7 @@
|
|
|
209
214
|
cookieValue = decodeURIComponent(cookieValue);
|
|
210
215
|
}
|
|
211
216
|
}
|
|
212
|
-
return cookieValue ||
|
|
217
|
+
return cookieValue || STR_EMPTY;
|
|
213
218
|
}
|
|
214
219
|
function createGuid(style) {
|
|
215
220
|
if (style === void 0) { style = "D" ; }
|
|
@@ -221,7 +226,7 @@
|
|
|
221
226
|
theGuid = "(" + theGuid + ")";
|
|
222
227
|
}
|
|
223
228
|
else if (style === "N" ) {
|
|
224
|
-
theGuid = theGuid.replace(/-/g,
|
|
229
|
+
theGuid = theGuid.replace(/-/g, STR_EMPTY);
|
|
225
230
|
}
|
|
226
231
|
return theGuid;
|
|
227
232
|
}
|
|
@@ -230,7 +235,7 @@
|
|
|
230
235
|
var deep = false;
|
|
231
236
|
var i = 0;
|
|
232
237
|
var length = arguments.length;
|
|
233
|
-
var objProto = Object[
|
|
238
|
+
var objProto = Object[applicationinsightsShims.strShimPrototype];
|
|
234
239
|
var theArgs = arguments;
|
|
235
240
|
if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
|
|
236
241
|
deep = theArgs[0];
|
|
@@ -315,7 +320,7 @@
|
|
|
315
320
|
theType |= getFieldValueType(value[0]);
|
|
316
321
|
}
|
|
317
322
|
}
|
|
318
|
-
else if (
|
|
323
|
+
else if (applicationinsightsShims.ObjHasOwnProperty.call(value, "value")) {
|
|
319
324
|
theType = 8192 | getFieldValueType(value.value);
|
|
320
325
|
}
|
|
321
326
|
}
|
|
@@ -437,27 +442,25 @@
|
|
|
437
442
|
return xhr;
|
|
438
443
|
}
|
|
439
444
|
|
|
440
|
-
var PropVersion = "version";
|
|
441
|
-
var properties = "properties";
|
|
442
445
|
var AppInsightsCore = /** @class */ (function (_super) {
|
|
443
446
|
applicationinsightsShims.__extendsFn(AppInsightsCore, _super);
|
|
444
447
|
function AppInsightsCore() {
|
|
445
448
|
var _this = _super.call(this) || this;
|
|
446
449
|
_this.pluginVersionStringArr = [];
|
|
447
|
-
_this.pluginVersionString = "";
|
|
448
450
|
dynamicProto__default(AppInsightsCore, _this, function (_self, _base) {
|
|
449
451
|
if (!_self.logger || !_self.logger.queue) {
|
|
450
452
|
_self.logger = new applicationinsightsCoreJs.DiagnosticLogger({ loggingLevelConsole: 1 });
|
|
451
453
|
}
|
|
452
454
|
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
453
455
|
applicationinsightsCoreJs.doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () {
|
|
456
|
+
var _pluginVersionStringArr = _self.pluginVersionStringArr;
|
|
454
457
|
if (config) {
|
|
455
458
|
if (!config.endpointUrl) {
|
|
456
|
-
config.endpointUrl =
|
|
459
|
+
config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
|
|
457
460
|
}
|
|
458
461
|
var propertyStorageOverride = config.propertyStorageOverride;
|
|
459
462
|
if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
|
|
460
|
-
|
|
463
|
+
applicationinsightsCoreJs.throwError("Invalid property storage override passed.");
|
|
461
464
|
}
|
|
462
465
|
if (config.channels) {
|
|
463
466
|
applicationinsightsCoreJs.arrForEach(config.channels, function (channels) {
|
|
@@ -465,7 +468,7 @@
|
|
|
465
468
|
applicationinsightsCoreJs.arrForEach(channels, function (channel) {
|
|
466
469
|
if (channel.identifier && channel.version) {
|
|
467
470
|
var ver = channel.identifier + "=" + channel.version;
|
|
468
|
-
|
|
471
|
+
_pluginVersionStringArr.push(ver);
|
|
469
472
|
}
|
|
470
473
|
});
|
|
471
474
|
}
|
|
@@ -473,17 +476,18 @@
|
|
|
473
476
|
}
|
|
474
477
|
}
|
|
475
478
|
_self.getWParam = function () {
|
|
476
|
-
return typeof document !== "undefined" ? 0 : -1;
|
|
479
|
+
return (typeof document !== "undefined" || !!config.enableWParam) ? 0 : -1;
|
|
477
480
|
};
|
|
478
481
|
if (extensions) {
|
|
479
482
|
applicationinsightsCoreJs.arrForEach(extensions, function (ext) {
|
|
480
483
|
if (ext && ext.identifier && ext.version) {
|
|
481
484
|
var ver = ext.identifier + "=" + ext.version;
|
|
482
|
-
|
|
485
|
+
_pluginVersionStringArr.push(ver);
|
|
483
486
|
}
|
|
484
487
|
});
|
|
485
488
|
}
|
|
486
|
-
_self.pluginVersionString =
|
|
489
|
+
_self.pluginVersionString = _pluginVersionStringArr.join(";");
|
|
490
|
+
_self.pluginVersionStringArr = _pluginVersionStringArr;
|
|
487
491
|
try {
|
|
488
492
|
_base.initialize(config, extensions, logger, notificationManager);
|
|
489
493
|
_self.pollInternalLogs("InternalLog");
|
|
@@ -494,7 +498,7 @@
|
|
|
494
498
|
if (message.indexOf("channels") !== -1) {
|
|
495
499
|
message += "\n - Channels must be provided through config.channels only!";
|
|
496
500
|
}
|
|
497
|
-
|
|
501
|
+
applicationinsightsCoreJs._throwInternal(logger_1, 1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message);
|
|
498
502
|
}
|
|
499
503
|
}, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });
|
|
500
504
|
};
|
|
@@ -511,16 +515,9 @@
|
|
|
511
515
|
itemExt.sdk = itemExt.sdk || {};
|
|
512
516
|
itemExt.sdk.ver = FullVersionString;
|
|
513
517
|
var baseData = telemetryItem.baseData = telemetryItem.baseData || {};
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
var itemProperties = baseData[properties];
|
|
518
|
-
if (!itemProperties[PropVersion]) {
|
|
519
|
-
itemProperties[PropVersion] = "";
|
|
520
|
-
}
|
|
521
|
-
if (_self.pluginVersionString !== "") {
|
|
522
|
-
itemProperties[PropVersion] = _self.pluginVersionString;
|
|
523
|
-
}
|
|
518
|
+
baseData[STR_PROPERTIES] = baseData[STR_PROPERTIES] || {};
|
|
519
|
+
var itemProperties = baseData[STR_PROPERTIES];
|
|
520
|
+
itemProperties[STR_VERSION] = itemProperties[STR_VERSION] || _self.pluginVersionString || STR_EMPTY;
|
|
524
521
|
}
|
|
525
522
|
_base.track(telemetryItem);
|
|
526
523
|
}, function () { return ({ item: item }); }, !(item.sync));
|
|
@@ -528,6 +525,7 @@
|
|
|
528
525
|
});
|
|
529
526
|
return _this;
|
|
530
527
|
}
|
|
528
|
+
AppInsightsCore.__ieDyn=1;
|
|
531
529
|
return AppInsightsCore;
|
|
532
530
|
}(applicationinsightsCoreJs.AppInsightsCore));
|
|
533
531
|
|
|
@@ -538,10 +536,10 @@
|
|
|
538
536
|
dynamicProto__default(BaseCore, _this, function (_self, _base) {
|
|
539
537
|
_self.initialize = function (config, extensions, logger, notificationManager) {
|
|
540
538
|
if (config && !config.endpointUrl) {
|
|
541
|
-
config.endpointUrl =
|
|
539
|
+
config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
|
|
542
540
|
}
|
|
543
541
|
_self.getWParam = function () {
|
|
544
|
-
return isDocumentObjectAvailable ? 0 : -1;
|
|
542
|
+
return (isDocumentObjectAvailable || !!config.enableWParam) ? 0 : -1;
|
|
545
543
|
};
|
|
546
544
|
try {
|
|
547
545
|
_base.initialize(config, extensions, logger, notificationManager);
|
|
@@ -562,6 +560,7 @@
|
|
|
562
560
|
});
|
|
563
561
|
return _this;
|
|
564
562
|
}
|
|
563
|
+
BaseCore.__ieDyn=1;
|
|
565
564
|
return BaseCore;
|
|
566
565
|
}(applicationinsightsCoreJs.BaseCore));
|
|
567
566
|
|
|
@@ -941,7 +940,7 @@
|
|
|
941
940
|
}
|
|
942
941
|
}
|
|
943
942
|
function _warnLog(message) {
|
|
944
|
-
diagLog
|
|
943
|
+
applicationinsightsCoreJs._warnToConsole(diagLog, "ESPromiseScheduler[" + _scheduledName + "] " + message);
|
|
945
944
|
}
|
|
946
945
|
}
|
|
947
946
|
ESPromiseScheduler.incomplete = function () {
|
|
@@ -1032,7 +1031,7 @@
|
|
|
1032
1031
|
if (mapValue.handler) {
|
|
1033
1032
|
return mapValue.handler.value(path, name, value, stringifyObjects);
|
|
1034
1033
|
}
|
|
1035
|
-
if (!applicationinsightsCoreJs.isString(name) || applicationinsightsCoreJs.isNullOrUndefined(value) || value ===
|
|
1034
|
+
if (!applicationinsightsCoreJs.isString(name) || applicationinsightsCoreJs.isNullOrUndefined(value) || value === STR_EMPTY) {
|
|
1036
1035
|
return null;
|
|
1037
1036
|
}
|
|
1038
1037
|
var property = null;
|
|
@@ -1149,7 +1148,9 @@
|
|
|
1149
1148
|
exports._InternalLogMessage = applicationinsightsCoreJs._InternalLogMessage;
|
|
1150
1149
|
exports._InternalMessageId = applicationinsightsCoreJs._InternalMessageId;
|
|
1151
1150
|
exports.__getRegisteredEvents = applicationinsightsCoreJs.__getRegisteredEvents;
|
|
1151
|
+
exports._logInternalMessage = applicationinsightsCoreJs._logInternalMessage;
|
|
1152
1152
|
exports._throwInternal = applicationinsightsCoreJs._throwInternal;
|
|
1153
|
+
exports._warnToConsole = applicationinsightsCoreJs._warnToConsole;
|
|
1153
1154
|
exports.addEventHandler = applicationinsightsCoreJs.addEventHandler;
|
|
1154
1155
|
exports.addEventListeners = applicationinsightsCoreJs.addEventListeners;
|
|
1155
1156
|
exports.addPageHideEventListener = applicationinsightsCoreJs.addPageHideEventListener;
|