@microsoft/1ds-core-js
Advanced tools
Comparing version 3.1.2 to 3.1.3
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
@@ -8,3 +8,3 @@ /** | ||
import { ITelemetryItem, IConfiguration, IAppInsightsCore } from "@microsoft/applicationinsights-core-js"; | ||
import { FieldValueSanitizerType } from "./Enums"; | ||
import { EventLatencyValue, EventPersistenceValue, EventSendType, FieldValueSanitizerType } from "./Enums"; | ||
/** | ||
@@ -55,12 +55,12 @@ * An interface used to create an event property value along with tagging it as PII, or customer content. | ||
*/ | ||
latency?: number; | ||
latency?: number | EventLatencyValue; | ||
/** | ||
* [Optional] An EventPersistence value, that specifies the persistence for the event. The EventPeristence constant | ||
* [Optional] An EventPersistence value, that specifies the persistence for the event. The EventPersistence constant | ||
* should be used to specify the different persistence values. | ||
*/ | ||
persistence?: number; | ||
persistence?: number | EventPersistenceValue; | ||
/** | ||
* [Optional] A boolean that specifies whether the event should be sent as a sync request. | ||
*/ | ||
sync?: boolean; | ||
sync?: boolean | EventSendType; | ||
/** | ||
@@ -67,0 +67,0 @@ * [Optional] A timings object. |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
@@ -77,2 +77,24 @@ /** | ||
*/ | ||
export declare const enum EventLatencyValue { | ||
/** | ||
* Normal latency. | ||
*/ | ||
Normal = 1, | ||
/** | ||
* Cost deferred latency. At the moment this latency is treated as Normal latency. | ||
*/ | ||
CostDeferred = 2, | ||
/** | ||
* Real time latency. | ||
*/ | ||
RealTime = 3, | ||
/** | ||
* Bypass normal batching/timing and send as soon as possible, this will still send asynchronously. | ||
* Added in v3.1.1 | ||
*/ | ||
Immediate = 4 | ||
} | ||
/** | ||
* The EventLatency contains a set of values that specify the latency with which an event is sent. | ||
*/ | ||
export declare const EventLatency: { | ||
@@ -82,11 +104,11 @@ /** | ||
*/ | ||
Normal: number; | ||
Normal: EventLatencyValue; | ||
/** | ||
* Cost deferred latency. At the moment this latency is treated as Normal latency. | ||
*/ | ||
CostDeferred: number; | ||
CostDeferred: EventLatencyValue; | ||
/** | ||
* Real time latency. | ||
*/ | ||
RealTime: number; | ||
RealTime: EventLatencyValue; | ||
/** | ||
@@ -96,3 +118,3 @@ * Bypass normal batching/timing and send as soon as possible, this will still send asynchronously. | ||
*/ | ||
Immediate: number; | ||
Immediate: EventLatencyValue; | ||
}; | ||
@@ -117,2 +139,15 @@ /** | ||
*/ | ||
export declare const enum EventPersistenceValue { | ||
/** | ||
* Normal persistence. | ||
*/ | ||
Normal = 1, | ||
/** | ||
* Critical persistence. | ||
*/ | ||
Critical = 2 | ||
} | ||
/** | ||
* The EventPersistence contains a set of values that specify the event's persistence. | ||
*/ | ||
export declare const EventPersistence: { | ||
@@ -122,9 +157,36 @@ /** | ||
*/ | ||
Normal: number; | ||
Normal: EventPersistenceValue; | ||
/** | ||
* Critical persistence. | ||
*/ | ||
Critical: number; | ||
Critical: EventPersistenceValue; | ||
}; | ||
/** | ||
* Define a specific way to send an event synchronously | ||
*/ | ||
export declare const enum EventSendType { | ||
/** | ||
* Batch and send the event asynchronously, this is the same as either setting the event `sync` flag to false or not setting at all. | ||
*/ | ||
Batched = 0, | ||
/** | ||
* Attempt to send the event synchronously, this is the same as setting the event `sync` flag to true | ||
*/ | ||
Synchronous = 1, | ||
/** | ||
* Attempt to send the event synchronously with a preference for the sendBeacon() API. | ||
* As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb, | ||
* the sendHook is also not supported or used when sendBeacon. | ||
*/ | ||
SendBeacon = 2, | ||
/** | ||
* Attempt to send the event synchronously with a preference for the fetch() API with the keepalive flag, | ||
* the SDK checks to ensure that the fetch() implementation supports the 'keepalive' flag and if not it | ||
* will fallback to either sendBeacon() or a synchronous XHR request. | ||
* As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb. | ||
* Note: Not all browsers support the keepalive flag so for those environments the events may still fail | ||
*/ | ||
SyncFetch = 3 | ||
} | ||
/** | ||
* The TraceLevel contains a set of values that specify the trace level for the trace messages. | ||
@@ -204,12 +266,17 @@ */ | ||
TrackPVFailed: number; | ||
/** | ||
* Normal latency. | ||
*/ | ||
TrackPVFailedCalc: number; | ||
TrackTraceFailed: number; | ||
TrackTraceFailed: number; /** | ||
* Cost deferred latency. At the moment this latency is treated as Normal latency. | ||
*/ | ||
TransmissionFailed: number; | ||
FailedToSetStorageBuffer: number; | ||
FailedToRestoreStorageBuffer: number; | ||
/** | ||
* Real time latency. | ||
InvalidBackendResponse: number; | ||
FailedToFixDepricatedValues: number; /** | ||
* Bypass normal batching/timing and send as soon as possible, this will still send asynchronously. | ||
* Added in v3.1.1 | ||
*/ | ||
InvalidBackendResponse: number; | ||
FailedToFixDepricatedValues: number; | ||
InvalidDurationValue: number; | ||
@@ -225,5 +292,3 @@ TelemetryEnvelopeInvalid: number; | ||
ItemNotInArray: number; | ||
MaxAjaxPerPVExceeded: number; /** | ||
* The EventPersistence contains a set of values that specify the event's persistence. | ||
*/ | ||
MaxAjaxPerPVExceeded: number; | ||
MessageTruncated: number; | ||
@@ -245,5 +310,2 @@ NameTooLong: number; | ||
FailedMonitorAjaxSetRequestHeader: number; | ||
/** | ||
* Information trace. | ||
*/ | ||
SendBrowserInfoOnUserInit: number; | ||
@@ -255,2 +317,5 @@ PluginException: number; | ||
CannotParseAiBlobValue: number; | ||
/** | ||
* Normal persistence. | ||
*/ | ||
TrackPageActionEventFailed: number; | ||
@@ -257,0 +322,0 @@ }; |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -88,11 +88,11 @@ * (Microsoft Internal Only) | ||
*/ | ||
Normal: 1, | ||
Normal: 1 /* Normal */, | ||
/** | ||
* Cost deferred latency. At the moment this latency is treated as Normal latency. | ||
*/ | ||
CostDeferred: 2, | ||
CostDeferred: 2 /* CostDeferred */, | ||
/** | ||
* Real time latency. | ||
*/ | ||
RealTime: 3, | ||
RealTime: 3 /* RealTime */, | ||
/** | ||
@@ -102,3 +102,3 @@ * Bypass normal batching/timing and send as soon as possible, this will still send asynchronously. | ||
*/ | ||
Immediate: 4 | ||
Immediate: 4 /* Immediate */ | ||
}; | ||
@@ -127,7 +127,7 @@ /** | ||
*/ | ||
Normal: 1, | ||
Normal: 1 /* Normal */, | ||
/** | ||
* Critical persistence. | ||
*/ | ||
Critical: 2 | ||
Critical: 2 /* Critical */ | ||
}; | ||
@@ -134,0 +134,0 @@ /** |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType, TransportType } from "./Enums"; | ||
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType, TransportType, EventLatencyValue, EventPersistenceValue, EventSendType } from "./Enums"; | ||
import { IExtendedConfiguration, IPropertyStorageOverride, IEventProperty, IExtendedTelemetryItem, IExtendedAppInsightsCore, IEventTiming, IValueSanitizer, FieldValueSanitizerFunc, IFieldSanitizerDetails, IFieldValueSanitizerProvider, FieldValueSanitizerTypes } from "./DataModels"; | ||
@@ -15,6 +15,6 @@ import AppInsightsCore from "./AppInsightsCore"; | ||
import { ValueSanitizer } from "./ValueSanitizer"; | ||
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, }; | ||
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 }; | ||
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, EventHelper, 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, 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, strIKey, strExtensionConfig, toISOString as getISOString, } from "@microsoft/applicationinsights-core-js"; | ||
export { isValueAssigned, isBeaconsSupported, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, useXDomainRequest, isDocumentObjectAvailable, isWindowObjectAvailable, addPageUnloadEventListener, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version fot tree-shaking | ||
export { isValueAssigned, isBeaconsSupported, isLatency, isFetchSupported, isXhrSupported, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, useXDomainRequest, isDocumentObjectAvailable, isWindowObjectAvailable, addPageUnloadEventListener, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version fot tree-shaking | ||
Utils, // Replacement for import * as Utils from "./Utils"; | ||
isChromium, } from "./Utils"; |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -12,3 +12,3 @@ * (Microsoft Internal Only) | ||
*/ | ||
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, } from "./Enums"; | ||
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId } from "./Enums"; | ||
import AppInsightsCore from "./AppInsightsCore"; | ||
@@ -19,3 +19,3 @@ import BaseCore from "./BaseCore"; | ||
import { ValueSanitizer } from "./ValueSanitizer"; | ||
export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer, }; | ||
export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer }; | ||
export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, | ||
@@ -32,5 +32,5 @@ // The HelperFuncs functions | ||
toISOString as getISOString, } from "@microsoft/applicationinsights-core-js"; | ||
export { isValueAssigned, isBeaconsSupported, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, useXDomainRequest, isDocumentObjectAvailable, isWindowObjectAvailable, addPageUnloadEventListener, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version fot tree-shaking | ||
export { isValueAssigned, isBeaconsSupported, isLatency, isFetchSupported, isXhrSupported, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, useXDomainRequest, isDocumentObjectAvailable, isWindowObjectAvailable, addPageUnloadEventListener, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version fot tree-shaking | ||
Utils, // Replacement for import * as Utils from "./Utils"; | ||
isChromium, } from "./Utils"; | ||
//# sourceMappingURL=Index.js.map |
import { IEventProperty } from "./DataModels"; | ||
import { GuidStyle, FieldValueSanitizerType } from "./Enums"; | ||
import { GuidStyle, FieldValueSanitizerType, EventLatency } from "./Enums"; | ||
import { ITelemetryItem, objForEachKey, isNumber, isReactNative, isString, isBoolean, isArray, isObject, perfNow, addEventHandler, uaDisallowsSameSiteNone, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, areCookiesSupported, ICookieMgr, ICoreUtils, strEndsWith } from "@microsoft/applicationinsights-core-js"; | ||
export declare const Version = "3.1.2"; | ||
export declare const Version = "3.1.3"; | ||
export declare const FullVersionString: string; | ||
@@ -32,2 +32,13 @@ /** | ||
/** | ||
* Checks if the Fetch API is supported in the current environment. | ||
* @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported | ||
* @returns True if supported, otherwise false | ||
*/ | ||
export declare function isFetchSupported(withKeepAlive?: boolean): boolean; | ||
/** | ||
* Checks if XMLHttpRequest is supported | ||
* @returns True if supported, otherwise false | ||
*/ | ||
export declare function isXhrSupported(): boolean; | ||
/** | ||
* Checks if Uint8Array are available in the current environment. Safari and Firefox along with | ||
@@ -43,3 +54,3 @@ * ReactNative are known to not support Uint8Array properly. | ||
*/ | ||
export declare function isLatency(value: number | undefined): boolean; | ||
export declare function isLatency(value: number | undefined | typeof EventLatency): boolean; | ||
/** | ||
@@ -46,0 +57,0 @@ * Sanitizes the Property. It checks the that the property name and value are valid. It also |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -16,3 +16,3 @@ * (Microsoft Internal Only) | ||
import { getDocument, hasNavigator, 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, } from "@microsoft/applicationinsights-core-js"; | ||
export var Version = '3.1.2'; | ||
export var Version = '3.1.3'; | ||
export var FullVersionString = "1DS-Web-JS-" + Version; | ||
@@ -33,5 +33,28 @@ // If value is array just get the type for the first element | ||
// let _uaDisallowsSameSiteNone = null; | ||
var _useXDomainRequest = null; | ||
var beaconsSupported = null; | ||
var uInt8ArraySupported = null; | ||
// var _areCookiesAvailable: boolean | undefined; | ||
function _hasProperty(theClass, property) { | ||
var supported = false; | ||
if (theClass) { | ||
supported = property in theClass; | ||
if (!supported) { | ||
var proto = theClass.prototype; | ||
if (proto) { | ||
supported = property in proto; | ||
} | ||
} | ||
if (!supported) { | ||
try { | ||
var tmp = new theClass(); | ||
supported = !isUndefined(tmp[property]); | ||
} | ||
catch (e) { | ||
// Do Nothing | ||
} | ||
} | ||
} | ||
return supported; | ||
} | ||
/** | ||
@@ -81,2 +104,29 @@ * Checks if document object is available | ||
/** | ||
* Checks if the Fetch API is supported in the current environment. | ||
* @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported | ||
* @returns True if supported, otherwise false | ||
*/ | ||
export function isFetchSupported(withKeepAlive) { | ||
var isSupported = false; | ||
try { | ||
var fetchApi = getGlobalInst("fetch"); | ||
isSupported = !!fetchApi; | ||
var request = getGlobalInst("Request"); | ||
if (isSupported && withKeepAlive && request) { | ||
isSupported = _hasProperty(request, "keepalive"); | ||
} | ||
} | ||
catch (e) { | ||
// Just Swallow any failure during availability checks | ||
} | ||
return isSupported; | ||
} | ||
/** | ||
* Checks if XMLHttpRequest is supported | ||
* @returns True if supported, otherwise false | ||
*/ | ||
export function isXhrSupported() { | ||
return typeof XMLHttpRequest !== undefined; | ||
} | ||
/** | ||
* Checks if Uint8Array are available in the current environment. Safari and Firefox along with | ||
@@ -149,9 +199,9 @@ * ReactNative are known to not support Uint8Array properly. | ||
export function useXDomainRequest() { | ||
if (typeof XMLHttpRequest !== undefined) { | ||
var xhr = getGlobalInst("XMLHttpRequest"); | ||
if (xhr) { | ||
var conn = new xhr(); | ||
return Boolean(isUndefined(conn.withCredentials) && (typeof XDomainRequest !== undefined)); | ||
if (_useXDomainRequest === null) { | ||
_useXDomainRequest = (typeof XDomainRequest !== undefined); | ||
if (_useXDomainRequest && isXhrSupported()) { | ||
_useXDomainRequest = _useXDomainRequest && !_hasProperty(XMLHttpRequest, "withCredentials"); | ||
} | ||
} | ||
return _useXDomainRequest; | ||
} | ||
@@ -158,0 +208,0 @@ export function getCommonSchemaMetaData(value, kind, type) { |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -12,2 +12,3 @@ * (Microsoft Internal Only) | ||
import { ValueSanitizerTests } from './ValueSanitizerTests'; | ||
import { FileSizeCheckTest } from './FileSizeCheckTest'; | ||
export function registerTests() { | ||
@@ -20,4 +21,5 @@ new CoreTest('CoreTest').registerTests(); | ||
new ValueSanitizerTests('ValueSanitizerTests').registerTests(); | ||
new FileSizeCheckTest('FileSizeCheckTest').registerTests(); | ||
} | ||
registerTests(); | ||
//# sourceMappingURL=Index.js.map |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/* | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -4,0 +4,0 @@ * (Microsoft Internal Only) |
/*! | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -34,5 +34,5 @@ * (Microsoft Internal Only) | ||
var EventLatency = { | ||
Normal: 1, | ||
CostDeferred: 2, | ||
RealTime: 3, | ||
Normal: 1 , | ||
CostDeferred: 2 , | ||
RealTime: 3 , | ||
Immediate: 4 | ||
@@ -53,3 +53,3 @@ }; | ||
var EventPersistence = { | ||
Normal: 1, | ||
Normal: 1 , | ||
Critical: 2 | ||
@@ -66,3 +66,3 @@ }; | ||
var _a; | ||
var Version = '3.1.2'; | ||
var Version = '3.1.3'; | ||
var FullVersionString = "1DS-Web-JS-" + Version; | ||
@@ -78,4 +78,26 @@ var _fieldTypeEventPropMap = (_a = {}, | ||
_a); | ||
var _useXDomainRequest = null; | ||
var beaconsSupported = null; | ||
var uInt8ArraySupported = null; | ||
function _hasProperty(theClass, property) { | ||
var supported = false; | ||
if (theClass) { | ||
supported = property in theClass; | ||
if (!supported) { | ||
var proto = theClass.prototype; | ||
if (proto) { | ||
supported = property in proto; | ||
} | ||
} | ||
if (!supported) { | ||
try { | ||
var tmp = new theClass(); | ||
supported = !applicationinsightsCoreJs.isUndefined(tmp[property]); | ||
} | ||
catch (e) { | ||
} | ||
} | ||
} | ||
return supported; | ||
} | ||
var isDocumentObjectAvailable = Boolean(applicationinsightsCoreJs.getDocument()); | ||
@@ -101,2 +123,19 @@ var isWindowObjectAvailable = Boolean(applicationinsightsCoreJs.getWindow()); | ||
} | ||
function isFetchSupported(withKeepAlive) { | ||
var isSupported = false; | ||
try { | ||
var fetchApi = applicationinsightsCoreJs.getGlobalInst("fetch"); | ||
isSupported = !!fetchApi; | ||
var request = applicationinsightsCoreJs.getGlobalInst("Request"); | ||
if (isSupported && withKeepAlive && request) { | ||
isSupported = _hasProperty(request, "keepalive"); | ||
} | ||
} | ||
catch (e) { | ||
} | ||
return isSupported; | ||
} | ||
function isXhrSupported() { | ||
return typeof XMLHttpRequest !== undefined; | ||
} | ||
function isUint8ArrayAvailable() { | ||
@@ -144,9 +183,9 @@ if (uInt8ArraySupported === null) { | ||
function useXDomainRequest() { | ||
if (typeof XMLHttpRequest !== undefined) { | ||
var xhr = applicationinsightsCoreJs.getGlobalInst("XMLHttpRequest"); | ||
if (xhr) { | ||
var conn = new xhr(); | ||
return Boolean(applicationinsightsCoreJs.isUndefined(conn.withCredentials) && (typeof XDomainRequest !== undefined)); | ||
if (_useXDomainRequest === null) { | ||
_useXDomainRequest = (typeof XDomainRequest !== undefined); | ||
if (_useXDomainRequest && isXhrSupported()) { | ||
_useXDomainRequest = _useXDomainRequest && !_hasProperty(XMLHttpRequest, "withCredentials"); | ||
} | ||
} | ||
return _useXDomainRequest; | ||
} | ||
@@ -1229,2 +1268,3 @@ function getCommonSchemaMetaData(value, kind, type) { | ||
exports.isDocumentObjectAvailable = isDocumentObjectAvailable; | ||
exports.isFetchSupported = isFetchSupported; | ||
exports.isLatency = isLatency; | ||
@@ -1235,2 +1275,3 @@ exports.isUint8ArrayAvailable = isUint8ArrayAvailable; | ||
exports.isWindowObjectAvailable = isWindowObjectAvailable; | ||
exports.isXhrSupported = isXhrSupported; | ||
exports.sanitizeProperty = sanitizeProperty; | ||
@@ -1237,0 +1278,0 @@ exports.setCookie = setCookie; |
/*! | ||
* 1DS JS SDK Core, 3.1.2 | ||
* 1DS JS SDK Core, 3.1.3 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
* (Microsoft Internal Only) | ||
*/ | ||
var e=this,n=function(e,r,f,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}var o=t(n),i={NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32},u={Normal:1,CostDeferred:2,RealTime:3,Immediate:4},a={Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9},l=r.__assignFn(r.__assignFn({},f._InternalMessageId),{AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}),s="3.1.2",d="1DS-Web-JS-"+s,c=((ie={})[0]=a.Unspecified,ie[2]=a.Double,ie[1]=a.String,ie[3]=a.Bool,ie[4098]=a.Double,ie[4097]=a.String,ie[4099]=a.Bool,ie),g=null,m=null,v=!!f.getDocument(),p=!!f.getWindow();function h(e){return!(""===e||f.isNullOrUndefined(e))}function y(e){if(e){var n=e.indexOf("-");if(-1<n)return e.substring(0,n)}return""}function S(){return g=null===g?f.hasNavigator()&&!!f.getNavigator().sendBeacon:g}function b(){return m=null===m?!(f.isUndefined(Uint8Array)||(e=f.getNavigator(),!f.isUndefined(e)&&e.userAgent&&(~(e=e.userAgent.toLowerCase()).indexOf("safari")||~e.indexOf("firefox"))&&!~e.indexOf("chrome"))||f.isReactNative()):m;var e}function C(e){return!!(e&&f.isNumber(e)&&e>=u.Normal&&e<=u.Immediate)}function E(e,n,t){if(!n&&!h(n)||"string"!=typeof e)return null;if("string"==(e=typeof n)||"number"==e||"boolean"==e||f.isArray(n))n={value:n};else if("object"!=e||n.hasOwnProperty("value")){if(f.isNullOrUndefined(n.value)||""===n.value||!f.isString(n.value)&&!f.isNumber(n.value)&&!f.isBoolean(n.value)&&!f.isArray(n.value))return null}else n={value:t?JSON.stringify(n):n};if(f.isArray(n.value)&&!U(n.value))return null;if(!f.isNullOrUndefined(n.kind)){if(f.isArray(n.value)||!F(n.kind))return null;n.value=n.value.toString()}return n}function I(){if(typeof XMLHttpRequest!==undefined){var e=f.getGlobalInst("XMLHttpRequest");if(e)return e=new e,!(!f.isUndefined(e.withCredentials)||typeof XDomainRequest===undefined)}}function N(e,n,t){var r=-1;return f.isUndefined(e)||(0<n&&(32===n?r=8192:n<=13&&(r=n<<5)),0<=t&&t<=9?(-1===r&&(r=0),r|=t):(e=c[x(e)]||-1,-1!==r&&-1!==e?r|=e:e===a.Double&&(r=e))),r}function P(){f.safeGetCookieMgr(null).setEnabled(!1)}function w(e,n,t){f.areCookiesSupported(null)&&f.safeGetCookieMgr(null).set(e,n,86400*t,null,"/")}function O(e){f.areCookiesSupported(null)&&f.safeGetCookieMgr(null).del(e)}function A(e){return f.areCookiesSupported(null)?T(f.safeGetCookieMgr(null),e):""}function T(e,n,t){var r;return void 0===t&&(t=!0),e&&(r=e.get(n),t&&r&&decodeURIComponent&&(r=decodeURIComponent(r))),r||""}function j(e){void 0===e&&(e="D");var n=f.newGuid();return"B"===e?n="{"+n+"}":"P"===e?n="("+n+")":"N"===e&&(n=n.replace(/-/g,"")),n}function k(e,n,t,r,i){var o={},a=!1,s=0,u=arguments.length,l=Object[f.strPrototype],d=arguments;for("[object Boolean]"===l.toString.call(d[0])&&(a=d[0],s++);s<u;s++)f.objForEachKey(d[s],function(t,e){a&&e&&f.isObject(e)?f.isArray(e)?(o[t]=o[t]||[],f.arrForEach(e,function(e,n){e&&f.isObject(e)?o[t][n]=k(!0,o[t][n],e):o[t][n]=e})):o[t]=k(!0,o[t],e):o[t]=e});return o}var D=f.perfNow;function F(e){return e===i.NotSet||e>i.NotSet&&e<=i.Pii_IPV4AddressLegacy||e===i.CustomerContent_GenericContent}function U(e){return 0<e.length}function R(e){var n=f.addEventHandler("beforeunload",e),n=f.addEventHandler("unload",e)||n;return f.addEventHandler("pagehide",e)||n}function V(e,n){e.timings=e.timings||{},e.timings.processTelemetryStart=e.timings.processTelemetryStart||{},e.timings.processTelemetryStart[n]=D()}function x(e){var n,t=0;return null!==e&&e!==undefined&&("string"==(n=typeof e)?t=1:"number"==n?t=2:"boolean"==n?t=3:n===r.strShimObject&&(t=4,f.isArray(e)?(t=4096,0<e.length&&(t|=x(e[0]))):f.hasOwnProperty(e,"value")&&(t=8192|x(e.value)))),t}var M,_={Version:s,FullVersionString:d,strUndefined:f.strUndefined,strObject:f.strObject,Undefined:f.strUndefined,arrForEach:f.arrForEach,arrIndexOf:f.arrIndexOf,arrMap:f.arrMap,arrReduce:f.arrReduce,objKeys:f.objKeys,toISOString:f.toISOString,isReactNative:f.isReactNative,isString:f.isString,isNumber:f.isNumber,isBoolean:f.isBoolean,isFunction:f.isFunction,isArray:f.isArray,isObject:f.isObject,strTrim:f.strTrim,isDocumentObjectAvailable:v,isWindowObjectAvailable:p,isValueAssigned:h,getTenantId:y,isBeaconsSupported:S,isUint8ArrayAvailable:b,isLatency:C,sanitizeProperty:E,getISOString:f.toISOString,useXDomainRequest:I,getCommonSchemaMetaData:N,cookieAvailable:f.areCookiesSupported,disallowsSameSiteNone:f.uaDisallowsSameSiteNone,setCookie:w,deleteCookie:O,getCookie:A,createGuid:j,extend:k,getTime:D,isValueKind:F,isArrayValid:U,objDefineAccessors:f.objDefineAccessors,addPageUnloadEventListener:R,setProcessTelemetryTimings:V,addEventHandler:f.addEventHandler,getFieldValueType:x,strEndsWith:f.strEndsWith,objForEachKey:f.objForEachKey},H={_canUseCookies:undefined,isTypeof:f.isTypeof,isUndefined:f.isUndefined,isNullOrUndefined:f.isNullOrUndefined,hasOwnProperty:f.hasOwnProperty,isFunction:f.isFunction,isObject:f.isObject,isDate:f.isDate,isArray:f.isArray,isError:f.isError,isString:f.isString,isNumber:f.isNumber,isBoolean:f.isBoolean,toISOString:f.toISOString,arrForEach:f.arrForEach,arrIndexOf:f.arrIndexOf,arrMap:f.arrMap,arrReduce:f.arrReduce,strTrim:f.strTrim,objCreate:r.objCreateFn,objKeys:f.objKeys,objDefineAccessors:f.objDefineAccessors,addEventHandler:f.addEventHandler,dateNow:f.dateNow,isIE:f.isIE,disableCookies:P,newGuid:f.newGuid,perfNow:f.perfNow,newId:f.newId,randomValue:f.randomValue,random32:f.random32,mwcRandomSeed:f.mwcRandomSeed,mwcRandom32:f.mwcRandom32,generateW3CId:f.generateW3CId},G="version",L="properties",B=(M=f.AppInsightsCore,r.__extendsFn(W,M),W);function W(){var e=M.call(this)||this;return e.pluginVersionStringArr=[],e.pluginVersionString="",o(W,e,function(a,s){a.initialize=function(t,r,i,o){f.doPerf(a,function(){return"AppInsightsCore.initialize"},function(){if(t){t.endpointUrl||(t.endpointUrl="https://browser.events.data.microsoft.com/OneCollector/1.0/");var e=t.propertyStorageOverride;if(e&&(!e.getProperty||!e.setProperty))throw Error("Invalid property storage override passed.");t.channels&&f.arrForEach(t.channels,function(e){e&&f.arrForEach(e,function(e){e.identifier&&e.version&&(e=e.identifier+"="+e.version,a.pluginVersionStringArr.push(e))})})}a.getWParam=function(){return"undefined"!=typeof document?0:-1},r&&f.arrForEach(r,function(e){e&&e.identifier&&e.version&&(e=e.identifier+"="+e.version,a.pluginVersionStringArr.push(e))}),a.pluginVersionString=a.pluginVersionStringArr.join(";");try{s.initialize(t,r,i,o)}catch(n){a.logger.throwInternal(f.LoggingSeverity.CRITICAL,l.ErrorProvidedChannels,"Channels must be provided through config.channels only")}a.pollInternalLogs("InternalLog")},function(){return{config:t,extensions:r,logger:i,notificationManager:o}})},a.track=function(t){f.doPerf(a,function(){return"AppInsightsCore.track"},function(){var e,n=t;n&&(n.timings=n.timings||{},n.timings.trackStart=D(),C(n.latency)||(n.latency=u.Normal),(e=n.ext=n.ext||{}).sdk=e.sdk||{},e.sdk.ver=d,(e=n.baseData=n.baseData||{})[L]||(e[L]={}),(e=e[L])[G]||(e[G]=""),""!==a.pluginVersionString&&(e[G]=a.pluginVersionString)),s.track(n)},function(){return{item:t}},!t.sync)}}),e}var z,K=(z=f.BaseCore,r.__extendsFn(q,z),q);function q(){var e=z.call(this)||this;return o(q,e,function(o,a){o.initialize=function(e,n,t,r){e&&(e.endpointUrl||(e.endpointUrl="https://browser.events.data.microsoft.com/OneCollector/1.0/")),o.getWParam=function(){return v?0:-1};try{a.initialize(e,n,t,r)}catch(i){o.logger.throwInternal(f.LoggingSeverity.CRITICAL,l.ErrorProvidedChannels,"Channels must be provided through config.channels only")}},o.track=function(e){var n=e;n&&((e=n.ext=n.ext||{}).sdk=e.sdk||{},e.sdk.ver=d),a.track(n)}}),e}var J=f.isFunction,X=(Q.resolve=function(r){return r instanceof Q?r:r&&J(r.then)?new Q(function(e,n){try{r.then(e,n)}catch(t){n(t)}}):new Q(function(e){e(r)})},Q.reject=function(t){return new Q(function(e,n){n(t)})},Q.all=function(s){if(s&&s.length)return new Q(function(r,e){try{for(var i=[],o=0,n=0;n<s.length;n++){var t=s[n];t&&J(t.then)?(o++,t.then(function(n,t){return function(e){n[t]=e,0==--o&&r(i)}}(i,n),e)):i[n]=t}0===o&&setTimeout(function(){r(i)},0)}catch(a){e(a)}})},Q.race=function(i){return new Q(function(n,t){if(i&&i.length)try{for(var r=0;r<i.length;r++)!function(){var e=i[r];e&&J(e.then)?e.then(n,t):setTimeout(function(){n(e)},0)}()}catch(e){t(e)}})},Q);function Q(n){var a=0,s=null,e=[];function i(t,r,i,o){e.push(function(){var e;try{(e=1===a?J(t)?t(s):s:J(r)?r(s):s)instanceof Q?e.then(i,o):(2!==a||J(r)?i:o)(e)}catch(n){return void o(n)}}),0!==a&&u()}function u(){var r;0<e.length&&(r=e.slice(),e=[],setTimeout(function(){for(var e=0,n=r.length;e<n;++e)try{r[e]()}catch(t){}},0))}function t(e){0===a&&(s=e,a=1,u())}function r(e){0===a&&(s=e,a=2,u())}o(Q,this,function(n){n.then=function(t,r){return new Q(function(e,n){i(t,r,e,n)})},n["catch"]=function(e){return n.then(null,e)}}),function(){if(!J(n))throw new TypeError("ESPromise: resolvedFunc argument is not a Function");try{n(t,r)}catch(e){r(e)}}()}var Z=6e5,Y=0,$=[],ee=[],ne=[];function te(){return(new Date).getTime()}function re(e,n){var p=0,h=(e||"<unnamed>")+"."+Y;function y(e){var n=f.getGlobal();n&&n.QUnit&&console&&console.log("ESPromiseScheduler["+h+"] "+e)}function S(e){n&&n.warnToConsole("ESPromiseScheduler["+h+"] "+e)}Y++,o(re,this,function(e){var g=null,m=0;function v(e,n){for(var t=0;t<e.length;t++)if(e[t].id===n)return e.splice(t,1)[0];return null}e.scheduleEvent=function(t,e,s){var i=h+"."+m;m++,e&&(i+="-("+e+")");var o,a,n,r=i+"{"+p+"}";return p++,(e={evt:null,tm:te(),id:r,isRunning:!1,isAborted:!1}).evt=g?(o=e,a=g,n=new X(function(n,t){var e=te()-a.tm,r=a.id;y("["+i+"] is waiting for ["+r+":"+e+" ms] to complete before starting -- ["+ee.length+"] waiting and ["+$.length+"] running"),o.abort=function(e){o.abort=null,v(ee,i),o.isAborted=!0,t(Error(e))},a.evt.then(function(e){v(ee,i),f(o).then(n,t)},function(e){v(ee,i),f(o).then(n,t)})}),ee.push(o),n):f(e),(g=e).evt._schId=r,e.evt;function u(e){for(var n=te(),t=n-Z,r=e.length,i=0;i<r;){var o,a=e[i];a&&a.tm<t?(o=null,a.abort?(o="Aborting ["+a.id+"] due to Excessive runtime ("+(n-a.tm)+" ms)",a.abort(o)):o="Removing ["+a.id+"] due to Excessive runtime ("+(n-a.tm)+" ms)",S(o),e.splice(i,1),r--):i++}}function l(e,n){var t,r=!1,i=v($,e);i||(i=v(ne,e),r=!0),i?(i.to&&(clearTimeout(i.to),i.to=null),t=te()-i.tm,n?r?S("Timed out event ["+e+"] finally complete -- "+t+" ms"):y("Promise ["+e+"] Complete -- "+t+" ms"):(ne.push(i),S("Event ["+e+"] Timed out and removed -- "+t+" ms"))):y("Failed to remove ["+e+"] from running queue"),g&&g.id===e&&(g=null),u($),u(ee),u(ne)}function d(n,t){return function(e){return l(n,!0),t&&t(e),e}}function c(r,o){var a=r.id;return new X(function(n,t){y("Event ["+a+"] Starting -- waited for "+(r.wTm||"--")+" ms"),r.isRunning=!0,r.abort=function(e){r.abort=null,r.isAborted=!0,l(a,!1),t(Error(e))};var e=o(a);e instanceof X?(s&&(r.to=setTimeout(function(){l(a,!1),t(Error("Timed out after ["+s+"] ms"))},s)),function i(n,e,t,r){e.then(function(e){return e instanceof X?(y("Event ["+n+"] returned a promise -- waiting"),i(n,e,t,r),e):d(n,t)(e)},d(n,r))}(a,e,function(e){y("Event ["+a+"] Resolving after "+(te()-r.tm)+" ms"),n(e)},t)):(y("Promise ["+a+"] Auto completed as the start action did not return a promise"),n())})}function f(e){var n=te();return e.wTm=n-e.tm,e.tm=n,e.isAborted?X.reject(Error("["+i+"] was aborted")):($.push(e),c(e,t))}}})}re.incomplete=function(){return $},re.waitingToStart=function(){return ee},n=re;var ie=(oe.getFieldType=x,oe);function oe(e){var l=this,o={},a=[],s=[];function u(e,n){var t=o[e];if(!(i=t?t[n]:i)&&null!==i){if(f.isString(e)&&f.isString(n))if(0<s.length){for(var r=0;r<s.length;r++)if(s[r].handleField(e,n)){i={canHandle:!0,fieldHandler:s[r]};break}}else 0===a.length&&(i={canHandle:!0});if(!i&&null!==i)for(var i=null,r=0;r<a.length;r++)if(a[r].handleField(e,n)){i={canHandle:!0,handler:a[r],fieldHandler:null};break}(t=t||(o[e]={}))[n]=i}return i}function d(e,n,t,r,i,o){if(e.handler)return e.handler.property(n,t,i,o);if(!f.isNullOrUndefined(i.kind)){if(4096==(4096&r)||!F(i.kind))return null;i.value=i.value.toString()}return function u(i,o,a,e,n){var t,s,r;return n&&i&&(t=i.getSanitizer(o,a,e,n.kind,n.propertyType))&&(4===e?(s={},r=n.value,f.objForEachKey(r,function(e,n){var t,r=o+"."+a;h(n)&&(t=c(0,0,n),(t=u(i,r,e,x(n),t))&&(s[e]=t.value))}),n.value=s):n=t.call(l,e={path:o,name:a,type:e,prop:n,sanitizer:l})),n}(e.fieldHandler,n,t,r,i)}function c(e,n,t){return h(t)?{value:t}:null}e&&s.push(e),l.addSanitizer=function(e){e&&(a.push(e),o={})},l.addFieldSanitizer=function(e){e&&(s.push(e),o={})},l.handleField=function(e,n){return!!(n=u(e,n))&&n.canHandle},l.value=function(e,n,t,r){var i=u(e,n);if(i&&i.canHandle){if(!i||!i.canHandle)return null;if(i.handler)return i.handler.value(e,n,t,r);if(!f.isString(n)||f.isNullOrUndefined(t)||""===t)return null;var o=null,a=x(t);if(8192==(8192&a)){var s=-8193&a;if(!h((o=t).value)||1!=s&&2!=s&&3!=s&&4096!=(4096&s))return null}else 1===a||2===a||3===a||4096==(4096&a)?o=c(0,0,t):4===a&&(o=c(0,0,r?JSON.stringify(t):t));if(o)return d(i,e,n,a,o,r)}return null},l.property=function(e,n,t,r){var i=u(e,n);if(!i||!i.canHandle)return null;if(!f.isString(n)||f.isNullOrUndefined(t)||!h(t.value))return null;var o=x(t.value);return 0===o?null:d(i,e,n,o,t,r)}}e.BaseTelemetryPlugin=f.BaseTelemetryPlugin,e.DiagnosticLogger=f.DiagnosticLogger,e.EventHelper=f.EventHelper,e.EventsDiscardedReason=f.EventsDiscardedReason,e.LoggingSeverity=f.LoggingSeverity,e.MinChannelPriorty=f.MinChannelPriorty,e.NotificationManager=f.NotificationManager,e.PerfEvent=f.PerfEvent,e.PerfManager=f.PerfManager,e.ProcessTelemetryContext=f.ProcessTelemetryContext,e.Undefined=f.strUndefined,e.addEventHandler=f.addEventHandler,e.areCookiesSupported=f.areCookiesSupported,e.arrForEach=f.arrForEach,e.arrIndexOf=f.arrIndexOf,e.arrMap=f.arrMap,e.arrReduce=f.arrReduce,e.attachEvent=f.attachEvent,e.cookieAvailable=f.areCookiesSupported,e.createCookieMgr=f.createCookieMgr,e.dateNow=f.dateNow,e.detachEvent=f.detachEvent,e.disallowsSameSiteNone=f.uaDisallowsSameSiteNone,e.doPerf=f.doPerf,e.dumpObj=f.dumpObj,e.generateW3CId=f.generateW3CId,e.getConsole=f.getConsole,e.getCrypto=f.getCrypto,e.getDocument=f.getDocument,e.getExceptionName=f.getExceptionName,e.getGlobal=f.getGlobal,e.getGlobalInst=f.getGlobalInst,e.getHistory=f.getHistory,e.getIEVersion=f.getIEVersion,e.getISOString=f.toISOString,e.getJSON=f.getJSON,e.getLocation=f.getLocation,e.getMsCrypto=f.getMsCrypto,e.getNavigator=f.getNavigator,e.getPerformance=f.getPerformance,e.getSetValue=f.getSetValue,e.getWindow=f.getWindow,e.hasDocument=f.hasDocument,e.hasHistory=f.hasHistory,e.hasJSON=f.hasJSON,e.hasNavigator=f.hasNavigator,e.hasOwnProperty=f.hasOwnProperty,e.hasWindow=f.hasWindow,e.isArray=f.isArray,e.isBoolean=f.isBoolean,e.isDate=f.isDate,e.isError=f.isError,e.isFunction=f.isFunction,e.isIE=f.isIE,e.isNotTruthy=f.isNotTruthy,e.isNullOrUndefined=f.isNullOrUndefined,e.isNumber=f.isNumber,e.isObject=f.isObject,e.isReactNative=f.isReactNative,e.isString=f.isString,e.isTruthy=f.isTruthy,e.isTypeof=f.isTypeof,e.isUndefined=f.isUndefined,e.newGuid=f.newGuid,e.newId=f.newId,e.normalizeJsName=f.normalizeJsName,e.objCreate=f.objCreate,e.objDefineAccessors=f.objDefineAccessors,e.objForEachKey=f.objForEachKey,e.objKeys=f.objKeys,e.optimizeObject=f.optimizeObject,e.perfNow=f.perfNow,e.proxyAssign=f.proxyAssign,e.random32=f.random32,e.randomValue=f.randomValue,e.safeGetCookieMgr=f.safeGetCookieMgr,e.safeGetLogger=f.safeGetLogger,e.setEnableEnvMocks=f.setEnableEnvMocks,e.setValue=f.setValue,e.strContains=f.strContains,e.strEndsWith=f.strEndsWith,e.strExtensionConfig=f.strExtensionConfig,e.strFunction=f.strFunction,e.strIKey=f.strIKey,e.strObject=f.strObject,e.strPrototype=f.strPrototype,e.strStartsWith=f.strStartsWith,e.strTrim=f.strTrim,e.strUndefined=f.strUndefined,e.throwError=f.throwError,e.toISOString=f.toISOString,e.AppInsightsCore=B,e.BaseCore=K,e.CoreUtils=H,e.ESPromise=X,e.ESPromiseScheduler=n,e.EventLatency=u,e.EventPersistence={Normal:1,Critical:2},e.EventPropertyType=a,e.FullVersionString=d,e.TraceLevel={NONE:0,ERROR:1,WARNING:2,INFORMATION:3},e.Utils=_,e.ValueKind=i,e.ValueSanitizer=ie,e.Version=s,e._ExtendedInternalMessageId=l,e.addPageUnloadEventListener=R,e.createGuid=j,e.deleteCookie=O,e.disableCookies=P,e.extend=k,e.getCommonSchemaMetaData=N,e.getCookie=A,e.getCookieValue=T,e.getFieldValueType=x,e.getTenantId=y,e.getTime=D,e.isArrayValid=U,e.isBeaconsSupported=S,e.isChromium=function(){return!!f.getGlobalInst("chrome")},e.isDocumentObjectAvailable=v,e.isLatency=C,e.isUint8ArrayAvailable=b,e.isValueAssigned=h,e.isValueKind=F,e.isWindowObjectAvailable=p,e.sanitizeProperty=E,e.setCookie=w,e.setProcessTelemetryTimings=V,e.useXDomainRequest=I,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@microsoft/applicationinsights-shims"),require("@microsoft/applicationinsights-core-js"),require("@microsoft/dynamicproto-js")):"function"==typeof define&&define.amd?define(["exports","@microsoft/applicationinsights-shims","@microsoft/applicationinsights-core-js","@microsoft/dynamicproto-js"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).oneDS=e.oneDS||{},e.applicationinsightsShims,e.applicationinsightsCoreJs,e.dynamicProto); | ||
var e=this,n=function(e,r,f,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}var o=t(n),i={NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32},u={Normal:1,CostDeferred:2,RealTime:3,Immediate:4},a={Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9},l=r.__assignFn(r.__assignFn({},f._InternalMessageId),{AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}),s="3.1.3",d="1DS-Web-JS-"+s,c=((se={})[0]=a.Unspecified,se[2]=a.Double,se[1]=a.String,se[3]=a.Bool,se[4098]=a.Double,se[4097]=a.String,se[4099]=a.Bool,se),g=null,v=null,m=null;function p(e,n){var t,r=!1;if(e&&((r=n in e)||(t=e.prototype)&&(r=n in t),!r))try{var i=new e,r=!f.isUndefined(i[n])}catch(o){}return r}var h=!!f.getDocument(),y=!!f.getWindow();function S(e){return!(""===e||f.isNullOrUndefined(e))}function b(e){if(e){var n=e.indexOf("-");if(-1<n)return e.substring(0,n)}return""}function C(){return v=null===v?f.hasNavigator()&&!!f.getNavigator().sendBeacon:v}function E(){return typeof XMLHttpRequest!==undefined}function I(){return m=null===m?!(f.isUndefined(Uint8Array)||(e=f.getNavigator(),!f.isUndefined(e)&&e.userAgent&&(~(e=e.userAgent.toLowerCase()).indexOf("safari")||~e.indexOf("firefox"))&&!~e.indexOf("chrome"))||f.isReactNative()):m;var e}function N(e){return!!(e&&f.isNumber(e)&&e>=u.Normal&&e<=u.Immediate)}function P(e,n,t){if(!n&&!S(n)||"string"!=typeof e)return null;if("string"==(e=typeof n)||"number"==e||"boolean"==e||f.isArray(n))n={value:n};else if("object"!=e||n.hasOwnProperty("value")){if(f.isNullOrUndefined(n.value)||""===n.value||!f.isString(n.value)&&!f.isNumber(n.value)&&!f.isBoolean(n.value)&&!f.isArray(n.value))return null}else n={value:t?JSON.stringify(n):n};if(f.isArray(n.value)&&!x(n.value))return null;if(!f.isNullOrUndefined(n.kind)){if(f.isArray(n.value)||!V(n.kind))return null;n.value=n.value.toString()}return n}function w(){return g=null===g&&(g=typeof XDomainRequest!==undefined)&&E()?g&&!p(XMLHttpRequest,"withCredentials"):g}function O(e,n,t){var r=-1;return f.isUndefined(e)||(0<n&&(32===n?r=8192:n<=13&&(r=n<<5)),0<=t&&t<=9?(-1===r&&(r=0),r|=t):(e=c[G(e)]||-1,-1!==r&&-1!==e?r|=e:e===a.Double&&(r=e))),r}function A(){f.safeGetCookieMgr(null).setEnabled(!1)}function T(e,n,t){f.areCookiesSupported(null)&&f.safeGetCookieMgr(null).set(e,n,86400*t,null,"/")}function j(e){f.areCookiesSupported(null)&&f.safeGetCookieMgr(null).del(e)}function k(e){return f.areCookiesSupported(null)?F(f.safeGetCookieMgr(null),e):""}function F(e,n,t){var r;return void 0===t&&(t=!0),e&&(r=e.get(n),t&&r&&decodeURIComponent&&(r=decodeURIComponent(r))),r||""}function D(e){void 0===e&&(e="D");var n=f.newGuid();return"B"===e?n="{"+n+"}":"P"===e?n="("+n+")":"N"===e&&(n=n.replace(/-/g,"")),n}function U(e,n,t,r,i){var o={},a=!1,s=0,u=arguments.length,l=Object[f.strPrototype],d=arguments;for("[object Boolean]"===l.toString.call(d[0])&&(a=d[0],s++);s<u;s++)f.objForEachKey(d[s],function(t,e){a&&e&&f.isObject(e)?f.isArray(e)?(o[t]=o[t]||[],f.arrForEach(e,function(e,n){e&&f.isObject(e)?o[t][n]=U(!0,o[t][n],e):o[t][n]=e})):o[t]=U(!0,o[t],e):o[t]=e});return o}var R=f.perfNow;function V(e){return e===i.NotSet||e>i.NotSet&&e<=i.Pii_IPV4AddressLegacy||e===i.CustomerContent_GenericContent}function x(e){return 0<e.length}function M(e){var n=f.addEventHandler("beforeunload",e),n=f.addEventHandler("unload",e)||n;return f.addEventHandler("pagehide",e)||n}function _(e,n){e.timings=e.timings||{},e.timings.processTelemetryStart=e.timings.processTelemetryStart||{},e.timings.processTelemetryStart[n]=R()}function G(e){var n,t=0;return null!==e&&e!==undefined&&("string"==(n=typeof e)?t=1:"number"==n?t=2:"boolean"==n?t=3:n===r.strShimObject&&(t=4,f.isArray(e)?(t=4096,0<e.length&&(t|=G(e[0]))):f.hasOwnProperty(e,"value")&&(t=8192|G(e.value)))),t}var H,L={Version:s,FullVersionString:d,strUndefined:f.strUndefined,strObject:f.strObject,Undefined:f.strUndefined,arrForEach:f.arrForEach,arrIndexOf:f.arrIndexOf,arrMap:f.arrMap,arrReduce:f.arrReduce,objKeys:f.objKeys,toISOString:f.toISOString,isReactNative:f.isReactNative,isString:f.isString,isNumber:f.isNumber,isBoolean:f.isBoolean,isFunction:f.isFunction,isArray:f.isArray,isObject:f.isObject,strTrim:f.strTrim,isDocumentObjectAvailable:h,isWindowObjectAvailable:y,isValueAssigned:S,getTenantId:b,isBeaconsSupported:C,isUint8ArrayAvailable:I,isLatency:N,sanitizeProperty:P,getISOString:f.toISOString,useXDomainRequest:w,getCommonSchemaMetaData:O,cookieAvailable:f.areCookiesSupported,disallowsSameSiteNone:f.uaDisallowsSameSiteNone,setCookie:T,deleteCookie:j,getCookie:k,createGuid:D,extend:U,getTime:R,isValueKind:V,isArrayValid:x,objDefineAccessors:f.objDefineAccessors,addPageUnloadEventListener:M,setProcessTelemetryTimings:_,addEventHandler:f.addEventHandler,getFieldValueType:G,strEndsWith:f.strEndsWith,objForEachKey:f.objForEachKey},B={_canUseCookies:undefined,isTypeof:f.isTypeof,isUndefined:f.isUndefined,isNullOrUndefined:f.isNullOrUndefined,hasOwnProperty:f.hasOwnProperty,isFunction:f.isFunction,isObject:f.isObject,isDate:f.isDate,isArray:f.isArray,isError:f.isError,isString:f.isString,isNumber:f.isNumber,isBoolean:f.isBoolean,toISOString:f.toISOString,arrForEach:f.arrForEach,arrIndexOf:f.arrIndexOf,arrMap:f.arrMap,arrReduce:f.arrReduce,strTrim:f.strTrim,objCreate:r.objCreateFn,objKeys:f.objKeys,objDefineAccessors:f.objDefineAccessors,addEventHandler:f.addEventHandler,dateNow:f.dateNow,isIE:f.isIE,disableCookies:A,newGuid:f.newGuid,perfNow:f.perfNow,newId:f.newId,randomValue:f.randomValue,random32:f.random32,mwcRandomSeed:f.mwcRandomSeed,mwcRandom32:f.mwcRandom32,generateW3CId:f.generateW3CId},W="version",z="properties",K=(H=f.AppInsightsCore,r.__extendsFn(q,H),q);function q(){var e=H.call(this)||this;return e.pluginVersionStringArr=[],e.pluginVersionString="",o(q,e,function(a,s){a.initialize=function(t,r,i,o){f.doPerf(a,function(){return"AppInsightsCore.initialize"},function(){if(t){t.endpointUrl||(t.endpointUrl="https://browser.events.data.microsoft.com/OneCollector/1.0/");var e=t.propertyStorageOverride;if(e&&(!e.getProperty||!e.setProperty))throw Error("Invalid property storage override passed.");t.channels&&f.arrForEach(t.channels,function(e){e&&f.arrForEach(e,function(e){e.identifier&&e.version&&(e=e.identifier+"="+e.version,a.pluginVersionStringArr.push(e))})})}a.getWParam=function(){return"undefined"!=typeof document?0:-1},r&&f.arrForEach(r,function(e){e&&e.identifier&&e.version&&(e=e.identifier+"="+e.version,a.pluginVersionStringArr.push(e))}),a.pluginVersionString=a.pluginVersionStringArr.join(";");try{s.initialize(t,r,i,o)}catch(n){a.logger.throwInternal(f.LoggingSeverity.CRITICAL,l.ErrorProvidedChannels,"Channels must be provided through config.channels only")}a.pollInternalLogs("InternalLog")},function(){return{config:t,extensions:r,logger:i,notificationManager:o}})},a.track=function(t){f.doPerf(a,function(){return"AppInsightsCore.track"},function(){var e,n=t;n&&(n.timings=n.timings||{},n.timings.trackStart=R(),N(n.latency)||(n.latency=u.Normal),(e=n.ext=n.ext||{}).sdk=e.sdk||{},e.sdk.ver=d,(e=n.baseData=n.baseData||{})[z]||(e[z]={}),(e=e[z])[W]||(e[W]=""),""!==a.pluginVersionString&&(e[W]=a.pluginVersionString)),s.track(n)},function(){return{item:t}},!t.sync)}}),e}var J,X=(J=f.BaseCore,r.__extendsFn(Q,J),Q);function Q(){var e=J.call(this)||this;return o(Q,e,function(o,a){o.initialize=function(e,n,t,r){e&&(e.endpointUrl||(e.endpointUrl="https://browser.events.data.microsoft.com/OneCollector/1.0/")),o.getWParam=function(){return h?0:-1};try{a.initialize(e,n,t,r)}catch(i){o.logger.throwInternal(f.LoggingSeverity.CRITICAL,l.ErrorProvidedChannels,"Channels must be provided through config.channels only")}},o.track=function(e){var n=e;n&&((e=n.ext=n.ext||{}).sdk=e.sdk||{},e.sdk.ver=d),a.track(n)}}),e}var Z=f.isFunction,Y=($.resolve=function(r){return r instanceof $?r:r&&Z(r.then)?new $(function(e,n){try{r.then(e,n)}catch(t){n(t)}}):new $(function(e){e(r)})},$.reject=function(t){return new $(function(e,n){n(t)})},$.all=function(s){if(s&&s.length)return new $(function(r,e){try{for(var i=[],o=0,n=0;n<s.length;n++){var t=s[n];t&&Z(t.then)?(o++,t.then(function(n,t){return function(e){n[t]=e,0==--o&&r(i)}}(i,n),e)):i[n]=t}0===o&&setTimeout(function(){r(i)},0)}catch(a){e(a)}})},$.race=function(i){return new $(function(n,t){if(i&&i.length)try{for(var r=0;r<i.length;r++)!function(){var e=i[r];e&&Z(e.then)?e.then(n,t):setTimeout(function(){n(e)},0)}()}catch(e){t(e)}})},$);function $(n){var a=0,s=null,e=[];function i(t,r,i,o){e.push(function(){var e;try{(e=1===a?Z(t)?t(s):s:Z(r)?r(s):s)instanceof $?e.then(i,o):(2!==a||Z(r)?i:o)(e)}catch(n){return void o(n)}}),0!==a&&u()}function u(){var r;0<e.length&&(r=e.slice(),e=[],setTimeout(function(){for(var e=0,n=r.length;e<n;++e)try{r[e]()}catch(t){}},0))}function t(e){0===a&&(s=e,a=1,u())}function r(e){0===a&&(s=e,a=2,u())}o($,this,function(n){n.then=function(t,r){return new $(function(e,n){i(t,r,e,n)})},n["catch"]=function(e){return n.then(null,e)}}),function(){if(!Z(n))throw new TypeError("ESPromise: resolvedFunc argument is not a Function");try{n(t,r)}catch(e){r(e)}}()}var ee=6e5,ne=0,te=[],re=[],ie=[];function oe(){return(new Date).getTime()}function ae(e,n){var p=0,h=(e||"<unnamed>")+"."+ne;function y(e){var n=f.getGlobal();n&&n.QUnit&&console&&console.log("ESPromiseScheduler["+h+"] "+e)}function S(e){n&&n.warnToConsole("ESPromiseScheduler["+h+"] "+e)}ne++,o(ae,this,function(e){var g=null,v=0;function m(e,n){for(var t=0;t<e.length;t++)if(e[t].id===n)return e.splice(t,1)[0];return null}e.scheduleEvent=function(t,e,s){var i=h+"."+v;v++,e&&(i+="-("+e+")");var o,a,n,r=i+"{"+p+"}";return p++,(e={evt:null,tm:oe(),id:r,isRunning:!1,isAborted:!1}).evt=g?(o=e,a=g,n=new Y(function(n,t){var e=oe()-a.tm,r=a.id;y("["+i+"] is waiting for ["+r+":"+e+" ms] to complete before starting -- ["+re.length+"] waiting and ["+te.length+"] running"),o.abort=function(e){o.abort=null,m(re,i),o.isAborted=!0,t(Error(e))},a.evt.then(function(e){m(re,i),f(o).then(n,t)},function(e){m(re,i),f(o).then(n,t)})}),re.push(o),n):f(e),(g=e).evt._schId=r,e.evt;function u(e){for(var n=oe(),t=n-ee,r=e.length,i=0;i<r;){var o,a=e[i];a&&a.tm<t?(o=null,a.abort?(o="Aborting ["+a.id+"] due to Excessive runtime ("+(n-a.tm)+" ms)",a.abort(o)):o="Removing ["+a.id+"] due to Excessive runtime ("+(n-a.tm)+" ms)",S(o),e.splice(i,1),r--):i++}}function l(e,n){var t,r=!1,i=m(te,e);i||(i=m(ie,e),r=!0),i?(i.to&&(clearTimeout(i.to),i.to=null),t=oe()-i.tm,n?r?S("Timed out event ["+e+"] finally complete -- "+t+" ms"):y("Promise ["+e+"] Complete -- "+t+" ms"):(ie.push(i),S("Event ["+e+"] Timed out and removed -- "+t+" ms"))):y("Failed to remove ["+e+"] from running queue"),g&&g.id===e&&(g=null),u(te),u(re),u(ie)}function d(n,t){return function(e){return l(n,!0),t&&t(e),e}}function c(r,o){var a=r.id;return new Y(function(n,t){y("Event ["+a+"] Starting -- waited for "+(r.wTm||"--")+" ms"),r.isRunning=!0,r.abort=function(e){r.abort=null,r.isAborted=!0,l(a,!1),t(Error(e))};var e=o(a);e instanceof Y?(s&&(r.to=setTimeout(function(){l(a,!1),t(Error("Timed out after ["+s+"] ms"))},s)),function i(n,e,t,r){e.then(function(e){return e instanceof Y?(y("Event ["+n+"] returned a promise -- waiting"),i(n,e,t,r),e):d(n,t)(e)},d(n,r))}(a,e,function(e){y("Event ["+a+"] Resolving after "+(oe()-r.tm)+" ms"),n(e)},t)):(y("Promise ["+a+"] Auto completed as the start action did not return a promise"),n())})}function f(e){var n=oe();return e.wTm=n-e.tm,e.tm=n,e.isAborted?Y.reject(Error("["+i+"] was aborted")):(te.push(e),c(e,t))}}})}ae.incomplete=function(){return te},ae.waitingToStart=function(){return re},n=ae;var se=(ue.getFieldType=G,ue);function ue(e){var l=this,o={},a=[],s=[];function u(e,n){var t=o[e];if(!(i=t?t[n]:i)&&null!==i){if(f.isString(e)&&f.isString(n))if(0<s.length){for(var r=0;r<s.length;r++)if(s[r].handleField(e,n)){i={canHandle:!0,fieldHandler:s[r]};break}}else 0===a.length&&(i={canHandle:!0});if(!i&&null!==i)for(var i=null,r=0;r<a.length;r++)if(a[r].handleField(e,n)){i={canHandle:!0,handler:a[r],fieldHandler:null};break}(t=t||(o[e]={}))[n]=i}return i}function d(e,n,t,r,i,o){if(e.handler)return e.handler.property(n,t,i,o);if(!f.isNullOrUndefined(i.kind)){if(4096==(4096&r)||!V(i.kind))return null;i.value=i.value.toString()}return function u(i,o,a,e,n){var t,s,r;return n&&i&&(t=i.getSanitizer(o,a,e,n.kind,n.propertyType))&&(4===e?(s={},r=n.value,f.objForEachKey(r,function(e,n){var t,r=o+"."+a;S(n)&&(t=c(0,0,n),(t=u(i,r,e,G(n),t))&&(s[e]=t.value))}),n.value=s):n=t.call(l,e={path:o,name:a,type:e,prop:n,sanitizer:l})),n}(e.fieldHandler,n,t,r,i)}function c(e,n,t){return S(t)?{value:t}:null}e&&s.push(e),l.addSanitizer=function(e){e&&(a.push(e),o={})},l.addFieldSanitizer=function(e){e&&(s.push(e),o={})},l.handleField=function(e,n){return!!(n=u(e,n))&&n.canHandle},l.value=function(e,n,t,r){var i=u(e,n);if(i&&i.canHandle){if(!i||!i.canHandle)return null;if(i.handler)return i.handler.value(e,n,t,r);if(!f.isString(n)||f.isNullOrUndefined(t)||""===t)return null;var o=null,a=G(t);if(8192==(8192&a)){var s=-8193&a;if(!S((o=t).value)||1!=s&&2!=s&&3!=s&&4096!=(4096&s))return null}else 1===a||2===a||3===a||4096==(4096&a)?o=c(0,0,t):4===a&&(o=c(0,0,r?JSON.stringify(t):t));if(o)return d(i,e,n,a,o,r)}return null},l.property=function(e,n,t,r){var i=u(e,n);if(!i||!i.canHandle)return null;if(!f.isString(n)||f.isNullOrUndefined(t)||!S(t.value))return null;var o=G(t.value);return 0===o?null:d(i,e,n,o,t,r)}}e.BaseTelemetryPlugin=f.BaseTelemetryPlugin,e.DiagnosticLogger=f.DiagnosticLogger,e.EventHelper=f.EventHelper,e.EventsDiscardedReason=f.EventsDiscardedReason,e.LoggingSeverity=f.LoggingSeverity,e.MinChannelPriorty=f.MinChannelPriorty,e.NotificationManager=f.NotificationManager,e.PerfEvent=f.PerfEvent,e.PerfManager=f.PerfManager,e.ProcessTelemetryContext=f.ProcessTelemetryContext,e.Undefined=f.strUndefined,e.addEventHandler=f.addEventHandler,e.areCookiesSupported=f.areCookiesSupported,e.arrForEach=f.arrForEach,e.arrIndexOf=f.arrIndexOf,e.arrMap=f.arrMap,e.arrReduce=f.arrReduce,e.attachEvent=f.attachEvent,e.cookieAvailable=f.areCookiesSupported,e.createCookieMgr=f.createCookieMgr,e.dateNow=f.dateNow,e.detachEvent=f.detachEvent,e.disallowsSameSiteNone=f.uaDisallowsSameSiteNone,e.doPerf=f.doPerf,e.dumpObj=f.dumpObj,e.generateW3CId=f.generateW3CId,e.getConsole=f.getConsole,e.getCrypto=f.getCrypto,e.getDocument=f.getDocument,e.getExceptionName=f.getExceptionName,e.getGlobal=f.getGlobal,e.getGlobalInst=f.getGlobalInst,e.getHistory=f.getHistory,e.getIEVersion=f.getIEVersion,e.getISOString=f.toISOString,e.getJSON=f.getJSON,e.getLocation=f.getLocation,e.getMsCrypto=f.getMsCrypto,e.getNavigator=f.getNavigator,e.getPerformance=f.getPerformance,e.getSetValue=f.getSetValue,e.getWindow=f.getWindow,e.hasDocument=f.hasDocument,e.hasHistory=f.hasHistory,e.hasJSON=f.hasJSON,e.hasNavigator=f.hasNavigator,e.hasOwnProperty=f.hasOwnProperty,e.hasWindow=f.hasWindow,e.isArray=f.isArray,e.isBoolean=f.isBoolean,e.isDate=f.isDate,e.isError=f.isError,e.isFunction=f.isFunction,e.isIE=f.isIE,e.isNotTruthy=f.isNotTruthy,e.isNullOrUndefined=f.isNullOrUndefined,e.isNumber=f.isNumber,e.isObject=f.isObject,e.isReactNative=f.isReactNative,e.isString=f.isString,e.isTruthy=f.isTruthy,e.isTypeof=f.isTypeof,e.isUndefined=f.isUndefined,e.newGuid=f.newGuid,e.newId=f.newId,e.normalizeJsName=f.normalizeJsName,e.objCreate=f.objCreate,e.objDefineAccessors=f.objDefineAccessors,e.objForEachKey=f.objForEachKey,e.objKeys=f.objKeys,e.optimizeObject=f.optimizeObject,e.perfNow=f.perfNow,e.proxyAssign=f.proxyAssign,e.random32=f.random32,e.randomValue=f.randomValue,e.safeGetCookieMgr=f.safeGetCookieMgr,e.safeGetLogger=f.safeGetLogger,e.setEnableEnvMocks=f.setEnableEnvMocks,e.setValue=f.setValue,e.strContains=f.strContains,e.strEndsWith=f.strEndsWith,e.strExtensionConfig=f.strExtensionConfig,e.strFunction=f.strFunction,e.strIKey=f.strIKey,e.strObject=f.strObject,e.strPrototype=f.strPrototype,e.strStartsWith=f.strStartsWith,e.strTrim=f.strTrim,e.strUndefined=f.strUndefined,e.throwError=f.throwError,e.toISOString=f.toISOString,e.AppInsightsCore=K,e.BaseCore=X,e.CoreUtils=B,e.ESPromise=Y,e.ESPromiseScheduler=n,e.EventLatency=u,e.EventPersistence={Normal:1,Critical:2},e.EventPropertyType=a,e.FullVersionString=d,e.TraceLevel={NONE:0,ERROR:1,WARNING:2,INFORMATION:3},e.Utils=L,e.ValueKind=i,e.ValueSanitizer=se,e.Version=s,e._ExtendedInternalMessageId=l,e.addPageUnloadEventListener=M,e.createGuid=D,e.deleteCookie=j,e.disableCookies=A,e.extend=U,e.getCommonSchemaMetaData=O,e.getCookie=k,e.getCookieValue=F,e.getFieldValueType=G,e.getTenantId=b,e.getTime=R,e.isArrayValid=x,e.isBeaconsSupported=C,e.isChromium=function(){return!!f.getGlobalInst("chrome")},e.isDocumentObjectAvailable=h,e.isFetchSupported=function(e){var n=!1;try{var n=!!f.getGlobalInst("fetch"),t=f.getGlobalInst("Request");n&&e&&t&&(n=p(t,"keepalive"))}catch(r){}return n},e.isLatency=N,e.isUint8ArrayAvailable=I,e.isValueAssigned=S,e.isValueKind=V,e.isWindowObjectAvailable=y,e.isXhrSupported=E,e.sanitizeProperty=P,e.setCookie=T,e.setProcessTelemetryTimings=_,e.useXDomainRequest=w,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(i){}typeof t.value!==undefined&&(e[n]=t.value)}(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@microsoft/applicationinsights-shims"),require("@microsoft/applicationinsights-core-js"),require("@microsoft/dynamicproto-js")):"function"==typeof define&&define.amd?define(["exports","@microsoft/applicationinsights-shims","@microsoft/applicationinsights-core-js","@microsoft/dynamicproto-js"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).oneDS=e.oneDS||{},e.applicationinsightsShims,e.applicationinsightsCoreJs,e.dynamicProto); | ||
//# sourceMappingURL=ms.core.min.js.map |
{ | ||
"name": "@microsoft/1ds-core-js", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "Microsoft Application Insights JavaScript SDK - 1ds-core-js extensions", | ||
@@ -35,4 +35,4 @@ "author": "Microsoft Application Insights Team", | ||
"@microsoft/applicationinsights-shims": "^2.0.0", | ||
"@microsoft/applicationinsights-core-js": "2.6.2", | ||
"@microsoft/dynamicproto-js": "^1.1.2" | ||
"@microsoft/applicationinsights-core-js": "2.6.3", | ||
"@microsoft/dynamicproto-js": "^1.1.4" | ||
}, | ||
@@ -42,4 +42,5 @@ "devDependencies": { | ||
"typedoc": "^0.15.1", | ||
"typescript": "^3.4.3" | ||
"typescript": "^3.4.3", | ||
"pako": "^2.0.3" | ||
} | ||
} |
@@ -72,3 +72,3 @@ /** | ||
LoggingSeverity.CRITICAL, | ||
_ExtendedInternalMessageId.ErrorProvidedChannels, "Channels must be provided through config.channels only", | ||
_ExtendedInternalMessageId.ErrorProvidedChannels, "Channels must be provided through config.channels only" | ||
); | ||
@@ -75,0 +75,0 @@ } |
@@ -41,3 +41,3 @@ /** | ||
LoggingSeverity.CRITICAL, | ||
_ExtendedInternalMessageId.ErrorProvidedChannels, "Channels must be provided through config.channels only", | ||
_ExtendedInternalMessageId.ErrorProvidedChannels, "Channels must be provided through config.channels only" | ||
); | ||
@@ -44,0 +44,0 @@ } |
@@ -8,3 +8,3 @@ /** | ||
import { ITelemetryItem, IConfiguration, IAppInsightsCore } from "@microsoft/applicationinsights-core-js"; | ||
import { EventPropertyType, ValueKind, FieldValueSanitizerType } from "./Enums"; | ||
import { EventLatencyValue, EventPersistenceValue, EventSendType, FieldValueSanitizerType } from "./Enums"; | ||
@@ -59,12 +59,12 @@ /** | ||
*/ | ||
latency?: number; | ||
latency?: number | EventLatencyValue; | ||
/** | ||
* [Optional] An EventPersistence value, that specifies the persistence for the event. The EventPeristence constant | ||
* [Optional] An EventPersistence value, that specifies the persistence for the event. The EventPersistence constant | ||
* should be used to specify the different persistence values. | ||
*/ | ||
persistence?: number; | ||
persistence?: number | EventPersistenceValue; | ||
/** | ||
* [Optional] A boolean that specifies whether the event should be sent as a sync request. | ||
*/ | ||
sync?: boolean; | ||
sync?: boolean | EventSendType; | ||
/** | ||
@@ -71,0 +71,0 @@ * [Optional] A timings object. |
@@ -75,3 +75,3 @@ /** | ||
*/ | ||
CustomerContent_GenericContent: 32, | ||
CustomerContent_GenericContent: 32 | ||
}; | ||
@@ -82,2 +82,26 @@ | ||
*/ | ||
export const enum EventLatencyValue { | ||
/** | ||
* Normal latency. | ||
*/ | ||
Normal = 1, | ||
/** | ||
* Cost deferred latency. At the moment this latency is treated as Normal latency. | ||
*/ | ||
CostDeferred = 2, | ||
/** | ||
* Real time latency. | ||
*/ | ||
RealTime = 3, | ||
/** | ||
* Bypass normal batching/timing and send as soon as possible, this will still send asynchronously. | ||
* Added in v3.1.1 | ||
*/ | ||
Immediate = 4 | ||
} | ||
/** | ||
* The EventLatency contains a set of values that specify the latency with which an event is sent. | ||
*/ | ||
export const EventLatency = { | ||
@@ -87,11 +111,11 @@ /** | ||
*/ | ||
Normal: 1, | ||
Normal: EventLatencyValue.Normal, | ||
/** | ||
* Cost deferred latency. At the moment this latency is treated as Normal latency. | ||
*/ | ||
CostDeferred: 2, | ||
CostDeferred: EventLatencyValue.CostDeferred, | ||
/** | ||
* Real time latency. | ||
*/ | ||
RealTime: 3, | ||
RealTime: EventLatencyValue.RealTime, | ||
@@ -102,3 +126,3 @@ /** | ||
*/ | ||
Immediate: 4, | ||
Immediate: EventLatencyValue.Immediate | ||
}; | ||
@@ -119,3 +143,3 @@ | ||
Guid: 8, | ||
DateTime: 9, | ||
DateTime: 9 | ||
}; | ||
@@ -126,2 +150,16 @@ | ||
*/ | ||
export const enum EventPersistenceValue { | ||
/** | ||
* Normal persistence. | ||
*/ | ||
Normal = 1, | ||
/** | ||
* Critical persistence. | ||
*/ | ||
Critical = 2 | ||
} | ||
/** | ||
* The EventPersistence contains a set of values that specify the event's persistence. | ||
*/ | ||
export const EventPersistence = { | ||
@@ -131,10 +169,41 @@ /** | ||
*/ | ||
Normal: 1, | ||
Normal: EventPersistenceValue.Normal, | ||
/** | ||
* Critical persistence. | ||
*/ | ||
Critical: 2, | ||
Critical: EventPersistenceValue.Critical | ||
}; | ||
/** | ||
* Define a specific way to send an event synchronously | ||
*/ | ||
export const enum EventSendType { | ||
/** | ||
* Batch and send the event asynchronously, this is the same as either setting the event `sync` flag to false or not setting at all. | ||
*/ | ||
Batched = 0, // For backward compatibility numeric 0 === false as a numeric | ||
/** | ||
* Attempt to send the event synchronously, this is the same as setting the event `sync` flag to true | ||
*/ | ||
Synchronous = 1, // For backward compatibility numeric 1 === true as a numeric | ||
/** | ||
* Attempt to send the event synchronously with a preference for the sendBeacon() API. | ||
* As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb, | ||
* the sendHook is also not supported or used when sendBeacon. | ||
*/ | ||
SendBeacon = 2, | ||
/** | ||
* Attempt to send the event synchronously with a preference for the fetch() API with the keepalive flag, | ||
* the SDK checks to ensure that the fetch() implementation supports the 'keepalive' flag and if not it | ||
* will fallback to either sendBeacon() or a synchronous XHR request. | ||
* As per the specification, the payload of the event (when converted to JSON) must not be larger than 64kb. | ||
* Note: Not all browsers support the keepalive flag so for those environments the events may still fail | ||
*/ | ||
SyncFetch = 3 | ||
} | ||
/** | ||
* The TraceLevel contains a set of values that specify the trace level for the trace messages. | ||
@@ -158,3 +227,3 @@ */ | ||
*/ | ||
INFORMATION: 3, | ||
INFORMATION: 3 | ||
}; | ||
@@ -183,3 +252,3 @@ | ||
PostResponseHandler: 519, | ||
SDKNotInitialized: 520, | ||
SDKNotInitialized: 520 | ||
}; | ||
@@ -192,3 +261,3 @@ | ||
Braces = "B", // 'B' - 32 digits separated by hyphens, enclosed in braces, | ||
Parentheses = "P", // 'P' 32 digits separated by hyphens, enclosed in parentheses | ||
Parentheses = "P" // 'P' 32 digits separated by hyphens, enclosed in parentheses | ||
} | ||
@@ -209,3 +278,3 @@ | ||
EventProperty = 0x2000, | ||
EventProperty = 0x2000 | ||
} | ||
@@ -237,3 +306,3 @@ | ||
*/ | ||
Beacon = 3, | ||
Beacon = 3 | ||
} |
@@ -17,3 +17,3 @@ /** | ||
Resolved = 1, | ||
Rejected = 2, | ||
Rejected = 2 | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -95,3 +95,3 @@ /** | ||
isRunning: false, | ||
isAborted: false, | ||
isAborted: false | ||
}; | ||
@@ -98,0 +98,0 @@ |
@@ -9,3 +9,3 @@ /** | ||
ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId, GuidStyle, FieldValueSanitizerType, | ||
TransportType, | ||
TransportType, EventLatencyValue, EventPersistenceValue, EventSendType | ||
} from "./Enums"; | ||
@@ -32,2 +32,3 @@ import { | ||
IFieldValueSanitizerProvider, IValueSanitizer, ValueSanitizer, | ||
EventLatencyValue, EventPersistenceValue, EventSendType | ||
}; | ||
@@ -64,3 +65,3 @@ | ||
export { | ||
isValueAssigned, isBeaconsSupported, isLatency, | ||
isValueAssigned, isBeaconsSupported, isLatency, isFetchSupported, isXhrSupported, | ||
isUint8ArrayAvailable, getTenantId, sanitizeProperty, | ||
@@ -67,0 +68,0 @@ Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
import { objCreateFn, strShimObject } from "@microsoft/applicationinsights-shims"; | ||
import { getGlobal, objCreateFn, ObjHasOwnProperty, strShimObject } from "@microsoft/applicationinsights-shims"; | ||
import { IEventProperty, IExtendedTelemetryItem } from "./DataModels"; | ||
@@ -32,3 +32,3 @@ import { EventPropertyType, _ExtendedInternalMessageId, GuidStyle, ValueKind, FieldValueSanitizerType, EventLatency } from "./Enums"; | ||
[FieldValueSanitizerType.Array | FieldValueSanitizerType.String]: EventPropertyType.String, | ||
[FieldValueSanitizerType.Array | FieldValueSanitizerType.Boolean]: EventPropertyType.Bool, | ||
[FieldValueSanitizerType.Array | FieldValueSanitizerType.Boolean]: EventPropertyType.Bool | ||
}; | ||
@@ -41,2 +41,3 @@ | ||
let _useXDomainRequest: boolean | null = null; | ||
var beaconsSupported: boolean | null = null; | ||
@@ -46,2 +47,26 @@ var uInt8ArraySupported: boolean | null = null; | ||
function _hasProperty(theClass: any, property: string) { | ||
let supported = false; | ||
if (theClass) { | ||
supported = property in theClass; | ||
if (!supported) { | ||
let proto = theClass.prototype; | ||
if (proto) { | ||
supported = property in proto; | ||
} | ||
} | ||
if (!supported) { | ||
try { | ||
let tmp = new theClass(); | ||
supported = !isUndefined(tmp[property]); | ||
} catch (e) { | ||
// Do Nothing | ||
} | ||
} | ||
} | ||
return supported; | ||
} | ||
/** | ||
@@ -96,2 +121,31 @@ * Checks if document object is available | ||
/** | ||
* Checks if the Fetch API is supported in the current environment. | ||
* @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported | ||
* @returns True if supported, otherwise false | ||
*/ | ||
export function isFetchSupported(withKeepAlive?: boolean): boolean { | ||
let isSupported = false; | ||
try { | ||
const fetchApi = getGlobalInst("fetch"); | ||
isSupported = !!fetchApi; | ||
const request = getGlobalInst("Request"); | ||
if (isSupported && withKeepAlive && request) { | ||
isSupported = _hasProperty(request, "keepalive"); | ||
} | ||
} catch (e) { | ||
// Just Swallow any failure during availability checks | ||
} | ||
return isSupported; | ||
} | ||
/** | ||
* Checks if XMLHttpRequest is supported | ||
* @returns True if supported, otherwise false | ||
*/ | ||
export function isXhrSupported(): boolean { | ||
return typeof XMLHttpRequest !== undefined; | ||
} | ||
/** | ||
* Checks if Uint8Array are available in the current environment. Safari and Firefox along with | ||
@@ -113,3 +167,3 @@ * ReactNative are known to not support Uint8Array properly. | ||
*/ | ||
export function isLatency(value: number | undefined): boolean { | ||
export function isLatency(value: number | undefined | typeof EventLatency): boolean { | ||
if (value && isNumber(value) && value >= EventLatency.Normal && value <= EventLatency.Immediate) { | ||
@@ -174,11 +228,10 @@ return true; | ||
export function useXDomainRequest(): boolean | undefined { | ||
if (typeof XMLHttpRequest !== undefined) { | ||
const xhr: any = getGlobalInst("XMLHttpRequest"); | ||
if (xhr) { | ||
const conn = new xhr(); | ||
return Boolean(isUndefined(conn.withCredentials) && (typeof XDomainRequest !== undefined)); | ||
if (_useXDomainRequest === null) { | ||
_useXDomainRequest = (typeof XDomainRequest !== undefined); | ||
if (_useXDomainRequest && isXhrSupported()) { | ||
_useXDomainRequest = _useXDomainRequest && !_hasProperty(XMLHttpRequest, "withCredentials"); | ||
} | ||
} | ||
} | ||
return _useXDomainRequest; | ||
} | ||
@@ -496,3 +549,3 @@ | ||
strEndsWith: strEndsWith, | ||
objForEachKey: objForEachKey, | ||
objForEachKey: objForEachKey | ||
}; | ||
@@ -541,3 +594,3 @@ | ||
mwcRandom32: mwcRandom32, | ||
generateW3CId: generateW3CId, | ||
generateW3CId: generateW3CId | ||
}; | ||
@@ -544,0 +597,0 @@ |
@@ -83,3 +83,3 @@ import { isNullOrUndefined, objForEachKey, isString } from "@microsoft/applicationinsights-core-js"; | ||
canHandle: true, // This instance will handle so we won't assign the handler | ||
fieldHandler: _fieldSanitizers[lp], | ||
fieldHandler: _fieldSanitizers[lp] | ||
}; | ||
@@ -93,3 +93,3 @@ break; | ||
result = { | ||
canHandle: true, | ||
canHandle: true | ||
}; | ||
@@ -108,3 +108,3 @@ } | ||
handler: _sanitizers[lp], | ||
fieldHandler: null, | ||
fieldHandler: null | ||
}; | ||
@@ -276,3 +276,3 @@ break; | ||
prop: property, | ||
sanitizer: _self, | ||
sanitizer: _self | ||
}; | ||
@@ -279,0 +279,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3486655
87
19636
4
+ Added@microsoft/applicationinsights-core-js@2.6.3(transitive)
- Removed@microsoft/applicationinsights-core-js@2.6.2(transitive)