@microsoft/applicationinsights-channel-js 2.8.0-nightly.2204-04 → 2.8.0-nightly.2204-05
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/browser/applicationinsights-channel-js.integrity.json +9 -9
- package/browser/applicationinsights-channel-js.js +323 -313
- package/browser/applicationinsights-channel-js.js.map +1 -1
- package/browser/applicationinsights-channel-js.min.js +2 -2
- package/browser/applicationinsights-channel-js.min.js.map +1 -1
- package/dist/applicationinsights-channel-js.d.ts +1 -1
- package/dist/applicationinsights-channel-js.js +323 -313
- package/dist/applicationinsights-channel-js.js.map +1 -1
- package/dist/applicationinsights-channel-js.min.js +2 -2
- package/dist/applicationinsights-channel-js.min.js.map +1 -1
- package/dist/applicationinsights-channel-js.rollup.d.ts +1 -1
- package/dist-esm/EnvelopeCreator.js +5 -5
- package/dist-esm/EnvelopeCreator.js.map +1 -1
- package/dist-esm/Interfaces.js +1 -1
- package/dist-esm/Offline.js +1 -1
- package/dist-esm/SendBuffer.js +7 -7
- package/dist-esm/SendBuffer.js.map +1 -1
- package/dist-esm/Sender.js +24 -24
- package/dist-esm/Sender.js.map +1 -1
- package/dist-esm/Serializer.js +10 -10
- package/dist-esm/Serializer.js.map +1 -1
- package/dist-esm/TelemetryProcessors/Sample.js +1 -1
- package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js +1 -1
- package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js +1 -1
- package/dist-esm/applicationinsights-channel-js.js +1 -1
- package/package.json +3 -3
- package/src/EnvelopeCreator.ts +7 -7
- package/src/SendBuffer.ts +14 -14
- package/src/Sender.ts +36 -36
- package/src/Serializer.ts +13 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Channel, 2.8.0-nightly.2204-
|
|
2
|
+
* Application Insights JavaScript SDK - Channel, 2.8.0-nightly.2204-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -98,247 +98,6 @@
|
|
|
98
98
|
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
/*!
|
|
102
|
-
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
103
|
-
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
104
|
-
*/
|
|
105
|
-
var Constructor = 'constructor';
|
|
106
|
-
var Prototype = 'prototype';
|
|
107
|
-
var strFunction = 'function';
|
|
108
|
-
var DynInstFuncTable = '_dynInstFuncs';
|
|
109
|
-
var DynProxyTag = '_isDynProxy';
|
|
110
|
-
var DynClassName = '_dynClass';
|
|
111
|
-
var DynClassNamePrefix = '_dynCls$';
|
|
112
|
-
var DynInstChkTag = '_dynInstChk';
|
|
113
|
-
var DynAllowInstChkTag = DynInstChkTag;
|
|
114
|
-
var DynProtoDefaultOptions = '_dfOpts';
|
|
115
|
-
var UnknownValue = '_unknown_';
|
|
116
|
-
var str__Proto$1 = "__proto__";
|
|
117
|
-
var strUseBaseInst = 'useBaseInst';
|
|
118
|
-
var strSetInstFuncs = 'setInstFuncs';
|
|
119
|
-
var Obj = Object;
|
|
120
|
-
var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
|
|
121
|
-
var _dynamicNames = 0;
|
|
122
|
-
function _hasOwnProperty(obj, prop) {
|
|
123
|
-
return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
|
|
124
|
-
}
|
|
125
|
-
function _isObjectOrArrayPrototype(target) {
|
|
126
|
-
return target && (target === Obj[Prototype] || target === Array[Prototype]);
|
|
127
|
-
}
|
|
128
|
-
function _isObjectArrayOrFunctionPrototype(target) {
|
|
129
|
-
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
130
|
-
}
|
|
131
|
-
function _getObjProto$1(target) {
|
|
132
|
-
if (target) {
|
|
133
|
-
if (_objGetPrototypeOf$1) {
|
|
134
|
-
return _objGetPrototypeOf$1(target);
|
|
135
|
-
}
|
|
136
|
-
var newProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
137
|
-
if (newProto) {
|
|
138
|
-
return newProto;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
function _forEachProp(target, func) {
|
|
144
|
-
var props = [];
|
|
145
|
-
var getOwnProps = Obj["getOwnPropertyNames"];
|
|
146
|
-
if (getOwnProps) {
|
|
147
|
-
props = getOwnProps(target);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
for (var name_1 in target) {
|
|
151
|
-
if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
|
|
152
|
-
props.push(name_1);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (props && props.length > 0) {
|
|
157
|
-
for (var lp = 0; lp < props.length; lp++) {
|
|
158
|
-
func(props[lp]);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function _isDynamicCandidate(target, funcName, skipOwn) {
|
|
163
|
-
return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
|
|
164
|
-
}
|
|
165
|
-
function _throwTypeError(message) {
|
|
166
|
-
throw new TypeError("DynamicProto: " + message);
|
|
167
|
-
}
|
|
168
|
-
function _getInstanceFuncs(thisTarget) {
|
|
169
|
-
var instFuncs = {};
|
|
170
|
-
_forEachProp(thisTarget, function (name) {
|
|
171
|
-
if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
|
|
172
|
-
instFuncs[name] = thisTarget[name];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
return instFuncs;
|
|
176
|
-
}
|
|
177
|
-
function _hasVisited(values, value) {
|
|
178
|
-
for (var lp = values.length - 1; lp >= 0; lp--) {
|
|
179
|
-
if (values[lp] === value) {
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
186
|
-
function _instFuncProxy(target, funcHost, funcName) {
|
|
187
|
-
var theFunc = funcHost[funcName];
|
|
188
|
-
if (theFunc[DynProxyTag] && useBaseInst) {
|
|
189
|
-
var instFuncTable = target[DynInstFuncTable] || {};
|
|
190
|
-
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
191
|
-
theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return function () {
|
|
195
|
-
return theFunc.apply(target, arguments);
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
var baseFuncs = {};
|
|
199
|
-
_forEachProp(instFuncs, function (name) {
|
|
200
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
201
|
-
});
|
|
202
|
-
var baseProto = _getObjProto$1(classProto);
|
|
203
|
-
var visited = [];
|
|
204
|
-
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
205
|
-
_forEachProp(baseProto, function (name) {
|
|
206
|
-
if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) {
|
|
207
|
-
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
visited.push(baseProto);
|
|
211
|
-
baseProto = _getObjProto$1(baseProto);
|
|
212
|
-
}
|
|
213
|
-
return baseFuncs;
|
|
214
|
-
}
|
|
215
|
-
function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
216
|
-
var instFunc = null;
|
|
217
|
-
if (target && _hasOwnProperty(proto, DynClassName)) {
|
|
218
|
-
var instFuncTable = target[DynInstFuncTable] || {};
|
|
219
|
-
instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
|
|
220
|
-
if (!instFunc) {
|
|
221
|
-
_throwTypeError("Missing [" + funcName + "] " + strFunction);
|
|
222
|
-
}
|
|
223
|
-
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
224
|
-
var canAddInst = !_hasOwnProperty(target, funcName);
|
|
225
|
-
var objProto = _getObjProto$1(target);
|
|
226
|
-
var visited = [];
|
|
227
|
-
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
228
|
-
var protoFunc = objProto[funcName];
|
|
229
|
-
if (protoFunc) {
|
|
230
|
-
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
visited.push(objProto);
|
|
234
|
-
objProto = _getObjProto$1(objProto);
|
|
235
|
-
}
|
|
236
|
-
try {
|
|
237
|
-
if (canAddInst) {
|
|
238
|
-
target[funcName] = instFunc;
|
|
239
|
-
}
|
|
240
|
-
instFunc[DynInstChkTag] = 1;
|
|
241
|
-
}
|
|
242
|
-
catch (e) {
|
|
243
|
-
instFuncTable[DynAllowInstChkTag] = false;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return instFunc;
|
|
248
|
-
}
|
|
249
|
-
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
250
|
-
var protoFunc = proto[funcName];
|
|
251
|
-
if (protoFunc === currentDynProtoProxy) {
|
|
252
|
-
protoFunc = _getObjProto$1(proto)[funcName];
|
|
253
|
-
}
|
|
254
|
-
if (typeof protoFunc !== strFunction) {
|
|
255
|
-
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
256
|
-
}
|
|
257
|
-
return protoFunc;
|
|
258
|
-
}
|
|
259
|
-
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
260
|
-
function _createDynamicPrototype(proto, funcName) {
|
|
261
|
-
var dynProtoProxy = function () {
|
|
262
|
-
var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
263
|
-
return instFunc.apply(this, arguments);
|
|
264
|
-
};
|
|
265
|
-
dynProtoProxy[DynProxyTag] = 1;
|
|
266
|
-
return dynProtoProxy;
|
|
267
|
-
}
|
|
268
|
-
if (!_isObjectOrArrayPrototype(proto)) {
|
|
269
|
-
var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
|
|
270
|
-
var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
|
|
271
|
-
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
272
|
-
instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
273
|
-
}
|
|
274
|
-
_forEachProp(target, function (name) {
|
|
275
|
-
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
276
|
-
instFuncs_1[name] = target[name];
|
|
277
|
-
delete target[name];
|
|
278
|
-
if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
279
|
-
proto[name] = _createDynamicPrototype(proto, name);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function _checkPrototype(classProto, thisTarget) {
|
|
286
|
-
if (_objGetPrototypeOf$1) {
|
|
287
|
-
var visited = [];
|
|
288
|
-
var thisProto = _getObjProto$1(thisTarget);
|
|
289
|
-
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
290
|
-
if (thisProto === classProto) {
|
|
291
|
-
return true;
|
|
292
|
-
}
|
|
293
|
-
visited.push(thisProto);
|
|
294
|
-
thisProto = _getObjProto$1(thisProto);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return false;
|
|
298
|
-
}
|
|
299
|
-
function _getObjName(target, unknownValue) {
|
|
300
|
-
if (_hasOwnProperty(target, Prototype)) {
|
|
301
|
-
return target.name || unknownValue || UnknownValue;
|
|
302
|
-
}
|
|
303
|
-
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
304
|
-
}
|
|
305
|
-
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
306
|
-
if (!_hasOwnProperty(theClass, Prototype)) {
|
|
307
|
-
_throwTypeError("theClass is an invalid class definition.");
|
|
308
|
-
}
|
|
309
|
-
var classProto = theClass[Prototype];
|
|
310
|
-
if (!_checkPrototype(classProto, target)) {
|
|
311
|
-
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
312
|
-
}
|
|
313
|
-
var className = null;
|
|
314
|
-
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
315
|
-
className = classProto[DynClassName];
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
|
|
319
|
-
_dynamicNames++;
|
|
320
|
-
classProto[DynClassName] = className;
|
|
321
|
-
}
|
|
322
|
-
var perfOptions = dynamicProto[DynProtoDefaultOptions];
|
|
323
|
-
var useBaseInst = !!perfOptions[strUseBaseInst];
|
|
324
|
-
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
325
|
-
useBaseInst = !!options[strUseBaseInst];
|
|
326
|
-
}
|
|
327
|
-
var instFuncs = _getInstanceFuncs(target);
|
|
328
|
-
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
329
|
-
delegateFunc(target, baseFuncs);
|
|
330
|
-
var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs];
|
|
331
|
-
if (setInstanceFunc && options) {
|
|
332
|
-
setInstanceFunc = !!options[strSetInstFuncs];
|
|
333
|
-
}
|
|
334
|
-
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
335
|
-
}
|
|
336
|
-
var perfDefaults = {
|
|
337
|
-
setInstFuncs: true,
|
|
338
|
-
useBaseInst: true
|
|
339
|
-
};
|
|
340
|
-
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
341
|
-
|
|
342
101
|
var strEmpty$1 = "";
|
|
343
102
|
var strSetNextPlugin = "setNextPlugin";
|
|
344
103
|
var strIsInitialized = "isInitialized";
|
|
@@ -353,7 +112,7 @@
|
|
|
353
112
|
var strMap = "map";
|
|
354
113
|
var cStrTrim = "trim";
|
|
355
114
|
var strToString = "toString";
|
|
356
|
-
var str__Proto = "__proto__";
|
|
115
|
+
var str__Proto$1 = "__proto__";
|
|
357
116
|
var strConstructor = "constructor";
|
|
358
117
|
var _objDefineProperty$1 = ObjDefineProperty;
|
|
359
118
|
var _objFreeze = ObjClass.freeze;
|
|
@@ -369,13 +128,13 @@
|
|
|
369
128
|
var rCamelCase = /-([a-z])/g;
|
|
370
129
|
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
371
130
|
var rLeadingNumeric = /^(\d+[\w\d_$])/;
|
|
372
|
-
var _objGetPrototypeOf = Object["getPrototypeOf"];
|
|
373
|
-
function _getObjProto(target) {
|
|
131
|
+
var _objGetPrototypeOf$1 = Object["getPrototypeOf"];
|
|
132
|
+
function _getObjProto$1(target) {
|
|
374
133
|
if (target) {
|
|
375
|
-
if (_objGetPrototypeOf) {
|
|
376
|
-
return _objGetPrototypeOf(target);
|
|
134
|
+
if (_objGetPrototypeOf$1) {
|
|
135
|
+
return _objGetPrototypeOf$1(target);
|
|
377
136
|
}
|
|
378
|
-
var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
|
|
137
|
+
var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor];
|
|
379
138
|
if (newProto) {
|
|
380
139
|
return newProto;
|
|
381
140
|
}
|
|
@@ -441,7 +200,7 @@
|
|
|
441
200
|
function isPlainObject(value) {
|
|
442
201
|
var result = false;
|
|
443
202
|
if (value && typeof value === "object") {
|
|
444
|
-
var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
|
|
203
|
+
var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value);
|
|
445
204
|
if (!proto) {
|
|
446
205
|
result = true;
|
|
447
206
|
}
|
|
@@ -596,6 +355,16 @@
|
|
|
596
355
|
function _doNothing(value) {
|
|
597
356
|
return value;
|
|
598
357
|
}
|
|
358
|
+
function deepFreeze(obj) {
|
|
359
|
+
if (_objFreeze) {
|
|
360
|
+
objForEachKey(obj, function (name, value) {
|
|
361
|
+
if (isArray(value) || isObject(value)) {
|
|
362
|
+
_objFreeze(value);
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
return objFreeze(obj);
|
|
367
|
+
}
|
|
599
368
|
var objFreeze = _objFreeze || _doNothing;
|
|
600
369
|
function dateNow() {
|
|
601
370
|
var dt = Date;
|
|
@@ -621,9 +390,6 @@
|
|
|
621
390
|
function isTruthy(value) {
|
|
622
391
|
return !!value;
|
|
623
392
|
}
|
|
624
|
-
function throwError(message) {
|
|
625
|
-
throw new Error(message);
|
|
626
|
-
}
|
|
627
393
|
function _createProxyFunction(source, funcName) {
|
|
628
394
|
var srcFunc = null;
|
|
629
395
|
var src = null;
|
|
@@ -644,9 +410,8 @@
|
|
|
644
410
|
};
|
|
645
411
|
}
|
|
646
412
|
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
647
|
-
if (overwriteTarget === void 0) { overwriteTarget = true; }
|
|
648
413
|
if (target && name && source) {
|
|
649
|
-
if (overwriteTarget || isUndefined(target[name])) {
|
|
414
|
+
if (overwriteTarget !== false || isUndefined(target[name])) {
|
|
650
415
|
target[name] = _createProxyFunction(source, theFunc);
|
|
651
416
|
}
|
|
652
417
|
}
|
|
@@ -664,17 +429,6 @@
|
|
|
664
429
|
return class_1;
|
|
665
430
|
}());
|
|
666
431
|
}
|
|
667
|
-
function createEnumStyle(values) {
|
|
668
|
-
var enumClass = {};
|
|
669
|
-
objForEachKey(values, function (field, value) {
|
|
670
|
-
enumClass[field] = value;
|
|
671
|
-
if (!isUndefined(enumClass[value])) {
|
|
672
|
-
throwError("[" + value + "] exists for " + field);
|
|
673
|
-
}
|
|
674
|
-
enumClass[value] = field;
|
|
675
|
-
});
|
|
676
|
-
return objFreeze(enumClass);
|
|
677
|
-
}
|
|
678
432
|
function optimizeObject(theObject) {
|
|
679
433
|
if (theObject && ObjAssign) {
|
|
680
434
|
theObject = ObjClass(ObjAssign({}, theObject));
|
|
@@ -726,6 +480,256 @@
|
|
|
726
480
|
return extended;
|
|
727
481
|
}
|
|
728
482
|
|
|
483
|
+
function createEnumStyle(values) {
|
|
484
|
+
var enumClass = {};
|
|
485
|
+
objForEachKey(values, function (field, value) {
|
|
486
|
+
enumClass[field] = value;
|
|
487
|
+
enumClass[value] = field;
|
|
488
|
+
});
|
|
489
|
+
return deepFreeze(enumClass);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/*!
|
|
493
|
+
* Microsoft Dynamic Proto Utility, 1.1.4
|
|
494
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
495
|
+
*/
|
|
496
|
+
var Constructor = 'constructor';
|
|
497
|
+
var Prototype = 'prototype';
|
|
498
|
+
var strFunction = 'function';
|
|
499
|
+
var DynInstFuncTable = '_dynInstFuncs';
|
|
500
|
+
var DynProxyTag = '_isDynProxy';
|
|
501
|
+
var DynClassName = '_dynClass';
|
|
502
|
+
var DynClassNamePrefix = '_dynCls$';
|
|
503
|
+
var DynInstChkTag = '_dynInstChk';
|
|
504
|
+
var DynAllowInstChkTag = DynInstChkTag;
|
|
505
|
+
var DynProtoDefaultOptions = '_dfOpts';
|
|
506
|
+
var UnknownValue = '_unknown_';
|
|
507
|
+
var str__Proto = "__proto__";
|
|
508
|
+
var strUseBaseInst = 'useBaseInst';
|
|
509
|
+
var strSetInstFuncs = 'setInstFuncs';
|
|
510
|
+
var Obj = Object;
|
|
511
|
+
var _objGetPrototypeOf = Obj["getPrototypeOf"];
|
|
512
|
+
var _dynamicNames = 0;
|
|
513
|
+
function _hasOwnProperty(obj, prop) {
|
|
514
|
+
return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
|
|
515
|
+
}
|
|
516
|
+
function _isObjectOrArrayPrototype(target) {
|
|
517
|
+
return target && (target === Obj[Prototype] || target === Array[Prototype]);
|
|
518
|
+
}
|
|
519
|
+
function _isObjectArrayOrFunctionPrototype(target) {
|
|
520
|
+
return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
|
|
521
|
+
}
|
|
522
|
+
function _getObjProto(target) {
|
|
523
|
+
if (target) {
|
|
524
|
+
if (_objGetPrototypeOf) {
|
|
525
|
+
return _objGetPrototypeOf(target);
|
|
526
|
+
}
|
|
527
|
+
var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
|
|
528
|
+
if (newProto) {
|
|
529
|
+
return newProto;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
function _forEachProp(target, func) {
|
|
535
|
+
var props = [];
|
|
536
|
+
var getOwnProps = Obj["getOwnPropertyNames"];
|
|
537
|
+
if (getOwnProps) {
|
|
538
|
+
props = getOwnProps(target);
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
for (var name_1 in target) {
|
|
542
|
+
if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
|
|
543
|
+
props.push(name_1);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (props && props.length > 0) {
|
|
548
|
+
for (var lp = 0; lp < props.length; lp++) {
|
|
549
|
+
func(props[lp]);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function _isDynamicCandidate(target, funcName, skipOwn) {
|
|
554
|
+
return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
|
|
555
|
+
}
|
|
556
|
+
function _throwTypeError(message) {
|
|
557
|
+
throw new TypeError("DynamicProto: " + message);
|
|
558
|
+
}
|
|
559
|
+
function _getInstanceFuncs(thisTarget) {
|
|
560
|
+
var instFuncs = {};
|
|
561
|
+
_forEachProp(thisTarget, function (name) {
|
|
562
|
+
if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
|
|
563
|
+
instFuncs[name] = thisTarget[name];
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
return instFuncs;
|
|
567
|
+
}
|
|
568
|
+
function _hasVisited(values, value) {
|
|
569
|
+
for (var lp = values.length - 1; lp >= 0; lp--) {
|
|
570
|
+
if (values[lp] === value) {
|
|
571
|
+
return true;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
|
|
577
|
+
function _instFuncProxy(target, funcHost, funcName) {
|
|
578
|
+
var theFunc = funcHost[funcName];
|
|
579
|
+
if (theFunc[DynProxyTag] && useBaseInst) {
|
|
580
|
+
var instFuncTable = target[DynInstFuncTable] || {};
|
|
581
|
+
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
582
|
+
theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return function () {
|
|
586
|
+
return theFunc.apply(target, arguments);
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
var baseFuncs = {};
|
|
590
|
+
_forEachProp(instFuncs, function (name) {
|
|
591
|
+
baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
|
|
592
|
+
});
|
|
593
|
+
var baseProto = _getObjProto(classProto);
|
|
594
|
+
var visited = [];
|
|
595
|
+
while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
|
|
596
|
+
_forEachProp(baseProto, function (name) {
|
|
597
|
+
if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
|
|
598
|
+
baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
visited.push(baseProto);
|
|
602
|
+
baseProto = _getObjProto(baseProto);
|
|
603
|
+
}
|
|
604
|
+
return baseFuncs;
|
|
605
|
+
}
|
|
606
|
+
function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
|
|
607
|
+
var instFunc = null;
|
|
608
|
+
if (target && _hasOwnProperty(proto, DynClassName)) {
|
|
609
|
+
var instFuncTable = target[DynInstFuncTable] || {};
|
|
610
|
+
instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
|
|
611
|
+
if (!instFunc) {
|
|
612
|
+
_throwTypeError("Missing [" + funcName + "] " + strFunction);
|
|
613
|
+
}
|
|
614
|
+
if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
|
|
615
|
+
var canAddInst = !_hasOwnProperty(target, funcName);
|
|
616
|
+
var objProto = _getObjProto(target);
|
|
617
|
+
var visited = [];
|
|
618
|
+
while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
|
|
619
|
+
var protoFunc = objProto[funcName];
|
|
620
|
+
if (protoFunc) {
|
|
621
|
+
canAddInst = (protoFunc === currentDynProtoProxy);
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
visited.push(objProto);
|
|
625
|
+
objProto = _getObjProto(objProto);
|
|
626
|
+
}
|
|
627
|
+
try {
|
|
628
|
+
if (canAddInst) {
|
|
629
|
+
target[funcName] = instFunc;
|
|
630
|
+
}
|
|
631
|
+
instFunc[DynInstChkTag] = 1;
|
|
632
|
+
}
|
|
633
|
+
catch (e) {
|
|
634
|
+
instFuncTable[DynAllowInstChkTag] = false;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return instFunc;
|
|
639
|
+
}
|
|
640
|
+
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
641
|
+
var protoFunc = proto[funcName];
|
|
642
|
+
if (protoFunc === currentDynProtoProxy) {
|
|
643
|
+
protoFunc = _getObjProto(proto)[funcName];
|
|
644
|
+
}
|
|
645
|
+
if (typeof protoFunc !== strFunction) {
|
|
646
|
+
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
647
|
+
}
|
|
648
|
+
return protoFunc;
|
|
649
|
+
}
|
|
650
|
+
function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
|
|
651
|
+
function _createDynamicPrototype(proto, funcName) {
|
|
652
|
+
var dynProtoProxy = function () {
|
|
653
|
+
var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
|
|
654
|
+
return instFunc.apply(this, arguments);
|
|
655
|
+
};
|
|
656
|
+
dynProtoProxy[DynProxyTag] = 1;
|
|
657
|
+
return dynProtoProxy;
|
|
658
|
+
}
|
|
659
|
+
if (!_isObjectOrArrayPrototype(proto)) {
|
|
660
|
+
var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
|
|
661
|
+
var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
|
|
662
|
+
if (instFuncTable[DynAllowInstChkTag] !== false) {
|
|
663
|
+
instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
|
|
664
|
+
}
|
|
665
|
+
_forEachProp(target, function (name) {
|
|
666
|
+
if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
|
|
667
|
+
instFuncs_1[name] = target[name];
|
|
668
|
+
delete target[name];
|
|
669
|
+
if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
|
|
670
|
+
proto[name] = _createDynamicPrototype(proto, name);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function _checkPrototype(classProto, thisTarget) {
|
|
677
|
+
if (_objGetPrototypeOf) {
|
|
678
|
+
var visited = [];
|
|
679
|
+
var thisProto = _getObjProto(thisTarget);
|
|
680
|
+
while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
|
|
681
|
+
if (thisProto === classProto) {
|
|
682
|
+
return true;
|
|
683
|
+
}
|
|
684
|
+
visited.push(thisProto);
|
|
685
|
+
thisProto = _getObjProto(thisProto);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
function _getObjName(target, unknownValue) {
|
|
691
|
+
if (_hasOwnProperty(target, Prototype)) {
|
|
692
|
+
return target.name || unknownValue || UnknownValue;
|
|
693
|
+
}
|
|
694
|
+
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
695
|
+
}
|
|
696
|
+
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
697
|
+
if (!_hasOwnProperty(theClass, Prototype)) {
|
|
698
|
+
_throwTypeError("theClass is an invalid class definition.");
|
|
699
|
+
}
|
|
700
|
+
var classProto = theClass[Prototype];
|
|
701
|
+
if (!_checkPrototype(classProto, target)) {
|
|
702
|
+
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
703
|
+
}
|
|
704
|
+
var className = null;
|
|
705
|
+
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
706
|
+
className = classProto[DynClassName];
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
|
|
710
|
+
_dynamicNames++;
|
|
711
|
+
classProto[DynClassName] = className;
|
|
712
|
+
}
|
|
713
|
+
var perfOptions = dynamicProto[DynProtoDefaultOptions];
|
|
714
|
+
var useBaseInst = !!perfOptions[strUseBaseInst];
|
|
715
|
+
if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
|
|
716
|
+
useBaseInst = !!options[strUseBaseInst];
|
|
717
|
+
}
|
|
718
|
+
var instFuncs = _getInstanceFuncs(target);
|
|
719
|
+
var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
|
|
720
|
+
delegateFunc(target, baseFuncs);
|
|
721
|
+
var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
|
|
722
|
+
if (setInstanceFunc && options) {
|
|
723
|
+
setInstanceFunc = !!options[strSetInstFuncs];
|
|
724
|
+
}
|
|
725
|
+
_populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
|
|
726
|
+
}
|
|
727
|
+
var perfDefaults = {
|
|
728
|
+
setInstFuncs: true,
|
|
729
|
+
useBaseInst: true
|
|
730
|
+
};
|
|
731
|
+
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
732
|
+
|
|
729
733
|
var strWindow = "window";
|
|
730
734
|
var strDocument = "document";
|
|
731
735
|
var strDocumentMode = "documentMode";
|
|
@@ -1069,10 +1073,16 @@
|
|
|
1069
1073
|
}
|
|
1070
1074
|
return DiagnosticLogger;
|
|
1071
1075
|
}());
|
|
1076
|
+
function _getLogger(logger) {
|
|
1077
|
+
return (logger || new DiagnosticLogger());
|
|
1078
|
+
}
|
|
1072
1079
|
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
1073
1080
|
if (isUserAct === void 0) { isUserAct = false; }
|
|
1074
1081
|
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
1075
1082
|
}
|
|
1083
|
+
function _warnToConsole(logger, message) {
|
|
1084
|
+
_getLogger(logger).warnToConsole(message);
|
|
1085
|
+
}
|
|
1076
1086
|
|
|
1077
1087
|
var strExecutionContextKey = "ctx";
|
|
1078
1088
|
var PerfEvent = /** @class */ (function () {
|
|
@@ -1255,7 +1265,7 @@
|
|
|
1255
1265
|
}
|
|
1256
1266
|
|
|
1257
1267
|
var _objDefineProperty = ObjDefineProperty;
|
|
1258
|
-
var version = "2.8.0-nightly.2204-
|
|
1268
|
+
var version = "2.8.0-nightly.2204-05";
|
|
1259
1269
|
var instanceName = "." + newId(6);
|
|
1260
1270
|
var _dataUid = 0;
|
|
1261
1271
|
function _createAccessor(target, prop, value) {
|
|
@@ -2139,7 +2149,7 @@
|
|
|
2139
2149
|
name = strTrim(name.toString());
|
|
2140
2150
|
if (name.length > 150 ) {
|
|
2141
2151
|
nameTrunc = name.substring(0, 150 );
|
|
2142
|
-
_throwInternal(logger, 2 ,
|
|
2152
|
+
_throwInternal(logger, 2 , 57 , "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
|
|
2143
2153
|
}
|
|
2144
2154
|
}
|
|
2145
2155
|
return nameTrunc || name;
|
|
@@ -2152,20 +2162,20 @@
|
|
|
2152
2162
|
value = strTrim(value);
|
|
2153
2163
|
if (value.toString().length > maxLength) {
|
|
2154
2164
|
valueTrunc = value.toString().substring(0, maxLength);
|
|
2155
|
-
_throwInternal(logger, 2 ,
|
|
2165
|
+
_throwInternal(logger, 2 , 61 , "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
|
|
2156
2166
|
}
|
|
2157
2167
|
}
|
|
2158
2168
|
return valueTrunc || value;
|
|
2159
2169
|
}
|
|
2160
2170
|
function dataSanitizeUrl(logger, url) {
|
|
2161
|
-
return dataSanitizeInput(logger, url, 2048 ,
|
|
2171
|
+
return dataSanitizeInput(logger, url, 2048 , 66 );
|
|
2162
2172
|
}
|
|
2163
2173
|
function dataSanitizeMessage(logger, message) {
|
|
2164
2174
|
var messageTrunc;
|
|
2165
2175
|
if (message) {
|
|
2166
2176
|
if (message.length > 32768 ) {
|
|
2167
2177
|
messageTrunc = message.substring(0, 32768 );
|
|
2168
|
-
_throwInternal(logger, 2 ,
|
|
2178
|
+
_throwInternal(logger, 2 , 56 , "message is too long, it has been truncated to " + 32768 + " characters.", { message: message }, true);
|
|
2169
2179
|
}
|
|
2170
2180
|
}
|
|
2171
2181
|
return messageTrunc || message;
|
|
@@ -2176,7 +2186,7 @@
|
|
|
2176
2186
|
var value = "" + exception;
|
|
2177
2187
|
if (value.length > 32768 ) {
|
|
2178
2188
|
exceptionTrunc = value.substring(0, 32768 );
|
|
2179
|
-
_throwInternal(logger, 2 ,
|
|
2189
|
+
_throwInternal(logger, 2 , 52 , "exception is too long, it has been truncated to " + 32768 + " characters.", { exception: exception }, true);
|
|
2180
2190
|
}
|
|
2181
2191
|
}
|
|
2182
2192
|
return exceptionTrunc || exception;
|
|
@@ -2190,7 +2200,7 @@
|
|
|
2190
2200
|
value = getJSON().stringify(value);
|
|
2191
2201
|
}
|
|
2192
2202
|
catch (e) {
|
|
2193
|
-
_throwInternal(logger, 2 ,
|
|
2203
|
+
_throwInternal(logger, 2 , 49 , "custom property is not valid", { exception: e }, true);
|
|
2194
2204
|
}
|
|
2195
2205
|
}
|
|
2196
2206
|
value = dataSanitizeString(logger, value, 8192 );
|
|
@@ -2213,7 +2223,7 @@
|
|
|
2213
2223
|
return measurements;
|
|
2214
2224
|
}
|
|
2215
2225
|
function dataSanitizeId(logger, id) {
|
|
2216
|
-
return id ? dataSanitizeInput(logger, id, 128 ,
|
|
2226
|
+
return id ? dataSanitizeInput(logger, id, 128 , 69 ).toString() : id;
|
|
2217
2227
|
}
|
|
2218
2228
|
function dataSanitizeInput(logger, input, maxLength, _msgId) {
|
|
2219
2229
|
var inputTrunc;
|
|
@@ -2304,7 +2314,7 @@
|
|
|
2304
2314
|
}
|
|
2305
2315
|
catch (e) {
|
|
2306
2316
|
_canUseSessionStorage = false;
|
|
2307
|
-
_throwInternal(logger, 2 ,
|
|
2317
|
+
_throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2308
2318
|
}
|
|
2309
2319
|
}
|
|
2310
2320
|
return null;
|
|
@@ -2318,7 +2328,7 @@
|
|
|
2318
2328
|
}
|
|
2319
2329
|
catch (e) {
|
|
2320
2330
|
_canUseSessionStorage = false;
|
|
2321
|
-
_throwInternal(logger, 2 ,
|
|
2331
|
+
_throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2322
2332
|
}
|
|
2323
2333
|
}
|
|
2324
2334
|
return false;
|
|
@@ -3198,7 +3208,7 @@
|
|
|
3198
3208
|
_self.enqueue = function (payload) {
|
|
3199
3209
|
if (_self.count() >= config.eventsLimitInMem()) {
|
|
3200
3210
|
if (!_bufferFullMessageSent) {
|
|
3201
|
-
logger
|
|
3211
|
+
_throwInternal(logger, 2 , 105 , "Maximum in-memory buffer size reached: " + _self.count(), true);
|
|
3202
3212
|
_bufferFullMessageSent = true;
|
|
3203
3213
|
}
|
|
3204
3214
|
return;
|
|
@@ -3270,7 +3280,7 @@
|
|
|
3270
3280
|
_self.enqueue = function (payload) {
|
|
3271
3281
|
if (_self.count() >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) {
|
|
3272
3282
|
if (!_bufferFullMessageSent) {
|
|
3273
|
-
logger
|
|
3283
|
+
_throwInternal(logger, 2 , 67 , "Maximum buffer size reached: " + _self.count(), true);
|
|
3274
3284
|
_bufferFullMessageSent = true;
|
|
3275
3285
|
}
|
|
3276
3286
|
return;
|
|
@@ -3290,7 +3300,7 @@
|
|
|
3290
3300
|
if (sentElements instanceof Array && payload instanceof Array) {
|
|
3291
3301
|
sentElements = sentElements.concat(payload);
|
|
3292
3302
|
if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) {
|
|
3293
|
-
logger
|
|
3303
|
+
_throwInternal(logger, 1 , 67 , "Sent buffer reached its maximum size: " + sentElements.length, true);
|
|
3294
3304
|
sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE;
|
|
3295
3305
|
}
|
|
3296
3306
|
_setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements);
|
|
@@ -3326,7 +3336,7 @@
|
|
|
3326
3336
|
}
|
|
3327
3337
|
}
|
|
3328
3338
|
catch (e) {
|
|
3329
|
-
logger
|
|
3339
|
+
_throwInternal(logger, 1 , 42 , " storage key: " + prefixedKey + ", " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3330
3340
|
}
|
|
3331
3341
|
return [];
|
|
3332
3342
|
}
|
|
@@ -3339,7 +3349,7 @@
|
|
|
3339
3349
|
}
|
|
3340
3350
|
catch (e) {
|
|
3341
3351
|
utlSetSessionStorage(logger, prefixedKey, JSON.stringify([]));
|
|
3342
|
-
logger
|
|
3352
|
+
_throwInternal(logger, 2 , 41 , " storage key: " + prefixedKey + ", " + getExceptionName(e) + ". Buffer cleared", { exception: dumpObj(e) });
|
|
3343
3353
|
}
|
|
3344
3354
|
}
|
|
3345
3355
|
});
|
|
@@ -3456,11 +3466,11 @@
|
|
|
3456
3466
|
}
|
|
3457
3467
|
function EnvelopeCreatorInit(logger, telemetryItem) {
|
|
3458
3468
|
if (isNullOrUndefined(telemetryItem[strBaseData])) {
|
|
3459
|
-
logger
|
|
3469
|
+
_throwInternal(logger, 1 , 46 , "telemetryItem.baseData cannot be null.");
|
|
3460
3470
|
}
|
|
3461
3471
|
}
|
|
3462
3472
|
var EnvelopeCreator = {
|
|
3463
|
-
Version: "2.8.0-nightly.2204-
|
|
3473
|
+
Version: "2.8.0-nightly.2204-05"
|
|
3464
3474
|
};
|
|
3465
3475
|
function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
|
|
3466
3476
|
EnvelopeCreatorInit(logger, telemetryItem);
|
|
@@ -3472,7 +3482,7 @@
|
|
|
3472
3482
|
}
|
|
3473
3483
|
var bd = telemetryItem[strBaseData];
|
|
3474
3484
|
if (isNullOrUndefined(bd)) {
|
|
3475
|
-
logger
|
|
3485
|
+
_warnToConsole(logger, "Invalid input for dependency data");
|
|
3476
3486
|
return null;
|
|
3477
3487
|
}
|
|
3478
3488
|
var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : "GET";
|
|
@@ -3619,18 +3629,18 @@
|
|
|
3619
3629
|
return getJSON().stringify(output);
|
|
3620
3630
|
}
|
|
3621
3631
|
catch (e) {
|
|
3622
|
-
logger
|
|
3632
|
+
_throwInternal(logger, 1 , 48 , (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true);
|
|
3623
3633
|
}
|
|
3624
3634
|
};
|
|
3625
3635
|
function _serializeObject(source, name) {
|
|
3626
3636
|
var circularReferenceCheck = "__aiCircularRefCheck";
|
|
3627
3637
|
var output = {};
|
|
3628
3638
|
if (!source) {
|
|
3629
|
-
logger
|
|
3639
|
+
_throwInternal(logger, 1 , 48 , "cannot serialize object because it is null or undefined", { name: name }, true);
|
|
3630
3640
|
return output;
|
|
3631
3641
|
}
|
|
3632
3642
|
if (source[circularReferenceCheck]) {
|
|
3633
|
-
logger
|
|
3643
|
+
_throwInternal(logger, 2 , 50 , "Circular reference detected while serializing object", { name: name }, true);
|
|
3634
3644
|
return output;
|
|
3635
3645
|
}
|
|
3636
3646
|
if (!source.aiDataContract) {
|
|
@@ -3647,13 +3657,13 @@
|
|
|
3647
3657
|
output = _serializeArray(source, name);
|
|
3648
3658
|
}
|
|
3649
3659
|
else {
|
|
3650
|
-
logger
|
|
3660
|
+
_throwInternal(logger, 2 , 49 , "Attempting to serialize an object which does not implement ISerializable", { name: name }, true);
|
|
3651
3661
|
try {
|
|
3652
3662
|
getJSON().stringify(source);
|
|
3653
3663
|
output = source;
|
|
3654
3664
|
}
|
|
3655
3665
|
catch (e) {
|
|
3656
|
-
logger
|
|
3666
|
+
_throwInternal(logger, 1 , 48 , (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true);
|
|
3657
3667
|
}
|
|
3658
3668
|
}
|
|
3659
3669
|
return output;
|
|
@@ -3666,7 +3676,7 @@
|
|
|
3666
3676
|
var isPresent = source[field] !== undefined;
|
|
3667
3677
|
var isObj = isObject(source[field]) && source[field] !== null;
|
|
3668
3678
|
if (isRequired && !isPresent && !isArray) {
|
|
3669
|
-
logger
|
|
3679
|
+
_throwInternal(logger, 1 , 24 , "Missing required field specification. The field is required but not present on source", { field: field, name: name });
|
|
3670
3680
|
}
|
|
3671
3681
|
else if (!isHidden) {
|
|
3672
3682
|
var value = void 0;
|
|
@@ -3693,7 +3703,7 @@
|
|
|
3693
3703
|
var output;
|
|
3694
3704
|
if (!!sources) {
|
|
3695
3705
|
if (!isArray(sources)) {
|
|
3696
|
-
logger
|
|
3706
|
+
_throwInternal(logger, 1 , 54 , "This field was specified as an array in the contract but the item is not an array.\r\n", { name: name }, true);
|
|
3697
3707
|
}
|
|
3698
3708
|
else {
|
|
3699
3709
|
output = [];
|
|
@@ -3744,7 +3754,7 @@
|
|
|
3744
3754
|
}
|
|
3745
3755
|
else {
|
|
3746
3756
|
output[field] = "invalid field: " + name + " is of unknown type.";
|
|
3747
|
-
logger
|
|
3757
|
+
_throwInternal(logger, 1 , output[field], null, true);
|
|
3748
3758
|
}
|
|
3749
3759
|
});
|
|
3750
3760
|
}
|
|
@@ -3995,7 +4005,7 @@
|
|
|
3995
4005
|
_self.triggerSend(isAsync, null, sendReason || 1 );
|
|
3996
4006
|
}
|
|
3997
4007
|
catch (e) {
|
|
3998
|
-
_throwInternal(_self.diagLog(),
|
|
4008
|
+
_throwInternal(_self.diagLog(), 1 , 22 , "flush failed, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3999
4009
|
}
|
|
4000
4010
|
}
|
|
4001
4011
|
};
|
|
@@ -4006,7 +4016,7 @@
|
|
|
4006
4016
|
_self.triggerSend(true, _doUnloadSend, 2 );
|
|
4007
4017
|
}
|
|
4008
4018
|
catch (e) {
|
|
4009
|
-
_throwInternal(_self.diagLog(),
|
|
4019
|
+
_throwInternal(_self.diagLog(), 1 , 20 , "failed to flush with beacon sender on page unload, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4010
4020
|
}
|
|
4011
4021
|
}
|
|
4012
4022
|
else {
|
|
@@ -4019,7 +4029,7 @@
|
|
|
4019
4029
|
};
|
|
4020
4030
|
_self.initialize = function (config, core, extensions, pluginChain) {
|
|
4021
4031
|
if (_self.isInitialized()) {
|
|
4022
|
-
_throwInternal(_self.diagLog(),
|
|
4032
|
+
_throwInternal(_self.diagLog(), 1 , 28 , "Sender is already initialized");
|
|
4023
4033
|
}
|
|
4024
4034
|
_base.initialize(config, core, extensions, pluginChain);
|
|
4025
4035
|
var ctx = _self._getTelCtx();
|
|
@@ -4041,7 +4051,7 @@
|
|
|
4041
4051
|
? new SessionStorageSendBuffer(diagLog, _self._senderConfig) : new ArraySendBuffer(diagLog, _self._senderConfig);
|
|
4042
4052
|
_self._sample = new Sample(_self._senderConfig.samplingPercentage(), diagLog);
|
|
4043
4053
|
if (!_validateInstrumentationKey(config)) {
|
|
4044
|
-
_throwInternal(diagLog,
|
|
4054
|
+
_throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + config.instrumentationKey);
|
|
4045
4055
|
}
|
|
4046
4056
|
if (!isInternalApplicationInsightsEndpoint(_self._senderConfig.endpointUrl()) && _self._senderConfig.customHeaders() && _self._senderConfig.customHeaders().length > 0) {
|
|
4047
4057
|
arrForEach(_self._senderConfig.customHeaders(), function (customHeader) {
|
|
@@ -4087,22 +4097,22 @@
|
|
|
4087
4097
|
return;
|
|
4088
4098
|
}
|
|
4089
4099
|
if (!telemetryItem) {
|
|
4090
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4100
|
+
_throwInternal(itemCtx.diagLog(), 1 , 7 , "Cannot send empty telemetry");
|
|
4091
4101
|
return;
|
|
4092
4102
|
}
|
|
4093
4103
|
if (telemetryItem.baseData && !telemetryItem.baseType) {
|
|
4094
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4104
|
+
_throwInternal(itemCtx.diagLog(), 1 , 70 , "Cannot send telemetry without baseData and baseType");
|
|
4095
4105
|
return;
|
|
4096
4106
|
}
|
|
4097
4107
|
if (!telemetryItem.baseType) {
|
|
4098
4108
|
telemetryItem.baseType = "EventData";
|
|
4099
4109
|
}
|
|
4100
4110
|
if (!_self._sender) {
|
|
4101
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4111
|
+
_throwInternal(itemCtx.diagLog(), 1 , 28 , "Sender was not initialized");
|
|
4102
4112
|
return;
|
|
4103
4113
|
}
|
|
4104
4114
|
if (!_isSampledIn(telemetryItem)) {
|
|
4105
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4115
|
+
_throwInternal(itemCtx.diagLog(), 2 , 33 , "Telemetry item was sampled out and not sent", { SampleRate: _self._sample.sampleRate });
|
|
4106
4116
|
return;
|
|
4107
4117
|
}
|
|
4108
4118
|
else {
|
|
@@ -4112,7 +4122,7 @@
|
|
|
4112
4122
|
var defaultEnvelopeIkey = telemetryItem.iKey || _self._senderConfig.instrumentationKey();
|
|
4113
4123
|
var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, itemCtx.diagLog(), convertUndefined);
|
|
4114
4124
|
if (!aiEnvelope_1) {
|
|
4115
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4125
|
+
_throwInternal(itemCtx.diagLog(), 1 , 47 , "Unable to create an AppInsights envelope");
|
|
4116
4126
|
return;
|
|
4117
4127
|
}
|
|
4118
4128
|
var doNotSendItem_1 = false;
|
|
@@ -4121,11 +4131,11 @@
|
|
|
4121
4131
|
try {
|
|
4122
4132
|
if (callBack && callBack(aiEnvelope_1) === false) {
|
|
4123
4133
|
doNotSendItem_1 = true;
|
|
4124
|
-
itemCtx.diagLog()
|
|
4134
|
+
_warnToConsole(itemCtx.diagLog(), "Telemetry processor check returns false");
|
|
4125
4135
|
}
|
|
4126
4136
|
}
|
|
4127
4137
|
catch (e) {
|
|
4128
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4138
|
+
_throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true);
|
|
4129
4139
|
}
|
|
4130
4140
|
});
|
|
4131
4141
|
delete telemetryItem.tags[ProcessLegacy];
|
|
@@ -4143,7 +4153,7 @@
|
|
|
4143
4153
|
_setupTimer();
|
|
4144
4154
|
}
|
|
4145
4155
|
catch (e) {
|
|
4146
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4156
|
+
_throwInternal(itemCtx.diagLog(), 2 , 12 , "Failed adding telemetry to the sender's buffer, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4147
4157
|
}
|
|
4148
4158
|
_self.processNext(telemetryItem, itemCtx);
|
|
4149
4159
|
};
|
|
@@ -4178,7 +4188,7 @@
|
|
|
4178
4188
|
catch (e) {
|
|
4179
4189
|
var ieVer = getIEVersion();
|
|
4180
4190
|
if (!ieVer || ieVer > 9) {
|
|
4181
|
-
_throwInternal(_self.diagLog(),
|
|
4191
|
+
_throwInternal(_self.diagLog(), 1 , 40 , "Telemetry transmission failed, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4182
4192
|
}
|
|
4183
4193
|
}
|
|
4184
4194
|
}
|
|
@@ -4189,7 +4199,7 @@
|
|
|
4189
4199
|
_initDefaults();
|
|
4190
4200
|
};
|
|
4191
4201
|
_self._onError = function (payload, message, event) {
|
|
4192
|
-
_throwInternal(_self.diagLog(),
|
|
4202
|
+
_throwInternal(_self.diagLog(), 2 , 26 , "Failed to send telemetry.", { message: message });
|
|
4193
4203
|
_self._buffer.clearSent(payload);
|
|
4194
4204
|
};
|
|
4195
4205
|
_self._onPartialSuccess = function (payload, results) {
|
|
@@ -4214,7 +4224,7 @@
|
|
|
4214
4224
|
}
|
|
4215
4225
|
if (retry.length > 0) {
|
|
4216
4226
|
_resendPayload(retry);
|
|
4217
|
-
_throwInternal(_self.diagLog(),
|
|
4227
|
+
_throwInternal(_self.diagLog(), 2 , 40 , "Partial success. " +
|
|
4218
4228
|
"Delivered: " + payload.length + ", Failed: " + failed.length +
|
|
4219
4229
|
". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items");
|
|
4220
4230
|
}
|
|
@@ -4259,7 +4269,7 @@
|
|
|
4259
4269
|
}
|
|
4260
4270
|
if (!_self._senderConfig.isRetryDisabled() && _isRetriable(status)) {
|
|
4261
4271
|
_resendPayload(payload);
|
|
4262
|
-
_throwInternal(_self.diagLog(),
|
|
4272
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " +
|
|
4263
4273
|
"Response code " + status + ". Will retry to send " + payload.length + " items.");
|
|
4264
4274
|
}
|
|
4265
4275
|
else {
|
|
@@ -4270,7 +4280,7 @@
|
|
|
4270
4280
|
if (!_self._senderConfig.isRetryDisabled()) {
|
|
4271
4281
|
var offlineBackOffMultiplier = 10;
|
|
4272
4282
|
_resendPayload(payload, offlineBackOffMultiplier);
|
|
4273
|
-
_throwInternal(_self.diagLog(),
|
|
4283
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". Offline - Response Code: ".concat(status, ". Offline status: ").concat(!_offlineListener.isOnline(), ". Will retry to send ").concat(payload.length, " items."));
|
|
4274
4284
|
}
|
|
4275
4285
|
}
|
|
4276
4286
|
else {
|
|
@@ -4338,7 +4348,7 @@
|
|
|
4338
4348
|
}
|
|
4339
4349
|
if (droppedPayload.length > 0) {
|
|
4340
4350
|
_fallbackSender && _fallbackSender(droppedPayload, true);
|
|
4341
|
-
_throwInternal(_self.diagLog(),
|
|
4351
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with normal sender.");
|
|
4342
4352
|
}
|
|
4343
4353
|
}
|
|
4344
4354
|
}
|
|
@@ -4379,7 +4389,7 @@
|
|
|
4379
4389
|
}
|
|
4380
4390
|
else {
|
|
4381
4391
|
_fallbackSender && _fallbackSender(payload, true);
|
|
4382
|
-
_throwInternal(_self.diagLog(),
|
|
4392
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with xhrSender.");
|
|
4383
4393
|
}
|
|
4384
4394
|
}
|
|
4385
4395
|
}
|
|
@@ -4470,7 +4480,7 @@
|
|
|
4470
4480
|
}
|
|
4471
4481
|
}
|
|
4472
4482
|
catch (e) {
|
|
4473
|
-
_throwInternal(_self.diagLog(),
|
|
4483
|
+
_throwInternal(_self.diagLog(), 1 , 43 , "Cannot parse the response. " + getExceptionName(e), {
|
|
4474
4484
|
response: response
|
|
4475
4485
|
});
|
|
4476
4486
|
}
|
|
@@ -4541,7 +4551,7 @@
|
|
|
4541
4551
|
xdr.onerror = function (event) { return _self._onError(payload, _formatErrorMessageXdr(xdr), event); };
|
|
4542
4552
|
var hostingProtocol = _window && _window.location && _window.location.protocol || "";
|
|
4543
4553
|
if (_self._senderConfig.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) {
|
|
4544
|
-
_throwInternal(_self.diagLog(),
|
|
4554
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " +
|
|
4545
4555
|
"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.");
|
|
4546
4556
|
buffer.clear();
|
|
4547
4557
|
return;
|
|
@@ -4572,7 +4582,7 @@
|
|
|
4572
4582
|
manager.eventsSendRequest(sendRequest, isAsync);
|
|
4573
4583
|
}
|
|
4574
4584
|
catch (e) {
|
|
4575
|
-
_throwInternal(_self.diagLog(),
|
|
4585
|
+
_throwInternal(_self.diagLog(), 1 , 74 , "send request notification failed: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4576
4586
|
}
|
|
4577
4587
|
}
|
|
4578
4588
|
}
|