permdock 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a/index.d.ts +1 -1
- package/dist/a2a/index.js +3 -3
- package/dist/{adoption-scan-BWL5H82_.js → adoption-scan-UkQisAqe.js} +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/index.js +3 -3
- package/dist/approvals/index.d.ts +1 -1
- package/dist/{arazzo-B_CPVseu.js → arazzo-BC3uLIZy.js} +2 -2
- package/dist/{arazzo-C8u26FUA.js → arazzo-CUthH61H.js} +1 -1
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/authzen/index.d.ts +2 -2
- package/dist/authzen/index.js +1 -1
- package/dist/better-supabase/index.d.ts +2 -2
- package/dist/better-supabase/index.js +3 -3
- package/dist/{bind-gwEbe9hL.js → bind-CJf7S-Jd.js} +3 -3
- package/dist/{bind-CW7nsZ86.d.ts → bind-XvnD_SUz.d.ts} +5 -5
- package/dist/{build-instance-DaBdCRiz.js → build-instance-CkRKgjSj.js} +1 -1
- package/dist/{casbin-JWZGKqzy.js → casbin-BOZN1P2Y.js} +1 -1
- package/dist/{casbin-DaY-CWOr.js → casbin-v9Xo_XPa.js} +1 -1
- package/dist/catalog/index.js +2 -2
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat-sdk/index.d.ts +1 -1
- package/dist/claude-agent/index.d.ts +2 -2
- package/dist/claude-agent/index.js +2 -2
- package/dist/clerk/index.d.ts +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/{cloud-pEhjaPNs.js → cloud-CB0btByh.js} +2 -2
- package/dist/{codemod-Cv0-7Ogj.js → codemod-B-duJDFD.js} +1 -1
- package/dist/{codemod-BUhreN8m.js → codemod-C3a3Iz_w.js} +2 -2
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-DZftFfXc.d.ts → compile-DonvwG9x.d.ts} +1 -1
- package/dist/{completion-BG1wcLJ3.js → completion-6IshPaPd.js} +1 -1
- package/dist/{config-Di9kWoLY.js → config-C45X7mpm.js} +1 -1
- package/dist/{config-report-B0IyW7EQ.js → config-report-Bmo62RRr.js} +1 -1
- package/dist/convex/index.d.ts +2 -2
- package/dist/convex/index.js +2 -2
- package/dist/{core-BOeGWbcR.d.ts → core-9KbhurkH.d.ts} +1 -1
- package/dist/{core-BwVkrpsi.js → core-Dxkwz4xR.js} +2 -2
- package/dist/{create-DMCC5ZOi.d.ts → create-BQOQkYYg.d.ts} +4 -4
- package/dist/{create-DDUFG1ul.js → create-BRiRVNUO.js} +5 -4
- package/dist/{create-DYSYYiLr.d.ts → create-BzgDDamI.d.ts} +1 -1
- package/dist/{create-BezeYFcT.d.ts → create-DH4ZD0A7.d.ts} +2 -2
- package/dist/{create-C0R8omeF.js → create-Q0wF9Elt.js} +3 -3
- package/dist/delivery/index.d.ts +1 -1
- package/dist/{diff-DXRNcjpg.js → diff-3fpwo3UD.js} +1 -1
- package/dist/{diff-Bd1-VCe5.js → diff-BJv7I3GR.js} +2 -2
- package/dist/{doctor-DpD4nHMS.js → doctor-Bz7s3JYD.js} +13 -13
- package/dist/{doctor-Bp3xspBi.js → doctor-keoa9DpH.js} +2 -2
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/elysia/index.d.ts +3 -3
- package/dist/elysia/index.js +1 -1
- package/dist/{evaluations-BgxEfPL7.d.ts → evaluations-OCm_Z-8V.d.ts} +1 -1
- package/dist/eve/index.d.ts +2 -2
- package/dist/eve/index.js +2 -2
- package/dist/express/index.d.ts +3 -3
- package/dist/express/index.js +1 -1
- package/dist/fastify/index.d.ts +3 -3
- package/dist/fastify/index.js +1 -1
- package/dist/{fetch-adapter-acq4dPX3.js → fetch-adapter-4EB3cLgB.js} +3 -2
- package/dist/{fetch-adapter-DCQ4pZxf.d.ts → fetch-adapter-BlL-ZhHq.d.ts} +2 -2
- package/dist/{fields-COvJbUva.js → fields-D_TfExiI.js} +1 -1
- package/dist/{gen-CKr1Vfiz.js → gen-Cf7nQsOb.js} +1 -1
- package/dist/{gen-B2O9T25-.js → gen-DYF4LKUP.js} +1 -1
- package/dist/h3/index.d.ts +3 -3
- package/dist/h3/index.js +2 -2
- package/dist/hono/index.d.ts +3 -3
- package/dist/hono/index.js +1 -1
- package/dist/{import-DVI_1tO_.js → import-C2ExjVvv.js} +2 -2
- package/dist/{import-DG6uswAo.js → import-CQ_kH_Ny.js} +1 -1
- package/dist/{index-Bt37QovT.d.ts → index-BqzpT-90.d.ts} +1 -1
- package/dist/{index-CruReRkB.d.ts → index-Do7FqHEr.d.ts} +1 -1
- package/dist/{index-B_I6N8Ju.d.ts → index-DuOF7OqS.d.ts} +2 -2
- package/dist/{index-D7xGi1LS.d.ts → index-tuR-kZoJ.d.ts} +4 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/{init-C-cgOvCl.js → init-DvkvbvZ_.js} +1 -1
- package/dist/{init-DAPbdjcX.js → init-kTFkEu8S.js} +3 -3
- package/dist/{instance-options-VPsNQsTH.d.ts → instance-options-Cq66kEeR.d.ts} +1 -1
- package/dist/{instance-snapshot-SX8zH_1t.js → instance-snapshot-Bi4-dJk0.js} +1 -1
- package/dist/{kernel-_QEUOSU0.js → kernel-CLEzDmbv.js} +3 -3
- package/dist/kysely/index.d.ts +2 -2
- package/dist/{login-Cgix5FgG.js → login-9ycIcJZH.js} +1 -1
- package/dist/{login-CQGjpkuo.js → login-CM_etiLM.js} +3 -3
- package/dist/{manifest-CMu1IE0R.js → manifest-CCd-xrM3.js} +33 -33
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +3 -3
- package/dist/{migrate-BbY5-Khy.js → migrate-CkLHdwuH.js} +1 -1
- package/dist/nest/index.d.ts +3 -3
- package/dist/nest/index.js +1 -1
- package/dist/next/index.d.ts +9 -6
- package/dist/next/index.js +6 -4
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +1 -1
- package/dist/openai/index.d.ts +2 -2
- package/dist/openai/index.js +3 -3
- package/dist/{openapi-FVeCoh97.js → openapi-DA7FVG2F.js} +1 -1
- package/dist/{openapi-lsf1gEtr.js → openapi-QnnU2A1c.js} +2 -2
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.d.ts +2 -2
- package/dist/{output-DZQCr2lP.js → output-KT0a3B3H.js} +1 -1
- package/dist/{ownership-CBuIjxKh.js → ownership-CeNOtQMV.js} +2 -2
- package/dist/pdp/index.d.ts +2 -2
- package/dist/pdp/index.js +1 -1
- package/dist/{permdock-D4F2p5J8.d.ts → permdock-CsrvbzHk.d.ts} +5 -0
- package/dist/{permdock-C1DN_7a-.js → permdock-DbAq8_Fp.js} +2 -1
- package/dist/{permissions-8N2yFsUM.js → permissions-Dz79qsFw.js} +1 -1
- package/dist/{policy-from-catalog-CUNlpgz0.js → policy-from-catalog-BtqfxytV.js} +1 -1
- package/dist/powersync-CWCirKAJ.js +1 -0
- package/dist/{powersync-CRtuJXVB.js → powersync-CWsN-QaK.js} +2 -2
- package/dist/{powersync-Dz4H1FLs.js → powersync-DiqY3VBG.js} +6 -6
- package/dist/prisma/index.d.ts +1 -1
- package/dist/{protected-action-ua0cx5cW.d.ts → protected-action-CuG0xz4P.d.ts} +3 -3
- package/dist/{provider-D_hgjZRa.d.ts → provider-ihxuJbMi.d.ts} +1 -1
- package/dist/{pull-DnhBA9pf.js → pull-B4EhSqOG.js} +1 -1
- package/dist/pull-VzcECZ-R.js +1 -0
- package/dist/{push-D2SsRW0U.js → push-DYOI4bPf.js} +1 -1
- package/dist/{pushed-policy-BERO0x9O.js → pushed-policy-Dszouliu.js} +1 -1
- package/dist/react/index.d.ts +4 -4
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react-native/index.d.ts +4 -4
- package/dist/{request-context-BPTi68z5.js → request-context-VjeXst1z.js} +1 -1
- package/dist/{resolve-names-CDnxNqNb.js → resolve-names-BIHnWL_L.js} +3 -3
- package/dist/{rls-CHZi5SUK.js → rls-C7qXye9M.js} +1 -1
- package/dist/{rls-CbDKv6GP.js → rls-CMFZWosz.js} +13 -13
- package/dist/{rpc-DdkbQVlT.js → rpc-BNIQwEB6.js} +1 -1
- package/dist/{rpc-D2LnFELm.d.ts → rpc-CYXICjM1.d.ts} +1 -1
- package/dist/{run-Bnm5VZ8m.js → run-CMJX9x7b.js} +2 -2
- package/dist/run-D2e1tybu.js +1 -0
- package/dist/{run-ticket-94DOS9Cd.d.ts → run-ticket-BXYqQ9dy.d.ts} +1 -1
- package/dist/{saas-BEXnrH9H.js → saas-DHFfthXv.js} +2 -2
- package/dist/{scan-VKkU4Ix9.js → scan-CSOkcNdl.js} +1 -1
- package/dist/{schema-5onstWlb.js → schema-7pXCaRYB.js} +1 -1
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +1 -1
- package/dist/{server-types-ChzXWU4Y.d.ts → server-types-Bfl-IrzZ.d.ts} +6 -5
- package/dist/{shared-DyYVEjKC.js → shared-sW3VYchq.js} +2 -1
- package/dist/{skills-Yz3LfoAZ.js → skills-DAjg-rgF.js} +1 -1
- package/dist/{skills-B6sLqv4E.js → skills-DrX83QBK.js} +1 -1
- package/dist/solid/index.d.ts +2 -2
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/solid-start/index.js +2 -2
- package/dist/{src-B8SQNsvw.js → src-Cop53_X1.js} +3 -2
- package/dist/{store-Dpg_fSNQ.d.ts → store-CRQ5VrWR.d.ts} +1 -1
- package/dist/{stores-C2A6KsxE.d.ts → stores-pEBMy94l.d.ts} +3 -3
- package/dist/supabase/middleware.d.ts +4 -4
- package/dist/supabase/middleware.js +4 -4
- package/dist/{supabase-CWpADE8k.js → supabase-Cbl2orB2.js} +2 -2
- package/dist/{supabase-hook-bDeWbKee.js → supabase-hook-BUcu3vPM.js} +11 -6
- package/dist/supabase-hook-QWphWBnG.js +1 -0
- package/dist/{supautils-0RrdsFT3.js → supautils-a_253u1X.js} +67 -8
- package/dist/svelte/index.d.ts +3 -3
- package/dist/svelte/runtime.d.ts +2 -2
- package/dist/svelte/source.d.ts +3 -3
- package/dist/sveltekit/index.d.ts +3 -3
- package/dist/sveltekit/index.js +1 -1
- package/dist/{tables-C53U2zrN.js → tables-XrvffTMj.js} +329 -68
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/tanstack-start/index.js +1 -1
- package/dist/terminal/index.d.ts +2 -2
- package/dist/terminal/index.js +2 -2
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/index.d.ts +7 -7
- package/dist/testing/index.js +6 -6
- package/dist/testing/saas/index.d.ts +1 -1
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +4 -4
- package/dist/trpc/index.js +2 -2
- package/dist/{types-C5p2hoBR.d.ts → types-C3C9ien9.d.ts} +2 -2
- package/dist/{types-Drs3OOAy.d.ts → types-DjGZAU64.d.ts} +2 -2
- package/dist/{types-D8JVDWOr.d.ts → types-DotXrris.d.ts} +1 -1
- package/dist/{types-DnzRZjEu.d.ts → types-MixnvXQ5.d.ts} +2 -2
- package/dist/{types-CMclYgSk.d.ts → types-zh4WGQcP.d.ts} +1 -1
- package/dist/{usage-BFMCEgJp.js → usage-DHsqp4lN.js} +1 -1
- package/dist/{usage-B6gmS634.js → usage-DPbdI3Vi.js} +2 -2
- package/dist/usage-dmSjKx-Z.js +1 -0
- package/dist/{verify-DFruUfZg.js → verify-C0jGJrmb.js} +7 -7
- package/dist/vue/index.d.ts +2 -2
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.js +1 -1
- package/dist/workflow-sdk/index.d.ts +2 -2
- package/dist/{wrap-CE5lxje7.d.ts → wrap-EQ6Or2Hi.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/powersync-BV68Jh-T.js +0 -1
- package/dist/pull-AOmtUo8V.js +0 -1
- package/dist/run-D6U-Gwok.js +0 -1
- package/dist/supabase-hook-Clczf4iF.js +0 -1
- package/dist/usage-Csu-M5jC.js +0 -1
|
@@ -47,7 +47,7 @@ const hookGenerate = defineLeaf({
|
|
|
47
47
|
const budget = given(flags.budget);
|
|
48
48
|
const schema = given(flags.schema);
|
|
49
49
|
const grantsOut = given(flags["grants-out"]);
|
|
50
|
-
const { runSupabase } = await import("./supabase-hook-
|
|
50
|
+
const { runSupabase } = await import("./supabase-hook-QWphWBnG.js");
|
|
51
51
|
return runSupabase({
|
|
52
52
|
cwd: ctx.cwd,
|
|
53
53
|
config: ctx.config,
|
|
@@ -76,7 +76,7 @@ const inspect = defineLeaf({
|
|
|
76
76
|
},
|
|
77
77
|
async run(ctx, { flags }) {
|
|
78
78
|
const out = flags.out === "" ? true : flags.out === "-" ? void 0 : flags.out;
|
|
79
|
-
const { runSupabase } = await import("./supabase-hook-
|
|
79
|
+
const { runSupabase } = await import("./supabase-hook-QWphWBnG.js");
|
|
80
80
|
return runSupabase({
|
|
81
81
|
cwd: ctx.cwd,
|
|
82
82
|
config: ctx.config,
|
|
@@ -19,13 +19,13 @@ import { n as formatManifestJson, t as MANIFEST_FILE } from "./manifest-json-CAG
|
|
|
19
19
|
import { n as MIGRATION_DIRS } from "./constants-DcJABbLW.js";
|
|
20
20
|
import { f as writeOutputFiles, l as partPath, r as driftOf, u as pgDeltaPath } from "./output-files-CM0BnH05.js";
|
|
21
21
|
import { n as pgConnector } from "./pg-Ddxsd5ZB.js";
|
|
22
|
-
import { A as quoteQualified, D as qualified, F as firstScopeType, I as scopeTypeOf, O as quoteIdent, R as tenantTypeOf, a as customRolesOn, j as quoteTable, k as quoteLiteral, l as USER_ID_HELPER, r as HELPERS, y as subjectIdSql } from "./shared-
|
|
23
|
-
import { E as TOKEN_SCOPE_ALLOWS, J as apiKeyFields, K as API_KEY_ALLOWS, R as globalRoleSource, _ as PERMISSION_HELPERS, at as memberForHelper, b as permissionKeysForHelper, bt as checkSuspension, ct as memberIdsHelper, dt as permittedForHelper, et as hasMemberFor, ft as permittedIdsHelper, g as OWNERSHIP, h as ASSIGNMENTS, lt as memberOfHelper, ot as memberForSources, rt as isTeamScope, st as memberForTable, tt as hasPermittedUsers, ut as memberRoleOf, v as checkName, vt as activeRowSql, x as permittedByPermissionHelper } from "./tables-
|
|
24
|
-
import { a as guardedTables, t as ownershipRules, u as roleNames } from "./ownership-
|
|
22
|
+
import { A as quoteQualified, D as qualified, F as firstScopeType, I as scopeTypeOf, O as quoteIdent, R as tenantTypeOf, a as customRolesOn, j as quoteTable, k as quoteLiteral, l as USER_ID_HELPER, r as HELPERS, y as subjectIdSql } from "./shared-sW3VYchq.js";
|
|
23
|
+
import { E as TOKEN_SCOPE_ALLOWS, J as apiKeyFields, K as API_KEY_ALLOWS, R as globalRoleSource, _ as PERMISSION_HELPERS, at as memberForHelper, b as permissionKeysForHelper, bt as checkSuspension, ct as memberIdsHelper, dt as permittedForHelper, et as hasMemberFor, ft as permittedIdsHelper, g as OWNERSHIP, h as ASSIGNMENTS, lt as memberOfHelper, ot as memberForSources, rt as isTeamScope, st as memberForTable, tt as hasPermittedUsers, ut as memberRoleOf, v as checkName, vt as activeRowSql, x as permittedByPermissionHelper } from "./tables-XrvffTMj.js";
|
|
24
|
+
import { a as guardedTables, t as ownershipRules, u as roleNames } from "./ownership-CeNOtQMV.js";
|
|
25
25
|
import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
|
|
26
26
|
import { a as splitUndiffed, r as tableKey, t as decidingColumns } from "./deciding-columns-NB4wcyBf.js";
|
|
27
|
-
import { c as ACTOR_MAY_WRITE, f as readOnlyActorKinds } from "./fields-
|
|
28
|
-
import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-
|
|
27
|
+
import { c as ACTOR_MAY_WRITE, f as readOnlyActorKinds } from "./fields-D_TfExiI.js";
|
|
28
|
+
import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-BIHnWL_L.js";
|
|
29
29
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
30
30
|
import { dirname, join, posix, resolve } from "node:path";
|
|
31
31
|
//#region ../../node_modules/.pnpm/smol-toml@1.9.1/node_modules/smol-toml/dist/error.js
|
|
@@ -3326,7 +3326,12 @@ as $$
|
|
|
3326
3326
|
insert into ${versionTable} as v (user_id, version)
|
|
3327
3327
|
select distinct u, 1 from unnest(p_users) u
|
|
3328
3328
|
where u is not null and exists (select 1 from auth.users au where au.id = u)
|
|
3329
|
-
on conflict (user_id) do update set version = v.version + 1
|
|
3329
|
+
on conflict (user_id) do update set version = v.version + 1;
|
|
3330
|
+
select set_config(
|
|
3331
|
+
'permdock.m.gen',
|
|
3332
|
+
(coalesce(nullif(current_setting('permdock.m.gen', true), ''), '0')::int + 1)::text,
|
|
3333
|
+
true
|
|
3334
|
+
)
|
|
3330
3335
|
$$;
|
|
3331
3336
|
revoke execute on function ${bumpFor}(uuid[]) from public, anon, authenticated;
|
|
3332
3337
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as runSupabase } from "./supabase-hook-BUcu3vPM.js";
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { c as listPermissions, u as renamedKeys } from "./permission-registry-B8tYxPIt.js";
|
|
2
|
-
import { d as scopeList, s as resolveScope } from "./scopes-BSdYaGHs.js";
|
|
2
|
+
import { d as scopeList, l as scopeChain, s as resolveScope } from "./scopes-BSdYaGHs.js";
|
|
3
3
|
import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
|
|
4
4
|
import { l as policyLevels } from "./policy-CaAME-Rh.js";
|
|
5
5
|
import { a as describeError, i as configError } from "./errors-BhRkoNS7.js";
|
|
6
6
|
import "./budget-BBCPDOGP.js";
|
|
7
7
|
import { d as sqlTextArray, i as qualifySqlTable } from "./sql-0WjxIp9g.js";
|
|
8
|
+
import { a as scopeMembershipTable, i as scopeColumn } from "./compile-B_oJqmIg.js";
|
|
8
9
|
import { l as roleColumn } from "./sources-C4vkzZJV.js";
|
|
9
10
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
10
11
|
import { c as parseSplit } from "./output-files-CM0BnH05.js";
|
|
11
|
-
import { x as resolveAuthorize } from "./supabase-hook-
|
|
12
|
-
import { A as quoteQualified, C as parseMembershipsFlag, D as qualified, F as firstScopeType, O as quoteIdent, R as tenantTypeOf, a as customRolesOn, j as quoteTable, k as quoteLiteral, s as signedIn, t as CUSTOM_ROLES } from "./shared-
|
|
13
|
-
import { G as byKey, H as rolesTableScope, O as tokenScopesPlan, Q as graphSqlName, V as raiseSql, W as byCodeUnit, Y as apiKeysPlan, a as closureDepths, bt as checkSuspension, i as tablelessResources, o as graphPlan, r as tableNames, t as resolveVias, z as currentKeyExpr } from "./tables-
|
|
14
|
-
import { o as assignableRoles, r as unsatisfiedKinds, t as ownershipRules, u as roleNames } from "./ownership-
|
|
12
|
+
import { x as resolveAuthorize } from "./supabase-hook-BUcu3vPM.js";
|
|
13
|
+
import { A as quoteQualified, C as parseMembershipsFlag, D as qualified, F as firstScopeType, O as quoteIdent, R as tenantTypeOf, a as customRolesOn, j as quoteTable, k as quoteLiteral, s as signedIn, t as CUSTOM_ROLES } from "./shared-sW3VYchq.js";
|
|
14
|
+
import { G as byKey, H as rolesTableScope, O as tokenScopesPlan, Q as graphSqlName, V as raiseSql, W as byCodeUnit, Y as apiKeysPlan, a as closureDepths, bt as checkSuspension, i as tablelessResources, o as graphPlan, r as tableNames, t as resolveVias, z as currentKeyExpr } from "./tables-XrvffTMj.js";
|
|
15
|
+
import { o as assignableRoles, r as unsatisfiedKinds, t as ownershipRules, u as roleNames } from "./ownership-CeNOtQMV.js";
|
|
15
16
|
import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
|
|
16
17
|
import { i as group, o as sqlStatements } from "./deciding-columns-NB4wcyBf.js";
|
|
17
|
-
import { d as orSql, h as branchClauses } from "./fields-
|
|
18
|
-
import { t as resolveNames } from "./resolve-names-
|
|
19
|
-
import { m as tableFor } from "./verify-
|
|
18
|
+
import { d as orSql, h as branchClauses } from "./fields-D_TfExiI.js";
|
|
19
|
+
import { t as resolveNames } from "./resolve-names-BIHnWL_L.js";
|
|
20
|
+
import { m as tableFor } from "./verify-C0jGJrmb.js";
|
|
20
21
|
//#region src/cli/rls/custom-role-rebuild.ts
|
|
21
22
|
const PREFIX = "PermDock CLI";
|
|
22
23
|
/** A column of the roles-table row `r`. */
|
|
@@ -589,6 +590,62 @@ function roleMemberScopesOf(migrate) {
|
|
|
589
590
|
const scopes = [...new Set(Object.values(migrate?.helpers ?? {}).flatMap((helper) => helper.form === "role" ? [helper.scope] : []))].toSorted();
|
|
590
591
|
return scopes.length === 0 ? {} : { roleMemberScopes: scopes };
|
|
591
592
|
}
|
|
593
|
+
function sameMap(left, right) {
|
|
594
|
+
const keys = Object.keys(left);
|
|
595
|
+
return keys.length === Object.keys(right).length && keys.every((key) => left[key] === right[key]);
|
|
596
|
+
}
|
|
597
|
+
function sameRoleOne(mapped, source) {
|
|
598
|
+
if (!("column" in source)) return false;
|
|
599
|
+
if (typeof mapped === "string") return source.column === mapped && !("through" in source) && !("map" in source);
|
|
600
|
+
if ("map" in mapped) return source.column === mapped.column && "map" in source && sameMap(source.map, mapped.map);
|
|
601
|
+
const [ref, id] = Object.entries(mapped.on)[0] ?? [];
|
|
602
|
+
if (ref === void 0 || id === void 0 || !("through" in source)) return false;
|
|
603
|
+
return source.column === ref && qualifySqlTable(source.through.table) === qualifySqlTable(mapped.through) && source.through.id === id && source.through.column === mapped.column && source.through.on === void 0;
|
|
604
|
+
}
|
|
605
|
+
function isRoleList(role) {
|
|
606
|
+
return Array.isArray(role);
|
|
607
|
+
}
|
|
608
|
+
function isManifestRoleList(role) {
|
|
609
|
+
return Array.isArray(role);
|
|
610
|
+
}
|
|
611
|
+
function sameRole(mapped, source) {
|
|
612
|
+
if (isRoleList(mapped)) return isManifestRoleList(source) && source.length === mapped.length && mapped.every((role, index) => {
|
|
613
|
+
const item = source[index];
|
|
614
|
+
return item !== void 0 && sameRoleOne(role, item);
|
|
615
|
+
});
|
|
616
|
+
return isManifestRoleList(source) ? false : sameRoleOne(mapped, source);
|
|
617
|
+
}
|
|
618
|
+
function sameVia(mapped, source) {
|
|
619
|
+
if (mapped === void 0) return source === void 0;
|
|
620
|
+
if (source === void 0 || typeof mapped === "string") return false;
|
|
621
|
+
return "value" in source && source.value === mapped.value;
|
|
622
|
+
}
|
|
623
|
+
function sameSource(table, scope, scopes, source) {
|
|
624
|
+
const manifest = source.sql.manifest;
|
|
625
|
+
const column = scopeColumn(table, scopes, scope);
|
|
626
|
+
if (column === void 0) return false;
|
|
627
|
+
if (qualifySqlTable(manifest.table) !== qualifySqlTable(table.table) || manifest.user.column !== table.user || "through" in manifest.user || manifest.id.column !== column || !("value" in manifest.scope) || manifest.scope.value !== scope || manifest.disabledAt?.column !== table.disabledAt || manifest.expiresAt?.column !== table.expiresAt || !sameVia(table.via, manifest.via) || source.sql.stream?.guard !== void 0) return false;
|
|
628
|
+
for (const name of scopeChain(scopes, scope)) {
|
|
629
|
+
if (name === scope) continue;
|
|
630
|
+
const held = scopeColumn(table, scopes, name);
|
|
631
|
+
const within = manifest.within;
|
|
632
|
+
if (held !== (within !== void 0 && "columns" in within ? within.columns[name] : void 0)) return false;
|
|
633
|
+
}
|
|
634
|
+
return sameRole(table.role, manifest.role);
|
|
635
|
+
}
|
|
636
|
+
function claimsFirstFor(input, authorize, scopes, memberships) {
|
|
637
|
+
const hook = input.config.supabase?.hook;
|
|
638
|
+
if (input.dialect !== "supabase" || authorize !== "database" || hook === void 0 || hook.version === false || hook.suspension !== void 0 || hook.schema !== void 0) return;
|
|
639
|
+
let mapped = false;
|
|
640
|
+
for (const scope of scopes) {
|
|
641
|
+
const table = scopeMembershipTable(memberships, scopes, scope.name);
|
|
642
|
+
if (table === void 0) continue;
|
|
643
|
+
mapped = true;
|
|
644
|
+
const source = hook.memberships.find((item) => item.sql.scope === scope.name);
|
|
645
|
+
if (source === void 0 || !sameSource(table, scope.name, scopes, source)) return;
|
|
646
|
+
}
|
|
647
|
+
return mapped ? true : void 0;
|
|
648
|
+
}
|
|
592
649
|
/** `rls.customRoleWrites.requires` as permission keys, or why it names none. */
|
|
593
650
|
function writeRequirement(policy, requires) {
|
|
594
651
|
if (requires === void 0) return {};
|
|
@@ -649,6 +706,7 @@ function buildContext(input, policy, options) {
|
|
|
649
706
|
const memberSources = membershipSourcesOf(input.config).map((source) => guard === void 0 ? source : source.guarded?.(guard) ?? source);
|
|
650
707
|
const sources = authorize === "database" ? memberSources : void 0;
|
|
651
708
|
const scopes = scopeList(policy.scopes);
|
|
709
|
+
const claimsFirst = claimsFirstFor(input, authorize, scopes, memberships);
|
|
652
710
|
const suspension = checkSuspension(rls?.suspension, scopes);
|
|
653
711
|
const hookRoles = input.config.supabase?.hook?.roles;
|
|
654
712
|
const roles = rls?.roles ?? (hookRoles === false ? void 0 : hookRoles);
|
|
@@ -684,6 +742,7 @@ function buildContext(input, policy, options) {
|
|
|
684
742
|
inlineFunctions: input.inlineFunctions || rls?.inlineFunctions === true,
|
|
685
743
|
schema,
|
|
686
744
|
authorize,
|
|
745
|
+
...claimsFirst === void 0 ? {} : { claimsFirst },
|
|
687
746
|
roleClaim: rls?.roleClaim ?? "user_role",
|
|
688
747
|
tenantType: input.tenantType ?? firstScopeType(rls?.scopeTypes, scopes),
|
|
689
748
|
...rls?.scopeTypes === void 0 ? {} : { scopeTypes: rls.scopeTypes },
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { c as requiredPlans } from "../errors-OTE9u4Wk.js";
|
|
2
2
|
import { i as describe } from "../describe-DibQM6g-.js";
|
|
3
3
|
import { t as PermissionBoundaryState } from "../boundary-C9ck-3uK.js";
|
|
4
|
-
import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-
|
|
4
|
+
import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-CRQ5VrWR.js";
|
|
5
5
|
import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-L9UOwATg.js";
|
|
6
6
|
import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
|
|
7
|
-
import { i as ProtectedProps, n as ProtectedActionReadable, r as SveltePermDockOptions, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-
|
|
8
|
-
import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-
|
|
7
|
+
import { i as ProtectedProps, n as ProtectedActionReadable, r as SveltePermDockOptions, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-C3C9ien9.js";
|
|
8
|
+
import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-pEBMy94l.js";
|
|
9
9
|
import { Component } from "svelte";
|
|
10
10
|
//#region src/svelte/index.d.ts
|
|
11
11
|
export declare const Protected: Component<ProtectedProps>;
|
package/dist/svelte/runtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as DescribeMessages } from "../describe-DibQM6g-.js";
|
|
2
2
|
import { n as boundaryDigest, r as boundaryFallback, t as PermissionBoundaryState } from "../boundary-C9ck-3uK.js";
|
|
3
|
-
import { t as ClientStore } from "../store-
|
|
4
|
-
import { a as scopedFor, c as slotContent, i as ProtectedProps, o as viewFor, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-
|
|
3
|
+
import { t as ClientStore } from "../store-CRQ5VrWR.js";
|
|
4
|
+
import { a as scopedFor, c as slotContent, i as ProtectedProps, o as viewFor, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-C3C9ien9.js";
|
|
5
5
|
//#region src/svelte/context.d.ts
|
|
6
6
|
/** The provider's `defaults` and `messages`. */
|
|
7
7
|
type PermDockUi = {
|
package/dist/svelte/source.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { c as requiredPlans } from "../errors-OTE9u4Wk.js";
|
|
2
2
|
import { i as describe } from "../describe-DibQM6g-.js";
|
|
3
3
|
import { t as PermissionBoundaryState } from "../boundary-C9ck-3uK.js";
|
|
4
|
-
import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-
|
|
4
|
+
import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-CRQ5VrWR.js";
|
|
5
5
|
import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-L9UOwATg.js";
|
|
6
6
|
import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
|
|
7
|
-
import { i as ProtectedProps, n as ProtectedActionReadable, r as SveltePermDockOptions, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-
|
|
8
|
-
import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-
|
|
7
|
+
import { i as ProtectedProps, n as ProtectedActionReadable, r as SveltePermDockOptions, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-C3C9ien9.js";
|
|
8
|
+
import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-pEBMy94l.js";
|
|
9
9
|
import { Component } from "svelte";
|
|
10
10
|
//#region src/svelte/source.d.ts
|
|
11
11
|
export declare const Protected: Component<ProtectedProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as Policy, N as PolicyVocabulary, en as Snapshot, yr as Principal } from "../policy-types-BI9C5Sp5.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
3
|
import { a as OperationInput, t as Operation } from "../operations-Ci_rT6Uo.js";
|
|
4
|
-
import { a as PermDock } from "../permdock-
|
|
5
|
-
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-
|
|
6
|
-
import { a as ProtectTarget, i as PermDockHandlers, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-
|
|
4
|
+
import { a as PermDock } from "../permdock-CsrvbzHk.js";
|
|
5
|
+
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-Bfl-IrzZ.js";
|
|
6
|
+
import { a as ProtectTarget, i as PermDockHandlers, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-BlL-ZhHq.js";
|
|
7
7
|
import { RequestEvent } from "@sveltejs/kit";
|
|
8
8
|
//#region src/sveltekit/create.d.ts
|
|
9
9
|
/**
|
package/dist/sveltekit/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-CNMVJVD6.js";
|
|
2
|
-
import { n as guardedRoute, r as instanceRoute, t as fetchAdapter } from "../fetch-adapter-
|
|
2
|
+
import { n as guardedRoute, r as instanceRoute, t as fetchAdapter } from "../fetch-adapter-4EB3cLgB.js";
|
|
3
3
|
//#region src/sveltekit/create.ts
|
|
4
4
|
const route = {
|
|
5
5
|
context: (event) => event,
|