@microsoft/applicationinsights-web-basic 2.8.10-nightly.2212-03 → 2.8.10-nightly.2301-13
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/aib.2.8.10-nightly.2301-13.integrity.json +26 -0
- package/browser/{aib.2.8.10-nightly.2212-03.js → aib.2.8.10-nightly.2301-13.js} +59 -29
- package/browser/aib.2.8.10-nightly.2301-13.js.map +1 -0
- package/browser/aib.2.8.10-nightly.2301-13.min.js +6 -0
- package/browser/aib.2.8.10-nightly.2301-13.min.js.map +1 -0
- package/browser/aib.2.js +58 -28
- package/browser/aib.2.js.map +1 -1
- package/browser/aib.2.min.js +2 -2
- package/browser/aib.2.min.js.map +1 -1
- package/dist/applicationinsights-web-basic.d.ts +1 -1
- package/dist/applicationinsights-web-basic.js +58 -28
- package/dist/applicationinsights-web-basic.js.map +1 -1
- package/dist/applicationinsights-web-basic.min.js +2 -2
- package/dist/applicationinsights-web-basic.min.js.map +1 -1
- package/dist/applicationinsights-web-basic.rollup.d.ts +1 -1
- package/dist-esm/__DynamicConstants.js +3 -2
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/index.js +12 -11
- package/dist-esm/index.js.map +1 -1
- package/package.json +6 -6
- package/src/__DynamicConstants.ts +15 -14
- package/src/index.ts +24 -26
- package/types/__DynamicConstants.d.ts +2 -1
- package/browser/aib.2.8.10-nightly.2212-03.integrity.json +0 -26
- package/browser/aib.2.8.10-nightly.2212-03.js.map +0 -1
- package/browser/aib.2.8.10-nightly.2212-03.min.js +0 -6
- package/browser/aib.2.8.10-nightly.2212-03.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript Web SDK - Basic, 2.8.10-nightly.
|
|
2
|
+
* Application Insights JavaScript Web SDK - Basic, 2.8.10-nightly.2301-13
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
// 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!!!
|
|
13
13
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
14
|
-
export var
|
|
14
|
+
export var _DYN_INSTRUMENTATION_KEY = "instrumentationKey"; // Count: 3
|
|
15
|
+
export var _DYN_CONNECTION_STRING = "connectionString"; // Count: 3
|
|
15
16
|
export var _DYN_DIAGNOSTIC_LOG_INTER0 = "diagnosticLogInterval"; // Count: 4
|
|
16
17
|
//# sourceMappingURL=__DynamicConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// 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!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// 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!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_INSTRUMENTATION_KEY = \"instrumentationKey\"; // Count: 3\r\nexport var _DYN_CONNECTION_STRING = \"connectionString\"; // Count: 3\r\nexport var _DYN_DIAGNOSTIC_LOG_INTER0 = \"diagnosticLogInterval\"; // Count: 4\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-esm/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript Web SDK - Basic, 2.8.10-nightly.
|
|
2
|
+
* Application Insights JavaScript Web SDK - Basic, 2.8.10-nightly.2301-13
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
8
8
|
import { Sender } from "@microsoft/applicationinsights-channel-js";
|
|
9
|
+
import { DEFAULT_BREEZE_PATH, parseConnectionString } from "@microsoft/applicationinsights-common";
|
|
9
10
|
import { AppInsightsCore, isNullOrUndefined, proxyFunctions, throwError } from "@microsoft/applicationinsights-core-js";
|
|
10
|
-
import { _DYN_DIAGNOSTIC_LOG_INTER0,
|
|
11
|
+
import { _DYN_CONNECTION_STRING, _DYN_DIAGNOSTIC_LOG_INTER0, _DYN_INSTRUMENTATION_KEY } from "./__DynamicConstants";
|
|
11
12
|
/**
|
|
12
13
|
* @export
|
|
13
14
|
* @class ApplicationInsights
|
|
@@ -22,13 +23,19 @@ var ApplicationInsights = /** @class */ (function () {
|
|
|
22
23
|
var core = new AppInsightsCore();
|
|
23
24
|
// initialize the queue and config in case they are undefined
|
|
24
25
|
if (isNullOrUndefined(config) ||
|
|
25
|
-
isNullOrUndefined(config
|
|
26
|
+
(isNullOrUndefined(config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */]) && isNullOrUndefined(config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */]))) {
|
|
26
27
|
throwError("Invalid input configuration");
|
|
27
28
|
}
|
|
28
29
|
dynamicProto(ApplicationInsights, this, function (_self) {
|
|
30
|
+
if (config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */]) {
|
|
31
|
+
var cs = parseConnectionString(config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */]);
|
|
32
|
+
var ingest = cs.ingestionendpoint;
|
|
33
|
+
config.endpointUrl = ingest ? (ingest + DEFAULT_BREEZE_PATH) : config.endpointUrl; // only add /v2/track when from connectionstring
|
|
34
|
+
config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = cs.instrumentationkey || config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];
|
|
35
|
+
}
|
|
29
36
|
_self.config = config;
|
|
30
37
|
_initialize();
|
|
31
|
-
_self
|
|
38
|
+
_self.initialize = _initialize;
|
|
32
39
|
_self.getSKUDefaults = function () {
|
|
33
40
|
_self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] =
|
|
34
41
|
_self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] && _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] > 0 ? _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] : 10000;
|
|
@@ -46,13 +53,7 @@ var ApplicationInsights = /** @class */ (function () {
|
|
|
46
53
|
"addUnloadCb"
|
|
47
54
|
]);
|
|
48
55
|
function _initialize() {
|
|
49
|
-
|
|
50
|
-
var appInsightsChannel = new Sender();
|
|
51
|
-
extensions.push(appInsightsChannel);
|
|
52
|
-
// initialize core
|
|
53
|
-
core[_DYN_INITIALIZE /* @min:%2einitialize */](_self.config, extensions);
|
|
54
|
-
// initialize extensions
|
|
55
|
-
appInsightsChannel[_DYN_INITIALIZE /* @min:%2einitialize */](_self.config, core, extensions);
|
|
56
|
+
core.initialize(_self.config, [new Sender()]);
|
|
56
57
|
core.pollInternalLogs();
|
|
57
58
|
}
|
|
58
59
|
});
|
package/dist-esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js.map","sources":["index.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\nimport { AppInsightsCore, isNullOrUndefined, proxyFunctions, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_DIAGNOSTIC_LOG_INTER0,
|
|
1
|
+
{"version":3,"file":"index.js.map","sources":["index.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\nimport { DEFAULT_BREEZE_PATH, parseConnectionString } from \"@microsoft/applicationinsights-common\";\r\nimport { AppInsightsCore, isNullOrUndefined, proxyFunctions, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_CONNECTION_STRING, _DYN_DIAGNOSTIC_LOG_INTER0, _DYN_INSTRUMENTATION_KEY } from \"./__DynamicConstants\";\r\n/**\r\n * @export\r\n * @class ApplicationInsights\r\n */\r\nvar ApplicationInsights = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ApplicationInsights.\r\n * @param {IConfiguration & IConfig} config\r\n * @memberof ApplicationInsights\r\n */\r\n function ApplicationInsights(config) {\r\n var core = new AppInsightsCore();\r\n // initialize the queue and config in case they are undefined\r\n if (isNullOrUndefined(config) ||\r\n (isNullOrUndefined(config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */]) && isNullOrUndefined(config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */]))) {\r\n throwError(\"Invalid input configuration\");\r\n }\r\n dynamicProto(ApplicationInsights, this, function (_self) {\r\n if (config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */]) {\r\n var cs = parseConnectionString(config[_DYN_CONNECTION_STRING /* @min:%2econnectionString */]);\r\n var ingest = cs.ingestionendpoint;\r\n config.endpointUrl = ingest ? (ingest + DEFAULT_BREEZE_PATH) : config.endpointUrl; // only add /v2/track when from connectionstring\r\n config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */] = cs.instrumentationkey || config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];\r\n }\r\n _self.config = config;\r\n _initialize();\r\n _self.initialize = _initialize;\r\n _self.getSKUDefaults = function () {\r\n _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] =\r\n _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] && _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] > 0 ? _self.config[_DYN_DIAGNOSTIC_LOG_INTER0 /* @min:%2ediagnosticLogInterval */] : 10000;\r\n };\r\n _self.getSKUDefaults();\r\n proxyFunctions(_self, core, [\r\n \"track\",\r\n \"flush\",\r\n \"pollInternalLogs\",\r\n \"stopPollingInternalLogs\",\r\n \"unload\",\r\n \"getPlugin\",\r\n \"addPlugin\",\r\n \"evtNamespace\",\r\n \"addUnloadCb\"\r\n ]);\r\n function _initialize() {\r\n core.initialize(_self.config, [new Sender()]);\r\n core.pollInternalLogs();\r\n }\r\n });\r\n }\r\n /**\r\n * Initialize this instance of ApplicationInsights\r\n *\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.initialize = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Send a manually constructed custom event\r\n *\r\n * @param {ITelemetryItem} item\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.track = function (item) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Immediately send all batched telemetry\r\n * @param {boolean} [async=true]\r\n * @memberof ApplicationInsights\r\n */\r\n ApplicationInsights.prototype.flush = function (async) {\r\n if (async === void 0) { async = true; }\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ApplicationInsights.prototype.pollInternalLogs = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ApplicationInsights.prototype.stopPollingInternalLogs = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n ApplicationInsights.prototype.getSKUDefaults = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered\r\n * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous\r\n * unload call return `true` stating that all plugins reported that they also unloaded, the recommended\r\n * approach is to create a new instance and initialize that instance.\r\n * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable\r\n * to successfully remove any global references or they may just be completing the unload process asynchronously.\r\n */\r\n ApplicationInsights.prototype.unload = function (isAsync, unloadComplete) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Find and return the (first) plugin with the specified identifier if present\r\n * @param pluginIdentifier\r\n */\r\n ApplicationInsights.prototype.getPlugin = function (pluginIdentifier) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add a new plugin to the installation\r\n * @param plugin - The new plugin to add\r\n * @param replaceExisting - should any existing plugin be replaced\r\n * @param doAsync - Should the add be performed asynchronously\r\n */\r\n ApplicationInsights.prototype.addPlugin = function (plugin, replaceExisting, doAsync, addCb) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Returns the unique event namespace that should be used\r\n */\r\n ApplicationInsights.prototype.evtNamespace = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Add an unload handler that will be called when the SDK is being unloaded\r\n * @param handler - the handler\r\n */\r\n ApplicationInsights.prototype.addUnloadCb = function (handler) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return ApplicationInsights;\r\n}());\r\nexport { ApplicationInsights };\r\nexport { AppInsightsCore, CoreUtils, arrForEach, _InternalMessageId, isNullOrUndefined, throwError, proxyFunctions } from \"@microsoft/applicationinsights-core-js\";\r\nexport { SeverityLevel } from \"@microsoft/applicationinsights-common\";\r\nexport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;8DA6EM,CAAC;;;;;;+BACwB;AAC/B;AACA;AACA;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-web-basic",
|
|
3
|
-
"version": "2.8.10-nightly.
|
|
3
|
+
"version": "2.8.10-nightly.2301-13",
|
|
4
4
|
"description": "Microsoft Application Insights Javascript SDK core and channel",
|
|
5
5
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
6
|
"author": "Microsoft Application Insights Team",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@microsoft/api-extractor": "^7.18.1",
|
|
34
34
|
"grunt": "^1.5.3",
|
|
35
35
|
"grunt-cli": "^1.4.3",
|
|
36
|
-
"grunt-contrib-qunit": "^
|
|
36
|
+
"grunt-contrib-qunit": "^6.2.1",
|
|
37
37
|
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
38
38
|
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
39
39
|
"globby": "^11.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@rollup/plugin-replace": "^2.3.3",
|
|
45
45
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
46
46
|
"rollup": "^2.32.0",
|
|
47
|
-
"typescript": "^4.3
|
|
47
|
+
"typescript": "^4.9.3",
|
|
48
48
|
"tslib": "^2.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@microsoft/dynamicproto-js": "^1.1.7",
|
|
55
55
|
"@microsoft/applicationinsights-shims": "2.0.2",
|
|
56
|
-
"@microsoft/applicationinsights-common": "2.8.10-nightly.
|
|
57
|
-
"@microsoft/applicationinsights-channel-js": "2.8.10-nightly.
|
|
58
|
-
"@microsoft/applicationinsights-core-js": "2.8.10-nightly.
|
|
56
|
+
"@microsoft/applicationinsights-common": "2.8.10-nightly.2301-13",
|
|
57
|
+
"@microsoft/applicationinsights-channel-js": "2.8.10-nightly.2301-13",
|
|
58
|
+
"@microsoft/applicationinsights-core-js": "2.8.10-nightly.2301-13"
|
|
59
59
|
},
|
|
60
60
|
"license": "MIT",
|
|
61
61
|
"publishConfig": {
|
|
@@ -1,14 +1,15 @@
|
|
|
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
|
|
14
|
-
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_INSTRUMENTATION_KEY = "instrumentationKey"; // Count: 3
|
|
14
|
+
export const _DYN_CONNECTION_STRING = "connectionString"; // Count: 3
|
|
15
|
+
export const _DYN_DIAGNOSTIC_LOG_INTER0 = "diagnosticLogInterval"; // Count: 4
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
5
|
-
import { Sender } from "@microsoft/applicationinsights-channel-js";
|
|
6
|
-
import { IConfig } from "@microsoft/applicationinsights-common";
|
|
7
|
-
import {
|
|
8
|
-
AppInsightsCore, IConfiguration, ILoadedPlugin, IPlugin, ITelemetryItem, ITelemetryPlugin, UnloadHandler,
|
|
9
|
-
|
|
10
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
11
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
5
|
+
import { Sender } from "@microsoft/applicationinsights-channel-js";
|
|
6
|
+
import { DEFAULT_BREEZE_PATH, IConfig, parseConnectionString } from "@microsoft/applicationinsights-common";
|
|
7
|
+
import {
|
|
8
|
+
AppInsightsCore, IConfiguration, ILoadedPlugin, IPlugin, ITelemetryItem, ITelemetryPlugin, UnloadHandler, isNullOrUndefined,
|
|
9
|
+
proxyFunctions, throwError
|
|
10
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* @export
|
|
14
14
|
* @class ApplicationInsights
|
|
@@ -27,12 +27,20 @@ export class ApplicationInsights {
|
|
|
27
27
|
// initialize the queue and config in case they are undefined
|
|
28
28
|
if (
|
|
29
29
|
isNullOrUndefined(config) ||
|
|
30
|
-
isNullOrUndefined(config.instrumentationKey)
|
|
30
|
+
(isNullOrUndefined(config.instrumentationKey) && isNullOrUndefined(config.connectionString))
|
|
31
31
|
) {
|
|
32
32
|
throwError("Invalid input configuration");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
dynamicProto(ApplicationInsights, this, (_self) => {
|
|
36
|
+
|
|
37
|
+
if (config.connectionString) {
|
|
38
|
+
const cs = parseConnectionString(config.connectionString);
|
|
39
|
+
const ingest = cs.ingestionendpoint;
|
|
40
|
+
config.endpointUrl = ingest ? (ingest + DEFAULT_BREEZE_PATH) : config.endpointUrl; // only add /v2/track when from connectionstring
|
|
41
|
+
config.instrumentationKey = cs.instrumentationkey || config.instrumentationKey;
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
_self.config = config;
|
|
37
45
|
|
|
38
46
|
_initialize();
|
|
@@ -44,7 +52,7 @@ export class ApplicationInsights {
|
|
|
44
52
|
_self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;
|
|
45
53
|
};
|
|
46
54
|
_self.getSKUDefaults();
|
|
47
|
-
|
|
55
|
+
|
|
48
56
|
proxyFunctions(_self, core, [
|
|
49
57
|
"track",
|
|
50
58
|
"flush",
|
|
@@ -58,17 +66,7 @@ export class ApplicationInsights {
|
|
|
58
66
|
]);
|
|
59
67
|
|
|
60
68
|
function _initialize(): void {
|
|
61
|
-
|
|
62
|
-
const appInsightsChannel: Sender = new Sender();
|
|
63
|
-
|
|
64
|
-
extensions.push(appInsightsChannel);
|
|
65
|
-
|
|
66
|
-
// initialize core
|
|
67
|
-
core.initialize(_self.config, extensions);
|
|
68
|
-
|
|
69
|
-
// initialize extensions
|
|
70
|
-
appInsightsChannel.initialize(_self.config, core, extensions);
|
|
71
|
-
|
|
69
|
+
core.initialize(_self.config, [new Sender()]);
|
|
72
70
|
core.pollInternalLogs();
|
|
73
71
|
}
|
|
74
72
|
});
|
|
@@ -179,8 +177,8 @@ export {
|
|
|
179
177
|
proxyFunctions,
|
|
180
178
|
IPlugin,
|
|
181
179
|
ITelemetryPlugin
|
|
182
|
-
|
|
183
180
|
} from "@microsoft/applicationinsights-core-js";
|
|
181
|
+
|
|
184
182
|
export {
|
|
185
183
|
SeverityLevel,
|
|
186
184
|
eSeverityLevel,
|
|
@@ -192,4 +190,4 @@ export {
|
|
|
192
190
|
IPageViewPerformanceTelemetry,
|
|
193
191
|
ITraceTelemetry
|
|
194
192
|
} from "@microsoft/applicationinsights-common";
|
|
195
|
-
export { Sender } from "@microsoft/applicationinsights-channel-js";
|
|
193
|
+
export { Sender } from "@microsoft/applicationinsights-channel-js";
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aib",
|
|
3
|
-
"version": "2.8.10-nightly.2212-03",
|
|
4
|
-
"ext": {
|
|
5
|
-
"@js": {
|
|
6
|
-
"file": "aib.2.8.10-nightly.2212-03.js",
|
|
7
|
-
"type": "text/javascript; charset=utf-8",
|
|
8
|
-
"integrity": "sha256-pPPV7Fh3ct0hCgVJb962j0ed6m4Lv1LeQ9Z1YSjsQzI= sha384-rBjDjFWSvf2pHlDpXFeaVzXLNsxczD/e0bdkSP1hjEOxkIJuiEekMkNPEBeznt7w sha512-F0seH7uItdqt3Jt5OQTzAcFR4GEHspN6TegCxIKA1w+Ixrhp+vcxdCn7hOfaQIeyr3bJoMPglpWa4aT6Ab3xzg==",
|
|
9
|
-
"hashes": {
|
|
10
|
-
"sha256": "pPPV7Fh3ct0hCgVJb962j0ed6m4Lv1LeQ9Z1YSjsQzI=",
|
|
11
|
-
"sha384": "rBjDjFWSvf2pHlDpXFeaVzXLNsxczD/e0bdkSP1hjEOxkIJuiEekMkNPEBeznt7w",
|
|
12
|
-
"sha512": "F0seH7uItdqt3Jt5OQTzAcFR4GEHspN6TegCxIKA1w+Ixrhp+vcxdCn7hOfaQIeyr3bJoMPglpWa4aT6Ab3xzg=="
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"@min.js": {
|
|
16
|
-
"file": "aib.2.8.10-nightly.2212-03.min.js",
|
|
17
|
-
"type": "text/javascript; charset=utf-8",
|
|
18
|
-
"integrity": "sha256-T1y95LutbyuRKlXr2nLRWgxwzQzWrHZP0MrBagrbfnA= sha384-kQTGgskSSTFps+x8FU/eyKl//cKxIGa3fRwSXa9n45Vsvo2l3mtwVBfhUI0H4qus sha512-W1uzreuBixpViMzUQcl877uXc/Ax0rz09qcP8B9iVJAwyOAfrQ+IkI9t+GJ+u5aF9P4CT4NVczmHR8MlUL3a8Q==",
|
|
19
|
-
"hashes": {
|
|
20
|
-
"sha256": "T1y95LutbyuRKlXr2nLRWgxwzQzWrHZP0MrBagrbfnA=",
|
|
21
|
-
"sha384": "kQTGgskSSTFps+x8FU/eyKl//cKxIGa3fRwSXa9n45Vsvo2l3mtwVBfhUI0H4qus",
|
|
22
|
-
"sha512": "W1uzreuBixpViMzUQcl877uXc/Ax0rz09qcP8B9iVJAwyOAfrQ+IkI9t+GJ+u5aF9P4CT4NVczmHR8MlUL3a8Q=="
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|