@aletheia-dev/core 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/CHANGELOG.md +10 -0
- package/LICENSE +202 -0
- package/README.md +18 -0
- package/dist/index.cjs +1635 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2691 -0
- package/dist/index.d.ts +2691 -0
- package/dist/index.js +1442 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-DFA8nkvG.d.cts +15 -0
- package/dist/logger-DFA8nkvG.d.ts +15 -0
- package/dist/node.cjs +179 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +86 -0
- package/dist/node.d.ts +86 -0
- package/dist/node.js +138 -0
- package/dist/node.js.map +1 -0
- package/package.json +61 -0
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import pino from 'pino';
|
|
3
|
+
import { a as Logger } from './logger-DFA8nkvG.js';
|
|
4
|
+
|
|
5
|
+
declare const EnvSchema: z.ZodObject<{
|
|
6
|
+
NODE_ENV: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
development: "development";
|
|
8
|
+
test: "test";
|
|
9
|
+
production: "production";
|
|
10
|
+
}>>;
|
|
11
|
+
DATABASE_URL: z.ZodURL;
|
|
12
|
+
TEMPORAL_ADDRESS: z.ZodDefault<z.ZodString>;
|
|
13
|
+
TEMPORAL_NAMESPACE: z.ZodDefault<z.ZodString>;
|
|
14
|
+
TEMPORAL_TASK_QUEUE: z.ZodDefault<z.ZodString>;
|
|
15
|
+
TEMPORAL_BACKTEST_TASK_QUEUE: z.ZodDefault<z.ZodString>;
|
|
16
|
+
TEMPORAL_PLUGIN_TASK_QUEUE: z.ZodDefault<z.ZodString>;
|
|
17
|
+
WEBHOOK_PUBLIC_URL: z.ZodOptional<z.ZodURL>;
|
|
18
|
+
API_HOST: z.ZodDefault<z.ZodString>;
|
|
19
|
+
API_PORT: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
20
|
+
API_CORS_ORIGINS: z.ZodDefault<z.ZodString>;
|
|
21
|
+
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
error: "error";
|
|
23
|
+
trace: "trace";
|
|
24
|
+
debug: "debug";
|
|
25
|
+
info: "info";
|
|
26
|
+
warn: "warn";
|
|
27
|
+
fatal: "fatal";
|
|
28
|
+
}>>;
|
|
29
|
+
DATABASE_APP_URL: z.ZodOptional<z.ZodURL>;
|
|
30
|
+
ZITADEL_ISSUER: z.ZodOptional<z.ZodURL>;
|
|
31
|
+
ZITADEL_PROJECT_ID: z.ZodOptional<z.ZodString>;
|
|
32
|
+
ZITADEL_API_CLIENT_ID: z.ZodOptional<z.ZodString>;
|
|
33
|
+
ZITADEL_API_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
|
|
34
|
+
ZITADEL_DIRECTORY_PAT: z.ZodOptional<z.ZodString>;
|
|
35
|
+
SUBMISSION_TOKEN_SECRET: z.ZodOptional<z.ZodString>;
|
|
36
|
+
COLLECTION_FLOW_URL: z.ZodOptional<z.ZodURL>;
|
|
37
|
+
STORAGE_ENDPOINT: z.ZodOptional<z.ZodURL>;
|
|
38
|
+
STORAGE_PUBLIC_ENDPOINT: z.ZodOptional<z.ZodURL>;
|
|
39
|
+
STORAGE_REGION: z.ZodDefault<z.ZodString>;
|
|
40
|
+
STORAGE_BUCKET: z.ZodDefault<z.ZodString>;
|
|
41
|
+
STORAGE_ACCESS_KEY: z.ZodOptional<z.ZodString>;
|
|
42
|
+
STORAGE_SECRET_KEY: z.ZodOptional<z.ZodString>;
|
|
43
|
+
STORAGE_CORS_ORIGINS: z.ZodOptional<z.ZodString>;
|
|
44
|
+
OTEL_EXPORTER_OTLP_ENDPOINT: z.ZodOptional<z.ZodURL>;
|
|
45
|
+
OTEL_SERVICE_NAME: z.ZodOptional<z.ZodString>;
|
|
46
|
+
OTEL_TRACES_SAMPLER: z.ZodOptional<z.ZodString>;
|
|
47
|
+
OTEL_TRACES_SAMPLER_ARG: z.ZodOptional<z.ZodString>;
|
|
48
|
+
OTEL_SDK_DISABLED: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
|
|
49
|
+
OTEL_PG_STATEMENTS: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
|
|
50
|
+
WORKER_HEALTH_PORT: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
51
|
+
SCHEMA_CHECK: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
strict: "strict";
|
|
53
|
+
lenient: "lenient";
|
|
54
|
+
}>>;
|
|
55
|
+
METRICS_PORT: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
56
|
+
DOCUMENT_SCANNER: z.ZodDefault<z.ZodEnum<{
|
|
57
|
+
none: "none";
|
|
58
|
+
}>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
type Env = z.infer<typeof EnvSchema>;
|
|
61
|
+
/** Validates process.env once at startup so apps fail fast on missing configuration. */
|
|
62
|
+
declare function loadEnv(source?: NodeJS.ProcessEnv): Env;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Keys whose values are never written to logs. Wildcards cover one level of nesting, so
|
|
66
|
+
* objects logged as `{ input: { token } }` are covered; deeper paths need an explicit entry.
|
|
67
|
+
* `callbackUrl` carries no secret and is left readable; merchant `link`s carry tokens.
|
|
68
|
+
*/
|
|
69
|
+
declare const DEFAULT_REDACT_PATHS: readonly string[];
|
|
70
|
+
declare const REDACT_CENSOR = "[redacted]";
|
|
71
|
+
interface CreateLoggerOptions {
|
|
72
|
+
name: string;
|
|
73
|
+
level?: string;
|
|
74
|
+
pretty?: boolean;
|
|
75
|
+
/** `service`, `version` and `env` base bindings on every line, when given. */
|
|
76
|
+
service?: string;
|
|
77
|
+
version?: string;
|
|
78
|
+
env?: string;
|
|
79
|
+
/** Extra redaction paths, appended to `DEFAULT_REDACT_PATHS`. */
|
|
80
|
+
redact?: readonly string[];
|
|
81
|
+
/** Write destination; defaults to stdout. Tests pass a stream. */
|
|
82
|
+
destination?: pino.DestinationStream;
|
|
83
|
+
}
|
|
84
|
+
declare function createLogger({ name, level, pretty, service, version, env, redact, destination, }: CreateLoggerOptions): Logger;
|
|
85
|
+
|
|
86
|
+
export { type CreateLoggerOptions, DEFAULT_REDACT_PATHS, type Env, EnvSchema, REDACT_CENSOR, createLogger, loadEnv };
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// src/env.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var EnvSchema = z.object({
|
|
4
|
+
NODE_ENV: z.enum(["development", "test", "production"]).default("development"),
|
|
5
|
+
DATABASE_URL: z.url(),
|
|
6
|
+
TEMPORAL_ADDRESS: z.string().default("localhost:7233"),
|
|
7
|
+
TEMPORAL_NAMESPACE: z.string().default("default"),
|
|
8
|
+
TEMPORAL_TASK_QUEUE: z.string().default("aletheia-workflows"),
|
|
9
|
+
/** Long-running backtests run on their own queue so they never starve decisions. */
|
|
10
|
+
TEMPORAL_BACKTEST_TASK_QUEUE: z.string().default("aletheia-backtests"),
|
|
11
|
+
/** Plugin invocations run on their own queue so vendor latency never starves decisions. */
|
|
12
|
+
TEMPORAL_PLUGIN_TASK_QUEUE: z.string().default("aletheia-plugins"),
|
|
13
|
+
/** Public base URL vendors call back on (`<url>/webhooks/plugins/<plugin>`). */
|
|
14
|
+
WEBHOOK_PUBLIC_URL: z.url().optional(),
|
|
15
|
+
API_HOST: z.string().default("0.0.0.0"),
|
|
16
|
+
API_PORT: z.coerce.number().int().positive().default(4e3),
|
|
17
|
+
/** Browser origins allowed to call the API (the three apps by default); comma-separated. */
|
|
18
|
+
API_CORS_ORIGINS: z.string().default("http://localhost:5173,http://localhost:5174,http://localhost:5175"),
|
|
19
|
+
LOG_LEVEL: z.enum(["trace", "debug", "info", "warn", "error", "fatal"]).default("info"),
|
|
20
|
+
/** Non-owner connection used by the API and worker so row-level security applies. */
|
|
21
|
+
DATABASE_APP_URL: z.url().optional(),
|
|
22
|
+
/** Identity provider (Zitadel). The API refuses to start without the required subset. */
|
|
23
|
+
ZITADEL_ISSUER: z.url().optional(),
|
|
24
|
+
ZITADEL_PROJECT_ID: z.string().min(1).optional(),
|
|
25
|
+
ZITADEL_API_CLIENT_ID: z.string().min(1).optional(),
|
|
26
|
+
ZITADEL_API_CLIENT_SECRET: z.string().min(1).optional(),
|
|
27
|
+
/** PAT of the read-only machine user the reviewer directory uses; unset disables the directory. */
|
|
28
|
+
ZITADEL_DIRECTORY_PAT: z.string().min(1).optional(),
|
|
29
|
+
/** Signs the links end customers use to open a collection flow. */
|
|
30
|
+
SUBMISSION_TOKEN_SECRET: z.string().min(32).optional(),
|
|
31
|
+
/** Public base URL of the collection-flow app, used to build those links. */
|
|
32
|
+
COLLECTION_FLOW_URL: z.url().optional(),
|
|
33
|
+
/** S3-compatible object storage for documents (Garage in the dev stack). Unset disables documents. */
|
|
34
|
+
STORAGE_ENDPOINT: z.url().optional(),
|
|
35
|
+
/** Endpoint browsers reach for direct uploads and downloads; defaults to STORAGE_ENDPOINT. */
|
|
36
|
+
STORAGE_PUBLIC_ENDPOINT: z.url().optional(),
|
|
37
|
+
STORAGE_REGION: z.string().default("garage"),
|
|
38
|
+
STORAGE_BUCKET: z.string().default("aletheia-documents"),
|
|
39
|
+
STORAGE_ACCESS_KEY: z.string().optional(),
|
|
40
|
+
STORAGE_SECRET_KEY: z.string().optional(),
|
|
41
|
+
/** Comma-separated browser origins allowed to upload directly (dev stack: the collection-flow and back-office apps). */
|
|
42
|
+
STORAGE_CORS_ORIGINS: z.string().optional(),
|
|
43
|
+
/** OTLP/HTTP collector base URL; unset disables tracing and metric export entirely. */
|
|
44
|
+
OTEL_EXPORTER_OTLP_ENDPOINT: z.url().optional(),
|
|
45
|
+
/** Overrides the default service name (`aletheia-api`, `aletheia-worker`). */
|
|
46
|
+
OTEL_SERVICE_NAME: z.string().min(1).optional(),
|
|
47
|
+
OTEL_TRACES_SAMPLER: z.string().min(1).optional(),
|
|
48
|
+
OTEL_TRACES_SAMPLER_ARG: z.string().min(1).optional(),
|
|
49
|
+
OTEL_SDK_DISABLED: z.coerce.boolean().default(false),
|
|
50
|
+
/** Include SQL statement text on database spans (postgres.js). */
|
|
51
|
+
OTEL_PG_STATEMENTS: z.coerce.boolean().default(false),
|
|
52
|
+
/** The worker's `GET /healthz` port; unset disables the health server. */
|
|
53
|
+
WORKER_HEALTH_PORT: z.coerce.number().int().positive().optional(),
|
|
54
|
+
/**
|
|
55
|
+
* What to do when the database schema is behind the bundled migrations: `strict` refuses to
|
|
56
|
+
* start (production default), `lenient` logs a warning (development default).
|
|
57
|
+
*/
|
|
58
|
+
SCHEMA_CHECK: z.enum(["strict", "lenient"]).optional(),
|
|
59
|
+
/** Serves Prometheus `/metrics` on this port when set (API and worker use their own). */
|
|
60
|
+
METRICS_PORT: z.coerce.number().int().positive().optional(),
|
|
61
|
+
/** Document scanner engine; `none` marks every document clean (ClamAV is deferred). */
|
|
62
|
+
DOCUMENT_SCANNER: z.enum(["none"]).default("none")
|
|
63
|
+
});
|
|
64
|
+
function loadEnv(source = process.env) {
|
|
65
|
+
const result = EnvSchema.safeParse(source);
|
|
66
|
+
if (!result.success) {
|
|
67
|
+
const problems = result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
|
|
68
|
+
throw new Error(`Invalid environment: ${problems}`);
|
|
69
|
+
}
|
|
70
|
+
return result.data;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/pino-logger.ts
|
|
74
|
+
import { hostname } from "os";
|
|
75
|
+
import { trace } from "@opentelemetry/api";
|
|
76
|
+
import pino from "pino";
|
|
77
|
+
var DEFAULT_REDACT_PATHS = [
|
|
78
|
+
"req.headers.authorization",
|
|
79
|
+
"headers.authorization",
|
|
80
|
+
"authorization",
|
|
81
|
+
"*.authorization",
|
|
82
|
+
"token",
|
|
83
|
+
"*.token",
|
|
84
|
+
"secrets",
|
|
85
|
+
"*.secrets",
|
|
86
|
+
"apiKey",
|
|
87
|
+
"*.apiKey",
|
|
88
|
+
"secretKey",
|
|
89
|
+
"*.secretKey",
|
|
90
|
+
"webhookSecret",
|
|
91
|
+
"*.webhookSecret",
|
|
92
|
+
"password",
|
|
93
|
+
"*.password",
|
|
94
|
+
"submissionUrl",
|
|
95
|
+
"*.submissionUrl",
|
|
96
|
+
"link",
|
|
97
|
+
"*.link"
|
|
98
|
+
];
|
|
99
|
+
var REDACT_CENSOR = "[redacted]";
|
|
100
|
+
function traceBindings() {
|
|
101
|
+
const span = trace.getActiveSpan();
|
|
102
|
+
if (!span || !span.isRecording()) return {};
|
|
103
|
+
const { traceId, spanId } = span.spanContext();
|
|
104
|
+
return { trace_id: traceId, span_id: spanId };
|
|
105
|
+
}
|
|
106
|
+
function createLogger({
|
|
107
|
+
name,
|
|
108
|
+
level = "info",
|
|
109
|
+
pretty = false,
|
|
110
|
+
service,
|
|
111
|
+
version,
|
|
112
|
+
env,
|
|
113
|
+
redact = [],
|
|
114
|
+
destination
|
|
115
|
+
}) {
|
|
116
|
+
const base = { pid: process.pid, hostname: hostname() };
|
|
117
|
+
if (service !== void 0) base.service = service;
|
|
118
|
+
if (version !== void 0) base.version = version;
|
|
119
|
+
if (env !== void 0) base.env = env;
|
|
120
|
+
const options = {
|
|
121
|
+
name,
|
|
122
|
+
level,
|
|
123
|
+
base,
|
|
124
|
+
mixin: traceBindings,
|
|
125
|
+
redact: { paths: [...DEFAULT_REDACT_PATHS, ...redact], censor: REDACT_CENSOR },
|
|
126
|
+
...pretty ? { transport: { target: "pino-pretty", options: { colorize: true } } } : {}
|
|
127
|
+
};
|
|
128
|
+
const logger = destination ? pino(options, destination) : pino(options);
|
|
129
|
+
return logger;
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
132
|
+
DEFAULT_REDACT_PATHS,
|
|
133
|
+
EnvSchema,
|
|
134
|
+
REDACT_CENSOR,
|
|
135
|
+
createLogger,
|
|
136
|
+
loadEnv
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/env.ts","../src/pino-logger.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const EnvSchema = z.object({\n NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),\n DATABASE_URL: z.url(),\n TEMPORAL_ADDRESS: z.string().default('localhost:7233'),\n TEMPORAL_NAMESPACE: z.string().default('default'),\n TEMPORAL_TASK_QUEUE: z.string().default('aletheia-workflows'),\n /** Long-running backtests run on their own queue so they never starve decisions. */\n TEMPORAL_BACKTEST_TASK_QUEUE: z.string().default('aletheia-backtests'),\n /** Plugin invocations run on their own queue so vendor latency never starves decisions. */\n TEMPORAL_PLUGIN_TASK_QUEUE: z.string().default('aletheia-plugins'),\n /** Public base URL vendors call back on (`<url>/webhooks/plugins/<plugin>`). */\n WEBHOOK_PUBLIC_URL: z.url().optional(),\n API_HOST: z.string().default('0.0.0.0'),\n API_PORT: z.coerce.number().int().positive().default(4000),\n /** Browser origins allowed to call the API (the three apps by default); comma-separated. */\n API_CORS_ORIGINS: z\n .string()\n .default('http://localhost:5173,http://localhost:5174,http://localhost:5175'),\n LOG_LEVEL: z.enum(['trace', 'debug', 'info', 'warn', 'error', 'fatal']).default('info'),\n /** Non-owner connection used by the API and worker so row-level security applies. */\n DATABASE_APP_URL: z.url().optional(),\n /** Identity provider (Zitadel). The API refuses to start without the required subset. */\n ZITADEL_ISSUER: z.url().optional(),\n ZITADEL_PROJECT_ID: z.string().min(1).optional(),\n ZITADEL_API_CLIENT_ID: z.string().min(1).optional(),\n ZITADEL_API_CLIENT_SECRET: z.string().min(1).optional(),\n /** PAT of the read-only machine user the reviewer directory uses; unset disables the directory. */\n ZITADEL_DIRECTORY_PAT: z.string().min(1).optional(),\n /** Signs the links end customers use to open a collection flow. */\n SUBMISSION_TOKEN_SECRET: z.string().min(32).optional(),\n /** Public base URL of the collection-flow app, used to build those links. */\n COLLECTION_FLOW_URL: z.url().optional(),\n /** S3-compatible object storage for documents (Garage in the dev stack). Unset disables documents. */\n STORAGE_ENDPOINT: z.url().optional(),\n /** Endpoint browsers reach for direct uploads and downloads; defaults to STORAGE_ENDPOINT. */\n STORAGE_PUBLIC_ENDPOINT: z.url().optional(),\n STORAGE_REGION: z.string().default('garage'),\n STORAGE_BUCKET: z.string().default('aletheia-documents'),\n STORAGE_ACCESS_KEY: z.string().optional(),\n STORAGE_SECRET_KEY: z.string().optional(),\n /** Comma-separated browser origins allowed to upload directly (dev stack: the collection-flow and back-office apps). */\n STORAGE_CORS_ORIGINS: z.string().optional(),\n /** OTLP/HTTP collector base URL; unset disables tracing and metric export entirely. */\n OTEL_EXPORTER_OTLP_ENDPOINT: z.url().optional(),\n /** Overrides the default service name (`aletheia-api`, `aletheia-worker`). */\n OTEL_SERVICE_NAME: z.string().min(1).optional(),\n OTEL_TRACES_SAMPLER: z.string().min(1).optional(),\n OTEL_TRACES_SAMPLER_ARG: z.string().min(1).optional(),\n OTEL_SDK_DISABLED: z.coerce.boolean().default(false),\n /** Include SQL statement text on database spans (postgres.js). */\n OTEL_PG_STATEMENTS: z.coerce.boolean().default(false),\n /** The worker's `GET /healthz` port; unset disables the health server. */\n WORKER_HEALTH_PORT: z.coerce.number().int().positive().optional(),\n /**\n * What to do when the database schema is behind the bundled migrations: `strict` refuses to\n * start (production default), `lenient` logs a warning (development default).\n */\n SCHEMA_CHECK: z.enum(['strict', 'lenient']).optional(),\n /** Serves Prometheus `/metrics` on this port when set (API and worker use their own). */\n METRICS_PORT: z.coerce.number().int().positive().optional(),\n /** Document scanner engine; `none` marks every document clean (ClamAV is deferred). */\n DOCUMENT_SCANNER: z.enum(['none']).default('none'),\n});\nexport type Env = z.infer<typeof EnvSchema>;\n\n/** Validates process.env once at startup so apps fail fast on missing configuration. */\nexport function loadEnv(source: NodeJS.ProcessEnv = process.env): Env {\n const result = EnvSchema.safeParse(source);\n if (!result.success) {\n const problems = result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ');\n throw new Error(`Invalid environment: ${problems}`);\n }\n return result.data;\n}\n","import { hostname } from 'node:os';\nimport { trace } from '@opentelemetry/api';\nimport pino from 'pino';\nimport type { Logger } from './logger.js';\n\n/**\n * Keys whose values are never written to logs. Wildcards cover one level of nesting, so\n * objects logged as `{ input: { token } }` are covered; deeper paths need an explicit entry.\n * `callbackUrl` carries no secret and is left readable; merchant `link`s carry tokens.\n */\nexport const DEFAULT_REDACT_PATHS: readonly string[] = [\n 'req.headers.authorization',\n 'headers.authorization',\n 'authorization',\n '*.authorization',\n 'token',\n '*.token',\n 'secrets',\n '*.secrets',\n 'apiKey',\n '*.apiKey',\n 'secretKey',\n '*.secretKey',\n 'webhookSecret',\n '*.webhookSecret',\n 'password',\n '*.password',\n 'submissionUrl',\n '*.submissionUrl',\n 'link',\n '*.link',\n];\n\nexport const REDACT_CENSOR = '[redacted]';\n\nexport interface CreateLoggerOptions {\n name: string;\n level?: string;\n pretty?: boolean;\n /** `service`, `version` and `env` base bindings on every line, when given. */\n service?: string;\n version?: string;\n env?: string;\n /** Extra redaction paths, appended to `DEFAULT_REDACT_PATHS`. */\n redact?: readonly string[];\n /** Write destination; defaults to stdout. Tests pass a stream. */\n destination?: pino.DestinationStream;\n}\n\n/** `trace_id` / `span_id` of the active recording span, for log correlation. */\nfunction traceBindings(): Record<string, string> {\n const span = trace.getActiveSpan();\n if (!span || !span.isRecording()) return {};\n const { traceId, spanId } = span.spanContext();\n return { trace_id: traceId, span_id: spanId };\n}\n\nexport function createLogger({\n name,\n level = 'info',\n pretty = false,\n service,\n version,\n env,\n redact = [],\n destination,\n}: CreateLoggerOptions): Logger {\n // pino's own defaults, kept when adding our bindings (setting `base` replaces them).\n const base: Record<string, unknown> = { pid: process.pid, hostname: hostname() };\n if (service !== undefined) base.service = service;\n if (version !== undefined) base.version = version;\n if (env !== undefined) base.env = env;\n const options: pino.LoggerOptions = {\n name,\n level,\n base,\n mixin: traceBindings,\n redact: { paths: [...DEFAULT_REDACT_PATHS, ...redact], censor: REDACT_CENSOR },\n ...(pretty ? { transport: { target: 'pino-pretty', options: { colorize: true } } } : {}),\n };\n const logger = destination ? pino(options, destination) : pino(options);\n return logger as unknown as Logger;\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,YAAY,EAAE,OAAO;AAAA,EAChC,UAAU,EAAE,KAAK,CAAC,eAAe,QAAQ,YAAY,CAAC,EAAE,QAAQ,aAAa;AAAA,EAC7E,cAAc,EAAE,IAAI;AAAA,EACpB,kBAAkB,EAAE,OAAO,EAAE,QAAQ,gBAAgB;AAAA,EACrD,oBAAoB,EAAE,OAAO,EAAE,QAAQ,SAAS;AAAA,EAChD,qBAAqB,EAAE,OAAO,EAAE,QAAQ,oBAAoB;AAAA;AAAA,EAE5D,8BAA8B,EAAE,OAAO,EAAE,QAAQ,oBAAoB;AAAA;AAAA,EAErE,4BAA4B,EAAE,OAAO,EAAE,QAAQ,kBAAkB;AAAA;AAAA,EAEjE,oBAAoB,EAAE,IAAI,EAAE,SAAS;AAAA,EACrC,UAAU,EAAE,OAAO,EAAE,QAAQ,SAAS;AAAA,EACtC,UAAU,EAAE,OAAO,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,GAAI;AAAA;AAAA,EAEzD,kBAAkB,EACf,OAAO,EACP,QAAQ,mEAAmE;AAAA,EAC9E,WAAW,EAAE,KAAK,CAAC,SAAS,SAAS,QAAQ,QAAQ,SAAS,OAAO,CAAC,EAAE,QAAQ,MAAM;AAAA;AAAA,EAEtF,kBAAkB,EAAE,IAAI,EAAE,SAAS;AAAA;AAAA,EAEnC,gBAAgB,EAAE,IAAI,EAAE,SAAS;AAAA,EACjC,oBAAoB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAC/C,uBAAuB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,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I,QAAQ,OAAW,MAAK,MAAM;AAClC,QAAM,UAA8B;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,QAAQ,EAAE,OAAO,CAAC,GAAG,sBAAsB,GAAG,MAAM,GAAG,QAAQ,cAAc;AAAA,IAC7E,GAAI,SAAS,EAAE,WAAW,EAAE,QAAQ,eAAe,SAAS,EAAE,UAAU,KAAK,EAAE,EAAE,IAAI,CAAC;AAAA,EACxF;AACA,QAAM,SAAS,cAAc,KAAK,SAAS,WAAW,IAAI,KAAK,OAAO;AACtE,SAAO;AACT;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aletheia-dev/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Aletheia platform types and zod schemas: subjects, cases, decisions, rules, workflows and collection flows. Platform types with no stability promise before 1.0.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/akhiljames/aletheia.git",
|
|
10
|
+
"directory": "packages/core"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/akhiljames/aletheia/tree/main/packages/core#readme",
|
|
13
|
+
"bugs": "https://github.com/akhiljames/aletheia/issues",
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./node": {
|
|
25
|
+
"types": "./dist/node.d.ts",
|
|
26
|
+
"import": "./dist/node.js",
|
|
27
|
+
"require": "./dist/node.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@opentelemetry/api": "^1.9.1",
|
|
40
|
+
"pino": "^10.3.1",
|
|
41
|
+
"pino-pretty": "^13.1.3",
|
|
42
|
+
"zod": "^4.6.5"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@opentelemetry/context-async-hooks": "^2.11.0",
|
|
46
|
+
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
47
|
+
"@types/node": "^22.20.4",
|
|
48
|
+
"eslint": "^10.11.0",
|
|
49
|
+
"tsup": "^8.5.1",
|
|
50
|
+
"typescript": "5.9.3",
|
|
51
|
+
"vitest": "^5.0.3"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsup",
|
|
55
|
+
"dev": "tsup --watch",
|
|
56
|
+
"lint": "eslint .",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"clean": "rm -rf dist .turbo"
|
|
60
|
+
}
|
|
61
|
+
}
|