-
Notifications
You must be signed in to change notification settings - Fork 235
/
Enums.ts
398 lines (350 loc) · 11.5 KB
/
Enums.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
/**
* Enums.ts
* @author Abhilash Panwar (abpanwar)
* @copyright Microsoft 2018
* File containing the enums as constants.
*/
import { _eInternalMessageId, createEnumStyle, objFreeze } from "@microsoft/applicationinsights-core-js";
/**
* The eValueKind contains a set of values that specify value kind of the property.
* Either PII (Personal Identifiable Information) or customer content.
*/
export const enum eValueKind {
/**
* No kind.
*/
NotSet = 0,
/**
* An LDAP distinguished name. For example, CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM.
*/
Pii_DistinguishedName = 1,
/**
* Generic information.
*/
Pii_GenericData = 2,
/**
* An IPV4 Internet address. For example, 192.0.2.1.
*/
Pii_IPV4Address = 3,
/**
* An IPV6 Internet address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
*/
Pii_IPv6Address = 4,
/**
* The Subject of an e-mail message.
*/
Pii_MailSubject = 5,
/**
* A telephone number.
*/
Pii_PhoneNumber = 6,
/**
* A query string.
*/
Pii_QueryString = 7,
/**
* An SIP (Session Internet Protocol) address.
*/
Pii_SipAddress = 8,
/**
* An e-mail address.
*/
Pii_SmtpAddress = 9,
/**
* An user ID.
*/
Pii_Identity = 10,
/**
* A URI (Uniform Resource Identifier).
*/
Pii_Uri = 11,
/**
* The fully-qualified domain name.
*/
Pii_Fqdn = 12,
/**
* Scrubs the last octet in a IPV4 Internet address.
* For example: 10.121.227.147 becomes 10.121.227.*
*/
Pii_IPV4AddressLegacy = 13,
/**
* Scrubs the last 4 Hextets (last 64-bits) of an IPv6 address
*/
Pii_IPv6ScrubLastHextets = 14,
/**
* Drops the value altogether, rather than hashing
*/
Pii_DropValue = 15,
/**
* Generic content.
*/
CustomerContent_GenericContent = 32
}
/**
* The ValueKind contains a set of values that specify value kind of the property.
* Either PII (Personal Identifiable Information) or customer content.
*/
export const ValueKind = createEnumStyle<typeof eValueKind>({
NotSet: eValueKind.NotSet,
Pii_DistinguishedName: eValueKind.Pii_DistinguishedName,
Pii_GenericData: eValueKind.Pii_GenericData,
Pii_IPV4Address: eValueKind.Pii_IPV4Address,
Pii_IPv6Address: eValueKind.Pii_IPv6Address,
Pii_MailSubject: eValueKind.Pii_MailSubject,
Pii_PhoneNumber: eValueKind.Pii_PhoneNumber,
Pii_QueryString: eValueKind.Pii_QueryString,
Pii_SipAddress: eValueKind.Pii_SipAddress,
Pii_SmtpAddress: eValueKind.Pii_SmtpAddress,
Pii_Identity: eValueKind.Pii_Identity,
Pii_Uri: eValueKind.Pii_Uri,
Pii_Fqdn: eValueKind.Pii_Fqdn,
Pii_IPV4AddressLegacy: eValueKind.Pii_IPV4AddressLegacy,
Pii_IPv6ScrubLastHextets: eValueKind.Pii_IPv6ScrubLastHextets,
Pii_DropValue: eValueKind.Pii_DropValue,
CustomerContent_GenericContent: eValueKind.CustomerContent_GenericContent
});
export type ValueKind = number | eValueKind
/**
* The EventLatency contains a set of values that specify the latency with which an event is sent.
*/
export const enum EventLatencyValue {
/**
* Normal latency.
*/
Normal = 1,
/**
* Cost deferred latency. At the moment this latency is treated as Normal latency.
*/
CostDeferred = 2,
/**
* Real time latency.
*/
RealTime = 3,
/**
* Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.
* Added in v3.1.1
*/
Immediate = 4
}
/**
* The EventLatency contains a set of values that specify the latency with which an event is sent.
*/
export const EventLatency = createEnumStyle<typeof EventLatencyValue>({
/**
* Normal latency.
*/
Normal: EventLatencyValue.Normal,
/**
* Cost deferred latency. At the moment this latency is treated as Normal latency.
*/
CostDeferred: EventLatencyValue.CostDeferred,
/**
* Real time latency.
*/
RealTime: EventLatencyValue.RealTime,
/**
* Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.
* Added in v3.1.1
*/
Immediate: EventLatencyValue.Immediate
});
export type EventLatency = number | EventLatencyValue
/**
* Enum for property types.
*/
export const enum eEventPropertyType {
Unspecified = 0,
String = 1,
Int32 = 2,
UInt32 = 3,
Int64 = 4,
UInt64 = 5,
Double = 6,
Bool = 7,
Guid = 8,
DateTime = 9
}
/**
* Enum for property types.
*/
export const EventPropertyType = createEnumStyle<typeof eEventPropertyType>({
Unspecified: eEventPropertyType.Unspecified,
String: eEventPropertyType.String,
Int32: eEventPropertyType.Int32,
UInt32: eEventPropertyType.UInt32,
Int64: eEventPropertyType.Int64,
UInt64: eEventPropertyType.UInt64,
Double: eEventPropertyType.Double,
Bool: eEventPropertyType.Bool,
Guid: eEventPropertyType.Guid,
DateTime: eEventPropertyType.DateTime
});
export type EventPropertyType = number | eEventPropertyType
/**
* The EventPersistence contains a set of values that specify the event's persistence.
*/
export const enum EventPersistenceValue {
/**
* Normal persistence.
*/
Normal = 1,
/**
* Critical persistence.
*/
Critical = 2
}
/**
* The EventPersistence contains a set of values that specify the event's persistence.
*/
export const EventPersistence = createEnumStyle<typeof EventPersistenceValue>({
/**
* Normal persistence.
*/
Normal: EventPersistenceValue.Normal,
/**
* Critical persistence.
*/
Critical: EventPersistenceValue.Critical
});
export type EventPersistence = number | EventPersistenceValue;
/**
* Define a specific way to send an event synchronously
*/
export const enum EventSendType {
/**
* Batch and send the event asynchronously, this is the same as either setting the event `sync` flag to false or not setting at all.
*/
Batched = 0, // For backward compatibility numeric 0 === false as a numeric
/**
* Attempt to send the event synchronously, this is the same as setting the event `sync` flag to true
*/
Synchronous = 1, // For backward compatibility numeric 1 === true as a numeric
/**
* Attempt to send the event synchronously with a preference for the sendBeacon() API.
* As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb,
* the sendHook is also not supported or used when sendBeacon.
*/
SendBeacon = 2,
/**
* Attempt to send the event synchronously with a preference for the fetch() API with the keepalive flag,
* the SDK checks to ensure that the fetch() implementation supports the 'keepalive' flag and if not it
* will fallback to either sendBeacon() or a synchronous XHR request.
* As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb.
* Note: Not all browsers support the keepalive flag so for those environments the events may still fail
*/
SyncFetch = 3
}
/**
* The TraceLevel contains a set of values that specify the trace level for the trace messages.
*/
export const enum eTraceLevel {
/**
* None.
*/
NONE = 0,
/**
* Error trace.
*/
ERROR = 1,
/**
* Warning trace.
*/
WARNING = 2,
/**
* Information trace.
*/
INFORMATION = 3
}
export const TraceLevel = createEnumStyle<typeof eTraceLevel>({
NONE: eTraceLevel.NONE,
ERROR: eTraceLevel.ERROR,
WARNING: eTraceLevel.WARNING,
INFORMATION: eTraceLevel.INFORMATION
});
export type TraceLevel = number | eTraceLevel;
export const enum _eExtendedInternalMessageId {
AuthHandShakeError = 501,
AuthRedirectFail = 502,
BrowserCannotReadLocalStorage = 503,
BrowserCannotWriteLocalStorage = 504,
BrowserDoesNotSupportLocalStorage = 505,
CannotParseBiBlobValue = 506,
CannotParseDataAttribute = 507,
CVPluginNotAvailable = 508,
DroppedEvent = 509,
ErrorParsingAISessionCookie = 510,
ErrorProvidedChannels = 511,
FailedToGetCookies = 512,
FailedToInitializeCorrelationVector = 513,
FailedToInitializeSDK = 514,
InvalidContentBlob = 515,
InvalidCorrelationValue = 516,
SessionRenewalDateIsZero = 517,
SendPostOnCompleteFailure = 518,
PostResponseHandler = 519,
SDKNotInitialized = 520
}
// export const _ExtendedInternalMessageId = objFreeze({
// ..._InternalMessageId,
// ...createEnumStyle<typeof _eExtendedInternalMessageId>({
// AuthHandShakeError: _eExtendedInternalMessageId.AuthHandShakeError,
// AuthRedirectFail: _eExtendedInternalMessageId.AuthRedirectFail,
// BrowserCannotReadLocalStorage: _eExtendedInternalMessageId.BrowserCannotReadLocalStorage,
// BrowserCannotWriteLocalStorage: _eExtendedInternalMessageId.BrowserCannotWriteLocalStorage,
// BrowserDoesNotSupportLocalStorage: _eExtendedInternalMessageId.BrowserDoesNotSupportLocalStorage,
// CannotParseBiBlobValue: _eExtendedInternalMessageId.CannotParseBiBlobValue,
// CannotParseDataAttribute: _eExtendedInternalMessageId.CannotParseDataAttribute,
// CVPluginNotAvailable: _eExtendedInternalMessageId.CVPluginNotAvailable,
// DroppedEvent: _eExtendedInternalMessageId.DroppedEvent,
// ErrorParsingAISessionCookie: _eExtendedInternalMessageId.ErrorParsingAISessionCookie,
// ErrorProvidedChannels: _eExtendedInternalMessageId.ErrorProvidedChannels,
// FailedToGetCookies: _eExtendedInternalMessageId.FailedToGetCookies,
// FailedToInitializeCorrelationVector: _eExtendedInternalMessageId.FailedToInitializeCorrelationVector,
// FailedToInitializeSDK: _eExtendedInternalMessageId.FailedToInitializeSDK,
// InvalidContentBlob: _eExtendedInternalMessageId.InvalidContentBlob,
// InvalidCorrelationValue: _eExtendedInternalMessageId.InvalidCorrelationValue,
// SessionRenewalDateIsZero: _eExtendedInternalMessageId.SessionRenewalDateIsZero,
// SendPostOnCompleteFailure: _eExtendedInternalMessageId.SendPostOnCompleteFailure,
// PostResponseHandler: _eExtendedInternalMessageId.PostResponseHandler,
// SDKNotInitialized: _eExtendedInternalMessageId.SDKNotInitialized
// })});
export type _ExtendedInternalMessageId = number | _eExtendedInternalMessageId | _eInternalMessageId;
// Following the format styles as defined by .Net (https://docs.microsoft.com/en-us/dotnet/api/system.guid.tostring?view=netcore-3.1)
export const enum GuidStyle {
Numeric = "N", // 'N' - 32 digits,
Digits = "D", // 'D' - 32 digits separated by hyphens,
Braces = "B", // 'B' - 32 digits separated by hyphens, enclosed in braces,
Parentheses = "P" // 'P' 32 digits separated by hyphens, enclosed in parentheses
}
export const enum FieldValueSanitizerType {
NotSet = 0x00,
String = 0x01,
Number = 0x02,
Boolean = 0x03,
Object = 0x04,
Array = 0x1000,
EventProperty = 0x2000
}
/**
* An enumeration that identifies the transport type that are requested to be used, if the requested
* transport is not available ir supported the SDK may choose the first available transport or it
* will log a warning to the diagnostic logger.
*/
export const enum TransportType {
/**
* Use the default available api
*/
NotSet = 0,
/**
* Use XMLHttpRequest or XMLDomainRequest if available
*/
Xhr = 1,
/**
* Use the Fetch api if available
*/
Fetch = 2,
/**
* Use sendBeacon api if available
*/
Beacon = 3
}