better-supabase 0.0.0 → 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.
- package/LICENSE +21 -0
- package/README.md +88 -1
- package/bin/better-supabase.js +4 -0
- package/dist/casing-da0uRTqt.js +14 -0
- package/dist/claims-CoTobNC-.js +25 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +15 -0
- package/dist/cli/index.d.ts +226 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli-DrSgDOQC.js +6646 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +112 -0
- package/dist/compiler-CZ9nIuqy.d.ts +14 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +3 -0
- package/dist/config-ClDXmVtY.js +277 -0
- package/dist/define-BXMYD9AY.js +1071 -0
- package/dist/define-e3zI4_4g.d.ts +679 -0
- package/dist/edge/index.d.ts +43 -0
- package/dist/edge/index.js +103 -0
- package/dist/entitlements-CTEBm7IB.js +20 -0
- package/dist/entitlements-Dng-ctuT.d.ts +42 -0
- package/dist/env/index.d.ts +2 -0
- package/dist/env/index.js +2 -0
- package/dist/env-BEToab0I.js +204 -0
- package/dist/errors-Bl3rkOzo.js +196 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.js +2 -0
- package/dist/events-BuzTgn2D.js +135 -0
- package/dist/events-DOt3nSO-.d.ts +84 -0
- package/dist/executor-BYXQ9AGn.d.ts +25 -0
- package/dist/executor-CGdNQ27g.d.ts +195 -0
- package/dist/executor-DeppvirK.js +89 -0
- package/dist/guards-BnzDvFrz.js +10 -0
- package/dist/hono/index.d.ts +45 -0
- package/dist/hono/index.js +70 -0
- package/dist/index-Bw1bwtC0.d.ts +144 -0
- package/dist/index-CBDufH1M.d.ts +120 -0
- package/dist/index-CG69s15v.d.ts +38 -0
- package/dist/index-Ciu5Xlml.d.ts +74 -0
- package/dist/index-D4v7sncu.d.ts +62 -0
- package/dist/index-DOsjFvMf.d.ts +618 -0
- package/dist/index-DbxFr7XG.d.ts +76 -0
- package/dist/index-DuP14VHo.d.ts +216 -0
- package/dist/index-Dy6kuF0P.d.ts +71 -0
- package/dist/index-K-3WM2Hp.d.ts +117 -0
- package/dist/index.d.ts +110 -0
- package/dist/index.js +43 -0
- package/dist/invalidate-DbxuL2jL.js +18 -0
- package/dist/jobs/index.d.ts +173 -0
- package/dist/jobs/index.js +478 -0
- package/dist/json-schema-BpYqkCKf.js +182 -0
- package/dist/lint/index.d.ts +75 -0
- package/dist/lint/index.js +167 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +410 -0
- package/dist/live-D8rV1Ldw.js +168 -0
- package/dist/live-DJyZMD6w.d.ts +191 -0
- package/dist/logger-glM28NVN.js +21 -0
- package/dist/mcp/index.d.ts +142 -0
- package/dist/mcp/index.js +463 -0
- package/dist/mfa-CpLfJSde.js +541 -0
- package/dist/mfa-TVia554c.d.ts +44 -0
- package/dist/next/image/index.d.ts +34 -0
- package/dist/next/image/index.js +40 -0
- package/dist/next/index.d.ts +210 -0
- package/dist/next/index.js +427 -0
- package/dist/openapi/index.d.ts +2 -0
- package/dist/openapi/index.js +332 -0
- package/dist/orpc/index.d.ts +46 -0
- package/dist/orpc/index.js +50 -0
- package/dist/otel/index.d.ts +40 -0
- package/dist/otel/index.js +168 -0
- package/dist/path-Cv__-OTj.d.ts +17 -0
- package/dist/permdock-sql-CghlHPuH.js +117 -0
- package/dist/plugin-BqR6wKMB.js +23 -0
- package/dist/plugin-C4TR9J0Z.d.ts +118 -0
- package/dist/plugins/actor/index.d.ts +13 -0
- package/dist/plugins/actor/index.js +43 -0
- package/dist/plugins/rules/index.d.ts +89 -0
- package/dist/plugins/rules/index.js +167 -0
- package/dist/plugins/soft-delete/index.d.ts +38 -0
- package/dist/plugins/soft-delete/index.js +69 -0
- package/dist/plugins/tenant/index.d.ts +49 -0
- package/dist/plugins/tenant/index.js +75 -0
- package/dist/plugins/timestamps/index.d.ts +9 -0
- package/dist/plugins/timestamps/index.js +37 -0
- package/dist/plugins/validation/index.d.ts +24 -0
- package/dist/plugins/validation/index.js +59 -0
- package/dist/pool-R2m_DkXi.d.ts +37 -0
- package/dist/postgres/index.d.ts +28 -0
- package/dist/postgres/index.js +79 -0
- package/dist/postgrest-cAEQ_IQN.d.ts +43 -0
- package/dist/problem-BTkTtRV9.js +97 -0
- package/dist/problem-DlgB0lYl.d.ts +47 -0
- package/dist/query/index.d.ts +2 -0
- package/dist/query/index.js +3 -0
- package/dist/query-ChvDbsDE.js +186 -0
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.js +5 -0
- package/dist/react/server.d.ts +13 -0
- package/dist/react/server.js +25 -0
- package/dist/react/session.d.ts +2 -0
- package/dist/react/session.js +3 -0
- package/dist/react-C83BdBGt.js +242 -0
- package/dist/read-set-4lI3W_gZ.js +216 -0
- package/dist/realtime/index.d.ts +4 -0
- package/dist/realtime/index.js +268 -0
- package/dist/resolve-CjHILk2w.d.ts +170 -0
- package/dist/resource-BHEWmQJK.js +175 -0
- package/dist/resource-CgZa3YG_.d.ts +65 -0
- package/dist/respond-DMcbQwfN.js +383 -0
- package/dist/respond-Dne1ARSa.d.ts +169 -0
- package/dist/result-CTkCZ6JA.d.ts +198 -0
- package/dist/result-DWXatkd6.js +103 -0
- package/dist/scope-CDHcS7dE.js +90 -0
- package/dist/seed-CzecODcJ.js +101 -0
- package/dist/server/index.d.ts +42 -0
- package/dist/server/index.js +68 -0
- package/dist/session-C3LxnQ0e.d.ts +22 -0
- package/dist/session-CqEwzVup.js +20 -0
- package/dist/shared-_6-uPL7E.js +57 -0
- package/dist/simplify-bwJpLnaS.js +665 -0
- package/dist/spec-pins-C3oc-Tdp.js +20 -0
- package/dist/spec-pins-CqorWDnO.d.ts +20 -0
- package/dist/sql-DTjA1LPj.js +260 -0
- package/dist/ssr/index.d.ts +5 -0
- package/dist/ssr/index.js +4 -0
- package/dist/standard-CyhRzctb.d.ts +7 -0
- package/dist/standard-FUi3Z3-7.js +21 -0
- package/dist/stats-C5W-rBfR.js +566 -0
- package/dist/storage/index.d.ts +5 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage-DuGn38fr.js +527 -0
- package/dist/tables-rZxRxNPW.js +59 -0
- package/dist/template-mbvlysOo.d.ts +6 -0
- package/dist/testing/index.d.ts +325 -0
- package/dist/testing/index.js +819 -0
- package/dist/types-6cYK9pbJ.js +29 -0
- package/dist/types-C83v5SQz.d.ts +248 -0
- package/dist/version-Cqq1m3UY.js +4 -0
- package/dist/view-D1s0wa0T.d.ts +49 -0
- package/dist/view-aOYizTeE.js +36 -0
- package/dist/webhooks/index.d.ts +152 -0
- package/dist/webhooks/index.js +2 -0
- package/dist/webhooks-DMipjhSP.js +139 -0
- package/package.json +250 -17
- package/schemas/config-v1.json +373 -0
- package/schemas/doctor-report-v1.json +106 -0
- package/schemas/snapshot-v2.json +1006 -0
- package/skills/better-supabase/SKILL.md +84 -0
- package/skills/better-supabase/references/plugins.md +65 -0
- package/skills/better-supabase/references/troubleshooting.md +39 -0
- package/skills/better-supabase-api/SKILL.md +67 -0
- package/skills/better-supabase-api/references/adapters.md +108 -0
- package/skills/better-supabase-testing/SKILL.md +66 -0
- package/index.js +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { n as AnyModels, t as AnyFunctions } from "../types-C83v5SQz.js";
|
|
2
|
+
import { t as BetterSupabase, y as Db } from "../define-e3zI4_4g.js";
|
|
3
|
+
import { h as RequestContext } from "../plugin-C4TR9J0Z.js";
|
|
4
|
+
import { a as checkAal, c as impersonatorOf, i as amrOf, n as AmrEntry, o as ImpersonationOptions, r as aalOf, s as Impersonator, t as Aal } from "../mfa-TVia554c.js";
|
|
5
|
+
import { _ as readSession, a as ResolveAuthOptions, b as writeSession, c as clientIp, d as CookieOptions, f as CookieRecord, i as InvalidReason, l as resolveAuth, m as StoredSession, n as AuthResolver, o as ResolvedState, p as CookieWrite, r as AuthState, s as authContext, t as AuthResolution, u as AUTH_CACHE_HEADERS, y as sessionCookieName } from "../resolve-CjHILk2w.js";
|
|
6
|
+
import { _ as DeleteAccountResult, a as guard, c as settle, d as ServerContext, f as ServerOptions, g as DeleteAccountOptions, h as ReplicaState, i as Settled, l as BetterServer, m as PRIMARY_COOKIE, n as GuardOptions, o as isResult, p as createServer, r as RespondOptions, s as respond, t as AuthKind, u as ContextOptions } from "../respond-Dne1ARSa.js";
|
|
7
|
+
import { a as defineResource, i as ResourceRouteOptions, n as ResourceInput, r as ResourceList, t as ResourceHandler } from "../resource-CgZa3YG_.js";
|
|
8
|
+
import { a as ProblemResponseOptions, c as problemResponse, i as ProblemOptions, l as toProblem, n as PROBLEM_TYPE_BASE, o as fromProblem, r as ProblemDetails, s as isProblem, t as PROBLEM_CONTENT_TYPE } from "../problem-DlgB0lYl.js";
|
|
9
|
+
import { n as RefreshOutcome, r as refreshSession } from "../index-CG69s15v.js";
|
|
10
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
11
|
+
import { Middleware } from "@supabase/middleware";
|
|
12
|
+
import { AuthMode, JWTClaims, UserClaims } from "@supabase/server";
|
|
13
|
+
import { PostgresApi } from "@supabase/server/middleware/postgres";
|
|
14
|
+
//#region src/server/middleware.d.ts
|
|
15
|
+
/** The `withSupabase` context keys `withBetterSupabase` reads. */
|
|
16
|
+
interface SupabaseAuthContext {
|
|
17
|
+
readonly jwtClaims: JWTClaims | null;
|
|
18
|
+
readonly userClaims: UserClaims | null;
|
|
19
|
+
readonly authMode: AuthMode;
|
|
20
|
+
}
|
|
21
|
+
/** Repository context from a `@supabase/server` context. */
|
|
22
|
+
export declare function contextFromSupabase(ctx: SupabaseAuthContext): RequestContext;
|
|
23
|
+
/**
|
|
24
|
+
* `@supabase/middleware` entry contributing `ctx.db`: repositories bound to
|
|
25
|
+
* `ctx.supabase` (the caller-scoped client from `withSupabase`).
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* pipeline([withSupabase({ auth: 'user' }), withBetterSupabase(sb)()], (req, ctx) => ...)
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function withBetterSupabase<M extends AnyModels, D, F extends AnyFunctions, E>(sb: BetterSupabase<M, D, F, E>): Middleware<"db", void, SupabaseAuthContext & {
|
|
32
|
+
readonly supabase: SupabaseClient;
|
|
33
|
+
}, Db<M, F, E, SupabaseClient>>;
|
|
34
|
+
/**
|
|
35
|
+
* Entry contributing `ctx.sql`: repositories over `ctx.postgres` from
|
|
36
|
+
* `withPostgresClient`, which runs each query as the caller with RLS.
|
|
37
|
+
*/
|
|
38
|
+
export declare function withBetterPostgres<M extends AnyModels, D, F extends AnyFunctions, E>(sb: BetterSupabase<M, D, F, E>): Middleware<"sql", void, SupabaseAuthContext & {
|
|
39
|
+
readonly postgres: PostgresApi;
|
|
40
|
+
}, Db<M, F, E, undefined>>;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { AUTH_CACHE_HEADERS, type Aal, type AmrEntry, type AuthKind, type AuthResolution, type AuthResolver, type AuthState, type BetterServer, type ContextOptions, type CookieOptions, type CookieRecord, type CookieWrite, type DeleteAccountOptions, type DeleteAccountResult, type GuardOptions, type ImpersonationOptions, type Impersonator, type InvalidReason, PRIMARY_COOKIE, PROBLEM_CONTENT_TYPE, PROBLEM_TYPE_BASE, type ProblemDetails, type ProblemOptions, type ProblemResponseOptions, type RefreshOutcome, type ReplicaState, type ResolveAuthOptions, type ResolvedState, type ResourceHandler, type ResourceInput, type ResourceList, type ResourceRouteOptions, type RespondOptions, type ServerContext, type ServerOptions, type Settled, type StoredSession, type SupabaseAuthContext, aalOf, amrOf, authContext, checkAal, clientIp, createServer, defineResource, fromProblem, guard, impersonatorOf, isProblem, isResult, problemResponse, readSession, refreshSession, resolveAuth, respond, sessionCookieName, settle, toProblem, writeSession };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { a as problemResponse, i as isProblem, n as PROBLEM_TYPE_BASE, o as toProblem, r as fromProblem, t as PROBLEM_CONTENT_TYPE } from "../problem-BTkTtRV9.js";
|
|
2
|
+
import { a as settle, i as respond, n as guard, o as createServer, r as isResult, u as PRIMARY_COOKIE } from "../respond-DMcbQwfN.js";
|
|
3
|
+
import { a as clientIp, f as sessionCookieName, g as impersonatorOf, i as authContext, m as refreshSession, n as amrOf, o as resolveAuth, p as writeSession, r as checkAal, s as AUTH_CACHE_HEADERS, t as aalOf, u as readSession } from "../mfa-CpLfJSde.js";
|
|
4
|
+
import { n as postgresExecutor } from "../executor-DeppvirK.js";
|
|
5
|
+
import { t as defineResource } from "../resource-BHEWmQJK.js";
|
|
6
|
+
import { defineMiddleware } from "@supabase/middleware";
|
|
7
|
+
//#region src/server/middleware.ts
|
|
8
|
+
/** Repository context from a `@supabase/server` context. */
|
|
9
|
+
function contextFromSupabase(ctx) {
|
|
10
|
+
switch (ctx.authMode) {
|
|
11
|
+
case "user":
|
|
12
|
+
if (!ctx.userClaims) break;
|
|
13
|
+
return {
|
|
14
|
+
actor: {
|
|
15
|
+
id: ctx.userClaims.id,
|
|
16
|
+
kind: "user",
|
|
17
|
+
...ctx.userClaims.role !== void 0 ? { role: ctx.userClaims.role } : {},
|
|
18
|
+
...ctx.userClaims.email !== void 0 ? { email: ctx.userClaims.email } : {}
|
|
19
|
+
},
|
|
20
|
+
claims: ctx.jwtClaims ?? {}
|
|
21
|
+
};
|
|
22
|
+
case "secret": return {
|
|
23
|
+
actor: {
|
|
24
|
+
id: "service",
|
|
25
|
+
kind: "service",
|
|
26
|
+
role: "service_role"
|
|
27
|
+
},
|
|
28
|
+
claims: { role: "service_role" }
|
|
29
|
+
};
|
|
30
|
+
case "publishable":
|
|
31
|
+
case "none": break;
|
|
32
|
+
default: return ctx.authMode;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
actor: {
|
|
36
|
+
id: "anon",
|
|
37
|
+
kind: "anon",
|
|
38
|
+
role: "anon"
|
|
39
|
+
},
|
|
40
|
+
claims: { role: "anon" }
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* `@supabase/middleware` entry contributing `ctx.db`: repositories bound to
|
|
45
|
+
* `ctx.supabase` (the caller-scoped client from `withSupabase`).
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* pipeline([withSupabase({ auth: 'user' }), withBetterSupabase(sb)()], (req, ctx) => ...)
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
function withBetterSupabase(sb) {
|
|
52
|
+
return defineMiddleware({
|
|
53
|
+
key: "db",
|
|
54
|
+
run: (_config) => (_req, ctx) => Promise.resolve({ db: sb.connect(ctx.supabase, contextFromSupabase(ctx)) })
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Entry contributing `ctx.sql`: repositories over `ctx.postgres` from
|
|
59
|
+
* `withPostgresClient`, which runs each query as the caller with RLS.
|
|
60
|
+
*/
|
|
61
|
+
function withBetterPostgres(sb) {
|
|
62
|
+
return defineMiddleware({
|
|
63
|
+
key: "sql",
|
|
64
|
+
run: (_config) => (_req, ctx) => Promise.resolve({ sql: sb.connect(postgresExecutor(ctx.postgres), contextFromSupabase(ctx)) })
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { AUTH_CACHE_HEADERS, PRIMARY_COOKIE, PROBLEM_CONTENT_TYPE, PROBLEM_TYPE_BASE, aalOf, amrOf, authContext, checkAal, clientIp, contextFromSupabase, createServer, defineResource, fromProblem, guard, impersonatorOf, isProblem, isResult, problemResponse, readSession, refreshSession, resolveAuth, respond, sessionCookieName, settle, toProblem, withBetterPostgres, withBetterSupabase, writeSession };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as AuthSession } from "./view-D1s0wa0T.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/react/session.d.ts
|
|
4
|
+
interface SessionProviderProps {
|
|
5
|
+
/**
|
|
6
|
+
* An unresolved `next.session()` promise, created inside a `<Suspense>`
|
|
7
|
+
* boundary so the layout itself never waits for auth.
|
|
8
|
+
*/
|
|
9
|
+
readonly sessionPromise: Promise<AuthSession>;
|
|
10
|
+
readonly children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** Shares the server-verified session with Client Components. */
|
|
13
|
+
declare function SessionProvider(props: SessionProviderProps): ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The session from the nearest `<SessionProvider>`. Suspends until the
|
|
16
|
+
* promise resolves, so render it inside `<Suspense>`. `C` types the claims
|
|
17
|
+
* (the output of `sb.claims(schema)`) and `P` the profile (the output of
|
|
18
|
+
* `sb.userMetadata(schema)`); `createHooks().useSession` infers both.
|
|
19
|
+
*/
|
|
20
|
+
declare function useSession<C = unknown, P = unknown>(): AuthSession<C, P>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { SessionProviderProps as n, useSession as r, SessionProvider as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createContext, createElement, use, useContext } from "react";
|
|
2
|
+
//#region src/react/session.ts
|
|
3
|
+
const SessionContext = createContext(null);
|
|
4
|
+
/** Shares the server-verified session with Client Components. */
|
|
5
|
+
function SessionProvider(props) {
|
|
6
|
+
return createElement(SessionContext.Provider, { value: props.sessionPromise }, props.children);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The session from the nearest `<SessionProvider>`. Suspends until the
|
|
10
|
+
* promise resolves, so render it inside `<Suspense>`. `C` types the claims
|
|
11
|
+
* (the output of `sb.claims(schema)`) and `P` the profile (the output of
|
|
12
|
+
* `sb.userMetadata(schema)`); `createHooks().useSession` infers both.
|
|
13
|
+
*/
|
|
14
|
+
function useSession() {
|
|
15
|
+
const promise = useContext(SessionContext);
|
|
16
|
+
if (!promise) throw new Error("better-supabase: useSession() needs <SessionProvider sessionPromise={...}>");
|
|
17
|
+
return use(promise);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { useSession as n, SessionProvider as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { n as dbError, t as DbException } from "./errors-Bl3rkOzo.js";
|
|
2
|
+
//#region src/plugins/shared.ts
|
|
3
|
+
/** Database column name for an app column, or `undefined` if it is unknown. */
|
|
4
|
+
function dbName(table, app) {
|
|
5
|
+
return app === void 0 ? void 0 : table.columns[app]?.db;
|
|
6
|
+
}
|
|
7
|
+
function isNull(column) {
|
|
8
|
+
return {
|
|
9
|
+
kind: "column",
|
|
10
|
+
column,
|
|
11
|
+
op: "is",
|
|
12
|
+
value: null
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function isNotNull(column) {
|
|
16
|
+
return {
|
|
17
|
+
kind: "not",
|
|
18
|
+
item: isNull(column)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function equals(column, value) {
|
|
22
|
+
return {
|
|
23
|
+
kind: "column",
|
|
24
|
+
column,
|
|
25
|
+
op: "eq",
|
|
26
|
+
value
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Sets `column` on a row unless the caller already provided it. */
|
|
30
|
+
function withDefault(row, column, value) {
|
|
31
|
+
if (column === void 0 || column in row) return row;
|
|
32
|
+
return {
|
|
33
|
+
...row,
|
|
34
|
+
[column]: value
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Upserts that may update existing rows must not overwrite "created" columns. */
|
|
38
|
+
function insertsOnly(op) {
|
|
39
|
+
return !op.onConflict || op.onConflict.action === "ignore";
|
|
40
|
+
}
|
|
41
|
+
function forbidden(message) {
|
|
42
|
+
throw new DbException(dbError("forbidden", message));
|
|
43
|
+
}
|
|
44
|
+
/** Database-keyed row to app-keyed row. */
|
|
45
|
+
function toApp(table, row) {
|
|
46
|
+
const out = {};
|
|
47
|
+
for (const [app, meta] of Object.entries(table.columns)) if (meta.db in row) out[app] = row[meta.db];
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
/** App-keyed row to database-keyed row. Unknown keys are dropped. */
|
|
51
|
+
function toDb(table, row) {
|
|
52
|
+
const out = {};
|
|
53
|
+
for (const [app, meta] of Object.entries(table.columns)) if (app in row) out[meta.db] = row[app];
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { isNotNull as a, toDb as c, insertsOnly as i, withDefault as l, equals as n, isNull as o, forbidden as r, toApp as s, dbName as t };
|