permdock 0.28.0 → 0.29.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 (99) hide show
  1. package/dist/{adoption-scan-BHQm3Li7.js → adoption-scan-obbSy73c.js} +1 -1
  2. package/dist/{arazzo-UwtVzma6.js → arazzo-D9Fv_ZEV.js} +1 -1
  3. package/dist/{arazzo-CAQr4N7Z.js → arazzo-rxj2pNN3.js} +1 -1
  4. package/dist/better-supabase/index.d.ts +7 -0
  5. package/dist/better-supabase/index.js +2 -2
  6. package/dist/{casbin-CSgPeAJK.js → casbin-D3PH6-AJ.js} +1 -1
  7. package/dist/{casbin-Ccbaft52.js → casbin-p8yi9Py5.js} +1 -1
  8. package/dist/cli/bin.js +1 -1
  9. package/dist/cli/generate/watch-worker.js +1 -1
  10. package/dist/cli/index.js +1 -1
  11. package/dist/cli/plugins/app.js +1 -1
  12. package/dist/cli/plugins/openapi.js +1 -1
  13. package/dist/cli/plugins/powersync.js +1 -1
  14. package/dist/cli/plugins/rls.js +1 -1
  15. package/dist/cli/plugins/schemas.js +1 -1
  16. package/dist/cli/plugins/supabase-hook.js +1 -1
  17. package/dist/cli/plugins/supabase.js +2 -2
  18. package/dist/cli/plugins/ui.js +1 -1
  19. package/dist/{cloud-CFtvELWj.js → cloud-DnTSKTYr.js} +2 -2
  20. package/dist/{codemod-ClcPRv4c.js → codemod-C4xmPHZU.js} +1 -1
  21. package/dist/{codemod-3PFIcPag.js → codemod-DwJ1I9er.js} +2 -2
  22. package/dist/{compile-mfTqcMJ5.js → compile-B9SZiEnG.js} +6 -6
  23. package/dist/{completion-D4p_MQX7.js → completion-CHOgUToS.js} +1 -1
  24. package/dist/{conditions-VlAMOm20.js → conditions-ChE7zxJI.js} +2 -2
  25. package/dist/{config-D9bq79Yi.js → config-StFKj2S0.js} +1 -1
  26. package/dist/{config-report-DZfIl6zc.js → config-report-DFj3emJp.js} +1 -1
  27. package/dist/{doctor-FHjwjHYC.js → doctor-BSYAl2XG.js} +76 -29
  28. package/dist/{doctor-CuhkBJ06.js → doctor-CjCJ_U2a.js} +2 -2
  29. package/dist/{execute-DdH84BHC.js → execute-BzQKrYqL.js} +3 -3
  30. package/dist/{fields-6d1j-q3c.js → fields-CViS0EPC.js} +1 -1
  31. package/dist/{gen-CcKymoUw.js → gen-BVDN_Hqx.js} +2 -2
  32. package/dist/gen-D13YdBQP.js +1 -0
  33. package/dist/{gen-kind-Bf9jYVgn.js → gen-kind-BK6bb0gj.js} +1 -1
  34. package/dist/{generate-BCUVV4vB.js → generate-DNAoLMj1.js} +14 -14
  35. package/dist/{generate-options-Cg5sAHhT.js → generate-options-Yfh1pGyX.js} +9 -9
  36. package/dist/{generate-UMuStlLD.js → generate-p7cdH1ac.js} +3 -3
  37. package/dist/{grants-C7bGZFPa.js → grants-Dn6zwfqo.js} +1 -1
  38. package/dist/{hook-sql-C0aUoiOH.js → hook-sql-55514A9t.js} +13 -11
  39. package/dist/{import--taRAR01.js → import-B0nUIp2b.js} +1 -1
  40. package/dist/{import-BqoDHpFt.js → import-Cm8kuezl.js} +2 -2
  41. package/dist/{init-CP3fYFb6.js → init-CjlVWrBE.js} +3 -3
  42. package/dist/{init-Cfi7_gXO.js → init-Ck4PIu9F.js} +1 -1
  43. package/dist/{interactive-only-CQsgMc1E.js → interactive-only-C_olBCPl.js} +28 -2
  44. package/dist/{login-kg9Pd0C2.js → login-BdWIAsFT.js} +1 -1
  45. package/dist/{login-BjkyJNGn.js → login-BhSLL8Pn.js} +3 -3
  46. package/dist/{manifest-C7dWk0k5.js → manifest-CXK3krNu.js} +30 -30
  47. package/dist/{manifest-B-8d2lhG.js → manifest-Ct3eXbLR.js} +1 -1
  48. package/dist/{manifest-schema-DJY5Q_pR.js → manifest-schema-Bp-eFhNZ.js} +1 -1
  49. package/dist/{migrate-BwXtXUtE.js → migrate-BcBFWFt9.js} +1 -1
  50. package/dist/{model-BkQLENu6.js → model-B0rrUh6J.js} +1 -1
  51. package/dist/{openapi-B5jo5ClY.js → openapi-D595qUYF.js} +1 -1
  52. package/dist/{openapi-dJFJTHiW.js → openapi-E2411VYb.js} +1 -1
  53. package/dist/{openapi-document-B58hIsZ4.js → openapi-document-DDzA3CrT.js} +1 -1
  54. package/dist/{output-Pne7BTXn.js → output-BhNN-hvv.js} +1 -1
  55. package/dist/{ownership-BPGoxz1T.js → ownership-mprXkEHG.js} +3 -3
  56. package/dist/{pipeline-CGctXudd.js → pipeline-Ct3YEKjx.js} +1 -1
  57. package/dist/{policy-G8iZ2T5P.js → policy-DfvOwgtX.js} +1 -1
  58. package/dist/{policy-bundle-nbcxlVOb.js → policy-bundle-pwhJJv2-.js} +3 -3
  59. package/dist/{powersync-BoOMFQRl.js → powersync-BdqLK59r.js} +1 -1
  60. package/dist/{powersync-B9KEEiJE.js → powersync-CMu40wtz.js} +1 -1
  61. package/dist/{powersync-CqAj9QJt.js → powersync-Da9op2Zo.js} +7 -7
  62. package/dist/{provider-BnnFjtWI.js → provider-1yWthvi5.js} +14 -4
  63. package/dist/{pull-DXuh-rob.js → pull-AXzbc_kg.js} +2 -2
  64. package/dist/pull-B0ju22jJ.js +1 -0
  65. package/dist/{push-DXh936bz.js → push-N-QI_ArC.js} +1 -1
  66. package/dist/{rbac-FlJv7Ba9.js → rbac-BJTUGJum.js} +2 -2
  67. package/dist/{resolve-names-CROyyjVR.js → resolve-names-B0cqvJxo.js} +4 -4
  68. package/dist/{rls-DV4MUNMb.js → rls-BC1IFnfu.js} +1 -1
  69. package/dist/{rls-BL90Ec30.js → rls-DfzVlo1q.js} +9 -9
  70. package/dist/{rls-files-BgLoAa9x.js → rls-files-BpMqBdji.js} +1 -1
  71. package/dist/{run-BFDAiNuS.js → run-CqAur1Y3.js} +2 -2
  72. package/dist/run-X_cWRiUV.js +1 -0
  73. package/dist/{scan-CoyAmDAz.js → scan-C_YtxPxn.js} +1 -1
  74. package/dist/{schema-9eGIiLry.js → schema-BVhiZyY-.js} +1 -1
  75. package/dist/{shared-BdF5DJDQ.js → shared-Cwxy5N16.js} +2 -1
  76. package/dist/{skills-BPDVfXgR.js → skills-CQ3B9vuz.js} +1 -1
  77. package/dist/{skills-B8nt-KuB.js → skills-DBvXLSo7.js} +1 -1
  78. package/dist/supabase/index.js +2 -2
  79. package/dist/{supabase-Ctn_Z6xf.js → supabase-BzK3lplm.js} +3 -3
  80. package/dist/{supabase-D5KN965n.js → supabase-CakrAxMg.js} +1 -1
  81. package/dist/{supabase-config-CjX-GjEp.js → supabase-config-B2sDFiwy.js} +1 -1
  82. package/dist/{supabase-hook-CmW2MLWa.js → supabase-hook-0q6ohTVN.js} +3 -3
  83. package/dist/supabase-hook-CcmjiBsh.js +2 -0
  84. package/dist/{tables-Btlt_Rp-.js → tables-BDqfipr1.js} +3 -3
  85. package/dist/testing/fixtures/index.js +7 -1
  86. package/dist/testing/index.js +1 -1
  87. package/dist/usage-Cayjfw1S.js +1 -0
  88. package/dist/{usage-DVjr2ZDc.js → usage-CnCNB6XN.js} +2 -2
  89. package/dist/{usage-DRReZaxQ.js → usage-Dodo7Sjb.js} +1 -1
  90. package/dist/{verify-BOB_Jyjx.js → verify-DTlATzWK.js} +5 -5
  91. package/dist/{watch-CnRyGEtp.js → watch-Bz_iEKlB.js} +1 -1
  92. package/package.json +1 -1
  93. package/schemas/supabase-manifest-v1.json +1 -1
  94. package/skills/permdock-wire/references/adapters.md +1 -1
  95. package/dist/gen-BseS8XeZ.js +0 -1
  96. package/dist/pull-8Vce3V1e.js +0 -1
  97. package/dist/run-mEbYi2Ow.js +0 -1
  98. package/dist/supabase-hook-CjChM-eX.js +0 -2
  99. package/dist/usage-nVi3-z-j.js +0 -1
@@ -1,32 +1,32 @@
1
1
  import { c as listPermissions, u as renamedKeys } from "./permission-registry-DMYRZVcn.js";
2
2
  import { t as policyRowConditionKeys } from "./row-conditions-DwIJocfQ.js";
3
3
  import { a as describeError, i as configError, o as exitCodeOfError } from "./errors-DgLOqc6j.js";
4
- import { D as seedSql, J as closureBackfillSql, N as guardAuthAdminGrants, P as unguardAuthAdminGrants, Q as graphSql, S as accessSql, T as helpersSql, c as permissionHelpersSql, d as permittedByPermissionHelper, i as tableNames, r as tableNameOf, s as checkName, u as permissionKeysHelper } from "./tables-Btlt_Rp-.js";
4
+ import { $ as graphSql, D as seedSql, N as guardAuthAdminGrants, P as unguardAuthAdminGrants, S as accessSql, T as helpersSql, Y as closureBackfillSql, c as permissionHelpersSql, d as permittedByPermissionHelper, i as tableNames, r as tableNameOf, s as checkName, u as permissionKeysHelper } from "./tables-BDqfipr1.js";
5
5
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
6
- import { c as indexesSql, i as tableFor, l as pruneIndexTargets, n as compileGrants, r as inferredCommand, s as indexTargets, u as readTableIndexFacts } from "./compile-mfTqcMJ5.js";
7
- import { a as CANDIDATES, c as rowHelpersSql, d as rebuildPlan, i as buildContext, l as rowSetSql, n as isRefusal, o as inheritTargets, r as splitsPart, s as levelKeys, t as generateOptions, u as DROPPED_LIST } from "./generate-options-Cg5sAHhT.js";
6
+ import { c as indexesSql, i as tableFor, l as pruneIndexTargets, n as compileGrants, r as inferredCommand, s as indexTargets, u as readTableIndexFacts } from "./compile-B9SZiEnG.js";
7
+ import { a as CANDIDATES, c as rowHelpersSql, d as rebuildPlan, i as buildContext, l as rowSetSql, n as isRefusal, o as inheritTargets, r as splitsPart, s as levelKeys, t as generateOptions, u as DROPPED_LIST } from "./generate-options-Yfh1pGyX.js";
8
8
  import { t as policyFromCatalog } from "./policy-from-catalog-YKaTeaco.js";
9
- import { t as fetchProjectPolicy } from "./pull-DXuh-rob.js";
9
+ import { t as fetchProjectPolicy } from "./pull-AXzbc_kg.js";
10
10
  import { c as requirePolicy } from "./load-CZnlAyZ8.js";
11
11
  import { t as compact } from "./compact-C4LFuqbW.js";
12
- import { a as nonEmptyOr } from "./output-Pne7BTXn.js";
12
+ import { a as nonEmptyOr } from "./output-BhNN-hvv.js";
13
13
  import { i as INDEXES_MARKER, n as GRANTS_MARKER, o as SEEDS_MARKER, t as BACKFILL_MARKER } from "./markers-C-kThnKN.js";
14
- import { G as graphHelper, H as byKey, K as graphSqlName, U as BOOTSTRAP_PERMISSIONS, lt as scopeSources, rt as memberIdsHelper, st as permittedIdsHelper, ut as scopeTable } from "./interactive-only-CQsgMc1E.js";
14
+ import { G as graphHelper, H as byKey, K as graphSqlName, U as BOOTSTRAP_PERMISSIONS, lt as scopeSources, rt as memberIdsHelper, st as permittedIdsHelper, ut as scopeTable } from "./interactive-only-C_olBCPl.js";
15
15
  import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
16
- import { D as idTypeOf, O as scopeTypeOf, _ as subjectClaimJsonSql, c as SESSION_LIVE_HELPER, g as sessionLiveHelperSql, o as rootName, r as HELPERS, t as CUSTOM_ROLES, y as subjectIdSql } from "./shared-BdF5DJDQ.js";
17
- import { a as supabaseHookSql, c as asideAuthzReceive, h as declarativeSql, p as resolveSchemas, t as grantsLabel, u as approvalsSql } from "./hook-sql-C0aUoiOH.js";
18
- import { i as assignmentSql, n as ownershipSql } from "./ownership-BPGoxz1T.js";
16
+ import { D as idTypeOf, O as scopeTypeOf, _ as subjectClaimJsonSql, c as SESSION_LIVE_HELPER, g as sessionLiveHelperSql, o as rootName, r as HELPERS, t as CUSTOM_ROLES, y as subjectIdSql } from "./shared-Cwxy5N16.js";
17
+ import { a as supabaseHookSql, c as asideAuthzReceive, h as declarativeSql, p as resolveSchemas, t as grantsLabel, u as approvalsSql } from "./hook-sql-55514A9t.js";
18
+ import { i as assignmentSql, n as ownershipSql } from "./ownership-mprXkEHG.js";
19
19
  import { p as scopeField } from "./tenancy-B5Xxt9Sc.js";
20
- import { i as collectGrants, n as breakGlassHolder, r as breakGlassKey } from "./grants-C7bGZFPa.js";
20
+ import { i as collectGrants, n as breakGlassHolder, r as breakGlassKey } from "./grants-Dn6zwfqo.js";
21
21
  import { t as supautilsRejections } from "./supautils-DXzJ2E2Q.js";
22
- import { a as fieldViewsSql, c as ACTOR_MAY_WRITE, d as assemblePolicies, i as fieldViews, l as actorMayWriteCall, m as readOnlyActorPolicies, n as columnGrantSql, o as rowBranches, p as readOnlyActorKinds, r as columnRevokeSql, u as actorMayWriteSql } from "./fields-6d1j-q3c.js";
22
+ import { a as fieldViewsSql, c as ACTOR_MAY_WRITE, d as assemblePolicies, i as fieldViews, l as actorMayWriteCall, m as readOnlyActorPolicies, n as columnGrantSql, o as rowBranches, p as readOnlyActorKinds, r as columnRevokeSql, u as actorMayWriteSql } from "./fields-CViS0EPC.js";
23
23
  import { l as isFieldRelation } from "./resource-relations-Ck5sjYQR.js";
24
24
  import { c as rootScope } from "./scopes-B-KX9EI8.js";
25
- import { n as permissionHoldersSql } from "./resolve-names-CROyyjVR.js";
26
- import { i as rbacScaffold } from "./rbac-FlJv7Ba9.js";
25
+ import { n as permissionHoldersSql } from "./resolve-names-B0cqvJxo.js";
26
+ import { i as rbacScaffold } from "./rbac-BJTUGJum.js";
27
27
  import { i as dateAt } from "./time-r0CKBm57.js";
28
28
  import { _ as writeOutputFiles, a as isSeedsDirectory, d as pgDeltaPath, g as underSchemaDir, h as serviceRel, l as parseSplit, m as seedsMigration, n as dataMigrationFile, p as seedDeltaNote, r as driftOf, u as partPath } from "./output-files-D5D-8-4l.js";
29
- import { i as readSupabaseConfig } from "./supabase-config-CjX-GjEp.js";
29
+ import { i as readSupabaseConfig } from "./supabase-config-B2sDFiwy.js";
30
30
  import { a as splitUndiffed } from "./deciding-columns-BnglEKqU.js";
31
31
  import { o as sqlFiles } from "./files-DAR51W3J.js";
32
32
  import { n as MIGRATION_DIRS } from "./constants-PCJiir_3.js";
@@ -10,17 +10,17 @@ import { a as scopeMembershipTable, i as scopeColumn } from "./compile-BUKXrueE.
10
10
  import { l as roleColumn } from "./sources-DnjJPGfb.js";
11
11
  import { t as beforeFirst } from "./text-D704xHVl.js";
12
12
  import { l as parseSplit } from "./output-files-D5D-8-4l.js";
13
- import { f as orSql, g as branchClauses } from "./fields-6d1j-q3c.js";
13
+ import { f as orSql, g as branchClauses } from "./fields-CViS0EPC.js";
14
14
  import { a as quoteIdent, c as quoteTable, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
15
- import { A as tenantTypeOf, C as parseMembershipsFlag, D as idTypeOf, E as firstScopeType, O as scopeTypeOf, a as customRolesOn, l as USER_ID_HELPER, r as HELPERS, s as signedIn, t as CUSTOM_ROLES, y as subjectIdSql } from "./shared-BdF5DJDQ.js";
16
- import { H as byKey, I as raiseSql, K as graphSqlName, M as currentKeyExpr, R as rolesTableScope, V as byCodeUnit, _ as memoizes, g as memoizedSetofSql, ht as checkSuspension, i as interactiveOnlyKeys, m as memoHitList, o as memoUserSql } from "./interactive-only-CQsgMc1E.js";
17
- import { A as tokenScopeUnlimitedSql, B as apiKeyUnlimitedSql, E as memoReadsSql, I as API_KEY_ALLOWS, M as memoReadTriggersSql, O as TOKEN_SCOPE_ALLOWS, R as apiKeyClaimSql, V as apiKeysPlan, X as graphIdsSql, Y as closureDepths, Z as graphPlan, a as tablelessResources, d as permittedByPermissionHelper, i as tableNames, j as tokenScopesPlan, n as resolveVias, o as PERMISSION_HELPERS, t as checkSharedTables } from "./tables-Btlt_Rp-.js";
18
- import { t as resolveNames } from "./resolve-names-CROyyjVR.js";
19
- import { a as roleNames, t as assignableRoles } from "./grants-C7bGZFPa.js";
20
- import { a as resolveAuthorize } from "./rbac-FlJv7Ba9.js";
21
- import { r as unsatisfiedKinds, t as ownershipRules } from "./ownership-BPGoxz1T.js";
15
+ import { A as tenantTypeOf, C as parseMembershipsFlag, D as idTypeOf, E as firstScopeType, O as scopeTypeOf, a as customRolesOn, l as USER_ID_HELPER, r as HELPERS, s as signedIn, t as CUSTOM_ROLES, y as subjectIdSql } from "./shared-Cwxy5N16.js";
16
+ import { H as byKey, I as raiseSql, K as graphSqlName, M as currentKeyExpr, R as rolesTableScope, V as byCodeUnit, _ as memoizes, g as memoizedSetofSql, ht as checkSuspension, i as interactiveOnlyKeys, m as memoHitList, o as memoUserSql } from "./interactive-only-C_olBCPl.js";
17
+ import { A as tokenScopeUnlimitedSql, B as apiKeyUnlimitedSql, E as memoReadsSql, I as API_KEY_ALLOWS, M as memoReadTriggersSql, O as TOKEN_SCOPE_ALLOWS, Q as graphPlan, R as apiKeyClaimSql, V as apiKeysPlan, X as closureDepths, Z as graphIdsSql, a as tablelessResources, d as permittedByPermissionHelper, i as tableNames, j as tokenScopesPlan, n as resolveVias, o as PERMISSION_HELPERS, t as checkSharedTables } from "./tables-BDqfipr1.js";
18
+ import { t as resolveNames } from "./resolve-names-B0cqvJxo.js";
19
+ import { a as roleNames, t as assignableRoles } from "./grants-Dn6zwfqo.js";
20
+ import { a as resolveAuthorize } from "./rbac-BJTUGJum.js";
21
+ import { r as unsatisfiedKinds, t as ownershipRules } from "./ownership-mprXkEHG.js";
22
22
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
23
- import { i as tableFor } from "./compile-mfTqcMJ5.js";
23
+ import { i as tableFor } from "./compile-B9SZiEnG.js";
24
24
  // src/cli/rls/custom-role-rebuild.ts
25
25
  const PREFIX = "PermDock CLI";
26
26
  /** A column of the roles-table row `r`. */
@@ -1,8 +1,8 @@
1
1
  import { t as defineLeaf } from "./command-9GAzSI7E.js";
2
2
  import { n as CliError } from "./errors-DgLOqc6j.js";
3
3
  import { c as generateFlags, f as policyFlag, i as dryRunFlag, n as dbUrl, r as dbUrlFlags, t as checkFlag } from "./flags-C0e-BzGW.js";
4
- import { t as executeGenerate } from "./execute-DdH84BHC.js";
5
- import { t as receiptRows } from "./pipeline-CGctXudd.js";
4
+ import { t as executeGenerate } from "./execute-BzQKrYqL.js";
5
+ import { t as receiptRows } from "./pipeline-Ct3YEKjx.js";
6
6
  // src/cli/commands/generate.ts
7
7
  function concurrencyFlag(value) {
8
8
  if (value === void 0 || value === "") return;
@@ -24,7 +24,7 @@ const generate = defineLeaf({
24
24
  const db = await dbUrl(ctx, flags);
25
25
  const policy = flags.policy !== void 0 && flags.policy !== "" ? flags.policy : ctx.config.policy;
26
26
  if (flags.watch) {
27
- const { watchGenerate } = await import("./watch-CnRyGEtp.js");
27
+ const { watchGenerate } = await import("./watch-Bz_iEKlB.js");
28
28
  return watchGenerate(ctx, {
29
29
  ...policy === void 0 ? {} : { policy },
30
30
  only: flags.only,
@@ -2,7 +2,7 @@ import { r as relationCondition, t as inheritCondition } from "./grantee-conditi
2
2
  import { d as scopeList } from "./scopes-B-KX9EI8.js";
3
3
  import { s as listRoles } from "./vocabulary-CE2k7s1a.js";
4
4
  import { i as configError } from "./errors-DgLOqc6j.js";
5
- import { t as andConditions } from "./conditions-VlAMOm20.js";
5
+ import { t as andConditions } from "./conditions-ChE7zxJI.js";
6
6
  // src/cli/sql/grants.ts
7
7
  /**
8
8
  * The `role_permissions` grant key of a break-glass grant. It differs from the
@@ -13,16 +13,16 @@ import { r as REGISTERED_CLAIMS } from "./definition-options-9o8Hdww3.js";
13
13
  import { t as beforeFirst } from "./text-D704xHVl.js";
14
14
  import { n as GRANTS_MARKER, r as HOOK_MARKER } from "./markers-C-kThnKN.js";
15
15
  import "./output-files-D5D-8-4l.js";
16
- import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-6d1j-q3c.js";
16
+ import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-CViS0EPC.js";
17
17
  import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
18
- import { A as tenantTypeOf, E as firstScopeType, O as scopeTypeOf, a as customRolesOn, j as userTypeOf, k as sqlType, l as USER_ID_HELPER, r as HELPERS, y as subjectIdSql } from "./shared-BdF5DJDQ.js";
19
- import { J as hasMemberFor, Q as isTeamScope, U as BOOTSTRAP_PERMISSIONS, X as hasPermittedUsers, at as memberRoleOf, et as memberForHelper, ht as checkSuspension, i as interactiveOnlyKeys, it as memberOfHelper, j as globalRoleSource, nt as memberForTable, ot as permittedForHelper, pt as activeRowSql, rt as memberIdsHelper, st as permittedIdsHelper, t as INTERACTIVE_ALLOWS, tt as memberForSources } from "./interactive-only-CQsgMc1E.js";
20
- import { H as HOOK_TEAM_READER, I as API_KEY_ALLOWS, O as TOKEN_SCOPE_ALLOWS, U as hookTeamReader, W as hookTeamsHelper, b as ASSIGNMENTS, d as permittedByPermissionHelper, l as permissionKeysForHelper, o as PERMISSION_HELPERS, s as checkName, x as OWNERSHIP, z as apiKeyFields } from "./tables-Btlt_Rp-.js";
21
- import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-CROyyjVR.js";
22
- import { a as supabaseConfig, t as declarativeSchemaDir } from "./supabase-config-CjX-GjEp.js";
23
- import { a as resolveAuthorize, n as hookUri, t as authAdminRead } from "./rbac-FlJv7Ba9.js";
18
+ import { A as tenantTypeOf, E as firstScopeType, O as scopeTypeOf, a as customRolesOn, j as userTypeOf, k as sqlType, l as USER_ID_HELPER, r as HELPERS, t as CUSTOM_ROLES, y as subjectIdSql } from "./shared-Cwxy5N16.js";
19
+ import { J as hasMemberFor, Q as isTeamScope, U as BOOTSTRAP_PERMISSIONS, X as hasPermittedUsers, at as memberRoleOf, et as memberForHelper, ht as checkSuspension, i as interactiveOnlyKeys, it as memberOfHelper, j as globalRoleSource, nt as memberForTable, ot as permittedForHelper, pt as activeRowSql, rt as memberIdsHelper, st as permittedIdsHelper, t as INTERACTIVE_ALLOWS, tt as memberForSources } from "./interactive-only-C_olBCPl.js";
20
+ import { H as HOOK_TEAM_READER, I as API_KEY_ALLOWS, O as TOKEN_SCOPE_ALLOWS, U as hookTeamReader, W as hookTeamsHelper, b as ASSIGNMENTS, d as permittedByPermissionHelper, l as permissionKeysForHelper, o as PERMISSION_HELPERS, s as checkName, x as OWNERSHIP, z as apiKeyFields } from "./tables-BDqfipr1.js";
21
+ import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-B0cqvJxo.js";
22
+ import { a as supabaseConfig, t as declarativeSchemaDir } from "./supabase-config-B2sDFiwy.js";
23
+ import { a as resolveAuthorize, n as hookUri, t as authAdminRead } from "./rbac-BJTUGJum.js";
24
24
  import { a as splitUndiffed, r as tableKey, t as decidingColumns } from "./deciding-columns-BnglEKqU.js";
25
- import { a as guardedTables, t as ownershipRules } from "./ownership-BPGoxz1T.js";
25
+ import { a as guardedTables, t as ownershipRules } from "./ownership-mprXkEHG.js";
26
26
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
27
27
  // src/cli/claims-schema.ts
28
28
  /**
@@ -3122,8 +3122,9 @@ function helperEntry(name, args, returns, execute) {
3122
3122
  }
3123
3123
  /**
3124
3124
  * The helpers `rls generate` writes beyond the ones the hook's claims feed: the
3125
- * `_for` forms in `database` mode, and the assignment checks when a role
3126
- * declares `assigns` (known only with the policy).
3125
+ * `_for` forms in `database` mode, `permdock_role_in` with custom roles there,
3126
+ * and the assignment checks when a role declares `assigns` (known only with the
3127
+ * policy).
3127
3128
  */
3128
3129
  function trustedHelpers(parts, config, types, tenantType, policy) {
3129
3130
  const database = resolveAuthorize(config) === "database";
@@ -3148,7 +3149,8 @@ function trustedHelpers(parts, config, types, tenantType, policy) {
3148
3149
  ...readOnlyActorKinds(config.rls?.readOnlyActors) === void 0 ? [] : [helperEntry(ACTOR_MAY_WRITE, "", "boolean", client)],
3149
3150
  ...config.rls?.approvals === true || typeof config.rls?.approvals === "object" ? [helperEntry(IS_APPROVER, typeof config.rls.approvals === "object" && (config.rls.approvals.delegations === true || config.rls.approvals.managers !== void 0) ? "p_approvers jsonb, p_tenant text, p_requester text, p_resource text" : "p_approvers jsonb, p_tenant text", "boolean", client), helperEntry(APPROVER_FOR_IDS, "", "setof uuid", client)] : [],
3150
3151
  ...typeof config.rls?.approvals === "object" && config.rls.approvals.managers !== void 0 ? [helperEntry(MANAGES, "p_requester text, p_levels integer", "boolean", []), helperEntry(MANAGED_USER_IDS, config.rls.approvals.managers.tenant === void 0 ? "" : `p_tenant ${tenantType}`, "setof uuid", client)] : [],
3151
- ...forUser
3152
+ ...forUser,
3153
+ ...custom ? [helperEntry(CUSTOM_ROLES.roleIn, `p_role text, p_tenant ${tenantType}`, "boolean", [])] : []
3152
3154
  ];
3153
3155
  if (!(policy !== void 0 && (ownershipRules(policy, parts.scopes)?.assigns.length ?? 0) > 0)) return keyed;
3154
3156
  const customArgs = `p_tenant ${tenantType}, p_scope text, p_scope_id text, p_role text`;
@@ -6,7 +6,7 @@ import { t as applyFiles } from "./files-DuV7wRim.js";
6
6
  import { n as httpRequest } from "./http-BbX_Ou3_.js";
7
7
  import { i as readJsonFile } from "./files-DAR51W3J.js";
8
8
  import { i as schemaExpression, t as emitPermissionsModule } from "./generate-5_kz2309.js";
9
- import { t as validateOpenapi } from "./schema-9eGIiLry.js";
9
+ import { t as validateOpenapi } from "./schema-BVhiZyY-.js";
10
10
  import { existsSync, readFileSync } from "node:fs";
11
11
  import { resolve } from "node:path";
12
12
  // src/cli/openapi/import.ts
@@ -2,11 +2,11 @@ import { f as usageResult, i as configError } from "./errors-DgLOqc6j.js";
2
2
  import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
3
3
  import { n as emptySchema, r as isSchemaKind, t as emitPermissionsModule } from "./generate-5_kz2309.js";
4
4
  import { n as pgConnector } from "./pg-CA651850.js";
5
- import { C as parseMembershipsFlag, r as HELPERS } from "./shared-BdF5DJDQ.js";
5
+ import { C as parseMembershipsFlag, r as HELPERS } from "./shared-Cwxy5N16.js";
6
6
  import { u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
7
7
  import { r as escapeSqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
8
8
  import { r as isRecord } from "./compact-C4LFuqbW.js";
9
- import { t as FIELD_VIEWS } from "./fields-6d1j-q3c.js";
9
+ import { t as FIELD_VIEWS } from "./fields-CViS0EPC.js";
10
10
  import { existsSync, readFileSync } from "node:fs";
11
11
  import { resolve } from "node:path";
12
12
  import { createHash } from "node:crypto";
@@ -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-Cfi7_gXO.js"), import("./peer-BWTpSLs2.js")]);
51
+ const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-Ck4PIu9F.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-Cfi7_gXO.js");
82
+ const { runPreset } = await import("./init-Ck4PIu9F.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-Cfi7_gXO.js");
90
+ const { runPreset } = await import("./init-Ck4PIu9F.js");
91
91
  return runPreset("url", args["code"] ?? "");
92
92
  }
93
93
  });
@@ -1,7 +1,7 @@
1
1
  import { a as decodePreset, g as resolvePreset, i as presetFlags, n as generatePreset, o as encodePreset } from "./preset-BcFDaeqd.js";
2
2
  import { n as CliError } from "./errors-DgLOqc6j.js";
3
3
  import { t as applyFiles } from "./files-DuV7wRim.js";
4
- import { a as nonEmptyOr } from "./output-Pne7BTXn.js";
4
+ import { a as nonEmptyOr } from "./output-BhNN-hvv.js";
5
5
  import { t as addLine } from "./peer-D77JpXe-.js";
6
6
  import { existsSync } from "node:fs";
7
7
  import { join } from "node:path";
@@ -4,8 +4,8 @@ import { i as configError } from "./errors-DgLOqc6j.js";
4
4
  import { d as sqlTextArray, i as qualifySqlTable } from "./sql-T4GaBh9X.js";
5
5
  import { a as scopeMembershipTable, i as scopeColumn } from "./compile-BUKXrueE.js";
6
6
  import { d as keptKeys, l as roleColumn, u as roleManifest } from "./sources-DnjJPGfb.js";
7
- import { a as quoteIdent, c as quoteTable, i as qualified, o as quoteLiteral, r as helperSchema, s as quoteQualified, t as CLI } from "./quote-BKrTBbcH.js";
8
- import { A as tenantTypeOf, O as scopeTypeOf, _ as subjectClaimJsonSql, d as keyTenantSql, f as kindFilterSql, i as allowEntry, m as memberVia, o as rootName, r as HELPERS, s as signedIn, t as CUSTOM_ROLES, u as globalKindFilterSql, v as subjectClaimSql, y as subjectIdSql } from "./shared-BdF5DJDQ.js";
7
+ import { a as quoteIdent, c as quoteTable, i as qualified, n as declaredArray, o as quoteLiteral, r as helperSchema, s as quoteQualified, t as CLI } from "./quote-BKrTBbcH.js";
8
+ import { A as tenantTypeOf, O as scopeTypeOf, _ as subjectClaimJsonSql, d as keyTenantSql, f as kindFilterSql, i as allowEntry, m as memberVia, o as rootName, r as HELPERS, s as signedIn, t as CUSTOM_ROLES, u as globalKindFilterSql, v as subjectClaimSql, y as subjectIdSql } from "./shared-Cwxy5N16.js";
9
9
  // src/cli/sql/active.ts
10
10
  function checkActiveRow(label, row) {
11
11
  quoteTable(row.table);
@@ -335,6 +335,31 @@ function byKey([a], [b]) {
335
335
  return byCodeUnit(a, b);
336
336
  }
337
337
  // src/cli/rls/custom-roles.ts
338
+ /**
339
+ * `permdock_role_in`: whether `p_role` is a role of tenant `p_tenant`, declared
340
+ * or a custom role the tenant owns or every tenant shares (a null tenant). It
341
+ * reads the application's roles table when `rls.customRoleWrites.roles` names
342
+ * one, else the custom-role tables. Trusted SQL only, such as better-supabase's
343
+ * `membership_roles` trigger.
344
+ */
345
+ function roleInSql(ctx, custom) {
346
+ const fn = qualified(ctx, CUSTOM_ROLES.roleIn);
347
+ const tenantType = tenantTypeOf(ctx);
348
+ const table = custom.table;
349
+ const exists = table === void 0 ? [CUSTOM_ROLES.permissions, CUSTOM_ROLES.includes].map((name) => `exists (select 1 from ${qualified(ctx, name)} c where c.role = p_role and (c.tenant_id = p_tenant or c.tenant_id is null))`).join("\n or ") : `exists (select 1 from ${quoteQualified(table.table)} r where r.${quoteIdent(table.key)}::text = p_role${table.tenant === void 0 ? "" : ` and (r.${quoteIdent(table.tenant)} = p_tenant or r.${quoteIdent(table.tenant)} is null)`})`;
350
+ return `-- whether p_role is a role of tenant p_tenant: declared, or a custom role the tenant owns or shares; trusted SQL only
351
+ create or replace function ${fn}(p_role text, p_tenant ${tenantType})
352
+ returns boolean
353
+ language sql
354
+ stable
355
+ security definer
356
+ set search_path = ''
357
+ as $$
358
+ select p_role = any(${declaredArray(custom.declared)})
359
+ or ${exists}
360
+ $$;
361
+ revoke execute on function ${fn}(text, ${tenantType}) from public, anon, authenticated;`;
362
+ }
338
363
  /** The readers every helpers file ends with. Names are part of the SQL contract. */
339
364
  const READERS = {
340
365
  keys: "permdock_permission_keys",
@@ -408,6 +433,7 @@ where rp.role = any(${sqlTextArray(custom.assignable)})
408
433
  and a.effect = 'allow'
409
434
  );
410
435
  revoke all on table ${ceiling} from anon, authenticated, public;`);
436
+ if (ctx.authorize === "database") chunks.push(roleInSql(ctx, custom));
411
437
  const renames = Object.entries(custom.renamed ?? {}).toSorted(byKey);
412
438
  const shared = sharedRoleSql(ctx);
413
439
  if (custom.levels === true) {
@@ -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 { a as nonEmptyOr } from "./output-Pne7BTXn.js";
6
+ import { a as nonEmptyOr } from "./output-BhNN-hvv.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-kg9Pd0C2.js");
30
+ const { runLogin } = await import("./login-BdWIAsFT.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-kg9Pd0C2.js");
46
+ const { runLogout } = await import("./login-BdWIAsFT.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-kg9Pd0C2.js");
58
+ const { runWhoami } = await import("./login-BdWIAsFT.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-CP3fYFb6.js")).init
33
+ load: async () => (await import("./init-CjlVWrBE.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-CP3fYFb6.js")).presetDecode
40
+ load: async () => (await import("./init-CjlVWrBE.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-CP3fYFb6.js")).presetUrl
46
+ load: async () => (await import("./init-CjlVWrBE.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-BPDVfXgR.js")).install
58
+ load: async () => (await import("./skills-CQ3B9vuz.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-BPDVfXgR.js")).update
65
+ load: async () => (await import("./skills-CQ3B9vuz.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-BPDVfXgR.js")).list
72
+ load: async () => (await import("./skills-CQ3B9vuz.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-CuhkBJ06.js")).doctor
86
+ load: async () => (await import("./doctor-CjCJ_U2a.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-D4p_MQX7.js")).completion
94
+ load: async () => (await import("./completion-CHOgUToS.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-UMuStlLD.js")).generate
128
+ load: async () => (await import("./generate-p7cdH1ac.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-DRReZaxQ.js")).usage
136
+ load: async () => (await import("./usage-Dodo7Sjb.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"],
@@ -165,7 +165,7 @@ const SECTIONS = [
165
165
  docs: "policy",
166
166
  effects: ["files"],
167
167
  config: true,
168
- load: async () => (await import("./policy-G8iZ2T5P.js")).policyBundle
168
+ load: async () => (await import("./policy-DfvOwgtX.js")).policyBundle
169
169
  })]),
170
170
  group("claims", "Measure the memberships claim of an access token", "claims", [leaf("size", "Report claim bytes, token characters and the budget cut", {
171
171
  examples: ["permdock claims size --memberships 60", "permdock claims size --memberships 11 --roles 3 --json"],
@@ -180,7 +180,7 @@ const SECTIONS = [
180
180
  effects: [],
181
181
  config: true,
182
182
  findings: true,
183
- load: async () => (await import("./config-D9bq79Yi.js")).config
183
+ load: async () => (await import("./config-StFKj2S0.js")).config
184
184
  })
185
185
  ]
186
186
  },
@@ -193,7 +193,7 @@ const SECTIONS = [
193
193
  docs: "rls",
194
194
  effects: ["files", "database:read"],
195
195
  config: true,
196
- load: async () => (await import("./rls-DV4MUNMb.js")).importPolicies
196
+ load: async () => (await import("./rls-BC1IFnfu.js")).importPolicies
197
197
  }),
198
198
  leaf("verify", "Run the fixtures against the policies, or compare a live database", {
199
199
  examples: [
@@ -205,21 +205,21 @@ const SECTIONS = [
205
205
  effects: ["files", "database:read"],
206
206
  config: true,
207
207
  findings: true,
208
- load: async () => (await import("./rls-DV4MUNMb.js")).verify
208
+ load: async () => (await import("./rls-BC1IFnfu.js")).verify
209
209
  }),
210
210
  leaf("migrate", "Rewrite hand-written policies onto the generated helpers", {
211
211
  examples: ["permdock rls migrate --sql supabase/migrations --dry-run", "permdock rls migrate --sql supabase/migrations"],
212
212
  docs: "rls",
213
213
  effects: ["rewrite", "files"],
214
214
  config: true,
215
- load: async () => (await import("./rls-DV4MUNMb.js")).migrate
215
+ load: async () => (await import("./rls-BC1IFnfu.js")).migrate
216
216
  }),
217
217
  leaf("explain", "Show the tables, membership sources and triggers the SQL binds to", {
218
218
  examples: ["permdock rls explain", "permdock rls explain --db-url-stdin --json"],
219
219
  docs: "rls",
220
220
  effects: ["database:read"],
221
221
  config: true,
222
- load: async () => (await import("./rls-DV4MUNMb.js")).explain
222
+ load: async () => (await import("./rls-BC1IFnfu.js")).explain
223
223
  })
224
224
  ]),
225
225
  group("supabase", "Generate the Supabase Custom Access Token Hook, or inspect its manifest", "supabase", [leaf("inspect", "Print or write the hook and helper manifest", {
@@ -227,14 +227,14 @@ const SECTIONS = [
227
227
  docs: "supabase",
228
228
  effects: ["files"],
229
229
  config: true,
230
- load: async () => (await import("./supabase-D5KN965n.js")).inspect
230
+ load: async () => (await import("./supabase-CakrAxMg.js")).inspect
231
231
  })]),
232
232
  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", {
233
233
  examples: ["permdock powersync verify", "permdock powersync verify --db-url-stdin"],
234
234
  docs: "powersync",
235
235
  effects: ["database:read"],
236
236
  config: true,
237
- load: async () => (await import("./powersync-BoOMFQRl.js")).verify
237
+ load: async () => (await import("./powersync-BdqLK59r.js")).verify
238
238
  })])
239
239
  ]
240
240
  },
@@ -247,13 +247,13 @@ const SECTIONS = [
247
247
  effects: ["files"],
248
248
  config: true,
249
249
  findings: true,
250
- load: async () => (await import("./openapi-dJFJTHiW.js")).annotateRoutes
250
+ load: async () => (await import("./openapi-E2411VYb.js")).annotateRoutes
251
251
  }), leaf("import", "Turn an OpenAPI document into a generated definition", {
252
252
  examples: ["permdock openapi import --doc openapi.yaml --out src/permissions.generated.ts"],
253
253
  docs: "openapi",
254
254
  effects: ["files", "network"],
255
255
  config: false,
256
- load: async () => (await import("./openapi-dJFJTHiW.js")).importDocument
256
+ load: async () => (await import("./openapi-E2411VYb.js")).importDocument
257
257
  })]),
258
258
  group("arazzo", "Check Arazzo workflows against the permissions", "arazzo", [leaf("check", "Resolve every Arazzo step to x-permdock-permissions", {
259
259
  examples: ["permdock arazzo check --doc arazzo.json --openapi openapi.json"],
@@ -261,7 +261,7 @@ const SECTIONS = [
261
261
  effects: [],
262
262
  config: true,
263
263
  findings: true,
264
- load: async () => (await import("./arazzo-UwtVzma6.js")).check
264
+ load: async () => (await import("./arazzo-D9Fv_ZEV.js")).check
265
265
  })]),
266
266
  leaf("scan", "List authorization checks written without PermDock, to adopt it in an existing app", {
267
267
  examples: ["permdock scan", "permdock scan --src app,lib --pattern isBeta"],
@@ -269,7 +269,7 @@ const SECTIONS = [
269
269
  effects: [],
270
270
  config: true,
271
271
  findings: true,
272
- load: async () => (await import("./scan-CoyAmDAz.js")).scan
272
+ load: async () => (await import("./scan-C_YtxPxn.js")).scan
273
273
  }),
274
274
  group("casl", "Import CASL rules into a generated module", "casl", [leaf("import", "Turn CASL rules per role into a permissions and policy module", {
275
275
  examples: ["permdock casl import --rules rules.json --out src/permissions.generated.ts"],
@@ -283,7 +283,7 @@ const SECTIONS = [
283
283
  docs: "casbin",
284
284
  effects: ["files"],
285
285
  config: false,
286
- load: async () => (await import("./casbin-CSgPeAJK.js")).casbinImport
286
+ load: async () => (await import("./casbin-D3PH6-AJ.js")).casbinImport
287
287
  })])
288
288
  ]
289
289
  },
@@ -295,34 +295,34 @@ const SECTIONS = [
295
295
  docs: "login",
296
296
  effects: ["network", "files"],
297
297
  config: false,
298
- load: async () => (await import("./login-BjkyJNGn.js")).login
298
+ load: async () => (await import("./login-BhSLL8Pn.js")).login
299
299
  }),
300
300
  leaf("logout", "Revoke and delete the stored PermDock Cloud login", {
301
301
  examples: ["permdock logout"],
302
302
  docs: "login",
303
303
  effects: ["network", "files"],
304
304
  config: false,
305
- load: async () => (await import("./login-BjkyJNGn.js")).logout
305
+ load: async () => (await import("./login-BhSLL8Pn.js")).logout
306
306
  }),
307
307
  leaf("whoami", "Print the PermDock Cloud identity the CLI acts as", {
308
308
  examples: ["permdock whoami", "permdock whoami --json"],
309
309
  docs: "login",
310
310
  effects: [],
311
311
  config: false,
312
- load: async () => (await import("./login-BjkyJNGn.js")).whoami
312
+ load: async () => (await import("./login-BhSLL8Pn.js")).whoami
313
313
  }),
314
314
  group("cloud", "Publish to or pull from a PermDock Cloud project", "cloud", [leaf("push", "Publish the catalog, policy and manifest to a Cloud project", {
315
315
  examples: ["permdock cloud push --dry-run", "permdock cloud push --project prj_123"],
316
316
  docs: "cloud",
317
317
  effects: ["network", "cloud:write"],
318
318
  config: true,
319
- load: async () => (await import("./cloud-CFtvELWj.js")).push
319
+ load: async () => (await import("./cloud-DnTSKTYr.js")).push
320
320
  }), leaf("pull", "Write a Cloud project's published catalog and manifest", {
321
321
  examples: ["permdock cloud pull --project prj_123"],
322
322
  docs: "cloud",
323
323
  effects: ["network", "files"],
324
324
  config: true,
325
- load: async () => (await import("./cloud-CFtvELWj.js")).pull
325
+ load: async () => (await import("./cloud-DnTSKTYr.js")).pull
326
326
  })])
327
327
  ]
328
328
  },
@@ -333,7 +333,7 @@ const SECTIONS = [
333
333
  docs: "codemod",
334
334
  effects: ["rewrite"],
335
335
  config: false,
336
- load: async () => (await import("./codemod-3PFIcPag.js")).codemod
336
+ load: async () => (await import("./codemod-DwJ1I9er.js")).codemod
337
337
  })]
338
338
  }
339
339
  ];
@@ -345,7 +345,7 @@ const COMPLETE_LEAF = leaf("__complete", "Print completion candidates for a part
345
345
  config: false,
346
346
  shellOutput: true,
347
347
  hidden: true,
348
- load: async () => (await import("./completion-D4p_MQX7.js")).complete
348
+ load: async () => (await import("./completion-CHOgUToS.js")).complete
349
349
  });
350
350
  const ROOT = group("permdock", "Collect, export, diff and check the permissions a PermDock policy declares", "", [...SECTIONS.flatMap((section) => section.entries), COMPLETE_LEAF]);
351
351
  /** Each leaf with its path from the root, in manifest order. */
@@ -1,7 +1,7 @@
1
1
  import { n as freezeDeep } from "./freeze-DGfJq_j2.js";
2
2
  import { n as copyJson, t as checkSchema } from "./json-schema-jtX26ydD.js";
3
3
  import { n as PermDockValidationError } from "./validation-error-CgDOA6VS.js";
4
- import { t as supabaseManifestSchema } from "./manifest-schema-DJY5Q_pR.js";
4
+ import { t as supabaseManifestSchema } from "./manifest-schema-Bp-eFhNZ.js";
5
5
  // src/supabase/manifest.ts
6
6
  /** Whether the manifest describes a token hook. */
7
7
  function hasTokenHook(manifest) {
@@ -437,7 +437,7 @@ const supabaseManifestSchema = freezeDeep({
437
437
  },
438
438
  helperName: {
439
439
  type: "string",
440
- pattern: "^(permdock_has(_for)?|permitted_[a-z][a-z0-9_]*_(ids|permission_keys)(_for)?|permitted_[a-z][a-z0-9_]*_users|member_[a-z][a-z0-9_]*_ids(_for|_of)?|permdock_can_assign(_any|_custom_role)?(_for)?|permdock_api_key_allows|permdock_token_scope_allows|permdock_interactive_allows|permdock_actor_may_write|permdock_is_approver|permdock_manages|permdock_user_id|permdock_subject|permdock_approver_for_ids|permdock_managed_user_ids|permdock_bootstrap_permissions)$"
440
+ pattern: "^(permdock_has(_for)?|permitted_[a-z][a-z0-9_]*_(ids|permission_keys)(_for)?|permitted_[a-z][a-z0-9_]*_users|member_[a-z][a-z0-9_]*_ids(_for|_of)?|permdock_can_assign(_any|_custom_role)?(_for)?|permdock_api_key_allows|permdock_token_scope_allows|permdock_interactive_allows|permdock_actor_may_write|permdock_is_approver|permdock_manages|permdock_user_id|permdock_subject|permdock_approver_for_ids|permdock_managed_user_ids|permdock_bootstrap_permissions|permdock_role_in)$"
441
441
  },
442
442
  column: {
443
443
  type: "object",
@@ -7,7 +7,7 @@ import { i as refuseDirty, t as applyFiles } from "./files-DuV7wRim.js";
7
7
  import { _ as writeOutputFiles, n as dataMigrationFile } from "./output-files-D5D-8-4l.js";
8
8
  import { o as sqlFiles } from "./files-DAR51W3J.js";
9
9
  import { a as RETIRE_MARKER } from "./markers-C-kThnKN.js";
10
- import { r as HELPERS } from "./shared-BdF5DJDQ.js";
10
+ import { r as HELPERS } from "./shared-Cwxy5N16.js";
11
11
  import { o as sqlStatements } from "./deciding-columns-BnglEKqU.js";
12
12
  import { i as retireSql, r as retirePlan } from "./retire-BNiXnbBR.js";
13
13
  import { existsSync, readFileSync } from "node:fs";
@@ -4,7 +4,7 @@ import { c as listPermissions, i as getRegistry, s as isRegistryTree } from "./p
4
4
  import { i as grantList } from "./policy-DFD2J5o_.js";
5
5
  import { c as jsonSchemaOf } from "./catalog-doc-Bp5khmCG.js";
6
6
  import { n as CliError } from "./errors-DgLOqc6j.js";
7
- import { n as compileConditionSql } from "./conditions-VlAMOm20.js";
7
+ import { n as compileConditionSql } from "./conditions-ChE7zxJI.js";
8
8
  import { a as quoteIdent, o as quoteLiteral } from "./quote-BKrTBbcH.js";
9
9
  // src/cli/generate/dialects.ts
10
10
  const STREAM_COMPARE = {
@@ -7,7 +7,7 @@ import { i as fileDrift } from "./output-files-D5D-8-4l.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-CZnlAyZ8.js";
10
- import { n as validateOverlay, t as validateOpenapi } from "./schema-9eGIiLry.js";
10
+ import { n as validateOverlay, t as validateOpenapi } from "./schema-BVhiZyY-.js";
11
11
  import { existsSync } from "node:fs";
12
12
  import { resolve } from "node:path";
13
13
  // src/cli/openapi/emit/merge.ts