@microsoft/applicationinsights-common 3.1.1-nightly3.2403-01 → 3.1.1-nightly3.2403-02
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/browser/es5/applicationinsights-common.cjs.js +876 -29
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.js +878 -31
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.integrity.json +25 -25
- package/browser/es5/applicationinsights-common.js +878 -31
- package/browser/es5/applicationinsights-common.js.map +1 -1
- package/browser/es5/applicationinsights-common.min.js +2 -2
- package/browser/es5/applicationinsights-common.min.js.map +1 -1
- package/dist/es5/applicationinsights-common.js +876 -29
- package/dist/es5/applicationinsights-common.js.map +1 -1
- package/dist/es5/applicationinsights-common.min.js +2 -2
- package/dist/es5/applicationinsights-common.min.js.map +1 -1
- package/dist-es5/ConnectionStringParser.js +5 -5
- package/dist-es5/ConnectionStringParser.js.map +1 -1
- package/dist-es5/Constants.js +1 -1
- package/dist-es5/DomHelperFuncs.js +1 -1
- package/dist-es5/Enums.js +1 -1
- package/dist-es5/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +1 -1
- package/dist-es5/Interfaces/Context/IApplication.js +1 -1
- package/dist-es5/Interfaces/Context/IDevice.js +1 -1
- package/dist-es5/Interfaces/Context/IInternal.js +1 -1
- package/dist-es5/Interfaces/Context/ILocation.js +1 -1
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-es5/Interfaces/Context/ISample.js +1 -1
- package/dist-es5/Interfaces/Context/ISession.js +1 -1
- package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-es5/Interfaces/Context/IUser.js +1 -1
- package/dist-es5/Interfaces/Context/IWeb.js +1 -1
- package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
- package/dist-es5/Interfaces/Contracts/IData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +1 -1
- package/dist-es5/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
- package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPartC.js +1 -1
- package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-es5/Interfaces/IRequestContext.js +1 -1
- package/dist-es5/Interfaces/ISenderPostManager.js +6 -0
- package/dist-es5/Interfaces/ISenderPostManager.js.map +1 -0
- package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
- package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
- package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
- package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IXDomainRequest.js +6 -0
- package/dist-es5/Interfaces/IXDomainRequest.js.map +1 -0
- package/dist-es5/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-es5/Offline.js +1 -1
- package/dist-es5/RequestResponseHeaders.js +1 -1
- package/dist-es5/SenderPostManager.js +456 -0
- package/dist-es5/SenderPostManager.js.map +1 -0
- package/dist-es5/StorageHelperFuncs.js +1 -1
- package/dist-es5/Telemetry/Common/Data.js +1 -1
- package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
- package/dist-es5/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-es5/Telemetry/Common/Envelope.js +3 -3
- package/dist-es5/Telemetry/Common/Envelope.js.map +1 -1
- package/dist-es5/Telemetry/Event.js +1 -1
- package/dist-es5/Telemetry/Exception.js +4 -4
- package/dist-es5/Telemetry/Exception.js.map +1 -1
- package/dist-es5/Telemetry/Metric.js +1 -1
- package/dist-es5/Telemetry/PageView.js +1 -1
- package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
- package/dist-es5/Telemetry/RemoteDependencyData.js +3 -3
- package/dist-es5/Telemetry/RemoteDependencyData.js.map +1 -1
- package/dist-es5/Telemetry/Trace.js +1 -1
- package/dist-es5/TelemetryItemCreator.js +3 -3
- package/dist-es5/TelemetryItemCreator.js.map +1 -1
- package/dist-es5/ThrottleMgr.js +1 -1
- package/dist-es5/UrlHelperFuncs.js +1 -1
- package/dist-es5/Util.js +57 -4
- package/dist-es5/Util.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +10 -4
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-common.js +3 -2
- package/dist-es5/applicationinsights-common.js.map +1 -1
- package/package.json +4 -3
- package/types/applicationinsights-common.d.ts +173 -1
- package/types/applicationinsights-common.namespaced.d.ts +205 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Common JavaScript Library, 3.1.1-nightly3.2403-
|
|
2
|
+
* Microsoft Application Insights Common JavaScript Library, 3.1.1-nightly3.2403-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -24,16 +24,22 @@ import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
|
|
|
24
24
|
import { ICustomProperties } from '@microsoft/applicationinsights-core-js';
|
|
25
25
|
import { IDiagnosticLogger } from '@microsoft/applicationinsights-core-js';
|
|
26
26
|
import { IDistributedTraceContext } from '@microsoft/applicationinsights-core-js';
|
|
27
|
+
import { IPayloadData } from '@microsoft/applicationinsights-core-js';
|
|
27
28
|
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
29
|
+
import { IProcessTelemetryUnloadContext } from '@microsoft/applicationinsights-core-js';
|
|
28
30
|
import { isBeaconsSupported as isBeaconApiSupported } from '@microsoft/applicationinsights-core-js';
|
|
29
31
|
import { isSampledFlag } from '@microsoft/applicationinsights-core-js';
|
|
30
32
|
import { isValidSpanId } from '@microsoft/applicationinsights-core-js';
|
|
31
33
|
import { isValidTraceId } from '@microsoft/applicationinsights-core-js';
|
|
32
34
|
import { isValidTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
33
35
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
36
|
+
import { ITelemetryUnloadState } from '@microsoft/applicationinsights-core-js';
|
|
34
37
|
import { ITraceParent } from '@microsoft/applicationinsights-core-js';
|
|
35
38
|
import { IUnloadHook } from '@microsoft/applicationinsights-core-js';
|
|
39
|
+
import { IXHROverride } from '@microsoft/applicationinsights-core-js';
|
|
40
|
+
import { OnCompleteCallback } from '@microsoft/applicationinsights-core-js';
|
|
36
41
|
import { parseTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
42
|
+
import { TransportType } from '@microsoft/applicationinsights-core-js';
|
|
37
43
|
|
|
38
44
|
/**
|
|
39
45
|
* Data struct to contain only C section with custom fields.
|
|
@@ -514,10 +520,16 @@ export { findW3cTraceParent }
|
|
|
514
520
|
*/
|
|
515
521
|
declare function _formatErrorCode(errorObj: any): any;
|
|
516
522
|
|
|
523
|
+
export declare function formatErrorMessageXdr(xdr: IXDomainRequest, message?: string): string;
|
|
524
|
+
|
|
525
|
+
export declare function formatErrorMessageXhr(xhr: XMLHttpRequest, message?: string): string;
|
|
526
|
+
|
|
517
527
|
export { formatTraceParent }
|
|
518
528
|
|
|
519
529
|
export declare function getExtensionByName(extensions: IPlugin[], identifier: string): IPlugin | null;
|
|
520
530
|
|
|
531
|
+
export declare function getResponseText(xhr: XMLHttpRequest | IXDomainRequest): string;
|
|
532
|
+
|
|
521
533
|
export declare const HttpMethod = "http.method";
|
|
522
534
|
|
|
523
535
|
export declare interface IAppInsights {
|
|
@@ -632,6 +644,25 @@ export declare interface IAutoExceptionTelemetry {
|
|
|
632
644
|
errorSrc?: string;
|
|
633
645
|
}
|
|
634
646
|
|
|
647
|
+
export declare interface IBackendResponse {
|
|
648
|
+
/**
|
|
649
|
+
* Number of items received by the backend
|
|
650
|
+
*/
|
|
651
|
+
readonly itemsReceived: number;
|
|
652
|
+
/**
|
|
653
|
+
* Number of items succesfuly accepted by the backend
|
|
654
|
+
*/
|
|
655
|
+
readonly itemsAccepted: number;
|
|
656
|
+
/**
|
|
657
|
+
* List of errors for items which were not accepted
|
|
658
|
+
*/
|
|
659
|
+
readonly errors: IResponseError[];
|
|
660
|
+
/**
|
|
661
|
+
* App id returned by the backend - not necessary returned, but we don't need it with each response.
|
|
662
|
+
*/
|
|
663
|
+
readonly appId?: string;
|
|
664
|
+
}
|
|
665
|
+
|
|
635
666
|
/**
|
|
636
667
|
* Configuration settings for how telemetry is sent
|
|
637
668
|
* @export
|
|
@@ -950,6 +981,11 @@ export declare interface IConfig {
|
|
|
950
981
|
throttleMgrCfg?: {
|
|
951
982
|
[key: number]: IThrottleMgrConfig;
|
|
952
983
|
};
|
|
984
|
+
/**
|
|
985
|
+
* [Optional] Specifies a Highest Priority custom endpoint URL where telemetry data will be sent.
|
|
986
|
+
* This URL takes precedence over the 'config.endpointUrl' and any endpoint in the connection string.
|
|
987
|
+
*/
|
|
988
|
+
userOverrideEndpointUrl?: string;
|
|
953
989
|
}
|
|
954
990
|
|
|
955
991
|
export declare interface IContextTagKeys {
|
|
@@ -1877,6 +1913,12 @@ export declare interface IRequestHeaders {
|
|
|
1877
1913
|
requestContextHeaderLowerCase: string;
|
|
1878
1914
|
}
|
|
1879
1915
|
|
|
1916
|
+
declare interface IResponseError {
|
|
1917
|
+
readonly index: number;
|
|
1918
|
+
readonly statusCode: number;
|
|
1919
|
+
readonly message: string;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1880
1922
|
export declare interface ISample {
|
|
1881
1923
|
/**
|
|
1882
1924
|
* Sample rate
|
|
@@ -1889,6 +1931,93 @@ export { isBeaconApiSupported }
|
|
|
1889
1931
|
|
|
1890
1932
|
export declare function isCrossOriginError(message: string | Event, url: string, lineNumber: number, columnNumber: number, error: Error | Event): boolean;
|
|
1891
1933
|
|
|
1934
|
+
/**
|
|
1935
|
+
* internal interface
|
|
1936
|
+
* Define functions when xhr/xdr/fetch requests are successfully returned. If they are not defined, oncomplete with be called instead
|
|
1937
|
+
* @internal for internal use only
|
|
1938
|
+
*/
|
|
1939
|
+
export declare interface _ISenderOnComplete {
|
|
1940
|
+
/**
|
|
1941
|
+
* defined xdr onload function to handle response
|
|
1942
|
+
* @param dxr xdr request object
|
|
1943
|
+
* @param oncomplete oncomplete function
|
|
1944
|
+
* @since version after 3.1.0
|
|
1945
|
+
*/
|
|
1946
|
+
xdrOnComplete?(xdr: IXDomainRequest, onComplete: OnCompleteCallback, payload?: IPayloadData): void;
|
|
1947
|
+
/**
|
|
1948
|
+
* defined fetch on complete function to handle response
|
|
1949
|
+
* @param response response object
|
|
1950
|
+
* @param onComplete oncomplete function
|
|
1951
|
+
* @param resValue response.text().value
|
|
1952
|
+
* @since version after 3.1.0
|
|
1953
|
+
*/
|
|
1954
|
+
fetchOnComplete?(response: Response, onComplete: OnCompleteCallback, resValue?: string, payload?: IPayloadData): void;
|
|
1955
|
+
/**
|
|
1956
|
+
* defined xhr onreadystatechange function to handle response
|
|
1957
|
+
* @param request request object
|
|
1958
|
+
* @param oncomplete oncomplete function
|
|
1959
|
+
* @since version after 3.1.0
|
|
1960
|
+
*/
|
|
1961
|
+
xhrOnComplete?(request: XMLHttpRequest, onComplete: OnCompleteCallback, payload?: IPayloadData): void;
|
|
1962
|
+
/**
|
|
1963
|
+
* Define functions during beacon can not send payload after first attempt. If not defined, will be apyload will be retried with fallback sender.
|
|
1964
|
+
* @param data payload data
|
|
1965
|
+
* @param onComplete oncomplete function
|
|
1966
|
+
* @param canSend can the current data sent by beacon sender
|
|
1967
|
+
* @since version after 3.1.0
|
|
1968
|
+
*/
|
|
1969
|
+
beaconOnRetry?(data: IPayloadData, onComplete: OnCompleteCallback, canSend: (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => boolean): void;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/**
|
|
1973
|
+
* Internal interface for SendPostMnager
|
|
1974
|
+
* @internal for internal use only
|
|
1975
|
+
*/
|
|
1976
|
+
export declare interface _ISendPostMgrConfig {
|
|
1977
|
+
/**
|
|
1978
|
+
* Enable the sender interface to return a promise
|
|
1979
|
+
* Note: Enabling this may cause unhandled promise rejection errors to occur if you do not listen and handle any rejection response,
|
|
1980
|
+
* Defaults to false
|
|
1981
|
+
* @since version after 3.1.0
|
|
1982
|
+
*/
|
|
1983
|
+
enableSendPromise?: boolean;
|
|
1984
|
+
/**
|
|
1985
|
+
* Identifies if the sender is 1ds post channel
|
|
1986
|
+
* Default is false
|
|
1987
|
+
* @since version after 3.1.0
|
|
1988
|
+
*/
|
|
1989
|
+
isOneDs?: boolean;
|
|
1990
|
+
/**
|
|
1991
|
+
* Identify if Credentials should be disabled for 1ds post channel, application insights sender will igore this config
|
|
1992
|
+
* Default is false
|
|
1993
|
+
* @since version after 3.1.0
|
|
1994
|
+
*/
|
|
1995
|
+
disableCredentials?: boolean;
|
|
1996
|
+
/**
|
|
1997
|
+
* Identifies if XMLHttpRequest or XDomainRequest (for IE < 9) should be used
|
|
1998
|
+
* Default: false
|
|
1999
|
+
* @since version after 3.1.0
|
|
2000
|
+
*/
|
|
2001
|
+
disableXhr?: boolean;
|
|
2002
|
+
/**
|
|
2003
|
+
* Is beacon disabled during asunc sending
|
|
2004
|
+
* Default: false
|
|
2005
|
+
* @since version after 3.1.0
|
|
2006
|
+
*/
|
|
2007
|
+
disableBeacon?: boolean;
|
|
2008
|
+
/**
|
|
2009
|
+
* Is beacon disabled during sync sending
|
|
2010
|
+
* Default: false
|
|
2011
|
+
* @since version after 3.1.0
|
|
2012
|
+
*/
|
|
2013
|
+
disableBeaconSync?: boolean;
|
|
2014
|
+
/**
|
|
2015
|
+
* Identifies functions when xhr/xdr/fetch requests are successfully returned. If they are not defined, oncomplete with be called instead
|
|
2016
|
+
* @since version after 3.1.0
|
|
2017
|
+
*/
|
|
2018
|
+
senderOnCompleteCallBack?: _ISenderOnComplete;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
1892
2021
|
export declare interface ISerializable {
|
|
1893
2022
|
/**
|
|
1894
2023
|
* The set of fields for a serializable object.
|
|
@@ -2264,6 +2393,12 @@ export declare interface IWeb {
|
|
|
2264
2393
|
domain: string;
|
|
2265
2394
|
}
|
|
2266
2395
|
|
|
2396
|
+
export declare interface IXDomainRequest extends XMLHttpRequestEventTarget {
|
|
2397
|
+
readonly responseText: string;
|
|
2398
|
+
send(payload: string): void;
|
|
2399
|
+
open(method: string, url: string): void;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2267
2402
|
export declare class Metric implements IMetricData, ISerializable {
|
|
2268
2403
|
static envelopeType: string;
|
|
2269
2404
|
static dataType: string;
|
|
@@ -2433,8 +2568,16 @@ export declare class PageViewPerformance implements IPageViewPerfData, ISerializ
|
|
|
2433
2568
|
|
|
2434
2569
|
export declare function parseConnectionString(connectionString?: string): ConnectionString;
|
|
2435
2570
|
|
|
2571
|
+
/**
|
|
2572
|
+
* Parses the response from the backend.
|
|
2573
|
+
* @param response - XMLHttpRequest or XDomainRequest response
|
|
2574
|
+
*/
|
|
2575
|
+
export declare function parseResponse(response: any, diagLog?: IDiagnosticLogger): IBackendResponse;
|
|
2576
|
+
|
|
2436
2577
|
export { parseTraceParent }
|
|
2437
2578
|
|
|
2579
|
+
export declare function prependTransports(theTransports: TransportType[], newTransports: TransportType | TransportType[]): TransportType[];
|
|
2580
|
+
|
|
2438
2581
|
export declare const ProcessLegacy = "ProcessLegacy";
|
|
2439
2582
|
|
|
2440
2583
|
export declare const PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
@@ -2538,6 +2681,35 @@ export declare const RequestHeaders: IRequestHeaders & {
|
|
|
2538
2681
|
|
|
2539
2682
|
export declare const SampleRate = "sampleRate";
|
|
2540
2683
|
|
|
2684
|
+
/**
|
|
2685
|
+
* This Internal component
|
|
2686
|
+
* Manager SendPost functions
|
|
2687
|
+
* SendPostManger
|
|
2688
|
+
* @internal for internal use only
|
|
2689
|
+
*/
|
|
2690
|
+
export declare class SenderPostManager {
|
|
2691
|
+
constructor();
|
|
2692
|
+
initialize(config: _ISendPostMgrConfig, diagLog: IDiagnosticLogger): void;
|
|
2693
|
+
/**
|
|
2694
|
+
* Get size of current sync fetch payload
|
|
2695
|
+
*/
|
|
2696
|
+
getSyncFetchPayload(): number;
|
|
2697
|
+
/**
|
|
2698
|
+
* reset Config
|
|
2699
|
+
* @returns True if set is successfully
|
|
2700
|
+
*/
|
|
2701
|
+
SetConfig(config: _ISendPostMgrConfig): boolean;
|
|
2702
|
+
/**
|
|
2703
|
+
* Get current xhr instance
|
|
2704
|
+
*/
|
|
2705
|
+
getXhrInst(transports: TransportType[], sync?: boolean): IXHROverride;
|
|
2706
|
+
/**
|
|
2707
|
+
* Get current fallback sender instance
|
|
2708
|
+
*/
|
|
2709
|
+
getFallbackInst(): IXHROverride;
|
|
2710
|
+
_doTeardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void;
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2541
2713
|
/**
|
|
2542
2714
|
* Defines the level of severity for the event.
|
|
2543
2715
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Common JavaScript Library, 3.1.1-nightly3.2403-
|
|
2
|
+
* Microsoft Application Insights Common JavaScript Library, 3.1.1-nightly3.2403-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -645,6 +645,10 @@ declare namespace ApplicationInsights {
|
|
|
645
645
|
*/
|
|
646
646
|
function _formatErrorCode(errorObj: any): any;
|
|
647
647
|
|
|
648
|
+
function formatErrorMessageXdr(xdr: IXDomainRequest, message?: string): string;
|
|
649
|
+
|
|
650
|
+
function formatErrorMessageXhr(xhr: XMLHttpRequest, message?: string): string;
|
|
651
|
+
|
|
648
652
|
/**
|
|
649
653
|
* Format the ITraceParent value as a string using the supported and know version formats.
|
|
650
654
|
* So even if the passed traceParent is a later version the string value returned from this
|
|
@@ -657,6 +661,8 @@ declare namespace ApplicationInsights {
|
|
|
657
661
|
|
|
658
662
|
function getExtensionByName(extensions: IPlugin[], identifier: string): IPlugin | null;
|
|
659
663
|
|
|
664
|
+
function getResponseText(xhr: XMLHttpRequest | IXDomainRequest): string;
|
|
665
|
+
|
|
660
666
|
const HttpMethod = "http.method";
|
|
661
667
|
|
|
662
668
|
interface IAppInsights {
|
|
@@ -915,6 +921,25 @@ declare namespace ApplicationInsights {
|
|
|
915
921
|
errorSrc?: string;
|
|
916
922
|
}
|
|
917
923
|
|
|
924
|
+
interface IBackendResponse {
|
|
925
|
+
/**
|
|
926
|
+
* Number of items received by the backend
|
|
927
|
+
*/
|
|
928
|
+
readonly itemsReceived: number;
|
|
929
|
+
/**
|
|
930
|
+
* Number of items succesfuly accepted by the backend
|
|
931
|
+
*/
|
|
932
|
+
readonly itemsAccepted: number;
|
|
933
|
+
/**
|
|
934
|
+
* List of errors for items which were not accepted
|
|
935
|
+
*/
|
|
936
|
+
readonly errors: IResponseError[];
|
|
937
|
+
/**
|
|
938
|
+
* App id returned by the backend - not necessary returned, but we don't need it with each response.
|
|
939
|
+
*/
|
|
940
|
+
readonly appId?: string;
|
|
941
|
+
}
|
|
942
|
+
|
|
918
943
|
interface IBaseProcessingContext {
|
|
919
944
|
/**
|
|
920
945
|
* The current core instance for the request
|
|
@@ -1338,6 +1363,11 @@ declare namespace ApplicationInsights {
|
|
|
1338
1363
|
throttleMgrCfg?: {
|
|
1339
1364
|
[key: number]: IThrottleMgrConfig;
|
|
1340
1365
|
};
|
|
1366
|
+
/**
|
|
1367
|
+
* [Optional] Specifies a Highest Priority custom endpoint URL where telemetry data will be sent.
|
|
1368
|
+
* This URL takes precedence over the 'config.endpointUrl' and any endpoint in the connection string.
|
|
1369
|
+
*/
|
|
1370
|
+
userOverrideEndpointUrl?: string;
|
|
1341
1371
|
}
|
|
1342
1372
|
|
|
1343
1373
|
/**
|
|
@@ -3375,6 +3405,12 @@ declare namespace ApplicationInsights {
|
|
|
3375
3405
|
requestContextHeaderLowerCase: string;
|
|
3376
3406
|
}
|
|
3377
3407
|
|
|
3408
|
+
interface IResponseError {
|
|
3409
|
+
readonly index: number;
|
|
3410
|
+
readonly statusCode: number;
|
|
3411
|
+
readonly message: string;
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3378
3414
|
interface ISample {
|
|
3379
3415
|
/**
|
|
3380
3416
|
* Sample rate
|
|
@@ -3393,6 +3429,93 @@ declare namespace ApplicationInsights {
|
|
|
3393
3429
|
|
|
3394
3430
|
function isCrossOriginError(message: string | Event, url: string, lineNumber: number, columnNumber: number, error: Error | Event): boolean;
|
|
3395
3431
|
|
|
3432
|
+
/**
|
|
3433
|
+
* internal interface
|
|
3434
|
+
* Define functions when xhr/xdr/fetch requests are successfully returned. If they are not defined, oncomplete with be called instead
|
|
3435
|
+
* @internal for internal use only
|
|
3436
|
+
*/
|
|
3437
|
+
interface _ISenderOnComplete {
|
|
3438
|
+
/**
|
|
3439
|
+
* defined xdr onload function to handle response
|
|
3440
|
+
* @param dxr xdr request object
|
|
3441
|
+
* @param oncomplete oncomplete function
|
|
3442
|
+
* @since version after 3.1.0
|
|
3443
|
+
*/
|
|
3444
|
+
xdrOnComplete?(xdr: IXDomainRequest, onComplete: OnCompleteCallback, payload?: IPayloadData): void;
|
|
3445
|
+
/**
|
|
3446
|
+
* defined fetch on complete function to handle response
|
|
3447
|
+
* @param response response object
|
|
3448
|
+
* @param onComplete oncomplete function
|
|
3449
|
+
* @param resValue response.text().value
|
|
3450
|
+
* @since version after 3.1.0
|
|
3451
|
+
*/
|
|
3452
|
+
fetchOnComplete?(response: Response, onComplete: OnCompleteCallback, resValue?: string, payload?: IPayloadData): void;
|
|
3453
|
+
/**
|
|
3454
|
+
* defined xhr onreadystatechange function to handle response
|
|
3455
|
+
* @param request request object
|
|
3456
|
+
* @param oncomplete oncomplete function
|
|
3457
|
+
* @since version after 3.1.0
|
|
3458
|
+
*/
|
|
3459
|
+
xhrOnComplete?(request: XMLHttpRequest, onComplete: OnCompleteCallback, payload?: IPayloadData): void;
|
|
3460
|
+
/**
|
|
3461
|
+
* Define functions during beacon can not send payload after first attempt. If not defined, will be apyload will be retried with fallback sender.
|
|
3462
|
+
* @param data payload data
|
|
3463
|
+
* @param onComplete oncomplete function
|
|
3464
|
+
* @param canSend can the current data sent by beacon sender
|
|
3465
|
+
* @since version after 3.1.0
|
|
3466
|
+
*/
|
|
3467
|
+
beaconOnRetry?(data: IPayloadData, onComplete: OnCompleteCallback, canSend: (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => boolean): void;
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
/**
|
|
3471
|
+
* Internal interface for SendPostMnager
|
|
3472
|
+
* @internal for internal use only
|
|
3473
|
+
*/
|
|
3474
|
+
interface _ISendPostMgrConfig {
|
|
3475
|
+
/**
|
|
3476
|
+
* Enable the sender interface to return a promise
|
|
3477
|
+
* Note: Enabling this may cause unhandled promise rejection errors to occur if you do not listen and handle any rejection response,
|
|
3478
|
+
* Defaults to false
|
|
3479
|
+
* @since version after 3.1.0
|
|
3480
|
+
*/
|
|
3481
|
+
enableSendPromise?: boolean;
|
|
3482
|
+
/**
|
|
3483
|
+
* Identifies if the sender is 1ds post channel
|
|
3484
|
+
* Default is false
|
|
3485
|
+
* @since version after 3.1.0
|
|
3486
|
+
*/
|
|
3487
|
+
isOneDs?: boolean;
|
|
3488
|
+
/**
|
|
3489
|
+
* Identify if Credentials should be disabled for 1ds post channel, application insights sender will igore this config
|
|
3490
|
+
* Default is false
|
|
3491
|
+
* @since version after 3.1.0
|
|
3492
|
+
*/
|
|
3493
|
+
disableCredentials?: boolean;
|
|
3494
|
+
/**
|
|
3495
|
+
* Identifies if XMLHttpRequest or XDomainRequest (for IE < 9) should be used
|
|
3496
|
+
* Default: false
|
|
3497
|
+
* @since version after 3.1.0
|
|
3498
|
+
*/
|
|
3499
|
+
disableXhr?: boolean;
|
|
3500
|
+
/**
|
|
3501
|
+
* Is beacon disabled during asunc sending
|
|
3502
|
+
* Default: false
|
|
3503
|
+
* @since version after 3.1.0
|
|
3504
|
+
*/
|
|
3505
|
+
disableBeacon?: boolean;
|
|
3506
|
+
/**
|
|
3507
|
+
* Is beacon disabled during sync sending
|
|
3508
|
+
* Default: false
|
|
3509
|
+
* @since version after 3.1.0
|
|
3510
|
+
*/
|
|
3511
|
+
disableBeaconSync?: boolean;
|
|
3512
|
+
/**
|
|
3513
|
+
* Identifies functions when xhr/xdr/fetch requests are successfully returned. If they are not defined, oncomplete with be called instead
|
|
3514
|
+
* @since version after 3.1.0
|
|
3515
|
+
*/
|
|
3516
|
+
senderOnCompleteCallBack?: _ISenderOnComplete;
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3396
3519
|
interface ISerializable {
|
|
3397
3520
|
/**
|
|
3398
3521
|
* The set of fields for a serializable object.
|
|
@@ -4125,6 +4248,19 @@ declare namespace ApplicationInsights {
|
|
|
4125
4248
|
domain: string;
|
|
4126
4249
|
}
|
|
4127
4250
|
|
|
4251
|
+
interface IXDomainRequest extends XMLHttpRequestEventTarget {
|
|
4252
|
+
readonly responseText: string;
|
|
4253
|
+
send(payload: string): void;
|
|
4254
|
+
open(method: string, url: string): void;
|
|
4255
|
+
}
|
|
4256
|
+
|
|
4257
|
+
/**
|
|
4258
|
+
* The IXHROverride interface overrides the way HTTP requests are sent.
|
|
4259
|
+
*/
|
|
4260
|
+
interface IXHROverride {
|
|
4261
|
+
sendPOST: SendPOSTFunction;
|
|
4262
|
+
}
|
|
4263
|
+
|
|
4128
4264
|
const LoggingSeverity: EnumValue<typeof eLoggingSeverity>;
|
|
4129
4265
|
|
|
4130
4266
|
type LoggingSeverity = number | eLoggingSeverity;
|
|
@@ -4172,6 +4308,10 @@ declare namespace ApplicationInsights {
|
|
|
4172
4308
|
*/
|
|
4173
4309
|
type OfflineCallback = (onlineState: IOfflineState) => void;
|
|
4174
4310
|
|
|
4311
|
+
type OnCompleteCallback = (status: number, headers: {
|
|
4312
|
+
[headerName: string]: string;
|
|
4313
|
+
}, response?: string) => void;
|
|
4314
|
+
|
|
4175
4315
|
class PageView implements IPageViewData, ISerializable {
|
|
4176
4316
|
static envelopeType: string;
|
|
4177
4317
|
static dataType: string;
|
|
@@ -4298,6 +4438,12 @@ declare namespace ApplicationInsights {
|
|
|
4298
4438
|
|
|
4299
4439
|
function parseConnectionString(connectionString?: string): ConnectionString;
|
|
4300
4440
|
|
|
4441
|
+
/**
|
|
4442
|
+
* Parses the response from the backend.
|
|
4443
|
+
* @param response - XMLHttpRequest or XDomainRequest response
|
|
4444
|
+
*/
|
|
4445
|
+
function parseResponse(response: any, diagLog?: IDiagnosticLogger): IBackendResponse;
|
|
4446
|
+
|
|
4301
4447
|
/**
|
|
4302
4448
|
* Attempt to parse the provided string as a W3C TraceParent header value (https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
4303
4449
|
*
|
|
@@ -4307,6 +4453,8 @@ declare namespace ApplicationInsights {
|
|
|
4307
4453
|
*/
|
|
4308
4454
|
function parseTraceParent(value: string, selectIdx?: number): ITraceParent;
|
|
4309
4455
|
|
|
4456
|
+
function prependTransports(theTransports: TransportType[], newTransports: TransportType | TransportType[]): TransportType[];
|
|
4457
|
+
|
|
4310
4458
|
const ProcessLegacy = "ProcessLegacy";
|
|
4311
4459
|
|
|
4312
4460
|
const PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
|
|
@@ -4424,6 +4572,43 @@ declare namespace ApplicationInsights {
|
|
|
4424
4572
|
|
|
4425
4573
|
const SampleRate = "sampleRate";
|
|
4426
4574
|
|
|
4575
|
+
/**
|
|
4576
|
+
* This Internal component
|
|
4577
|
+
* Manager SendPost functions
|
|
4578
|
+
* SendPostManger
|
|
4579
|
+
* @internal for internal use only
|
|
4580
|
+
*/
|
|
4581
|
+
class SenderPostManager {
|
|
4582
|
+
constructor();
|
|
4583
|
+
initialize(config: _ISendPostMgrConfig, diagLog: IDiagnosticLogger): void;
|
|
4584
|
+
/**
|
|
4585
|
+
* Get size of current sync fetch payload
|
|
4586
|
+
*/
|
|
4587
|
+
getSyncFetchPayload(): number;
|
|
4588
|
+
/**
|
|
4589
|
+
* reset Config
|
|
4590
|
+
* @returns True if set is successfully
|
|
4591
|
+
*/
|
|
4592
|
+
SetConfig(config: _ISendPostMgrConfig): boolean;
|
|
4593
|
+
/**
|
|
4594
|
+
* Get current xhr instance
|
|
4595
|
+
*/
|
|
4596
|
+
getXhrInst(transports: TransportType[], sync?: boolean): IXHROverride;
|
|
4597
|
+
/**
|
|
4598
|
+
* Get current fallback sender instance
|
|
4599
|
+
*/
|
|
4600
|
+
getFallbackInst(): IXHROverride;
|
|
4601
|
+
_doTeardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void;
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4604
|
+
/**
|
|
4605
|
+
* SendPOSTFunction type defines how an HTTP POST request is sent to an ingestion server
|
|
4606
|
+
* @param payload - The payload object that should be sent, contains the url, bytes/string and headers for the request
|
|
4607
|
+
* @param oncomplete - The function to call once the request has completed whether a success, failure or timeout
|
|
4608
|
+
* @param sync - A boolean flag indicating whether the request should be sent as a synchronous request.
|
|
4609
|
+
*/
|
|
4610
|
+
type SendPOSTFunction = (payload: IPayloadData, oncomplete: OnCompleteCallback, sync?: boolean) => void | IPromise<boolean>;
|
|
4611
|
+
|
|
4427
4612
|
/**
|
|
4428
4613
|
* The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
|
|
4429
4614
|
*/
|
|
@@ -4594,6 +4779,25 @@ declare namespace ApplicationInsights {
|
|
|
4594
4779
|
});
|
|
4595
4780
|
}
|
|
4596
4781
|
|
|
4782
|
+
const enum TransportType {
|
|
4783
|
+
/**
|
|
4784
|
+
* Use the default available api
|
|
4785
|
+
*/
|
|
4786
|
+
NotSet = 0,
|
|
4787
|
+
/**
|
|
4788
|
+
* Use XMLHttpRequest or XMLDomainRequest if available
|
|
4789
|
+
*/
|
|
4790
|
+
Xhr = 1,
|
|
4791
|
+
/**
|
|
4792
|
+
* Use the Fetch api if available
|
|
4793
|
+
*/
|
|
4794
|
+
Fetch = 2,
|
|
4795
|
+
/**
|
|
4796
|
+
* Use sendBeacon api if available
|
|
4797
|
+
*/
|
|
4798
|
+
Beacon = 3
|
|
4799
|
+
}
|
|
4800
|
+
|
|
4597
4801
|
type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
4598
4802
|
|
|
4599
4803
|
function urlGetAbsoluteUrl(url: string): string;
|