@pgxsinkit/server 0.1.32 → 0.1.36
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/README.md +12 -0
- package/bin/pgxsinkit-generate.mjs +25 -0
- package/dist/cli/generate.d.ts +14 -2
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/electric-proxy.d.ts +30 -2
- package/dist/electric-proxy.d.ts.map +1 -1
- package/dist/index.d.ts +56 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3935 -936
- package/dist/index.js.map +40 -25
- package/dist/migrations/utilities.d.ts +13 -0
- package/dist/migrations/utilities.d.ts.map +1 -0
- package/dist/mutations/plpgsql-apply.d.ts +36 -0
- package/dist/mutations/plpgsql-apply.d.ts.map +1 -0
- package/dist/mutations/route.d.ts +64 -0
- package/dist/mutations/route.d.ts.map +1 -0
- package/dist/mutations/types.d.ts +4 -0
- package/dist/mutations/types.d.ts.map +1 -0
- package/dist/operations-log/ddl.d.ts +6 -0
- package/dist/operations-log/ddl.d.ts.map +1 -1
- package/dist/operations-log/schema.d.ts +2 -32
- package/dist/operations-log/schema.d.ts.map +1 -1
- package/dist/operations-log/types.d.ts +1 -5
- package/dist/operations-log/types.d.ts.map +1 -1
- package/dist/operations-log/writer.d.ts.map +1 -1
- package/dist/router.d.ts +22 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/sql-state.d.ts +23 -0
- package/dist/sql-state.d.ts.map +1 -0
- package/package.json +11 -6
- package/skills/deploying/SKILL.md +162 -0
- package/src/cli/generate.ts +292 -21
- package/src/electric-proxy.ts +274 -42
- package/src/index.ts +146 -59
- package/src/migrations/utilities.ts +25 -0
- package/src/mutations/plpgsql-apply.ts +658 -0
- package/src/mutations/route.ts +1176 -0
- package/src/mutations/{bulk/types.ts → types.ts} +0 -2
- package/src/operations-log/ddl.ts +13 -3
- package/src/operations-log/schema.ts +9 -6
- package/src/operations-log/types.ts +1 -7
- package/src/operations-log/writer.ts +0 -2
- package/src/router.ts +109 -0
- package/src/sql-state.ts +59 -0
- package/dist/mutations/bulk/plpgsql-strategy.d.ts +0 -17
- package/dist/mutations/bulk/plpgsql-strategy.d.ts.map +0 -1
- package/dist/mutations/bulk/route.d.ts +0 -7
- package/dist/mutations/bulk/route.d.ts.map +0 -1
- package/dist/mutations/bulk/types.d.ts +0 -5
- package/dist/mutations/bulk/types.d.ts.map +0 -1
- package/src/mutations/bulk/plpgsql-strategy.ts +0 -370
- package/src/mutations/bulk/route.ts +0 -580
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import { sql } from "drizzle-orm";
|
|
1
|
+
import { getTableName, sql } from "drizzle-orm";
|
|
2
2
|
import type { PgAsyncDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
3
3
|
|
|
4
4
|
import type { RegistryRelations, SyncTableRegistry } from "@pgxsinkit/contracts";
|
|
5
5
|
|
|
6
|
+
import { operationsLogTable } from "./schema";
|
|
6
7
|
import type { OperationsLogConfig } from "./types";
|
|
7
8
|
|
|
8
9
|
type OperationsLogPresenceRow = {
|
|
9
10
|
tableName: string | null;
|
|
10
11
|
};
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* The `to_regclass` presence-probe target, derived from the real pgTable so the probe (and the
|
|
15
|
+
* warning below) track a rename of `operationsLogTable`. Exported for the integration suite that
|
|
16
|
+
* asserts the degraded no-log path against the same identity.
|
|
17
|
+
*/
|
|
18
|
+
export function operationsLogRegclassTarget(): string {
|
|
19
|
+
return `public.${getTableName(operationsLogTable)}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
12
22
|
/**
|
|
13
23
|
* Ensures the operations_log table exists in the database.
|
|
14
24
|
*
|
|
@@ -26,14 +36,14 @@ export async function ensureOperationsLogSchema<TRegistry extends SyncTableRegis
|
|
|
26
36
|
|
|
27
37
|
try {
|
|
28
38
|
const result = await db.execute<OperationsLogPresenceRow>(sql`
|
|
29
|
-
SELECT to_regclass(
|
|
39
|
+
SELECT to_regclass(${operationsLogRegclassTarget()})::text AS "tableName"
|
|
30
40
|
`);
|
|
31
41
|
|
|
32
42
|
const row = Array.from(result as Iterable<unknown>, (entry) => entry as OperationsLogPresenceRow)[0];
|
|
33
43
|
|
|
34
44
|
if (!row?.tableName) {
|
|
35
45
|
console.warn(
|
|
36
|
-
|
|
46
|
+
`${getTableName(operationsLogTable)} table is missing. Add operationsLogTable from @pgxsinkit/server ` +
|
|
37
47
|
"to your Drizzle schema and run drizzle-kit generate/push to create it. " +
|
|
38
48
|
"Operation logging will be disabled until the table exists.",
|
|
39
49
|
);
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { sql } from "drizzle-orm";
|
|
2
1
|
import { bigint, bigserial, index, integer, jsonb, pgTable, text, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import { clockMicrosecondsSql } from "@pgxsinkit/contracts";
|
|
5
4
|
|
|
6
5
|
export const operationsLogTable = pgTable(
|
|
7
6
|
"operations_log",
|
|
8
7
|
{
|
|
9
8
|
id: bigserial("id", { mode: "number" }).primaryKey(),
|
|
10
|
-
source: varchar("source", { length: 24 }).notNull(),
|
|
11
|
-
backend: varchar("backend", { length: 24 }).notNull(),
|
|
12
9
|
tableName: varchar("table_name", { length: 255 }),
|
|
13
10
|
operationKind: varchar("operation_kind", { length: 24 }),
|
|
14
11
|
userId: uuid("user_id"),
|
|
@@ -17,11 +14,17 @@ export const operationsLogTable = pgTable(
|
|
|
17
14
|
status: varchar("status", { length: 32 }).notNull(),
|
|
18
15
|
errorMessage: text("error_message"),
|
|
19
16
|
httpStatus: integer("http_status"),
|
|
20
|
-
|
|
17
|
+
// Text, NOT uuid: derived child envelopes (the expander tier) carry composite non-UUID ids of the
|
|
18
|
+
// form `${parentMutationId}:<tag>:<n>`, so the log column must accept any string the apply path may
|
|
19
|
+
// record. This is the server-side tier of the two-tier mutation-id invariant (see plpgsql-apply.ts
|
|
20
|
+
// and packages/contracts/src/mutation.ts): the apply function + this log accept opaque text for a
|
|
21
|
+
// direct caller deriving children, while pgxsinkit's public surface (route schemas, client journal)
|
|
22
|
+
// stays UUID-only. (The ::uuid casts on this id were dropped for the same reason.)
|
|
23
|
+
mutationId: text("mutation_id"),
|
|
21
24
|
mutationSeq: integer("mutation_seq"),
|
|
22
25
|
clientTimestampUs: bigint("client_timestamp_us", { mode: "bigint" }),
|
|
23
26
|
requestPath: text("request_path"),
|
|
24
|
-
serverTimestampUs: bigint("server_timestamp_us", { mode: "bigint" }).notNull().default(
|
|
27
|
+
serverTimestampUs: bigint("server_timestamp_us", { mode: "bigint" }).notNull().default(clockMicrosecondsSql),
|
|
25
28
|
createdAt: timestamp("created_at", { mode: "date", withTimezone: true }).notNull().defaultNow(),
|
|
26
29
|
},
|
|
27
30
|
(table) => [
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import type { SQLWrapper } from "drizzle-orm";
|
|
2
2
|
import type { AnyPgTable } from "drizzle-orm/pg-core";
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
export type OpsLogBackend = "bulk-plpgsql-artifact";
|
|
7
|
-
|
|
8
|
-
export type OpsLogStatus = "succeeded" | "validation_failed" | "not_found" | "execution_failed";
|
|
4
|
+
export type OpsLogStatus = "succeeded" | "validation_failed" | "not_found" | "execution_failed" | "conflicted";
|
|
9
5
|
|
|
10
6
|
export interface OperationsLogConfig {
|
|
11
7
|
enabled: boolean;
|
|
12
8
|
}
|
|
13
9
|
|
|
14
10
|
export interface OpsLogEntry {
|
|
15
|
-
source: OpsLogSource;
|
|
16
|
-
backend: OpsLogBackend;
|
|
17
11
|
tableName?: string | null;
|
|
18
12
|
operationKind?: "create" | "update" | "delete" | null;
|
|
19
13
|
userId?: string | null;
|
|
@@ -27,8 +27,6 @@ export async function logOperation(
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
await executor.insert(operationsLogTable).values({
|
|
30
|
-
source: entry.source,
|
|
31
|
-
backend: entry.backend,
|
|
32
30
|
tableName: entry.tableName ?? null,
|
|
33
31
|
operationKind: entry.operationKind ?? null,
|
|
34
32
|
userId: entry.userId ?? null,
|
package/src/router.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// A tiny web-standard `fetch` router for the pgxsinkit server (ADR-0017). The server needs only
|
|
2
|
+
// exact-path GET/POST routing, a small CORS layer, and an error boundary, so a focused router keeps
|
|
3
|
+
// `@pgxsinkit/server` dependency-light and runnable on any `fetch` runtime — no web framework required.
|
|
4
|
+
// `proxyElectricShapeRequest` and the mutation handler are plain `(Request) => Response` functions, so
|
|
5
|
+
// they can equally be mounted in someone else's framework.
|
|
6
|
+
|
|
7
|
+
export type FetchHandler = (request: Request) => Response | Promise<Response>;
|
|
8
|
+
|
|
9
|
+
export interface CorsConfig {
|
|
10
|
+
origins: string[];
|
|
11
|
+
allowMethods: string[];
|
|
12
|
+
allowHeaders: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** A CORS scope is matched either by exact pathname or by pathname prefix (e.g. `/api/`). */
|
|
16
|
+
export type CorsScope = { exact: string } | { prefix: string };
|
|
17
|
+
|
|
18
|
+
export type RouterErrorHandler = (error: unknown, request: Request) => Response | Promise<Response>;
|
|
19
|
+
|
|
20
|
+
export class FetchRouter {
|
|
21
|
+
readonly #routes = new Map<string, FetchHandler>();
|
|
22
|
+
#cors: CorsConfig | undefined;
|
|
23
|
+
#corsMatchers: Array<(pathname: string) => boolean> = [];
|
|
24
|
+
#onError: RouterErrorHandler | undefined;
|
|
25
|
+
|
|
26
|
+
get(path: string, handler: FetchHandler): void {
|
|
27
|
+
this.#routes.set(`GET ${path}`, handler);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
post(path: string, handler: FetchHandler): void {
|
|
31
|
+
this.#routes.set(`POST ${path}`, handler);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
setCors(config: CorsConfig, scopes: CorsScope[]): void {
|
|
35
|
+
this.#cors = config;
|
|
36
|
+
this.#corsMatchers = scopes.map((scope) =>
|
|
37
|
+
"exact" in scope
|
|
38
|
+
? (pathname: string) => pathname === scope.exact
|
|
39
|
+
: (pathname: string) => pathname.startsWith(scope.prefix),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setErrorHandler(handler: RouterErrorHandler): void {
|
|
44
|
+
this.#onError = handler;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
readonly fetch = async (request: Request): Promise<Response> => {
|
|
48
|
+
const pathname = new URL(request.url).pathname;
|
|
49
|
+
const corsApplies = this.#cors !== undefined && this.#corsMatchers.some((matches) => matches(pathname));
|
|
50
|
+
|
|
51
|
+
// A preflight short-circuits before routing, exactly as a CORS middleware mounted on the scope would.
|
|
52
|
+
if (request.method === "OPTIONS" && corsApplies) {
|
|
53
|
+
return this.#preflight(request);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let response: Response;
|
|
57
|
+
const handler = this.#routes.get(`${request.method} ${pathname}`);
|
|
58
|
+
if (handler) {
|
|
59
|
+
try {
|
|
60
|
+
response = await handler(request);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (!this.#onError) {
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
response = await this.#onError(error, request);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
response = new Response("Not Found", { status: 404 });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return corsApplies ? this.#withCorsHeaders(request, response) : response;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
#allowedOrigin(request: Request): string | null {
|
|
75
|
+
const origin = request.headers.get("origin");
|
|
76
|
+
return origin && this.#cors?.origins.includes(origin) ? origin : null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#preflight(request: Request): Response {
|
|
80
|
+
const headers = new Headers();
|
|
81
|
+
const origin = this.#allowedOrigin(request);
|
|
82
|
+
if (origin) {
|
|
83
|
+
headers.set("Access-Control-Allow-Origin", origin);
|
|
84
|
+
headers.append("Vary", "Origin");
|
|
85
|
+
}
|
|
86
|
+
if (this.#cors) {
|
|
87
|
+
headers.set("Access-Control-Allow-Methods", this.#cors.allowMethods.join(","));
|
|
88
|
+
// Echo what the browser asks to send (e.g. a deployment gateway's `apikey` alongside the
|
|
89
|
+
// toolkit's `Authorization`), falling back to the declared list — so a client header the app
|
|
90
|
+
// legitimately sets is never rejected just because it wasn't enumerated here.
|
|
91
|
+
headers.set(
|
|
92
|
+
"Access-Control-Allow-Headers",
|
|
93
|
+
request.headers.get("access-control-request-headers") ?? this.#cors.allowHeaders.join(","),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return new Response(null, { status: 204, headers });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
#withCorsHeaders(request: Request, response: Response): Response {
|
|
100
|
+
const origin = this.#allowedOrigin(request);
|
|
101
|
+
if (!origin) {
|
|
102
|
+
return response;
|
|
103
|
+
}
|
|
104
|
+
const headers = new Headers(response.headers);
|
|
105
|
+
headers.set("Access-Control-Allow-Origin", origin);
|
|
106
|
+
headers.append("Vary", "Origin");
|
|
107
|
+
return new Response(response.body, { status: response.status, statusText: response.statusText, headers });
|
|
108
|
+
}
|
|
109
|
+
}
|
package/src/sql-state.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the Postgres `SQLSTATE` (the five-character error class, e.g. `"23505"` unique_violation) off a
|
|
3
|
+
* thrown database error.
|
|
4
|
+
*
|
|
5
|
+
* **Why this helper exists — the bun-sql gotcha.** Bun's built-in `SQL`/`sql` driver (what pgxsinkit and
|
|
6
|
+
* its consumers run against Postgres) surfaces the server's SQLSTATE on the error's **`errno`** property.
|
|
7
|
+
* Its **`code`** property is bun's own generic string (`"ERR_POSTGRES_SERVER_ERROR"`), NOT the SQLSTATE —
|
|
8
|
+
* so the intuitive `error.code` read (which worked under `postgres.js` / `pg`, where `code` carried the
|
|
9
|
+
* SQLSTATE) silently returns the wrong thing under bun-sql. Consumers reaching for a stable, driver-agnostic
|
|
10
|
+
* SQLSTATE (to map `23505`→"already exists", `P0001`→a raised app rule, etc.) kept re-deriving this by hand;
|
|
11
|
+
* this is the one canonical extraction.
|
|
12
|
+
*
|
|
13
|
+
* Resolution order, returning the first well-formed SQLSTATE found:
|
|
14
|
+
* 1. `errno` on the error (bun-sql),
|
|
15
|
+
* 2. `code` on the error (postgres.js / node-postgres, and any driver that follows that convention),
|
|
16
|
+
* 3. the same two properties walked down the `cause` chain (a wrapped/re-thrown error).
|
|
17
|
+
*
|
|
18
|
+
* A "well-formed" SQLSTATE is exactly five characters of `[0-9A-Z]` — this is what rejects bun's generic
|
|
19
|
+
* `code` string, an `errno` that is a numeric OS errno, and any other non-SQLSTATE noise. A non-object
|
|
20
|
+
* error (string, number, `null`, `undefined`) yields `undefined`.
|
|
21
|
+
*/
|
|
22
|
+
export function readSqlState(error: unknown): string | undefined {
|
|
23
|
+
// Guard against a self-referential (or pathologically deep) `cause` chain — walk a bounded number of
|
|
24
|
+
// links, never a `while (true)`.
|
|
25
|
+
const MAX_CAUSE_DEPTH = 16;
|
|
26
|
+
|
|
27
|
+
let current: unknown = error;
|
|
28
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH; depth++) {
|
|
29
|
+
if (!current || typeof current !== "object") {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const candidate = current as { errno?: unknown; code?: unknown; cause?: unknown };
|
|
34
|
+
|
|
35
|
+
// bun-sql: SQLSTATE on `errno`. postgres.js / pg: SQLSTATE on `code`. Prefer `errno`, fall back to
|
|
36
|
+
// `code`, and accept only a value that is actually shaped like a SQLSTATE.
|
|
37
|
+
const fromErrno = asSqlState(candidate.errno);
|
|
38
|
+
if (fromErrno !== undefined) {
|
|
39
|
+
return fromErrno;
|
|
40
|
+
}
|
|
41
|
+
const fromCode = asSqlState(candidate.code);
|
|
42
|
+
if (fromCode !== undefined) {
|
|
43
|
+
return fromCode;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Not on this error — descend into a wrapped cause (Error.cause / a driver's nested original error).
|
|
47
|
+
if (candidate.cause === current) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
current = candidate.cause;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** A value is a SQLSTATE only if it is a string of exactly five `[0-9A-Z]` characters. */
|
|
57
|
+
function asSqlState(value: unknown): string | undefined {
|
|
58
|
+
return typeof value === "string" && /^[0-9A-Z]{5}$/u.test(value) ? value : undefined;
|
|
59
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type PgAsyncDatabase, type PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
2
|
-
import { type BatchMutationRequest, type RegistryRelations, type SyncTableRegistry } from "@pgxsinkit/contracts";
|
|
3
|
-
import type { TransactionClient } from "./types";
|
|
4
|
-
export declare function buildPlpgsqlBatchFunctionDdl(registry: SyncTableRegistry, options?: {
|
|
5
|
-
functionSchema?: string;
|
|
6
|
-
}): string;
|
|
7
|
-
export declare function installPlpgsqlBatchFunction<TRegistry extends SyncTableRegistry>(db: PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>, registry: TRegistry, options?: {
|
|
8
|
-
functionSchema?: string;
|
|
9
|
-
}): Promise<void>;
|
|
10
|
-
export declare function verifyPlpgsqlBatchFunction<TRegistry extends SyncTableRegistry>(db: PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>, options?: {
|
|
11
|
-
functionSchema?: string;
|
|
12
|
-
}): Promise<void>;
|
|
13
|
-
export declare function verifyArtifactRlsAuthHelpers<TRegistry extends SyncTableRegistry>(db: PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>): Promise<void>;
|
|
14
|
-
export declare function executePlpgsqlBatch(tx: TransactionClient, batch: BatchMutationRequest, requestPath: string, logEnabled: boolean, rlsEnabled: boolean, userClaims: Record<string, unknown>, options?: {
|
|
15
|
-
functionSchema?: string;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
//# sourceMappingURL=plpgsql-strategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plpgsql-strategy.d.ts","sourceRoot":"","sources":["../../../src/mutations/bulk/plpgsql-strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGnH,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAqJjD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,MAAM,CA8HR;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,0BAA0B,CAAC,SAAS,SAAS,iBAAiB,EAClF,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,EACnE,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,OAAO,CAAC,IAAI,CAAC,CAaf;AAMD,wBAAsB,4BAA4B,CAAC,SAAS,SAAS,iBAAiB,EACpF,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAClE,OAAO,CAAC,IAAI,CAAC,CAef;AAED,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,EACnC,OAAO,GAAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PgAsyncDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
2
|
-
import type { Hono } from "hono";
|
|
3
|
-
import type { JwtClaims, RegistryRelations, SyncTableRegistry } from "@pgxsinkit/contracts";
|
|
4
|
-
import type { OperationsLogConfig } from "../../operations-log/types";
|
|
5
|
-
import type { BulkMutationBackend } from "./types";
|
|
6
|
-
export declare function registerBulkMutationRoute<TRegistry extends SyncTableRegistry>(app: Hono, db: PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>, registry: TRegistry, backend: BulkMutationBackend, operationsLogConfig: OperationsLogConfig, operationsLogReady: Promise<void>, resolveAuthClaims?: (request: Request) => Promise<JwtClaims | null> | JwtClaims | null): void;
|
|
7
|
-
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/mutations/bulk/route.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG7E,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,EAEV,SAAS,EAET,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,SAAS,CAAC;AAQtE,wBAAgB,yBAAyB,CAAC,SAAS,SAAS,iBAAiB,EAC3E,GAAG,EAAE,IAAI,EACT,EAAE,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,EACnE,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,mBAAmB,EAC5B,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,QA8QvF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/mutations/bulk/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/C"}
|