@microsoft/applicationinsights-teechannel-js 3.0.1-nightly3.2304-41 → 3.0.1-nightly3.2305-01
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/es5/{applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.js → applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.js} +318 -19
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.cjs.min.js.map +1 -0
- package/browser/es5/{applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.js → applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.js} +318 -19
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.gbl.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.integrity.json +66 -0
- package/browser/es5/{applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.js → applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.js} +318 -19
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2305-01.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.js +317 -18
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.js +317 -18
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-teechannel-js.3.js +317 -18
- package/browser/es5/applicationinsights-teechannel-js.3.js.map +1 -1
- package/browser/es5/applicationinsights-teechannel-js.3.min.js +2 -2
- package/browser/es5/applicationinsights-teechannel-js.3.min.js.map +1 -1
- package/dist/es5/applicationinsights-teechannel-js.js +317 -18
- package/dist/es5/applicationinsights-teechannel-js.js.map +1 -1
- package/dist/es5/applicationinsights-teechannel-js.min.js +2 -2
- package/dist/es5/applicationinsights-teechannel-js.min.js.map +1 -1
- package/dist-es5/ChannelController.js +9 -2
- package/dist-es5/ChannelController.js.map +1 -1
- package/dist-es5/Interfaces/ITeeChannelConfig.js +1 -1
- package/dist-es5/TeeChannel.js +1 -1
- package/dist-es5/TeeChannel.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +1 -1
- package/dist-es5/applicationinsights-teechannel-js.js +1 -1
- package/package.json +5 -4
- package/types/applicationinsights-teechannel-js.d.ts +17 -4
- package/types/applicationinsights-teechannel-js.namespaced.d.ts +17 -4
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.js.map +0 -1
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.min.js +0 -6
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.cjs.min.js.map +0 -1
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.js.map +0 -1
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.min.js +0 -6
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.gbl.min.js.map +0 -1
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.integrity.json +0 -66
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.js.map +0 -1
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.min.js +0 -6
- package/browser/es5/applicationinsights-teechannel-js.3.0.1-nightly3.2304-41.min.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Tee Channel, 3.0.1-nightly3.
|
|
2
|
+
* Application Insights JavaScript SDK - Tee Channel, 3.0.1-nightly3.2305-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import { createProcessTelemetryContext } from "@microsoft/applicationinsights-core-js";
|
|
8
|
+
import { createPromise } from "@nevware21/ts-async";
|
|
8
9
|
import { arrForEach, scheduleTimeout } from "@nevware21/ts-utils";
|
|
9
10
|
import { _DYN_IDENTIFIER, _DYN_LENGTH, _DYN_PROCESS_NEXT, _DYN_QUEUE } from "./__DynamicConstants";
|
|
10
11
|
export var ChannelControllerPriority = 500;
|
|
@@ -121,7 +122,13 @@ export function createChannelControllerPlugin() {
|
|
|
121
122
|
var waiting = 1;
|
|
122
123
|
var doneIterating = false;
|
|
123
124
|
var cbTimer = null;
|
|
125
|
+
var result = true;
|
|
124
126
|
cbTimeout = cbTimeout || 5000;
|
|
127
|
+
if (isAsync && !callBack) {
|
|
128
|
+
result = createPromise(function (resolve) {
|
|
129
|
+
callBack = resolve;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
125
132
|
function doCallback() {
|
|
126
133
|
waiting--;
|
|
127
134
|
if (doneIterating && waiting === 0) {
|
|
@@ -162,7 +169,7 @@ export function createChannelControllerPlugin() {
|
|
|
162
169
|
doneIterating = true;
|
|
163
170
|
doCallback();
|
|
164
171
|
});
|
|
165
|
-
return
|
|
172
|
+
return result;
|
|
166
173
|
}
|
|
167
174
|
};
|
|
168
175
|
return channelController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelController.js.map","sources":["ChannelController.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createProcessTelemetryContext } from \"@microsoft/applicationinsights-core-js\";\r\nimport { arrForEach, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_IDENTIFIER, _DYN_LENGTH, _DYN_PROCESS_NEXT, _DYN_QUEUE } from \"./__DynamicConstants\";\r\nexport var ChannelControllerPriority = 500;\r\nfunction _getTelCtx(core) {\r\n return createProcessTelemetryContext(null, core.config, core, null);\r\n}\r\nfunction _processChannelQueue(theChannels, itemCtx, processFn, onComplete) {\r\n var waiting = theChannels ? (theChannels[_DYN_LENGTH /* @min:%2elength */] + 1) : 1;\r\n function _runChainOnComplete() {\r\n waiting--;\r\n if (waiting === 0) {\r\n onComplete && onComplete();\r\n onComplete = null;\r\n }\r\n }\r\n if (waiting > 0) {\r\n arrForEach(theChannels, function (channels) {\r\n // pass on to first item in queue\r\n if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var chainCtx = itemCtx.createNew(channels[_DYN_QUEUE /* @min:%2equeue */]);\r\n chainCtx.onComplete(_runChainOnComplete);\r\n // Cause this chain to start processing\r\n processFn(chainCtx);\r\n }\r\n else {\r\n waiting--;\r\n }\r\n });\r\n }\r\n _runChainOnComplete();\r\n}\r\nexport function createChannelControllerPlugin() {\r\n var _channelQueue = [];\r\n var _core = null;\r\n function _doUpdate(updateCtx, updateState) {\r\n var theUpdateState = updateState || {\r\n reason: 0 /* TelemetryUpdateReason.Unknown */\r\n };\r\n _processChannelQueue(_channelQueue, updateCtx, function (chainCtx) {\r\n chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);\r\n }, function () {\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);\r\n });\r\n return true;\r\n }\r\n function _getChannel(pluginIdentifier) {\r\n var thePlugin = null;\r\n if (_channelQueue && _channelQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(_channelQueue, function (channels) {\r\n // pass on to first item in queue\r\n if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(channels[_DYN_QUEUE /* @min:%2equeue */], function (ext) {\r\n if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier) {\r\n thePlugin = ext;\r\n // Cause arrForEach to stop iterating\r\n return -1;\r\n }\r\n });\r\n if (thePlugin) {\r\n // Cause arrForEach to stop iterating\r\n return -1;\r\n }\r\n }\r\n });\r\n }\r\n return thePlugin;\r\n }\r\n var channelController = {\r\n init: function (channelQueue, core) {\r\n _channelQueue = channelQueue;\r\n _core = core;\r\n },\r\n getQueues: function () {\r\n return _channelQueue;\r\n },\r\n processTelemetry: function (item, itemCtx) {\r\n _processChannelQueue(_channelQueue, itemCtx || _getTelCtx(_core), function (chainCtx) {\r\n chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);\r\n }, function () {\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);\r\n });\r\n },\r\n update: _doUpdate,\r\n pause: function () {\r\n _processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {\r\n chainCtx.iterate(function (plugin) {\r\n plugin.pause && plugin.pause();\r\n });\r\n }, null);\r\n },\r\n resume: function () {\r\n _processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {\r\n chainCtx.iterate(function (plugin) {\r\n plugin.resume && plugin.resume();\r\n });\r\n }, null);\r\n },\r\n teardown: function (unloadCtx, unloadState, onComplete) {\r\n var theUnloadState = unloadState || {\r\n reason: 0 /* TelemetryUnloadReason.ManualTeardown */,\r\n isAsync: false\r\n };\r\n _processChannelQueue(_channelQueue, unloadCtx, function (chainCtx) {\r\n chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n }, function () {\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n onComplete && onComplete();\r\n });\r\n return true;\r\n },\r\n getChannel: _getChannel,\r\n flush: function (isAsync, callBack, sendReason, cbTimeout) {\r\n // Setting waiting to one so that we don't call the callBack until we finish iterating\r\n var waiting = 1;\r\n var doneIterating = false;\r\n var cbTimer = null;\r\n cbTimeout = cbTimeout || 5000;\r\n function doCallback() {\r\n waiting--;\r\n if (doneIterating && waiting === 0) {\r\n cbTimer && cbTimer.cancel();\r\n cbTimer = null;\r\n callBack && callBack(doneIterating);\r\n callBack = null;\r\n }\r\n }\r\n _processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {\r\n chainCtx.iterate(function (plugin) {\r\n if (plugin.flush) {\r\n waiting++;\r\n var handled_1 = false;\r\n // Not all channels will call this callback for every scenario\r\n if (!plugin.flush(isAsync, function () {\r\n handled_1 = true;\r\n doCallback();\r\n }, sendReason)) {\r\n if (!handled_1) {\r\n // If any channel doesn't return true and it didn't call the callback, then we should assume that the callback\r\n // will never be called, so use a timeout to allow the channel(s) some time to \"finish\" before triggering any\r\n // followup function (such as unloading)\r\n if (isAsync && cbTimer == null) {\r\n cbTimer = scheduleTimeout(function () {\r\n cbTimer = null;\r\n doCallback();\r\n }, cbTimeout);\r\n }\r\n else {\r\n doCallback();\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }, function () {\r\n doneIterating = true;\r\n doCallback();\r\n });\r\n return
|
|
1
|
+
{"version":3,"file":"ChannelController.js.map","sources":["ChannelController.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { createProcessTelemetryContext } from \"@microsoft/applicationinsights-core-js\";\r\nimport { createPromise } from \"@nevware21/ts-async\";\r\nimport { arrForEach, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_IDENTIFIER, _DYN_LENGTH, _DYN_PROCESS_NEXT, _DYN_QUEUE } from \"./__DynamicConstants\";\r\nexport var ChannelControllerPriority = 500;\r\nfunction _getTelCtx(core) {\r\n return createProcessTelemetryContext(null, core.config, core, null);\r\n}\r\nfunction _processChannelQueue(theChannels, itemCtx, processFn, onComplete) {\r\n var waiting = theChannels ? (theChannels[_DYN_LENGTH /* @min:%2elength */] + 1) : 1;\r\n function _runChainOnComplete() {\r\n waiting--;\r\n if (waiting === 0) {\r\n onComplete && onComplete();\r\n onComplete = null;\r\n }\r\n }\r\n if (waiting > 0) {\r\n arrForEach(theChannels, function (channels) {\r\n // pass on to first item in queue\r\n if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var chainCtx = itemCtx.createNew(channels[_DYN_QUEUE /* @min:%2equeue */]);\r\n chainCtx.onComplete(_runChainOnComplete);\r\n // Cause this chain to start processing\r\n processFn(chainCtx);\r\n }\r\n else {\r\n waiting--;\r\n }\r\n });\r\n }\r\n _runChainOnComplete();\r\n}\r\nexport function createChannelControllerPlugin() {\r\n var _channelQueue = [];\r\n var _core = null;\r\n function _doUpdate(updateCtx, updateState) {\r\n var theUpdateState = updateState || {\r\n reason: 0 /* TelemetryUpdateReason.Unknown */\r\n };\r\n _processChannelQueue(_channelQueue, updateCtx, function (chainCtx) {\r\n chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);\r\n }, function () {\r\n updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);\r\n });\r\n return true;\r\n }\r\n function _getChannel(pluginIdentifier) {\r\n var thePlugin = null;\r\n if (_channelQueue && _channelQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(_channelQueue, function (channels) {\r\n // pass on to first item in queue\r\n if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(channels[_DYN_QUEUE /* @min:%2equeue */], function (ext) {\r\n if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier) {\r\n thePlugin = ext;\r\n // Cause arrForEach to stop iterating\r\n return -1;\r\n }\r\n });\r\n if (thePlugin) {\r\n // Cause arrForEach to stop iterating\r\n return -1;\r\n }\r\n }\r\n });\r\n }\r\n return thePlugin;\r\n }\r\n var channelController = {\r\n init: function (channelQueue, core) {\r\n _channelQueue = channelQueue;\r\n _core = core;\r\n },\r\n getQueues: function () {\r\n return _channelQueue;\r\n },\r\n processTelemetry: function (item, itemCtx) {\r\n _processChannelQueue(_channelQueue, itemCtx || _getTelCtx(_core), function (chainCtx) {\r\n chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);\r\n }, function () {\r\n itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);\r\n });\r\n },\r\n update: _doUpdate,\r\n pause: function () {\r\n _processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {\r\n chainCtx.iterate(function (plugin) {\r\n plugin.pause && plugin.pause();\r\n });\r\n }, null);\r\n },\r\n resume: function () {\r\n _processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {\r\n chainCtx.iterate(function (plugin) {\r\n plugin.resume && plugin.resume();\r\n });\r\n }, null);\r\n },\r\n teardown: function (unloadCtx, unloadState, onComplete) {\r\n var theUnloadState = unloadState || {\r\n reason: 0 /* TelemetryUnloadReason.ManualTeardown */,\r\n isAsync: false\r\n };\r\n _processChannelQueue(_channelQueue, unloadCtx, function (chainCtx) {\r\n chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n }, function () {\r\n unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);\r\n onComplete && onComplete();\r\n });\r\n return true;\r\n },\r\n getChannel: _getChannel,\r\n flush: function (isAsync, callBack, sendReason, cbTimeout) {\r\n // Setting waiting to one so that we don't call the callBack until we finish iterating\r\n var waiting = 1;\r\n var doneIterating = false;\r\n var cbTimer = null;\r\n var result = true;\r\n cbTimeout = cbTimeout || 5000;\r\n if (isAsync && !callBack) {\r\n result = createPromise(function (resolve) {\r\n callBack = resolve;\r\n });\r\n }\r\n function doCallback() {\r\n waiting--;\r\n if (doneIterating && waiting === 0) {\r\n cbTimer && cbTimer.cancel();\r\n cbTimer = null;\r\n callBack && callBack(doneIterating);\r\n callBack = null;\r\n }\r\n }\r\n _processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {\r\n chainCtx.iterate(function (plugin) {\r\n if (plugin.flush) {\r\n waiting++;\r\n var handled_1 = false;\r\n // Not all channels will call this callback for every scenario\r\n if (!plugin.flush(isAsync, function () {\r\n handled_1 = true;\r\n doCallback();\r\n }, sendReason)) {\r\n if (!handled_1) {\r\n // If any channel doesn't return true and it didn't call the callback, then we should assume that the callback\r\n // will never be called, so use a timeout to allow the channel(s) some time to \"finish\" before triggering any\r\n // followup function (such as unloading)\r\n if (isAsync && cbTimer == null) {\r\n cbTimer = scheduleTimeout(function () {\r\n cbTimer = null;\r\n doCallback();\r\n }, cbTimeout);\r\n }\r\n else {\r\n doCallback();\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }, function () {\r\n doneIterating = true;\r\n doCallback();\r\n });\r\n return result;\r\n }\r\n };\r\n return channelController;\r\n}\r\n//# sourceMappingURL=ChannelController.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-es5/TeeChannel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeeChannel.js.map","sources":["TeeChannel.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar _a;\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BaseTelemetryPlugin, cfgDfBoolean, createProcessTelemetryContext, initializePlugins, onConfigChange, proxyFunctions } from \"@microsoft/applicationinsights-core-js\";\r\nimport { arrForEach, isArray, objDeepFreeze, objFreeze, throwError } from \"@nevware21/ts-utils\";\r\nimport { ChannelControllerPriority, createChannelControllerPlugin } from \"./ChannelController\";\r\nimport { _DYN_GET_QUEUES, _DYN_IDENTIFIER, _DYN_IGNORE_CORE_CHANNELS, _DYN_LENGTH, _DYN_PRIORITY, _DYN_QUEUE, _DYN_TEARDOWN, _DYN_TEE_CHANNELS } from \"./__DynamicConstants\";\r\nvar ChannelValidationMessage = \"Channel has invalid priority - \";\r\nvar defaultTeeChannelConfig = objDeepFreeze((_a = {},\r\n _a[_DYN_TEE_CHANNELS /* @min:teeChannels */] = null,\r\n _a[_DYN_IGNORE_CORE_CHANNELS /* @min:ignoreCoreChannels */] = cfgDfBoolean(),\r\n _a));\r\nfunction _addChannelQueue(channelQueue, queue, core, teeChannel) {\r\n var _a;\r\n if (queue && isArray(queue) && queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a[_DYN_PRIORITY /* @min:%2epriority */] - b[_DYN_PRIORITY /* @min:%2epriority */];\r\n });\r\n var _queue_1 = [];\r\n arrForEach(queue, function (queueItem) {\r\n if (queueItem[_DYN_PRIORITY /* @min:%2epriority */] < ChannelControllerPriority) {\r\n throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER /* @min:%2eidentifier */]);\r\n }\r\n if (queueItem !== teeChannel) {\r\n _queue_1.push(queueItem);\r\n }\r\n });\r\n channelQueue.push((_a = {},\r\n _a[_DYN_QUEUE /* @min:queue */] = objFreeze(_queue_1),\r\n _a));\r\n }\r\n}\r\nfunction _createChannelQueues(config, core, teeChannel) {\r\n var channelQueue = [];\r\n if (config) {\r\n if (!config[_DYN_IGNORE_CORE_CHANNELS /* @min:%2eignoreCoreChannels */] && core.config.channels) {\r\n // Add and sort the configuration channel queues\r\n arrForEach(core.config.channels, function (queue, idx) {\r\n if (idx > 0) {\r\n _addChannelQueue(channelQueue, queue, core, teeChannel);\r\n }\r\n });\r\n }\r\n if (config[_DYN_TEE_CHANNELS /* @min:%2eteeChannels */]) {\r\n // Add and sort the configuration channel queues\r\n arrForEach(config[_DYN_TEE_CHANNELS /* @min:%2eteeChannels */], function (queue) { return _addChannelQueue(channelQueue, queue, core, teeChannel); });\r\n }\r\n }\r\n return channelQueue;\r\n}\r\nvar TeeChannel = /** @class */ (function (_super) {\r\n __extends(TeeChannel, _super);\r\n function TeeChannel() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"TeeChannelController\";\r\n _this.priority = 999;\r\n var _channelController;\r\n var _isInitialized;\r\n dynamicProto(TeeChannel, _this, function (_self, base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (!_isInitialized) {\r\n _isInitialized = true;\r\n _initChannels(_self, core);\r\n }\r\n };\r\n _self.getTeeChannels = function () {\r\n var controls = [];\r\n var channelQueues = _channelController[_DYN_GET_QUEUES /* @min:%2egetQueues */]();\r\n if (channelQueues) {\r\n arrForEach(channelQueues, function (channels) {\r\n controls.push(channels[_DYN_QUEUE /* @min:%2equeue */]);\r\n });\r\n }\r\n return objFreeze(controls);\r\n };\r\n _self.isInitialized = function () {\r\n return _isInitialized;\r\n };\r\n _self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {\r\n return _channelController[_DYN_TEARDOWN /* @min:%2eteardown */](unloadCtx, unloadState, function () {\r\n _isInitialized = false;\r\n });\r\n };\r\n proxyFunctions(_self, _channelController, [\r\n \"processTelemetry\",\r\n \"update\",\r\n \"pause\",\r\n \"resume\",\r\n \"getChannel\",\r\n \"flush\"\r\n ]);\r\n });\r\n function _initDefaults() {\r\n _channelController = createChannelControllerPlugin();\r\n _isInitialized = false;\r\n }\r\n function _initChannels(self, core) {\r\n // This function will be re-called whenever any referenced configuration is changed\r\n self._addHook(onConfigChange(core.config, function (details) {\r\n var ctx = createProcessTelemetryContext(null, details.cfg, core);\r\n var theConfig = ctx.getExtCfg(self[_DYN_IDENTIFIER /* @min:%2eidentifier */], defaultTeeChannelConfig);\r\n var channelQueue = _createChannelQueues(theConfig, core, self);\r\n arrForEach(channelQueue, function (channels) {\r\n if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n initializePlugins(ctx.createNew(channels[_DYN_QUEUE /* @min:%2equeue */]), details.cfg.extensions);\r\n }\r\n });\r\n _channelController.init(channelQueue, core);\r\n }));\r\n }\r\n return _this;\r\n }\r\n TeeChannel.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TeeChannel.prototype.getTeeChannels = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n TeeChannel.prototype.processTelemetry = function (telemetryItem, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and\r\n * therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further\r\n * processTelemetry calls are ignored and it just calls the processNext() with the provided context.\r\n * @param unloadCtx - This is the context that should be used during unloading.\r\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\r\n * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.\r\n */\r\n TeeChannel.prototype.teardown = function (unloadCtx, unloadState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * The the plugin should re-evaluate configuration and update any cached configuration settings.\r\n * @param updateCtx - This is the context that should be used during updating.\r\n * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.\r\n * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.\r\n */\r\n TeeChannel.prototype.update = function (updateCtx, updateState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are\r\n * hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage\r\n * is disabled events will be lost.\r\n * SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).\r\n */\r\n TeeChannel.prototype.pause = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal\r\n * send interval.\r\n */\r\n TeeChannel.prototype.resume = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush the batched events immediately (not synchronously).\r\n * Will not flush if the Sender has been paused.\r\n */\r\n TeeChannel.prototype.flush = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush the batched events synchronously (if possible -- based on configuration).\r\n * Will not flush if the Send has been paused.\r\n */\r\n TeeChannel.prototype.onunloadFlush = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get and return the named channel instance (if present) from the queues\r\n * @param pluginIdentifier - The identifier name of the plugin\r\n */\r\n TeeChannel.prototype.getChannel = function (pluginIdentifier) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return TeeChannel;\r\n}(BaseTelemetryPlugin));\r\nexport { TeeChannel };\r\n//# sourceMappingURL=TeeChannel.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;oDAmEM,CAAC;;;;;sBACe;AACtB;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"TeeChannel.js.map","sources":["TeeChannel.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nvar _a;\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BaseTelemetryPlugin, cfgDfBoolean, createProcessTelemetryContext, initializePlugins, onConfigChange, proxyFunctions } from \"@microsoft/applicationinsights-core-js\";\r\nimport { arrForEach, isArray, objDeepFreeze, objFreeze, throwError } from \"@nevware21/ts-utils\";\r\nimport { ChannelControllerPriority, createChannelControllerPlugin } from \"./ChannelController\";\r\nimport { _DYN_GET_QUEUES, _DYN_IDENTIFIER, _DYN_IGNORE_CORE_CHANNELS, _DYN_LENGTH, _DYN_PRIORITY, _DYN_QUEUE, _DYN_TEARDOWN, _DYN_TEE_CHANNELS } from \"./__DynamicConstants\";\r\nvar ChannelValidationMessage = \"Channel has invalid priority - \";\r\nvar defaultTeeChannelConfig = objDeepFreeze((_a = {},\r\n _a[_DYN_TEE_CHANNELS /* @min:teeChannels */] = null,\r\n _a[_DYN_IGNORE_CORE_CHANNELS /* @min:ignoreCoreChannels */] = cfgDfBoolean(),\r\n _a));\r\nfunction _addChannelQueue(channelQueue, queue, core, teeChannel) {\r\n var _a;\r\n if (queue && isArray(queue) && queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n queue = queue.sort(function (a, b) {\r\n return a[_DYN_PRIORITY /* @min:%2epriority */] - b[_DYN_PRIORITY /* @min:%2epriority */];\r\n });\r\n var _queue_1 = [];\r\n arrForEach(queue, function (queueItem) {\r\n if (queueItem[_DYN_PRIORITY /* @min:%2epriority */] < ChannelControllerPriority) {\r\n throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER /* @min:%2eidentifier */]);\r\n }\r\n if (queueItem !== teeChannel) {\r\n _queue_1.push(queueItem);\r\n }\r\n });\r\n channelQueue.push((_a = {},\r\n _a[_DYN_QUEUE /* @min:queue */] = objFreeze(_queue_1),\r\n _a));\r\n }\r\n}\r\nfunction _createChannelQueues(config, core, teeChannel) {\r\n var channelQueue = [];\r\n if (config) {\r\n if (!config[_DYN_IGNORE_CORE_CHANNELS /* @min:%2eignoreCoreChannels */] && core.config.channels) {\r\n // Add and sort the configuration channel queues\r\n arrForEach(core.config.channels, function (queue, idx) {\r\n if (idx > 0) {\r\n _addChannelQueue(channelQueue, queue, core, teeChannel);\r\n }\r\n });\r\n }\r\n if (config[_DYN_TEE_CHANNELS /* @min:%2eteeChannels */]) {\r\n // Add and sort the configuration channel queues\r\n arrForEach(config[_DYN_TEE_CHANNELS /* @min:%2eteeChannels */], function (queue) { return _addChannelQueue(channelQueue, queue, core, teeChannel); });\r\n }\r\n }\r\n return channelQueue;\r\n}\r\nvar TeeChannel = /** @class */ (function (_super) {\r\n __extends(TeeChannel, _super);\r\n function TeeChannel() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"TeeChannelController\";\r\n _this.priority = 999;\r\n var _channelController;\r\n var _isInitialized;\r\n dynamicProto(TeeChannel, _this, function (_self, base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n if (!_isInitialized) {\r\n _isInitialized = true;\r\n _initChannels(_self, core);\r\n }\r\n };\r\n _self.getTeeChannels = function () {\r\n var controls = [];\r\n var channelQueues = _channelController[_DYN_GET_QUEUES /* @min:%2egetQueues */]();\r\n if (channelQueues) {\r\n arrForEach(channelQueues, function (channels) {\r\n controls.push(channels[_DYN_QUEUE /* @min:%2equeue */]);\r\n });\r\n }\r\n return objFreeze(controls);\r\n };\r\n _self.isInitialized = function () {\r\n return _isInitialized;\r\n };\r\n _self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {\r\n return _channelController[_DYN_TEARDOWN /* @min:%2eteardown */](unloadCtx, unloadState, function () {\r\n _isInitialized = false;\r\n });\r\n };\r\n proxyFunctions(_self, _channelController, [\r\n \"processTelemetry\",\r\n \"update\",\r\n \"pause\",\r\n \"resume\",\r\n \"getChannel\",\r\n \"flush\"\r\n ]);\r\n });\r\n function _initDefaults() {\r\n _channelController = createChannelControllerPlugin();\r\n _isInitialized = false;\r\n }\r\n function _initChannels(self, core) {\r\n // This function will be re-called whenever any referenced configuration is changed\r\n self._addHook(onConfigChange(core.config, function (details) {\r\n var ctx = createProcessTelemetryContext(null, details.cfg, core);\r\n var theConfig = ctx.getExtCfg(self[_DYN_IDENTIFIER /* @min:%2eidentifier */], defaultTeeChannelConfig);\r\n var channelQueue = _createChannelQueues(theConfig, core, self);\r\n arrForEach(channelQueue, function (channels) {\r\n if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n initializePlugins(ctx.createNew(channels[_DYN_QUEUE /* @min:%2equeue */]), details.cfg.extensions);\r\n }\r\n });\r\n _channelController.init(channelQueue, core);\r\n }));\r\n }\r\n return _this;\r\n }\r\n TeeChannel.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TeeChannel.prototype.getTeeChannels = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n TeeChannel.prototype.processTelemetry = function (telemetryItem, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and\r\n * therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further\r\n * processTelemetry calls are ignored and it just calls the processNext() with the provided context.\r\n * @param unloadCtx - This is the context that should be used during unloading.\r\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\r\n * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.\r\n */\r\n TeeChannel.prototype.teardown = function (unloadCtx, unloadState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * The the plugin should re-evaluate configuration and update any cached configuration settings.\r\n * @param updateCtx - This is the context that should be used during updating.\r\n * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.\r\n * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.\r\n */\r\n TeeChannel.prototype.update = function (updateCtx, updateState) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are\r\n * hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage\r\n * is disabled events will be lost.\r\n * SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).\r\n */\r\n TeeChannel.prototype.pause = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal\r\n * send interval.\r\n */\r\n TeeChannel.prototype.resume = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush any batched events immediately; Will not flush if the paused and channel should default to sending data asynchronously.\r\n * If executing asynchronously and you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)\r\n * will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise`\r\n * will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)\r\n * @param async - send data asynchronously when true\r\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.\r\n * If the caller doesn't return true the caller should assume that it may never be called.\r\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\r\n * @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller\r\n * should assume that any provided callback will never be called, Nothing or if occurring asynchronously a\r\n * [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete,\r\n * the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided\r\n * and isAsync is true.\r\n */\r\n TeeChannel.prototype.flush = function (isAsync, callBack, sendReason, cbTimeout) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Flush the batched events synchronously (if possible -- based on configuration).\r\n * Will not flush if the Send has been paused.\r\n */\r\n TeeChannel.prototype.onunloadFlush = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Get and return the named channel instance (if present) from the queues\r\n * @param pluginIdentifier - The identifier name of the plugin\r\n */\r\n TeeChannel.prototype.getChannel = function (pluginIdentifier) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return TeeChannel;\r\n}(BaseTelemetryPlugin));\r\nexport { TeeChannel };\r\n//# sourceMappingURL=TeeChannel.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA,gFAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;oDA8EM,CAAC;;;;;sBACe;AACtB;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-teechannel-js",
|
|
3
|
-
"version": "3.0.1-nightly3.
|
|
3
|
+
"version": "3.0.1-nightly3.2305-01",
|
|
4
4
|
"description": "Microsoft Application Insights JavaScript SDK Tee Channel",
|
|
5
5
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
6
|
"author": "Microsoft Application Insights Team",
|
|
@@ -52,9 +52,10 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@microsoft/dynamicproto-js": "^2.0.2",
|
|
54
54
|
"@microsoft/applicationinsights-shims": "3.0.1",
|
|
55
|
-
"@microsoft/applicationinsights-core-js": "3.0.1-nightly3.
|
|
56
|
-
"@microsoft/applicationinsights-common": "3.0.1-nightly3.
|
|
57
|
-
"@nevware21/ts-utils": ">= 0.9.
|
|
55
|
+
"@microsoft/applicationinsights-core-js": "3.0.1-nightly3.2305-01",
|
|
56
|
+
"@microsoft/applicationinsights-common": "3.0.1-nightly3.2305-01",
|
|
57
|
+
"@nevware21/ts-utils": ">= 0.9.5 < 2.x",
|
|
58
|
+
"@nevware21/ts-async": ">= 0.2.4 < 2.x"
|
|
58
59
|
},
|
|
59
60
|
"license": "MIT",
|
|
60
61
|
"publishConfig": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights JavaScript SDK Tee Channel, 3.0.1-nightly3.
|
|
2
|
+
* Microsoft Application Insights JavaScript SDK Tee Channel, 3.0.1-nightly3.2305-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -22,10 +22,12 @@ import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
|
22
22
|
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
23
23
|
import { IProcessTelemetryUnloadContext } from '@microsoft/applicationinsights-core-js';
|
|
24
24
|
import { IProcessTelemetryUpdateContext } from '@microsoft/applicationinsights-core-js';
|
|
25
|
+
import { IPromise } from '@nevware21/ts-async';
|
|
25
26
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
26
27
|
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
|
|
27
28
|
import { ITelemetryUnloadState } from '@microsoft/applicationinsights-core-js';
|
|
28
29
|
import { ITelemetryUpdateState } from '@microsoft/applicationinsights-core-js';
|
|
30
|
+
import { SendRequestReason } from '@microsoft/applicationinsights-core-js';
|
|
29
31
|
|
|
30
32
|
export declare interface ITeeChannelConfig {
|
|
31
33
|
/**
|
|
@@ -81,10 +83,21 @@ export declare class TeeChannel extends BaseTelemetryPlugin implements IChannelC
|
|
|
81
83
|
*/
|
|
82
84
|
resume(): void;
|
|
83
85
|
/**
|
|
84
|
-
* Flush
|
|
85
|
-
*
|
|
86
|
+
* Flush any batched events immediately; Will not flush if the paused and channel should default to sending data asynchronously.
|
|
87
|
+
* If executing asynchronously and you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)
|
|
88
|
+
* will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise`
|
|
89
|
+
* will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)
|
|
90
|
+
* @param async - send data asynchronously when true
|
|
91
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
92
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
93
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
94
|
+
* @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller
|
|
95
|
+
* should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
|
|
96
|
+
* [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete,
|
|
97
|
+
* the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided
|
|
98
|
+
* and isAsync is true.
|
|
86
99
|
*/
|
|
87
|
-
flush(): void
|
|
100
|
+
flush(isAsync: boolean, callBack: (flushComplete?: boolean) => void, sendReason: SendRequestReason, cbTimeout?: number): void | IPromise<boolean>;
|
|
88
101
|
/**
|
|
89
102
|
* Flush the batched events synchronously (if possible -- based on configuration).
|
|
90
103
|
* Will not flush if the Send has been paused.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights JavaScript SDK Tee Channel, 3.0.1-nightly3.
|
|
2
|
+
* Microsoft Application Insights JavaScript SDK Tee Channel, 3.0.1-nightly3.2305-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -17,10 +17,12 @@ declare namespace ApplicationInsights {
|
|
|
17
17
|
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
18
18
|
import { IProcessTelemetryUnloadContext } from '@microsoft/applicationinsights-core-js';
|
|
19
19
|
import { IProcessTelemetryUpdateContext } from '@microsoft/applicationinsights-core-js';
|
|
20
|
+
import { IPromise } from '@nevware21/ts-async';
|
|
20
21
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
21
22
|
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
|
|
22
23
|
import { ITelemetryUnloadState } from '@microsoft/applicationinsights-core-js';
|
|
23
24
|
import { ITelemetryUpdateState } from '@microsoft/applicationinsights-core-js';
|
|
25
|
+
import { SendRequestReason } from '@microsoft/applicationinsights-core-js';
|
|
24
26
|
|
|
25
27
|
interface ITeeChannelConfig {
|
|
26
28
|
/**
|
|
@@ -76,10 +78,21 @@ declare namespace ApplicationInsights {
|
|
|
76
78
|
*/
|
|
77
79
|
resume(): void;
|
|
78
80
|
/**
|
|
79
|
-
* Flush
|
|
80
|
-
*
|
|
81
|
+
* Flush any batched events immediately; Will not flush if the paused and channel should default to sending data asynchronously.
|
|
82
|
+
* If executing asynchronously and you DO NOT pass a callback function then a [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html)
|
|
83
|
+
* will be returned which will resolve once the flush is complete. The actual implementation of the `IPromise`
|
|
84
|
+
* will be a native Promise (if supported) or the default as supplied by [ts-async library](https://github.com/nevware21/ts-async)
|
|
85
|
+
* @param async - send data asynchronously when true
|
|
86
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
87
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
88
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
89
|
+
* @returns - If a callback is provided `true` to indicate that callback will be called after the flush is complete otherwise the caller
|
|
90
|
+
* should assume that any provided callback will never be called, Nothing or if occurring asynchronously a
|
|
91
|
+
* [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) which will be resolved once the unload is complete,
|
|
92
|
+
* the [IPromise](https://nevware21.github.io/ts-async/typedoc/interfaces/IPromise.html) will only be returned when no callback is provided
|
|
93
|
+
* and isAsync is true.
|
|
81
94
|
*/
|
|
82
|
-
flush(): void
|
|
95
|
+
flush(isAsync: boolean, callBack: (flushComplete?: boolean) => void, sendReason: SendRequestReason, cbTimeout?: number): void | IPromise<boolean>;
|
|
83
96
|
/**
|
|
84
97
|
* Flush the batched events synchronously (if possible -- based on configuration).
|
|
85
98
|
* Will not flush if the Send has been paused.
|