@microsoft/applicationinsights-angularplugin-js 15.4.2-nightly.2608-05 → 15.4.2-nightly.2608-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.
@@ -5,225 +5,227 @@ import dynamicProto from '@microsoft/dynamicproto-js';
5
5
  import { NavigationEnd } from '@angular/router';
6
6
  import { objDeepFreeze } from '@nevware21/ts-utils';
7
7
 
8
- class ApplicationinsightsAngularpluginErrorService {
9
- constructor() {
10
- this.errorServices = [];
11
- if (ApplicationinsightsAngularpluginErrorService.instance === null) {
12
- ApplicationinsightsAngularpluginErrorService.instance = this;
13
- }
14
- }
15
- set plugin(analyticsPlugin) {
16
- this.analyticsPlugin = analyticsPlugin;
17
- }
18
- clearErrorHandlers() {
19
- this.errorServices = [];
20
- }
21
- addErrorHandler(errorService) {
22
- if (errorService && isFunction(errorService.handleError)) {
23
- this.errorServices.push(errorService);
24
- }
25
- }
26
- removeErrorHandler(errorService) {
27
- if (errorService && isFunction(errorService.handleError)) {
28
- const idx = this.errorServices.indexOf(errorService);
29
- if (idx !== -1) {
30
- this.errorServices.splice(idx, 1);
31
- }
32
- }
33
- }
34
- handleError(error) {
35
- if (this.analyticsPlugin) {
36
- this.analyticsPlugin.trackException({ exception: error });
37
- }
38
- if (this.errorServices && this.errorServices.length > 0) {
39
- arrForEach(this.errorServices, errorService => {
40
- if (isFunction(errorService.handleError)) {
41
- errorService.handleError(error);
42
- }
43
- });
44
- }
45
- }
46
- }
47
- ApplicationinsightsAngularpluginErrorService.instance = null;
48
- ApplicationinsightsAngularpluginErrorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
49
- ApplicationinsightsAngularpluginErrorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, providedIn: "root" });
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, decorators: [{
51
- type: Injectable,
52
- args: [{
53
- providedIn: "root"
54
- }]
55
- }], ctorParameters: function () { return []; } });
8
+ class ApplicationinsightsAngularpluginErrorService {
9
+ static instance = null;
10
+ analyticsPlugin;
11
+ errorServices = [];
12
+ constructor() {
13
+ if (ApplicationinsightsAngularpluginErrorService.instance === null) {
14
+ ApplicationinsightsAngularpluginErrorService.instance = this;
15
+ }
16
+ }
17
+ set plugin(analyticsPlugin) {
18
+ this.analyticsPlugin = analyticsPlugin;
19
+ }
20
+ clearErrorHandlers() {
21
+ this.errorServices = [];
22
+ }
23
+ addErrorHandler(errorService) {
24
+ if (errorService && isFunction(errorService.handleError)) {
25
+ this.errorServices.push(errorService);
26
+ }
27
+ }
28
+ removeErrorHandler(errorService) {
29
+ if (errorService && isFunction(errorService.handleError)) {
30
+ const idx = this.errorServices.indexOf(errorService);
31
+ if (idx !== -1) {
32
+ this.errorServices.splice(idx, 1);
33
+ }
34
+ }
35
+ }
36
+ handleError(error) {
37
+ if (this.analyticsPlugin) {
38
+ this.analyticsPlugin.trackException({ exception: error });
39
+ }
40
+ if (this.errorServices && this.errorServices.length > 0) {
41
+ arrForEach(this.errorServices, errorService => {
42
+ if (isFunction(errorService.handleError)) {
43
+ errorService.handleError(error);
44
+ }
45
+ });
46
+ }
47
+ }
48
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
49
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, providedIn: "root" });
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, decorators: [{
52
+ type: Injectable,
53
+ args: [{
54
+ providedIn: "root"
55
+ }]
56
+ }], ctorParameters: () => [] });
56
57
 
57
- let undefValue;
58
- const defaultAngularExtensionConfig = objDeepFreeze({
59
- router: { blkVal: true, v: undefValue },
60
- errorServices: { blkVal: true, v: undefValue }
61
- });
62
- // eslint-disable-next-line @angular-eslint/component-class-suffix
63
- class AngularPlugin extends BaseTelemetryPlugin {
64
- constructor(_injector) {
65
- super();
66
- this._injector = _injector;
67
- this.priority = 186;
68
- this.identifier = "AngularPlugin";
69
- let _analyticsPlugin;
70
- let _propertiesPlugin;
71
- let _angularCfg;
72
- let _eventSubscription;
73
- let _isPageInitialLoad;
74
- let _prevRouter;
75
- let _errorServiceInstance;
76
- dynamicProto(AngularPlugin, this, (_self, _base) => {
77
- const _initDefaults = () => {
78
- _analyticsPlugin = null;
79
- _propertiesPlugin = null;
80
- _angularCfg = null;
81
- _eventSubscription = null;
82
- _isPageInitialLoad = true;
83
- _prevRouter = undefValue;
84
- _errorServiceInstance = null;
85
- };
86
- _initDefaults();
87
- _self.initialize = (config, core, extensions, pluginChain) => {
88
- super.initialize(config, core, extensions, pluginChain);
89
- _self._addHook(onConfigChange(config, (details) => {
90
- let ctx = _self._getTelCtx();
91
- _angularCfg = ctx.getExtCfg(_self.identifier, defaultAngularExtensionConfig);
92
- _propertiesPlugin = core.getPlugin(PropertiesPluginIdentifier)?.plugin;
93
- _analyticsPlugin = core.getPlugin(AnalyticsPluginIdentifier)?.plugin;
94
- if (_angularCfg.useInjector && _injector) {
95
- _errorServiceInstance = this._injector.get(ApplicationinsightsAngularpluginErrorService);
96
- }
97
- _errorServiceInstance = _errorServiceInstance ? _errorServiceInstance
98
- : ApplicationinsightsAngularpluginErrorService.instance;
99
- // two instance of errorService
100
- if (_analyticsPlugin) {
101
- if (_errorServiceInstance !== null) {
102
- _errorServiceInstance.plugin = _analyticsPlugin;
103
- if (_angularCfg.errorServices && isArray(_angularCfg.errorServices)) {
104
- _errorServiceInstance.clearErrorHandlers();
105
- arrForEach(_angularCfg.errorServices, (errorService) => {
106
- _errorServiceInstance.addErrorHandler(errorService);
107
- });
108
- }
109
- }
110
- }
111
- if (_angularCfg.router !== _prevRouter) {
112
- // router is changed, or has not been initialized yet
113
- // unsubscribe previous router events
114
- if (_eventSubscription) {
115
- _eventSubscription.unsubscribe();
116
- }
117
- if (_angularCfg.router) {
118
- // only track page view if it is the initial page load for this plugin
119
- if (_isPageInitialLoad) {
120
- const pageViewTelemetry = {
121
- uri: _angularCfg.router.url
122
- };
123
- _self.trackPageView(pageViewTelemetry);
124
- }
125
- // subscribe to new router events
126
- _eventSubscription = _angularCfg.router.events.subscribe(event => {
127
- if (_self.isInitialized()) {
128
- if (event instanceof NavigationEnd) {
129
- // for page initial load, do not call trackPageView twice
130
- if (_isPageInitialLoad) {
131
- _isPageInitialLoad = false;
132
- return;
133
- }
134
- const pvt = {
135
- uri: _angularCfg.router.url,
136
- properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
137
- };
138
- _self.trackPageView(pvt);
139
- }
140
- }
141
- });
142
- }
143
- _prevRouter = _angularCfg.router;
144
- }
145
- }));
146
- // for test purpose only
147
- _self["_getDbgPlgTargets"] = () => _angularCfg;
148
- _self["_getErrorService"] = () => _errorServiceInstance;
149
- };
150
- _self.trackPageView = (pageView) => {
151
- if (_analyticsPlugin) {
152
- const location = getLocation();
153
- if (_propertiesPlugin && _propertiesPlugin.context && _propertiesPlugin.context.telemetryTrace) {
154
- _propertiesPlugin.context.telemetryTrace.traceID = generateW3CId();
155
- _propertiesPlugin.context.telemetryTrace.name = location && location.pathname || "_unknown_";
156
- }
157
- _analyticsPlugin.trackPageView(pageView);
158
- }
159
- else {
160
- _throwInternal(_self.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, "Analytics plugin is not available, Angular plugin telemetry will not be sent: ");
161
- }
162
- };
163
- _self._doTeardown = (unloadCtx, unloadState, asyncCallback) => {
164
- if (_analyticsPlugin && _errorServiceInstance !== null) {
165
- _errorServiceInstance.plugin = null;
166
- if (_angularCfg) {
167
- if (_angularCfg.errorServices && Array.isArray(_angularCfg.errorServices)) {
168
- _errorServiceInstance.clearErrorHandlers();
169
- }
170
- }
171
- }
172
- if (_eventSubscription) {
173
- _eventSubscription.unsubscribe();
174
- _eventSubscription = null;
175
- }
176
- _initDefaults();
177
- };
178
- });
179
- }
180
- /**
181
- * Add Part A fields to the event
182
- *
183
- * @param event The event that needs to be processed
184
- */
185
- processTelemetry(event, itemCtx) {
186
- this.processNext(event, itemCtx);
187
- }
188
- initialize(config, core, extensions, pluginChain) {
189
- // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
190
- }
191
- trackPageView(pageView) {
192
- // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
193
- }
194
- }
195
- AngularPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularPlugin, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
196
- AngularPlugin.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AngularPlugin, selector: "lib-applicationinsights-angularplugin-js", usesInheritance: true, ngImport: i0, template: "", isInline: true });
197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularPlugin, decorators: [{
198
- type: Component,
199
- args: [{ selector: "lib-applicationinsights-angularplugin-js", template: "" }]
200
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
58
+ let undefValue;
59
+ const defaultAngularExtensionConfig = objDeepFreeze({
60
+ router: { blkVal: true, v: undefValue },
61
+ errorServices: { blkVal: true, v: undefValue }
62
+ });
63
+ // eslint-disable-next-line @angular-eslint/component-class-suffix
64
+ class AngularPlugin extends BaseTelemetryPlugin {
65
+ _injector;
66
+ priority = 186;
67
+ identifier = "AngularPlugin";
68
+ constructor(_injector) {
69
+ super();
70
+ this._injector = _injector;
71
+ let _analyticsPlugin;
72
+ let _propertiesPlugin;
73
+ let _angularCfg;
74
+ let _eventSubscription;
75
+ let _isPageInitialLoad;
76
+ let _prevRouter;
77
+ let _errorServiceInstance;
78
+ dynamicProto(AngularPlugin, this, (_self, _base) => {
79
+ const _initDefaults = () => {
80
+ _analyticsPlugin = null;
81
+ _propertiesPlugin = null;
82
+ _angularCfg = null;
83
+ _eventSubscription = null;
84
+ _isPageInitialLoad = true;
85
+ _prevRouter = undefValue;
86
+ _errorServiceInstance = null;
87
+ };
88
+ _initDefaults();
89
+ _self.initialize = (config, core, extensions, pluginChain) => {
90
+ super.initialize(config, core, extensions, pluginChain);
91
+ _self._addHook(onConfigChange(config, (details) => {
92
+ let ctx = _self._getTelCtx();
93
+ _angularCfg = ctx.getExtCfg(_self.identifier, defaultAngularExtensionConfig);
94
+ _propertiesPlugin = core.getPlugin(PropertiesPluginIdentifier)?.plugin;
95
+ _analyticsPlugin = core.getPlugin(AnalyticsPluginIdentifier)?.plugin;
96
+ if (_angularCfg.useInjector && _injector) {
97
+ _errorServiceInstance = this._injector.get(ApplicationinsightsAngularpluginErrorService);
98
+ }
99
+ _errorServiceInstance = _errorServiceInstance ? _errorServiceInstance
100
+ : ApplicationinsightsAngularpluginErrorService.instance;
101
+ // two instance of errorService
102
+ if (_analyticsPlugin) {
103
+ if (_errorServiceInstance !== null) {
104
+ _errorServiceInstance.plugin = _analyticsPlugin;
105
+ if (_angularCfg.errorServices && isArray(_angularCfg.errorServices)) {
106
+ _errorServiceInstance.clearErrorHandlers();
107
+ arrForEach(_angularCfg.errorServices, (errorService) => {
108
+ _errorServiceInstance.addErrorHandler(errorService);
109
+ });
110
+ }
111
+ }
112
+ }
113
+ if (_angularCfg.router !== _prevRouter) {
114
+ // router is changed, or has not been initialized yet
115
+ // unsubscribe previous router events
116
+ if (_eventSubscription) {
117
+ _eventSubscription.unsubscribe();
118
+ }
119
+ if (_angularCfg.router) {
120
+ // only track page view if it is the initial page load for this plugin
121
+ if (_isPageInitialLoad) {
122
+ const pageViewTelemetry = {
123
+ uri: _angularCfg.router.url
124
+ };
125
+ _self.trackPageView(pageViewTelemetry);
126
+ }
127
+ // subscribe to new router events
128
+ _eventSubscription = _angularCfg.router.events.subscribe(event => {
129
+ if (_self.isInitialized()) {
130
+ if (event instanceof NavigationEnd) {
131
+ // for page initial load, do not call trackPageView twice
132
+ if (_isPageInitialLoad) {
133
+ _isPageInitialLoad = false;
134
+ return;
135
+ }
136
+ const pvt = {
137
+ uri: _angularCfg.router.url,
138
+ properties: { duration: 0 } // SPA route change loading durations are undefined, so send 0
139
+ };
140
+ _self.trackPageView(pvt);
141
+ }
142
+ }
143
+ });
144
+ }
145
+ _prevRouter = _angularCfg.router;
146
+ }
147
+ }));
148
+ // for test purpose only
149
+ _self["_getDbgPlgTargets"] = () => _angularCfg;
150
+ _self["_getErrorService"] = () => _errorServiceInstance;
151
+ };
152
+ _self.trackPageView = (pageView) => {
153
+ if (_analyticsPlugin) {
154
+ const location = getLocation();
155
+ if (_propertiesPlugin && _propertiesPlugin.context && _propertiesPlugin.context.telemetryTrace) {
156
+ _propertiesPlugin.context.telemetryTrace.traceID = generateW3CId();
157
+ _propertiesPlugin.context.telemetryTrace.name = location && location.pathname || "_unknown_";
158
+ }
159
+ _analyticsPlugin.trackPageView(pageView);
160
+ }
161
+ else {
162
+ _throwInternal(_self.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, 64 /* _eInternalMessageId.TelemetryInitializerFailed */, "Analytics plugin is not available, Angular plugin telemetry will not be sent: ");
163
+ }
164
+ };
165
+ _self._doTeardown = (unloadCtx, unloadState, asyncCallback) => {
166
+ if (_analyticsPlugin && _errorServiceInstance !== null) {
167
+ _errorServiceInstance.plugin = null;
168
+ if (_angularCfg) {
169
+ if (_angularCfg.errorServices && Array.isArray(_angularCfg.errorServices)) {
170
+ _errorServiceInstance.clearErrorHandlers();
171
+ }
172
+ }
173
+ }
174
+ if (_eventSubscription) {
175
+ _eventSubscription.unsubscribe();
176
+ _eventSubscription = null;
177
+ }
178
+ _initDefaults();
179
+ };
180
+ });
181
+ }
182
+ /**
183
+ * Add Part A fields to the event
184
+ *
185
+ * @param event The event that needs to be processed
186
+ */
187
+ processTelemetry(event, itemCtx) {
188
+ this.processNext(event, itemCtx);
189
+ }
190
+ initialize(config, core, extensions, pluginChain) {
191
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
192
+ }
193
+ trackPageView(pageView) {
194
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
195
+ }
196
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AngularPlugin, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
197
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: AngularPlugin, isStandalone: false, selector: "lib-applicationinsights-angularplugin-js", usesInheritance: true, ngImport: i0, template: "", isInline: true });
198
+ }
199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AngularPlugin, decorators: [{
200
+ type: Component,
201
+ args: [{ selector: "lib-applicationinsights-angularplugin-js", template: "", standalone: false }]
202
+ }], ctorParameters: () => [{ type: i0.Injector }] });
201
203
 
202
- class ApplicationinsightsAngularpluginJsModule {
203
- }
204
- ApplicationinsightsAngularpluginJsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
205
- ApplicationinsightsAngularpluginJsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, declarations: [AngularPlugin], exports: [AngularPlugin] });
206
- ApplicationinsightsAngularpluginJsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, providers: [
207
- ApplicationinsightsAngularpluginErrorService
208
- ] });
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, decorators: [{
210
- type: NgModule,
211
- args: [{
212
- declarations: [AngularPlugin],
213
- imports: [],
214
- exports: [AngularPlugin],
215
- providers: [
216
- ApplicationinsightsAngularpluginErrorService
217
- ]
218
- }]
204
+ class ApplicationinsightsAngularpluginJsModule {
205
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
206
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, declarations: [AngularPlugin], exports: [AngularPlugin] });
207
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, providers: [
208
+ ApplicationinsightsAngularpluginErrorService
209
+ ] });
210
+ }
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ApplicationinsightsAngularpluginJsModule, decorators: [{
212
+ type: NgModule,
213
+ args: [{
214
+ declarations: [AngularPlugin],
215
+ imports: [],
216
+ exports: [AngularPlugin],
217
+ providers: [
218
+ ApplicationinsightsAngularpluginErrorService
219
+ ]
220
+ }]
219
221
  }] });
220
222
 
221
- /*
222
- * Public API Surface of applicationinsights-angularplugin-js
223
+ /*
224
+ * Public API Surface of applicationinsights-angularplugin-js
223
225
  */
224
226
 
225
- /**
226
- * Generated bundle index. Do not edit.
227
+ /**
228
+ * Generated bundle index. Do not edit.
227
229
  */
228
230
 
229
231
  export { AngularPlugin, ApplicationinsightsAngularpluginErrorService, ApplicationinsightsAngularpluginJsModule };
@@ -0,0 +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, 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 clearErrorHandlers() {\r\n this.errorServices = [];\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, Injector} from \"@angular/core\";\r\nimport {\r\n IPlugin, IConfiguration, IAppInsightsCore, BaseTelemetryPlugin, arrForEach, ITelemetryItem, ITelemetryPluginChain,\r\n IProcessTelemetryContext, getLocation, _throwInternal, eLoggingSeverity, _eInternalMessageId, IProcessTelemetryUnloadContext,\r\n ITelemetryUnloadState, generateW3CId, onConfigChange, IConfigDefaults, isArray,\r\n IPageViewTelemetry, PropertiesPluginIdentifier, AnalyticsPluginIdentifier\r\n} from \"@microsoft/applicationinsights-core-js\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { NavigationEnd, Router } from \"@angular/router\";\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\nimport {objDeepFreeze} from \"@nevware21/ts-utils\";\r\nimport { PropertiesPlugin } from \"@microsoft/applicationinsights-properties-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 useInjector?: boolean;\r\n}\r\n\r\nlet undefValue;\r\n\r\nconst defaultAngularExtensionConfig: IConfigDefaults<IAngularExtensionConfig> = objDeepFreeze({\r\n router: { blkVal: true, v: undefValue},\r\n errorServices: { blkVal: true, v: undefValue}\r\n});\r\n\r\n@Component({\r\n selector: \"lib-applicationinsights-angularplugin-js\",\r\n template: \"\",\r\n styles: [],\r\n standalone: false\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 constructor(private _injector?: Injector) { // _injector is optional to provide\r\n super();\r\n let _analyticsPlugin: AnalyticsPlugin;\r\n let _propertiesPlugin: PropertiesPlugin;\r\n let _angularCfg: IAngularExtensionConfig;\r\n let _eventSubscription: Subscription;\r\n let _isPageInitialLoad: boolean;\r\n let _prevRouter: Router;\r\n let _errorServiceInstance: ApplicationinsightsAngularpluginErrorService;\r\n\r\n dynamicProto(AngularPlugin, this, (_self, _base) => {\r\n\r\n const _initDefaults = () => {\r\n _analyticsPlugin = null;\r\n _propertiesPlugin = null;\r\n _angularCfg = null;\r\n _eventSubscription = null;\r\n _isPageInitialLoad = true;\r\n _prevRouter = undefValue;\r\n _errorServiceInstance = null;\r\n };\r\n\r\n _initDefaults();\r\n\r\n _self.initialize = (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[],\r\n pluginChain?: ITelemetryPluginChain) => {\r\n super.initialize(config, core, extensions, pluginChain);\r\n \r\n _self._addHook(onConfigChange(config, (details) => {\r\n let ctx = _self._getTelCtx();\r\n _angularCfg = ctx.getExtCfg<IAngularExtensionConfig>(_self.identifier, defaultAngularExtensionConfig);\r\n _propertiesPlugin = core.getPlugin<PropertiesPlugin>(PropertiesPluginIdentifier)?.plugin as PropertiesPlugin;\r\n _analyticsPlugin = core.getPlugin<AnalyticsPlugin>(AnalyticsPluginIdentifier)?.plugin as AnalyticsPlugin;\r\n \r\n if (_angularCfg.useInjector && _injector){\r\n _errorServiceInstance = this._injector.get(ApplicationinsightsAngularpluginErrorService);\r\n }\r\n _errorServiceInstance = _errorServiceInstance ? _errorServiceInstance\r\n : ApplicationinsightsAngularpluginErrorService.instance;\r\n\r\n // two instance of errorService\r\n\r\n if (_analyticsPlugin) {\r\n if (_errorServiceInstance !== null) {\r\n _errorServiceInstance.plugin = _analyticsPlugin;\r\n if (_angularCfg.errorServices && isArray(_angularCfg.errorServices)) {\r\n _errorServiceInstance.clearErrorHandlers();\r\n arrForEach(_angularCfg.errorServices, (errorService: IErrorService) => {\r\n _errorServiceInstance.addErrorHandler(errorService);\r\n });\r\n }\r\n }\r\n }\r\n \r\n if (_angularCfg.router !== _prevRouter) {\r\n // router is changed, or has not been initialized yet\r\n\r\n // unsubscribe previous router events\r\n if (_eventSubscription) {\r\n _eventSubscription.unsubscribe();\r\n }\r\n\r\n if (_angularCfg.router){\r\n // only track page view if it is the initial page load for this plugin\r\n if (_isPageInitialLoad){\r\n const pageViewTelemetry: IPageViewTelemetry = {\r\n uri: _angularCfg.router.url\r\n };\r\n _self.trackPageView(pageViewTelemetry);\r\n }\r\n \r\n // subscribe to new router events\r\n _eventSubscription = _angularCfg.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: _angularCfg.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 _prevRouter = _angularCfg.router;\r\n }\r\n }));\r\n\r\n // for test purpose only\r\n _self[\"_getDbgPlgTargets\"] = () => _angularCfg;\r\n _self[\"_getErrorService\"] = () => _errorServiceInstance;\r\n };\r\n\r\n _self.trackPageView = (pageView: IPageViewTelemetry) => {\r\n if (_analyticsPlugin) {\r\n const location = getLocation();\r\n if (_propertiesPlugin && _propertiesPlugin.context && _propertiesPlugin.context.telemetryTrace) {\r\n _propertiesPlugin.context.telemetryTrace.traceID = generateW3CId();\r\n _propertiesPlugin.context.telemetryTrace.name = location && location.pathname || \"_unknown_\";\r\n }\r\n _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 _self._doTeardown = (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState,\r\n asyncCallback?: () => void): void | boolean => {\r\n if (_analyticsPlugin && _errorServiceInstance !== null) {\r\n _errorServiceInstance.plugin = null;\r\n if (_angularCfg) {\r\n if (_angularCfg.errorServices && Array.isArray(_angularCfg.errorServices)) {\r\n _errorServiceInstance.clearErrorHandlers();\r\n \r\n }\r\n }\r\n }\r\n \r\n if (_eventSubscription) {\r\n _eventSubscription.unsubscribe();\r\n _eventSubscription = null;\r\n }\r\n _initDefaults();\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\r\n initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n }\r\n\r\n trackPageView(pageView: IPageViewTelemetry) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\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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,CAAC;AAC7B,oBAAA,OAAO,EAAE,EACR;oBACD,OAAO,EAAE,CAAC,aAAa,CAAC;AACxB,oBAAA,SAAS,EAAE;wBACP;AACH;AACJ,iBAAA;;;ACZD;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-angularplugin-js",
3
- "version": "15.4.2-nightly.2608-05",
3
+ "version": "15.4.2-nightly.2608-07",
4
4
  "description": "Microsoft Application Insights Angular plugin",
5
5
  "author": "Microsoft Application Insights Team",
6
6
  "license": "MIT",
@@ -20,30 +20,23 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@microsoft/applicationinsights-analytics-js": "nightly3",
23
- "@angular/common": ">= 14.0.3",
24
- "@angular/core": ">= 14.0.3"
23
+ "@angular/common": ">= 15.0.0",
24
+ "@angular/core": ">= 15.0.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "tag": "nightly"
28
28
  },
29
- "module": "fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
30
- "es2020": "fesm2020/microsoft-applicationinsights-angularplugin-js.mjs",
31
- "esm2020": "esm2020/microsoft-applicationinsights-angularplugin-js.mjs",
32
- "fesm2020": "fesm2020/microsoft-applicationinsights-angularplugin-js.mjs",
33
- "fesm2015": "fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
34
- "typings": "index.d.ts",
29
+ "module": "fesm2022/microsoft-applicationinsights-angularplugin-js.mjs",
30
+ "typings": "types/microsoft-applicationinsights-angularplugin-js.d.ts",
35
31
  "exports": {
36
32
  "./package.json": {
37
33
  "default": "./package.json"
38
34
  },
39
35
  ".": {
40
- "types": "./index.d.ts",
41
- "esm2020": "./esm2020/microsoft-applicationinsights-angularplugin-js.mjs",
42
- "es2020": "./fesm2020/microsoft-applicationinsights-angularplugin-js.mjs",
43
- "es2015": "./fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
44
- "node": "./fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
45
- "default": "./fesm2020/microsoft-applicationinsights-angularplugin-js.mjs"
36
+ "types": "./types/microsoft-applicationinsights-angularplugin-js.d.ts",
37
+ "default": "./fesm2022/microsoft-applicationinsights-angularplugin-js.mjs"
46
38
  }
47
39
  },
48
- "sideEffects": false
40
+ "sideEffects": false,
41
+ "type": "module"
49
42
  }
@@ -0,0 +1,47 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injector, ErrorHandler } from '@angular/core';
3
+ import { BaseTelemetryPlugin, ITelemetryItem, IProcessTelemetryContext, IConfiguration, IAppInsightsCore, IPlugin, ITelemetryPluginChain, IPageViewTelemetry, IAppInsights } from '@microsoft/applicationinsights-core-js';
4
+
5
+ declare class AngularPlugin extends BaseTelemetryPlugin {
6
+ private _injector?;
7
+ priority: number;
8
+ identifier: string;
9
+ constructor(_injector?: Injector);
10
+ /**
11
+ * Add Part A fields to the event
12
+ *
13
+ * @param event The event that needs to be processed
14
+ */
15
+ processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
16
+ initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
17
+ trackPageView(pageView: IPageViewTelemetry): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<AngularPlugin, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<AngularPlugin, "lib-applicationinsights-angularplugin-js", never, {}, {}, never, never, false, never>;
20
+ }
21
+
22
+ declare class ApplicationinsightsAngularpluginJsModule {
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationinsightsAngularpluginJsModule, never>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationinsightsAngularpluginJsModule, [typeof AngularPlugin], never, [typeof AngularPlugin]>;
25
+ static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationinsightsAngularpluginJsModule>;
26
+ }
27
+
28
+ interface IErrorService extends ErrorHandler {
29
+ handleError(error: any): void;
30
+ }
31
+
32
+ declare class ApplicationinsightsAngularpluginErrorService implements IErrorService {
33
+ static instance: ApplicationinsightsAngularpluginErrorService;
34
+ private analyticsPlugin;
35
+ private errorServices;
36
+ constructor();
37
+ set plugin(analyticsPlugin: IAppInsights);
38
+ clearErrorHandlers(): void;
39
+ addErrorHandler(errorService: IErrorService): void;
40
+ removeErrorHandler(errorService: IErrorService): void;
41
+ handleError(error: any): void;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationinsightsAngularpluginErrorService, never>;
43
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationinsightsAngularpluginErrorService>;
44
+ }
45
+
46
+ export { AngularPlugin, ApplicationinsightsAngularpluginErrorService, ApplicationinsightsAngularpluginJsModule };
47
+ export type { IErrorService };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSUVycm9yU2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2FwcGxpY2F0aW9uaW5zaWdodHMtYW5ndWxhcnBsdWdpbi1qcy9zcmMvbGliL0lFcnJvclNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEVycm9ySGFuZGxlciB9IGZyb20gXCJAYW5ndWxhci9jb3JlXCI7XHJcblxyXG5leHBvcnQgaW50ZXJmYWNlIElFcnJvclNlcnZpY2UgZXh0ZW5kcyBFcnJvckhhbmRsZXIge1xyXG4gICAgaGFuZGxlRXJyb3IoZXJyb3I6IGFueSk6IHZvaWQ7XHJcbn1cclxuIl19