better-supabase 0.63.2 → 0.64.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/dist/{adapter-base-DXF0tNJJ.js → adapter-base-BWp_GpBq.js} +1 -1
- package/dist/{api-DhCLHpIU.js → api-TwaJ4nS8.js} +1 -1
- package/dist/astro/index.js +3 -3
- package/dist/{build-Vd4JkaqJ.js → build-CF_wE706.js} +1 -1
- package/dist/cli/{add-B8H-eHVK.js → add-CAEF20DB.js} +9 -9
- package/dist/cli/{add-DzsB2EMd.js → add-DAbzG8-C.js} +2 -2
- package/dist/cli/add-bP1hqEPB.js +1 -0
- package/dist/cli/{app-table-files-BNbkk4mU.js → app-table-files-BNnw-4C9.js} +3 -3
- package/dist/cli/{app-tables-B9xoTgSg.js → app-tables-D2TRhx62.js} +2 -2
- package/dist/cli/{backfill-DxGGF0tw.js → backfill-DgqbUamk.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-zWXWOGcv.js → blocks-CWVG1w3P.js} +1 -1
- package/dist/cli/{blocks-xgk0tdfI.js → blocks-DykCgrRb.js} +1 -1
- package/dist/cli/{cache-DGTzqvsc.js → cache-JroD4zCO.js} +1 -1
- package/dist/cli/{codemod-C63P8ybN.js → codemod-CAz5XmH0.js} +4 -4
- package/dist/cli/{codemod-naming-wb0ni9VH.js → codemod-naming-DtzMgEs7.js} +1 -1
- package/dist/cli/{column-renames-Cw-VJmbc.js → column-renames-DcEFMXX4.js} +2 -2
- package/dist/cli/{content-mapper-DXjq7Wfl.js → content-mapper-DQczPByw.js} +1 -1
- package/dist/cli/{dev-r1oRNl1e.js → dev-Bwy7jmxv.js} +3 -3
- package/dist/cli/{doctor-BHIIEqOU.js → doctor-BjwgIEEk.js} +17 -17
- package/dist/cli/{emit-C6S__22g.js → emit-D1NL_ewe.js} +2 -2
- package/dist/cli/{gen-DWNQMbqr.js → gen-5GahcSRz.js} +3 -3
- package/dist/cli/{gen-tasks-D0_qerE6.js → gen-tasks-BNqtXDSZ.js} +9 -9
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-DiYhhVtO.js → init-DwJ-fzKE.js} +8 -8
- package/dist/cli/{live-C7AMtQsQ.js → live-hA0NkWeP.js} +2 -2
- package/dist/cli/{mcp-DaymIFzT.js → mcp-BpU-r3at.js} +2 -2
- package/dist/cli/{memo-backend-DaO-IuUk.js → memo-backend-jPoQR64l.js} +1 -1
- package/dist/cli/{metadata-CsSZ8mZc.js → metadata-DsItgHac.js} +4 -4
- package/dist/cli/{migrate-Ceai0fte.js → migrate-bs8m1S4X.js} +1 -1
- package/dist/cli/{migration-safety-BXKmX5ar.js → migration-safety-CYnC7qr0.js} +1 -1
- package/dist/cli/{module-migration-ueN8AWpK.js → module-migration-DI1bC407.js} +1 -1
- package/dist/cli/{partition-DMv3-JOr.js → partition-B_o9eCEl.js} +1 -1
- package/dist/cli/powersync-BeiG2uAK.js +1 -0
- package/dist/cli/{powersync-QpdoYTM1.js → powersync-CYzLue5S.js} +3 -3
- package/dist/cli/{print-CQe9SQD_.js → print-CX3mfrR4.js} +2 -2
- package/dist/cli/{providers-DocDgHot.js → providers-C_0X8CZ5.js} +1 -1
- package/dist/cli/{prune-workflows-w_4KdMR9.js → prune-workflows-BRymSktV.js} +1 -1
- package/dist/cli/{remove-DvnCBCVe.js → remove-Ddd7JMeU.js} +6 -6
- package/dist/cli/{render-X1jNuye8.js → render-D0JOrrdH.js} +4 -4
- package/dist/cli/{render-cache-Be5Sm_Eu.js → render-cache-B6_cW4jQ.js} +1 -1
- package/dist/cli/{run-BoLLvybx.js → run-CRbd_qI2.js} +30 -30
- package/dist/cli/{run-72NxM1zM.js → run-CivaFfvS.js} +101 -21
- package/dist/cli/{shared-BR48oJN4.js → shared-77CYy2Ff.js} +1 -1
- package/dist/cli/{source-aefKuXMY.js → source-H6tArdAg.js} +1 -1
- package/dist/cli/{spec-Dvz-C4MP.js → spec-Bn4ArkKk.js} +2 -2
- package/dist/cli/{spec-CxtMMgXM.js → spec-CKr1A_Oo.js} +1 -1
- package/dist/cli/{sql-layout-B2fda2KP.js → sql-layout--Tblsahr.js} +2 -2
- package/dist/cli/{squash-D7KwCZHj.js → squash-BdHHGvSy.js} +1 -1
- package/dist/cli/{sync-DvD3jbb4.js → sync-koAHC0Xq.js} +4 -4
- package/dist/cli/{upgrade-hDU5DI6_.js → upgrade-B6MOyby0.js} +5 -5
- package/dist/cli/{upgrade-C6Pw49Jc.js → upgrade-D9dPPfIy.js} +5 -5
- package/dist/cli/{version-CiDgdPUD.js → version-3_JBFBjw.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.js +2 -2
- package/dist/{composite-C13UCNgm.js → composite-RorL_F8I.js} +1 -1
- package/dist/config/index.js +4 -4
- package/dist/{config-1kAVpZc_.js → config-BuZW7wNr.js} +3 -3
- package/dist/{config-L5_4kg24.js → config-ocvgjLWV.js} +1 -1
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.js +4 -4
- package/dist/{define-runtime-BbNPkt-5.js → define-runtime-DQC2Gjdr.js} +4 -0
- package/dist/{define-runtime-full-gpz09qAj.js → define-runtime-full-BIrEQWJR.js} +1 -1
- package/dist/edge/index.js +4 -4
- package/dist/{executor-DABWqMfV.js → executor-D7avvqx3.js} +1 -1
- package/dist/expo/index.js +3 -3
- package/dist/{former-permission-keys-FPrqQHXf.js → former-permission-keys-DVwR65bj.js} +1 -1
- package/dist/{framework-BQgHM3zD.js → framework-DxCx0pmS.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-B2NJNoRd.d.ts → index-CwvF-r09.d.ts} +8 -0
- package/dist/{instances-PZAWgQEX.js → instances-B9oCgEOH.js} +76 -0
- package/dist/{json-schema-BwfI_jJ2.js → json-schema-BuzopJOK.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-Cif2SnK4.js → mcp-BCP-kBjf.js} +3 -3
- package/dist/next/index.js +2 -2
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.js +5 -5
- package/dist/{ports-ClJbgoyt.js → ports-BfHdHz1e.js} +1 -1
- package/dist/powersync/index.js +1 -1
- package/dist/preset/index.js +3 -3
- package/dist/{preset-BcwGsW_B.js → preset-DrfMF0Hv.js} +2 -2
- package/dist/{project-DYyr_iyu.js → project-BdZTXDVG.js} +5 -5
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/server.d.ts +1 -1
- package/dist/react/server.js +1 -1
- package/dist/{react-hb2gg5UV.js → react-BkLf1aNc.js} +14 -1
- package/dist/react-router/index.js +3 -3
- package/dist/server/index.js +4 -4
- package/dist/{server-B0T944J9.js → server-DpcMKAt_.js} +1 -1
- package/dist/solid-start/index.js +3 -3
- package/dist/spec/index.js +2 -2
- package/dist/sql/index.js +2 -2
- package/dist/{sql-DPpcMNUF.js → sql-B3e0Ji-Q.js} +79 -3
- 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-B9H4YoiS.js → version-Adj2H6dY.js} +1 -1
- package/dist/webmcp/index.js +1 -1
- package/package.json +1 -1
- package/skills/better-supabase/references/ui-recipes.md +1174 -532
- package/dist/cli/add-BpikP7u5.js +0 -1
- package/dist/cli/powersync-CEhwfawV.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as runsWithInvalidConfig, d as DOCS_ORIGIN, f as GROUPS, g as runCommand, h as parseArgs$2, i as joinRepeated, l as COMMANDS, o as listArgs, p as RESERVED_NAMES, s as readsLegacyTables, t as GLOBAL_ARGS } from "./command-fqvJ0TdG.js";
|
|
2
2
|
import { s as setCacheEnabled } from "./store-DP-nmqBt.js";
|
|
3
3
|
import { n as highlight, r as painter } from "./style-B5-nByxb.js";
|
|
4
|
-
import { t as VERSION } from "./version-
|
|
4
|
+
import { t as VERSION } from "./version-3_JBFBjw.js";
|
|
5
5
|
import { a as missingInputNext, o as resolveAgent, t as checkConsent } from "./agent-BlYLJPzM.js";
|
|
6
6
|
import { a as isActionRequired, l as toCliError, n as CliError, o as isReport, s as isRetryable } from "./errors-B7i-VGxk.js";
|
|
7
7
|
import { r as splitCommandLine } from "./shell-omi9-T2X.js";
|
|
@@ -21,48 +21,48 @@ const LOADERS = [
|
|
|
21
21
|
["login", () => import("./account-BzhVD6jJ.js").then((m) => m.loginCommand)],
|
|
22
22
|
["logout", () => import("./account-BzhVD6jJ.js").then((m) => m.logoutCommand)],
|
|
23
23
|
["whoami", () => import("./account-BzhVD6jJ.js").then((m) => m.whoamiCommand)],
|
|
24
|
-
["init", () => import("./init-
|
|
25
|
-
["add", () => import("./add-
|
|
26
|
-
["remove", () => import("./remove-
|
|
27
|
-
["upgrade", () => import("./upgrade-
|
|
24
|
+
["init", () => import("./init-DwJ-fzKE.js").then((m) => m.initCommand)],
|
|
25
|
+
["add", () => import("./add-bP1hqEPB.js").then((m) => m.addCommand)],
|
|
26
|
+
["remove", () => import("./remove-Ddd7JMeU.js").then((m) => m.removeCommand)],
|
|
27
|
+
["upgrade", () => import("./upgrade-D9dPPfIy.js").then((m) => m.upgradeCommand)],
|
|
28
28
|
["table", () => import("./table-CcO-m_7t.js").then((m) => m.tableCommand)],
|
|
29
|
-
["migrate schema-first", () => import("./migrate-
|
|
30
|
-
["gen", () => import("./gen-
|
|
31
|
-
["doctor", () => import("./doctor-
|
|
29
|
+
["migrate schema-first", () => import("./migrate-bs8m1S4X.js").then((m) => m.migrateSchemaFirstCommand)],
|
|
30
|
+
["gen", () => import("./gen-5GahcSRz.js").then((m) => m.genCommand)],
|
|
31
|
+
["doctor", () => import("./doctor-BjwgIEEk.js").then((m) => m.doctorCommand)],
|
|
32
32
|
["codes", () => import("./codes-D_oa7Aw5.js").then((m) => m.codesCommand)],
|
|
33
33
|
["db query", () => import("./db-C4up7wFU.js").then((m) => m.dbQueryCommand)],
|
|
34
34
|
["db diff", () => import("./db-C4up7wFU.js").then((m) => m.dbDiffCommand)],
|
|
35
35
|
["db seed", () => import("./seed-B3MrC1Qe.js").then((m) => m.seedCommand)],
|
|
36
|
-
["db backfill", () => import("./backfill-
|
|
36
|
+
["db backfill", () => import("./backfill-DgqbUamk.js").then((m) => m.dbBackfillCommand)],
|
|
37
37
|
["db verify", () => import("./verify-CR7f21Ri.js").then((m) => m.dbVerifyCommand)],
|
|
38
|
-
["db partition", () => import("./partition-
|
|
39
|
-
["db squash", () => import("./squash-
|
|
40
|
-
["workflows prune", () => import("./prune-workflows-
|
|
41
|
-
["dev", () => import("./dev-
|
|
38
|
+
["db partition", () => import("./partition-B_o9eCEl.js").then((m) => m.dbPartitionCommand)],
|
|
39
|
+
["db squash", () => import("./squash-BdHHGvSy.js").then((m) => m.dbSquashCommand)],
|
|
40
|
+
["workflows prune", () => import("./prune-workflows-BRymSktV.js").then((m) => m.workflowsPruneCommand)],
|
|
41
|
+
["dev", () => import("./dev-Bwy7jmxv.js").then((m) => m.devCommand)],
|
|
42
42
|
["dev env", () => import("./env-bItpF97w.js").then((m) => m.envCommand)],
|
|
43
43
|
["dev run", () => import("./run-DbR0NaN_.js").then((m) => m.runCommand)],
|
|
44
44
|
["dev keys", () => import("./keys-f9iMQepr.js").then((m) => m.keysCommand)],
|
|
45
45
|
["dev stack ls", () => import("./stack-BUrc8jsg.js").then((m) => m.stackLsCommand)],
|
|
46
46
|
["dev stack prune", () => import("./stack-BUrc8jsg.js").then((m) => m.stackPruneCommand)],
|
|
47
47
|
["automations list", () => import("./automations-C1yZj3mn.js").then((m) => m.automationsListCommand)],
|
|
48
|
-
["blocks list", () => import("./blocks-
|
|
49
|
-
["blocks view", () => import("./blocks-
|
|
50
|
-
["blocks search", () => import("./blocks-
|
|
51
|
-
["powersync streams", () => import("./powersync-
|
|
52
|
-
["spec emit", () => import("./spec-
|
|
53
|
-
["spec validate", () => import("./spec-
|
|
54
|
-
["mcp", () => import("./mcp-
|
|
48
|
+
["blocks list", () => import("./blocks-DykCgrRb.js").then((m) => m.blocksListCommand)],
|
|
49
|
+
["blocks view", () => import("./blocks-DykCgrRb.js").then((m) => m.blocksViewCommand)],
|
|
50
|
+
["blocks search", () => import("./blocks-DykCgrRb.js").then((m) => m.blocksSearchCommand)],
|
|
51
|
+
["powersync streams", () => import("./powersync-BeiG2uAK.js").then((m) => m.powersyncStreamsCommand)],
|
|
52
|
+
["spec emit", () => import("./spec-CKr1A_Oo.js").then((m) => m.specEmitCommand)],
|
|
53
|
+
["spec validate", () => import("./spec-CKr1A_Oo.js").then((m) => m.specValidateCommand)],
|
|
54
|
+
["mcp", () => import("./mcp-BpU-r3at.js").then((m) => m.mcpCommand)],
|
|
55
55
|
["skills list", () => import("./skills-C4vNmuxw.js").then((m) => m.skillsListCommand)],
|
|
56
56
|
["skills install", () => import("./skills-C4vNmuxw.js").then((m) => m.skillsInstallCommand)],
|
|
57
|
-
["codemod naming", () => import("./codemod-
|
|
58
|
-
["codemod extra-columns", () => import("./codemod-
|
|
59
|
-
["codemod owned-columns", () => import("./codemod-
|
|
60
|
-
["codemod config", () => import("./codemod-
|
|
61
|
-
["codemod table-modules", () => import("./codemod-
|
|
62
|
-
["codemod account-calls", () => import("./codemod-
|
|
63
|
-
["codemod server-imports", () => import("./codemod-
|
|
64
|
-
["codemod generators", () => import("./codemod-
|
|
65
|
-
["codemod read-many", () => import("./codemod-
|
|
57
|
+
["codemod naming", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("naming"))],
|
|
58
|
+
["codemod extra-columns", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("extra-columns"))],
|
|
59
|
+
["codemod owned-columns", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("owned-columns"))],
|
|
60
|
+
["codemod config", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("config"))],
|
|
61
|
+
["codemod table-modules", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("table-modules"))],
|
|
62
|
+
["codemod account-calls", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("account-calls"))],
|
|
63
|
+
["codemod server-imports", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("server-imports"))],
|
|
64
|
+
["codemod generators", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("generators"))],
|
|
65
|
+
["codemod read-many", () => import("./codemod-CAz5XmH0.js").then((m) => m.codemodCommand("read-many"))],
|
|
66
66
|
["completion", () => import("./completion-Ct0kXYpV.js").then((m) => m.completionCommand)],
|
|
67
67
|
["cache purge", () => import("./cache-DwdJCb29.js").then((m) => m.cachePurgeCommand)],
|
|
68
68
|
["config", () => import("./config-J8LaJ0Nl.js").then((m) => m.configCommand)]
|
|
@@ -747,7 +747,7 @@ function cliFromTree(init, extra = {}) {
|
|
|
747
747
|
digest: globals["effects-digest"]
|
|
748
748
|
});
|
|
749
749
|
};
|
|
750
|
-
await import("./memo-backend-
|
|
750
|
+
await import("./memo-backend-jPoQR64l.js").then(({ installMemo }) => installMemo(config.root));
|
|
751
751
|
context = {
|
|
752
752
|
cwd,
|
|
753
753
|
config,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as CACHE_DIR } from "./store-DP-nmqBt.js";
|
|
2
2
|
import { a as entitlementsMode, c as unsafeKey, i as entitlementRequirements, n as accessRequirements, o as moduleKeyProblems, s as providerLabel } from "./authorization-CNWhpdKb.js";
|
|
3
|
-
import { B as typegenVersionNotice, H as installedVersion, L as stabilizeMetadata, N as oxfmtInstalled, V as declaredPeers, W as satisfies, d as loadSnapshot, i as migrationsDir, z as typegenVersion } from "./sql-layout
|
|
4
|
-
import { s as schemaStampPath } from "./content-mapper-
|
|
3
|
+
import { B as typegenVersionNotice, H as installedVersion, L as stabilizeMetadata, N as oxfmtInstalled, V as declaredPeers, W as satisfies, d as loadSnapshot, i as migrationsDir, z as typegenVersion } from "./sql-layout--Tblsahr.js";
|
|
4
|
+
import { s as schemaStampPath } from "./content-mapper-DQczPByw.js";
|
|
5
5
|
import { a as changedFiles, d as fileDiff, i as changeLines, r as applyPlan, s as hasConflicts } from "./files-NnXnawki.js";
|
|
6
6
|
import { a as sameText, t as display } from "./io-CngfGyMA.js";
|
|
7
|
-
import { n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-
|
|
7
|
+
import { n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-D2TRhx62.js";
|
|
8
8
|
import { r as errorText } from "./errors-B7i-VGxk.js";
|
|
9
|
-
import { c as qualified, l as tableObject, r as exposed, s as policyObject, t as catalogOf } from "./shared-
|
|
10
|
-
import { a as storeTypesModule, o as typesModuleKey, s as writeAtomic } from "./cache-
|
|
9
|
+
import { c as qualified, l as tableObject, r as exposed, s as policyObject, t as catalogOf } from "./shared-77CYy2Ff.js";
|
|
10
|
+
import { a as storeTypesModule, o as typesModuleKey, s as writeAtomic } from "./cache-JroD4zCO.js";
|
|
11
11
|
import { t as compiledReadSets } from "./read-sets-77o7SxpK.js";
|
|
12
|
-
import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-
|
|
12
|
+
import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-DI1bC407.js";
|
|
13
13
|
import { t as byCodePoint } from "./compare-yl4sSwVn.js";
|
|
14
|
-
import { n as render } from "./render-
|
|
14
|
+
import { n as render } from "./render-D0JOrrdH.js";
|
|
15
15
|
import { existsSync } from "node:fs";
|
|
16
16
|
import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
17
17
|
import { readFile } from "node:fs/promises";
|
|
@@ -377,29 +377,108 @@ function onlyWrapped(name, expressions) {
|
|
|
377
377
|
}
|
|
378
378
|
return calls > 0 && calls === wraps;
|
|
379
379
|
}
|
|
380
|
+
const templateName = (template) => {
|
|
381
|
+
const name = template?.slice(0, template.indexOf("(")).trim();
|
|
382
|
+
return name ? [escape(name).replaceAll(escape("{scope}"), "\\w+")] : [];
|
|
383
|
+
};
|
|
384
|
+
const NO_PINS = {
|
|
385
|
+
sets: [],
|
|
386
|
+
platform: []
|
|
387
|
+
};
|
|
388
|
+
function tenantPins(context) {
|
|
389
|
+
const functions = context.config.authorization?.functions;
|
|
390
|
+
return {
|
|
391
|
+
sets: [...templateName(functions?.idsWith), ...templateName(functions?.memberIds)],
|
|
392
|
+
platform: templateName(functions?.isPlatform)
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function unwrap(expression) {
|
|
396
|
+
let text = expression.trim();
|
|
397
|
+
while (text.startsWith("(") && closing(text, 0) === text.length - 1) text = text.slice(1, -1).trim();
|
|
398
|
+
return text;
|
|
399
|
+
}
|
|
400
|
+
function closing(text, open) {
|
|
401
|
+
let depth = 0;
|
|
402
|
+
let quoted = false;
|
|
403
|
+
for (let at = open; at < text.length; at += 1) {
|
|
404
|
+
const char = text.charAt(at);
|
|
405
|
+
if (char === "'") quoted = !quoted;
|
|
406
|
+
else if (!quoted) {
|
|
407
|
+
depth += char === "(" ? 1 : char === ")" ? -1 : 0;
|
|
408
|
+
if (depth === 0) return at;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return -1;
|
|
412
|
+
}
|
|
413
|
+
function operands(expression, op) {
|
|
414
|
+
const parts = [];
|
|
415
|
+
const word = new RegExp(`^\\s+${op}\\s+`, "i");
|
|
416
|
+
let depth = 0;
|
|
417
|
+
let quoted = false;
|
|
418
|
+
let from = 0;
|
|
419
|
+
for (let at = 0; at < expression.length; at += 1) {
|
|
420
|
+
const char = expression.charAt(at);
|
|
421
|
+
if (char === "'") quoted = !quoted;
|
|
422
|
+
else if (!quoted) {
|
|
423
|
+
depth += char === "(" ? 1 : char === ")" ? -1 : 0;
|
|
424
|
+
const match = depth === 0 ? word.exec(expression.slice(at)) : null;
|
|
425
|
+
if (match) {
|
|
426
|
+
parts.push(expression.slice(from, at));
|
|
427
|
+
from = at + match[0].length;
|
|
428
|
+
at = from - 1;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
parts.push(expression.slice(from));
|
|
433
|
+
return parts.map((part) => part.trim()).filter((part) => part !== "");
|
|
434
|
+
}
|
|
435
|
+
function holds(expression, atom, orNull) {
|
|
436
|
+
const text = unwrap(expression);
|
|
437
|
+
const branches = operands(text, "or");
|
|
438
|
+
if (branches.length > 1) return branches.every((branch) => holds(branch, atom, orNull));
|
|
439
|
+
const parts = operands(text, "and");
|
|
440
|
+
if (parts.length > 1) return parts.some((part) => holds(part, atom, orNull)) || orNull !== void 0 && parts.some((part) => orNull.column.test(unwrap(part))) && parts.some((part) => orNull.platform.test(part));
|
|
441
|
+
return !/\bor\b/i.test(text) && atom.test(text);
|
|
442
|
+
}
|
|
380
443
|
/**
|
|
381
444
|
* Whether every permissive policy that lets `role` run `command` holds `column`
|
|
382
|
-
* to a tenant the caller acts in
|
|
383
|
-
* `
|
|
384
|
-
*
|
|
385
|
-
* name a tenant the caller isn't in then.
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* `or
|
|
445
|
+
* to a tenant the caller acts in: equal to `current_tenant_id()`, passed to
|
|
446
|
+
* `can('tenant', column, ...)`, or in `(select tenant_ids_with(...))`, `(select
|
|
447
|
+
* member_<tenant>_ids())` or the provider's `idsWith` and `memberIds` helpers.
|
|
448
|
+
* A write can't name a tenant the caller isn't in then. An `or` holds when each
|
|
449
|
+
* branch does, and a branch that writes a null tenant under a platform check
|
|
450
|
+
* (`is_platform(...)` or the provider's `isPlatform`) holds too: only a
|
|
451
|
+
* platform role writes those rows. The guest branch `ctx.scope.guest` adds (`or
|
|
452
|
+
* (column, ...) in (select g.tenant ... portal_subjects(...) g)`) pins it to a
|
|
453
|
+
* tenant the caller is a guest of.
|
|
389
454
|
*/
|
|
390
|
-
function pinnedToTenant(table, column, command, role) {
|
|
455
|
+
function pinnedToTenant(table, column, command, role, pins = NO_PINS) {
|
|
391
456
|
if (!table.rls) return false;
|
|
392
457
|
const col = `"?${escape(column)}"?`;
|
|
458
|
+
const sets = ["better_supabase\\.(?:tenant_ids_with|member_\\w+_ids)", ...pins.sets];
|
|
393
459
|
const pin = new RegExp([
|
|
394
460
|
`(?<![\\w."])${col}\\s*=\\s*\\(?\\s*(?:select\\s+)?better_supabase\\.current_tenant_id\\(\\)`,
|
|
395
461
|
`better_supabase\\.can\\(\\s*'tenant'(?:::text)?\\s*,\\s*${col}\\s*,`,
|
|
396
|
-
`(?<![\\w."])${col}\\s+in\\s+\\(\\s*select\\s+
|
|
462
|
+
`(?<![\\w."])${col}\\s+in\\s+\\(\\s*select\\s+(?:${sets.join("|")})\\(`
|
|
397
463
|
].join("|"), "i");
|
|
464
|
+
const orNull = {
|
|
465
|
+
column: new RegExp(`^(?:\\w+\\.)?${col}\\s+is\\s+null$`, "i"),
|
|
466
|
+
platform: new RegExp(`(?:${["better_supabase\\.is_platform", ...pins.platform].join("|")})\\(`, "i")
|
|
467
|
+
};
|
|
398
468
|
const guest = new RegExp(`\\bor\\s+\\(*\\(?${col}\\)?(?:::text)?\\s*,(?:[^()]|\\([^()]*\\))*\\)\\s+in\\s+\\(\\s*select\\s+g\\.tenant\\b[^()]*from\\s+better_supabase\\.portal_(?:subjects|parties)\\([^()]*\\)\\s+g(?:\\([^()]*\\))?\\)`, "gi");
|
|
399
469
|
const applying = table.policies.filter((policy) => policy.permissive && (policy.command === "all" || policy.command === command) && appliesTo(policy, role));
|
|
400
470
|
return applying.length > 0 && applying.every((policy) => {
|
|
401
471
|
const check = (policy.check ?? policy.using)?.replaceAll(guest, "");
|
|
402
|
-
return check !== void 0 &&
|
|
472
|
+
return check !== void 0 && holds(check, pin, orNull);
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
function pinnedToCaller(table, column, command, role) {
|
|
476
|
+
if (!table.rls || command !== "insert") return false;
|
|
477
|
+
const atom = new RegExp(`(?<![\\w."])"?${escape(column)}"?\\s*=\\s*\\(\\s*select\\s+auth\\.uid\\(\\)`, "i");
|
|
478
|
+
const applying = table.policies.filter((policy) => policy.permissive && (policy.command === "all" || policy.command === command) && appliesTo(policy, role));
|
|
479
|
+
return applying.length > 0 && applying.every((policy) => {
|
|
480
|
+
const check = policy.check ?? policy.using;
|
|
481
|
+
return check !== null && holds(check, atom);
|
|
403
482
|
});
|
|
404
483
|
}
|
|
405
484
|
/**
|
|
@@ -408,11 +487,11 @@ function pinnedToTenant(table, column, command, role) {
|
|
|
408
487
|
* stops a write from taking over another row), and so is a column every policy
|
|
409
488
|
* pins to the request's tenant, unless the provider lists it in `deciding`.
|
|
410
489
|
*/
|
|
411
|
-
function writableColumns(table, columns, command, role, deciding = /* @__PURE__ */ new Set()) {
|
|
490
|
+
function writableColumns(table, columns, command, role, deciding = /* @__PURE__ */ new Set(), pins) {
|
|
412
491
|
if (!policyAllows(table, command, role)) return [];
|
|
413
492
|
const privilege = command.toUpperCase();
|
|
414
493
|
const tableLevel = table.grants.some((grant) => grantsTo(grant, role) && grant.privileges.includes(privilege));
|
|
415
|
-
const risky = columns.filter((column) => deciding.has(column) || !(table.primaryKey.length === 1 && table.primaryKey[0] === column) && !pinnedToTenant(table, column, command, role));
|
|
494
|
+
const risky = columns.filter((column) => deciding.has(column) || !(table.primaryKey.length === 1 && table.primaryKey[0] === column) && !pinnedToTenant(table, column, command, role, pins) && !pinnedToCaller(table, column, command, role));
|
|
416
495
|
if (tableLevel) return risky;
|
|
417
496
|
return risky.filter((column) => (table.columnGrants ?? []).some((grant) => grantsTo(grant, role) && grant.column === column && grant.privileges.includes(privilege)));
|
|
418
497
|
}
|
|
@@ -531,9 +610,10 @@ const RLS_RULES = [
|
|
|
531
610
|
code: "BS213",
|
|
532
611
|
severity: "warning",
|
|
533
612
|
title: "API roles can write the columns that grant access",
|
|
534
|
-
description: "RLS helpers decide access from columns such as `memberships.user_id`, `memberships.role` or `contacts.customer_id`, and an authorization provider lists them as `decidingColumns`. When `anon` or `authenticated` may insert or update one of them, and a policy lets them write the row, a user can grant themselves access. A table-level grant counts even after a column-level revoke. A single-column primary key, a tenant column every write policy pins to a tenant the caller acts in (`current_tenant_id()`, `can('tenant', column, ...)`, `tenant_ids_with(...)
|
|
613
|
+
description: "RLS helpers decide access from columns such as `memberships.user_id`, `memberships.role` or `contacts.customer_id`, and an authorization provider lists them as `decidingColumns`. When `anon` or `authenticated` may insert or update one of them, and a policy lets them write the row, a user can grant themselves access. A table-level grant counts even after a column-level revoke. A single-column primary key, a tenant column every write policy pins to a tenant the caller acts in (`current_tenant_id()`, `can('tenant', column, ...)`, `tenant_ids_with(...)`, the membership helper `member_organization_ids()` or the provider's `idsWith` and `memberIds` helpers, alone, next to a guest's grant from `portal_subjects()`, or next to a branch that writes a null tenant under a platform check), a column every insert policy pins to the caller (`column = (select auth.uid())`, on insert only), a subject's `deletedAt` column in `config.recordTypes` and a block's soft-delete column (they only hide rows) don't count unless the provider lists them.",
|
|
535
614
|
check: (context) => {
|
|
536
615
|
const tables = new Map(catalogOf(context).tables.map((table) => [qualified(table), table]));
|
|
616
|
+
const pins = tenantPins(context);
|
|
537
617
|
return [...grantColumns(context)].flatMap(([name, byColumn]) => {
|
|
538
618
|
const table = tables.get(name);
|
|
539
619
|
if (!table) return [];
|
|
@@ -545,7 +625,7 @@ const RLS_RULES = [
|
|
|
545
625
|
const tableLevel = [];
|
|
546
626
|
const revoked = /* @__PURE__ */ new Set();
|
|
547
627
|
for (const command of WRITES) {
|
|
548
|
-
const writable = writableColumns(table, columns, command, role, deciding);
|
|
628
|
+
const writable = writableColumns(table, columns, command, role, deciding, pins);
|
|
549
629
|
if (writable.length === 0) continue;
|
|
550
630
|
writes.push(`${role} may ${command} ${writable.join(", ")}`);
|
|
551
631
|
const privilege = command.toUpperCase();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VERSION } from "./version-
|
|
1
|
+
import { t as VERSION } from "./version-3_JBFBjw.js";
|
|
2
2
|
import { n as CliError } from "./errors-B7i-VGxk.js";
|
|
3
3
|
import { r as redactUrl } from "./redact--zOGdWzo.js";
|
|
4
4
|
import { n as HTTP_CHANNEL } from "./trace-D3TNqWBg.js";
|
|
@@ -4,8 +4,8 @@ import { t as CACHE_DIR } from "./store-DP-nmqBt.js";
|
|
|
4
4
|
import { i as failedResult, n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
|
|
5
5
|
import { a as changedFiles, i as changeLines, r as applyPlan } from "./files-NnXnawki.js";
|
|
6
6
|
import { t as display } from "./io-CngfGyMA.js";
|
|
7
|
-
import { s as writeAtomic } from "./cache-
|
|
8
|
-
import { t as VERSION } from "./version-
|
|
7
|
+
import { s as writeAtomic } from "./cache-JroD4zCO.js";
|
|
8
|
+
import { t as VERSION } from "./version-3_JBFBjw.js";
|
|
9
9
|
import { t as importFresh } from "./fresh-import-CdO2oQaQ.js";
|
|
10
10
|
import { t as isRecord } from "./guards-DxwRG0Uv.js";
|
|
11
11
|
import { t as loadTopics } from "./topics-CqhOV1S0.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as specEmitCommand, i as specValidateCommand } from "./spec-
|
|
1
|
+
export { n as specEmitCommand, i as specValidateCommand } from "./spec-Bn4ArkKk.js";
|
|
@@ -4,8 +4,8 @@ import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, n as declarative
|
|
|
4
4
|
import { n as databaseUrl, p as accessToken } from "./config-By5EbpdJ.js";
|
|
5
5
|
import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
|
|
6
6
|
import { t as connect } from "./db-B_xr3ZvK.js";
|
|
7
|
-
import { c as TYPEGEN_VERSION, n as cachedIntrospect, u as readExtras } from "./cache-
|
|
8
|
-
import { a as toCatalog, n as managementSource, r as pgSource } from "./source-
|
|
7
|
+
import { c as TYPEGEN_VERSION, n as cachedIntrospect, u as readExtras } from "./cache-JroD4zCO.js";
|
|
8
|
+
import { a as toCatalog, n as managementSource, r as pgSource } from "./source-H6tArdAg.js";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { dirname, join, posix, relative, resolve, sep } from "node:path";
|
|
11
11
|
import { glob, readFile, readdir } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
|
|
2
2
|
import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
|
|
3
3
|
import { r as supabaseCli } from "./exec-DBgtTCHK.js";
|
|
4
|
-
import { i as migrationsDir } from "./sql-layout
|
|
4
|
+
import { i as migrationsDir } from "./sql-layout--Tblsahr.js";
|
|
5
5
|
import { r as migrationStamp } from "./migration-names-7zAdXfcd.js";
|
|
6
6
|
import { resolve } from "node:path";
|
|
7
7
|
import { readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d as fileDiff, i as changeLines, l as keepHandEdit, o as handEditedError, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-NnXnawki.js";
|
|
2
2
|
import { t as display } from "./io-CngfGyMA.js";
|
|
3
|
-
import { i as migrationsDir, l as sqlPlan } from "./sql-layout
|
|
3
|
+
import { i as migrationsDir, l as sqlPlan } from "./sql-layout--Tblsahr.js";
|
|
4
4
|
import { n as CliError } from "./errors-B7i-VGxk.js";
|
|
5
5
|
import { t as loadTopics } from "./topics-CqhOV1S0.js";
|
|
6
|
-
import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-
|
|
6
|
+
import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-DI1bC407.js";
|
|
7
7
|
import { t as orphanedBlockFiles } from "./orphans-ByB0gKOp.js";
|
|
8
|
-
import { r as layoutFor } from "./providers-
|
|
9
|
-
import { n as renderBlocksCached, t as cacheOf } from "./render-cache-
|
|
8
|
+
import { r as layoutFor } from "./providers-C_0X8CZ5.js";
|
|
9
|
+
import { n as renderBlocksCached, t as cacheOf } from "./render-cache-B6_cW4jQ.js";
|
|
10
10
|
import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, i as diffEngine, l as migrationCommand, o as findSupabaseRoot, p as sqlWorkflow, t as PGDELTA_TABLE } from "./supabase-toml-B6-eEV5p.js";
|
|
11
11
|
import { n as migrationFile, t as hasMigrationSuffix } from "./migration-names-7zAdXfcd.js";
|
|
12
12
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d as fileDiff, i as changeLines, r as applyPlan } from "./files-NnXnawki.js";
|
|
2
2
|
import { t as display } from "./io-CngfGyMA.js";
|
|
3
|
-
import { i as migrationsDir, l as sqlPlan } from "./sql-layout
|
|
3
|
+
import { i as migrationsDir, l as sqlPlan } from "./sql-layout--Tblsahr.js";
|
|
4
4
|
import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-B6-eEV5p.js";
|
|
5
|
-
import { a as write, r as nextStep, s as topicPolicyFile } from "./sync-
|
|
5
|
+
import { a as write, r as nextStep, s as topicPolicyFile } from "./sync-koAHC0Xq.js";
|
|
6
6
|
import { n as migrationFile } from "./migration-names-7zAdXfcd.js";
|
|
7
|
-
import { a as migrationInstances, c as sameModuleMigration, o as migrationModules, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-
|
|
8
|
-
import { r as layoutFor } from "./providers-
|
|
9
|
-
import { n as renderBlocksCached, t as cacheOf } from "./render-cache-
|
|
7
|
+
import { a as migrationInstances, c as sameModuleMigration, o as migrationModules, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-DI1bC407.js";
|
|
8
|
+
import { r as layoutFor } from "./providers-C_0X8CZ5.js";
|
|
9
|
+
import { n as renderBlocksCached, t as cacheOf } from "./render-cache-B6_cW4jQ.js";
|
|
10
10
|
import { resolve } from "node:path";
|
|
11
11
|
import { readFile, readdir } from "node:fs/promises";
|
|
12
12
|
import { PRELUDE_FUNCTIONS, PRELUDE_MODULE, SQL_MODULES, buildModel, conflicts, duplicatePolicies, entityRenamePlan, moduleFileVersion, moduleTopics, sameBlockFile, upgradePlan } from "better-supabase/sql";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
|
|
2
|
-
import { t as shadowedBlockColumns } from "./column-renames-
|
|
3
|
-
import { n as appSchemaTexts } from "./sql-layout
|
|
2
|
+
import { t as shadowedBlockColumns } from "./column-renames-DcEFMXX4.js";
|
|
3
|
+
import { n as appSchemaTexts } from "./sql-layout--Tblsahr.js";
|
|
4
4
|
import { t as SQL_ARGS } from "./args-CS_64_tg.js";
|
|
5
|
-
import { o as dataMigration, t as syncModules } from "./sync-
|
|
6
|
-
import { r as renderStats } from "./render-cache-
|
|
7
|
-
import { t as upgrade } from "./upgrade-
|
|
5
|
+
import { o as dataMigration, t as syncModules } from "./sync-koAHC0Xq.js";
|
|
6
|
+
import { r as renderStats } from "./render-cache-B6_cW4jQ.js";
|
|
7
|
+
import { t as upgrade } from "./upgrade-B6MOyby0.js";
|
|
8
8
|
import { i as plain } from "./style-B5-nByxb.js";
|
|
9
9
|
// src/cli/commands/upgrade.ts
|
|
10
10
|
const UPGRADE_ARGS = {
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as parsePublicEnv } from "../public-CCEJuurM.js";
|
|
2
|
-
import { n as storageUpload, r as bindClient, t as memoryStorage } from "../ports-
|
|
2
|
+
import { n as storageUpload, r as bindClient, t as memoryStorage } from "../ports-BfHdHz1e.js";
|
|
3
3
|
import { r as authzUserTopic, t as AUTHZ_EVENT } from "../authz-topic-D7fPUY4P.js";
|
|
4
4
|
import { n as dbError } from "../errors-DK1wGb9z.js";
|
|
5
5
|
import { i as isProblem, r as fromProblem } from "../problem-BwplIuhI.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as provideConnectionRuntime } from "../../define-runtime-full-
|
|
2
|
-
import { n as storageUpload, r as bindClient, t as memoryStorage } from "../../ports-
|
|
1
|
+
import { t as provideConnectionRuntime } from "../../define-runtime-full-BIrEQWJR.js";
|
|
2
|
+
import { n as storageUpload, r as bindClient, t as memoryStorage } from "../../ports-BfHdHz1e.js";
|
|
3
3
|
import { i as signInWithOAuthBrowser, n as handleAuthDeepLink, r as linkParams, t as startNativeAuthzRefresh } from "../../authz-refresh-27sp45FG.js";
|
|
4
4
|
import { r as authzUserTopic, t as AUTHZ_EVENT } from "../../authz-topic-D7fPUY4P.js";
|
|
5
5
|
import { t as expoPushToken } from "../../push-token-CO28k46S.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as withAuthMode, i as withAuth, o as withJwtClaims, s as withUserClaims } from "./claims-DouHL7ZL.js";
|
|
2
|
-
import { a as withSupport, i as withTenant, o as withServerContext, t as createServer } from "./server-
|
|
2
|
+
import { a as withSupport, i as withTenant, o as withServerContext, t as createServer } from "./server-DpcMKAt_.js";
|
|
3
3
|
import { c as serverCore, i as withSession } from "./sessions-w6xril_l.js";
|
|
4
4
|
import { o as problemResponse } from "./problem-BwplIuhI.js";
|
|
5
5
|
import { i as guard, n as defaultExpose } from "./respond-DLvLJwwN.js";
|
package/dist/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as CONFIG_DEFAULTS, a as blockEntityRenames, c as blockSubjectTypes, g as resolveJsonSchema, i as blockEntities, o as blockEventRenames, s as blockFormerFunctions, t as FormerPermissionKeyError } from "../former-permission-keys-
|
|
2
|
-
import { A as blockEntrySource, D as CONFIG_GROUPS, F as INTEGRATION_INFO, I as INTEGRATION_NAMES, L as SKILLS_AGENTS, M as groupConfig, N as groupEntries, O as RENAMED_BLOCK_KEYS, P as GEN_TASKS, j as flattenConfig, k as RENAMED_CONFIG_KEYS } from "../config-
|
|
1
|
+
import { _ as CONFIG_DEFAULTS, a as blockEntityRenames, c as blockSubjectTypes, g as resolveJsonSchema, i as blockEntities, o as blockEventRenames, s as blockFormerFunctions, t as FormerPermissionKeyError } from "../former-permission-keys-DVwR65bj.js";
|
|
2
|
+
import { A as blockEntrySource, D as CONFIG_GROUPS, F as INTEGRATION_INFO, I as INTEGRATION_NAMES, L as SKILLS_AGENTS, M as groupConfig, N as groupEntries, O as RENAMED_BLOCK_KEYS, P as GEN_TASKS, j as flattenConfig, k as RENAMED_CONFIG_KEYS } from "../config-ocvgjLWV.js";
|
|
3
3
|
import { a as tenantClaimPaths, r as claimPaths, t as DEFAULT_CLAIMS } from "../claims-CX-ar1vt.js";
|
|
4
|
-
import { A as APP_ON_DELETE_ACTIONS, D as APP_COLUMN_ACCESS, M as APP_TABLE_EVENT_KINDS, O as APP_COLUMN_FORMATS, R as DEFAULT_ACTIVE_TENANT, V as tenantNameOf, j as APP_ROLLUP_AGGREGATES, k as APP_COLUMN_TYPES } from "../instances-
|
|
4
|
+
import { A as APP_ON_DELETE_ACTIONS, D as APP_COLUMN_ACCESS, M as APP_TABLE_EVENT_KINDS, O as APP_COLUMN_FORMATS, R as DEFAULT_ACTIVE_TENANT, V as tenantNameOf, j as APP_ROLLUP_AGGREGATES, k as APP_COLUMN_TYPES } from "../instances-B9oCgEOH.js";
|
|
5
5
|
import { i as FIELD_FORMATS } from "../field-formats-sLYMh1ZK.js";
|
|
6
|
-
import { a as PERMISSION_LEVEL_SEPARATOR, c as resolvePersonas, i as resolveConfig, l as splitPermissionLevel, n as defineConfig, o as permissionLevelKey, r as generatorProblem, s as providerApiProblem, t as CONFIG_SCHEMA_URL } from "../config-
|
|
6
|
+
import { a as PERMISSION_LEVEL_SEPARATOR, c as resolvePersonas, i as resolveConfig, l as splitPermissionLevel, n as defineConfig, o as permissionLevelKey, r as generatorProblem, s as providerApiProblem, t as CONFIG_SCHEMA_URL } from "../config-BuZW7wNr.js";
|
|
7
7
|
export { APP_COLUMN_ACCESS, APP_COLUMN_FORMATS, APP_COLUMN_TYPES, APP_ON_DELETE_ACTIONS, APP_ROLLUP_AGGREGATES, APP_TABLE_EVENT_KINDS, CONFIG_DEFAULTS, CONFIG_GROUPS, CONFIG_SCHEMA_URL, DEFAULT_ACTIVE_TENANT, DEFAULT_CLAIMS, FIELD_FORMATS, FormerPermissionKeyError, GEN_TASKS, INTEGRATION_INFO, INTEGRATION_NAMES, PERMISSION_LEVEL_SEPARATOR, RENAMED_BLOCK_KEYS, RENAMED_CONFIG_KEYS, SKILLS_AGENTS, blockEntities, blockEntityRenames, blockEntrySource, blockEventRenames, blockFormerFunctions, blockSubjectTypes, claimPaths, defineConfig, flattenConfig, generatorProblem, groupConfig, groupEntries, permissionLevelKey, providerApiProblem, resolveConfig, resolveJsonSchema, resolvePersonas, splitPermissionLevel, tenantClaimPaths, tenantNameOf };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as CONFIG_DEFAULTS, u as withBlockSubjects } from "./former-permission-keys-
|
|
2
|
-
import { j as flattenConfig, n as expandFlatPreset, r as expandPreset } from "./config-
|
|
1
|
+
import { _ as CONFIG_DEFAULTS, u as withBlockSubjects } from "./former-permission-keys-DVwR65bj.js";
|
|
2
|
+
import { j as flattenConfig, n as expandFlatPreset, r as expandPreset } from "./config-ocvgjLWV.js";
|
|
3
3
|
import { t as DEFAULT_CLAIMS } from "./claims-CX-ar1vt.js";
|
|
4
4
|
import { o as tenantNames } from "./entity-naming-CUsC8bC1.js";
|
|
5
5
|
import { o as frameworkRegistry } from "./frameworks-D_2HeAEj.js";
|
|
6
|
-
import { V as tenantNameOf, _ as appTablesOf, o as resolveInstances, r as blocksByName, v as withAppTableSubjects } from "./instances-
|
|
6
|
+
import { V as tenantNameOf, _ as appTablesOf, o as resolveInstances, r as blocksByName, v as withAppTableSubjects } from "./instances-B9oCgEOH.js";
|
|
7
7
|
// src/config/authorization.ts
|
|
8
8
|
/**
|
|
9
9
|
* The personas the access matrix signs in as: `personas` as listed, or one per
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as linkNeedsRelations, I as PRESET_CATALOG, z as asBlocksConfig } from "./instances-
|
|
1
|
+
import { F as linkNeedsRelations, I as PRESET_CATALOG, z as asBlocksConfig } from "./instances-B9oCgEOH.js";
|
|
2
2
|
import { t as DEFAULT_TENANT } from "./entity-naming-CUsC8bC1.js";
|
|
3
3
|
import { a as QUALITY, c as SAAS_LINKED, i as PUBLIC_MEDIA, l as TICKETS, n as CONTROLLED_DOCUMENTS, o as QUOTE_TO_ORDER, r as ERP, s as SAAS } from "./preset-blocks-DDsAXYDY.js";
|
|
4
4
|
import { t as canonicalJson } from "./canonical-json-CTT9fC4F.js";
|
package/dist/create/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as APP_ON_DELETE_ACTIONS } from "../instances-
|
|
2
|
-
import { $ as eventsColumnsEdited, A as renameColumn, B as computedColumnRenamed, C as editTable, D as isEmptyDesign, E as isAppTable, F as tidy, G as isRollupAggregate, H as computedTableRenamed, I as updateTable, J as readableColumns, K as lookupSources, L as userConnection, M as setColumn, N as setTableId, O as moveTables, P as singular, Q as tableWithoutComputed, R as withDesign, S as duplicateTable, T as identifierError, U as filterColumns, V as computedRows, W as fittedRollup, X as rollupSources, Y as rollupColumns, Z as tableWithComputed, _ as columnError, a as parseSchema, at as encryptable, b as deleteColumn, c as tenantColumnOf, ct as optionError, d as previewFiles, et as subjectColumns, f as designIssues, g as appTableId, h as addTable, i as keyColumnsOf, it as columnLabel, j as renameTable, k as referenceFrom, l as schemaData, lt as takesBounds, m as EMPTY_DESIGN, n as loadProject, nt as subjectTypeError, o as schemaRelations, ot as fitted, p as APP_MODULE, q as prunedComputed, r as checkDesign, rt as boundError, s as tableStatements, st as lockedWithoutDefault, t as checkProject, tt as subjectColumnsEdited, u as previewAccessProvider, ut as withBounds, v as connect, w as freeTableName, x as deleteTable, y as defaultError, z as ROLLUP_AGGREGATES } from "../project-
|
|
3
|
-
import { m as diffDesigns } from "../preset-
|
|
1
|
+
import { A as APP_ON_DELETE_ACTIONS } from "../instances-B9oCgEOH.js";
|
|
2
|
+
import { $ as eventsColumnsEdited, A as renameColumn, B as computedColumnRenamed, C as editTable, D as isEmptyDesign, E as isAppTable, F as tidy, G as isRollupAggregate, H as computedTableRenamed, I as updateTable, J as readableColumns, K as lookupSources, L as userConnection, M as setColumn, N as setTableId, O as moveTables, P as singular, Q as tableWithoutComputed, R as withDesign, S as duplicateTable, T as identifierError, U as filterColumns, V as computedRows, W as fittedRollup, X as rollupSources, Y as rollupColumns, Z as tableWithComputed, _ as columnError, a as parseSchema, at as encryptable, b as deleteColumn, c as tenantColumnOf, ct as optionError, d as previewFiles, et as subjectColumns, f as designIssues, g as appTableId, h as addTable, i as keyColumnsOf, it as columnLabel, j as renameTable, k as referenceFrom, l as schemaData, lt as takesBounds, m as EMPTY_DESIGN, n as loadProject, nt as subjectTypeError, o as schemaRelations, ot as fitted, p as APP_MODULE, q as prunedComputed, r as checkDesign, rt as boundError, s as tableStatements, st as lockedWithoutDefault, t as checkProject, tt as subjectColumnsEdited, u as previewAccessProvider, ut as withBounds, v as connect, w as freeTableName, x as deleteTable, y as defaultError, z as ROLLUP_AGGREGATES } from "../project-BdZTXDVG.js";
|
|
3
|
+
import { m as diffDesigns } from "../preset-DrfMF0Hv.js";
|
|
4
4
|
// src/create/column-kinds.ts
|
|
5
5
|
/** The groups of the column type picker, in the order it shows them. */
|
|
6
6
|
const KIND_GROUPS = [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as loadLite, t as LITE_INSTALL } from "../../runtime-sBnEajcK.js";
|
|
2
|
-
import { b as appDefaultError } from "../../instances-
|
|
3
|
-
import { t as defineApi } from "../../api-
|
|
4
|
-
import { n as loadProject } from "../../project-
|
|
5
|
-
import { c as resolvePersonas } from "../../config-
|
|
2
|
+
import { b as appDefaultError } from "../../instances-B9oCgEOH.js";
|
|
3
|
+
import { t as defineApi } from "../../api-TwaJ4nS8.js";
|
|
4
|
+
import { n as loadProject } from "../../project-BdZTXDVG.js";
|
|
5
|
+
import { c as resolvePersonas } from "../../config-BuZW7wNr.js";
|
|
6
6
|
import { i as fillTemplate } from "../../access-sql-Dvl7BRy0.js";
|
|
7
7
|
// src/create/lite/apply.ts
|
|
8
8
|
const MISSING_EXTENSION = /extension "([^"]+)" is not available/u;
|
|
@@ -1250,6 +1250,7 @@ function createRepository(runner, table) {
|
|
|
1250
1250
|
* installs the runtime without them.
|
|
1251
1251
|
*/
|
|
1252
1252
|
let extras;
|
|
1253
|
+
const FULL_RUNTIME_SLOT = Symbol.for("better-supabase.connection-runtime.full");
|
|
1253
1254
|
/**
|
|
1254
1255
|
* Turns one definition into a `db`. Lives apart from the definition class so
|
|
1255
1256
|
* entries that only read the definition (the proxy, the sessions runtime) do
|
|
@@ -1558,6 +1559,9 @@ function connectorOf(definition) {
|
|
|
1558
1559
|
*/
|
|
1559
1560
|
function provideLeanConnectionRuntime(withExtras) {
|
|
1560
1561
|
extras ??= withExtras;
|
|
1562
|
+
const host = globalThis;
|
|
1563
|
+
if (withExtras === void 0 && host[FULL_RUNTIME_SLOT] === true) return;
|
|
1564
|
+
if (withExtras !== void 0) host[FULL_RUNTIME_SLOT] = true;
|
|
1561
1565
|
installConnectionRuntime({
|
|
1562
1566
|
connect: (definition, source, context, options) => connectorOf(definition).connect(source, context, options),
|
|
1563
1567
|
registerTable: (definition, table) => {
|
|
@@ -4,7 +4,7 @@ import { a as ok, r as err, s as toDbError, t as AsyncResult } from "./result-Di
|
|
|
4
4
|
import { t as DbException } from "./db-exception-Dv18UZ-I.js";
|
|
5
5
|
import { r as addLazyTable, t as builderFor } from "./build-ByfDs2ru.js";
|
|
6
6
|
import { t as decodeRows } from "./codec-CJaAdLjG.js";
|
|
7
|
-
import { a as loadReachedTables, i as NO_PLUGINS, n as decodeRpcResult, o as runSpec, r as rpcFunction, t as provideLeanConnectionRuntime } from "./define-runtime-
|
|
7
|
+
import { a as loadReachedTables, i as NO_PLUGINS, n as decodeRpcResult, o as runSpec, r as rpcFunction, t as provideLeanConnectionRuntime } from "./define-runtime-DQC2Gjdr.js";
|
|
8
8
|
import { n as isRecord } from "./guards-CsRa6v57.js";
|
|
9
9
|
import { t as vectorLiteral } from "./search-DtbkD0h0.js";
|
|
10
10
|
import { t as EventHub } from "./events-Da482tiF.js";
|
package/dist/edge/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { n as dbError } from "../errors-DK1wGb9z.js";
|
|
2
2
|
import { o as problemResponse } from "../problem-BwplIuhI.js";
|
|
3
3
|
import { a as ok, r as err } from "../result-DijoXEFG.js";
|
|
4
|
-
import { t as adapterBase } from "../adapter-base-
|
|
4
|
+
import { t as adapterBase } from "../adapter-base-BWp_GpBq.js";
|
|
5
5
|
import { _ as withFlush, g as unexpectedResponse } from "../sessions-w6xril_l.js";
|
|
6
|
-
import { t as withBetterSupabase } from "../composite-
|
|
6
|
+
import { t as withBetterSupabase } from "../composite-RorL_F8I.js";
|
|
7
7
|
import { n as corsConfig, t as SUPABASE_CORS_HEADERS } from "../cors-DrDFLMNn.js";
|
|
8
8
|
import { t as withExtra } from "../extra-Dz9n5y1s.js";
|
|
9
|
-
import { t as EVERY_CALLER } from "../framework-
|
|
9
|
+
import { t as EVERY_CALLER } from "../framework-DxCx0pmS.js";
|
|
10
10
|
import { i as requireCaller } from "../kit-BgRTtW9w.js";
|
|
11
11
|
import { n as resourceRouter } from "../resources-CM9wwyfa.js";
|
|
12
12
|
import { o as respond, s as settle } from "../respond-DLvLJwwN.js";
|
|
13
|
-
import { n as extendServer, t as createServer } from "../server-
|
|
13
|
+
import { n as extendServer, t as createServer } from "../server-DpcMKAt_.js";
|
|
14
14
|
import { i as defineAction } from "../resource-BxSmk1R1.js";
|
|
15
15
|
import { t as FUNCTION_DESCRIPTOR } from "../function-contract-Bf6llTkE.js";
|
|
16
16
|
import { n as validate } from "../standard-DM4THQrL.js";
|
|
@@ -6,7 +6,7 @@ import { p as isQuerySpec } from "./read-set-DfScfSsf.js";
|
|
|
6
6
|
import { a as ok, r as err, s as toDbError } from "./result-DijoXEFG.js";
|
|
7
7
|
import { n as simplifyOrFalse } from "./simplify-BzThKn5b.js";
|
|
8
8
|
import { n as whereClause, t as integer } from "./shared-BRFaCh8n.js";
|
|
9
|
-
import { t as provideConnectionRuntime } from "./define-runtime-full-
|
|
9
|
+
import { t as provideConnectionRuntime } from "./define-runtime-full-BIrEQWJR.js";
|
|
10
10
|
// src/compile/sqlite.ts
|
|
11
11
|
/**
|
|
12
12
|
* The operation needs something the SQLite dialect can't express: full-text
|
package/dist/expo/index.js
CHANGED
|
@@ -6,11 +6,11 @@ import { t as tenantOf } from "../tenant-Duq0dWqX.js";
|
|
|
6
6
|
import { i as claimsOf } from "../claims-CX-ar1vt.js";
|
|
7
7
|
import { t as DbException } from "../db-exception-Dv18UZ-I.js";
|
|
8
8
|
import { c as toProblem } from "../problem-BwplIuhI.js";
|
|
9
|
-
import { t as adapterBase } from "../adapter-base-
|
|
9
|
+
import { t as adapterBase } from "../adapter-base-BWp_GpBq.js";
|
|
10
10
|
import { g as unexpectedResponse } from "../sessions-w6xril_l.js";
|
|
11
|
-
import { c as bootstrapSchema, l as bootstrapWith, n as extendServer, s as accessOf, t as createServer } from "../server-
|
|
11
|
+
import { c as bootstrapSchema, l as bootstrapWith, n as extendServer, s as accessOf, t as createServer } from "../server-DpcMKAt_.js";
|
|
12
12
|
import { i as userSessionTags, r as tableTags, t as sessionIdTag } from "../cache-tags-C5Oivuxo.js";
|
|
13
|
-
import { t as withBetterSupabase } from "../composite-
|
|
13
|
+
import { t as withBetterSupabase } from "../composite-RorL_F8I.js";
|
|
14
14
|
import { r as refreshFor } from "../request-kind-BMNdlQpz.js";
|
|
15
15
|
import { i as guard, o as respond } from "../respond-DLvLJwwN.js";
|
|
16
16
|
import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as entityNoun, i as entityNames, n as checkEntityName, s as tenantRename, t as DEFAULT_TENANT } from "./entity-naming-CUsC8bC1.js";
|
|
2
|
-
import { B as resolveBlock, I as PRESET_CATALOG, V as tenantNameOf } from "./instances-
|
|
2
|
+
import { B as resolveBlock, I as PRESET_CATALOG, V as tenantNameOf } from "./instances-B9oCgEOH.js";
|
|
3
3
|
// src/config/defaults.ts
|
|
4
4
|
/**
|
|
5
5
|
* Every default `resolveConfig` fills in. Other modules (the SQL module
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as snapshotOf } from "./snapshot-C1KUHKTc.js";
|
|
2
2
|
import { i as toSession } from "./view-DpKWWhP2.js";
|
|
3
|
-
import { t as withBetterSupabase } from "./composite-
|
|
3
|
+
import { t as withBetterSupabase } from "./composite-RorL_F8I.js";
|
|
4
4
|
// src/server/framework.ts
|
|
5
5
|
/**
|
|
6
6
|
* Every caller: the framework factories guard per loader, action or route
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VERSION } from "../../version-
|
|
1
|
+
import { t as VERSION } from "../../version-Adj2H6dY.js";
|
|
2
2
|
import { f as siblingPath, t as HEADER } from "../../shared-BXRDj6UR.js";
|
|
3
3
|
import { r as relativeImport } from "../../kit-D6kdfQFj.js";
|
|
4
4
|
// src/generators/factories.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as jsonSchema, n as toJsonSchema } from "../../json-schema-
|
|
1
|
+
export { t as jsonSchema, n as toJsonSchema } from "../../json-schema-BuzopJOK.js";
|