@microsoft/applicationinsights-common 3.0.0-beta.2303-02 → 3.0.0-beta.2303-03
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 +116 -33
- 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 +57 -9
- package/dist/applicationinsights-common.api.md +5 -5
- package/dist/applicationinsights-common.d.ts +16 -3
- package/dist/applicationinsights-common.js +116 -33
- 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 +16 -3
- 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 +54 -34
- 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 +1 -1
- package/dist-esm/applicationinsights-common.js +1 -1
- package/package.json +2 -2
- package/src/Enums.ts +10 -0
- package/src/Interfaces/IThrottleMgr.ts +4 -2
- package/src/ThrottleMgr.ts +61 -33
- package/src/applicationinsights-common.ts +1 -1
- package/types/Enums.d.ts +9 -0
- package/types/Interfaces/IThrottleMgr.d.ts +3 -1
- package/types/ThrottleMgr.d.ts +3 -2
- package/types/applicationinsights-common.d.ts +1 -1
|
@@ -13918,7 +13918,7 @@
|
|
|
13918
13918
|
{
|
|
13919
13919
|
"kind": "PropertySignature",
|
|
13920
13920
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleMgrConfig#limit:member",
|
|
13921
|
-
"docComment": "/**\n * Identifies limit number/percentage of items sent per time\n */\n",
|
|
13921
|
+
"docComment": "/**\n * Identifies limit number/percentage of items sent per time Default: sampling percentage 0.01% with one item sent per time\n */\n",
|
|
13922
13922
|
"excerptTokens": [
|
|
13923
13923
|
{
|
|
13924
13924
|
"kind": "Content",
|
|
@@ -13946,11 +13946,11 @@
|
|
|
13946
13946
|
{
|
|
13947
13947
|
"kind": "PropertySignature",
|
|
13948
13948
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleMgrConfig#msgKey:member",
|
|
13949
|
-
"docComment": "/**\n * Identifies message key to be used for local storage key\n */\n",
|
|
13949
|
+
"docComment": "/**\n * Identifies message key to be used for local storage key Default: IThrottleMsgKey.default\n */\n",
|
|
13950
13950
|
"excerptTokens": [
|
|
13951
13951
|
{
|
|
13952
13952
|
"kind": "Content",
|
|
13953
|
-
"text": "msgKey
|
|
13953
|
+
"text": "msgKey?: "
|
|
13954
13954
|
},
|
|
13955
13955
|
{
|
|
13956
13956
|
"kind": "Reference",
|
|
@@ -13963,7 +13963,7 @@
|
|
|
13963
13963
|
}
|
|
13964
13964
|
],
|
|
13965
13965
|
"isReadonly": false,
|
|
13966
|
-
"isOptional":
|
|
13966
|
+
"isOptional": true,
|
|
13967
13967
|
"releaseTag": "Public",
|
|
13968
13968
|
"name": "msgKey",
|
|
13969
13969
|
"propertyTypeTokenRange": {
|
|
@@ -13992,7 +13992,7 @@
|
|
|
13992
13992
|
{
|
|
13993
13993
|
"kind": "EnumMember",
|
|
13994
13994
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleMsgKey.cdnDeprecate:member",
|
|
13995
|
-
"docComment": "",
|
|
13995
|
+
"docComment": "/**\n * Message key for cdn Deprecation\n */\n",
|
|
13996
13996
|
"excerptTokens": [
|
|
13997
13997
|
{
|
|
13998
13998
|
"kind": "Content",
|
|
@@ -14013,7 +14013,7 @@
|
|
|
14013
14013
|
{
|
|
14014
14014
|
"kind": "EnumMember",
|
|
14015
14015
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleMsgKey.default:member",
|
|
14016
|
-
"docComment": "",
|
|
14016
|
+
"docComment": "/**\n * Default Message key for non pre-defined message\n */\n",
|
|
14017
14017
|
"excerptTokens": [
|
|
14018
14018
|
{
|
|
14019
14019
|
"kind": "Content",
|
|
@@ -14034,7 +14034,7 @@
|
|
|
14034
14034
|
{
|
|
14035
14035
|
"kind": "EnumMember",
|
|
14036
14036
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleMsgKey.ikeyDeprecate:member",
|
|
14037
|
-
"docComment": "",
|
|
14037
|
+
"docComment": "/**\n * Message key for ikey Deprecation\n */\n",
|
|
14038
14038
|
"excerptTokens": [
|
|
14039
14039
|
{
|
|
14040
14040
|
"kind": "Content",
|
|
@@ -17895,7 +17895,7 @@
|
|
|
17895
17895
|
"excerptTokens": [
|
|
17896
17896
|
{
|
|
17897
17897
|
"kind": "Content",
|
|
17898
|
-
"text": "constructor(
|
|
17898
|
+
"text": "constructor(config?: "
|
|
17899
17899
|
},
|
|
17900
17900
|
{
|
|
17901
17901
|
"kind": "Reference",
|
|
@@ -17919,6 +17919,15 @@
|
|
|
17919
17919
|
"kind": "Content",
|
|
17920
17920
|
"text": "string"
|
|
17921
17921
|
},
|
|
17922
|
+
{
|
|
17923
|
+
"kind": "Content",
|
|
17924
|
+
"text": ", unloadHookContainer?: "
|
|
17925
|
+
},
|
|
17926
|
+
{
|
|
17927
|
+
"kind": "Reference",
|
|
17928
|
+
"text": "IUnloadHookContainer",
|
|
17929
|
+
"canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadHookContainer:interface"
|
|
17930
|
+
},
|
|
17922
17931
|
{
|
|
17923
17932
|
"kind": "Content",
|
|
17924
17933
|
"text": ");"
|
|
@@ -17929,7 +17938,7 @@
|
|
|
17929
17938
|
"overloadIndex": 1,
|
|
17930
17939
|
"parameters": [
|
|
17931
17940
|
{
|
|
17932
|
-
"parameterName": "
|
|
17941
|
+
"parameterName": "config",
|
|
17933
17942
|
"parameterTypeTokenRange": {
|
|
17934
17943
|
"startIndex": 1,
|
|
17935
17944
|
"endIndex": 2
|
|
@@ -17951,6 +17960,14 @@
|
|
|
17951
17960
|
"endIndex": 6
|
|
17952
17961
|
},
|
|
17953
17962
|
"isOptional": true
|
|
17963
|
+
},
|
|
17964
|
+
{
|
|
17965
|
+
"parameterName": "unloadHookContainer",
|
|
17966
|
+
"parameterTypeTokenRange": {
|
|
17967
|
+
"startIndex": 7,
|
|
17968
|
+
"endIndex": 8
|
|
17969
|
+
},
|
|
17970
|
+
"isOptional": true
|
|
17954
17971
|
}
|
|
17955
17972
|
]
|
|
17956
17973
|
},
|
|
@@ -17984,6 +18001,37 @@
|
|
|
17984
18001
|
"isProtected": false,
|
|
17985
18002
|
"isAbstract": false
|
|
17986
18003
|
},
|
|
18004
|
+
{
|
|
18005
|
+
"kind": "Property",
|
|
18006
|
+
"canonicalReference": "@microsoft/applicationinsights-common!ThrottleMgr#config:member",
|
|
18007
|
+
"docComment": "",
|
|
18008
|
+
"excerptTokens": [
|
|
18009
|
+
{
|
|
18010
|
+
"kind": "Content",
|
|
18011
|
+
"text": "config: "
|
|
18012
|
+
},
|
|
18013
|
+
{
|
|
18014
|
+
"kind": "Reference",
|
|
18015
|
+
"text": "IThrottleMgrConfig",
|
|
18016
|
+
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleMgrConfig:interface"
|
|
18017
|
+
},
|
|
18018
|
+
{
|
|
18019
|
+
"kind": "Content",
|
|
18020
|
+
"text": ";"
|
|
18021
|
+
}
|
|
18022
|
+
],
|
|
18023
|
+
"isReadonly": false,
|
|
18024
|
+
"isOptional": false,
|
|
18025
|
+
"releaseTag": "Public",
|
|
18026
|
+
"name": "config",
|
|
18027
|
+
"propertyTypeTokenRange": {
|
|
18028
|
+
"startIndex": 1,
|
|
18029
|
+
"endIndex": 2
|
|
18030
|
+
},
|
|
18031
|
+
"isStatic": false,
|
|
18032
|
+
"isProtected": false,
|
|
18033
|
+
"isAbstract": false
|
|
18034
|
+
},
|
|
17987
18035
|
{
|
|
17988
18036
|
"kind": "Property",
|
|
17989
18037
|
"canonicalReference": "@microsoft/applicationinsights-common!ThrottleMgr#flush:member",
|
|
@@ -25,6 +25,7 @@ import { isValidTraceId } from '@microsoft/applicationinsights-core-js';
|
|
|
25
25
|
import { isValidTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
26
26
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
27
27
|
import { ITraceParent } from '@microsoft/applicationinsights-core-js';
|
|
28
|
+
import { IUnloadHookContainer } from '@microsoft/applicationinsights-core-js';
|
|
28
29
|
import { parseTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
29
30
|
|
|
30
31
|
// @public
|
|
@@ -865,16 +866,13 @@ export interface IThrottleMgrConfig {
|
|
|
865
866
|
disabled?: boolean;
|
|
866
867
|
interval?: IThrottleInterval;
|
|
867
868
|
limit?: IThrottleLimit;
|
|
868
|
-
msgKey
|
|
869
|
+
msgKey?: IThrottleMsgKey;
|
|
869
870
|
}
|
|
870
871
|
|
|
871
872
|
// @public (undocumented)
|
|
872
873
|
export const enum IThrottleMsgKey {
|
|
873
|
-
// (undocumented)
|
|
874
874
|
cdnDeprecate = 2,
|
|
875
|
-
// (undocumented)
|
|
876
875
|
default = 0,
|
|
877
|
-
// (undocumented)
|
|
878
876
|
ikeyDeprecate = 1
|
|
879
877
|
}
|
|
880
878
|
|
|
@@ -1131,10 +1129,12 @@ export class TelemetryItemCreator {
|
|
|
1131
1129
|
|
|
1132
1130
|
// @public (undocumented)
|
|
1133
1131
|
export class ThrottleMgr {
|
|
1134
|
-
constructor(
|
|
1132
|
+
constructor(config?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string, unloadHookContainer?: IUnloadHookContainer);
|
|
1135
1133
|
// (undocumented)
|
|
1136
1134
|
canThrottle: () => boolean;
|
|
1137
1135
|
// (undocumented)
|
|
1136
|
+
config: IThrottleMgrConfig;
|
|
1137
|
+
// (undocumented)
|
|
1138
1138
|
flush: () => boolean;
|
|
1139
1139
|
// (undocumented)
|
|
1140
1140
|
getConfig: () => IThrottleMgrConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2303-
|
|
2
|
+
* Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2303-03
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -28,6 +28,7 @@ declare namespace ApplicationInsights {
|
|
|
28
28
|
import { isValidTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
29
29
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
30
30
|
import { ITraceParent } from '@microsoft/applicationinsights-core-js';
|
|
31
|
+
import { IUnloadHookContainer } from '@microsoft/applicationinsights-core-js';
|
|
31
32
|
import { parseTraceParent } from '@microsoft/applicationinsights-core-js';
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -2022,8 +2023,9 @@ declare namespace ApplicationInsights {
|
|
|
2022
2023
|
interface IThrottleMgrConfig {
|
|
2023
2024
|
/**
|
|
2024
2025
|
* Identifies message key to be used for local storage key
|
|
2026
|
+
* Default: IThrottleMsgKey.default
|
|
2025
2027
|
*/
|
|
2026
|
-
msgKey
|
|
2028
|
+
msgKey?: IThrottleMsgKey;
|
|
2027
2029
|
/**
|
|
2028
2030
|
* Identifies if throttle is disabled
|
|
2029
2031
|
* Default: false
|
|
@@ -2031,6 +2033,7 @@ declare namespace ApplicationInsights {
|
|
|
2031
2033
|
disabled?: boolean;
|
|
2032
2034
|
/**
|
|
2033
2035
|
* Identifies limit number/percentage of items sent per time
|
|
2036
|
+
* Default: sampling percentage 0.01% with one item sent per time
|
|
2034
2037
|
*/
|
|
2035
2038
|
limit?: IThrottleLimit;
|
|
2036
2039
|
/**
|
|
@@ -2041,8 +2044,17 @@ declare namespace ApplicationInsights {
|
|
|
2041
2044
|
}
|
|
2042
2045
|
|
|
2043
2046
|
const enum IThrottleMsgKey {
|
|
2047
|
+
/**
|
|
2048
|
+
* Default Message key for non pre-defined message
|
|
2049
|
+
*/
|
|
2044
2050
|
default = 0,
|
|
2051
|
+
/**
|
|
2052
|
+
* Message key for ikey Deprecation
|
|
2053
|
+
*/
|
|
2045
2054
|
ikeyDeprecate = 1,
|
|
2055
|
+
/**
|
|
2056
|
+
* Message key for cdn Deprecation
|
|
2057
|
+
*/
|
|
2046
2058
|
cdnDeprecate = 2
|
|
2047
2059
|
}
|
|
2048
2060
|
|
|
@@ -2459,7 +2471,8 @@ declare namespace ApplicationInsights {
|
|
|
2459
2471
|
isReady: () => boolean;
|
|
2460
2472
|
onReadyState: (isReady?: boolean) => boolean;
|
|
2461
2473
|
flush: () => boolean;
|
|
2462
|
-
|
|
2474
|
+
config: IThrottleMgrConfig;
|
|
2475
|
+
constructor(config?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string, unloadHookContainer?: IUnloadHookContainer);
|
|
2463
2476
|
}
|
|
2464
2477
|
|
|
2465
2478
|
class Trace implements IMessageData, ISerializable {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.0-beta.2303-
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.0-beta.2303-03
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
var POLYFILL_TAG = "_polyfill";
|
|
29
29
|
var INDEX_OF = "indexOf";
|
|
30
30
|
var LENGTH = "length";
|
|
31
|
+
var DONE = "done";
|
|
31
32
|
var VALUE = "value";
|
|
32
33
|
var NAME = "name";
|
|
33
34
|
var ObjClass$1 = Object;
|
|
@@ -403,6 +404,27 @@
|
|
|
403
404
|
(!_symbolFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();
|
|
404
405
|
return (_symbolFor.v || polySymbolFor)(key);
|
|
405
406
|
}
|
|
407
|
+
function isIterator(value) {
|
|
408
|
+
return !!value && isFunction(value.next);
|
|
409
|
+
}
|
|
410
|
+
function arrAppend(target, elms) {
|
|
411
|
+
if (!isUndefined(elms) && target) {
|
|
412
|
+
if (isArray(elms)) {
|
|
413
|
+
target.push.apply(target, elms);
|
|
414
|
+
}
|
|
415
|
+
else if (isIterator(elms)) {
|
|
416
|
+
var value = elms.next();
|
|
417
|
+
while (!value[DONE]) {
|
|
418
|
+
target.push(value[VALUE]);
|
|
419
|
+
value = elms.next();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
target.push(elms);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return target;
|
|
427
|
+
}
|
|
406
428
|
function arrForEach(theArray, callbackfn, thisArg) {
|
|
407
429
|
if (theArray) {
|
|
408
430
|
var len = theArray[LENGTH] >>> 0;
|
|
@@ -1019,6 +1041,7 @@
|
|
|
1019
1041
|
var STR_EMPTY = "";
|
|
1020
1042
|
var STR_ERROR_TO_CONSOLE = "errorToConsole";
|
|
1021
1043
|
var STR_WARN_TO_CONSOLE = "warnToConsole";
|
|
1044
|
+
var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
|
|
1022
1045
|
|
|
1023
1046
|
var rCamelCase = /-([a-z])/g;
|
|
1024
1047
|
var rNormalizeInvalid = /([^\w\d_$])/g;
|
|
@@ -1217,7 +1240,7 @@
|
|
|
1217
1240
|
return result;
|
|
1218
1241
|
}
|
|
1219
1242
|
|
|
1220
|
-
var version = "3.0.0-beta.2303-
|
|
1243
|
+
var version = "3.0.0-beta.2303-03";
|
|
1221
1244
|
var instanceName = "." + newId(6);
|
|
1222
1245
|
var _dataUid = 0;
|
|
1223
1246
|
function createUniqueNamespace(name, includeVersion) {
|
|
@@ -1722,6 +1745,15 @@
|
|
|
1722
1745
|
_makeDynamicObject(theState, newTarget);
|
|
1723
1746
|
return cfgHandler;
|
|
1724
1747
|
}
|
|
1748
|
+
function _logInvalidAccess(logger, message) {
|
|
1749
|
+
if (logger) {
|
|
1750
|
+
logger[STR_WARN_TO_CONSOLE ](message);
|
|
1751
|
+
logger[_DYN_THROW_INTERNAL ](2 , 108 , message);
|
|
1752
|
+
}
|
|
1753
|
+
else {
|
|
1754
|
+
throwInvalidAccess(message);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1725
1757
|
function createDynamicConfig(config, defaultConfig, logger, inPlace) {
|
|
1726
1758
|
var dynamicHandler = _createDynamicHandler(logger, config || {}, inPlace);
|
|
1727
1759
|
if (defaultConfig) {
|
|
@@ -1729,6 +1761,14 @@
|
|
|
1729
1761
|
}
|
|
1730
1762
|
return dynamicHandler;
|
|
1731
1763
|
}
|
|
1764
|
+
function onConfigChange(config, configHandler, logger) {
|
|
1765
|
+
var handler = config[CFG_HANDLER_LINK] || config;
|
|
1766
|
+
if (handler.cfg && (handler.cfg === config || handler.cfg[CFG_HANDLER_LINK] === handler)) {
|
|
1767
|
+
return handler[_DYN_WATCH ](configHandler);
|
|
1768
|
+
}
|
|
1769
|
+
_logInvalidAccess(logger, STR_NOT_DYNAMIC_ERROR + dumpObj(config));
|
|
1770
|
+
createDynamicConfig(config, null, logger)[_DYN_WATCH ](configHandler);
|
|
1771
|
+
}
|
|
1732
1772
|
|
|
1733
1773
|
var _aiNamespace = null;
|
|
1734
1774
|
function _getExtensionNamespace() {
|
|
@@ -2044,6 +2084,31 @@
|
|
|
2044
2084
|
return traceParent;
|
|
2045
2085
|
}
|
|
2046
2086
|
|
|
2087
|
+
function createUnloadHookContainer() {
|
|
2088
|
+
var _hooks = [];
|
|
2089
|
+
function _doUnload(logger) {
|
|
2090
|
+
var oldHooks = _hooks;
|
|
2091
|
+
_hooks = [];
|
|
2092
|
+
arrForEach(oldHooks, function (fn) {
|
|
2093
|
+
try {
|
|
2094
|
+
(fn.rm || fn.remove).call(fn);
|
|
2095
|
+
}
|
|
2096
|
+
catch (e) {
|
|
2097
|
+
_throwInternal(logger, 2 , 73 , "Unloading:" + dumpObj(e));
|
|
2098
|
+
}
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
function _addHook(hooks) {
|
|
2102
|
+
if (hooks) {
|
|
2103
|
+
arrAppend(_hooks, hooks);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
return {
|
|
2107
|
+
run: _doUnload,
|
|
2108
|
+
add: _addHook
|
|
2109
|
+
};
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2047
2112
|
var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
|
2048
2113
|
var SampleRate = "sampleRate";
|
|
2049
2114
|
var ProcessLegacy = "ProcessLegacy";
|
|
@@ -2606,7 +2671,7 @@
|
|
|
2606
2671
|
|
|
2607
2672
|
var THROTTLE_STORAGE_PREFIX = "appInsightsThrottle";
|
|
2608
2673
|
var ThrottleMgr = /** @class */ (function () {
|
|
2609
|
-
function ThrottleMgr(
|
|
2674
|
+
function ThrottleMgr(config, core, namePrefix, unloadHookContainer) {
|
|
2610
2675
|
var _self = this;
|
|
2611
2676
|
var _canUseLocalStorage;
|
|
2612
2677
|
var _logger;
|
|
@@ -2619,6 +2684,9 @@
|
|
|
2619
2684
|
var _isReady = false;
|
|
2620
2685
|
var _isSpecificDaysGiven = false;
|
|
2621
2686
|
_initConfig();
|
|
2687
|
+
_self["_getDbgPlgTargets"] = function () {
|
|
2688
|
+
return [_queue];
|
|
2689
|
+
};
|
|
2622
2690
|
_self.getConfig = function () {
|
|
2623
2691
|
return _config;
|
|
2624
2692
|
};
|
|
@@ -2634,8 +2702,10 @@
|
|
|
2634
2702
|
_self.flush = function () {
|
|
2635
2703
|
try {
|
|
2636
2704
|
if (_isReady && _queue[_DYN_LENGTH ] > 0) {
|
|
2637
|
-
|
|
2638
|
-
|
|
2705
|
+
var items = _queue.slice(0);
|
|
2706
|
+
_queue = [];
|
|
2707
|
+
arrForEach(items, function (item) {
|
|
2708
|
+
_flushMessage(item.msgID, item[_DYN_MESSAGE ], item.severity, false);
|
|
2639
2709
|
});
|
|
2640
2710
|
return true;
|
|
2641
2711
|
}
|
|
@@ -2649,6 +2719,9 @@
|
|
|
2649
2719
|
return _self.flush();
|
|
2650
2720
|
};
|
|
2651
2721
|
_self.sendMessage = function (msgID, message, severity) {
|
|
2722
|
+
return _flushMessage(msgID, message, severity, true);
|
|
2723
|
+
};
|
|
2724
|
+
function _flushMessage(msgID, message, severity, saveUnsentMsg) {
|
|
2652
2725
|
if (_isReady) {
|
|
2653
2726
|
var isSampledIn = _canSampledIn();
|
|
2654
2727
|
if (!isSampledIn) {
|
|
@@ -2682,40 +2755,47 @@
|
|
|
2682
2755
|
};
|
|
2683
2756
|
}
|
|
2684
2757
|
else {
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2758
|
+
if (!!saveUnsentMsg) {
|
|
2759
|
+
_queue.push({
|
|
2760
|
+
msgID: msgID,
|
|
2761
|
+
message: message,
|
|
2762
|
+
severity: severity
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2690
2765
|
}
|
|
2691
2766
|
return null;
|
|
2692
|
-
}
|
|
2767
|
+
}
|
|
2693
2768
|
function _initConfig() {
|
|
2694
|
-
var _a, _b;
|
|
2695
|
-
_canUseLocalStorage = utlCanUseLocalStorage();
|
|
2696
2769
|
_logger = safeGetLogger(core);
|
|
2697
2770
|
_isTriggered = false;
|
|
2698
|
-
_namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : "";
|
|
2699
2771
|
_queue = [];
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2772
|
+
_namePrefix = isNotNullOrUndefined(namePrefix) ? namePrefix : "";
|
|
2773
|
+
unloadHookContainer = unloadHookContainer || createUnloadHookContainer();
|
|
2774
|
+
config = createDynamicConfig(config || {}, null, _logger).cfg;
|
|
2775
|
+
var unloadHook = onConfigChange((config), function () {
|
|
2776
|
+
var _a, _b;
|
|
2777
|
+
_canUseLocalStorage = utlCanUseLocalStorage();
|
|
2778
|
+
var configMgr = config || {};
|
|
2779
|
+
_config = {};
|
|
2780
|
+
_config[_DYN_DISABLED ] = !!configMgr[_DYN_DISABLED ];
|
|
2781
|
+
_config.msgKey = configMgr.msgKey || 0 ;
|
|
2782
|
+
var configInterval = configMgr[_DYN_INTERVAL ] || {};
|
|
2783
|
+
_isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH ]) > 0;
|
|
2784
|
+
_config[_DYN_INTERVAL ] = _getIntervalConfig(configInterval);
|
|
2785
|
+
var limit = {
|
|
2786
|
+
samplingRate: ((_a = configMgr.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,
|
|
2787
|
+
maxSendNumber: ((_b = configMgr.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1
|
|
2788
|
+
};
|
|
2789
|
+
_config.limit = limit;
|
|
2790
|
+
_localStorageName = _getLocalStorageName(_config.msgKey, _namePrefix);
|
|
2791
|
+
if (_canUseLocalStorage && _localStorageName) {
|
|
2792
|
+
_localStorageObj = _getLocalStorageObj(utlGetLocalStorage(_logger, _localStorageName), _logger, _localStorageName);
|
|
2793
|
+
}
|
|
2794
|
+
if (_localStorageObj) {
|
|
2795
|
+
_isTriggered = _isTriggeredOnCurDate(_localStorageObj[_DYN_PRE_TRIGGER_DATE ]);
|
|
2796
|
+
}
|
|
2797
|
+
});
|
|
2798
|
+
unloadHookContainer && unloadHookContainer.add(unloadHook);
|
|
2719
2799
|
}
|
|
2720
2800
|
function _getIntervalConfig(interval) {
|
|
2721
2801
|
interval = interval || {};
|
|
@@ -2825,6 +2905,9 @@
|
|
|
2825
2905
|
return false;
|
|
2826
2906
|
}
|
|
2827
2907
|
function _checkInterval(interval, start, current) {
|
|
2908
|
+
if (interval <= 0) {
|
|
2909
|
+
return 1;
|
|
2910
|
+
}
|
|
2828
2911
|
return (current >= start) && (current - start) % interval == 0 ? Math.floor((current - start) / interval) + 1 : -1;
|
|
2829
2912
|
}
|
|
2830
2913
|
function _sendMessage(msgID, logger, message, severity) {
|