permdock 0.9.0 → 0.11.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/active-tenant-DVee32-T.js +39 -0
- package/dist/{adoption-scan-Ch07MdxN.js → adoption-scan-DKCOsfcF.js} +1 -1
- package/dist/{arazzo-BpS7LnV0.js → arazzo-BXaEhGHM.js} +1 -1
- package/dist/{arazzo-CmQaGPkM.js → arazzo-CTH5iN--.js} +1 -1
- package/dist/better-supabase/index.d.ts +188 -23
- package/dist/better-supabase/index.js +246 -62
- package/dist/{casbin-B7_yS-oo.js → casbin-BuTZnSPv.js} +1 -1
- package/dist/{casbin-bHyIxTNQ.js → casbin-DTi6HSsl.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +6 -1
- package/dist/cli/index.js +10 -2
- package/dist/{cloud-3kWfjnYy.js → cloud-DiAiYFRo.js} +2 -2
- package/dist/{codemod-Bv5i-Mzo.js → codemod-C1U8_Zu3.js} +1 -1
- package/dist/{codemod-D9Aiii1r.js → codemod-_q_ZI01S.js} +2 -2
- package/dist/{collect-B80GYEot.js → collect-D9Tt0Bcx.js} +1 -1
- package/dist/{completion-_bc0OUQ-.js → completion-DLTuCf53.js} +1 -1
- package/dist/{config-BwPBfN0t.js → config-BR23fL8m.js} +2 -2
- package/dist/{config-D5XrLWpk.js → config-CmydKZr2.js} +1 -1
- package/dist/{config-report-BmWIskD7.js → config-report-5AwptLr2.js} +2 -2
- package/dist/{config-shape-ykV0Vm2n.js → config-shape-tsxHx71E.js} +2 -1
- package/dist/{create-BamXmeob.d.ts → create-CDd9c22W.d.ts} +10 -1
- package/dist/{doctor-LPMYjSqO.js → doctor-DxyVeUEE.js} +2 -2
- package/dist/{doctor-ClRVAtXQ.js → doctor-ktitU5Dl.js} +142 -14
- package/dist/{fields-D0vUI6dq.js → fields-DI8s3cPl.js} +1 -1
- package/dist/{gen-BtfFWGbz.js → gen-DuAhghDw.js} +1 -1
- package/dist/{gen-BFfzZSLH.js → gen-DwgCSC6V.js} +1 -1
- package/dist/{import-CST57XLp.js → import-CNBF96hB.js} +2 -2
- package/dist/{import-ACkOrv6g.js → import-t1yqnCyG.js} +1 -1
- package/dist/{index-vYjMrXyK.d.ts → index-Cay5-Kvx.d.ts} +3 -51
- package/dist/index.d.ts +2 -1
- package/dist/{init-txYTuW9u.js → init-CY7THM2v.js} +3 -3
- package/dist/{init-BjuFDYT1.js → init-DFwylmiN.js} +1 -1
- package/dist/{login-CgfCTO3F.js → login-B92-dZMK.js} +1 -1
- package/dist/{login-CfImTJGb.js → login-C5XLYZSF.js} +3 -3
- package/dist/{manifest-CzzWtnAb.d.ts → manifest-B5yF3CIq.d.ts} +19 -0
- package/dist/{manifest-wg8WkkpD.js → manifest-BXTbHNIV.js} +1 -1
- package/dist/{manifest-B2QPh19C.js → manifest-Cav1rjNQ.js} +33 -33
- package/dist/{manifest-schema-2r37XRhD.js → manifest-schema-DQkBK2Mr.js} +28 -1
- package/dist/{migrate-B7oP_sQU.js → migrate-BJHxQqT5.js} +2 -2
- package/dist/{module-values-BJTBdo6y.js → module-values-B1EVTkHP.js} +1 -1
- package/dist/next/index.d.ts +16 -3
- package/dist/next/index.js +1 -1
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/{openapi-BGeuunWC.js → openapi-CuePQL4z.js} +1 -1
- package/dist/{openapi-BIpw3Mb7.js → openapi-gMQQSzNn.js} +2 -2
- package/dist/{output-DV5dwOTs.js → output-CtyBwTNB.js} +1 -1
- package/dist/{ownership-DA5YdYTm.js → ownership-qqBuGJXr.js} +3 -3
- package/dist/{postgrest-5Dr3W64L.js → postgrest-DAxFltvO.js} +1 -1
- package/dist/powersync-6vgKevSi.js +1 -0
- package/dist/{powersync-Bg8u-JcR.js → powersync-CBcsEvdr.js} +2 -2
- package/dist/{powersync-CJrT1DSc.js → powersync-CD8-Ypao.js} +188 -36
- package/dist/{pull-2nJr0qg_.js → pull-CAeaAioC.js} +2 -2
- package/dist/pull-DfJALUbS.js +1 -0
- package/dist/{push-Bn-lMEmI.js → push-Dq_ca4-j.js} +1 -1
- package/dist/{resolve-names-ConCSj1y.js → resolve-names-Y1Cb22cp.js} +4 -4
- package/dist/{rls-Ba9wN0SP.js → rls-BYHN5bcJ.js} +1 -1
- package/dist/{rls-Cx0dtsB7.js → rls-CtRaRrn3.js} +22 -15
- package/dist/run-0vOholnN.js +1 -0
- package/dist/{run-PbRlXTfh.js → run-B5nyNKe8.js} +3 -3
- package/dist/{run-ticket-Dv7aF7Dk.js → run-ticket-DfnZCh-u.js} +19 -6
- package/dist/{run-ticket-B2o2Kxz8.d.ts → run-ticket-ylovhyFQ.d.ts} +16 -1
- package/dist/{scan-CRTj6fke.js → scan-CvFWW_fU.js} +1 -1
- package/dist/{schema-BTsE1WRT.js → schema-CQzIJdEd.js} +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +1 -1
- package/dist/{shared-Afctg7B0.js → shared-DrGLwM3s.js} +1 -1
- package/dist/{skills-C9uKfSF5.js → skills-BZc81VLt.js} +1 -1
- package/dist/{skills-CQQcuGBi.js → skills-Bar7ZqwM.js} +1 -1
- package/dist/{sources-CMAM-2A3.js → sources-C4vkzZJV.js} +12 -7
- package/dist/{types-BMVDHvI0.d.ts → sources-oB1Hg1Fm.d.ts} +316 -2
- package/dist/supabase/index.d.ts +10 -3
- package/dist/supabase/index.js +4 -4
- package/dist/{supabase-SBs3MYUE.js → supabase-CBEK6KEo.js} +2 -2
- package/dist/{supabase-DnMMg5Fn.js → supabase-CC6rIri4.js} +3 -2
- package/dist/supabase-hook-CWvEpdCh.js +1 -0
- package/dist/{supabase-hook-CrgU06WH.js → supabase-hook-CyuD9Wau.js} +110 -47
- package/dist/{supautils-ByezN3b8.js → supautils-C-_jqylY.js} +8 -8
- package/dist/{tables-BqrxBCir.js → tables-DimBcVWY.js} +2 -2
- package/dist/testing/fixtures/index.d.ts +1 -1
- package/dist/testing/fixtures/index.js +26 -28
- package/dist/testing/index.d.ts +4 -3
- package/dist/testing/index.js +3 -2
- package/dist/{types-CzOeVvcC.d.ts → types-Cklw5hJo.d.ts} +23 -2
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/usage-CNca1i1W.js +1 -0
- package/dist/{usage-B9EtHWLa.js → usage-Y6xZUfE-.js} +2 -2
- package/dist/{usage-CBzgwfIs.js → usage-heV5KOiU.js} +1 -1
- package/dist/{verify-DlUcTDBz.js → verify-6EauWrkP.js} +6 -6
- package/dist/version-cache-Df11C2Qp.d.ts +51 -0
- package/dist/{watch-BFDKqmUa.js → watch-Bpci3hBY.js} +1 -1
- package/dist/watch-COuvly20.js +1 -0
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.js +22 -6
- package/dist/workflow-sdk/index.d.ts +1 -1
- package/package.json +2 -2
- package/schemas/run-v1.json +16 -0
- package/schemas/supabase-manifest-v1.json +28 -0
- package/skills/permdock-agents/references/operations-automations-chat.md +1 -0
- package/skills/permdock-approvals/references/stores-and-resume.md +1 -1
- package/skills/permdock-wire/references/adapters.md +2 -2
- package/dist/powersync-B701tvhE.js +0 -1
- package/dist/pull-C3EEGzSw.js +0 -1
- package/dist/run-Ck22anC2.js +0 -1
- package/dist/sources-CWG32C0G.d.ts +0 -312
- package/dist/supabase-hook-C0FyEACZ.js +0 -1
- package/dist/usage-0hjZPIRX.js +0 -1
- package/dist/watch-ClLuO2TL.js +0 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ import { l as ReplayStore } from "../types-DsHGPtkR.js";
|
|
|
9
9
|
import { a as WebhookInput, c as WebhookMessage, d as WebhookSigningKey, f as WebhookVerifier, h as webhookVerifier, i as WebhookHeaders, l as WebhookSigner, m as webhookSigner, n as WebhookAlgorithm, o as WebhookJwk, p as WebhookVerifierOptions, r as WebhookFailureCause, s as WebhookJwks, t as VerifiedWebhookMessage, u as WebhookSignerOptions } from "../standard-webhooks-DOYEuOLx.js";
|
|
10
10
|
import { t as memoryReplayStore } from "../replay-Bs9Df2fQ.js";
|
|
11
11
|
import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotTag, r as SnapshotHeadersOptions, t as CacheLifeForOptions } from "../snapshot-cache-BjAWkchD.js";
|
|
12
|
-
import { a as RunContext, c as
|
|
13
|
-
export { type ApiKeyFailureCause, type ApiKeyParts, type ApiKeySubjectOptions, type ApprovalHint, type CacheLifeForOptions, type Connection, type ConnectionData, type ConnectionOptions, type DeniedResponse, type DeniedResponseEvent, type DiscoverViaSignatureAgentOptions, type Guard, InvalidSignatureError, type MemoryCredentialStore, type OpenApiHooks, type OperationScopes, PROBLEM_BASE, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, type ProblemFromErrorOptions, type ProtectOptions, RUN_TICKET_CLAIMS, type ReplayStore, type RequestContext, type RevocationEvent, type RevocationFeed, type RunActClaim, type RunAutomation, type RunBinding, type RunContext, type RunKind, type RunPrincipal, type RunTicket, type RunTicketAutomations, type RunTicketFailureCause, type RunTicketInput, type RunTicketOptions, type RunTicketSubjectOptions, type ScopeGuard, type ServerPermDock, type ServerPermDockOptions, type SnapshotHeaders, type SnapshotHeadersOptions, type SnapshotQuery, type StoredCredential, type SupportSessionContext, type SupportSessionFailureCause, type SupportSessionSource, type SupportSessionSubjectOptions, type TenantOption, type TenantScope, type VerifiedWebhookMessage, type WebBotAuthJwk, type WebBotAuthKeyLookup, type WebBotAuthKeys, type WebBotAuthOptions, type WebBotAuthVerifier, type WebhookAlgorithm, type WebhookFailureCause, type WebhookHeaders, type WebhookInput, type WebhookJwk, type WebhookJwks, type WebhookMessage, type WebhookSigner, type WebhookSignerOptions, type WebhookSigningKey, type WebhookVerifier, type WebhookVerifierOptions, apiKeyVerifier, cacheLifeFor, createPermDock, discoverViaSignatureAgent, evaluationsHandler, generateApiKey, generateFeedKey, hashApiKey, invalidSignatureProblem, invalidSignatureResponse, memoryCredentialStore, memoryReplayStore, memoryRevocationFeed, parseApiKey, parseFeedKey, parseRunTicket, problemFromDecision, problemFromError, problemResponse, signRunTicket, signSupportSession, snapshotHeaders, snapshotTag, subjectFromApiKey, subjectFromRunTicket, subjectFromSupportSession, tenantScope, validationProblem, webBotAuthVerifier, webhookSigner, webhookVerifier, wwwAuthenticate };
|
|
12
|
+
import { _ as subjectFromRunTicket, a as RunContext, c as RunResource, d as RunTicketFailureCause, f as RunTicketInput, g as signRunTicket, h as parseRunTicket, i as RunBinding, l as RunTicket, m as RunTicketSubjectOptions, n as RunActClaim, o as RunKind, p as RunTicketOptions, r as RunAutomation, s as RunPrincipal, t as RUN_TICKET_CLAIMS, u as RunTicketAutomations } from "../run-ticket-ylovhyFQ.js";
|
|
13
|
+
export { type ApiKeyFailureCause, type ApiKeyParts, type ApiKeySubjectOptions, type ApprovalHint, type CacheLifeForOptions, type Connection, type ConnectionData, type ConnectionOptions, type DeniedResponse, type DeniedResponseEvent, type DiscoverViaSignatureAgentOptions, type Guard, InvalidSignatureError, type MemoryCredentialStore, type OpenApiHooks, type OperationScopes, PROBLEM_BASE, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, type ProblemFromErrorOptions, type ProtectOptions, RUN_TICKET_CLAIMS, type ReplayStore, type RequestContext, type RevocationEvent, type RevocationFeed, type RunActClaim, type RunAutomation, type RunBinding, type RunContext, type RunKind, type RunPrincipal, type RunResource, type RunTicket, type RunTicketAutomations, type RunTicketFailureCause, type RunTicketInput, type RunTicketOptions, type RunTicketSubjectOptions, type ScopeGuard, type ServerPermDock, type ServerPermDockOptions, type SnapshotHeaders, type SnapshotHeadersOptions, type SnapshotQuery, type StoredCredential, type SupportSessionContext, type SupportSessionFailureCause, type SupportSessionSource, type SupportSessionSubjectOptions, type TenantOption, type TenantScope, type VerifiedWebhookMessage, type WebBotAuthJwk, type WebBotAuthKeyLookup, type WebBotAuthKeys, type WebBotAuthOptions, type WebBotAuthVerifier, type WebhookAlgorithm, type WebhookFailureCause, type WebhookHeaders, type WebhookInput, type WebhookJwk, type WebhookJwks, type WebhookMessage, type WebhookSigner, type WebhookSignerOptions, type WebhookSigningKey, type WebhookVerifier, type WebhookVerifierOptions, apiKeyVerifier, cacheLifeFor, createPermDock, discoverViaSignatureAgent, evaluationsHandler, generateApiKey, generateFeedKey, hashApiKey, invalidSignatureProblem, invalidSignatureResponse, memoryCredentialStore, memoryReplayStore, memoryRevocationFeed, parseApiKey, parseFeedKey, parseRunTicket, problemFromDecision, problemFromError, problemResponse, signRunTicket, signSupportSession, snapshotHeaders, snapshotTag, subjectFromApiKey, subjectFromRunTicket, subjectFromSupportSession, tenantScope, validationProblem, webBotAuthVerifier, webhookSigner, webhookVerifier, wwwAuthenticate };
|
package/dist/server/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { d as invalidSignatureProblem, f as invalidSignatureResponse, l as Inval
|
|
|
8
8
|
import { n as tenantScope } from "../adapter-context-CIQpQxbE.js";
|
|
9
9
|
import { t as createPermDock } from "../create-BLPKnJKa.js";
|
|
10
10
|
import { a as generateFeedKey, c as parseApiKey, i as generateApiKey, l as parseFeedKey, n as subjectFromSupportSession, o as hashApiKey, r as apiKeyVerifier, s as memoryCredentialStore, t as signSupportSession, u as subjectFromApiKey } from "../server-3cVlTLde.js";
|
|
11
|
-
import { i as subjectFromRunTicket, n as parseRunTicket, r as signRunTicket, t as RUN_TICKET_CLAIMS } from "../run-ticket-
|
|
11
|
+
import { i as subjectFromRunTicket, n as parseRunTicket, r as signRunTicket, t as RUN_TICKET_CLAIMS } from "../run-ticket-DfnZCh-u.js";
|
|
12
12
|
import { t as problemFromError } from "../map-error-pasIGqMT.js";
|
|
13
13
|
import { n as webhookVerifier, t as webhookSigner } from "../standard-webhooks-D67a3nzk.js";
|
|
14
14
|
export { InvalidSignatureError, PROBLEM_BASE, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, RUN_TICKET_CLAIMS, apiKeyVerifier, cacheLifeFor, createPermDock, discoverViaSignatureAgent, evaluationsHandler, generateApiKey, generateFeedKey, hashApiKey, invalidSignatureProblem, invalidSignatureResponse, memoryCredentialStore, memoryReplayStore, memoryRevocationFeed, parseApiKey, parseFeedKey, parseRunTicket, problemFromDecision, problemFromError, problemResponse, signRunTicket, signSupportSession, snapshotHeaders, snapshotTag, subjectFromApiKey, subjectFromRunTicket, subjectFromSupportSession, tenantScope, validationProblem, webBotAuthVerifier, webhookSigner, webhookVerifier, wwwAuthenticate };
|
|
@@ -4,7 +4,7 @@ import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
|
4
4
|
import { i as configError } from "./errors-Vpu6rKHl.js";
|
|
5
5
|
import { a as quoteQualifiedTable, c as quoteSqlTable, o as quoteSqlIdent, s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
|
|
6
6
|
import { t as byScope } from "./compile-EzEMB-7v.js";
|
|
7
|
-
import "./sources-
|
|
7
|
+
import "./sources-C4vkzZJV.js";
|
|
8
8
|
//#region src/cli/sql/columns.ts
|
|
9
9
|
/**
|
|
10
10
|
* The Postgres type a JSON Schema property compares as; `undefined` for text or
|
|
@@ -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-Bar7ZqwM.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-CtyBwTNB.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";
|
|
@@ -228,7 +228,7 @@ function singleRole(role, table, alias, options) {
|
|
|
228
228
|
}
|
|
229
229
|
const pairs = Object.entries(role.on);
|
|
230
230
|
const [pair] = pairs;
|
|
231
|
-
if (pair === void 0 || pairs.length !== 1) throw new TypeError(`${prefix}: ${options.label}.on must map exactly one column of ${table} to ${role.through}, for example ${options.example ?? "{ role_id: 'id' }"}`);
|
|
231
|
+
if (pair === void 0 || pairs.length !== 1 && options.composite !== true) throw new TypeError(options.composite === true ? `${prefix}: ${options.label}.on must map at least one column of ${table} to ${role.through}, for example ${options.example ?? "{ role_id: 'id' }"}` : `${prefix}: ${options.label}.on must map exactly one column of ${table} to ${role.through}, for example ${options.example ?? "{ role_id: 'id' }"}`);
|
|
232
232
|
const [ref, id] = pair;
|
|
233
233
|
const schema = table.includes(".") ? table.split(".")[0] ?? "public" : "public";
|
|
234
234
|
const through = role.through.includes(".") ? role.through : `${schema}.${role.through}`;
|
|
@@ -238,18 +238,20 @@ function singleRole(role, table, alias, options) {
|
|
|
238
238
|
table: through,
|
|
239
239
|
id,
|
|
240
240
|
key: role.column,
|
|
241
|
-
ref
|
|
241
|
+
ref,
|
|
242
|
+
match: pairs
|
|
242
243
|
};
|
|
244
|
+
const on = pairs.map(([from, to]) => `${keys}.${q(to)} = ${alias}.${q(from)}`).join(" and ");
|
|
243
245
|
const plain = `${keys}.${q(role.column)}::text`;
|
|
244
246
|
const guard = options.guard;
|
|
245
247
|
const key = guard !== void 0 && qualifySqlTable(guard.table) === through ? `case when ${keys}.${q(guard.tenant)} is not null${guard.skip === void 0 ? "" : ` and not coalesce(${keys}.${q(guard.skip)}, false)`} and ${plain} = any(${sqlTextArray(guard.declared)}) then null else ${plain} end` : plain;
|
|
246
248
|
return {
|
|
247
249
|
column: ref,
|
|
248
250
|
sql: key,
|
|
249
|
-
join: `${options.indent === void 0 ? " " : `\n${options.indent}`}join ${target} ${keys} on ${
|
|
250
|
-
lookup: `(select ${key} from ${target} ${keys} where ${
|
|
251
|
+
join: `${options.indent === void 0 ? " " : `\n${options.indent}`}join ${target} ${keys} on ${on}`,
|
|
252
|
+
lookup: `(select ${key} from ${target} ${keys} where ${on})`,
|
|
251
253
|
through: keyed,
|
|
252
|
-
columns: [
|
|
254
|
+
columns: pairs.map(([from]) => from),
|
|
253
255
|
throughs: [keyed],
|
|
254
256
|
lateral: false,
|
|
255
257
|
nullable: false
|
|
@@ -264,12 +266,14 @@ function sourceManifest(column, through, map) {
|
|
|
264
266
|
column,
|
|
265
267
|
map
|
|
266
268
|
};
|
|
267
|
-
|
|
269
|
+
if (through === void 0) return { column };
|
|
270
|
+
return {
|
|
268
271
|
column,
|
|
269
272
|
through: {
|
|
270
273
|
table: through.table,
|
|
271
274
|
id: through.id,
|
|
272
|
-
column: through.key
|
|
275
|
+
column: through.key,
|
|
276
|
+
...through.match.length > 1 ? { on: Object.fromEntries(through.match) } : {}
|
|
273
277
|
}
|
|
274
278
|
};
|
|
275
279
|
}
|
|
@@ -300,6 +304,7 @@ function memberRole(role, table, label, guard) {
|
|
|
300
304
|
return roleColumn(role, qualifySqlTable(table), "m", {
|
|
301
305
|
label,
|
|
302
306
|
indent: "",
|
|
307
|
+
composite: true,
|
|
303
308
|
...guard === void 0 ? {} : { guard }
|
|
304
309
|
});
|
|
305
310
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { pr as Principal, rn as AuthEvent } from "./policy-types-DGIO_gxq.js";
|
|
1
|
+
import { nt as MembershipSource, pr as Principal, rn as AuthEvent } from "./policy-types-DGIO_gxq.js";
|
|
2
2
|
import { t as ClaimsMap } from "./claims-map-D1Pb5oRq.js";
|
|
3
3
|
import { t as ClientNames } from "./clients-C_NOET3z.js";
|
|
4
|
+
import { c as SupabaseManifestMembership } from "./manifest-B5yF3CIq.js";
|
|
5
|
+
import { t as SqlQuery } from "./sql-B80DFdpG.js";
|
|
4
6
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
7
|
//#region src/supabase/claims.d.ts
|
|
6
8
|
/**
|
|
@@ -404,4 +406,316 @@ type SupabaseDelegation = {
|
|
|
404
406
|
readonly scopes: readonly string[];
|
|
405
407
|
};
|
|
406
408
|
//#endregion
|
|
407
|
-
|
|
409
|
+
//#region src/supabase/roles.d.ts
|
|
410
|
+
/** A roles table a role column references, by `schema.table`. */
|
|
411
|
+
type RoleKeys = {
|
|
412
|
+
readonly table: string;
|
|
413
|
+
/** The roles table column the reference points at. */
|
|
414
|
+
readonly id: string;
|
|
415
|
+
/** The roles table column holding the role key. */
|
|
416
|
+
readonly key: string;
|
|
417
|
+
/** The referencing table's column. */
|
|
418
|
+
readonly ref: string;
|
|
419
|
+
/**
|
|
420
|
+
* Every referencing column and the column of `table` it matches, `ref` and
|
|
421
|
+
* `id` first; more than one pair for a composite reference.
|
|
422
|
+
*/
|
|
423
|
+
readonly match: readonly (readonly [ref: string, id: string])[];
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* One role source of a membership row: a key column, or a reference to a roles
|
|
427
|
+
* table.
|
|
428
|
+
*/
|
|
429
|
+
type RoleSource = string | RoleThrough | RoleMap;
|
|
430
|
+
/** A role source, or several the row holds at once. */
|
|
431
|
+
type RoleSpec = RoleSource | readonly RoleSource[];
|
|
432
|
+
/**
|
|
433
|
+
* A roles table whose tenant rows are written by tenants. A role key read
|
|
434
|
+
* through it from a tenant row that is one of `declared` reads as null, so a
|
|
435
|
+
* tenant cannot claim the grants of a declared role by naming a role after it.
|
|
436
|
+
*/
|
|
437
|
+
type RoleGuard = {
|
|
438
|
+
/** `schema.table`, or `public`. */
|
|
439
|
+
readonly table: string;
|
|
440
|
+
/** The tenant column of the roles table. */
|
|
441
|
+
readonly tenant: string;
|
|
442
|
+
/**
|
|
443
|
+
* A tenant row with this column true is the application's own copy of a
|
|
444
|
+
* declared role.
|
|
445
|
+
*/
|
|
446
|
+
readonly skip?: string | undefined;
|
|
447
|
+
readonly declared: readonly string[];
|
|
448
|
+
};
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region src/supabase/sources.d.ts
|
|
451
|
+
type Common = {
|
|
452
|
+
readonly table: string;
|
|
453
|
+
/**
|
|
454
|
+
* Runs the lookups; without it the source only describes SQL (for `permdock
|
|
455
|
+
* supabase hook generate`).
|
|
456
|
+
*/
|
|
457
|
+
readonly query?: SqlQuery;
|
|
458
|
+
/**
|
|
459
|
+
* Drop suspended users and memberships under suspended instances, like
|
|
460
|
+
* `rls.suspension`.
|
|
461
|
+
*/
|
|
462
|
+
readonly suspension?: SupabaseSuspension;
|
|
463
|
+
};
|
|
464
|
+
type MembershipTableOptions = Common & {
|
|
465
|
+
/**
|
|
466
|
+
* Column names; `user`, `scope`, `id` and `role` default to `user_id`,
|
|
467
|
+
* `scope`, `scope_id`, `role`.
|
|
468
|
+
*/
|
|
469
|
+
readonly columns?: {
|
|
470
|
+
/** The user id column, or a reference to a table that holds the user id. */
|
|
471
|
+
readonly user?: string | RoleThrough;
|
|
472
|
+
readonly scope?: string;
|
|
473
|
+
readonly id?: string;
|
|
474
|
+
/** A `jsonb` column of ancestor ids keyed by scope name. */
|
|
475
|
+
readonly within?: string;
|
|
476
|
+
/**
|
|
477
|
+
* The role key column, a reference to a roles table that holds the key, or
|
|
478
|
+
* several of them: the row holds every non-null key.
|
|
479
|
+
*/
|
|
480
|
+
readonly role?: RoleSpec;
|
|
481
|
+
readonly via?: string;
|
|
482
|
+
readonly expiresAt?: string;
|
|
483
|
+
readonly disabledAt?: string;
|
|
484
|
+
/** The principal id that wrote the membership (`grantedBy`). */
|
|
485
|
+
readonly grantedBy?: string;
|
|
486
|
+
/** Free-text justification recorded on the membership (`reason`). */
|
|
487
|
+
readonly reason?: string;
|
|
488
|
+
/** A subgroup column filling `member.group`. */
|
|
489
|
+
readonly group?: string;
|
|
490
|
+
/**
|
|
491
|
+
* A text column; the value `idp` marks the row as owned by the identity
|
|
492
|
+
* provider.
|
|
493
|
+
*/
|
|
494
|
+
readonly managedBy?: string;
|
|
495
|
+
/** A `text[]` column of seats. */
|
|
496
|
+
readonly seats?: string;
|
|
497
|
+
/** A `jsonb` column of app data (`Membership.x`); never written into claims. */
|
|
498
|
+
readonly x?: string;
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
type MembershipJunctionOptions = Common & {
|
|
502
|
+
/** The declared scope every row is a membership of. */
|
|
503
|
+
readonly scope: string;
|
|
504
|
+
/**
|
|
505
|
+
* The user id column (default `user_id`), or a reference to a table that
|
|
506
|
+
* holds the user id.
|
|
507
|
+
*/
|
|
508
|
+
readonly user?: string | RoleThrough;
|
|
509
|
+
/** The column holding the scope instance id. Default `<scope>_id`. */
|
|
510
|
+
readonly id?: string;
|
|
511
|
+
/** Ancestor id columns keyed by scope name. */
|
|
512
|
+
readonly within?: Readonly<Record<string, string>>;
|
|
513
|
+
/**
|
|
514
|
+
* A role column, a reference to a roles table that holds the key, fixed roles
|
|
515
|
+
* every row holds (a contact table with no role column), or `{ sources }`:
|
|
516
|
+
* several role columns whose non-null keys the row holds.
|
|
517
|
+
*/
|
|
518
|
+
readonly roles: string | RoleThrough | RoleMap | readonly string[] | {
|
|
519
|
+
readonly sources: readonly RoleSource[];
|
|
520
|
+
};
|
|
521
|
+
/** The membership kind every row has (`contact`, `staff`, `partner`). */
|
|
522
|
+
readonly via?: string;
|
|
523
|
+
readonly expiresAt?: string;
|
|
524
|
+
readonly disabledAt?: string;
|
|
525
|
+
/** The principal id that wrote the membership (`grantedBy`). */
|
|
526
|
+
readonly grantedBy?: string;
|
|
527
|
+
/** Free-text justification recorded on the membership (`reason`). */
|
|
528
|
+
readonly reason?: string;
|
|
529
|
+
/** A subgroup filling `member.group`: a fixed name every row has, or a column. */
|
|
530
|
+
readonly group?: string | {
|
|
531
|
+
readonly column: string;
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* `idp` when the identity provider owns every row, or a text column holding
|
|
535
|
+
* `idp` per row.
|
|
536
|
+
*/
|
|
537
|
+
readonly managedBy?: "idp" | {
|
|
538
|
+
readonly column: string;
|
|
539
|
+
};
|
|
540
|
+
/** A `text[]` column of seats. */
|
|
541
|
+
readonly seats?: string;
|
|
542
|
+
/** A `jsonb` column of app data (`Membership.x`); never written into claims. */
|
|
543
|
+
readonly x?: string;
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* What `permdock supabase hook generate` compiles; the same SQL the source
|
|
547
|
+
* runs.
|
|
548
|
+
*/
|
|
549
|
+
type MembershipSql = {
|
|
550
|
+
readonly table: string;
|
|
551
|
+
/**
|
|
552
|
+
* The table's user column: the user id, or with `userThrough` the reference
|
|
553
|
+
* to the row holding it.
|
|
554
|
+
*/
|
|
555
|
+
readonly user: string;
|
|
556
|
+
/**
|
|
557
|
+
* The table that holds the user id when `user` references it; a change of
|
|
558
|
+
* that id bumps the old and the new user.
|
|
559
|
+
*/
|
|
560
|
+
readonly userThrough?: RoleKeys;
|
|
561
|
+
/**
|
|
562
|
+
* `<table>.<user>%type`: the PL/pgSQL type of the user id column, for a
|
|
563
|
+
* variable `select` compares with.
|
|
564
|
+
*/
|
|
565
|
+
readonly userType: string;
|
|
566
|
+
/**
|
|
567
|
+
* The `select` of claim rows for one user, with every filter applied. `user`
|
|
568
|
+
* must have the column's type (a `userType` variable, or an untyped `$1`
|
|
569
|
+
* Postgres infers): the column is compared uncast so its index applies.
|
|
570
|
+
* `keep` adds the `keep` column; it defaults to `keeps`, and a `union` with a
|
|
571
|
+
* source that keeps passes `true`.
|
|
572
|
+
*/
|
|
573
|
+
select: (user: string, keep?: boolean) => string;
|
|
574
|
+
/** The `select` of member rows for one scope instance (`$1` scope, `$2` id). */
|
|
575
|
+
list: (keep?: boolean) => string;
|
|
576
|
+
/**
|
|
577
|
+
* A suspended scope on the source keeps permissions: rows of its suspended
|
|
578
|
+
* instances stay, with a `keep` column.
|
|
579
|
+
*/
|
|
580
|
+
readonly keeps: boolean;
|
|
581
|
+
/**
|
|
582
|
+
* A text column holding `idp` for rows the identity provider owns; `''` when
|
|
583
|
+
* every row is owned.
|
|
584
|
+
*/
|
|
585
|
+
readonly managed?: string;
|
|
586
|
+
/** Other tables the `select` reads (suspension tables). */
|
|
587
|
+
readonly reads: readonly string[];
|
|
588
|
+
/**
|
|
589
|
+
* The roles table the role column references; a key change bumps every
|
|
590
|
+
* holder's authorization version.
|
|
591
|
+
*/
|
|
592
|
+
readonly through?: RoleKeys;
|
|
593
|
+
/** Every roles table the role columns reference, `through` first. */
|
|
594
|
+
readonly throughs: readonly RoleKeys[];
|
|
595
|
+
/**
|
|
596
|
+
* Every column that decides who holds which membership: user, scope, id,
|
|
597
|
+
* `within`, role, `via` and expiry.
|
|
598
|
+
*/
|
|
599
|
+
readonly columns: readonly string[];
|
|
600
|
+
/**
|
|
601
|
+
* For a single-scope source: its scope and the scopes whose ids each row
|
|
602
|
+
* carries.
|
|
603
|
+
*/
|
|
604
|
+
readonly scope?: string;
|
|
605
|
+
readonly holds?: readonly string[];
|
|
606
|
+
/** The source's entry in the hook manifest's `memberships`. */
|
|
607
|
+
readonly manifest: SupabaseManifestMembership;
|
|
608
|
+
/** What the ownership triggers count; absent on a source that is not a table. */
|
|
609
|
+
readonly holders?: MembershipHolders;
|
|
610
|
+
/**
|
|
611
|
+
* The rows as plain columns, for Sync Streams and `powerSyncSource`; a source
|
|
612
|
+
* without it does not sync.
|
|
613
|
+
*/
|
|
614
|
+
readonly stream?: MembershipStream;
|
|
615
|
+
};
|
|
616
|
+
/**
|
|
617
|
+
* One membership source as columns a Sync Streams query can filter on. Tables
|
|
618
|
+
* are `schema.table`; a `through` table is qualified in the source's schema
|
|
619
|
+
* when it names none.
|
|
620
|
+
*/
|
|
621
|
+
type MembershipStream = {
|
|
622
|
+
readonly table: string;
|
|
623
|
+
/** The user id column, or the reference to the table that holds the user id. */
|
|
624
|
+
readonly user: string | RoleThrough;
|
|
625
|
+
/** The scope column, or the scope every row is a membership of. */
|
|
626
|
+
readonly scope: {
|
|
627
|
+
readonly column: string;
|
|
628
|
+
} | {
|
|
629
|
+
readonly value: string;
|
|
630
|
+
};
|
|
631
|
+
readonly id: string;
|
|
632
|
+
/**
|
|
633
|
+
* The role sources (the row holds every non-null key), or the fixed roles
|
|
634
|
+
* every row holds.
|
|
635
|
+
*/
|
|
636
|
+
readonly roles: RoleSpec | {
|
|
637
|
+
readonly value: readonly string[];
|
|
638
|
+
};
|
|
639
|
+
/** The membership kind column, or the kind every row has. */
|
|
640
|
+
readonly via?: {
|
|
641
|
+
readonly column: string;
|
|
642
|
+
} | {
|
|
643
|
+
readonly value: string;
|
|
644
|
+
};
|
|
645
|
+
readonly expiresAt?: string;
|
|
646
|
+
readonly disabledAt?: string;
|
|
647
|
+
/**
|
|
648
|
+
* A row may hold no role key: such a row is no membership, and a reader drops
|
|
649
|
+
* it.
|
|
650
|
+
*/
|
|
651
|
+
readonly nullableRoles: boolean;
|
|
652
|
+
/**
|
|
653
|
+
* The guard the source reads its roles table with: a tenant row named like a
|
|
654
|
+
* declared role is no role.
|
|
655
|
+
*/
|
|
656
|
+
readonly guard?: RoleGuard;
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* The rows of a membership table, for the holder-count and transfer-only
|
|
660
|
+
* triggers `permdock rls generate` puts on it. No suspension filter: a
|
|
661
|
+
* suspended holder still holds the role.
|
|
662
|
+
*/
|
|
663
|
+
type MembershipHolders = {
|
|
664
|
+
/**
|
|
665
|
+
* `<table>.<id column>%type`: the type of a variable `rows` compares the id
|
|
666
|
+
* column with.
|
|
667
|
+
*/
|
|
668
|
+
readonly idType: string;
|
|
669
|
+
/**
|
|
670
|
+
* The instance id of scope `scope` the PL/pgSQL record `row` holds, as text;
|
|
671
|
+
* null on a row of another scope.
|
|
672
|
+
*/
|
|
673
|
+
id: (scope: string, row: string) => string;
|
|
674
|
+
/**
|
|
675
|
+
* `select id, user_id, role, via, live` over the rows of scope `scope` in
|
|
676
|
+
* `from` (default the table): one row per held role key, `live` false once
|
|
677
|
+
* expired. `id` is an expression of `idType` the id column must equal.
|
|
678
|
+
*/
|
|
679
|
+
rows: (scope: string, options?: {
|
|
680
|
+
readonly id?: string;
|
|
681
|
+
readonly from?: string;
|
|
682
|
+
}) => string;
|
|
683
|
+
};
|
|
684
|
+
type SqlMembershipSource = MembershipSource & {
|
|
685
|
+
readonly sql: MembershipSql;
|
|
686
|
+
/**
|
|
687
|
+
* The same source with the role keys of tenant rows of `guard.table` named
|
|
688
|
+
* like a declared role read as null.
|
|
689
|
+
*/
|
|
690
|
+
readonly guarded?: (guard: RoleGuard) => SqlMembershipSource;
|
|
691
|
+
};
|
|
692
|
+
/** The part of `@supabase/server`'s `PostgresApi` a `SqlQuery` needs. */
|
|
693
|
+
type SupabasePostgres = {
|
|
694
|
+
readonly queryRaw: (text: string, params?: unknown[]) => Promise<readonly Record<string, unknown>[]>;
|
|
695
|
+
};
|
|
696
|
+
declare function supabasePostgresQuery(postgres: SupabasePostgres): SqlQuery;
|
|
697
|
+
/**
|
|
698
|
+
* Memberships from one table holding every scope: a row per user, scope,
|
|
699
|
+
* instance and role (`user_id, scope, scope_id, role`), with optional `within`,
|
|
700
|
+
* `via`, expiry, owner and seat columns. Rows of the same instance merge into
|
|
701
|
+
* one membership.
|
|
702
|
+
*/
|
|
703
|
+
declare function tableMembershipSource(options: MembershipTableOptions): SqlMembershipSource;
|
|
704
|
+
/**
|
|
705
|
+
* Memberships from a table of one scope (`customer_contacts`): every row is a
|
|
706
|
+
* membership of `scope`, with roles from a column or fixed (`['contact']`), a
|
|
707
|
+
* fixed `via`, and ancestor ids from `within` columns.
|
|
708
|
+
*/
|
|
709
|
+
declare function junctionMembershipSource(options: MembershipJunctionOptions): SqlMembershipSource;
|
|
710
|
+
declare const AUTHZ_VERSION_TABLE = "permdock_authz_version";
|
|
711
|
+
/**
|
|
712
|
+
* Reads the authorization version `permdock supabase hook generate` keeps in
|
|
713
|
+
* `<schema>.permdock_authz_version`: pass it to `claimsFirst(sources, { version
|
|
714
|
+
* })`.
|
|
715
|
+
*/
|
|
716
|
+
declare function authzVersion(options: {
|
|
717
|
+
readonly query: SqlQuery;
|
|
718
|
+
readonly schema?: string;
|
|
719
|
+
}): NonNullable<MembershipSource["version"]>;
|
|
720
|
+
//#endregion
|
|
721
|
+
export { SupabaseSubjectOptions as A, supabaseClaims as B, SupabasePrincipal as C, SupabaseRlsOptions as D, SupabaseRlsMembershipTable as E, SupabaseClaims as F, SupabaseClaimsOptions as I, SupabaseClaimsSchema as L, SupabaseSuspendedScope as M, SupabaseSuspension as N, SupabaseSessionLike as O, SupabaseActClaim as P, SupabaseMembershipClaim as R, SupabasePermissionRef as S, SupabaseRlsConfig as T, SupabaseActor as _, MembershipStream as a, SupabaseInclude as b, SupabasePostgres as c, supabasePostgresQuery as d, tableMembershipSource as f, SupabaseActiveRow as g, RoleThrough as h, MembershipSql as i, SupabaseSuspendedMembership as j, SupabaseStorage as k, authzVersion as l, RoleMap as m, MembershipHolders as n, MembershipTableOptions as o, AuthorizeSqlOptions as p, MembershipJunctionOptions as r, SqlMembershipSource as s, AUTHZ_VERSION_TABLE as t, junctionMembershipSource as u, SupabaseActorResult as v, SupabaseRealtime as w, SupabaseMembershipTable as x, SupabaseDelegation as y, SupabasePermDockClaims as z };
|
package/dist/supabase/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Wt as Instant, hr as Subject } from "../policy-types-DGIO_gxq.js";
|
|
2
2
|
import { a as ApprovalDelegationSource, m as ApprovalStore, u as ApprovalRequest } from "../types-DLvhVm1r.js";
|
|
3
3
|
import { a as SupabaseRpcClient, c as readSubjectRecord, i as SupabaseRpcCaller, n as PostgrestSourcesOptions, o as SupabaseRpcResult, r as SubjectRecord, s as postgrestSources, t as PostgrestSources } from "../postgrest-D5nUGm-c.js";
|
|
4
|
-
import { C as
|
|
4
|
+
import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-oB1Hg1Fm.js";
|
|
5
|
+
import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-B5yF3CIq.js";
|
|
5
6
|
import { t as SqlQuery } from "../sql-B80DFdpG.js";
|
|
6
|
-
import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-CzzWtnAb.js";
|
|
7
|
-
import { a as MembershipStream, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, i as MembershipSql, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource } from "../sources-CWG32C0G.js";
|
|
8
7
|
import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-hYsPz_yE.js";
|
|
9
8
|
//#region src/supabase/capability.d.ts
|
|
10
9
|
type ExchangeCapabilityOptions = {
|
|
@@ -41,6 +40,14 @@ type SupabaseApprovalStoreOptions = {
|
|
|
41
40
|
readonly schema?: string;
|
|
42
41
|
/** Seconds a request stays open when the caller sets no `ttl`. */
|
|
43
42
|
readonly ttl?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Runs on every `create`, before the call that stores the request, with the
|
|
45
|
+
* request: insert the app's own row holding `request.token`, which `open:
|
|
46
|
+
* 'attach'` then attaches the request to. A repeated ask and a retried open
|
|
47
|
+
* run it again, so it must be idempotent, such as an insert that ignores a
|
|
48
|
+
* conflict on the token. A throw fails the open before anything is stored.
|
|
49
|
+
*/
|
|
50
|
+
readonly beforeOpen?: (request: ApprovalRequest) => void | Promise<void>;
|
|
44
51
|
/**
|
|
45
52
|
* Runs once per stored request, after the call that stored it, with the
|
|
46
53
|
* stored request: notify the approvers, or cancel the requests this one
|
package/dist/supabase/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as supabaseClaims, i as supabaseApprovalStore, n as supabaseRls, o as exchangeCapability, r as tableApprovalDelegationSource, t as authorizeSql } from "../supabase-
|
|
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
2
|
import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-BELja5A9.js";
|
|
3
|
-
import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-
|
|
4
|
-
import { a as delegationOf, c as subjectFromSupabaseSession, i as actorOf, n as postgrestSources, r as readSubjectRecord, s as subjectFromSupabase } from "../postgrest-
|
|
5
|
-
import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-
|
|
3
|
+
import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-C4vkzZJV.js";
|
|
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
|
+
import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-BXTbHNIV.js";
|
|
6
6
|
export { AUTHZ_VERSION_TABLE, actorOf, authorizeSql, authzVersion, delegationOf, exchangeCapability, hasTokenHook, junctionMembershipSource, parseSupabaseManifest, postgrestSources, readSubjectRecord, subjectFromSupabase, subjectFromSupabaseSession, supabaseApprovalStore, supabaseClaims, supabaseMembershipsBudget, supabasePostgresQuery, supabaseRls, supabaseTenantClaim, tableApprovalDelegationSource, tableMembershipSource };
|
|
@@ -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-CWvEpdCh.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-CWvEpdCh.js");
|
|
80
80
|
return runSupabase({
|
|
81
81
|
cwd: ctx.cwd,
|
|
82
82
|
config: ctx.config,
|
|
@@ -7,8 +7,8 @@ import { a as parseCapability } from "./capability-BqX94r07.js";
|
|
|
7
7
|
import { t as loadJose } from "./load-jose-DZ4dnjri.js";
|
|
8
8
|
import { a as quoteQualifiedTable, c as quoteSqlTable, d as sqlTextArray, i as qualifySqlTable, o as quoteSqlIdent, s as quoteSqlLiteral } from "./sql-0WjxIp9g.js";
|
|
9
9
|
import "./budget-BELja5A9.js";
|
|
10
|
-
import { d as keptKeys, l as roleColumn } from "./sources-
|
|
11
|
-
import { t as callRpc } from "./postgrest-
|
|
10
|
+
import { d as keptKeys, l as roleColumn } from "./sources-C4vkzZJV.js";
|
|
11
|
+
import { t as callRpc } from "./postgrest-DAxFltvO.js";
|
|
12
12
|
//#region src/supabase/capability.ts
|
|
13
13
|
const DEFAULT_TTL = 300;
|
|
14
14
|
const MAX_TTL = 3600;
|
|
@@ -278,6 +278,7 @@ function supabaseApprovalStore(client, options = {}) {
|
|
|
278
278
|
return {
|
|
279
279
|
...options.ttl === void 0 ? {} : { ttl: options.ttl },
|
|
280
280
|
async create(request) {
|
|
281
|
+
await options.beforeOpen?.(request);
|
|
281
282
|
await call("permdock_approval_open", { p_request: request });
|
|
282
283
|
if (options.onOpen !== void 0) {
|
|
283
284
|
const stored = await get(request.token);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as runSupabase } from "./supabase-hook-CyuD9Wau.js";
|