@ms-cloudpack/telemetry 0.10.1 → 0.10.2
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/AppInsightsTelemetryClient-ZL4CRVTO.js +14633 -0
- package/dist/NoOpTelemetryClient-MGEGOMRG.js +13 -0
- package/dist/chunk-CAVDED25.js +12487 -0
- package/dist/chunk-ZRGXKAUG.js +28 -0
- package/dist/index.js +43 -0
- package/package.json +3 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createRequire as topLevelCreateRequire } from 'node:module';
|
|
2
|
+
import topLevelPath from 'node:path';
|
|
3
|
+
import topLevelUrl from 'node:url';
|
|
4
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = topLevelPath.dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
BaseTelemetryClient,
|
|
9
|
+
__name
|
|
10
|
+
} from "./chunk-CAVDED25.js";
|
|
11
|
+
|
|
12
|
+
// src/NoOpTelemetryClient.ts
|
|
13
|
+
var _NoOpTelemetryClient = class _NoOpTelemetryClient extends BaseTelemetryClient {
|
|
14
|
+
constructor() {
|
|
15
|
+
super({
|
|
16
|
+
productVersion: "no-op",
|
|
17
|
+
serviceName: "no-op",
|
|
18
|
+
serviceNamespace: "no-op",
|
|
19
|
+
logLevel: "NONE"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
__name(_NoOpTelemetryClient, "NoOpTelemetryClient");
|
|
24
|
+
var NoOpTelemetryClient = _NoOpTelemetryClient;
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
NoOpTelemetryClient
|
|
28
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire as topLevelCreateRequire } from 'node:module';
|
|
2
|
+
import topLevelPath from 'node:path';
|
|
3
|
+
import topLevelUrl from 'node:url';
|
|
4
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = topLevelPath.dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
NoOpTelemetryClient
|
|
9
|
+
} from "./chunk-ZRGXKAUG.js";
|
|
10
|
+
import {
|
|
11
|
+
DiagConsoleLogger,
|
|
12
|
+
DiagLogLevel,
|
|
13
|
+
__name,
|
|
14
|
+
diag,
|
|
15
|
+
init_esm
|
|
16
|
+
} from "./chunk-CAVDED25.js";
|
|
17
|
+
|
|
18
|
+
// src/createTelemetryClient.ts
|
|
19
|
+
init_esm();
|
|
20
|
+
async function createTelemetryClient(options) {
|
|
21
|
+
if (!options.connectionString) {
|
|
22
|
+
console.debug("No connection string found. Telemetry will not be sent.");
|
|
23
|
+
const { NoOpTelemetryClient: NoOpTelemetryClient2 } = await import("./NoOpTelemetryClient-MGEGOMRG.js");
|
|
24
|
+
return new NoOpTelemetryClient2();
|
|
25
|
+
}
|
|
26
|
+
diag.setLogger(new DiagConsoleLogger(), {
|
|
27
|
+
logLevel: (options.logLevel && DiagLogLevel[options.logLevel]) ?? DiagLogLevel.WARN,
|
|
28
|
+
suppressOverrideMessage: true
|
|
29
|
+
});
|
|
30
|
+
const { AppInsightsTelemetryClient } = await import("./AppInsightsTelemetryClient-ZL4CRVTO.js");
|
|
31
|
+
return new AppInsightsTelemetryClient(options);
|
|
32
|
+
}
|
|
33
|
+
__name(createTelemetryClient, "createTelemetryClient");
|
|
34
|
+
|
|
35
|
+
// src/createNoOpTelemetryClient.ts
|
|
36
|
+
function createNoOpTelemetryClient() {
|
|
37
|
+
return new NoOpTelemetryClient();
|
|
38
|
+
}
|
|
39
|
+
__name(createNoOpTelemetryClient, "createNoOpTelemetryClient");
|
|
40
|
+
export {
|
|
41
|
+
createNoOpTelemetryClient,
|
|
42
|
+
createTelemetryClient
|
|
43
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/telemetry",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Helpers for reporting telemetry in Cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"source": "./src/index.ts",
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
13
|
-
"import": "./
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"api": "cloudpack-scripts api",
|
|
32
32
|
"build:watch": "cloudpack-scripts build-watch",
|
|
33
|
-
"build": "cloudpack-scripts build",
|
|
33
|
+
"build": "cloudpack-scripts build && cloudpack-scripts bundle-node",
|
|
34
34
|
"lint:update": "cloudpack-scripts lint-update",
|
|
35
35
|
"lint": "cloudpack-scripts lint",
|
|
36
36
|
"test:update": "cloudpack-scripts test-update",
|