@microsoft/applicationinsights-common 3.0.0-beta.2301-20 → 3.0.0-beta.2302-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/applicationinsights-common.integrity.json +9 -9
- package/browser/applicationinsights-common.js +99 -30
- package/browser/applicationinsights-common.js.map +1 -1
- package/browser/applicationinsights-common.min.js +2 -2
- package/browser/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.api.json +10 -10
- package/dist/applicationinsights-common.api.md +1 -1
- package/dist/applicationinsights-common.d.ts +7 -7
- package/dist/applicationinsights-common.js +99 -30
- package/dist/applicationinsights-common.js.map +1 -1
- package/dist/applicationinsights-common.min.js +2 -2
- package/dist/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.rollup.d.ts +7 -7
- package/dist-esm/ConnectionStringParser.js +1 -1
- package/dist-esm/Constants.js +1 -1
- package/dist-esm/DomHelperFuncs.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/HelperFuncs.js +1 -1
- package/dist-esm/Interfaces/ConnectionString.js +1 -1
- package/dist-esm/Interfaces/Context/IApplication.js +1 -1
- package/dist-esm/Interfaces/Context/IDevice.js +1 -1
- package/dist-esm/Interfaces/Context/IInternal.js +1 -1
- package/dist-esm/Interfaces/Context/ILocation.js +1 -1
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-esm/Interfaces/Context/ISample.js +1 -1
- package/dist-esm/Interfaces/Context/ISession.js +1 -1
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-esm/Interfaces/Context/IUser.js +1 -1
- package/dist-esm/Interfaces/Context/IWeb.js +1 -1
- package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
- package/dist-esm/Interfaces/Contracts/IData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/IAppInsights.js +1 -1
- package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
- package/dist-esm/Interfaces/IConfig.js +1 -1
- package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
- package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPartC.js +1 -1
- package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-esm/Interfaces/IRequestContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
- package/dist-esm/Interfaces/IThrottleMgr.js +1 -1
- package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-esm/Interfaces/PartAExtensions.js +1 -1
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-esm/RequestResponseHeaders.js +1 -1
- package/dist-esm/StorageHelperFuncs.js +1 -1
- package/dist-esm/Telemetry/Common/Data.js +1 -1
- package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
- package/dist-esm/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-esm/Telemetry/Common/Envelope.js +1 -1
- package/dist-esm/Telemetry/Event.js +1 -1
- package/dist-esm/Telemetry/Exception.js +1 -1
- package/dist-esm/Telemetry/Metric.js +1 -1
- package/dist-esm/Telemetry/PageView.js +1 -1
- package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
- package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-esm/Telemetry/Trace.js +1 -1
- package/dist-esm/TelemetryItemCreator.js +1 -1
- package/dist-esm/ThrottleMgr.js +46 -19
- package/dist-esm/ThrottleMgr.js.map +1 -1
- package/dist-esm/UrlHelperFuncs.js +1 -1
- package/dist-esm/Util.js +1 -1
- package/dist-esm/__DynamicConstants.js +6 -5
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-common.js +1 -1
- package/package.json +5 -5
- package/src/ConnectionStringParser.ts +8 -8
- package/src/HelperFuncs.ts +6 -6
- package/src/Interfaces/IConfig.ts +7 -7
- package/src/Interfaces/IThrottleMgr.ts +6 -6
- package/src/StorageHelperFuncs.ts +10 -10
- package/src/Telemetry/Common/DataSanitizer.ts +8 -8
- package/src/Telemetry/Common/Envelope.ts +11 -11
- package/src/Telemetry/Event.ts +11 -11
- package/src/Telemetry/Exception.ts +22 -22
- package/src/Telemetry/Metric.ts +12 -12
- package/src/Telemetry/PageView.ts +14 -14
- package/src/Telemetry/PageViewPerformance.ts +12 -12
- package/src/Telemetry/RemoteDependencyData.ts +12 -12
- package/src/Telemetry/Trace.ts +12 -12
- package/src/TelemetryItemCreator.ts +10 -10
- package/src/ThrottleMgr.ts +53 -21
- package/src/UrlHelperFuncs.ts +6 -6
- package/src/Util.ts +16 -16
- package/src/__DynamicConstants.ts +50 -49
- package/types/Enums.d.ts +2 -2
- package/types/Interfaces/ConnectionString.d.ts +2 -2
- package/types/Interfaces/Contracts/SeverityLevel.d.ts +1 -1
- package/types/Interfaces/IThrottleMgr.d.ts +6 -6
- package/types/__DynamicConstants.d.ts +2 -1
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { strNotSpecified } from "../Constants";
|
|
6
|
-
import { FieldType } from "../Enums";
|
|
7
|
-
import { msToTimeSpan } from "../HelperFuncs";
|
|
8
|
-
import { IPageViewData } from "../Interfaces/Contracts/IPageViewData";
|
|
9
|
-
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
10
|
-
import {
|
|
11
|
-
dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl
|
|
12
|
-
} from "./Common/DataSanitizer";
|
|
13
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
import { strNotSpecified } from "../Constants";
|
|
6
|
+
import { FieldType } from "../Enums";
|
|
7
|
+
import { msToTimeSpan } from "../HelperFuncs";
|
|
8
|
+
import { IPageViewData } from "../Interfaces/Contracts/IPageViewData";
|
|
9
|
+
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
10
|
+
import {
|
|
11
|
+
dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl
|
|
12
|
+
} from "./Common/DataSanitizer";
|
|
13
|
+
|
|
14
14
|
export class PageView implements IPageViewData, ISerializable {
|
|
15
15
|
|
|
16
16
|
public static envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview";
|
|
@@ -76,4 +76,4 @@ export class PageView implements IPageViewData, ISerializable {
|
|
|
76
76
|
_self.properties = dataSanitizeProperties(logger, properties);
|
|
77
77
|
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { strNotSpecified } from "../Constants";
|
|
6
|
-
import { FieldType } from "../Enums";
|
|
7
|
-
import { IPageViewPerfData } from "../Interfaces/Contracts/IPageViewPerfData";
|
|
8
|
-
import { IPageViewPerformanceTelemetry } from "../Interfaces/IPageViewPerformanceTelemetry";
|
|
9
|
-
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
10
|
-
import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
|
|
11
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
import { strNotSpecified } from "../Constants";
|
|
6
|
+
import { FieldType } from "../Enums";
|
|
7
|
+
import { IPageViewPerfData } from "../Interfaces/Contracts/IPageViewPerfData";
|
|
8
|
+
import { IPageViewPerformanceTelemetry } from "../Interfaces/IPageViewPerformanceTelemetry";
|
|
9
|
+
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
10
|
+
import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
|
|
11
|
+
|
|
12
12
|
export class PageViewPerformance implements IPageViewPerfData, ISerializable {
|
|
13
13
|
|
|
14
14
|
public static envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance";
|
|
@@ -110,4 +110,4 @@ export class PageViewPerformance implements IPageViewPerfData, ISerializable {
|
|
|
110
110
|
_self.sentRequest = cs4BaseData.sentRequest;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
}
|
|
113
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { FieldType } from "../Enums";
|
|
6
|
-
import { msToTimeSpan } from "../HelperFuncs";
|
|
7
|
-
import { IRemoteDependencyData } from "../Interfaces/Contracts/IRemoteDependencyData";
|
|
8
|
-
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
9
|
-
import { AjaxHelperParseDependencyPath } from "../Util";
|
|
10
|
-
import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
|
|
11
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
import { FieldType } from "../Enums";
|
|
6
|
+
import { msToTimeSpan } from "../HelperFuncs";
|
|
7
|
+
import { IRemoteDependencyData } from "../Interfaces/Contracts/IRemoteDependencyData";
|
|
8
|
+
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
9
|
+
import { AjaxHelperParseDependencyPath } from "../Util";
|
|
10
|
+
import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
|
|
11
|
+
|
|
12
12
|
export class RemoteDependencyData implements IRemoteDependencyData, ISerializable {
|
|
13
13
|
|
|
14
14
|
public static envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency";
|
|
@@ -119,4 +119,4 @@ export class RemoteDependencyData implements IRemoteDependencyData, ISerializabl
|
|
|
119
119
|
_self.properties = dataSanitizeProperties(logger, properties);
|
|
120
120
|
_self.measurements = dataSanitizeMeasurements(logger, measurements);
|
|
121
121
|
}
|
|
122
|
-
}
|
|
122
|
+
}
|
package/src/Telemetry/Trace.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { strNotSpecified } from "../Constants";
|
|
6
|
-
import { FieldType } from "../Enums";
|
|
7
|
-
import { IMessageData } from "../Interfaces/Contracts/IMessageData";
|
|
8
|
-
import { SeverityLevel } from "../Interfaces/Contracts/SeverityLevel";
|
|
9
|
-
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
10
|
-
import { dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties } from "./Common/DataSanitizer";
|
|
11
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
import { strNotSpecified } from "../Constants";
|
|
6
|
+
import { FieldType } from "../Enums";
|
|
7
|
+
import { IMessageData } from "../Interfaces/Contracts/IMessageData";
|
|
8
|
+
import { SeverityLevel } from "../Interfaces/Contracts/SeverityLevel";
|
|
9
|
+
import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
|
|
10
|
+
import { dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties } from "./Common/DataSanitizer";
|
|
11
|
+
|
|
12
12
|
export class Trace implements IMessageData, ISerializable {
|
|
13
13
|
|
|
14
14
|
public static envelopeType = "Microsoft.ApplicationInsights.{0}.Message";
|
|
@@ -61,4 +61,4 @@ export class Trace implements IMessageData, ISerializable {
|
|
|
61
61
|
_self.severityLevel = severityLevel;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
IDiagnosticLogger, ITelemetryItem, isNullOrUndefined, objForEachKey, throwError, toISOString
|
|
6
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
7
|
-
import { strIkey, strNotSpecified } from "./Constants";
|
|
8
|
-
import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
|
|
9
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IDiagnosticLogger, ITelemetryItem, isNullOrUndefined, objForEachKey, throwError, toISOString
|
|
6
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
7
|
+
import { strIkey, strNotSpecified } from "./Constants";
|
|
8
|
+
import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Create a telemetry item that the 1DS channel understands
|
|
12
12
|
* @param item - domain specific properties; part B
|
|
@@ -72,4 +72,4 @@ export class TelemetryItemCreator {
|
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
public static create = createTelemetryItem;
|
|
75
|
-
}
|
|
75
|
+
}
|
package/src/ThrottleMgr.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IAppInsightsCore, IDiagnosticLogger, _eInternalMessageId, _throwInternal, arrForEach, eLoggingSeverity, isNotNullOrUndefined,
|
|
3
|
-
isNullOrUndefined, randomValue, safeGetLogger, strTrim
|
|
4
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
import { IThrottleMsgKey } from "./Enums";
|
|
6
|
-
import { IThrottleLocalStorageObj, IThrottleMgrConfig, IThrottleResult } from "./Interfaces/IThrottleMgr";
|
|
7
|
-
import { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from "./StorageHelperFuncs";
|
|
8
|
-
|
|
1
|
+
import {
|
|
2
|
+
IAppInsightsCore, IDiagnosticLogger, _eInternalMessageId, _throwInternal, arrForEach, arrIndexOf, eLoggingSeverity, isNotNullOrUndefined,
|
|
3
|
+
isNullOrUndefined, randomValue, safeGetLogger, strTrim
|
|
4
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
import { IThrottleMsgKey } from "./Enums";
|
|
6
|
+
import { IThrottleInterval, IThrottleLocalStorageObj, IThrottleMgrConfig, IThrottleResult } from "./Interfaces/IThrottleMgr";
|
|
7
|
+
import { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from "./StorageHelperFuncs";
|
|
8
|
+
|
|
9
9
|
const THROTTLE_STORAGE_PREFIX = "appInsightsThrottle";
|
|
10
10
|
|
|
11
11
|
interface SendMsgParameter {
|
|
@@ -34,6 +34,7 @@ export class ThrottleMgr {
|
|
|
34
34
|
let _namePrefix: string;
|
|
35
35
|
let _queue: Array<SendMsgParameter>;
|
|
36
36
|
let _isReady: boolean = false;
|
|
37
|
+
let _isSpecificDaysGiven: boolean = false;
|
|
37
38
|
|
|
38
39
|
_initConfig();
|
|
39
40
|
|
|
@@ -150,14 +151,11 @@ export class ThrottleMgr {
|
|
|
150
151
|
_config = {} as any;
|
|
151
152
|
_config.disabled = !!configMgr.disabled;
|
|
152
153
|
_config.msgKey = configMgr.msgKey;
|
|
153
|
-
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
maxTimesPerMonth: configMgr.interval?.maxTimesPerMonth || 1
|
|
159
|
-
};
|
|
160
|
-
_config.interval = interval;
|
|
154
|
+
|
|
155
|
+
let configInterval = configMgr.interval || {};
|
|
156
|
+
_isSpecificDaysGiven = configInterval?.daysOfMonth && configInterval?.daysOfMonth.length > 0;
|
|
157
|
+
_config.interval = _getIntervalConfig(configInterval);
|
|
158
|
+
|
|
161
159
|
let limit = {
|
|
162
160
|
samplingRate: configMgr.limit?.samplingRate || 100,
|
|
163
161
|
// dafault: every time sent only 1 event
|
|
@@ -174,15 +172,49 @@ export class ThrottleMgr {
|
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
|
|
175
|
+
function _getIntervalConfig(interval: IThrottleInterval) {
|
|
176
|
+
interval = interval || {};
|
|
177
|
+
let monthInterval = interval?.monthInterval;
|
|
178
|
+
let dayInterval = interval?.dayInterval;
|
|
179
|
+
|
|
180
|
+
// default: send data every 3 month each year
|
|
181
|
+
if (isNullOrUndefined(monthInterval) && isNullOrUndefined(dayInterval)) {
|
|
182
|
+
interval.monthInterval = 3;
|
|
183
|
+
if (!_isSpecificDaysGiven) {
|
|
184
|
+
// default: send data on 28th
|
|
185
|
+
interval.daysOfMonth = [28];
|
|
186
|
+
_isSpecificDaysGiven = true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
interval = {
|
|
190
|
+
// dafault: sent every three months
|
|
191
|
+
monthInterval: interval?.monthInterval,
|
|
192
|
+
dayInterval: interval?.dayInterval,
|
|
193
|
+
daysOfMonth: interval?.daysOfMonth
|
|
194
|
+
} as IThrottleInterval;
|
|
195
|
+
return interval;
|
|
196
|
+
}
|
|
197
|
+
|
|
177
198
|
function _canThrottle(config: IThrottleMgrConfig, canUseLocalStorage: boolean, localStorageObj: IThrottleLocalStorageObj) {
|
|
178
199
|
if (!config.disabled && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
|
|
179
200
|
let curDate = _getThrottleDate();
|
|
180
201
|
let date = localStorageObj.date;
|
|
181
202
|
let interval = config.interval;
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
203
|
+
let monthCheck = 1;
|
|
204
|
+
if (interval?.monthInterval) {
|
|
205
|
+
let monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth();
|
|
206
|
+
monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let dayCheck = 1;
|
|
210
|
+
if (_isSpecificDaysGiven) {
|
|
211
|
+
dayCheck = arrIndexOf(interval.daysOfMonth, curDate.getUTCDate());
|
|
212
|
+
} else if (interval?.dayInterval) {
|
|
213
|
+
let daySpan = Math.floor((curDate.getTime() - date.getTime()) / 86400000);
|
|
214
|
+
dayCheck = _checkInterval(interval.dayInterval, 0, daySpan);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return monthCheck >= 0 && dayCheck >= 0;
|
|
186
218
|
}
|
|
187
219
|
return false;
|
|
188
220
|
}
|
|
@@ -282,4 +314,4 @@ export class ThrottleMgr {
|
|
|
282
314
|
return randomValue(1000000) <= _config.limit.samplingRate;
|
|
283
315
|
}
|
|
284
316
|
}
|
|
285
|
-
}
|
|
317
|
+
}
|
package/src/UrlHelperFuncs.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { getDocument, isString } from "@microsoft/applicationinsights-core-js";
|
|
5
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { getDocument, isString } from "@microsoft/applicationinsights-core-js";
|
|
5
|
+
|
|
6
6
|
let _document: any = getDocument() || {};
|
|
7
7
|
|
|
8
8
|
let _htmlAnchorIdx: number = 0;
|
|
@@ -98,4 +98,4 @@ export function urlParseFullHost(url: string, inclPort?: boolean) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
return result;
|
|
101
|
-
}
|
|
101
|
+
}
|
package/src/Util.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
IDiagnosticLogger, IDistributedTraceContext, arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId,
|
|
6
|
-
isValidTraceId
|
|
7
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
8
|
-
import { strIndexOf } from "@nevware21/ts-utils";
|
|
9
|
-
import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from "./Constants";
|
|
10
|
-
import { ITelemetryTrace } from "./Interfaces/Context/ITelemetryTrace";
|
|
11
|
-
import { ICorrelationConfig } from "./Interfaces/ICorrelationConfig";
|
|
12
|
-
import { RequestHeaders, eRequestHeaders } from "./RequestResponseHeaders";
|
|
13
|
-
import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
|
|
14
|
-
import { urlParseFullHost, urlParseUrl } from "./UrlHelperFuncs";
|
|
15
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IDiagnosticLogger, IDistributedTraceContext, arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId,
|
|
6
|
+
isValidTraceId
|
|
7
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
8
|
+
import { strIndexOf } from "@nevware21/ts-utils";
|
|
9
|
+
import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from "./Constants";
|
|
10
|
+
import { ITelemetryTrace } from "./Interfaces/Context/ITelemetryTrace";
|
|
11
|
+
import { ICorrelationConfig } from "./Interfaces/ICorrelationConfig";
|
|
12
|
+
import { RequestHeaders, eRequestHeaders } from "./RequestResponseHeaders";
|
|
13
|
+
import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
|
|
14
|
+
import { urlParseFullHost, urlParseUrl } from "./UrlHelperFuncs";
|
|
15
|
+
|
|
16
16
|
// listing only non-geo specific locations
|
|
17
17
|
const _internalEndpoints: string[] = [
|
|
18
18
|
DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,
|
|
@@ -218,4 +218,4 @@ export function createDistributedTraceContextFromTrace(telemetryTrace?: ITelemet
|
|
|
218
218
|
trace.traceFlags = newTraceFlags
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
|
-
}
|
|
221
|
+
}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
// @skip-file-minify
|
|
4
|
-
|
|
5
|
-
// ##############################################################
|
|
6
|
-
// AUTO GENERATED FILE: This file is Auto Generated during build.
|
|
7
|
-
// ##############################################################
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
// Note: DON'T Export these const from the package as we are still targeting
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
export const _DYN_SPLIT = "split"; // Count: 6
|
|
14
|
-
export const _DYN_LENGTH = "length"; // Count: 41
|
|
15
|
-
export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
|
|
16
|
-
export const _DYN_INGESTIONENDPOINT = "ingestionendpoint"; // Count: 4
|
|
17
|
-
export const _DYN_TO_STRING = "toString"; // Count: 12
|
|
18
|
-
export const _DYN_REMOVE_ITEM = "removeItem"; // Count: 3
|
|
19
|
-
export const _DYN_NAME = "name"; // Count: 11
|
|
20
|
-
export const _DYN_MESSAGE = "message"; // Count: 10
|
|
21
|
-
export const _DYN_COUNT = "count"; // Count: 8
|
|
22
|
-
export const _DYN_PRE_TRIGGER_DATE = "preTriggerDate"; // Count: 4
|
|
23
|
-
export const _DYN_DISABLED = "disabled"; // Count: 3
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
44
|
-
export const
|
|
45
|
-
export const
|
|
46
|
-
export const
|
|
47
|
-
export const
|
|
48
|
-
export const
|
|
49
|
-
export const
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
// @skip-file-minify
|
|
4
|
+
|
|
5
|
+
// ##############################################################
|
|
6
|
+
// AUTO GENERATED FILE: This file is Auto Generated during build.
|
|
7
|
+
// ##############################################################
|
|
8
|
+
|
|
9
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
+
// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
|
|
11
|
+
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
|
+
|
|
13
|
+
export const _DYN_SPLIT = "split"; // Count: 6
|
|
14
|
+
export const _DYN_LENGTH = "length"; // Count: 41
|
|
15
|
+
export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
|
|
16
|
+
export const _DYN_INGESTIONENDPOINT = "ingestionendpoint"; // Count: 4
|
|
17
|
+
export const _DYN_TO_STRING = "toString"; // Count: 12
|
|
18
|
+
export const _DYN_REMOVE_ITEM = "removeItem"; // Count: 3
|
|
19
|
+
export const _DYN_NAME = "name"; // Count: 11
|
|
20
|
+
export const _DYN_MESSAGE = "message"; // Count: 10
|
|
21
|
+
export const _DYN_COUNT = "count"; // Count: 8
|
|
22
|
+
export const _DYN_PRE_TRIGGER_DATE = "preTriggerDate"; // Count: 4
|
|
23
|
+
export const _DYN_DISABLED = "disabled"; // Count: 3
|
|
24
|
+
export const _DYN_INTERVAL = "interval"; // Count: 3
|
|
25
|
+
export const _DYN_DAYS_OF_MONTH = "daysOfMonth"; // Count: 3
|
|
26
|
+
export const _DYN_DATE = "date"; // Count: 5
|
|
27
|
+
export const _DYN_GET_UTCDATE = "getUTCDate"; // Count: 3
|
|
28
|
+
export const _DYN_STRINGIFY = "stringify"; // Count: 4
|
|
29
|
+
export const _DYN_PATHNAME = "pathname"; // Count: 4
|
|
30
|
+
export const _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; // Count: 2
|
|
31
|
+
export const _DYN_EXTENSION_CONFIG = "extensionConfig"; // Count: 4
|
|
32
|
+
export const _DYN_EXCEPTIONS = "exceptions"; // Count: 6
|
|
33
|
+
export const _DYN_PARSED_STACK = "parsedStack"; // Count: 11
|
|
34
|
+
export const _DYN_PROPERTIES = "properties"; // Count: 9
|
|
35
|
+
export const _DYN_MEASUREMENTS = "measurements"; // Count: 9
|
|
36
|
+
export const _DYN_SIZE_IN_BYTES = "sizeInBytes"; // Count: 11
|
|
37
|
+
export const _DYN_TYPE_NAME = "typeName"; // Count: 11
|
|
38
|
+
export const _DYN_SEVERITY_LEVEL = "severityLevel"; // Count: 5
|
|
39
|
+
export const _DYN_PROBLEM_GROUP = "problemGroup"; // Count: 3
|
|
40
|
+
export const _DYN_IS_MANUAL = "isManual"; // Count: 3
|
|
41
|
+
export const _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface"; // Count: 2
|
|
42
|
+
export const _DYN_HAS_FULL_STACK = "hasFullStack"; // Count: 6
|
|
43
|
+
export const _DYN_LEVEL = "level"; // Count: 5
|
|
44
|
+
export const _DYN_METHOD = "method"; // Count: 7
|
|
45
|
+
export const _DYN_ASSEMBLY = "assembly"; // Count: 5
|
|
46
|
+
export const _DYN_FILE_NAME = "fileName"; // Count: 6
|
|
47
|
+
export const _DYN_LINE = "line"; // Count: 6
|
|
48
|
+
export const _DYN_DURATION = "duration"; // Count: 4
|
|
49
|
+
export const _DYN_RECEIVED_RESPONSE = "receivedResponse"; // Count: 2
|
|
50
|
+
export const _DYN_SUBSTRING = "substring"; // Count: 6
|
package/types/Enums.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const enum eStorageType {
|
|
|
6
6
|
SessionStorage = 1
|
|
7
7
|
}
|
|
8
8
|
export declare const StorageType: import("@microsoft/applicationinsights-core-js").EnumValue<typeof eStorageType>;
|
|
9
|
-
export
|
|
9
|
+
export type StorageType = eStorageType | typeof StorageType;
|
|
10
10
|
/**
|
|
11
11
|
* Enum is used in aiDataContract to describe how fields are serialized.
|
|
12
12
|
* For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array
|
|
@@ -32,7 +32,7 @@ export declare const enum eDistributedTracingModes {
|
|
|
32
32
|
W3C = 2
|
|
33
33
|
}
|
|
34
34
|
export declare const DistributedTracingModes: import("@microsoft/applicationinsights-core-js").EnumValue<typeof eDistributedTracingModes>;
|
|
35
|
-
export
|
|
35
|
+
export type DistributedTracingModes = number | eDistributedTracingModes;
|
|
36
36
|
export declare const enum IThrottleMsgKey {
|
|
37
37
|
default = 0,
|
|
38
38
|
ikeyDeprecate = 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type ConnectionStringKey = "authorization" | "instrumentationkey" | "ingestionendpoint" | "location" | "endpointsuffix";
|
|
2
|
+
export type ConnectionString = {
|
|
3
3
|
[key in ConnectionStringKey]?: string;
|
|
4
4
|
};
|
|
@@ -12,4 +12,4 @@ export declare const enum eSeverityLevel {
|
|
|
12
12
|
* Defines the level of severity for the event.
|
|
13
13
|
*/
|
|
14
14
|
export declare const SeverityLevel: import("@microsoft/applicationinsights-core-js").EnumValue<typeof eSeverityLevel>;
|
|
15
|
-
export
|
|
15
|
+
export type SeverityLevel = number | eSeverityLevel;
|
|
@@ -24,19 +24,19 @@ export interface IThrottleInterval {
|
|
|
24
24
|
/**
|
|
25
25
|
* Identifies month interval that items can be sent
|
|
26
26
|
* For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.)
|
|
27
|
-
*
|
|
27
|
+
* If both monthInterval and dayInterval are undefined, it will be set to 3
|
|
28
28
|
*/
|
|
29
29
|
monthInterval?: number;
|
|
30
30
|
/**
|
|
31
|
-
* Identifies days that items can be sent
|
|
32
|
-
* Default:
|
|
31
|
+
* Identifies days Interval from start date that items can be sent
|
|
32
|
+
* Default: undefined
|
|
33
33
|
*/
|
|
34
34
|
dayInterval?: number;
|
|
35
35
|
/**
|
|
36
|
-
* Identifies
|
|
37
|
-
*
|
|
36
|
+
* Identifies days within each month that items can be sent
|
|
37
|
+
* If both monthInterval and dayInterval are undefined, it will be default to [28]
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
daysOfMonth?: number[];
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Identifies basic config
|
|
@@ -9,9 +9,10 @@ export declare const _DYN_MESSAGE = "message";
|
|
|
9
9
|
export declare const _DYN_COUNT = "count";
|
|
10
10
|
export declare const _DYN_PRE_TRIGGER_DATE = "preTriggerDate";
|
|
11
11
|
export declare const _DYN_DISABLED = "disabled";
|
|
12
|
+
export declare const _DYN_INTERVAL = "interval";
|
|
13
|
+
export declare const _DYN_DAYS_OF_MONTH = "daysOfMonth";
|
|
12
14
|
export declare const _DYN_DATE = "date";
|
|
13
15
|
export declare const _DYN_GET_UTCDATE = "getUTCDate";
|
|
14
|
-
export declare const _DYN_MAX_TIMES_PER_MONTH = "maxTimesPerMonth";
|
|
15
16
|
export declare const _DYN_STRINGIFY = "stringify";
|
|
16
17
|
export declare const _DYN_PATHNAME = "pathname";
|
|
17
18
|
export declare const _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns";
|