@palbase/backend 25.0.2 → 25.0.4
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/dist/bin/palbase-backend.cjs +26 -10
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +3 -3
- package/dist/{chunk-34I4GB7D.js → chunk-AILPKEK5.js} +12 -12
- package/dist/chunk-AILPKEK5.js.map +1 -0
- package/dist/{chunk-P2Q27SGP.js → chunk-CJSKYY76.js} +182 -2
- package/dist/chunk-CJSKYY76.js.map +1 -0
- package/dist/{chunk-XJ2RSHEU.js → chunk-CRQKCRGF.js} +16 -2
- package/dist/chunk-CRQKCRGF.js.map +1 -0
- package/dist/{chunk-7JSEN7UR.js → chunk-G4R6BTLV.js} +3 -182
- package/dist/chunk-G4R6BTLV.js.map +1 -0
- package/dist/db/index.cjs +1 -1
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.js +2 -2
- package/dist/engine/index.cjs +26 -10
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.js +3 -3
- package/dist/index.cjs +15 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -6
- package/docs/README.md +20 -20
- package/docs/llms-full.txt +20 -20
- package/package.json +1 -1
- package/dist/chunk-34I4GB7D.js.map +0 -1
- package/dist/chunk-7JSEN7UR.js.map +0 -1
- package/dist/chunk-P2Q27SGP.js.map +0 -1
- package/dist/chunk-XJ2RSHEU.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -17,15 +17,13 @@ import {
|
|
|
17
17
|
openai,
|
|
18
18
|
ownedByUser,
|
|
19
19
|
policy,
|
|
20
|
-
qualifiedTableKey,
|
|
21
20
|
raw,
|
|
22
21
|
text,
|
|
23
22
|
timestamp,
|
|
24
|
-
toSchemaJSON,
|
|
25
23
|
userRef,
|
|
26
24
|
uuid,
|
|
27
25
|
vector
|
|
28
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-G4R6BTLV.js";
|
|
29
27
|
import {
|
|
30
28
|
defineError,
|
|
31
29
|
getErrorRegistry
|
|
@@ -48,14 +46,16 @@ import {
|
|
|
48
46
|
__setRuntime,
|
|
49
47
|
onShutdown,
|
|
50
48
|
onStart
|
|
51
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-CRQKCRGF.js";
|
|
52
50
|
import {
|
|
53
51
|
TxPlanError,
|
|
54
52
|
TxRefError,
|
|
55
53
|
dec,
|
|
56
54
|
inc,
|
|
57
|
-
now
|
|
58
|
-
|
|
55
|
+
now,
|
|
56
|
+
qualifiedTableKey,
|
|
57
|
+
toSchemaJSON
|
|
58
|
+
} from "./chunk-CJSKYY76.js";
|
|
59
59
|
import {
|
|
60
60
|
BadRequest,
|
|
61
61
|
Conflict,
|
package/docs/README.md
CHANGED
|
@@ -178,28 +178,28 @@ export default class TodosController {
|
|
|
178
178
|
|
|
179
179
|
```ts
|
|
180
180
|
// db/public.ts — config-as-code; the deploy auto-migrates additive changes.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
rls: true, // every Database.* query runs as the request user
|
|
193
|
-
policies: [
|
|
194
|
-
policy("pb_owner_all")
|
|
195
|
-
.for("all")
|
|
196
|
-
.to("authenticated")
|
|
197
|
-
.using("user_id = (select auth.uid())")
|
|
198
|
-
.withCheck("user_id = (select auth.uid())"),
|
|
199
|
-
],
|
|
200
|
-
},
|
|
181
|
+
// ONE SCHEMA PER FILE: this is `public`; a sibling `db/billing.ts` declares its own.
|
|
182
|
+
import { defineSchema, defineTable, uuid, text, boolean, timestamp, policy, ownedByUser } from "@palbase/backend";
|
|
183
|
+
|
|
184
|
+
export const todos = defineTable("todos", {
|
|
185
|
+
columns: {
|
|
186
|
+
id: uuid().primaryKey().defaultRandom(),
|
|
187
|
+
user_id: ownedByUser(), // owns the row: text, NOT NULL, ON DELETE cascade
|
|
188
|
+
title: text().notNull(),
|
|
189
|
+
completed: boolean().default(false),
|
|
190
|
+
created_at: timestamp().defaultNow(),
|
|
201
191
|
},
|
|
192
|
+
rls: true, // every Database.* query runs as the request user
|
|
193
|
+
policies: [
|
|
194
|
+
policy("pb_owner_all")
|
|
195
|
+
.for("all")
|
|
196
|
+
.to("authenticated")
|
|
197
|
+
.using("user_id = (select auth.uid())")
|
|
198
|
+
.withCheck("user_id = (select auth.uid())"),
|
|
199
|
+
],
|
|
202
200
|
});
|
|
201
|
+
|
|
202
|
+
export default defineSchema("public", { tables: [todos] });
|
|
203
203
|
```
|
|
204
204
|
|
|
205
205
|
### operationId — what the generated clients call
|
package/docs/llms-full.txt
CHANGED
|
@@ -186,28 +186,28 @@ export default class TodosController {
|
|
|
186
186
|
|
|
187
187
|
```ts
|
|
188
188
|
// db/public.ts — config-as-code; the deploy auto-migrates additive changes.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
rls: true, // every Database.* query runs as the request user
|
|
201
|
-
policies: [
|
|
202
|
-
policy("pb_owner_all")
|
|
203
|
-
.for("all")
|
|
204
|
-
.to("authenticated")
|
|
205
|
-
.using("user_id = (select auth.uid())")
|
|
206
|
-
.withCheck("user_id = (select auth.uid())"),
|
|
207
|
-
],
|
|
208
|
-
},
|
|
189
|
+
// ONE SCHEMA PER FILE: this is `public`; a sibling `db/billing.ts` declares its own.
|
|
190
|
+
import { defineSchema, defineTable, uuid, text, boolean, timestamp, policy, ownedByUser } from "@palbase/backend";
|
|
191
|
+
|
|
192
|
+
export const todos = defineTable("todos", {
|
|
193
|
+
columns: {
|
|
194
|
+
id: uuid().primaryKey().defaultRandom(),
|
|
195
|
+
user_id: ownedByUser(), // owns the row: text, NOT NULL, ON DELETE cascade
|
|
196
|
+
title: text().notNull(),
|
|
197
|
+
completed: boolean().default(false),
|
|
198
|
+
created_at: timestamp().defaultNow(),
|
|
209
199
|
},
|
|
200
|
+
rls: true, // every Database.* query runs as the request user
|
|
201
|
+
policies: [
|
|
202
|
+
policy("pb_owner_all")
|
|
203
|
+
.for("all")
|
|
204
|
+
.to("authenticated")
|
|
205
|
+
.using("user_id = (select auth.uid())")
|
|
206
|
+
.withCheck("user_id = (select auth.uid())"),
|
|
207
|
+
],
|
|
210
208
|
});
|
|
209
|
+
|
|
210
|
+
export default defineSchema("public", { tables: [todos] });
|
|
211
211
|
```
|
|
212
212
|
|
|
213
213
|
### operationId — what the generated clients call
|
package/package.json
CHANGED