@echothink-ui/telemetry 0.1.0

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @echothink-ui/telemetry
2
+
3
+ Telemetry package for EchoThink app-domain websites.
4
+
5
+ This package is part of the EchoThink-UI app-domain library. It is designed for normal website app domains rendered inside EchoThink Studio's Chromium shell, not for implementing the studio browser chrome itself.
package/dist/index.cjs ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.tsx
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ createTelemetryEvent: () => createTelemetryEvent,
24
+ noopAuditSink: () => noopAuditSink,
25
+ noopTelemetrySink: () => noopTelemetrySink
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+ var noopTelemetrySink = { emit: () => void 0 };
29
+ function createTelemetryEvent(name, metadata = {}) {
30
+ return { name, timestamp: (/* @__PURE__ */ new Date()).toISOString(), metadata };
31
+ }
32
+ var noopAuditSink = { emit: () => void 0 };
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ createTelemetryEvent,
36
+ noopAuditSink,
37
+ noopTelemetrySink
38
+ });
39
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"sourcesContent":["export interface EthTelemetryEvent {\n name: string;\n timestamp: string;\n component?: string;\n skillId?: string;\n durationMs?: number;\n metadata?: Record<string, unknown>;\n}\n\nexport interface EthTelemetrySink {\n emit(event: EthTelemetryEvent): void | Promise<void>;\n}\n\nexport const noopTelemetrySink: EthTelemetrySink = { emit: () => undefined };\n\nexport function createTelemetryEvent(\n name: string,\n metadata: Record<string, unknown> = {}\n): EthTelemetryEvent {\n return { name, timestamp: new Date().toISOString(), metadata };\n}\n\nexport interface EthAuditRecord {\n action: string;\n resource?: string;\n actor?: string;\n traceId?: string;\n approved?: boolean;\n metadata?: Record<string, unknown>;\n timestamp: string;\n}\n\nexport interface EthAuditSink {\n emit(record: EthAuditRecord): void | Promise<void>;\n}\n\nexport const noopAuditSink: EthAuditSink = { emit: () => undefined };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,IAAM,oBAAsC,EAAE,MAAM,MAAM,OAAU;AAEpE,SAAS,qBACd,MACA,WAAoC,CAAC,GAClB;AACnB,SAAO,EAAE,MAAM,YAAW,oBAAI,KAAK,GAAE,YAAY,GAAG,SAAS;AAC/D;AAgBO,IAAM,gBAA8B,EAAE,MAAM,MAAM,OAAU;","names":[]}
@@ -0,0 +1,26 @@
1
+ export interface EthTelemetryEvent {
2
+ name: string;
3
+ timestamp: string;
4
+ component?: string;
5
+ skillId?: string;
6
+ durationMs?: number;
7
+ metadata?: Record<string, unknown>;
8
+ }
9
+ export interface EthTelemetrySink {
10
+ emit(event: EthTelemetryEvent): void | Promise<void>;
11
+ }
12
+ export declare const noopTelemetrySink: EthTelemetrySink;
13
+ export declare function createTelemetryEvent(name: string, metadata?: Record<string, unknown>): EthTelemetryEvent;
14
+ export interface EthAuditRecord {
15
+ action: string;
16
+ resource?: string;
17
+ actor?: string;
18
+ traceId?: string;
19
+ approved?: boolean;
20
+ metadata?: Record<string, unknown>;
21
+ timestamp: string;
22
+ }
23
+ export interface EthAuditSink {
24
+ emit(record: EthAuditRecord): void | Promise<void>;
25
+ }
26
+ export declare const noopAuditSink: EthAuditSink;
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ // src/index.tsx
2
+ var noopTelemetrySink = { emit: () => void 0 };
3
+ function createTelemetryEvent(name, metadata = {}) {
4
+ return { name, timestamp: (/* @__PURE__ */ new Date()).toISOString(), metadata };
5
+ }
6
+ var noopAuditSink = { emit: () => void 0 };
7
+ export {
8
+ createTelemetryEvent,
9
+ noopAuditSink,
10
+ noopTelemetrySink
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"sourcesContent":["export interface EthTelemetryEvent {\n name: string;\n timestamp: string;\n component?: string;\n skillId?: string;\n durationMs?: number;\n metadata?: Record<string, unknown>;\n}\n\nexport interface EthTelemetrySink {\n emit(event: EthTelemetryEvent): void | Promise<void>;\n}\n\nexport const noopTelemetrySink: EthTelemetrySink = { emit: () => undefined };\n\nexport function createTelemetryEvent(\n name: string,\n metadata: Record<string, unknown> = {}\n): EthTelemetryEvent {\n return { name, timestamp: new Date().toISOString(), metadata };\n}\n\nexport interface EthAuditRecord {\n action: string;\n resource?: string;\n actor?: string;\n traceId?: string;\n approved?: boolean;\n metadata?: Record<string, unknown>;\n timestamp: string;\n}\n\nexport interface EthAuditSink {\n emit(record: EthAuditRecord): void | Promise<void>;\n}\n\nexport const noopAuditSink: EthAuditSink = { emit: () => undefined };\n"],"mappings":";AAaO,IAAM,oBAAsC,EAAE,MAAM,MAAM,OAAU;AAEpE,SAAS,qBACd,MACA,WAAoC,CAAC,GAClB;AACnB,SAAO,EAAE,MAAM,YAAW,oBAAI,KAAK,GAAE,YAAY,GAAG,SAAS;AAC/D;AAgBO,IAAM,gBAA8B,EAAE,MAAM,MAAM,OAAU;","names":[]}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@echothink-ui/telemetry",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "src",
20
+ "README.md"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "scripts": {
26
+ "build": "tsup src/index.tsx --format esm,cjs --sourcemap --clean --external react --external react-dom && tsc -p tsconfig.json --declaration --emitDeclarationOnly --noEmit false --outDir dist",
27
+ "typecheck": "tsc -p tsconfig.json --noEmit",
28
+ "test": "vitest run --config ../../vitest.config.ts --passWithNoTests",
29
+ "lint": "eslint src"
30
+ }
31
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,37 @@
1
+ export interface EthTelemetryEvent {
2
+ name: string;
3
+ timestamp: string;
4
+ component?: string;
5
+ skillId?: string;
6
+ durationMs?: number;
7
+ metadata?: Record<string, unknown>;
8
+ }
9
+
10
+ export interface EthTelemetrySink {
11
+ emit(event: EthTelemetryEvent): void | Promise<void>;
12
+ }
13
+
14
+ export const noopTelemetrySink: EthTelemetrySink = { emit: () => undefined };
15
+
16
+ export function createTelemetryEvent(
17
+ name: string,
18
+ metadata: Record<string, unknown> = {}
19
+ ): EthTelemetryEvent {
20
+ return { name, timestamp: new Date().toISOString(), metadata };
21
+ }
22
+
23
+ export interface EthAuditRecord {
24
+ action: string;
25
+ resource?: string;
26
+ actor?: string;
27
+ traceId?: string;
28
+ approved?: boolean;
29
+ metadata?: Record<string, unknown>;
30
+ timestamp: string;
31
+ }
32
+
33
+ export interface EthAuditSink {
34
+ emit(record: EthAuditRecord): void | Promise<void>;
35
+ }
36
+
37
+ export const noopAuditSink: EthAuditSink = { emit: () => undefined };