@microsoft/applicationinsights-angularplugin-js 15.1.1 → 15.1.2
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/IErrorService.mjs +2 -0
- package/esm2020/lib/applicationinsights-angularplugin-error.service.mjs +52 -0
- package/esm2020/lib/applicationinsights-angularplugin-js.component.mjs +152 -0
- package/esm2020/lib/applicationinsights-angularplugin-js.module.mjs +23 -0
- package/esm2020/microsoft-applicationinsights-angularplugin-js.mjs +5 -0
- package/esm2020/public-api.mjs +8 -0
- package/fesm2015/microsoft-applicationinsights-angularplugin-js.mjs +231 -0
- package/fesm2015/microsoft-applicationinsights-angularplugin-js.mjs.map +1 -0
- package/fesm2020/microsoft-applicationinsights-angularplugin-js.mjs +230 -0
- package/fesm2020/microsoft-applicationinsights-angularplugin-js.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/{src/lib/IErrorService.ts → lib/IErrorService.d.ts} +0 -1
- package/lib/applicationinsights-angularplugin-error.service.d.ts +16 -0
- package/lib/applicationinsights-angularplugin-js.component.d.ts +20 -0
- package/lib/applicationinsights-angularplugin-js.module.d.ts +7 -0
- package/package.json +47 -30
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/.eslintrc.json +0 -74
- package/NOTICE +0 -17
- package/PRIVACY +0 -3
- package/SECURITY.md +0 -41
- package/SUPPORT.md +0 -14
- package/karma.conf.js +0 -43
- package/ng-package.json +0 -15
- package/src/lib/applicationininsights-angularplugin-multiple-instace.spec.ts +0 -245
- package/src/lib/applicationinsights-angularplugin-error.service.spec.ts +0 -113
- package/src/lib/applicationinsights-angularplugin-error.service.ts +0 -57
- package/src/lib/applicationinsights-angularplugin-js.component.spec.ts +0 -158
- package/src/lib/applicationinsights-angularplugin-js.component.ts +0 -203
- package/src/lib/applicationinsights-angularplugin-js.module.ts +0 -14
- package/src/test.ts +0 -13
- package/tsconfig.lib.json +0 -30
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { PropertiesPluginIdentifier, AnalyticsPluginIdentifier } from '@microsoft/applicationinsights-common';
|
|
4
|
+
import { isFunction, arrForEach, BaseTelemetryPlugin, onConfigChange, isArray, getLocation, generateW3CId, _throwInternal } from '@microsoft/applicationinsights-core-js';
|
|
5
|
+
import dynamicProto from '@microsoft/dynamicproto-js';
|
|
6
|
+
import { NavigationEnd } from '@angular/router';
|
|
7
|
+
import { objDeepFreeze } from '@nevware21/ts-utils';
|
|
8
|
+
|
|
9
|
+
class ApplicationinsightsAngularpluginErrorService {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.errorServices = [];
|
|
12
|
+
if (ApplicationinsightsAngularpluginErrorService.instance === null) {
|
|
13
|
+
ApplicationinsightsAngularpluginErrorService.instance = this;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
set plugin(analyticsPlugin) {
|
|
17
|
+
this.analyticsPlugin = analyticsPlugin;
|
|
18
|
+
}
|
|
19
|
+
clearErrorHandlers() {
|
|
20
|
+
this.errorServices = [];
|
|
21
|
+
}
|
|
22
|
+
addErrorHandler(errorService) {
|
|
23
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
24
|
+
this.errorServices.push(errorService);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
removeErrorHandler(errorService) {
|
|
28
|
+
if (errorService && isFunction(errorService.handleError)) {
|
|
29
|
+
const idx = this.errorServices.indexOf(errorService);
|
|
30
|
+
if (idx !== -1) {
|
|
31
|
+
this.errorServices.splice(idx, 1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
handleError(error) {
|
|
36
|
+
if (this.analyticsPlugin) {
|
|
37
|
+
this.analyticsPlugin.trackException({ exception: error });
|
|
38
|
+
}
|
|
39
|
+
if (this.errorServices && this.errorServices.length > 0) {
|
|
40
|
+
arrForEach(this.errorServices, errorService => {
|
|
41
|
+
if (isFunction(errorService.handleError)) {
|
|
42
|
+
errorService.handleError(error);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
ApplicationinsightsAngularpluginErrorService.instance = null;
|
|
49
|
+
ApplicationinsightsAngularpluginErrorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
50
|
+
ApplicationinsightsAngularpluginErrorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, providedIn: "root" });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApplicationinsightsAngularpluginErrorService, decorators: [{
|
|
52
|
+
type: Injectable,
|
|
53
|
+
args: [{
|
|
54
|
+
providedIn: "root"
|
|
55
|
+
}]
|
|
56
|
+
}], ctorParameters: function () { return []; } });
|
|
57
|
+
|
|
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
|
+
constructor(_injector) {
|
|
66
|
+
super();
|
|
67
|
+
this._injector = _injector;
|
|
68
|
+
this.priority = 186;
|
|
69
|
+
this.identifier = "AngularPlugin";
|
|
70
|
+
let _analyticsPlugin;
|
|
71
|
+
let _propertiesPlugin;
|
|
72
|
+
let _angularCfg;
|
|
73
|
+
let _eventSubscription;
|
|
74
|
+
let _isPageInitialLoad;
|
|
75
|
+
let _prevRouter;
|
|
76
|
+
let _errorServiceInstance;
|
|
77
|
+
dynamicProto(AngularPlugin, this, (_self, _base) => {
|
|
78
|
+
const _initDefaults = () => {
|
|
79
|
+
_analyticsPlugin = null;
|
|
80
|
+
_propertiesPlugin = null;
|
|
81
|
+
_angularCfg = null;
|
|
82
|
+
_eventSubscription = null;
|
|
83
|
+
_isPageInitialLoad = true;
|
|
84
|
+
_prevRouter = undefValue;
|
|
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 }]; } });
|
|
201
|
+
|
|
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
|
+
}]
|
|
219
|
+
}] });
|
|
220
|
+
|
|
221
|
+
/*
|
|
222
|
+
* Public API Surface of applicationinsights-angularplugin-js
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Generated bundle index. Do not edit.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
export { AngularPlugin, ApplicationinsightsAngularpluginErrorService, ApplicationinsightsAngularpluginJsModule };
|
|
230
|
+
//# sourceMappingURL=microsoft-applicationinsights-angularplugin-js.mjs.map
|
|
@@ -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 } 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 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 IConfig, IPageViewTelemetry, PropertiesPluginIdentifier, AnalyticsPluginIdentifier\r\n} from \"@microsoft/applicationinsights-common\";\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} 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})\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 };\r\n\r\n _initDefaults();\r\n\r\n _self.initialize = (config: IConfiguration & IConfig, 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 & IConfig, 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 \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,CAAA;AAKrD,IAAA,WAAA,GAAA;QAFQ,IAAa,CAAA,aAAA,GAAoB,EAAE,CAAC;AAGxC,QAAA,IAAI,4CAA4C,CAAC,QAAQ,KAAK,IAAI,EAAE;AAChE,YAAA,4CAA4C,CAAC,QAAQ,GAAG,IAAI,CAAC;AAChE,SAAA;KACJ;IAED,IAAW,MAAM,CAAC,eAA6B,EAAA;AAC3C,QAAA,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KAC1C;IAEM,kBAAkB,GAAA;AACrB,QAAA,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;KAC3B;AAEM,IAAA,eAAe,CAAC,YAA2B,EAAA;QAC9C,IAAI,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;AACtD,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACzC,SAAA;KACJ;AAEM,IAAA,kBAAkB,CAAC,YAA2B,EAAA;QACjD,IAAI,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YACtD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACrD,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applicationinsights-common";
|
|
2
|
+
import { IErrorService } from "./IErrorService";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ApplicationinsightsAngularpluginErrorService implements IErrorService {
|
|
5
|
+
static instance: ApplicationinsightsAngularpluginErrorService;
|
|
6
|
+
private analyticsPlugin;
|
|
7
|
+
private errorServices;
|
|
8
|
+
constructor();
|
|
9
|
+
set plugin(analyticsPlugin: IAppInsights);
|
|
10
|
+
clearErrorHandlers(): void;
|
|
11
|
+
addErrorHandler(errorService: IErrorService): void;
|
|
12
|
+
removeErrorHandler(errorService: IErrorService): void;
|
|
13
|
+
handleError(error: any): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationinsightsAngularpluginErrorService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationinsightsAngularpluginErrorService>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Injector } from "@angular/core";
|
|
2
|
+
import { IConfig, IPageViewTelemetry } from "@microsoft/applicationinsights-common";
|
|
3
|
+
import { IPlugin, IConfiguration, IAppInsightsCore, BaseTelemetryPlugin, ITelemetryItem, ITelemetryPluginChain, IProcessTelemetryContext } from "@microsoft/applicationinsights-core-js";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export 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 & IConfig, 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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./applicationinsights-angularplugin-js.component";
|
|
3
|
+
export declare class ApplicationinsightsAngularpluginJsModule {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationinsightsAngularpluginJsModule, never>;
|
|
5
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationinsightsAngularpluginJsModule, [typeof i1.AngularPlugin], never, [typeof i1.AngularPlugin]>;
|
|
6
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationinsightsAngularpluginJsModule>;
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,30 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@microsoft/applicationinsights-angularplugin-js",
|
|
3
|
-
"version": "15.1.
|
|
4
|
-
"description": "Microsoft Application Insights Angular plugin",
|
|
5
|
-
"author": "Microsoft Application Insights Team",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/microsoft/applicationinsights-angularplugin-js"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/microsoft/applicationinsights-angularplugin-js/issues"
|
|
13
|
-
},
|
|
14
|
-
"homepage": "https://github.com/microsoft/applicationinsights-angularplugin-js#readme",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@microsoft/applicationinsights-shims": "^3.0.1",
|
|
17
|
-
"@microsoft/applicationinsights-common": "^3.1.
|
|
18
|
-
"@microsoft/applicationinsights-core-js": "^3.1.
|
|
19
|
-
"@microsoft/applicationinsights-properties-js": "^3.1.
|
|
20
|
-
"tslib": "^2.0.0"
|
|
21
|
-
},
|
|
22
|
-
"
|
|
23
|
-
"@microsoft/applicationinsights-analytics-js": "^3.1.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/applicationinsights-angularplugin-js",
|
|
3
|
+
"version": "15.1.2",
|
|
4
|
+
"description": "Microsoft Application Insights Angular plugin",
|
|
5
|
+
"author": "Microsoft Application Insights Team",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/microsoft/applicationinsights-angularplugin-js"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/microsoft/applicationinsights-angularplugin-js/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/microsoft/applicationinsights-angularplugin-js#readme",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@microsoft/applicationinsights-shims": "^3.0.1",
|
|
17
|
+
"@microsoft/applicationinsights-common": "^3.1.2",
|
|
18
|
+
"@microsoft/applicationinsights-core-js": "^3.1.2",
|
|
19
|
+
"@microsoft/applicationinsights-properties-js": "^3.1.2",
|
|
20
|
+
"tslib": "^2.0.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@microsoft/applicationinsights-analytics-js": "^3.1.2",
|
|
24
|
+
"@angular/common": ">= 14.0.3",
|
|
25
|
+
"@angular/core": ">= 14.0.3"
|
|
26
|
+
},
|
|
27
|
+
"module": "fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
28
|
+
"es2020": "fesm2020/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
29
|
+
"esm2020": "esm2020/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
30
|
+
"fesm2020": "fesm2020/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
31
|
+
"fesm2015": "fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
32
|
+
"typings": "index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
"./package.json": {
|
|
35
|
+
"default": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./index.d.ts",
|
|
39
|
+
"esm2020": "./esm2020/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
40
|
+
"es2020": "./fesm2020/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
41
|
+
"es2015": "./fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
42
|
+
"node": "./fesm2015/microsoft-applicationinsights-angularplugin-js.mjs",
|
|
43
|
+
"default": "./fesm2020/microsoft-applicationinsights-angularplugin-js.mjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"sideEffects": false
|
|
47
|
+
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of applicationinsights-angularplugin-js
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
export * from "./lib/applicationinsights-angularplugin-js.component";
|
|
6
2
|
export * from "./lib/applicationinsights-angularplugin-js.module";
|
|
7
3
|
export * from "./lib/applicationinsights-angularplugin-error.service";
|
package/.eslintrc.json
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../.eslintrc.json",
|
|
3
|
-
"ignorePatterns": [
|
|
4
|
-
"!**/*"
|
|
5
|
-
],
|
|
6
|
-
"overrides": [
|
|
7
|
-
{
|
|
8
|
-
"files": [
|
|
9
|
-
"*.ts"
|
|
10
|
-
],
|
|
11
|
-
"parserOptions": {
|
|
12
|
-
"project": [
|
|
13
|
-
"projects/applicationinsights-angularplugin-js/tsconfig.lib.json",
|
|
14
|
-
"projects/applicationinsights-angularplugin-js/tsconfig.spec.json"
|
|
15
|
-
],
|
|
16
|
-
"createDefaultProgram": true
|
|
17
|
-
},
|
|
18
|
-
"rules": {
|
|
19
|
-
"indent": ["error"], // Enabling for auto fixing
|
|
20
|
-
"quotes": ["warn", "double"], // Enabled for auto fixing
|
|
21
|
-
"curly": [ "error" ], // Enabling for auto fixing
|
|
22
|
-
"brace-style": [ "error" ], // Enabling for auto fixing
|
|
23
|
-
"prefer-const": "off",
|
|
24
|
-
"prefer-spread": "off",
|
|
25
|
-
"no-var": "off",
|
|
26
|
-
"no-extra-boolean-cast": "off",
|
|
27
|
-
"prefer-rest-params": "off",
|
|
28
|
-
"no-case-declarations": "off",
|
|
29
|
-
"no-prototype-builtins": "off",
|
|
30
|
-
"no-useless-escape": "off", // Suppressing Error -- need to Review Later
|
|
31
|
-
"no-trailing-spaces": [ "warn", { "skipBlankLines": true }],// Enabled for auto fixing
|
|
32
|
-
"no-const-assign": "error",
|
|
33
|
-
"comma-dangle": [ "error", "never" ], // Enabled for auto fixing
|
|
34
|
-
"security/detect-object-injection": "off", // Suppress Warning -- need to Review Later
|
|
35
|
-
"security/detect-non-literal-fs-filename": "off", // This was causing a bunch of false positive matches for dynamic config "watch" function
|
|
36
|
-
"@typescript-eslint/ban-types": "off",
|
|
37
|
-
"@typescript-eslint/no-unused-vars": [ "warn", { "vars": "all", "args": "none", "argsIgnorePattern": "^_", "ignoreRestSiblings": true } ],
|
|
38
|
-
"@typescript-eslint/triple-slash-reference": "off",
|
|
39
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
40
|
-
"@typescript-eslint/no-this-alias": "off",
|
|
41
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
42
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
43
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
44
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
45
|
-
"@typescript-eslint/no-extra-semi": "error", // Enabled for auto fixing
|
|
46
|
-
"@typescript-eslint/no-non-null-assertion": "error",
|
|
47
|
-
"@typescript-eslint/dot-notation": "off",
|
|
48
|
-
"@typescript-eslint/quotes": ["warn", "double"],
|
|
49
|
-
"@angular-eslint/component-selector": [
|
|
50
|
-
"error",
|
|
51
|
-
{
|
|
52
|
-
"type": "element",
|
|
53
|
-
"prefix": "lib",
|
|
54
|
-
"style": "kebab-case"
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"@angular-eslint/directive-selector": [
|
|
58
|
-
"error",
|
|
59
|
-
{
|
|
60
|
-
"type": "attribute",
|
|
61
|
-
"prefix": "lib",
|
|
62
|
-
"style": "camelCase"
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"files": [
|
|
69
|
-
"*.html"
|
|
70
|
-
],
|
|
71
|
-
"rules": {}
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
}
|
package/NOTICE
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
NOTICES AND INFORMATION
|
|
2
|
-
Do Not Translate or Localize
|
|
3
|
-
|
|
4
|
-
This software incorporates material from third parties. Microsoft makes certain
|
|
5
|
-
open source code available at https://3rdpartysource.microsoft.com, or you may
|
|
6
|
-
send a check or money order for US $5.00, including the product name, the open
|
|
7
|
-
source component name, and version number, to:
|
|
8
|
-
|
|
9
|
-
Source Code Compliance Team
|
|
10
|
-
Microsoft Corporation
|
|
11
|
-
One Microsoft Way
|
|
12
|
-
Redmond, WA 98052
|
|
13
|
-
USA
|
|
14
|
-
|
|
15
|
-
Notwithstanding any other terms, you may reverse engineer this software to the
|
|
16
|
-
extent required to debug changes to any libraries licensed under the GNU Lesser
|
|
17
|
-
General Public License.
|
package/PRIVACY
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Data Collection
|
|
2
|
-
|
|
3
|
-
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
|
package/SECURITY.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
|
|
2
|
-
|
|
3
|
-
## Security
|
|
4
|
-
|
|
5
|
-
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
|
6
|
-
|
|
7
|
-
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
|
|
8
|
-
|
|
9
|
-
## Reporting Security Issues
|
|
10
|
-
|
|
11
|
-
**Please do not report security vulnerabilities through public GitHub issues.**
|
|
12
|
-
|
|
13
|
-
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
|
|
14
|
-
|
|
15
|
-
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
|
|
16
|
-
|
|
17
|
-
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
|
18
|
-
|
|
19
|
-
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
|
20
|
-
|
|
21
|
-
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
|
22
|
-
* Full paths of source file(s) related to the manifestation of the issue
|
|
23
|
-
* The location of the affected source code (tag/branch/commit or direct URL)
|
|
24
|
-
* Any special configuration required to reproduce the issue
|
|
25
|
-
* Step-by-step instructions to reproduce the issue
|
|
26
|
-
* Proof-of-concept or exploit code (if possible)
|
|
27
|
-
* Impact of the issue, including how an attacker might exploit the issue
|
|
28
|
-
|
|
29
|
-
This information will help us triage your report more quickly.
|
|
30
|
-
|
|
31
|
-
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
|
|
32
|
-
|
|
33
|
-
## Preferred Languages
|
|
34
|
-
|
|
35
|
-
We prefer all communications to be in English.
|
|
36
|
-
|
|
37
|
-
## Policy
|
|
38
|
-
|
|
39
|
-
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
|
|
40
|
-
|
|
41
|
-
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
package/SUPPORT.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Support
|
|
2
|
-
|
|
3
|
-
## How to file issues and get help
|
|
4
|
-
|
|
5
|
-
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
|
|
6
|
-
issues before filing new issues to avoid duplicates. For new issues, file your bug or
|
|
7
|
-
feature request as a new Issue.
|
|
8
|
-
|
|
9
|
-
For help and questions about using this project, please create a Support request issue on
|
|
10
|
-
https://github.com/microsoft/applicationinsights-angularplugin-js/issues.
|
|
11
|
-
|
|
12
|
-
## Microsoft Support Policy
|
|
13
|
-
|
|
14
|
-
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
|
package/karma.conf.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-coverage'),
|
|
12
|
-
require('@angular-devkit/build-angular/plugins/karma')
|
|
13
|
-
],
|
|
14
|
-
client: {
|
|
15
|
-
jasmine: {
|
|
16
|
-
// you can add configuration options for Jasmine here
|
|
17
|
-
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
18
|
-
// for example, you can disable the random execution with `random: false`
|
|
19
|
-
// or set a specific seed with `seed: 4321`
|
|
20
|
-
},
|
|
21
|
-
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
22
|
-
},
|
|
23
|
-
jasmineHtmlReporter: {
|
|
24
|
-
suppressAll: true // removes the duplicated traces
|
|
25
|
-
},
|
|
26
|
-
coverageReporter: {
|
|
27
|
-
dir: require('path').join(__dirname, '../../coverage'),
|
|
28
|
-
subdir: '.',
|
|
29
|
-
reporters: [
|
|
30
|
-
{ type: 'text' },
|
|
31
|
-
{ type: 'html-spa' }
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
reporters: ['progress'],
|
|
35
|
-
port: 9876,
|
|
36
|
-
colors: true,
|
|
37
|
-
logLevel: config.LOG_INFO,
|
|
38
|
-
autoWatch: true,
|
|
39
|
-
browsers: ['Chrome'],
|
|
40
|
-
singleRun: false,
|
|
41
|
-
restartOnFileChange: true
|
|
42
|
-
});
|
|
43
|
-
};
|
package/ng-package.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"dest": "../../dist/applicationinsights-angularplugin-js",
|
|
4
|
-
"deleteDestPath": false,
|
|
5
|
-
"lib": {
|
|
6
|
-
"entryFile": "src/public-api.ts"
|
|
7
|
-
},
|
|
8
|
-
"allowedNonPeerDependencies": [
|
|
9
|
-
"@microsoft/applicationinsights-common",
|
|
10
|
-
"@microsoft/applicationinsights-core-js",
|
|
11
|
-
"@microsoft/applicationinsights-properties-js",
|
|
12
|
-
"@microsoft/applicationinsights-rollup-es3",
|
|
13
|
-
"@microsoft/applicationinsights-shims"
|
|
14
|
-
]
|
|
15
|
-
}
|