jotdb 0.1.1 → 0.1.3

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/bun.lock CHANGED
@@ -3,6 +3,9 @@
3
3
  "workspaces": {
4
4
  "": {
5
5
  "name": "jotdb",
6
+ "dependencies": {
7
+ "typescript": "^5.8.3",
8
+ },
6
9
  "devDependencies": {
7
10
  "@cloudflare/workers-types": "^4.20250517.0",
8
11
  "hono": "^4.7.10",
@@ -196,6 +199,8 @@
196
199
 
197
200
  "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
198
201
 
202
+ "typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
203
+
199
204
  "ufo": ["ufo@1.6.1", "", {}, "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="],
200
205
 
201
206
  "undici": ["undici@5.29.0", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="],
@@ -0,0 +1,49 @@
1
+ import type { DurableObjectState } from "@cloudflare/workers-types";
2
+ import { Hono } from 'hono';
3
+ import { DurableObject } from "cloudflare:workers";
4
+ type SchemaType = "string" | "number" | "boolean" | "email" | "array" | "object" | "any";
5
+ type SchemaDefinition = Record<string, SchemaType>;
6
+ interface JotDBOptions {
7
+ autoStrip: boolean;
8
+ readOnly: boolean;
9
+ }
10
+ interface AuditLogEntry {
11
+ timestamp: number;
12
+ action: string;
13
+ keys: string[];
14
+ }
15
+ export declare class JotDB extends DurableObject {
16
+ private data;
17
+ private rawSchema;
18
+ private zodSchema;
19
+ private options;
20
+ private auditLog;
21
+ constructor(state: DurableObjectState, env: Env);
22
+ load(): Promise<void>;
23
+ save(): Promise<void>;
24
+ logAudit(action: string, keys: string[] | string): Promise<void>;
25
+ get<T = unknown>(key: string): Promise<T | undefined>;
26
+ getAll(): Promise<Record<string, unknown>>;
27
+ set<T>(key: string, value: T): Promise<void>;
28
+ setAll(obj: Record<string, unknown>): Promise<void>;
29
+ delete(key: string): Promise<void>;
30
+ clear(): Promise<void>;
31
+ keys(): Promise<string[]>;
32
+ has(key: string): Promise<boolean>;
33
+ getSchema(): Promise<SchemaDefinition>;
34
+ private warnSchemaDiff;
35
+ setSchema(schemaObj: SchemaDefinition): Promise<void>;
36
+ setOptions(opts: Partial<JotDBOptions>): Promise<void>;
37
+ getOptions(): Promise<JotDBOptions>;
38
+ getAuditLog(): Promise<AuditLogEntry[]>;
39
+ clearAuditLog(): Promise<void>;
40
+ private buildZodSchema;
41
+ fetch(request: Request): Promise<Response>;
42
+ }
43
+ export interface Env {
44
+ JOTDB: DurableObjectNamespace;
45
+ }
46
+ declare const app: Hono<{
47
+ Bindings: Env;
48
+ }, import("hono/types").BlankSchema, "/">;
49
+ export default app;