@microsoft/applicationinsights-channel-js 2.7.1-nightly.202110-07 → 2.7.1-nightly.202110-16
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/applicationinsights-channel-js.integrity.json +9 -9
- package/browser/applicationinsights-channel-js.js +74 -65
- package/browser/applicationinsights-channel-js.js.map +1 -1
- package/browser/applicationinsights-channel-js.min.js +2 -2
- package/browser/applicationinsights-channel-js.min.js.map +1 -1
- package/dist/applicationinsights-channel-js.api.json +1 -1
- package/dist/applicationinsights-channel-js.d.ts +1 -1
- package/dist/applicationinsights-channel-js.js +74 -65
- package/dist/applicationinsights-channel-js.js.map +1 -1
- package/dist/applicationinsights-channel-js.min.js +2 -2
- package/dist/applicationinsights-channel-js.min.js.map +1 -1
- package/dist/applicationinsights-channel-js.rollup.d.ts +1 -1
- package/dist-esm/EnvelopeCreator.js +17 -17
- package/dist-esm/EnvelopeCreator.js.map +1 -1
- package/dist-esm/Interfaces.js +1 -1
- package/dist-esm/Offline.js +5 -5
- package/dist-esm/Offline.js.map +1 -1
- package/dist-esm/SendBuffer.js +4 -4
- package/dist-esm/SendBuffer.js.map +1 -1
- package/dist-esm/Sender.js +17 -17
- package/dist-esm/Sender.js.map +1 -1
- package/dist-esm/Serializer.js +3 -3
- package/dist-esm/Serializer.js.map +1 -1
- package/dist-esm/TelemetryProcessors/Sample.js +4 -4
- package/dist-esm/TelemetryProcessors/Sample.js.map +1 -1
- package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js +1 -1
- package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js +3 -3
- package/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js.map +1 -1
- package/dist-esm/applicationinsights-channel-js.js +1 -1
- package/package.json +3 -4
- package/src/EnvelopeCreator.ts +18 -17
- package/src/Offline.ts +4 -4
- package/src/SendBuffer.ts +4 -4
- package/src/Sender.ts +17 -17
- package/src/Serializer.ts +3 -3
- package/src/TelemetryProcessors/Sample.ts +3 -3
- package/src/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.ts +3 -3
- package/types/EnvelopeCreator.d.ts +2 -2
- package/types/SendBuffer.d.ts +2 -2
- package/types/Sender.d.ts +4 -4
- package/types/Serializer.d.ts +2 -2
- package/types/TelemetryProcessors/Sample.d.ts +2 -2
- package/types/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.d.ts +1 -1
- package/types/tsdoc-metadata.json +1 -1
package/src/Sender.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ISenderConfig, XDomainRequest as IXDomainRequest, IBackendResponse } from
|
|
2
|
-
import { ISendBuffer, SessionStorageSendBuffer, ArraySendBuffer } from
|
|
1
|
+
import { ISenderConfig, XDomainRequest as IXDomainRequest, IBackendResponse } from "./Interfaces";
|
|
2
|
+
import { ISendBuffer, SessionStorageSendBuffer, ArraySendBuffer } from "./SendBuffer";
|
|
3
3
|
import {
|
|
4
4
|
DependencyEnvelopeCreator, EventEnvelopeCreator,
|
|
5
5
|
ExceptionEnvelopeCreator, MetricEnvelopeCreator, PageViewEnvelopeCreator,
|
|
6
6
|
PageViewPerformanceEnvelopeCreator, TraceEnvelopeCreator
|
|
7
|
-
} from
|
|
8
|
-
import { Serializer } from
|
|
7
|
+
} from "./EnvelopeCreator";
|
|
8
|
+
import { Serializer } from "./Serializer"; // todo move to channel
|
|
9
9
|
import {
|
|
10
10
|
DisabledPropertyName, RequestHeaders, IEnvelope, PageView, Event,
|
|
11
11
|
Trace, Exception, Metric, PageViewPerformance, RemoteDependencyData,
|
|
12
12
|
IChannelControlsAI, IConfig, ProcessLegacy, BreezeChannelIdentifier,
|
|
13
13
|
SampleRate, isInternalApplicationInsightsEndpoint, utlCanUseSessionStorage,
|
|
14
14
|
ISample
|
|
15
|
-
} from
|
|
15
|
+
} from "@microsoft/applicationinsights-common";
|
|
16
16
|
import {
|
|
17
17
|
ITelemetryItem, IProcessTelemetryContext, IConfiguration,
|
|
18
18
|
_InternalMessageId, LoggingSeverity, IDiagnosticLogger, IAppInsightsCore, IPlugin,
|
|
19
19
|
getWindow, getNavigator, getJSON, BaseTelemetryPlugin, ITelemetryPluginChain, INotificationManager,
|
|
20
20
|
SendRequestReason, objForEachKey, isNullOrUndefined, arrForEach, dateNow, dumpObj, getExceptionName, getIEVersion, throwError, objKeys,
|
|
21
21
|
isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported, isArray
|
|
22
|
-
} from
|
|
23
|
-
import { Offline } from
|
|
24
|
-
import { Sample } from
|
|
25
|
-
import dynamicProto from
|
|
22
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
23
|
+
import { Offline } from "./Offline";
|
|
24
|
+
import { Sample } from "./TelemetryProcessors/Sample"
|
|
25
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
26
26
|
|
|
27
27
|
const FetchSyncRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit)
|
|
28
28
|
|
|
@@ -504,7 +504,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
if (failed.length > 0) {
|
|
507
|
-
_self._onError(failed, _formatErrorMessageXhr(null, [
|
|
507
|
+
_self._onError(failed, _formatErrorMessageXhr(null, ["partial success", results.itemsAccepted, "of", results.itemsReceived].join(" ")));
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
if (retry.length > 0) {
|
|
@@ -619,7 +619,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
619
619
|
// _stamp_specific_redirects = 0;
|
|
620
620
|
return false;
|
|
621
621
|
}
|
|
622
|
-
if(!isNullOrUndefined(responseUrl) && responseUrl !==
|
|
622
|
+
if(!isNullOrUndefined(responseUrl) && responseUrl !== "") {
|
|
623
623
|
if(responseUrl !== _self._senderConfig.endpointUrl()) {
|
|
624
624
|
_self._senderConfig.endpointUrl = () => responseUrl;
|
|
625
625
|
++_stamp_specific_redirects;
|
|
@@ -647,7 +647,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
647
647
|
|
|
648
648
|
// Chrome only allows CORS-safelisted values for the sendBeacon data argument
|
|
649
649
|
// see: https://bugs.chromium.org/p/chromium/issues/detail?id=720283
|
|
650
|
-
const plainTextBatch = new Blob([batch], { type:
|
|
650
|
+
const plainTextBatch = new Blob([batch], { type: "text/plain;charset=UTF-8" });
|
|
651
651
|
|
|
652
652
|
// The sendBeacon method returns true if the user agent is able to successfully queue the data for transfer. Otherwise it returns false.
|
|
653
653
|
const queued = nav.sendBeacon(url, plainTextBatch);
|
|
@@ -762,7 +762,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
762
762
|
function _doFetchSender(payload: string[], isAsync: boolean) {
|
|
763
763
|
const endPointUrl = _self._senderConfig.endpointUrl();
|
|
764
764
|
const batch = _self._buffer.batchPayloads(payload);
|
|
765
|
-
const plainTextBatch = new Blob([batch], { type:
|
|
765
|
+
const plainTextBatch = new Blob([batch], { type: "application/json" });
|
|
766
766
|
let requestHeaders = new Headers();
|
|
767
767
|
let batchLength = batch.length;
|
|
768
768
|
|
|
@@ -971,7 +971,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
971
971
|
}
|
|
972
972
|
|
|
973
973
|
const endpointUrl = _self._senderConfig.endpointUrl().replace(/^(https?:)/, "");
|
|
974
|
-
xdr.open(
|
|
974
|
+
xdr.open("POST", endpointUrl);
|
|
975
975
|
|
|
976
976
|
// compose an array of payloads
|
|
977
977
|
const batch = buffer.batchPayloads(payload);
|
|
@@ -990,13 +990,13 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
990
990
|
|
|
991
991
|
// Using function lookups for backward compatibility as the getNotifyMgr() did not exist until after v2.5.6
|
|
992
992
|
function _getNotifyMgr() : INotificationManager {
|
|
993
|
-
const func =
|
|
993
|
+
const func = "getNotifyMgr";
|
|
994
994
|
if (_self.core[func]) {
|
|
995
995
|
return _self.core[func]();
|
|
996
996
|
}
|
|
997
997
|
|
|
998
998
|
// using _self.core['_notificationManager'] for backward compatibility
|
|
999
|
-
return _self.core[
|
|
999
|
+
return _self.core["_notificationManager"];
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
function _notifySendRequest(sendRequest: SendRequestReason, isAsync: boolean) {
|
|
@@ -1022,7 +1022,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
1022
1022
|
if(disableIKeyValidationFlag) {
|
|
1023
1023
|
return true;
|
|
1024
1024
|
}
|
|
1025
|
-
const UUID_Regex =
|
|
1025
|
+
const UUID_Regex = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
|
|
1026
1026
|
const regexp = new RegExp(UUID_Regex);
|
|
1027
1027
|
return regexp.test(config.instrumentationKey);
|
|
1028
1028
|
}
|
package/src/Serializer.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ISerializable, FieldType } from
|
|
1
|
+
import { ISerializable, FieldType } from "@microsoft/applicationinsights-common";
|
|
2
2
|
import {
|
|
3
3
|
IDiagnosticLogger, LoggingSeverity, _InternalMessageId, getJSON, objForEachKey, isFunction, isObject, isArray
|
|
4
|
-
} from
|
|
5
|
-
import dynamicProto from
|
|
4
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
import dynamicProto from "@microsoft/dynamicproto-js"
|
|
6
6
|
|
|
7
7
|
export class Serializer {
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { SamplingScoreGenerator } from
|
|
5
|
-
import { ISample, Metric } from
|
|
6
|
-
import { ITelemetryItem, IDiagnosticLogger, _InternalMessageId, LoggingSeverity, safeGetLogger } from
|
|
4
|
+
import { SamplingScoreGenerator } from "./SamplingScoreGenerators/SamplingScoreGenerator";
|
|
5
|
+
import { ISample, Metric } from "@microsoft/applicationinsights-common";
|
|
6
|
+
import { ITelemetryItem, IDiagnosticLogger, _InternalMessageId, LoggingSeverity, safeGetLogger } from "@microsoft/applicationinsights-core-js";
|
|
7
7
|
|
|
8
8
|
export class Sample implements ISample {
|
|
9
9
|
public sampleRate: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { HashCodeScoreGenerator } from
|
|
5
|
-
import { ITelemetryItem } from
|
|
6
|
-
import { ContextTagKeys } from
|
|
4
|
+
import { HashCodeScoreGenerator } from "./HashCodeScoreGenerator";
|
|
5
|
+
import { ITelemetryItem } from "@microsoft/applicationinsights-core-js";
|
|
6
|
+
import { ContextTagKeys } from "@microsoft/applicationinsights-common";
|
|
7
7
|
|
|
8
8
|
export class SamplingScoreGenerator {
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IEnvelope } from
|
|
2
|
-
import { ITelemetryItem, IDiagnosticLogger } from
|
|
1
|
+
import { IEnvelope } from "@microsoft/applicationinsights-common";
|
|
2
|
+
import { ITelemetryItem, IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
3
3
|
export declare const EnvelopeCreator: {
|
|
4
4
|
Version: string;
|
|
5
5
|
};
|
package/types/SendBuffer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IDiagnosticLogger } from
|
|
2
|
-
import { ISenderConfig } from
|
|
1
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
2
|
+
import { ISenderConfig } from "./Interfaces";
|
|
3
3
|
export interface ISendBuffer {
|
|
4
4
|
/**
|
|
5
5
|
* Enqueue the payload
|
package/types/Sender.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ISenderConfig, XDomainRequest as IXDomainRequest, IBackendResponse } from
|
|
2
|
-
import { ISendBuffer } from
|
|
3
|
-
import { IEnvelope, IChannelControlsAI, IConfig, ISample } from
|
|
4
|
-
import { ITelemetryItem, IProcessTelemetryContext, IConfiguration, IDiagnosticLogger, IAppInsightsCore, IPlugin, BaseTelemetryPlugin, ITelemetryPluginChain, SendRequestReason } from
|
|
1
|
+
import { ISenderConfig, XDomainRequest as IXDomainRequest, IBackendResponse } from "./Interfaces";
|
|
2
|
+
import { ISendBuffer } from "./SendBuffer";
|
|
3
|
+
import { IEnvelope, IChannelControlsAI, IConfig, ISample } from "@microsoft/applicationinsights-common";
|
|
4
|
+
import { ITelemetryItem, IProcessTelemetryContext, IConfiguration, IDiagnosticLogger, IAppInsightsCore, IPlugin, BaseTelemetryPlugin, ITelemetryPluginChain, SendRequestReason } from "@microsoft/applicationinsights-core-js";
|
|
5
5
|
export declare type SenderFunction = (payload: string[], isAsync: boolean) => void;
|
|
6
6
|
export declare class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
7
7
|
static constructEnvelope(orig: ITelemetryItem, iKey: string, logger: IDiagnosticLogger, convertUndefined?: any): IEnvelope;
|
package/types/Serializer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISerializable } from
|
|
2
|
-
import { IDiagnosticLogger } from
|
|
1
|
+
import { ISerializable } from "@microsoft/applicationinsights-common";
|
|
2
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
3
3
|
export declare class Serializer {
|
|
4
4
|
constructor(logger: IDiagnosticLogger);
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISample } from
|
|
2
|
-
import { ITelemetryItem, IDiagnosticLogger } from
|
|
1
|
+
import { ISample } from "@microsoft/applicationinsights-common";
|
|
2
|
+
import { ITelemetryItem, IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
3
3
|
export declare class Sample implements ISample {
|
|
4
4
|
sampleRate: number;
|
|
5
5
|
INT_MAX_VALUE: number;
|