better-supabase 0.58.1 → 0.58.3
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/{adapter-base-8PuJ3OoB.js → adapter-base-BbnpIsy4.js} +1 -1
- package/dist/{api-D-YoZpRe.js → api-DsFkhsYI.js} +1 -1
- package/dist/astro/index.js +3 -3
- package/dist/blocks/crm/index.js +1 -1
- package/dist/blocks/index.js +2 -2
- package/dist/{build-1ikup3O6.js → build-Cb9yLxtS.js} +1 -1
- package/dist/cli/{add-CBNxtc8h.js → add-BQZyQh4f.js} +2 -2
- package/dist/cli/add-DHvo6zQZ.js +1 -0
- package/dist/cli/{add-B63B07UG.js → add-dbBQf6Vy.js} +9 -9
- package/dist/cli/{app-table-files-BQU5_xhz.js → app-table-files-CITEmvRS.js} +3 -3
- package/dist/cli/{app-tables-DUCrWiGS.js → app-tables-BBqu3dow.js} +2 -2
- package/dist/cli/{backfill-ff_y-n3l.js → backfill-bBk3QjfK.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-BuwjO--N.js → blocks-CsQNweG8.js} +1 -1
- package/dist/cli/{blocks-DcMd8kRY.js → blocks-D-DV2aCE.js} +1 -1
- package/dist/cli/{cache-Di8fhrqf.js → cache-sR8AQqSV.js} +1 -1
- package/dist/cli/{codemod-Bu77IP-l.js → codemod-BkPcyPnF.js} +4 -4
- package/dist/cli/{codemod-naming-CB4FfxcO.js → codemod-naming-BLoVSmVF.js} +1 -1
- package/dist/cli/{column-renames-B8tfoufA.js → column-renames-brM-D_th.js} +2 -2
- package/dist/cli/{content-mapper-Dby_JOgB.js → content-mapper-DMi2HOKi.js} +1 -1
- package/dist/cli/{dev-CJnbxe_s.js → dev-ClH-7fB0.js} +3 -3
- package/dist/cli/{doctor-C_GPFp8I.js → doctor-C_BEuEGg.js} +16 -16
- package/dist/cli/{emit-Diublx-B.js → emit-CTzFdffA.js} +2 -2
- package/dist/cli/{gen-BgTMpJhV.js → gen-RKf7q3L5.js} +3 -3
- package/dist/cli/{gen-tasks-Dn9gxauI.js → gen-tasks-DmDvgVBV.js} +9 -9
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-1gNLko5F.js → init-B_CCByIh.js} +8 -8
- package/dist/cli/{live-D07gGcoV.js → live-DjjMID3V.js} +2 -2
- package/dist/cli/{mcp-BwMLfpxa.js → mcp-BYwrZHp1.js} +2 -2
- package/dist/cli/{memo-backend-yki17W-K.js → memo-backend-BIHqP1uE.js} +1 -1
- package/dist/cli/{metadata-CxF9te2t.js → metadata-DCtLUYqR.js} +4 -4
- package/dist/cli/{migrate-D4gNS4gj.js → migrate-Bq6CUPbE.js} +1 -1
- package/dist/cli/{migration-safety-DsQonP4-.js → migration-safety-BvJ-JK5n.js} +1 -1
- package/dist/cli/{module-migration-Cl-I5j0j.js → module-migration-Dv6VV1om.js} +1 -1
- package/dist/cli/{partition-C5G03PgD.js → partition-C4g7WAwh.js} +1 -1
- package/dist/cli/{powersync-WhAasez3.js → powersync-1HMiZhFF.js} +3 -3
- package/dist/cli/powersync-DLUNuNl4.js +1 -0
- package/dist/cli/{print-B6dsmPgY.js → print-D9biMrfv.js} +2 -2
- package/dist/cli/{providers-B4QIwuqF.js → providers-C5fw9XC_.js} +1 -1
- package/dist/cli/{prune-workflows-BRLMJAN3.js → prune-workflows-DxpPCevB.js} +1 -1
- package/dist/cli/{remove-H86BDqeG.js → remove-CyhSdPkK.js} +6 -6
- package/dist/cli/{render-DinflArt.js → render-DOz25g5T.js} +4 -4
- package/dist/cli/{render-cache-BoFKfBx6.js → render-cache-CInSNFhV.js} +1 -1
- package/dist/cli/{run-3BMqhsTa.js → run-0bMsZ1VV.js} +7 -7
- package/dist/cli/{run-sk-YY1p3.js → run-DVdkD1MI.js} +30 -30
- package/dist/cli/{shared-B9fxx6uL.js → shared-D2i8_u-U.js} +1 -1
- package/dist/cli/{source-Dwn8SwJg.js → source-BGVOuWXq.js} +1 -1
- package/dist/cli/{spec-BFlvbXVb.js → spec-COotILIk.js} +2 -2
- package/dist/cli/{spec--0tYexnO.js → spec-C_JKo_dP.js} +1 -1
- package/dist/cli/{sql-layout-CpbXj-r9.js → sql-layout-D8dIzdy9.js} +2 -2
- package/dist/cli/{squash-DLXeXmpI.js → squash-xCseaSP1.js} +1 -1
- package/dist/cli/{sync-DHUrIa97.js → sync-Ceqa-3R6.js} +4 -4
- package/dist/cli/{upgrade-DKfXHex4.js → upgrade-CUNKALDw.js} +5 -5
- package/dist/cli/{upgrade-N7lDosgT.js → upgrade-DiMHauEU.js} +5 -5
- package/dist/cli/{version-Bm4K-iOw.js → version-C7imaHag.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.js +2 -2
- package/dist/{codec-CqLbYQ6z.js → codec-Cjquuv8M.js} +1 -1
- package/dist/{composite-6VIY4jUO.js → composite-DYAp3Znr.js} +1 -1
- package/dist/{composite-reads-CbPYsvlz.js → composite-reads-BJeDe1yV.js} +1 -1
- package/dist/create/index.js +1 -1
- package/dist/create/lite/index.js +2 -2
- package/dist/{define-runtime-BBF5JHl4.js → define-runtime-Dv8OYnKW.js} +59 -6
- package/dist/{define-runtime-full-D6v1ST7M.js → define-runtime-full-Bh5c_01f.js} +3 -3
- package/dist/edge/index.js +4 -4
- package/dist/{executor-BgjsCon6.js → executor-B0nTn-4Q.js} +2 -2
- package/dist/expo/index.js +3 -3
- package/dist/{framework-DSGTH9p6.js → framework-C9UiMaOq.js} +1 -1
- package/dist/generators/factories/index.js +1 -1
- package/dist/generators/json-schema/index.js +1 -1
- package/dist/generators/nuqs/index.js +1 -1
- package/dist/generators/standard-schema/index.js +1 -1
- package/dist/generators/valibot/index.js +1 -1
- package/dist/generators/zod/index.js +1 -1
- package/dist/hono/index.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{json-schema-Ba8xSQxR.js → json-schema-CgwH39-G.js} +1 -1
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/{mcp-CaC-3JB3.js → mcp-CoJbu0Hk.js} +3 -3
- package/dist/next/index.js +3 -3
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.js +5 -5
- package/dist/{ports-BXtpOQRz.js → ports-DfDzwMCR.js} +2 -2
- package/dist/powersync/index.js +1 -1
- package/dist/{project-Bgz2gbh5.js → project-CxoixIpG.js} +1 -1
- package/dist/react-router/index.js +3 -3
- package/dist/{read-set-DsIurGUE.js → read-set-BptYceHc.js} +1 -1
- package/dist/server/index.js +4 -4
- package/dist/{server-DFxO9Dyz.js → server-CqRpnOo0.js} +2 -2
- package/dist/solid-start/index.js +3 -3
- package/dist/spec/index.js +2 -2
- package/dist/sql/index.js +1 -1
- package/dist/{sql-BbaGokNJ.js → sql-ZLYXNvXw.js} +56 -21
- package/dist/sqlite/index.js +1 -1
- package/dist/sveltekit/index.js +3 -3
- package/dist/tanstack-start/index.js +3 -3
- package/dist/testing/index.js +3 -3
- package/dist/{version-Ce4Rk4uV.js → version-DRVVrk-u.js} +1 -1
- package/dist/webmcp/index.js +1 -1
- package/package.json +1 -1
- package/dist/cli/add-CeZUs_jU.js +0 -1
- package/dist/cli/powersync-TDly6ptq.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as rpcCacheTargets, S as rowKey, _ as BetterSupabase, b as cacheTargetOf, c as explainPostgrest, g as registerRpcReturn, h as decodeRpcReturn, i as decodeCursor, l as postgrestExecutor, m as compilePostgrest, o as encodeCursor, t as decodeRows, v as createSupabase, x as memoryCache } from "./codec-
|
|
1
|
+
import { C as rpcCacheTargets, S as rowKey, _ as BetterSupabase, b as cacheTargetOf, c as explainPostgrest, g as registerRpcReturn, h as decodeRpcReturn, i as decodeCursor, l as postgrestExecutor, m as compilePostgrest, o as encodeCursor, t as decodeRows, v as createSupabase, x as memoryCache } from "./codec-Cjquuv8M.js";
|
|
2
2
|
import { n as StatsRecorder, r as recordStats, t as EMPTY_STATS } from "./stats-D2TN2c3B.js";
|
|
3
3
|
import { a as ok, i as fromBetterResult, n as defineBetterResultErrors, o as toBetterResult, r as err, s as toDbError, t as AsyncResult } from "./result-DijoXEFG.js";
|
|
4
4
|
import { a as isCheck, c as isForeignKey, d as statusOf, i as dbErrorOfStatus, l as mapDbError, n as dbError, o as isConflict, s as isDbError, u as matchDbError } from "./errors-DK1wGb9z.js";
|
|
@@ -7,7 +7,7 @@ import { o as encodeValue, r as decodeValue } from "./wire-DDdE6nKn.js";
|
|
|
7
7
|
import { t as DbException } from "./db-exception-Dv18UZ-I.js";
|
|
8
8
|
import { n as toDb, t as toApp } from "./casing-DQzG9ANZ.js";
|
|
9
9
|
import { n as validate } from "./standard-DM4THQrL.js";
|
|
10
|
-
import { c as readSetTables, i as defineReadSet, m as specTables, o as isReadSet, p as isQuerySpec, u as blockRead } from "./read-set-
|
|
10
|
+
import { c as readSetTables, i as defineReadSet, m as specTables, o as isReadSet, p as isQuerySpec, u as blockRead } from "./read-set-BptYceHc.js";
|
|
11
11
|
import { n as readTypeSource } from "./read-type-DV9TEXw8.js";
|
|
12
12
|
import { n as touchedTables, t as invalidationTargets } from "./tables-BSiVuKKx.js";
|
|
13
13
|
import { n as silentLogger, t as consoleLogger } from "./logger-BkF8ukXV.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as tableJsonSchema, r as fieldJsonSchema, t as forTarget } from "./table-schema-CnUdpnfT.js";
|
|
2
|
-
import { t as VERSION } from "./version-
|
|
2
|
+
import { t as VERSION } from "./version-DRVVrk-u.js";
|
|
3
3
|
import { t as isList } from "./guards-CsRa6v57.js";
|
|
4
4
|
import { n as extraSchemas, r as fieldMeta } from "./extras-CW8CKLeE.js";
|
|
5
5
|
import { _ as variantTitle, f as siblingPath, i as fieldsFor, m as tableEntries, n as fieldDocs, p as tableDocs, r as fieldSpec, v as variantsFor } from "./shared-BXRDj6UR.js";
|
package/dist/mapper/bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as loadSnapshot } from "../cli/sql-layout-
|
|
1
|
+
import { d as loadSnapshot } from "../cli/sql-layout-D8dIzdy9.js";
|
|
2
2
|
import { i as discoverConfig, s as loadConfig } from "../cli/config-NxPVkM-K.js";
|
|
3
|
-
import { s as schemaStampPath } from "../cli/content-mapper-
|
|
3
|
+
import { s as schemaStampPath } from "../cli/content-mapper-DMi2HOKi.js";
|
|
4
4
|
import { i as parseEnv, n as configEnvironment } from "../cli/env-CQ831uY0.js";
|
|
5
|
-
import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-
|
|
6
|
-
import { i as lastTypesModule, o as typesModuleKey, s as writeAtomic } from "../cli/cache-
|
|
7
|
-
import { t as VERSION } from "../cli/version-
|
|
5
|
+
import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-DOz25g5T.js";
|
|
6
|
+
import { i as lastTypesModule, o as typesModuleKey, s as writeAtomic } from "../cli/cache-sR8AQqSV.js";
|
|
7
|
+
import { t as VERSION } from "../cli/version-C7imaHag.js";
|
|
8
8
|
import { existsSync, realpathSync } from "node:fs";
|
|
9
9
|
import { basename, dirname, join, resolve } from "node:path";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
package/dist/mcp/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as MCP_PROTOCOL_VERSION, i as answerLine, a as answerMessage, t as createMcp, n as defineTool } from "../mcp-
|
|
1
|
+
export { r as MCP_PROTOCOL_VERSION, i as answerLine, a as answerMessage, t as createMcp, n as defineTool } from "../mcp-CoJbu0Hk.js";
|
package/dist/mcp/sdk/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { i as delegationOf } from "../../actor-DraVJ7tB.js";
|
|
|
2
2
|
import { h as resolveToken, p as flushEvents } from "../../sessions-Dedk1ubX.js";
|
|
3
3
|
import { t as withExtra } from "../../extra-Dz9n5y1s.js";
|
|
4
4
|
import { i as guard } from "../../respond-DLvLJwwN.js";
|
|
5
|
-
import { n as extendServer, t as createServer } from "../../server-
|
|
5
|
+
import { n as extendServer, t as createServer } from "../../server-CqRpnOo0.js";
|
|
6
6
|
import { a as withCors, i as metadataPreflight, n as endpointPreflight, r as isMetadataRequest, t as discovery } from "../../http-BRUI3qim.js";
|
|
7
7
|
import { n as dbError } from "../../errors-DK1wGb9z.js";
|
|
8
8
|
import { o as problemResponse } from "../../problem-BwplIuhI.js";
|
|
@@ -3,13 +3,13 @@ import { n as jsonResponse, t as jsonReplacer } from "./json-O5vFw243.js";
|
|
|
3
3
|
import { a as methodNotAllowed, c as toProblem, o as problemResponse } from "./problem-BwplIuhI.js";
|
|
4
4
|
import { n as validate } from "./standard-DM4THQrL.js";
|
|
5
5
|
import { t as boundedTtlCache } from "./ttl-cache-C5S0L2wx.js";
|
|
6
|
-
import { n as toJsonSchema, r as toDraft07 } from "./json-schema-
|
|
7
|
-
import { t as adapterBase } from "./adapter-base-
|
|
6
|
+
import { n as toJsonSchema, r as toDraft07 } from "./json-schema-CgwH39-G.js";
|
|
7
|
+
import { t as adapterBase } from "./adapter-base-BbnpIsy4.js";
|
|
8
8
|
import { p as flushEvents } from "./sessions-Dedk1ubX.js";
|
|
9
9
|
import { t as withExtra } from "./extra-Dz9n5y1s.js";
|
|
10
10
|
import { t as defineResource } from "./resource-BxSmk1R1.js";
|
|
11
11
|
import { i as guard, s as settle } from "./respond-DLvLJwwN.js";
|
|
12
|
-
import { n as extendServer, t as createServer } from "./server-
|
|
12
|
+
import { n as extendServer, t as createServer } from "./server-CqRpnOo0.js";
|
|
13
13
|
import { r as pageSchema, t as pageInputSchema } from "./resource-schemas-Bq0g2RCQ.js";
|
|
14
14
|
import { a as withCors, i as metadataPreflight, n as endpointPreflight, r as isMetadataRequest, t as discovery } from "./http-BRUI3qim.js";
|
|
15
15
|
import { t as base64ToText } from "./base64-CEBz6-Jj.js";
|
package/dist/next/index.js
CHANGED
|
@@ -5,17 +5,17 @@ import { i as toSession } from "../view-DpKWWhP2.js";
|
|
|
5
5
|
import { i as claimsOf } from "../claims-CX-ar1vt.js";
|
|
6
6
|
import { n as dbError } from "../errors-DK1wGb9z.js";
|
|
7
7
|
import { t as isList } from "../guards-CsRa6v57.js";
|
|
8
|
-
import { c as readSetTables, o as isReadSet, p as isQuerySpec } from "../read-set-
|
|
8
|
+
import { c as readSetTables, o as isReadSet, p as isQuerySpec } from "../read-set-BptYceHc.js";
|
|
9
9
|
import { r as err } from "../result-DijoXEFG.js";
|
|
10
10
|
import { n as validate } from "../standard-DM4THQrL.js";
|
|
11
11
|
import { t as EMPTY_STATS } from "../stats-D2TN2c3B.js";
|
|
12
12
|
import { r as tagFor, t as cacheTagsOf } from "../tags-CW-KvjdL.js";
|
|
13
13
|
import { t as ACCOUNT_PARTS } from "../account-parts-CsuHH0Zs.js";
|
|
14
|
-
import { t as adapterBase } from "../adapter-base-
|
|
14
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
15
15
|
import { t as tenantOf } from "../tenant-Duq0dWqX.js";
|
|
16
16
|
import { c as serverCore, f as bearerRequest, m as handle } from "../sessions-Dedk1ubX.js";
|
|
17
17
|
import { r as permissionsOf } from "../permissions-Dk3BH3dS.js";
|
|
18
|
-
import { c as bootstrapSchema, l as bootstrapWith, n as extendServer, s as accessOf, t as createServer, u as mapBootstrapMemo } from "../server-
|
|
18
|
+
import { c as bootstrapSchema, l as bootstrapWith, n as extendServer, s as accessOf, t as createServer, u as mapBootstrapMemo } from "../server-CqRpnOo0.js";
|
|
19
19
|
import { t as withExtra } from "../extra-Dz9n5y1s.js";
|
|
20
20
|
import { i as requireCaller, n as formDataObject, t as authorizeCaller } from "../kit-BgRTtW9w.js";
|
|
21
21
|
import { n as resourceRouter } from "../resources-CM9wwyfa.js";
|
package/dist/orpc/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import { i as toSession } from "../view-DpKWWhP2.js";
|
|
|
2
2
|
import { i as claimsOf } from "../claims-CX-ar1vt.js";
|
|
3
3
|
import { n as dbError, r as dbErrorOf } from "../errors-DK1wGb9z.js";
|
|
4
4
|
import { c as toProblem } from "../problem-BwplIuhI.js";
|
|
5
|
-
import { t as adapterBase } from "../adapter-base-
|
|
5
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
6
6
|
import { p as flushEvents } from "../sessions-Dedk1ubX.js";
|
|
7
7
|
import { t as authorizeCaller } from "../kit-BgRTtW9w.js";
|
|
8
8
|
import { t as rateLimitGate } from "../rate-limit-Wolzge1m.js";
|
|
9
9
|
import { t as tenantOf } from "../tenant-Duq0dWqX.js";
|
|
10
10
|
import { r as refreshFor } from "../request-kind-BMNdlQpz.js";
|
|
11
11
|
import { i as guard, s as settle, t as assertCookieRefresh } from "../respond-DLvLJwwN.js";
|
|
12
|
-
import { n as extendServer, t as createServer } from "../server-
|
|
12
|
+
import { n as extendServer, t as createServer } from "../server-CqRpnOo0.js";
|
|
13
13
|
import { t as callWithInput } from "../block-method-DIbWG4Mj.js";
|
|
14
14
|
import { r as checkPermission } from "../authorizer-DtUCjKBn.js";
|
|
15
15
|
import { n as isRecord } from "../guards-CsRa6v57.js";
|
package/dist/otel/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as blockEventAttributes } from "../block-events-uKWyOpAy.js";
|
|
2
2
|
import { r as definePlugin } from "../plugin-Ca2qBiFZ.js";
|
|
3
3
|
import { t as SPEC_PINS } from "../spec-pins-Dlz8OVqi.js";
|
|
4
|
-
import "../version-
|
|
4
|
+
import "../version-DRVVrk-u.js";
|
|
5
5
|
import { SpanKind, SpanStatusCode, context, metrics, propagation, trace } from "@opentelemetry/api";
|
|
6
6
|
// src/otel/index.ts
|
|
7
7
|
const INSTRUMENTATION_NAME = "better-supabase";
|
|
@@ -40,9 +40,9 @@ function systemOf(executor) {
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
function otel(options = {}) {
|
|
43
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.
|
|
43
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.3");
|
|
44
44
|
let histogram;
|
|
45
|
-
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.58.
|
|
45
|
+
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.58.3")).createHistogram("db.client.operation.duration", {
|
|
46
46
|
unit: "s",
|
|
47
47
|
description: "Duration of database client operations.",
|
|
48
48
|
advice: { explicitBucketBoundaries: [
|
|
@@ -231,7 +231,7 @@ function otel(options = {}) {
|
|
|
231
231
|
* `betterSupabase.events`. Returns a function that stops listening.
|
|
232
232
|
*/
|
|
233
233
|
function traceAuth(betterSupabase, options = {}) {
|
|
234
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.
|
|
234
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.3");
|
|
235
235
|
const offAuth = betterSupabase.events.on("auth", (event) => {
|
|
236
236
|
const span = tracer.startSpan("auth.resolve", {
|
|
237
237
|
kind: SpanKind.INTERNAL,
|
|
@@ -270,7 +270,7 @@ function traceAuth(betterSupabase, options = {}) {
|
|
|
270
270
|
* `*.denied`) set an error status. Returns a function that stops listening.
|
|
271
271
|
*/
|
|
272
272
|
function traceBlockEvents(betterSupabase, options = {}) {
|
|
273
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.
|
|
273
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.3");
|
|
274
274
|
return betterSupabase.events.on("block", (event) => {
|
|
275
275
|
const attributes = {
|
|
276
276
|
...options.attributes,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as postgrestExecutor } from "./codec-
|
|
1
|
+
import { l as postgrestExecutor } from "./codec-Cjquuv8M.js";
|
|
2
2
|
import { a as ok, r as err, t as AsyncResult } from "./result-DijoXEFG.js";
|
|
3
3
|
import { r as decodeJwtPayload } from "./base64-CEBz6-Jj.js";
|
|
4
4
|
import { i as userContext } from "./impersonation-BlU6M8zN.js";
|
|
5
|
-
import { t as provideLeanConnectionRuntime } from "./define-runtime-
|
|
5
|
+
import { t as provideLeanConnectionRuntime } from "./define-runtime-Dv8OYnKW.js";
|
|
6
6
|
import { n as hasAuthModule, r as claimedTenant } from "./auth-module-D_RA-X_y.js";
|
|
7
7
|
import { t as currentTenant } from "./tenant-source-46lMuMEn.js";
|
|
8
8
|
import { n as identityKey } from "./user-change-Ngy8z1fZ.js";
|
package/dist/powersync/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as sqliteCompiler, c as quoteSqliteIdent, i as checkSqlite, l as sqliteValue, n as postgrestTimestamp, o as compileSqlite, r as sqliteExecutor, s as likeToGlob, t as fromSqliteError } from "../executor-
|
|
1
|
+
import { a as sqliteCompiler, c as quoteSqliteIdent, i as checkSqlite, l as sqliteValue, n as postgrestTimestamp, o as compileSqlite, r as sqliteExecutor, s as likeToGlob, t as fromSqliteError } from "../executor-B0nTn-4Q.js";
|
|
2
2
|
import { i as localEngine } from "../data-engine-MRAlinsa.js";
|
|
3
3
|
import { n as authzVersionOf } from "../snapshot-C1KUHKTc.js";
|
|
4
4
|
import { n as claimAt, s as tenantPathsFor } from "../claims-CX-ar1vt.js";
|
|
@@ -2,7 +2,7 @@ import { a as presetOf, f as resolvePreset } from "./config-a_CzEbpi.js";
|
|
|
2
2
|
import { D as designOf, M as parseDesign, j as jsonPointer, k as encodeDesign, v as DesignParseError, w as designConfig, y as DesignTooLongError } from "./preset-HzYIrxUS.js";
|
|
3
3
|
import { I as PRESET_CATALOG, b as appDefaultError, d as appIdentifierError, f as appNameLengthError, p as appReservedColumns, x as isAppDefault } from "./instances-07Lopbd1.js";
|
|
4
4
|
import { i as resolveConfig } from "./config-DzPViWQU.js";
|
|
5
|
-
import { Ft as SQL_MODULES, ot as renderBlocks, q as moduleLayout } from "./sql-
|
|
5
|
+
import { Ft as SQL_MODULES, ot as renderBlocks, q as moduleLayout } from "./sql-ZLYXNvXw.js";
|
|
6
6
|
// src/create/column-keys.ts
|
|
7
7
|
/** The most options a select takes, and the longest option. */
|
|
8
8
|
const MAX_OPTIONS = 100;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as bufferInPlace, t as around } from "../shared-Ci1g9nl4.js";
|
|
2
2
|
import { o as problemResponse } from "../problem-BwplIuhI.js";
|
|
3
|
-
import { t as adapterBase } from "../adapter-base-
|
|
3
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
4
4
|
import { _ as withFlush } from "../sessions-Dedk1ubX.js";
|
|
5
|
-
import { i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-
|
|
5
|
+
import { i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-C9UiMaOq.js";
|
|
6
6
|
import { i as requireCaller, o as runAction } from "../kit-BgRTtW9w.js";
|
|
7
7
|
import { r as refusalResponse } from "../refusal-CgSrkirX.js";
|
|
8
8
|
import { s as settle } from "../respond-DLvLJwwN.js";
|
|
9
|
-
import { n as extendServer, t as createServer } from "../server-
|
|
9
|
+
import { n as extendServer, t as createServer } from "../server-CqRpnOo0.js";
|
|
10
10
|
// src/bridges/react-router.ts
|
|
11
11
|
/**
|
|
12
12
|
* Runs an entry array as React Router server middleware. The contributions are
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as defineAuthorizationHooks, f as SERVER_EVENT_SOURCE, n as extendServer, r as TENANT_HEADER, t as createServer } from "../server-
|
|
1
|
+
import { d as defineAuthorizationHooks, f as SERVER_EVENT_SOURCE, n as extendServer, r as TENANT_HEADER, t as createServer } from "../server-CqRpnOo0.js";
|
|
2
2
|
import { n as PRIMARY_COOKIE } from "../replicas-DiDz-zyr.js";
|
|
3
|
-
import { t as adapterBase } from "../adapter-base-
|
|
3
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
4
4
|
import { _ as withFlush, c as serverCore, g as unexpectedResponse, h as resolveToken, i as withSession, m as handle, p as flushEvents } from "../sessions-Dedk1ubX.js";
|
|
5
5
|
import { n as event, t as defineEvents } from "../event-map-DLajpFiJ.js";
|
|
6
6
|
import { a as PERMISSIONS_TRUNCATED_CLAIM, i as PERMISSIONS_CLAIM, n as FEATURES_CLAIM, o as PERMISSION_CAP_CLAIM, r as MEMBERSHIPS_CLAIM, t as AUTHZ_VERSION_CLAIM } from "../claim-names-B3KyK7Js.js";
|
|
@@ -18,9 +18,9 @@ import { n as supportClaims, t as sqlSupportStore } from "../support-DqbhfGgx.js
|
|
|
18
18
|
import { t as supportOf } from "../support-view-CvDEgyGY.js";
|
|
19
19
|
import { i as userContext, r as impersonatorOf } from "../impersonation-BlU6M8zN.js";
|
|
20
20
|
import "../claims/index.js";
|
|
21
|
-
import { t as provideConnectionRuntime } from "../define-runtime-full-
|
|
21
|
+
import { t as provideConnectionRuntime } from "../define-runtime-full-Bh5c_01f.js";
|
|
22
22
|
import { t as postgresExecutor } from "../executor-BWg7xw7c.js";
|
|
23
|
-
import { n as withGuard, t as withBetterSupabase } from "../composite-
|
|
23
|
+
import { n as withGuard, t as withBetterSupabase } from "../composite-DYAp3Znr.js";
|
|
24
24
|
import { n as jwtClaimsOf, r as userClaimsOf, t as authModeOf } from "../claims-DouHL7ZL.js";
|
|
25
25
|
import { i as delegationOf, n as actorOf, r as agentClaims, t as IDENTITY_SCOPES } from "../actor-DraVJ7tB.js";
|
|
26
26
|
import { t as authContext } from "../context-DxTbfhD8.js";
|
|
@@ -4,9 +4,9 @@ import { a as narrowCap, i as delegatedClaims, r as contextClaims } from "./dele
|
|
|
4
4
|
import { i as userContext, t as actClaim } from "./impersonation-BlU6M8zN.js";
|
|
5
5
|
import { m as sessionCookieName } from "./resolve-oJsHQ9Ib.js";
|
|
6
6
|
import { s as requestMemo, t as bindAuthorizer } from "./authorizer-DtUCjKBn.js";
|
|
7
|
-
import { t as provideConnectionRuntime } from "./define-runtime-full-
|
|
7
|
+
import { t as provideConnectionRuntime } from "./define-runtime-full-Bh5c_01f.js";
|
|
8
8
|
import { n as dbError } from "./errors-DK1wGb9z.js";
|
|
9
|
-
import { l as postgrestExecutor } from "./codec-
|
|
9
|
+
import { l as postgrestExecutor } from "./codec-Cjquuv8M.js";
|
|
10
10
|
import { a as ok, r as err, t as AsyncResult } from "./result-DijoXEFG.js";
|
|
11
11
|
import { n as StatsRecorder } from "./stats-D2TN2c3B.js";
|
|
12
12
|
import { t as credentialProviderOf } from "./provider-DEDGgEeN.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as beforeRoute } from "../before-route-Ra3OhI2x.js";
|
|
2
2
|
import { i as nitroCloudflareEnv } from "../shared-Ci1g9nl4.js";
|
|
3
|
-
import { t as adapterBase } from "../adapter-base-
|
|
3
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
4
4
|
import { p as flushEvents } from "../sessions-Dedk1ubX.js";
|
|
5
|
-
import { i as localsOf, r as frameworkEntry } from "../framework-
|
|
5
|
+
import { i as localsOf, r as frameworkEntry } from "../framework-C9UiMaOq.js";
|
|
6
6
|
import { i as requireCaller, o as runAction } from "../kit-BgRTtW9w.js";
|
|
7
7
|
import { r as refusalResponse } from "../refusal-CgSrkirX.js";
|
|
8
|
-
import { n as extendServer, t as createServer } from "../server-
|
|
8
|
+
import { n as extendServer, t as createServer } from "../server-CqRpnOo0.js";
|
|
9
9
|
// src/solid-start/index.ts
|
|
10
10
|
/** SolidStart integration: middleware, guards and server function actions. */
|
|
11
11
|
function createSolidStart(betterSupabase, options) {
|
package/dist/spec/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as toOpenApi30Schema, n as openapiFormat, o as defineDocumentFormat, r as OPENAPI_33_PREVIEW_VERSION, t as defineApi } from "../api-
|
|
2
|
-
import { a as topicsFrom, c as PROBLEM_SCHEMA, d as mergeJson, f as pointerToken, i as safeKey, l as convertStandard, r as CLOUD_EVENT_TRAIT, s as DEFAULT_ERRORS, t as defineApiModel, u as pascal } from "../build-
|
|
1
|
+
import { a as toOpenApi30Schema, n as openapiFormat, o as defineDocumentFormat, r as OPENAPI_33_PREVIEW_VERSION, t as defineApi } from "../api-DsFkhsYI.js";
|
|
2
|
+
import { a as topicsFrom, c as PROBLEM_SCHEMA, d as mergeJson, f as pointerToken, i as safeKey, l as convertStandard, r as CLOUD_EVENT_TRAIT, s as DEFAULT_ERRORS, t as defineApiModel, u as pascal } from "../build-Cb9yLxtS.js";
|
|
3
3
|
import { t as FUNCTION_DESCRIPTOR } from "../function-contract-Bf6llTkE.js";
|
|
4
4
|
import { r as isPlainObject } from "../clone-H_gCsL29.js";
|
|
5
5
|
import { a as methodNotAllowed } from "../problem-BwplIuhI.js";
|
package/dist/sql/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { B as resolveBlock, T as hasColumnAccess, h as appTableEventTypes } from "../instances-07Lopbd1.js";
|
|
2
|
-
import { $ as ownerOf, $t as redundantNulls, A as declaredCheckValues, At as sameBlockFile, B as clearMemo, Bt as excludedColumns, C as rulePolicy, Ct as appTablesFiles, D as duplicateObjects, Dt as blockFileState, E as sharedRolesProblems, Et as blockSqlVersion, F as sameTenantLayout, Ft as SQL_MODULES, G as blockTables, Gt as keysetPredicate, H as memoized, Ht as SECRET_COLUMNS, I as adoptedColumnProblems, It as moduleSource, J as entityRenamePlan, Jt as listOrder, K as seedDefaultsFunctions, Kt as listBody, L as adoptedTables, Lt as resolveBlocks, M as tenantsQuery, Mt as moduleHidingColumns, N as expiredFlagsQuery, Nt as modulePermissionKeys, O as writtenValues, Ot as isModuleDataFile, P as ownedColumns, Pt as moduleSchemaExtensions, Q as duplicatePolicies, Qt as moduleContext, R as adoptedViews, Rt as TENANT_SCOPE_NAMES, S as renderRulePolicy, St as APP_TABLES_MODULE, T as compileReadSets, Tt as renderAutoEmbedding, U as setMemoBackend, Ut as dataExportPlan, V as memoStats, Vt as resolveExposeColumns, W as instanceFunctions, Wt as LIST_TOTAL_CAP, X as buildModel, Xt as sameTenantTrigger, Y as appColumnsOf, Yt as sameTenantColumn, Z as conflicts, Zt as migrationOptionUses, _ as disallowedPolicyCalls, _n as extensionSchema, _t as setModuleRenderStore, a as setTableFeature, an as checkedValueMaps, at as moduleTopics, b as readRulePolicies, bn as auditRegistrations, bt as moduleFilePaths, c as RENDERED_FEATURES, cn as AUDIT_CATEGORIES, ct as upgradePlan, d as setTagBlock, dn as declaredColumnTypes, dt as appTablePolicyNotes, en as MODULE_ID_TYPES, et as parseDeclared, f as commentOnTableSql, fn as declaredIndexes, ft as declaredPolicies, g as POLICY_FUNCTIONS, gn as declaredViews, gt as moduleRenderStats, h as setBsbTag, hn as declaredUpdatedAtTriggers, ht as PRELUDE_MODULE, i as setFeatureStatement, in as appValues, it as moduleBody, j as blockReadRoles, jt as moduleEventTriggers, k as checkValues, kt as moduleFileVersion, l as isRenderedFeature, ln as BLOCK_OPTION_SCHEMAS, lt as bsbPolicyName, m as parseBsbComment, mn as declaredTables, mt as PRELUDE_FUNCTIONS, n as createsTable, nn as moduleIdType, nt as splitStatements, o as tableFeatures, on as legacyOptionTables, ot as renderBlocks, p as formatBsbComment, pn as declaredTableColumns, pt as widenedCommands, q as moduleLayout, qt as listDeclare, r as isTableFeature, rn as contractSignature, rt as customContracts, s as tableTagComments, sn as legacyOptionTarget, st as moduleDeprecations, t as TABLE_FEATURES, tn as isBlockSqlIdType, tt as setParseStore, u as renderTagBlock, un as addedColumnTypes, ut as UNSCOPED_MODULE, v as isRule, vn as policyGrants, vt as renderKey, w as compileReadSet, wt as scopePolicyName, x as renderRule, xt as APP_TABLES_MARKER, y as policyFunctionsSql, yn as rlsTables, yt as moduleDataDir, z as moduleWritesText, zt as TENANT_SCOPE_POLICY } from "../sql-
|
|
2
|
+
import { $ as ownerOf, $t as redundantNulls, A as declaredCheckValues, At as sameBlockFile, B as clearMemo, Bt as excludedColumns, C as rulePolicy, Ct as appTablesFiles, D as duplicateObjects, Dt as blockFileState, E as sharedRolesProblems, Et as blockSqlVersion, F as sameTenantLayout, Ft as SQL_MODULES, G as blockTables, Gt as keysetPredicate, H as memoized, Ht as SECRET_COLUMNS, I as adoptedColumnProblems, It as moduleSource, J as entityRenamePlan, Jt as listOrder, K as seedDefaultsFunctions, Kt as listBody, L as adoptedTables, Lt as resolveBlocks, M as tenantsQuery, Mt as moduleHidingColumns, N as expiredFlagsQuery, Nt as modulePermissionKeys, O as writtenValues, Ot as isModuleDataFile, P as ownedColumns, Pt as moduleSchemaExtensions, Q as duplicatePolicies, Qt as moduleContext, R as adoptedViews, Rt as TENANT_SCOPE_NAMES, S as renderRulePolicy, St as APP_TABLES_MODULE, T as compileReadSets, Tt as renderAutoEmbedding, U as setMemoBackend, Ut as dataExportPlan, V as memoStats, Vt as resolveExposeColumns, W as instanceFunctions, Wt as LIST_TOTAL_CAP, X as buildModel, Xt as sameTenantTrigger, Y as appColumnsOf, Yt as sameTenantColumn, Z as conflicts, Zt as migrationOptionUses, _ as disallowedPolicyCalls, _n as extensionSchema, _t as setModuleRenderStore, a as setTableFeature, an as checkedValueMaps, at as moduleTopics, b as readRulePolicies, bn as auditRegistrations, bt as moduleFilePaths, c as RENDERED_FEATURES, cn as AUDIT_CATEGORIES, ct as upgradePlan, d as setTagBlock, dn as declaredColumnTypes, dt as appTablePolicyNotes, en as MODULE_ID_TYPES, et as parseDeclared, f as commentOnTableSql, fn as declaredIndexes, ft as declaredPolicies, g as POLICY_FUNCTIONS, gn as declaredViews, gt as moduleRenderStats, h as setBsbTag, hn as declaredUpdatedAtTriggers, ht as PRELUDE_MODULE, i as setFeatureStatement, in as appValues, it as moduleBody, j as blockReadRoles, jt as moduleEventTriggers, k as checkValues, kt as moduleFileVersion, l as isRenderedFeature, ln as BLOCK_OPTION_SCHEMAS, lt as bsbPolicyName, m as parseBsbComment, mn as declaredTables, mt as PRELUDE_FUNCTIONS, n as createsTable, nn as moduleIdType, nt as splitStatements, o as tableFeatures, on as legacyOptionTables, ot as renderBlocks, p as formatBsbComment, pn as declaredTableColumns, pt as widenedCommands, q as moduleLayout, qt as listDeclare, r as isTableFeature, rn as contractSignature, rt as customContracts, s as tableTagComments, sn as legacyOptionTarget, st as moduleDeprecations, t as TABLE_FEATURES, tn as isBlockSqlIdType, tt as setParseStore, u as renderTagBlock, un as addedColumnTypes, ut as UNSCOPED_MODULE, v as isRule, vn as policyGrants, vt as renderKey, w as compileReadSet, wt as scopePolicyName, x as renderRule, xt as APP_TABLES_MARKER, y as policyFunctionsSql, yn as rlsTables, yt as moduleDataDir, z as moduleWritesText, zt as TENANT_SCOPE_POLICY } from "../sql-ZLYXNvXw.js";
|
|
3
3
|
import { a as LEGACY_OPTION } from "../options-Bfd-k6yw.js";
|
|
4
4
|
import { A as notNullCheckName } from "../shared-D-qwk29i.js";
|
|
5
5
|
import { s as subjectColumns } from "../contributions-Bh-HcHoJ.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as temporalText } from "./temporal-VgABWvpY.js";
|
|
2
|
-
import { a as hasPlaceholder, f as isFunctionSpec, l as splitPlaceholders, r as containsPlaceholder, s as placeholderOf } from "./read-set-
|
|
2
|
+
import { a as hasPlaceholder, f as isFunctionSpec, l as splitPlaceholders, r as containsPlaceholder, s as placeholderOf } from "./read-set-BptYceHc.js";
|
|
3
3
|
import { a as ok } from "./result-DijoXEFG.js";
|
|
4
4
|
import { n as isRecord$1, t as isList } from "./guards-CsRa6v57.js";
|
|
5
5
|
import { t as SPEC_PINS } from "./spec-pins-Dlz8OVqi.js";
|
|
@@ -167,7 +167,7 @@ import { n as WARRANTY_STATUSES } from "./warranty-values-BJo_g1F1.js";
|
|
|
167
167
|
import { n as WORKFLOW_SDK_WORLD } from "./workflow-sdk-c025kSHf.js";
|
|
168
168
|
import { s as permissionMatches$1 } from "./delegation-CnCIKysL.js";
|
|
169
169
|
import { n as quoteIdent, t as compileSql } from "./sql-DqCwJ2qB.js";
|
|
170
|
-
import { t as provideConnectionRuntime } from "./define-runtime-full-
|
|
170
|
+
import { t as provideConnectionRuntime } from "./define-runtime-full-Bh5c_01f.js";
|
|
171
171
|
// src/sql/api-schema.ts
|
|
172
172
|
/** The roles PostgREST runs a request as. */
|
|
173
173
|
const API_ROLES = /* @__PURE__ */ new Set([
|
|
@@ -1145,6 +1145,14 @@ function skipQuoted(sql, at) {
|
|
|
1145
1145
|
return at;
|
|
1146
1146
|
}
|
|
1147
1147
|
/** Each statement of `sql` with what precedes it, up to its semicolon. */
|
|
1148
|
+
/**
|
|
1149
|
+
* The comments before a statement that is dropped, such as a module header, or
|
|
1150
|
+
* nothing when only whitespace precedes it.
|
|
1151
|
+
*/
|
|
1152
|
+
function leadingComments(statement, masked) {
|
|
1153
|
+
const lead = statement.slice(0, masked.search(/\S/));
|
|
1154
|
+
return lead.trim() === "" ? "" : lead;
|
|
1155
|
+
}
|
|
1148
1156
|
function statementSpans(sql) {
|
|
1149
1157
|
const spans = [];
|
|
1150
1158
|
let start = 0;
|
|
@@ -1168,7 +1176,11 @@ const UNMAPPED_TABLE_USE = new RegExp(String.raw`${UNMAPPED_TABLE}(\w+)`);
|
|
|
1168
1176
|
*/
|
|
1169
1177
|
function withoutUnmappedTables(sql, instance) {
|
|
1170
1178
|
if (!sql.includes("bsb_unmapped_table:")) return sql;
|
|
1171
|
-
const out = statementSpans(sql).map(([from, to]) =>
|
|
1179
|
+
const out = statementSpans(sql).map(([from, to]) => {
|
|
1180
|
+
const statement = sql.slice(from, to);
|
|
1181
|
+
const masked = maskComments(statement);
|
|
1182
|
+
return statement.includes("bsb_unmapped_table:") && UNMAPPED_TABLE_DDL.test(masked) ? leadingComments(statement, masked) : statement;
|
|
1183
|
+
}).join("");
|
|
1172
1184
|
const use = UNMAPPED_TABLE_USE.exec(out);
|
|
1173
1185
|
if (use !== null) throw new TypeError(`Module "${instance}" needs table "${use[1]}", which blocks.${instance}.tables maps to null`);
|
|
1174
1186
|
return out;
|
|
@@ -1377,7 +1389,7 @@ function withoutSkippedIndexes(sql, skip) {
|
|
|
1377
1389
|
const drop = named.filter((name) => skip.has(name));
|
|
1378
1390
|
if (drop.length === 0) continue;
|
|
1379
1391
|
removed.push(...drop);
|
|
1380
|
-
out += sql.slice(cursor, from);
|
|
1392
|
+
out += sql.slice(cursor, from) + leadingComments(sql.slice(from, to), statement);
|
|
1381
1393
|
cursor = to;
|
|
1382
1394
|
}
|
|
1383
1395
|
return {
|
|
@@ -23952,7 +23964,15 @@ ${indent}end if;`;
|
|
|
23952
23964
|
const escalatedSet = `coalesce((q.bsb_step ->> 'escalated')::boolean, false)`;
|
|
23953
23965
|
const decidedHere = (row) => `exists (select 1 from ${decisions} x where x.${d("request")} = ${row}.${c("id")} and x.${d("step")} = ${stepOf(row)} and x.${d("approver")} = ${row}.bsb_me)`;
|
|
23954
23966
|
const delegatedHere = delegation ? `\n or exists (select 1 from ${decisions} x where x.${d("request")} = q.${c("id")} and x.${d("step")} = ${stepOf("q")} and x.${d("decision")} = 'delegated' and x.${d("delegateTo")} = q.bsb_me)` : "";
|
|
23955
|
-
const
|
|
23967
|
+
const stepApprovers = escalates ? `case when ${escalatedSet} then ${approversIn("escalateTo")} else ${approversIn("approvers")} end` : approversIn("approvers");
|
|
23968
|
+
const providerSet = approverCheck(ctx, layout, {
|
|
23969
|
+
kind: { sql: `q.${c("subjectType")} || '.' || q.${c("action")}` },
|
|
23970
|
+
subject: `q.${c("subjectId")}::text`,
|
|
23971
|
+
tenant: `q.${c("tenant")}`,
|
|
23972
|
+
requester: `q.${c("requestedBy")}`,
|
|
23973
|
+
approvers: `(coalesce(${stepApprovers}, '{}'::jsonb) || jsonb_build_object('required', coalesce(q.bsb_step -> 'required', '1'::jsonb)))`
|
|
23974
|
+
});
|
|
23975
|
+
const providerFallback = providerSet === void 0 ? "" : `\n or (q.bsb_me is distinct from q.${c("requestedBy")} and coalesce((${providerSet.sql}), false))`;
|
|
23956
23976
|
const linkedSet = linked.flatMap((each) => each.approvable === void 0 ? [] : [`when q.${c("subjectType")} = ${sqlString(each.subject)} then (${each.approvable({
|
|
23957
23977
|
id: `q.${c("id")}`,
|
|
23958
23978
|
subjectId: `q.${c("subjectId")}`,
|
|
@@ -72406,14 +72426,26 @@ set search_path = ''
|
|
|
72406
72426
|
as $$
|
|
72407
72427
|
begin
|
|
72408
72428
|
return (
|
|
72429
|
+
with e as materialized (
|
|
72430
|
+
select x.row, x.n from jsonb_array_elements(${m.fn("messaging_messages_json")}(comments_json.ids)) with ordinality x(row, n)
|
|
72431
|
+
),
|
|
72432
|
+
c as materialized (
|
|
72433
|
+
select c.${cv("id")} as id, c.${cv("subjectType")} as subject_type, c.${cv("subjectId")} as subject_id
|
|
72434
|
+
from ${m.table("conversations")} c
|
|
72435
|
+
where c.${cv("id")} = any (array(select distinct (e.row ->> ${key(ms("conversation"))})::uuid from e))
|
|
72436
|
+
),
|
|
72437
|
+
t as materialized (
|
|
72438
|
+
select t.${k("message")} as message, t.${k("task")} as task from ${tasks} t
|
|
72439
|
+
where t.${k("message")} = any (comments_json.ids)
|
|
72440
|
+
)
|
|
72409
72441
|
select coalesce(jsonb_agg(e.row || jsonb_build_object(
|
|
72410
|
-
'subject_type', c
|
|
72411
|
-
'subject_id', c
|
|
72412
|
-
'task_id', t
|
|
72442
|
+
'subject_type', c.subject_type,
|
|
72443
|
+
'subject_id', c.subject_id,
|
|
72444
|
+
'task_id', t.task
|
|
72413
72445
|
) order by e.n), '[]'::jsonb)
|
|
72414
|
-
from
|
|
72415
|
-
join
|
|
72416
|
-
left join
|
|
72446
|
+
from e
|
|
72447
|
+
join c on c.id = (e.row ->> ${key(ms("conversation"))})::uuid
|
|
72448
|
+
left join t on t.message = (e.row ->> ${key(ms("id"))})::uuid
|
|
72417
72449
|
);
|
|
72418
72450
|
end;
|
|
72419
72451
|
$$;
|
|
@@ -160906,7 +160938,7 @@ function messagesJson(q) {
|
|
|
160906
160938
|
table: t("messages"),
|
|
160907
160939
|
id: ms("id"),
|
|
160908
160940
|
user: ms("author"),
|
|
160909
|
-
visible: `
|
|
160941
|
+
visible: `y.${ms("conversation")} = any (array(select c.${q.cols("conversations")("id")} from ${t("conversations")} c where c.${q.cols("conversations")("id")} = any (array(select distinct v.${ms("conversation")} from ${t("messages")} v where v.${ms("id")} = any ($1))) and ${conversationReadable(q, "c")}))`,
|
|
160910
160942
|
what: "The name and avatar of each message's author, keyed by message id,\n-- for the messages of ids the caller may read."
|
|
160911
160943
|
});
|
|
160912
160944
|
const files = ctx.installed("attachments") ? (() => {
|
|
@@ -219442,6 +219474,7 @@ function build$7(ctx, layout) {
|
|
|
219442
219474
|
const planKeys = typeof layout.entitlements?.source === "object" ? ` or q.${qc("plan")} = any (better_supabase.tenant_plans(tenant))` : "";
|
|
219443
219475
|
const entitled = ctx.entitlements("tenant");
|
|
219444
219476
|
const planMatches = entitled ? `q.${qc("plan")} = '*' or q.${qc("plan")} = any (${entitled})${planKeys}` : `q.${qc("plan")} = '*'`;
|
|
219477
|
+
const planMatchesOnce = entitled ? `q.${qc("plan")} = '*' or q.${qc("plan")} = any ((select ${ctx.entitlements("usage_overview.tenant") ?? entitled})::text[])${planKeys === "" ? "" : ` or q.${qc("plan")} = any ((select better_supabase.tenant_plans(usage_overview.tenant))::text[])`}` : `q.${qc("plan")} = '*'`;
|
|
219445
219478
|
return `${schemaPreamble(ctx)}
|
|
219446
219479
|
-- Usage per tenant, meter and UTC day. Quotas sum the days of their period.
|
|
219447
219480
|
create table if not exists ${counters} (
|
|
@@ -219832,8 +219865,9 @@ begin
|
|
|
219832
219865
|
end;
|
|
219833
219866
|
$$;
|
|
219834
219867
|
|
|
219835
|
-
-- One row per meter: the
|
|
219836
|
-
--
|
|
219868
|
+
-- One row per meter: the tenant's plans and entitlements read once, the quota
|
|
219869
|
+
-- resolved once, the window once per distinct period, and the counters summed
|
|
219870
|
+
-- in one grouped join. The catalog is read once.
|
|
219837
219871
|
create or replace function ${fn("usage_overview")}(tenant ${id})
|
|
219838
219872
|
returns jsonb
|
|
219839
219873
|
language plpgsql
|
|
@@ -219846,12 +219880,15 @@ begin
|
|
|
219846
219880
|
${fail("USAGE_FORBIDDEN", "Not allowed to read usage in this tenant")}
|
|
219847
219881
|
end if;
|
|
219848
219882
|
return (
|
|
219849
|
-
with
|
|
219883
|
+
with scoped as materialized (
|
|
219884
|
+
select q.* from ${quotas} q
|
|
219885
|
+
where q.${qc("tenant")} = usage_overview.tenant
|
|
219886
|
+
or (q.${qc("tenant")} is null and (${planMatchesOnce}))
|
|
219887
|
+
),
|
|
219888
|
+
meters as (
|
|
219850
219889
|
select jsonb_object_keys(${fn("usage_meters")}()) as meter
|
|
219851
219890
|
union
|
|
219852
|
-
select q.${qc("meter")} from
|
|
219853
|
-
where q.${qc("tenant")} = usage_overview.tenant
|
|
219854
|
-
or (q.${qc("tenant")} is null and (${planMatches.replaceAll("(tenant)", "(usage_overview.tenant)")}))
|
|
219891
|
+
select q.${qc("meter")} from scoped q
|
|
219855
219892
|
union
|
|
219856
219893
|
select distinct c.${cc("meter")} from ${counters} c
|
|
219857
219894
|
where c.${cc("tenant")} = usage_overview.tenant
|
|
@@ -219861,10 +219898,8 @@ begin
|
|
|
219861
219898
|
q.${qc("meter")} as meter,
|
|
219862
219899
|
q.${qc("limit")} as quota_limit,
|
|
219863
219900
|
${quotaPeriod("q")} as period
|
|
219864
|
-
from
|
|
219901
|
+
from scoped q
|
|
219865
219902
|
join meters m on m.meter = q.${qc("meter")}
|
|
219866
|
-
where q.${qc("tenant")} = usage_overview.tenant
|
|
219867
|
-
or (q.${qc("tenant")} is null and (${planMatches.replaceAll("(tenant)", "(usage_overview.tenant)")}))
|
|
219868
219903
|
order by q.${qc("meter")}, (q.${qc("tenant")} is not null) desc, q.${qc("limit")} desc nulls first
|
|
219869
219904
|
),
|
|
219870
219905
|
chosen as (
|
package/dist/sqlite/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as localEngine } from "../data-engine-MRAlinsa.js";
|
|
2
|
-
import { i as checkSqlite, r as sqliteExecutor, t as fromSqliteError } from "../executor-
|
|
2
|
+
import { i as checkSqlite, r as sqliteExecutor, t as fromSqliteError } from "../executor-B0nTn-4Q.js";
|
|
3
3
|
// src/sqlite/engine.ts
|
|
4
4
|
/**
|
|
5
5
|
* A UUID v4 from SQLite's `randomblob`, for runtimes without
|
package/dist/sveltekit/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { t as DbException } from "../db-exception-Dv18UZ-I.js";
|
|
|
2
2
|
import { n as bufferInPlace, t as around } from "../shared-Ci1g9nl4.js";
|
|
3
3
|
import { r as dbErrorOf } from "../errors-DK1wGb9z.js";
|
|
4
4
|
import { c as toProblem } from "../problem-BwplIuhI.js";
|
|
5
|
-
import { t as adapterBase } from "../adapter-base-
|
|
5
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
6
6
|
import { _ as withFlush } from "../sessions-Dedk1ubX.js";
|
|
7
|
-
import { a as platformWaitUntil, i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-
|
|
7
|
+
import { a as platformWaitUntil, i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-C9UiMaOq.js";
|
|
8
8
|
import { i as requireCaller, o as runAction } from "../kit-BgRTtW9w.js";
|
|
9
9
|
import { i as refusalTarget } from "../refusal-CgSrkirX.js";
|
|
10
|
-
import { n as extendServer, t as createServer } from "../server-
|
|
10
|
+
import { n as extendServer, t as createServer } from "../server-CqRpnOo0.js";
|
|
11
11
|
import { r as tagFor } from "../tags-CW-KvjdL.js";
|
|
12
12
|
// src/bridges/sveltekit.ts
|
|
13
13
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as bufferInPlace, t as around } from "../shared-Ci1g9nl4.js";
|
|
2
|
-
import { t as adapterBase } from "../adapter-base-
|
|
2
|
+
import { t as adapterBase } from "../adapter-base-BbnpIsy4.js";
|
|
3
3
|
import { _ as withFlush } from "../sessions-Dedk1ubX.js";
|
|
4
|
-
import { i as localsOf, r as frameworkEntry } from "../framework-
|
|
4
|
+
import { i as localsOf, r as frameworkEntry } from "../framework-C9UiMaOq.js";
|
|
5
5
|
import { i as requireCaller, o as runAction } from "../kit-BgRTtW9w.js";
|
|
6
6
|
import { r as refusalResponse } from "../refusal-CgSrkirX.js";
|
|
7
|
-
import { n as extendServer, t as createServer } from "../server-
|
|
7
|
+
import { n as extendServer, t as createServer } from "../server-CqRpnOo0.js";
|
|
8
8
|
// src/bridges/tanstack-start.ts
|
|
9
9
|
/**
|
|
10
10
|
* The `response` of a request middleware's `next()` result; server function
|
package/dist/testing/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { i as fromBase64, o as toBase64Url, t as base64ToText } from "../base64-CEBz6-Jj.js";
|
|
2
2
|
import { t as DbException } from "../db-exception-Dv18UZ-I.js";
|
|
3
3
|
import { n as dbError } from "../errors-DK1wGb9z.js";
|
|
4
|
-
import { t as provideConnectionRuntime } from "../define-runtime-full-
|
|
4
|
+
import { t as provideConnectionRuntime } from "../define-runtime-full-Bh5c_01f.js";
|
|
5
5
|
import { ENV_VARIABLES } from "../env/index.js";
|
|
6
6
|
import { t as postgresExecutor } from "../executor-BWg7xw7c.js";
|
|
7
7
|
import { i as seedLite, n as loadLite, r as migrateLite, t as LITE_INSTALL } from "../runtime-sBnEajcK.js";
|
|
8
8
|
import { n as parseDbStats } from "../timing-D5QtD9FE.js";
|
|
9
9
|
import { n as isPrefetch } from "../request-kind-BMNdlQpz.js";
|
|
10
10
|
import { t as importOptionalPeer } from "../optional-peer-5SOYr3lL.js";
|
|
11
|
-
import { _ as BetterSupabase } from "../codec-
|
|
11
|
+
import { _ as BetterSupabase } from "../codec-Cjquuv8M.js";
|
|
12
12
|
import { d as temporalText } from "../temporal-VgABWvpY.js";
|
|
13
13
|
import { t as temporal } from "../temporal-required-DQ1KN6UV.js";
|
|
14
14
|
import { t as organizationsEvents } from "../events-CCw0FE_F.js";
|
|
@@ -34,7 +34,7 @@ import { t as AUTHZ_VERSION_CLAIM } from "../claim-names-B3KyK7Js.js";
|
|
|
34
34
|
import { c as snapshotOf } from "../snapshot-C1KUHKTc.js";
|
|
35
35
|
import { c as requestOf, i as defineAuthorizer, r as checkPermission } from "../authorizer-DtUCjKBn.js";
|
|
36
36
|
import { t as mailHeaders } from "../delivery-SmPHu2_H.js";
|
|
37
|
-
import { t as defineApiModel } from "../build-
|
|
37
|
+
import { t as defineApiModel } from "../build-Cb9yLxtS.js";
|
|
38
38
|
import { i as resolveConfig, r as generatorProblem } from "../config-DzPViWQU.js";
|
|
39
39
|
import { i as embedVectors } from "../knowledge-LNI5C6QT.js";
|
|
40
40
|
import { n as toFhirPrescription } from "../prescriptions-CzY13vFr.js";
|
package/dist/webmcp/index.js
CHANGED
package/package.json
CHANGED
package/dist/cli/add-CeZUs_jU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as addCommand } from "./add-B63B07UG.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as powersyncStreamsCommand } from "./powersync-WhAasez3.js";
|