@microsoft/applicationinsights-offlinechannel-js 0.3.0-nightly3.2406-07 → 0.3.0-nightly3.2406-09
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/dist/es5/applicationinsights-offlinechannel-js.js +71 -50
- package/dist/es5/applicationinsights-offlinechannel-js.js.map +1 -1
- package/dist/es5/applicationinsights-offlinechannel-js.min.js +2 -2
- package/dist/es5/applicationinsights-offlinechannel-js.min.js.map +1 -1
- package/dist-es5/Helpers/Utils.js +1 -1
- package/dist-es5/InMemoryBatch.js +1 -1
- package/dist-es5/Interfaces/IInMemoryBatch.js +1 -1
- package/dist-es5/Interfaces/IOfflineBatch.js +1 -1
- package/dist-es5/Interfaces/IOfflineIndexDb.js +1 -1
- package/dist-es5/Interfaces/IOfflineProvider.js +1 -1
- package/dist-es5/Interfaces/ISender.js +1 -1
- package/dist-es5/OfflineBatchHandler.js +1 -1
- package/dist-es5/OfflineChannel.js +17 -7
- package/dist-es5/OfflineChannel.js.map +1 -1
- package/dist-es5/PayloadHelper.js +1 -1
- package/dist-es5/Providers/IndexDbHelper.js +1 -1
- package/dist-es5/Providers/IndexDbProvider.js +8 -3
- package/dist-es5/Providers/IndexDbProvider.js.map +1 -1
- package/dist-es5/Providers/WebStorageProvider.js +1 -1
- package/dist-es5/Sender.js +1 -1
- package/dist-es5/__DynamicConstants.js +3 -3
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-offlinechannel-js.js +1 -1
- package/package.json +3 -3
- package/types/applicationinsights-offlinechannel-js.d.ts +1 -1
- package/types/applicationinsights-offlinechannel-js.namespaced.d.ts +52 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Offline Channel, 0.3.0-nightly3.2406-
|
|
2
|
+
* Application Insights JavaScript SDK - Offline Channel, 0.3.0-nightly3.2406-09
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {})));
|
|
9
9
|
})(this, (function (exports) { 'use strict';
|
|
10
10
|
|
|
11
|
-
/*! https://github.com/nevware21/ts-utils v0.11.
|
|
11
|
+
/*! https://github.com/nevware21/ts-utils v0.11.3 */
|
|
12
12
|
/*#__NO_SIDE_EFFECTS__*/
|
|
13
13
|
function _pureAssign(func1, func2) {
|
|
14
14
|
return func1 || func2;
|
|
@@ -108,14 +108,52 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
var propMap = {
|
|
112
|
+
e: "enumerable",
|
|
113
|
+
c: "configurable",
|
|
114
|
+
v: "value",
|
|
115
|
+
w: "writable",
|
|
116
|
+
g: "get",
|
|
117
|
+
s: "set"
|
|
118
|
+
};
|
|
111
119
|
/*#__NO_SIDE_EFFECTS__*/
|
|
112
|
-
function
|
|
120
|
+
function _createProp(value) {
|
|
121
|
+
var prop = {};
|
|
122
|
+
prop[propMap["c"]] = true;
|
|
123
|
+
prop[propMap["e"]] = true;
|
|
124
|
+
if (value.l) {
|
|
125
|
+
prop.get = function () { return value.l.v; };
|
|
126
|
+
var desc = objGetOwnPropertyDescriptor(value.l, "v");
|
|
127
|
+
if (desc && desc.set) {
|
|
128
|
+
prop.set = function (newValue) {
|
|
129
|
+
value.l.v = newValue;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
objForEachKey(value, function (key, value) {
|
|
134
|
+
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
135
|
+
});
|
|
136
|
+
return prop;
|
|
137
|
+
}
|
|
138
|
+
var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass$1, "defineProperty"));
|
|
139
|
+
function objDefine(target, key, propDesc) {
|
|
140
|
+
return objDefineProp(target, key, _createProp(propDesc));
|
|
141
|
+
}
|
|
142
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
143
|
+
function _createKeyValueMap(values, keyType, valueType, completeFn, writable) {
|
|
113
144
|
var theMap = {};
|
|
114
145
|
objForEachKey(values, function (key, value) {
|
|
115
|
-
theMap
|
|
116
|
-
theMap
|
|
146
|
+
_assignMapValue(theMap, key, keyType ? value : key, writable);
|
|
147
|
+
_assignMapValue(theMap, value, valueType ? value : key, writable);
|
|
148
|
+
});
|
|
149
|
+
return completeFn ? completeFn(theMap) : theMap;
|
|
150
|
+
}
|
|
151
|
+
function _assignMapValue(theMap, key, value, writable) {
|
|
152
|
+
objDefineProp(theMap, key, {
|
|
153
|
+
value: value,
|
|
154
|
+
enumerable: true,
|
|
155
|
+
writable: !!writable
|
|
117
156
|
});
|
|
118
|
-
return completeFn(theMap);
|
|
119
157
|
}
|
|
120
158
|
var asString = ( /* #__PURE__ */_pureAssign(StrCls));
|
|
121
159
|
var ERROR_TYPE = "[object Error]";
|
|
@@ -151,7 +189,7 @@
|
|
|
151
189
|
if (_objFreeze) {
|
|
152
190
|
objForEachKey(value, function (key, value) {
|
|
153
191
|
if (isArray(value) || isObject(value)) {
|
|
154
|
-
|
|
192
|
+
objDeepFreeze(value);
|
|
155
193
|
}
|
|
156
194
|
});
|
|
157
195
|
}
|
|
@@ -161,11 +199,11 @@
|
|
|
161
199
|
var objGetPrototypeOf = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass$1, "getPrototypeOf")), _getProto));
|
|
162
200
|
/*#__NO_SIDE_EFFECTS__*/
|
|
163
201
|
function createEnum(values) {
|
|
164
|
-
return _createKeyValueMap(values, 1 , 0 ,
|
|
202
|
+
return _createKeyValueMap(values, 1 , 0 , objFreeze);
|
|
165
203
|
}
|
|
166
204
|
/*#__NO_SIDE_EFFECTS__*/
|
|
167
205
|
function createEnumKeyMap(values) {
|
|
168
|
-
return _createKeyValueMap(values, 0 , 0 ,
|
|
206
|
+
return _createKeyValueMap(values, 0 , 0 , objFreeze);
|
|
169
207
|
}
|
|
170
208
|
var _wellKnownSymbolMap = /*#__PURE__*/ createEnumKeyMap({
|
|
171
209
|
asyncIterator: 0 ,
|
|
@@ -291,37 +329,6 @@
|
|
|
291
329
|
}
|
|
292
330
|
return result;
|
|
293
331
|
}
|
|
294
|
-
var propMap = {
|
|
295
|
-
e: "enumerable",
|
|
296
|
-
c: "configurable",
|
|
297
|
-
v: "value",
|
|
298
|
-
w: "writable",
|
|
299
|
-
g: "get",
|
|
300
|
-
s: "set"
|
|
301
|
-
};
|
|
302
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
303
|
-
function _createProp(value) {
|
|
304
|
-
var prop = {};
|
|
305
|
-
prop[propMap["c"]] = true;
|
|
306
|
-
prop[propMap["e"]] = true;
|
|
307
|
-
if (value.l) {
|
|
308
|
-
prop.get = function () { return value.l.v; };
|
|
309
|
-
var desc = objGetOwnPropertyDescriptor(value.l, "v");
|
|
310
|
-
if (desc && desc.set) {
|
|
311
|
-
prop.set = function (newValue) {
|
|
312
|
-
value.l.v = newValue;
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
objForEachKey(value, function (key, value) {
|
|
317
|
-
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
318
|
-
});
|
|
319
|
-
return prop;
|
|
320
|
-
}
|
|
321
|
-
var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass$1, "defineProperty"));
|
|
322
|
-
function objDefine(target, key, propDesc) {
|
|
323
|
-
return objDefineProp(target, key, _createProp(propDesc));
|
|
324
|
-
}
|
|
325
332
|
var _globalLazyTestHooks;
|
|
326
333
|
function _initTestHooks() {
|
|
327
334
|
_globalLazyTestHooks = _getGlobalConfig();
|
|
@@ -729,6 +736,7 @@
|
|
|
729
736
|
var _DYN_INITIALIZE$1 = "initialize";
|
|
730
737
|
var _DYN_IDENTIFIER = "identifier";
|
|
731
738
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
739
|
+
var _DYN_VALUE$1 = "value";
|
|
732
740
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
733
741
|
var _DYN_NAME$1 = "name";
|
|
734
742
|
var _DYN_TIME = "time";
|
|
@@ -1972,7 +1980,7 @@
|
|
|
1972
1980
|
return result;
|
|
1973
1981
|
}
|
|
1974
1982
|
|
|
1975
|
-
var version$1 = '3.3.0-nightly3.2406-
|
|
1983
|
+
var version$1 = '3.3.0-nightly3.2406-09';
|
|
1976
1984
|
var instanceName = "." + newId(6);
|
|
1977
1985
|
var _dataUid = 0;
|
|
1978
1986
|
function _canAcceptData(target) {
|
|
@@ -3869,7 +3877,7 @@
|
|
|
3869
3877
|
if (!responseHandled) {
|
|
3870
3878
|
responseHandled = true;
|
|
3871
3879
|
if (!result.rejected) {
|
|
3872
|
-
var response_1 = result
|
|
3880
|
+
var response_1 = result[_DYN_VALUE$1 ];
|
|
3873
3881
|
try {
|
|
3874
3882
|
if (!_isOneDs && !response_1.ok) {
|
|
3875
3883
|
_handleError(response_1.statusText);
|
|
@@ -3882,7 +3890,7 @@
|
|
|
3882
3890
|
}
|
|
3883
3891
|
else {
|
|
3884
3892
|
doAwaitResponse(response_1.text(), function (resp) {
|
|
3885
|
-
_onFetchComplete(response_1, payload, resp
|
|
3893
|
+
_onFetchComplete(response_1, payload, resp[_DYN_VALUE$1 ]);
|
|
3886
3894
|
resolveFunc && resolveFunc(true);
|
|
3887
3895
|
});
|
|
3888
3896
|
}
|
|
@@ -4350,9 +4358,9 @@
|
|
|
4350
4358
|
var _DYN_CREATE_ONE_DSPAYLOAD = "createOneDSPayload";
|
|
4351
4359
|
var _DYN_CRITICAL_CNT = "criticalCnt";
|
|
4352
4360
|
var _DYN_IS_COMPLETELY_IDLE = "isCompletelyIdle";
|
|
4361
|
+
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
4353
4362
|
var _DYN_GET_OFFLINE_SUPPORT = "getOfflineSupport";
|
|
4354
4363
|
var _DYN_OVERRIDE_INSTRUMENTA1 = "overrideInstrumentationKey";
|
|
4355
|
-
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
4356
4364
|
var _DYN_NOTIFICATION_MGR = "notificationMgr";
|
|
4357
4365
|
var _DYN_TO_STRING = "toString";
|
|
4358
4366
|
var _DYN_ENABLE_SEND_PROMISE = "enableSendPromise";
|
|
@@ -5055,7 +5063,11 @@
|
|
|
5055
5063
|
}
|
|
5056
5064
|
var coreConfig = providerContext[_DYN_ITEM_CTX ].getCfg();
|
|
5057
5065
|
var itemCtx = providerContext[_DYN_ITEM_CTX ];
|
|
5058
|
-
|
|
5066
|
+
var ikey = itemCtx.getCfg()[_DYN_INSTRUMENTATION_KEY ] || coreConfig[_DYN_INSTRUMENTATION_KEY ];
|
|
5067
|
+
if (!isString(ikey)) {
|
|
5068
|
+
return;
|
|
5069
|
+
}
|
|
5070
|
+
_iKey = ikey;
|
|
5059
5071
|
var storageConfig = providerContext[_DYN_STORAGE_CONFIG ];
|
|
5060
5072
|
_storageId = _this.id || providerContext.id || newGuid();
|
|
5061
5073
|
_notificationManager = providerContext[_DYN_NOTIFICATION_MGR ];
|
|
@@ -6322,7 +6334,7 @@
|
|
|
6322
6334
|
return Sender;
|
|
6323
6335
|
}());
|
|
6324
6336
|
|
|
6325
|
-
var version = '0.3.0-nightly3.2406-
|
|
6337
|
+
var version = '0.3.0-nightly3.2406-09';
|
|
6326
6338
|
var DefaultOfflineIdentifier = "OfflineChannel";
|
|
6327
6339
|
var DefaultBatchInterval = 15000;
|
|
6328
6340
|
var DefaultInMemoMaxTime = 15000;
|
|
@@ -6599,11 +6611,11 @@
|
|
|
6599
6611
|
_storeNotification(sentItems_1);
|
|
6600
6612
|
}
|
|
6601
6613
|
};
|
|
6602
|
-
if (payloadData) {
|
|
6614
|
+
if (payloadData && _urlCfg && _urlCfg[_DYN_BATCH_HANDLER ]) {
|
|
6603
6615
|
var promise = _urlCfg[_DYN_BATCH_HANDLER ].storeBatch(payloadData, callback, unload);
|
|
6604
6616
|
_queueStorageEvent("storeBatch", promise);
|
|
6605
6617
|
}
|
|
6606
|
-
if (!_inMemoBatch[_DYN_COUNT ]()) {
|
|
6618
|
+
if (_inMemoBatch && !_inMemoBatch[_DYN_COUNT ]()) {
|
|
6607
6619
|
_inMemoFlushTimer && _inMemoFlushTimer[_DYN_CANCEL ]();
|
|
6608
6620
|
}
|
|
6609
6621
|
}
|
|
@@ -6636,8 +6648,10 @@
|
|
|
6636
6648
|
batchDropNotification(_notificationManager, 1, 1 );
|
|
6637
6649
|
}
|
|
6638
6650
|
};
|
|
6639
|
-
|
|
6640
|
-
|
|
6651
|
+
if (_urlCfg && _urlCfg[_DYN_BATCH_HANDLER ]) {
|
|
6652
|
+
var promise = _urlCfg.batchHandler[_DYN_SEND_NEXT_BATCH ](callback, false, _senderInst);
|
|
6653
|
+
_queueStorageEvent("sendNextBatch", promise);
|
|
6654
|
+
}
|
|
6641
6655
|
}
|
|
6642
6656
|
}
|
|
6643
6657
|
else {
|
|
@@ -6726,6 +6740,13 @@
|
|
|
6726
6740
|
}
|
|
6727
6741
|
function _createUrlConfig(coreConfig, core, extensions, pluginChain) {
|
|
6728
6742
|
_self._addHook(onConfigChange(coreConfig, function (details) {
|
|
6743
|
+
if (!isString(coreConfig[_DYN_INSTRUMENTATION_KEY ]) || !isString(coreConfig.endpointUrl)) {
|
|
6744
|
+
_self.pause();
|
|
6745
|
+
return;
|
|
6746
|
+
}
|
|
6747
|
+
if (_paused) {
|
|
6748
|
+
_self.resume();
|
|
6749
|
+
}
|
|
6729
6750
|
var storageConfig = null;
|
|
6730
6751
|
var theConfig = details.cfg;
|
|
6731
6752
|
var ctx = createProcessTelemetryContext(null, theConfig, core);
|