better-supabase 0.6.0 → 0.7.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/{adapter-Bc1o3zyy.js → adapter-B-tL8hqg.js} +104 -25
- package/dist/ai-sdk/batches/index.d.ts +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/{api-keys-rCGtKaZA.d.ts → api-keys-CIjghYjV.d.ts} +1 -1
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/blocks/ai-providers/index.d.ts +1 -1
- package/dist/blocks/api-keys/index.d.ts +2 -2
- package/dist/blocks/attachments/index.d.ts +18 -4
- package/dist/blocks/attachments/index.js +16 -4
- package/dist/blocks/audit/index.js +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +11 -3
- package/dist/blocks/data-lifecycle/index.js +8 -3
- package/dist/blocks/entitlements/index.d.ts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/workflow-builder/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/react/index.d.ts +1 -1
- package/dist/chat-sdk/index.d.ts +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{doctor-B4JOm_ox.js → doctor-CVdnLahA.js} +66 -14
- package/dist/cli/{gen-BGLb_zou.js → gen-AIf4MREI.js} +1 -1
- package/dist/cli/gen-DSrahEdX.js +2 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/cli/{init-BIIwclPg.js → init-Cr6arjXU.js} +1 -1
- package/dist/cli/{introspect-DNUTuNvb.js → introspect-Bzuv1HHj.js} +1 -1
- package/dist/cli/{run-DNWxHynX.js → run-BO052mki.js} +7 -7
- package/dist/cli/{sql-D0GUtUPp.js → sql-B8csQPyn.js} +13 -54
- package/dist/cli/sql-layout-D6cphHT3.js +69 -0
- package/dist/cli/{version-hr88OZG0.js → version-Bp4fyubI.js} +1 -1
- package/dist/{composite-DhE66P5u.js → composite-C6I8ZyaF.js} +1 -1
- package/dist/{composite-Bt1YK3Ke.d.ts → composite-CpHLEo-G.d.ts} +3 -3
- package/dist/{connectors-hkLCwyEz.d.ts → connectors-CrpknU0P.d.ts} +1 -1
- package/dist/credentials/index.d.ts +2 -2
- package/dist/{csv-CPAzEmB6.js → csv-DCK-PT1n.js} +1 -1
- package/dist/edge/index.d.ts +5 -5
- package/dist/edge/index.js +3 -3
- package/dist/elysia/index.d.ts +1 -1
- package/dist/{ended-jLfvw8h-.d.ts → ended-XjeGQ5XW.d.ts} +4 -1
- package/dist/{entitlements-DHrY2UDZ.d.ts → entitlements-BKSVGtrG.d.ts} +1 -1
- package/dist/eve/index.d.ts +2 -2
- package/dist/eve/index.js +1 -1
- package/dist/{executor-D14tGopJ.d.ts → executor-BVBFM86G.d.ts} +1 -1
- package/dist/expo/index.d.ts +2 -2
- package/dist/expo/index.js +3 -3
- package/dist/{framework-CONDyPYx.js → framework-BDCpJI7o.js} +1 -1
- package/dist/{framework-DuVb4Xa8.d.ts → framework-KIPvRQJU.d.ts} +4 -4
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/hono/index.d.ts +6 -6
- package/dist/hono/index.js +2 -2
- package/dist/{index-DDrYaUcq.d.ts → index-CdZKQF98.d.ts} +1 -1
- package/dist/{index-CtuakVRc.d.ts → index-CewnYSpv.d.ts} +1 -1
- package/dist/{kit-B5tid-q5.d.ts → kit-CkNzZUqv.d.ts} +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.d.ts +3 -3
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/next/index.d.ts +13 -8
- package/dist/next/index.js +5 -5
- package/dist/node/index.d.ts +2 -2
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +1 -1
- package/dist/otel/index.js +5 -5
- package/dist/{provider-BH5UWZJ6.d.ts → provider-D-UEMvSD.d.ts} +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/server.d.ts +5 -5
- package/dist/react/session.d.ts +2 -2
- package/dist/react-router/index.d.ts +4 -4
- package/dist/react-router/index.js +2 -2
- package/dist/{refusal-D1rgbzNq.d.ts → refusal-DhSU2Vvr.d.ts} +1 -1
- package/dist/{resolve-KW8nCeL6.d.ts → resolve-ChTYeTEl.d.ts} +3 -0
- package/dist/{resolve-D_IcnvFd.js → resolve-tJZY3FEa.js} +12 -7
- package/dist/{resource-D6Uc7Sk7.d.ts → resource-IPS5xi9q.d.ts} +1 -1
- package/dist/{respond-DoBijysA.d.ts → respond-DprrgyXX.d.ts} +1 -1
- package/dist/server/index.d.ts +47 -10
- package/dist/server/index.js +27 -5
- package/dist/{server-CeVeeXwz.d.ts → server-ZSJ9rCcV.d.ts} +27 -3
- package/dist/solid/index.d.ts +2 -2
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +2 -2
- package/dist/sql/index.d.ts +10 -0
- package/dist/sql/index.js +82 -13
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +1 -1
- package/dist/{support-BivNqSpK.js → support-DWwzVf-O.js} +1 -1
- package/dist/{support-view-33Oi07TT.d.ts → support-view-CVOJJLpc.d.ts} +1 -1
- package/dist/svelte/index.d.ts +1 -1
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenant-icPeuUBN.d.ts → tenant-BxNFk9bx.d.ts} +1 -1
- package/dist/testing/index.d.ts +5 -5
- package/dist/{types-TaiEeBGA.d.ts → types-6rocye-y.d.ts} +1 -1
- package/dist/{types-BI-0Sl2v.d.ts → types-AYOvcyep.d.ts} +1 -1
- package/dist/{vault-CSO7ss5C.d.ts → vault-wlbBhqm7.d.ts} +1 -1
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/{version-Bvv6aLjZ.js → version--AolB5ej.js} +1 -1
- package/dist/{view-DbxLNu8L.d.ts → view-CF7ihnkg.d.ts} +1 -1
- package/dist/vue/index.d.ts +2 -2
- package/dist/workflow-sdk/builder/index.d.ts +2 -2
- package/package.json +1 -1
- package/schemas/doctor-report-v1.json +2 -0
- package/dist/cli/gen-DAH8FM2W.js +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { c as mapDbError, n as dbError, o as isDbError } from "./errors-B11Duf73.js";
|
|
1
|
+
import { c as mapDbError, n as dbError, o as isDbError, r as dbErrorOf } from "./errors-B11Duf73.js";
|
|
2
|
+
import { t as temporal } from "./temporal-required-BVvW7SYJ.js";
|
|
2
3
|
import { a as ok, r as err, t as AsyncResult } from "./result-DzUbqgdW.js";
|
|
3
4
|
import { a as postgrestExecutor, n as StatsRecorder } from "./stats-D_AD9GGu.js";
|
|
4
5
|
import { a as problemResponse } from "./problem-BreOl8b8.js";
|
|
@@ -7,7 +8,7 @@ import { a as actorOf, i as userContext, n as impersonatorClaim, t as actClaim }
|
|
|
7
8
|
import { t as fromPgError } from "./executor-De1Of3m3.js";
|
|
8
9
|
import { n as forwardBlockEvents } from "./cloud-event-BnmD5fb9.js";
|
|
9
10
|
import { a as replicaState, i as primaryCookieWrite, o as routedExecutor, r as pinnedUntil, s as withPrimaryPin } from "./replicas-CwrYp5Zj.js";
|
|
10
|
-
import { c as AUTH_CACHE_HEADERS, d as clearSessionAtScopes, f as parseCookies, h as sessionCookieName, i as resolveAuth, m as serializeCookie, r as prefetchJwks, t as authContext } from "./resolve-
|
|
11
|
+
import { c as AUTH_CACHE_HEADERS, d as clearSessionAtScopes, f as parseCookies, h as sessionCookieName, i as resolveAuth, m as serializeCookie, r as prefetchJwks, t as authContext } from "./resolve-tJZY3FEa.js";
|
|
11
12
|
import { t as credentialProviderOf } from "./provider-Di3sRutW.js";
|
|
12
13
|
import { a as respond, n as defaultPrefetchJwks, r as guard, t as defaultExpose } from "./respond-BUgsXNgk.js";
|
|
13
14
|
import { createClient } from "@supabase/supabase-js";
|
|
@@ -137,7 +138,8 @@ function invalidUser(userId) {
|
|
|
137
138
|
return dbError("invalid_request", `"${userId}" is not a user id`, { table: "auth.users" });
|
|
138
139
|
}
|
|
139
140
|
function fromSqlError(cause) {
|
|
140
|
-
|
|
141
|
+
const known = dbErrorOf(cause);
|
|
142
|
+
if (known) return known;
|
|
141
143
|
const raw = fromPgError(cause);
|
|
142
144
|
if (raw) return {
|
|
143
145
|
...mapDbError(raw),
|
|
@@ -162,6 +164,29 @@ function endSessions(sql, userId) {
|
|
|
162
164
|
}
|
|
163
165
|
});
|
|
164
166
|
}
|
|
167
|
+
const LAST_SIGN_INS = `select user_id, last_sign_in_at
|
|
168
|
+
from better_supabase.last_sign_ins($1::uuid[])`;
|
|
169
|
+
/**
|
|
170
|
+
* The last sign-in of each user, in one query (`better_supabase.last_sign_ins`
|
|
171
|
+
* from the `sessions` module, which only the service role may call). Users
|
|
172
|
+
* that don't exist are missing from the map.
|
|
173
|
+
*/
|
|
174
|
+
function lastSignIns(sql, userIds) {
|
|
175
|
+
return AsyncResult.from(async () => {
|
|
176
|
+
const invalid = userIds.find((userId) => !UUID.test(userId));
|
|
177
|
+
if (invalid !== void 0) return err(invalidUser(invalid));
|
|
178
|
+
if (userIds.length === 0) return ok(/* @__PURE__ */ new Map());
|
|
179
|
+
try {
|
|
180
|
+
const rows = await sql.queryRaw(LAST_SIGN_INS, [[...new Set(userIds)]]);
|
|
181
|
+
return ok(new Map(rows.map((row) => [row.user_id, {
|
|
182
|
+
userId: row.user_id,
|
|
183
|
+
lastSignInAt: row.last_sign_in_at === null ? null : temporal().Instant.from(row.last_sign_in_at instanceof Date ? row.last_sign_in_at.toISOString() : row.last_sign_in_at)
|
|
184
|
+
}])));
|
|
185
|
+
} catch (cause) {
|
|
186
|
+
return err(fromSqlError(cause));
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
165
190
|
async function ban(client, userId, duration) {
|
|
166
191
|
try {
|
|
167
192
|
const { error } = await client.auth.admin.updateUserById(userId, { ban_duration: duration });
|
|
@@ -426,6 +451,57 @@ function withTenant(core) {
|
|
|
426
451
|
})();
|
|
427
452
|
}
|
|
428
453
|
//#endregion
|
|
454
|
+
//#region src/server/request-ids.ts
|
|
455
|
+
const REQUEST_ID_PATTERN = /^[A-Za-z0-9._:;,@/+=-]{1,128}$/;
|
|
456
|
+
function requestIdOrUndefined(value) {
|
|
457
|
+
return typeof value === "string" && REQUEST_ID_PATTERN.test(value) ? value : void 0;
|
|
458
|
+
}
|
|
459
|
+
function sessionWith(ids, tenant, readOnly = false) {
|
|
460
|
+
const settings = {
|
|
461
|
+
...ids.requestId === void 0 ? {} : { "better_supabase.request_id": ids.requestId },
|
|
462
|
+
...ids.correlationId === void 0 ? {} : { "better_supabase.correlation_id": ids.correlationId },
|
|
463
|
+
...tenant === void 0 ? {} : { "better_supabase.tenant": tenant }
|
|
464
|
+
};
|
|
465
|
+
const hasSettings = Object.keys(settings).length > 0;
|
|
466
|
+
if (!hasSettings && !readOnly) return void 0;
|
|
467
|
+
return {
|
|
468
|
+
...readOnly ? { readOnly: true } : {},
|
|
469
|
+
...hasSettings ? { settings } : {}
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function requestIdPolicy(options = {}) {
|
|
473
|
+
const on = options !== false;
|
|
474
|
+
const settings = on ? options : {};
|
|
475
|
+
const requestHeader = (settings.requestHeader ?? "x-request-id").toLowerCase();
|
|
476
|
+
const correlationHeader = (settings.correlationHeader ?? "x-correlation-id").toLowerCase();
|
|
477
|
+
const incoming = on && (settings.incoming ?? true);
|
|
478
|
+
const generate = on && (settings.generate ?? true);
|
|
479
|
+
const generated = /* @__PURE__ */ new WeakMap();
|
|
480
|
+
const fromHeader = (request, name) => incoming && request ? requestIdOrUndefined(request.headers.get(name)) : void 0;
|
|
481
|
+
const generatedFor = (request) => {
|
|
482
|
+
if (!generate || !request) return void 0;
|
|
483
|
+
const known = generated.get(request);
|
|
484
|
+
if (known !== void 0) return known;
|
|
485
|
+
const id = crypto.randomUUID();
|
|
486
|
+
generated.set(request, id);
|
|
487
|
+
return id;
|
|
488
|
+
};
|
|
489
|
+
return {
|
|
490
|
+
forRequest(request, explicit) {
|
|
491
|
+
const requestId = requestIdOrUndefined(explicit.requestId) ?? fromHeader(request, requestHeader) ?? generatedFor(request);
|
|
492
|
+
const correlationId = requestIdOrUndefined(explicit.correlationId) ?? fromHeader(request, correlationHeader) ?? requestId;
|
|
493
|
+
return {
|
|
494
|
+
...requestId === void 0 ? {} : { requestId },
|
|
495
|
+
...correlationId === void 0 ? {} : { correlationId }
|
|
496
|
+
};
|
|
497
|
+
},
|
|
498
|
+
headers: (ids) => ({
|
|
499
|
+
...ids.requestId === void 0 ? {} : { [requestHeader]: ids.requestId },
|
|
500
|
+
...ids.correlationId === void 0 ? {} : { [correlationHeader]: ids.correlationId }
|
|
501
|
+
})
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
429
505
|
//#region src/auth/support-cookie.ts
|
|
430
506
|
/** The cookie that carries the support session id. */
|
|
431
507
|
const SUPPORT_COOKIE = "bs-support";
|
|
@@ -674,6 +750,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
674
750
|
return tenant;
|
|
675
751
|
};
|
|
676
752
|
const pinMs = options.replicas?.pinMs ?? 5e3;
|
|
753
|
+
const idPolicy = requestIdPolicy(options.requestIds);
|
|
677
754
|
if (options.support && !options.postgres) throw new TypeError("Support sessions need createServer(betterSupabase, { postgres: createPostgres(), support })");
|
|
678
755
|
const audit = serverAudit(betterSupabase, options.audit);
|
|
679
756
|
const support = options.support ? options.support.create(betterSupabase.events, options.auth?.claims ?? betterSupabase.claimsSchema) : supportOff;
|
|
@@ -682,7 +759,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
682
759
|
* Postgres with the target's claims plus `act`, read-only unless the
|
|
683
760
|
* session allows writes; nothing reaches Supabase with the admin's token.
|
|
684
761
|
*/
|
|
685
|
-
const supportContextFor = (resolution, active, parent, tenant) => {
|
|
762
|
+
const supportContextFor = (resolution, active, parent, tenant, ids) => {
|
|
686
763
|
const { session, claims } = active;
|
|
687
764
|
const record = (key) => {
|
|
688
765
|
const value = claims[key];
|
|
@@ -711,10 +788,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
711
788
|
...base,
|
|
712
789
|
tenant: scope
|
|
713
790
|
};
|
|
714
|
-
const sessionOptions =
|
|
715
|
-
...session.readOnly ? { readOnly: true } : {},
|
|
716
|
-
...scope === void 0 ? {} : { settings: { "better_supabase.tenant": scope } }
|
|
717
|
-
};
|
|
791
|
+
const sessionOptions = sessionWith(ids, scope, session.readOnly);
|
|
718
792
|
const recorder = new StatsRecorder(parent);
|
|
719
793
|
const sqlClaims = claims;
|
|
720
794
|
const unavailable = () => {
|
|
@@ -724,6 +798,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
724
798
|
let sql;
|
|
725
799
|
return {
|
|
726
800
|
...credentials,
|
|
801
|
+
...ids,
|
|
727
802
|
auth,
|
|
728
803
|
resolution,
|
|
729
804
|
support: active,
|
|
@@ -753,19 +828,20 @@ function createServer(betterSupabase, options = {}) {
|
|
|
753
828
|
* `ctx.sql` run over direct Postgres with the key's synthesized claims,
|
|
754
829
|
* scoped to its organization unless the tenant option names another.
|
|
755
830
|
*/
|
|
756
|
-
const apiKeyContextFor = (resolution, auth, parent, tenant) => {
|
|
831
|
+
const apiKeyContextFor = (resolution, auth, parent, tenant, ids) => {
|
|
757
832
|
const scope = tenant ?? auth.organizationId;
|
|
758
833
|
const base = authContext(auth);
|
|
759
834
|
const context = scope === void 0 ? base : {
|
|
760
835
|
...base,
|
|
761
836
|
tenant: scope
|
|
762
837
|
};
|
|
763
|
-
const session =
|
|
838
|
+
const session = sessionWith(ids, scope);
|
|
764
839
|
const recorder = new StatsRecorder(parent);
|
|
765
840
|
let db;
|
|
766
841
|
let sql;
|
|
767
842
|
return {
|
|
768
843
|
...credentials,
|
|
844
|
+
...ids,
|
|
769
845
|
auth: resolution.auth,
|
|
770
846
|
resolution,
|
|
771
847
|
get supabase() {
|
|
@@ -790,25 +866,30 @@ function createServer(betterSupabase, options = {}) {
|
|
|
790
866
|
};
|
|
791
867
|
};
|
|
792
868
|
/** Clients and repositories are built on first access: most scopes use one of them. */
|
|
793
|
-
const contextFor = (resolution, requestHeaders, parent, until = 0, tenant, active) => {
|
|
794
|
-
if (active) return supportContextFor(resolution, active, parent, tenant);
|
|
869
|
+
const contextFor = (resolution, requestHeaders, parent, until = 0, tenant, active, ids = {}) => {
|
|
870
|
+
if (active) return supportContextFor(resolution, active, parent, tenant, ids);
|
|
795
871
|
const { auth } = resolution;
|
|
796
|
-
if (auth.kind === "apiKey") return apiKeyContextFor(resolution, auth, parent, tenant);
|
|
872
|
+
if (auth.kind === "apiKey") return apiKeyContextFor(resolution, auth, parent, tenant, ids);
|
|
797
873
|
const context = tenant === void 0 ? authContext(auth) : {
|
|
798
874
|
...authContext(auth),
|
|
799
875
|
tenant
|
|
800
876
|
};
|
|
801
|
-
const
|
|
877
|
+
const clientHeaders = tenant === void 0 ? requestHeaders : {
|
|
802
878
|
...requestHeaders,
|
|
803
879
|
[TENANT_HEADER]: tenant
|
|
804
880
|
};
|
|
805
|
-
const
|
|
881
|
+
const headers = {
|
|
882
|
+
...idPolicy.headers(ids),
|
|
883
|
+
...clientHeaders
|
|
884
|
+
};
|
|
885
|
+
const sharesClient = auth.kind !== "user";
|
|
886
|
+
const session = sessionWith(ids, tenant);
|
|
806
887
|
const recorder = new StatsRecorder(parent);
|
|
807
888
|
let supabase;
|
|
808
889
|
let db;
|
|
809
890
|
let sql;
|
|
810
891
|
const sqlClaims = auth.kind === "user" ? auth.claims : auth.kind === "anon" ? { role: "anon" } : void 0;
|
|
811
|
-
const client = () => supabase ??= supabaseFor(auth, headers);
|
|
892
|
+
const client = () => supabase ??= supabaseFor(auth, sharesClient ? clientHeaders : headers);
|
|
812
893
|
let replica;
|
|
813
894
|
const replicaUrl = () => {
|
|
814
895
|
const url = readUrl();
|
|
@@ -817,6 +898,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
817
898
|
};
|
|
818
899
|
return {
|
|
819
900
|
...credentials,
|
|
901
|
+
...ids,
|
|
820
902
|
auth,
|
|
821
903
|
resolution,
|
|
822
904
|
get supabase() {
|
|
@@ -825,7 +907,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
825
907
|
get db() {
|
|
826
908
|
if (db) return db;
|
|
827
909
|
const url = replicaUrl();
|
|
828
|
-
const rest = supabase ?? restAt(env().url, auth, headers);
|
|
910
|
+
const rest = (sharesClient ? void 0 : supabase) ?? restAt(env().url, auth, headers);
|
|
829
911
|
const connected = betterSupabase.connect(rest, context, {
|
|
830
912
|
stats: recorder,
|
|
831
913
|
...url && replica ? { executor: routedExecutor(postgrestExecutor(rest, executorOptions), postgrestExecutor(restAt(url, auth, headers), executorOptions), replica) } : tunedExecutor ? { executor: postgrestExecutor(rest, executorOptions) } : {}
|
|
@@ -850,7 +932,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
850
932
|
}
|
|
851
933
|
};
|
|
852
934
|
};
|
|
853
|
-
const fromResolution = (resolution, request, contextOptions, tenant) => contextFor(resolution, options.headers?.(request) ?? {}, contextOptions.stats, contextOptions.pinnedUntil ?? (readUrl() ? pinnedUntil(resolution.requestCookies) : 0), tenant, contextOptions.support);
|
|
935
|
+
const fromResolution = (resolution, request, contextOptions, tenant) => contextFor(resolution, options.headers?.(request) ?? {}, contextOptions.stats, contextOptions.pinnedUntil ?? (readUrl() ? pinnedUntil(resolution.requestCookies) : 0), tenant, contextOptions.support, idPolicy.forRequest(request, contextOptions));
|
|
854
936
|
const resolve = async (request, resolveOptions = {}) => {
|
|
855
937
|
const claims = options.auth?.claims ?? betterSupabase.claimsSchema;
|
|
856
938
|
const userMetadata = betterSupabase.userMetadataSchema;
|
|
@@ -902,7 +984,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
902
984
|
headers: {},
|
|
903
985
|
requestCookies: [],
|
|
904
986
|
apply: (response) => response
|
|
905
|
-
}, {}, contextOptions.stats, contextOptions.pinnedUntil, contextOptions.tenant, contextOptions.support),
|
|
987
|
+
}, {}, contextOptions.stats, contextOptions.pinnedUntil, contextOptions.tenant, contextOptions.support, idPolicy.forRequest(void 0, contextOptions)),
|
|
906
988
|
context(request, contextOptions = {}) {
|
|
907
989
|
const { refresh, cookies, ...rest } = contextOptions;
|
|
908
990
|
const key = Object.keys(rest).length === 0 ? `${String(refresh ?? false)}:${String(cookies ?? true)}` : void 0;
|
|
@@ -998,10 +1080,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
998
1080
|
reason: forOptions.reason ?? "job"
|
|
999
1081
|
}) } : {}
|
|
1000
1082
|
};
|
|
1001
|
-
const session = {
|
|
1002
|
-
...support?.readOnly ? { readOnly: true } : {},
|
|
1003
|
-
...tenant === void 0 ? {} : { settings: { "better_supabase.tenant": tenant } }
|
|
1004
|
-
};
|
|
1083
|
+
const session = sessionWith({}, tenant, support?.readOnly);
|
|
1005
1084
|
return ok(sqlFor(claims, {
|
|
1006
1085
|
actor: {
|
|
1007
1086
|
id: actor.id,
|
|
@@ -1011,7 +1090,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
1011
1090
|
},
|
|
1012
1091
|
claims,
|
|
1013
1092
|
...tenant === void 0 ? {} : { tenant }
|
|
1014
|
-
}, void 0,
|
|
1093
|
+
}, void 0, session));
|
|
1015
1094
|
});
|
|
1016
1095
|
}
|
|
1017
1096
|
};
|
|
@@ -1103,4 +1182,4 @@ async function resolveToken(server, token) {
|
|
|
1103
1182
|
return auth;
|
|
1104
1183
|
}
|
|
1105
1184
|
//#endregion
|
|
1106
|
-
export { serverCore as C,
|
|
1185
|
+
export { serverCore as C, suspendAccount as D, lastSignIns as E, deleteAccount as O, withServerContext as S, endSessions as T, withSession as _, unexpectedResponse as a, shouldCheckSession as b, extendServer as c, clearSupportCookie as d, supportCookie as f, withSupport as g, withTenant as h, resolveToken as i, withExtra as l, supportCookieValue as m, flushEvents as n, TENANT_HEADER as o, supportCookieMaxAge as p, handle as r, createServer as s, bearerRequest as t, SUPPORT_COOKIE as u, isPrefetch as v, SERVER_EVENT_SOURCE as w, shouldRefresh as x, refreshFor as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as AsyncResult } from "../../result-D7y2fT87.js";
|
|
2
2
|
import { i as CursorPageOptions } from "../../block-helpers-CKtbFcRv.js";
|
|
3
3
|
import { m as JobHandler } from "../../queue-CLJurhdy.js";
|
|
4
|
-
import { i as AiBatchItemInput, r as AiBatchItem, t as AiBatch, u as AiProviders } from "../../types-
|
|
4
|
+
import { i as AiBatchItemInput, r as AiBatchItem, t as AiBatch, u as AiProviders } from "../../types-6rocye-y.js";
|
|
5
5
|
import { Experimental_BatchItemResult, Experimental_BatchProvider, Experimental_BatchReference, Experimental_BatchStatus, Experimental_StartBatchOptions, Experimental_StartBatchResult } from "ai";
|
|
6
6
|
//#region src/ai-sdk/batches/batches.d.ts
|
|
7
7
|
/** The AI SDK batch calls, replaceable in tests. */
|
package/dist/ai-sdk/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { b as DbError, t as AsyncResult } from "../result-D7y2fT87.js";
|
|
3
3
|
import { m as JobHandler } from "../queue-CLJurhdy.js";
|
|
4
4
|
import { U as AiSandboxes } from "../ai-chat-7amvXjmQ.js";
|
|
5
|
-
import { p as ResolvedProviderKey, u as AiProviders } from "../types-
|
|
5
|
+
import { p as ResolvedProviderKey, u as AiProviders } from "../types-6rocye-y.js";
|
|
6
6
|
import { i as Usage } from "../usage-CrvrL2vw.js";
|
|
7
7
|
import { _ as usageOf, a as GatewayClient, c as GatewayOptions, d as costBackfill, f as gatewayOptions, g as usageEntries, h as problem429, i as CostBackfillPayload, l as ModelCatalogRefreshOptions, m as modelInputOf, n as AiUsageMeters, o as GatewayContext, p as modelCatalogRefresh, r as CostBackfillOptions, s as GatewayModelEntry, t as AiUsage, u as UsageSource, v as usageQuota } from "../gateway-C1ssRHnf.js";
|
|
8
8
|
import { a as ModelSource, c as isUIMessage, i as ModelApproval, l as toUIMessage, n as DENIED_TOOL_OUTPUT, o as fromModelMessages, r as FromModelMessagesOptions, s as fromUIMessage, t as AI_SDK_UI_FORMAT, u as toUIMessages } from "../messages-DYP0sUTe.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as DbError, t as AsyncResult } from "../../result-D7y2fT87.js";
|
|
2
|
-
import { i as CredentialRef, r as CredentialProvider } from "../../provider-
|
|
3
|
-
import { r as ConnectorServer, s as Connectors } from "../../connectors-
|
|
4
|
-
import { n as VaultCredentials } from "../../vault-
|
|
2
|
+
import { i as CredentialRef, r as CredentialProvider } from "../../provider-D-UEMvSD.js";
|
|
3
|
+
import { r as ConnectorServer, s as Connectors } from "../../connectors-CrpknU0P.js";
|
|
4
|
+
import { n as VaultCredentials } from "../../vault-wlbBhqm7.js";
|
|
5
5
|
import { ToolSet } from "ai";
|
|
6
6
|
import { ElicitResult, ElicitationRequest, MCPClient, OAuthClientMetadata, OAuthClientProvider } from "@ai-sdk/mcp";
|
|
7
7
|
//#region src/ai-sdk/mcp/mcp.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { t as AsyncResult } from "./result-D7y2fT87.js";
|
|
3
3
|
import { t as BlockTransport } from "./block-transport-DvaoPuZ9.js";
|
|
4
|
-
import { n as AuthResolver } from "./resolve-
|
|
4
|
+
import { n as AuthResolver } from "./resolve-ChTYeTEl.js";
|
|
5
5
|
import { r as BlockTemporalOptions } from "./block-helpers-CKtbFcRv.js";
|
|
6
6
|
import { JWTClaims } from "@supabase/server";
|
|
7
7
|
//#region src/blocks/api-keys/api-keys.d.ts
|
package/dist/astro/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as AnyModels, i as AnyFunctions } from "../types-6BdhkmZe.js";
|
|
2
2
|
import { t as BetterSupabase } from "../define-CJJkkr1-.js";
|
|
3
|
-
import { t as BetterServer } from "../server-
|
|
3
|
+
import { t as BetterServer } from "../server-ZSJ9rCcV.js";
|
|
4
4
|
import { j as StorageImageOptions } from "../index-D48jVS-N.js";
|
|
5
|
-
import { a as AuthorizedContext, c as Unwrapped, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-
|
|
6
|
-
import { t as RefusalRedirects } from "../refusal-
|
|
7
|
-
import { n as FrameworkOptions, t as FrameworkLocals } from "../framework-
|
|
5
|
+
import { a as AuthorizedContext, c as Unwrapped, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-CkNzZUqv.js";
|
|
6
|
+
import { t as RefusalRedirects } from "../refusal-DhSU2Vvr.js";
|
|
7
|
+
import { n as FrameworkOptions, t as FrameworkLocals } from "../framework-KIPvRQJU.js";
|
|
8
8
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
9
9
|
//#region src/astro/index.d.ts
|
|
10
10
|
/** The part of Astro's `APIContext` (middleware, pages, endpoints, actions) the integration uses. */
|
package/dist/astro/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-
|
|
1
|
+
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-B-tL8hqg.js";
|
|
2
2
|
import { t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
3
3
|
import { i as requireCaller, o as runAction } from "../kit-Fm-Fv7q5.js";
|
|
4
4
|
import { t as storageImageUrl } from "../image-url-pIVlO6R1.js";
|
|
5
5
|
import { t as around } from "../shared-CBxosKK3.js";
|
|
6
|
-
import { i as localsOf, r as frameworkEntry } from "../framework-
|
|
6
|
+
import { i as localsOf, r as frameworkEntry } from "../framework-BDCpJI7o.js";
|
|
7
7
|
import { r as refusalResponse } from "../refusal-CeJWxmkH.js";
|
|
8
8
|
//#region src/astro/index.ts
|
|
9
9
|
function runtimeEnv(locals) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../../block-transport-DvaoPuZ9.js";
|
|
2
|
-
import { a as AiBatchItemStatus, c as AiProviderKey, d as AiProvidersOptions, f as NewAiBatch, i as AiBatchItemInput, l as AiProviderKeyInput, n as AiBatchCounts, o as AiBatchPatch, p as ResolvedProviderKey, r as AiBatchItem, s as AiBatchStatus, t as AiBatch, u as AiProviders } from "../../types-
|
|
2
|
+
import { a as AiBatchItemStatus, c as AiProviderKey, d as AiProvidersOptions, f as NewAiBatch, i as AiBatchItemInput, l as AiProviderKeyInput, n as AiBatchCounts, o as AiBatchPatch, p as ResolvedProviderKey, r as AiBatchItem, s as AiBatchStatus, t as AiBatch, u as AiProviders } from "../../types-6rocye-y.js";
|
|
3
3
|
//#region src/blocks/ai-providers/ai-providers.d.ts
|
|
4
4
|
/** Per-tenant provider keys and provider batch jobs. */
|
|
5
5
|
export declare function createAiProviders(options: AiProvidersOptions): AiProviders;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../../block-transport-DvaoPuZ9.js";
|
|
2
|
-
import { r as AuthState } from "../../resolve-
|
|
2
|
+
import { r as AuthState } from "../../resolve-ChTYeTEl.js";
|
|
3
3
|
import { t as BlockProblemOptions } from "../../problem-DD8LZFjc.js";
|
|
4
|
-
import { a as ApiKeyResolverOptions, c as ApiKeysOptions, d as ParsedApiKey, f as apiKeyChecksum, g as parseApiKey, h as createApiKeys, i as ApiKeyExtraClaim, l as CreateApiKeyInput, m as apiKeyResolver, n as ApiKeyCheck, o as ApiKeyState, p as apiKeyClaims, r as ApiKeyClaimsOptions, s as ApiKeys, t as ApiKey, u as CreatedApiKey } from "../../api-keys-
|
|
4
|
+
import { a as ApiKeyResolverOptions, c as ApiKeysOptions, d as ParsedApiKey, f as apiKeyChecksum, g as parseApiKey, h as createApiKeys, i as ApiKeyExtraClaim, l as CreateApiKeyInput, m as apiKeyResolver, n as ApiKeyCheck, o as ApiKeyState, p as apiKeyClaims, r as ApiKeyClaimsOptions, s as ApiKeys, t as ApiKey, u as CreatedApiKey } from "../../api-keys-CIjghYjV.js";
|
|
5
5
|
import { Entry } from "@supabase/middleware";
|
|
6
6
|
import { AuthMode, JWTClaims, UserClaims } from "@supabase/server";
|
|
7
7
|
//#region src/blocks/api-keys/pipeline.d.ts
|
|
@@ -152,9 +152,16 @@ interface AttachmentScanJob {
|
|
|
152
152
|
interface AttachmentScanner {
|
|
153
153
|
/** Scans one uploaded file and records the verdict. */
|
|
154
154
|
scan(id: string, signal?: AbortSignal): AsyncResult<Attachment>;
|
|
155
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* A jobs handler: `queue.work('attachment-scans', scanner.job)`. A deleted
|
|
157
|
+
* attachment completes the job; other errors throw so the queue retries.
|
|
158
|
+
*/
|
|
156
159
|
readonly job: JobHandler<AttachmentScanJob>;
|
|
157
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* An outbox sink that scans each `attachment.uploaded` event's file. An
|
|
162
|
+
* event for a deleted attachment is skipped, so it never holds up the
|
|
163
|
+
* events behind it; other errors throw so the relay retries the batch.
|
|
164
|
+
*/
|
|
158
165
|
sink(): EventSink;
|
|
159
166
|
}
|
|
160
167
|
/**
|
|
@@ -193,9 +200,16 @@ interface ObjectScanJob {
|
|
|
193
200
|
interface ObjectScanner {
|
|
194
201
|
/** Scans one object and records the verdict; a clean or infected object is not scanned again. */
|
|
195
202
|
scan(bucket: string, path: string, signal?: AbortSignal): AsyncResult<ScannedObject>;
|
|
196
|
-
/**
|
|
203
|
+
/**
|
|
204
|
+
* A jobs handler: `queue.work('object-scans', scanner.job)`. An object
|
|
205
|
+
* deleted from storage completes the job; other errors throw.
|
|
206
|
+
*/
|
|
197
207
|
readonly job: JobHandler<ObjectScanJob>;
|
|
198
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* An outbox sink that scans each `object.uploaded` event's object. An
|
|
210
|
+
* event for an object deleted from storage is skipped; other errors throw
|
|
211
|
+
* so the relay retries the batch.
|
|
212
|
+
*/
|
|
199
213
|
sink(): EventSink;
|
|
200
214
|
}
|
|
201
215
|
/**
|
|
@@ -49,6 +49,18 @@ function stored(reply) {
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Waits for a scan from a job or an event. A scan whose target is gone (the
|
|
54
|
+
* attachment row, or for an object the stored object) is done, not a
|
|
55
|
+
* failure, so the job or event is not retried; every other error throws.
|
|
56
|
+
*/
|
|
57
|
+
async function settle(scanned, gone) {
|
|
58
|
+
const result = await scanned;
|
|
59
|
+
if (result.ok || gone(result.error)) return;
|
|
60
|
+
await scanned.orThrow();
|
|
61
|
+
}
|
|
62
|
+
const attachmentGone = (error) => error.kind === "not_found" && error.hint === "ATTACHMENT_NOT_FOUND";
|
|
63
|
+
const objectGone = (error) => error.kind === "not_found" && error.code === "NoSuchKey";
|
|
52
64
|
function lookup(call, id) {
|
|
53
65
|
return call("get_attachment", { id }, (value) => value).andThen((value) => Promise.resolve(isRecord(value) ? ok(attachmentOf(value)) : err(notFound())));
|
|
54
66
|
}
|
|
@@ -145,13 +157,13 @@ function createAttachmentScanner(options) {
|
|
|
145
157
|
return {
|
|
146
158
|
scan,
|
|
147
159
|
job: async (payload, _job, signal) => {
|
|
148
|
-
await scan(payload.attachmentId, signal)
|
|
160
|
+
await settle(scan(payload.attachmentId, signal), attachmentGone);
|
|
149
161
|
},
|
|
150
162
|
sink: () => ({ async send(events) {
|
|
151
163
|
for (const event of events) {
|
|
152
164
|
if ((event.type.startsWith(prefix) ? event.type.slice(prefix.length) : event.type) !== "attachment.uploaded" || !isRecord(event.data)) continue;
|
|
153
165
|
const id = optionalText(event.data["attachmentId"]);
|
|
154
|
-
if (id !== void 0) await scan(id)
|
|
166
|
+
if (id !== void 0) await settle(scan(id), attachmentGone);
|
|
155
167
|
}
|
|
156
168
|
} })
|
|
157
169
|
};
|
|
@@ -206,14 +218,14 @@ function createObjectScanner(options) {
|
|
|
206
218
|
return {
|
|
207
219
|
scan,
|
|
208
220
|
job: async (payload, _job, signal) => {
|
|
209
|
-
await scan(payload.bucket, payload.path, signal)
|
|
221
|
+
await settle(scan(payload.bucket, payload.path, signal), objectGone);
|
|
210
222
|
},
|
|
211
223
|
sink: () => ({ async send(events) {
|
|
212
224
|
for (const event of events) {
|
|
213
225
|
if ((event.type.startsWith(prefix) ? event.type.slice(prefix.length) : event.type) !== "object.uploaded" || !isRecord(event.data)) continue;
|
|
214
226
|
const bucket = optionalText(event.data["bucket"]);
|
|
215
227
|
const path = optionalText(event.data["path"]);
|
|
216
|
-
if (bucket !== void 0 && path !== void 0) await scan(bucket, path)
|
|
228
|
+
if (bucket !== void 0 && path !== void 0) await settle(scan(bucket, path), objectGone);
|
|
217
229
|
}
|
|
218
230
|
} })
|
|
219
231
|
};
|
|
@@ -3,11 +3,11 @@ import { n as dbError } from "../../errors-B11Duf73.js";
|
|
|
3
3
|
import { t as temporal } from "../../temporal-required-BVvW7SYJ.js";
|
|
4
4
|
import { a as ok, r as err, t as AsyncResult } from "../../result-DzUbqgdW.js";
|
|
5
5
|
import { t as SPEC_PINS } from "../../spec-pins--j6mTok4.js";
|
|
6
|
+
import { n as toCsv } from "../../csv-DCK-PT1n.js";
|
|
6
7
|
import { r as sqlIdent } from "../../template--jDkl3UP.js";
|
|
7
8
|
import { n as rpcTransport, r as sqlTransport } from "../../block-transport-BLr-ZgLc.js";
|
|
8
9
|
import { C as run, D as stringsOf, O as textOf, d as isRecord, g as pageOf, h as optionalText, i as blockCall, m as optionalInstant, n as applyTemporal, u as instantArg, w as seconds } from "../../block-helpers-DWHxHsEQ.js";
|
|
9
10
|
import { n as defineListQuery } from "../../list-query-gl808ac1.js";
|
|
10
|
-
import { t as toCsv } from "../../csv-CPAzEmB6.js";
|
|
11
11
|
//#region src/blocks/audit/audit.ts
|
|
12
12
|
const RETENTION_MANY = /* @__PURE__ */ new WeakMap();
|
|
13
13
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../../block-transport-DvaoPuZ9.js";
|
|
2
|
-
import { a as ConnectorSession, c as ConnectorsOptions, i as ConnectorServerFields, l as FingerprintStatus, n as ConnectorGrant, o as ConnectorTransport, r as ConnectorServer, s as Connectors, t as ConnectorAuth, u as createConnectors } from "../../connectors-
|
|
2
|
+
import { a as ConnectorSession, c as ConnectorsOptions, i as ConnectorServerFields, l as FingerprintStatus, n as ConnectorGrant, o as ConnectorTransport, r as ConnectorServer, s as Connectors, t as ConnectorAuth, u as createConnectors } from "../../connectors-CrpknU0P.js";
|
|
3
3
|
export { type BlockTransport, type ConnectorAuth, type ConnectorGrant, type ConnectorServer, type ConnectorServerFields, type ConnectorSession, type ConnectorTransport, type Connectors, type ConnectorsOptions, type FingerprintStatus, createConnectors, rpcTransport, sqlTransport };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { t as AsyncResult, w as ErrorMapper } from "../../result-D7y2fT87.js";
|
|
3
3
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../../block-transport-DvaoPuZ9.js";
|
|
4
|
-
import { a as CredentialSubject, i as CredentialRef, r as CredentialProvider } from "../../provider-
|
|
4
|
+
import { a as CredentialSubject, i as CredentialRef, r as CredentialProvider } from "../../provider-D-UEMvSD.js";
|
|
5
5
|
import { r as BlockTemporalOptions } from "../../block-helpers-CKtbFcRv.js";
|
|
6
6
|
import { m as JobHandler } from "../../queue-CLJurhdy.js";
|
|
7
7
|
import { r as EventSink } from "../../cloud-event-C1JCc1bH.js";
|
|
@@ -132,9 +132,17 @@ interface DataExporter {
|
|
|
132
132
|
* emits `data_export.completed`). A failure marks it failed and returns the error.
|
|
133
133
|
*/
|
|
134
134
|
run(exportId: string, signal?: AbortSignal): AsyncResult<DataExport>;
|
|
135
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* A jobs handler: `queue.work('data-exports', exporter.job)`. An export
|
|
137
|
+
* that is no longer pending or failed (cancelled, deleted, running or
|
|
138
|
+
* ready) completes the job; other errors throw so the queue retries.
|
|
139
|
+
*/
|
|
136
140
|
readonly job: JobHandler<DataExportJob>;
|
|
137
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* An outbox sink that runs each `data_export.requested` export. An event
|
|
143
|
+
* for an export that is no longer pending or failed is skipped, so it never
|
|
144
|
+
* holds up the events behind it; other errors throw so the relay retries.
|
|
145
|
+
*/
|
|
138
146
|
sink(): EventSink;
|
|
139
147
|
}
|
|
140
148
|
/** Runs requested exports with a service-role client. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as dbError } from "../../errors-B11Duf73.js";
|
|
2
2
|
import { a as ok, r as err, t as AsyncResult } from "../../result-DzUbqgdW.js";
|
|
3
|
+
import { n as toCsv } from "../../csv-DCK-PT1n.js";
|
|
3
4
|
import { n as credentialRefInTenant } from "../../provider-Di3sRutW.js";
|
|
4
5
|
import { n as rpcTransport, r as sqlTransport } from "../../block-transport-BLr-ZgLc.js";
|
|
5
6
|
import { D as stringsOf, O as textOf, c as errorText, d as isRecord, h as optionalText, i as blockCall, k as toInstant, m as optionalInstant, n as applyTemporal, x as recordsOf, y as recordOf } from "../../block-helpers-DWHxHsEQ.js";
|
|
6
|
-
import { t as toCsv } from "../../csv-CPAzEmB6.js";
|
|
7
7
|
import { t as fromStorageError } from "../../errors-DLjJHPLK.js";
|
|
8
8
|
//#region src/blocks/data-lifecycle/data-lifecycle.ts
|
|
9
9
|
const EXPORT_STATUSES = [
|
|
@@ -180,16 +180,21 @@ function createDataExporter(options) {
|
|
|
180
180
|
files: written.data
|
|
181
181
|
}, exportOf);
|
|
182
182
|
});
|
|
183
|
+
const settle = async (ran) => {
|
|
184
|
+
const result = await ran;
|
|
185
|
+
if (result.ok || result.error.hint === "DATA_EXPORT_NOT_FOUND") return;
|
|
186
|
+
await ran.orThrow();
|
|
187
|
+
};
|
|
183
188
|
return {
|
|
184
189
|
run,
|
|
185
190
|
job: async (payload, _job, signal) => {
|
|
186
|
-
await run(payload.exportId, signal)
|
|
191
|
+
await settle(run(payload.exportId, signal));
|
|
187
192
|
},
|
|
188
193
|
sink: () => ({ async send(events) {
|
|
189
194
|
for (const event of events) {
|
|
190
195
|
if ((event.type.startsWith(prefix) ? event.type.slice(prefix.length) : event.type) !== "data_export.requested" || !isRecord(event.data)) continue;
|
|
191
196
|
const id = optionalText(event.data["exportId"]);
|
|
192
|
-
if (id !== void 0) await run(id)
|
|
197
|
+
if (id !== void 0) await settle(run(id));
|
|
193
198
|
}
|
|
194
199
|
} })
|
|
195
200
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AsyncResult } from "../../result-D7y2fT87.js";
|
|
2
2
|
import { t as SqlClient } from "../../executor-DbvExCFC.js";
|
|
3
|
-
import { i as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-
|
|
3
|
+
import { i as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-BKSVGtrG.js";
|
|
4
4
|
//#region src/blocks/entitlements/entitlements.d.ts
|
|
5
5
|
/** The Stripe event sent when a customer's active entitlements change. */
|
|
6
6
|
export declare const ENTITLEMENTS_UPDATED = "entitlements.active_entitlement_summary.updated";
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as sqlTransport, n as RpcClient, r as rpcTransport, t as BlockTransport } from "../block-transport-DvaoPuZ9.js";
|
|
2
2
|
import { a as EventHub } from "../events-DWDhx77e.js";
|
|
3
|
-
import { r as CredentialProvider } from "../provider-
|
|
3
|
+
import { r as CredentialProvider } from "../provider-D-UEMvSD.js";
|
|
4
4
|
import { i as CursorPageOptions, n as BlockOptions } from "../block-helpers-CKtbFcRv.js";
|
|
5
5
|
import { f as AiFiles } from "../types-C05bxW-W.js";
|
|
6
6
|
import { n as FinalRunState, r as RunState, t as FINAL_RUN_STATES } from "../run-state-CPo-1X2B.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as AsyncResult, w as ErrorMapper } from "../../result-D7y2fT87.js";
|
|
3
3
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../../block-transport-DvaoPuZ9.js";
|
|
4
4
|
import { r as BlockTemporalOptions } from "../../block-helpers-CKtbFcRv.js";
|
|
5
|
-
import { s as ApiKeys } from "../../api-keys-
|
|
5
|
+
import { s as ApiKeys } from "../../api-keys-CIjghYjV.js";
|
|
6
6
|
//#region src/blocks/sso/sso.d.ts
|
|
7
7
|
/** The DNS record that proves a domain belongs to the organization. */
|
|
8
8
|
interface DomainRecord {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../../block-transport-DvaoPuZ9.js";
|
|
2
|
-
import { A as approved, C as WorkflowCondition, D as WorkflowGraphEdge, E as WorkflowGraphDiff, F as validateGraph, M as durationMs, N as evaluateCondition, O as WorkflowGraphNode, P as topologicalOrder, S as WorkflowVersionStatus, T as WorkflowGraph, _ as WorkflowNodeRunStatus, a as CredentialInput, b as WorkflowTriggerKind, c as NodeRunRecord, d as TriggerInput, f as WorkflowAlert, g as WorkflowNodeRun, h as WorkflowDefinition, i as BuilderStarter, j as diffGraphs, k as WorkflowNodeKind, l as OutboxLikeEvent, m as WorkflowCredential, n as BuilderOptions, o as DefinitionInput, p as WorkflowBuilder, r as BuilderStartCall, s as GraphCompiler, t as AlertInput, u as RunInput, v as WorkflowStepInfo, w as WorkflowConditionOperator, x as WorkflowVersion, y as WorkflowTrigger } from "../../types-
|
|
3
|
-
import { i as executeGraph, n as GraphStepCall, r as approvalToken, t as GraphRuntime } from "../../executor-
|
|
2
|
+
import { A as approved, C as WorkflowCondition, D as WorkflowGraphEdge, E as WorkflowGraphDiff, F as validateGraph, M as durationMs, N as evaluateCondition, O as WorkflowGraphNode, P as topologicalOrder, S as WorkflowVersionStatus, T as WorkflowGraph, _ as WorkflowNodeRunStatus, a as CredentialInput, b as WorkflowTriggerKind, c as NodeRunRecord, d as TriggerInput, f as WorkflowAlert, g as WorkflowNodeRun, h as WorkflowDefinition, i as BuilderStarter, j as diffGraphs, k as WorkflowNodeKind, l as OutboxLikeEvent, m as WorkflowCredential, n as BuilderOptions, o as DefinitionInput, p as WorkflowBuilder, r as BuilderStartCall, s as GraphCompiler, t as AlertInput, u as RunInput, v as WorkflowStepInfo, w as WorkflowConditionOperator, x as WorkflowVersion, y as WorkflowTrigger } from "../../types-AYOvcyep.js";
|
|
3
|
+
import { i as executeGraph, n as GraphStepCall, r as approvalToken, t as GraphRuntime } from "../../executor-BVBFM86G.js";
|
|
4
4
|
//#region src/blocks/workflow-builder/workflow-builder.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The `workflow-builder` module's definitions, versions, triggers,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as DbError } from "../../../result-D7y2fT87.js";
|
|
2
2
|
import { x as SubscriptionStatus } from "../../../index-DunNRdnT.js";
|
|
3
3
|
import { t as WorkflowRun } from "../../../workflows-B0j9WKPu.js";
|
|
4
|
-
import { g as WorkflowNodeRun, h as WorkflowDefinition, p as WorkflowBuilder, v as WorkflowStepInfo } from "../../../types-
|
|
4
|
+
import { g as WorkflowNodeRun, h as WorkflowDefinition, p as WorkflowBuilder, v as WorkflowStepInfo } from "../../../types-AYOvcyep.js";
|
|
5
5
|
//#region src/blocks/workflow-builder/react/index.d.ts
|
|
6
6
|
export interface UseWorkflowBuilderOptions {
|
|
7
7
|
/** The tenant whose definitions to list. */
|
package/dist/chat-sdk/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { t as AsyncResult, w as ErrorMapper } from "../result-D7y2fT87.js";
|
|
3
3
|
import { i as sqlTransport, r as rpcTransport, t as BlockTransport } from "../block-transport-DvaoPuZ9.js";
|
|
4
|
-
import { a as CredentialSubject, i as CredentialRef, o as CredentialToken, r as CredentialProvider } from "../provider-
|
|
4
|
+
import { a as CredentialSubject, i as CredentialRef, o as CredentialToken, r as CredentialProvider } from "../provider-D-UEMvSD.js";
|
|
5
5
|
import { o as StreamStore } from "../store-CGjgWu5n.js";
|
|
6
6
|
import { C as InboxMessage, T as MessageAttachment, a as Inbox, b as InboundResult, h as Conversation, j as StoredInboundEvent, y as DeliveryStatus } from "../inbox-i7E1ppo6.js";
|
|
7
7
|
import { Adapter, AdapterPostableMessage, Attachment, Message, RawMessage, StateAdapter, WebhookOptions } from "chat";
|
package/dist/cli/bin.js
CHANGED