@microsoft/applicationinsights-channel-js 2.8.0-beta.2203-16 → 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 +555 -680
- 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.api.json +56 -29
- package/dist/applicationinsights-channel-js.d.ts +1 -1
- package/dist/applicationinsights-channel-js.js +555 -680
- 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 +4 -4
- package/src/EnvelopeCreator.ts +7 -7
- package/src/SendBuffer.ts +14 -14
- package/src/Sender.ts +36 -36
- package/src/Serializer.ts +13 -13
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Channel, 2.8.0-
|
|
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;
|
|
@@ -616,115 +385,350 @@
|
|
|
616
385
|
target[field] = theValue;
|
|
617
386
|
}
|
|
618
387
|
}
|
|
619
|
-
return theValue;
|
|
620
|
-
}
|
|
621
|
-
function isTruthy(value) {
|
|
622
|
-
return !!value;
|
|
623
|
-
}
|
|
624
|
-
function
|
|
625
|
-
|
|
388
|
+
return theValue;
|
|
389
|
+
}
|
|
390
|
+
function isTruthy(value) {
|
|
391
|
+
return !!value;
|
|
392
|
+
}
|
|
393
|
+
function _createProxyFunction(source, funcName) {
|
|
394
|
+
var srcFunc = null;
|
|
395
|
+
var src = null;
|
|
396
|
+
if (isFunction(source)) {
|
|
397
|
+
srcFunc = source;
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
src = source;
|
|
401
|
+
}
|
|
402
|
+
return function () {
|
|
403
|
+
var originalArguments = arguments;
|
|
404
|
+
if (srcFunc) {
|
|
405
|
+
src = srcFunc();
|
|
406
|
+
}
|
|
407
|
+
if (src) {
|
|
408
|
+
return src[funcName].apply(src, originalArguments);
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) {
|
|
413
|
+
if (target && name && source) {
|
|
414
|
+
if (overwriteTarget !== false || isUndefined(target[name])) {
|
|
415
|
+
target[name] = _createProxyFunction(source, theFunc);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function createClassFromInterface(defaults) {
|
|
420
|
+
return /** @class */ (function () {
|
|
421
|
+
function class_1() {
|
|
422
|
+
var _this_1 = this;
|
|
423
|
+
if (defaults) {
|
|
424
|
+
objForEachKey(defaults, function (field, value) {
|
|
425
|
+
_this_1[field] = value;
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return class_1;
|
|
430
|
+
}());
|
|
431
|
+
}
|
|
432
|
+
function optimizeObject(theObject) {
|
|
433
|
+
if (theObject && ObjAssign) {
|
|
434
|
+
theObject = ObjClass(ObjAssign({}, theObject));
|
|
435
|
+
}
|
|
436
|
+
return theObject;
|
|
437
|
+
}
|
|
438
|
+
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
439
|
+
var theArgs = arguments;
|
|
440
|
+
var extended = theArgs[0] || {};
|
|
441
|
+
var argLen = theArgs.length;
|
|
442
|
+
var deep = false;
|
|
443
|
+
var idx = 1;
|
|
444
|
+
if (argLen > 0 && isBoolean(extended)) {
|
|
445
|
+
deep = extended;
|
|
446
|
+
extended = theArgs[idx] || {};
|
|
447
|
+
idx++;
|
|
448
|
+
}
|
|
449
|
+
if (!isObject(extended)) {
|
|
450
|
+
extended = {};
|
|
451
|
+
}
|
|
452
|
+
for (; idx < argLen; idx++) {
|
|
453
|
+
var arg = theArgs[idx];
|
|
454
|
+
var isArgArray = isArray(arg);
|
|
455
|
+
var isArgObj = isObject(arg);
|
|
456
|
+
for (var prop in arg) {
|
|
457
|
+
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
|
|
458
|
+
if (!propOk) {
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
var newValue = arg[prop];
|
|
462
|
+
var isNewArray = void 0;
|
|
463
|
+
if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
|
|
464
|
+
var clone = extended[prop];
|
|
465
|
+
if (isNewArray) {
|
|
466
|
+
if (!isArray(clone)) {
|
|
467
|
+
clone = [];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
else if (!isPlainObject(clone)) {
|
|
471
|
+
clone = {};
|
|
472
|
+
}
|
|
473
|
+
newValue = objExtend(deep, clone, newValue);
|
|
474
|
+
}
|
|
475
|
+
if (newValue !== undefined) {
|
|
476
|
+
extended[prop] = newValue;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return extended;
|
|
481
|
+
}
|
|
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;
|
|
626
639
|
}
|
|
627
|
-
function
|
|
628
|
-
var
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
srcFunc = source;
|
|
640
|
+
function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
|
|
641
|
+
var protoFunc = proto[funcName];
|
|
642
|
+
if (protoFunc === currentDynProtoProxy) {
|
|
643
|
+
protoFunc = _getObjProto(proto)[funcName];
|
|
632
644
|
}
|
|
633
|
-
|
|
634
|
-
|
|
645
|
+
if (typeof protoFunc !== strFunction) {
|
|
646
|
+
_throwTypeError("[" + funcName + "] is not a " + strFunction);
|
|
635
647
|
}
|
|
636
|
-
return
|
|
637
|
-
var originalArguments = arguments;
|
|
638
|
-
if (srcFunc) {
|
|
639
|
-
src = srcFunc();
|
|
640
|
-
}
|
|
641
|
-
if (src) {
|
|
642
|
-
return src[funcName].apply(src, originalArguments);
|
|
643
|
-
}
|
|
644
|
-
};
|
|
648
|
+
return protoFunc;
|
|
645
649
|
}
|
|
646
|
-
function
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
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;
|
|
651
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
|
+
});
|
|
652
674
|
}
|
|
653
675
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
});
|
|
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;
|
|
662
683
|
}
|
|
684
|
+
visited.push(thisProto);
|
|
685
|
+
thisProto = _getObjProto(thisProto);
|
|
663
686
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}
|
|
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);
|
|
687
|
+
}
|
|
688
|
+
return false;
|
|
677
689
|
}
|
|
678
|
-
function
|
|
679
|
-
if (
|
|
680
|
-
|
|
690
|
+
function _getObjName(target, unknownValue) {
|
|
691
|
+
if (_hasOwnProperty(target, Prototype)) {
|
|
692
|
+
return target.name || unknownValue || UnknownValue;
|
|
681
693
|
}
|
|
682
|
-
return
|
|
694
|
+
return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
|
|
683
695
|
}
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
var argLen = theArgs.length;
|
|
688
|
-
var deep = false;
|
|
689
|
-
var idx = 1;
|
|
690
|
-
if (argLen > 0 && isBoolean(extended)) {
|
|
691
|
-
deep = extended;
|
|
692
|
-
extended = theArgs[idx] || {};
|
|
693
|
-
idx++;
|
|
696
|
+
function dynamicProto(theClass, target, delegateFunc, options) {
|
|
697
|
+
if (!_hasOwnProperty(theClass, Prototype)) {
|
|
698
|
+
_throwTypeError("theClass is an invalid class definition.");
|
|
694
699
|
}
|
|
695
|
-
|
|
696
|
-
|
|
700
|
+
var classProto = theClass[Prototype];
|
|
701
|
+
if (!_checkPrototype(classProto, target)) {
|
|
702
|
+
_throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
|
|
697
703
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
var isArgObj = isObject(arg);
|
|
702
|
-
for (var prop in arg) {
|
|
703
|
-
var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop)));
|
|
704
|
-
if (!propOk) {
|
|
705
|
-
continue;
|
|
706
|
-
}
|
|
707
|
-
var newValue = arg[prop];
|
|
708
|
-
var isNewArray = void 0;
|
|
709
|
-
if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) {
|
|
710
|
-
var clone = extended[prop];
|
|
711
|
-
if (isNewArray) {
|
|
712
|
-
if (!isArray(clone)) {
|
|
713
|
-
clone = [];
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
else if (!isPlainObject(clone)) {
|
|
717
|
-
clone = {};
|
|
718
|
-
}
|
|
719
|
-
newValue = objExtend(deep, clone, newValue);
|
|
720
|
-
}
|
|
721
|
-
if (newValue !== undefined) {
|
|
722
|
-
extended[prop] = newValue;
|
|
723
|
-
}
|
|
724
|
-
}
|
|
704
|
+
var className = null;
|
|
705
|
+
if (_hasOwnProperty(classProto, DynClassName)) {
|
|
706
|
+
className = classProto[DynClassName];
|
|
725
707
|
}
|
|
726
|
-
|
|
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);
|
|
727
726
|
}
|
|
727
|
+
var perfDefaults = {
|
|
728
|
+
setInstFuncs: true,
|
|
729
|
+
useBaseInst: true
|
|
730
|
+
};
|
|
731
|
+
dynamicProto[DynProtoDefaultOptions] = perfDefaults;
|
|
728
732
|
|
|
729
733
|
var strWindow = "window";
|
|
730
734
|
var strDocument = "document";
|
|
@@ -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-
|
|
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;
|
|
@@ -2415,37 +2425,17 @@
|
|
|
2415
2425
|
};
|
|
2416
2426
|
}
|
|
2417
2427
|
|
|
2418
|
-
var
|
|
2419
|
-
function Base() {
|
|
2420
|
-
}
|
|
2421
|
-
return Base;
|
|
2422
|
-
}());
|
|
2423
|
-
|
|
2424
|
-
var Data$1 = /** @class */ (function (_super) {
|
|
2425
|
-
__extendsFn(Data, _super);
|
|
2426
|
-
function Data() {
|
|
2427
|
-
return _super.call(this) || this;
|
|
2428
|
-
}
|
|
2429
|
-
return Data;
|
|
2430
|
-
}(Base));
|
|
2431
|
-
|
|
2432
|
-
var Envelope$1 = /** @class */ (function () {
|
|
2433
|
-
function Envelope() {
|
|
2434
|
-
this.ver = 1;
|
|
2435
|
-
this.sampleRate = 100.0;
|
|
2436
|
-
this.tags = {};
|
|
2437
|
-
}
|
|
2438
|
-
return Envelope;
|
|
2439
|
-
}());
|
|
2440
|
-
|
|
2441
|
-
var Envelope = /** @class */ (function (_super) {
|
|
2442
|
-
__extendsFn(Envelope, _super);
|
|
2428
|
+
var Envelope = /** @class */ (function () {
|
|
2443
2429
|
function Envelope(logger, data, name) {
|
|
2444
|
-
var _this =
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2430
|
+
var _this = this;
|
|
2431
|
+
var _self = this;
|
|
2432
|
+
_self.ver = 1;
|
|
2433
|
+
_self.sampleRate = 100.0;
|
|
2434
|
+
_self.tags = {};
|
|
2435
|
+
_self.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
2436
|
+
_self.data = data;
|
|
2437
|
+
_self.time = toISOString(new Date());
|
|
2438
|
+
_self.aiDataContract = {
|
|
2449
2439
|
time: 1 ,
|
|
2450
2440
|
iKey: 1 ,
|
|
2451
2441
|
name: 1 ,
|
|
@@ -2455,62 +2445,27 @@
|
|
|
2455
2445
|
tags: 1 ,
|
|
2456
2446
|
data: 1
|
|
2457
2447
|
};
|
|
2458
|
-
return _this;
|
|
2459
2448
|
}
|
|
2460
2449
|
return Envelope;
|
|
2461
|
-
}(Envelope$1));
|
|
2462
|
-
|
|
2463
|
-
var EventData = /** @class */ (function () {
|
|
2464
|
-
function EventData() {
|
|
2465
|
-
this.ver = 2;
|
|
2466
|
-
this.properties = {};
|
|
2467
|
-
this.measurements = {};
|
|
2468
|
-
}
|
|
2469
|
-
return EventData;
|
|
2470
2450
|
}());
|
|
2471
2451
|
|
|
2472
|
-
var Event = /** @class */ (function (
|
|
2473
|
-
__extendsFn(Event, _super);
|
|
2452
|
+
var Event = /** @class */ (function () {
|
|
2474
2453
|
function Event(logger, name, properties, measurements) {
|
|
2475
|
-
|
|
2476
|
-
_this.aiDataContract = {
|
|
2454
|
+
this.aiDataContract = {
|
|
2477
2455
|
ver: 1 ,
|
|
2478
2456
|
name: 1 ,
|
|
2479
2457
|
properties: 0 ,
|
|
2480
2458
|
measurements: 0
|
|
2481
2459
|
};
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2460
|
+
var _self = this;
|
|
2461
|
+
_self.ver = 2;
|
|
2462
|
+
_self.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
2463
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
2464
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
2486
2465
|
}
|
|
2487
2466
|
Event.envelopeType = "Microsoft.ApplicationInsights.{0}.Event";
|
|
2488
2467
|
Event.dataType = "EventData";
|
|
2489
2468
|
return Event;
|
|
2490
|
-
}(EventData));
|
|
2491
|
-
|
|
2492
|
-
var StackFrame = /** @class */ (function () {
|
|
2493
|
-
function StackFrame() {
|
|
2494
|
-
}
|
|
2495
|
-
return StackFrame;
|
|
2496
|
-
}());
|
|
2497
|
-
|
|
2498
|
-
var ExceptionData = /** @class */ (function () {
|
|
2499
|
-
function ExceptionData() {
|
|
2500
|
-
this.ver = 2;
|
|
2501
|
-
this.exceptions = [];
|
|
2502
|
-
this.properties = {};
|
|
2503
|
-
this.measurements = {};
|
|
2504
|
-
}
|
|
2505
|
-
return ExceptionData;
|
|
2506
|
-
}());
|
|
2507
|
-
|
|
2508
|
-
var ExceptionDetails = /** @class */ (function () {
|
|
2509
|
-
function ExceptionDetails() {
|
|
2510
|
-
this.hasFullStack = true;
|
|
2511
|
-
this.parsedStack = [];
|
|
2512
|
-
}
|
|
2513
|
-
return ExceptionDetails;
|
|
2514
2469
|
}());
|
|
2515
2470
|
|
|
2516
2471
|
var NoMethod = "<no_method>";
|
|
@@ -2754,50 +2709,48 @@
|
|
|
2754
2709
|
}
|
|
2755
2710
|
return "" + (errorObj || "");
|
|
2756
2711
|
}
|
|
2757
|
-
var Exception = /** @class */ (function (
|
|
2758
|
-
__extendsFn(Exception, _super);
|
|
2712
|
+
var Exception = /** @class */ (function () {
|
|
2759
2713
|
function Exception(logger, exception, properties, measurements, severityLevel, id) {
|
|
2760
|
-
|
|
2761
|
-
_this.aiDataContract = {
|
|
2714
|
+
this.aiDataContract = {
|
|
2762
2715
|
ver: 1 ,
|
|
2763
2716
|
exceptions: 1 ,
|
|
2764
2717
|
severityLevel: 0 ,
|
|
2765
2718
|
properties: 0 ,
|
|
2766
2719
|
measurements: 0
|
|
2767
2720
|
};
|
|
2721
|
+
var _self = this;
|
|
2722
|
+
_self.ver = 2;
|
|
2768
2723
|
if (!_isExceptionInternal(exception)) {
|
|
2769
2724
|
if (!properties) {
|
|
2770
2725
|
properties = {};
|
|
2771
2726
|
}
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2727
|
+
_self.exceptions = [new _ExceptionDetails(logger, exception, properties)];
|
|
2728
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
2729
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
2775
2730
|
if (severityLevel) {
|
|
2776
|
-
|
|
2731
|
+
_self.severityLevel = severityLevel;
|
|
2777
2732
|
}
|
|
2778
2733
|
if (id) {
|
|
2779
|
-
|
|
2734
|
+
_self.id = id;
|
|
2780
2735
|
}
|
|
2781
2736
|
}
|
|
2782
2737
|
else {
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2738
|
+
_self.exceptions = exception.exceptions || [];
|
|
2739
|
+
_self.properties = exception.properties;
|
|
2740
|
+
_self.measurements = exception.measurements;
|
|
2786
2741
|
if (exception.severityLevel) {
|
|
2787
|
-
|
|
2742
|
+
_self.severityLevel = exception.severityLevel;
|
|
2788
2743
|
}
|
|
2789
2744
|
if (exception.id) {
|
|
2790
|
-
|
|
2745
|
+
_self.id = exception.id;
|
|
2791
2746
|
}
|
|
2792
2747
|
if (exception.problemGroup) {
|
|
2793
|
-
|
|
2748
|
+
_self.problemGroup = exception.problemGroup;
|
|
2794
2749
|
}
|
|
2795
|
-
_this.ver = 2;
|
|
2796
2750
|
if (!isNullOrUndefined(exception.isManual)) {
|
|
2797
|
-
|
|
2751
|
+
_self.isManual = exception.isManual;
|
|
2798
2752
|
}
|
|
2799
2753
|
}
|
|
2800
|
-
return _this;
|
|
2801
2754
|
}
|
|
2802
2755
|
Exception.CreateAutoException = function (message, url, lineNumber, columnNumber, error, evt, stack, errorSrc) {
|
|
2803
2756
|
var errorType = _getErrorType(error || evt || message);
|
|
@@ -2851,12 +2804,10 @@
|
|
|
2851
2804
|
Exception.dataType = "ExceptionData";
|
|
2852
2805
|
Exception.formatError = _formatErrorCode;
|
|
2853
2806
|
return Exception;
|
|
2854
|
-
}(
|
|
2855
|
-
var _ExceptionDetails = /** @class */ (function (
|
|
2856
|
-
__extendsFn(_ExceptionDetails, _super);
|
|
2807
|
+
}());
|
|
2808
|
+
var _ExceptionDetails = /** @class */ (function () {
|
|
2857
2809
|
function _ExceptionDetails(logger, exception, properties) {
|
|
2858
|
-
|
|
2859
|
-
_this.aiDataContract = {
|
|
2810
|
+
this.aiDataContract = {
|
|
2860
2811
|
id: 0 ,
|
|
2861
2812
|
outerId: 0 ,
|
|
2862
2813
|
typeName: 1 ,
|
|
@@ -2865,41 +2816,42 @@
|
|
|
2865
2816
|
stack: 0 ,
|
|
2866
2817
|
parsedStack: 2
|
|
2867
2818
|
};
|
|
2819
|
+
var _self = this;
|
|
2868
2820
|
if (!_isExceptionDetailsInternal(exception)) {
|
|
2869
2821
|
var error = exception;
|
|
2870
2822
|
var evt = error && error.evt;
|
|
2871
2823
|
if (!isError(error)) {
|
|
2872
2824
|
error = error[strError] || evt || error;
|
|
2873
2825
|
}
|
|
2874
|
-
|
|
2875
|
-
|
|
2826
|
+
_self.typeName = dataSanitizeString(logger, _getErrorType(error)) || strNotSpecified;
|
|
2827
|
+
_self.message = dataSanitizeMessage(logger, _formatMessage(exception || error, _self.typeName)) || strNotSpecified;
|
|
2876
2828
|
var stack = exception[strStackDetails] || _getStackFromErrorObj(exception);
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2829
|
+
_self.parsedStack = _parseStack(stack);
|
|
2830
|
+
_self[strStack] = dataSanitizeException(logger, _formatStackTrace(stack));
|
|
2831
|
+
_self.hasFullStack = isArray(_self.parsedStack) && _self.parsedStack.length > 0;
|
|
2880
2832
|
if (properties) {
|
|
2881
|
-
properties.typeName = properties.typeName ||
|
|
2833
|
+
properties.typeName = properties.typeName || _self.typeName;
|
|
2882
2834
|
}
|
|
2883
2835
|
}
|
|
2884
2836
|
else {
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2837
|
+
_self.typeName = exception.typeName;
|
|
2838
|
+
_self.message = exception.message;
|
|
2839
|
+
_self[strStack] = exception[strStack];
|
|
2840
|
+
_self.parsedStack = exception.parsedStack || [];
|
|
2841
|
+
_self.hasFullStack = exception.hasFullStack;
|
|
2890
2842
|
}
|
|
2891
|
-
return _this;
|
|
2892
2843
|
}
|
|
2893
2844
|
_ExceptionDetails.prototype.toInterface = function () {
|
|
2894
|
-
var
|
|
2895
|
-
|
|
2845
|
+
var _self = this;
|
|
2846
|
+
var parsedStack = _self.parsedStack instanceof Array
|
|
2847
|
+
&& arrMap(_self.parsedStack, function (frame) { return frame.toInterface(); });
|
|
2896
2848
|
var exceptionDetailsInterface = {
|
|
2897
|
-
id:
|
|
2898
|
-
outerId:
|
|
2899
|
-
typeName:
|
|
2900
|
-
message:
|
|
2901
|
-
hasFullStack:
|
|
2902
|
-
stack:
|
|
2849
|
+
id: _self.id,
|
|
2850
|
+
outerId: _self.outerId,
|
|
2851
|
+
typeName: _self.typeName,
|
|
2852
|
+
message: _self.message,
|
|
2853
|
+
hasFullStack: _self.hasFullStack,
|
|
2854
|
+
stack: _self[strStack],
|
|
2903
2855
|
parsedStack: parsedStack || undefined
|
|
2904
2856
|
};
|
|
2905
2857
|
return exceptionDetailsInterface;
|
|
@@ -2912,94 +2864,68 @@
|
|
|
2912
2864
|
return exceptionDetails;
|
|
2913
2865
|
};
|
|
2914
2866
|
return _ExceptionDetails;
|
|
2915
|
-
}(
|
|
2916
|
-
var _StackFrame = /** @class */ (function (
|
|
2917
|
-
__extendsFn(_StackFrame, _super);
|
|
2867
|
+
}());
|
|
2868
|
+
var _StackFrame = /** @class */ (function () {
|
|
2918
2869
|
function _StackFrame(sourceFrame, level) {
|
|
2919
|
-
|
|
2920
|
-
_this.sizeInBytes = 0;
|
|
2921
|
-
_this.aiDataContract = {
|
|
2870
|
+
this.aiDataContract = {
|
|
2922
2871
|
level: 1 ,
|
|
2923
2872
|
method: 1 ,
|
|
2924
2873
|
assembly: 0 ,
|
|
2925
2874
|
fileName: 0 ,
|
|
2926
2875
|
line: 0
|
|
2927
2876
|
};
|
|
2877
|
+
var _self = this;
|
|
2878
|
+
_self.sizeInBytes = 0;
|
|
2928
2879
|
if (typeof sourceFrame === "string") {
|
|
2929
2880
|
var frame = sourceFrame;
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2881
|
+
_self.level = level;
|
|
2882
|
+
_self.method = NoMethod;
|
|
2883
|
+
_self.assembly = strTrim(frame);
|
|
2884
|
+
_self.fileName = "";
|
|
2885
|
+
_self.line = 0;
|
|
2935
2886
|
var matches = frame.match(_StackFrame.regex);
|
|
2936
2887
|
if (matches && matches.length >= 5) {
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2888
|
+
_self.method = strTrim(matches[2]) || _self.method;
|
|
2889
|
+
_self.fileName = strTrim(matches[4]);
|
|
2890
|
+
_self.line = parseInt(matches[5]) || 0;
|
|
2940
2891
|
}
|
|
2941
2892
|
}
|
|
2942
2893
|
else {
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
return _this;
|
|
2894
|
+
_self.level = sourceFrame.level;
|
|
2895
|
+
_self.method = sourceFrame.method;
|
|
2896
|
+
_self.assembly = sourceFrame.assembly;
|
|
2897
|
+
_self.fileName = sourceFrame.fileName;
|
|
2898
|
+
_self.line = sourceFrame.line;
|
|
2899
|
+
_self.sizeInBytes = 0;
|
|
2900
|
+
}
|
|
2901
|
+
_self.sizeInBytes += _self.method.length;
|
|
2902
|
+
_self.sizeInBytes += _self.fileName.length;
|
|
2903
|
+
_self.sizeInBytes += _self.assembly.length;
|
|
2904
|
+
_self.sizeInBytes += _StackFrame.baseSize;
|
|
2905
|
+
_self.sizeInBytes += _self.level.toString().length;
|
|
2906
|
+
_self.sizeInBytes += _self.line.toString().length;
|
|
2957
2907
|
}
|
|
2958
2908
|
_StackFrame.CreateFromInterface = function (frame) {
|
|
2959
2909
|
return new _StackFrame(frame, null );
|
|
2960
2910
|
};
|
|
2961
2911
|
_StackFrame.prototype.toInterface = function () {
|
|
2912
|
+
var _self = this;
|
|
2962
2913
|
return {
|
|
2963
|
-
level:
|
|
2964
|
-
method:
|
|
2965
|
-
assembly:
|
|
2966
|
-
fileName:
|
|
2967
|
-
line:
|
|
2914
|
+
level: _self.level,
|
|
2915
|
+
method: _self.method,
|
|
2916
|
+
assembly: _self.assembly,
|
|
2917
|
+
fileName: _self.fileName,
|
|
2918
|
+
line: _self.line
|
|
2968
2919
|
};
|
|
2969
2920
|
};
|
|
2970
2921
|
_StackFrame.regex = /^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/;
|
|
2971
2922
|
_StackFrame.baseSize = 58;
|
|
2972
2923
|
return _StackFrame;
|
|
2973
|
-
}(StackFrame));
|
|
2974
|
-
|
|
2975
|
-
var MetricData = /** @class */ (function () {
|
|
2976
|
-
function MetricData() {
|
|
2977
|
-
this.ver = 2;
|
|
2978
|
-
this.metrics = [];
|
|
2979
|
-
this.properties = {};
|
|
2980
|
-
this.measurements = {};
|
|
2981
|
-
}
|
|
2982
|
-
return MetricData;
|
|
2983
|
-
}());
|
|
2984
|
-
|
|
2985
|
-
var DataPointType;
|
|
2986
|
-
(function (DataPointType) {
|
|
2987
|
-
DataPointType[DataPointType["Measurement"] = 0] = "Measurement";
|
|
2988
|
-
DataPointType[DataPointType["Aggregation"] = 1] = "Aggregation";
|
|
2989
|
-
})(DataPointType || (DataPointType = {}));
|
|
2990
|
-
|
|
2991
|
-
var DataPoint$1 = /** @class */ (function () {
|
|
2992
|
-
function DataPoint() {
|
|
2993
|
-
this.kind = DataPointType.Measurement;
|
|
2994
|
-
}
|
|
2995
|
-
return DataPoint;
|
|
2996
2924
|
}());
|
|
2997
2925
|
|
|
2998
|
-
var DataPoint = /** @class */ (function (
|
|
2999
|
-
__extendsFn(DataPoint, _super);
|
|
2926
|
+
var DataPoint = /** @class */ (function () {
|
|
3000
2927
|
function DataPoint() {
|
|
3001
|
-
|
|
3002
|
-
_this.aiDataContract = {
|
|
2928
|
+
this.aiDataContract = {
|
|
3003
2929
|
name: 1 ,
|
|
3004
2930
|
kind: 0 ,
|
|
3005
2931
|
value: 1 ,
|
|
@@ -3008,20 +2934,20 @@
|
|
|
3008
2934
|
max: 0 ,
|
|
3009
2935
|
stdDev: 0
|
|
3010
2936
|
};
|
|
3011
|
-
|
|
2937
|
+
this.kind = 0 ;
|
|
3012
2938
|
}
|
|
3013
2939
|
return DataPoint;
|
|
3014
|
-
}(
|
|
2940
|
+
}());
|
|
3015
2941
|
|
|
3016
|
-
var Metric = /** @class */ (function (
|
|
3017
|
-
__extendsFn(Metric, _super);
|
|
2942
|
+
var Metric = /** @class */ (function () {
|
|
3018
2943
|
function Metric(logger, name, value, count, min, max, stdDev, properties, measurements) {
|
|
3019
|
-
|
|
3020
|
-
_this.aiDataContract = {
|
|
2944
|
+
this.aiDataContract = {
|
|
3021
2945
|
ver: 1 ,
|
|
3022
2946
|
metrics: 1 ,
|
|
3023
2947
|
properties: 0
|
|
3024
2948
|
};
|
|
2949
|
+
var _self = this;
|
|
2950
|
+
_self.ver = 2;
|
|
3025
2951
|
var dataPoint = new DataPoint();
|
|
3026
2952
|
dataPoint.count = count > 0 ? count : undefined;
|
|
3027
2953
|
dataPoint.max = isNaN(max) || max === null ? undefined : max;
|
|
@@ -3029,33 +2955,18 @@
|
|
|
3029
2955
|
dataPoint.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
3030
2956
|
dataPoint.value = value;
|
|
3031
2957
|
dataPoint.stdDev = isNaN(stdDev) || stdDev === null ? undefined : stdDev;
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
return _this;
|
|
2958
|
+
_self.metrics = [dataPoint];
|
|
2959
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
2960
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
3036
2961
|
}
|
|
3037
2962
|
Metric.envelopeType = "Microsoft.ApplicationInsights.{0}.Metric";
|
|
3038
2963
|
Metric.dataType = "MetricData";
|
|
3039
2964
|
return Metric;
|
|
3040
|
-
}(
|
|
3041
|
-
|
|
3042
|
-
var PageViewData = /** @class */ (function (_super) {
|
|
3043
|
-
__extendsFn(PageViewData, _super);
|
|
3044
|
-
function PageViewData() {
|
|
3045
|
-
var _this = _super.call(this) || this;
|
|
3046
|
-
_this.ver = 2;
|
|
3047
|
-
_this.properties = {};
|
|
3048
|
-
_this.measurements = {};
|
|
3049
|
-
return _this;
|
|
3050
|
-
}
|
|
3051
|
-
return PageViewData;
|
|
3052
|
-
}(EventData));
|
|
2965
|
+
}());
|
|
3053
2966
|
|
|
3054
|
-
var PageView = /** @class */ (function (
|
|
3055
|
-
__extendsFn(PageView, _super);
|
|
2967
|
+
var PageView = /** @class */ (function () {
|
|
3056
2968
|
function PageView(logger, name, url, durationMs, properties, measurements, id) {
|
|
3057
|
-
|
|
3058
|
-
_this.aiDataContract = {
|
|
2969
|
+
this.aiDataContract = {
|
|
3059
2970
|
ver: 1 ,
|
|
3060
2971
|
name: 0 ,
|
|
3061
2972
|
url: 0 ,
|
|
@@ -3064,37 +2975,26 @@
|
|
|
3064
2975
|
measurements: 0 ,
|
|
3065
2976
|
id: 0
|
|
3066
2977
|
};
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
2978
|
+
var _self = this;
|
|
2979
|
+
_self.ver = 2;
|
|
2980
|
+
_self.id = dataSanitizeId(logger, id);
|
|
2981
|
+
_self.url = dataSanitizeUrl(logger, url);
|
|
2982
|
+
_self.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
3070
2983
|
if (!isNaN(durationMs)) {
|
|
3071
|
-
|
|
2984
|
+
_self.duration = msToTimeSpan(durationMs);
|
|
3072
2985
|
}
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
return _this;
|
|
2986
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
2987
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
3076
2988
|
}
|
|
3077
2989
|
PageView.envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview";
|
|
3078
2990
|
PageView.dataType = "PageviewData";
|
|
3079
2991
|
return PageView;
|
|
3080
|
-
}(PageViewData));
|
|
3081
|
-
|
|
3082
|
-
var RemoteDependencyData$1 = /** @class */ (function () {
|
|
3083
|
-
function RemoteDependencyData() {
|
|
3084
|
-
this.ver = 2;
|
|
3085
|
-
this.success = true;
|
|
3086
|
-
this.properties = {};
|
|
3087
|
-
this.measurements = {};
|
|
3088
|
-
}
|
|
3089
|
-
return RemoteDependencyData;
|
|
3090
2992
|
}());
|
|
3091
2993
|
|
|
3092
|
-
var RemoteDependencyData = /** @class */ (function (
|
|
3093
|
-
__extendsFn(RemoteDependencyData, _super);
|
|
2994
|
+
var RemoteDependencyData = /** @class */ (function () {
|
|
3094
2995
|
function RemoteDependencyData(logger, id, absoluteUrl, commandName, value, success, resultCode, method, requestAPI, correlationContext, properties, measurements) {
|
|
3095
2996
|
if (requestAPI === void 0) { requestAPI = "Ajax"; }
|
|
3096
|
-
|
|
3097
|
-
_this.aiDataContract = {
|
|
2997
|
+
this.aiDataContract = {
|
|
3098
2998
|
id: 1 ,
|
|
3099
2999
|
ver: 1 ,
|
|
3100
3000
|
name: 0 ,
|
|
@@ -3117,77 +3017,54 @@
|
|
|
3117
3017
|
commandName: 0 ,
|
|
3118
3018
|
dependencyTypeName: 0
|
|
3119
3019
|
};
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3020
|
+
var _self = this;
|
|
3021
|
+
_self.ver = 2;
|
|
3022
|
+
_self.id = id;
|
|
3023
|
+
_self.duration = msToTimeSpan(value);
|
|
3024
|
+
_self.success = success;
|
|
3025
|
+
_self.resultCode = resultCode + "";
|
|
3026
|
+
_self.type = dataSanitizeString(logger, requestAPI);
|
|
3125
3027
|
var dependencyFields = AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName);
|
|
3126
|
-
|
|
3127
|
-
|
|
3028
|
+
_self.data = dataSanitizeUrl(logger, commandName) || dependencyFields.data;
|
|
3029
|
+
_self.target = dataSanitizeString(logger, dependencyFields.target);
|
|
3128
3030
|
if (correlationContext) {
|
|
3129
|
-
|
|
3031
|
+
_self.target = "".concat(_self.target, " | ").concat(correlationContext);
|
|
3130
3032
|
}
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
return _this;
|
|
3033
|
+
_self.name = dataSanitizeString(logger, dependencyFields.name);
|
|
3034
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
3035
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
3135
3036
|
}
|
|
3136
3037
|
RemoteDependencyData.envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency";
|
|
3137
3038
|
RemoteDependencyData.dataType = "RemoteDependencyData";
|
|
3138
3039
|
return RemoteDependencyData;
|
|
3139
|
-
}(RemoteDependencyData$1));
|
|
3140
|
-
|
|
3141
|
-
var MessageData = /** @class */ (function () {
|
|
3142
|
-
function MessageData() {
|
|
3143
|
-
this.ver = 2;
|
|
3144
|
-
this.properties = {};
|
|
3145
|
-
this.measurements = {};
|
|
3146
|
-
}
|
|
3147
|
-
return MessageData;
|
|
3148
3040
|
}());
|
|
3149
3041
|
|
|
3150
|
-
var Trace = /** @class */ (function (
|
|
3151
|
-
__extendsFn(Trace, _super);
|
|
3042
|
+
var Trace = /** @class */ (function () {
|
|
3152
3043
|
function Trace(logger, message, severityLevel, properties, measurements) {
|
|
3153
|
-
|
|
3154
|
-
_this.aiDataContract = {
|
|
3044
|
+
this.aiDataContract = {
|
|
3155
3045
|
ver: 1 ,
|
|
3156
3046
|
message: 1 ,
|
|
3157
3047
|
severityLevel: 0 ,
|
|
3158
3048
|
properties: 0
|
|
3159
3049
|
};
|
|
3050
|
+
var _self = this;
|
|
3051
|
+
_self.ver = 2;
|
|
3160
3052
|
message = message || strNotSpecified;
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3053
|
+
_self.message = dataSanitizeMessage(logger, message);
|
|
3054
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
3055
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
3164
3056
|
if (severityLevel) {
|
|
3165
|
-
|
|
3057
|
+
_self.severityLevel = severityLevel;
|
|
3166
3058
|
}
|
|
3167
|
-
return _this;
|
|
3168
3059
|
}
|
|
3169
3060
|
Trace.envelopeType = "Microsoft.ApplicationInsights.{0}.Message";
|
|
3170
3061
|
Trace.dataType = "MessageData";
|
|
3171
3062
|
return Trace;
|
|
3172
|
-
}(
|
|
3173
|
-
|
|
3174
|
-
var PageViewPerfData = /** @class */ (function (_super) {
|
|
3175
|
-
__extendsFn(PageViewPerfData, _super);
|
|
3176
|
-
function PageViewPerfData() {
|
|
3177
|
-
var _this = _super.call(this) || this;
|
|
3178
|
-
_this.ver = 2;
|
|
3179
|
-
_this.properties = {};
|
|
3180
|
-
_this.measurements = {};
|
|
3181
|
-
return _this;
|
|
3182
|
-
}
|
|
3183
|
-
return PageViewPerfData;
|
|
3184
|
-
}(PageViewData));
|
|
3063
|
+
}());
|
|
3185
3064
|
|
|
3186
|
-
var PageViewPerformance = /** @class */ (function (
|
|
3187
|
-
__extendsFn(PageViewPerformance, _super);
|
|
3065
|
+
var PageViewPerformance = /** @class */ (function () {
|
|
3188
3066
|
function PageViewPerformance(logger, name, url, unused, properties, measurements, cs4BaseData) {
|
|
3189
|
-
|
|
3190
|
-
_this.aiDataContract = {
|
|
3067
|
+
this.aiDataContract = {
|
|
3191
3068
|
ver: 1 ,
|
|
3192
3069
|
name: 0 ,
|
|
3193
3070
|
url: 0 ,
|
|
@@ -3200,39 +3077,37 @@
|
|
|
3200
3077
|
properties: 0 ,
|
|
3201
3078
|
measurements: 0
|
|
3202
3079
|
};
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3080
|
+
var _self = this;
|
|
3081
|
+
_self.ver = 2;
|
|
3082
|
+
_self.url = dataSanitizeUrl(logger, url);
|
|
3083
|
+
_self.name = dataSanitizeString(logger, name) || strNotSpecified;
|
|
3084
|
+
_self.properties = dataSanitizeProperties(logger, properties);
|
|
3085
|
+
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
3207
3086
|
if (cs4BaseData) {
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3087
|
+
_self.domProcessing = cs4BaseData.domProcessing;
|
|
3088
|
+
_self.duration = cs4BaseData.duration;
|
|
3089
|
+
_self.networkConnect = cs4BaseData.networkConnect;
|
|
3090
|
+
_self.perfTotal = cs4BaseData.perfTotal;
|
|
3091
|
+
_self.receivedResponse = cs4BaseData.receivedResponse;
|
|
3092
|
+
_self.sentRequest = cs4BaseData.sentRequest;
|
|
3214
3093
|
}
|
|
3215
|
-
return _this;
|
|
3216
3094
|
}
|
|
3217
3095
|
PageViewPerformance.envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance";
|
|
3218
3096
|
PageViewPerformance.dataType = "PageviewPerformanceData";
|
|
3219
3097
|
return PageViewPerformance;
|
|
3220
|
-
}(
|
|
3098
|
+
}());
|
|
3221
3099
|
|
|
3222
|
-
var Data = /** @class */ (function (
|
|
3223
|
-
__extendsFn(Data, _super);
|
|
3100
|
+
var Data = /** @class */ (function () {
|
|
3224
3101
|
function Data(baseType, data) {
|
|
3225
|
-
|
|
3226
|
-
_this.aiDataContract = {
|
|
3102
|
+
this.aiDataContract = {
|
|
3227
3103
|
baseType: 1 ,
|
|
3228
3104
|
baseData: 1
|
|
3229
3105
|
};
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
return _this;
|
|
3106
|
+
this.baseType = baseType;
|
|
3107
|
+
this.baseData = data;
|
|
3233
3108
|
}
|
|
3234
3109
|
return Data;
|
|
3235
|
-
}(
|
|
3110
|
+
}());
|
|
3236
3111
|
|
|
3237
3112
|
function _aiNameFunc(baseName) {
|
|
3238
3113
|
var aiName = "ai." + baseName + ".";
|
|
@@ -3333,7 +3208,7 @@
|
|
|
3333
3208
|
_self.enqueue = function (payload) {
|
|
3334
3209
|
if (_self.count() >= config.eventsLimitInMem()) {
|
|
3335
3210
|
if (!_bufferFullMessageSent) {
|
|
3336
|
-
logger
|
|
3211
|
+
_throwInternal(logger, 2 , 105 , "Maximum in-memory buffer size reached: " + _self.count(), true);
|
|
3337
3212
|
_bufferFullMessageSent = true;
|
|
3338
3213
|
}
|
|
3339
3214
|
return;
|
|
@@ -3405,7 +3280,7 @@
|
|
|
3405
3280
|
_self.enqueue = function (payload) {
|
|
3406
3281
|
if (_self.count() >= SessionStorageSendBuffer.MAX_BUFFER_SIZE) {
|
|
3407
3282
|
if (!_bufferFullMessageSent) {
|
|
3408
|
-
logger
|
|
3283
|
+
_throwInternal(logger, 2 , 67 , "Maximum buffer size reached: " + _self.count(), true);
|
|
3409
3284
|
_bufferFullMessageSent = true;
|
|
3410
3285
|
}
|
|
3411
3286
|
return;
|
|
@@ -3425,7 +3300,7 @@
|
|
|
3425
3300
|
if (sentElements instanceof Array && payload instanceof Array) {
|
|
3426
3301
|
sentElements = sentElements.concat(payload);
|
|
3427
3302
|
if (sentElements.length > SessionStorageSendBuffer.MAX_BUFFER_SIZE) {
|
|
3428
|
-
logger
|
|
3303
|
+
_throwInternal(logger, 1 , 67 , "Sent buffer reached its maximum size: " + sentElements.length, true);
|
|
3429
3304
|
sentElements.length = SessionStorageSendBuffer.MAX_BUFFER_SIZE;
|
|
3430
3305
|
}
|
|
3431
3306
|
_setBuffer(SessionStorageSendBuffer.SENT_BUFFER_KEY, sentElements);
|
|
@@ -3461,7 +3336,7 @@
|
|
|
3461
3336
|
}
|
|
3462
3337
|
}
|
|
3463
3338
|
catch (e) {
|
|
3464
|
-
logger
|
|
3339
|
+
_throwInternal(logger, 1 , 42 , " storage key: " + prefixedKey + ", " + getExceptionName(e), { exception: dumpObj(e) });
|
|
3465
3340
|
}
|
|
3466
3341
|
return [];
|
|
3467
3342
|
}
|
|
@@ -3474,7 +3349,7 @@
|
|
|
3474
3349
|
}
|
|
3475
3350
|
catch (e) {
|
|
3476
3351
|
utlSetSessionStorage(logger, prefixedKey, JSON.stringify([]));
|
|
3477
|
-
logger
|
|
3352
|
+
_throwInternal(logger, 2 , 41 , " storage key: " + prefixedKey + ", " + getExceptionName(e) + ". Buffer cleared", { exception: dumpObj(e) });
|
|
3478
3353
|
}
|
|
3479
3354
|
}
|
|
3480
3355
|
});
|
|
@@ -3591,11 +3466,11 @@
|
|
|
3591
3466
|
}
|
|
3592
3467
|
function EnvelopeCreatorInit(logger, telemetryItem) {
|
|
3593
3468
|
if (isNullOrUndefined(telemetryItem[strBaseData])) {
|
|
3594
|
-
logger
|
|
3469
|
+
_throwInternal(logger, 1 , 46 , "telemetryItem.baseData cannot be null.");
|
|
3595
3470
|
}
|
|
3596
3471
|
}
|
|
3597
3472
|
var EnvelopeCreator = {
|
|
3598
|
-
Version: "2.8.0-
|
|
3473
|
+
Version: "2.8.0-nightly.2204-05"
|
|
3599
3474
|
};
|
|
3600
3475
|
function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
|
|
3601
3476
|
EnvelopeCreatorInit(logger, telemetryItem);
|
|
@@ -3607,7 +3482,7 @@
|
|
|
3607
3482
|
}
|
|
3608
3483
|
var bd = telemetryItem[strBaseData];
|
|
3609
3484
|
if (isNullOrUndefined(bd)) {
|
|
3610
|
-
logger
|
|
3485
|
+
_warnToConsole(logger, "Invalid input for dependency data");
|
|
3611
3486
|
return null;
|
|
3612
3487
|
}
|
|
3613
3488
|
var method = bd[strProperties] && bd[strProperties][HttpMethod] ? bd[strProperties][HttpMethod] : "GET";
|
|
@@ -3754,18 +3629,18 @@
|
|
|
3754
3629
|
return getJSON().stringify(output);
|
|
3755
3630
|
}
|
|
3756
3631
|
catch (e) {
|
|
3757
|
-
logger
|
|
3632
|
+
_throwInternal(logger, 1 , 48 , (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true);
|
|
3758
3633
|
}
|
|
3759
3634
|
};
|
|
3760
3635
|
function _serializeObject(source, name) {
|
|
3761
3636
|
var circularReferenceCheck = "__aiCircularRefCheck";
|
|
3762
3637
|
var output = {};
|
|
3763
3638
|
if (!source) {
|
|
3764
|
-
logger
|
|
3639
|
+
_throwInternal(logger, 1 , 48 , "cannot serialize object because it is null or undefined", { name: name }, true);
|
|
3765
3640
|
return output;
|
|
3766
3641
|
}
|
|
3767
3642
|
if (source[circularReferenceCheck]) {
|
|
3768
|
-
logger
|
|
3643
|
+
_throwInternal(logger, 2 , 50 , "Circular reference detected while serializing object", { name: name }, true);
|
|
3769
3644
|
return output;
|
|
3770
3645
|
}
|
|
3771
3646
|
if (!source.aiDataContract) {
|
|
@@ -3782,13 +3657,13 @@
|
|
|
3782
3657
|
output = _serializeArray(source, name);
|
|
3783
3658
|
}
|
|
3784
3659
|
else {
|
|
3785
|
-
logger
|
|
3660
|
+
_throwInternal(logger, 2 , 49 , "Attempting to serialize an object which does not implement ISerializable", { name: name }, true);
|
|
3786
3661
|
try {
|
|
3787
3662
|
getJSON().stringify(source);
|
|
3788
3663
|
output = source;
|
|
3789
3664
|
}
|
|
3790
3665
|
catch (e) {
|
|
3791
|
-
logger
|
|
3666
|
+
_throwInternal(logger, 1 , 48 , (e && isFunction(e.toString)) ? e.toString() : "Error serializing object", null, true);
|
|
3792
3667
|
}
|
|
3793
3668
|
}
|
|
3794
3669
|
return output;
|
|
@@ -3801,7 +3676,7 @@
|
|
|
3801
3676
|
var isPresent = source[field] !== undefined;
|
|
3802
3677
|
var isObj = isObject(source[field]) && source[field] !== null;
|
|
3803
3678
|
if (isRequired && !isPresent && !isArray) {
|
|
3804
|
-
logger
|
|
3679
|
+
_throwInternal(logger, 1 , 24 , "Missing required field specification. The field is required but not present on source", { field: field, name: name });
|
|
3805
3680
|
}
|
|
3806
3681
|
else if (!isHidden) {
|
|
3807
3682
|
var value = void 0;
|
|
@@ -3828,7 +3703,7 @@
|
|
|
3828
3703
|
var output;
|
|
3829
3704
|
if (!!sources) {
|
|
3830
3705
|
if (!isArray(sources)) {
|
|
3831
|
-
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);
|
|
3832
3707
|
}
|
|
3833
3708
|
else {
|
|
3834
3709
|
output = [];
|
|
@@ -3879,7 +3754,7 @@
|
|
|
3879
3754
|
}
|
|
3880
3755
|
else {
|
|
3881
3756
|
output[field] = "invalid field: " + name + " is of unknown type.";
|
|
3882
|
-
logger
|
|
3757
|
+
_throwInternal(logger, 1 , output[field], null, true);
|
|
3883
3758
|
}
|
|
3884
3759
|
});
|
|
3885
3760
|
}
|
|
@@ -4130,7 +4005,7 @@
|
|
|
4130
4005
|
_self.triggerSend(isAsync, null, sendReason || 1 );
|
|
4131
4006
|
}
|
|
4132
4007
|
catch (e) {
|
|
4133
|
-
_throwInternal(_self.diagLog(),
|
|
4008
|
+
_throwInternal(_self.diagLog(), 1 , 22 , "flush failed, telemetry will not be collected: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4134
4009
|
}
|
|
4135
4010
|
}
|
|
4136
4011
|
};
|
|
@@ -4141,7 +4016,7 @@
|
|
|
4141
4016
|
_self.triggerSend(true, _doUnloadSend, 2 );
|
|
4142
4017
|
}
|
|
4143
4018
|
catch (e) {
|
|
4144
|
-
_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) });
|
|
4145
4020
|
}
|
|
4146
4021
|
}
|
|
4147
4022
|
else {
|
|
@@ -4154,7 +4029,7 @@
|
|
|
4154
4029
|
};
|
|
4155
4030
|
_self.initialize = function (config, core, extensions, pluginChain) {
|
|
4156
4031
|
if (_self.isInitialized()) {
|
|
4157
|
-
_throwInternal(_self.diagLog(),
|
|
4032
|
+
_throwInternal(_self.diagLog(), 1 , 28 , "Sender is already initialized");
|
|
4158
4033
|
}
|
|
4159
4034
|
_base.initialize(config, core, extensions, pluginChain);
|
|
4160
4035
|
var ctx = _self._getTelCtx();
|
|
@@ -4176,7 +4051,7 @@
|
|
|
4176
4051
|
? new SessionStorageSendBuffer(diagLog, _self._senderConfig) : new ArraySendBuffer(diagLog, _self._senderConfig);
|
|
4177
4052
|
_self._sample = new Sample(_self._senderConfig.samplingPercentage(), diagLog);
|
|
4178
4053
|
if (!_validateInstrumentationKey(config)) {
|
|
4179
|
-
_throwInternal(diagLog,
|
|
4054
|
+
_throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + config.instrumentationKey);
|
|
4180
4055
|
}
|
|
4181
4056
|
if (!isInternalApplicationInsightsEndpoint(_self._senderConfig.endpointUrl()) && _self._senderConfig.customHeaders() && _self._senderConfig.customHeaders().length > 0) {
|
|
4182
4057
|
arrForEach(_self._senderConfig.customHeaders(), function (customHeader) {
|
|
@@ -4222,22 +4097,22 @@
|
|
|
4222
4097
|
return;
|
|
4223
4098
|
}
|
|
4224
4099
|
if (!telemetryItem) {
|
|
4225
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4100
|
+
_throwInternal(itemCtx.diagLog(), 1 , 7 , "Cannot send empty telemetry");
|
|
4226
4101
|
return;
|
|
4227
4102
|
}
|
|
4228
4103
|
if (telemetryItem.baseData && !telemetryItem.baseType) {
|
|
4229
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4104
|
+
_throwInternal(itemCtx.diagLog(), 1 , 70 , "Cannot send telemetry without baseData and baseType");
|
|
4230
4105
|
return;
|
|
4231
4106
|
}
|
|
4232
4107
|
if (!telemetryItem.baseType) {
|
|
4233
4108
|
telemetryItem.baseType = "EventData";
|
|
4234
4109
|
}
|
|
4235
4110
|
if (!_self._sender) {
|
|
4236
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4111
|
+
_throwInternal(itemCtx.diagLog(), 1 , 28 , "Sender was not initialized");
|
|
4237
4112
|
return;
|
|
4238
4113
|
}
|
|
4239
4114
|
if (!_isSampledIn(telemetryItem)) {
|
|
4240
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4115
|
+
_throwInternal(itemCtx.diagLog(), 2 , 33 , "Telemetry item was sampled out and not sent", { SampleRate: _self._sample.sampleRate });
|
|
4241
4116
|
return;
|
|
4242
4117
|
}
|
|
4243
4118
|
else {
|
|
@@ -4247,7 +4122,7 @@
|
|
|
4247
4122
|
var defaultEnvelopeIkey = telemetryItem.iKey || _self._senderConfig.instrumentationKey();
|
|
4248
4123
|
var aiEnvelope_1 = Sender.constructEnvelope(telemetryItem, defaultEnvelopeIkey, itemCtx.diagLog(), convertUndefined);
|
|
4249
4124
|
if (!aiEnvelope_1) {
|
|
4250
|
-
_throwInternal(itemCtx.diagLog(),
|
|
4125
|
+
_throwInternal(itemCtx.diagLog(), 1 , 47 , "Unable to create an AppInsights envelope");
|
|
4251
4126
|
return;
|
|
4252
4127
|
}
|
|
4253
4128
|
var doNotSendItem_1 = false;
|
|
@@ -4256,11 +4131,11 @@
|
|
|
4256
4131
|
try {
|
|
4257
4132
|
if (callBack && callBack(aiEnvelope_1) === false) {
|
|
4258
4133
|
doNotSendItem_1 = true;
|
|
4259
|
-
itemCtx.diagLog()
|
|
4134
|
+
_warnToConsole(itemCtx.diagLog(), "Telemetry processor check returns false");
|
|
4260
4135
|
}
|
|
4261
4136
|
}
|
|
4262
4137
|
catch (e) {
|
|
4263
|
-
_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);
|
|
4264
4139
|
}
|
|
4265
4140
|
});
|
|
4266
4141
|
delete telemetryItem.tags[ProcessLegacy];
|
|
@@ -4278,7 +4153,7 @@
|
|
|
4278
4153
|
_setupTimer();
|
|
4279
4154
|
}
|
|
4280
4155
|
catch (e) {
|
|
4281
|
-
_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) });
|
|
4282
4157
|
}
|
|
4283
4158
|
_self.processNext(telemetryItem, itemCtx);
|
|
4284
4159
|
};
|
|
@@ -4313,7 +4188,7 @@
|
|
|
4313
4188
|
catch (e) {
|
|
4314
4189
|
var ieVer = getIEVersion();
|
|
4315
4190
|
if (!ieVer || ieVer > 9) {
|
|
4316
|
-
_throwInternal(_self.diagLog(),
|
|
4191
|
+
_throwInternal(_self.diagLog(), 1 , 40 , "Telemetry transmission failed, some telemetry will be lost: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4317
4192
|
}
|
|
4318
4193
|
}
|
|
4319
4194
|
}
|
|
@@ -4324,7 +4199,7 @@
|
|
|
4324
4199
|
_initDefaults();
|
|
4325
4200
|
};
|
|
4326
4201
|
_self._onError = function (payload, message, event) {
|
|
4327
|
-
_throwInternal(_self.diagLog(),
|
|
4202
|
+
_throwInternal(_self.diagLog(), 2 , 26 , "Failed to send telemetry.", { message: message });
|
|
4328
4203
|
_self._buffer.clearSent(payload);
|
|
4329
4204
|
};
|
|
4330
4205
|
_self._onPartialSuccess = function (payload, results) {
|
|
@@ -4349,7 +4224,7 @@
|
|
|
4349
4224
|
}
|
|
4350
4225
|
if (retry.length > 0) {
|
|
4351
4226
|
_resendPayload(retry);
|
|
4352
|
-
_throwInternal(_self.diagLog(),
|
|
4227
|
+
_throwInternal(_self.diagLog(), 2 , 40 , "Partial success. " +
|
|
4353
4228
|
"Delivered: " + payload.length + ", Failed: " + failed.length +
|
|
4354
4229
|
". Will retry to send " + retry.length + " our of " + results.itemsReceived + " items");
|
|
4355
4230
|
}
|
|
@@ -4394,7 +4269,7 @@
|
|
|
4394
4269
|
}
|
|
4395
4270
|
if (!_self._senderConfig.isRetryDisabled() && _isRetriable(status)) {
|
|
4396
4271
|
_resendPayload(payload);
|
|
4397
|
-
_throwInternal(_self.diagLog(),
|
|
4272
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " +
|
|
4398
4273
|
"Response code " + status + ". Will retry to send " + payload.length + " items.");
|
|
4399
4274
|
}
|
|
4400
4275
|
else {
|
|
@@ -4405,7 +4280,7 @@
|
|
|
4405
4280
|
if (!_self._senderConfig.isRetryDisabled()) {
|
|
4406
4281
|
var offlineBackOffMultiplier = 10;
|
|
4407
4282
|
_resendPayload(payload, offlineBackOffMultiplier);
|
|
4408
|
-
_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."));
|
|
4409
4284
|
}
|
|
4410
4285
|
}
|
|
4411
4286
|
else {
|
|
@@ -4473,7 +4348,7 @@
|
|
|
4473
4348
|
}
|
|
4474
4349
|
if (droppedPayload.length > 0) {
|
|
4475
4350
|
_fallbackSender && _fallbackSender(droppedPayload, true);
|
|
4476
|
-
_throwInternal(_self.diagLog(),
|
|
4351
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with normal sender.");
|
|
4477
4352
|
}
|
|
4478
4353
|
}
|
|
4479
4354
|
}
|
|
@@ -4514,7 +4389,7 @@
|
|
|
4514
4389
|
}
|
|
4515
4390
|
else {
|
|
4516
4391
|
_fallbackSender && _fallbackSender(payload, true);
|
|
4517
|
-
_throwInternal(_self.diagLog(),
|
|
4392
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " + "Failed to send telemetry with Beacon API, retried with xhrSender.");
|
|
4518
4393
|
}
|
|
4519
4394
|
}
|
|
4520
4395
|
}
|
|
@@ -4605,7 +4480,7 @@
|
|
|
4605
4480
|
}
|
|
4606
4481
|
}
|
|
4607
4482
|
catch (e) {
|
|
4608
|
-
_throwInternal(_self.diagLog(),
|
|
4483
|
+
_throwInternal(_self.diagLog(), 1 , 43 , "Cannot parse the response. " + getExceptionName(e), {
|
|
4609
4484
|
response: response
|
|
4610
4485
|
});
|
|
4611
4486
|
}
|
|
@@ -4676,7 +4551,7 @@
|
|
|
4676
4551
|
xdr.onerror = function (event) { return _self._onError(payload, _formatErrorMessageXdr(xdr), event); };
|
|
4677
4552
|
var hostingProtocol = _window && _window.location && _window.location.protocol || "";
|
|
4678
4553
|
if (_self._senderConfig.endpointUrl().lastIndexOf(hostingProtocol, 0) !== 0) {
|
|
4679
|
-
_throwInternal(_self.diagLog(),
|
|
4554
|
+
_throwInternal(_self.diagLog(), 2 , 40 , ". " +
|
|
4680
4555
|
"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.");
|
|
4681
4556
|
buffer.clear();
|
|
4682
4557
|
return;
|
|
@@ -4707,7 +4582,7 @@
|
|
|
4707
4582
|
manager.eventsSendRequest(sendRequest, isAsync);
|
|
4708
4583
|
}
|
|
4709
4584
|
catch (e) {
|
|
4710
|
-
_throwInternal(_self.diagLog(),
|
|
4585
|
+
_throwInternal(_self.diagLog(), 1 , 74 , "send request notification failed: " + getExceptionName(e), { exception: dumpObj(e) });
|
|
4711
4586
|
}
|
|
4712
4587
|
}
|
|
4713
4588
|
}
|