@microsoft/applicationinsights-teechannel-js 3.0.0-beta.2304-07
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/LICENSE +21 -0
- package/NOTICE +17 -0
- package/PRIVACY +3 -0
- package/README.md +81 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.cjs.js +2918 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.cjs.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.cjs.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.cjs.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.gbl.js +2922 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.gbl.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.gbl.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.gbl.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.integrity.json +66 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.js +2924 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.0.0-beta.2304-07.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.js +2918 -0
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.cjs.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.js +2922 -0
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.gbl.min.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.js +2924 -0
- package/browser/es5/applicationinsights-teechannel-js.3.js.map +1 -0
- package/browser/es5/applicationinsights-teechannel-js.3.min.js +6 -0
- package/browser/es5/applicationinsights-teechannel-js.3.min.js.map +1 -0
- package/dist/es5/applicationinsights-teechannel-js.js +2924 -0
- package/dist/es5/applicationinsights-teechannel-js.js.map +1 -0
- package/dist/es5/applicationinsights-teechannel-js.min.js +6 -0
- package/dist/es5/applicationinsights-teechannel-js.min.js.map +1 -0
- package/dist-es5/ChannelController.js +170 -0
- package/dist-es5/ChannelController.js.map +1 -0
- package/dist-es5/Interfaces/ITeeChannelConfig.js +8 -0
- package/dist-es5/Interfaces/ITeeChannelConfig.js.map +1 -0
- package/dist-es5/TeeChannel.js +137 -0
- package/dist-es5/TeeChannel.js.map +1 -0
- package/dist-es5/__DynamicConstants.js +23 -0
- package/dist-es5/__DynamicConstants.js.map +1 -0
- package/dist-es5/applicationinsights-teechannel-js.js +8 -0
- package/dist-es5/applicationinsights-teechannel-js.js.map +1 -0
- package/package.json +63 -0
- package/tsconfig.json +28 -0
- package/types/applicationinsights-teechannel-js.d.ts +100 -0
- package/types/applicationinsights-teechannel-js.namespaced.d.ts +96 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Application Insights JavaScript SDK - Tee Channel, 3.0.0-beta.2304-07
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import { createProcessTelemetryContext } from "@microsoft/applicationinsights-core-js";
|
|
8
|
+
import { arrForEach, scheduleTimeout } from "@nevware21/ts-utils";
|
|
9
|
+
import { _DYN_IDENTIFIER, _DYN_LENGTH, _DYN_PROCESS_NEXT, _DYN_QUEUE } from "./__DynamicConstants";
|
|
10
|
+
export var ChannelControllerPriority = 500;
|
|
11
|
+
function _getTelCtx(core) {
|
|
12
|
+
return createProcessTelemetryContext(null, core.config, core, null);
|
|
13
|
+
}
|
|
14
|
+
function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) {
|
|
15
|
+
var waiting = theChannels ? (theChannels[_DYN_LENGTH /* @min:%2elength */] + 1) : 1;
|
|
16
|
+
function _runChainOnComplete() {
|
|
17
|
+
waiting--;
|
|
18
|
+
if (waiting === 0) {
|
|
19
|
+
onComplete && onComplete();
|
|
20
|
+
onComplete = null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (waiting > 0) {
|
|
24
|
+
arrForEach(theChannels, function (channels) {
|
|
25
|
+
// pass on to first item in queue
|
|
26
|
+
if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
|
27
|
+
var chainCtx = itemCtx.createNew(channels[_DYN_QUEUE /* @min:%2equeue */]);
|
|
28
|
+
chainCtx.onComplete(_runChainOnComplete);
|
|
29
|
+
// Cause this chain to start processing
|
|
30
|
+
processFn(chainCtx);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
waiting--;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
_runChainOnComplete();
|
|
38
|
+
}
|
|
39
|
+
export function createChannelControllerPlugin() {
|
|
40
|
+
var _channelQueue = [];
|
|
41
|
+
var _core = null;
|
|
42
|
+
function _doUpdate(updateCtx, updateState) {
|
|
43
|
+
var theUpdateState = updateState || {
|
|
44
|
+
reason: 0 /* TelemetryUpdateReason.Unknown */
|
|
45
|
+
};
|
|
46
|
+
_processChannelQueue(_channelQueue, updateCtx, function (chainCtx) {
|
|
47
|
+
chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);
|
|
48
|
+
}, function () {
|
|
49
|
+
updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);
|
|
50
|
+
});
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
function _getChannel(pluginIdentifier) {
|
|
54
|
+
var thePlugin = null;
|
|
55
|
+
if (_channelQueue && _channelQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
|
56
|
+
arrForEach(_channelQueue, function (channels) {
|
|
57
|
+
// pass on to first item in queue
|
|
58
|
+
if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
|
59
|
+
arrForEach(channels[_DYN_QUEUE /* @min:%2equeue */], function (ext) {
|
|
60
|
+
if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier) {
|
|
61
|
+
thePlugin = ext;
|
|
62
|
+
// Cause arrForEach to stop iterating
|
|
63
|
+
return -1;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (thePlugin) {
|
|
67
|
+
// Cause arrForEach to stop iterating
|
|
68
|
+
return -1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return thePlugin;
|
|
74
|
+
}
|
|
75
|
+
var channelController = {
|
|
76
|
+
init: function (channelQueue, core) {
|
|
77
|
+
_channelQueue = channelQueue;
|
|
78
|
+
_core = core;
|
|
79
|
+
},
|
|
80
|
+
getQueues: function () {
|
|
81
|
+
return _channelQueue;
|
|
82
|
+
},
|
|
83
|
+
processTelemetry: function (item, itemCtx) {
|
|
84
|
+
_processChannelQueue(_channelQueue, itemCtx || _getTelCtx(_core), function (chainCtx) {
|
|
85
|
+
chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);
|
|
86
|
+
}, function () {
|
|
87
|
+
itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
update: _doUpdate,
|
|
91
|
+
pause: function () {
|
|
92
|
+
_processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {
|
|
93
|
+
chainCtx.iterate(function (plugin) {
|
|
94
|
+
plugin.pause && plugin.pause();
|
|
95
|
+
});
|
|
96
|
+
}, null);
|
|
97
|
+
},
|
|
98
|
+
resume: function () {
|
|
99
|
+
_processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {
|
|
100
|
+
chainCtx.iterate(function (plugin) {
|
|
101
|
+
plugin.resume && plugin.resume();
|
|
102
|
+
});
|
|
103
|
+
}, null);
|
|
104
|
+
},
|
|
105
|
+
teardown: function (unloadCtx, unloadState, onComplete) {
|
|
106
|
+
var theUnloadState = unloadState || {
|
|
107
|
+
reason: 0 /* TelemetryUnloadReason.ManualTeardown */,
|
|
108
|
+
isAsync: false
|
|
109
|
+
};
|
|
110
|
+
_processChannelQueue(_channelQueue, unloadCtx, function (chainCtx) {
|
|
111
|
+
chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);
|
|
112
|
+
}, function () {
|
|
113
|
+
unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);
|
|
114
|
+
onComplete && onComplete();
|
|
115
|
+
});
|
|
116
|
+
return true;
|
|
117
|
+
},
|
|
118
|
+
getChannel: _getChannel,
|
|
119
|
+
flush: function (isAsync, callBack, sendReason, cbTimeout) {
|
|
120
|
+
// Setting waiting to one so that we don't call the callBack until we finish iterating
|
|
121
|
+
var waiting = 1;
|
|
122
|
+
var doneIterating = false;
|
|
123
|
+
var cbTimer = null;
|
|
124
|
+
cbTimeout = cbTimeout || 5000;
|
|
125
|
+
function doCallback() {
|
|
126
|
+
waiting--;
|
|
127
|
+
if (doneIterating && waiting === 0) {
|
|
128
|
+
cbTimer && cbTimer.cancel();
|
|
129
|
+
cbTimer = null;
|
|
130
|
+
callBack && callBack(doneIterating);
|
|
131
|
+
callBack = null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
_processChannelQueue(_channelQueue, _getTelCtx(_core), function (chainCtx) {
|
|
135
|
+
chainCtx.iterate(function (plugin) {
|
|
136
|
+
if (plugin.flush) {
|
|
137
|
+
waiting++;
|
|
138
|
+
var handled_1 = false;
|
|
139
|
+
// Not all channels will call this callback for every scenario
|
|
140
|
+
if (!plugin.flush(isAsync, function () {
|
|
141
|
+
handled_1 = true;
|
|
142
|
+
doCallback();
|
|
143
|
+
}, sendReason)) {
|
|
144
|
+
if (!handled_1) {
|
|
145
|
+
// If any channel doesn't return true and it didn't call the callback, then we should assume that the callback
|
|
146
|
+
// will never be called, so use a timeout to allow the channel(s) some time to "finish" before triggering any
|
|
147
|
+
// followup function (such as unloading)
|
|
148
|
+
if (isAsync && cbTimer == null) {
|
|
149
|
+
cbTimer = scheduleTimeout(function () {
|
|
150
|
+
cbTimer = null;
|
|
151
|
+
doCallback();
|
|
152
|
+
}, cbTimeout);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
doCallback();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}, function () {
|
|
162
|
+
doneIterating = true;
|
|
163
|
+
doCallback();
|
|
164
|
+
});
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return channelController;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=ChannelController.js.map
|
|
@@ -0,0 +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 true;\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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITeeChannelConfig.js.map","sources":["ITeeChannelConfig.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport {};\r\n//# sourceMappingURL=ITeeChannelConfig.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Application Insights JavaScript SDK - Tee Channel, 3.0.0-beta.2304-07
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _a;
|
|
8
|
+
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
|
9
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
10
|
+
import { BaseTelemetryPlugin, cfgDfBoolean, createProcessTelemetryContext, initializePlugins, onConfigChange, proxyFunctions } from "@microsoft/applicationinsights-core-js";
|
|
11
|
+
import { arrForEach, isArray, objDeepFreeze, objFreeze, throwError } from "@nevware21/ts-utils";
|
|
12
|
+
import { ChannelControllerPriority, createChannelControllerPlugin } from "./ChannelController";
|
|
13
|
+
import { _DYN_GET_QUEUES, _DYN_IDENTIFIER, _DYN_IGNORE_CORE_CHANNELS, _DYN_LENGTH, _DYN_PRIORITY, _DYN_QUEUE, _DYN_TEARDOWN, _DYN_TEE_CHANNELS } from "./__DynamicConstants";
|
|
14
|
+
var ChannelValidationMessage = "Channel has invalid priority - ";
|
|
15
|
+
var defaultTeeChannelConfig = objDeepFreeze((_a = {},
|
|
16
|
+
_a[_DYN_TEE_CHANNELS /* @min:teeChannels */] = null,
|
|
17
|
+
_a[_DYN_IGNORE_CORE_CHANNELS /* @min:ignoreCoreChannels */] = cfgDfBoolean(),
|
|
18
|
+
_a));
|
|
19
|
+
function _addChannelQueue(channelQueue, queue, core, teeChannel) {
|
|
20
|
+
var _a;
|
|
21
|
+
if (queue && isArray(queue) && queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
|
22
|
+
queue = queue.sort(function (a, b) {
|
|
23
|
+
return a[_DYN_PRIORITY /* @min:%2epriority */] - b[_DYN_PRIORITY /* @min:%2epriority */];
|
|
24
|
+
});
|
|
25
|
+
var _queue_1 = [];
|
|
26
|
+
arrForEach(queue, function (queueItem) {
|
|
27
|
+
if (queueItem[_DYN_PRIORITY /* @min:%2epriority */] < ChannelControllerPriority) {
|
|
28
|
+
throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER /* @min:%2eidentifier */]);
|
|
29
|
+
}
|
|
30
|
+
if (queueItem !== teeChannel) {
|
|
31
|
+
_queue_1.push(queueItem);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
channelQueue.push((_a = {},
|
|
35
|
+
_a[_DYN_QUEUE /* @min:queue */] = objFreeze(_queue_1),
|
|
36
|
+
_a));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function _createChannelQueues(config, core, teeChannel) {
|
|
40
|
+
var channelQueue = [];
|
|
41
|
+
if (config) {
|
|
42
|
+
if (!config[_DYN_IGNORE_CORE_CHANNELS /* @min:%2eignoreCoreChannels */] && core.config.channels) {
|
|
43
|
+
// Add and sort the configuration channel queues
|
|
44
|
+
arrForEach(core.config.channels, function (queue, idx) {
|
|
45
|
+
if (idx > 0) {
|
|
46
|
+
_addChannelQueue(channelQueue, queue, core, teeChannel);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (config[_DYN_TEE_CHANNELS /* @min:%2eteeChannels */]) {
|
|
51
|
+
// Add and sort the configuration channel queues
|
|
52
|
+
arrForEach(config[_DYN_TEE_CHANNELS /* @min:%2eteeChannels */], function (queue) { return _addChannelQueue(channelQueue, queue, core, teeChannel); });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return channelQueue;
|
|
56
|
+
}
|
|
57
|
+
var TeeChannel = /** @class */ (function (_super) {
|
|
58
|
+
__extends(TeeChannel, _super);
|
|
59
|
+
function TeeChannel() {
|
|
60
|
+
var _this = _super.call(this) || this;
|
|
61
|
+
_this.identifier = "TeeChannelController";
|
|
62
|
+
_this.priority = 999;
|
|
63
|
+
var _channelController;
|
|
64
|
+
var _isInitialized;
|
|
65
|
+
dynamicProto(TeeChannel, _this, function (_self, base) {
|
|
66
|
+
_initDefaults();
|
|
67
|
+
_self.initialize = function (config, core, extensions, pluginChain) {
|
|
68
|
+
if (!_isInitialized) {
|
|
69
|
+
_isInitialized = true;
|
|
70
|
+
_initChannels(_self, core);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
_self.getTeeChannels = function () {
|
|
74
|
+
var controls = [];
|
|
75
|
+
var channelQueues = _channelController[_DYN_GET_QUEUES /* @min:%2egetQueues */]();
|
|
76
|
+
if (channelQueues) {
|
|
77
|
+
arrForEach(channelQueues, function (channels) {
|
|
78
|
+
controls.push(channels[_DYN_QUEUE /* @min:%2equeue */]);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return objFreeze(controls);
|
|
82
|
+
};
|
|
83
|
+
_self.isInitialized = function () {
|
|
84
|
+
return _isInitialized;
|
|
85
|
+
};
|
|
86
|
+
_self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {
|
|
87
|
+
return _channelController[_DYN_TEARDOWN /* @min:%2eteardown */](unloadCtx, unloadState, function () {
|
|
88
|
+
_isInitialized = false;
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
proxyFunctions(_self, _channelController, [
|
|
92
|
+
"processTelemetry",
|
|
93
|
+
"update",
|
|
94
|
+
"pause",
|
|
95
|
+
"resume",
|
|
96
|
+
"getChannel",
|
|
97
|
+
"flush"
|
|
98
|
+
]);
|
|
99
|
+
});
|
|
100
|
+
function _initDefaults() {
|
|
101
|
+
_channelController = createChannelControllerPlugin();
|
|
102
|
+
_isInitialized = false;
|
|
103
|
+
}
|
|
104
|
+
function _initChannels(self, core) {
|
|
105
|
+
// This function will be re-called whenever any referenced configuration is changed
|
|
106
|
+
self._addHook(onConfigChange(core.config, function (details) {
|
|
107
|
+
var ctx = createProcessTelemetryContext(null, details.cfg, core);
|
|
108
|
+
var theConfig = ctx.getExtCfg(self[_DYN_IDENTIFIER /* @min:%2eidentifier */], defaultTeeChannelConfig);
|
|
109
|
+
var channelQueue = _createChannelQueues(theConfig, core, self);
|
|
110
|
+
arrForEach(channelQueue, function (channels) {
|
|
111
|
+
if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
|
112
|
+
initializePlugins(ctx.createNew(channels[_DYN_QUEUE /* @min:%2equeue */]), details.cfg.extensions);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
_channelController.init(channelQueue, core);
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
return _this;
|
|
119
|
+
}
|
|
120
|
+
// Removed Stub for TeeChannel.prototype.initialize.
|
|
121
|
+
// Removed Stub for TeeChannel.prototype.getTeeChannels.
|
|
122
|
+
// Removed Stub for TeeChannel.prototype.processTelemetry.
|
|
123
|
+
// Removed Stub for TeeChannel.prototype.teardown.
|
|
124
|
+
// Removed Stub for TeeChannel.prototype.update.
|
|
125
|
+
// Removed Stub for TeeChannel.prototype.pause.
|
|
126
|
+
// Removed Stub for TeeChannel.prototype.resume.
|
|
127
|
+
// Removed Stub for TeeChannel.prototype.flush.
|
|
128
|
+
// Removed Stub for TeeChannel.prototype.onunloadFlush.
|
|
129
|
+
// Removed Stub for TeeChannel.prototype.getChannel.
|
|
130
|
+
// This is a workaround for an IE bug when using dynamicProto() with classes that don't have any
|
|
131
|
+
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
|
132
|
+
TeeChannel.__ieDyn=1;
|
|
133
|
+
|
|
134
|
+
return TeeChannel;
|
|
135
|
+
}(BaseTelemetryPlugin));
|
|
136
|
+
export { TeeChannel };
|
|
137
|
+
//# sourceMappingURL=TeeChannel.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Application Insights JavaScript SDK - Tee Channel, 3.0.0-beta.2304-07
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// @skip-file-minify
|
|
8
|
+
// ##############################################################
|
|
9
|
+
// AUTO GENERATED FILE: This file is Auto Generated during build.
|
|
10
|
+
// ##############################################################
|
|
11
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
|
+
// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
|
|
13
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
14
|
+
export var _DYN_LENGTH = "length"; // Count: 6
|
|
15
|
+
export var _DYN_QUEUE = "queue"; // Count: 5
|
|
16
|
+
export var _DYN_PROCESS_NEXT = "processNext"; // Count: 6
|
|
17
|
+
export var _DYN_IDENTIFIER = "identifier"; // Count: 3
|
|
18
|
+
export var _DYN_GET_QUEUES = "getQueues"; // Count: 3
|
|
19
|
+
export var _DYN_TEARDOWN = "teardown"; // Count: 3
|
|
20
|
+
export var _DYN_PRIORITY = "priority"; // Count: 3
|
|
21
|
+
export var _DYN_IGNORE_CORE_CHANNELS = "ignoreCoreChannels"; // Count: 2
|
|
22
|
+
export var _DYN_TEE_CHANNELS = "teeChannels"; // Count: 3
|
|
23
|
+
//# sourceMappingURL=__DynamicConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_LENGTH = \"length\"; // Count: 6\r\nexport var _DYN_QUEUE = \"queue\"; // Count: 5\r\nexport var _DYN_PROCESS_NEXT = \"processNext\"; // Count: 6\r\nexport var _DYN_IDENTIFIER = \"identifier\"; // Count: 3\r\nexport var _DYN_GET_QUEUES = \"getQueues\"; // Count: 3\r\nexport var _DYN_TEARDOWN = \"teardown\"; // Count: 3\r\nexport var _DYN_PRIORITY = \"priority\"; // Count: 3\r\nexport var _DYN_IGNORE_CORE_CHANNELS = \"ignoreCoreChannels\"; // Count: 2\r\nexport var _DYN_TEE_CHANNELS = \"teeChannels\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applicationinsights-teechannel-js.js.map","sources":["applicationinsights-teechannel-js.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport { TeeChannel } from \"./TeeChannel\";\r\n//# sourceMappingURL=applicationinsights-teechannel-js.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/applicationinsights-teechannel-js",
|
|
3
|
+
"version": "3.0.0-beta.2304-07",
|
|
4
|
+
"description": "Microsoft Application Insights JavaScript SDK Tee Channel",
|
|
5
|
+
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
|
+
"author": "Microsoft Application Insights Team",
|
|
7
|
+
"main": "dist/es5/applicationinsights-teechannel-js.js",
|
|
8
|
+
"module": "dist-es5/applicationinsights-teechannel-js.js",
|
|
9
|
+
"types": "types/applicationinsights-teechannel-js.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"repository": "github:Microsoft/applicationinsights-js",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"clean": "rm -rf browser build dist dist-es5 types",
|
|
14
|
+
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
|
|
15
|
+
"build:esm": "grunt teechannel",
|
|
16
|
+
"build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
|
|
17
|
+
"rebuild": "npm run build",
|
|
18
|
+
"test": "grunt teechanneltest",
|
|
19
|
+
"mintest": "grunt teechannel-mintest",
|
|
20
|
+
"lint": "tslint -p tsconfig.json",
|
|
21
|
+
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights JavaScript SDK Tee Channel\"",
|
|
22
|
+
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
|
|
23
|
+
"ai-min": "grunt teechannel-min",
|
|
24
|
+
"ai-restore": "grunt teechannel-restore",
|
|
25
|
+
"npm-pack": "npm pack",
|
|
26
|
+
"npm-publish-ai": "node ../../tools/release-tools/npm_publish.js ."
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@microsoft/ai-test-framework": "0.0.1",
|
|
30
|
+
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
31
|
+
"@microsoft/applicationinsights-rollup-es5": "1.0.1",
|
|
32
|
+
"@microsoft/api-extractor": "^7.18.1",
|
|
33
|
+
"@types/sinon": "4.3.3",
|
|
34
|
+
"grunt": "^1.5.3",
|
|
35
|
+
"grunt-cli": "^1.4.3",
|
|
36
|
+
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
37
|
+
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
38
|
+
"globby": "^11.0.0",
|
|
39
|
+
"magic-string": "^0.25.7",
|
|
40
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
41
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
42
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
43
|
+
"rollup-plugin-cleanup": "^3.2.1",
|
|
44
|
+
"rollup": "^3.20.0",
|
|
45
|
+
"typescript": "^4.9.3",
|
|
46
|
+
"tslib": "^2.0.0",
|
|
47
|
+
"sinon": "^7.3.1"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"tslib": "*"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@microsoft/dynamicproto-js": "^2.0.2",
|
|
54
|
+
"@microsoft/applicationinsights-shims": "3.0.1",
|
|
55
|
+
"@microsoft/applicationinsights-core-js": "3.0.0-beta.2304-07",
|
|
56
|
+
"@microsoft/applicationinsights-common": "3.0.0-beta.2304-07",
|
|
57
|
+
"@nevware21/ts-utils": ">= 0.9.4 < 2.x"
|
|
58
|
+
},
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"tag": "beta"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"sourceMap": true,
|
|
4
|
+
"inlineSources": true,
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"module": "es6",
|
|
7
|
+
"moduleResolution": "Node",
|
|
8
|
+
"target": "es5",
|
|
9
|
+
"alwaysStrict": true,
|
|
10
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
11
|
+
"allowSyntheticDefaultImports": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"importHelpers": true,
|
|
14
|
+
"noEmitHelpers": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"declaration": true,
|
|
17
|
+
"declarationDir": "build/types",
|
|
18
|
+
"outDir": "dist-es5",
|
|
19
|
+
"rootDir": "./src",
|
|
20
|
+
"removeComments": false
|
|
21
|
+
},
|
|
22
|
+
"include": [
|
|
23
|
+
"./src/**/*.ts"
|
|
24
|
+
],
|
|
25
|
+
"exclude": [
|
|
26
|
+
"node_modules"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Microsoft Application Insights JavaScript SDK Tee Channel, 3.0.0-beta.2304-07
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Microsoft Application Insights Team
|
|
6
|
+
* https://github.com/microsoft/ApplicationInsights-JS#readme
|
|
7
|
+
*
|
|
8
|
+
* ---------------------------------------------------------------------------
|
|
9
|
+
* This is a single combined (rollup) declaration file for the package,
|
|
10
|
+
* if you require a namespace wrapped version it is also available.
|
|
11
|
+
* - Namespaced version: types/applicationinsights-teechannel-js.namespaced.d.ts
|
|
12
|
+
* ---------------------------------------------------------------------------
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';
|
|
16
|
+
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
|
|
17
|
+
import { IChannelControls } from '@microsoft/applicationinsights-core-js';
|
|
18
|
+
import { IChannelControlsHost } from '@microsoft/applicationinsights-core-js';
|
|
19
|
+
import { IConfig } from '@microsoft/applicationinsights-common';
|
|
20
|
+
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
21
|
+
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
22
|
+
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
23
|
+
import { IProcessTelemetryUnloadContext } from '@microsoft/applicationinsights-core-js';
|
|
24
|
+
import { IProcessTelemetryUpdateContext } from '@microsoft/applicationinsights-core-js';
|
|
25
|
+
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
26
|
+
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
|
|
27
|
+
import { ITelemetryUnloadState } from '@microsoft/applicationinsights-core-js';
|
|
28
|
+
import { ITelemetryUpdateState } from '@microsoft/applicationinsights-core-js';
|
|
29
|
+
|
|
30
|
+
export declare interface ITeeChannelConfig {
|
|
31
|
+
/**
|
|
32
|
+
* Channel queues that is setup by caller in desired order.
|
|
33
|
+
* If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
|
|
34
|
+
*/
|
|
35
|
+
teeChannels?: IChannelControls[][];
|
|
36
|
+
/**
|
|
37
|
+
* By default the TeeChannel will use the core configuration `channels` (starting at index 1 `channels[1.xxx]`) as separate tee'd channel chains
|
|
38
|
+
* for processing events. This configuration allow you to ignore any additional core channels and only use the `teeChannels`
|
|
39
|
+
* Defaults to false
|
|
40
|
+
*/
|
|
41
|
+
ignoreCoreChannels?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare class TeeChannel extends BaseTelemetryPlugin implements IChannelControlsHost {
|
|
45
|
+
readonly identifier: string;
|
|
46
|
+
readonly priority: number;
|
|
47
|
+
/**
|
|
48
|
+
* Returns whether the plugin has been initialized
|
|
49
|
+
*/
|
|
50
|
+
isInitialized: () => boolean;
|
|
51
|
+
constructor();
|
|
52
|
+
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
53
|
+
getTeeChannels(): IChannelControls[][];
|
|
54
|
+
processTelemetry(telemetryItem: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
55
|
+
/**
|
|
56
|
+
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
57
|
+
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
58
|
+
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
59
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
60
|
+
* @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.
|
|
61
|
+
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
62
|
+
*/
|
|
63
|
+
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The the plugin should re-evaluate configuration and update any cached configuration settings.
|
|
66
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
67
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
68
|
+
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
69
|
+
*/
|
|
70
|
+
update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Pause the sending (transmission) of events, this will cause all events to be batched only until the maximum limits are
|
|
73
|
+
* hit at which point new events are dropped. Will also cause events to NOT be sent during page unload, so if Session storage
|
|
74
|
+
* is disabled events will be lost.
|
|
75
|
+
* SessionStorage Limit is 2000 events, In-Memory (Array) Storage is 10,000 events (can be configured via the eventsLimitInMem).
|
|
76
|
+
*/
|
|
77
|
+
pause(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Resume the sending (transmission) of events, this will restart the timer and any batched events will be sent using the normal
|
|
80
|
+
* send interval.
|
|
81
|
+
*/
|
|
82
|
+
resume(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Flush the batched events immediately (not synchronously).
|
|
85
|
+
* Will not flush if the Sender has been paused.
|
|
86
|
+
*/
|
|
87
|
+
flush(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Flush the batched events synchronously (if possible -- based on configuration).
|
|
90
|
+
* Will not flush if the Send has been paused.
|
|
91
|
+
*/
|
|
92
|
+
onunloadFlush(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get and return the named channel instance (if present) from the queues
|
|
95
|
+
* @param pluginIdentifier - The identifier name of the plugin
|
|
96
|
+
*/
|
|
97
|
+
getChannel<T extends IPlugin = IPlugin>(pluginIdentifier: string): T;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { }
|