better-supabase 0.29.0 → 0.31.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-D4aNBxhm.js → adapter-BTbj5N9C.js} +2 -52
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/{app-tables-DekyKNQ8.d.ts → app-tables-B2mKMNRQ.d.ts} +1 -1
- package/dist/astro/index.js +2 -2
- package/dist/{authorization-C7nuWMuB.d.ts → authorization-DfEkyFt_.d.ts} +24 -3
- package/dist/{bind-DmUGUsBd.d.ts → bind-DAx0bMSi.d.ts} +2 -2
- package/dist/{block-env-DWtZsqhH.d.ts → block-env-Dz7Caxk0.d.ts} +3 -3
- package/dist/blocks/ai-chat/index.d.ts +3 -3
- package/dist/blocks/announcements/index.d.ts +3 -3
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +1 -1
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/automations/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +1 -1
- package/dist/blocks/bookings/index.d.ts +1 -1
- package/dist/blocks/calendar/index.d.ts +7 -3
- package/dist/blocks/calendar/index.js +5 -1
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/employees/index.js +1 -4
- package/dist/blocks/entitlements/index.d.ts +2 -2
- package/dist/blocks/forms/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +4 -4
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/messaging/index.d.ts +4 -4
- package/dist/blocks/mfa/index.d.ts +1 -1
- package/dist/blocks/notifications/index.d.ts +3 -3
- package/dist/blocks/notifications/index.js +5 -43
- package/dist/blocks/onboarding/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +34 -21
- package/dist/blocks/organizations/index.js +5 -1
- package/dist/blocks/permissions/index.d.ts +32 -3
- package/dist/blocks/permissions/index.js +23 -2
- package/dist/blocks/push/index.d.ts +10 -2
- package/dist/blocks/push/index.js +23 -7
- package/dist/blocks/reactions/index.d.ts +3 -3
- package/dist/blocks/saved-views/index.d.ts +1 -1
- package/dist/blocks/search/index.d.ts +2 -2
- package/dist/blocks/sessions/index.d.ts +1 -1
- package/dist/blocks/settings/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +1 -1
- package/dist/blocks/tags/index.d.ts +1 -1
- package/dist/blocks/tasks/index.js +1 -1
- package/dist/blocks/teams/index.d.ts +7 -1
- package/dist/blocks/teams/index.js +8 -7
- package/dist/blocks/undo/index.d.ts +1 -1
- package/dist/blocks/usage/index.d.ts +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +3 -3
- package/dist/blocks/workflows/index.d.ts +3 -3
- package/dist/cli/{add-BKkV99g9.js → add-B9wP0YGU.js} +2 -2
- package/dist/cli/{add-CrQ3jS7t.js → add-DjZXKd7X.js} +10 -10
- package/dist/cli/add-ZcEOEK23.js +1 -0
- package/dist/cli/{app-table-files-PnPOpuB4.js → app-table-files-mtvjHa48.js} +2 -2
- package/dist/cli/{backfill-DDDLhinm.js → backfill-Coshdvh_.js} +2 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-tRfYx_mh.js → blocks-BWCuA0nq.js} +2 -2
- package/dist/cli/{blocks-BCVcjvbm.js → blocks-hiSazThw.js} +1 -1
- package/dist/cli/{cache-DQZ09YOg.js → cache-x2wWAy0h.js} +1 -1
- package/dist/cli/{codemod-HKuwQmi_.js → codemod-BnjV7BpC.js} +210 -11
- package/dist/cli/{command-DIPmo0wh.js → command-CCAwhiOh.js} +6 -0
- package/dist/cli/{completion-DxPxMtyP.js → completion-BJaB84Pe.js} +2 -2
- package/dist/cli/{completion-DyLMSjOD.js → completion-BkUhs1ms.js} +1 -1
- package/dist/cli/{completion-FUgqm2-N.js → completion-DmUVsUVQ.js} +2 -2
- package/dist/cli/{config-BfapErxs.js → config-zId1jkLx.js} +1 -1
- package/dist/cli/{content-mapper-B0ehR7K-.js → content-mapper-DvOSOdTE.js} +2 -2
- package/dist/cli/{db-CWvH1_46.js → db-DXKyVEDF.js} +1 -1
- package/dist/cli/{doctor-CXJOhwLB.js → doctor-Ywy8oJEU.js} +76 -18
- package/dist/cli/env-CNjT_uOV.js +1 -0
- package/dist/cli/{env-BM242BCV.js → env-XMiKvhtV.js} +2 -2
- package/dist/cli/{gen-B7rw4j19.js → gen-B-FbQmG1.js} +14 -14
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-C1bXXB_P.js → init-fb9e1BKX.js} +9 -9
- package/dist/cli/{keys-V-HcO-21.js → keys-ORiPz1sM.js} +1 -1
- package/dist/cli/{live-PpAh9pAc.js → live-DIt7TP-N.js} +2 -2
- package/dist/cli/{mcp-BRNAchdH.js → mcp-CVWwraga.js} +3 -3
- package/dist/cli/{metadata-dAAKb_kR.js → metadata-CannIjel.js} +3 -3
- package/dist/cli/{migrate-BWYXFnaW.js → migrate-Ht2TzIQF.js} +2 -2
- package/dist/cli/{migration-safety-DGQswWZy.js → migration-safety-nNyB05I-.js} +1 -1
- package/dist/cli/{migrations-Cqk-lJwu.js → migrations-bAd7dpk1.js} +2 -2
- package/dist/cli/{module-migration-8-hMiZtW.js → module-migration-CkNux8dr.js} +2 -2
- package/dist/cli/{moved-DNOtp9LA.js → moved-C3WyRHkA.js} +1 -1
- package/dist/cli/{parse-BPf3kGnc.js → parse-DjHbTaFI.js} +1 -1
- package/dist/cli/{powersync-BWQ-8T3G.js → powersync-B2v0tDwp.js} +100 -7
- package/dist/cli/powersync-D3mAQ6QE.js +1 -0
- package/dist/cli/{print-DSTnq5xz.js → print-CxQ0rBKT.js} +2 -2
- package/dist/cli/{providers-Cjf5iOp5.js → providers-DtI90lSw.js} +1 -1
- package/dist/cli/{remove-CwG8cPv1.js → remove-DYtE4IZ4.js} +6 -6
- package/dist/cli/{render-B18iAdsT.js → render-QGWfEoiB.js} +3 -3
- package/dist/cli/{run-CvPl8iQd.js → run-B5aMwErM.js} +3 -3
- package/dist/cli/{run-C2Yg5MWt.js → run-BNoJKf5I.js} +40 -39
- package/dist/cli/{run-Wx_2Acgv.js → run-DiYX1XEa.js} +8 -8
- package/dist/cli/{seed-CDnL4Tnc.js → seed-C-Hu2n_E.js} +1 -1
- package/dist/cli/seed-Cm-c0BDd.js +1 -0
- package/dist/cli/{shared-BHbtUOvh.js → shared-D_CFi5di.js} +1 -1
- package/dist/cli/{skills-DM3oeIxY.js → skills-D98y0bSB.js} +1 -1
- package/dist/cli/{snapshot-CXgsUPGj.js → snapshot-BlQ4DDcJ.js} +9 -4
- package/dist/cli/{source-B6aMAoEK.js → source-CelMBQMj.js} +1 -1
- package/dist/cli/{spec-EO0TP84d.js → spec-BxcoGE0h.js} +1 -1
- package/dist/cli/{spec-BcYic005.js → spec-iBx1LcYO.js} +3 -3
- package/dist/cli/{sql-layout-CkxDNVEH.js → sql-layout-Dp4Rottt.js} +2 -2
- package/dist/cli/{stack-ClESAZYf.js → stack-B2slzrYH.js} +1 -1
- package/dist/cli/{stack-env-6hS-WEmh.js → stack-env-3ziggrU3.js} +1 -1
- package/dist/cli/{sync-pq6gmlhG.js → sync-BnORI43S.js} +4 -4
- package/dist/cli/{table-dyKddjwo.js → table-D6HUECKI.js} +1 -1
- package/dist/cli/{upgrade-Dp9p7A69.js → upgrade-CR6-WmIc.js} +5 -5
- package/dist/cli/{upgrade-BoHb4h9P.js → upgrade-fz92aCnh.js} +3 -3
- package/dist/cli/{version-CQHFm-ak.js → version-Dz8ZlOuh.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{composite-CBRbvn5j.js → composite-B4qB6k31.js} +2 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +4 -4
- package/dist/{config-r7njjNgh.js → config-B7g-HDis.js} +3 -3
- package/dist/{config-bqKaPjst.js → config-R0m0fBiD.js} +1 -1
- package/dist/{context-B4TsE2gY.d.ts → context-DWWoP1wK.d.ts} +13 -1
- package/dist/{controller-CtwAsnVV.d.ts → controller-Br9dGKGe.d.ts} +1 -1
- package/dist/{controller-qG-B1eDn.js → controller-W97g2WGG.js} +1 -1
- package/dist/create/index.d.ts +3 -3
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.d.ts +3 -3
- package/dist/create/lite/index.js +3 -3
- package/dist/delivery-events-DbL8IHIY.js +53 -0
- package/dist/edge/index.js +3 -3
- package/dist/{entitlements-Bw3eYGKJ.d.ts → entitlements-CBjm2lvD.d.ts} +1 -1
- package/dist/eve/index.js +1 -1
- package/dist/expo/index.js +3 -2
- package/dist/{field-errors-DkzFduux.d.ts → field-errors-CEjsMAgd.d.ts} +4 -4
- package/dist/{framework-DYEUraqt.js → framework-CqiZk89W.js} +1 -1
- package/dist/hono/index.js +2 -2
- package/dist/{index-CB66nl14.d.ts → index-Clyd2Goi.d.ts} +1 -1
- package/dist/{index-Cw5gGSP8.d.ts → index-D98bQs8a.d.ts} +7 -7
- package/dist/{index-BNgpz_BV.d.ts → index-DIdPoQtO.d.ts} +2 -2
- package/dist/{index-BxckmAFc.d.ts → index-I8YLxKq8.d.ts} +2 -2
- package/dist/{index-CBQT_nXf.d.ts → index-eRBuKtMt.d.ts} +2 -2
- package/dist/{index-BM6NmKSc.d.ts → index-uIU65iEn.d.ts} +6 -6
- package/dist/{instances-C7qUTjhJ.js → instances-DY_ORk5g.js} +2 -0
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/next/index.d.ts +155 -13
- package/dist/next/index.js +245 -52
- package/dist/{operations-CqmQrTKw.d.ts → operations-hm1Isvvs.d.ts} +1 -1
- package/dist/{options-C4LuqmdG.js → options-CF6EVF_G.js} +3 -1
- package/dist/{options-COo7_3MX.js → options-DSCW40_5.js} +3 -1
- package/dist/orpc/index.js +2 -1
- package/dist/otel/index.js +4 -4
- package/dist/{ports-6LBgr1Aa.d.ts → ports-DOrPTJzl.d.ts} +1 -1
- package/dist/powersync/index.d.ts +204 -4
- package/dist/powersync/index.js +361 -4
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-DCdEnJj9.js → preset-CXhpPmPV.js} +2 -2
- package/dist/{project-C4NA_van.js → project-DJ9Uo0sT.js} +5 -5
- package/dist/{push-token-BXsrJ7W9.d.ts → push-token-B4vcIU4s.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/query/index.js +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +1 -1
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/react/server.js +1 -1
- package/dist/{react-CcrQQl0_.js → react-mdVjpewL.js} +2 -2
- package/dist/react-router/index.js +2 -2
- package/dist/realtime/index.d.ts +3 -3
- package/dist/{record-type-DRbnlj5q.js → record-type-BEUyEsFx.js} +2 -2
- package/dist/records/index.d.ts +5 -5
- package/dist/records/index.js +3 -3
- package/dist/{replicas-Dyoh3CEg.js → refresh-DLBgnxjL.js} +51 -1
- package/dist/{resolved-names-iLBOUaib.js → resolved-names-kMRjmSIy.js} +1 -1
- package/dist/{runtime-CoKxZibd.js → runtime-LRJM7UqY.js} +19 -20
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +4 -4
- package/dist/sign-in-BzihC_8k.d.ts +50 -0
- package/dist/{sign-in-NO7LWlw4.js → sign-in-CuZ1Ag7O.js} +136 -26
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid-start/index.js +2 -2
- package/dist/spec/index.js +1 -1
- package/dist/sql/index.d.ts +4 -4
- package/dist/sql/index.js +3 -3
- package/dist/{sql-CoBySj2F.js → sql-DHp0L7zK.js} +680 -333
- package/dist/ssr/index.d.ts +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/sveltekit/index.js +2 -2
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenant-Ded341Qz.d.ts → tenant-FfgNhd5x.d.ts} +1 -1
- package/dist/testing/index.d.ts +13 -4
- package/dist/testing/index.js +17 -15
- package/dist/{timeline-DvXtXq5q.d.ts → timeline-DqEoD8bb.d.ts} +1 -1
- package/dist/{timeline--VU3A1e4.js → timeline-Dz3hO2I6.js} +1 -1
- package/dist/{topic-XDdKzlrn.d.ts → topic-BaUElNw2.d.ts} +1 -1
- package/dist/{types-BFwB-E1j.d.ts → types-CMN0h_Ix.d.ts} +2 -2
- package/dist/vue/index.d.ts +5 -5
- package/dist/{watch-topic-DpN_GEoS.d.ts → watch-topic-BabDTZ-L.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +2 -2
- package/dist/{workflow-sdk-CaEw822d.js → workflow-sdk-DJJkP0dT.js} +47 -8
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +10 -1
- package/schemas/doctor-report-v1.json +2 -0
- package/skills/better-supabase/references/ui-recipes.md +524 -295
- package/skills/better-supabase-api/references/powersync.md +16 -0
- package/skills/better-supabase-auth/SKILL.md +11 -1
- package/dist/cli/add-CwhrRJz5.js +0 -1
- package/dist/cli/env-uqfUbUzk.js +0 -1
- package/dist/cli/powersync-CbYxLsjv.js +0 -1
- package/dist/cli/seed-BOun22-k.js +0 -1
- package/dist/sign-in-CfwJAJJL.d.ts +0 -24
|
@@ -9,7 +9,9 @@ const calendarSqlOptions = blockOptions({
|
|
|
9
9
|
recurrence: option.string({ default: "inline" }),
|
|
10
10
|
rdates: option.boolean({ default: false }),
|
|
11
11
|
attendeeKey: option.string({ default: "email" }),
|
|
12
|
-
calendarDetails: option.boolean({ default: false })
|
|
12
|
+
calendarDetails: option.boolean({ default: false }),
|
|
13
|
+
ruleDialect: option.unknown(),
|
|
14
|
+
readOnly: option.unknown()
|
|
13
15
|
});
|
|
14
16
|
//#endregion
|
|
15
17
|
export { calendarSqlOptions as t };
|
|
@@ -4,7 +4,9 @@ const tasksSqlOptions = blockOptions({
|
|
|
4
4
|
prefix: option.string({ default: "TASK-" }),
|
|
5
5
|
maxAssignees: option.number({ default: 0 }),
|
|
6
6
|
extraColumns: option.extraColumns(),
|
|
7
|
-
authorCanDelete: option.boolean({ default: true })
|
|
7
|
+
authorCanDelete: option.boolean({ default: true }),
|
|
8
|
+
notify: option.boolean({ default: true }),
|
|
9
|
+
actionPath: option.string()
|
|
8
10
|
});
|
|
9
11
|
//#endregion
|
|
10
12
|
export { tasksSqlOptions as t };
|
package/dist/orpc/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import { i as claimsOf } from "../claims-Bp9My7XP.js";
|
|
|
7
7
|
import { t as TABLE_VERBS } from "../resource-DvgXqZB_.js";
|
|
8
8
|
import { t as callWithInput } from "../block-method-C9hWdHom.js";
|
|
9
9
|
import { t as tenantOf } from "../tenant-BgIiMQpo.js";
|
|
10
|
-
import { c as extendServer, n as flushEvents, s as createServer
|
|
10
|
+
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-BTbj5N9C.js";
|
|
11
|
+
import { n as refreshFor } from "../refresh-DLBgnxjL.js";
|
|
11
12
|
import { r as checkPermission } from "../authorizer-BGhXaDmo.js";
|
|
12
13
|
import { n as toSession } from "../view-C8Ve14ja.js";
|
|
13
14
|
import { i as guard, n as defaultExpose, s as settle, t as assertCookieRefresh } from "../respond-CZMWbUs3.js";
|
package/dist/otel/index.js
CHANGED
|
@@ -40,9 +40,9 @@ function systemOf(executor) {
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
function otel(options = {}) {
|
|
43
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
43
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.31.0");
|
|
44
44
|
let histogram;
|
|
45
|
-
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.
|
|
45
|
+
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.31.0")).createHistogram("db.client.operation.duration", {
|
|
46
46
|
unit: "s",
|
|
47
47
|
description: "Duration of database client operations.",
|
|
48
48
|
advice: { explicitBucketBoundaries: [
|
|
@@ -219,7 +219,7 @@ function otel(options = {}) {
|
|
|
219
219
|
* `betterSupabase.events`. Returns a function that stops listening.
|
|
220
220
|
*/
|
|
221
221
|
function traceAuth(betterSupabase, options = {}) {
|
|
222
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
222
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.31.0");
|
|
223
223
|
const offAuth = betterSupabase.events.on("auth", (event) => {
|
|
224
224
|
const span = tracer.startSpan("auth.resolve", {
|
|
225
225
|
kind: SpanKind.INTERNAL,
|
|
@@ -257,7 +257,7 @@ function traceAuth(betterSupabase, options = {}) {
|
|
|
257
257
|
* an error status. Returns a function that stops listening.
|
|
258
258
|
*/
|
|
259
259
|
function traceBlockEvents(betterSupabase, options = {}) {
|
|
260
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
260
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.31.0");
|
|
261
261
|
return betterSupabase.events.on("block", (event) => {
|
|
262
262
|
const attributes = {
|
|
263
263
|
...options.attributes,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AsyncResult } from "./result-DZeA5KS6.js";
|
|
2
|
-
import { n as TopicPort } from "./watch-topic-
|
|
2
|
+
import { n as TopicPort } from "./watch-topic-BabDTZ-L.js";
|
|
3
3
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
4
4
|
//#region src/client/ports.d.ts
|
|
5
5
|
/**
|
|
@@ -2,8 +2,8 @@ import { f as Result } from "../result-DZeA5KS6.js";
|
|
|
2
2
|
import { Bt as Executor } from "../types-CPl9uJ0G.js";
|
|
3
3
|
import { t as BlockTransport } from "../block-transport-9EUA3q_I.js";
|
|
4
4
|
import { C as UploadRouteOptions, E as uploadRoute, S as UploadRoute, T as uploadOutcome, _ as UploadConnectorOptions, b as UploadOutcome, c as LocalTablesOption, d as CreateUploadRepository, f as CrudEntryLike, g as UploadConnector, h as RejectedStore, m as RejectedChange, n as DataEngine, p as CrudQueueLike, s as LiveEngineOptions, v as UploadErrorContext, w as createUploadConnector, x as UploadRepository, y as UploadFunction } from "../data-engine-rvbR2C4F.js";
|
|
5
|
-
import { n as TopicPort } from "../watch-topic-
|
|
6
|
-
import { t as AuthSnapshot } from "../bind-
|
|
5
|
+
import { n as TopicPort } from "../watch-topic-BabDTZ-L.js";
|
|
6
|
+
import { t as AuthSnapshot } from "../bind-DAx0bMSi.js";
|
|
7
7
|
import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-BfirBzOr.js";
|
|
8
8
|
//#region src/powersync/sync.d.ts
|
|
9
9
|
/** The part of PowerSync's `SyncStatus` the engine reads. */
|
|
@@ -249,7 +249,7 @@ interface NotificationRecipientWrites {
|
|
|
249
249
|
*
|
|
250
250
|
* ```ts
|
|
251
251
|
* createUploadConnector({
|
|
252
|
-
*
|
|
252
|
+
* tables: {
|
|
253
253
|
* notification_recipients: notificationRecipientsRoute(
|
|
254
254
|
* serverNotifications,
|
|
255
255
|
* ),
|
|
@@ -271,4 +271,204 @@ export declare function notificationRecipientsRoute(notifications: NotificationR
|
|
|
271
271
|
*/
|
|
272
272
|
export declare function powersyncTopicPort(database: PowerSyncDatabaseLike, tables?: readonly string[]): TopicPort;
|
|
273
273
|
//#endregion
|
|
274
|
-
|
|
274
|
+
//#region src/powersync/memberships.d.ts
|
|
275
|
+
/** The organization functions the local transport answers from SQLite. */
|
|
276
|
+
type LocalMembershipFunction = "list_my_organizations" | "leave_organization";
|
|
277
|
+
interface PowerSyncMembershipsOptions {
|
|
278
|
+
/** Where every other function goes: `rpcTransport(supabase)`. */
|
|
279
|
+
readonly server: BlockTransport;
|
|
280
|
+
/**
|
|
281
|
+
* The synced table names, as `powersync streams` wrote them into the client
|
|
282
|
+
* schema. Default `memberships` and `organizations`.
|
|
283
|
+
*/
|
|
284
|
+
readonly tables?: {
|
|
285
|
+
readonly memberships?: string;
|
|
286
|
+
readonly organizations?: string;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* The tenant column of the memberships table, when `config.tenancy` renames
|
|
290
|
+
* it. Default `organization_id`.
|
|
291
|
+
*/
|
|
292
|
+
readonly tenantColumn?: string;
|
|
293
|
+
/** Function names, when the instance renames them (`blocks.<name>.entities`). */
|
|
294
|
+
readonly functions?: Partial<Record<LocalMembershipFunction, string>>;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* A block transport for the organizations block on PowerSync: the organization
|
|
298
|
+
* switcher's list (`organizations.mine()`) and leaving an organization run on
|
|
299
|
+
* the synced `memberships` and `organizations` tables, so the switcher works
|
|
300
|
+
* offline. A leave goes into PowerSync's upload queue, which `membershipsRoute`
|
|
301
|
+
* replays on the server. Every other function (switching, members, invitations)
|
|
302
|
+
* goes to `server`.
|
|
303
|
+
*
|
|
304
|
+
* ```ts
|
|
305
|
+
* const organizations = createOrganizations({
|
|
306
|
+
* transport: powersyncMembershipsTransport(powersync, {
|
|
307
|
+
* server: rpcTransport(supabase),
|
|
308
|
+
* }),
|
|
309
|
+
* });
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* The synced memberships are the signed-in user's only (the `powersync streams`
|
|
313
|
+
* query filters by `auth.user_id()`). A row has its `role`; with
|
|
314
|
+
* `blocks.memberships.options.roles.many` the other roles and the
|
|
315
|
+
* organization's attribute columns come from the server.
|
|
316
|
+
*/
|
|
317
|
+
export declare function powersyncMembershipsTransport(database: PowerSyncDatabaseLike, options: PowerSyncMembershipsOptions): BlockTransport;
|
|
318
|
+
/**
|
|
319
|
+
* The upload route's organizations client: the server one, not the local
|
|
320
|
+
* transport.
|
|
321
|
+
*/
|
|
322
|
+
interface MembershipWrites {
|
|
323
|
+
updateMemberRole(organizationId: string, userId: string, role: string): PromiseLike<Result<unknown>>;
|
|
324
|
+
leave(organizationId: string): PromiseLike<Result<unknown>>;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* The upload route for `memberships`: replays a local leave (a `DELETE`) with
|
|
328
|
+
* `leave` and a role change (a `PATCH` to `role`) with `updateMemberRole`,
|
|
329
|
+
* whose server functions check the caller may make them. A `PUT` is refused: a
|
|
330
|
+
* user joins through an invitation. Pass an organizations client on
|
|
331
|
+
* `rpcTransport(supabase)`; one on `powersyncMembershipsTransport` would write
|
|
332
|
+
* the change locally again.
|
|
333
|
+
*
|
|
334
|
+
* ```ts
|
|
335
|
+
* createUploadConnector({
|
|
336
|
+
* tables: { memberships: membershipsRoute(serverOrganizations) },
|
|
337
|
+
* });
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
export declare function membershipsRoute(organizations: MembershipWrites): UploadFunction;
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/powersync/teams.d.ts
|
|
343
|
+
/** The team functions the local transport answers from SQLite. */
|
|
344
|
+
type LocalTeamFunction = "list_teams" | "update_team" | "archive_team" | "restore_team" | "add_team_member" | "remove_team_member";
|
|
345
|
+
interface PowerSyncTeamsOptions {
|
|
346
|
+
/** Where every other function goes: `rpcTransport(supabase)`. */
|
|
347
|
+
readonly server: BlockTransport;
|
|
348
|
+
/**
|
|
349
|
+
* The synced table names, as `powersync streams` wrote them into the client
|
|
350
|
+
* schema. Default `teams` and `team_members`.
|
|
351
|
+
*/
|
|
352
|
+
readonly tables?: {
|
|
353
|
+
readonly teams?: string;
|
|
354
|
+
readonly members?: string;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* The tenant column of both tables, when `config.tenancy` renames it. Default
|
|
358
|
+
* `tenant_id`.
|
|
359
|
+
*/
|
|
360
|
+
readonly tenantColumn?: string;
|
|
361
|
+
/** Function names, when the instance renames them (`blocks.<name>.entities`). */
|
|
362
|
+
readonly functions?: Partial<Record<LocalTeamFunction, string>>;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* A block transport for the teams block on PowerSync: listing teams, renaming,
|
|
366
|
+
* archiving and restoring them, and adding and removing members run on the
|
|
367
|
+
* synced `teams` and `team_members` tables, so they work offline. The writes go
|
|
368
|
+
* into PowerSync's upload queue, which `teamsRoute` and `teamMembersRoute`
|
|
369
|
+
* replay on the server. Creating and deleting a team go to `server`, which
|
|
370
|
+
* picks the id and slug and checks the permission.
|
|
371
|
+
*
|
|
372
|
+
* ```ts
|
|
373
|
+
* const teams = createTeams({
|
|
374
|
+
* transport: powersyncTeamsTransport(powersync, {
|
|
375
|
+
* server: rpcTransport(supabase),
|
|
376
|
+
* }),
|
|
377
|
+
* });
|
|
378
|
+
* ```
|
|
379
|
+
*
|
|
380
|
+
* The synced teams are the ones the signed-in user belongs to (the `powersync
|
|
381
|
+
* streams` query filters by `auth.user_id()`), so `list` offline returns those,
|
|
382
|
+
* not every team the user may read, and each team's `memberIds` holds only the
|
|
383
|
+
* synced member rows.
|
|
384
|
+
*/
|
|
385
|
+
export declare function powersyncTeamsTransport(database: PowerSyncDatabaseLike, options: PowerSyncTeamsOptions): BlockTransport;
|
|
386
|
+
/** The upload routes' teams client: the server one, not the local transport. */
|
|
387
|
+
interface TeamWrites {
|
|
388
|
+
update(id: string, name: string, description?: string, fields?: never, options?: {
|
|
389
|
+
readonly slug?: string;
|
|
390
|
+
readonly description?: string | null;
|
|
391
|
+
}): PromiseLike<Result<unknown>>;
|
|
392
|
+
archive(id: string): PromiseLike<Result<unknown>>;
|
|
393
|
+
restore(id: string): PromiseLike<Result<unknown>>;
|
|
394
|
+
delete(id: string): PromiseLike<Result<unknown>>;
|
|
395
|
+
addMember(teamId: string, userId: string): PromiseLike<Result<unknown>>;
|
|
396
|
+
removeMember(teamId: string, userId: string): PromiseLike<Result<unknown>>;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* The upload route for `teams`: replays a local rename, slug or description
|
|
400
|
+
* change with `update`, a `status` change with `archive` or `restore`, and a
|
|
401
|
+
* `DELETE` with `delete`. A `PATCH` carries only the changed columns, so the
|
|
402
|
+
* route reads the team's current name from `database` when the name stayed. A
|
|
403
|
+
* `PUT` is refused: create teams on the server.
|
|
404
|
+
*
|
|
405
|
+
* ```ts
|
|
406
|
+
* createUploadConnector({
|
|
407
|
+
* tables: {
|
|
408
|
+
* teams: teamsRoute(serverTeams, powersync),
|
|
409
|
+
* team_members: teamMembersRoute(serverTeams),
|
|
410
|
+
* },
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
export declare function teamsRoute(teams: TeamWrites, database: PowerSyncDatabaseLike, table?: string): UploadFunction;
|
|
415
|
+
/**
|
|
416
|
+
* The upload route for `team_members`: replays a local add (a `PUT`) with
|
|
417
|
+
* `addMember` and a removal (a `DELETE`) with `removeMember`. `powersync
|
|
418
|
+
* streams` keys a row as `<team>:<user>`.
|
|
419
|
+
*/
|
|
420
|
+
export declare function teamMembersRoute(teams: TeamWrites): UploadFunction;
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/powersync/profiles.d.ts
|
|
423
|
+
/** The profile functions the local transport answers from SQLite. */
|
|
424
|
+
type LocalProfileFunction = "my_profile" | "update_my_profile";
|
|
425
|
+
interface PowerSyncProfilesOptions {
|
|
426
|
+
/** Where every other function goes: `rpcTransport(supabase)`. */
|
|
427
|
+
readonly server: BlockTransport;
|
|
428
|
+
/**
|
|
429
|
+
* The synced table name, as `powersync streams` wrote it into the client
|
|
430
|
+
* schema. Default `profiles`.
|
|
431
|
+
*/
|
|
432
|
+
readonly table?: string;
|
|
433
|
+
/** Function names, when the instance renames them (`blocks.<name>.entities`). */
|
|
434
|
+
readonly functions?: Partial<Record<LocalProfileFunction, string>>;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* A block transport for the profiles block on PowerSync: `profiles.mine()` and
|
|
438
|
+
* `profiles.updateMine()` run on the synced `profiles` row, so the user's
|
|
439
|
+
* profile reads and edits work offline. An edit goes into PowerSync's upload
|
|
440
|
+
* queue, which `profilesRoute` replays on the server.
|
|
441
|
+
*
|
|
442
|
+
* ```ts
|
|
443
|
+
* const profiles = createProfiles({
|
|
444
|
+
* transport: powersyncProfilesTransport(powersync, {
|
|
445
|
+
* server: rpcTransport(supabase),
|
|
446
|
+
* }),
|
|
447
|
+
* });
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* The synced row is the signed-in user's only (the `powersync streams` query
|
|
451
|
+
* filters by `auth.user_id()`). `updateMine` writes the columns the local row
|
|
452
|
+
* has, except the ones only the server sets (`email`, the active organization
|
|
453
|
+
* and team, and the stamps).
|
|
454
|
+
*/
|
|
455
|
+
export declare function powersyncProfilesTransport(database: PowerSyncDatabaseLike, options: PowerSyncProfilesOptions): BlockTransport;
|
|
456
|
+
/** The upload route's profiles client: the server one, not the local transport. */
|
|
457
|
+
interface ProfileWrites {
|
|
458
|
+
updateMine(attrs: Readonly<Record<string, unknown>>): PromiseLike<Result<unknown>>;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* The upload route for `profiles`: replays a local edit (a `PATCH`) with
|
|
462
|
+
* `updateMine`, which writes only the columns the profiles block lets a user
|
|
463
|
+
* change. A `PUT` or `DELETE` is refused: the server creates and removes
|
|
464
|
+
* profiles with the user.
|
|
465
|
+
*
|
|
466
|
+
* ```ts
|
|
467
|
+
* createUploadConnector({
|
|
468
|
+
* tables: { profiles: profilesRoute(serverProfiles) },
|
|
469
|
+
* });
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
export declare function profilesRoute(profiles: ProfileWrites): UploadFunction;
|
|
473
|
+
//#endregion
|
|
474
|
+
export { type AttachmentPathRow, type AttachmentQueueRoute, type AttachmentQueueRouteOptions, type AuthSourceLike, type CheckSqliteOptions, type CreateUploadRepository, type CrudEntryLike, type CrudQueueLike, type LocalMembershipFunction, type LocalNotificationFunction, type LocalProfileFunction, type LocalTeamFunction, type MembershipWrites, type NotificationRecipientWrites, type PowerSyncDatabaseLike, type PowerSyncEngineOptions, type PowerSyncExecutorOptions, type PowerSyncMembershipsOptions, type PowerSyncNotificationsOptions, type PowerSyncProfilesOptions, type PowerSyncTeamsOptions, type ProfileWrites, type RejectedChange, type RejectedStore, type SqliteColumn, type SqliteCompilerOptions, type SqliteContextLike, type SqliteDecode, type SqliteInsertPlan, type SqliteKeyedPlan, type SqliteKeys, type SqliteNested, type SqlitePlan, type SqliteQuery, type SqliteReturning, type SqliteSelectPlan, type SqliteValue, type SyncStatusLike, type SyncWithAuthOptions, type SyncedDatabaseLike, type TeamWrites, type UploadConnector, type UploadConnectorOptions, type UploadErrorContext, type UploadFunction, type UploadOutcome, type UploadRepository, type UploadRoute, type UploadRouteOptions, checkSqlite, compileSqlite, createUploadConnector, fromSqliteError, likeToGlob, postgrestTimestamp, quoteSqliteIdent, sqliteCompiler, sqliteValue, uploadOutcome, uploadRoute };
|