jotdb 0.1.1 → 0.1.2
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 +5 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +249 -5832
- package/package.json +7 -4
- package/src/index.ts +5 -4
- package/tsconfig.json +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jotdb",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -10,9 +10,12 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "wrangler dev --port 5173 --remote",
|
|
12
12
|
"test": "bun test jotdb.tests.ts",
|
|
13
|
-
"deploy": "wrangler deploy"
|
|
13
|
+
"deploy": "wrangler deploy",
|
|
14
|
+
"patch": "npm version patch && npm publish --access public"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"typescript": "^5.8.3"
|
|
14
18
|
},
|
|
15
|
-
"dependencies": {},
|
|
16
19
|
"devDependencies": {
|
|
17
20
|
"@cloudflare/workers-types": "^4.20250517.0",
|
|
18
21
|
"hono": "^4.7.10",
|
|
@@ -23,4 +26,4 @@
|
|
|
23
26
|
"type": "git",
|
|
24
27
|
"url": "https://github.com/acoyfellow/jotdb.git"
|
|
25
28
|
}
|
|
26
|
-
}
|
|
29
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z, ZodTypeAny, ZodObject } from "zod";
|
|
2
|
-
import type { DurableObjectState } from "@cloudflare/workers-types";
|
|
3
2
|
import { Hono } from 'hono';
|
|
4
3
|
import { cors } from 'hono/cors';
|
|
5
4
|
import { prettyJSON } from 'hono/pretty-json';
|
|
@@ -21,7 +20,6 @@ interface AuditLogEntry {
|
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export class JotDB extends DurableObject {
|
|
24
|
-
private ctx: DurableObjectState;
|
|
25
23
|
private data: Record<string, unknown> = {};
|
|
26
24
|
private rawSchema: SchemaDefinition = {};
|
|
27
25
|
private zodSchema: ZodObject<any> | null = null;
|
|
@@ -31,9 +29,8 @@ export class JotDB extends DurableObject {
|
|
|
31
29
|
};
|
|
32
30
|
private auditLog: AuditLogEntry[] = [];
|
|
33
31
|
|
|
34
|
-
constructor(state:
|
|
32
|
+
constructor(state: any, env: Env) {
|
|
35
33
|
super(state, env);
|
|
36
|
-
this.ctx = state;
|
|
37
34
|
}
|
|
38
35
|
|
|
39
36
|
async load(): Promise<void> {
|
|
@@ -229,6 +226,10 @@ export class JotDB extends DurableObject {
|
|
|
229
226
|
}
|
|
230
227
|
return z.object(shape);
|
|
231
228
|
}
|
|
229
|
+
|
|
230
|
+
async fetch(request: Request) {
|
|
231
|
+
return new Response("Hello, World!");
|
|
232
|
+
}
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
export interface Env {
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2020",
|
|
4
|
-
"module": "
|
|
4
|
+
"module": "ESNext",
|
|
5
5
|
"lib": [
|
|
6
6
|
"ES2020"
|
|
7
7
|
],
|
|
8
8
|
"types": [
|
|
9
9
|
"@cloudflare/workers-types"
|
|
10
10
|
],
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"emitDeclarationOnly": false,
|
|
13
|
+
"outDir": "dist",
|
|
11
14
|
"moduleResolution": "node",
|
|
12
15
|
"strict": true,
|
|
13
16
|
"noImplicitAny": true,
|