permdock 0.13.0 → 0.15.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.js +1 -1
- package/dist/{adoption-scan-oks22j9J.js → adoption-scan-DLel53Oa.js} +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.js +2 -2
- package/dist/{arazzo-BzVfXbhf.js → arazzo-CHK9NT6u.js} +1 -1
- package/dist/{arazzo-CBBIhC40.js → arazzo-CL8CZnpL.js} +1 -1
- package/dist/better-supabase/index.d.ts +20 -22
- package/dist/better-supabase/index.js +4 -16
- package/dist/better-supabase-Dirf_8Ec.js +72 -0
- package/dist/{casbin-C8r5trwy.js → casbin-DRFwgVIP.js} +1 -1
- package/dist/{casbin-BunKq48W.js → casbin-iAEXjmca.js} +1 -1
- package/dist/claude-agent/index.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/{cloud-C_Mau1q2.js → cloud-eOtmuonF.js} +1 -1
- package/dist/{codemod-BqYPToUJ.js → codemod-D6NYu4AK.js} +2 -2
- package/dist/{codemod-CpMCbp0G.js → codemod-KEDj_3zl.js} +1 -1
- package/dist/{collect-D9Tt0Bcx.js → collect-DnXL4B8c.js} +1 -1
- package/dist/{completion-Cq4fbT2S.js → completion-DCza8aQY.js} +1 -1
- package/dist/{config-0xxCmoD8.js → config-BAM3a3z8.js} +1 -1
- package/dist/{config-BR23fL8m.js → config-CcLlvEYW.js} +4 -1
- package/dist/{config-report-C1-r59VY.js → config-report-VZcQ0ZpS.js} +1 -1
- package/dist/{create-6EwRQlig.js → create-Coq5fIrq.js} +1 -1
- package/dist/{diff-BwR1JdP2.js → diff-CxtbOi2l.js} +1 -1
- package/dist/{diff-CQegtBAo.js → diff-DfmYaIhB.js} +1 -1
- package/dist/{doctor-CDfzrMQB.js → doctor-CMqPKuN_.js} +16 -49
- package/dist/{doctor-Dea6IqRw.js → doctor-gIO9WTYo.js} +2 -2
- package/dist/eve/index.js +1 -1
- package/dist/{fixtures-A1_sp_tR.js → fixtures-Bm4_K1ke.js} +7 -9
- package/dist/{import-PP7uH8rC.js → import-DK_J8tVE.js} +1 -1
- package/dist/{init-n1gkKHvc.js → init-Buibrl9h.js} +3 -3
- package/dist/{init-BuUt4bLJ.js → init-jLSyPMM7.js} +1 -1
- package/dist/{kernel-qv4cr9w8.js → kernel-BD8QuMnv.js} +9 -2
- package/dist/{login-YsrgkAQo.js → login-CB55O4Gv.js} +1 -1
- package/dist/{login-DyQNWJok.js → login-VVpkkund.js} +3 -3
- package/dist/{manifest-Cl6yHiVK.js → manifest-CbEyvPN2.js} +33 -33
- package/dist/mcp/index.d.ts +21 -3
- package/dist/mcp/index.js +87 -16
- package/dist/next/plugin.js +1 -1
- package/dist/openai/index.js +2 -2
- package/dist/{openapi-D8JQtO8k.js → openapi-CleDZYVf.js} +1 -1
- package/dist/{openapi-BFyBIe9J.js → openapi-eHZ5hwUJ.js} +2 -2
- package/dist/{output-DpCUAST3.js → output-BVZpQDad.js} +1 -1
- package/dist/{powersync-Bm3ZjHwD.js → powersync-CFWILHjb.js} +2 -2
- package/dist/powersync-CnGzxvEl.js +1 -0
- package/dist/{powersync-BTLk8GSl.js → powersync-uqYWxTjq.js} +126 -39
- package/dist/{pull-iVPQZsnI.js → pull-BBmCxnqX.js} +1 -1
- package/dist/pull-D6dloyrc.js +1 -0
- package/dist/react-native/index.d.ts +21 -8
- package/dist/react-native/index.js +103 -17
- package/dist/{rls-BItB4vkC.js → rls-BwKXdVEW.js} +5 -5
- package/dist/{rls-C8nxX0RV.js → rls-yK2nZUcm.js} +1 -1
- package/dist/{run-CjFdAzqE.js → run-D5WIJfs7.js} +3 -3
- package/dist/run-DlQYPtPv.js +1 -0
- package/dist/{scan-COIQvTMg.js → scan-CzdMtHnq.js} +1 -1
- package/dist/{schema-CeQZY6bO.js → schema-BDGEVO4g.js} +1 -1
- package/dist/{skills-CfkYP7GG.js → skills-BIsm1n26.js} +1 -1
- package/dist/{skills-5XWpNzCi.js → skills-BZxPQ_09.js} +1 -1
- package/dist/supabase/index.js +1 -1
- package/dist/{supabase-CBEK6KEo.js → supabase-DYWnT800.js} +2 -2
- package/dist/{supabase-hook-CyuD9Wau.js → supabase-hook-HPgwYb9V.js} +2 -2
- package/dist/supabase-hook-qsewAVZY.js +1 -0
- package/dist/{supautils-PRhfO-bL.js → supautils-CGk4YpvC.js} +16 -5
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/unplugin/index.js +1 -1
- package/dist/usage-D3KJyaNS.js +1 -0
- package/dist/{usage-BfzSfOpD.js → usage-DBNrpwoT.js} +1 -1
- package/dist/{usage-hMYVFsN5.js → usage-e6M1Mls1.js} +2 -2
- package/dist/{verify-CmTiQ-yM.js → verify-CgIpJRcG.js} +3 -3
- package/dist/watch-CuPz0D2M.js +1 -0
- package/dist/{watch-Bpci3hBY.js → watch-DAkjm75Y.js} +1 -1
- package/package.json +16 -16
- package/skills/permdock-credentials/references/tokens-keys-links.md +1 -1
- package/skills/permdock-wire/references/adapters.md +1 -1
- package/dist/powersync-CObULVRk.js +0 -1
- package/dist/pull-3OQCgxUf.js +0 -1
- package/dist/run-BqW8S5TM.js +0 -1
- package/dist/supabase-hook-CWvEpdCh.js +0 -1
- package/dist/usage-BDiTP763.js +0 -1
- package/dist/watch-COuvly20.js +0 -1
- package/dist/{core-DzVINFbU.js → core-lxoANyai.js} +1 -1
- package/dist/{supabase-CC6rIri4.js → supabase-CDHMsDD0.js} +1 -1
|
@@ -115,15 +115,28 @@ type PowerSyncSourceOptions<Q extends string> = {
|
|
|
115
115
|
readonly read?: undefined;
|
|
116
116
|
};
|
|
117
117
|
/**
|
|
118
|
-
* A `localSnapshot` source over a PowerSync database: `get` runs
|
|
119
|
-
* with `db.getAll
|
|
120
|
-
* `queries` and `read`, it reads the tables `manifest.rows`
|
|
121
|
-
* memberships of every source with null roles dropped, the global
|
|
122
|
-
* custom roles with their levels. A watch result with unchanged
|
|
123
|
-
* re-renders nothing (`connectSource`). The source takes the database
|
|
124
|
-
* argument; `permdock/react-native` never imports `@powersync/*`.
|
|
118
|
+
* A `localSnapshot` source over a PowerSync database: `get` initially runs
|
|
119
|
+
* every query with `db.getAll`; watch-triggered reads refresh only fired
|
|
120
|
+
* queries. Without `queries` and `read`, it reads the tables `manifest.rows`
|
|
121
|
+
* names: the memberships of every source with null roles dropped, the global
|
|
122
|
+
* roles and the custom roles with their levels. A watch result with unchanged
|
|
123
|
+
* content re-renders nothing (`connectSource`). The source takes the database
|
|
124
|
+
* as an argument; `permdock/react-native` never imports `@powersync/*`.
|
|
125
125
|
*/
|
|
126
126
|
export declare function powerSyncSource<Q extends string>(db: PowerSyncWatchable, options: PowerSyncSourceOptions<Q>): SnapshotSource;
|
|
127
|
+
/** `powerSyncSource` over one database, memoised per manifest and options. */
|
|
128
|
+
type PowerSyncSourceCache = {
|
|
129
|
+
readonly source: <Q extends string>(options: PowerSyncSourceOptions<Q>) => SnapshotSource;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* A cache of `powerSyncSource` sources over `db`. `source` answers the same
|
|
133
|
+
* source for the same `manifest` object and, with `user`, the same `user`,
|
|
134
|
+
* `tenant` and `attributes` content, or, with `queries`, the same `queries` and
|
|
135
|
+
* `read` objects. A render that rebuilds its options then keeps the source, so
|
|
136
|
+
* `PermDockProvider` neither resubscribes nor rereads. Entries live as long as
|
|
137
|
+
* their manifest; create one cache per database, outside render.
|
|
138
|
+
*/
|
|
139
|
+
export declare function powerSyncSourceCache(db: PowerSyncWatchable): PowerSyncSourceCache;
|
|
127
140
|
//#endregion
|
|
128
141
|
//#region src/react-native/provider.d.ts
|
|
129
142
|
export declare function PermDockProvider(props: ReactNativePermDockProviderProps): ReactElement;
|
|
@@ -209,4 +222,4 @@ type NativeStoreOptions = Omit<ReactNativePermDockProviderProps, "children" | "h
|
|
|
209
222
|
export declare function connectSource(store: ClientStore, source: SnapshotSource, subscribeForeground?: SubscribeForeground): () => void;
|
|
210
223
|
export declare function nativeStore(options: NativeStoreOptions): ClientStore;
|
|
211
224
|
//#endregion
|
|
212
|
-
export { type ActionResult, type AppStateModule, type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type LocalMembershipRows, type LocalRowColumn, type LocalRowValue, type LocalSnapshotData, type LocalSnapshotManifest, type LocalSnapshotOptions, type LocalSnapshotRows, type MmkvInstance, type NativeRevalidate, type NetInfoModule, type PermDockDefaults, type PermissionSet, type PermissionState, type PowerSyncQuery, type PowerSyncSourceOptions, type PowerSyncWatchable, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type ReactNativePermDockProviderProps, type RefreshTrigger, type RolesOptions, type SecureStoreModule, type SnapshotSource, type SnapshotStorage, type SubjectView, type SubscribeForeground, type SubscribeOnline, type TenantView, approvalHeaders, describe, eventSourceRefresh, parseLocalSnapshotManifest, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRoles, useSubject, useTenant };
|
|
225
|
+
export { type ActionResult, type AppStateModule, type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type LocalMembershipRows, type LocalRowColumn, type LocalRowValue, type LocalSnapshotData, type LocalSnapshotManifest, type LocalSnapshotOptions, type LocalSnapshotRows, type MmkvInstance, type NativeRevalidate, type NetInfoModule, type PermDockDefaults, type PermissionSet, type PermissionState, type PowerSyncQuery, type PowerSyncSourceCache, type PowerSyncSourceOptions, type PowerSyncWatchable, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type ReactNativePermDockProviderProps, type RefreshTrigger, type RolesOptions, type SecureStoreModule, type SnapshotSource, type SnapshotStorage, type SubjectView, type SubscribeForeground, type SubscribeOnline, type TenantView, approvalHeaders, describe, eventSourceRefresh, parseLocalSnapshotManifest, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRoles, useSubject, useTenant };
|
|
@@ -535,32 +535,118 @@ function planOf(options) {
|
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
538
|
-
* A `localSnapshot` source over a PowerSync database: `get` runs
|
|
539
|
-
* with `db.getAll
|
|
540
|
-
* `queries` and `read`, it reads the tables `manifest.rows`
|
|
541
|
-
* memberships of every source with null roles dropped, the global
|
|
542
|
-
* custom roles with their levels. A watch result with unchanged
|
|
543
|
-
* re-renders nothing (`connectSource`). The source takes the database
|
|
544
|
-
* argument; `permdock/react-native` never imports `@powersync/*`.
|
|
538
|
+
* A `localSnapshot` source over a PowerSync database: `get` initially runs
|
|
539
|
+
* every query with `db.getAll`; watch-triggered reads refresh only fired
|
|
540
|
+
* queries. Without `queries` and `read`, it reads the tables `manifest.rows`
|
|
541
|
+
* names: the memberships of every source with null roles dropped, the global
|
|
542
|
+
* roles and the custom roles with their levels. A watch result with unchanged
|
|
543
|
+
* content re-renders nothing (`connectSource`). The source takes the database
|
|
544
|
+
* as an argument; `permdock/react-native` never imports `@powersync/*`.
|
|
545
545
|
*/
|
|
546
546
|
function powerSyncSource(db, options) {
|
|
547
547
|
const plan = planOf(options);
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
548
|
+
const queries = Object.entries(plan.queries);
|
|
549
|
+
const rows = /* @__PURE__ */ new Map();
|
|
550
|
+
const dirty = /* @__PURE__ */ new Set();
|
|
551
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
552
|
+
let scheduled = false;
|
|
553
|
+
let pending;
|
|
554
|
+
let snapshot;
|
|
555
|
+
let content;
|
|
556
|
+
const invalidate = (name) => {
|
|
557
|
+
dirty.add(name);
|
|
558
|
+
if (scheduled) return;
|
|
559
|
+
scheduled = true;
|
|
560
|
+
queueMicrotask(() => {
|
|
561
|
+
scheduled = false;
|
|
562
|
+
for (const listener of listeners) listener();
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
const read = async () => {
|
|
566
|
+
if (dirty.size === 0) for (const [name] of queries) dirty.add(name);
|
|
567
|
+
do {
|
|
568
|
+
const selected = queries.filter(([name]) => dirty.has(name) || !rows.has(name));
|
|
569
|
+
for (const [name] of selected) dirty.delete(name);
|
|
570
|
+
try {
|
|
571
|
+
const results = await Promise.all(selected.map(async ([name, query]) => [name, await db.getAll(query.sql, [...query.parameters ?? []])]));
|
|
572
|
+
for (const [name, result] of results) rows.set(name, result);
|
|
573
|
+
} catch (error) {
|
|
574
|
+
for (const [name] of selected) dirty.add(name);
|
|
575
|
+
throw error;
|
|
576
|
+
}
|
|
577
|
+
} while (dirty.size > 0);
|
|
578
|
+
const data = plan.read(Object.fromEntries(rows));
|
|
579
|
+
const next = JSON.stringify([data, data.principal?.memberships?.map((membership) => isMembershipExpired(membership))]);
|
|
580
|
+
if (snapshot === void 0 || next !== content) {
|
|
581
|
+
snapshot = buildLocalSnapshot(options.manifest, data);
|
|
582
|
+
content = next;
|
|
583
|
+
}
|
|
584
|
+
return snapshot;
|
|
585
|
+
};
|
|
586
|
+
return {
|
|
587
|
+
get: () => {
|
|
588
|
+
pending ??= read().finally(() => {
|
|
589
|
+
pending = void 0;
|
|
590
|
+
});
|
|
591
|
+
return pending;
|
|
555
592
|
},
|
|
556
593
|
subscribe: (listener) => {
|
|
594
|
+
listeners.add(listener);
|
|
557
595
|
const controller = new AbortController();
|
|
558
|
-
for (const query of
|
|
596
|
+
for (const [name, query] of queries) db.watch(query.sql, [...query.parameters ?? []], { onResult: () => {
|
|
597
|
+
invalidate(name);
|
|
598
|
+
} }, { signal: controller.signal });
|
|
559
599
|
return () => {
|
|
600
|
+
listeners.delete(listener);
|
|
560
601
|
controller.abort();
|
|
561
602
|
};
|
|
562
603
|
}
|
|
563
|
-
}
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* A cache of `powerSyncSource` sources over `db`. `source` answers the same
|
|
608
|
+
* source for the same `manifest` object and, with `user`, the same `user`,
|
|
609
|
+
* `tenant` and `attributes` content, or, with `queries`, the same `queries` and
|
|
610
|
+
* `read` objects. A render that rebuilds its options then keeps the source, so
|
|
611
|
+
* `PermDockProvider` neither resubscribes nor rereads. Entries live as long as
|
|
612
|
+
* their manifest; create one cache per database, outside render.
|
|
613
|
+
*/
|
|
614
|
+
function powerSyncSourceCache(db) {
|
|
615
|
+
const byManifest = /* @__PURE__ */ new WeakMap();
|
|
616
|
+
return Object.freeze({ source: (options) => {
|
|
617
|
+
let entries = byManifest.get(options.manifest);
|
|
618
|
+
if (entries === void 0) {
|
|
619
|
+
entries = {
|
|
620
|
+
rows: /* @__PURE__ */ new Map(),
|
|
621
|
+
custom: /* @__PURE__ */ new WeakMap()
|
|
622
|
+
};
|
|
623
|
+
byManifest.set(options.manifest, entries);
|
|
624
|
+
}
|
|
625
|
+
if ("user" in options) {
|
|
626
|
+
const key = JSON.stringify([
|
|
627
|
+
options.user,
|
|
628
|
+
options.tenant ?? null,
|
|
629
|
+
options.attributes ?? null
|
|
630
|
+
]);
|
|
631
|
+
let source = entries.rows.get(key);
|
|
632
|
+
if (source === void 0) {
|
|
633
|
+
source = powerSyncSource(db, options);
|
|
634
|
+
entries.rows.set(key, source);
|
|
635
|
+
}
|
|
636
|
+
return source;
|
|
637
|
+
}
|
|
638
|
+
let byRead = entries.custom.get(options.queries);
|
|
639
|
+
if (byRead === void 0) {
|
|
640
|
+
byRead = /* @__PURE__ */ new WeakMap();
|
|
641
|
+
entries.custom.set(options.queries, byRead);
|
|
642
|
+
}
|
|
643
|
+
let source = byRead.get(options.read);
|
|
644
|
+
if (source === void 0) {
|
|
645
|
+
source = powerSyncSource(db, options);
|
|
646
|
+
byRead.set(options.read, source);
|
|
647
|
+
}
|
|
648
|
+
return source;
|
|
649
|
+
} });
|
|
564
650
|
}
|
|
565
651
|
//#endregion
|
|
566
652
|
//#region src/react-native/storage.ts
|
|
@@ -1040,4 +1126,4 @@ function netInfoOnline(netInfo) {
|
|
|
1040
1126
|
});
|
|
1041
1127
|
}
|
|
1042
1128
|
//#endregion
|
|
1043
|
-
export { PermDockProvider, Protected, appStateForeground, approvalHeaders, buildLocalSnapshot, connectSource, describe, eventSourceRefresh, localSnapshot, memorySnapshotStorage, mmkvStorage, nativeStore, netInfoOnline, parseLocalSnapshotManifest, powerSyncSource, requiredPlans, secureStoreStorage, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissionGuard, usePermissions, useProtectedAction, useRoles, useSnapshotReady, useSubject, useTenant };
|
|
1129
|
+
export { PermDockProvider, Protected, appStateForeground, approvalHeaders, buildLocalSnapshot, connectSource, describe, eventSourceRefresh, localSnapshot, memorySnapshotStorage, mmkvStorage, nativeStore, netInfoOnline, parseLocalSnapshotManifest, powerSyncSource, powerSyncSourceCache, requiredPlans, secureStoreStorage, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissionGuard, usePermissions, useProtectedAction, useRoles, useSnapshotReady, useSubject, useTenant };
|
|
@@ -11,13 +11,13 @@ import "./sources-C4vkzZJV.js";
|
|
|
11
11
|
import { t as policyFromCatalog } from "./policy-from-catalog-CU3An8uP.js";
|
|
12
12
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
13
13
|
import { i as INDEXES_MARKER, n as GRANTS_MARKER, o as SEEDS_MARKER, t as BACKFILL_MARKER } from "./markers-BeHZ4x9Q.js";
|
|
14
|
-
import { a as nonEmptyOr } from "./output-
|
|
14
|
+
import { a as nonEmptyOr } from "./output-BVZpQDad.js";
|
|
15
15
|
import { i as requirePeer, n as packageManagerOf, t as addLine } from "./peer-Q0fuZ6hx.js";
|
|
16
16
|
import { t as POLICY_NOT_PUBLISHED } from "./problem-types-DSsRfONQ.js";
|
|
17
|
-
import { t as fetchProjectPolicy } from "./pull-
|
|
17
|
+
import { t as fetchProjectPolicy } from "./pull-BBmCxnqX.js";
|
|
18
18
|
import { n as MIGRATION_DIRS } from "./constants-DcJABbLW.js";
|
|
19
19
|
import { a as isSeedsDirectory, c as parseSplit, d as seedsMigration, f as writeOutputFiles, l as partPath, n as dataMigrationFile, r as driftOf, u as pgDeltaPath } from "./output-files-BIQ_9pIs.js";
|
|
20
|
-
import { b as rbacScaffold, d as resolveSchemas, f as schemasRefusal, o as supabaseHookSql, p as declarativeSql, s as approvalsSql, t as grantsLabel, u as isSupabaseSchemas, y as parseRbacAuthorize } from "./supabase-hook-
|
|
20
|
+
import { b as rbacScaffold, d as resolveSchemas, f as schemasRefusal, o as supabaseHookSql, p as declarativeSql, s as approvalsSql, t as grantsLabel, u as isSupabaseSchemas, y as parseRbacAuthorize } from "./supabase-hook-HPgwYb9V.js";
|
|
21
21
|
import { A as quoteQualified, D as qualified$1, I as scopeTypeOf, O as quoteIdent$1, _ as subjectClaimJsonSql, c as SESSION_LIVE_HELPER, g as sessionLiveHelperSql, j as quoteTable, k as quoteLiteral, r as HELPERS, t as CUSTOM_ROLES, y as subjectIdSql } from "./shared-DrGLwM3s.js";
|
|
22
22
|
import { C as accessSql, G as byKey, T as seedSql, Z as graphHelper, ct as memberIdsHelper, ft as permittedIdsHelper, ht as scopeTable, mt as scopeSources, r as tableNames, s as graphSql, w as helpersSql, x as permittedByPermissionHelper, y as permissionHelpersSql } from "./tables-DimBcVWY.js";
|
|
23
23
|
import { c as breakGlassKey, i as assignmentSql, l as collectGrants, n as ownershipSql, s as breakGlassHolder } from "./ownership-qqBuGJXr.js";
|
|
@@ -25,8 +25,8 @@ import { a as splitUndiffed } from "./deciding-columns-NB4wcyBf.js";
|
|
|
25
25
|
import { t as connectPgPool } from "./pg-DQTqRrou.js";
|
|
26
26
|
import { a as fieldViewsSql, c as ACTOR_MAY_WRITE, f as readOnlyActorKinds, i as fieldViews, l as actorMayWriteSql, n as columnGrantSql, o as rowBranches, p as readOnlyActorPolicies, r as columnRevokeSql, u as assemblePolicies } from "./fields-DI8s3cPl.js";
|
|
27
27
|
import { n as permissionHoldersSql } from "./resolve-names-Y1Cb22cp.js";
|
|
28
|
-
import { _ as indexTargets, a as verifyResult, b as readTableIndexFacts, c as callsHelper, g as INDEX_COLUMNS_SQL, h as COLUMNS_SQL, i as verifyIgnores, l as helperCallKeys, m as tableFor, n as runRlsVerify, o as HELPER_TABLES, p as compileGrants, r as rlsFinding, v as indexesSql, y as pruneIndexTargets } from "./verify-
|
|
29
|
-
import { a as buildContext, c as levelKeys, d as rebuildPlan, i as splitsPart, l as rowHelpersSql, n as generateOptions, o as CANDIDATES, r as isRefusal, s as inheritTargets, t as supautilsRejections, u as DROPPED_LIST } from "./supautils-
|
|
28
|
+
import { _ as indexTargets, a as verifyResult, b as readTableIndexFacts, c as callsHelper, g as INDEX_COLUMNS_SQL, h as COLUMNS_SQL, i as verifyIgnores, l as helperCallKeys, m as tableFor, n as runRlsVerify, o as HELPER_TABLES, p as compileGrants, r as rlsFinding, v as indexesSql, y as pruneIndexTargets } from "./verify-CgIpJRcG.js";
|
|
29
|
+
import { a as buildContext, c as levelKeys, d as rebuildPlan, i as splitsPart, l as rowHelpersSql, n as generateOptions, o as CANDIDATES, r as isRefusal, s as inheritTargets, t as supautilsRejections, u as DROPPED_LIST } from "./supautils-CGk4YpvC.js";
|
|
30
30
|
import { readFileSync } from "node:fs";
|
|
31
31
|
import { basename, delimiter, join } from "node:path";
|
|
32
32
|
import { spawn } from "node:child_process";
|
|
@@ -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-
|
|
195
|
+
return (await import("./rls-BwKXdVEW.js")).runRls(input);
|
|
196
196
|
}
|
|
197
197
|
const generate = defineLeaf({
|
|
198
198
|
flags: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as dateAt } from "./time-nR1JesoH.js";
|
|
2
2
|
import { a as describeError, l as problemOf, n as CliError, r as cliProblem, s as kindOfCode } from "./errors-Vpu6rKHl.js";
|
|
3
3
|
import { s as cliVersion } from "./version-DMQ0dnN5.js";
|
|
4
|
-
import { a as resolveCwd, i as readConfig } from "./config-
|
|
4
|
+
import { a as resolveCwd, i as readConfig } from "./config-CcLlvEYW.js";
|
|
5
5
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
6
6
|
import { a as suggestion, i as parseLeaf, n as flagSpellings, o as GLOBAL_FLAGS, r as parseFlags } from "./args-0FrVs5EH.js";
|
|
7
7
|
import { r as progressReporter, t as redact } from "./credentials-CdDxp7jN.js";
|
|
8
|
-
import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-
|
|
8
|
+
import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
|
|
9
9
|
import { t as createStyle } from "./style-Ds11Hmk4.js";
|
|
10
|
-
import { i as githubAnnotations, n as envelope, o as sarifLog, t as dataOf } from "./output-
|
|
10
|
+
import { i as githubAnnotations, n as envelope, o as sarifLog, t as dataOf } from "./output-BVZpQDad.js";
|
|
11
11
|
import { i as renameMessage, r as flagRename, t as COMMAND_MOVES } from "./renames-CGj7YwcQ.js";
|
|
12
12
|
import { stripVTControlCharacters } from "node:util";
|
|
13
13
|
import { existsSync, statSync } from "node:fs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as run } from "./run-D5WIJfs7.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-
|
|
19
|
+
const { runAdoptionScan } = await import("./adoption-scan-DLel53Oa.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 { r as isRecord } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { l as packageRoot } from "./version-DMQ0dnN5.js";
|
|
3
3
|
import { t as DRAFT_PINS } from "./pins-nqarl3oE.js";
|
|
4
|
-
import { a as nonEmptyOr } from "./output-
|
|
4
|
+
import { a as nonEmptyOr } from "./output-BVZpQDad.js";
|
|
5
5
|
import { t as require__2020 } from "./2020-CJbO8Bvz.js";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as defineLeaf } from "./command-L8EstFNm.js";
|
|
2
2
|
import { t as checkFlag } from "./flags-DXjoTVbS.js";
|
|
3
3
|
import { r as pick, t as CANCELLED } from "./prompt-BYc6drYW.js";
|
|
4
|
-
import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-
|
|
4
|
+
import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-BZxPQ_09.js";
|
|
5
5
|
//#region src/cli/commands/skills.ts
|
|
6
6
|
const forFlag = { for: {
|
|
7
7
|
type: "string",
|
|
@@ -2,7 +2,7 @@ import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
|
2
2
|
import { i as readJsonFile } from "./files-BSjrtIHw.js";
|
|
3
3
|
import { l as packageRoot } from "./version-DMQ0dnN5.js";
|
|
4
4
|
import { t as didYouMean } from "./args-0FrVs5EH.js";
|
|
5
|
-
import { a as nonEmptyOr } from "./output-
|
|
5
|
+
import { a as nonEmptyOr } from "./output-BVZpQDad.js";
|
|
6
6
|
import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
8
8
|
import { pathToFileURL } from "node:url";
|
package/dist/supabase/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as supabaseClaims, i as supabaseApprovalStore, n as supabaseRls, o as exchangeCapability, r as tableApprovalDelegationSource, t as authorizeSql } from "../supabase-CC6rIri4.js";
|
|
2
1
|
import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-BELja5A9.js";
|
|
2
|
+
import { a as supabaseClaims, i as supabaseApprovalStore, n as supabaseRls, o as exchangeCapability, r as tableApprovalDelegationSource, t as authorizeSql } from "../supabase-CDHMsDD0.js";
|
|
3
3
|
import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-C4vkzZJV.js";
|
|
4
4
|
import { a as delegationOf, c as subjectFromSupabaseSession, i as actorOf, n as postgrestSources, r as readSubjectRecord, s as subjectFromSupabase } from "../postgrest-DAxFltvO.js";
|
|
5
5
|
import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-BXTbHNIV.js";
|
|
@@ -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-qsewAVZY.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-qsewAVZY.js");
|
|
80
80
|
return runSupabase({
|
|
81
81
|
cwd: ctx.cwd,
|
|
82
82
|
config: ctx.config,
|
|
@@ -6,10 +6,10 @@ import { a as describeError, i as configError } from "./errors-Vpu6rKHl.js";
|
|
|
6
6
|
import { i as readJsonFile, o as sqlFiles, s as writeFileEnsuringDir } from "./files-BSjrtIHw.js";
|
|
7
7
|
import { a as SUPABASE_MANIFEST_SCHEMA } from "./version-DMQ0dnN5.js";
|
|
8
8
|
import { c as requirePolicy } from "./load-DjSU5KXO.js";
|
|
9
|
+
import "./budget-BELja5A9.js";
|
|
9
10
|
import { i as qualifySqlTable } from "./sql-0WjxIp9g.js";
|
|
10
11
|
import { i as scopeColumn } from "./compile-EzEMB-7v.js";
|
|
11
|
-
import { t as authorizeSql } from "./supabase-
|
|
12
|
-
import "./budget-BELja5A9.js";
|
|
12
|
+
import { t as authorizeSql } from "./supabase-CDHMsDD0.js";
|
|
13
13
|
import { a as hookApiNames, d as keptKeys, t as AUTHZ_VERSION_TABLE, u as roleManifest } from "./sources-C4vkzZJV.js";
|
|
14
14
|
import { o as readMemberships } from "./postgrest-DAxFltvO.js";
|
|
15
15
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as runSupabase } from "./supabase-hook-HPgwYb9V.js";
|
|
@@ -3,12 +3,12 @@ import { f as scopeList, s as resolveScope } from "./scopes-0Up_UA2t.js";
|
|
|
3
3
|
import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
|
|
4
4
|
import { l as policyLevels } from "./policy-CLQ8__GF.js";
|
|
5
5
|
import { a as describeError, i as configError } from "./errors-Vpu6rKHl.js";
|
|
6
|
-
import { d as sqlTextArray, i as qualifySqlTable } from "./sql-0WjxIp9g.js";
|
|
7
6
|
import "./budget-BELja5A9.js";
|
|
7
|
+
import { d as sqlTextArray, i as qualifySqlTable } from "./sql-0WjxIp9g.js";
|
|
8
8
|
import { l as roleColumn } from "./sources-C4vkzZJV.js";
|
|
9
9
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
10
10
|
import { c as parseSplit } from "./output-files-BIQ_9pIs.js";
|
|
11
|
-
import { x as resolveAuthorize } from "./supabase-hook-
|
|
11
|
+
import { x as resolveAuthorize } from "./supabase-hook-HPgwYb9V.js";
|
|
12
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-DrGLwM3s.js";
|
|
13
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-DimBcVWY.js";
|
|
14
14
|
import { o as assignableRoles, r as unsatisfiedKinds, t as ownershipRules, u as roleNames } from "./ownership-qqBuGJXr.js";
|
|
@@ -16,7 +16,7 @@ import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
|
|
|
16
16
|
import { i as group, o as sqlStatements } from "./deciding-columns-NB4wcyBf.js";
|
|
17
17
|
import { d as orSql, h as branchClauses } from "./fields-DI8s3cPl.js";
|
|
18
18
|
import { t as resolveNames } from "./resolve-names-Y1Cb22cp.js";
|
|
19
|
-
import { m as tableFor } from "./verify-
|
|
19
|
+
import { m as tableFor } from "./verify-CgIpJRcG.js";
|
|
20
20
|
//#region src/cli/rls/custom-role-rebuild.ts
|
|
21
21
|
const PREFIX = "PermDock CLI";
|
|
22
22
|
/** A column of the roles-table row `r`. */
|
|
@@ -199,8 +199,8 @@ const DROPPED_LIST = `(select string_agg(g.role || ': ' || g.items, '; ' order b
|
|
|
199
199
|
* shared role holds is skipped with a warning (`name-taken`). Before-row
|
|
200
200
|
* triggers hold a signed-in caller at trigger depth 1 to the checks of
|
|
201
201
|
* `permdock_replace_custom_role_grants`: `permdock_custom_role_guard` on each
|
|
202
|
-
* role the row names,
|
|
203
|
-
* a refusal aborts the write.
|
|
202
|
+
* role the row names, the entry it adds against the ceiling, then
|
|
203
|
+
* `permdock_custom_role_beyond` on that entry; a refusal aborts the write.
|
|
204
204
|
*/
|
|
205
205
|
function customRoleSyncSql(ctx, from, migrate) {
|
|
206
206
|
const plan = rebuildPlan(ctx, from, migrate);
|
|
@@ -305,6 +305,17 @@ begin
|
|
|
305
305
|
end if;
|
|
306
306
|
v_dropped := '{}'::text[];
|
|
307
307
|
${plan.collectNew[name]}
|
|
308
|
+
if cardinality(v_dropped) > 0 then
|
|
309
|
+
raise exception using
|
|
310
|
+
errcode = '22023',
|
|
311
|
+
message = 'permdock: ' || v_dropped[1],
|
|
312
|
+
hint = case
|
|
313
|
+
when v_dropped[1] like '%outside the ceiling of %' then 'outside-ceiling'
|
|
314
|
+
when v_dropped[1] like '%, level % is not declared' then 'unknown-level'
|
|
315
|
+
when v_dropped[1] like '%, not a declared role' then 'unknown-role'
|
|
316
|
+
else 'unknown-permission'
|
|
317
|
+
end;
|
|
318
|
+
end if;
|
|
308
319
|
select string_agg(b, ', ' order by b) into v_beyond
|
|
309
320
|
from ${beyond}(v.tenant_id, v.scope, v.scope_id, v_allow, v_deny, v_include) b;
|
|
310
321
|
if v_beyond is not null then
|
package/dist/testing/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as policyMatrix, t as testOrmParity, n as testRlsParity } from "../core-
|
|
1
|
+
export { r as policyMatrix, t as testOrmParity, n as testRlsParity } from "../core-lxoANyai.js";
|
|
@@ -512,7 +512,7 @@ var better_supabase_manifest_default = {
|
|
|
512
512
|
"schema": "permdock",
|
|
513
513
|
"function": "custom_access_token_hook",
|
|
514
514
|
"out": "supabase/schemas/permdock/functions/custom_access_token_hook.sql",
|
|
515
|
-
"activeFrom": { "appMetadata": "
|
|
515
|
+
"activeFrom": { "appMetadata": "tenant_id" },
|
|
516
516
|
"schemas": "pg-delta"
|
|
517
517
|
},
|
|
518
518
|
helpers: {
|
package/dist/testing/index.js
CHANGED
|
@@ -27,16 +27,16 @@ import { c as problemFromDecision } from "../problem-BVLHFK33.js";
|
|
|
27
27
|
import { o as resolveApproval } from "../helpers-DJicaG6f.js";
|
|
28
28
|
import { t as APPROVAL_REQUEST_SCHEMA } from "../request-schema-DhX7UbfQ.js";
|
|
29
29
|
import { t as catalogSchema } from "../schema-BOJjqlWL.js";
|
|
30
|
+
import { t as supabaseMembershipsBudget } from "../budget-BELja5A9.js";
|
|
30
31
|
import { c as parseApiKey } from "../server-3cVlTLde.js";
|
|
31
32
|
import { n as discoverAuthorizationServer } from "../device-BwbJNmb2.js";
|
|
32
33
|
import { t as CONNECTOR_SCHEMA } from "../connector-schema-CYLQNMYq.js";
|
|
33
34
|
import { l as sha256Hex, n as scimHandler, t as directoryMembershipSource } from "../scim-jJBJ7g1Z.js";
|
|
34
35
|
import { c as quoteSqlTable, o as quoteSqlIdent } from "../sql-0WjxIp9g.js";
|
|
35
36
|
import { i as cloudEndpoints, n as cloud, s as approverHeaders, t as bearerChallenge } from "../challenge-DImNcR7B.js";
|
|
36
|
-
import { t as supabaseMembershipsBudget } from "../budget-BELja5A9.js";
|
|
37
37
|
import { t as supabaseManifestSchema } from "../manifest-schema-DQkBK2Mr.js";
|
|
38
38
|
import { t as PUSHED_POLICY_SCHEMA } from "../pushed-policy-CDuOL2de.js";
|
|
39
|
-
import { i as policyMatrixLayout, n as testRlsParity, r as policyMatrix, t as testOrmParity } from "../core-
|
|
39
|
+
import { i as policyMatrixLayout, n as testRlsParity, r as policyMatrix, t as testOrmParity } from "../core-lxoANyai.js";
|
|
40
40
|
import { i as saasPermissions } from "../permissions-CYcHj_w7.js";
|
|
41
41
|
import { C as saasOrg, E as saasSeed, S as saasMemberships, a as saasProject, g as verifySaasSession, h as signSaasToken, k as saasPolicy, t as saasDoc, w as saasPrincipal, x as saasCustomRoles } from "../saas-DK4V-3Is.js";
|
|
42
42
|
import { t as POLICY_NOT_PUBLISHED } from "../problem-types-DSsRfONQ.js";
|
package/dist/unplugin/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createCollectScheduler, r as report } from "../watch-
|
|
1
|
+
import { n as createCollectScheduler, r as report } from "../watch-DAkjm75Y.js";
|
|
2
2
|
import { r as peerHint } from "../peer-Q0fuZ6hx.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
//#region src/unplugin/index.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as runUsage } from "./usage-e6M1Mls1.js";
|
|
@@ -6,8 +6,8 @@ import { c as jsonSchemaOf } from "./catalog-doc-DjMKzJp9.js";
|
|
|
6
6
|
import { a as loadModule, n as asPolicy, s as pickNamed } from "./load-DjSU5KXO.js";
|
|
7
7
|
import { r as runCollect } from "./collect-WCl8cJQV.js";
|
|
8
8
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
9
|
-
import { t as DOCS_BASE } from "./manifest-
|
|
10
|
-
import { r as findingOf } from "./output-
|
|
9
|
+
import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
|
|
10
|
+
import { r as findingOf } from "./output-BVZpQDad.js";
|
|
11
11
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
12
12
|
import { dirname, resolve } from "node:path";
|
|
13
13
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -17,13 +17,13 @@ import { t as policyRowConditionKeys } from "./row-conditions-BAGHOmVq.js";
|
|
|
17
17
|
import { s as writeFileEnsuringDir } from "./files-BSjrtIHw.js";
|
|
18
18
|
import { c as jsonSchemaOf } from "./catalog-doc-DjMKzJp9.js";
|
|
19
19
|
import { o as loadPolicyAt } from "./load-DjSU5KXO.js";
|
|
20
|
+
import "./budget-BELja5A9.js";
|
|
20
21
|
import { i as qualifySqlTable, n as defaultSqlCommand, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
|
|
21
22
|
import { a as scopeMembershipTable, i as scopeColumn } from "./compile-EzEMB-7v.js";
|
|
22
|
-
import "./budget-BELja5A9.js";
|
|
23
23
|
import "./sources-C4vkzZJV.js";
|
|
24
24
|
import { t as beforeFirst } from "./text-BMFRfBqc.js";
|
|
25
|
-
import { t as DOCS_BASE } from "./manifest-
|
|
26
|
-
import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-
|
|
25
|
+
import { t as DOCS_BASE } from "./manifest-CbEyvPN2.js";
|
|
26
|
+
import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-Bm4_K1ke.js";
|
|
27
27
|
import { A as quoteQualified, N as arrayColumnsOf, O as quoteIdent, P as columnTypesOf, _ as subjectClaimJsonSql, a as customRolesOn, j as quoteTable, k as quoteLiteral, r as HELPERS, v as subjectClaimSql } from "./shared-DrGLwM3s.js";
|
|
28
28
|
import { C as accessSql, D as tokenScopeAllowsCall, S as requiresSql, ht as scopeTable, k as capabilityAccessSql, n as tableNameOf, o as graphPlan, q as apiKeyAllowsCall, r as tableNames } from "./tables-DimBcVWY.js";
|
|
29
29
|
import { c as breakGlassKey, f as compileConditionSql, l as collectGrants, m as sqlFunctionNames, p as contextRefs, s as breakGlassHolder } from "./ownership-qqBuGJXr.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as watchCollect } from "./watch-DAkjm75Y.js";
|
|
@@ -2,7 +2,7 @@ import { i as dateAt } from "./time-nR1JesoH.js";
|
|
|
2
2
|
import { a as describeError } from "./errors-Vpu6rKHl.js";
|
|
3
3
|
import { t as defaultSrcPath } from "./files-BSjrtIHw.js";
|
|
4
4
|
import { r as runCollect } from "./collect-WCl8cJQV.js";
|
|
5
|
-
import { n as isConfigFile, r as loadConfig } from "./config-
|
|
5
|
+
import { n as isConfigFile, r as loadConfig } from "./config-CcLlvEYW.js";
|
|
6
6
|
import { watch } from "node:fs";
|
|
7
7
|
import { basename, dirname, relative, resolve, sep } from "node:path";
|
|
8
8
|
//#region src/cli/watch.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "permdock",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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",
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
"oxc-parser": "0.154.0"
|
|
321
321
|
},
|
|
322
322
|
"devDependencies": {
|
|
323
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
323
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.303",
|
|
324
324
|
"@arethetypeswrong/cli": "0.18.5",
|
|
325
325
|
"@babel/core": "8.0.7",
|
|
326
326
|
"@clack/prompts": "1.8.1",
|
|
@@ -330,9 +330,9 @@
|
|
|
330
330
|
"@nestjs/core": "12.1.3",
|
|
331
331
|
"@nestjs/platform-express": "12.1.3",
|
|
332
332
|
"@openai/agents": "0.20.0",
|
|
333
|
-
"@orpc/contract": "2.0.0-beta.
|
|
334
|
-
"@orpc/openapi": "2.0.0-beta.
|
|
335
|
-
"@orpc/server": "2.0.0-beta.
|
|
333
|
+
"@orpc/contract": "2.0.0-beta.44",
|
|
334
|
+
"@orpc/openapi": "2.0.0-beta.44",
|
|
335
|
+
"@orpc/server": "2.0.0-beta.44",
|
|
336
336
|
"@permdock/ox-config": "0.0.0",
|
|
337
337
|
"@permdock/typescript-config": "0.0.0",
|
|
338
338
|
"@solidjs/start": "2.0.6",
|
|
@@ -340,35 +340,35 @@
|
|
|
340
340
|
"@supabase/supabase-js": "2.118.0",
|
|
341
341
|
"@sveltejs/kit": "3.1.0",
|
|
342
342
|
"@sveltejs/vite-plugin-svelte": "7.3.1",
|
|
343
|
-
"@tanstack/react-start": "1.169.
|
|
343
|
+
"@tanstack/react-start": "1.169.3",
|
|
344
344
|
"@trpc/server": "11.19.0",
|
|
345
345
|
"@types/express": "5.0.6",
|
|
346
|
-
"@types/node": "
|
|
346
|
+
"@types/node": "26.6.5",
|
|
347
347
|
"@types/pg": "8.23.1",
|
|
348
348
|
"@types/react": "19.3.0",
|
|
349
349
|
"@types/react-dom": "19.3.0",
|
|
350
350
|
"@vercel/detect-agent": "1.2.5",
|
|
351
351
|
"@vitest/coverage-v8": "5.0.5",
|
|
352
|
-
"ai": "7.0.
|
|
352
|
+
"ai": "7.0.143",
|
|
353
353
|
"ajv": "8.20.0",
|
|
354
354
|
"astro": "7.4.0",
|
|
355
355
|
"babel-plugin-react-compiler": "1.0.0",
|
|
356
|
-
"better-supabase": "0.
|
|
357
|
-
"better-supabase-floor": "npm:better-supabase@0.
|
|
356
|
+
"better-supabase": "0.29.0",
|
|
357
|
+
"better-supabase-floor": "npm:better-supabase@0.29.0",
|
|
358
358
|
"chat": "4.42.0",
|
|
359
359
|
"diff": "9.0.0",
|
|
360
360
|
"drizzle-orm": "1.0.0-rc.5-5935859",
|
|
361
361
|
"elysia": "1.4.30",
|
|
362
|
-
"eve": "0.
|
|
362
|
+
"eve": "0.80.1",
|
|
363
363
|
"express": "5.3.0",
|
|
364
364
|
"fastest-levenshtein": "1.0.16",
|
|
365
365
|
"fastify": "5.12.7",
|
|
366
|
-
"h3": "2.0.
|
|
366
|
+
"h3": "2.0.5",
|
|
367
367
|
"happy-dom": "21.0.4",
|
|
368
368
|
"hono": "4.13.13",
|
|
369
369
|
"jose": "6.2.12",
|
|
370
|
-
"kysely": "0.29.
|
|
371
|
-
"next": "16.4.
|
|
370
|
+
"kysely": "0.29.7",
|
|
371
|
+
"next": "16.4.2",
|
|
372
372
|
"oxlint": "1.89.0",
|
|
373
373
|
"oxlint-tsgolint": "7.0.2004",
|
|
374
374
|
"package-manager-detector": "1.9.0",
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
"react": "19.3.1",
|
|
379
379
|
"react-dom": "19.3.1",
|
|
380
380
|
"reflect-metadata": "0.2.2",
|
|
381
|
-
"resend": "6.
|
|
381
|
+
"resend": "6.34.1",
|
|
382
382
|
"rxjs": "7.8.2",
|
|
383
383
|
"smol-toml": "1.9.1",
|
|
384
384
|
"solid-js": "1.9.17",
|
|
@@ -411,7 +411,7 @@
|
|
|
411
411
|
"@trpc/server": ">=11",
|
|
412
412
|
"ai": ">=5",
|
|
413
413
|
"astro": ">=5",
|
|
414
|
-
"better-supabase": ">=0.
|
|
414
|
+
"better-supabase": ">=0.29.0",
|
|
415
415
|
"chat": ">=4",
|
|
416
416
|
"drizzle-orm": ">=0.40 || >=1.0.0-rc.0",
|
|
417
417
|
"elysia": ">=1",
|
|
@@ -125,7 +125,7 @@ const subject = await subjectFromCapability(token, {
|
|
|
125
125
|
- The result is a `kind: 'link'` principal with one `{ on, roles, via: 'link' }` membership. It never holds a scope or global role.
|
|
126
126
|
- `linkPolicy` returns the tenant's `LinkPolicy` (`maxLifetime`, `redeemers`, `once`). Passing the same policy to `signCapability` refuses to mint a link the resolver would refuse.
|
|
127
127
|
- Never an unguessable id without expiry, and never a security-definer RPC that reads the guest page's rows.
|
|
128
|
-
- The one exception is resolving a stored link. When links live in better-supabase's share-links block, its `resolve_share_link` is `security definer` and reads only the link table. `subjectFromShareLink(token, { shareLinks, links, ttl })` from `permdock/better-supabase` turns the row into the same link subject. The page's rows are then read through `exchangeCapability` and RLS, as for a signed link. `links` maps each subject type (`subject.type`
|
|
128
|
+
- The one exception is resolving a stored link. When links live in better-supabase's share-links block, its `resolve_share_link` is `security definer` and reads only the link table. `subjectFromShareLink(token, { shareLinks, links, ttl })` from `permdock/better-supabase` turns the row into the same link subject. The page's rows are then read through `exchangeCapability` and RLS, as for a signed link. `links` maps each subject type (the row's `subject.type`) to a resource and maps the row's role to PermDock roles. An unmapped type or role, and a revoked or expired row, are anonymous. A link pinned to a version is refused, because a capability reads the current rows; read it through better-supabase's `versions.getShared(token)`. See [row-backed links](https://permdock.com/docs/concepts/capabilities#row-backed-links).
|
|
129
129
|
|
|
130
130
|
With Supabase, let RLS serve the link through an exchange, never the link token itself:
|
|
131
131
|
|