@microsoft/applicationinsights-web-basic 2.8.0-nightly.2202-06 → 2.8.0-nightly.2204-06

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/dist-esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*
2
- * Application Insights JavaScript Web SDK - Basic, 2.8.0-nightly.2202-06
2
+ * Application Insights JavaScript Web SDK - Basic, 2.8.0-nightly.2204-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- import { AppInsightsCore, isNullOrUndefined, arrForEach, throwError } from "@microsoft/applicationinsights-core-js";
7
+ import dynamicProto from "@microsoft/dynamicproto-js";
8
+ import { AppInsightsCore, isNullOrUndefined, throwError, proxyFunctions } from "@microsoft/applicationinsights-core-js";
8
9
  import { Sender } from "@microsoft/applicationinsights-channel-js";
9
- "use strict";
10
10
  /**
11
11
  * @export
12
12
  * @class ApplicationInsights
@@ -18,69 +18,59 @@ var ApplicationInsights = /** @class */ (function () {
18
18
  * @memberof ApplicationInsights
19
19
  */
20
20
  function ApplicationInsights(config) {
21
+ var core = new AppInsightsCore();
21
22
  // initialize the queue and config in case they are undefined
22
23
  if (isNullOrUndefined(config) ||
23
24
  isNullOrUndefined(config.instrumentationKey)) {
24
25
  throwError("Invalid input configuration");
25
26
  }
26
- this.config = config;
27
- this.getSKUDefaults();
28
- this.initialize();
29
- }
30
- /**
31
- * Initialize this instance of ApplicationInsights
32
- *
33
- * @memberof ApplicationInsights
34
- */
35
- ApplicationInsights.prototype.initialize = function () {
36
- this.core = new AppInsightsCore();
37
- var extensions = [];
38
- var appInsightsChannel = new Sender();
39
- extensions.push(appInsightsChannel);
40
- // initialize core
41
- this.core.initialize(this.config, extensions);
42
- // initialize extensions
43
- appInsightsChannel.initialize(this.config, this.core, extensions);
44
- this.pollInternalLogs();
45
- };
46
- /**
47
- * Send a manually constructed custom event
48
- *
49
- * @param {ITelemetryItem} item
50
- * @memberof ApplicationInsights
51
- */
52
- ApplicationInsights.prototype.track = function (item) {
53
- this.core.track(item);
54
- };
55
- /**
56
- * Immediately send all batched telemetry
57
- * @param {boolean} [async=true]
58
- * @memberof ApplicationInsights
59
- */
60
- ApplicationInsights.prototype.flush = function (async) {
61
- if (async === void 0) { async = true; }
62
- arrForEach(this.core.getTransmissionControls(), function (controls) {
63
- arrForEach(controls, function (plugin) {
64
- async
65
- ? plugin.flush()
66
- : plugin.triggerSend(async, null, 1 /* ManualFlush */);
67
- });
27
+ dynamicProto(ApplicationInsights, this, function (_self) {
28
+ _self.config = config;
29
+ _self.getSKUDefaults();
30
+ _initialize();
31
+ _self.initialize = _initialize;
32
+ _self.getSKUDefaults = function () {
33
+ _self.config.diagnosticLogInterval =
34
+ _self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;
35
+ };
36
+ proxyFunctions(_self, core, [
37
+ "track",
38
+ "flush",
39
+ "pollInternalLogs",
40
+ "stopPollingInternalLogs",
41
+ "unload",
42
+ "getPlugin",
43
+ "addPlugin",
44
+ "evtNamespace",
45
+ "addUnloadCb"
46
+ ]);
47
+ function _initialize() {
48
+ var extensions = [];
49
+ var appInsightsChannel = new Sender();
50
+ extensions.push(appInsightsChannel);
51
+ // initialize core
52
+ core.initialize(this.config, extensions);
53
+ // initialize extensions
54
+ appInsightsChannel.initialize(this.config, core, extensions);
55
+ core.pollInternalLogs();
56
+ }
68
57
  });
69
- };
70
- ApplicationInsights.prototype.pollInternalLogs = function () {
71
- this.core.pollInternalLogs();
72
- };
73
- ApplicationInsights.prototype.stopPollingInternalLogs = function () {
74
- this.core.stopPollingInternalLogs();
75
- };
76
- ApplicationInsights.prototype.getSKUDefaults = function () {
77
- this.config.diagnosticLogInterval =
78
- this.config.diagnosticLogInterval && this.config.diagnosticLogInterval > 0 ? this.config.diagnosticLogInterval : 10000;
79
- };
58
+ }
59
+ // Removed Stub for ApplicationInsights.prototype.initialize.
60
+ // Removed Stub for ApplicationInsights.prototype.track.
61
+ // Removed Stub for ApplicationInsights.prototype.flush.
62
+ // Removed Stub for ApplicationInsights.prototype.pollInternalLogs.
63
+ // Removed Stub for ApplicationInsights.prototype.stopPollingInternalLogs.
64
+ // Removed Stub for ApplicationInsights.prototype.getSKUDefaults.
65
+ // Removed Stub for ApplicationInsights.prototype.unload.
66
+ // Removed Stub for ApplicationInsights.prototype.getPlugin.
67
+ // Removed Stub for ApplicationInsights.prototype.addPlugin.
68
+ // Removed Stub for ApplicationInsights.prototype.evtNamespace.
69
+ // Removed Stub for ApplicationInsights.prototype.addUnloadCb.
80
70
  return ApplicationInsights;
81
71
  }());
82
72
  export { ApplicationInsights };
83
- export { AppInsightsCore, CoreUtils } from "@microsoft/applicationinsights-core-js";
73
+ export { AppInsightsCore, CoreUtils, arrForEach, _InternalMessageId, isNullOrUndefined, throwError, proxyFunctions } from "@microsoft/applicationinsights-core-js";
84
74
  export { SeverityLevel } from "@microsoft/applicationinsights-common";
85
75
  export { Sender } from "@microsoft/applicationinsights-channel-js";
86
76
  //# sourceMappingURL=index.js.map
@@ -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 { AppInsightsCore, isNullOrUndefined, arrForEach, throwError } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\r\n\"use strict\";\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 // initialize the queue and config in case they are undefined\r\n if (isNullOrUndefined(config) ||\r\n isNullOrUndefined(config.instrumentationKey)) {\r\n throwError(\"Invalid input configuration\");\r\n }\r\n this.config = config;\r\n this.getSKUDefaults();\r\n this.initialize();\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 this.core = new AppInsightsCore();\r\n var extensions = [];\r\n var appInsightsChannel = new Sender();\r\n extensions.push(appInsightsChannel);\r\n // initialize core\r\n this.core.initialize(this.config, extensions);\r\n // initialize extensions\r\n appInsightsChannel.initialize(this.config, this.core, extensions);\r\n this.pollInternalLogs();\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 this.core.track(item);\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 arrForEach(this.core.getTransmissionControls(), function (controls) {\r\n arrForEach(controls, function (plugin) {\r\n async\r\n ? plugin.flush()\r\n : plugin.triggerSend(async, null, 1 /* ManualFlush */);\r\n });\r\n });\r\n };\r\n ApplicationInsights.prototype.pollInternalLogs = function () {\r\n this.core.pollInternalLogs();\r\n };\r\n ApplicationInsights.prototype.stopPollingInternalLogs = function () {\r\n this.core.stopPollingInternalLogs();\r\n };\r\n ApplicationInsights.prototype.getSKUDefaults = function () {\r\n this.config.diagnosticLogInterval =\r\n this.config.diagnosticLogInterval && this.config.diagnosticLogInterval > 0 ? this.config.diagnosticLogInterval : 10000;\r\n };\r\n return ApplicationInsights;\r\n}());\r\nexport { ApplicationInsights };\r\nexport { AppInsightsCore, CoreUtils } 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;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"}
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 { AppInsightsCore, isNullOrUndefined, throwError, proxyFunctions } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Sender } from \"@microsoft/applicationinsights-channel-js\";\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.instrumentationKey)) {\r\n throwError(\"Invalid input configuration\");\r\n }\r\n dynamicProto(ApplicationInsights, this, function (_self) {\r\n _self.config = config;\r\n _self.getSKUDefaults();\r\n _initialize();\r\n _self.initialize = _initialize;\r\n _self.getSKUDefaults = function () {\r\n _self.config.diagnosticLogInterval =\r\n _self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;\r\n };\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 var extensions = [];\r\n var appInsightsChannel = new Sender();\r\n extensions.push(appInsightsChannel);\r\n // initialize core\r\n core.initialize(this.config, extensions);\r\n // initialize extensions\r\n appInsightsChannel.initialize(this.config, core, extensions);\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;;;;;;;;;;8DA6EM;AACN;AACA;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.0-nightly.2202-06",
3
+ "version": "2.8.0-nightly.2204-06",
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",
@@ -13,7 +13,7 @@
13
13
  "build:esm": "grunt aiskulite",
14
14
  "build:browser": "rollup -c rollup.config.js",
15
15
  "rebuild": "npm run build",
16
- "test": "echo 'No tests'",
16
+ "test": "grunt aiskuliteunittests",
17
17
  "lint": "tslint -p tsconfig.json",
18
18
  "dtsgen": "api-extractor run --local && node ../scripts/dtsgen.js 'Microsoft.ApplicationInsights'",
19
19
  "sri": "node ../tools/subResourceIntegrity/generateIntegrityFile.js"
@@ -24,6 +24,7 @@
24
24
  "directory": "AISKULight"
25
25
  },
26
26
  "devDependencies": {
27
+ "@microsoft/ai-test-framework": "0.0.1",
27
28
  "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
28
29
  "@microsoft/applicationinsights-rollup-es3": "1.1.3",
29
30
  "@microsoft/api-extractor": "^7.18.1",
@@ -34,10 +35,11 @@
34
35
  "@nevware21/grunt-eslint-ts": "^0.2.2",
35
36
  "globby": "^11.0.0",
36
37
  "magic-string": "^0.25.7",
38
+ "pako": "^2.0.3",
37
39
  "@rollup/plugin-commonjs": "^18.0.0",
38
40
  "@rollup/plugin-node-resolve": "^11.2.1",
39
41
  "@rollup/plugin-replace": "^2.3.3",
40
- "rollup-plugin-cleanup": "3.2.1",
42
+ "rollup-plugin-cleanup": "^3.2.1",
41
43
  "rollup": "^2.32.0",
42
44
  "source-map-loader": "^0.2.3",
43
45
  "typescript": "^4.3.4",
@@ -49,9 +51,9 @@
49
51
  "dependencies": {
50
52
  "@microsoft/dynamicproto-js": "^1.1.4",
51
53
  "@microsoft/applicationinsights-shims": "2.0.1",
52
- "@microsoft/applicationinsights-common": "2.8.0-nightly.2202-06",
53
- "@microsoft/applicationinsights-channel-js": "2.8.0-nightly.2202-06",
54
- "@microsoft/applicationinsights-core-js": "2.8.0-nightly.2202-06"
54
+ "@microsoft/applicationinsights-common": "2.8.0-nightly.2204-06",
55
+ "@microsoft/applicationinsights-channel-js": "2.8.0-nightly.2204-06",
56
+ "@microsoft/applicationinsights-core-js": "2.8.0-nightly.2204-06"
55
57
  },
56
58
  "license": "MIT",
57
59
  "publishConfig": {
package/src/index.ts ADDED
@@ -0,0 +1,203 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import dynamicProto from "@microsoft/dynamicproto-js";
5
+ import {
6
+ IConfiguration,
7
+ AppInsightsCore,
8
+ _InternalMessageId,
9
+ isNullOrUndefined,
10
+ ITelemetryItem,
11
+ throwError,
12
+ proxyFunctions,
13
+ UnloadHandler,
14
+ IPlugin,
15
+ ITelemetryPlugin,
16
+ ILoadedPlugin
17
+ } from "@microsoft/applicationinsights-core-js";
18
+ import { IConfig } from "@microsoft/applicationinsights-common";
19
+ import { Sender } from "@microsoft/applicationinsights-channel-js";
20
+
21
+ /**
22
+ * @export
23
+ * @class ApplicationInsights
24
+ */
25
+ export class ApplicationInsights {
26
+ public config: IConfiguration & IConfig;
27
+
28
+ /**
29
+ * Creates an instance of ApplicationInsights.
30
+ * @param {IConfiguration & IConfig} config
31
+ * @memberof ApplicationInsights
32
+ */
33
+ constructor(config: IConfiguration & IConfig) {
34
+ let core = new AppInsightsCore();
35
+
36
+ // initialize the queue and config in case they are undefined
37
+ if (
38
+ isNullOrUndefined(config) ||
39
+ isNullOrUndefined(config.instrumentationKey)
40
+ ) {
41
+ throwError("Invalid input configuration");
42
+ }
43
+
44
+ dynamicProto(ApplicationInsights, this, (_self) => {
45
+ _self.config = config;
46
+ _self.getSKUDefaults();
47
+
48
+ _initialize();
49
+
50
+ _self.initialize = _initialize;
51
+
52
+ _self.getSKUDefaults = () => {
53
+ _self.config.diagnosticLogInterval =
54
+ _self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;
55
+ };
56
+
57
+ proxyFunctions(_self, core, [
58
+ "track",
59
+ "flush",
60
+ "pollInternalLogs",
61
+ "stopPollingInternalLogs",
62
+ "unload",
63
+ "getPlugin",
64
+ "addPlugin",
65
+ "evtNamespace",
66
+ "addUnloadCb"
67
+ ]);
68
+
69
+ function _initialize(): void {
70
+ const extensions = [];
71
+ const appInsightsChannel: Sender = new Sender();
72
+
73
+ extensions.push(appInsightsChannel);
74
+
75
+ // initialize core
76
+ core.initialize(this.config, extensions);
77
+
78
+ // initialize extensions
79
+ appInsightsChannel.initialize(this.config, core, extensions);
80
+
81
+ core.pollInternalLogs();
82
+ }
83
+ });
84
+ }
85
+
86
+ /**
87
+ * Initialize this instance of ApplicationInsights
88
+ *
89
+ * @memberof ApplicationInsights
90
+ */
91
+ public initialize(): void {
92
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
93
+ }
94
+
95
+ /**
96
+ * Send a manually constructed custom event
97
+ *
98
+ * @param {ITelemetryItem} item
99
+ * @memberof ApplicationInsights
100
+ */
101
+ public track(item: ITelemetryItem) {
102
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
103
+ }
104
+
105
+ /**
106
+ * Immediately send all batched telemetry
107
+ * @param {boolean} [async=true]
108
+ * @memberof ApplicationInsights
109
+ */
110
+ public flush(async: boolean = true) {
111
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
112
+ }
113
+
114
+ public pollInternalLogs(): void {
115
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
116
+ }
117
+
118
+ public stopPollingInternalLogs(): void {
119
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
120
+ }
121
+
122
+ public getSKUDefaults() {
123
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
124
+ }
125
+
126
+ /**
127
+ * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
128
+ * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
129
+ * unload call return `true` stating that all plugins reported that they also unloaded, the recommended
130
+ * approach is to create a new instance and initialize that instance.
131
+ * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
132
+ * to successfully remove any global references or they may just be completing the unload process asynchronously.
133
+ */
134
+ public unload(isAsync?: boolean, unloadComplete?: () => void): void {
135
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
136
+ return null;
137
+ }
138
+
139
+ /**
140
+ * Find and return the (first) plugin with the specified identifier if present
141
+ * @param pluginIdentifier
142
+ */
143
+ public getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T> {
144
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
145
+ return null;
146
+ }
147
+
148
+ /**
149
+ * Add a new plugin to the installation
150
+ * @param plugin - The new plugin to add
151
+ * @param replaceExisting - should any existing plugin be replaced
152
+ * @param doAsync - Should the add be performed asynchronously
153
+ */
154
+ public addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void {
155
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
156
+ }
157
+
158
+ /**
159
+ * Returns the unique event namespace that should be used
160
+ */
161
+ public evtNamespace(): string {
162
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
163
+ return null;
164
+ }
165
+
166
+ /**
167
+ * Add an unload handler that will be called when the SDK is being unloaded
168
+ * @param handler - the handler
169
+ */
170
+ public addUnloadCb(handler: UnloadHandler): void {
171
+ // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
172
+ }
173
+ }
174
+
175
+ export {
176
+ IConfiguration,
177
+ AppInsightsCore,
178
+ IAppInsightsCore,
179
+ CoreUtils,
180
+ ITelemetryItem,
181
+ ILoadedPlugin,
182
+ arrForEach,
183
+ SendRequestReason,
184
+ _eInternalMessageId,
185
+ _InternalMessageId,
186
+ isNullOrUndefined,
187
+ throwError,
188
+ proxyFunctions,
189
+ IPlugin,
190
+ ITelemetryPlugin
191
+
192
+ } from "@microsoft/applicationinsights-core-js";
193
+ export {
194
+ SeverityLevel,
195
+ IPageViewTelemetry,
196
+ IDependencyTelemetry,
197
+ IAutoExceptionTelemetry,
198
+ IEventTelemetry,
199
+ IMetricTelemetry,
200
+ IPageViewPerformanceTelemetry,
201
+ ITraceTelemetry
202
+ } from "@microsoft/applicationinsights-common";
203
+ export { Sender } from "@microsoft/applicationinsights-channel-js";
package/tsconfig.json CHANGED
@@ -16,8 +16,12 @@
16
16
  "declaration": true,
17
17
  "declarationDir": "AISKULight/types",
18
18
  "outDir": "dist-esm",
19
- "rootDir": "AISKULight"
19
+ "rootDir": "./AISKULight/src"
20
20
  },
21
- "include": ["index.ts"],
22
- "exclude": ["node_modules"]
21
+ "include": [
22
+ "src/**/*"
23
+ ],
24
+ "exclude": [
25
+ "node_modules"
26
+ ]
23
27
  }
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IConfiguration, ITelemetryItem } from "@microsoft/applicationinsights-core-js";
1
+ import { IConfiguration, ITelemetryItem, UnloadHandler, IPlugin, ITelemetryPlugin, ILoadedPlugin } from "@microsoft/applicationinsights-core-js";
2
2
  import { IConfig } from "@microsoft/applicationinsights-common";
3
3
  /**
4
4
  * @export
@@ -6,7 +6,6 @@ import { IConfig } from "@microsoft/applicationinsights-common";
6
6
  */
7
7
  export declare class ApplicationInsights {
8
8
  config: IConfiguration & IConfig;
9
- private core;
10
9
  /**
11
10
  * Creates an instance of ApplicationInsights.
12
11
  * @param {IConfiguration & IConfig} config
@@ -32,10 +31,40 @@ export declare class ApplicationInsights {
32
31
  * @memberof ApplicationInsights
33
32
  */
34
33
  flush(async?: boolean): void;
35
- private pollInternalLogs;
34
+ pollInternalLogs(): void;
36
35
  stopPollingInternalLogs(): void;
37
- private getSKUDefaults;
36
+ getSKUDefaults(): void;
37
+ /**
38
+ * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
39
+ * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
40
+ * unload call return `true` stating that all plugins reported that they also unloaded, the recommended
41
+ * approach is to create a new instance and initialize that instance.
42
+ * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
43
+ * to successfully remove any global references or they may just be completing the unload process asynchronously.
44
+ */
45
+ unload(isAsync?: boolean, unloadComplete?: () => void): void;
46
+ /**
47
+ * Find and return the (first) plugin with the specified identifier if present
48
+ * @param pluginIdentifier
49
+ */
50
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
51
+ /**
52
+ * Add a new plugin to the installation
53
+ * @param plugin - The new plugin to add
54
+ * @param replaceExisting - should any existing plugin be replaced
55
+ * @param doAsync - Should the add be performed asynchronously
56
+ */
57
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
58
+ /**
59
+ * Returns the unique event namespace that should be used
60
+ */
61
+ evtNamespace(): string;
62
+ /**
63
+ * Add an unload handler that will be called when the SDK is being unloaded
64
+ * @param handler - the handler
65
+ */
66
+ addUnloadCb(handler: UnloadHandler): void;
38
67
  }
39
- export { IConfiguration, AppInsightsCore, IAppInsightsCore, CoreUtils, ITelemetryItem } from "@microsoft/applicationinsights-core-js";
68
+ export { IConfiguration, AppInsightsCore, IAppInsightsCore, CoreUtils, ITelemetryItem, ILoadedPlugin, arrForEach, SendRequestReason, _eInternalMessageId, _InternalMessageId, isNullOrUndefined, throwError, proxyFunctions, IPlugin, ITelemetryPlugin } from "@microsoft/applicationinsights-core-js";
40
69
  export { SeverityLevel, IPageViewTelemetry, IDependencyTelemetry, IAutoExceptionTelemetry, IEventTelemetry, IMetricTelemetry, IPageViewPerformanceTelemetry, ITraceTelemetry } from "@microsoft/applicationinsights-common";
41
70
  export { Sender } from "@microsoft/applicationinsights-channel-js";
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.19.4"
8
+ "packageVersion": "7.20.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,26 +0,0 @@
1
- {
2
- "name": "aib",
3
- "version": "2.8.0-nightly.2202-06",
4
- "ext": {
5
- "@js": {
6
- "file": "aib.2.8.0-nightly.2202-06.js",
7
- "type": "text/javascript; charset=utf-8",
8
- "integrity": "sha256-ZpyH6Rzn5Jbn2mw7UwF9cqg/RVlJTUC/jPxgObJMoxI= sha384-9wOmQBeFr2smF5R2+JDoUDC3pzGdd9AbWTrJdq99sRBQGC/KapD9fzlej52Cw5Rh sha512-9utyb7/XzgIknA0eOvHGK4BacszN4l9yzucCAcN+bWEISAFsM3MFeWgI1lsFsdNSSlmdWd4Logb1yzfAtiM/Rw==",
9
- "hashes": {
10
- "sha256": "ZpyH6Rzn5Jbn2mw7UwF9cqg/RVlJTUC/jPxgObJMoxI=",
11
- "sha384": "9wOmQBeFr2smF5R2+JDoUDC3pzGdd9AbWTrJdq99sRBQGC/KapD9fzlej52Cw5Rh",
12
- "sha512": "9utyb7/XzgIknA0eOvHGK4BacszN4l9yzucCAcN+bWEISAFsM3MFeWgI1lsFsdNSSlmdWd4Logb1yzfAtiM/Rw=="
13
- }
14
- },
15
- "@min.js": {
16
- "file": "aib.2.8.0-nightly.2202-06.min.js",
17
- "type": "text/javascript; charset=utf-8",
18
- "integrity": "sha256-Jmjk1wejIwf1lJtgTfXnZEzIEJZAY+LY30wZBXXnBCI= sha384-/0PZxq1m87Our/82cziYNOSi6UtQWS3uaaDU4GGoLwHDHRlQWciMOw9unaIstCUy sha512-v78Rkxzq0LonOGz99fy2XLNjHp5eEpVa2MbTIweTi8xGA8786fO+e5jz+THtIKWU1fZPokRCikPUURQ1YRCARg==",
19
- "hashes": {
20
- "sha256": "Jmjk1wejIwf1lJtgTfXnZEzIEJZAY+LY30wZBXXnBCI=",
21
- "sha384": "/0PZxq1m87Our/82cziYNOSi6UtQWS3uaaDU4GGoLwHDHRlQWciMOw9unaIstCUy",
22
- "sha512": "v78Rkxzq0LonOGz99fy2XLNjHp5eEpVa2MbTIweTi8xGA8786fO+e5jz+THtIKWU1fZPokRCikPUURQ1YRCARg=="
23
- }
24
- }
25
- }
26
- }