@microsoft/applicationinsights-common 3.0.0-beta.2208-14 → 3.0.0-beta.2208-19
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 +7 -0
- package/browser/applicationinsights-common.integrity.json +9 -9
- package/browser/applicationinsights-common.js +698 -1416
- package/browser/applicationinsights-common.js.map +1 -1
- package/browser/applicationinsights-common.min.js +2 -2
- package/browser/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.api.json +1785 -3953
- package/dist/applicationinsights-common.api.md +13 -137
- package/dist/applicationinsights-common.d.ts +23 -278
- package/dist/applicationinsights-common.js +698 -1416
- package/dist/applicationinsights-common.js.map +1 -1
- package/dist/applicationinsights-common.min.js +2 -2
- package/dist/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.rollup.d.ts +23 -278
- package/dist-esm/ConnectionStringParser.js +1 -1
- package/dist-esm/Constants.js +1 -1
- package/dist-esm/DomHelperFuncs.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/HelperFuncs.js +1 -1
- package/dist-esm/Interfaces/ConnectionString.js +1 -1
- package/dist-esm/Interfaces/Context/IApplication.js +1 -1
- package/dist-esm/Interfaces/Context/IDevice.js +1 -1
- package/dist-esm/Interfaces/Context/IInternal.js +1 -1
- package/dist-esm/Interfaces/Context/ILocation.js +1 -1
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-esm/Interfaces/Context/ISample.js +1 -1
- package/dist-esm/Interfaces/Context/ISession.js +1 -1
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-esm/Interfaces/Context/IUser.js +1 -1
- package/dist-esm/Interfaces/Context/IWeb.js +1 -1
- package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
- package/dist-esm/Interfaces/Contracts/IData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/IAppInsights.js +1 -1
- package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
- package/dist-esm/Interfaces/IConfig.js +1 -1
- package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
- package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPartC.js +1 -1
- package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-esm/Interfaces/IRequestContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
- package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-esm/Interfaces/PartAExtensions.js +1 -1
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-esm/RequestResponseHeaders.js +1 -1
- package/dist-esm/StorageHelperFuncs.js +1 -1
- package/dist-esm/Telemetry/Common/Data.js +1 -1
- package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
- package/dist-esm/Telemetry/Common/DataSanitizer.js +6 -32
- package/dist-esm/Telemetry/Common/DataSanitizer.js.map +1 -1
- package/dist-esm/Telemetry/Common/Envelope.js +1 -1
- package/dist-esm/Telemetry/Event.js +1 -1
- package/dist-esm/Telemetry/Exception.js +1 -1
- package/dist-esm/Telemetry/Metric.js +1 -1
- package/dist-esm/Telemetry/PageView.js +1 -1
- package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
- package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-esm/Telemetry/Trace.js +1 -1
- package/dist-esm/TelemetryItemCreator.js +1 -1
- package/dist-esm/UrlHelperFuncs.js +1 -1
- package/dist-esm/Util.js +79 -133
- package/dist-esm/Util.js.map +1 -1
- package/dist-esm/__DynamicConstants.js +4 -8
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-common.js +3 -3
- package/dist-esm/applicationinsights-common.js.map +1 -1
- package/package.json +5 -4
- package/src/Telemetry/Common/DataSanitizer.ts +5 -95
- package/src/Util.ts +79 -395
- package/src/__DynamicConstants.ts +3 -7
- package/src/applicationinsights-common.ts +3 -4
- package/tsconfig.json +1 -1
- package/types/Telemetry/Common/DataSanitizer.d.ts +0 -50
- package/types/Util.d.ts +19 -212
- package/types/__DynamicConstants.d.ts +0 -4
- package/types/applicationinsights-common.d.ts +2 -2
- package/types/tsdoc-metadata.json +1 -1
package/types/Util.d.ts
CHANGED
|
@@ -1,204 +1,25 @@
|
|
|
1
|
-
import { IDiagnosticLogger, IDistributedTraceContext
|
|
1
|
+
import { IDiagnosticLogger, IDistributedTraceContext } from "@microsoft/applicationinsights-core-js";
|
|
2
2
|
import { ITelemetryTrace } from "./Interfaces/Context/ITelemetryTrace";
|
|
3
3
|
import { ICorrelationConfig } from "./Interfaces/ICorrelationConfig";
|
|
4
4
|
export declare function isInternalApplicationInsightsEndpoint(endpointUrl: string): boolean;
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* Get an object from the browser's local storage
|
|
24
|
-
*
|
|
25
|
-
* @param {string} name - the name of the object to get from storage
|
|
26
|
-
* @returns {string} The contents of the storage object with the given name. Null if storage is not supported.
|
|
27
|
-
*/
|
|
28
|
-
getStorage: (logger: IDiagnosticLogger, name: string) => string;
|
|
29
|
-
/**
|
|
30
|
-
* Set the contents of an object in the browser's local storage
|
|
31
|
-
*
|
|
32
|
-
* @param {string} name - the name of the object to set in storage
|
|
33
|
-
* @param {string} data - the contents of the object to set in storage
|
|
34
|
-
* @returns {boolean} True if the storage object could be written.
|
|
35
|
-
*/
|
|
36
|
-
setStorage: (logger: IDiagnosticLogger, name: string, data: string) => boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Remove an object from the browser's local storage
|
|
39
|
-
*
|
|
40
|
-
* @param {string} name - the name of the object to remove from storage
|
|
41
|
-
* @returns {boolean} True if the storage object could be removed.
|
|
42
|
-
*/
|
|
43
|
-
removeStorage: (logger: IDiagnosticLogger, name: string) => boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Check if the browser supports session storage.
|
|
46
|
-
*
|
|
47
|
-
* @returns {boolean} True if session storage is supported.
|
|
48
|
-
*/
|
|
49
|
-
canUseSessionStorage: () => boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Gets the list of session storage keys
|
|
52
|
-
*
|
|
53
|
-
* @returns {string[]} List of session storage keys
|
|
54
|
-
*/
|
|
55
|
-
getSessionStorageKeys: () => string[];
|
|
56
|
-
/**
|
|
57
|
-
* Get an object from the browser's session storage
|
|
58
|
-
*
|
|
59
|
-
* @param {string} name - the name of the object to get from storage
|
|
60
|
-
* @returns {string} The contents of the storage object with the given name. Null if storage is not supported.
|
|
61
|
-
*/
|
|
62
|
-
getSessionStorage: (logger: IDiagnosticLogger, name: string) => string;
|
|
63
|
-
/**
|
|
64
|
-
* Set the contents of an object in the browser's session storage
|
|
65
|
-
*
|
|
66
|
-
* @param {string} name - the name of the object to set in storage
|
|
67
|
-
* @param {string} data - the contents of the object to set in storage
|
|
68
|
-
* @returns {boolean} True if the storage object could be written.
|
|
69
|
-
*/
|
|
70
|
-
setSessionStorage: (logger: IDiagnosticLogger, name: string, data: string) => boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Remove an object from the browser's session storage
|
|
73
|
-
*
|
|
74
|
-
* @param {string} name - the name of the object to remove from storage
|
|
75
|
-
* @returns {boolean} True if the storage object could be removed.
|
|
76
|
-
*/
|
|
77
|
-
removeSessionStorage: (logger: IDiagnosticLogger, name: string) => boolean;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated - Use the core.getCookieMgr().disable()
|
|
80
|
-
* Force the SDK not to store and read any data from cookies.
|
|
81
|
-
*/
|
|
82
|
-
disableCookies: () => void;
|
|
83
|
-
/**
|
|
84
|
-
* @deprecated - Use the core.getCookieMgr().isEnabled()
|
|
85
|
-
* Helper method to tell if document.cookie object is available and whether it can be used.
|
|
86
|
-
*/
|
|
87
|
-
canUseCookies: (logger: IDiagnosticLogger) => any;
|
|
88
|
-
disallowsSameSiteNone: (userAgent: string) => boolean;
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated - Use the core.getCookieMgr().set()
|
|
91
|
-
* helper method to set userId and sessionId cookie
|
|
92
|
-
*/
|
|
93
|
-
setCookie: (logger: IDiagnosticLogger, name: string, value: string, domain?: string) => void;
|
|
94
|
-
stringToBoolOrDefault: (str: any, defaultValue?: boolean) => boolean;
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated - Use the core.getCookieMgr().get()
|
|
97
|
-
* helper method to access userId and sessionId cookie
|
|
98
|
-
*/
|
|
99
|
-
getCookie: (logger: IDiagnosticLogger, name: string) => string;
|
|
100
|
-
/**
|
|
101
|
-
* @deprecated - Use the core.getCookieMgr().del()
|
|
102
|
-
* Deletes a cookie by setting it's expiration time in the past.
|
|
103
|
-
* @param name - The name of the cookie to delete.
|
|
104
|
-
*/
|
|
105
|
-
deleteCookie: (logger: IDiagnosticLogger, name: string) => void;
|
|
106
|
-
/**
|
|
107
|
-
* helper method to trim strings (IE8 does not implement String.prototype.trim)
|
|
108
|
-
*/
|
|
109
|
-
trim: (str: any) => string;
|
|
110
|
-
/**
|
|
111
|
-
* generate random id string
|
|
112
|
-
*/
|
|
113
|
-
newId: () => string;
|
|
114
|
-
/**
|
|
115
|
-
* generate a random 32bit number (-0x80000000..0x7FFFFFFF).
|
|
116
|
-
*/
|
|
117
|
-
random32: () => number;
|
|
118
|
-
/**
|
|
119
|
-
* generate W3C trace id
|
|
120
|
-
*/
|
|
121
|
-
generateW3CId: () => string;
|
|
122
|
-
/**
|
|
123
|
-
* Check if an object is of type Array
|
|
124
|
-
*/
|
|
125
|
-
isArray: (obj: any) => boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Check if an object is of type Error
|
|
128
|
-
*/
|
|
129
|
-
isError: (obj: any) => obj is Error;
|
|
130
|
-
/**
|
|
131
|
-
* Check if an object is of type Date
|
|
132
|
-
*/
|
|
133
|
-
isDate: (obj: any) => obj is Date;
|
|
134
|
-
toISOStringForIE8: (date: Date) => string;
|
|
135
|
-
/**
|
|
136
|
-
* Gets IE version returning the document emulation mode if we are running on IE, or null otherwise
|
|
137
|
-
*/
|
|
138
|
-
getIEVersion: (userAgentStr?: string) => number;
|
|
139
|
-
/**
|
|
140
|
-
* Convert ms to c# time span format
|
|
141
|
-
*/
|
|
142
|
-
msToTimeSpan: (totalms: number) => string;
|
|
143
|
-
/**
|
|
144
|
-
* Checks if error has no meaningful data inside. Ususally such errors are received by window.onerror when error
|
|
145
|
-
* happens in a script from other domain (cross origin, CORS).
|
|
146
|
-
*/
|
|
147
|
-
isCrossOriginError: (message: string | Event, url: string, lineNumber: number, columnNumber: number, error: Error) => boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Returns string representation of an object suitable for diagnostics logging.
|
|
150
|
-
*/
|
|
151
|
-
dump: (object: any) => string;
|
|
152
|
-
/**
|
|
153
|
-
* Returns the name of object if it's an Error. Otherwise, returns empty string.
|
|
154
|
-
*/
|
|
155
|
-
getExceptionName: (object: any) => string;
|
|
156
|
-
/**
|
|
157
|
-
* Adds an event handler for the specified event to the window
|
|
158
|
-
* @param eventName {string} - The name of the event
|
|
159
|
-
* @param callback {any} - The callback function that needs to be executed for the given event
|
|
160
|
-
* @return {boolean} - true if the handler was successfully added
|
|
161
|
-
*/
|
|
162
|
-
addEventHandler: (obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture: boolean) => boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Tells if a browser supports a Beacon API
|
|
165
|
-
*/
|
|
166
|
-
IsBeaconApiSupported: () => boolean;
|
|
167
|
-
getExtension: (extensions: IPlugin[], identifier: string) => IPlugin | null;
|
|
168
|
-
}
|
|
169
|
-
export declare const Util: IUtil;
|
|
170
|
-
export interface IUrlHelper {
|
|
171
|
-
parseUrl: (url: string) => HTMLAnchorElement;
|
|
172
|
-
getAbsoluteUrl: (url: string) => string;
|
|
173
|
-
getPathName: (url: string) => string;
|
|
174
|
-
getCompleteUrl: (method: string, absoluteUrl: string) => string;
|
|
175
|
-
parseHost: (url: string, inclPort?: boolean) => string;
|
|
176
|
-
/**
|
|
177
|
-
* Get the full host from the url, optionally including the port
|
|
178
|
-
*/
|
|
179
|
-
parseFullHost: (url: string, inclPort?: boolean) => string;
|
|
180
|
-
}
|
|
181
|
-
export declare const UrlHelper: IUrlHelper;
|
|
182
|
-
export interface ICorrelationIdHelper {
|
|
183
|
-
correlationIdPrefix: string;
|
|
184
|
-
/**
|
|
185
|
-
* Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.
|
|
186
|
-
* Headers are always included if the current domain matches the request domain. If they do not match (CORS),
|
|
187
|
-
* they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.
|
|
188
|
-
* Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must
|
|
189
|
-
* manually supply domains to include correlation headers on. Else, no headers will be included at all.
|
|
190
|
-
*/
|
|
191
|
-
canIncludeCorrelationHeader(config: ICorrelationConfig, requestUrl: string, currentHost?: string): boolean;
|
|
192
|
-
/**
|
|
193
|
-
* Combines target appId and target role name from response header.
|
|
194
|
-
*/
|
|
195
|
-
getCorrelationContext(responseHeader: string): string | undefined;
|
|
196
|
-
/**
|
|
197
|
-
* Gets key from correlation response header
|
|
198
|
-
*/
|
|
199
|
-
getCorrelationContextValue(responseHeader: string, key: string): string | undefined;
|
|
200
|
-
}
|
|
201
|
-
export declare const CorrelationIdHelper: ICorrelationIdHelper;
|
|
5
|
+
export declare function correlationIdSetPrefix(prefix: string): void;
|
|
6
|
+
export declare function correlationIdGetPrefix(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.
|
|
9
|
+
* Headers are always included if the current domain matches the request domain. If they do not match (CORS),
|
|
10
|
+
* they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.
|
|
11
|
+
* Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must
|
|
12
|
+
* manually supply domains to include correlation headers on. Else, no headers will be included at all.
|
|
13
|
+
*/
|
|
14
|
+
export declare function correlationIdCanIncludeCorrelationHeader(config: ICorrelationConfig, requestUrl: string, currentHost?: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Combines target appId and target role name from response header.
|
|
17
|
+
*/
|
|
18
|
+
export declare function correlationIdGetCorrelationContext(responseHeader: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Gets key from correlation response header
|
|
21
|
+
*/
|
|
22
|
+
export declare function correlationIdGetCorrelationContextValue(responseHeader: string, key: string): string;
|
|
202
23
|
export declare function AjaxHelperParseDependencyPath(logger: IDiagnosticLogger, absoluteUrl: string, method: string, commandName: string): {
|
|
203
24
|
target: string;
|
|
204
25
|
name: string;
|
|
@@ -206,20 +27,6 @@ export declare function AjaxHelperParseDependencyPath(logger: IDiagnosticLogger,
|
|
|
206
27
|
};
|
|
207
28
|
export declare function dateTimeUtilsNow(): number;
|
|
208
29
|
export declare function dateTimeUtilsDuration(start: number, end: number): number;
|
|
209
|
-
export interface IDateTimeUtils {
|
|
210
|
-
/**
|
|
211
|
-
* Get the number of milliseconds since 1970/01/01 in local timezone
|
|
212
|
-
*/
|
|
213
|
-
Now: () => number;
|
|
214
|
-
/**
|
|
215
|
-
* Gets duration between two timestamps
|
|
216
|
-
*/
|
|
217
|
-
GetDuration: (start: number, end: number) => number;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* A utility class that helps getting time related parameters
|
|
221
|
-
*/
|
|
222
|
-
export declare const DateTimeUtils: IDateTimeUtils;
|
|
223
30
|
/**
|
|
224
31
|
* Creates a IDistributedTraceContext from an optional telemetryTrace
|
|
225
32
|
* @param telemetryTrace - The telemetryTrace instance that is being wrapped
|
|
@@ -30,7 +30,3 @@ export declare const _DYN_LINE = "line";
|
|
|
30
30
|
export declare const _DYN_DURATION = "duration";
|
|
31
31
|
export declare const _DYN_RECEIVED_RESPONSE = "receivedResponse";
|
|
32
32
|
export declare const _DYN_SUBSTRING = "substring";
|
|
33
|
-
export declare const _DYN_SANITIZE_KEY_AND_ADD2 = "sanitizeKeyAndAddUniqueness";
|
|
34
|
-
export declare const _DYN_SANITIZE_EXCEPTION = "sanitizeException";
|
|
35
|
-
export declare const _DYN_SANITIZE_PROPERTIES = "sanitizeProperties";
|
|
36
|
-
export declare const _DYN_SANITIZE_MEASUREMENT3 = "sanitizeMeasurements";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { correlationIdSetPrefix, correlationIdGetPrefix, correlationIdCanIncludeCorrelationHeader, correlationIdGetCorrelationContext, correlationIdGetCorrelationContextValue, dateTimeUtilsNow, dateTimeUtilsDuration, isInternalApplicationInsightsEndpoint, createDistributedTraceContextFromTrace } from "./Util";
|
|
2
2
|
export { parseConnectionString, ConnectionStringParser } from "./ConnectionStringParser";
|
|
3
3
|
export { FieldType } from "./Enums";
|
|
4
4
|
export { IRequestHeaders, RequestHeaders, eRequestHeaders } from "./RequestResponseHeaders";
|
|
@@ -28,7 +28,7 @@ export { eSeverityLevel, SeverityLevel } from "./Interfaces/Contracts/SeverityLe
|
|
|
28
28
|
export { IConfig, ConfigurationManager } from "./Interfaces/IConfig";
|
|
29
29
|
export { IChannelControlsAI } from "./Interfaces/IChannelControlsAI";
|
|
30
30
|
export { IContextTagKeys, ContextTagKeys } from "./Interfaces/Contracts/ContextTagKeys";
|
|
31
|
-
export { DataSanitizerValues,
|
|
31
|
+
export { DataSanitizerValues, dataSanitizeKeyAndAddUniqueness, dataSanitizeKey, dataSanitizeString, dataSanitizeUrl, dataSanitizeMessage, dataSanitizeException, dataSanitizeProperties, dataSanitizeMeasurements, dataSanitizeId, dataSanitizeInput, dsPadNumber } from "./Telemetry/Common/DataSanitizer";
|
|
32
32
|
export { TelemetryItemCreator, createTelemetryItem } from "./TelemetryItemCreator";
|
|
33
33
|
export { ICorrelationConfig } from "./Interfaces/ICorrelationConfig";
|
|
34
34
|
export { IAppInsights } from "./Interfaces/IAppInsights";
|