permdock 0.26.0 → 0.27.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 (91) hide show
  1. package/dist/{adoption-scan-b0_Xpab8.js → adoption-scan-CMghLDUG.js} +1 -1
  2. package/dist/{arazzo-DMmcumRx.js → arazzo-B8heXoYy.js} +1 -1
  3. package/dist/{arazzo-Hxerfx3_.js → arazzo-DdJBVrsy.js} +1 -1
  4. package/dist/{casbin-CYwbggCS.js → casbin-BHYVxJDD.js} +1 -1
  5. package/dist/{casbin-Co1KcLWU.js → casbin-D33ZeUf5.js} +1 -1
  6. package/dist/cli/bin.js +1 -1
  7. package/dist/cli/generate/watch-worker.js +1 -1
  8. package/dist/cli/index.d.ts +2 -2
  9. package/dist/cli/index.js +1 -1
  10. package/dist/cli/plugins/app.d.ts +10 -4
  11. package/dist/cli/plugins/app.js +15 -5
  12. package/dist/cli/plugins/better-supabase.d.ts +1 -1
  13. package/dist/cli/plugins/openapi.d.ts +1 -1
  14. package/dist/cli/plugins/openapi.js +1 -1
  15. package/dist/cli/plugins/powersync.d.ts +1 -1
  16. package/dist/cli/plugins/powersync.js +1 -1
  17. package/dist/cli/plugins/rls.d.ts +2 -2
  18. package/dist/cli/plugins/rls.js +1 -1
  19. package/dist/cli/plugins/schemas.d.ts +1 -1
  20. package/dist/cli/plugins/schemas.js +1 -1
  21. package/dist/cli/plugins/scim.d.ts +2 -2
  22. package/dist/cli/plugins/supabase-hook.d.ts +2 -2
  23. package/dist/cli/plugins/supabase-hook.js +1 -1
  24. package/dist/cli/plugins/supabase.d.ts +3 -3
  25. package/dist/cli/plugins/supabase.js +2 -2
  26. package/dist/cli/plugins/ui.d.ts +1 -1
  27. package/dist/cli/plugins/ui.js +1 -1
  28. package/dist/{cloud-BfEI9TLS.js → cloud-BmQrcTvx.js} +1 -1
  29. package/dist/{codemod-DwH0IZ2x.js → codemod-BpjMjxly.js} +1 -1
  30. package/dist/{codemod-p67ePW25.js → codemod-C_NKj01W.js} +2 -2
  31. package/dist/{compile-Blrr5WWw.js → compile-Dy3zMRxo.js} +1 -1
  32. package/dist/{completion-CfrZOGcB.js → completion-CSncf6cX.js} +1 -1
  33. package/dist/{config-report-BaHEBpt-.js → config-report-D607UDnv.js} +1 -1
  34. package/dist/{config-D6gh_xvs.js → config-xiX3R65I.js} +1 -1
  35. package/dist/{doctor-Bg12v-8M.js → doctor-BhoJiHi0.js} +13 -13
  36. package/dist/{doctor-DCsyH7YR.js → doctor-CoKSRLhf.js} +2 -2
  37. package/dist/{execute-SN8_dlch.js → execute-CyQLisIB.js} +1 -1
  38. package/dist/{gen-B4GUqsfM.js → gen-CJE3Xud5.js} +31 -23
  39. package/dist/gen-WzJbAcMJ.js +1 -0
  40. package/dist/{gen-kind-Bahz_i3U.js → gen-kind-DGQxmID0.js} +3 -1
  41. package/dist/{generate-CbtjKcjn.js → generate-DF6Y8ncI.js} +1 -1
  42. package/dist/{generate-B-msjuaO.js → generate-DIZNzMuk.js} +8 -8
  43. package/dist/{generate-options-BDgadlwe.js → generate-options-CLPUvgVW.js} +112 -31
  44. package/dist/{hook-sql-BIR4fL7i.js → hook-sql-FSets5NB.js} +3 -3
  45. package/dist/{import-BZi1tZxq.js → import-DemSCI1R.js} +1 -1
  46. package/dist/{init-K3tKOwf4.js → init-BlYRZRnQ.js} +3 -3
  47. package/dist/{init-9cqnSJWG.js → init-CgoOwXtk.js} +1 -1
  48. package/dist/{login-C1I5KIsK.js → login-CNQJN8Fy.js} +3 -3
  49. package/dist/{login-CP0UxnLw.js → login-TwrSjf6k.js} +1 -1
  50. package/dist/{manifest-DvS2IoXo.js → manifest-XIXxXYty.js} +30 -30
  51. package/dist/next/plugin.d.ts +1 -1
  52. package/dist/{openapi-BT5XY7HY.js → openapi-CH9Dh5UX.js} +1 -1
  53. package/dist/{openapi-BHqqNSoG.js → openapi-CrCBEFEm.js} +1 -1
  54. package/dist/{openapi-document-Ca5yAjc6.js → openapi-document-CJO6cUS1.js} +1 -1
  55. package/dist/{output-djxu62oH.js → output-CU7OppLv.js} +1 -1
  56. package/dist/{ownership-BO0sI5FB.js → ownership-BBQe7GZp.js} +1 -1
  57. package/dist/{plugin-DGmbeXwA.d.ts → plugin-1XW5OfAZ.d.ts} +1 -1
  58. package/dist/{policy-BhSUlHRr.js → policy-FrCL4wDQ.js} +1 -1
  59. package/dist/{policy-bundle-97xaDULc.js → policy-bundle-1Znzdxse.js} +3 -3
  60. package/dist/{powersync-m9uYgCFF.js → powersync-DVgkPQKM.js} +1 -1
  61. package/dist/{powersync-CN7IQIKk.js → powersync-Y-_z8V5X.js} +1 -1
  62. package/dist/{powersync-DdDLP02A.js → powersync-pbvC5g6K.js} +4 -4
  63. package/dist/pull-C3_fCkgX.js +1 -0
  64. package/dist/{pull-9oQvY18T.js → pull-CpLyeY2p.js} +1 -1
  65. package/dist/{resolve-names-Cmg6SPAa.js → resolve-names-Ca4ClMU2.js} +1 -1
  66. package/dist/{rls-BrsMogAP.js → rls-CmyxiQsS.js} +1 -1
  67. package/dist/{rls-Cv1V8YfI.js → rls-DY5ITGzf.js} +5 -5
  68. package/dist/{rls-files-Bj446vbj.js → rls-files-BtaUXVp-.js} +1 -1
  69. package/dist/{rls-options-Dpj_pEyU.d.ts → rls-options-CEpg5nDP.d.ts} +1 -1
  70. package/dist/{run-DX4D6S6V.js → run-BoVUFspr.js} +2 -2
  71. package/dist/run-BriRChKE.js +1 -0
  72. package/dist/{scan-Cj7PQLrS.js → scan-C4x8UqS7.js} +1 -1
  73. package/dist/{schema-CJPvTfeN.js → schema-Zfpbku8U.js} +1 -1
  74. package/dist/{skills-Cr1C0b9D.js → skills-B0cLRZ7w.js} +1 -1
  75. package/dist/{skills-B5bc6JIA.js → skills-DiGdMvMw.js} +1 -1
  76. package/dist/{supabase-BG1HPdQU.js → supabase-B7Q5bO-P.js} +1 -1
  77. package/dist/supabase-hook-C7FNwQ1p.js +2 -0
  78. package/dist/{supabase-hook-tdR45aXY.js → supabase-hook-loL2iJVb.js} +1 -1
  79. package/dist/{tables-CRTCBuFi.js → tables-C8IwkTHq.js} +17 -8
  80. package/dist/{types-D8VXQxKL.d.ts → types-nXo_oQYk.d.ts} +6 -2
  81. package/dist/unplugin/index.d.ts +1 -1
  82. package/dist/{usage-B-E747wO.js → usage-BgNAgZfj.js} +1 -1
  83. package/dist/usage-D6HUlfvP.js +1 -0
  84. package/dist/{usage-B7nx0_aa.js → usage-llSQehNg.js} +2 -2
  85. package/dist/{verify-9HObfifg.js → verify-nMTdEqBB.js} +3 -3
  86. package/package.json +1 -1
  87. package/dist/gen-BC66z5Fd.js +0 -1
  88. package/dist/pull-jvJPMQhP.js +0 -1
  89. package/dist/run-decqEKNa.js +0 -1
  90. package/dist/supabase-hook-hd9abKy4.js +0 -2
  91. package/dist/usage-rqQ9ViXv.js +0 -1
@@ -81,7 +81,7 @@ const importDocument = defineLeaf({
81
81
  async run(ctx, { flags }) {
82
82
  const doc = given(flags.doc);
83
83
  if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
84
- return (await import("./import-BZi1tZxq.js")).runOpenapiImport({
84
+ return (await import("./import-DemSCI1R.js")).runOpenapiImport({
85
85
  cwd: ctx.cwd,
86
86
  doc,
87
87
  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-BT5XY7HY.js");
6
+ const { runOpenapi } = await import("./openapi-CH9Dh5UX.js");
7
7
  const outcome = await runOpenapi({
8
8
  cwd: source.cwd,
9
9
  config: source.config,
@@ -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-DvS2IoXo.js";
2
+ import { t as DOCS_BASE } from "./manifest-XIXxXYty.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
@@ -6,7 +6,7 @@ import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
6
6
  import { l as roleColumn } from "./sources-DnjJPGfb.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-BKrTBbcH.js";
9
- 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-CRTCBuFi.js";
9
+ 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-C8IwkTHq.js";
10
10
  // src/cli/rls/assignments.ts
11
11
  /**
12
12
  * The client roles whose writes the assignment triggers check; any other role
@@ -1,5 +1,5 @@
1
1
  import { D as Policy, Tn as Scope, _ as Grant, kr as Condition } from "./policy-types-93NwI8iI.js";
2
- import { o as PermDockConfig } from "./types-D8VXQxKL.js";
2
+ import { o as PermDockConfig } from "./types-nXo_oQYk.js";
3
3
  import { P as ResourceNode } from "./vocabulary-FYgI_NoI.js";
4
4
  /** The settings of `supabase/config.toml` doctor reads. */
5
5
  type SupabaseConfig = {
@@ -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-97xaDULc.js");
21
+ const { runPolicyBundle } = await import("./policy-bundle-1Znzdxse.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-BDgadlwe.js";
3
- import { n as compileGrants } from "./compile-Blrr5WWw.js";
4
- import { H as POLICY_BUNDLE_FORMAT, U as bundleLoaderSql, W as policyBundle, i as tableNames } from "./tables-CRTCBuFi.js";
2
+ import { i as buildContext, n as isRefusal, o as inheritTargets, t as generateOptions } from "./generate-options-CLPUvgVW.js";
3
+ import { n as compileGrants } from "./compile-Dy3zMRxo.js";
4
+ import { G as POLICY_BUNDLE_FORMAT, K as bundleLoaderSql, i as tableNames, q as policyBundle } from "./tables-C8IwkTHq.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 { r as powersyncFiles, t as runPowerSync } from "./powersync-DdDLP02A.js";
1
+ export { r as powersyncFiles, t as runPowerSync } from "./powersync-pbvC5g6K.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-m9uYgCFF.js");
27
+ const { runPowerSync } = await import("./powersync-DVgkPQKM.js");
28
28
  return runPowerSync({
29
29
  cwd: ctx.cwd,
30
30
  config: ctx.config,
@@ -8,7 +8,7 @@ import { i as fileDrift } from "./output-files-DNid6TBl.js";
8
8
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-Bm0G0A7H.js";
9
9
  import { n as pgConnector } from "./pg-CA651850.js";
10
10
  import { c as requirePolicy } from "./load-CZnlAyZ8.js";
11
- import { t as canFixture } from "./verify-9HObfifg.js";
11
+ import { t as canFixture } from "./verify-nMTdEqBB.js";
12
12
  import { a as roleNames, i as collectGrants, t as assignableRoles } from "./grants-BzjbUCdR.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";
@@ -18,9 +18,9 @@ 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-BdF5DJDQ.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-BO0sI5FB.js";
22
- import { i as tableFor } from "./compile-Blrr5WWw.js";
23
- import { i as tableNames, r as tableNameOf } from "./tables-CRTCBuFi.js";
21
+ import { t as ownershipRules } from "./ownership-BBQe7GZp.js";
22
+ import { i as tableFor } from "./compile-Dy3zMRxo.js";
23
+ import { i as tableNames, r as tableNameOf } from "./tables-C8IwkTHq.js";
24
24
  import { l as policyLevels } from "./policy-DFD2J5o_.js";
25
25
  import { r as contextRefs, t as andConditions } from "./conditions-CkHgXoZB.js";
26
26
  import { p as scopeField } from "./tenancy-B5Xxt9Sc.js";
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-CpLyeY2p.js";
@@ -4,7 +4,7 @@ import { n as parseSupabaseManifest } from "./manifest-B-8d2lhG.js";
4
4
  import { o as formatCatalogJson } from "./catalog-doc-Bp5khmCG.js";
5
5
  import { t as catalogPath } from "./catalog-path-bG0XxHMu.js";
6
6
  import { a as describeError } from "./errors-DgLOqc6j.js";
7
- import { a as nonEmptyOr } from "./output-djxu62oH.js";
7
+ import { a as nonEmptyOr } from "./output-CU7OppLv.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";
@@ -5,7 +5,7 @@ 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-6d1j-q3c.js";
8
- import { C as forUserContext, J as graphPlan, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-CRTCBuFi.js";
8
+ import { C as forUserContext, Z as graphPlan, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-C8IwkTHq.js";
9
9
  import { D as idTypeOf, O as scopeTypeOf } from "./shared-BdF5DJDQ.js";
10
10
  import { G as graphHelper, K as graphSqlName, Q as isTeamScope, T as globalRoleRows, X as hasPermittedUsers, Z as inheritedRowsHelper, ct as restrictedHelper, et as memberForHelper, f as holderBody, it as memberOfHelper, ot as permittedForHelper, rt as memberIdsHelper, st as permittedIdsHelper, ut as scopeTable } from "./interactive-only-BZu9rLpa.js";
11
11
  import { a as quoteIdent, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
@@ -192,7 +192,7 @@ async function rlsInput(ctx, verb, shape, options) {
192
192
  };
193
193
  }
194
194
  async function runRls(input) {
195
- return (await import("./rls-Cv1V8YfI.js")).runRls(input);
195
+ return (await import("./rls-DY5ITGzf.js")).runRls(input);
196
196
  }
197
197
  ({
198
198
  ...shapeFlags,
@@ -2,13 +2,13 @@ import "./sources-DnjJPGfb.js";
2
2
  import { a as describeError, f as usageResult, o as exitCodeOfError } from "./errors-DgLOqc6j.js";
3
3
  import { i as requirePeer, n as packageManagerOf, t as addLine } from "./peer-D77JpXe-.js";
4
4
  import { n as pgConnector, t as connectPgPool } from "./pg-CA651850.js";
5
- import { f as isSupabaseSchemas, m as schemasRefusal } from "./hook-sql-BIR4fL7i.js";
6
- import { a as nonEmptyOr } from "./output-djxu62oH.js";
7
- import { n as describeExplain, t as runRlsGenerate } from "./generate-B-msjuaO.js";
8
- import { a as COLUMNS_SQL, o as INDEX_COLUMNS_SQL, u as readTableIndexFacts } from "./compile-Blrr5WWw.js";
5
+ import { f as isSupabaseSchemas, m as schemasRefusal } from "./hook-sql-FSets5NB.js";
6
+ import { a as nonEmptyOr } from "./output-CU7OppLv.js";
7
+ import { n as describeExplain, t as runRlsGenerate } from "./generate-DIZNzMuk.js";
8
+ import { a as COLUMNS_SQL, o as INDEX_COLUMNS_SQL, u as readTableIndexFacts } from "./compile-Dy3zMRxo.js";
9
9
  import { r as escapeSqlIdent } from "./sql-T4GaBh9X.js";
10
10
  import { t as beforeFirst } from "./text-D704xHVl.js";
11
- import { a as verifyResult, c as callsHelper, i as verifyIgnores, l as helperCallKeys, n as runRlsVerify, o as HELPER_TABLES, r as rlsFinding } from "./verify-9HObfifg.js";
11
+ import { a as verifyResult, c as callsHelper, i as verifyIgnores, l as helperCallKeys, n as runRlsVerify, o as HELPER_TABLES, r as rlsFinding } from "./verify-nMTdEqBB.js";
12
12
  import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-6d1j-q3c.js";
13
13
  import { r as parseRbacAuthorize } from "./rbac-B-49toAp.js";
14
14
  import { delimiter, join } from "node:path";
@@ -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-DNid6TBl.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-B-msjuaO.js";
6
+ import { t as runRlsGenerate } from "./generate-DIZNzMuk.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 { b as SupabaseSchemas, u as RlsConfig, v as RlsTarget } from "./types-D8VXQxKL.js";
1
+ import { b as SupabaseSchemas, u as RlsConfig, v as RlsTarget } from "./types-nXo_oQYk.js";
2
2
  /**
3
3
  * `rls.seeds` as a mode, or `false` to skip the rows, or where they are
4
4
  * written.
@@ -3,9 +3,9 @@ import { a as resolveCwd, i as readConfig, o as withPluginOutputs } from "./conf
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-0EWFk-4S.js";
6
- import { c as confirmationRequired, d as quote, f as replayArgv, i as githubAnnotations, l as consentDigest, n as errorDocument, o as resultDocument, s as sarifLog, t as dataOf, u as consentReasons } from "./output-djxu62oH.js";
6
+ import { c as confirmationRequired, d as quote, f as replayArgv, i as githubAnnotations, l as consentDigest, n as errorDocument, o as resultDocument, s as sarifLog, t as dataOf, u as consentReasons } from "./output-CU7OppLv.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-DvS2IoXo.js";
8
+ import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-XIXxXYty.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";
@@ -0,0 +1 @@
1
+ export { t as run } from "./run-BoVUFspr.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-b0_Xpab8.js");
19
+ const { runAdoptionScan } = await import("./adoption-scan-CMghLDUG.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-bJfT8aIA.js";
2
2
  import { r as isRecord } from "./compact-C4LFuqbW.js";
3
3
  import { t as DRAFT_PINS } from "./pins-CXXkVEiD.js";
4
- import { a as nonEmptyOr } from "./output-djxu62oH.js";
4
+ import { a as nonEmptyOr } from "./output-CU7OppLv.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,6 +1,6 @@
1
1
  import { t as byCodePoint } from "./compare-dfHDj8kT.js";
2
2
  import { t as didYouMean } from "./args-0EWFk-4S.js";
3
- import { a as nonEmptyOr } from "./output-djxu62oH.js";
3
+ import { a as nonEmptyOr } from "./output-CU7OppLv.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,7 +1,7 @@
1
1
  import { t as defineLeaf } from "./command-9GAzSI7E.js";
2
2
  import { t as checkFlag } from "./flags-C0e-BzGW.js";
3
3
  import { r as pick, t as CANCELLED } from "./prompt-CSXHcJxy.js";
4
- import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-Cr1C0b9D.js";
4
+ import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-B0cLRZ7w.js";
5
5
  // src/cli/commands/skills.ts
6
6
  const forFlag = { for: {
7
7
  type: "string",
@@ -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-hd9abKy4.js");
18
+ const { runSupabase } = await import("./supabase-hook-C7FNwQ1p.js");
19
19
  return runSupabase({
20
20
  cwd: ctx.cwd,
21
21
  config: ctx.config,
@@ -0,0 +1,2 @@
1
+ import "./hook-sql-FSets5NB.js";
2
+ export { r as runSupabase } from "./supabase-hook-loL2iJVb.js";
@@ -6,7 +6,7 @@ import { i as readJsonFile, o as sqlFiles, s as writeFileEnsuringDir } from "./f
6
6
  import { n as formatManifestJson, t as MANIFEST_FILE } from "./manifest-json-DMaBWmcG.js";
7
7
  import { c as requirePolicy } from "./load-CZnlAyZ8.js";
8
8
  import { n as hookUri } from "./rbac-B-49toAp.js";
9
- import { a as supabaseHookSql, c as asideAuthzReceive, f as isSupabaseSchemas, h as declarativeSql, i as supabaseHookManifest, l as configToml, m as schemasRefusal, n as hooklessDatabase, o as defaultOut, p as resolveSchemas, r as supabaseDatabaseManifest, s as hookMarker, t as grantsLabel } from "./hook-sql-BIR4fL7i.js";
9
+ import { a as supabaseHookSql, c as asideAuthzReceive, f as isSupabaseSchemas, h as declarativeSql, i as supabaseHookManifest, l as configToml, m as schemasRefusal, n as hooklessDatabase, o as defaultOut, p as resolveSchemas, r as supabaseDatabaseManifest, s as hookMarker, t as grantsLabel } from "./hook-sql-FSets5NB.js";
10
10
  import { r as HOOK_MARKER, s as hookMarkerFields } from "./markers-C-kThnKN.js";
11
11
  import { a as supabaseConfig } from "./supabase-config-mXcggV5I.js";
12
12
  import { t as readMemberships } from "./read-memberships-BkePIa1F.js";
@@ -623,6 +623,12 @@ function permissionOf(plan, expr) {
623
623
  function apiKeyAllowsCall(ctx, grant) {
624
624
  return `${qualified(ctx, API_KEY_ALLOWS)}(${grant})`;
625
625
  }
626
+ function apiKeyUnlimitedSql(key) {
627
+ return `${key} is null or ${key} = 'null'::jsonb`;
628
+ }
629
+ function apiKeyClaimSql(ctx, plan) {
630
+ return subjectClaimJsonSql(ctx, plan.claim);
631
+ }
626
632
  function apiKeyAllowsSql(ctx, plan, anonExecute) {
627
633
  const fn = qualified(ctx, API_KEY_ALLOWS);
628
634
  const scopes = `k -> ${quoteLiteral(plan.scopes)}`;
@@ -638,7 +644,7 @@ security definer
638
644
  set search_path = ''
639
645
  as $$
640
646
  select case
641
- when k is null or k = 'null'::jsonb then true
647
+ when ${apiKeyUnlimitedSql("k")} then true
642
648
  when exists (
643
649
  select 1 from ${qualified(ctx, "role_permissions")} rp
644
650
  where rp.grant_key = p_grant and rp.effect = 'deny'
@@ -2098,6 +2104,14 @@ function tokenScopesPlan(setting, policy) {
2098
2104
  }));
2099
2105
  return { scopes: delegatedScopeMap(permissions, policy.oauthScopes) };
2100
2106
  }
2107
+ function tokenScopeUnlimitedSql(ctx) {
2108
+ const act = subjectClaimJsonSql(ctx, "act");
2109
+ return `coalesce(${subjectClaimSql(ctx, "client_id")}, '') = ''
2110
+ and (${act} is null
2111
+ or ${act} = 'null'::jsonb
2112
+ or (jsonb_typeof(${act}) = 'object'
2113
+ and ${act} ->> 'kind' in ('support', 'impersonation')))`;
2114
+ }
2101
2115
  function tokenScopeAllowsCall(ctx, grant) {
2102
2116
  return `${qualified(ctx, TOKEN_SCOPE_ALLOWS)}(${grant})`;
2103
2117
  }
@@ -2123,7 +2137,6 @@ function tokenScopeRows(ctx) {
2123
2137
  function tokenScopeAllowsSql(ctx, plan, anonExecute) {
2124
2138
  const fn = qualified(ctx, TOKEN_SCOPE_ALLOWS);
2125
2139
  const map = qualified(ctx, TOKEN_SCOPE_MAP);
2126
- const act = subjectClaimJsonSql(ctx, "act");
2127
2140
  const grants = anonExecute ? `revoke execute on function ${fn}(text) from public;
2128
2141
  grant execute on function ${fn}(text) to anon, authenticated;` : `revoke execute on function ${fn}(text) from public, anon;
2129
2142
  grant execute on function ${fn}(text) to authenticated;`;
@@ -2146,11 +2159,7 @@ security definer
2146
2159
  set search_path = ''
2147
2160
  as $$
2148
2161
  select case
2149
- when coalesce(${subjectClaimSql(ctx, "client_id")}, '') = ''
2150
- and (${act} is null
2151
- or ${act} = 'null'::jsonb
2152
- or (jsonb_typeof(${act}) = 'object'
2153
- and ${act} ->> 'kind' in ('support', 'impersonation'))) then true
2162
+ when ${tokenScopeUnlimitedSql(ctx)} then true
2154
2163
  when exists (
2155
2164
  select 1 from ${qualified(ctx, "role_permissions")} rp
2156
2165
  where rp.grant_key = p_grant and rp.effect = 'deny'
@@ -3237,4 +3246,4 @@ function resolveVias(tables, scopes, dialect) {
3237
3246
  }
3238
3247
  return Object.keys(out).length === 0 ? void 0 : out;
3239
3248
  }
3240
- export { tokenScopesPlan as A, hookTeamReader as B, forUserContext as C, seedSql as D, memoReadsSql as E, API_KEY_ALLOWS as F, closureBackfillSql as G, POLICY_BUNDLE_FORMAT as H, apiKeyAllowsCall as I, graphPlan as J, closureDepths as K, apiKeyFields as L, guardAuthAdminGrants as M, unguardAuthAdminGrants as N, TOKEN_SCOPE_ALLOWS as O, capabilityAccessSql as P, apiKeysPlan as R, accessSql as S, helpersSql as T, bundleLoaderSql as U, hookTeamsHelper as V, policyBundle as W, graphSql as Y, sourceTransferTriggerSql as _, tablelessResources as a, ASSIGNMENTS as b, permissionHelpersSql as c, permittedByPermissionHelper as d, requiresSql as f, sourceRowsSql as g, sourceHoldersTriggerSql as h, tableNames as i, memoReadTriggersSql as j, tokenScopeAllowsCall as k, permissionKeysForHelper as l, pairsSql as m, resolveVias as n, PERMISSION_HELPERS as o, holderSources as p, graphIdsSql as q, tableNameOf as r, checkName as s, checkSharedTables as t, permissionKeysHelper as u, holdersTriggerSql as v, grantBodies as w, OWNERSHIP as x, transferTriggerSql as y, HOOK_TEAM_READER as z };
3249
+ export { tokenScopeUnlimitedSql as A, apiKeyUnlimitedSql as B, forUserContext as C, seedSql as D, memoReadsSql as E, capabilityAccessSql as F, POLICY_BUNDLE_FORMAT as G, HOOK_TEAM_READER as H, API_KEY_ALLOWS as I, closureBackfillSql as J, bundleLoaderSql as K, apiKeyAllowsCall as L, memoReadTriggersSql as M, guardAuthAdminGrants as N, TOKEN_SCOPE_ALLOWS as O, unguardAuthAdminGrants as P, graphSql as Q, apiKeyClaimSql as R, accessSql as S, helpersSql as T, hookTeamReader as U, apiKeysPlan as V, hookTeamsHelper as W, graphIdsSql as X, closureDepths as Y, graphPlan as Z, sourceTransferTriggerSql as _, tablelessResources as a, ASSIGNMENTS as b, permissionHelpersSql as c, permittedByPermissionHelper as d, requiresSql as f, sourceRowsSql as g, sourceHoldersTriggerSql as h, tableNames as i, tokenScopesPlan as j, tokenScopeAllowsCall as k, permissionKeysForHelper as l, pairsSql as m, resolveVias as n, PERMISSION_HELPERS as o, holderSources as p, policyBundle as q, tableNameOf as r, checkName as s, checkSharedTables as t, permissionKeysHelper as u, holdersTriggerSql as v, grantBodies as w, OWNERSHIP as x, transferTriggerSql as y, apiKeyFields as z };
@@ -1115,12 +1115,16 @@ type PermDockConfig = {
1115
1115
  readonly seeds?: Seeds;
1116
1116
  };
1117
1117
  /** What `permdock gen --kind` writes. */
1118
- type GenKind = "zod" | "valibot" | "arktype" | "json-schema" | "standard-schema" | "constants" | "factories" | "react" | "vue" | "svelte" | "solid" | "messages" | "bundle";
1118
+ type GenKind = "zod" | "valibot" | "arktype" | "json-schema" | "standard-schema" | "constants" | "types" | "sql" | "factories" | "react" | "vue" | "svelte" | "solid" | "messages" | "bundle";
1119
1119
  /** `permdock gen` input. */
1120
1120
  type GenConfig = {
1121
1121
  /** The directory the generated files go to; default `src/permdock`. */
1122
1122
  readonly out?: string;
1123
- /** The kinds `permdock gen` writes without `--kind`; default `['constants']`. */
1123
+ /**
1124
+ * The kinds `permdock gen` writes without `--kind`; default `['constants',
1125
+ * 'types', 'sql']`. `zod`, `valibot` and `factories` add `types`, which they
1126
+ * import.
1127
+ */
1124
1128
  readonly kinds?: readonly GenKind[];
1125
1129
  /**
1126
1130
  * Also write `fields.ts`: `<resource>Fields` per resource, with each field's
@@ -1,4 +1,4 @@
1
- import { s as PermDockPluginOptions } from "../types-D8VXQxKL.js";
1
+ import { s as PermDockPluginOptions } from "../types-nXo_oQYk.js";
2
2
  import { createUnplugin } from "unplugin";
3
3
  type CreateUnplugin = typeof createUnplugin<PermDockPluginOptions | undefined>;
4
4
  export declare const createPermDockUnplugin: ReturnType<CreateUnplugin>;
@@ -16,7 +16,7 @@ const usage = defineLeaf({
16
16
  }
17
17
  },
18
18
  async run(ctx, { flags }) {
19
- return (await import("./usage-rqQ9ViXv.js")).runUsage({
19
+ return (await import("./usage-D6HUlfvP.js")).runUsage({
20
20
  cwd: ctx.cwd,
21
21
  config: ctx.config,
22
22
  ignore: flags.ignore,
@@ -0,0 +1 @@
1
+ export { t as runUsage } from "./usage-llSQehNg.js";
@@ -2,8 +2,8 @@ import { a as getResource } from "./permission-registry-DMYRZVcn.js";
2
2
  import { c as jsonSchemaOf } from "./catalog-doc-Bp5khmCG.js";
3
3
  import { r as runCollect } from "./collect-BJZsuBW4.js";
4
4
  import { f as usageResult } from "./errors-DgLOqc6j.js";
5
- import { t as DOCS_BASE } from "./manifest-DvS2IoXo.js";
6
- import { r as findingOf } from "./output-djxu62oH.js";
5
+ import { t as DOCS_BASE } from "./manifest-XIXxXYty.js";
6
+ import { r as findingOf } from "./output-CU7OppLv.js";
7
7
  import { o as USAGE_REPORT_SCHEMA } from "./version-D-jWyJb9.js";
8
8
  import { n as jiti, r as parseSync, t as createVisitor } from "./optional-CaQWp9HA.js";
9
9
  import { a as rel, r as listSourceFiles } from "./files-DAR51W3J.js";
@@ -7,16 +7,16 @@ import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
7
7
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-Bm0G0A7H.js";
8
8
  import { n as pgConnector } from "./pg-CA651850.js";
9
9
  import { o as loadPolicyAt } from "./load-CZnlAyZ8.js";
10
- import { t as commandFor } from "./compile-Blrr5WWw.js";
10
+ import { t as commandFor } from "./compile-Dy3zMRxo.js";
11
11
  import { r as isRecord } from "./compact-C4LFuqbW.js";
12
12
  import { t as policyRowConditionKeys } from "./row-conditions-DwIJocfQ.js";
13
13
  import { c as rootScope, d as scopeList, o as normalizeMemberships } from "./scopes-B-KX9EI8.js";
14
14
  import { t as beforeFirst } from "./text-D704xHVl.js";
15
15
  import { T as columnTypesOf, a as customRolesOn, r as HELPERS } from "./shared-BdF5DJDQ.js";
16
16
  import { a as quoteIdent, c as quoteTable, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
17
- import { J as graphPlan, i as tableNames, r as tableNameOf } from "./tables-CRTCBuFi.js";
17
+ import { Z as graphPlan, i as tableNames, r as tableNameOf } from "./tables-C8IwkTHq.js";
18
18
  import { s as viewName, t as FIELD_VIEWS } from "./fields-6d1j-q3c.js";
19
- import { t as DOCS_BASE } from "./manifest-DvS2IoXo.js";
19
+ import { t as DOCS_BASE } from "./manifest-XIXxXYty.js";
20
20
  import { b as membershipsClaim, m as customRoleScope } from "./evaluate-D8SdfP3h.js";
21
21
  import { n as defaultSqlCommand, t as SQL_IDENT } from "./sql-T4GaBh9X.js";
22
22
  import "./budget-BH81q2cj.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "permdock",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Typed permissions for TypeScript apps, APIs, databases, and AI agents, with the permdock CLI and test runners.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -1 +0,0 @@
1
- export { t as renderKinds } from "./gen-B4GUqsfM.js";
@@ -1 +0,0 @@
1
- export { n as runCloudPull } from "./pull-9oQvY18T.js";
@@ -1 +0,0 @@
1
- export { t as run } from "./run-DX4D6S6V.js";
@@ -1,2 +0,0 @@
1
- import "./hook-sql-BIR4fL7i.js";
2
- export { r as runSupabase } from "./supabase-hook-tdR45aXY.js";
@@ -1 +0,0 @@
1
- export { t as runUsage } from "./usage-B7nx0_aa.js";