@microsoft/1ds-core-js 3.1.9 → 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.9.gbl.js → ms.core-3.2.0.gbl.js} +2560 -1200
- 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.9.js → ms.core-3.2.0.js} +2560 -1200
- 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 +2559 -1199
- 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 +2559 -1199
- 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 +97 -56
- 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.d.ts +0 -8
- package/dist-esm/src/BaseCore.js +4 -5
- 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 +6 -5
- package/dist-esm/src/Utils.js +21 -14
- package/dist-esm/src/Utils.js.map +1 -1
- package/dist-esm/src/ValueSanitizer.js +1 -1
- package/package.json +4 -4
- package/src/AppInsightsCore.ts +6 -6
- package/src/BaseCore.ts +6 -6
- package/src/Enums.ts +155 -65
- package/src/Index.ts +14 -7
- package/src/Utils.ts +23 -14
- package/bundle/ms.core-3.1.9.gbl.js.map +0 -1
- package/bundle/ms.core-3.1.9.gbl.min.js +0 -7
- package/bundle/ms.core-3.1.9.gbl.min.js.map +0 -1
- package/bundle/ms.core-3.1.9.integrity.json +0 -46
- package/bundle/ms.core-3.1.9.js.map +0 -1
- package/bundle/ms.core-3.1.9.min.js +0 -7
- package/bundle/ms.core-3.1.9.min.js.map +0 -1
package/dist-esm/src/Enums.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* 1DS JS SDK Core, 3.
|
|
2
|
+
* 1DS JS SDK Core, 3.2.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -10,78 +10,32 @@
|
|
|
10
10
|
* File containing the enums as constants.
|
|
11
11
|
*/
|
|
12
12
|
import { __assignFn as __assign } from "@microsoft/applicationinsights-shims";
|
|
13
|
-
import { _InternalMessageId } from "@microsoft/applicationinsights-core-js";
|
|
13
|
+
import { _InternalMessageId, createEnumStyle, objFreeze } from "@microsoft/applicationinsights-core-js";
|
|
14
14
|
/**
|
|
15
15
|
* The ValueKind contains a set of values that specify value kind of the property.
|
|
16
16
|
* Either PII (Personal Identifiable Information) or customer content.
|
|
17
17
|
*/
|
|
18
|
-
export var ValueKind = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* An IPV6 Internet address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
|
|
37
|
-
*/
|
|
38
|
-
Pii_IPv6Address: 4,
|
|
39
|
-
/**
|
|
40
|
-
* The Subject of an e-mail message.
|
|
41
|
-
*/
|
|
42
|
-
Pii_MailSubject: 5,
|
|
43
|
-
/**
|
|
44
|
-
* A telephone number.
|
|
45
|
-
*/
|
|
46
|
-
Pii_PhoneNumber: 6,
|
|
47
|
-
/**
|
|
48
|
-
* A query string.
|
|
49
|
-
*/
|
|
50
|
-
Pii_QueryString: 7,
|
|
51
|
-
/**
|
|
52
|
-
* An SIP (Session Internet Protocol) address.
|
|
53
|
-
*/
|
|
54
|
-
Pii_SipAddress: 8,
|
|
55
|
-
/**
|
|
56
|
-
* An e-mail address.
|
|
57
|
-
*/
|
|
58
|
-
Pii_SmtpAddress: 9,
|
|
59
|
-
/**
|
|
60
|
-
* An user ID.
|
|
61
|
-
*/
|
|
62
|
-
Pii_Identity: 10,
|
|
63
|
-
/**
|
|
64
|
-
* A URI (Uniform Resource Identifier).
|
|
65
|
-
*/
|
|
66
|
-
Pii_Uri: 11,
|
|
67
|
-
/**
|
|
68
|
-
* The fully-qualified domain name.
|
|
69
|
-
*/
|
|
70
|
-
Pii_Fqdn: 12,
|
|
71
|
-
/**
|
|
72
|
-
* Scrubs the last octet in a IPV4 Internet address.
|
|
73
|
-
* For example: 10.121.227.147 becomes 10.121.227.*
|
|
74
|
-
*/
|
|
75
|
-
Pii_IPV4AddressLegacy: 13,
|
|
76
|
-
/**
|
|
77
|
-
* Generic content.
|
|
78
|
-
*/
|
|
79
|
-
CustomerContent_GenericContent: 32
|
|
80
|
-
};
|
|
18
|
+
export var ValueKind = createEnumStyle({
|
|
19
|
+
NotSet: 0 /* NotSet */,
|
|
20
|
+
Pii_DistinguishedName: 1 /* Pii_DistinguishedName */,
|
|
21
|
+
Pii_GenericData: 2 /* Pii_GenericData */,
|
|
22
|
+
Pii_IPV4Address: 3 /* Pii_IPV4Address */,
|
|
23
|
+
Pii_IPv6Address: 4 /* Pii_IPv6Address */,
|
|
24
|
+
Pii_MailSubject: 5 /* Pii_MailSubject */,
|
|
25
|
+
Pii_PhoneNumber: 6 /* Pii_PhoneNumber */,
|
|
26
|
+
Pii_QueryString: 7 /* Pii_QueryString */,
|
|
27
|
+
Pii_SipAddress: 8 /* Pii_SipAddress */,
|
|
28
|
+
Pii_SmtpAddress: 9 /* Pii_SmtpAddress */,
|
|
29
|
+
Pii_Identity: 10 /* Pii_Identity */,
|
|
30
|
+
Pii_Uri: 11 /* Pii_Uri */,
|
|
31
|
+
Pii_Fqdn: 12 /* Pii_Fqdn */,
|
|
32
|
+
Pii_IPV4AddressLegacy: 13 /* Pii_IPV4AddressLegacy */,
|
|
33
|
+
CustomerContent_GenericContent: 32 /* CustomerContent_GenericContent */
|
|
34
|
+
});
|
|
81
35
|
/**
|
|
82
36
|
* The EventLatency contains a set of values that specify the latency with which an event is sent.
|
|
83
37
|
*/
|
|
84
|
-
export var EventLatency = {
|
|
38
|
+
export var EventLatency = createEnumStyle({
|
|
85
39
|
/**
|
|
86
40
|
* Normal latency.
|
|
87
41
|
*/
|
|
@@ -99,26 +53,26 @@ export var EventLatency = {
|
|
|
99
53
|
* Added in v3.1.1
|
|
100
54
|
*/
|
|
101
55
|
Immediate: 4 /* Immediate */
|
|
102
|
-
};
|
|
56
|
+
});
|
|
103
57
|
/**
|
|
104
58
|
* Enum for property types.
|
|
105
59
|
*/
|
|
106
|
-
export var EventPropertyType = {
|
|
107
|
-
Unspecified: 0
|
|
108
|
-
String: 1
|
|
109
|
-
Int32: 2
|
|
110
|
-
UInt32: 3
|
|
111
|
-
Int64: 4
|
|
112
|
-
UInt64: 5
|
|
113
|
-
Double: 6
|
|
114
|
-
Bool: 7
|
|
115
|
-
Guid: 8
|
|
116
|
-
DateTime: 9
|
|
117
|
-
};
|
|
60
|
+
export var EventPropertyType = createEnumStyle({
|
|
61
|
+
Unspecified: 0 /* Unspecified */,
|
|
62
|
+
String: 1 /* String */,
|
|
63
|
+
Int32: 2 /* Int32 */,
|
|
64
|
+
UInt32: 3 /* UInt32 */,
|
|
65
|
+
Int64: 4 /* Int64 */,
|
|
66
|
+
UInt64: 5 /* UInt64 */,
|
|
67
|
+
Double: 6 /* Double */,
|
|
68
|
+
Bool: 7 /* Bool */,
|
|
69
|
+
Guid: 8 /* Guid */,
|
|
70
|
+
DateTime: 9 /* DateTime */
|
|
71
|
+
});
|
|
118
72
|
/**
|
|
119
73
|
* The EventPersistence contains a set of values that specify the event's persistence.
|
|
120
74
|
*/
|
|
121
|
-
export var EventPersistence = {
|
|
75
|
+
export var EventPersistence = createEnumStyle({
|
|
122
76
|
/**
|
|
123
77
|
* Normal persistence.
|
|
124
78
|
*/
|
|
@@ -127,27 +81,33 @@ export var EventPersistence = {
|
|
|
127
81
|
* Critical persistence.
|
|
128
82
|
*/
|
|
129
83
|
Critical: 2 /* Critical */
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
84
|
+
});
|
|
85
|
+
export var TraceLevel = createEnumStyle({
|
|
86
|
+
NONE: 0 /* NONE */,
|
|
87
|
+
ERROR: 1 /* ERROR */,
|
|
88
|
+
WARNING: 2 /* WARNING */,
|
|
89
|
+
INFORMATION: 3 /* INFORMATION */
|
|
90
|
+
});
|
|
91
|
+
export var _ExtendedInternalMessageId = objFreeze(__assign(__assign({}, _InternalMessageId), createEnumStyle({
|
|
92
|
+
AuthHandShakeError: 501 /* AuthHandShakeError */,
|
|
93
|
+
AuthRedirectFail: 502 /* AuthRedirectFail */,
|
|
94
|
+
BrowserCannotReadLocalStorage: 503 /* BrowserCannotReadLocalStorage */,
|
|
95
|
+
BrowserCannotWriteLocalStorage: 504 /* BrowserCannotWriteLocalStorage */,
|
|
96
|
+
BrowserDoesNotSupportLocalStorage: 505 /* BrowserDoesNotSupportLocalStorage */,
|
|
97
|
+
CannotParseBiBlobValue: 506 /* CannotParseBiBlobValue */,
|
|
98
|
+
CannotParseDataAttribute: 507 /* CannotParseDataAttribute */,
|
|
99
|
+
CVPluginNotAvailable: 508 /* CVPluginNotAvailable */,
|
|
100
|
+
DroppedEvent: 509 /* DroppedEvent */,
|
|
101
|
+
ErrorParsingAISessionCookie: 510 /* ErrorParsingAISessionCookie */,
|
|
102
|
+
ErrorProvidedChannels: 511 /* ErrorProvidedChannels */,
|
|
103
|
+
FailedToGetCookies: 512 /* FailedToGetCookies */,
|
|
104
|
+
FailedToInitializeCorrelationVector: 513 /* FailedToInitializeCorrelationVector */,
|
|
105
|
+
FailedToInitializeSDK: 514 /* FailedToInitializeSDK */,
|
|
106
|
+
InvalidContentBlob: 515 /* InvalidContentBlob */,
|
|
107
|
+
InvalidCorrelationValue: 516 /* InvalidCorrelationValue */,
|
|
108
|
+
SessionRenewalDateIsZero: 517 /* SessionRenewalDateIsZero */,
|
|
109
|
+
SendPostOnCompleteFailure: 518 /* SendPostOnCompleteFailure */,
|
|
110
|
+
PostResponseHandler: 519 /* PostResponseHandler */,
|
|
111
|
+
SDKNotInitialized: 520 /* SDKNotInitialized */
|
|
112
|
+
})));
|
|
153
113
|
//# sourceMappingURL=Enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Enums.js.map","sources":["Enums.js"],"sourcesContent":["/**\r\n * Enums.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File containing the enums as constants.\r\n */\r\nimport { __assign } from \"tslib\";\r\nimport { _InternalMessageId } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * The ValueKind contains a set of values that specify value kind of the property.\r\n * Either PII (Personal Identifiable Information) or customer content.\r\n */\r\nexport var ValueKind = {\r\n
|
|
1
|
+
{"version":3,"file":"Enums.js.map","sources":["Enums.js"],"sourcesContent":["/**\r\n * Enums.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File containing the enums as constants.\r\n */\r\nimport { __assign } from \"tslib\";\r\nimport { _InternalMessageId, createEnumStyle, objFreeze } from \"@microsoft/applicationinsights-core-js\";\r\n/**\r\n * The ValueKind contains a set of values that specify value kind of the property.\r\n * Either PII (Personal Identifiable Information) or customer content.\r\n */\r\nexport var ValueKind = createEnumStyle({\r\n NotSet: 0 /* NotSet */,\r\n Pii_DistinguishedName: 1 /* Pii_DistinguishedName */,\r\n Pii_GenericData: 2 /* Pii_GenericData */,\r\n Pii_IPV4Address: 3 /* Pii_IPV4Address */,\r\n Pii_IPv6Address: 4 /* Pii_IPv6Address */,\r\n Pii_MailSubject: 5 /* Pii_MailSubject */,\r\n Pii_PhoneNumber: 6 /* Pii_PhoneNumber */,\r\n Pii_QueryString: 7 /* Pii_QueryString */,\r\n Pii_SipAddress: 8 /* Pii_SipAddress */,\r\n Pii_SmtpAddress: 9 /* Pii_SmtpAddress */,\r\n Pii_Identity: 10 /* Pii_Identity */,\r\n Pii_Uri: 11 /* Pii_Uri */,\r\n Pii_Fqdn: 12 /* Pii_Fqdn */,\r\n Pii_IPV4AddressLegacy: 13 /* Pii_IPV4AddressLegacy */,\r\n CustomerContent_GenericContent: 32 /* CustomerContent_GenericContent */\r\n});\r\n/**\r\n * The EventLatency contains a set of values that specify the latency with which an event is sent.\r\n */\r\nexport var EventLatency = createEnumStyle({\r\n /**\r\n * Normal latency.\r\n */\r\n Normal: 1 /* Normal */,\r\n /**\r\n * Cost deferred latency. At the moment this latency is treated as Normal latency.\r\n */\r\n CostDeferred: 2 /* CostDeferred */,\r\n /**\r\n * Real time latency.\r\n */\r\n RealTime: 3 /* RealTime */,\r\n /**\r\n * Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.\r\n * Added in v3.1.1\r\n */\r\n Immediate: 4 /* Immediate */\r\n});\r\n/**\r\n * Enum for property types.\r\n */\r\nexport var EventPropertyType = createEnumStyle({\r\n Unspecified: 0 /* Unspecified */,\r\n String: 1 /* String */,\r\n Int32: 2 /* Int32 */,\r\n UInt32: 3 /* UInt32 */,\r\n Int64: 4 /* Int64 */,\r\n UInt64: 5 /* UInt64 */,\r\n Double: 6 /* Double */,\r\n Bool: 7 /* Bool */,\r\n Guid: 8 /* Guid */,\r\n DateTime: 9 /* DateTime */\r\n});\r\n/**\r\n * The EventPersistence contains a set of values that specify the event's persistence.\r\n */\r\nexport var EventPersistence = createEnumStyle({\r\n /**\r\n * Normal persistence.\r\n */\r\n Normal: 1 /* Normal */,\r\n /**\r\n * Critical persistence.\r\n */\r\n Critical: 2 /* Critical */\r\n});\r\nexport var TraceLevel = createEnumStyle({\r\n NONE: 0 /* NONE */,\r\n ERROR: 1 /* ERROR */,\r\n WARNING: 2 /* WARNING */,\r\n INFORMATION: 3 /* INFORMATION */\r\n});\r\nexport var _ExtendedInternalMessageId = objFreeze(__assign(__assign({}, _InternalMessageId), createEnumStyle({\r\n AuthHandShakeError: 501 /* AuthHandShakeError */,\r\n AuthRedirectFail: 502 /* AuthRedirectFail */,\r\n BrowserCannotReadLocalStorage: 503 /* BrowserCannotReadLocalStorage */,\r\n BrowserCannotWriteLocalStorage: 504 /* BrowserCannotWriteLocalStorage */,\r\n BrowserDoesNotSupportLocalStorage: 505 /* BrowserDoesNotSupportLocalStorage */,\r\n CannotParseBiBlobValue: 506 /* CannotParseBiBlobValue */,\r\n CannotParseDataAttribute: 507 /* CannotParseDataAttribute */,\r\n CVPluginNotAvailable: 508 /* CVPluginNotAvailable */,\r\n DroppedEvent: 509 /* DroppedEvent */,\r\n ErrorParsingAISessionCookie: 510 /* ErrorParsingAISessionCookie */,\r\n ErrorProvidedChannels: 511 /* ErrorProvidedChannels */,\r\n FailedToGetCookies: 512 /* FailedToGetCookies */,\r\n FailedToInitializeCorrelationVector: 513 /* FailedToInitializeCorrelationVector */,\r\n FailedToInitializeSDK: 514 /* FailedToInitializeSDK */,\r\n InvalidContentBlob: 515 /* InvalidContentBlob */,\r\n InvalidCorrelationValue: 516 /* InvalidCorrelationValue */,\r\n SessionRenewalDateIsZero: 517 /* SessionRenewalDateIsZero */,\r\n SendPostOnCompleteFailure: 518 /* SendPostOnCompleteFailure */,\r\n PostResponseHandler: 519 /* PostResponseHandler */,\r\n SDKNotInitialized: 520 /* SDKNotInitialized */\r\n})));\r\n//# sourceMappingURL=Enums.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8EAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-esm/src/Index.d.ts
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* @copyright Microsoft 2018
|
|
5
5
|
* File to export public classes, interfaces and enums.
|
|
6
6
|
*/
|
|
7
|
-
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType, TransportType, EventLatencyValue, EventPersistenceValue, EventSendType } from "./Enums";
|
|
7
|
+
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, _eExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType, TransportType, EventLatencyValue, EventPersistenceValue, EventSendType } from "./Enums";
|
|
8
8
|
import { IExtendedConfiguration, IPropertyStorageOverride, IEventProperty, IExtendedTelemetryItem, IExtendedAppInsightsCore, IEventTiming, IValueSanitizer, FieldValueSanitizerFunc, IFieldSanitizerDetails, IFieldValueSanitizerProvider, FieldValueSanitizerTypes } from "./DataModels";
|
|
9
9
|
import AppInsightsCore from "./AppInsightsCore";
|
|
10
10
|
import BaseCore from "./BaseCore";
|
|
11
11
|
import ESPromise, { ESPromiseOnResolvedFunc, ESPromiseOnRejectedFunc, ResolverResolveFunc, ResolverRejectFunc } from "./ESPromise";
|
|
12
12
|
import ESPromiseScheduler, { ESPromiseSchedulerEvent } from "./ESPromiseScheduler";
|
|
13
13
|
import { ValueSanitizer } from "./ValueSanitizer";
|
|
14
|
-
export { ValueKind, IExtendedConfiguration, IPropertyStorageOverride, EventLatency, EventPersistence, TraceLevel, IEventProperty, IExtendedTelemetryItem, TransportType, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, IExtendedAppInsightsCore, EventPropertyType, IEventTiming, ESPromise, ESPromiseOnResolvedFunc, ESPromiseOnRejectedFunc, ResolverResolveFunc, ResolverRejectFunc, ESPromiseScheduler, ESPromiseSchedulerEvent, GuidStyle, FieldValueSanitizerFunc, FieldValueSanitizerType, FieldValueSanitizerTypes, IFieldSanitizerDetails, IFieldValueSanitizerProvider, IValueSanitizer, ValueSanitizer, EventLatencyValue, EventPersistenceValue, EventSendType };
|
|
15
|
-
export { IAppInsightsCore, IChannelControls, IPlugin, INotificationManager, NotificationManager, INotificationListener, IConfiguration, ITelemetryItem, ITelemetryPlugin, BaseTelemetryPlugin, IProcessTelemetryContext, ProcessTelemetryContext, ITelemetryPluginChain, MinChannelPriorty, EventsDiscardedReason, ICoreUtils, IDiagnosticLogger, DiagnosticLogger, LoggingSeverity, SendRequestReason, IPerfEvent, IPerfManager, IPerfManagerProvider, PerfEvent, PerfManager, doPerf, ICustomProperties, Tags, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId,
|
|
14
|
+
export { ValueKind, IExtendedConfiguration, IPropertyStorageOverride, EventLatency, EventPersistence, TraceLevel, IEventProperty, IExtendedTelemetryItem, TransportType, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, _eExtendedInternalMessageId, IExtendedAppInsightsCore, EventPropertyType, IEventTiming, ESPromise, ESPromiseOnResolvedFunc, ESPromiseOnRejectedFunc, ResolverResolveFunc, ResolverRejectFunc, ESPromiseScheduler, ESPromiseSchedulerEvent, GuidStyle, FieldValueSanitizerFunc, FieldValueSanitizerType, FieldValueSanitizerTypes, IFieldSanitizerDetails, IFieldValueSanitizerProvider, IValueSanitizer, ValueSanitizer, EventLatencyValue, EventPersistenceValue, EventSendType };
|
|
15
|
+
export { IAppInsightsCore, IChannelControls, IPlugin, INotificationManager, NotificationManager, INotificationListener, IConfiguration, ITelemetryItem, ITelemetryPlugin, BaseTelemetryPlugin, IProcessTelemetryContext, ProcessTelemetryContext, ITelemetryPluginChain, MinChannelPriorty, EventsDiscardedReason, ICoreUtils, IDiagnosticLogger, DiagnosticLogger, LoggingSeverity, SendRequestReason, IPerfEvent, IPerfManager, IPerfManagerProvider, PerfEvent, PerfManager, doPerf, ICustomProperties, Tags, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, createEnumStyle, eLoggingSeverity, _eInternalMessageId, _throwInternal, // _warnToConsole, _logInternalMessage
|
|
16
|
+
isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal, getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined, randomValue, random32, ICookieMgr, ICookieMgrConfig, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr, toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, _IRegisteredEvents, __getRegisteredEvents, TelemetryInitializerFunction, ITelemetryInitializerHandler, ITelemetryInitializerContainer, createProcessTelemetryContext, IProcessTelemetryUnloadContext, UnloadHandler, IUnloadHandlerContainer, ITelemetryUnloadState, createUnloadHandlerContainer, TelemetryUnloadReason, ITelemetryUpdateState, IUnloadableComponent } from "@microsoft/applicationinsights-core-js";
|
|
16
17
|
export { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version for tree-shaking
|
|
17
18
|
Utils, // Replacement for import * as Utils from "./Utils";
|
|
18
19
|
isChromium, // Replace with ai-core version once published in ai-core
|
package/dist-esm/src/Index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* 1DS JS SDK Core, 3.
|
|
2
|
+
* 1DS JS SDK Core, 3.2.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -16,17 +16,15 @@ import ESPromise from "./ESPromise";
|
|
|
16
16
|
import ESPromiseScheduler from "./ESPromiseScheduler";
|
|
17
17
|
import { ValueSanitizer } from "./ValueSanitizer";
|
|
18
18
|
export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer };
|
|
19
|
-
export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId,
|
|
19
|
+
export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, createEnumStyle, _throwInternal, // _warnToConsole, _logInternalMessage
|
|
20
20
|
// The HelperFuncs functions
|
|
21
|
-
isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger,
|
|
21
|
+
isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal,
|
|
22
22
|
// EnvUtils
|
|
23
23
|
getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined,
|
|
24
24
|
// Random
|
|
25
25
|
randomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr,
|
|
26
|
-
// Constants
|
|
27
|
-
strIKey, strExtensionConfig,
|
|
28
26
|
// Aliases
|
|
29
|
-
toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener } from "@microsoft/applicationinsights-core-js";
|
|
27
|
+
toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer } from "@microsoft/applicationinsights-core-js";
|
|
30
28
|
export { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version for tree-shaking
|
|
31
29
|
Utils, // Replacement for import * as Utils from "./Utils";
|
|
32
30
|
isChromium, // Replace with ai-core version once published in ai-core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js.map","sources":["Index.js"],"sourcesContent":["/**\r\n * Index.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File to export public classes, interfaces and enums.\r\n */\r\nimport { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId } from \"./Enums\";\r\nimport AppInsightsCore from \"./AppInsightsCore\";\r\nimport BaseCore from \"./BaseCore\";\r\nimport ESPromise from \"./ESPromise\";\r\nimport ESPromiseScheduler from \"./ESPromiseScheduler\";\r\nimport { ValueSanitizer } from \"./ValueSanitizer\";\r\nexport { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer };\r\nexport { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, \r\n// The HelperFuncs functions\r\nisTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, \r\n// EnvUtils\r\ngetGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined, \r\n// Random\r\nrandomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr, \r\n//
|
|
1
|
+
{"version":3,"file":"Index.js.map","sources":["Index.js"],"sourcesContent":["/**\r\n * Index.ts\r\n * @author Abhilash Panwar (abpanwar)\r\n * @copyright Microsoft 2018\r\n * File to export public classes, interfaces and enums.\r\n */\r\nimport { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId } from \"./Enums\";\r\nimport AppInsightsCore from \"./AppInsightsCore\";\r\nimport BaseCore from \"./BaseCore\";\r\nimport ESPromise from \"./ESPromise\";\r\nimport ESPromiseScheduler from \"./ESPromiseScheduler\";\r\nimport { ValueSanitizer } from \"./ValueSanitizer\";\r\nexport { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer };\r\nexport { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, createEnumStyle, _throwInternal, // _warnToConsole, _logInternalMessage\r\n// The HelperFuncs functions\r\nisTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal, \r\n// EnvUtils\r\ngetGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined, \r\n// Random\r\nrandomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr, \r\n// Aliases\r\ntoISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer } from \"@microsoft/applicationinsights-core-js\";\r\nexport { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version for tree-shaking\r\nUtils, // Replacement for import * as Utils from \"./Utils\";\r\nisChromium, // Replace with ai-core version once published in ai-core\r\nopenXhr } from \"./Utils\";\r\n//# sourceMappingURL=Index.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-esm/src/Utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IEventProperty } from "./DataModels";
|
|
2
2
|
import { GuidStyle, FieldValueSanitizerType, EventLatency } from "./Enums";
|
|
3
|
-
import { ITelemetryItem, objForEachKey, isNumber, isReactNative, isString, isBoolean,
|
|
4
|
-
export declare const Version = "3.
|
|
3
|
+
import { ITelemetryItem, objForEachKey, isNumber, isReactNative, isString, isBoolean, isObject, perfNow, addEventHandler, uaDisallowsSameSiteNone, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, areCookiesSupported, ICookieMgr, ICoreUtils, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener } from "@microsoft/applicationinsights-core-js";
|
|
4
|
+
export declare const Version = "3.2.0";
|
|
5
5
|
export declare const FullVersionString: string;
|
|
6
6
|
/**
|
|
7
7
|
* Checks if document object is available
|
|
@@ -34,7 +34,7 @@ export declare function isUint8ArrayAvailable(): boolean;
|
|
|
34
34
|
* @param value - The value that needs to be checked.
|
|
35
35
|
* @returns True if the value is in AWTEventLatency, false otherwise.
|
|
36
36
|
*/
|
|
37
|
-
export declare function isLatency(value:
|
|
37
|
+
export declare function isLatency(value: EventLatency | undefined): boolean;
|
|
38
38
|
/**
|
|
39
39
|
* Sanitizes the Property. It checks the that the property name and value are valid. It also
|
|
40
40
|
* checks/populates the correct type and pii of the property value.
|
|
@@ -127,7 +127,7 @@ export declare const Utils: {
|
|
|
127
127
|
isNumber: typeof isNumber;
|
|
128
128
|
isBoolean: typeof isBoolean;
|
|
129
129
|
isFunction: typeof isFunction;
|
|
130
|
-
isArray:
|
|
130
|
+
isArray: <T = any>(obj: any) => obj is T[];
|
|
131
131
|
isObject: typeof isObject;
|
|
132
132
|
strTrim: typeof strTrim;
|
|
133
133
|
isDocumentObjectAvailable: boolean;
|
|
@@ -178,6 +178,7 @@ export declare function isChromium(): boolean;
|
|
|
178
178
|
* @param withCredentials - Option flag indicating that credentials should be sent
|
|
179
179
|
* @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)
|
|
180
180
|
* @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)
|
|
181
|
+
* @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request
|
|
181
182
|
* @returns A new opened XHR request
|
|
182
183
|
*/
|
|
183
|
-
export declare function openXhr(method: string, urlString: string, withCredentials?: boolean, disabled?: boolean, isSync?: boolean): XMLHttpRequest;
|
|
184
|
+
export declare function openXhr(method: string, urlString: string, withCredentials?: boolean, disabled?: boolean, isSync?: boolean, timeout?: number): XMLHttpRequest;
|
package/dist-esm/src/Utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* 1DS JS SDK Core, 3.
|
|
2
|
+
* 1DS JS SDK Core, 3.2.0
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
* (Microsoft Internal Only)
|
|
5
5
|
*/
|
|
@@ -11,22 +11,22 @@ var _a;
|
|
|
11
11
|
* File containing utility functions.
|
|
12
12
|
*/
|
|
13
13
|
import { objCreateFn, strShimObject } from "@microsoft/applicationinsights-shims";
|
|
14
|
-
import { EventPropertyType, ValueKind, EventLatency } from "./Enums";
|
|
15
14
|
import { getDocument, getNavigator, getWindow, getGlobalInst, objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray, newGuid, isObject, perfNow, hasOwnProperty, addEventHandler, uaDisallowsSameSiteNone, strPrototype, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, strUndefined, strObject, areCookiesSupported, safeGetCookieMgr, generateW3CId, mwcRandom32, mwcRandomSeed, random32, randomValue, newId, isIE, dateNow, isError, isDate, isTypeof, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener, } from "@microsoft/applicationinsights-core-js";
|
|
16
|
-
export var Version = '3.
|
|
15
|
+
export var Version = '3.2.0';
|
|
17
16
|
export var FullVersionString = "1DS-Web-JS-" + Version;
|
|
18
17
|
// Defining here so we don't need to take (import) the ApplicationInsights Common module
|
|
19
18
|
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
20
19
|
var strWithCredentials = "withCredentials";
|
|
20
|
+
var strTimeout = "timeout";
|
|
21
21
|
// If value is array just get the type for the first element
|
|
22
22
|
var _fieldTypeEventPropMap = (_a = {},
|
|
23
|
-
_a[0 /* NotSet */] =
|
|
24
|
-
_a[2 /* Number */] =
|
|
25
|
-
_a[1 /* String */] =
|
|
26
|
-
_a[3 /* Boolean */] =
|
|
27
|
-
_a[4096 /* Array */ | 2 /* Number */] =
|
|
28
|
-
_a[4096 /* Array */ | 1 /* String */] =
|
|
29
|
-
_a[4096 /* Array */ | 3 /* Boolean */] =
|
|
23
|
+
_a[0 /* NotSet */] = 0 /* Unspecified */,
|
|
24
|
+
_a[2 /* Number */] = 6 /* Double */,
|
|
25
|
+
_a[1 /* String */] = 1 /* String */,
|
|
26
|
+
_a[3 /* Boolean */] = 7 /* Bool */,
|
|
27
|
+
_a[4096 /* Array */ | 2 /* Number */] = 6 /* Double */,
|
|
28
|
+
_a[4096 /* Array */ | 1 /* String */] = 1 /* String */,
|
|
29
|
+
_a[4096 /* Array */ | 3 /* Boolean */] = 7 /* Bool */,
|
|
30
30
|
_a);
|
|
31
31
|
/**
|
|
32
32
|
* @ignore
|
|
@@ -84,7 +84,7 @@ export function isUint8ArrayAvailable() {
|
|
|
84
84
|
* @returns True if the value is in AWTEventLatency, false otherwise.
|
|
85
85
|
*/
|
|
86
86
|
export function isLatency(value) {
|
|
87
|
-
if (value && isNumber(value) && value >=
|
|
87
|
+
if (value && isNumber(value) && value >= 1 /* Normal */ && value <= 4 /* Immediate */) {
|
|
88
88
|
return true;
|
|
89
89
|
}
|
|
90
90
|
return false;
|
|
@@ -162,7 +162,7 @@ export function getCommonSchemaMetaData(value, kind, type) {
|
|
|
162
162
|
// pii exists so we must return correct type
|
|
163
163
|
encodedTypeValue |= propType;
|
|
164
164
|
}
|
|
165
|
-
else if (propType ===
|
|
165
|
+
else if (propType === 6 /* Double */) {
|
|
166
166
|
encodedTypeValue = propType;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -306,7 +306,7 @@ export function extend(obj, obj2, obj3, obj4, obj5) {
|
|
|
306
306
|
export var getTime = perfNow;
|
|
307
307
|
export function isValueKind(value) {
|
|
308
308
|
// Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization
|
|
309
|
-
if (value ===
|
|
309
|
+
if (value === 0 /* NotSet */ || ((value > 0 /* NotSet */ && value <= 13 /* Pii_IPV4AddressLegacy */) || value === 32 /* CustomerContent_GenericContent */)) {
|
|
310
310
|
return true;
|
|
311
311
|
}
|
|
312
312
|
return false;
|
|
@@ -478,9 +478,10 @@ export function isChromium() {
|
|
|
478
478
|
* @param withCredentials - Option flag indicating that credentials should be sent
|
|
479
479
|
* @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)
|
|
480
480
|
* @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)
|
|
481
|
+
* @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request
|
|
481
482
|
* @returns A new opened XHR request
|
|
482
483
|
*/
|
|
483
|
-
export function openXhr(method, urlString, withCredentials, disabled, isSync) {
|
|
484
|
+
export function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {
|
|
484
485
|
if (disabled === void 0) { disabled = false; }
|
|
485
486
|
if (isSync === void 0) { isSync = false; }
|
|
486
487
|
function _wrapSetXhrProp(xhr, prop, value) {
|
|
@@ -509,6 +510,12 @@ export function openXhr(method, urlString, withCredentials, disabled, isSync) {
|
|
|
509
510
|
// And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing
|
|
510
511
|
_wrapSetXhrProp(xhr, strWithCredentials, withCredentials);
|
|
511
512
|
}
|
|
513
|
+
// Only set the timeout for asynchronous requests as
|
|
514
|
+
// "Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.""
|
|
515
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout
|
|
516
|
+
if (!isSync && timeout) {
|
|
517
|
+
_wrapSetXhrProp(xhr, strTimeout, timeout);
|
|
518
|
+
}
|
|
512
519
|
return xhr;
|
|
513
520
|
}
|
|
514
521
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js.map","sources":["Utils.js"],"sourcesContent":["var _a;\r\n/**\r\n * Utils.ts\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n * File containing utility functions.\r\n */\r\nimport { objCreateFn, strShimObject } from \"@microsoft/applicationinsights-shims\";\r\nimport { EventPropertyType, ValueKind, EventLatency } from \"./Enums\";\r\nimport { getDocument, getNavigator, getWindow, getGlobalInst, objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray, newGuid, isObject, perfNow, hasOwnProperty, addEventHandler, uaDisallowsSameSiteNone, strPrototype, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, strUndefined, strObject, areCookiesSupported, safeGetCookieMgr, generateW3CId, mwcRandom32, mwcRandomSeed, random32, randomValue, newId, isIE, dateNow, isError, isDate, isTypeof, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener, } from \"@microsoft/applicationinsights-core-js\";\r\nexport var Version = '3.1.9';\r\nexport var FullVersionString = \"1DS-Web-JS-\" + Version;\r\n// Defining here so we don't need to take (import) the ApplicationInsights Common module\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\n// If value is array just get the type for the first element\r\nvar _fieldTypeEventPropMap = (_a = {},\r\n _a[0 /* NotSet */] = EventPropertyType.Unspecified,\r\n _a[2 /* Number */] = EventPropertyType.Double,\r\n _a[1 /* String */] = EventPropertyType.String,\r\n _a[3 /* Boolean */] = EventPropertyType.Bool,\r\n _a[4096 /* Array */ | 2 /* Number */] = EventPropertyType.Double,\r\n _a[4096 /* Array */ | 1 /* String */] = EventPropertyType.String,\r\n _a[4096 /* Array */ | 3 /* Boolean */] = EventPropertyType.Bool,\r\n _a);\r\n/**\r\n * @ignore\r\n */\r\n// let _uaDisallowsSameSiteNone = null;\r\nvar uInt8ArraySupported = null;\r\n// var _areCookiesAvailable: boolean | undefined;\r\n/**\r\n * Checks if document object is available\r\n */\r\nexport var isDocumentObjectAvailable = Boolean(getDocument());\r\n/**\r\n * Checks if window object is available\r\n */\r\nexport var isWindowObjectAvailable = Boolean(getWindow());\r\n/**\r\n * Checks if value is assigned to the given param.\r\n * @param value - The token from which the tenant id is to be extracted.\r\n * @returns True/false denoting if value is assigned to the param.\r\n */\r\nexport function isValueAssigned(value) {\r\n /// <summary> takes a value and checks for undefined, null and empty string </summary>\r\n /// <param type=\"any\"> value to be tested </param>\r\n /// <returns> true if value is null undefined or emptyString </returns>\r\n return !(value === \"\" || isNullOrUndefined(value));\r\n}\r\n/**\r\n * Gets the tenant id from the tenant token.\r\n * @param apiKey - The token from which the tenant id is to be extracted.\r\n * @returns The tenant id.\r\n */\r\nexport function getTenantId(apiKey) {\r\n if (apiKey) {\r\n var indexTenantId = apiKey.indexOf(\"-\");\r\n if (indexTenantId > -1) {\r\n return apiKey.substring(0, indexTenantId);\r\n }\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Checks if Uint8Array are available in the current environment. Safari and Firefox along with\r\n * ReactNative are known to not support Uint8Array properly.\r\n * @returns True if available, false otherwise.\r\n */\r\nexport function isUint8ArrayAvailable() {\r\n if (uInt8ArraySupported === null) {\r\n uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();\r\n }\r\n return uInt8ArraySupported;\r\n}\r\n/**\r\n * Checks if the value is a valid EventLatency.\r\n * @param value - The value that needs to be checked.\r\n * @returns True if the value is in AWTEventLatency, false otherwise.\r\n */\r\nexport function isLatency(value) {\r\n if (value && isNumber(value) && value >= EventLatency.Normal && value <= EventLatency.Immediate) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Sanitizes the Property. It checks the that the property name and value are valid. It also\r\n * checks/populates the correct type and pii of the property value.\r\n * @param name - property name - The property name.\r\n * @param property - The property value or an IEventProperty containing value,\r\n * type ,pii and customer content.\r\n * @returns IEventProperty containing valid name, value, pii and type or null if invalid.\r\n */\r\nexport function sanitizeProperty(name, property, stringifyObjects) {\r\n // Check that property is valid\r\n if ((!property && !isValueAssigned(property)) || typeof name !== \"string\") {\r\n return null;\r\n }\r\n // Perf optimization -- only need to get the type once not multiple times\r\n var propType = typeof property;\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n if (propType === \"string\" || propType === \"number\" || propType === \"boolean\" || isArray(property)) {\r\n property = { value: property };\r\n }\r\n else if (propType === \"object\" && !property.hasOwnProperty(\"value\")) {\r\n property = { value: stringifyObjects ? JSON.stringify(property) : property };\r\n }\r\n else if (isNullOrUndefined(property.value)\r\n || property.value === \"\" || (!isString(property.value)\r\n && !isNumber(property.value) && !isBoolean(property.value)\r\n && !isArray(property.value))) {\r\n // Since property is IEventProperty, we need to validate its value\r\n return null;\r\n }\r\n // We need to check that if the property value is an array, it is valid\r\n if (isArray(property.value) &&\r\n !isArrayValid(property.value)) {\r\n return null;\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if (isArray(property.value) || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n property.value = property.value.toString();\r\n }\r\n return property;\r\n}\r\nexport function getCommonSchemaMetaData(value, kind, type) {\r\n var encodedTypeValue = -1;\r\n if (!isUndefined(value)) {\r\n if (kind > 0) {\r\n if (kind === 32) {\r\n // encode customer content. Value can only be string. bit 13-16 are for cc\r\n encodedTypeValue = (1 << 13);\r\n }\r\n else if (kind <= 13) {\r\n // encode PII. Value can only be string. bits 5-12 are for Pii\r\n encodedTypeValue = (kind << 5);\r\n }\r\n }\r\n // isDataType checks that the \"type\" is a number so we don't need to check for undefined\r\n if (isDataType(type)) {\r\n // Data Type is provided and valid, so use that\r\n if (encodedTypeValue === -1) {\r\n // Don't return -1\r\n encodedTypeValue = 0;\r\n }\r\n encodedTypeValue |= type;\r\n }\r\n else {\r\n var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;\r\n if (encodedTypeValue !== -1 && propType !== -1) {\r\n // pii exists so we must return correct type\r\n encodedTypeValue |= propType;\r\n }\r\n else if (propType === EventPropertyType.Double) {\r\n encodedTypeValue = propType;\r\n }\r\n }\r\n }\r\n return encodedTypeValue;\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().disable()\r\n * Force the SDK not to store and read any data from cookies.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport function disableCookies() {\r\n safeGetCookieMgr(null).setEnabled(false);\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().set()\r\n * Sets the value of a cookie.\r\n * @param name - Cookie name.\r\n * @param value - Cookie value.\r\n * @param days - Expiration days.\r\n */\r\nexport function setCookie(name, value, days) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).set(name, value, days * 86400, null, \"/\");\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().del()\r\n * Deletes a cookie, by setting its expiration to -1.\r\n * @param name - Cookie name to delete.\r\n */\r\nexport function deleteCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).del(name);\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().get()\r\n * Gets the cookie value for the specified cookie.\r\n * if value is k1=v1&k2==v2 then will return 'v1' for key 'k1'\r\n * @param cookieName - Cookie name.\r\n */\r\nexport function getCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n return getCookieValue(safeGetCookieMgr(null), name);\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Helper to get and decode the cookie value using decodeURIComponent, this is for historical\r\n * backward compatibility where the document.cookie value was decoded before parsing.\r\n * @param cookieMgr - The cookie manager to use\r\n * @param name - The name of the cookie to get\r\n * @param decode - A flag to indicate whether the cookie value should be decoded\r\n * @returns The decoded cookie value (if available) otherwise an empty string.\r\n */\r\nexport function getCookieValue(cookieMgr, name, decode) {\r\n if (decode === void 0) { decode = true; }\r\n var cookieValue;\r\n if (cookieMgr) {\r\n cookieValue = cookieMgr.get(name);\r\n if (decode && cookieValue && decodeURIComponent) {\r\n cookieValue = decodeURIComponent(cookieValue);\r\n }\r\n }\r\n return cookieValue || \"\";\r\n}\r\n/**\r\n * Create a new guid.\r\n * @param style - The style of guid to generated, defaults to Digits\r\n * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000\r\n * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}\r\n * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)\r\n * Numeric - 32 digits: 00000000000000000000000000000000\r\n * @returns The formatted guid.\r\n */\r\nexport function createGuid(style) {\r\n if (style === void 0) { style = \"D\" /* Digits */; }\r\n var theGuid = newGuid();\r\n if (style === \"B\" /* Braces */) {\r\n theGuid = \"{\" + theGuid + \"}\";\r\n }\r\n else if (style === \"P\" /* Parentheses */) {\r\n theGuid = \"(\" + theGuid + \")\";\r\n }\r\n else if (style === \"N\" /* Numeric */) {\r\n theGuid = theGuid.replace(/-/g, \"\");\r\n }\r\n return theGuid;\r\n}\r\n/**\r\n * Pass in the objects to merge as arguments.\r\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\r\n * @param obj2 - object to merge.\r\n * @param obj3 - object to merge.\r\n * @param obj4 - object to merge.\r\n * @param obj5 - object to merge.\r\n * @returns The extended object.\r\n */\r\nexport function extend(obj, obj2, obj3, obj4, obj5) {\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n var length = arguments.length;\r\n var objProto = Object[strPrototype];\r\n var theArgs = arguments;\r\n // Check if a deep merge\r\n if (objProto.toString.call(theArgs[0]) === \"[object Boolean]\") {\r\n deep = theArgs[0];\r\n i++;\r\n }\r\n // Loop through each object and conduct a merge\r\n for (; i < length; i++) {\r\n var obj = theArgs[i];\r\n objForEachKey(obj, function (prop, value) {\r\n // If deep merge and property is an object, merge properties\r\n if (deep && value && isObject(value)) {\r\n if (isArray(value)) {\r\n extended[prop] = extended[prop] || [];\r\n arrForEach(value, function (arrayValue, arrayIndex) {\r\n if (arrayValue && isObject(arrayValue)) {\r\n extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);\r\n }\r\n else {\r\n extended[prop][arrayIndex] = arrayValue;\r\n }\r\n });\r\n }\r\n else {\r\n extended[prop] = extend(true, extended[prop], value);\r\n }\r\n }\r\n else {\r\n extended[prop] = value;\r\n }\r\n });\r\n }\r\n return extended;\r\n}\r\nexport var getTime = perfNow;\r\nexport function isValueKind(value) {\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value === ValueKind.NotSet || ((value > ValueKind.NotSet && value <= ValueKind.Pii_IPV4AddressLegacy) || value === ValueKind.CustomerContent_GenericContent)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isDataType(value) {\r\n // Remark: 0 returns false, but it doesn't affect encoding anyways\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value >= 0 && value <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSafariOrFirefox() {\r\n var nav = getNavigator();\r\n // If non-browser navigator will be undefined\r\n if (!isUndefined(nav) && nav.userAgent) {\r\n var ua = nav.userAgent.toLowerCase();\r\n if ((ua.indexOf(\"safari\") >= 0 || ua.indexOf(\"firefox\") >= 0) && ua.indexOf(\"chrome\") < 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function isArrayValid(value) {\r\n return value.length > 0;\r\n}\r\nexport function setProcessTelemetryTimings(event, identifier) {\r\n var evt = event;\r\n evt.timings = evt.timings || {};\r\n evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};\r\n evt.timings.processTelemetryStart[identifier] = getTime();\r\n}\r\n/**\r\n * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value\r\n * @param value The value to determine the type\r\n */\r\nexport function getFieldValueType(value) {\r\n var theType = 0 /* NotSet */;\r\n if (value !== null && value !== undefined) {\r\n var objType = typeof value;\r\n if (objType === \"string\") {\r\n theType = 1 /* String */;\r\n }\r\n else if (objType === \"number\") {\r\n theType = 2 /* Number */;\r\n }\r\n else if (objType === \"boolean\") {\r\n theType = 3 /* Boolean */;\r\n }\r\n else if (objType === strShimObject) {\r\n theType = 4 /* Object */;\r\n if (isArray(value)) {\r\n theType = 4096 /* Array */;\r\n if (value.length > 0) {\r\n // Empty arrays are not supported and are considered to be the same as null\r\n theType |= getFieldValueType(value[0]);\r\n }\r\n }\r\n else if (hasOwnProperty(value, \"value\")) {\r\n // Looks like an IEventProperty\r\n theType = 8192 /* EventProperty */ | getFieldValueType(value.value);\r\n }\r\n }\r\n }\r\n return theType;\r\n}\r\nexport var Utils = {\r\n Version: Version,\r\n FullVersionString: FullVersionString,\r\n strUndefined: strUndefined,\r\n strObject: strObject,\r\n Undefined: strUndefined,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n objKeys: objKeys,\r\n toISOString: toISOString,\r\n isReactNative: isReactNative,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n isFunction: isFunction,\r\n isArray: isArray,\r\n isObject: isObject,\r\n strTrim: strTrim,\r\n isDocumentObjectAvailable: isDocumentObjectAvailable,\r\n isWindowObjectAvailable: isWindowObjectAvailable,\r\n isValueAssigned: isValueAssigned,\r\n getTenantId: getTenantId,\r\n isBeaconsSupported: isBeaconsSupported,\r\n isUint8ArrayAvailable: isUint8ArrayAvailable,\r\n isLatency: isLatency,\r\n sanitizeProperty: sanitizeProperty,\r\n getISOString: toISOString,\r\n useXDomainRequest: useXDomainRequest,\r\n getCommonSchemaMetaData: getCommonSchemaMetaData,\r\n cookieAvailable: areCookiesSupported,\r\n disallowsSameSiteNone: uaDisallowsSameSiteNone,\r\n setCookie: setCookie,\r\n deleteCookie: deleteCookie,\r\n getCookie: getCookie,\r\n createGuid: createGuid,\r\n extend: extend,\r\n getTime: getTime,\r\n isValueKind: isValueKind,\r\n isArrayValid: isArrayValid,\r\n objDefineAccessors: objDefineAccessors,\r\n addPageUnloadEventListener: addPageUnloadEventListener,\r\n setProcessTelemetryTimings: setProcessTelemetryTimings,\r\n addEventHandler: addEventHandler,\r\n getFieldValueType: getFieldValueType,\r\n strEndsWith: strEndsWith,\r\n objForEachKey: objForEachKey\r\n};\r\n/**\r\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\r\n * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions\r\n * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items\r\n * in your resulting code.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport var CoreUtils = {\r\n _canUseCookies: undefined,\r\n isTypeof: isTypeof,\r\n isUndefined: isUndefined,\r\n isNullOrUndefined: isNullOrUndefined,\r\n hasOwnProperty: hasOwnProperty,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n isDate: isDate,\r\n isArray: isArray,\r\n isError: isError,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n toISOString: toISOString,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n strTrim: strTrim,\r\n objCreate: objCreateFn,\r\n objKeys: objKeys,\r\n objDefineAccessors: objDefineAccessors,\r\n addEventHandler: addEventHandler,\r\n dateNow: dateNow,\r\n isIE: isIE,\r\n disableCookies: disableCookies,\r\n newGuid: newGuid,\r\n perfNow: perfNow,\r\n newId: newId,\r\n randomValue: randomValue,\r\n random32: random32,\r\n mwcRandomSeed: mwcRandomSeed,\r\n mwcRandom32: mwcRandom32,\r\n generateW3CId: generateW3CId\r\n};\r\n/**\r\n * Helper to identify whether we are running in a chromium based browser environment\r\n */\r\nexport function isChromium() {\r\n return !!getGlobalInst(\"chrome\");\r\n}\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n return xhr;\r\n}\r\n//# sourceMappingURL=Utils.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"Utils.js.map","sources":["Utils.js"],"sourcesContent":["var _a;\r\n/**\r\n * Utils.ts\r\n * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)\r\n * @copyright Microsoft 2018\r\n * File containing utility functions.\r\n */\r\nimport { objCreateFn, strShimObject } from \"@microsoft/applicationinsights-shims\";\r\nimport { getDocument, getNavigator, getWindow, getGlobalInst, objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray, newGuid, isObject, perfNow, hasOwnProperty, addEventHandler, uaDisallowsSameSiteNone, strPrototype, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, strUndefined, strObject, areCookiesSupported, safeGetCookieMgr, generateW3CId, mwcRandom32, mwcRandomSeed, random32, randomValue, newId, isIE, dateNow, isError, isDate, isTypeof, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener, } from \"@microsoft/applicationinsights-core-js\";\r\nexport var Version = '3.2.0';\r\nexport var FullVersionString = \"1DS-Web-JS-\" + Version;\r\n// Defining here so we don't need to take (import) the ApplicationInsights Common module\r\nvar strDisabledPropertyName = \"Microsoft_ApplicationInsights_BypassAjaxInstrumentation\";\r\nvar strWithCredentials = \"withCredentials\";\r\nvar strTimeout = \"timeout\";\r\n// If value is array just get the type for the first element\r\nvar _fieldTypeEventPropMap = (_a = {},\r\n _a[0 /* NotSet */] = 0 /* Unspecified */,\r\n _a[2 /* Number */] = 6 /* Double */,\r\n _a[1 /* String */] = 1 /* String */,\r\n _a[3 /* Boolean */] = 7 /* Bool */,\r\n _a[4096 /* Array */ | 2 /* Number */] = 6 /* Double */,\r\n _a[4096 /* Array */ | 1 /* String */] = 1 /* String */,\r\n _a[4096 /* Array */ | 3 /* Boolean */] = 7 /* Bool */,\r\n _a);\r\n/**\r\n * @ignore\r\n */\r\n// let _uaDisallowsSameSiteNone = null;\r\nvar uInt8ArraySupported = null;\r\n// var _areCookiesAvailable: boolean | undefined;\r\n/**\r\n * Checks if document object is available\r\n */\r\nexport var isDocumentObjectAvailable = Boolean(getDocument());\r\n/**\r\n * Checks if window object is available\r\n */\r\nexport var isWindowObjectAvailable = Boolean(getWindow());\r\n/**\r\n * Checks if value is assigned to the given param.\r\n * @param value - The token from which the tenant id is to be extracted.\r\n * @returns True/false denoting if value is assigned to the param.\r\n */\r\nexport function isValueAssigned(value) {\r\n /// <summary> takes a value and checks for undefined, null and empty string </summary>\r\n /// <param type=\"any\"> value to be tested </param>\r\n /// <returns> true if value is null undefined or emptyString </returns>\r\n return !(value === \"\" || isNullOrUndefined(value));\r\n}\r\n/**\r\n * Gets the tenant id from the tenant token.\r\n * @param apiKey - The token from which the tenant id is to be extracted.\r\n * @returns The tenant id.\r\n */\r\nexport function getTenantId(apiKey) {\r\n if (apiKey) {\r\n var indexTenantId = apiKey.indexOf(\"-\");\r\n if (indexTenantId > -1) {\r\n return apiKey.substring(0, indexTenantId);\r\n }\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Checks if Uint8Array are available in the current environment. Safari and Firefox along with\r\n * ReactNative are known to not support Uint8Array properly.\r\n * @returns True if available, false otherwise.\r\n */\r\nexport function isUint8ArrayAvailable() {\r\n if (uInt8ArraySupported === null) {\r\n uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();\r\n }\r\n return uInt8ArraySupported;\r\n}\r\n/**\r\n * Checks if the value is a valid EventLatency.\r\n * @param value - The value that needs to be checked.\r\n * @returns True if the value is in AWTEventLatency, false otherwise.\r\n */\r\nexport function isLatency(value) {\r\n if (value && isNumber(value) && value >= 1 /* Normal */ && value <= 4 /* Immediate */) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Sanitizes the Property. It checks the that the property name and value are valid. It also\r\n * checks/populates the correct type and pii of the property value.\r\n * @param name - property name - The property name.\r\n * @param property - The property value or an IEventProperty containing value,\r\n * type ,pii and customer content.\r\n * @returns IEventProperty containing valid name, value, pii and type or null if invalid.\r\n */\r\nexport function sanitizeProperty(name, property, stringifyObjects) {\r\n // Check that property is valid\r\n if ((!property && !isValueAssigned(property)) || typeof name !== \"string\") {\r\n return null;\r\n }\r\n // Perf optimization -- only need to get the type once not multiple times\r\n var propType = typeof property;\r\n // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.\r\n if (propType === \"string\" || propType === \"number\" || propType === \"boolean\" || isArray(property)) {\r\n property = { value: property };\r\n }\r\n else if (propType === \"object\" && !property.hasOwnProperty(\"value\")) {\r\n property = { value: stringifyObjects ? JSON.stringify(property) : property };\r\n }\r\n else if (isNullOrUndefined(property.value)\r\n || property.value === \"\" || (!isString(property.value)\r\n && !isNumber(property.value) && !isBoolean(property.value)\r\n && !isArray(property.value))) {\r\n // Since property is IEventProperty, we need to validate its value\r\n return null;\r\n }\r\n // We need to check that if the property value is an array, it is valid\r\n if (isArray(property.value) &&\r\n !isArrayValid(property.value)) {\r\n return null;\r\n }\r\n // If either pii or cc is set convert value to string (since only string pii/cc is allowed).\r\n // If the value is a complex type like an array that can't be converted to string we will drop\r\n // the property.\r\n if (!isNullOrUndefined(property.kind)) {\r\n if (isArray(property.value) || !isValueKind(property.kind)) {\r\n return null;\r\n }\r\n property.value = property.value.toString();\r\n }\r\n return property;\r\n}\r\nexport function getCommonSchemaMetaData(value, kind, type) {\r\n var encodedTypeValue = -1;\r\n if (!isUndefined(value)) {\r\n if (kind > 0) {\r\n if (kind === 32) {\r\n // encode customer content. Value can only be string. bit 13-16 are for cc\r\n encodedTypeValue = (1 << 13);\r\n }\r\n else if (kind <= 13) {\r\n // encode PII. Value can only be string. bits 5-12 are for Pii\r\n encodedTypeValue = (kind << 5);\r\n }\r\n }\r\n // isDataType checks that the \"type\" is a number so we don't need to check for undefined\r\n if (isDataType(type)) {\r\n // Data Type is provided and valid, so use that\r\n if (encodedTypeValue === -1) {\r\n // Don't return -1\r\n encodedTypeValue = 0;\r\n }\r\n encodedTypeValue |= type;\r\n }\r\n else {\r\n var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;\r\n if (encodedTypeValue !== -1 && propType !== -1) {\r\n // pii exists so we must return correct type\r\n encodedTypeValue |= propType;\r\n }\r\n else if (propType === 6 /* Double */) {\r\n encodedTypeValue = propType;\r\n }\r\n }\r\n }\r\n return encodedTypeValue;\r\n}\r\n/**\r\n * @deprecated - Use the core.getCookieMgr().disable()\r\n * Force the SDK not to store and read any data from cookies.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport function disableCookies() {\r\n safeGetCookieMgr(null).setEnabled(false);\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().set()\r\n * Sets the value of a cookie.\r\n * @param name - Cookie name.\r\n * @param value - Cookie value.\r\n * @param days - Expiration days.\r\n */\r\nexport function setCookie(name, value, days) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).set(name, value, days * 86400, null, \"/\");\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().del()\r\n * Deletes a cookie, by setting its expiration to -1.\r\n * @param name - Cookie name to delete.\r\n */\r\nexport function deleteCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n safeGetCookieMgr(null).del(name);\r\n }\r\n}\r\n/**\r\n * @deprecated - Use the oneDs.getCookieMgr().get()\r\n * Gets the cookie value for the specified cookie.\r\n * if value is k1=v1&k2==v2 then will return 'v1' for key 'k1'\r\n * @param cookieName - Cookie name.\r\n */\r\nexport function getCookie(name) {\r\n if (areCookiesSupported(null)) {\r\n return getCookieValue(safeGetCookieMgr(null), name);\r\n }\r\n return \"\";\r\n}\r\n/**\r\n * Helper to get and decode the cookie value using decodeURIComponent, this is for historical\r\n * backward compatibility where the document.cookie value was decoded before parsing.\r\n * @param cookieMgr - The cookie manager to use\r\n * @param name - The name of the cookie to get\r\n * @param decode - A flag to indicate whether the cookie value should be decoded\r\n * @returns The decoded cookie value (if available) otherwise an empty string.\r\n */\r\nexport function getCookieValue(cookieMgr, name, decode) {\r\n if (decode === void 0) { decode = true; }\r\n var cookieValue;\r\n if (cookieMgr) {\r\n cookieValue = cookieMgr.get(name);\r\n if (decode && cookieValue && decodeURIComponent) {\r\n cookieValue = decodeURIComponent(cookieValue);\r\n }\r\n }\r\n return cookieValue || \"\";\r\n}\r\n/**\r\n * Create a new guid.\r\n * @param style - The style of guid to generated, defaults to Digits\r\n * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000\r\n * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}\r\n * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)\r\n * Numeric - 32 digits: 00000000000000000000000000000000\r\n * @returns The formatted guid.\r\n */\r\nexport function createGuid(style) {\r\n if (style === void 0) { style = \"D\" /* Digits */; }\r\n var theGuid = newGuid();\r\n if (style === \"B\" /* Braces */) {\r\n theGuid = \"{\" + theGuid + \"}\";\r\n }\r\n else if (style === \"P\" /* Parentheses */) {\r\n theGuid = \"(\" + theGuid + \")\";\r\n }\r\n else if (style === \"N\" /* Numeric */) {\r\n theGuid = theGuid.replace(/-/g, \"\");\r\n }\r\n return theGuid;\r\n}\r\n/**\r\n * Pass in the objects to merge as arguments.\r\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\r\n * @param obj2 - object to merge.\r\n * @param obj3 - object to merge.\r\n * @param obj4 - object to merge.\r\n * @param obj5 - object to merge.\r\n * @returns The extended object.\r\n */\r\nexport function extend(obj, obj2, obj3, obj4, obj5) {\r\n // Variables\r\n var extended = {};\r\n var deep = false;\r\n var i = 0;\r\n var length = arguments.length;\r\n var objProto = Object[strPrototype];\r\n var theArgs = arguments;\r\n // Check if a deep merge\r\n if (objProto.toString.call(theArgs[0]) === \"[object Boolean]\") {\r\n deep = theArgs[0];\r\n i++;\r\n }\r\n // Loop through each object and conduct a merge\r\n for (; i < length; i++) {\r\n var obj = theArgs[i];\r\n objForEachKey(obj, function (prop, value) {\r\n // If deep merge and property is an object, merge properties\r\n if (deep && value && isObject(value)) {\r\n if (isArray(value)) {\r\n extended[prop] = extended[prop] || [];\r\n arrForEach(value, function (arrayValue, arrayIndex) {\r\n if (arrayValue && isObject(arrayValue)) {\r\n extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);\r\n }\r\n else {\r\n extended[prop][arrayIndex] = arrayValue;\r\n }\r\n });\r\n }\r\n else {\r\n extended[prop] = extend(true, extended[prop], value);\r\n }\r\n }\r\n else {\r\n extended[prop] = value;\r\n }\r\n });\r\n }\r\n return extended;\r\n}\r\nexport var getTime = perfNow;\r\nexport function isValueKind(value) {\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value === 0 /* NotSet */ || ((value > 0 /* NotSet */ && value <= 13 /* Pii_IPV4AddressLegacy */) || value === 32 /* CustomerContent_GenericContent */)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isDataType(value) {\r\n // Remark: 0 returns false, but it doesn't affect encoding anyways\r\n // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization\r\n if (value >= 0 && value <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSafariOrFirefox() {\r\n var nav = getNavigator();\r\n // If non-browser navigator will be undefined\r\n if (!isUndefined(nav) && nav.userAgent) {\r\n var ua = nav.userAgent.toLowerCase();\r\n if ((ua.indexOf(\"safari\") >= 0 || ua.indexOf(\"firefox\") >= 0) && ua.indexOf(\"chrome\") < 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nexport function isArrayValid(value) {\r\n return value.length > 0;\r\n}\r\nexport function setProcessTelemetryTimings(event, identifier) {\r\n var evt = event;\r\n evt.timings = evt.timings || {};\r\n evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};\r\n evt.timings.processTelemetryStart[identifier] = getTime();\r\n}\r\n/**\r\n * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value\r\n * @param value The value to determine the type\r\n */\r\nexport function getFieldValueType(value) {\r\n var theType = 0 /* NotSet */;\r\n if (value !== null && value !== undefined) {\r\n var objType = typeof value;\r\n if (objType === \"string\") {\r\n theType = 1 /* String */;\r\n }\r\n else if (objType === \"number\") {\r\n theType = 2 /* Number */;\r\n }\r\n else if (objType === \"boolean\") {\r\n theType = 3 /* Boolean */;\r\n }\r\n else if (objType === strShimObject) {\r\n theType = 4 /* Object */;\r\n if (isArray(value)) {\r\n theType = 4096 /* Array */;\r\n if (value.length > 0) {\r\n // Empty arrays are not supported and are considered to be the same as null\r\n theType |= getFieldValueType(value[0]);\r\n }\r\n }\r\n else if (hasOwnProperty(value, \"value\")) {\r\n // Looks like an IEventProperty\r\n theType = 8192 /* EventProperty */ | getFieldValueType(value.value);\r\n }\r\n }\r\n }\r\n return theType;\r\n}\r\nexport var Utils = {\r\n Version: Version,\r\n FullVersionString: FullVersionString,\r\n strUndefined: strUndefined,\r\n strObject: strObject,\r\n Undefined: strUndefined,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n objKeys: objKeys,\r\n toISOString: toISOString,\r\n isReactNative: isReactNative,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n isFunction: isFunction,\r\n isArray: isArray,\r\n isObject: isObject,\r\n strTrim: strTrim,\r\n isDocumentObjectAvailable: isDocumentObjectAvailable,\r\n isWindowObjectAvailable: isWindowObjectAvailable,\r\n isValueAssigned: isValueAssigned,\r\n getTenantId: getTenantId,\r\n isBeaconsSupported: isBeaconsSupported,\r\n isUint8ArrayAvailable: isUint8ArrayAvailable,\r\n isLatency: isLatency,\r\n sanitizeProperty: sanitizeProperty,\r\n getISOString: toISOString,\r\n useXDomainRequest: useXDomainRequest,\r\n getCommonSchemaMetaData: getCommonSchemaMetaData,\r\n cookieAvailable: areCookiesSupported,\r\n disallowsSameSiteNone: uaDisallowsSameSiteNone,\r\n setCookie: setCookie,\r\n deleteCookie: deleteCookie,\r\n getCookie: getCookie,\r\n createGuid: createGuid,\r\n extend: extend,\r\n getTime: getTime,\r\n isValueKind: isValueKind,\r\n isArrayValid: isArrayValid,\r\n objDefineAccessors: objDefineAccessors,\r\n addPageUnloadEventListener: addPageUnloadEventListener,\r\n setProcessTelemetryTimings: setProcessTelemetryTimings,\r\n addEventHandler: addEventHandler,\r\n getFieldValueType: getFieldValueType,\r\n strEndsWith: strEndsWith,\r\n objForEachKey: objForEachKey\r\n};\r\n/**\r\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\r\n * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions\r\n * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items\r\n * in your resulting code.\r\n * Overriding the applicationinsights-core version for tree-shaking\r\n */\r\nexport var CoreUtils = {\r\n _canUseCookies: undefined,\r\n isTypeof: isTypeof,\r\n isUndefined: isUndefined,\r\n isNullOrUndefined: isNullOrUndefined,\r\n hasOwnProperty: hasOwnProperty,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n isDate: isDate,\r\n isArray: isArray,\r\n isError: isError,\r\n isString: isString,\r\n isNumber: isNumber,\r\n isBoolean: isBoolean,\r\n toISOString: toISOString,\r\n arrForEach: arrForEach,\r\n arrIndexOf: arrIndexOf,\r\n arrMap: arrMap,\r\n arrReduce: arrReduce,\r\n strTrim: strTrim,\r\n objCreate: objCreateFn,\r\n objKeys: objKeys,\r\n objDefineAccessors: objDefineAccessors,\r\n addEventHandler: addEventHandler,\r\n dateNow: dateNow,\r\n isIE: isIE,\r\n disableCookies: disableCookies,\r\n newGuid: newGuid,\r\n perfNow: perfNow,\r\n newId: newId,\r\n randomValue: randomValue,\r\n random32: random32,\r\n mwcRandomSeed: mwcRandomSeed,\r\n mwcRandom32: mwcRandom32,\r\n generateW3CId: generateW3CId\r\n};\r\n/**\r\n * Helper to identify whether we are running in a chromium based browser environment\r\n */\r\nexport function isChromium() {\r\n return !!getGlobalInst(\"chrome\");\r\n}\r\n/**\r\n * Create and open an XMLHttpRequest object\r\n * @param method - The request method\r\n * @param urlString - The url\r\n * @param withCredentials - Option flag indicating that credentials should be sent\r\n * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)\r\n * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)\r\n * @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request\r\n * @returns A new opened XHR request\r\n */\r\nexport function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {\r\n if (disabled === void 0) { disabled = false; }\r\n if (isSync === void 0) { isSync = false; }\r\n function _wrapSetXhrProp(xhr, prop, value) {\r\n try {\r\n xhr[prop] = value;\r\n }\r\n catch (e) {\r\n // - Wrapping as depending on the environment setting the property may fail (non-terminally)\r\n }\r\n }\r\n var xhr = new XMLHttpRequest();\r\n if (disabled) {\r\n // Tag the instance so it's not tracked (trackDependency)\r\n // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would\r\n // cause the request to fail and we no telemetry would be sent\r\n _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);\r\n }\r\n if (withCredentials) {\r\n // Some libraries require that the withCredentials flag is set \"before\" open and\r\n // - Wrapping as IE 10 has started throwing when setting before open\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n xhr.open(method, urlString, !isSync);\r\n if (withCredentials) {\r\n // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)\r\n // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing\r\n _wrapSetXhrProp(xhr, strWithCredentials, withCredentials);\r\n }\r\n // Only set the timeout for asynchronous requests as\r\n // \"Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.\"\"\r\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout\r\n if (!isSync && timeout) {\r\n _wrapSetXhrProp(xhr, strTimeout, timeout);\r\n }\r\n return xhr;\r\n}\r\n//# sourceMappingURL=Utils.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/1ds-core-js",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Microsoft Application Insights JavaScript SDK - 1ds-core-js extensions",
|
|
5
5
|
"author": "Microsoft Application Insights Team",
|
|
6
6
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist-esm/src/Index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@microsoft/applicationinsights-shims": "^2.0.
|
|
36
|
-
"@microsoft/applicationinsights-core-js": "2.
|
|
35
|
+
"@microsoft/applicationinsights-shims": "^2.0.1",
|
|
36
|
+
"@microsoft/applicationinsights-core-js": "2.8.0",
|
|
37
37
|
"@microsoft/dynamicproto-js": "^1.1.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"grunt": "^1.4.1",
|
|
41
|
-
"typedoc": "^0.
|
|
41
|
+
"typedoc": "^0.22.13",
|
|
42
42
|
"typescript": "^4.3.5"
|
|
43
43
|
}
|
|
44
44
|
}
|