@microsoft/applicationinsights-properties-js 3.0.0-beta.2303-10 → 3.0.0-beta.2304-07
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.js +3990 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.js.map +1 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.min.js +6 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.min.js.map +1 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.js +3994 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.js.map +1 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.min.js +6 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.min.js.map +1 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.integrity.json +66 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.js +3996 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.js.map +1 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.min.js +6 -0
- package/browser/es5/ai.props.3.0.0-beta.2304-07.min.js.map +1 -0
- package/browser/es5/ai.props.3.cjs.js +3990 -0
- package/browser/es5/ai.props.3.cjs.js.map +1 -0
- package/browser/es5/ai.props.3.cjs.min.js +6 -0
- package/browser/es5/ai.props.3.cjs.min.js.map +1 -0
- package/browser/es5/ai.props.3.gbl.js +3994 -0
- package/browser/es5/ai.props.3.gbl.js.map +1 -0
- package/browser/es5/ai.props.3.gbl.min.js +6 -0
- package/browser/es5/ai.props.3.gbl.min.js.map +1 -0
- package/{dist/applicationinsights-properties-js.js → browser/es5/ai.props.3.js} +886 -851
- package/browser/es5/ai.props.3.js.map +1 -0
- package/browser/es5/ai.props.3.min.js +6 -0
- package/browser/es5/ai.props.3.min.js.map +1 -0
- package/{browser → dist/es5}/applicationinsights-properties-js.js +885 -850
- package/dist/es5/applicationinsights-properties-js.js.map +1 -0
- package/dist/es5/applicationinsights-properties-js.min.js +6 -0
- package/dist/es5/applicationinsights-properties-js.min.js.map +1 -0
- package/{dist-esm → dist-es5}/Context/Application.js +1 -1
- package/{dist-esm → dist-es5}/Context/Device.js +1 -1
- package/{dist-esm → dist-es5}/Context/Internal.js +1 -1
- package/{dist-esm → dist-es5}/Context/Location.js +1 -1
- package/{dist-esm → dist-es5}/Context/Session.js +1 -1
- package/{dist-esm → dist-es5}/Context/TelemetryTrace.js +1 -1
- package/{dist-esm → dist-es5}/Context/User.js +1 -1
- package/{dist-esm → dist-es5}/Interfaces/IPropTelemetryContext.js +1 -1
- package/{dist-esm → dist-es5}/Interfaces/IPropertiesConfig.js +1 -1
- package/{dist-esm → dist-es5}/PropertiesPlugin.js +1 -1
- package/{dist-esm → dist-es5}/TelemetryContext.js +1 -1
- package/{dist-esm → dist-es5}/__DynamicConstants.js +1 -1
- package/{dist-esm → dist-es5}/applicationinsights-properties-js.js +1 -1
- package/package.json +17 -16
- package/tsconfig.json +4 -3
- package/types/applicationinsights-properties-js.d.ts +161 -6
- package/{dist/applicationinsights-properties-js.d.ts → types/applicationinsights-properties-js.namespaced.d.ts} +1 -1
- package/browser/applicationinsights-properties-js.integrity.json +0 -26
- package/browser/applicationinsights-properties-js.js.map +0 -1
- package/browser/applicationinsights-properties-js.min.js +0 -6
- package/browser/applicationinsights-properties-js.min.js.map +0 -1
- package/dist/applicationinsights-properties-js.api.json +0 -3120
- package/dist/applicationinsights-properties-js.api.md +0 -173
- package/dist/applicationinsights-properties-js.js.map +0 -1
- package/dist/applicationinsights-properties-js.min.js +0 -6
- package/dist/applicationinsights-properties-js.min.js.map +0 -1
- package/dist/applicationinsights-properties-js.rollup.d.ts +0 -162
- package/src/Context/Application.ts +0 -16
- package/src/Context/Device.ts +0 -49
- package/src/Context/Internal.ts +0 -49
- package/src/Context/Location.ts +0 -12
- package/src/Context/Session.ts +0 -257
- package/src/Context/TelemetryTrace.ts +0 -26
- package/src/Context/User.ts +0 -233
- package/src/Interfaces/IPropTelemetryContext.ts +0 -21
- package/src/Interfaces/IPropertiesConfig.ts +0 -19
- package/src/PropertiesPlugin.ts +0 -183
- package/src/TelemetryContext.ts +0 -233
- package/src/__DynamicConstants.ts +0 -41
- package/src/applicationinsights-properties-js.ts +0 -10
- package/types/Context/Application.d.ts +0 -11
- package/types/Context/Device.d.ts +0 -31
- package/types/Context/Internal.d.ts +0 -30
- package/types/Context/Location.d.ts +0 -7
- package/types/Context/Session.d.ts +0 -42
- package/types/Context/TelemetryTrace.d.ts +0 -10
- package/types/Context/User.d.ts +0 -59
- package/types/Interfaces/IPropTelemetryContext.d.ts +0 -16
- package/types/Interfaces/IPropertiesConfig.d.ts +0 -16
- package/types/PropertiesPlugin.d.ts +0 -19
- package/types/TelemetryContext.d.ts +0 -34
- package/types/__DynamicConstants.d.ts +0 -29
- package/types/tsdoc-metadata.json +0 -11
- /package/{dist-esm → dist-es5}/Context/Application.js.map +0 -0
- /package/{dist-esm → dist-es5}/Context/Device.js.map +0 -0
- /package/{dist-esm → dist-es5}/Context/Internal.js.map +0 -0
- /package/{dist-esm → dist-es5}/Context/Location.js.map +0 -0
- /package/{dist-esm → dist-es5}/Context/Session.js.map +0 -0
- /package/{dist-esm → dist-es5}/Context/TelemetryTrace.js.map +0 -0
- /package/{dist-esm → dist-es5}/Context/User.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IPropTelemetryContext.js.map +0 -0
- /package/{dist-esm → dist-es5}/Interfaces/IPropertiesConfig.js.map +0 -0
- /package/{dist-esm → dist-es5}/PropertiesPlugin.js.map +0 -0
- /package/{dist-esm → dist-es5}/TelemetryContext.js.map +0 -0
- /package/{dist-esm → dist-es5}/__DynamicConstants.js.map +0 -0
- /package/{dist-esm → dist-es5}/applicationinsights-properties-js.js.map +0 -0
package/src/TelemetryContext.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TelemetryContext.ts
|
|
3
|
-
* @copyright Microsoft 2018
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
7
|
-
import {
|
|
8
|
-
CtxTagKeys, Extensions, IApplication, IDevice, IInternal, ILocation, IOperatingSystem, ISession, ITelemetryTrace, IUserContext, IWeb,
|
|
9
|
-
PageView
|
|
10
|
-
} from "@microsoft/applicationinsights-common";
|
|
11
|
-
import {
|
|
12
|
-
IAppInsightsCore, IDistributedTraceContext, IProcessTelemetryContext, ITelemetryItem, IUnloadHookContainer, _InternalLogMessage,
|
|
13
|
-
getSetValue, hasWindow, isNullOrUndefined, isString, objKeys, setValue
|
|
14
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
15
|
-
import { Application } from "./Context/Application";
|
|
16
|
-
import { Device } from "./Context/Device";
|
|
17
|
-
import { Internal } from "./Context/Internal";
|
|
18
|
-
import { Location } from "./Context/Location";
|
|
19
|
-
import { Session, _SessionManager } from "./Context/Session";
|
|
20
|
-
import { TelemetryTrace } from "./Context/TelemetryTrace";
|
|
21
|
-
import { User } from "./Context/User";
|
|
22
|
-
import { IPropTelemetryContext } from "./Interfaces/IPropTelemetryContext";
|
|
23
|
-
import { IPropertiesConfig } from "./Interfaces/IPropertiesConfig";
|
|
24
|
-
|
|
25
|
-
const strExt = "ext";
|
|
26
|
-
const strTags = "tags";
|
|
27
|
-
|
|
28
|
-
function _removeEmpty(target: any, name: string) {
|
|
29
|
-
if (target && target[name] && objKeys(target[name]).length === 0) {
|
|
30
|
-
delete target[name];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _nullResult(): string {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class TelemetryContext implements IPropTelemetryContext {
|
|
39
|
-
|
|
40
|
-
public application: IApplication; // The object describing a component tracked by this object - legacy
|
|
41
|
-
public device: IDevice; // The object describing a device tracked by this object.
|
|
42
|
-
public location: ILocation; // The object describing a location tracked by this object -legacy
|
|
43
|
-
public telemetryTrace: ITelemetryTrace; // The object describing a operation tracked by this object.
|
|
44
|
-
public user: IUserContext; // The object describing a user tracked by this object.
|
|
45
|
-
public internal: IInternal; // legacy
|
|
46
|
-
public session: ISession; // The object describing a session tracked by this object.
|
|
47
|
-
public sessionManager: _SessionManager; // The session manager that manages session on the base of cookies.
|
|
48
|
-
public os: IOperatingSystem;
|
|
49
|
-
public web: IWeb;
|
|
50
|
-
public appId: () => string;
|
|
51
|
-
public getSessionId: () => string;
|
|
52
|
-
|
|
53
|
-
constructor(core: IAppInsightsCore, defaultConfig: IPropertiesConfig, previousTraceCtx?: IDistributedTraceContext, unloadHookContainer?: IUnloadHookContainer) {
|
|
54
|
-
let logger = core.logger
|
|
55
|
-
|
|
56
|
-
dynamicProto(TelemetryContext, this, (_self) => {
|
|
57
|
-
_self.appId = _nullResult;
|
|
58
|
-
_self.getSessionId = _nullResult;
|
|
59
|
-
_self.application = new Application();
|
|
60
|
-
_self.internal = new Internal(defaultConfig, unloadHookContainer);
|
|
61
|
-
if (hasWindow()) {
|
|
62
|
-
_self.sessionManager = new _SessionManager(defaultConfig, core, unloadHookContainer);
|
|
63
|
-
_self.device = new Device();
|
|
64
|
-
_self.location = new Location();
|
|
65
|
-
_self.user = new User(defaultConfig, core, unloadHookContainer);
|
|
66
|
-
|
|
67
|
-
let traceId: string;
|
|
68
|
-
let parentId: string;
|
|
69
|
-
let name: string;
|
|
70
|
-
if (previousTraceCtx) {
|
|
71
|
-
traceId = previousTraceCtx.getTraceId();
|
|
72
|
-
parentId = previousTraceCtx.getSpanId();
|
|
73
|
-
name = previousTraceCtx.getName();
|
|
74
|
-
}
|
|
75
|
-
_self.telemetryTrace = new TelemetryTrace(traceId, parentId, name, logger);
|
|
76
|
-
_self.session = new Session();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_self.getSessionId = () => {
|
|
80
|
-
let session = _self.session;
|
|
81
|
-
let sesId = null;
|
|
82
|
-
|
|
83
|
-
// If customer set session info, apply their context; otherwise apply context automatically generated
|
|
84
|
-
if (session && isString(session.id)) {
|
|
85
|
-
sesId = session.id;
|
|
86
|
-
} else {
|
|
87
|
-
// Gets the automatic session if it exists or an empty object
|
|
88
|
-
let autoSession = (_self.sessionManager || {} as _SessionManager).automaticSession;
|
|
89
|
-
|
|
90
|
-
sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return sesId;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
_self.applySessionContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
97
|
-
setValue(getSetValue(evt.ext, Extensions.AppExt), "sesId", _self.getSessionId(), isString);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
_self.applyOperatingSystemContxt = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
101
|
-
setValue(evt.ext, Extensions.OSExt, _self.os);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
_self.applyApplicationContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
105
|
-
let application = _self.application;
|
|
106
|
-
if (application) {
|
|
107
|
-
// evt.ext.app
|
|
108
|
-
let tags = getSetValue(evt, strTags);
|
|
109
|
-
setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString);
|
|
110
|
-
setValue(tags, CtxTagKeys.applicationBuild, application.build, isString)
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
_self.applyDeviceContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
115
|
-
let device = _self.device;
|
|
116
|
-
if (device) {
|
|
117
|
-
// evt.ext.device
|
|
118
|
-
let extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt);
|
|
119
|
-
setValue(extDevice, "localId", device.id, isString);
|
|
120
|
-
setValue(extDevice, "ip", device.ip, isString);
|
|
121
|
-
setValue(extDevice, "model", device.model, isString);
|
|
122
|
-
setValue(extDevice, "deviceClass", device.deviceClass, isString);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
_self.applyInternalContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
127
|
-
let internal = _self.internal;
|
|
128
|
-
if (internal) {
|
|
129
|
-
let tags = getSetValue(evt, strTags);
|
|
130
|
-
|
|
131
|
-
setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); // not mapped in CS 4.0
|
|
132
|
-
setValue(tags, CtxTagKeys.internalSdkVersion, internal.sdkVersion, isString);
|
|
133
|
-
|
|
134
|
-
if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) {
|
|
135
|
-
setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString);
|
|
136
|
-
setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
_self.applyLocationContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
142
|
-
let location = this.location;
|
|
143
|
-
if (location) {
|
|
144
|
-
setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
_self.applyOperationContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
149
|
-
let telemetryTrace = _self.telemetryTrace;
|
|
150
|
-
if (telemetryTrace) {
|
|
151
|
-
const extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined } as ITelemetryTrace);
|
|
152
|
-
setValue(extTrace, "traceID", telemetryTrace.traceID, isString, isNullOrUndefined);
|
|
153
|
-
setValue(extTrace, "name", telemetryTrace.name, isString, isNullOrUndefined);
|
|
154
|
-
setValue(extTrace, "parentID", telemetryTrace.parentID, isString, isNullOrUndefined);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
_self.applyWebContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
159
|
-
let web = this.web;
|
|
160
|
-
if (web) {
|
|
161
|
-
setValue(getSetValue(evt, strExt), Extensions.WebExt, web);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
_self.applyUserContext = (evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
166
|
-
let user = _self.user;
|
|
167
|
-
if (user) {
|
|
168
|
-
let tags = getSetValue(evt, strTags, []);
|
|
169
|
-
|
|
170
|
-
// stays in tags
|
|
171
|
-
setValue(tags, CtxTagKeys.userAccountId, user.accountId, isString);
|
|
172
|
-
|
|
173
|
-
// CS 4.0
|
|
174
|
-
let extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt);
|
|
175
|
-
setValue(extUser, "id", user.id, isString);
|
|
176
|
-
setValue(extUser, "authId", user.authenticatedId, isString);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
_self.cleanUp = (evt:ITelemetryItem, itemCtx?: IProcessTelemetryContext) => {
|
|
181
|
-
let ext = evt.ext;
|
|
182
|
-
if (ext) {
|
|
183
|
-
_removeEmpty(ext, Extensions.DeviceExt);
|
|
184
|
-
_removeEmpty(ext, Extensions.UserExt);
|
|
185
|
-
_removeEmpty(ext, Extensions.WebExt);
|
|
186
|
-
_removeEmpty(ext, Extensions.OSExt);
|
|
187
|
-
_removeEmpty(ext, Extensions.AppExt);
|
|
188
|
-
_removeEmpty(ext, Extensions.TraceExt);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
public applySessionContext(evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
195
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
public applyOperatingSystemContxt(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
199
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
public applyApplicationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
203
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
public applyDeviceContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
207
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
public applyInternalContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
211
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
public applyLocationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
215
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
public applyOperationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
219
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
public applyWebContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
223
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
public applyUserContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext) {
|
|
227
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
public cleanUp(event:ITelemetryItem, itemCtx?: IProcessTelemetryContext): void {
|
|
231
|
-
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
232
|
-
}
|
|
233
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
// @skip-file-minify
|
|
4
|
-
|
|
5
|
-
// ##############################################################
|
|
6
|
-
// AUTO GENERATED FILE: This file is Auto Generated during build.
|
|
7
|
-
// ##############################################################
|
|
8
|
-
|
|
9
|
-
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
|
|
11
|
-
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
|
-
|
|
13
|
-
export const _DYN_SESSION_MANAGER = "sessionManager"; // Count: 3
|
|
14
|
-
export const _DYN_UPDATE = "update"; // Count: 4
|
|
15
|
-
export const _DYN_IS_USER_COOKIE_SET = "isUserCookieSet"; // Count: 4
|
|
16
|
-
export const _DYN_IS_NEW_USER = "isNewUser"; // Count: 4
|
|
17
|
-
export const _DYN_GET_TRACE_CTX = "getTraceCtx"; // Count: 3
|
|
18
|
-
export const _DYN_TELEMETRY_TRACE = "telemetryTrace"; // Count: 3
|
|
19
|
-
export const _DYN_APPLY_SESSION_CONTEX0 = "applySessionContext"; // Count: 2
|
|
20
|
-
export const _DYN_APPLY_APPLICATION_CO1 = "applyApplicationContext"; // Count: 2
|
|
21
|
-
export const _DYN_APPLY_DEVICE_CONTEXT = "applyDeviceContext"; // Count: 2
|
|
22
|
-
export const _DYN_APPLY_OPERATION_CONT2 = "applyOperationContext"; // Count: 2
|
|
23
|
-
export const _DYN_APPLY_USER_CONTEXT = "applyUserContext"; // Count: 2
|
|
24
|
-
export const _DYN_APPLY_OPERATING_SYST3 = "applyOperatingSystemContxt"; // Count: 2
|
|
25
|
-
export const _DYN_APPLY_LOCATION_CONTE4 = "applyLocationContext"; // Count: 2
|
|
26
|
-
export const _DYN_APPLY_INTERNAL_CONTE5 = "applyInternalContext"; // Count: 2
|
|
27
|
-
export const _DYN_ACCOUNT_ID = "accountId"; // Count: 7
|
|
28
|
-
export const _DYN_GET_SESSION_ID = "getSessionId"; // Count: 4
|
|
29
|
-
export const _DYN_NAME_PREFIX = "namePrefix"; // Count: 3
|
|
30
|
-
export const _DYN_SESSION_COOKIE_POSTF6 = "sessionCookiePostfix"; // Count: 2
|
|
31
|
-
export const _DYN_USER_COOKIE_POSTFIX = "userCookiePostfix"; // Count: 2
|
|
32
|
-
export const _DYN_ID_LENGTH = "idLength"; // Count: 4
|
|
33
|
-
export const _DYN_GET_NEW_ID = "getNewId"; // Count: 3
|
|
34
|
-
export const _DYN_LENGTH = "length"; // Count: 4
|
|
35
|
-
export const _DYN_AUTOMATIC_SESSION = "automaticSession"; // Count: 5
|
|
36
|
-
export const _DYN_AUTHENTICATED_ID = "authenticatedId"; // Count: 6
|
|
37
|
-
export const _DYN_ACQUISITION_DATE = "acquisitionDate"; // Count: 5
|
|
38
|
-
export const _DYN_RENEWAL_DATE = "renewalDate"; // Count: 4
|
|
39
|
-
export const _DYN_JOIN = "join"; // Count: 5
|
|
40
|
-
export const _DYN_COOKIE_SEPARATOR = "cookieSeparator"; // Count: 5
|
|
41
|
-
export const _DYN_AUTH_USER_COOKIE_NAM7 = "authUserCookieName"; // Count: 3
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import PropertiesPlugin from "./PropertiesPlugin";
|
|
5
|
-
import { TelemetryTrace } from "./Context/TelemetryTrace";
|
|
6
|
-
import { TelemetryContext } from "./TelemetryContext"
|
|
7
|
-
import { ISessionConfig, Session, _SessionManager } from "./Context/Session";
|
|
8
|
-
import { IPropTelemetryContext } from "./Interfaces/IPropTelemetryContext";
|
|
9
|
-
|
|
10
|
-
export { PropertiesPlugin, TelemetryTrace, TelemetryContext, Session, ISessionConfig, IPropTelemetryContext, _SessionManager as SessionManager };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IDevice } from "@microsoft/applicationinsights-common";
|
|
2
|
-
export declare class Device implements IDevice {
|
|
3
|
-
/**
|
|
4
|
-
* The type for the current device.
|
|
5
|
-
*/
|
|
6
|
-
deviceClass: string;
|
|
7
|
-
/**
|
|
8
|
-
* A device unique ID.
|
|
9
|
-
*/
|
|
10
|
-
id: string;
|
|
11
|
-
/**
|
|
12
|
-
* The application screen resolution.
|
|
13
|
-
*/
|
|
14
|
-
resolution: string;
|
|
15
|
-
/**
|
|
16
|
-
* The device model for the current device.
|
|
17
|
-
*/
|
|
18
|
-
model: string;
|
|
19
|
-
/**
|
|
20
|
-
* Device identifier known at instrumentation time
|
|
21
|
-
*/
|
|
22
|
-
localId: string;
|
|
23
|
-
/**
|
|
24
|
-
* Device identifier known at instrumentation time
|
|
25
|
-
*/
|
|
26
|
-
ip: string;
|
|
27
|
-
/**
|
|
28
|
-
* Constructs a new instance of the Device class
|
|
29
|
-
*/
|
|
30
|
-
constructor();
|
|
31
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IInternal } from "@microsoft/applicationinsights-common";
|
|
2
|
-
import { IUnloadHookContainer } from "@microsoft/applicationinsights-core-js";
|
|
3
|
-
import { IPropertiesConfig } from "../Interfaces/IPropertiesConfig";
|
|
4
|
-
export declare class Internal implements IInternal {
|
|
5
|
-
/**
|
|
6
|
-
* The SDK version used to create this telemetry item.
|
|
7
|
-
*/
|
|
8
|
-
sdkVersion: string;
|
|
9
|
-
/**
|
|
10
|
-
* The SDK agent version.
|
|
11
|
-
*/
|
|
12
|
-
agentVersion: string;
|
|
13
|
-
/**
|
|
14
|
-
* The Snippet version used to initialize the sdk instance, this will contain either
|
|
15
|
-
* undefined/null - Snippet not used
|
|
16
|
-
* '-' - Version and legacy mode not determined
|
|
17
|
-
* # - Version # of the snippet
|
|
18
|
-
* #.l - Version # in legacy mode
|
|
19
|
-
* .l - No defined version, but used legacy mode initialization
|
|
20
|
-
*/
|
|
21
|
-
snippetVer: string;
|
|
22
|
-
/**
|
|
23
|
-
* Identifies the source of the sdk script
|
|
24
|
-
*/
|
|
25
|
-
sdkSrc: string;
|
|
26
|
-
/**
|
|
27
|
-
* Constructs a new instance of the internal telemetry data class.
|
|
28
|
-
*/
|
|
29
|
-
constructor(config: IPropertiesConfig, unloadHookContainer?: IUnloadHookContainer);
|
|
30
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ISession } from "@microsoft/applicationinsights-common";
|
|
2
|
-
import { IAppInsightsCore, IUnloadHookContainer } from "@microsoft/applicationinsights-core-js";
|
|
3
|
-
export interface ISessionConfig {
|
|
4
|
-
readonly sessionRenewalMs?: number;
|
|
5
|
-
readonly sessionExpirationMs?: number;
|
|
6
|
-
readonly namePrefix?: string;
|
|
7
|
-
readonly sessionCookiePostfix?: string;
|
|
8
|
-
readonly idLength?: number;
|
|
9
|
-
readonly getNewId?: (idLength?: number) => string;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Avoid using this value to override the cookie manager cookie domain.
|
|
12
|
-
*/
|
|
13
|
-
cookieDomain?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class Session implements ISession {
|
|
16
|
-
/**
|
|
17
|
-
* The session ID.
|
|
18
|
-
*/
|
|
19
|
-
id?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The date at which this guid was generated.
|
|
22
|
-
* Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds elapsed from this time.
|
|
23
|
-
*/
|
|
24
|
-
acquisitionDate?: number;
|
|
25
|
-
/**
|
|
26
|
-
* The date at which this session ID was last reported.
|
|
27
|
-
* This value should be updated whenever telemetry is sent using this ID.
|
|
28
|
-
* Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity.
|
|
29
|
-
*/
|
|
30
|
-
renewalDate?: number;
|
|
31
|
-
}
|
|
32
|
-
export declare class _SessionManager {
|
|
33
|
-
automaticSession: Session;
|
|
34
|
-
constructor(config: ISessionConfig, core?: IAppInsightsCore, unloadHookContainer?: IUnloadHookContainer);
|
|
35
|
-
update(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Record the current state of the automatic session and store it in our cookie string format
|
|
38
|
-
* into the browser's local storage. This is used to restore the session data when the cookie
|
|
39
|
-
* expires.
|
|
40
|
-
*/
|
|
41
|
-
backup(): void;
|
|
42
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ITelemetryTrace, ITraceState } from "@microsoft/applicationinsights-common";
|
|
2
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
3
|
-
export declare class TelemetryTrace implements ITelemetryTrace {
|
|
4
|
-
traceID: string;
|
|
5
|
-
parentID: string;
|
|
6
|
-
traceState: ITraceState;
|
|
7
|
-
traceFlags: number;
|
|
8
|
-
name: string;
|
|
9
|
-
constructor(id?: string, parentId?: string, name?: string, logger?: IDiagnosticLogger);
|
|
10
|
-
}
|
package/types/Context/User.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { IUserContext } from "@microsoft/applicationinsights-common";
|
|
2
|
-
import { IAppInsightsCore, IUnloadHookContainer } from "@microsoft/applicationinsights-core-js";
|
|
3
|
-
import { IPropertiesConfig } from "../Interfaces/IPropertiesConfig";
|
|
4
|
-
export declare class User implements IUserContext {
|
|
5
|
-
static cookieSeparator: string;
|
|
6
|
-
static userCookieName: string;
|
|
7
|
-
static authUserCookieName: string;
|
|
8
|
-
/**
|
|
9
|
-
* The telemetry configuration.
|
|
10
|
-
*/
|
|
11
|
-
readonly config: IPropertiesConfig;
|
|
12
|
-
/**
|
|
13
|
-
* The user ID.
|
|
14
|
-
*/
|
|
15
|
-
id: string;
|
|
16
|
-
/**
|
|
17
|
-
* Authenticated user id
|
|
18
|
-
*/
|
|
19
|
-
authenticatedId: string;
|
|
20
|
-
/**
|
|
21
|
-
* The localId
|
|
22
|
-
*/
|
|
23
|
-
localId: string;
|
|
24
|
-
/**
|
|
25
|
-
* The account ID.
|
|
26
|
-
*/
|
|
27
|
-
accountId: string;
|
|
28
|
-
/**
|
|
29
|
-
* The account acquisition date.
|
|
30
|
-
*/
|
|
31
|
-
accountAcquisitionDate: string;
|
|
32
|
-
/**
|
|
33
|
-
* A flag indicating whether this represents a new user
|
|
34
|
-
*/
|
|
35
|
-
isNewUser: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* A flag indicating whether the user cookie has been set
|
|
38
|
-
*/
|
|
39
|
-
isUserCookieSet: boolean;
|
|
40
|
-
constructor(config: IPropertiesConfig, core: IAppInsightsCore, unloadHookContainer?: IUnloadHookContainer);
|
|
41
|
-
/**
|
|
42
|
-
* Sets the authenticated user id and the account id in this session.
|
|
43
|
-
*
|
|
44
|
-
* @param authenticatedUserId - {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service.
|
|
45
|
-
* @param accountId - {string} - An optional string to represent the account associated with the authenticated user.
|
|
46
|
-
*/
|
|
47
|
-
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie?: boolean): void;
|
|
48
|
-
/**
|
|
49
|
-
* Clears the authenticated user id and the account id from the user context.
|
|
50
|
-
* @returns {}
|
|
51
|
-
*/
|
|
52
|
-
clearAuthenticatedUserContext(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Update or create the user cookie if cookies where previously disabled or the new userId does not match the existing value.
|
|
55
|
-
* If you pass nothing a new random user id will be created.
|
|
56
|
-
* @param userId - Specific either the current (via appInsights.context.user.id) or new id that you want to set
|
|
57
|
-
*/
|
|
58
|
-
update(userId?: string): void;
|
|
59
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ITelemetryContext } from "@microsoft/applicationinsights-common";
|
|
2
|
-
import { IProcessTelemetryContext, ITelemetryItem } from "@microsoft/applicationinsights-core-js";
|
|
3
|
-
import { _SessionManager } from "../Context/Session";
|
|
4
|
-
export interface IPropTelemetryContext extends ITelemetryContext {
|
|
5
|
-
readonly sessionManager: _SessionManager;
|
|
6
|
-
applySessionContext(evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
7
|
-
applyOperatingSystemContxt(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
8
|
-
applyApplicationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
9
|
-
applyDeviceContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
10
|
-
applyInternalContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
11
|
-
applyLocationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
12
|
-
applyOperationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
13
|
-
applyWebContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
14
|
-
applyUserContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
15
|
-
cleanUp(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface IPropertiesConfig {
|
|
2
|
-
readonly accountId: string;
|
|
3
|
-
readonly sessionRenewalMs: number;
|
|
4
|
-
readonly samplingPercentage: number;
|
|
5
|
-
readonly sessionExpirationMs: number;
|
|
6
|
-
readonly cookieDomain: string;
|
|
7
|
-
readonly sdkExtension: string;
|
|
8
|
-
readonly isBrowserLinkTrackingEnabled: boolean;
|
|
9
|
-
readonly appId: string;
|
|
10
|
-
readonly getSessionId: string;
|
|
11
|
-
readonly namePrefix: string;
|
|
12
|
-
readonly sessionCookiePostfix: string;
|
|
13
|
-
readonly userCookiePostfix: string;
|
|
14
|
-
readonly idLength: number;
|
|
15
|
-
readonly getNewId: (idLength?: number) => string;
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PropertiesPlugin.ts
|
|
3
|
-
* @copyright Microsoft 2018
|
|
4
|
-
*/
|
|
5
|
-
import { IConfig, IPropertiesPlugin } from "@microsoft/applicationinsights-common";
|
|
6
|
-
import { BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
|
|
7
|
-
import { IPropTelemetryContext } from "./Interfaces/IPropTelemetryContext";
|
|
8
|
-
export default class PropertiesPlugin extends BaseTelemetryPlugin implements IPropertiesPlugin {
|
|
9
|
-
context: IPropTelemetryContext;
|
|
10
|
-
priority: number;
|
|
11
|
-
identifier: string;
|
|
12
|
-
constructor();
|
|
13
|
-
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
14
|
-
/**
|
|
15
|
-
* Add Part A fields to the event
|
|
16
|
-
* @param event - The event that needs to be processed
|
|
17
|
-
*/
|
|
18
|
-
processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
19
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TelemetryContext.ts
|
|
3
|
-
* @copyright Microsoft 2018
|
|
4
|
-
*/
|
|
5
|
-
import { IApplication, IDevice, IInternal, ILocation, IOperatingSystem, ISession, ITelemetryTrace, IUserContext, IWeb } from "@microsoft/applicationinsights-common";
|
|
6
|
-
import { IAppInsightsCore, IDistributedTraceContext, IProcessTelemetryContext, ITelemetryItem, IUnloadHookContainer } from "@microsoft/applicationinsights-core-js";
|
|
7
|
-
import { _SessionManager } from "./Context/Session";
|
|
8
|
-
import { IPropTelemetryContext } from "./Interfaces/IPropTelemetryContext";
|
|
9
|
-
import { IPropertiesConfig } from "./Interfaces/IPropertiesConfig";
|
|
10
|
-
export declare class TelemetryContext implements IPropTelemetryContext {
|
|
11
|
-
application: IApplication;
|
|
12
|
-
device: IDevice;
|
|
13
|
-
location: ILocation;
|
|
14
|
-
telemetryTrace: ITelemetryTrace;
|
|
15
|
-
user: IUserContext;
|
|
16
|
-
internal: IInternal;
|
|
17
|
-
session: ISession;
|
|
18
|
-
sessionManager: _SessionManager;
|
|
19
|
-
os: IOperatingSystem;
|
|
20
|
-
web: IWeb;
|
|
21
|
-
appId: () => string;
|
|
22
|
-
getSessionId: () => string;
|
|
23
|
-
constructor(core: IAppInsightsCore, defaultConfig: IPropertiesConfig, previousTraceCtx?: IDistributedTraceContext, unloadHookContainer?: IUnloadHookContainer);
|
|
24
|
-
applySessionContext(evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
25
|
-
applyOperatingSystemContxt(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
26
|
-
applyApplicationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
27
|
-
applyDeviceContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
28
|
-
applyInternalContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
29
|
-
applyLocationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
30
|
-
applyOperationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
31
|
-
applyWebContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
32
|
-
applyUserContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
33
|
-
cleanUp(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
34
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const _DYN_SESSION_MANAGER = "sessionManager";
|
|
2
|
-
export declare const _DYN_UPDATE = "update";
|
|
3
|
-
export declare const _DYN_IS_USER_COOKIE_SET = "isUserCookieSet";
|
|
4
|
-
export declare const _DYN_IS_NEW_USER = "isNewUser";
|
|
5
|
-
export declare const _DYN_GET_TRACE_CTX = "getTraceCtx";
|
|
6
|
-
export declare const _DYN_TELEMETRY_TRACE = "telemetryTrace";
|
|
7
|
-
export declare const _DYN_APPLY_SESSION_CONTEX0 = "applySessionContext";
|
|
8
|
-
export declare const _DYN_APPLY_APPLICATION_CO1 = "applyApplicationContext";
|
|
9
|
-
export declare const _DYN_APPLY_DEVICE_CONTEXT = "applyDeviceContext";
|
|
10
|
-
export declare const _DYN_APPLY_OPERATION_CONT2 = "applyOperationContext";
|
|
11
|
-
export declare const _DYN_APPLY_USER_CONTEXT = "applyUserContext";
|
|
12
|
-
export declare const _DYN_APPLY_OPERATING_SYST3 = "applyOperatingSystemContxt";
|
|
13
|
-
export declare const _DYN_APPLY_LOCATION_CONTE4 = "applyLocationContext";
|
|
14
|
-
export declare const _DYN_APPLY_INTERNAL_CONTE5 = "applyInternalContext";
|
|
15
|
-
export declare const _DYN_ACCOUNT_ID = "accountId";
|
|
16
|
-
export declare const _DYN_GET_SESSION_ID = "getSessionId";
|
|
17
|
-
export declare const _DYN_NAME_PREFIX = "namePrefix";
|
|
18
|
-
export declare const _DYN_SESSION_COOKIE_POSTF6 = "sessionCookiePostfix";
|
|
19
|
-
export declare const _DYN_USER_COOKIE_POSTFIX = "userCookiePostfix";
|
|
20
|
-
export declare const _DYN_ID_LENGTH = "idLength";
|
|
21
|
-
export declare const _DYN_GET_NEW_ID = "getNewId";
|
|
22
|
-
export declare const _DYN_LENGTH = "length";
|
|
23
|
-
export declare const _DYN_AUTOMATIC_SESSION = "automaticSession";
|
|
24
|
-
export declare const _DYN_AUTHENTICATED_ID = "authenticatedId";
|
|
25
|
-
export declare const _DYN_ACQUISITION_DATE = "acquisitionDate";
|
|
26
|
-
export declare const _DYN_RENEWAL_DATE = "renewalDate";
|
|
27
|
-
export declare const _DYN_JOIN = "join";
|
|
28
|
-
export declare const _DYN_COOKIE_SEPARATOR = "cookieSeparator";
|
|
29
|
-
export declare const _DYN_AUTH_USER_COOKIE_NAM7 = "authUserCookieName";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.34.4"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|