@microsoft/applicationinsights-analytics-js 2.7.2-nightly.2111-09 → 2.7.2-nightly.2111-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-analytics-js.integrity.json +9 -9
- package/browser/applicationinsights-analytics-js.js +37 -4
- package/browser/applicationinsights-analytics-js.js.map +1 -1
- package/browser/applicationinsights-analytics-js.min.js +2 -2
- package/browser/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.d.ts +1 -1
- package/dist/applicationinsights-analytics-js.js +37 -4
- package/dist/applicationinsights-analytics-js.js.map +1 -1
- package/dist/applicationinsights-analytics-js.min.js +2 -2
- package/dist/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.rollup.d.ts +1 -1
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js +2 -2
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/applicationinsights-analytics-js.js +1 -1
- package/package.json +5 -5
- package/src/JavaScriptSDK/ApplicationInsights.ts +1 -1
- package/Tests/Unit/src/AnalyticsExtensionSize.tests.ts +0 -58
- package/Tests/Unit/src/ApplicationInsights.tests.ts +0 -1647
- package/Tests/Unit/src/TelemetryItemCreator.tests.ts +0 -304
- package/Tests/Unit/src/appinsights-analytics.tests.ts +0 -9
- package/Tests/UnitTests.html +0 -62
- package/Tests/tsconfig.json +0 -13
- package/api-extractor.json +0 -361
- package/applicationinsights-analytics-js.build.error.log +0 -80
- package/applicationinsights-analytics-js.build.log +0 -309
- package/microsoft-applicationinsights-analytics-js-2.7.2-nightly.2111-09.tgz +0 -0
- package/rollup.config.js +0 -139
- package/temp/applicationinsights-analytics-js.api.md +0 -114
- package/tslint.json +0 -5
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import { Assert, AITestClass } from "@microsoft/ai-test-framework";
|
|
2
|
-
import {
|
|
3
|
-
PageViewPerformance,
|
|
4
|
-
PageView,
|
|
5
|
-
TelemetryItemCreator,
|
|
6
|
-
IPageViewTelemetry,
|
|
7
|
-
IEventTelemetry,
|
|
8
|
-
Event as EventTelemetry,
|
|
9
|
-
Trace,
|
|
10
|
-
ITraceTelemetry,
|
|
11
|
-
Metric,
|
|
12
|
-
IMetricTelemetry,
|
|
13
|
-
RemoteDependencyData,
|
|
14
|
-
IDependencyTelemetry,
|
|
15
|
-
} from '@microsoft/applicationinsights-common';
|
|
16
|
-
import { ApplicationInsights } from '../../../src/JavaScriptSDK/ApplicationInsights'
|
|
17
|
-
import {
|
|
18
|
-
IAppInsightsCore, AppInsightsCore,
|
|
19
|
-
ITelemetryItem,
|
|
20
|
-
IConfiguration, IPlugin
|
|
21
|
-
} from '@microsoft/applicationinsights-core-js';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export class TelemetryItemCreatorTests extends AITestClass {
|
|
26
|
-
private _core: IAppInsightsCore;
|
|
27
|
-
private _appInsights: ApplicationInsights;
|
|
28
|
-
|
|
29
|
-
public testInitialize() {
|
|
30
|
-
const plugin: IPlugin = new ChannelPlugin();
|
|
31
|
-
this._core = new AppInsightsCore();
|
|
32
|
-
this._core.initialize(
|
|
33
|
-
{instrumentationKey: "key"},
|
|
34
|
-
[plugin]
|
|
35
|
-
);
|
|
36
|
-
this._appInsights = new ApplicationInsights();
|
|
37
|
-
this._appInsights.initialize({ "instrumentationKey": "ikey" }, this._core, []);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public registerTests() {
|
|
41
|
-
this.testCase({
|
|
42
|
-
name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a page view performance item",
|
|
43
|
-
test: () => {
|
|
44
|
-
// setup
|
|
45
|
-
const name = "testName";
|
|
46
|
-
const uri = "testUri";
|
|
47
|
-
const pageViewPerformance = new PageViewPerformance(this._core.logger, name, uri, null);
|
|
48
|
-
const properties = {
|
|
49
|
-
"propKey1": "PropVal1",
|
|
50
|
-
"propKey2": "PropVal2"
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// act
|
|
54
|
-
const telemetryItem = TelemetryItemCreator.create<PageViewPerformance>(
|
|
55
|
-
pageViewPerformance,
|
|
56
|
-
PageViewPerformance.dataType,
|
|
57
|
-
PageViewPerformance.envelopeType,
|
|
58
|
-
this._core.logger,
|
|
59
|
-
properties);
|
|
60
|
-
|
|
61
|
-
// assert
|
|
62
|
-
Assert.ok(telemetryItem);
|
|
63
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.PageviewPerformance", telemetryItem.name, "telemtryItem.name");
|
|
64
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.PageviewPerformance", telemetryItem.name, "telemtryItem.name");
|
|
65
|
-
Assert.equal("", telemetryItem.iKey, "telemetryItem.iKey");
|
|
66
|
-
Assert.deepEqual({"propKey1":"PropVal1","propKey2":"PropVal2"},telemetryItem.data, "telemetryItem.data");
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
this.testCase({
|
|
71
|
-
name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a page view item",
|
|
72
|
-
test: () => {
|
|
73
|
-
// setup
|
|
74
|
-
const name = "testName";
|
|
75
|
-
const uri = "testUri";
|
|
76
|
-
const pageView: IPageViewTelemetry = {
|
|
77
|
-
name,
|
|
78
|
-
uri
|
|
79
|
-
};
|
|
80
|
-
const properties = {
|
|
81
|
-
"propKey1": "PropVal1",
|
|
82
|
-
"propKey2": "PropVal2"
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// act
|
|
86
|
-
const telemetryItem = TelemetryItemCreator.create<IPageViewTelemetry>(
|
|
87
|
-
pageView,
|
|
88
|
-
PageView.dataType,
|
|
89
|
-
PageView.envelopeType,
|
|
90
|
-
this._core.logger,
|
|
91
|
-
properties);
|
|
92
|
-
|
|
93
|
-
// assert
|
|
94
|
-
Assert.ok(telemetryItem);
|
|
95
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.Pageview", telemetryItem.name, "telemtryItem.name");
|
|
96
|
-
Assert.equal("PageviewData", telemetryItem.baseType, "telemetryItem.baseType");
|
|
97
|
-
Assert.equal("",telemetryItem.iKey,"telemetryItem.iKey");
|
|
98
|
-
Assert.deepEqual({"propKey1":"PropVal1","propKey2":"PropVal2"},telemetryItem.data, "telemetryItem.data");
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.testCase({
|
|
104
|
-
name: "TelemetryItemCreatorTests: create a valid TelemetryItem for trackEvent with iKey",
|
|
105
|
-
test: () => {
|
|
106
|
-
// setup
|
|
107
|
-
const event: IEventTelemetry = {
|
|
108
|
-
name: "trackEventNewtTest",
|
|
109
|
-
iKey: "newTestIkey",
|
|
110
|
-
properties: { "prop1": "value1" },
|
|
111
|
-
measurements: { "measurement1": 200 }
|
|
112
|
-
}
|
|
113
|
-
const customProperties = {"propKey1":"PropVal1"};
|
|
114
|
-
|
|
115
|
-
// act
|
|
116
|
-
const telemetryItem = TelemetryItemCreator.create<ITelemetryItem>(
|
|
117
|
-
event,
|
|
118
|
-
EventTelemetry.dataType,
|
|
119
|
-
EventTelemetry.envelopeType,
|
|
120
|
-
this._appInsights.diagLog(),
|
|
121
|
-
customProperties);
|
|
122
|
-
|
|
123
|
-
// assert
|
|
124
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.Event", telemetryItem.name, "telemtryItem.name");
|
|
125
|
-
Assert.equal("EventData", telemetryItem.baseType, "telemetryItem.baseType");
|
|
126
|
-
Assert.equal("newTestIkey", telemetryItem.iKey, "telemtryItem.iKey");
|
|
127
|
-
Assert.deepEqual({"propKey1":"PropVal1"},telemetryItem.data, "telemetryItem.data");
|
|
128
|
-
Assert.deepEqual( "trackEventNewtTest",telemetryItem.baseData.name, "telemetryItem.baseData.name");
|
|
129
|
-
Assert.deepEqual({ "prop1": "value1" },telemetryItem.baseData.properties, "telemetryItem.baseData.properties");
|
|
130
|
-
Assert.deepEqual({ "measurement1": 200 },telemetryItem.baseData.measurements, "telemetryItem.baseData.measurements");
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
this.testCase({
|
|
135
|
-
name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a page view item with iKey",
|
|
136
|
-
test: () => {
|
|
137
|
-
// setup
|
|
138
|
-
const name = "testName";
|
|
139
|
-
const uri = "testUri";
|
|
140
|
-
const pageView: IPageViewTelemetry = {
|
|
141
|
-
name: name,
|
|
142
|
-
uri: uri,
|
|
143
|
-
iKey: "newIkey"
|
|
144
|
-
};
|
|
145
|
-
const properties = {
|
|
146
|
-
"propKey1": "PropVal1"
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
// act
|
|
150
|
-
const telemetryItem = TelemetryItemCreator.create<IPageViewTelemetry>(
|
|
151
|
-
pageView,
|
|
152
|
-
PageView.dataType,
|
|
153
|
-
PageView.envelopeType,
|
|
154
|
-
this._core.logger,
|
|
155
|
-
properties);
|
|
156
|
-
|
|
157
|
-
// assert
|
|
158
|
-
Assert.ok(telemetryItem);
|
|
159
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.Pageview", telemetryItem.name, "telemtryItem.name");
|
|
160
|
-
Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey");
|
|
161
|
-
Assert.equal("PageviewData", telemetryItem.baseType, "telemetryItem.baseType");
|
|
162
|
-
Assert.equal("testUri", telemetryItem.baseData.uri, "telemetryItem.baseData.uri");
|
|
163
|
-
Assert.equal("testName", telemetryItem.baseData.name, "telemetryItem.baseData.name");
|
|
164
|
-
Assert.deepEqual({"propKey1":"PropVal1"},telemetryItem.data, "telemetryItem.data");
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
this.testCase({
|
|
169
|
-
name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a trace item with iKey",
|
|
170
|
-
test: () => {
|
|
171
|
-
// setup
|
|
172
|
-
const trace: ITraceTelemetry = {
|
|
173
|
-
message:"traceMessage",
|
|
174
|
-
iKey: "newIkey"
|
|
175
|
-
};
|
|
176
|
-
const customProperties = {
|
|
177
|
-
"propKey1": "PropVal1"
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
// act
|
|
181
|
-
const telemetryItem = TelemetryItemCreator.create<ITraceTelemetry>(
|
|
182
|
-
trace,
|
|
183
|
-
Trace.dataType,
|
|
184
|
-
Trace.envelopeType,
|
|
185
|
-
this._core.logger,
|
|
186
|
-
customProperties);
|
|
187
|
-
|
|
188
|
-
// assert
|
|
189
|
-
Assert.ok(telemetryItem);
|
|
190
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.Message", telemetryItem.name, "telemtryItem.name");
|
|
191
|
-
Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey");
|
|
192
|
-
Assert.equal("MessageData", telemetryItem.baseType, "telemetryItem.baseType");
|
|
193
|
-
Assert.equal("traceMessage", telemetryItem.baseData.message, "telemetryItem.baseData.message");
|
|
194
|
-
Assert.deepEqual({"propKey1":"PropVal1"},telemetryItem.data, "telemetryItem.data");
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
this.testCase({
|
|
199
|
-
name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a metric item with iKey",
|
|
200
|
-
test: () => {
|
|
201
|
-
// setup
|
|
202
|
-
const metric: IMetricTelemetry = {
|
|
203
|
-
name:"metricName",
|
|
204
|
-
average: 5,
|
|
205
|
-
iKey: "newIkey"
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
// act
|
|
209
|
-
const telemetryItem = TelemetryItemCreator.create<IMetricTelemetry>(
|
|
210
|
-
metric,
|
|
211
|
-
Metric.dataType,
|
|
212
|
-
Metric.envelopeType,
|
|
213
|
-
this._core.logger,
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
// assert
|
|
217
|
-
Assert.ok(telemetryItem);
|
|
218
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.Metric", telemetryItem.name, "telemtryItem.name");
|
|
219
|
-
Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey");
|
|
220
|
-
Assert.equal("MetricData", telemetryItem.baseType, "telemetryItem.baseType");
|
|
221
|
-
Assert.equal("metricName",telemetryItem.baseData.name, "telemetryItem.baseData.name");
|
|
222
|
-
Assert.equal(5,telemetryItem.baseData.average, "telemetryItem.baseData.average");
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
this.testCase({
|
|
227
|
-
name: "TelemetryItemCreatorTests: create a valid ITelemetryItem for a dependency item with iKey",
|
|
228
|
-
test: () => {
|
|
229
|
-
// setup
|
|
230
|
-
const dependency: IDependencyTelemetry = {
|
|
231
|
-
name:"dependencyName",
|
|
232
|
-
id:"id",
|
|
233
|
-
responseCode: 200,
|
|
234
|
-
iKey: "newIkey"
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// act
|
|
238
|
-
const telemetryItem = TelemetryItemCreator.create<IDependencyTelemetry>(
|
|
239
|
-
dependency,
|
|
240
|
-
RemoteDependencyData.dataType,
|
|
241
|
-
RemoteDependencyData.envelopeType,
|
|
242
|
-
this._core.logger,
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
// assert
|
|
246
|
-
Assert.ok(telemetryItem);
|
|
247
|
-
Assert.equal("Microsoft.ApplicationInsights.{0}.RemoteDependency", telemetryItem.name, "telemtryItem.name");
|
|
248
|
-
Assert.equal("newIkey", telemetryItem.iKey, "telemtryItem.iKey");
|
|
249
|
-
Assert.equal("RemoteDependencyData", telemetryItem.baseType, "telemetryItem.baseType");
|
|
250
|
-
Assert.equal("dependencyName",telemetryItem.baseData.name, "telemetryItem.baseData.name");
|
|
251
|
-
Assert.equal(200,telemetryItem.baseData.responseCode, "telemetryItem.baseData.responseCode");
|
|
252
|
-
Assert.equal("id",telemetryItem.baseData.id, "telemetryItem.baseData.id");
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
class ChannelPlugin implements IPlugin {
|
|
260
|
-
|
|
261
|
-
public isFlushInvoked = false;
|
|
262
|
-
public isTearDownInvoked = false;
|
|
263
|
-
public isResumeInvoked = false;
|
|
264
|
-
public isPauseInvoked = false;
|
|
265
|
-
|
|
266
|
-
public processTelemetry;
|
|
267
|
-
|
|
268
|
-
public identifier = "Sender";
|
|
269
|
-
|
|
270
|
-
public priority: number = 1001;
|
|
271
|
-
|
|
272
|
-
constructor() {
|
|
273
|
-
this.processTelemetry = this._processTelemetry.bind(this);
|
|
274
|
-
}
|
|
275
|
-
public pause(): void {
|
|
276
|
-
this.isPauseInvoked = true;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
public resume(): void {
|
|
280
|
-
this.isResumeInvoked = true;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
public teardown(): void {
|
|
284
|
-
this.isTearDownInvoked = true;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
flush(async?: boolean, callBack?: () => void): void {
|
|
288
|
-
this.isFlushInvoked = true;
|
|
289
|
-
if (callBack) {
|
|
290
|
-
callBack();
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
setNextPlugin(next: any) {
|
|
295
|
-
// no next setup
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
public initialize = (config: IConfiguration) => {
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
private _processTelemetry(env: ITelemetryItem) {
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ApplicationInsightsTests } from './ApplicationInsights.tests';
|
|
2
|
-
import { TelemetryItemCreatorTests } from './TelemetryItemCreator.tests';
|
|
3
|
-
import { AnalyticsExtensionSizeCheck } from "./AnalyticsExtensionSize.tests";
|
|
4
|
-
|
|
5
|
-
export function runTests() {
|
|
6
|
-
new ApplicationInsightsTests().registerTests();
|
|
7
|
-
new TelemetryItemCreatorTests().registerTests();
|
|
8
|
-
new AnalyticsExtensionSizeCheck().registerTests();
|
|
9
|
-
}
|
package/Tests/UnitTests.html
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta http-equiv="Cache-control" content="no-Cache" />
|
|
7
|
-
<title>Tests for Application Insights JavaScript Analytics Extension</title>
|
|
8
|
-
<link rel="stylesheet" href="../../../common/Tests//External/qunit-1.23.1.css">
|
|
9
|
-
<script src="../../../common/Tests/Selenium/ExceptionHelper.js"></script>
|
|
10
|
-
<!-- <script src="http://sinonjs.org/releases/sinon-2.3.8.js" crossorigin="anonymous"></script> -->
|
|
11
|
-
<script src="../../../common/Tests/External/sinon-7.3.1.js"></script> -->
|
|
12
|
-
<!-- <script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.js" crossorigin="anonymous"></script> -->
|
|
13
|
-
<script src="../../../common/Tests/External/require-2.2.0.js"></script>
|
|
14
|
-
<script src="../../../common/Tests/Selenium/ModuleLoader.js"></script>
|
|
15
|
-
<script src="../../../common/Tests/Selenium/SimpleSyncPromise.js"></script>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
var modules = new ModuleLoader({
|
|
19
|
-
baseUrl: '../',
|
|
20
|
-
paths: {
|
|
21
|
-
qunit: "../../common/Tests/External/qunit-1.23.1",
|
|
22
|
-
"whatwg-fetch": "../../common/Tests/External/whatwg-fetch.3.0.0"
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Load qunit here instead of with tests, otherwise will not work
|
|
27
|
-
modules.add("qunit");
|
|
28
|
-
modules.add("pako","./node_modules/pako/dist/pako");
|
|
29
|
-
|
|
30
|
-
loadFetchModule(modules, "whatwg-fetch");
|
|
31
|
-
loadCommonModules(modules);
|
|
32
|
-
|
|
33
|
-
// Load Core
|
|
34
|
-
modules.add("@microsoft/applicationinsights-core-js", "./node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js");
|
|
35
|
-
|
|
36
|
-
// Load Common
|
|
37
|
-
modules.add("@microsoft/applicationinsights-common", "./node_modules/@microsoft/applicationinsights-common/browser/applicationinsights-common");
|
|
38
|
-
|
|
39
|
-
// Load Channel
|
|
40
|
-
modules.add("@microsoft/applicationinsights-channel-js", "./node_modules/@microsoft/applicationinsights-channel-js/browser/applicationinsights-channel-js");
|
|
41
|
-
|
|
42
|
-
// Load Properties
|
|
43
|
-
modules.add("@microsoft/applicationinsights-properties-js", "./node_modules/@microsoft/applicationinsights-properties-js/browser/applicationinsights-properties-js");
|
|
44
|
-
|
|
45
|
-
var testModule = modules.add("Tests/Unit/src/appinsights-analytics.tests", "./Unit/dist/appinsights-analytics.tests.js")
|
|
46
|
-
testModule.run = function (tests) {
|
|
47
|
-
console && console.log("Starting tests");
|
|
48
|
-
QUnit.start();
|
|
49
|
-
tests.runTests();
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
modules.run();
|
|
53
|
-
</script>
|
|
54
|
-
</head>
|
|
55
|
-
|
|
56
|
-
<body>
|
|
57
|
-
<div id="qunit"></div>
|
|
58
|
-
<div id="qunit-fixture"></div>
|
|
59
|
-
<div id="error-message"></div>
|
|
60
|
-
</body>
|
|
61
|
-
|
|
62
|
-
</html>
|
package/Tests/tsconfig.json
DELETED