@microsoft/1ds-core-js 3.1.11 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/{ms.core-3.1.11.gbl.js → ms.core-3.2.0.gbl.js} +2613 -1373
- package/bundle/ms.core-3.2.0.gbl.js.map +1 -0
- package/bundle/ms.core-3.2.0.gbl.min.js +7 -0
- package/bundle/ms.core-3.2.0.gbl.min.js.map +1 -0
- package/bundle/ms.core-3.2.0.integrity.json +46 -0
- package/bundle/{ms.core-3.1.11.js → ms.core-3.2.0.js} +2613 -1373
- package/bundle/ms.core-3.2.0.js.map +1 -0
- package/bundle/ms.core-3.2.0.min.js +7 -0
- package/bundle/ms.core-3.2.0.min.js.map +1 -0
- package/bundle/ms.core.gbl.js +2612 -1372
- package/bundle/ms.core.gbl.js.map +1 -1
- package/bundle/ms.core.gbl.min.js +2 -2
- package/bundle/ms.core.gbl.min.js.map +1 -1
- package/bundle/ms.core.integrity.json +17 -17
- package/bundle/ms.core.js +2612 -1372
- package/bundle/ms.core.js.map +1 -1
- package/bundle/ms.core.min.js +2 -2
- package/bundle/ms.core.min.js.map +1 -1
- package/dist/ms.core.js +92 -55
- package/dist/ms.core.js.map +1 -1
- package/dist/ms.core.min.js +2 -2
- package/dist/ms.core.min.js.map +1 -1
- package/dist-esm/src/AppInsightsCore.js +5 -6
- package/dist-esm/src/AppInsightsCore.js.map +1 -1
- package/dist-esm/src/BaseCore.js +3 -4
- package/dist-esm/src/BaseCore.js.map +1 -1
- package/dist-esm/src/DataModels.js +1 -1
- package/dist-esm/src/ESPromise.js +1 -1
- package/dist-esm/src/ESPromiseScheduler.js +1 -1
- package/dist-esm/src/Enums.d.ts +174 -172
- package/dist-esm/src/Enums.js +63 -103
- package/dist-esm/src/Enums.js.map +1 -1
- package/dist-esm/src/Index.d.ts +4 -3
- package/dist-esm/src/Index.js +4 -6
- package/dist-esm/src/Index.js.map +1 -1
- package/dist-esm/src/Utils.d.ts +2 -2
- package/dist-esm/src/Utils.js +12 -13
- package/dist-esm/src/Utils.js.map +1 -1
- package/dist-esm/src/ValueSanitizer.js +1 -1
- package/package.json +3 -3
- package/src/AppInsightsCore.ts +6 -6
- package/src/BaseCore.ts +5 -5
- package/src/Enums.ts +155 -65
- package/src/Index.ts +14 -7
- package/src/Utils.ts +12 -12
- package/bundle/ms.core-3.1.11.gbl.js.map +0 -1
- package/bundle/ms.core-3.1.11.gbl.min.js +0 -7
- package/bundle/ms.core-3.1.11.gbl.min.js.map +0 -1
- package/bundle/ms.core-3.1.11.integrity.json +0 -46
- package/bundle/ms.core-3.1.11.js.map +0 -1
- package/bundle/ms.core-3.1.11.min.js +0 -7
- package/bundle/ms.core-3.1.11.min.js.map +0 -1
package/src/BaseCore.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* @copyright Microsoft 2018
|
|
8
8
|
*/
|
|
9
9
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
10
|
-
import { BaseCore as InternalCore, IPlugin,
|
|
10
|
+
import { BaseCore as InternalCore, IPlugin, eLoggingSeverity, ITelemetryItem, IDiagnosticLogger, INotificationManager, dumpObj, _throwInternal } from "@microsoft/applicationinsights-core-js";
|
|
11
11
|
import { IExtendedConfiguration, IExtendedTelemetryItem, IExtendedAppInsightsCore } from "./DataModels";
|
|
12
|
-
import {
|
|
12
|
+
import { _eExtendedInternalMessageId } from "./Enums";
|
|
13
13
|
import { FullVersionString, isDocumentObjectAvailable } from "./Utils";
|
|
14
14
|
|
|
15
15
|
export default class BaseCore extends InternalCore implements IExtendedAppInsightsCore {
|
|
@@ -34,9 +34,9 @@ export default class BaseCore extends InternalCore implements IExtendedAppInsigh
|
|
|
34
34
|
try {
|
|
35
35
|
_base.initialize(config, extensions, logger, notificationManager);
|
|
36
36
|
} catch (e) {
|
|
37
|
-
_self.logger
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
_throwInternal(_self.logger,
|
|
38
|
+
eLoggingSeverity.CRITICAL,
|
|
39
|
+
_eExtendedInternalMessageId.FailedToInitializeSDK, "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only"
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
};
|
package/src/Enums.ts
CHANGED
|
@@ -5,75 +5,112 @@
|
|
|
5
5
|
* File containing the enums as constants.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { _InternalMessageId } from "@microsoft/applicationinsights-core-js";
|
|
8
|
+
import { _InternalMessageId, _eInternalMessageId, createEnumStyle, objFreeze } from "@microsoft/applicationinsights-core-js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The eValueKind contains a set of values that specify value kind of the property.
|
|
12
12
|
* Either PII (Personal Identifiable Information) or customer content.
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const enum eValueKind {
|
|
15
15
|
/**
|
|
16
16
|
* No kind.
|
|
17
17
|
*/
|
|
18
|
-
NotSet
|
|
18
|
+
NotSet = 0,
|
|
19
|
+
|
|
19
20
|
/**
|
|
20
21
|
* An LDAP distinguished name. For example, CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM.
|
|
21
22
|
*/
|
|
22
|
-
Pii_DistinguishedName
|
|
23
|
+
Pii_DistinguishedName = 1,
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* Generic information.
|
|
25
27
|
*/
|
|
26
|
-
Pii_GenericData
|
|
28
|
+
Pii_GenericData = 2,
|
|
29
|
+
|
|
27
30
|
/**
|
|
28
31
|
* An IPV4 Internet address. For example, 192.0.2.1.
|
|
29
32
|
*/
|
|
30
|
-
Pii_IPV4Address
|
|
33
|
+
Pii_IPV4Address = 3,
|
|
34
|
+
|
|
31
35
|
/**
|
|
32
36
|
* An IPV6 Internet address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
|
|
33
37
|
*/
|
|
34
|
-
Pii_IPv6Address
|
|
38
|
+
Pii_IPv6Address = 4,
|
|
39
|
+
|
|
35
40
|
/**
|
|
36
41
|
* The Subject of an e-mail message.
|
|
37
42
|
*/
|
|
38
|
-
Pii_MailSubject
|
|
43
|
+
Pii_MailSubject = 5,
|
|
44
|
+
|
|
39
45
|
/**
|
|
40
46
|
* A telephone number.
|
|
41
47
|
*/
|
|
42
|
-
Pii_PhoneNumber
|
|
48
|
+
Pii_PhoneNumber = 6,
|
|
49
|
+
|
|
43
50
|
/**
|
|
44
51
|
* A query string.
|
|
45
52
|
*/
|
|
46
|
-
Pii_QueryString
|
|
53
|
+
Pii_QueryString = 7,
|
|
54
|
+
|
|
47
55
|
/**
|
|
48
56
|
* An SIP (Session Internet Protocol) address.
|
|
49
57
|
*/
|
|
50
|
-
Pii_SipAddress
|
|
58
|
+
Pii_SipAddress = 8,
|
|
59
|
+
|
|
51
60
|
/**
|
|
52
61
|
* An e-mail address.
|
|
53
62
|
*/
|
|
54
|
-
Pii_SmtpAddress
|
|
63
|
+
Pii_SmtpAddress = 9,
|
|
64
|
+
|
|
55
65
|
/**
|
|
56
66
|
* An user ID.
|
|
57
67
|
*/
|
|
58
|
-
Pii_Identity
|
|
68
|
+
Pii_Identity = 10,
|
|
69
|
+
|
|
59
70
|
/**
|
|
60
71
|
* A URI (Uniform Resource Identifier).
|
|
61
72
|
*/
|
|
62
|
-
Pii_Uri
|
|
73
|
+
Pii_Uri = 11,
|
|
74
|
+
|
|
63
75
|
/**
|
|
64
76
|
* The fully-qualified domain name.
|
|
65
77
|
*/
|
|
66
|
-
Pii_Fqdn
|
|
78
|
+
Pii_Fqdn = 12,
|
|
79
|
+
|
|
67
80
|
/**
|
|
68
81
|
* Scrubs the last octet in a IPV4 Internet address.
|
|
69
82
|
* For example: 10.121.227.147 becomes 10.121.227.*
|
|
70
83
|
*/
|
|
71
|
-
Pii_IPV4AddressLegacy
|
|
84
|
+
Pii_IPV4AddressLegacy = 13,
|
|
85
|
+
|
|
72
86
|
/**
|
|
73
87
|
* Generic content.
|
|
74
88
|
*/
|
|
75
|
-
CustomerContent_GenericContent
|
|
76
|
-
}
|
|
89
|
+
CustomerContent_GenericContent = 32
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The ValueKind contains a set of values that specify value kind of the property.
|
|
94
|
+
* Either PII (Personal Identifiable Information) or customer content.
|
|
95
|
+
*/
|
|
96
|
+
export const ValueKind = createEnumStyle<typeof eValueKind>({
|
|
97
|
+
NotSet: eValueKind.NotSet,
|
|
98
|
+
Pii_DistinguishedName: eValueKind.Pii_DistinguishedName,
|
|
99
|
+
Pii_GenericData: eValueKind.Pii_GenericData,
|
|
100
|
+
Pii_IPV4Address: eValueKind.Pii_IPV4Address,
|
|
101
|
+
Pii_IPv6Address: eValueKind.Pii_IPv6Address,
|
|
102
|
+
Pii_MailSubject: eValueKind.Pii_MailSubject,
|
|
103
|
+
Pii_PhoneNumber: eValueKind.Pii_PhoneNumber,
|
|
104
|
+
Pii_QueryString: eValueKind.Pii_QueryString,
|
|
105
|
+
Pii_SipAddress: eValueKind.Pii_SipAddress,
|
|
106
|
+
Pii_SmtpAddress: eValueKind.Pii_SmtpAddress,
|
|
107
|
+
Pii_Identity: eValueKind.Pii_Identity,
|
|
108
|
+
Pii_Uri: eValueKind.Pii_Uri,
|
|
109
|
+
Pii_Fqdn: eValueKind.Pii_Fqdn,
|
|
110
|
+
Pii_IPV4AddressLegacy: eValueKind.Pii_IPV4AddressLegacy,
|
|
111
|
+
CustomerContent_GenericContent: eValueKind.CustomerContent_GenericContent
|
|
112
|
+
});
|
|
113
|
+
export type ValueKind = number | eValueKind
|
|
77
114
|
|
|
78
115
|
/**
|
|
79
116
|
* The EventLatency contains a set of values that specify the latency with which an event is sent.
|
|
@@ -102,7 +139,7 @@ export const enum EventLatencyValue {
|
|
|
102
139
|
/**
|
|
103
140
|
* The EventLatency contains a set of values that specify the latency with which an event is sent.
|
|
104
141
|
*/
|
|
105
|
-
export const EventLatency = {
|
|
142
|
+
export const EventLatency = createEnumStyle<typeof EventLatencyValue>({
|
|
106
143
|
/**
|
|
107
144
|
* Normal latency.
|
|
108
145
|
*/
|
|
@@ -121,23 +158,41 @@ export const EventLatency = {
|
|
|
121
158
|
* Added in v3.1.1
|
|
122
159
|
*/
|
|
123
160
|
Immediate: EventLatencyValue.Immediate
|
|
124
|
-
};
|
|
161
|
+
});
|
|
162
|
+
export type EventLatency = number | EventLatencyValue
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Enum for property types.
|
|
166
|
+
*/
|
|
167
|
+
export const enum eEventPropertyType {
|
|
168
|
+
Unspecified = 0,
|
|
169
|
+
String = 1,
|
|
170
|
+
Int32 = 2,
|
|
171
|
+
UInt32 = 3,
|
|
172
|
+
Int64 = 4,
|
|
173
|
+
UInt64 = 5,
|
|
174
|
+
Double = 6,
|
|
175
|
+
Bool = 7,
|
|
176
|
+
Guid = 8,
|
|
177
|
+
DateTime = 9
|
|
178
|
+
}
|
|
125
179
|
|
|
126
180
|
/**
|
|
127
181
|
* Enum for property types.
|
|
128
182
|
*/
|
|
129
|
-
export const EventPropertyType = {
|
|
130
|
-
Unspecified:
|
|
131
|
-
String:
|
|
132
|
-
Int32:
|
|
133
|
-
UInt32:
|
|
134
|
-
Int64:
|
|
135
|
-
UInt64:
|
|
136
|
-
Double:
|
|
137
|
-
Bool:
|
|
138
|
-
Guid:
|
|
139
|
-
DateTime:
|
|
140
|
-
};
|
|
183
|
+
export const EventPropertyType = createEnumStyle<typeof eEventPropertyType>({
|
|
184
|
+
Unspecified: eEventPropertyType.Unspecified,
|
|
185
|
+
String: eEventPropertyType.String,
|
|
186
|
+
Int32: eEventPropertyType.Int32,
|
|
187
|
+
UInt32: eEventPropertyType.UInt32,
|
|
188
|
+
Int64: eEventPropertyType.Int64,
|
|
189
|
+
UInt64: eEventPropertyType.UInt64,
|
|
190
|
+
Double: eEventPropertyType.Double,
|
|
191
|
+
Bool: eEventPropertyType.Bool,
|
|
192
|
+
Guid: eEventPropertyType.Guid,
|
|
193
|
+
DateTime: eEventPropertyType.DateTime
|
|
194
|
+
});
|
|
195
|
+
export type EventPropertyType = number | eEventPropertyType
|
|
141
196
|
|
|
142
197
|
/**
|
|
143
198
|
* The EventPersistence contains a set of values that specify the event's persistence.
|
|
@@ -156,16 +211,18 @@ export const enum EventPersistenceValue {
|
|
|
156
211
|
/**
|
|
157
212
|
* The EventPersistence contains a set of values that specify the event's persistence.
|
|
158
213
|
*/
|
|
159
|
-
export const EventPersistence = {
|
|
214
|
+
export const EventPersistence = createEnumStyle<typeof EventPersistenceValue>({
|
|
160
215
|
/**
|
|
161
216
|
* Normal persistence.
|
|
162
217
|
*/
|
|
163
218
|
Normal: EventPersistenceValue.Normal,
|
|
219
|
+
|
|
164
220
|
/**
|
|
165
221
|
* Critical persistence.
|
|
166
222
|
*/
|
|
167
223
|
Critical: EventPersistenceValue.Critical
|
|
168
|
-
};
|
|
224
|
+
});
|
|
225
|
+
export type EventPersistence = number | EventPersistenceValue;
|
|
169
226
|
|
|
170
227
|
/**
|
|
171
228
|
* Define a specific way to send an event synchronously
|
|
@@ -201,48 +258,81 @@ export const enum EventSendType {
|
|
|
201
258
|
/**
|
|
202
259
|
* The TraceLevel contains a set of values that specify the trace level for the trace messages.
|
|
203
260
|
*/
|
|
204
|
-
export const
|
|
261
|
+
export const enum eTraceLevel {
|
|
205
262
|
/**
|
|
206
263
|
* None.
|
|
207
264
|
*/
|
|
208
|
-
NONE
|
|
265
|
+
NONE = 0,
|
|
209
266
|
/**
|
|
210
267
|
* Error trace.
|
|
211
268
|
*/
|
|
212
|
-
ERROR
|
|
269
|
+
ERROR = 1,
|
|
213
270
|
/**
|
|
214
271
|
* Warning trace.
|
|
215
272
|
*/
|
|
216
|
-
WARNING
|
|
273
|
+
WARNING = 2,
|
|
217
274
|
/**
|
|
218
275
|
* Information trace.
|
|
219
276
|
*/
|
|
220
|
-
INFORMATION
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
277
|
+
INFORMATION = 3
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export const TraceLevel = createEnumStyle<typeof eTraceLevel>({
|
|
281
|
+
NONE: eTraceLevel.NONE,
|
|
282
|
+
ERROR: eTraceLevel.ERROR,
|
|
283
|
+
WARNING: eTraceLevel.WARNING,
|
|
284
|
+
INFORMATION: eTraceLevel.INFORMATION,
|
|
285
|
+
});
|
|
286
|
+
export type TraceLevel = number | eTraceLevel;
|
|
287
|
+
|
|
288
|
+
export const enum _eExtendedInternalMessageId {
|
|
289
|
+
AuthHandShakeError = 501,
|
|
290
|
+
AuthRedirectFail = 502,
|
|
291
|
+
BrowserCannotReadLocalStorage = 503,
|
|
292
|
+
BrowserCannotWriteLocalStorage = 504,
|
|
293
|
+
BrowserDoesNotSupportLocalStorage = 505,
|
|
294
|
+
CannotParseBiBlobValue = 506,
|
|
295
|
+
CannotParseDataAttribute = 507,
|
|
296
|
+
CVPluginNotAvailable = 508,
|
|
297
|
+
DroppedEvent = 509,
|
|
298
|
+
ErrorParsingAISessionCookie = 510,
|
|
299
|
+
ErrorProvidedChannels = 511,
|
|
300
|
+
FailedToGetCookies = 512,
|
|
301
|
+
FailedToInitializeCorrelationVector = 513,
|
|
302
|
+
FailedToInitializeSDK = 514,
|
|
303
|
+
InvalidContentBlob = 515,
|
|
304
|
+
InvalidCorrelationValue = 516,
|
|
305
|
+
SessionRenewalDateIsZero = 517,
|
|
306
|
+
SendPostOnCompleteFailure = 518,
|
|
307
|
+
PostResponseHandler = 519,
|
|
308
|
+
SDKNotInitialized = 520
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export const _ExtendedInternalMessageId = objFreeze({
|
|
312
|
+
..._InternalMessageId,
|
|
313
|
+
...createEnumStyle<typeof _eExtendedInternalMessageId>({
|
|
314
|
+
AuthHandShakeError: _eExtendedInternalMessageId.AuthHandShakeError,
|
|
315
|
+
AuthRedirectFail: _eExtendedInternalMessageId.AuthRedirectFail,
|
|
316
|
+
BrowserCannotReadLocalStorage: _eExtendedInternalMessageId.BrowserCannotReadLocalStorage,
|
|
317
|
+
BrowserCannotWriteLocalStorage: _eExtendedInternalMessageId.BrowserCannotWriteLocalStorage,
|
|
318
|
+
BrowserDoesNotSupportLocalStorage: _eExtendedInternalMessageId.BrowserDoesNotSupportLocalStorage,
|
|
319
|
+
CannotParseBiBlobValue: _eExtendedInternalMessageId.CannotParseBiBlobValue,
|
|
320
|
+
CannotParseDataAttribute: _eExtendedInternalMessageId.CannotParseDataAttribute,
|
|
321
|
+
CVPluginNotAvailable: _eExtendedInternalMessageId.CVPluginNotAvailable,
|
|
322
|
+
DroppedEvent: _eExtendedInternalMessageId.DroppedEvent,
|
|
323
|
+
ErrorParsingAISessionCookie: _eExtendedInternalMessageId.ErrorParsingAISessionCookie,
|
|
324
|
+
ErrorProvidedChannels: _eExtendedInternalMessageId.ErrorProvidedChannels,
|
|
325
|
+
FailedToGetCookies: _eExtendedInternalMessageId.FailedToGetCookies,
|
|
326
|
+
FailedToInitializeCorrelationVector: _eExtendedInternalMessageId.FailedToInitializeCorrelationVector,
|
|
327
|
+
FailedToInitializeSDK: _eExtendedInternalMessageId.FailedToInitializeSDK,
|
|
328
|
+
InvalidContentBlob: _eExtendedInternalMessageId.InvalidContentBlob,
|
|
329
|
+
InvalidCorrelationValue: _eExtendedInternalMessageId.InvalidCorrelationValue,
|
|
330
|
+
SessionRenewalDateIsZero: _eExtendedInternalMessageId.SessionRenewalDateIsZero,
|
|
331
|
+
SendPostOnCompleteFailure: _eExtendedInternalMessageId.SendPostOnCompleteFailure,
|
|
332
|
+
PostResponseHandler: _eExtendedInternalMessageId.PostResponseHandler,
|
|
333
|
+
SDKNotInitialized: _eExtendedInternalMessageId.SDKNotInitialized
|
|
334
|
+
})});
|
|
335
|
+
export type _ExtendedInternalMessageId = number | _eExtendedInternalMessageId | _eInternalMessageId;
|
|
246
336
|
|
|
247
337
|
// Following the format styles as defined by .Net (https://docs.microsoft.com/en-us/dotnet/api/system.guid.tostring?view=netcore-3.1)
|
|
248
338
|
export const enum GuidStyle {
|
package/src/Index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* File to export public classes, interfaces and enums.
|
|
6
6
|
*/
|
|
7
7
|
import {
|
|
8
|
-
ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType,
|
|
8
|
+
ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, _eExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType,
|
|
9
9
|
TransportType, EventLatencyValue, EventPersistenceValue, EventSendType
|
|
10
10
|
} from "./Enums";
|
|
11
11
|
import {
|
|
@@ -23,7 +23,7 @@ import { ValueSanitizer } from "./ValueSanitizer";
|
|
|
23
23
|
export {
|
|
24
24
|
ValueKind, IExtendedConfiguration, IPropertyStorageOverride,
|
|
25
25
|
EventLatency, EventPersistence, TraceLevel, IEventProperty, IExtendedTelemetryItem, TransportType,
|
|
26
|
-
AppInsightsCore, BaseCore, _ExtendedInternalMessageId, IExtendedAppInsightsCore, EventPropertyType,
|
|
26
|
+
AppInsightsCore, BaseCore, _ExtendedInternalMessageId, _eExtendedInternalMessageId, IExtendedAppInsightsCore, EventPropertyType,
|
|
27
27
|
IEventTiming, ESPromise, ESPromiseOnResolvedFunc, ESPromiseOnRejectedFunc, ResolverResolveFunc,
|
|
28
28
|
ResolverRejectFunc, ESPromiseScheduler, ESPromiseSchedulerEvent, GuidStyle,
|
|
29
29
|
FieldValueSanitizerFunc, FieldValueSanitizerType, FieldValueSanitizerTypes, IFieldSanitizerDetails,
|
|
@@ -37,12 +37,13 @@ export {
|
|
|
37
37
|
MinChannelPriorty, EventsDiscardedReason, ICoreUtils, IDiagnosticLogger, DiagnosticLogger, LoggingSeverity, SendRequestReason,
|
|
38
38
|
IPerfEvent, IPerfManager, IPerfManagerProvider, PerfEvent, PerfManager, doPerf, ICustomProperties, Tags,
|
|
39
39
|
EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId,
|
|
40
|
+
createEnumStyle, eLoggingSeverity, _eInternalMessageId, _throwInternal,// _warnToConsole, _logInternalMessage
|
|
40
41
|
// The HelperFuncs functions
|
|
41
42
|
isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName,
|
|
42
43
|
objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean,
|
|
43
44
|
toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError,
|
|
44
|
-
setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, optimizeObject,
|
|
45
|
-
objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger,
|
|
45
|
+
setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject,
|
|
46
|
+
objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal,
|
|
46
47
|
// EnvUtils
|
|
47
48
|
getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto,
|
|
48
49
|
hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON,
|
|
@@ -53,12 +54,18 @@ export {
|
|
|
53
54
|
// Cookie Handling
|
|
54
55
|
ICookieMgr, ICookieMgrConfig, uaDisallowsSameSiteNone as disallowsSameSiteNone,
|
|
55
56
|
areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr,
|
|
56
|
-
// Constants
|
|
57
|
-
strIKey, strExtensionConfig,
|
|
58
57
|
// Aliases
|
|
59
58
|
toISOString as getISOString,
|
|
60
59
|
isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest,
|
|
61
|
-
addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener
|
|
60
|
+
addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener,
|
|
61
|
+
removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace,
|
|
62
|
+
createUniqueNamespace,
|
|
63
|
+
_IRegisteredEvents, __getRegisteredEvents,
|
|
64
|
+
TelemetryInitializerFunction, ITelemetryInitializerHandler, ITelemetryInitializerContainer,
|
|
65
|
+
createProcessTelemetryContext,
|
|
66
|
+
IProcessTelemetryUnloadContext, UnloadHandler, IUnloadHandlerContainer, ITelemetryUnloadState, createUnloadHandlerContainer, TelemetryUnloadReason,
|
|
67
|
+
ITelemetryUpdateState, IUnloadableComponent
|
|
68
|
+
|
|
62
69
|
} from "@microsoft/applicationinsights-core-js";
|
|
63
70
|
|
|
64
71
|
export {
|
package/src/Utils.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { objCreateFn, strShimObject } from "@microsoft/applicationinsights-shims";
|
|
8
8
|
import { IEventProperty, IExtendedTelemetryItem } from "./DataModels";
|
|
9
|
-
import {
|
|
9
|
+
import { eEventPropertyType, _ExtendedInternalMessageId, GuidStyle, eValueKind, FieldValueSanitizerType, EventLatency, EventLatencyValue } from "./Enums";
|
|
10
10
|
import {
|
|
11
11
|
ITelemetryItem, getDocument, getNavigator, getWindow, getGlobalInst,
|
|
12
12
|
objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray,
|
|
@@ -26,13 +26,13 @@ const strTimeout: string = "timeout";
|
|
|
26
26
|
|
|
27
27
|
// If value is array just get the type for the first element
|
|
28
28
|
const _fieldTypeEventPropMap = {
|
|
29
|
-
[FieldValueSanitizerType.NotSet]:
|
|
30
|
-
[FieldValueSanitizerType.Number]:
|
|
31
|
-
[FieldValueSanitizerType.String]:
|
|
32
|
-
[FieldValueSanitizerType.Boolean]:
|
|
33
|
-
[FieldValueSanitizerType.Array | FieldValueSanitizerType.Number]:
|
|
34
|
-
[FieldValueSanitizerType.Array | FieldValueSanitizerType.String]:
|
|
35
|
-
[FieldValueSanitizerType.Array | FieldValueSanitizerType.Boolean]:
|
|
29
|
+
[FieldValueSanitizerType.NotSet]: eEventPropertyType.Unspecified,
|
|
30
|
+
[FieldValueSanitizerType.Number]: eEventPropertyType.Double,
|
|
31
|
+
[FieldValueSanitizerType.String]: eEventPropertyType.String,
|
|
32
|
+
[FieldValueSanitizerType.Boolean]: eEventPropertyType.Bool,
|
|
33
|
+
[FieldValueSanitizerType.Array | FieldValueSanitizerType.Number]: eEventPropertyType.Double,
|
|
34
|
+
[FieldValueSanitizerType.Array | FieldValueSanitizerType.String]: eEventPropertyType.String,
|
|
35
|
+
[FieldValueSanitizerType.Array | FieldValueSanitizerType.Boolean]: eEventPropertyType.Bool
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -97,8 +97,8 @@ export function isUint8ArrayAvailable(): boolean {
|
|
|
97
97
|
* @param value - The value that needs to be checked.
|
|
98
98
|
* @returns True if the value is in AWTEventLatency, false otherwise.
|
|
99
99
|
*/
|
|
100
|
-
export function isLatency(value:
|
|
101
|
-
if (value && isNumber(value) && value >=
|
|
100
|
+
export function isLatency(value: EventLatency | undefined): boolean {
|
|
101
|
+
if (value && isNumber(value) && value >= EventLatencyValue.Normal && value <= EventLatencyValue.Immediate) {
|
|
102
102
|
return true;
|
|
103
103
|
}
|
|
104
104
|
return false;
|
|
@@ -185,7 +185,7 @@ export function getCommonSchemaMetaData(value: string | boolean | number | strin
|
|
|
185
185
|
if (encodedTypeValue !== -1 && propType !== -1) {
|
|
186
186
|
// pii exists so we must return correct type
|
|
187
187
|
encodedTypeValue |= propType;
|
|
188
|
-
} else if (propType ===
|
|
188
|
+
} else if (propType === eEventPropertyType.Double) {
|
|
189
189
|
encodedTypeValue = propType;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -338,7 +338,7 @@ export let getTime = perfNow;
|
|
|
338
338
|
|
|
339
339
|
export function isValueKind(value: number | undefined): boolean {
|
|
340
340
|
// Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization
|
|
341
|
-
if (value ===
|
|
341
|
+
if (value === eValueKind.NotSet || ((value > eValueKind.NotSet && value <= eValueKind.Pii_IPV4AddressLegacy) || value === eValueKind.CustomerContent_GenericContent)) {
|
|
342
342
|
return true;
|
|
343
343
|
}
|
|
344
344
|
|