@pgxsinkit/server 0.1.51 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"plpgsql-apply.d.ts","sourceRoot":"","sources":["../../src/mutations/plpgsql-apply.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGnH,OAAO,EAOL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAkgBjD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,MAAM,CAER;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,MAAM,CAUR;AAED,wBAAsB,2BAA2B,CAAC,SAAS,SAAS,iBAAiB,EACnF,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,EACnE,QAAQ,EAAE,SAAS,EACnB,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,OAAO,CAAC,IAAI,CAAC,CAGf;AAMD,wBAAsB,oBAAoB,CAAC,SAAS,SAAS,iBAAiB,EAC5E,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAClE,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CA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Gf;AAMD,wBAAsB,oBAAoB,CAAC,SAAS,SAAS,iBAAiB,EAC5E,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAClE,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAQD,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAE,oBAAoB,EAC3B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAKnC,mBAAmB,EAAE,MAAM,EAC3B,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA0B7B"}
@@ -11,9 +11,9 @@ import type { FetchHandler } from "../router";
11
11
  * worker sends ZERO queries before the mutation transaction itself.
12
12
  */
13
13
  export type StartupVerificationMode = "in-process" | "deploy-time";
14
- export declare const batchMutationPaths: readonly ["/api/mutations", "/mutations"];
14
+ export declare const batchMutationPaths: readonly ["/api/mutations"];
15
15
  /** The authoritative (pessimistic) write endpoint (ADR-0022 §3): one atomic write-unit per POST. */
16
- export declare const authoritativeMutationPaths: readonly ["/api/mutations/unit", "/mutations/unit"];
16
+ export declare const authoritativeMutationPaths: readonly ["/api/mutations/unit"];
17
17
  export declare function createMutationHandler<TRegistry extends SyncTableRegistry>(db: PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>, registry: TRegistry, operationsLogConfig: OperationsLogConfig, operationsLogReady: Promise<void>, resolveAuthClaims?: (request: Request) => Promise<JwtClaims | null> | JwtClaims | null, startupVerification?: StartupVerificationMode, logTimings?: boolean): {
18
18
  batch: FetchHandler;
19
19
  authoritative: FetchHandler;
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/mutations/route.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI7E,OAAO,KAAK,EAEV,oBAAoB,EACpB,SAAS,EAET,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAU9C;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,aAAa,CAAC;AAQnE,eAAO,MAAM,kBAAkB,YAAI,gBAAgB,EAAE,YAAY,CAAU,CAAC;AAC5E,oGAAoG;AACpG,eAAO,MAAM,0BAA0B,YAAI,qBAAqB,EAAE,iBAAiB,CAAU,CAAC;AAE9F,wBAAgB,qBAAqB,CAAC,SAAS,SAAS,iBAAiB,EACvE,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,EACnE,QAAQ,EAAE,SAAS,EACnB,mBAAmB,EAAE,mBAAmB,EACxC,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,EACjC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,EACtF,mBAAmB,GAAE,uBAAsC,EAC3D,UAAU,UAAQ,GACjB;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,aAAa,EAAE,YAAY,CAAA;CAAE,CAwpBtD;AAqCD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAmD9D;AA+ED;;;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,EAC3D,UAAU,UAAQ,GACjB;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,aAAa,EAAE,YAAY,CAAA;CAAE,CAwpBtD;AAqCD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAmD9D;AA+ED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAC/D,OAAO,EAAE,OAAO,GACf,IAAI,CA0DN;AAmED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,cAAc;;GAYhE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgxsinkit/server",
3
- "version": "0.1.51",
3
+ "version": "0.2.0",
4
4
  "keywords": [
5
5
  "tanstack-intent"
6
6
  ],
@@ -31,7 +31,7 @@
31
31
  "build": "bun --cwd ../.. run build:public-packages"
32
32
  },
33
33
  "dependencies": {
34
- "@pgxsinkit/contracts": "0.1.51"
34
+ "@pgxsinkit/contracts": "0.2.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "drizzle-orm": "1.0.0-rc.4"
@@ -11,7 +11,7 @@ description: >-
11
11
  metadata:
12
12
  type: task
13
13
  library: "@pgxsinkit/server"
14
- library_version: "0.1.51"
14
+ library_version: "0.2.0"
15
15
  source: https://pgxsinkit.github.io/start/deploying-the-server/
16
16
  ---
17
17
 
@@ -34,14 +34,14 @@ any framework you chose) inlines.
34
34
 
35
35
  ## 2. Strip the function-name path prefix before `server.fetch`
36
36
 
37
- Edge Functions route by the first path segment, so a POST to `/functions/v1/write` arrives as `/write`.
38
- The mutation route is served at `/mutations` (and `/api/mutations`), deployment-name-agnostic by design —
39
- rewrite the path first, exactly as a reverse proxy would:
37
+ Edge Functions route by the first path segment, so a POST to `/functions/v1/write/api/mutations`
38
+ arrives as `/write/api/mutations`. Strip only the function-name prefix so the server receives the
39
+ canonical `/api/mutations` path:
40
40
 
41
41
  ```ts
42
42
  Deno.serve((request) => {
43
43
  const url = new URL(request.url);
44
- url.pathname = "/mutations"; // /write or /write/... -> /mutations
44
+ url.pathname = url.pathname.replace(/^\/write(?=\/|$)/, "") || "/";
45
45
  return server.fetch(new Request(url, request));
46
46
  });
47
47
  ```
@@ -154,7 +154,7 @@ detail live in the `operating` skill.
154
154
  function and column DEFAULTs call `public.pgxsinkit_clock_us()`, so migrate fails with an
155
155
  undefined-function error. Generate it first (`--utilities`).
156
156
  - Shipping toolkit source to Deno without bundling, or leaving builtins un-prefixed (not `node:*`).
157
- - Forgetting the path rewrite, so `/mutations` 404s behind the function name.
157
+ - Forgetting to strip the function-name prefix, so `/write/api/mutations` 404s.
158
158
  - Verifying the JWT only at the gateway instead of in `resolveAuthClaims` (non-portable).
159
159
  - A sync function timeout below Electric's ~25s long-poll (constant read-path reconnects).
160
160
  - Omitting `cache-control: no-store` on a same-origin shape proxy.
@@ -33,7 +33,8 @@ export interface ElectricProxyOptions {
33
33
  /**
34
34
  * Opt-in per-request timing log (default off). When on, each forwarded shape request emits one compact
35
35
  * `[pgxsinkit-timing]` line (route `"shape"`) with the request's table/live/offset and the upstream
36
- * Electric fetch duration + status, for attributing read-path latency. Additive; no behaviour change.
36
+ * Electric fetch duration + status, for attributing read-path latency. Off by default — a pure
37
+ * diagnostic surface that adds no standing query or latency when unset.
37
38
  */
38
39
  logTimings?: boolean;
39
40
  /**
package/src/index.ts CHANGED
@@ -37,8 +37,9 @@ interface BunNamespace {
37
37
 
38
38
  /**
39
39
  * How the operations-log table's presence is resolved at startup (ADR-0030 decision 3):
40
- * - `"probe"` (default): today's behavior — one query ensures/confirms the table, and logging is
41
- * disabled at runtime (with a warning) if it is absent. Preserves the documented degradation.
40
+ * - `"probe"` (default): the safe degradation posture (ADR-0030) — one query ensures/confirms the table,
41
+ * and logging is disabled at runtime (with a warning) if it is absent, so a missing table degrades
42
+ * gracefully instead of failing writes.
42
43
  * - `"enabled"`: assume the table exists — NO query. If it is actually absent, writes then fail loudly.
43
44
  * - `"disabled"`: turn logging off with NO query.
44
45
  *
@@ -49,8 +50,9 @@ export type OperationsLogStartupMode = "probe" | "enabled" | "disabled";
49
50
 
50
51
  /**
51
52
  * The `deployment` profile owns the server's startup query posture (ADR-0030 decision 3). Its defaults
52
- * preserve today's behavior exactly, so long-lived hosts need not set it; serverless / per-request
53
- * workers set `{ startupVerification: "deploy-time", operationsLog: "enabled" | "disabled" }` for a
53
+ * are the safe degradation posture — probe-and-verify at startup — so a long-lived host that never sets
54
+ * it still verifies and degrades gracefully; serverless / per-request workers set
55
+ * `{ startupVerification: "deploy-time", operationsLog: "enabled" | "disabled" }` for a
54
56
  * zero-startup-query first write.
55
57
  */
56
58
  export interface DeploymentProfile {
@@ -94,13 +96,14 @@ export interface CreateSyncServerOptions<
94
96
  * The startup query posture (ADR-0030). The apply function now verifies its own ADR-0018 fingerprint
95
97
  * in-body on every call (SQLSTATE `PXS01` on drift), so there is no startup drift check to configure;
96
98
  * this governs only the RLS auth-helper verify and the operations-log presence resolution. Defaults
97
- * preserve today's behavior. See {@link DeploymentProfile}.
99
+ * are the safe degradation posture (ADR-0030). See {@link DeploymentProfile}.
98
100
  */
99
101
  deployment?: DeploymentProfile;
100
102
  /**
101
103
  * Opt-in per-request timing log (default false). When on, each mutation and shape-proxy request emits
102
104
  * one compact `[pgxsinkit-timing]` line with an ISO-8601(ms, UTC) timestamp and phase durations, for
103
- * attributing wall-clock latency against the client's `syncDebug` lines. Additive; no behaviour change.
105
+ * attributing wall-clock latency against the client's `syncDebug` lines. Off by default — a pure
106
+ * diagnostic surface that adds no standing query or latency when unset.
104
107
  */
105
108
  logTimings?: boolean;
106
109
  }
@@ -170,9 +173,8 @@ export function createSyncServer<
170
173
 
171
174
  const shapeProxyPath = options.shapeProxyPath ?? "/api/shape";
172
175
 
173
- // CORS mirrors the previous middleware scopes: everything under /api/*, the /mutations alias, and
174
- // the shape proxy path (which may be relocated outside /api/).
175
- const corsScopes: CorsScope[] = [{ prefix: "/api/" }, { exact: "/mutations" }];
176
+ // CORS covers the canonical /api/* routes and the shape proxy path when it is relocated outside /api/.
177
+ const corsScopes: CorsScope[] = [{ prefix: "/api/" }];
176
178
  if (options.electricUrl) {
177
179
  corsScopes.push({ exact: shapeProxyPath });
178
180
  }
@@ -204,7 +206,7 @@ export function createSyncServer<
204
206
  router.get(healthCheckPath, () => Response.json({ ok: true }));
205
207
  }
206
208
 
207
- // The single mutation ingress point — all writes go through POST /api/mutations (and the /mutations alias).
209
+ // The single mutation ingress point — all writes go through POST /api/mutations.
208
210
  const mutationHandlers = createMutationHandler(
209
211
  db,
210
212
  options.registry,
@@ -310,11 +310,10 @@ function buildTableBranch(entry: SyncTableEntry): string {
310
310
  const APPLY_FUNCTION_NAME = "pgxsinkit_apply_mutations";
311
311
  // ADR-0030: the trailing `text` is `p_expected_fingerprint` — the running server passes the fingerprint
312
312
  // it expects for its registry + codegen, and the function verifies itself against its stamped comment
313
- // before touching any table. The previous (pre-ADR-0030) signature dropped the trailing `text`.
313
+ // before touching any table.
314
314
  const APPLY_FUNCTION_ARG_TYPES = "jsonb, text, boolean, boolean, jsonb, text";
315
- const APPLY_FUNCTION_ARG_TYPES_LEGACY = "jsonb, text, boolean, boolean, jsonb";
316
- // ADR-0018: version-prefixed so the stored format can evolve; the reader parses the prefix and
317
- // treats an unknown prefix as "can't compare" (warn) rather than a mismatch (error).
315
+ // ADR-0018: the prefix namespaces the strict fingerprint format. Any absent or different prefix is
316
+ // an identity mismatch and the apply function refuses the write.
318
317
  const APPLY_FINGERPRINT_PREFIX = "pgxsinkit:fp1:";
319
318
 
320
319
  function buildApplyFunctionBody(
@@ -334,9 +333,8 @@ function buildApplyFunctionBody(
334
333
  const functionName = qualifyIdent(options.functionSchema, APPLY_FUNCTION_NAME);
335
334
 
336
335
  return `
337
- -- ADR-0015: the function now RETURNS the per-mutation conflicts (a reject-if-stale stale write). A
338
- -- return-type change cannot be a bare CREATE OR REPLACE, so drop the prior (void-returning) signature
339
- -- first. Idempotent: re-running installs the same definition.
336
+ -- Install idempotently by dropping the current signature first. PostgreSQL cannot change a function's
337
+ -- return type through CREATE OR REPLACE, while a generated artifact must install its complete definition.
340
338
  --
341
339
  -- TWO-TIER MUTATION-ID INVARIANT. \`mutation_id\` is TEXT here (RETURNS TABLE + operations_log), not
342
340
  -- uuid, so this apply function can serve a DIRECT server-side caller that derives child envelopes with
@@ -346,11 +344,6 @@ function buildApplyFunctionBody(
346
344
  -- builds every ack from that request id, never from the TEXT conflict rows this returns. A non-UUID id
347
345
  -- therefore never crosses into the UUID-typed surface.
348
346
  --
349
- -- ADR-0030: the signature gained a trailing p_expected_fingerprint text, so the prior (pre-ADR-0030,
350
- -- 5-arg) function is a DIFFERENT overload — drop it too, else a CREATE of the 6-arg form would leave a
351
- -- stale 5-arg beside it. The runtime only ever calls the 6-arg form; dropping the legacy one keeps an
352
- -- in-place upgrade clean.
353
- DROP FUNCTION IF EXISTS ${functionName}(${APPLY_FUNCTION_ARG_TYPES_LEGACY});
354
347
  DROP FUNCTION IF EXISTS ${functionName}(${APPLY_FUNCTION_ARG_TYPES});
355
348
 
356
349
  CREATE OR REPLACE FUNCTION ${functionName}(
@@ -386,7 +379,7 @@ BEGIN
386
379
  -- ADR-0030: the apply function verifies ITSELF against its ADR-0018 fingerprint comment before it
387
380
  -- touches any table. p_expected_fingerprint is what the running server expects for its registry +
388
381
  -- codegen; obj_description(...) is the fingerprint this installed function was stamped with, atomically,
389
- -- by the same migration. A mismatch — INCLUDING an absent comment (a hand-installed / pre-fingerprint
382
+ -- by the same migration. A mismatch — INCLUDING an absent comment (an unstamped hand-installed
390
383
  -- function ⇒ NULL, refused per ADR-0030) — means the installed function is stale relative to the caller,
391
384
  -- so raise SQLSTATE 'PXS01' and apply nothing. The check IS the call (no read-then-call TOCTOU) and
392
385
  -- costs no extra round trip (the argument rides the existing invocation; the comparison is one text
@@ -49,9 +49,9 @@ const { createInsertSchema: createMutationInsertSchema } = createSchemaFactory({
49
49
 
50
50
  type RouteReadQueryClient = Pick<PgAsyncDatabase<PgQueryResultHKT, AnyRelations>, "select">;
51
51
 
52
- export const batchMutationPaths = ["/api/mutations", "/mutations"] as const;
52
+ export const batchMutationPaths = ["/api/mutations"] as const;
53
53
  /** The authoritative (pessimistic) write endpoint (ADR-0022 §3): one atomic write-unit per POST. */
54
- export const authoritativeMutationPaths = ["/api/mutations/unit", "/mutations/unit"] as const;
54
+ export const authoritativeMutationPaths = ["/api/mutations/unit"] as const;
55
55
 
56
56
  export function createMutationHandler<TRegistry extends SyncTableRegistry>(
57
57
  db: PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>,