@palbase/backend 33.0.0 → 33.0.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/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +5 -5
- package/dist/{chunk-BRLJOXWS.js → chunk-AAT5G7KY.js} +2 -2
- package/dist/{chunk-BRLJOXWS.js.map → chunk-AAT5G7KY.js.map} +1 -1
- package/dist/{chunk-DCDHAKF3.js → chunk-C6COAB3E.js} +5 -5
- package/dist/{chunk-C4ZA5AT2.js → chunk-SI4KGEM3.js} +1 -1
- package/dist/{chunk-C4ZA5AT2.js.map → chunk-SI4KGEM3.js.map} +1 -1
- package/dist/{chunk-QMFOL2K6.js → chunk-TVCCR6SO.js} +2 -2
- package/dist/{chunk-N54QZER3.js → chunk-WWUG2QXF.js} +2 -2
- package/dist/{chunk-GOPZPM2A.js → chunk-YIQ4RS4F.js} +2 -2
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.js +2 -2
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +3 -3
- package/dist/engine/index.d.ts +3 -3
- package/dist/engine/index.js +5 -5
- package/dist/{index-Bi74dcOu.d.ts → index-D-3duy8Y.d.ts} +2 -2
- package/dist/{index-BWgnGj68.d.cts → index-DB_nW-AV.d.cts} +19 -10
- package/dist/{index-g6iQyYci.d.cts → index-DLveQoOf.d.cts} +2 -2
- package/dist/{index-Dg10RnZO.d.ts → index-DMZG3kpo.d.ts} +19 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5 -5
- package/dist/openapi/index.cjs +1 -1
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +2 -2
- package/dist/openapi/index.d.ts +2 -2
- package/dist/openapi/index.js +1 -1
- package/dist/{registry-6VT5RPeO.d.cts → registry-DSTThhKf.d.cts} +1 -1
- package/dist/{registry-B-sxJJN0.d.ts → registry-JjF5lcj4.d.ts} +1 -1
- package/dist/test/index.cjs +1120 -4
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js +1121 -5
- package/dist/test/index.js.map +1 -1
- package/docs/README.md +123 -79
- package/docs/auth.md +11 -7
- package/docs/background.md +16 -7
- package/docs/database.md +22 -18
- package/docs/endpoints.md +26 -20
- package/docs/errors.md +2 -3
- package/docs/events.md +63 -29
- package/docs/getting-started.md +8 -7
- package/docs/llms-full.txt +399 -232
- package/docs/migrations.md +6 -5
- package/docs/routing.md +34 -11
- package/docs/schema.md +61 -36
- package/docs/services.md +30 -13
- package/package.json +2 -1
- package/stack-images.json +24 -0
- package/template/AGENTS.md +7 -7
- package/template/modules/health/health.controller.ts +7 -4
- package/template/modules/notes/dto/create.ts +4 -3
- package/template/modules/notes/notes.controller.ts +8 -6
- /package/dist/{chunk-DCDHAKF3.js.map → chunk-C6COAB3E.js.map} +0 -0
- /package/dist/{chunk-QMFOL2K6.js.map → chunk-TVCCR6SO.js.map} +0 -0
- /package/dist/{chunk-N54QZER3.js.map → chunk-WWUG2QXF.js.map} +0 -0
- /package/dist/{chunk-GOPZPM2A.js.map → chunk-YIQ4RS4F.js.map} +0 -0
package/dist/engine/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '../index-
|
|
2
|
-
export { A as App, g as AuthVerifier, B as BootRefused, h as CreateAppOptions, D as DECLARATION_REFUSAL, a as DeclarationRefused, E as EgressPolicy, j as EngineConfig, M as ModuleClients, R as RateLimiter, k as RequestDatabase, l as RouteEntry, m as RuntimeHooks, S as ScrubResult, n as SqlDriver, o as SqlTx, p as buildRouteTable, q as createApp, r as createLazyTransaction, s as createOps, t as createRequestDatabase, u as effectiveAuth, v as hostAllowed, w as installEgressFence, i as isDeclarationRefused, x as loadConfig, y as makeMemoryCache, z as matchRoute, F as quoteIdent, G as scrubSecrets, H as withTables } from '../index-
|
|
1
|
+
import '../index-DB_nW-AV.cjs';
|
|
2
|
+
export { A as App, g as AuthVerifier, B as BootRefused, h as CreateAppOptions, D as DECLARATION_REFUSAL, a as DeclarationRefused, E as EgressPolicy, j as EngineConfig, M as ModuleClients, R as RateLimiter, k as RequestDatabase, l as RouteEntry, m as RuntimeHooks, S as ScrubResult, n as SqlDriver, o as SqlTx, p as buildRouteTable, q as createApp, r as createLazyTransaction, s as createOps, t as createRequestDatabase, u as effectiveAuth, v as hostAllowed, w as installEgressFence, i as isDeclarationRefused, x as loadConfig, y as makeMemoryCache, z as matchRoute, F as quoteIdent, G as scrubSecrets, H as withTables } from '../index-DLveQoOf.cjs';
|
|
3
3
|
import '../db/env.cjs';
|
|
4
4
|
import '../stack.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'node:async_hooks';
|
|
7
7
|
import '../module-Dl1KFVtc.cjs';
|
|
8
|
-
import '../registry-
|
|
8
|
+
import '../registry-DSTThhKf.cjs';
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '../index-
|
|
2
|
-
export { A as App, g as AuthVerifier, B as BootRefused, h as CreateAppOptions, D as DECLARATION_REFUSAL, a as DeclarationRefused, E as EgressPolicy, j as EngineConfig, M as ModuleClients, R as RateLimiter, k as RequestDatabase, l as RouteEntry, m as RuntimeHooks, S as ScrubResult, n as SqlDriver, o as SqlTx, p as buildRouteTable, q as createApp, r as createLazyTransaction, s as createOps, t as createRequestDatabase, u as effectiveAuth, v as hostAllowed, w as installEgressFence, i as isDeclarationRefused, x as loadConfig, y as makeMemoryCache, z as matchRoute, F as quoteIdent, G as scrubSecrets, H as withTables } from '../index-
|
|
1
|
+
import '../index-DMZG3kpo.js';
|
|
2
|
+
export { A as App, g as AuthVerifier, B as BootRefused, h as CreateAppOptions, D as DECLARATION_REFUSAL, a as DeclarationRefused, E as EgressPolicy, j as EngineConfig, M as ModuleClients, R as RateLimiter, k as RequestDatabase, l as RouteEntry, m as RuntimeHooks, S as ScrubResult, n as SqlDriver, o as SqlTx, p as buildRouteTable, q as createApp, r as createLazyTransaction, s as createOps, t as createRequestDatabase, u as effectiveAuth, v as hostAllowed, w as installEgressFence, i as isDeclarationRefused, x as loadConfig, y as makeMemoryCache, z as matchRoute, F as quoteIdent, G as scrubSecrets, H as withTables } from '../index-D-3duy8Y.js';
|
|
3
3
|
import '../db/env.js';
|
|
4
4
|
import '../stack.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'node:async_hooks';
|
|
7
7
|
import '../module-Dl1KFVtc.js';
|
|
8
|
-
import '../registry-
|
|
8
|
+
import '../registry-JjF5lcj4.js';
|
package/dist/engine/index.js
CHANGED
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
quoteIdent,
|
|
17
17
|
scrubSecrets,
|
|
18
18
|
withTables
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-C6COAB3E.js";
|
|
20
20
|
import {
|
|
21
21
|
DECLARATION_REFUSAL,
|
|
22
22
|
DeclarationRefused,
|
|
23
23
|
isDeclarationRefused
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
} from "../chunk-WWUG2QXF.js";
|
|
25
|
+
import "../chunk-TVCCR6SO.js";
|
|
26
26
|
import "../chunk-XOX6RFPZ.js";
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-SI4KGEM3.js";
|
|
28
|
+
import "../chunk-AAT5G7KY.js";
|
|
29
29
|
import "../chunk-KATPXCJ5.js";
|
|
30
30
|
export {
|
|
31
31
|
AuthVerifier,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DBClient, b as DBOps, T as TxPlanBody, c as TxPlanResponse, A as AuthSpec, C as CacheClient, a as RuntimeServices, _ as __runWithRuntime, d as __requestALS } from './index-
|
|
1
|
+
import { D as DBClient, b as DBOps, T as TxPlanBody, c as TxPlanResponse, A as AuthSpec, C as CacheClient, a as RuntimeServices, _ as __runWithRuntime, d as __requestALS } from './index-DMZG3kpo.js';
|
|
2
2
|
import { T as Token } from './module-Dl1KFVtc.js';
|
|
3
|
-
import { R as RouteMeta } from './registry-
|
|
3
|
+
import { R as RouteMeta } from './registry-JjF5lcj4.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* engine/config.ts — settings from the environment, and the gate that refuses
|
|
@@ -2257,7 +2257,7 @@ interface PalbaseFunctionsClient {
|
|
|
2257
2257
|
invoke<T = unknown>(fnName: string, options?: PalbaseInvokeOptions): Promise<PalbaseResult<T>>;
|
|
2258
2258
|
}
|
|
2259
2259
|
/**
|
|
2260
|
-
* Cross-user admin write surface, reached via `Flags
|
|
2260
|
+
* Cross-user admin write surface, reached via `Flags.$asService()`.
|
|
2261
2261
|
*
|
|
2262
2262
|
* These five methods set/clear overrides for an ARBITRARY user (named
|
|
2263
2263
|
* explicitly), so they bypass the current-request-user scope that `Flags.*`
|
|
@@ -2265,10 +2265,10 @@ interface PalbaseFunctionsClient {
|
|
|
2265
2265
|
* `Database` / `Database.$asService()` split: the privileged, cross-user path
|
|
2266
2266
|
* is moved OFF the default surface so it is greppable and intentional — a
|
|
2267
2267
|
* handler that calls `Flags.setOverrideForUser(...)` on the default surface is
|
|
2268
|
-
* a compile error and must reach for `Flags
|
|
2268
|
+
* a compile error and must reach for `Flags.$asService()` first.
|
|
2269
2269
|
*
|
|
2270
2270
|
* @example
|
|
2271
|
-
* await Flags
|
|
2271
|
+
* await Flags.$asService().setOverrideForUser("user_123", "new_checkout", true);
|
|
2272
2272
|
*/
|
|
2273
2273
|
interface PalbaseFlagsServiceClient {
|
|
2274
2274
|
/**
|
|
@@ -2331,7 +2331,7 @@ interface PalbaseFlagsClient {
|
|
|
2331
2331
|
* user until cleared.
|
|
2332
2332
|
*
|
|
2333
2333
|
* Errors when there is no signed-in user (an anonymous request); reach for
|
|
2334
|
-
* `Flags
|
|
2334
|
+
* `Flags.$asService().setOverrideForUser(userId, key, value)` to write a flag
|
|
2335
2335
|
* for an arbitrary (cross-user) target.
|
|
2336
2336
|
*
|
|
2337
2337
|
* @example
|
|
@@ -2341,8 +2341,12 @@ interface PalbaseFlagsClient {
|
|
|
2341
2341
|
/**
|
|
2342
2342
|
* Return the cross-user admin write surface ({@link PalbaseFlagsServiceClient}).
|
|
2343
2343
|
* Use sparingly and explicitly — the default `Flags.setOverride(...)` path is
|
|
2344
|
-
* bound to the current request user;
|
|
2345
|
-
*
|
|
2344
|
+
* bound to the current request user; this is how you write a flag override for
|
|
2345
|
+
* an ARBITRARY user. Mirrors `Database.$asService()`.
|
|
2346
|
+
*
|
|
2347
|
+
* NOT the name a handler writes: the ambient `Flags` singleton OMITS this
|
|
2348
|
+
* member and exposes `$asService()` instead — `Flags.asService()` still
|
|
2349
|
+
* type-checks there and THROWS, naming its replacement (H1).
|
|
2346
2350
|
*/
|
|
2347
2351
|
asService(): PalbaseFlagsServiceClient;
|
|
2348
2352
|
}
|
|
@@ -4035,12 +4039,17 @@ type EnvServiceDatabase = EnvSchemaSurface & {
|
|
|
4035
4039
|
}): Promise<Materialized<T>>;
|
|
4036
4040
|
};
|
|
4037
4041
|
/**
|
|
4038
|
-
* The typed-by-default Database surface: the
|
|
4039
|
-
* PLUS
|
|
4040
|
-
*
|
|
4042
|
+
* The typed-by-default Database surface: the `$`-prefixed string-keyed
|
|
4043
|
+
* `DBClient` ops PLUS one property per schema — `public` and every schema the
|
|
4044
|
+
* project declares — typed against the generated `palbase-env.d.ts`, a
|
|
4045
|
+
* `$transaction` that runs a whole plan in one request, and `$asService()` for
|
|
4041
4046
|
* the explicit RLS-bypass sibling.
|
|
4042
4047
|
*
|
|
4043
|
-
*
|
|
4048
|
+
* NOT `tables`: that intermediate layer was removed (FR-001) and this sentence
|
|
4049
|
+
* outlived it by two majors, teaching a spelling that is TS2339. Pinned in
|
|
4050
|
+
* `src/database-ambient.test-d.ts`.
|
|
4051
|
+
*
|
|
4052
|
+
* The low-level `txPlan` op is deliberately NOT re-exposed here: `$transaction`
|
|
4044
4053
|
* is the surface, and a hand-built plan would bypass the ref/guard machinery
|
|
4045
4054
|
* that makes one safe to write.
|
|
4046
4055
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DBClient, b as DBOps, T as TxPlanBody, c as TxPlanResponse, A as AuthSpec, C as CacheClient, a as RuntimeServices, _ as __runWithRuntime, d as __requestALS } from './index-
|
|
1
|
+
import { D as DBClient, b as DBOps, T as TxPlanBody, c as TxPlanResponse, A as AuthSpec, C as CacheClient, a as RuntimeServices, _ as __runWithRuntime, d as __requestALS } from './index-DB_nW-AV.cjs';
|
|
2
2
|
import { T as Token } from './module-Dl1KFVtc.cjs';
|
|
3
|
-
import { R as RouteMeta } from './registry-
|
|
3
|
+
import { R as RouteMeta } from './registry-DSTThhKf.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* engine/config.ts — settings from the environment, and the gate that refuses
|
|
@@ -2257,7 +2257,7 @@ interface PalbaseFunctionsClient {
|
|
|
2257
2257
|
invoke<T = unknown>(fnName: string, options?: PalbaseInvokeOptions): Promise<PalbaseResult<T>>;
|
|
2258
2258
|
}
|
|
2259
2259
|
/**
|
|
2260
|
-
* Cross-user admin write surface, reached via `Flags
|
|
2260
|
+
* Cross-user admin write surface, reached via `Flags.$asService()`.
|
|
2261
2261
|
*
|
|
2262
2262
|
* These five methods set/clear overrides for an ARBITRARY user (named
|
|
2263
2263
|
* explicitly), so they bypass the current-request-user scope that `Flags.*`
|
|
@@ -2265,10 +2265,10 @@ interface PalbaseFunctionsClient {
|
|
|
2265
2265
|
* `Database` / `Database.$asService()` split: the privileged, cross-user path
|
|
2266
2266
|
* is moved OFF the default surface so it is greppable and intentional — a
|
|
2267
2267
|
* handler that calls `Flags.setOverrideForUser(...)` on the default surface is
|
|
2268
|
-
* a compile error and must reach for `Flags
|
|
2268
|
+
* a compile error and must reach for `Flags.$asService()` first.
|
|
2269
2269
|
*
|
|
2270
2270
|
* @example
|
|
2271
|
-
* await Flags
|
|
2271
|
+
* await Flags.$asService().setOverrideForUser("user_123", "new_checkout", true);
|
|
2272
2272
|
*/
|
|
2273
2273
|
interface PalbaseFlagsServiceClient {
|
|
2274
2274
|
/**
|
|
@@ -2331,7 +2331,7 @@ interface PalbaseFlagsClient {
|
|
|
2331
2331
|
* user until cleared.
|
|
2332
2332
|
*
|
|
2333
2333
|
* Errors when there is no signed-in user (an anonymous request); reach for
|
|
2334
|
-
* `Flags
|
|
2334
|
+
* `Flags.$asService().setOverrideForUser(userId, key, value)` to write a flag
|
|
2335
2335
|
* for an arbitrary (cross-user) target.
|
|
2336
2336
|
*
|
|
2337
2337
|
* @example
|
|
@@ -2341,8 +2341,12 @@ interface PalbaseFlagsClient {
|
|
|
2341
2341
|
/**
|
|
2342
2342
|
* Return the cross-user admin write surface ({@link PalbaseFlagsServiceClient}).
|
|
2343
2343
|
* Use sparingly and explicitly — the default `Flags.setOverride(...)` path is
|
|
2344
|
-
* bound to the current request user;
|
|
2345
|
-
*
|
|
2344
|
+
* bound to the current request user; this is how you write a flag override for
|
|
2345
|
+
* an ARBITRARY user. Mirrors `Database.$asService()`.
|
|
2346
|
+
*
|
|
2347
|
+
* NOT the name a handler writes: the ambient `Flags` singleton OMITS this
|
|
2348
|
+
* member and exposes `$asService()` instead — `Flags.asService()` still
|
|
2349
|
+
* type-checks there and THROWS, naming its replacement (H1).
|
|
2346
2350
|
*/
|
|
2347
2351
|
asService(): PalbaseFlagsServiceClient;
|
|
2348
2352
|
}
|
|
@@ -4035,12 +4039,17 @@ type EnvServiceDatabase = EnvSchemaSurface & {
|
|
|
4035
4039
|
}): Promise<Materialized<T>>;
|
|
4036
4040
|
};
|
|
4037
4041
|
/**
|
|
4038
|
-
* The typed-by-default Database surface: the
|
|
4039
|
-
* PLUS
|
|
4040
|
-
*
|
|
4042
|
+
* The typed-by-default Database surface: the `$`-prefixed string-keyed
|
|
4043
|
+
* `DBClient` ops PLUS one property per schema — `public` and every schema the
|
|
4044
|
+
* project declares — typed against the generated `palbase-env.d.ts`, a
|
|
4045
|
+
* `$transaction` that runs a whole plan in one request, and `$asService()` for
|
|
4041
4046
|
* the explicit RLS-bypass sibling.
|
|
4042
4047
|
*
|
|
4043
|
-
*
|
|
4048
|
+
* NOT `tables`: that intermediate layer was removed (FR-001) and this sentence
|
|
4049
|
+
* outlived it by two majors, teaching a spelling that is TS2339. Pinned in
|
|
4050
|
+
* `src/database-ambient.test-d.ts`.
|
|
4051
|
+
*
|
|
4052
|
+
* The low-level `txPlan` op is deliberately NOT re-exposed here: `$transaction`
|
|
4044
4053
|
* is the surface, and a hand-built plan would bypass the ref/guard machinery
|
|
4045
4054
|
* that makes one safe to write.
|
|
4046
4055
|
*/
|