@microsoft/applicationinsights-angularplugin-js 2.8.1 → 2.9.0
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/esm2020/lib/applicationinsights-angularplugin-error.service.mjs +14 -4
- package/esm2020/lib/applicationinsights-angularplugin-js.component.mjs +52 -35
- package/esm2020/lib/applicationinsights-angularplugin-js.module.mjs +1 -1
- package/fesm2015/microsoft-applicationinsights-angularplugin-js.mjs +64 -36
- package/fesm2015/microsoft-applicationinsights-angularplugin-js.mjs.map +1 -1
- package/fesm2020/microsoft-applicationinsights-angularplugin-js.mjs +63 -36
- package/fesm2020/microsoft-applicationinsights-angularplugin-js.mjs.map +1 -1
- package/lib/applicationinsights-angularplugin-error.service.d.ts +1 -0
- package/lib/applicationinsights-angularplugin-js.component.d.ts +3 -0
- package/microsoft-applicationinsights-angularplugin-js-2.9.0.tgz +0 -0
- package/package.json +4 -4
- package/microsoft-applicationinsights-angularplugin-js-2.8.1.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { arrForEach } from '@microsoft/applicationinsights-core-js';
|
|
2
|
+
import { arrForEach, isFunction } from '@microsoft/applicationinsights-core-js';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export class ApplicationinsightsAngularpluginErrorService {
|
|
5
5
|
constructor() {
|
|
@@ -12,7 +12,17 @@ export class ApplicationinsightsAngularpluginErrorService {
|
|
|
12
12
|
this.analyticsPlugin = analyticsPlugin;
|
|
13
13
|
}
|
|
14
14
|
addErrorHandler(errorService) {
|
|
15
|
-
|
|
15
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
16
|
+
this.errorServices.push(errorService);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
removeErrorHandler(errorService) {
|
|
20
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
21
|
+
const idx = this.errorServices.indexOf(errorService);
|
|
22
|
+
if (idx !== -1) {
|
|
23
|
+
this.errorServices.splice(idx, 1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
16
26
|
}
|
|
17
27
|
handleError(error) {
|
|
18
28
|
if (this.analyticsPlugin) {
|
|
@@ -20,7 +30,7 @@ export class ApplicationinsightsAngularpluginErrorService {
|
|
|
20
30
|
}
|
|
21
31
|
if (this.errorServices && this.errorServices.length > 0) {
|
|
22
32
|
arrForEach(this.errorServices, errorService => {
|
|
23
|
-
if (errorService.handleError
|
|
33
|
+
if (isFunction(errorService.handleError)) {
|
|
24
34
|
errorService.handleError(error);
|
|
25
35
|
}
|
|
26
36
|
});
|
|
@@ -36,4 +46,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
36
46
|
providedIn: 'root'
|
|
37
47
|
}]
|
|
38
48
|
}], ctorParameters: function () { return []; } });
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb25pbnNpZ2h0cy1hbmd1bGFycGx1Z2luLWVycm9yLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hcHBsaWNhdGlvbmluc2lnaHRzLWFuZ3VsYXJwbHVnaW4tanMvc3JjL2xpYi9hcHBsaWNhdGlvbmluc2lnaHRzLWFuZ3VsYXJwbHVnaW4tZXJyb3Iuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxVQUFVLEVBQUUsVUFBVSxFQUFFLE1BQU0sd0NBQXdDLENBQUM7O0FBTWhGLE1BQU0sT0FBTyw0Q0FBNEM7SUFLckQ7UUFGUSxrQkFBYSxHQUFvQixFQU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CBpZHggPSB0aGlzLmVycm9yU2VydmljZXMuaW5kZXhPZihlcnJvclNlcnZpY2UpO1xyXG4gICAgICAgICAgICBpZiAoaWR4ICE9PSAtMSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5lcnJvclNlcnZpY2VzLnNwbGljZShpZHgsIDEpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGhhbmRsZUVycm9yKGVycm9yOiBhbnkpOiB2b2lkIHtcclxuICAgICAgICBpZiAodGhpcy5hbmFseXRpY3NQbHVnaW4pIHtcclxuICAgICAgICAgICAgdGhpcy5hbmFseXRpY3NQbHVnaW4udHJhY2tFeGNlcHRpb24oeyBleGNlcHRpb246IGVycm9yIH0pO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHRoaXMuZXJyb3JTZXJ2aWNlcyAmJiB0aGlzLmVycm9yU2VydmljZXMubGVuZ3RoID4gMCkge1xyXG4gICAgICAgICAgICBhcnJGb3JFYWNoKHRoaXMuZXJyb3JTZXJ2aWNlcywgZXJyb3JTZXJ2aWNlID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKGVycm9yU2VydmljZS5oYW5kbGVFcnJvcikpIHtcclxuICAgICAgICAgICAgICAgICAgICBlcnJvclNlcnZpY2UuaGFuZGxlRXJyb3IoZXJyb3IpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuXHJcbiJdfQ==
|
|
@@ -1,56 +1,75 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
|
-
import { PropertiesPluginIdentifier, Util } from '@microsoft/applicationinsights-common';
|
|
3
|
-
import { BaseTelemetryPlugin, arrForEach,
|
|
2
|
+
import { PropertiesPluginIdentifier, Util, AnalyticsPluginIdentifier } from '@microsoft/applicationinsights-common';
|
|
3
|
+
import { BaseTelemetryPlugin, arrForEach, getLocation, _throwInternal } from '@microsoft/applicationinsights-core-js';
|
|
4
4
|
import { NavigationEnd } from '@angular/router';
|
|
5
5
|
import { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
8
8
|
export class AngularPlugin extends BaseTelemetryPlugin {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(
|
|
10
|
+
super();
|
|
11
11
|
this.priority = 186;
|
|
12
12
|
this.identifier = 'AngularPlugin';
|
|
13
|
+
this._angularCfg = null;
|
|
14
|
+
this._eventSubscription = null;
|
|
15
|
+
let self = this;
|
|
16
|
+
self._doTeardown = (unloadCtx, unloadState, asyncCallback) => {
|
|
17
|
+
if (this.analyticsPlugin && ApplicationinsightsAngularpluginErrorService.instance !== null) {
|
|
18
|
+
ApplicationinsightsAngularpluginErrorService.instance.plugin = null;
|
|
19
|
+
if (self._angularCfg) {
|
|
20
|
+
if (self._angularCfg.errorServices && Array.isArray(self._angularCfg.errorServices)) {
|
|
21
|
+
arrForEach(self._angularCfg.errorServices, (errorService) => {
|
|
22
|
+
ApplicationinsightsAngularpluginErrorService.instance.removeErrorHandler(errorService);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (self._eventSubscription) {
|
|
28
|
+
self._eventSubscription.unsubscribe();
|
|
29
|
+
self._eventSubscription = null;
|
|
30
|
+
}
|
|
31
|
+
self.analyticsPlugin = null;
|
|
32
|
+
self.propertiesPlugin = null;
|
|
33
|
+
self._angularCfg = null;
|
|
34
|
+
};
|
|
13
35
|
}
|
|
14
36
|
initialize(config, core, extensions, pluginChain) {
|
|
15
37
|
super.initialize(config, core, extensions, pluginChain);
|
|
16
38
|
const self = this;
|
|
17
39
|
const ctx = self._getTelCtx();
|
|
18
40
|
const extConfig = ctx.getExtCfg(self.identifier, { router: null, errorServices: null });
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}
|
|
41
|
+
self.propertiesPlugin = core.getPlugin(PropertiesPluginIdentifier)?.plugin;
|
|
42
|
+
self.analyticsPlugin = core.getPlugin(AnalyticsPluginIdentifier)?.plugin;
|
|
43
|
+
if (self.analyticsPlugin) {
|
|
44
|
+
if (ApplicationinsightsAngularpluginErrorService.instance !== null) {
|
|
45
|
+
ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;
|
|
46
|
+
if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {
|
|
47
|
+
arrForEach(extConfig.errorServices, (errorService) => {
|
|
48
|
+
ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);
|
|
49
|
+
});
|
|
30
50
|
}
|
|
31
51
|
}
|
|
32
|
-
|
|
33
|
-
self.propertiesPlugin = ext;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
52
|
+
}
|
|
36
53
|
if (extConfig.router) {
|
|
37
54
|
let isPageInitialLoad = true;
|
|
38
55
|
const pageViewTelemetry = {
|
|
39
56
|
uri: extConfig.router.url
|
|
40
57
|
};
|
|
41
58
|
self.trackPageView(pageViewTelemetry);
|
|
42
|
-
extConfig.router.events.subscribe(event => {
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
isPageInitialLoad
|
|
47
|
-
|
|
59
|
+
self._eventSubscription = extConfig.router.events.subscribe(event => {
|
|
60
|
+
if (self.isInitialized()) {
|
|
61
|
+
if (event instanceof NavigationEnd) {
|
|
62
|
+
// for page initial load, do not call trackPageView twice
|
|
63
|
+
if (isPageInitialLoad) {
|
|
64
|
+
isPageInitialLoad = false;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const pvt = {
|
|
68
|
+
uri: extConfig.router.url,
|
|
69
|
+
properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
|
|
70
|
+
};
|
|
71
|
+
self.trackPageView(pvt);
|
|
48
72
|
}
|
|
49
|
-
const pvt = {
|
|
50
|
-
uri: extConfig.router.url,
|
|
51
|
-
properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
|
|
52
|
-
};
|
|
53
|
-
self.trackPageView(pvt);
|
|
54
73
|
}
|
|
55
74
|
});
|
|
56
75
|
}
|
|
@@ -74,13 +93,11 @@ export class AngularPlugin extends BaseTelemetryPlugin {
|
|
|
74
93
|
self.analyticsPlugin.trackPageView(pageView);
|
|
75
94
|
}
|
|
76
95
|
else {
|
|
77
|
-
self.diagLog()
|
|
78
|
-
// eslint-disable-next-line max-len
|
|
79
|
-
LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');
|
|
96
|
+
_throwInternal(self.diagLog(), 1 /* CRITICAL */, 64 /* TelemetryInitializerFailed */, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');
|
|
80
97
|
}
|
|
81
98
|
}
|
|
82
99
|
}
|
|
83
|
-
AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, deps:
|
|
100
|
+
AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
84
101
|
AngularPlugin.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: AngularPlugin, selector: "lib-applicationinsights-angularplugin-js", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
85
102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, decorators: [{
|
|
86
103
|
type: Component,
|
|
@@ -89,5 +106,5 @@ i0.ɵɵngDeclareClassMetadata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XHJcbiAgICAgICAgc3VwZXIuaW5pdGlhbGl6ZShjb25maWcsIGNvcmUsIGV4dGVuc2lvbnMsIHBsdWdpbkNoYWluKTtcclxuICAgICAgICBjb25zdCBzZWxmID0gdGhpcztcclxuICAgICAgICBjb25zdCBjdHggPSBzZWxmLl9nZXRUZWxDdHgoKTtcclxuICAgICAgICBjb25zdCBleHRDb25maWcgPSBjdHguZ2V0RXh0Q2ZnPElBbmd1bGFyRXh0ZW5zaW9uQ29uZmlnPihzZWxmLmlkZW50aWZpZXIsIHsgcm91dGVyOiBudWxsLCBlcnJvclNlcnZpY2VzOiBudWxsIH0pO1xyXG4gICAgICAgIGFyckZvckVhY2goZXh0ZW5zaW9ucywgZXh0ID0+IHtcclxuICAgICAgICAgICAgY29uc3QgaWRlbnRpZmllciA9IChleHQgYXMgSVRlbGVtZXRyeVBsdWdpbikuaWRlbnRpZmllcjtcclxuICAgICAgICAgICAgaWYgKGlkZW50aWZpZXIgPT09ICdBcHBsaWNhdGlvbkluc2lnaHRzQW5hbHl0aWNzJykge1xyXG4gICAgICAgICAgICAgICAgc2VsZi5hbmFseXRpY3NQbHVnaW4gPSAoZXh0IGFzIGFueSkgYXMgSUFwcEluc2lnaHRzO1xyXG4gICAgICAgICAgICAgICAgaWYgKEFwcGxpY2F0aW9uaW5zaWdodHNBbmd1bGFycGx1Z2luRXJyb3JTZXJ2aWNlLmluc3RhbmNlICE9PSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgQXBwbGljYXRpb25pbnNpZ2h0c0FuZ3VsYXJwbHVnaW5FcnJvclNlcnZpY2UuaW5zdGFuY2UucGx1Z2luID0gc2VsZi5hbmFseXRpY3NQbHVnaW47XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGV4dENvbmZpZy5lcnJvclNlcnZpY2VzICYmIEFycmF5LmlzQXJyYXkoZXh0Q29uZmlnLmVycm9yU2VydmljZXMpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyckZvckVhY2goZXh0Q29uZmlnLmVycm9yU2VydmljZXMsIChlcnJvclNlcnZpY2U6IElFcnJvclNlcnZpY2UpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFwcGxpY2F0aW9uaW5zaWdodHNBbmd1bGFycGx1Z2luRXJyb3JTZXJ2aWNlLmluc3RhbmNlLmFkZEVycm9ySGFuZGxlcihlcnJvclNlcnZpY2UpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGlkZW50aWZpZXIgPT09IFByb3BlcnRpZXNQbHVnaW5JZGVudGlmaWVyKSB7XHJcbiAgICAgICAgICAgICAgICBzZWxmLnByb3BlcnRpZXNQbHVnaW4gPSAoZXh0IGFzIGFueSkgYXMgcHJvcGVydGllcy5Qcm9wZXJ0aWVzUGx1Z2luO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIGlmIChleHRDb25maWcucm91dGVyKSB7XHJcbiAgICAgICAgICAgIGxldCBpc1BhZ2VJbml0aWFsTG9hZCA9IHRydWU7XHJcbiAgICAgICAgICAgIGNvbnN0IHBhZ2VWaWV3VGVsZW1ldHJ5OiBJUGFnZVZpZXdUZWxlbWV0cnkgPSB7XHJcbiAgICAgICAgICAgICAgICB1cmk6IGV4dENvbmZpZy5yb3V0ZXIudXJsXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNlbGYudHJhY2tQYWdlVmlldyhwYWdlVmlld1RlbGVtZXRyeSk7XHJcbiAgICAgICAgICAgIGV4dENvbmZpZy5yb3V0ZXIuZXZlbnRzLnN1YnNjcmliZShldmVudCA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQgaW5zdGFuY2VvZiBOYXZpZ2F0aW9uRW5kKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZm9yIHBhZ2UgaW5pdGlhbCBsb2FkLCBkbyBub3QgY2FsbCB0cmFja1BhZ2VWaWV3IHR3aWNlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzUGFnZUluaXRpYWxMb2FkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlzUGFnZUluaXRpYWxMb2FkID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcHZ0OiBJUGFnZVZpZXdUZWxlbWV0cnkgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHVyaTogZXh0Q29uZmlnLnJvdXRlci51cmwsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXM6IHsgZHVyYXRpb246IDAgfSAvLyBTUEEgcm91dGUgY2hhbmdlIGxvYWRpbmcgZHVyYXRpb25zIGFyZSB1bmRlZmluZWQsIHNvIHNlbmQgMFxyXG4gICAgICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZi50cmFja1BhZ2VWaWV3KHB2dCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEFkZCBQYXJ0IEEgZmllbGRzIHRvIHRoZSBldmVudFxyXG4gICAgICpcclxuICAgICAqIEBwYXJhbSBldmVudCBUaGUgZXZlbnQgdGhhdCBuZWVkcyB0byBiZSBwcm9jZXNzZWRcclxuICAgICAqL1xyXG4gICAgcHJvY2Vzc1RlbGVtZXRyeShldmVudDogSVRlbGVtZXRyeUl0ZW0sIGl0ZW1DdHg/OiBJUHJvY2Vzc1RlbGVtZXRyeUNvbnRleHQpIHtcclxuICAgICAgICB0aGlzLnByb2Nlc3NOZXh0KGV2ZW50LCBpdGVtQ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JcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyckZvckVhY2goc2VsZi5fYW5ndWxhckNmZy5lcnJvclNlcnZpY2VzLCAoZXJyb3JTZXJ2aWNlOiBJRXJyb3JTZXJ2aWNlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcHBsaWNhdGlvbmluc2lnaHRzQW5ndWxhcnBsdWdpbkVycm9yU2VydmljZS5pbnN0YW5jZS5yZW1vdmVFcnJvckhhbmRsZXIoZXJyb3JTZXJ2aWNlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBpZiAoc2VsZi5fZXZlbnRTdWJzY3JpcHRpb24pIHtcclxuICAgICAgICAgICAgICAgIHNlbGYuX2V2ZW50U3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XHJcbiAgICAgICAgICAgICAgICBzZWxmLl9ldmVudFN1YnNjcmlwdGlvbiA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIHNlbGYuYW5hbHl0aWNzUGx1Z2luID0gbnVsbDtcclxuICAgICAgICAgICAgc2VsZi5wcm9wZXJ0aWVzUGx1Z2luID0gbnVsbDtcclxuICAgICAgICAgICAgc2VsZi5fYW5ndWxhckNmZyA9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGluaXRpYWxpemUoY29uZmlnOiBJQ29uZmlndXJhdGlvbiAmIElDb25maWcsIGNvcmU6IElBcHBJbnNpZ2h0c0NvcmUsIGV4dGVuc2lvbnM6IElQbHVnaW5bXSwgcGx1Z2luQ2hhaW4/OiBJVGVsZW1ldHJ5UGx1Z2luQ2hhaW4pIHtcclxuICAgICAgICBzdXBlci5pbml0aWFsaXplKGNvbmZpZywgY29yZSwgZXh0ZW5zaW9ucywgcGx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b3JTZXJ2aWNlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIEFwcGxpY2F0aW9uaW5zaWdodHNBbmd1bGFycGx1Z2luRXJyb3JTZXJ2aWNlLmluc3RhbmNlLmFkZEVycm9ySGFuZGxlcihlcnJvclNlcnZpY2UpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAoZXh0Q29uZmlnLnJvdXRlcikge1xyXG4gICAgICAgICAgICBsZXQgaXNQYWdlSW5pdGlhbExvYWQgPSB0cnVlO1xyXG4gICAgICAgICAgICBjb25zdCBwYWdlVmlld1RlbGVtZXRyeTogSVBhZ2VWaWV3VGVsZW1ldHJ5ID0ge1xyXG4gICAgICAgICAgICAgICAgdXJpOiBleHRDb25maWcucm91dGVyLnVybFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZWxmLnRyYWNrUGFnZVZpZXcocGFnZVZpZXdUZWxlbWV0cnkpO1xyXG4gICAgICAgICAgICBzZWxmLl9ldmVudFN1YnNjcmlwdGlvbiA9IGV4dENvbmZpZy5yb3V0ZXIuZXZlbnRzLnN1YnNjcmliZShldmVudCA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoc2VsZi5pc0luaXRpYWxpemVkKCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQgaW5zdGFuY2VvZiBOYXZpZ2F0aW9uRW5kKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvciBwYWdlIGluaXRpYWwgbG9hZCwgZG8gbm90IGNhbGwgdHJhY2tQYWdlVmlldyB0d2ljZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNQYWdlSW5pdGlhbExvYWQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzUGFnZUluaXRpYWxMb2FkID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcHZ0OiBJUGFnZVZpZXdUZWxlbWV0cnkgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmk6IGV4dENvbmZpZy5yb3V0ZXIudXJsLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczogeyBkdXJhdGlvbjogMCB9IC8vIFNQQSByb3V0ZSBjaGFuZ2UgbG9hZGluZyBkdXJhdGlvbnMgYXJlIHVuZGVmaW5lZCwgc28gc2VuZCAwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYudHJhY2tQYWdlVmlldyhwdnQpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQWRkIFBhcnQgQSBmaWVsZHMgdG8gdGhlIGV2ZW50XHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIGV2ZW50IFRoZSBldmVudCB0aGF0IG5lZWRzIHRvIGJlIHByb2Nlc3NlZFxyXG4gICAgICovXHJcbiAgICBwcm9jZXNzVGVsZW1ldHJ5KGV2ZW50OiBJVGVsZW1ldHJ5SXRlbSwgaXRlbUN0eD86IElQcm9jZXNzVGVsZW1ldHJ5Q29udGV4dCkge1xyXG4gICAgICAgIHRoaXMucHJvY2Vzc05leHQoZXZlbnQsIGl0ZW1DdHgpO1xyXG4gICAgfVxyXG5cclxuICAgIHRyYWNrUGFnZVZpZXcocGFnZVZpZXc6IElQYWdlVmlld1RlbGVtZXRyeSkge1xyXG4gICAgICAgIGNvbnN0IHNlbGYgPSB0aGlzO1xyXG5cclxuICAgICAgICBp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4 +20,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
20
20
|
]
|
|
21
21
|
}]
|
|
22
22
|
}] });
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwbGljYXRpb25pbnNpZ2h0cy1hbmd1bGFycGx1Z2luLWpzLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2FwcGxpY2F0aW9uaW5zaWdodHMtYW5ndWxhcnBsdWdpbi1qcy9zcmMvbGliL2FwcGxpY2F0aW9uaW5zaWdodHMtYW5ndWxhcnBsdWdpbi1qcy5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sa0RBQWtELENBQUM7QUFDakYsT0FBTyxFQUFFLDRDQUE0QyxFQUFFLE1BQU0sbURBQW1ELENBQUM7O0FBV2pILE1BQU0sT0FBTyx3Q0FBd0M7O3FJQUF4Qyx3Q0FBd0M7c0lBQXhDLHdDQUF3QyxpQkFSbEMsYUFBYSxhQUdsQixhQUFhO3NJQUtkLHdDQUF3QyxhQUp0QztRQUNQLDRDQUE0QztLQUMvQyxZQUxRLEVBQ1I7MkZBTVEsd0NBQXdDO2tCQVRwRCxRQUFRO21CQUFDO29CQUNOLFlBQVksRUFBRSxDQUFDLGFBQWEsQ0FBQztvQkFDN0IsT0FBTyxFQUFFLEVBQ1I7b0JBQ0QsT0FBTyxFQUFFLENBQUMsYUFBYSxDQUFDO29CQUN4QixTQUFTLEVBQUU7d0JBQ1AsNENBQTRDO3FCQUMvQztpQkFDSiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IEFuZ3VsYXJQbHVnaW4gfSBmcm9tICcuL2FwcGxpY2F0aW9uaW5zaWdodHMtYW5ndWxhcnBsdWdpbi1qcy5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBBcHBsaWNhdGlvbmluc2lnaHRzQW5ndWxhcnBsdWdpbkVycm9yU2VydmljZSB9IGZyb20gJy4vYXBwbGljYXRpb25pbnNpZ2h0cy1hbmd1bGFycGx1Z2luLWVycm9yLnNlcnZpY2UnO1xyXG5cclxuQE5nTW9kdWxlKHtcclxuICAgIGRlY2xhcmF0aW9uczogW0FuZ3VsYXJQbHVnaW5dLFxyXG4gICAgaW1wb3J0czogW1xyXG4gICAgXSxcclxuICAgIGV4cG9ydHM6IFtBbmd1bGFyUGx1Z2luXSxcclxuICAgIHByb3ZpZGVyczogW1xyXG4gICAgICAgIEFwcGxpY2F0aW9uaW5zaWdodHNBbmd1bGFycGx1Z2luRXJyb3JTZXJ2aWNlXHJcbiAgICBdXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBBcHBsaWNhdGlvbmluc2lnaHRzQW5ndWxhcnBsdWdpbkpzTW9kdWxlIHsgfVxyXG4iXX0=
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, NgModule } from '@angular/core';
|
|
3
|
-
import { PropertiesPluginIdentifier, Util } from '@microsoft/applicationinsights-common';
|
|
4
|
-
import { arrForEach, BaseTelemetryPlugin, getLocation,
|
|
3
|
+
import { PropertiesPluginIdentifier, AnalyticsPluginIdentifier, Util } from '@microsoft/applicationinsights-common';
|
|
4
|
+
import { isFunction, arrForEach, BaseTelemetryPlugin, getLocation, _throwInternal } from '@microsoft/applicationinsights-core-js';
|
|
5
5
|
import { NavigationEnd } from '@angular/router';
|
|
6
6
|
|
|
7
7
|
class ApplicationinsightsAngularpluginErrorService {
|
|
@@ -15,7 +15,17 @@ class ApplicationinsightsAngularpluginErrorService {
|
|
|
15
15
|
this.analyticsPlugin = analyticsPlugin;
|
|
16
16
|
}
|
|
17
17
|
addErrorHandler(errorService) {
|
|
18
|
-
|
|
18
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
19
|
+
this.errorServices.push(errorService);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
removeErrorHandler(errorService) {
|
|
23
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
24
|
+
const idx = this.errorServices.indexOf(errorService);
|
|
25
|
+
if (idx !== -1) {
|
|
26
|
+
this.errorServices.splice(idx, 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
handleError(error) {
|
|
21
31
|
if (this.analyticsPlugin) {
|
|
@@ -23,7 +33,7 @@ class ApplicationinsightsAngularpluginErrorService {
|
|
|
23
33
|
}
|
|
24
34
|
if (this.errorServices && this.errorServices.length > 0) {
|
|
25
35
|
arrForEach(this.errorServices, errorService => {
|
|
26
|
-
if (errorService.handleError
|
|
36
|
+
if (isFunction(errorService.handleError)) {
|
|
27
37
|
errorService.handleError(error);
|
|
28
38
|
}
|
|
29
39
|
});
|
|
@@ -43,50 +53,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
43
53
|
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
44
54
|
class AngularPlugin extends BaseTelemetryPlugin {
|
|
45
55
|
constructor() {
|
|
46
|
-
super(
|
|
56
|
+
super();
|
|
47
57
|
this.priority = 186;
|
|
48
58
|
this.identifier = 'AngularPlugin';
|
|
59
|
+
this._angularCfg = null;
|
|
60
|
+
this._eventSubscription = null;
|
|
61
|
+
let self = this;
|
|
62
|
+
self._doTeardown = (unloadCtx, unloadState, asyncCallback) => {
|
|
63
|
+
if (this.analyticsPlugin && ApplicationinsightsAngularpluginErrorService.instance !== null) {
|
|
64
|
+
ApplicationinsightsAngularpluginErrorService.instance.plugin = null;
|
|
65
|
+
if (self._angularCfg) {
|
|
66
|
+
if (self._angularCfg.errorServices && Array.isArray(self._angularCfg.errorServices)) {
|
|
67
|
+
arrForEach(self._angularCfg.errorServices, (errorService) => {
|
|
68
|
+
ApplicationinsightsAngularpluginErrorService.instance.removeErrorHandler(errorService);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (self._eventSubscription) {
|
|
74
|
+
self._eventSubscription.unsubscribe();
|
|
75
|
+
self._eventSubscription = null;
|
|
76
|
+
}
|
|
77
|
+
self.analyticsPlugin = null;
|
|
78
|
+
self.propertiesPlugin = null;
|
|
79
|
+
self._angularCfg = null;
|
|
80
|
+
};
|
|
49
81
|
}
|
|
50
82
|
initialize(config, core, extensions, pluginChain) {
|
|
83
|
+
var _a, _b;
|
|
51
84
|
super.initialize(config, core, extensions, pluginChain);
|
|
52
85
|
const self = this;
|
|
53
86
|
const ctx = self._getTelCtx();
|
|
54
87
|
const extConfig = ctx.getExtCfg(self.identifier, { router: null, errorServices: null });
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
}
|
|
88
|
+
self.propertiesPlugin = (_a = core.getPlugin(PropertiesPluginIdentifier)) === null || _a === void 0 ? void 0 : _a.plugin;
|
|
89
|
+
self.analyticsPlugin = (_b = core.getPlugin(AnalyticsPluginIdentifier)) === null || _b === void 0 ? void 0 : _b.plugin;
|
|
90
|
+
if (self.analyticsPlugin) {
|
|
91
|
+
if (ApplicationinsightsAngularpluginErrorService.instance !== null) {
|
|
92
|
+
ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;
|
|
93
|
+
if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {
|
|
94
|
+
arrForEach(extConfig.errorServices, (errorService) => {
|
|
95
|
+
ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);
|
|
96
|
+
});
|
|
66
97
|
}
|
|
67
98
|
}
|
|
68
|
-
|
|
69
|
-
self.propertiesPlugin = ext;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
99
|
+
}
|
|
72
100
|
if (extConfig.router) {
|
|
73
101
|
let isPageInitialLoad = true;
|
|
74
102
|
const pageViewTelemetry = {
|
|
75
103
|
uri: extConfig.router.url
|
|
76
104
|
};
|
|
77
105
|
self.trackPageView(pageViewTelemetry);
|
|
78
|
-
extConfig.router.events.subscribe(event => {
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
isPageInitialLoad
|
|
83
|
-
|
|
106
|
+
self._eventSubscription = extConfig.router.events.subscribe(event => {
|
|
107
|
+
if (self.isInitialized()) {
|
|
108
|
+
if (event instanceof NavigationEnd) {
|
|
109
|
+
// for page initial load, do not call trackPageView twice
|
|
110
|
+
if (isPageInitialLoad) {
|
|
111
|
+
isPageInitialLoad = false;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const pvt = {
|
|
115
|
+
uri: extConfig.router.url,
|
|
116
|
+
properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
|
|
117
|
+
};
|
|
118
|
+
self.trackPageView(pvt);
|
|
84
119
|
}
|
|
85
|
-
const pvt = {
|
|
86
|
-
uri: extConfig.router.url,
|
|
87
|
-
properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
|
|
88
|
-
};
|
|
89
|
-
self.trackPageView(pvt);
|
|
90
120
|
}
|
|
91
121
|
});
|
|
92
122
|
}
|
|
@@ -110,13 +140,11 @@ class AngularPlugin extends BaseTelemetryPlugin {
|
|
|
110
140
|
self.analyticsPlugin.trackPageView(pageView);
|
|
111
141
|
}
|
|
112
142
|
else {
|
|
113
|
-
self.diagLog()
|
|
114
|
-
// eslint-disable-next-line max-len
|
|
115
|
-
LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');
|
|
143
|
+
_throwInternal(self.diagLog(), 1 /* CRITICAL */, 64 /* TelemetryInitializerFailed */, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');
|
|
116
144
|
}
|
|
117
145
|
}
|
|
118
146
|
}
|
|
119
|
-
AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, deps:
|
|
147
|
+
AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
120
148
|
AngularPlugin.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: AngularPlugin, selector: "lib-applicationinsights-angularplugin-js", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
121
149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, decorators: [{
|
|
122
150
|
type: Component,
|
|
@@ -125,7 +153,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
125
153
|
template: ``,
|
|
126
154
|
styles: []
|
|
127
155
|
}]
|
|
128
|
-
}] });
|
|
156
|
+
}], ctorParameters: function () { return []; } });
|
|
129
157
|
|
|
130
158
|
class ApplicationinsightsAngularpluginJsModule {
|
|
131
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft-applicationinsights-angularplugin-js.mjs","sources":["../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-error.service.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.component.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.module.ts","../../../projects/applicationinsights-angularplugin-js/src/public-api.ts","../../../projects/applicationinsights-angularplugin-js/src/microsoft-applicationinsights-angularplugin-js.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { IAppInsights } from '@microsoft/applicationinsights-common';\r\nimport { arrForEach } from '@microsoft/applicationinsights-core-js';\r\nimport { IErrorService } from './IErrorService';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApplicationinsightsAngularpluginErrorService implements IErrorService {\r\n public static instance: ApplicationinsightsAngularpluginErrorService = null;\r\n private analyticsPlugin: IAppInsights;\r\n private errorServices: IErrorService[] = [];\r\n\r\n constructor() {\r\n if (ApplicationinsightsAngularpluginErrorService.instance === null) {\r\n ApplicationinsightsAngularpluginErrorService.instance = this;\r\n }\r\n }\r\n\r\n public set plugin(analyticsPlugin: IAppInsights) {\r\n this.analyticsPlugin = analyticsPlugin;\r\n }\r\n\r\n public addErrorHandler(errorService: IErrorService): void {\r\n this.errorServices.push(errorService);\r\n }\r\n\r\n handleError(error: any): void {\r\n if (this.analyticsPlugin) {\r\n this.analyticsPlugin.trackException({ exception: error });\r\n }\r\n\r\n if (this.errorServices && this.errorServices.length > 0) {\r\n arrForEach(this.errorServices, errorService => {\r\n if (errorService.handleError && typeof errorService.handleError === 'function') {\r\n errorService.handleError(error);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\n","import { Component } from '@angular/core';\r\nimport {\r\n IConfig, IPageViewTelemetry, IAppInsights, PropertiesPluginIdentifier, Util\r\n} from '@microsoft/applicationinsights-common';\r\nimport {\r\n IPlugin, IConfiguration, IAppInsightsCore,\r\n ITelemetryPlugin, BaseTelemetryPlugin, arrForEach, ITelemetryItem, ITelemetryPluginChain,\r\n IProcessTelemetryContext, _InternalMessageId, LoggingSeverity, getLocation\r\n} from '@microsoft/applicationinsights-core-js';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\n// For types only\r\nimport * as properties from '@microsoft/applicationinsights-properties-js';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\nimport { IErrorService } from './IErrorService';\r\n\r\ninterface IAngularExtensionConfig {\r\n /**\r\n * Angular router for enabling Application Insights PageView tracking.\r\n */\r\n router?: Router;\r\n\r\n /**\r\n * Custom error service for global error handling.\r\n */\r\n errorServices?: IErrorService[];\r\n}\r\n\r\n@Component({\r\n selector: 'lib-applicationinsights-angularplugin-js',\r\n template: ``,\r\n styles: []\r\n})\r\n// eslint-disable-next-line @angular-eslint/component-class-suffix\r\nexport class AngularPlugin extends BaseTelemetryPlugin {\r\n public priority = 186;\r\n public identifier = 'AngularPlugin';\r\n\r\n private analyticsPlugin: IAppInsights;\r\n private propertiesPlugin: properties.PropertiesPlugin;\r\n\r\n initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) {\r\n super.initialize(config, core, extensions, pluginChain);\r\n const self = this;\r\n const ctx = self._getTelCtx();\r\n const extConfig = ctx.getExtCfg<IAngularExtensionConfig>(self.identifier, { router: null, errorServices: null });\r\n arrForEach(extensions, ext => {\r\n const identifier = (ext as ITelemetryPlugin).identifier;\r\n if (identifier === 'ApplicationInsightsAnalytics') {\r\n self.analyticsPlugin = (ext as any) as IAppInsights;\r\n if (ApplicationinsightsAngularpluginErrorService.instance !== null) {\r\n ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;\r\n if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {\r\n arrForEach(extConfig.errorServices, (errorService: IErrorService) => {\r\n ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n if (identifier === PropertiesPluginIdentifier) {\r\n self.propertiesPlugin = (ext as any) as properties.PropertiesPlugin;\r\n }\r\n });\r\n\r\n if (extConfig.router) {\r\n let isPageInitialLoad = true;\r\n const pageViewTelemetry: IPageViewTelemetry = {\r\n uri: extConfig.router.url\r\n };\r\n self.trackPageView(pageViewTelemetry);\r\n extConfig.router.events.subscribe(event => {\r\n if (event instanceof NavigationEnd) {\r\n // for page initial load, do not call trackPageView twice\r\n if (isPageInitialLoad) {\r\n isPageInitialLoad = false;\r\n return;\r\n }\r\n const pvt: IPageViewTelemetry = {\r\n uri: extConfig.router.url,\r\n properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0\r\n };\r\n self.trackPageView(pvt);\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Add Part A fields to the event\r\n *\r\n * @param event The event that needs to be processed\r\n */\r\n processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {\r\n this.processNext(event, itemCtx);\r\n }\r\n\r\n trackPageView(pageView: IPageViewTelemetry) {\r\n const self = this;\r\n\r\n if (self.analyticsPlugin) {\r\n const location = getLocation();\r\n if (self.propertiesPlugin && self.propertiesPlugin.context && self.propertiesPlugin.context.telemetryTrace) {\r\n self.propertiesPlugin.context.telemetryTrace.traceID = Util.generateW3CId();\r\n self.propertiesPlugin.context.telemetryTrace.name = location && location.pathname || '_unknown_';\r\n }\r\n self.analyticsPlugin.trackPageView(pageView);\r\n } else {\r\n self.diagLog().throwInternal(\r\n // eslint-disable-next-line max-len\r\n LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { AngularPlugin } from './applicationinsights-angularplugin-js.component';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\n\r\n@NgModule({\r\n declarations: [AngularPlugin],\r\n imports: [\r\n ],\r\n exports: [AngularPlugin],\r\n providers: [\r\n ApplicationinsightsAngularpluginErrorService\r\n ]\r\n})\r\nexport class ApplicationinsightsAngularpluginJsModule { }\r\n","/*\r\n * Public API Surface of applicationinsights-angularplugin-js\r\n */\r\n\r\nexport * from './lib/applicationinsights-angularplugin-js.component';\r\nexport * from './lib/applicationinsights-angularplugin-js.module';\r\nexport * from './lib/applicationinsights-angularplugin-error.service';\r\nexport * from './lib/IErrorService';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,4CAA4C;IAKvD;QAFQ,kBAAa,GAAoB,EAAE,CAAC;QAG1C,IAAI,4CAA4C,CAAC,QAAQ,KAAK,IAAI,EAAE;YAClE,4CAA4C,CAAC,QAAQ,GAAG,IAAI,CAAC;SAC9D;KACF;IAED,IAAW,MAAM,CAAC,eAA6B;QAC7C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KACxC;IAEM,eAAe,CAAC,YAA2B;QAChD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACvC;IAED,WAAW,CAAC,KAAU;QACpB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;SAC3D;QAED,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;YACvD,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY;gBACzC,IAAI,YAAY,CAAC,WAAW,IAAI,OAAO,YAAY,CAAC,WAAW,KAAK,UAAU,EAAE;oBAC9E,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;iBACjC;aACF,CAAC,CAAC;SACJ;KACF;;AA9Ba,qDAAQ,GAAiD,IAAK,CAAA;yIADjE,4CAA4C;6IAA5C,4CAA4C,cAF3C,MAAM;2FAEP,4CAA4C;kBAHxD,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;ACyBD;MACa,sBAAsB,mBAAmB;IANtD;;QAOW,aAAQ,GAAG,GAAG,CAAC;QACf,eAAU,GAAG,eAAe,CAAC;KA4EvC;IAvEG,UAAU,CAAC,MAAgC,EAAE,IAAsB,EAAE,UAAqB,EAAE,WAAmC;QAC3H,KAAK,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,SAAS;mBAAC;oBACP,QAAQ,EAAE,0CAA0C;oBACpD,QAAQ,EAAE,EAAE;oBACZ,MAAM,EAAE,EAAE;iBACb;;;MClBY,wCAAwC;;qIAAxC,wCAAwC;sIAAxC,wCAAwC,iBARpC,aAAa,aAGlB,aAAa;sIAKZ,wCAAwC,aAJxC;QACT,4CAA4C;KAC7C,YALQ,EACR;2FAMU,wCAAwC;kBATpD,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT,4CAA4C;qBAC7C;iBACF;;;ACZD;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"microsoft-applicationinsights-angularplugin-js.mjs","sources":["../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-error.service.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.component.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.module.ts","../../../projects/applicationinsights-angularplugin-js/src/public-api.ts","../../../projects/applicationinsights-angularplugin-js/src/microsoft-applicationinsights-angularplugin-js.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { IAppInsights } from '@microsoft/applicationinsights-common';\r\nimport { arrForEach, isFunction } from '@microsoft/applicationinsights-core-js';\r\nimport { IErrorService } from './IErrorService';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApplicationinsightsAngularpluginErrorService implements IErrorService {\r\n public static instance: ApplicationinsightsAngularpluginErrorService = null;\r\n private analyticsPlugin: IAppInsights;\r\n private errorServices: IErrorService[] = [];\r\n\r\n constructor() {\r\n if (ApplicationinsightsAngularpluginErrorService.instance === null) {\r\n ApplicationinsightsAngularpluginErrorService.instance = this;\r\n }\r\n }\r\n\r\n public set plugin(analyticsPlugin: IAppInsights) {\r\n this.analyticsPlugin = analyticsPlugin;\r\n }\r\n\r\n public addErrorHandler(errorService: IErrorService): void {\r\n if (errorService && isFunction(errorService.handleError)) {\r\n this.errorServices.push(errorService);\r\n }\r\n }\r\n\r\n public removeErrorHandler(errorService: IErrorService): void {\r\n if (errorService && isFunction(errorService.handleError)) {\r\n const idx = this.errorServices.indexOf(errorService);\r\n if (idx !== -1) {\r\n this.errorServices.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n handleError(error: any): void {\r\n if (this.analyticsPlugin) {\r\n this.analyticsPlugin.trackException({ exception: error });\r\n }\r\n\r\n if (this.errorServices && this.errorServices.length > 0) {\r\n arrForEach(this.errorServices, errorService => {\r\n if (isFunction(errorService.handleError)) {\r\n errorService.handleError(error);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\n","import { Component } from '@angular/core';\r\nimport {\r\n IConfig, IPageViewTelemetry, IAppInsights, PropertiesPluginIdentifier, Util, AnalyticsPluginIdentifier\r\n} from '@microsoft/applicationinsights-common';\r\nimport {\r\n IPlugin, IConfiguration, IAppInsightsCore,\r\n BaseTelemetryPlugin, arrForEach, ITelemetryItem, ITelemetryPluginChain,\r\n IProcessTelemetryContext, getLocation, _throwInternal, eLoggingSeverity, _eInternalMessageId, IProcessTelemetryUnloadContext, ITelemetryUnloadState\r\n} from '@microsoft/applicationinsights-core-js';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\n// For types only\r\nimport * as properties from '@microsoft/applicationinsights-properties-js';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\nimport { IErrorService } from './IErrorService';\r\nimport { Subscription } from 'rxjs';\r\nimport { AnalyticsPlugin } from '@microsoft/applicationinsights-analytics-js';\r\n\r\ninterface IAngularExtensionConfig {\r\n /**\r\n * Angular router for enabling Application Insights PageView tracking.\r\n */\r\n router?: Router;\r\n\r\n /**\r\n * Custom error service for global error handling.\r\n */\r\n errorServices?: IErrorService[];\r\n}\r\n\r\n@Component({\r\n selector: 'lib-applicationinsights-angularplugin-js',\r\n template: ``,\r\n styles: []\r\n})\r\n// eslint-disable-next-line @angular-eslint/component-class-suffix\r\nexport class AngularPlugin extends BaseTelemetryPlugin {\r\n public priority = 186;\r\n public identifier = 'AngularPlugin';\r\n\r\n private analyticsPlugin: AnalyticsPlugin;\r\n private propertiesPlugin: properties.PropertiesPlugin;\r\n private _angularCfg: IAngularExtensionConfig = null;\r\n private _eventSubscription: Subscription = null;\r\n\r\n\r\n constructor() {\r\n super();\r\n let self = this;\r\n\r\n self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean => {\r\n if (this.analyticsPlugin && ApplicationinsightsAngularpluginErrorService.instance !== null) {\r\n ApplicationinsightsAngularpluginErrorService.instance.plugin = null;\r\n if (self._angularCfg) {\r\n if (self._angularCfg.errorServices && Array.isArray(self._angularCfg.errorServices)) {\r\n arrForEach(self._angularCfg.errorServices, (errorService: IErrorService) => {\r\n ApplicationinsightsAngularpluginErrorService.instance.removeErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (self._eventSubscription) {\r\n self._eventSubscription.unsubscribe();\r\n self._eventSubscription = null;\r\n }\r\n\r\n self.analyticsPlugin = null;\r\n self.propertiesPlugin = null;\r\n self._angularCfg = null;\r\n }\r\n }\r\n\r\n initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) {\r\n super.initialize(config, core, extensions, pluginChain);\r\n const self = this;\r\n const ctx = self._getTelCtx();\r\n const extConfig = ctx.getExtCfg<IAngularExtensionConfig>(self.identifier, { router: null, errorServices: null });\r\n\r\n self.propertiesPlugin = core.getPlugin<properties.PropertiesPlugin>(PropertiesPluginIdentifier)?.plugin;\r\n self.analyticsPlugin = core.getPlugin<AnalyticsPlugin>(AnalyticsPluginIdentifier)?.plugin;\r\n if (self.analyticsPlugin) {\r\n if (ApplicationinsightsAngularpluginErrorService.instance !== null) {\r\n ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;\r\n if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {\r\n arrForEach(extConfig.errorServices, (errorService: IErrorService) => {\r\n ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (extConfig.router) {\r\n let isPageInitialLoad = true;\r\n const pageViewTelemetry: IPageViewTelemetry = {\r\n uri: extConfig.router.url\r\n };\r\n self.trackPageView(pageViewTelemetry);\r\n self._eventSubscription = extConfig.router.events.subscribe(event => {\r\n if (self.isInitialized()) {\r\n if (event instanceof NavigationEnd) {\r\n // for page initial load, do not call trackPageView twice\r\n if (isPageInitialLoad) {\r\n isPageInitialLoad = false;\r\n return;\r\n }\r\n const pvt: IPageViewTelemetry = {\r\n uri: extConfig.router.url,\r\n properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0\r\n };\r\n self.trackPageView(pvt);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Add Part A fields to the event\r\n *\r\n * @param event The event that needs to be processed\r\n */\r\n processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {\r\n this.processNext(event, itemCtx);\r\n }\r\n\r\n trackPageView(pageView: IPageViewTelemetry) {\r\n const self = this;\r\n\r\n if (self.analyticsPlugin) {\r\n const location = getLocation();\r\n if (self.propertiesPlugin && self.propertiesPlugin.context && self.propertiesPlugin.context.telemetryTrace) {\r\n self.propertiesPlugin.context.telemetryTrace.traceID = Util.generateW3CId();\r\n self.propertiesPlugin.context.telemetryTrace.name = location && location.pathname || '_unknown_';\r\n }\r\n self.analyticsPlugin.trackPageView(pageView);\r\n } else {\r\n _throwInternal(self.diagLog(),\r\n // eslint-disable-next-line max-len\r\n eLoggingSeverity.CRITICAL, _eInternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');\r\n }\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { AngularPlugin } from './applicationinsights-angularplugin-js.component';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\n\r\n@NgModule({\r\n declarations: [AngularPlugin],\r\n imports: [\r\n ],\r\n exports: [AngularPlugin],\r\n providers: [\r\n ApplicationinsightsAngularpluginErrorService\r\n ]\r\n})\r\nexport class ApplicationinsightsAngularpluginJsModule { }\r\n","/*\r\n * Public API Surface of applicationinsights-angularplugin-js\r\n */\r\n\r\nexport * from './lib/applicationinsights-angularplugin-js.component';\r\nexport * from './lib/applicationinsights-angularplugin-js.module';\r\nexport * from './lib/applicationinsights-angularplugin-error.service';\r\nexport * from './lib/IErrorService';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,4CAA4C;IAKrD;QAFQ,kBAAa,GAAoB,EAAE,CAAC;QAGxC,IAAI,4CAA4C,CAAC,QAAQ,KAAK,IAAI,EAAE;YAChE,4CAA4C,CAAC,QAAQ,GAAG,IAAI,CAAC;SAChE;KACJ;IAED,IAAW,MAAM,CAAC,eAA6B;QAC3C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KAC1C;IAEM,eAAe,CAAC,YAA2B;QAC9C,IAAI,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACtD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACzC;KACJ;IAEM,kBAAkB,CAAC,YAA2B;QACjD,IAAI,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACtD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACrD,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;gBACZ,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aACrC;SACJ;KACJ;IAED,WAAW,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CAAC,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;gBAC5E,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,IAAI,WAAW,CAAC;aACpG;YACD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;SAChD;aAAM;YACH,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,yDAEkD,gFAAgF,CAAC,CAAC;SACpK;KACJ;;0GAzGQ,aAAa;8FAAb,aAAa,uGAJZ,EAAE;2FAIH,aAAa;kBANzB,SAAS;mBAAC;oBACP,QAAQ,EAAE,0CAA0C;oBACpD,QAAQ,EAAE,EAAE;oBACZ,MAAM,EAAE,EAAE;iBACb;;;MCpBY,wCAAwC;;qIAAxC,wCAAwC;sIAAxC,wCAAwC,iBARlC,aAAa,aAGlB,aAAa;sIAKd,wCAAwC,aAJtC;QACP,4CAA4C;KAC/C,YALQ,EACR;2FAMQ,wCAAwC;kBATpD,QAAQ;mBAAC;oBACN,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACP,4CAA4C;qBAC/C;iBACJ;;;ACZD;;;;ACAA;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, NgModule } from '@angular/core';
|
|
3
|
-
import { PropertiesPluginIdentifier, Util } from '@microsoft/applicationinsights-common';
|
|
4
|
-
import { arrForEach, BaseTelemetryPlugin, getLocation,
|
|
3
|
+
import { PropertiesPluginIdentifier, AnalyticsPluginIdentifier, Util } from '@microsoft/applicationinsights-common';
|
|
4
|
+
import { isFunction, arrForEach, BaseTelemetryPlugin, getLocation, _throwInternal } from '@microsoft/applicationinsights-core-js';
|
|
5
5
|
import { NavigationEnd } from '@angular/router';
|
|
6
6
|
|
|
7
7
|
class ApplicationinsightsAngularpluginErrorService {
|
|
@@ -15,7 +15,17 @@ class ApplicationinsightsAngularpluginErrorService {
|
|
|
15
15
|
this.analyticsPlugin = analyticsPlugin;
|
|
16
16
|
}
|
|
17
17
|
addErrorHandler(errorService) {
|
|
18
|
-
|
|
18
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
19
|
+
this.errorServices.push(errorService);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
removeErrorHandler(errorService) {
|
|
23
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
24
|
+
const idx = this.errorServices.indexOf(errorService);
|
|
25
|
+
if (idx !== -1) {
|
|
26
|
+
this.errorServices.splice(idx, 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
handleError(error) {
|
|
21
31
|
if (this.analyticsPlugin) {
|
|
@@ -23,7 +33,7 @@ class ApplicationinsightsAngularpluginErrorService {
|
|
|
23
33
|
}
|
|
24
34
|
if (this.errorServices && this.errorServices.length > 0) {
|
|
25
35
|
arrForEach(this.errorServices, errorService => {
|
|
26
|
-
if (errorService.handleError
|
|
36
|
+
if (isFunction(errorService.handleError)) {
|
|
27
37
|
errorService.handleError(error);
|
|
28
38
|
}
|
|
29
39
|
});
|
|
@@ -43,50 +53,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
43
53
|
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
44
54
|
class AngularPlugin extends BaseTelemetryPlugin {
|
|
45
55
|
constructor() {
|
|
46
|
-
super(
|
|
56
|
+
super();
|
|
47
57
|
this.priority = 186;
|
|
48
58
|
this.identifier = 'AngularPlugin';
|
|
59
|
+
this._angularCfg = null;
|
|
60
|
+
this._eventSubscription = null;
|
|
61
|
+
let self = this;
|
|
62
|
+
self._doTeardown = (unloadCtx, unloadState, asyncCallback) => {
|
|
63
|
+
if (this.analyticsPlugin && ApplicationinsightsAngularpluginErrorService.instance !== null) {
|
|
64
|
+
ApplicationinsightsAngularpluginErrorService.instance.plugin = null;
|
|
65
|
+
if (self._angularCfg) {
|
|
66
|
+
if (self._angularCfg.errorServices && Array.isArray(self._angularCfg.errorServices)) {
|
|
67
|
+
arrForEach(self._angularCfg.errorServices, (errorService) => {
|
|
68
|
+
ApplicationinsightsAngularpluginErrorService.instance.removeErrorHandler(errorService);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (self._eventSubscription) {
|
|
74
|
+
self._eventSubscription.unsubscribe();
|
|
75
|
+
self._eventSubscription = null;
|
|
76
|
+
}
|
|
77
|
+
self.analyticsPlugin = null;
|
|
78
|
+
self.propertiesPlugin = null;
|
|
79
|
+
self._angularCfg = null;
|
|
80
|
+
};
|
|
49
81
|
}
|
|
50
82
|
initialize(config, core, extensions, pluginChain) {
|
|
51
83
|
super.initialize(config, core, extensions, pluginChain);
|
|
52
84
|
const self = this;
|
|
53
85
|
const ctx = self._getTelCtx();
|
|
54
86
|
const extConfig = ctx.getExtCfg(self.identifier, { router: null, errorServices: null });
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
}
|
|
87
|
+
self.propertiesPlugin = core.getPlugin(PropertiesPluginIdentifier)?.plugin;
|
|
88
|
+
self.analyticsPlugin = core.getPlugin(AnalyticsPluginIdentifier)?.plugin;
|
|
89
|
+
if (self.analyticsPlugin) {
|
|
90
|
+
if (ApplicationinsightsAngularpluginErrorService.instance !== null) {
|
|
91
|
+
ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;
|
|
92
|
+
if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {
|
|
93
|
+
arrForEach(extConfig.errorServices, (errorService) => {
|
|
94
|
+
ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);
|
|
95
|
+
});
|
|
66
96
|
}
|
|
67
97
|
}
|
|
68
|
-
|
|
69
|
-
self.propertiesPlugin = ext;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
98
|
+
}
|
|
72
99
|
if (extConfig.router) {
|
|
73
100
|
let isPageInitialLoad = true;
|
|
74
101
|
const pageViewTelemetry = {
|
|
75
102
|
uri: extConfig.router.url
|
|
76
103
|
};
|
|
77
104
|
self.trackPageView(pageViewTelemetry);
|
|
78
|
-
extConfig.router.events.subscribe(event => {
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
isPageInitialLoad
|
|
83
|
-
|
|
105
|
+
self._eventSubscription = extConfig.router.events.subscribe(event => {
|
|
106
|
+
if (self.isInitialized()) {
|
|
107
|
+
if (event instanceof NavigationEnd) {
|
|
108
|
+
// for page initial load, do not call trackPageView twice
|
|
109
|
+
if (isPageInitialLoad) {
|
|
110
|
+
isPageInitialLoad = false;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const pvt = {
|
|
114
|
+
uri: extConfig.router.url,
|
|
115
|
+
properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
|
|
116
|
+
};
|
|
117
|
+
self.trackPageView(pvt);
|
|
84
118
|
}
|
|
85
|
-
const pvt = {
|
|
86
|
-
uri: extConfig.router.url,
|
|
87
|
-
properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
|
|
88
|
-
};
|
|
89
|
-
self.trackPageView(pvt);
|
|
90
119
|
}
|
|
91
120
|
});
|
|
92
121
|
}
|
|
@@ -110,13 +139,11 @@ class AngularPlugin extends BaseTelemetryPlugin {
|
|
|
110
139
|
self.analyticsPlugin.trackPageView(pageView);
|
|
111
140
|
}
|
|
112
141
|
else {
|
|
113
|
-
self.diagLog()
|
|
114
|
-
// eslint-disable-next-line max-len
|
|
115
|
-
LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');
|
|
142
|
+
_throwInternal(self.diagLog(), 1 /* CRITICAL */, 64 /* TelemetryInitializerFailed */, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');
|
|
116
143
|
}
|
|
117
144
|
}
|
|
118
145
|
}
|
|
119
|
-
AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, deps:
|
|
146
|
+
AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
120
147
|
AngularPlugin.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: AngularPlugin, selector: "lib-applicationinsights-angularplugin-js", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
121
148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AngularPlugin, decorators: [{
|
|
122
149
|
type: Component,
|
|
@@ -125,7 +152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
125
152
|
template: ``,
|
|
126
153
|
styles: []
|
|
127
154
|
}]
|
|
128
|
-
}] });
|
|
155
|
+
}], ctorParameters: function () { return []; } });
|
|
129
156
|
|
|
130
157
|
class ApplicationinsightsAngularpluginJsModule {
|
|
131
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft-applicationinsights-angularplugin-js.mjs","sources":["../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-error.service.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.component.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.module.ts","../../../projects/applicationinsights-angularplugin-js/src/public-api.ts","../../../projects/applicationinsights-angularplugin-js/src/microsoft-applicationinsights-angularplugin-js.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { IAppInsights } from '@microsoft/applicationinsights-common';\r\nimport { arrForEach } from '@microsoft/applicationinsights-core-js';\r\nimport { IErrorService } from './IErrorService';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApplicationinsightsAngularpluginErrorService implements IErrorService {\r\n public static instance: ApplicationinsightsAngularpluginErrorService = null;\r\n private analyticsPlugin: IAppInsights;\r\n private errorServices: IErrorService[] = [];\r\n\r\n constructor() {\r\n if (ApplicationinsightsAngularpluginErrorService.instance === null) {\r\n ApplicationinsightsAngularpluginErrorService.instance = this;\r\n }\r\n }\r\n\r\n public set plugin(analyticsPlugin: IAppInsights) {\r\n this.analyticsPlugin = analyticsPlugin;\r\n }\r\n\r\n public addErrorHandler(errorService: IErrorService): void {\r\n this.errorServices.push(errorService);\r\n }\r\n\r\n handleError(error: any): void {\r\n if (this.analyticsPlugin) {\r\n this.analyticsPlugin.trackException({ exception: error });\r\n }\r\n\r\n if (this.errorServices && this.errorServices.length > 0) {\r\n arrForEach(this.errorServices, errorService => {\r\n if (errorService.handleError && typeof errorService.handleError === 'function') {\r\n errorService.handleError(error);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\n","import { Component } from '@angular/core';\r\nimport {\r\n IConfig, IPageViewTelemetry, IAppInsights, PropertiesPluginIdentifier, Util\r\n} from '@microsoft/applicationinsights-common';\r\nimport {\r\n IPlugin, IConfiguration, IAppInsightsCore,\r\n ITelemetryPlugin, BaseTelemetryPlugin, arrForEach, ITelemetryItem, ITelemetryPluginChain,\r\n IProcessTelemetryContext, _InternalMessageId, LoggingSeverity, getLocation\r\n} from '@microsoft/applicationinsights-core-js';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\n// For types only\r\nimport * as properties from '@microsoft/applicationinsights-properties-js';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\nimport { IErrorService } from './IErrorService';\r\n\r\ninterface IAngularExtensionConfig {\r\n /**\r\n * Angular router for enabling Application Insights PageView tracking.\r\n */\r\n router?: Router;\r\n\r\n /**\r\n * Custom error service for global error handling.\r\n */\r\n errorServices?: IErrorService[];\r\n}\r\n\r\n@Component({\r\n selector: 'lib-applicationinsights-angularplugin-js',\r\n template: ``,\r\n styles: []\r\n})\r\n// eslint-disable-next-line @angular-eslint/component-class-suffix\r\nexport class AngularPlugin extends BaseTelemetryPlugin {\r\n public priority = 186;\r\n public identifier = 'AngularPlugin';\r\n\r\n private analyticsPlugin: IAppInsights;\r\n private propertiesPlugin: properties.PropertiesPlugin;\r\n\r\n initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) {\r\n super.initialize(config, core, extensions, pluginChain);\r\n const self = this;\r\n const ctx = self._getTelCtx();\r\n const extConfig = ctx.getExtCfg<IAngularExtensionConfig>(self.identifier, { router: null, errorServices: null });\r\n arrForEach(extensions, ext => {\r\n const identifier = (ext as ITelemetryPlugin).identifier;\r\n if (identifier === 'ApplicationInsightsAnalytics') {\r\n self.analyticsPlugin = (ext as any) as IAppInsights;\r\n if (ApplicationinsightsAngularpluginErrorService.instance !== null) {\r\n ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;\r\n if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {\r\n arrForEach(extConfig.errorServices, (errorService: IErrorService) => {\r\n ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n if (identifier === PropertiesPluginIdentifier) {\r\n self.propertiesPlugin = (ext as any) as properties.PropertiesPlugin;\r\n }\r\n });\r\n\r\n if (extConfig.router) {\r\n let isPageInitialLoad = true;\r\n const pageViewTelemetry: IPageViewTelemetry = {\r\n uri: extConfig.router.url\r\n };\r\n self.trackPageView(pageViewTelemetry);\r\n extConfig.router.events.subscribe(event => {\r\n if (event instanceof NavigationEnd) {\r\n // for page initial load, do not call trackPageView twice\r\n if (isPageInitialLoad) {\r\n isPageInitialLoad = false;\r\n return;\r\n }\r\n const pvt: IPageViewTelemetry = {\r\n uri: extConfig.router.url,\r\n properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0\r\n };\r\n self.trackPageView(pvt);\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Add Part A fields to the event\r\n *\r\n * @param event The event that needs to be processed\r\n */\r\n processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {\r\n this.processNext(event, itemCtx);\r\n }\r\n\r\n trackPageView(pageView: IPageViewTelemetry) {\r\n const self = this;\r\n\r\n if (self.analyticsPlugin) {\r\n const location = getLocation();\r\n if (self.propertiesPlugin && self.propertiesPlugin.context && self.propertiesPlugin.context.telemetryTrace) {\r\n self.propertiesPlugin.context.telemetryTrace.traceID = Util.generateW3CId();\r\n self.propertiesPlugin.context.telemetryTrace.name = location && location.pathname || '_unknown_';\r\n }\r\n self.analyticsPlugin.trackPageView(pageView);\r\n } else {\r\n self.diagLog().throwInternal(\r\n // eslint-disable-next-line max-len\r\n LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { AngularPlugin } from './applicationinsights-angularplugin-js.component';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\n\r\n@NgModule({\r\n declarations: [AngularPlugin],\r\n imports: [\r\n ],\r\n exports: [AngularPlugin],\r\n providers: [\r\n ApplicationinsightsAngularpluginErrorService\r\n ]\r\n})\r\nexport class ApplicationinsightsAngularpluginJsModule { }\r\n","/*\r\n * Public API Surface of applicationinsights-angularplugin-js\r\n */\r\n\r\nexport * from './lib/applicationinsights-angularplugin-js.component';\r\nexport * from './lib/applicationinsights-angularplugin-js.module';\r\nexport * from './lib/applicationinsights-angularplugin-error.service';\r\nexport * from './lib/IErrorService';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,4CAA4C;IAKvD;QAFQ,kBAAa,GAAoB,EAAE,CAAC;QAG1C,IAAI,4CAA4C,CAAC,QAAQ,KAAK,IAAI,EAAE;YAClE,4CAA4C,CAAC,QAAQ,GAAG,IAAI,CAAC;SAC9D;KACF;IAED,IAAW,MAAM,CAAC,eAA6B;QAC7C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KACxC;IAEM,eAAe,CAAC,YAA2B;QAChD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACvC;IAED,WAAW,CAAC,KAAU;QACpB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;SAC3D;QAED,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;YACvD,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY;gBACzC,IAAI,YAAY,CAAC,WAAW,IAAI,OAAO,YAAY,CAAC,WAAW,KAAK,UAAU,EAAE;oBAC9E,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;iBACjC;aACF,CAAC,CAAC;SACJ;KACF;;AA9Ba,qDAAQ,GAAiD,IAAK,CAAA;yIADjE,4CAA4C;6IAA5C,4CAA4C,cAF3C,MAAM;2FAEP,4CAA4C;kBAHxD,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;ACyBD;MACa,aAAc,SAAQ,mBAAmB;IANtD;;QAOW,aAAQ,GAAG,GAAG,CAAC;QACf,eAAU,GAAG,eAAe,CAAC;KA4EvC;IAvEG,UAAU,CAAC,MAAgC,EAAE,IAAsB,EAAE,UAAqB,EAAE,WAAmC;QA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AAa;kBANzB,SAAS;mBAAC;oBACP,QAAQ,EAAE,0CAA0C;oBACpD,QAAQ,EAAE,EAAE;oBACZ,MAAM,EAAE,EAAE;iBACb;;;MClBY,wCAAwC;;qIAAxC,wCAAwC;sIAAxC,wCAAwC,iBARpC,aAAa,aAGlB,aAAa;sIAKZ,wCAAwC,aAJxC;QACT,4CAA4C;KAC7C,YALQ,EACR;2FAMU,wCAAwC;kBATpD,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT,4CAA4C;qBAC7C;iBACF;;;ACZD;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"microsoft-applicationinsights-angularplugin-js.mjs","sources":["../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-error.service.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.component.ts","../../../projects/applicationinsights-angularplugin-js/src/lib/applicationinsights-angularplugin-js.module.ts","../../../projects/applicationinsights-angularplugin-js/src/public-api.ts","../../../projects/applicationinsights-angularplugin-js/src/microsoft-applicationinsights-angularplugin-js.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { IAppInsights } from '@microsoft/applicationinsights-common';\r\nimport { arrForEach, isFunction } from '@microsoft/applicationinsights-core-js';\r\nimport { IErrorService } from './IErrorService';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApplicationinsightsAngularpluginErrorService implements IErrorService {\r\n public static instance: ApplicationinsightsAngularpluginErrorService = null;\r\n private analyticsPlugin: IAppInsights;\r\n private errorServices: IErrorService[] = [];\r\n\r\n constructor() {\r\n if (ApplicationinsightsAngularpluginErrorService.instance === null) {\r\n ApplicationinsightsAngularpluginErrorService.instance = this;\r\n }\r\n }\r\n\r\n public set plugin(analyticsPlugin: IAppInsights) {\r\n this.analyticsPlugin = analyticsPlugin;\r\n }\r\n\r\n public addErrorHandler(errorService: IErrorService): void {\r\n if (errorService && isFunction(errorService.handleError)) {\r\n this.errorServices.push(errorService);\r\n }\r\n }\r\n\r\n public removeErrorHandler(errorService: IErrorService): void {\r\n if (errorService && isFunction(errorService.handleError)) {\r\n const idx = this.errorServices.indexOf(errorService);\r\n if (idx !== -1) {\r\n this.errorServices.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n handleError(error: any): void {\r\n if (this.analyticsPlugin) {\r\n this.analyticsPlugin.trackException({ exception: error });\r\n }\r\n\r\n if (this.errorServices && this.errorServices.length > 0) {\r\n arrForEach(this.errorServices, errorService => {\r\n if (isFunction(errorService.handleError)) {\r\n errorService.handleError(error);\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\n","import { Component } from '@angular/core';\r\nimport {\r\n IConfig, IPageViewTelemetry, IAppInsights, PropertiesPluginIdentifier, Util, AnalyticsPluginIdentifier\r\n} from '@microsoft/applicationinsights-common';\r\nimport {\r\n IPlugin, IConfiguration, IAppInsightsCore,\r\n BaseTelemetryPlugin, arrForEach, ITelemetryItem, ITelemetryPluginChain,\r\n IProcessTelemetryContext, getLocation, _throwInternal, eLoggingSeverity, _eInternalMessageId, IProcessTelemetryUnloadContext, ITelemetryUnloadState\r\n} from '@microsoft/applicationinsights-core-js';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\n// For types only\r\nimport * as properties from '@microsoft/applicationinsights-properties-js';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\nimport { IErrorService } from './IErrorService';\r\nimport { Subscription } from 'rxjs';\r\nimport { AnalyticsPlugin } from '@microsoft/applicationinsights-analytics-js';\r\n\r\ninterface IAngularExtensionConfig {\r\n /**\r\n * Angular router for enabling Application Insights PageView tracking.\r\n */\r\n router?: Router;\r\n\r\n /**\r\n * Custom error service for global error handling.\r\n */\r\n errorServices?: IErrorService[];\r\n}\r\n\r\n@Component({\r\n selector: 'lib-applicationinsights-angularplugin-js',\r\n template: ``,\r\n styles: []\r\n})\r\n// eslint-disable-next-line @angular-eslint/component-class-suffix\r\nexport class AngularPlugin extends BaseTelemetryPlugin {\r\n public priority = 186;\r\n public identifier = 'AngularPlugin';\r\n\r\n private analyticsPlugin: AnalyticsPlugin;\r\n private propertiesPlugin: properties.PropertiesPlugin;\r\n private _angularCfg: IAngularExtensionConfig = null;\r\n private _eventSubscription: Subscription = null;\r\n\r\n\r\n constructor() {\r\n super();\r\n let self = this;\r\n\r\n self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean => {\r\n if (this.analyticsPlugin && ApplicationinsightsAngularpluginErrorService.instance !== null) {\r\n ApplicationinsightsAngularpluginErrorService.instance.plugin = null;\r\n if (self._angularCfg) {\r\n if (self._angularCfg.errorServices && Array.isArray(self._angularCfg.errorServices)) {\r\n arrForEach(self._angularCfg.errorServices, (errorService: IErrorService) => {\r\n ApplicationinsightsAngularpluginErrorService.instance.removeErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (self._eventSubscription) {\r\n self._eventSubscription.unsubscribe();\r\n self._eventSubscription = null;\r\n }\r\n\r\n self.analyticsPlugin = null;\r\n self.propertiesPlugin = null;\r\n self._angularCfg = null;\r\n }\r\n }\r\n\r\n initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) {\r\n super.initialize(config, core, extensions, pluginChain);\r\n const self = this;\r\n const ctx = self._getTelCtx();\r\n const extConfig = ctx.getExtCfg<IAngularExtensionConfig>(self.identifier, { router: null, errorServices: null });\r\n\r\n self.propertiesPlugin = core.getPlugin<properties.PropertiesPlugin>(PropertiesPluginIdentifier)?.plugin;\r\n self.analyticsPlugin = core.getPlugin<AnalyticsPlugin>(AnalyticsPluginIdentifier)?.plugin;\r\n if (self.analyticsPlugin) {\r\n if (ApplicationinsightsAngularpluginErrorService.instance !== null) {\r\n ApplicationinsightsAngularpluginErrorService.instance.plugin = self.analyticsPlugin;\r\n if (extConfig.errorServices && Array.isArray(extConfig.errorServices)) {\r\n arrForEach(extConfig.errorServices, (errorService: IErrorService) => {\r\n ApplicationinsightsAngularpluginErrorService.instance.addErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (extConfig.router) {\r\n let isPageInitialLoad = true;\r\n const pageViewTelemetry: IPageViewTelemetry = {\r\n uri: extConfig.router.url\r\n };\r\n self.trackPageView(pageViewTelemetry);\r\n self._eventSubscription = extConfig.router.events.subscribe(event => {\r\n if (self.isInitialized()) {\r\n if (event instanceof NavigationEnd) {\r\n // for page initial load, do not call trackPageView twice\r\n if (isPageInitialLoad) {\r\n isPageInitialLoad = false;\r\n return;\r\n }\r\n const pvt: IPageViewTelemetry = {\r\n uri: extConfig.router.url,\r\n properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0\r\n };\r\n self.trackPageView(pvt);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Add Part A fields to the event\r\n *\r\n * @param event The event that needs to be processed\r\n */\r\n processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {\r\n this.processNext(event, itemCtx);\r\n }\r\n\r\n trackPageView(pageView: IPageViewTelemetry) {\r\n const self = this;\r\n\r\n if (self.analyticsPlugin) {\r\n const location = getLocation();\r\n if (self.propertiesPlugin && self.propertiesPlugin.context && self.propertiesPlugin.context.telemetryTrace) {\r\n self.propertiesPlugin.context.telemetryTrace.traceID = Util.generateW3CId();\r\n self.propertiesPlugin.context.telemetryTrace.name = location && location.pathname || '_unknown_';\r\n }\r\n self.analyticsPlugin.trackPageView(pageView);\r\n } else {\r\n _throwInternal(self.diagLog(),\r\n // eslint-disable-next-line max-len\r\n eLoggingSeverity.CRITICAL, _eInternalMessageId.TelemetryInitializerFailed, 'Analytics plugin is not available, Angular plugin telemetry will not be sent: ');\r\n }\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { AngularPlugin } from './applicationinsights-angularplugin-js.component';\r\nimport { ApplicationinsightsAngularpluginErrorService } from './applicationinsights-angularplugin-error.service';\r\n\r\n@NgModule({\r\n declarations: [AngularPlugin],\r\n imports: [\r\n ],\r\n exports: [AngularPlugin],\r\n providers: [\r\n ApplicationinsightsAngularpluginErrorService\r\n ]\r\n})\r\nexport class ApplicationinsightsAngularpluginJsModule { }\r\n","/*\r\n * Public API Surface of applicationinsights-angularplugin-js\r\n */\r\n\r\nexport * from './lib/applicationinsights-angularplugin-js.component';\r\nexport * from './lib/applicationinsights-angularplugin-js.module';\r\nexport * from './lib/applicationinsights-angularplugin-error.service';\r\nexport * from './lib/IErrorService';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,4CAA4C;IAKrD;QAFQ,kBAAa,GAAoB,EAAE,CAAC;QAGxC,IAAI,4CAA4C,CAAC,QAAQ,KAAK,IAAI,EAAE;YAChE,4CAA4C,CAAC,QAAQ,GAAG,IAAI,CAAC;SAChE;KACJ;IAED,IAAW,MAAM,CAAC,eAA6B;QAC3C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KAC1C;IAEM,eAAe,CAAC,YAA2B;QAC9C,IAAI,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACtD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACzC;KACJ;IAEM,kBAAkB,CAAC,YAA2B;QACjD,IAAI,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACtD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACrD,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;gBACZ,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aACrC;SACJ;KACJ;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CAAC,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;gBAC5E,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,IAAI,WAAW,CAAC;aACpG;YACD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;SAChD;aAAM;YACH,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,yDAEkD,gFAAgF,CAAC,CAAC;SACpK;KACJ;;0GAzGQ,aAAa;8FAAb,aAAa,uGAJZ,EAAE;2FAIH,aAAa;kBANzB,SAAS;mBAAC;oBACP,QAAQ,EAAE,0CAA0C;oBACpD,QAAQ,EAAE,EAAE;oBACZ,MAAM,EAAE,EAAE;iBACb;;;MCpBY,wCAAwC;;qIAAxC,wCAAwC;sIAAxC,wCAAwC,iBARlC,aAAa,aAGlB,aAAa;sIAKd,wCAAwC,aAJtC;QACP,4CAA4C;KAC/C,YALQ,EACR;2FAMQ,wCAAwC;kBATpD,QAAQ;mBAAC;oBACN,YAAY,EAAE,CAAC,aAAa,CAAC;oBAC7B,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACP,4CAA4C;qBAC/C;iBACJ;;;ACZD;;;;ACAA;;;;;;"}
|
|
@@ -8,6 +8,7 @@ export declare class ApplicationinsightsAngularpluginErrorService implements IEr
|
|
|
8
8
|
constructor();
|
|
9
9
|
set plugin(analyticsPlugin: IAppInsights);
|
|
10
10
|
addErrorHandler(errorService: IErrorService): void;
|
|
11
|
+
removeErrorHandler(errorService: IErrorService): void;
|
|
11
12
|
handleError(error: any): void;
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationinsightsAngularpluginErrorService, never>;
|
|
13
14
|
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationinsightsAngularpluginErrorService>;
|
|
@@ -6,6 +6,9 @@ export declare class AngularPlugin extends BaseTelemetryPlugin {
|
|
|
6
6
|
identifier: string;
|
|
7
7
|
private analyticsPlugin;
|
|
8
8
|
private propertiesPlugin;
|
|
9
|
+
private _angularCfg;
|
|
10
|
+
private _eventSubscription;
|
|
11
|
+
constructor();
|
|
9
12
|
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
10
13
|
/**
|
|
11
14
|
* Add Part A fields to the event
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-angularplugin-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^13.0.3",
|
|
6
6
|
"@angular/core": "^13.0.3"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@microsoft/applicationinsights-common": "~2.
|
|
10
|
-
"@microsoft/applicationinsights-core-js": "~2.
|
|
11
|
-
"@microsoft/applicationinsights-properties-js": "~2.
|
|
9
|
+
"@microsoft/applicationinsights-common": "~2.8.1",
|
|
10
|
+
"@microsoft/applicationinsights-core-js": "~2.8.1",
|
|
11
|
+
"@microsoft/applicationinsights-properties-js": "~2.8.1",
|
|
12
12
|
"@microsoft/applicationinsights-rollup-es3": "^1.1.3",
|
|
13
13
|
"@microsoft/applicationinsights-shims": "^1.0.3",
|
|
14
14
|
"tslib": "^2.0.0"
|
|
Binary file
|