@vobase/core 0.9.0 → 0.11.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/package.json +9 -10
- package/src/__tests__/drizzle-introspection.test.ts +77 -0
- package/src/__tests__/e2e.test.ts +225 -0
- package/src/__tests__/permissions.test.ts +157 -0
- package/src/__tests__/rpc-types.test.ts +92 -0
- package/src/app.test.ts +99 -0
- package/src/app.ts +178 -0
- package/src/audit.test.ts +126 -0
- package/src/auth.test.ts +74 -0
- package/src/contracts/auth.ts +37 -0
- package/{dist/contracts/module.d.ts → src/contracts/module.ts} +6 -6
- package/src/contracts/notify.ts +47 -0
- package/src/contracts/permissions.ts +10 -0
- package/src/contracts/storage.ts +61 -0
- package/src/ctx.test.ts +162 -0
- package/src/ctx.ts +64 -0
- package/src/db/client.test.ts +75 -0
- package/src/db/client.ts +15 -0
- package/src/db/helpers.test.ts +147 -0
- package/src/db/helpers.ts +51 -0
- package/src/db/index.ts +8 -0
- package/{dist/index.d.ts → src/index.ts} +105 -6
- package/src/infra/circuit-breaker.test.ts +74 -0
- package/src/infra/circuit-breaker.ts +57 -0
- package/src/infra/errors.test.ts +175 -0
- package/src/infra/errors.ts +64 -0
- package/src/infra/http-client.test.ts +482 -0
- package/src/infra/http-client.ts +221 -0
- package/src/infra/index.ts +35 -0
- package/src/infra/job.test.ts +85 -0
- package/src/infra/job.ts +94 -0
- package/src/infra/logger.test.ts +65 -0
- package/src/infra/logger.ts +18 -0
- package/src/infra/queue.test.ts +46 -0
- package/src/infra/queue.ts +147 -0
- package/src/infra/throw-proxy.test.ts +34 -0
- package/src/infra/throw-proxy.ts +17 -0
- package/src/infra/webhooks-schema.ts +17 -0
- package/src/infra/webhooks.test.ts +364 -0
- package/src/infra/webhooks.ts +146 -0
- package/src/mcp/auth.test.ts +129 -0
- package/src/mcp/crud.test.ts +128 -0
- package/src/mcp/crud.ts +171 -0
- package/{dist/mcp/index.d.ts → src/mcp/index.ts} +0 -1
- package/src/mcp/server.test.ts +153 -0
- package/src/mcp/server.ts +178 -0
- package/src/middleware/audit.test.ts +169 -0
- package/src/module-registry.ts +18 -0
- package/src/module.test.ts +168 -0
- package/src/module.ts +111 -0
- package/src/modules/audit/index.ts +18 -0
- package/src/modules/audit/middleware.ts +33 -0
- package/src/modules/audit/schema.ts +35 -0
- package/src/modules/audit/track-changes.ts +70 -0
- package/src/modules/auth/audit-hooks.ts +74 -0
- package/src/modules/auth/index.ts +101 -0
- package/src/modules/auth/middleware.ts +51 -0
- package/src/modules/auth/permissions.ts +46 -0
- package/src/modules/auth/schema.ts +184 -0
- package/src/modules/credentials/encrypt.ts +95 -0
- package/src/modules/credentials/index.ts +15 -0
- package/src/modules/credentials/schema.ts +10 -0
- package/src/modules/notify/index.ts +90 -0
- package/src/modules/notify/notify.test.ts +145 -0
- package/src/modules/notify/providers/resend.ts +47 -0
- package/src/modules/notify/providers/smtp.ts +117 -0
- package/src/modules/notify/providers/waba.ts +82 -0
- package/src/modules/notify/schema.ts +27 -0
- package/src/modules/notify/service.ts +93 -0
- package/src/modules/sequences/index.ts +15 -0
- package/src/modules/sequences/next-sequence.ts +48 -0
- package/src/modules/sequences/schema.ts +12 -0
- package/src/modules/storage/index.ts +44 -0
- package/src/modules/storage/providers/local.ts +124 -0
- package/src/modules/storage/providers/s3.ts +83 -0
- package/src/modules/storage/routes.ts +76 -0
- package/src/modules/storage/schema.ts +26 -0
- package/src/modules/storage/service.ts +202 -0
- package/src/modules/storage/storage.test.ts +225 -0
- package/src/schemas.test.ts +44 -0
- package/src/schemas.ts +63 -0
- package/src/sequence.test.ts +56 -0
- package/dist/app.d.ts +0 -37
- package/dist/app.d.ts.map +0 -1
- package/dist/contracts/auth.d.ts +0 -35
- package/dist/contracts/auth.d.ts.map +0 -1
- package/dist/contracts/module.d.ts.map +0 -1
- package/dist/contracts/notify.d.ts +0 -46
- package/dist/contracts/notify.d.ts.map +0 -1
- package/dist/contracts/permissions.d.ts +0 -10
- package/dist/contracts/permissions.d.ts.map +0 -1
- package/dist/contracts/storage.d.ts +0 -54
- package/dist/contracts/storage.d.ts.map +0 -1
- package/dist/ctx.d.ts +0 -40
- package/dist/ctx.d.ts.map +0 -1
- package/dist/db/client.d.ts +0 -4
- package/dist/db/client.d.ts.map +0 -1
- package/dist/db/helpers.d.ts +0 -26
- package/dist/db/helpers.d.ts.map +0 -1
- package/dist/db/index.d.ts +0 -3
- package/dist/db/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -89026
- package/dist/infra/circuit-breaker.d.ts +0 -17
- package/dist/infra/circuit-breaker.d.ts.map +0 -1
- package/dist/infra/errors.d.ts +0 -26
- package/dist/infra/errors.d.ts.map +0 -1
- package/dist/infra/http-client.d.ts +0 -31
- package/dist/infra/http-client.d.ts.map +0 -1
- package/dist/infra/index.d.ts +0 -11
- package/dist/infra/index.d.ts.map +0 -1
- package/dist/infra/job.d.ts +0 -14
- package/dist/infra/job.d.ts.map +0 -1
- package/dist/infra/logger.d.ts +0 -7
- package/dist/infra/logger.d.ts.map +0 -1
- package/dist/infra/queue.d.ts +0 -18
- package/dist/infra/queue.d.ts.map +0 -1
- package/dist/infra/throw-proxy.d.ts +0 -7
- package/dist/infra/throw-proxy.d.ts.map +0 -1
- package/dist/infra/webhooks-schema.d.ts +0 -60
- package/dist/infra/webhooks-schema.d.ts.map +0 -1
- package/dist/infra/webhooks.d.ts +0 -46
- package/dist/infra/webhooks.d.ts.map +0 -1
- package/dist/mcp/crud.d.ts +0 -12
- package/dist/mcp/crud.d.ts.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/server.d.ts +0 -10
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/module-registry.d.ts +0 -3
- package/dist/module-registry.d.ts.map +0 -1
- package/dist/module.d.ts +0 -29
- package/dist/module.d.ts.map +0 -1
- package/dist/modules/audit/index.d.ts +0 -5
- package/dist/modules/audit/index.d.ts.map +0 -1
- package/dist/modules/audit/middleware.d.ts +0 -3
- package/dist/modules/audit/middleware.d.ts.map +0 -1
- package/dist/modules/audit/schema.d.ts +0 -247
- package/dist/modules/audit/schema.d.ts.map +0 -1
- package/dist/modules/audit/track-changes.d.ts +0 -3
- package/dist/modules/audit/track-changes.d.ts.map +0 -1
- package/dist/modules/auth/audit-hooks.d.ts +0 -6
- package/dist/modules/auth/audit-hooks.d.ts.map +0 -1
- package/dist/modules/auth/index.d.ts +0 -17
- package/dist/modules/auth/index.d.ts.map +0 -1
- package/dist/modules/auth/middleware.d.ts +0 -15
- package/dist/modules/auth/middleware.d.ts.map +0 -1
- package/dist/modules/auth/permissions.d.ts +0 -5
- package/dist/modules/auth/permissions.d.ts.map +0 -1
- package/dist/modules/auth/schema.d.ts +0 -2519
- package/dist/modules/auth/schema.d.ts.map +0 -1
- package/dist/modules/credentials/encrypt.d.ts +0 -12
- package/dist/modules/credentials/encrypt.d.ts.map +0 -1
- package/dist/modules/credentials/index.d.ts +0 -4
- package/dist/modules/credentials/index.d.ts.map +0 -1
- package/dist/modules/credentials/schema.d.ts +0 -56
- package/dist/modules/credentials/schema.d.ts.map +0 -1
- package/dist/modules/notify/index.d.ts +0 -36
- package/dist/modules/notify/index.d.ts.map +0 -1
- package/dist/modules/notify/providers/resend.d.ts +0 -7
- package/dist/modules/notify/providers/resend.d.ts.map +0 -1
- package/dist/modules/notify/providers/smtp.d.ts +0 -18
- package/dist/modules/notify/providers/smtp.d.ts.map +0 -1
- package/dist/modules/notify/providers/waba.d.ts +0 -12
- package/dist/modules/notify/providers/waba.d.ts.map +0 -1
- package/dist/modules/notify/schema.d.ts +0 -337
- package/dist/modules/notify/schema.d.ts.map +0 -1
- package/dist/modules/notify/service.d.ts +0 -22
- package/dist/modules/notify/service.d.ts.map +0 -1
- package/dist/modules/sequences/index.d.ts +0 -4
- package/dist/modules/sequences/index.d.ts.map +0 -1
- package/dist/modules/sequences/next-sequence.d.ts +0 -8
- package/dist/modules/sequences/next-sequence.d.ts.map +0 -1
- package/dist/modules/sequences/schema.d.ts +0 -72
- package/dist/modules/sequences/schema.d.ts.map +0 -1
- package/dist/modules/storage/index.d.ts +0 -24
- package/dist/modules/storage/index.d.ts.map +0 -1
- package/dist/modules/storage/providers/local.d.ts +0 -3
- package/dist/modules/storage/providers/local.d.ts.map +0 -1
- package/dist/modules/storage/providers/s3.d.ts +0 -3
- package/dist/modules/storage/providers/s3.d.ts.map +0 -1
- package/dist/modules/storage/routes.d.ts +0 -4
- package/dist/modules/storage/routes.d.ts.map +0 -1
- package/dist/modules/storage/schema.d.ts +0 -273
- package/dist/modules/storage/schema.d.ts.map +0 -1
- package/dist/modules/storage/service.d.ts +0 -35
- package/dist/modules/storage/service.d.ts.map +0 -1
- package/dist/schemas.d.ts +0 -19
- package/dist/schemas.d.ts.map +0 -1
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface CircuitBreakerOptions {
|
|
2
|
-
threshold: number;
|
|
3
|
-
resetTimeout: number;
|
|
4
|
-
}
|
|
5
|
-
export declare class CircuitBreaker {
|
|
6
|
-
private state;
|
|
7
|
-
private failures;
|
|
8
|
-
private openedAt;
|
|
9
|
-
private readonly threshold;
|
|
10
|
-
private readonly resetTimeout;
|
|
11
|
-
constructor(options: CircuitBreakerOptions);
|
|
12
|
-
isOpen(): boolean;
|
|
13
|
-
isHalfOpen(): boolean;
|
|
14
|
-
recordFailure(): void;
|
|
15
|
-
recordSuccess(): void;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=circuit-breaker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../src/infra/circuit-breaker.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAID,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,OAAO,EAAE,qBAAqB;IAK1C,MAAM,IAAI,OAAO;IAYjB,UAAU,IAAI,OAAO;IAMrB,aAAa,IAAI,IAAI;IAerB,aAAa,IAAI,IAAI;CAItB"}
|
package/dist/infra/errors.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
|
3
|
-
export declare const ERROR_CODES: {
|
|
4
|
-
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
5
|
-
readonly FORBIDDEN: "FORBIDDEN";
|
|
6
|
-
readonly NOT_FOUND: "NOT_FOUND";
|
|
7
|
-
readonly VALIDATION: "VALIDATION";
|
|
8
|
-
readonly CONFLICT: "CONFLICT";
|
|
9
|
-
readonly INTERNAL: "INTERNAL";
|
|
10
|
-
readonly DB_BUSY: "DB_BUSY";
|
|
11
|
-
};
|
|
12
|
-
export type ErrorCode = keyof typeof ERROR_CODES;
|
|
13
|
-
export declare class VobaseError extends Error {
|
|
14
|
-
readonly code: ErrorCode;
|
|
15
|
-
readonly statusCode: ContentfulStatusCode;
|
|
16
|
-
readonly details?: object | undefined;
|
|
17
|
-
constructor(message: string, code: ErrorCode, statusCode: ContentfulStatusCode, details?: object | undefined);
|
|
18
|
-
}
|
|
19
|
-
export declare const unauthorized: (message?: string) => VobaseError;
|
|
20
|
-
export declare const forbidden: (message?: string) => VobaseError;
|
|
21
|
-
export declare const notFound: (resource: string) => VobaseError;
|
|
22
|
-
export declare const validation: (details: object, message?: string) => VobaseError;
|
|
23
|
-
export declare const conflict: (resource: string) => VobaseError;
|
|
24
|
-
export declare const dbBusy: () => VobaseError;
|
|
25
|
-
export declare const errorHandler: (err: Error, c: Context) => Response;
|
|
26
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/infra/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AAEjD,qBAAa,WAAY,SAAQ,KAAK;aAGlB,IAAI,EAAE,SAAS;aACf,UAAU,EAAE,oBAAoB;aAChC,OAAO,CAAC,EAAE,MAAM;gBAHhC,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,oBAAoB,EAChC,OAAO,CAAC,EAAE,MAAM,YAAA;CAKnC;AAED,eAAO,MAAM,YAAY,GAAI,gBAAwB,gBACN,CAAC;AAEhD,eAAO,MAAM,SAAS,GAAI,gBAAqB,gBACH,CAAC;AAE7C,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,gBACmB,CAAC;AAE7D,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,gBAA6B,gBACnB,CAAC;AAEvD,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,gBACuB,CAAC;AAEjE,eAAO,MAAM,MAAM,mBAC0C,CAAC;AAE9D,eAAO,MAAM,YAAY,GAAI,KAAK,KAAK,EAAE,GAAG,OAAO,KAAG,QAkBrD,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type CircuitBreakerOptions } from './circuit-breaker';
|
|
2
|
-
export interface HttpClientOptions {
|
|
3
|
-
baseUrl?: string;
|
|
4
|
-
timeout?: number;
|
|
5
|
-
retries?: number;
|
|
6
|
-
retryDelay?: number;
|
|
7
|
-
circuitBreaker?: CircuitBreakerOptions;
|
|
8
|
-
}
|
|
9
|
-
export interface RequestOptions {
|
|
10
|
-
method?: string;
|
|
11
|
-
headers?: Record<string, string>;
|
|
12
|
-
body?: unknown;
|
|
13
|
-
timeout?: number;
|
|
14
|
-
retries?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface HttpResponse<T = unknown> {
|
|
17
|
-
ok: boolean;
|
|
18
|
-
status: number;
|
|
19
|
-
headers: Headers;
|
|
20
|
-
data: T;
|
|
21
|
-
raw: Response;
|
|
22
|
-
}
|
|
23
|
-
export interface HttpClient {
|
|
24
|
-
fetch<T = unknown>(url: string, options?: RequestOptions): Promise<HttpResponse<T>>;
|
|
25
|
-
get<T = unknown>(url: string, options?: Omit<RequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
|
|
26
|
-
post<T = unknown>(url: string, body?: unknown, options?: Omit<RequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
|
|
27
|
-
put<T = unknown>(url: string, body?: unknown, options?: Omit<RequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
|
|
28
|
-
delete<T = unknown>(url: string, options?: Omit<RequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
|
|
29
|
-
}
|
|
30
|
-
export declare function createHttpClient(defaults?: HttpClientOptions): HttpClient;
|
|
31
|
-
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/infra/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/E,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,CAAC,GAAG,OAAO,EACf,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,GAAG,CAAC,CAAC,GAAG,OAAO,EACb,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,GAChD,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAC,CAAC,GAAG,OAAO,EACd,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,GAChD,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,GAAG,CAAC,CAAC,GAAG,OAAO,EACb,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,GAChD,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,CAAC,CAAC,GAAG,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,GAChD,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7B;AA2CD,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAgIzE"}
|
package/dist/infra/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { conflict, dbBusy, ERROR_CODES, type ErrorCode, errorHandler, forbidden, notFound, unauthorized, VobaseError, validation, } from './errors';
|
|
2
|
-
export { logger } from './logger';
|
|
3
|
-
export { createScheduler, configureQueueDataPath, DEFAULT_QUEUE_DB_PATH, DEFAULT_QUEUE_NAME, type JobOptions, type Scheduler, type SchedulerOptions, } from './queue';
|
|
4
|
-
export type { JobDefinition, JobHandler, WorkerOptions } from './job';
|
|
5
|
-
export { createWorker, defineJob, jobRegistry } from './job';
|
|
6
|
-
export { CircuitBreaker, type CircuitBreakerOptions } from './circuit-breaker';
|
|
7
|
-
export { createHttpClient, type HttpClient, type HttpClientOptions, type HttpResponse, type RequestOptions, } from './http-client';
|
|
8
|
-
export { createThrowProxy } from './throw-proxy';
|
|
9
|
-
export { type WebhookConfig, verifyHmacSignature, createWebhookRoutes, webhookDedup } from './webhooks';
|
|
10
|
-
export { webhookDedup as webhookDedupSchema } from './webhooks-schema';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infra/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,KAAK,SAAS,EACd,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,gBAAgB,GACtB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/infra/job.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Worker } from 'bunqueue/client';
|
|
2
|
-
import { type SchedulerOptions } from './queue';
|
|
3
|
-
export type JobHandler = (data: unknown) => Promise<void>;
|
|
4
|
-
export interface JobDefinition {
|
|
5
|
-
name: string;
|
|
6
|
-
handler: JobHandler;
|
|
7
|
-
}
|
|
8
|
-
export interface WorkerOptions extends Pick<SchedulerOptions, 'dbPath' | 'queueName'> {
|
|
9
|
-
concurrency?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const jobRegistry: Map<string, JobHandler>;
|
|
12
|
-
export declare function defineJob(name: string, handler: JobHandler): JobDefinition;
|
|
13
|
-
export declare function createWorker(jobs: JobDefinition[], options?: WorkerOptions): Worker;
|
|
14
|
-
//# sourceMappingURL=job.d.ts.map
|
package/dist/infra/job.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/infra/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACP,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,WAAW,CAAC;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,yBAAgC,CAAC;AAkCzD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,aAAa,CAM1E;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,aAAa,EAAE,EACrB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAoBR"}
|
package/dist/infra/logger.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/infra/logger.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,MAAM;gBACL,MAAM,SAAS,OAAO;gBACtB,MAAM,SAAS,OAAO;iBACrB,MAAM,SAAS,OAAO;iBACtB,MAAM,SAAS,OAAO;CACpC,CAAC"}
|
package/dist/infra/queue.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_QUEUE_DB_PATH = "/data/bunqueue.db";
|
|
2
|
-
export declare const DEFAULT_QUEUE_NAME = "vobase-jobs";
|
|
3
|
-
export interface JobOptions {
|
|
4
|
-
delay?: number | string;
|
|
5
|
-
priority?: number;
|
|
6
|
-
retry?: number;
|
|
7
|
-
retries?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface SchedulerOptions {
|
|
10
|
-
dbPath?: string;
|
|
11
|
-
queueName?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface Scheduler {
|
|
14
|
-
add(jobName: string, data: unknown, options?: JobOptions): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export declare function configureQueueDataPath(dbPath: string): string;
|
|
17
|
-
export declare function createScheduler(options?: SchedulerOptions): Scheduler;
|
|
18
|
-
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/infra/queue.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E;AAsFD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAa7D;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAmBrE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a proxy that throws a descriptive error when any property is accessed.
|
|
3
|
-
* Used for optional services (storage, notify) that are typed as non-optional
|
|
4
|
-
* in VobaseCtx but may not be configured.
|
|
5
|
-
*/
|
|
6
|
-
export declare function createThrowProxy<T>(serviceName: string): T;
|
|
7
|
-
//# sourceMappingURL=throw-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"throw-proxy.d.ts","sourceRoot":"","sources":["../../src/infra/throw-proxy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAW1D"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook deduplication table. Tracks processed webhook IDs
|
|
3
|
-
* to prevent duplicate processing.
|
|
4
|
-
*/
|
|
5
|
-
export declare const webhookDedup: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
6
|
-
name: "_webhook_dedup";
|
|
7
|
-
schema: undefined;
|
|
8
|
-
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
10
|
-
name: string;
|
|
11
|
-
tableName: "_webhook_dedup";
|
|
12
|
-
dataType: "string";
|
|
13
|
-
data: string;
|
|
14
|
-
driverParam: string;
|
|
15
|
-
notNull: true;
|
|
16
|
-
hasDefault: false;
|
|
17
|
-
isPrimaryKey: false;
|
|
18
|
-
isAutoincrement: false;
|
|
19
|
-
hasRuntimeDefault: false;
|
|
20
|
-
enumValues: [string, ...string[]];
|
|
21
|
-
baseColumn: never;
|
|
22
|
-
identity: undefined;
|
|
23
|
-
generated: undefined;
|
|
24
|
-
}, {}>;
|
|
25
|
-
source: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
26
|
-
name: string;
|
|
27
|
-
tableName: "_webhook_dedup";
|
|
28
|
-
dataType: "string";
|
|
29
|
-
data: string;
|
|
30
|
-
driverParam: string;
|
|
31
|
-
notNull: true;
|
|
32
|
-
hasDefault: false;
|
|
33
|
-
isPrimaryKey: false;
|
|
34
|
-
isAutoincrement: false;
|
|
35
|
-
hasRuntimeDefault: false;
|
|
36
|
-
enumValues: [string, ...string[]];
|
|
37
|
-
baseColumn: never;
|
|
38
|
-
identity: undefined;
|
|
39
|
-
generated: undefined;
|
|
40
|
-
}, {}>;
|
|
41
|
-
receivedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
42
|
-
name: string;
|
|
43
|
-
tableName: "_webhook_dedup";
|
|
44
|
-
dataType: "object date";
|
|
45
|
-
data: Date;
|
|
46
|
-
driverParam: number;
|
|
47
|
-
notNull: true;
|
|
48
|
-
hasDefault: true;
|
|
49
|
-
isPrimaryKey: false;
|
|
50
|
-
isAutoincrement: false;
|
|
51
|
-
hasRuntimeDefault: true;
|
|
52
|
-
enumValues: undefined;
|
|
53
|
-
baseColumn: never;
|
|
54
|
-
identity: undefined;
|
|
55
|
-
generated: undefined;
|
|
56
|
-
}, {}>;
|
|
57
|
-
};
|
|
58
|
-
dialect: "sqlite";
|
|
59
|
-
}>;
|
|
60
|
-
//# sourceMappingURL=webhooks-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks-schema.d.ts","sourceRoot":"","sources":["../../src/infra/webhooks-schema.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUxB,CAAC"}
|
package/dist/infra/webhooks.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Hono } from 'hono';
|
|
2
|
-
import type { VobaseDb } from '../db/client';
|
|
3
|
-
import type { Scheduler } from './queue';
|
|
4
|
-
export { webhookDedup } from './webhooks-schema';
|
|
5
|
-
export interface WebhookConfig {
|
|
6
|
-
/** Route path, e.g. '/webhooks/stripe' */
|
|
7
|
-
path: string;
|
|
8
|
-
/** HMAC secret for signature verification */
|
|
9
|
-
secret: string;
|
|
10
|
-
/** Job name to enqueue, e.g. 'system:processWebhook' */
|
|
11
|
-
handler: string;
|
|
12
|
-
/** Header containing the signature (default: 'x-webhook-signature') */
|
|
13
|
-
signatureHeader?: string;
|
|
14
|
-
/** Whether to deduplicate webhooks (default: true) */
|
|
15
|
-
dedup?: boolean;
|
|
16
|
-
/** Header containing the webhook delivery ID (default: 'x-webhook-id') */
|
|
17
|
-
idHeader?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Verify an HMAC-SHA256 signature against a payload and secret.
|
|
21
|
-
*
|
|
22
|
-
* Uses timing-safe comparison to prevent timing attacks.
|
|
23
|
-
* Returns false for any malformed or invalid signature (never throws).
|
|
24
|
-
*/
|
|
25
|
-
export declare function verifyHmacSignature(payload: string, signature: string, secret: string): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Check whether a webhook has already been processed and record it if not.
|
|
28
|
-
*
|
|
29
|
-
* Checks for existing record first, then inserts if not found.
|
|
30
|
-
*
|
|
31
|
-
* @returns `true` if the webhook is a duplicate, `false` if it's new.
|
|
32
|
-
*/
|
|
33
|
-
export declare function checkAndRecordWebhook(db: VobaseDb, webhookId: string, source: string): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Create a Hono router that handles incoming webhook POST requests.
|
|
36
|
-
*
|
|
37
|
-
* For each webhook config, registers a POST handler that:
|
|
38
|
-
* 1. Verifies HMAC signature
|
|
39
|
-
* 2. Optionally deduplicates by webhook ID
|
|
40
|
-
* 3. Enqueues the payload to the configured job
|
|
41
|
-
*/
|
|
42
|
-
export declare function createWebhookRoutes(configs: Record<string, WebhookConfig>, deps: {
|
|
43
|
-
db: VobaseDb;
|
|
44
|
-
scheduler: Scheduler;
|
|
45
|
-
}): Hono;
|
|
46
|
-
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/infra/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAoBT;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAoBT;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACtC,IAAI,EAAE;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,GAC3C,IAAI,CA6CN"}
|
package/dist/mcp/crud.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { AuthUser } from '../contracts/auth';
|
|
3
|
-
import type { VobaseDb } from '../db';
|
|
4
|
-
import type { VobaseModule } from '../module';
|
|
5
|
-
interface CrudContext {
|
|
6
|
-
db: VobaseDb;
|
|
7
|
-
user: AuthUser | null;
|
|
8
|
-
organizationEnabled: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare function registerCrudTools(server: McpServer, modules: VobaseModule[], ctx: CrudContext, excludeMap: Map<string, Set<string>>): void;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=crud.d.ts.map
|
package/dist/mcp/crud.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../src/mcp/crud.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,UAAU,WAAW;IACnB,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAwBD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,YAAY,EAAE,EACvB,GAAG,EAAE,WAAW,EAChB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,QA2HrC"}
|
package/dist/mcp/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/mcp/server.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { VobaseDb } from '../db';
|
|
3
|
-
import type { VobaseModule } from '../module';
|
|
4
|
-
export interface McpDeps {
|
|
5
|
-
db: VobaseDb;
|
|
6
|
-
modules: VobaseModule[];
|
|
7
|
-
}
|
|
8
|
-
export declare function createMcpServer(deps: McpDeps): McpServer;
|
|
9
|
-
export declare function createMcpHandler(deps: McpDeps): (req: Request) => Promise<Response>;
|
|
10
|
-
//# sourceMappingURL=server.d.ts.map
|
package/dist/mcp/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAK9C,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAmBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAmFxD;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,OAAO,GACZ,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAgBrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-registry.d.ts","sourceRoot":"","sources":["../src/module-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,OAAO,EAAE,YAAY,EAAE,GACtB,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAY3B"}
|
package/dist/module.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Hono } from 'hono';
|
|
2
|
-
import type { ModuleInitContext } from './contracts/module';
|
|
3
|
-
import type { JobDefinition } from './infra/job';
|
|
4
|
-
export interface VobaseModule {
|
|
5
|
-
name: string;
|
|
6
|
-
schema: Record<string, unknown>;
|
|
7
|
-
routes: Hono;
|
|
8
|
-
jobs?: JobDefinition[];
|
|
9
|
-
pages?: Record<string, string>;
|
|
10
|
-
seed?: () => Promise<void>;
|
|
11
|
-
init?: (ctx: ModuleInitContext) => Promise<void> | void;
|
|
12
|
-
}
|
|
13
|
-
export interface DefineModuleConfig {
|
|
14
|
-
name: string;
|
|
15
|
-
schema: Record<string, unknown>;
|
|
16
|
-
routes: Hono;
|
|
17
|
-
jobs?: JobDefinition[];
|
|
18
|
-
pages?: Record<string, string>;
|
|
19
|
-
seed?: () => Promise<void>;
|
|
20
|
-
init?: (ctx: ModuleInitContext) => Promise<void> | void;
|
|
21
|
-
}
|
|
22
|
-
export declare function defineModule(config: DefineModuleConfig): VobaseModule;
|
|
23
|
-
/**
|
|
24
|
-
* Internal-only factory for built-in modules. Bypasses user-facing name
|
|
25
|
-
* validation to allow the `_` prefix convention (e.g., `_audit`, `_sequences`).
|
|
26
|
-
* Not exported in the public API (index.ts).
|
|
27
|
-
*/
|
|
28
|
-
export declare function defineBuiltinModule(config: DefineModuleConfig): VobaseModule;
|
|
29
|
-
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzD;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CA6CrE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CA4B5E"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { auditLog, recordAudits } from './schema';
|
|
2
|
-
export { trackChanges } from './track-changes';
|
|
3
|
-
export { requestAuditMiddleware } from './middleware';
|
|
4
|
-
export declare function createAuditModule(): import("../..").VobaseModule;
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/audit/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,wBAAgB,iBAAiB,iCAOhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/modules/audit/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAWhD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,+DAmBlD"}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Audit log table for tracking system events (sign-in, sign-up, role changes, etc.)
|
|
3
|
-
* Events are immutable - no updatedAt column
|
|
4
|
-
*/
|
|
5
|
-
export declare const auditLog: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
6
|
-
name: "_audit_log";
|
|
7
|
-
schema: undefined;
|
|
8
|
-
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
10
|
-
name: string;
|
|
11
|
-
tableName: "_audit_log";
|
|
12
|
-
dataType: "string";
|
|
13
|
-
data: string;
|
|
14
|
-
driverParam: string;
|
|
15
|
-
notNull: true;
|
|
16
|
-
hasDefault: true;
|
|
17
|
-
isPrimaryKey: true;
|
|
18
|
-
isAutoincrement: false;
|
|
19
|
-
hasRuntimeDefault: true;
|
|
20
|
-
enumValues: [string, ...string[]];
|
|
21
|
-
baseColumn: never;
|
|
22
|
-
identity: undefined;
|
|
23
|
-
generated: undefined;
|
|
24
|
-
}, {}>;
|
|
25
|
-
event: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
26
|
-
name: string;
|
|
27
|
-
tableName: "_audit_log";
|
|
28
|
-
dataType: "string";
|
|
29
|
-
data: string;
|
|
30
|
-
driverParam: string;
|
|
31
|
-
notNull: true;
|
|
32
|
-
hasDefault: false;
|
|
33
|
-
isPrimaryKey: false;
|
|
34
|
-
isAutoincrement: false;
|
|
35
|
-
hasRuntimeDefault: false;
|
|
36
|
-
enumValues: [string, ...string[]];
|
|
37
|
-
baseColumn: never;
|
|
38
|
-
identity: undefined;
|
|
39
|
-
generated: undefined;
|
|
40
|
-
}, {}>;
|
|
41
|
-
actorId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
42
|
-
name: string;
|
|
43
|
-
tableName: "_audit_log";
|
|
44
|
-
dataType: "string";
|
|
45
|
-
data: string;
|
|
46
|
-
driverParam: string;
|
|
47
|
-
notNull: false;
|
|
48
|
-
hasDefault: false;
|
|
49
|
-
isPrimaryKey: false;
|
|
50
|
-
isAutoincrement: false;
|
|
51
|
-
hasRuntimeDefault: false;
|
|
52
|
-
enumValues: [string, ...string[]];
|
|
53
|
-
baseColumn: never;
|
|
54
|
-
identity: undefined;
|
|
55
|
-
generated: undefined;
|
|
56
|
-
}, {}>;
|
|
57
|
-
actorEmail: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
58
|
-
name: string;
|
|
59
|
-
tableName: "_audit_log";
|
|
60
|
-
dataType: "string";
|
|
61
|
-
data: string;
|
|
62
|
-
driverParam: string;
|
|
63
|
-
notNull: false;
|
|
64
|
-
hasDefault: false;
|
|
65
|
-
isPrimaryKey: false;
|
|
66
|
-
isAutoincrement: false;
|
|
67
|
-
hasRuntimeDefault: false;
|
|
68
|
-
enumValues: [string, ...string[]];
|
|
69
|
-
baseColumn: never;
|
|
70
|
-
identity: undefined;
|
|
71
|
-
generated: undefined;
|
|
72
|
-
}, {}>;
|
|
73
|
-
ip: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
74
|
-
name: string;
|
|
75
|
-
tableName: "_audit_log";
|
|
76
|
-
dataType: "string";
|
|
77
|
-
data: string;
|
|
78
|
-
driverParam: string;
|
|
79
|
-
notNull: false;
|
|
80
|
-
hasDefault: false;
|
|
81
|
-
isPrimaryKey: false;
|
|
82
|
-
isAutoincrement: false;
|
|
83
|
-
hasRuntimeDefault: false;
|
|
84
|
-
enumValues: [string, ...string[]];
|
|
85
|
-
baseColumn: never;
|
|
86
|
-
identity: undefined;
|
|
87
|
-
generated: undefined;
|
|
88
|
-
}, {}>;
|
|
89
|
-
details: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
90
|
-
name: string;
|
|
91
|
-
tableName: "_audit_log";
|
|
92
|
-
dataType: "string";
|
|
93
|
-
data: string;
|
|
94
|
-
driverParam: string;
|
|
95
|
-
notNull: false;
|
|
96
|
-
hasDefault: false;
|
|
97
|
-
isPrimaryKey: false;
|
|
98
|
-
isAutoincrement: false;
|
|
99
|
-
hasRuntimeDefault: false;
|
|
100
|
-
enumValues: [string, ...string[]];
|
|
101
|
-
baseColumn: never;
|
|
102
|
-
identity: undefined;
|
|
103
|
-
generated: undefined;
|
|
104
|
-
}, {}>;
|
|
105
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
106
|
-
name: string;
|
|
107
|
-
tableName: "_audit_log";
|
|
108
|
-
dataType: "object date";
|
|
109
|
-
data: Date;
|
|
110
|
-
driverParam: number;
|
|
111
|
-
notNull: true;
|
|
112
|
-
hasDefault: true;
|
|
113
|
-
isPrimaryKey: false;
|
|
114
|
-
isAutoincrement: false;
|
|
115
|
-
hasRuntimeDefault: true;
|
|
116
|
-
enumValues: undefined;
|
|
117
|
-
baseColumn: never;
|
|
118
|
-
identity: undefined;
|
|
119
|
-
generated: undefined;
|
|
120
|
-
}, {}>;
|
|
121
|
-
};
|
|
122
|
-
dialect: "sqlite";
|
|
123
|
-
}>;
|
|
124
|
-
/**
|
|
125
|
-
* Record audits table for tracking changes to individual records
|
|
126
|
-
* Stores before/after data for data change auditing
|
|
127
|
-
*/
|
|
128
|
-
export declare const recordAudits: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
129
|
-
name: "_record_audits";
|
|
130
|
-
schema: undefined;
|
|
131
|
-
columns: {
|
|
132
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
133
|
-
name: string;
|
|
134
|
-
tableName: "_record_audits";
|
|
135
|
-
dataType: "string";
|
|
136
|
-
data: string;
|
|
137
|
-
driverParam: string;
|
|
138
|
-
notNull: true;
|
|
139
|
-
hasDefault: true;
|
|
140
|
-
isPrimaryKey: true;
|
|
141
|
-
isAutoincrement: false;
|
|
142
|
-
hasRuntimeDefault: true;
|
|
143
|
-
enumValues: [string, ...string[]];
|
|
144
|
-
baseColumn: never;
|
|
145
|
-
identity: undefined;
|
|
146
|
-
generated: undefined;
|
|
147
|
-
}, {}>;
|
|
148
|
-
tableName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
149
|
-
name: string;
|
|
150
|
-
tableName: "_record_audits";
|
|
151
|
-
dataType: "string";
|
|
152
|
-
data: string;
|
|
153
|
-
driverParam: string;
|
|
154
|
-
notNull: true;
|
|
155
|
-
hasDefault: false;
|
|
156
|
-
isPrimaryKey: false;
|
|
157
|
-
isAutoincrement: false;
|
|
158
|
-
hasRuntimeDefault: false;
|
|
159
|
-
enumValues: [string, ...string[]];
|
|
160
|
-
baseColumn: never;
|
|
161
|
-
identity: undefined;
|
|
162
|
-
generated: undefined;
|
|
163
|
-
}, {}>;
|
|
164
|
-
recordId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
165
|
-
name: string;
|
|
166
|
-
tableName: "_record_audits";
|
|
167
|
-
dataType: "string";
|
|
168
|
-
data: string;
|
|
169
|
-
driverParam: string;
|
|
170
|
-
notNull: true;
|
|
171
|
-
hasDefault: false;
|
|
172
|
-
isPrimaryKey: false;
|
|
173
|
-
isAutoincrement: false;
|
|
174
|
-
hasRuntimeDefault: false;
|
|
175
|
-
enumValues: [string, ...string[]];
|
|
176
|
-
baseColumn: never;
|
|
177
|
-
identity: undefined;
|
|
178
|
-
generated: undefined;
|
|
179
|
-
}, {}>;
|
|
180
|
-
oldData: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
181
|
-
name: string;
|
|
182
|
-
tableName: "_record_audits";
|
|
183
|
-
dataType: "string";
|
|
184
|
-
data: string;
|
|
185
|
-
driverParam: string;
|
|
186
|
-
notNull: false;
|
|
187
|
-
hasDefault: false;
|
|
188
|
-
isPrimaryKey: false;
|
|
189
|
-
isAutoincrement: false;
|
|
190
|
-
hasRuntimeDefault: false;
|
|
191
|
-
enumValues: [string, ...string[]];
|
|
192
|
-
baseColumn: never;
|
|
193
|
-
identity: undefined;
|
|
194
|
-
generated: undefined;
|
|
195
|
-
}, {}>;
|
|
196
|
-
newData: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
197
|
-
name: string;
|
|
198
|
-
tableName: "_record_audits";
|
|
199
|
-
dataType: "string";
|
|
200
|
-
data: string;
|
|
201
|
-
driverParam: string;
|
|
202
|
-
notNull: false;
|
|
203
|
-
hasDefault: false;
|
|
204
|
-
isPrimaryKey: false;
|
|
205
|
-
isAutoincrement: false;
|
|
206
|
-
hasRuntimeDefault: false;
|
|
207
|
-
enumValues: [string, ...string[]];
|
|
208
|
-
baseColumn: never;
|
|
209
|
-
identity: undefined;
|
|
210
|
-
generated: undefined;
|
|
211
|
-
}, {}>;
|
|
212
|
-
changedBy: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
213
|
-
name: string;
|
|
214
|
-
tableName: "_record_audits";
|
|
215
|
-
dataType: "string";
|
|
216
|
-
data: string;
|
|
217
|
-
driverParam: string;
|
|
218
|
-
notNull: false;
|
|
219
|
-
hasDefault: false;
|
|
220
|
-
isPrimaryKey: false;
|
|
221
|
-
isAutoincrement: false;
|
|
222
|
-
hasRuntimeDefault: false;
|
|
223
|
-
enumValues: [string, ...string[]];
|
|
224
|
-
baseColumn: never;
|
|
225
|
-
identity: undefined;
|
|
226
|
-
generated: undefined;
|
|
227
|
-
}, {}>;
|
|
228
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
229
|
-
name: string;
|
|
230
|
-
tableName: "_record_audits";
|
|
231
|
-
dataType: "object date";
|
|
232
|
-
data: Date;
|
|
233
|
-
driverParam: number;
|
|
234
|
-
notNull: true;
|
|
235
|
-
hasDefault: true;
|
|
236
|
-
isPrimaryKey: false;
|
|
237
|
-
isAutoincrement: false;
|
|
238
|
-
hasRuntimeDefault: true;
|
|
239
|
-
enumValues: undefined;
|
|
240
|
-
baseColumn: never;
|
|
241
|
-
identity: undefined;
|
|
242
|
-
generated: undefined;
|
|
243
|
-
}, {}>;
|
|
244
|
-
};
|
|
245
|
-
dialect: "sqlite";
|
|
246
|
-
}>;
|
|
247
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/audit/schema.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUnB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvB,CAAC"}
|