permdock 0.31.0 → 0.32.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.
Files changed (142) hide show
  1. package/dist/{adoption-scan-9brJ_mUG.js → adoption-scan-BJMEEu7V.js} +1 -1
  2. package/dist/{arazzo-Cs-3yoxR.js → arazzo-BAgh0PT6.js} +1 -1
  3. package/dist/{arazzo-C0bltfjv.js → arazzo-C_xK2Kaa.js} +1 -1
  4. package/dist/better-supabase/index.d.ts +26 -4
  5. package/dist/better-supabase/index.js +11 -2
  6. package/dist/{bsb-access-tags-B1TBUQLj.js → bsb-access-tags-CjeR7v7-.js} +10 -43
  7. package/dist/{bsb-action-keys-iKmZChtQ.js → bsb-action-keys-CYEREFMg.js} +1 -1
  8. package/dist/{casbin-DGsO-QmR.js → casbin-BErdqy1J.js} +1 -1
  9. package/dist/{casbin-s6_zDJi1.js → casbin-EwdKipQs.js} +1 -1
  10. package/dist/cli/bin.js +1 -1
  11. package/dist/cli/generate/watch-worker.js +2 -2
  12. package/dist/cli/index.d.ts +3 -3
  13. package/dist/cli/index.js +2 -2
  14. package/dist/cli/plugins/app.d.ts +1 -1
  15. package/dist/cli/plugins/app.js +1 -1
  16. package/dist/cli/plugins/better-supabase.d.ts +1 -1
  17. package/dist/cli/plugins/openapi.d.ts +1 -1
  18. package/dist/cli/plugins/openapi.js +1 -1
  19. package/dist/cli/plugins/powersync.d.ts +1 -1
  20. package/dist/cli/plugins/powersync.js +1 -1
  21. package/dist/cli/plugins/rls.d.ts +2 -2
  22. package/dist/cli/plugins/rls.js +1 -1
  23. package/dist/cli/plugins/schemas.d.ts +1 -1
  24. package/dist/cli/plugins/schemas.js +1 -1
  25. package/dist/cli/plugins/scim.d.ts +2 -2
  26. package/dist/cli/plugins/supabase-hook.d.ts +2 -2
  27. package/dist/cli/plugins/supabase-hook.js +1 -1
  28. package/dist/cli/plugins/supabase.d.ts +3 -3
  29. package/dist/cli/plugins/supabase.js +2 -2
  30. package/dist/cli/plugins/ui.d.ts +1 -1
  31. package/dist/cli/plugins/ui.js +1 -1
  32. package/dist/{client-subject-BOPbpwgm.d.ts → client-subject-xCSkKD1C.d.ts} +1 -1
  33. package/dist/{cloud-fRv3j6sq.js → cloud-DW3q3qnp.js} +2 -2
  34. package/dist/{codemod-DsqEKP6A.js → codemod-CF7NNDzA.js} +14 -11
  35. package/dist/{codemod-DT0dMVdd.js → codemod-DVDMFsTX.js} +8 -7
  36. package/dist/{collect-CCgmm5xN.js → collect-CE5wK0AX.js} +1 -1
  37. package/dist/{compile-DNVVdVWs.js → compile-BXKYYmT1.js} +3 -3
  38. package/dist/{completion-DrJkWgZa.js → completion-B59uPAnZ.js} +1 -1
  39. package/dist/{config-D8iWeV9k.js → config-7QvEq57a.js} +2 -2
  40. package/dist/{config-BaKkd6HB.js → config-VCa1RLUe.js} +1 -1
  41. package/dist/{config-report-uuD5eVEn.js → config-report-CjvA6lGI.js} +1 -1
  42. package/dist/{context-Ne0EdD45.js → context-CAFddgb9.js} +1 -1
  43. package/dist/{custom-role-rebuild-BBKC7Bt1.js → custom-role-rebuild-BK73tPib.js} +1 -1
  44. package/dist/{doctor-Ch4VGl2q.js → doctor-ELj5hrVv.js} +2 -2
  45. package/dist/{doctor-C1T2G2mn.js → doctor-ervtBRzG.js} +61 -33
  46. package/dist/{execute-BhWXiQAy.js → execute-ix7AAdWg.js} +3 -3
  47. package/dist/{gen-CGjbD8I_.js → gen-8rW_AUG5.js} +2 -2
  48. package/dist/gen-BtiGMiuH.js +1 -0
  49. package/dist/{gen-kind-thoT0NYV.js → gen-kind-C9ikF8nb.js} +1 -1
  50. package/dist/{generate-vEW8Brg8.js → generate-BmpCt5oi.js} +3 -3
  51. package/dist/{generate-eor7vXGN.js → generate-CW7gNfLr.js} +16 -12
  52. package/dist/{generate-options-MJgn0dgl.js → generate-options-DiR4r_sk.js} +7 -7
  53. package/dist/{hook-sql-DJQ_yOEC.js → hook-sql-D-abRHut.js} +5 -5
  54. package/dist/{import-CGQIK3iN.js → import-BAhoTYTk.js} +1 -1
  55. package/dist/{init-C6te_dSg.js → init-DkRHIe8-.js} +3 -3
  56. package/dist/{init-DN19mlwE.js → init-zxb0BVDJ.js} +1 -1
  57. package/dist/{interactive-only-BjYwp9mm.js → interactive-only-Dqww0ABO.js} +18 -1
  58. package/dist/{keys-qFqDoYeF.js → keys-DQsHrgBM.js} +1 -1
  59. package/dist/{login-BYXaH_yT.js → login-C1p3gmj8.js} +1 -1
  60. package/dist/{login-CMzfsdm8.js → login-DOEZveP6.js} +3 -3
  61. package/dist/{manager-chain-CStuYb7A.js → manager-chain-DdkiCw5q.js} +1 -1
  62. package/dist/{manifest-CowZuywo.js → manifest-31igzVGQ.js} +33 -33
  63. package/dist/{manifest-DdNYR_pl.js → manifest-B487A3po.js} +1 -1
  64. package/dist/{manifest-CA3E0KP8.d.ts → manifest-DgsxeAsM.d.ts} +38 -1
  65. package/dist/{manifest-schema-CLbcbDz7.js → manifest-schema-D7RQbnGY.js} +44 -1
  66. package/dist/{model-BqHWwfcg.js → model-BXhr8gUI.js} +1 -1
  67. package/dist/next/index.d.ts +2 -1
  68. package/dist/next/index.js +2 -1
  69. package/dist/next/plugin.d.ts +1 -1
  70. package/dist/next/plugin.js +1 -1
  71. package/dist/{openapi-Dsh0MDSZ.js → openapi-BeMVHVY4.js} +1 -1
  72. package/dist/{openapi-BP7YpJeF.js → openapi-DEGesHWH.js} +1 -1
  73. package/dist/{openapi-document-_QSOtSKS.js → openapi-document-CEQ6jqqR.js} +1 -1
  74. package/dist/{output-Didy9Ys4.js → output-C7EPeSZj.js} +1 -1
  75. package/dist/{ownership-CG5_N8b5.js → ownership-Csk9C3Js.js} +8 -5
  76. package/dist/{pipeline-B4iyaOK7.js → pipeline-Bbu7uw28.js} +2 -2
  77. package/dist/{plugin-DQJuZVl1.d.ts → plugin-L3G7jPGE.d.ts} +1 -1
  78. package/dist/{policy-hnVT4MC4.js → policy-CSOOQ3rR.js} +1 -1
  79. package/dist/{policy-bundle-BIDV0DZF.js → policy-bundle-KYI0EnrM.js} +3 -3
  80. package/dist/{powersync-DUvN9v5a.js → powersync-C1ix7CEY.js} +1 -1
  81. package/dist/{powersync-D7YfMHke.js → powersync-CGvu6j5U.js} +1 -1
  82. package/dist/{powersync-_2ElzOhQ.js → powersync-CM6Vg4RH.js} +6 -6
  83. package/dist/{provider-D1vlNPWo.js → provider-BV_v0JAY.js} +18 -3
  84. package/dist/{prune-config-5vtQpiLk.js → prune-config-CdoPJIGz.js} +5 -5
  85. package/dist/{pull-BnxZmo3f.js → pull-BaB401Bk.js} +2 -2
  86. package/dist/pull-Bp63vtgu.js +1 -0
  87. package/dist/{push-Bu0uCkJg.js → push-DcjvEj0m.js} +1 -1
  88. package/dist/{rbac-CwcucZPx.js → rbac-mblGDx-Z.js} +1 -1
  89. package/dist/{rename-CLoDRrbc.js → rename-BZNOV8H9.js} +2 -2
  90. package/dist/report-DCAiUc5U.js +1 -0
  91. package/dist/{report-BI_hek_d.js → report-DievqWhf.js} +75 -5
  92. package/dist/{resolve-names-CTji5IPe.js → resolve-names-Cth1UQ-8.js} +2 -2
  93. package/dist/{rls-UY6p6ztg.js → rls-BtkZgaZp.js} +7 -2
  94. package/dist/{rls-BPHCyA5v.js → rls-DUYok5e9.js} +17 -7
  95. package/dist/{rls-files-CDZdTh8v.js → rls-files-ucAI0J5j.js} +1 -1
  96. package/dist/{rls-options-BgD-KZkm.d.ts → rls-options-BFGRmdcH.d.ts} +1 -1
  97. package/dist/run-BjMxYYTe.js +1 -0
  98. package/dist/{run-C3ztA88m.js → run-WIqPbnjD.js} +3 -3
  99. package/dist/{scan-m5m1M6Qn.js → scan-Badcllgg.js} +1 -1
  100. package/dist/{schema-BpGuLrwk.js → schema-DBRKgQb4.js} +1 -1
  101. package/dist/{skills-BytzDi34.js → skills-Ba9hHGO6.js} +1 -1
  102. package/dist/{skills-CzhnDo-C.js → skills-CTKq3o8D.js} +1 -1
  103. package/dist/{sources-D5n28164.d.ts → sources-CjgZns7t.d.ts} +1 -1
  104. package/dist/supabase/index.d.ts +3 -3
  105. package/dist/supabase/index.js +1 -1
  106. package/dist/{supabase-CAswAUeb.js → supabase-CGiB83XQ.js} +1 -1
  107. package/dist/supabase-hook-CluYxKee.js +2 -0
  108. package/dist/{supabase-hook-C0LIaT7b.js → supabase-hook-CqO_0Koh.js} +9 -183
  109. package/dist/{supabase-schemas-BUFeyErz.js → supabase-schemas-BglbAG2Z.js} +9 -8
  110. package/dist/table-reads-AnHPrBp8.js +517 -0
  111. package/dist/table-reads-BviGc0L_.js +1 -0
  112. package/dist/{tables-sLA1CpuN.js → tables-CDq0HVVq.js} +7 -4
  113. package/dist/tenant-check-D7g9oNVH.js +105 -0
  114. package/dist/testing/fixtures/index.d.ts +1 -1
  115. package/dist/testing/fixtures/index.js +14 -8
  116. package/dist/testing/index.d.ts +1 -1
  117. package/dist/testing/index.js +1 -1
  118. package/dist/{types-config-BiMM_zJ-.d.ts → types-config-DNIw_Gt5.d.ts} +1 -1
  119. package/dist/{types-run-N2ffLN_Z.d.ts → types-run-Bwn1MuW0.d.ts} +1 -1
  120. package/dist/unplugin/index.d.ts +1 -1
  121. package/dist/unplugin/index.js +1 -1
  122. package/dist/{usage-DT6QK86a.js → usage-CW6xhRcV.js} +2 -2
  123. package/dist/usage-Ci7Glu-H.js +1 -0
  124. package/dist/{usage-Dcbg6zu6.js → usage-n4V2k_a6.js} +1 -1
  125. package/dist/{verify-DNERav8K.js → verify-CKzngsUH.js} +3 -3
  126. package/dist/warm-5yxlUmBh.js +32 -0
  127. package/dist/warm-BR-mrnY-.d.ts +16 -0
  128. package/dist/{watch-BsQ4n3NV.js → watch-C12Ub7x4.js} +2 -2
  129. package/dist/{watch-fldErlRf.js → watch-D-5ztqN8.js} +1 -1
  130. package/dist/watch-J1PfGMfb.js +1 -0
  131. package/package.json +1 -1
  132. package/schemas/supabase-manifest-v1.json +109 -19
  133. package/skills/permdock-data/references/queries-and-rls.md +1 -1
  134. package/dist/gen-CkUEZ5Z6.js +0 -1
  135. package/dist/platform-CSxTsLsr.js +0 -35
  136. package/dist/pull-CGncYZNZ.js +0 -1
  137. package/dist/report-BevPHMy6.js +0 -1
  138. package/dist/run-3ySqmufy.js +0 -1
  139. package/dist/supabase-hook-DXGg5bNn.js +0 -2
  140. package/dist/tenant-check-gL2miiaS.js +0 -31
  141. package/dist/usage-DdOFc5xq.js +0 -1
  142. package/dist/watch-eay1PztJ.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { n as fileSummary, t as applyFiles } from "./files-DuV7wRim.js";
2
- import { i as buildContext, n as isRefusal, o as inheritTargets, t as generateOptions } from "./generate-options-MJgn0dgl.js";
3
- import { r as compileGrants } from "./compile-DNVVdVWs.js";
4
- import { G as POLICY_BUNDLE_FORMAT, J as policyBundle, i as tableNames, q as bundleLoaderSql } from "./tables-sLA1CpuN.js";
2
+ import { i as buildContext, n as isRefusal, o as inheritTargets, t as generateOptions } from "./generate-options-DiR4r_sk.js";
3
+ import { r as compileGrants } from "./compile-BXKYYmT1.js";
4
+ import { G as POLICY_BUNDLE_FORMAT, J as policyBundle, i as tableNames, q as bundleLoaderSql } from "./tables-CDq0HVVq.js";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  import { resolve } from "node:path";
7
7
  // src/cli/policy-bundle.ts
@@ -1 +1 @@
1
- export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-_2ElzOhQ.js";
1
+ export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-CM6Vg4RH.js";
@@ -24,7 +24,7 @@ const verify = defineLeaf({
24
24
  const db = await dbUrl(ctx, flags, { required: true });
25
25
  const fixtures = given(flags.fixtures);
26
26
  const from = given(flags.policy);
27
- const { runPowerSync } = await import("./powersync-DUvN9v5a.js");
27
+ const { runPowerSync } = await import("./powersync-C1ix7CEY.js");
28
28
  return runPowerSync({
29
29
  cwd: ctx.cwd,
30
30
  config: ctx.config,
@@ -8,8 +8,8 @@ import { i as fileDrift } from "./output-files-8lfALMSU.js";
8
8
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-3aUUP6Nx.js";
9
9
  import { r as pgConnector } from "./pg-DmS5ITHu.js";
10
10
  import { c as requirePolicy } from "./load-m7jmit3y.js";
11
- import { t as canFixture } from "./verify-DNERav8K.js";
12
- import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-CwcucZPx.js";
11
+ import { t as canFixture } from "./verify-CKzngsUH.js";
12
+ import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-mblGDx-Z.js";
13
13
  import { a as quoteIdent, s as quoteQualified } from "./quote-BKrTBbcH.js";
14
14
  import { a as scopeMembershipTable, i as scopeColumn } from "./compile-BUKXrueE.js";
15
15
  import { r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
@@ -18,15 +18,15 @@ import { d as keptKeys, t as AUTHZ_VERSION_TABLE } from "./sources-DnjJPGfb.js";
18
18
  import { a as customRolesOn, t as CUSTOM_ROLES } from "./shared-C6_T7QUo.js";
19
19
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
20
20
  import { s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-T4GaBh9X.js";
21
- import { t as ownershipRules } from "./ownership-CG5_N8b5.js";
22
- import { a as tableFor } from "./compile-DNVVdVWs.js";
23
- import { i as tableNames, r as tableNameOf } from "./tables-sLA1CpuN.js";
21
+ import { t as ownershipRules } from "./ownership-Csk9C3Js.js";
22
+ import { a as tableFor } from "./compile-BXKYYmT1.js";
23
+ import { i as tableNames, r as tableNameOf } from "./tables-CDq0HVVq.js";
24
24
  import { l as policyLevels } from "./policy-BBvhhH9X.js";
25
25
  import { p as scopeField } from "./tenancy-B5Xxt9Sc.js";
26
26
  import { t as requiresApproval } from "./approval-required-B-R4Yw3J.js";
27
27
  import { o as sqlFiles } from "./files-DAR51W3J.js";
28
28
  import { o as parseSqlLenient } from "./ast-Dnm2TOHN.js";
29
- import { n as resolveSchemas } from "./supabase-schemas-BUFeyErz.js";
29
+ import { n as resolveSchemas } from "./supabase-schemas-BglbAG2Z.js";
30
30
  import { existsSync, readFileSync } from "node:fs";
31
31
  import { join, resolve } from "node:path";
32
32
  // src/cli/powersync/claims.ts
@@ -2,7 +2,7 @@ import { t as parseCatalog } from "./parse-CUqZ_lLC.js";
2
2
  import { n as freezeDeep } from "./freeze-DGfJq_j2.js";
3
3
  import { a as delegatedScopeMap } from "./permdock-CJPIwU1T.js";
4
4
  import { i as qualifySqlTable, l as sqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
5
- import { n as parseSupabaseManifest, t as hasTokenHook } from "./manifest-DdNYR_pl.js";
5
+ import { n as parseSupabaseManifest, t as hasTokenHook } from "./manifest-B487A3po.js";
6
6
  import { y as parseAnswer } from "./permission-registry-DstT40VS.js";
7
7
  import { o as holder, r as approverLeaves } from "./approvers-BkY_ZfWl.js";
8
8
  import { n as asApprover } from "./approval-normalize-C6je8vWN.js";
@@ -176,6 +176,8 @@ function tenantOf(source, tenantScope) {
176
176
  */
177
177
  function portalFunctionsOf(input) {
178
178
  const { manifest, tenantScope, requires, problems } = input;
179
+ const wantSubjects = input.subjects;
180
+ const wantParties = input.parties;
179
181
  const schema = sqlIdent(manifest.rls.schema);
180
182
  const helpers = new Set(manifest.rls.helpers.map((helper) => helper.name));
181
183
  const children = childScopes(manifest, tenantScope).filter((scope) => helpers.has(`member_${scope.name}_ids`));
@@ -193,9 +195,12 @@ function portalFunctionsOf(input) {
193
195
  const teamIdsOf = team === void 0 || teams.length > 1 ? void 0 : `(select m.id from ${memberIds(team.name)} as m(id) where {user} = (select auth.uid()))`;
194
196
  const parties = [];
195
197
  const subjects = [];
198
+ let permittedMissing = false;
196
199
  for (const scope of children) {
197
200
  if (!scope.sources.every((source) => source.via !== void 0)) continue;
201
+ if (!wantParties && !wantSubjects) continue;
198
202
  const permitted = helpers.has(`permitted_${scope.name}_ids`);
203
+ if (wantSubjects && !permitted) permittedMissing = true;
199
204
  for (const source of scope.sources) {
200
205
  const tenant = tenantOf(source, tenantScope);
201
206
  if (tenant === void 0) {
@@ -204,8 +209,8 @@ function portalFunctionsOf(input) {
204
209
  }
205
210
  const id = `m.${sqlIdent(source.id.column)}`;
206
211
  const select = `select ${tenant}, ${quoteSqlLiteral(scope.name)}, ${id}::text from ${source.table} m where ${id} in (select ${memberIds(scope.name)})`;
207
- parties.push(select);
208
- if (permitted) {
212
+ if (wantParties) parties.push(select);
213
+ if (wantSubjects && permitted) {
209
214
  const fn = `${schema}.${sqlIdent(`permitted_${scope.name}_ids_by_permission`)}`;
210
215
  if (!requires.some((entry) => entry.function === fn)) requires.push({
211
216
  function: fn,
@@ -216,6 +221,7 @@ function portalFunctionsOf(input) {
216
221
  }
217
222
  }
218
223
  }
224
+ if (permittedMissing && subjects.length === 0) problems.push("portalSubjects: the manifest names no permitted_<scope>_ids helper for a portal scope. Run permdock generate.");
219
225
  const portalParties = union(parties);
220
226
  const portalSubjects = union(subjects);
221
227
  return {
@@ -460,6 +466,8 @@ function providerFunctions(input) {
460
466
  const portal = portalFunctionsOf({
461
467
  manifest,
462
468
  tenantScope,
469
+ subjects: options.portalSubjects === true,
470
+ parties: options.portalParties !== false,
463
471
  requires,
464
472
  problems
465
473
  });
@@ -1146,6 +1154,12 @@ function authorizationProvider(options) {
1146
1154
  if (options.tables === true && catalog === void 0) problems.push("tables: true needs a catalog to tell which permissions a table's select policy checks. Pass `catalog`.");
1147
1155
  const tenantScope = tenantScopeOf(manifest, options.scope);
1148
1156
  const tables = options.tables === true && catalog !== void 0 ? tablesOf(manifest, catalog, tenantScope) : void 0;
1157
+ if (options.sharedFunctions === true && options.tables !== true) problems.push("sharedFunctions: true needs tables: true, because each listed table must be a `tenant` entry of `tables`.");
1158
+ if (options.sharedFunctions === true && rls.sharedFunctions === void 0) problems.push("sharedFunctions: true needs `rls.sharedFunctions` in the manifest. Run `permdock supabase inspect --out`.");
1159
+ const sharedFunctions = options.sharedFunctions === true && options.tables === true && rls.sharedFunctions !== void 0 && rls.sharedFunctions.length > 0 ? Object.fromEntries(rls.sharedFunctions.map((entry) => [entry.function, {
1160
+ tables: entry.tables,
1161
+ permissions: entry.permissions
1162
+ }])) : void 0;
1149
1163
  const scopeNames = rls.scopes.map((scope) => scope.name);
1150
1164
  const schema = sqlIdent(rls.schema);
1151
1165
  const rootTenant = rls.scopes.find((scope) => scope.name === tenantScope)?.within === void 0;
@@ -1216,6 +1230,7 @@ function authorizationProvider(options) {
1216
1230
  ...versions === void 0 ? {} : { versions: versions.versions },
1217
1231
  ...wildcards === void 0 ? {} : { wildcards },
1218
1232
  ...tables === void 0 ? {} : { tables },
1233
+ ...sharedFunctions === void 0 ? {} : { sharedFunctions },
1219
1234
  ...Object.keys(delegated).length > 0 || interactiveOnly.length > 0 ? { delegation: {
1220
1235
  ...Object.keys(delegated).length > 0 ? { scopes: delegated } : {},
1221
1236
  ...interactiveOnly.length > 0 ? { interactiveOnly } : {}
@@ -1,16 +1,16 @@
1
1
  import { n as CliError } from "./errors-DgLOqc6j.js";
2
2
  import { i as refuseDirty, t as applyFiles } from "./files-DuV7wRim.js";
3
3
  import { a as rel } from "./files-DAR51W3J.js";
4
- import { t as genFiles } from "./gen-CGjbD8I_.js";
5
- import { t as projectContext } from "./context-Ne0EdD45.js";
6
- import { t as emitPluginFiles } from "./pipeline-B4iyaOK7.js";
4
+ import { t as genFiles } from "./gen-8rW_AUG5.js";
5
+ import { t as projectContext } from "./context-CAFddgb9.js";
6
+ import { t as emitPluginFiles } from "./pipeline-Bbu7uw28.js";
7
7
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
8
- import { S as restatedFacts, c as withDerivedDefaults, o as readParsedConfig, t as configFileIn } from "./config-D8iWeV9k.js";
8
+ import { S as restatedFacts, c as withDerivedDefaults, o as readParsedConfig, t as configFileIn } from "./config-7QvEq57a.js";
9
9
  import { c as requirePolicy } from "./load-m7jmit3y.js";
10
10
  import { n as restatedDefaults, r as withoutPath } from "./resolve-config-9NYYVc30.js";
11
11
  import { n as writtenPaths, t as configProperty } from "./config-paths-CQvGng3k.js";
12
12
  import { r as removeProperty, t as applyEditsStrict } from "./edits-CqU8s2GC.js";
13
- import { n as commandFor } from "./compile-DNVVdVWs.js";
13
+ import { n as commandFor } from "./compile-BXKYYmT1.js";
14
14
  import { r as schemaTables, t as restatedSchemaDefaults } from "./schema-tables-Ba9LE_XB.js";
15
15
  import { readFileSync } from "node:fs";
16
16
  // src/cli/codemod/prune-config.ts
@@ -1,10 +1,10 @@
1
1
  import { t as parseCatalog } from "./parse-CUqZ_lLC.js";
2
2
  import { t as catalogFingerprint } from "./catalog-fingerprint-DAWZARy6.js";
3
- import { n as parseSupabaseManifest } from "./manifest-DdNYR_pl.js";
3
+ import { n as parseSupabaseManifest } from "./manifest-B487A3po.js";
4
4
  import { o as formatCatalogJson } from "./catalog-doc-D4g3nyFB.js";
5
5
  import { t as catalogPath } from "./catalog-path-bG0XxHMu.js";
6
6
  import { a as describeError } from "./errors-DgLOqc6j.js";
7
- import { o as nonEmptyOr } from "./output-Didy9Ys4.js";
7
+ import { o as nonEmptyOr } from "./output-C7EPeSZj.js";
8
8
  import { s as cliVersion } from "./version-D-jWyJb9.js";
9
9
  import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
10
10
  import { n as formatManifestJson } from "./manifest-json-DMaBWmcG.js";
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-BaB401Bk.js";
@@ -3,7 +3,7 @@ import { r as pushedPolicy } from "./pushed-policy-DSjSWEAl.js";
3
3
  import { r as isRecord } from "./compact-C4LFuqbW.js";
4
4
  import { n as PermDockValidationError } from "./validation-error-CgDOA6VS.js";
5
5
  import { t as catalogFingerprint } from "./catalog-fingerprint-DAWZARy6.js";
6
- import { n as parseSupabaseManifest } from "./manifest-DdNYR_pl.js";
6
+ import { n as parseSupabaseManifest } from "./manifest-B487A3po.js";
7
7
  import { n as runCatalog } from "./catalog-BExjL94D.js";
8
8
  import { a as describeError, n as CliError } from "./errors-DgLOqc6j.js";
9
9
  import { n as httpRequest, t as authFailure } from "./http-BbX_Ou3_.js";
@@ -10,7 +10,7 @@ import { n as isForbiddenKey } from "./paths-CeS_gpHf.js";
10
10
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
11
11
  import { u as isoAt } from "./time-r0CKBm57.js";
12
12
  import { u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
13
- import { G as graphSqlText, H as CLOSURE, U as graphHelper, Y as inheritedRowsHelper, Z as linkHelper, _ as memoizes, ct as scopeTable, ft as activeUserSql, lt as activeInstancesSql, m as memoHitList, o as memoUserSql, ot as restrictedHelper, rt as memberRoleOf, st as scopeSources, tt as memberIdsHelper, ut as activeMembershipSql } from "./interactive-only-BjYwp9mm.js";
13
+ import { $ as linkHelper, G as graphHelper, W as CLOSURE, Z as inheritedRowsHelper, at as memberRoleOf, c as memoUserSql, ct as restrictedHelper, dt as activeInstancesSql, ft as activeMembershipSql, g as memoHitList, lt as scopeSources, mt as activeUserSql, q as graphSqlText, rt as memberIdsHelper, ut as scopeTable, y as memoizes } from "./interactive-only-Dqww0ABO.js";
14
14
  import { S as sqlType, a as kindFilterSql, b as idTypeOf, c as roleKindSql, d as subjectClaimSql, f as subjectIdSql, h as CLAIM, i as keyTenantSql, o as liveSessionSql, p as tenantClaimSql, s as memberVia, u as subjectClaimJsonSql } from "./subject-CrldGifz.js";
15
15
  import { a as quoteIdent, c as quoteTable, i as qualified, l as textArrayLiteral, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-BKrTBbcH.js";
16
16
  // src/cli/sql/conditions.ts
@@ -3,9 +3,9 @@ import "./sources-DnjJPGfb.js";
3
3
  import { i as configError, n as CliError } from "./errors-DgLOqc6j.js";
4
4
  import { i as refuseDirty, n as fileSummary, t as applyFiles } from "./files-DuV7wRim.js";
5
5
  import { a as loadModule, r as leavesOf, s as pickNamed, t as asPermissionTree } from "./load-m7jmit3y.js";
6
- import { a as resolveAuthorize } from "./rbac-CwcucZPx.js";
6
+ import { a as resolveAuthorize } from "./rbac-mblGDx-Z.js";
7
7
  import { a as customRolesOn, t as CUSTOM_ROLES } from "./shared-C6_T7QUo.js";
8
- import { n as legacyKeySql } from "./custom-role-rebuild-BBKC7Bt1.js";
8
+ import { n as legacyKeySql } from "./custom-role-rebuild-BK73tPib.js";
9
9
  import { n as byKey } from "./compare-8SNJN-9U.js";
10
10
  import { a as quoteIdent, o as quoteLiteral } from "./quote-BKrTBbcH.js";
11
11
  import { a as nameOf, o as nodes, r as child, u as walk } from "./ast-CAOxvn9t.js";
@@ -0,0 +1 @@
1
+ export { t as NON_LEAKPROOF_INDEXED_SQL, n as POLICIES_MAX, r as REPORT_POLICIES_SQL, i as TABLE_READ_RULES, a as droppedPolicy, o as policiesFor, s as reportFiles, c as rlsReport, l as runRlsReport } from "./report-DievqWhf.js";
@@ -5,11 +5,66 @@ import { n as MIGRATION_DIRS } from "./constants-PCJiir_3.js";
5
5
  import { a as parseSqlFile, c as readPolicy, d as sqlCalls, i as isPolicyCommand, t as SqlSyntaxError } from "./ast-Dnm2TOHN.js";
6
6
  import { i as taggedAccessPolicies } from "./bsb-access-Bcw6GrQm.js";
7
7
  import { a as helperCallKeys, i as callsHelper } from "./helper-calls-DHvgN9tr.js";
8
- import { n as isStripeDataPipelineSchema } from "./platform-CSxTsLsr.js";
9
8
  import { n as supabaseDir } from "./supabase-dir-0lxKbrYu.js";
10
9
  import { readFileSync } from "node:fs";
11
10
  import { deparse } from "pgsql-parser";
11
+ // src/cli/sql/platform.ts
12
+ /** Schemas Postgres, Supabase and its extensions own. */
13
+ const SYSTEM_SCHEMAS = /* @__PURE__ */ new Set([
14
+ "pg_catalog",
15
+ "information_schema",
16
+ "pg_toast",
17
+ "auth",
18
+ "storage",
19
+ "realtime",
20
+ "extensions",
21
+ "graphql",
22
+ "graphql_public",
23
+ "vault",
24
+ "pgsodium",
25
+ "pgsodium_masks",
26
+ "net",
27
+ "cron",
28
+ "supabase_functions",
29
+ "supabase_migrations"
30
+ ]);
31
+ /**
32
+ * Stripe Data Pipeline's schemas. Supabase creates the `stripe_sdp` role, and
33
+ * Stripe creates a schema with that prefix and writes its tables as that role;
34
+ * an app reads them but never writes or grants on them.
35
+ */
36
+ const STRIPE_SDP = "stripe_sdp";
37
+ /** Whether a platform owns `schema`, so no PermDock check or grant reaches it. */
38
+ function isPlatformSchema(schema) {
39
+ return SYSTEM_SCHEMAS.has(schema) || schema.startsWith("pg_") || schema.startsWith(STRIPE_SDP);
40
+ }
41
+ /** Whether `schema` belongs to Stripe Data Pipeline. */
42
+ function isStripeDataPipelineSchema(schema) {
43
+ return schema.startsWith(STRIPE_SDP);
44
+ }
12
45
  // src/cli/rls/report.ts
46
+ /** The rules a `row` table can break, in the order the report lists them. */
47
+ const TABLE_READ_RULES = [
48
+ "form",
49
+ "follows",
50
+ "via",
51
+ "walk",
52
+ "owner",
53
+ "condition",
54
+ "restrictive",
55
+ "fields",
56
+ "unknown"
57
+ ];
58
+ /** The counts of `reads` per share and per rule. */
59
+ function summariseTableReads(reads) {
60
+ const byRule = Object.fromEntries(TABLE_READ_RULES.map((rule) => [rule, reads.filter((read) => read.rules?.includes(rule) === true).length]));
61
+ return {
62
+ tenant: reads.filter((read) => read.share === "tenant").length,
63
+ row: reads.filter((read) => read.share === "row").length,
64
+ byRule,
65
+ tables: reads
66
+ };
67
+ }
13
68
  const COMMANDS = [
14
69
  "select",
15
70
  "insert",
@@ -256,11 +311,18 @@ function policiesFor(table, command) {
256
311
  return table.policies.filter((policy) => appliesTo(policy, command));
257
312
  }
258
313
  async function rlsReport(input) {
314
+ const reads = input.tableReads === void 0 || input.tableReads.length === 0 ? {} : { tableReads: summariseTableReads(input.tableReads) };
259
315
  if (input.db !== void 0 && input.connect !== void 0) {
260
316
  const { policies, leaky } = await fromDatabase(input.db, input.connect);
261
- return reportOf("database", policies, leaky);
317
+ return {
318
+ ...reportOf("database", policies, leaky),
319
+ ...reads
320
+ };
262
321
  }
263
- return reportOf("files", await policiesFromFiles(input.cwd, input.config), void 0);
322
+ return {
323
+ ...reportOf("files", await policiesFromFiles(input.cwd, input.config), void 0),
324
+ ...reads
325
+ };
264
326
  }
265
327
  function renderTable(table) {
266
328
  const calls = COMMANDS.map((command) => `${command} ${String(table.helperCallsPerStatement[command])}`).join(", ");
@@ -274,9 +336,17 @@ function renderTable(table) {
274
336
  for (const column of table.nonLeakproofIndexed ?? []) lines.push(` index on ${column.column} (${column.type}): = is not leakproof, so a filter on it does not use the index under RLS`);
275
337
  return lines;
276
338
  }
339
+ function renderTableReads(reads) {
340
+ const rules = TABLE_READ_RULES.map((rule) => `${rule} ${String(reads.byRule[rule])}`).join(", ");
341
+ return [`table reads: ${String(reads.tenant)} tenant, ${String(reads.row)} row (${rules})`, ...reads.tables.filter((read) => read.share === "row").map((read) => ` ${read.table}: ${(read.rules ?? []).join(", ")}${read.reason === void 0 ? "" : `; ${read.reason}`}`)];
342
+ }
277
343
  function renderRlsReport(report) {
278
344
  const { totals } = report;
279
- return [...report.tables.flatMap(renderTable), `${String(totals.policies)} policies on ${String(report.tables.length)} tables: ${String(totals.library)} library, ${String(totals.provider)} provider, ${String(totals.app)} app (from ${report.source === "files" ? "the schema files and migrations" : "pg_policies"})`].join("\n");
345
+ return [
346
+ ...report.tables.flatMap(renderTable),
347
+ ...report.tableReads === void 0 ? [] : renderTableReads(report.tableReads),
348
+ `${String(totals.policies)} policies on ${String(report.tables.length)} tables: ${String(totals.library)} library, ${String(totals.provider)} provider, ${String(totals.app)} app (from ${report.source === "files" ? "the schema files and migrations" : "pg_policies"})`
349
+ ].join("\n");
280
350
  }
281
351
  async function runRlsReport(input) {
282
352
  try {
@@ -295,4 +365,4 @@ async function runRlsReport(input) {
295
365
  throw error;
296
366
  }
297
367
  }
298
- export { policiesFor as a, runRlsReport as c, droppedPolicy as i, POLICIES_MAX as n, reportFiles as o, REPORT_POLICIES_SQL as r, rlsReport as s, NON_LEAKPROOF_INDEXED_SQL as t };
368
+ export { droppedPolicy as a, rlsReport as c, TABLE_READ_RULES as i, runRlsReport as l, POLICIES_MAX as n, policiesFor as o, REPORT_POLICIES_SQL as r, reportFiles as s, NON_LEAKPROOF_INDEXED_SQL as t, isPlatformSchema as u };
@@ -5,9 +5,9 @@ import "./budget-BH81q2cj.js";
5
5
  import "./sources-DnjJPGfb.js";
6
6
  import { i as configError } from "./errors-DgLOqc6j.js";
7
7
  import { t as FIELD_VIEWS } from "./fields-y_PSRCyJ.js";
8
- import { C as forUserContext, Q as graphPlan, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-sLA1CpuN.js";
8
+ import { C as forUserContext, Q as graphPlan, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-CDq0HVVq.js";
9
9
  import { b as idTypeOf, x as scopeTypeOf } from "./subject-CrldGifz.js";
10
- import { J as hasPermittedUsers, Q as memberForHelper, T as globalRoleRows, U as graphHelper, W as graphSqlName, X as isTeamScope, Y as inheritedRowsHelper, at as permittedIdsHelper, ct as scopeTable, f as holderBody, it as permittedForHelper, nt as memberOfHelper, ot as restrictedHelper, tt as memberIdsHelper } from "./interactive-only-BjYwp9mm.js";
10
+ import { D as globalRoleRows, G as graphHelper, K as graphSqlName, Q as isTeamScope, X as hasPermittedUsers, Z as inheritedRowsHelper, ct as restrictedHelper, et as memberForHelper, it as memberOfHelper, m as holderBody, ot as permittedForHelper, rt as memberIdsHelper, st as permittedIdsHelper, ut as scopeTable } from "./interactive-only-Dqww0ABO.js";
11
11
  import { a as quoteIdent, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
12
12
  // src/cli/rls/permission-holders.ts
13
13
  /**
@@ -194,7 +194,7 @@ async function rlsInput(ctx, verb, shape, options) {
194
194
  };
195
195
  }
196
196
  async function runRls(input) {
197
- return (await import("./rls-BPHCyA5v.js")).runRls(input);
197
+ return (await import("./rls-DUYok5e9.js")).runRls(input);
198
198
  }
199
199
  ({
200
200
  ...shapeFlags,
@@ -302,10 +302,15 @@ const report = defineLeaf({
302
302
  flags: { ...dbUrlFlags },
303
303
  async run(ctx, { flags }) {
304
304
  const db = await dbUrl(ctx, flags);
305
- const [{ runRlsReport }, { pgConnector }] = await Promise.all([import("./report-BevPHMy6.js"), import("./pg-DtiDogUp.js")]);
305
+ const [{ runRlsReport }, { pgConnector }, { configuredTableReads }] = await Promise.all([
306
+ import("./report-DCAiUc5U.js"),
307
+ import("./pg-DtiDogUp.js"),
308
+ import("./table-reads-BviGc0L_.js")
309
+ ]);
306
310
  return runRlsReport({
307
311
  cwd: ctx.cwd,
308
312
  config: ctx.config,
313
+ tableReads: await configuredTableReads(ctx.cwd, ctx.config),
309
314
  ...db === void 0 ? {} : {
310
315
  db,
311
316
  connect: pgConnector("permdock rls report", ctx.cwd)
@@ -2,18 +2,19 @@ import "./sources-DnjJPGfb.js";
2
2
  import { a as describeError, f as usageResult, o as exitCodeOfError } from "./errors-DgLOqc6j.js";
3
3
  import { n as openPgPool, r as pgConnector, t as connectPgPool } from "./pg-DmS5ITHu.js";
4
4
  import { i as taggedAccessPolicies } from "./bsb-access-Bcw6GrQm.js";
5
- import { n as resolveSchemas, r as schemasRefusal, t as isSupabaseSchemas } from "./supabase-schemas-BUFeyErz.js";
6
- import { o as nonEmptyOr } from "./output-Didy9Ys4.js";
5
+ import { n as resolveSchemas, r as schemasRefusal, t as isSupabaseSchemas } from "./supabase-schemas-BglbAG2Z.js";
6
+ import { o as nonEmptyOr } from "./output-C7EPeSZj.js";
7
7
  import { n as packageManagerOf, t as addLine } from "./peer-D77JpXe-.js";
8
- import { n as describeExplain, t as runRlsGenerate } from "./generate-eor7vXGN.js";
9
- import { c as INDEX_COLUMNS_SQL, f as readTableIndexFacts, s as COLUMNS_SQL } from "./compile-DNVVdVWs.js";
8
+ import { n as describeExplain, t as runRlsGenerate } from "./generate-CW7gNfLr.js";
9
+ import { c as INDEX_COLUMNS_SQL, f as readTableIndexFacts, s as COLUMNS_SQL } from "./compile-BXKYYmT1.js";
10
10
  import { r as escapeSqlIdent } from "./sql-T4GaBh9X.js";
11
11
  import { t as beforeFirst } from "./text-D704xHVl.js";
12
12
  import { a as helperCallKeys, i as callsHelper, t as HELPER_TABLES } from "./helper-calls-DHvgN9tr.js";
13
- import { t as isPlatformSchema } from "./platform-CSxTsLsr.js";
13
+ import { u as isPlatformSchema } from "./report-DievqWhf.js";
14
14
  import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-y_PSRCyJ.js";
15
- import { a as verifyResult, i as verifyIgnores, n as runRlsVerify, r as rlsFinding } from "./verify-DNERav8K.js";
16
- import { r as parseRbacAuthorize } from "./rbac-CwcucZPx.js";
15
+ import { a as verifyResult, i as verifyIgnores, n as runRlsVerify, r as rlsFinding } from "./verify-CKzngsUH.js";
16
+ import { r as parseRbacAuthorize } from "./rbac-mblGDx-Z.js";
17
+ import { n as configuredTableReads } from "./table-reads-AnHPrBp8.js";
17
18
  import { r as isRecord } from "./compact-C4LFuqbW.js";
18
19
  import { a as rel, o as sqlFiles } from "./files-DAR51W3J.js";
19
20
  import { t as importFromApp } from "./app-peer-BnMh5lqz.js";
@@ -859,6 +860,15 @@ async function explain(input) {
859
860
  tenantColumn: policy.tenantColumn
860
861
  }))
861
862
  };
863
+ const rowTables = (await configuredTableReads(input.cwd, input.config)).filter((read) => read.share === "row").map((read) => ({
864
+ table: read.table,
865
+ rules: read.rules ?? [],
866
+ ...read.reason === void 0 ? {} : { reason: read.reason }
867
+ }));
868
+ if (rowTables.length > 0) report = {
869
+ ...report,
870
+ rowTables
871
+ };
862
872
  if (input.db !== void 0) try {
863
873
  const facts = await readTableIndexFacts(input.db, report.bindings.map((binding) => binding.table), input.connect);
864
874
  report = {
@@ -3,7 +3,7 @@ import { i as dateAt } from "./time-r0CKBm57.js";
3
3
  import { n as CliError } from "./errors-DgLOqc6j.js";
4
4
  import { m as seedsMigration, p as seedDeltaNote } from "./output-files-8lfALMSU.js";
5
5
  import { a as fixturesPresent, i as defaultsSeedSql, o as fixturesSeedSql, r as FIXTURES_PATH, t as DEFAULTS_MARKER } from "./seed-sql-CjF7u0aX.js";
6
- import { t as runRlsGenerate } from "./generate-eor7vXGN.js";
6
+ import { t as runRlsGenerate } from "./generate-CW7gNfLr.js";
7
7
  import { a as quietIo, r as noted } from "./plugin-MQVfUBUS.js";
8
8
  // src/cli/generate/plugins/rls-options.ts
9
9
  function seedMode(seeds) {
@@ -1,4 +1,4 @@
1
- import { c as RlsConfig, g as RlsTarget, o as SupabaseSchemas } from "./types-config-BiMM_zJ-.js";
1
+ import { c as RlsConfig, g as RlsTarget, o as SupabaseSchemas } from "./types-config-DNIw_Gt5.js";
2
2
  /**
3
3
  * `rls.seeds` as a mode, or `false` to skip the rows, or where they are
4
4
  * written.
@@ -0,0 +1 @@
1
+ export { t as run } from "./run-WIqPbnjD.js";
@@ -1,11 +1,11 @@
1
1
  import { i as dateAt } from "./time-r0CKBm57.js";
2
- import { a as readConfig, l as withPluginOutputs, s as resolveCwd } from "./config-D8iWeV9k.js";
2
+ import { a as readConfig, l as withPluginOutputs, s as resolveCwd } from "./config-7QvEq57a.js";
3
3
  import { t as beforeFirst } from "./text-D704xHVl.js";
4
4
  import { a as describeError, n as CliError, r as cliFailure, s as failureOf, u as kindOfCode } from "./errors-DgLOqc6j.js";
5
5
  import { a as suggestion, i as parseLeaf, o as GLOBAL_FLAGS, r as parseFlags } from "./args-BSpXxMnb.js";
6
- import { a as githubAnnotations, c as sarifLog, d as consentReasons, f as quote, i as findingsDocument, l as confirmationRequired, n as errorDocument, p as replayArgv, s as resultDocument, t as dataOf, u as consentDigest } from "./output-Didy9Ys4.js";
6
+ import { a as githubAnnotations, c as sarifLog, d as consentReasons, f as quote, i as findingsDocument, l as confirmationRequired, n as errorDocument, p as replayArgv, s as resultDocument, t as dataOf, u as consentDigest } from "./output-C7EPeSZj.js";
7
7
  import { r as progressReporter, t as redact } from "./credentials-6ZWbJ-Re.js";
8
- import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-CowZuywo.js";
8
+ import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-31igzVGQ.js";
9
9
  import { t as createStyle } from "./style-CQDaLJtP.js";
10
10
  import { s as cliVersion } from "./version-D-jWyJb9.js";
11
11
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
@@ -16,7 +16,7 @@ const scan = defineLeaf({
16
16
  }
17
17
  },
18
18
  async run(ctx, { flags }) {
19
- const { runAdoptionScan } = await import("./adoption-scan-9brJ_mUG.js");
19
+ const { runAdoptionScan } = await import("./adoption-scan-BJMEEu7V.js");
20
20
  return runAdoptionScan({
21
21
  cwd: ctx.cwd,
22
22
  srcPath: flags.src.length > 0 ? flags.src : ctx.config.collect?.srcPath ?? ["src"],
@@ -1,7 +1,7 @@
1
1
  import { t as require__2020 } from "./2020-DBXhfpuK.js";
2
2
  import { r as isRecord } from "./compact-C4LFuqbW.js";
3
3
  import { t as DRAFT_PINS } from "./pins-CXXkVEiD.js";
4
- import { o as nonEmptyOr } from "./output-Didy9Ys4.js";
4
+ import { o as nonEmptyOr } from "./output-C7EPeSZj.js";
5
5
  import { l as packageRoot } from "./version-D-jWyJb9.js";
6
6
  import { readFileSync } from "node:fs";
7
7
  import { join } from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { t as defineLeaf } from "./command-9GAzSI7E.js";
2
2
  import { t as checkFlag } from "./flags-DQzNPxg1.js";
3
3
  import { r as pick, t as CANCELLED } from "./prompt-CPlJn_4-.js";
4
- import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-CzhnDo-C.js";
4
+ import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-CTKq3o8D.js";
5
5
  // src/cli/commands/skills.ts
6
6
  const forFlag = { for: {
7
7
  type: "string",
@@ -1,6 +1,6 @@
1
1
  import { t as byCodePoint } from "./compare-dfHDj8kT.js";
2
2
  import { t as didYouMean } from "./args-BSpXxMnb.js";
3
- import { o as nonEmptyOr } from "./output-Didy9Ys4.js";
3
+ import { o as nonEmptyOr } from "./output-C7EPeSZj.js";
4
4
  import { i as readJsonFile, s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
5
5
  import { l as packageRoot } from "./version-D-jWyJb9.js";
6
6
  import { cpSync, existsSync, lstatSync, readFileSync, readdirSync, readlinkSync, realpathSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import { Er as Principal, it as MembershipSource, mn as AuthEvent, q as CustomRoleSource } from "./policy-types-CfW4X_yX.js";
2
2
  import { t as SqlQuery } from "./sql-BYYNi1lu.js";
3
- import { c as SupabaseManifestMembership } from "./manifest-CA3E0KP8.js";
3
+ import { c as SupabaseManifestMembership } from "./manifest-DgsxeAsM.js";
4
4
  import { t as ClaimsMap } from "./claims-map-CLKQWxJG.js";
5
5
  import { t as ClientNames } from "./clients-DGcyFDCc.js";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -1,14 +1,14 @@
1
1
  import { D as Policy, Er as Principal, N as PolicyVocabulary, Or as Subject, Q as Intent, qt as Instant } from "../policy-types-CfW4X_yX.js";
2
- import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-D5n28164.js";
2
+ import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-CjgZns7t.js";
3
3
  import { a as ApprovalDelegationSource, m as ApprovalStore, u as ApprovalRequest } from "../types-vKKndyxx.js";
4
4
  import { a as SupabaseRpcResult, i as SupabaseRpcClient, n as PostgrestSourcesOptions, o as postgrestSources, r as SupabaseRpcCaller, t as PostgrestSources } from "../postgrest-PQ3zAOD2.js";
5
5
  import { F as PermissionState, P as PermissionCheck, a as PermDock, z as ApprovalPolicySource } from "../permdock-BShHM8OJ.js";
6
6
  import { t as SqlQuery } from "../sql-BYYNi1lu.js";
7
7
  import { a as readSubjectRecord, r as SubjectRecord } from "../subject-cache-CnJcz2K_.js";
8
- import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-CA3E0KP8.js";
8
+ import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-DgsxeAsM.js";
9
9
  import { a as AppOptions, n as PermDockDefinition, r as PermDockQuery } from "../define-permdock-DBgwTFi1.js";
10
10
  import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-5LJ8kfZk.js";
11
- import { n as subjectFromSupabaseClient, t as SupabaseClaimsClient } from "../client-subject-BOPbpwgm.js";
11
+ import { n as subjectFromSupabaseClient, t as SupabaseClaimsClient } from "../client-subject-xCSkKD1C.js";
12
12
  /**
13
13
  * The server topic the generated version trigger broadcasts on without
14
14
  * better-supabase; no user may join it. With better-supabase it is
@@ -5,5 +5,5 @@ import { a as tableApprovalPolicySource, c as exchangeCapability, i as tableAppr
5
5
  import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-DnjJPGfb.js";
6
6
  import { r as subjectFromSupabaseClient, s as postgrestSources } from "../resolver-CuIY8aFD.js";
7
7
  import { a as delegationOf, i as actorOf, o as subjectFromSupabase, s as subjectFromSupabaseSession } from "../definition-options-9o8Hdww3.js";
8
- import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-DdNYR_pl.js";
8
+ import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-B487A3po.js";
9
9
  export { AUTHZ_EVENT, AUTHZ_TOPIC, AUTHZ_VERSION_TABLE, actorOf, authorizeSql, authzUserTopic, authzVersion, definePermDock, delegationOf, exchangeCapability, hasTokenHook, junctionMembershipSource, parseSupabaseManifest, postgrestSources, readSubjectRecord, subjectFromSupabase, subjectFromSupabaseClient, subjectFromSupabaseSession, supabaseApprovalStore, supabaseClaims, supabaseMembershipsBudget, supabasePostgresQuery, supabaseRls, supabaseTenantClaim, tableApprovalDelegationSource, tableApprovalPolicySource, tableMembershipSource };
@@ -15,7 +15,7 @@ const inspect = defineLeaf({
15
15
  },
16
16
  async run(ctx, { flags }) {
17
17
  const out = flags.out === "" ? true : flags.out === "-" ? void 0 : flags.out;
18
- const { runSupabase } = await import("./supabase-hook-DXGg5bNn.js");
18
+ const { runSupabase } = await import("./supabase-hook-CluYxKee.js");
19
19
  return runSupabase({
20
20
  cwd: ctx.cwd,
21
21
  config: ctx.config,
@@ -0,0 +1,2 @@
1
+ import "./hook-sql-D-abRHut.js";
2
+ export { r as runSupabase } from "./supabase-hook-CqO_0Koh.js";