@microsoft/applicationinsights-core-js 2.7.2-nightly.2111-08 → 2.7.2-nightly.2111-09

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.
Files changed (69) hide show
  1. package/CONTRIBUTING.md +14 -0
  2. package/Tests/Perf/src/CorePerfCheck.Tests.ts +828 -0
  3. package/Tests/Perf/src/aiperftests.ts +6 -0
  4. package/Tests/Perf/tsconfig.json +17 -0
  5. package/Tests/PerfTests.html +54 -0
  6. package/Tests/Unit/src/AppInsightsCoreSize.Tests.ts +59 -0
  7. package/Tests/Unit/src/ApplicationInsightsCore.Tests.ts +1015 -0
  8. package/Tests/Unit/src/CookieManager.Tests.ts +477 -0
  9. package/Tests/Unit/src/HelperFunc.Tests.ts +59 -0
  10. package/Tests/Unit/src/aiunittests.ts +13 -0
  11. package/Tests/UnitTests.html +48 -0
  12. package/Tests/tsconfig.json +17 -0
  13. package/api-extractor.json +361 -0
  14. package/applicationinsights-core-js.build.error.log +205 -0
  15. package/applicationinsights-core-js.build.log +612 -0
  16. package/browser/applicationinsights-core-js.integrity.json +9 -9
  17. package/browser/applicationinsights-core-js.js +1 -1
  18. package/browser/applicationinsights-core-js.js.map +1 -1
  19. package/browser/applicationinsights-core-js.min.js +1 -1
  20. package/browser/applicationinsights-core-js.min.js.map +1 -1
  21. package/dist/applicationinsights-core-js.api.json +1 -1
  22. package/dist/applicationinsights-core-js.d.ts +1 -1
  23. package/dist/applicationinsights-core-js.js +1 -1
  24. package/dist/applicationinsights-core-js.js.map +1 -1
  25. package/dist/applicationinsights-core-js.min.js +1 -1
  26. package/dist/applicationinsights-core-js.min.js.map +1 -1
  27. package/dist/applicationinsights-core-js.rollup.d.ts +1 -1
  28. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  29. package/dist-esm/JavaScriptSDK/BaseCore.js +1 -1
  30. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  31. package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
  32. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  33. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  34. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  35. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  36. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  37. package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
  38. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  39. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  40. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  41. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  42. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  43. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  44. package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +1 -1
  45. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  46. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  47. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  48. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  52. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  62. package/dist-esm/applicationinsights-core-js.js +1 -1
  63. package/microsoft-applicationinsights-core-js-2.7.2-nightly.2111-09.tgz +0 -0
  64. package/package.json +1 -1
  65. package/rollup.config.js +138 -0
  66. package/src/applicationinsights-core-js.ts +59 -0
  67. package/temp/applicationinsights-core-js.api.md +934 -0
  68. package/tslint.json +5 -0
  69. package/types/tsdoc-metadata.json +1 -1
@@ -0,0 +1,6 @@
1
+ import '@microsoft/applicationinsights-shims';
2
+ import { CorePerfCheckTests } from './CorePerfCheck.Tests';
3
+
4
+ export function runTests() {
5
+ new CorePerfCheckTests().registerTests();
6
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "sourceMap": true,
4
+ "inlineSources": true,
5
+ "noImplicitAny": false,
6
+ "module": "amd",
7
+ "moduleResolution": "node",
8
+ "target": "es6",
9
+ "importHelpers": true,
10
+ "noEmitHelpers": true,
11
+ "skipLibCheck": true,
12
+ "alwaysStrict": true,
13
+ "declaration": true
14
+ },
15
+ "files": []
16
+ }
17
+
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta http-equiv="Cache-control" content="no-Cache" />
7
+ <title>Tests for Application Insights JavaScript Core SDK</title>
8
+ <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.23.1.css">
9
+ <script src="http://sinonjs.org/releases/sinon-2.3.8.js"></script>
10
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.js"></script>
11
+ <script src="../../../common/Tests/Selenium/ModuleLoader.js"></script>
12
+ <script src="../../../common/Tests/Selenium/SimpleSyncPromise.js"></script>
13
+
14
+ <script>
15
+ var modules = new ModuleLoader({
16
+ baseUrl: '../',
17
+ paths: {
18
+ qunit: "../../common/Tests/External/qunit-1.23.1",
19
+ "whatwg-fetch": "../../common/Tests/External/whatwg-fetch.3.0.0"
20
+ }
21
+ });
22
+
23
+ // Load qunit here instead of with tests, otherwise will not work
24
+ modules.add("qunit");
25
+
26
+ loadFetchModule(modules, "whatwg-fetch");
27
+
28
+ // Load and define the app insights test framework module
29
+ modules.add("@microsoft/ai-test-framework", "./node_modules/@microsoft/ai-test-framework/dist/ai-test-framework");
30
+
31
+ // Load and define the app insights Shims module
32
+ modules.add("@microsoft/applicationinsights-shims", "./node_modules/@microsoft/applicationinsights-shims/browser/applicationinsights-shims");
33
+
34
+ // Load DynamicProto
35
+ modules.add("@microsoft/dynamicproto-js", "./node_modules/@microsoft/dynamicproto-js/lib/dist/umd/dynamicproto-js", true);
36
+
37
+ var testModule = modules.add("Tests/Perf/src/aiperftests", "./Tests/Perf/dist/aicoreperf.tests")
38
+ testModule.run = function (tests) {
39
+ console && console.log("Starting tests");
40
+ QUnit.start();
41
+ tests.runTests();
42
+ };
43
+
44
+ modules.run();
45
+ </script>
46
+ </head>
47
+
48
+ <body>
49
+ <div id="qunit"></div>
50
+ <div id="qunit-fixture"></div>
51
+ <div id="error-message"></div>
52
+ </body>
53
+
54
+ </html>
@@ -0,0 +1,59 @@
1
+ import { Assert, AITestClass } from "@microsoft/ai-test-framework";
2
+ import * as pako from "pako";
3
+
4
+ export class AppInsightsCoreSizeCheck extends AITestClass {
5
+ private readonly MAX_DEFLATE_SIZE = 15;
6
+ private readonly rawFilePath = "../dist/applicationinsights-core-js.min.js";
7
+ private readonly prodFilePath = "../browser/applicationinsights-core-js.min.js";
8
+
9
+ public testInitialize() {
10
+ }
11
+
12
+ public testCleanup() {
13
+ }
14
+
15
+ public registerTests() {
16
+ this.addRawFileSizeCheck();
17
+ this.addProdFileSizeCheck();
18
+ }
19
+
20
+ constructor() {
21
+ super("AppInsightsCoreSizeCheck");
22
+ }
23
+
24
+ private addRawFileSizeCheck(): void {
25
+ this._fileSizeCheck(false);
26
+ }
27
+
28
+ private addProdFileSizeCheck(): void {
29
+ this._fileSizeCheck(true);
30
+ }
31
+
32
+ private _fileSizeCheck(isProd: boolean): void {
33
+ let _filePath = isProd? this.prodFilePath : this.rawFilePath;
34
+ let postfix = isProd? "" : "-raw";
35
+ let fileName = _filePath.split("..")[1];
36
+ this.testCase({
37
+ name: `Test applicationinsights-core${postfix} deflate size`,
38
+ test: () => {
39
+ Assert.ok(true, `test file: ${fileName}`);
40
+ let request = new Request(_filePath, {method:"GET"});
41
+ return fetch(request).then((response) => {
42
+ if (!response.ok) {
43
+ Assert.ok(false, `applicationinsights-core${postfix} deflate size error: ${response.statusText}`);
44
+ return;
45
+ } else {
46
+ return response.text().then(text => {
47
+ let size = Math.ceil(pako.deflate(text).length/1024);
48
+ Assert.ok(size <= this.MAX_DEFLATE_SIZE ,`max ${this.MAX_DEFLATE_SIZE} KB, current deflate size is: ${size} KB`);
49
+ }).catch((error) => {
50
+ Assert.ok(false, `applicationinsights-core${postfix} response error: ${error}`);
51
+ });
52
+ }
53
+ }).catch((error: Error) => {
54
+ Assert.ok(false, `applicationinsights-core${postfix} deflate size error: ${error}`);
55
+ });
56
+ }
57
+ });
58
+ }
59
+ }