@mihari/logger-types 0.1.0 → 0.2.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.
@@ -0,0 +1,44 @@
1
+ declare enum LogLevel {
2
+ Debug = "debug",
3
+ Info = "info",
4
+ Warn = "warn",
5
+ Error = "error",
6
+ Fatal = "fatal"
7
+ }
8
+ interface LogEntry {
9
+ readonly dt: string;
10
+ readonly level: LogLevel;
11
+ readonly message: string;
12
+ readonly [key: string]: unknown;
13
+ }
14
+ interface MihariConfig {
15
+ readonly token: string;
16
+ readonly endpoint: string;
17
+ readonly batchSize?: number;
18
+ readonly flushInterval?: number;
19
+ readonly maxQueueSize?: number;
20
+ readonly compression?: boolean;
21
+ readonly retries?: number;
22
+ readonly metadata?: Record<string, unknown>;
23
+ }
24
+ interface TransportOptions {
25
+ readonly token: string;
26
+ readonly endpoint: string;
27
+ readonly compression?: boolean;
28
+ readonly retries?: number;
29
+ }
30
+ interface BatchOptions {
31
+ readonly batchSize?: number;
32
+ readonly flushInterval?: number;
33
+ readonly maxQueueSize?: number;
34
+ }
35
+ interface TransportResponse {
36
+ readonly status: "accepted";
37
+ readonly count: number;
38
+ }
39
+ interface TransportError {
40
+ readonly error: string;
41
+ }
42
+ type CompressFn = (data: Uint8Array) => Promise<Uint8Array>;
43
+
44
+ export { type BatchOptions, type CompressFn, type LogEntry, LogLevel, type MihariConfig, type TransportError, type TransportOptions, type TransportResponse };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- export declare enum LogLevel {
1
+ declare enum LogLevel {
2
2
  Debug = "debug",
3
3
  Info = "info",
4
4
  Warn = "warn",
5
5
  Error = "error",
6
6
  Fatal = "fatal"
7
7
  }
8
- export interface LogEntry {
8
+ interface LogEntry {
9
9
  readonly dt: string;
10
10
  readonly level: LogLevel;
11
11
  readonly message: string;
12
12
  readonly [key: string]: unknown;
13
13
  }
14
- export interface MihariConfig {
14
+ interface MihariConfig {
15
15
  readonly token: string;
16
16
  readonly endpoint: string;
17
17
  readonly batchSize?: number;
@@ -21,23 +21,24 @@ export interface MihariConfig {
21
21
  readonly retries?: number;
22
22
  readonly metadata?: Record<string, unknown>;
23
23
  }
24
- export interface TransportOptions {
24
+ interface TransportOptions {
25
25
  readonly token: string;
26
26
  readonly endpoint: string;
27
27
  readonly compression?: boolean;
28
28
  readonly retries?: number;
29
29
  }
30
- export interface BatchOptions {
30
+ interface BatchOptions {
31
31
  readonly batchSize?: number;
32
32
  readonly flushInterval?: number;
33
33
  readonly maxQueueSize?: number;
34
34
  }
35
- export interface TransportResponse {
35
+ interface TransportResponse {
36
36
  readonly status: "accepted";
37
37
  readonly count: number;
38
38
  }
39
- export interface TransportError {
39
+ interface TransportError {
40
40
  readonly error: string;
41
41
  }
42
- export type CompressFn = (data: Uint8Array) => Promise<Uint8Array>;
43
- //# sourceMappingURL=index.d.ts.map
42
+ type CompressFn = (data: Uint8Array) => Promise<Uint8Array>;
43
+
44
+ export { type BatchOptions, type CompressFn, type LogEntry, LogLevel, type MihariConfig, type TransportError, type TransportOptions, type TransportResponse };
package/dist/index.js CHANGED
@@ -1,12 +1,38 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogLevel = void 0;
4
- var LogLevel;
5
- (function (LogLevel) {
6
- LogLevel["Debug"] = "debug";
7
- LogLevel["Info"] = "info";
8
- LogLevel["Warn"] = "warn";
9
- LogLevel["Error"] = "error";
10
- LogLevel["Fatal"] = "fatal";
11
- })(LogLevel || (exports.LogLevel = LogLevel = {}));
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.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ LogLevel: () => LogLevel
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
27
+ LogLevel2["Debug"] = "debug";
28
+ LogLevel2["Info"] = "info";
29
+ LogLevel2["Warn"] = "warn";
30
+ LogLevel2["Error"] = "error";
31
+ LogLevel2["Fatal"] = "fatal";
32
+ return LogLevel2;
33
+ })(LogLevel || {});
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ LogLevel
37
+ });
12
38
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export enum LogLevel {\n Debug = \"debug\",\n Info = \"info\",\n Warn = \"warn\",\n Error = \"error\",\n Fatal = \"fatal\",\n}\n\nexport interface LogEntry {\n readonly dt: string;\n readonly level: LogLevel;\n readonly message: string;\n readonly [key: string]: unknown;\n}\n\nexport interface MihariConfig {\n readonly token: string;\n readonly endpoint: string;\n readonly batchSize?: number;\n readonly flushInterval?: number;\n readonly maxQueueSize?: number;\n readonly compression?: boolean;\n readonly retries?: number;\n readonly metadata?: Record<string, unknown>;\n}\n\nexport interface TransportOptions {\n readonly token: string;\n readonly endpoint: string;\n readonly compression?: boolean;\n readonly retries?: number;\n}\n\nexport interface BatchOptions {\n readonly batchSize?: number;\n readonly flushInterval?: number;\n readonly maxQueueSize?: number;\n}\n\nexport interface TransportResponse {\n readonly status: \"accepted\";\n readonly count: number;\n}\n\nexport interface TransportError {\n readonly error: string;\n}\n\nexport type CompressFn = (data: Uint8Array) => Promise<Uint8Array>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,WAAQ;AALE,SAAAA;AAAA,GAAA;","names":["LogLevel"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,13 @@
1
+ // src/index.ts
2
+ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
3
+ LogLevel2["Debug"] = "debug";
4
+ LogLevel2["Info"] = "info";
5
+ LogLevel2["Warn"] = "warn";
6
+ LogLevel2["Error"] = "error";
7
+ LogLevel2["Fatal"] = "fatal";
8
+ return LogLevel2;
9
+ })(LogLevel || {});
10
+ export {
11
+ LogLevel
12
+ };
13
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export enum LogLevel {\n Debug = \"debug\",\n Info = \"info\",\n Warn = \"warn\",\n Error = \"error\",\n Fatal = \"fatal\",\n}\n\nexport interface LogEntry {\n readonly dt: string;\n readonly level: LogLevel;\n readonly message: string;\n readonly [key: string]: unknown;\n}\n\nexport interface MihariConfig {\n readonly token: string;\n readonly endpoint: string;\n readonly batchSize?: number;\n readonly flushInterval?: number;\n readonly maxQueueSize?: number;\n readonly compression?: boolean;\n readonly retries?: number;\n readonly metadata?: Record<string, unknown>;\n}\n\nexport interface TransportOptions {\n readonly token: string;\n readonly endpoint: string;\n readonly compression?: boolean;\n readonly retries?: number;\n}\n\nexport interface BatchOptions {\n readonly batchSize?: number;\n readonly flushInterval?: number;\n readonly maxQueueSize?: number;\n}\n\nexport interface TransportResponse {\n readonly status: \"accepted\";\n readonly count: number;\n}\n\nexport interface TransportError {\n readonly error: string;\n}\n\nexport type CompressFn = (data: Uint8Array) => Promise<Uint8Array>;\n"],"mappings":";AAAO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,WAAQ;AALE,SAAAA;AAAA,GAAA;","names":["LogLevel"]}
package/package.json CHANGED
@@ -1,17 +1,38 @@
1
1
  {
2
2
  "name": "@mihari/logger-types",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Shared TypeScript type definitions for mihari",
5
- "main": "src/index.ts",
6
- "types": "src/index.ts",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
7
15
  "files": [
8
16
  "dist"
9
17
  ],
10
18
  "scripts": {
11
- "build": "tsc",
19
+ "build": "tsup",
12
20
  "clean": "rm -rf dist",
13
21
  "test": "cd ../.. && npx vitest run --config vitest.config.ts packages/types"
14
22
  },
23
+ "tsup": {
24
+ "entry": [
25
+ "src/index.ts"
26
+ ],
27
+ "format": [
28
+ "cjs",
29
+ "esm"
30
+ ],
31
+ "dts": true,
32
+ "splitting": false,
33
+ "sourcemap": true,
34
+ "clean": true
35
+ },
15
36
  "publishConfig": {
16
37
  "access": "public"
17
38
  },
@@ -21,5 +42,5 @@
21
42
  "url": "https://github.com/mihari/mihari-js",
22
43
  "directory": "packages/types"
23
44
  },
24
- "gitHead": "dc10a3217caa819965eb3a1e2ff3901a16e510aa"
45
+ "gitHead": "a0a2dd591dafbf0923bb81bd5d8180fa6d6eecea"
25
46
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC"}
package/src/index.ts DELETED
@@ -1,49 +0,0 @@
1
- export enum LogLevel {
2
- Debug = "debug",
3
- Info = "info",
4
- Warn = "warn",
5
- Error = "error",
6
- Fatal = "fatal",
7
- }
8
-
9
- export interface LogEntry {
10
- readonly dt: string;
11
- readonly level: LogLevel;
12
- readonly message: string;
13
- readonly [key: string]: unknown;
14
- }
15
-
16
- export interface MihariConfig {
17
- readonly token: string;
18
- readonly endpoint: string;
19
- readonly batchSize?: number;
20
- readonly flushInterval?: number;
21
- readonly maxQueueSize?: number;
22
- readonly compression?: boolean;
23
- readonly retries?: number;
24
- readonly metadata?: Record<string, unknown>;
25
- }
26
-
27
- export interface TransportOptions {
28
- readonly token: string;
29
- readonly endpoint: string;
30
- readonly compression?: boolean;
31
- readonly retries?: number;
32
- }
33
-
34
- export interface BatchOptions {
35
- readonly batchSize?: number;
36
- readonly flushInterval?: number;
37
- readonly maxQueueSize?: number;
38
- }
39
-
40
- export interface TransportResponse {
41
- readonly status: "accepted";
42
- readonly count: number;
43
- }
44
-
45
- export interface TransportError {
46
- readonly error: string;
47
- }
48
-
49
- export type CompressFn = (data: Uint8Array) => Promise<Uint8Array>;