permdock 0.37.0 → 0.38.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 (92) hide show
  1. package/dist/{adoption-scan-sufK4R53.js → adoption-scan-D-uM3y5a.js} +1 -1
  2. package/dist/{arazzo-D0ctRNBU.js → arazzo-BdWGzdqv.js} +1 -1
  3. package/dist/{arazzo-BxtTsEK2.js → arazzo-CyENGJ-M.js} +1 -1
  4. package/dist/{bsb-access-tags-LCaE48SK.js → bsb-access-tags-C4iPlzjs.js} +1 -1
  5. package/dist/{casbin-CMEY_GT4.js → casbin-DdJndgnu.js} +1 -1
  6. package/dist/{casbin-CkLvGuUb.js → casbin-ILRPO6t9.js} +1 -1
  7. package/dist/cli/bin.js +1 -1
  8. package/dist/cli/generate/watch-worker.js +1 -1
  9. package/dist/cli/index.js +1 -1
  10. package/dist/cli/plugins/app.js +1 -1
  11. package/dist/cli/plugins/openapi.js +1 -1
  12. package/dist/cli/plugins/powersync.js +1 -1
  13. package/dist/cli/plugins/rls.js +1 -1
  14. package/dist/cli/plugins/schemas.js +1 -1
  15. package/dist/cli/plugins/supabase-hook.js +1 -1
  16. package/dist/cli/plugins/supabase.js +2 -2
  17. package/dist/cli/plugins/ui.js +1 -1
  18. package/dist/{cloud-N4IUVluH.js → cloud-C8bHMKjI.js} +1 -1
  19. package/dist/{codemod-C9SQqhNG.js → codemod-D02eYuzA.js} +4 -4
  20. package/dist/{codemod-D5a5oDJX.js → codemod-D8zh3IYV.js} +1 -1
  21. package/dist/{compile-BFV2WG67.js → compile-7tf8hHlu.js} +3 -3
  22. package/dist/{completion-BUWG1FGo.js → completion-BZShluF7.js} +1 -1
  23. package/dist/{config-B3Bc6Tly.js → config-ClypJwe2.js} +1 -1
  24. package/dist/{config-report-3IhYuH4v.js → config-report-Kb-mYv9F.js} +1 -1
  25. package/dist/{context-CNI2jibq.js → context-BQQzAw83.js} +1 -1
  26. package/dist/{custom-role-rebuild-QFXiMHqJ.js → custom-role-rebuild-CRz6Ip6J.js} +1 -1
  27. package/dist/{doctor-DP7HwXw_.js → doctor-DAx9dIEX.js} +2 -2
  28. package/dist/{doctor-DhpDQ5C6.js → doctor-XSdrG1SZ.js} +17 -17
  29. package/dist/{execute-g-nMgY4t.js → execute-DgCH7kEE.js} +3 -3
  30. package/dist/gen-Df-r9jpy.js +1 -0
  31. package/dist/{gen-kind-DLnQ-vCe.js → gen-kind-DIltjpY9.js} +1 -1
  32. package/dist/{gen-CTRqv1H2.js → gen-m1X9N8DZ.js} +2 -2
  33. package/dist/{generate-dbQzpEqb.js → generate-CIjPy_cH.js} +3 -3
  34. package/dist/{generate-DcPnvokU.js → generate-DWL9aXjZ.js} +11 -11
  35. package/dist/{generate-options-4jvPn7w3.js → generate-options-RvPqyMWE.js} +7 -7
  36. package/dist/{hook-sql-3yPtwas6.js → hook-sql-C24FFEWr.js} +5 -5
  37. package/dist/{import-DEUiWePf.js → import-Dmm7N9C6.js} +1 -1
  38. package/dist/{init-DqOKr99S.js → init-Cgcea11w.js} +1 -1
  39. package/dist/{init-CUviJnno.js → init-tXmJlH7f.js} +3 -3
  40. package/dist/{inspect-functions-Uv3Ndkty.js → inspect-functions-DbhgRvDf.js} +1 -1
  41. package/dist/{interactive-only-CylKSukS.js → interactive-only-ad2JJYk8.js} +12 -7
  42. package/dist/{keys-CA3SdBHQ.js → keys-B4JLF5VZ.js} +1 -1
  43. package/dist/{login-mcxQxTAL.js → login-DAqoZl0F.js} +1 -1
  44. package/dist/{login-BMONKzI_.js → login-fz4tUg2P.js} +3 -3
  45. package/dist/{manifest-tO5SjSGH.js → manifest-DbJC_rXj.js} +34 -34
  46. package/dist/{measure-r811lN7F.js → measure-R9VWfQ2y.js} +1 -1
  47. package/dist/{model-wt3wihiH.js → model-8NWofaam.js} +1 -1
  48. package/dist/{openapi-BZHc6R7A.js → openapi-BgXg8LkZ.js} +2 -2
  49. package/dist/{openapi-document-CHJI74v_.js → openapi-document-BJcbM0-l.js} +1 -1
  50. package/dist/{openapi-CNWuAQZi.js → openapi-uxD7ABpM.js} +1 -1
  51. package/dist/{output-Bfc3EpB2.js → output-DZS9QWHI.js} +1 -1
  52. package/dist/{ownership-BuQFLjZ5.js → ownership-DO5EF2nr.js} +2 -2
  53. package/dist/{pipeline-DW7cy40F.js → pipeline-IvdKfvuP.js} +2 -2
  54. package/dist/{policy-DTk6NZm-.js → policy-V-sHH2Ku.js} +1 -1
  55. package/dist/{policy-bundle-C7Hz9Rrs.js → policy-bundle-DyJKT9TF.js} +3 -3
  56. package/dist/{powersync-LpKFefiH.js → powersync-BY6r-MIk.js} +1 -1
  57. package/dist/{powersync-CeuhNT0R.js → powersync-BkN45DVg.js} +1 -1
  58. package/dist/{powersync-CoP_nlGj.js → powersync-IqzV6QHS.js} +6 -6
  59. package/dist/{prune-config-C0uSbf1I.js → prune-config-BRqnw6rb.js} +4 -4
  60. package/dist/{pull-A1SkxAyb.js → pull-PDxkxdGN.js} +1 -1
  61. package/dist/pull-n6noMzmE.js +1 -0
  62. package/dist/{rbac-Dx88RLxH.js → rbac-BK_wp3eK.js} +1 -1
  63. package/dist/{rename-RnOp8vDq.js → rename-BbdlodFz.js} +2 -2
  64. package/dist/{resolve-names-Ch5Ve5l4.js → resolve-names-B85N2-Ws.js} +2 -2
  65. package/dist/{rls-CHJbaZxj.js → rls-BkXnBVXx.js} +7 -7
  66. package/dist/{rls-DgYAJpVW.js → rls-DTXsf2zJ.js} +3 -3
  67. package/dist/{rls-files-RZ7PGrzg.js → rls-files-BJMmTuC9.js} +1 -1
  68. package/dist/run-DqqVLgh_.js +1 -0
  69. package/dist/{run-CbJPONx5.js → run-dwwtRWj6.js} +2 -2
  70. package/dist/{scan-DjTW-y6E.js → scan-BGTnZXgx.js} +1 -1
  71. package/dist/{schema-DVyxM9xS.js → schema-KPTMZVeK.js} +1 -1
  72. package/dist/{skills-BYc8rmHF.js → skills-CexZ2QfF.js} +1 -1
  73. package/dist/{skills-BdmjI4D2.js → skills-jPbcwqhX.js} +1 -1
  74. package/dist/{supabase-BAuqWNj3.js → supabase-DgHCnzMW.js} +2 -2
  75. package/dist/supabase-hook-8jAi64W9.js +2 -0
  76. package/dist/{supabase-hook-BbwsceID.js → supabase-hook-BIBC5Ihn.js} +5 -5
  77. package/dist/{supabase-schemas-RG58AMTu.js → supabase-schemas-DOc3cNnf.js} +1 -1
  78. package/dist/{table-reads--NupdCFw.js → table-reads-CMP1MnPJ.js} +1 -1
  79. package/dist/{table-reads-Glf0BHSE.js → table-reads-CXecyZKo.js} +1 -1
  80. package/dist/{tables-Dyfviku5.js → tables-C-DzDqKb.js} +4 -4
  81. package/dist/{tenant-check-Bfd4hotj.js → tenant-check-DoZibca6.js} +3 -3
  82. package/dist/{usage-7Hwk_akY.js → usage-BiTJQNJO.js} +2 -2
  83. package/dist/usage-D7-bsLte.js +1 -0
  84. package/dist/{usage-nZP7EeRj.js → usage-ltA8iGa4.js} +1 -1
  85. package/dist/{verify-DOCJgGlw.js → verify-Dj3OjNiD.js} +3 -3
  86. package/dist/{watch-DYsWhTvO.js → watch--c--3aEf.js} +1 -1
  87. package/package.json +1 -1
  88. package/dist/gen-D-orrO2e.js +0 -1
  89. package/dist/pull-CNMED72E.js +0 -1
  90. package/dist/run-iPVAxorh.js +0 -1
  91. package/dist/supabase-hook-CObLSH20.js +0 -2
  92. package/dist/usage-Bwl8YAmq.js +0 -1
@@ -48,7 +48,7 @@ const init = defineLeaf({
48
48
  ...forceFlag
49
49
  },
50
50
  async run(ctx, { flags }) {
51
- const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-DqOKr99S.js"), import("./peer-BWTpSLs2.js")]);
51
+ const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-Cgcea11w.js"), import("./peer-BWTpSLs2.js")]);
52
52
  const agent = await packageManagerOf(ctx.cwd);
53
53
  const selection = {
54
54
  archetype: flags.archetype,
@@ -79,7 +79,7 @@ const presetDecode = defineLeaf({
79
79
  positionals: presetCode,
80
80
  flags: {},
81
81
  async run(_ctx, { args }) {
82
- const { runPreset } = await import("./init-DqOKr99S.js");
82
+ const { runPreset } = await import("./init-Cgcea11w.js");
83
83
  return runPreset("decode", args["code"] ?? "");
84
84
  }
85
85
  });
@@ -87,7 +87,7 @@ const presetUrl = defineLeaf({
87
87
  positionals: presetCode,
88
88
  flags: {},
89
89
  async run(_ctx, { args }) {
90
- const { runPreset } = await import("./init-DqOKr99S.js");
90
+ const { runPreset } = await import("./init-Cgcea11w.js");
91
91
  return runPreset("url", args["code"] ?? "");
92
92
  }
93
93
  });
@@ -1,4 +1,4 @@
1
- import { n as configuredTableReads, o as functionShares } from "./table-reads--NupdCFw.js";
1
+ import { n as configuredTableReads, o as functionShares } from "./table-reads-CMP1MnPJ.js";
2
2
  // src/cli/rls/inspect-functions.ts
3
3
  /**
4
4
  * `permdock supabase inspect --functions <pattern>`: for each function the
@@ -1233,7 +1233,7 @@ const SETOF_ROWS = 10;
1233
1233
  * `language sql`, or `plpgsql` returning the query when the body declares
1234
1234
  * variables.
1235
1235
  */
1236
- function functionBody(body, parallelSafe = false, setof = false) {
1236
+ function functionBody(body, parallelSafe = false, setof = false, returnsSet = setof) {
1237
1237
  const planner = `cost 1000${setof ? `\nrows ${String(SETOF_ROWS)}` : ""}${parallelSafe ? "\nparallel safe" : ""}`;
1238
1238
  if (body.memo !== void 0) {
1239
1239
  const declare = [
@@ -1285,7 +1285,7 @@ ${body.sql}
1285
1285
  end;
1286
1286
  $$;`;
1287
1287
  }
1288
- if (body.vars.length === 0) return `language sql
1288
+ if (body.vars.length === 0 && /^\s*select [^\n]* where false(?: --[^\n]*)?$/u.test(body.sql)) return `language sql
1289
1289
  stable
1290
1290
  security definer
1291
1291
  ${planner}
@@ -1293,17 +1293,22 @@ set search_path = ''
1293
1293
  as $$
1294
1294
  ${body.sql}
1295
1295
  $$;`;
1296
+ const declare = body.vars.length === 0 ? "" : `declare
1297
+ ${body.vars.map((line) => ` ${line}`).join("\n")}
1298
+ `;
1299
+ const end = body.sql.slice(body.sql.lastIndexOf("\n") + 1).includes("--") ? "\n ;" : ";";
1296
1300
  return `language plpgsql
1297
1301
  stable
1298
1302
  security definer
1299
1303
  ${planner}
1300
1304
  set search_path = ''
1301
1305
  as $$
1302
- declare
1303
- ${body.vars.map((line) => ` ${line}`).join("\n")}
1304
- begin
1305
- return query
1306
- ${body.sql};
1306
+ #variable_conflict use_column
1307
+ ${declare}begin
1308
+ ${returnsSet ? ` return query
1309
+ ${body.sql}${end}` : ` return (
1310
+ ${body.sql}
1311
+ );`}
1307
1312
  end;
1308
1313
  $$;`;
1309
1314
  }
@@ -24,7 +24,7 @@ const keysRename = defineLeaf({
24
24
  }
25
25
  },
26
26
  async run(ctx, { flags, args }) {
27
- const { runKeysRename } = await import("./rename-RnOp8vDq.js");
27
+ const { runKeysRename } = await import("./rename-BbdlodFz.js");
28
28
  const migration = given(flags.migration);
29
29
  return runKeysRename({
30
30
  cwd: ctx.cwd,
@@ -3,7 +3,7 @@ import { i as postForm, r as parseToken, s as runDeviceFlow } from "./device-f3J
3
3
  import { i as writeCredentials, n as deleteCredentials, r as readCredentials, t as credentialsPath } from "./storage-BhGDhsXm.js";
4
4
  import { n as CliError } from "./errors-DgLOqc6j.js";
5
5
  import { n as httpRequest } from "./http-BbX_Ou3_.js";
6
- import { o as nonEmptyOr } from "./output-Bfc3EpB2.js";
6
+ import { o as nonEmptyOr } from "./output-DZS9QWHI.js";
7
7
  import { c as READ_SCOPES, d as issuerMetadata, i as credentialsInsideRepository, l as cloudUrl, n as cliRuntime, r as credentialStorage, s as CLI_CLIENT_ID, t as CREDENTIAL_SERVICE } from "./auth-WHKYWtnS.js";
8
8
  import { n as randomToken, t as pkce } from "./pkce-DdsRBK7n.js";
9
9
  import { spawn } from "node:child_process";
@@ -27,7 +27,7 @@ const login = defineLeaf({
27
27
  }
28
28
  },
29
29
  async run(ctx, { flags }) {
30
- const { runLogin } = await import("./login-mcxQxTAL.js");
30
+ const { runLogin } = await import("./login-DAqoZl0F.js");
31
31
  return runLogin({
32
32
  cwd: ctx.cwd,
33
33
  url: given(flags.url),
@@ -43,7 +43,7 @@ const login = defineLeaf({
43
43
  const logout = defineLeaf({
44
44
  flags: { ...urlFlag },
45
45
  async run(ctx, { flags }) {
46
- const { runLogout } = await import("./login-mcxQxTAL.js");
46
+ const { runLogout } = await import("./login-DAqoZl0F.js");
47
47
  return runLogout({
48
48
  url: given(flags.url),
49
49
  json: ctx.json,
@@ -55,7 +55,7 @@ const logout = defineLeaf({
55
55
  const whoami = defineLeaf({
56
56
  flags: { ...urlFlag },
57
57
  async run(ctx, { flags }) {
58
- const { runWhoami } = await import("./login-mcxQxTAL.js");
58
+ const { runWhoami } = await import("./login-DAqoZl0F.js");
59
59
  return runWhoami({
60
60
  url: given(flags.url),
61
61
  json: ctx.json,
@@ -30,20 +30,20 @@ const SECTIONS = [
30
30
  docs: "init",
31
31
  effects: ["files"],
32
32
  config: false,
33
- load: async () => (await import("./init-CUviJnno.js")).init
33
+ load: async () => (await import("./init-tXmJlH7f.js")).init
34
34
  }),
35
35
  group("preset", "Decode a preset code, or print its permdock.com/create link", "preset", [leaf("decode", "Print what a preset code holds", {
36
36
  examples: ["permdock preset decode p1AQIDBAc"],
37
37
  docs: "preset",
38
38
  effects: [],
39
39
  config: false,
40
- load: async () => (await import("./init-CUviJnno.js")).presetDecode
40
+ load: async () => (await import("./init-tXmJlH7f.js")).presetDecode
41
41
  }), leaf("url", "Print the permdock.com/create link that opens a code", {
42
42
  examples: ["permdock preset url p1AQIDBAc"],
43
43
  docs: "preset",
44
44
  effects: [],
45
45
  config: false,
46
- load: async () => (await import("./init-CUviJnno.js")).presetUrl
46
+ load: async () => (await import("./init-tXmJlH7f.js")).presetUrl
47
47
  })]),
48
48
  group("skills", "Install, update or list the PermDock Agent Skills", "skills", [
49
49
  leaf("install", "Copy the Agent Skills into the agent folders", {
@@ -55,21 +55,21 @@ const SECTIONS = [
55
55
  docs: "skills",
56
56
  effects: ["files"],
57
57
  config: false,
58
- load: async () => (await import("./skills-BYc8rmHF.js")).install
58
+ load: async () => (await import("./skills-CexZ2QfF.js")).install
59
59
  }),
60
60
  leaf("update", "Replace installed skills with this version's", {
61
61
  examples: ["permdock skills update"],
62
62
  docs: "skills",
63
63
  effects: ["files"],
64
64
  config: false,
65
- load: async () => (await import("./skills-BYc8rmHF.js")).update
65
+ load: async () => (await import("./skills-CexZ2QfF.js")).update
66
66
  }),
67
67
  leaf("list", "List the skills and where each is installed", {
68
68
  examples: ["permdock skills list"],
69
69
  docs: "skills",
70
70
  effects: [],
71
71
  config: false,
72
- load: async () => (await import("./skills-BYc8rmHF.js")).list
72
+ load: async () => (await import("./skills-CexZ2QfF.js")).list
73
73
  })
74
74
  ]),
75
75
  leaf("doctor", "Check a PermDock installation and print a fix for each finding", {
@@ -83,7 +83,7 @@ const SECTIONS = [
83
83
  effects: ["files", "database:read"],
84
84
  config: true,
85
85
  findings: true,
86
- load: async () => (await import("./doctor-DP7HwXw_.js")).doctor
86
+ load: async () => (await import("./doctor-DAx9dIEX.js")).doctor
87
87
  }),
88
88
  leaf("completion", "Print the shell completion script for bash, zsh or fish", {
89
89
  examples: ["permdock completion zsh > ~/.zfunc/_permdock", "eval \"$(permdock completion bash)\""],
@@ -91,7 +91,7 @@ const SECTIONS = [
91
91
  effects: [],
92
92
  config: false,
93
93
  shellOutput: true,
94
- load: async () => (await import("./completion-BUWG1FGo.js")).completion
94
+ load: async () => (await import("./completion-BZShluF7.js")).completion
95
95
  })
96
96
  ]
97
97
  },
@@ -125,7 +125,7 @@ const SECTIONS = [
125
125
  docs: "generate",
126
126
  effects: ["files"],
127
127
  config: true,
128
- load: async () => (await import("./generate-dbQzpEqb.js")).generate
128
+ load: async () => (await import("./generate-CIjPy_cH.js")).generate
129
129
  }),
130
130
  leaf("usage", "Report unused, ungranted and role-less permissions and conditions on undeclared fields", {
131
131
  examples: ["permdock usage", "permdock usage --fail-on warning"],
@@ -133,7 +133,7 @@ const SECTIONS = [
133
133
  effects: [],
134
134
  config: true,
135
135
  findings: true,
136
- load: async () => (await import("./usage-nZP7EeRj.js")).usage
136
+ load: async () => (await import("./usage-ltA8iGa4.js")).usage
137
137
  }),
138
138
  leaf("diff", "Compare two policies or catalogs; exit 1 on a breaking change", {
139
139
  examples: ["permdock diff main.catalog.json permissions.catalog.json", "permdock diff ./old-policy.ts ./src/policy.ts --impact"],
@@ -175,7 +175,7 @@ const SECTIONS = [
175
175
  docs: "keys",
176
176
  effects: ["rewrite", "files"],
177
177
  config: true,
178
- load: async () => (await import("./keys-CA3SdBHQ.js")).keysRename
178
+ load: async () => (await import("./keys-B4JLF5VZ.js")).keysRename
179
179
  })]),
180
180
  group("policy", "Write the static grants of a policy as a content-addressed bundle", "policy", [leaf("bundle", "Write the policy bundle that rls.staticGrants 'ref' pins by hash", {
181
181
  examples: [
@@ -186,7 +186,7 @@ const SECTIONS = [
186
186
  docs: "policy",
187
187
  effects: ["files"],
188
188
  config: true,
189
- load: async () => (await import("./policy-DTk6NZm-.js")).policyBundle
189
+ load: async () => (await import("./policy-V-sHH2Ku.js")).policyBundle
190
190
  })]),
191
191
  group("claims", "Measure the memberships claim of an access token", "claims", [leaf("size", "Report claim bytes, token characters and the budget cut", {
192
192
  examples: ["permdock claims size --memberships 60", "permdock claims size --memberships 11 --roles 3 --json"],
@@ -201,7 +201,7 @@ const SECTIONS = [
201
201
  effects: [],
202
202
  config: true,
203
203
  findings: true,
204
- load: async () => (await import("./config-B3Bc6Tly.js")).config
204
+ load: async () => (await import("./config-ClypJwe2.js")).config
205
205
  })
206
206
  ]
207
207
  },
@@ -214,7 +214,7 @@ const SECTIONS = [
214
214
  docs: "rls",
215
215
  effects: ["files", "database:read"],
216
216
  config: true,
217
- load: async () => (await import("./rls-DgYAJpVW.js")).importPolicies
217
+ load: async () => (await import("./rls-DTXsf2zJ.js")).importPolicies
218
218
  }),
219
219
  leaf("verify", "Run the fixtures against the policies, or compare a live database", {
220
220
  examples: [
@@ -226,35 +226,35 @@ const SECTIONS = [
226
226
  effects: ["files", "database:read"],
227
227
  config: true,
228
228
  findings: true,
229
- load: async () => (await import("./rls-DgYAJpVW.js")).verify
229
+ load: async () => (await import("./rls-DTXsf2zJ.js")).verify
230
230
  }),
231
231
  leaf("migrate", "Rewrite hand-written policies onto the generated helpers", {
232
232
  examples: ["permdock rls migrate --sql supabase/migrations --dry-run", "permdock rls migrate --sql supabase/migrations"],
233
233
  docs: "rls",
234
234
  effects: ["rewrite", "files"],
235
235
  config: true,
236
- load: async () => (await import("./rls-DgYAJpVW.js")).migrate
236
+ load: async () => (await import("./rls-DTXsf2zJ.js")).migrate
237
237
  }),
238
238
  leaf("explain", "Show the tables, membership sources and triggers the SQL binds to", {
239
239
  examples: ["permdock rls explain", "permdock rls explain --db-url-stdin --json"],
240
240
  docs: "rls",
241
241
  effects: ["database:read"],
242
242
  config: true,
243
- load: async () => (await import("./rls-DgYAJpVW.js")).explain
243
+ load: async () => (await import("./rls-DTXsf2zJ.js")).explain
244
244
  }),
245
245
  leaf("measure", "Run requests as a user and count version reads, helper times and share keys", {
246
246
  examples: ["permdock rls measure --as <user-id> --local", "permdock rls measure --as <user-id>,<user-id> --tenant <tenant-id> --requests 50 --db-url-stdin"],
247
247
  docs: "rls",
248
248
  effects: ["database:read"],
249
249
  config: true,
250
- load: async () => (await import("./rls-DgYAJpVW.js")).measure
250
+ load: async () => (await import("./rls-DTXsf2zJ.js")).measure
251
251
  }),
252
252
  leaf("report", "List each table's policies by command, role, origin and helper calls", {
253
253
  examples: ["permdock rls report", "permdock rls report --local --json"],
254
254
  docs: "rls",
255
255
  effects: ["database:read"],
256
256
  config: true,
257
- load: async () => (await import("./rls-DgYAJpVW.js")).report
257
+ load: async () => (await import("./rls-DTXsf2zJ.js")).report
258
258
  })
259
259
  ]),
260
260
  group("supabase", "Generate the Supabase Custom Access Token Hook, or inspect its manifest", "supabase", [leaf("inspect", "Print or write the hook and helper manifest", {
@@ -262,14 +262,14 @@ const SECTIONS = [
262
262
  docs: "supabase",
263
263
  effects: ["files"],
264
264
  config: true,
265
- load: async () => (await import("./supabase-BAuqWNj3.js")).inspect
265
+ load: async () => (await import("./supabase-DgHCnzMW.js")).inspect
266
266
  })]),
267
267
  group("powersync", "Generate PowerSync Sync Streams from the policy, or verify them", "powersync", [leaf("verify", "Fail on stale streams or a stream that syncs a denied row", {
268
268
  examples: ["permdock powersync verify", "permdock powersync verify --db-url-stdin"],
269
269
  docs: "powersync",
270
270
  effects: ["database:read"],
271
271
  config: true,
272
- load: async () => (await import("./powersync-CeuhNT0R.js")).verify
272
+ load: async () => (await import("./powersync-BkN45DVg.js")).verify
273
273
  })])
274
274
  ]
275
275
  },
@@ -283,7 +283,7 @@ const SECTIONS = [
283
283
  effects: ["files"],
284
284
  config: true,
285
285
  findings: true,
286
- load: async () => (await import("./openapi-BZHc6R7A.js")).emitDocument
286
+ load: async () => (await import("./openapi-BgXg8LkZ.js")).emitDocument
287
287
  }),
288
288
  leaf("annotate", "Write an operations map from @permission comments or an OpenAPI document", {
289
289
  examples: ["permdock openapi annotate --routes 'app/**/route.ts'", "permdock openapi annotate --doc openapi.yaml --tenant-path orgId"],
@@ -291,14 +291,14 @@ const SECTIONS = [
291
291
  effects: ["files"],
292
292
  config: true,
293
293
  findings: true,
294
- load: async () => (await import("./openapi-BZHc6R7A.js")).annotateRoutes
294
+ load: async () => (await import("./openapi-BgXg8LkZ.js")).annotateRoutes
295
295
  }),
296
296
  leaf("import", "Turn an OpenAPI document into a generated definition", {
297
297
  examples: ["permdock openapi import --doc openapi.yaml --out src/permissions.generated.ts"],
298
298
  docs: "openapi",
299
299
  effects: ["files", "network"],
300
300
  config: false,
301
- load: async () => (await import("./openapi-BZHc6R7A.js")).importDocument
301
+ load: async () => (await import("./openapi-BgXg8LkZ.js")).importDocument
302
302
  })
303
303
  ]),
304
304
  group("arazzo", "Check Arazzo workflows against the permissions", "arazzo", [leaf("check", "Resolve every Arazzo step to x-permdock-permissions", {
@@ -307,7 +307,7 @@ const SECTIONS = [
307
307
  effects: [],
308
308
  config: true,
309
309
  findings: true,
310
- load: async () => (await import("./arazzo-D0ctRNBU.js")).check
310
+ load: async () => (await import("./arazzo-BdWGzdqv.js")).check
311
311
  })]),
312
312
  leaf("scan", "List authorization checks written without PermDock, to adopt it in an existing app", {
313
313
  examples: ["permdock scan", "permdock scan --src app,lib --pattern isBeta"],
@@ -315,7 +315,7 @@ const SECTIONS = [
315
315
  effects: [],
316
316
  config: true,
317
317
  findings: true,
318
- load: async () => (await import("./scan-DjTW-y6E.js")).scan
318
+ load: async () => (await import("./scan-BGTnZXgx.js")).scan
319
319
  }),
320
320
  group("casl", "Import CASL rules into a generated module", "casl", [leaf("import", "Turn CASL rules per role into a permissions and policy module", {
321
321
  examples: ["permdock casl import --rules rules.json --out src/permissions.generated.ts"],
@@ -329,7 +329,7 @@ const SECTIONS = [
329
329
  docs: "casbin",
330
330
  effects: ["files"],
331
331
  config: false,
332
- load: async () => (await import("./casbin-CMEY_GT4.js")).casbinImport
332
+ load: async () => (await import("./casbin-DdJndgnu.js")).casbinImport
333
333
  })])
334
334
  ]
335
335
  },
@@ -341,34 +341,34 @@ const SECTIONS = [
341
341
  docs: "login",
342
342
  effects: ["network", "files"],
343
343
  config: false,
344
- load: async () => (await import("./login-BMONKzI_.js")).login
344
+ load: async () => (await import("./login-fz4tUg2P.js")).login
345
345
  }),
346
346
  leaf("logout", "Revoke and delete the stored PermDock Cloud login", {
347
347
  examples: ["permdock logout"],
348
348
  docs: "login",
349
349
  effects: ["network", "files"],
350
350
  config: false,
351
- load: async () => (await import("./login-BMONKzI_.js")).logout
351
+ load: async () => (await import("./login-fz4tUg2P.js")).logout
352
352
  }),
353
353
  leaf("whoami", "Print the PermDock Cloud identity the CLI acts as", {
354
354
  examples: ["permdock whoami", "permdock whoami --json"],
355
355
  docs: "login",
356
356
  effects: [],
357
357
  config: false,
358
- load: async () => (await import("./login-BMONKzI_.js")).whoami
358
+ load: async () => (await import("./login-fz4tUg2P.js")).whoami
359
359
  }),
360
360
  group("cloud", "Publish to or pull from a PermDock Cloud project", "cloud", [leaf("push", "Publish the catalog, policy and manifest to a Cloud project", {
361
361
  examples: ["permdock cloud push --dry-run", "permdock cloud push --project prj_123"],
362
362
  docs: "cloud",
363
363
  effects: ["network", "cloud:write"],
364
364
  config: true,
365
- load: async () => (await import("./cloud-N4IUVluH.js")).push
365
+ load: async () => (await import("./cloud-C8bHMKjI.js")).push
366
366
  }), leaf("pull", "Write a Cloud project's published catalog and manifest", {
367
367
  examples: ["permdock cloud pull --project prj_123"],
368
368
  docs: "cloud",
369
369
  effects: ["network", "files"],
370
370
  config: true,
371
- load: async () => (await import("./cloud-N4IUVluH.js")).pull
371
+ load: async () => (await import("./cloud-C8bHMKjI.js")).pull
372
372
  })])
373
373
  ]
374
374
  },
@@ -383,7 +383,7 @@ const SECTIONS = [
383
383
  docs: "codemod",
384
384
  effects: ["rewrite"],
385
385
  config: false,
386
- load: async () => (await import("./codemod-C9SQqhNG.js")).codemod
386
+ load: async () => (await import("./codemod-D02eYuzA.js")).codemod
387
387
  })]
388
388
  }
389
389
  ];
@@ -395,7 +395,7 @@ const COMPLETE_LEAF = leaf("__complete", "Print completion candidates for a part
395
395
  config: false,
396
396
  shellOutput: true,
397
397
  hidden: true,
398
- load: async () => (await import("./completion-BUWG1FGo.js")).complete
398
+ load: async () => (await import("./completion-BZShluF7.js")).complete
399
399
  });
400
400
  const ROOT = group("permdock", "Collect, export, diff and check the permissions a PermDock policy declares", "", [...SECTIONS.flatMap((section) => section.entries), COMPLETE_LEAF]);
401
401
  /** Each leaf with its path from the root, in manifest order. */
@@ -6,7 +6,7 @@ import "./sources-C6Id63F8.js";
6
6
  import { i as loadConfiguredPolicy } from "./load-m7jmit3y.js";
7
7
  import { a as quoteIdent } from "./quote-LNaBdCGA.js";
8
8
  import { n as activeSource } from "./memberships-CDiSsFTu.js";
9
- import { n as configuredTableReads } from "./table-reads--NupdCFw.js";
9
+ import { n as configuredTableReads } from "./table-reads-CMP1MnPJ.js";
10
10
  // src/cli/rls/measure.ts
11
11
  /** Requests per tenant when `--requests` is absent. */
12
12
  const DEFAULT_REQUESTS = 20;
@@ -7,7 +7,7 @@ import { o as sqlFiles } from "./files-DAR51W3J.js";
7
7
  import { c as jsonSchemaOf } from "./catalog-doc-BX97oFAn.js";
8
8
  import { a as quoteIdent, o as quoteLiteral } from "./quote-LNaBdCGA.js";
9
9
  import { a as parseSqlFile, f as stringValues, l as readRelation, t as SqlSyntaxError, u as removeStatements } from "./ast-Dnm2TOHN.js";
10
- import { f as compileConditionSql } from "./rbac-Dx88RLxH.js";
10
+ import { f as compileConditionSql } from "./rbac-BK_wp3eK.js";
11
11
  import { readFileSync } from "node:fs";
12
12
  import { relative } from "node:path";
13
13
  // src/cli/sql/exported-copies.ts
@@ -79,7 +79,7 @@ const emitFlags = {
79
79
  }
80
80
  };
81
81
  async function executeOpenapiEmit(ctx, flags) {
82
- return (await import("./openapi-CNWuAQZi.js")).runOpenapi({
82
+ return (await import("./openapi-uxD7ABpM.js")).runOpenapi({
83
83
  cwd: ctx.cwd,
84
84
  config: ctx.config,
85
85
  rest: ["emit"],
@@ -183,7 +183,7 @@ const importDocument = defineLeaf({
183
183
  async run(ctx, { flags }) {
184
184
  const doc = given(flags.doc);
185
185
  if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
186
- return (await import("./import-DEUiWePf.js")).runOpenapiImport({
186
+ return (await import("./import-Dmm7N9C6.js")).runOpenapiImport({
187
187
  cwd: ctx.cwd,
188
188
  doc,
189
189
  out: fileOut("openapi import", flags.out),
@@ -3,7 +3,7 @@ import { n as CliError } from "./errors-DgLOqc6j.js";
3
3
  /** The annotated document, without writing it. */
4
4
  async function openapiDocument(task, options, source) {
5
5
  if (options.doc === void 0) return [];
6
- const { runOpenapi } = await import("./openapi-CNWuAQZi.js");
6
+ const { runOpenapi } = await import("./openapi-uxD7ABpM.js");
7
7
  const outcome = await runOpenapi({
8
8
  cwd: source.cwd,
9
9
  config: source.config,
@@ -7,7 +7,7 @@ import { i as fileDrift } from "./output-files-8lfALMSU.js";
7
7
  import { t as shortDiff } from "./text-diff-DxKRNFlx.js";
8
8
  import { i as readJsonFile, s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
9
9
  import { a as loadModule, n as asPolicy, s as pickNamed, t as asPermissionTree } from "./load-m7jmit3y.js";
10
- import { n as validateOverlay, t as validateOpenapi } from "./schema-DVyxM9xS.js";
10
+ import { n as validateOverlay, t as validateOpenapi } from "./schema-KPTMZVeK.js";
11
11
  import { existsSync } from "node:fs";
12
12
  import { resolve } from "node:path";
13
13
  // src/cli/openapi/emit/merge.ts
@@ -1,5 +1,5 @@
1
1
  import { c as isActionRequired, l as isRetryable, n as CliError, t as CLI_ERRORS_URL } from "./errors-DgLOqc6j.js";
2
- import { t as DOCS_BASE } from "./manifest-tO5SjSGH.js";
2
+ import { t as DOCS_BASE } from "./manifest-DbJC_rXj.js";
3
3
  import { s as cliVersion } from "./version-D-jWyJb9.js";
4
4
  import { createHash } from "node:crypto";
5
5
  // src/cli/core/consent.ts
@@ -7,8 +7,8 @@ import { l as roleColumn } from "./sources-C6Id63F8.js";
7
7
  import { i as configError } from "./errors-DgLOqc6j.js";
8
8
  import { a as quoteIdent, i as qualified, n as declaredArray, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
9
9
  import { s as signedIn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
10
- import { A as membershipRows, D as globalRoleRows, I as hasCustomRoleChecksFor, T as sourcesKeep, V as storedTenant, d as disabledColumn, h as memberColumn, j as roleRows, l as claimKeptLines, n as delegatedGlobalSql, o as interactiveSessionSql, x as sourceFilters } from "./interactive-only-CylKSukS.js";
11
- import { _ as sourceTransferTriggerSql, b as ASSIGNMENTS, g as sourceRowsSql, h as sourceHoldersTriggerSql, m as pairsSql, p as holderSources, v as holdersTriggerSql, x as OWNERSHIP, y as transferTriggerSql } from "./tables-Dyfviku5.js";
10
+ import { A as membershipRows, D as globalRoleRows, I as hasCustomRoleChecksFor, T as sourcesKeep, V as storedTenant, d as disabledColumn, h as memberColumn, j as roleRows, l as claimKeptLines, n as delegatedGlobalSql, o as interactiveSessionSql, x as sourceFilters } from "./interactive-only-ad2JJYk8.js";
11
+ import { _ as sourceTransferTriggerSql, b as ASSIGNMENTS, g as sourceRowsSql, h as sourceHoldersTriggerSql, m as pairsSql, p as holderSources, v as holdersTriggerSql, x as OWNERSHIP, y as transferTriggerSql } from "./tables-C-DzDqKb.js";
12
12
  // src/cli/rls/assignments.ts
13
13
  /**
14
14
  * The client roles whose writes the assignment triggers check; any other role
@@ -2,8 +2,8 @@ import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
2
2
  import { r as planFiles, t as applyFiles } from "./files-DuV7wRim.js";
3
3
  import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
4
4
  import { n as CliError } from "./errors-DgLOqc6j.js";
5
- import { a as ownedObjects, i as inReservedDir, n as foreignSchemaFiles, o as shownKey, s as withoutOwned, t as policyModel } from "./model-wt3wihiH.js";
6
- import { n as resolveSchemas } from "./supabase-schemas-RG58AMTu.js";
5
+ import { a as ownedObjects, i as inReservedDir, n as foreignSchemaFiles, o as shownKey, s as withoutOwned, t as policyModel } from "./model-8NWofaam.js";
6
+ import { n as resolveSchemas } from "./supabase-schemas-DOc3cNnf.js";
7
7
  import { i as orderPlugins } from "./plugin-MQVfUBUS.js";
8
8
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
9
9
  import { join, relative, resolve } from "node:path";
@@ -18,7 +18,7 @@ const policyBundle = defineLeaf({
18
18
  },
19
19
  async run(ctx, { flags }) {
20
20
  try {
21
- const { runPolicyBundle } = await import("./policy-bundle-C7Hz9Rrs.js");
21
+ const { runPolicyBundle } = await import("./policy-bundle-DyJKT9TF.js");
22
22
  const policy = await requirePolicy(ctx.cwd, given(flags.policy) ?? ctx.config.policy, "set policy in permdock.config.ts or pass --policy");
23
23
  return runPolicyBundle({
24
24
  cwd: ctx.cwd,
@@ -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-4jvPn7w3.js";
3
- import { r as compileGrants } from "./compile-BFV2WG67.js";
4
- import { X as policyBundle, Y as bundleLoaderSql, i as tableNames, q as POLICY_BUNDLE_FORMAT } from "./tables-Dyfviku5.js";
2
+ import { i as buildContext, n as isRefusal, o as inheritTargets, t as generateOptions } from "./generate-options-RvPqyMWE.js";
3
+ import { r as compileGrants } from "./compile-7tf8hHlu.js";
4
+ import { X as policyBundle, Y as bundleLoaderSql, i as tableNames, q as POLICY_BUNDLE_FORMAT } from "./tables-C-DzDqKb.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-CoP_nlGj.js";
1
+ export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-IqzV6QHS.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-LpKFefiH.js");
27
+ const { runPowerSync } = await import("./powersync-BY6r-MIk.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-DOCJgGlw.js";
12
- import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-Dx88RLxH.js";
11
+ import { t as canFixture } from "./verify-Dj3OjNiD.js";
12
+ import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-BK_wp3eK.js";
13
13
  import { a as quoteIdent, s as quoteQualified } from "./quote-LNaBdCGA.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-C6Id63F8.js";
18
18
  import { a as customRolesOn, t as CUSTOM_ROLES } from "./shared-DnVY767H.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-BuQFLjZ5.js";
22
- import { a as tableFor } from "./compile-BFV2WG67.js";
23
- import { i as tableNames, r as tableNameOf } from "./tables-Dyfviku5.js";
21
+ import { t as ownershipRules } from "./ownership-DO5EF2nr.js";
22
+ import { a as tableFor } from "./compile-7tf8hHlu.js";
23
+ import { i as tableNames, r as tableNameOf } from "./tables-C-DzDqKb.js";
24
24
  import { l as policyLevels } from "./policy-CZBJDcTx.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-RG58AMTu.js";
29
+ import { n as resolveSchemas } from "./supabase-schemas-DOc3cNnf.js";
30
30
  import { existsSync, readFileSync } from "node:fs";
31
31
  import { join, resolve } from "node:path";
32
32
  // src/cli/powersync/claims.ts
@@ -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-CTRqv1H2.js";
5
- import { t as projectContext } from "./context-CNI2jibq.js";
6
- import { t as emitPluginFiles } from "./pipeline-DW7cy40F.js";
4
+ import { t as genFiles } from "./gen-m1X9N8DZ.js";
5
+ import { t as projectContext } from "./context-BQQzAw83.js";
6
+ import { t as emitPluginFiles } from "./pipeline-IvdKfvuP.js";
7
7
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
8
8
  import { S as restatedFacts, c as withDerivedDefaults, o as readParsedConfig, t as configFileIn } from "./config-Dan6vcvj.js";
9
9
  import { c as requirePolicy } from "./load-m7jmit3y.js";
10
10
  import { n as restatedDefaults, r as withoutPath } from "./resolve-config-Cu_mE2wt.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-BFV2WG67.js";
13
+ import { n as commandFor } from "./compile-7tf8hHlu.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
@@ -4,7 +4,7 @@ import { n as parseSupabaseManifest } from "./manifest-teSfgeqF.js";
4
4
  import { o as formatCatalogJson } from "./catalog-doc-BX97oFAn.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-Bfc3EpB2.js";
7
+ import { o as nonEmptyOr } from "./output-DZS9QWHI.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-PDxkxdGN.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 { K as activeUserSql, U as activeInstancesSql, W as activeMembershipSql, c as memoUserSql, g as memoHitList, y as memoizes } from "./interactive-only-CylKSukS.js";
13
+ import { K as activeUserSql, U as activeInstancesSql, W as activeMembershipSql, c as memoUserSql, g as memoHitList, y as memoizes } from "./interactive-only-ad2JJYk8.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-B7p94Y0s.js";
15
15
  import { S as scopeTable, _ as memberRoleOf, a as graphSqlText, b as restrictedHelper, d as linkHelper, h as memberIdsHelper, l as inheritedRowsHelper, n as CLOSURE, r as graphHelper, x as scopeSources } from "./names-DwGleRKB.js";
16
16
  import { a as quoteIdent, c as quoteTable, i as qualified, l as textArrayLiteral, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-LNaBdCGA.js";