better-supabase 0.34.0 → 0.35.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.
Files changed (154) hide show
  1. package/dist/ai-sdk/agents/index.d.ts +2 -2
  2. package/dist/{app-tables-Don-aNOB.d.ts → app-tables-X3yzJljM.d.ts} +1 -1
  3. package/dist/{authorization-DpVtxuKM.d.ts → authorization-D1P3VBOd.d.ts} +37 -0
  4. package/dist/{automations-Bw5cX7oj.js → automations-D4QTP8nI.js} +2 -1
  5. package/dist/{bind-BA05aoY9.d.ts → bind-Bvv-Zrdh.d.ts} +1 -1
  6. package/dist/{block-env-UX42PHLP.d.ts → block-env-h_uPl2f_.d.ts} +3 -3
  7. package/dist/{block-tables-Bre1zjau.d.ts → block-tables-pj3eHfoP.d.ts} +1 -1
  8. package/dist/blocks/ai-chat/index.d.ts +3 -3
  9. package/dist/blocks/announcements/index.d.ts +3 -3
  10. package/dist/blocks/api-keys/index.d.ts +1 -1
  11. package/dist/blocks/attachments/index.d.ts +1 -1
  12. package/dist/blocks/audit/index.d.ts +2 -2
  13. package/dist/blocks/automations/index.d.ts +1 -1
  14. package/dist/blocks/billing/index.d.ts +1 -1
  15. package/dist/blocks/bookings/index.d.ts +1 -1
  16. package/dist/blocks/calendar/index.d.ts +1 -1
  17. package/dist/blocks/catalog/index.d.ts +15 -0
  18. package/dist/blocks/catalog/index.js +23 -8
  19. package/dist/blocks/comments/index.d.ts +4 -4
  20. package/dist/blocks/deals/index.js +1 -1
  21. package/dist/blocks/entitlements/index.d.ts +2 -2
  22. package/dist/blocks/forms/index.d.ts +1 -1
  23. package/dist/blocks/inbox/index.d.ts +4 -4
  24. package/dist/blocks/index.d.ts +1 -1
  25. package/dist/blocks/invoices/index.d.ts +4 -0
  26. package/dist/blocks/invoices/index.js +6 -3
  27. package/dist/blocks/messaging/index.d.ts +4 -4
  28. package/dist/blocks/mfa/index.d.ts +1 -1
  29. package/dist/blocks/notifications/index.d.ts +3 -3
  30. package/dist/blocks/onboarding/index.d.ts +1 -1
  31. package/dist/blocks/organizations/index.d.ts +2 -2
  32. package/dist/blocks/permissions/index.d.ts +1 -1
  33. package/dist/blocks/push/index.d.ts +1 -1
  34. package/dist/blocks/quotes/index.js +1 -1
  35. package/dist/blocks/reactions/index.d.ts +3 -3
  36. package/dist/blocks/saved-views/index.d.ts +1 -1
  37. package/dist/blocks/search/index.d.ts +2 -2
  38. package/dist/blocks/sessions/index.d.ts +1 -1
  39. package/dist/blocks/settings/index.d.ts +1 -1
  40. package/dist/blocks/subjects/index.d.ts +1 -1
  41. package/dist/blocks/tags/index.d.ts +1 -1
  42. package/dist/blocks/time-tracking/index.js +1 -1
  43. package/dist/blocks/undo/index.d.ts +1 -1
  44. package/dist/blocks/usage/index.d.ts +1 -1
  45. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  46. package/dist/blocks/workflows/index.d.ts +3 -3
  47. package/dist/claims/index.d.ts +3 -3
  48. package/dist/cli/add-BaB3y1lv.js +1 -0
  49. package/dist/cli/{add-THXE7juv.js → add-CYreXA68.js} +9 -9
  50. package/dist/cli/{add-DoEtJhZG.js → add-DzgsOE8V.js} +2 -2
  51. package/dist/cli/{app-table-files-BqLd5TuX.js → app-table-files-BnISa3uY.js} +2 -2
  52. package/dist/cli/{backfill-D-2W0fNT.js → backfill-BLLTSDSa.js} +1 -1
  53. package/dist/cli/bin.js +1 -1
  54. package/dist/cli/{blocks-XwUHeyUH.js → blocks-CpRvI7x8.js} +1 -1
  55. package/dist/cli/{blocks-BVU_FoLo.js → blocks-uzh1g_0v.js} +1 -1
  56. package/dist/cli/{cache-D4nwCBXc.js → cache-BPWC7tGD.js} +1 -1
  57. package/dist/cli/{codemod-Dh4lf_k4.js → codemod-CbJVS_kG.js} +1 -1
  58. package/dist/cli/{content-mapper-CwFH_PEn.js → content-mapper-Cjkm2Sg3.js} +2 -2
  59. package/dist/cli/{doctor-CyAMbZ_s.js → doctor-D94FEJZs.js} +19 -19
  60. package/dist/cli/{gen-EAUNnUY7.js → gen-Cd0VNDjE.js} +11 -11
  61. package/dist/cli/index.d.ts +1 -1
  62. package/dist/cli/index.js +6 -6
  63. package/dist/cli/{init-BRmmmGHJ.js → init-Co1N9ZoA.js} +8 -8
  64. package/dist/cli/{live-CV9mn-xC.js → live-NFNeZsP7.js} +2 -2
  65. package/dist/cli/{mcp-CnaxcLWa.js → mcp-WZ8t7NMz.js} +2 -2
  66. package/dist/cli/{metadata-CFQGBR5E.js → metadata-BzMkmrZR.js} +3 -3
  67. package/dist/cli/{migrate-z5oHDGNs.js → migrate-C9gyDAV7.js} +1 -1
  68. package/dist/cli/{migration-safety-BtAPMEZa.js → migration-safety-BNi8PIiM.js} +1 -1
  69. package/dist/cli/{migrations-CNa62JSi.js → migrations-Ds0J_TmZ.js} +2 -2
  70. package/dist/cli/{module-migration-CKJ8kRm1.js → module-migration-hFrlzQZ5.js} +2 -2
  71. package/dist/cli/powersync-J2Kms2NT.js +1 -0
  72. package/dist/cli/{powersync-BgoAWeRT.js → powersync-oFiwgsBi.js} +3 -3
  73. package/dist/cli/{print-CoqKHoy0.js → print-BtreoJSm.js} +2 -2
  74. package/dist/cli/{providers-CfbFxUOQ.js → providers-Be2dgyuR.js} +1 -1
  75. package/dist/cli/{prune-workflows-BigCoXLw.js → prune-workflows-BPxgRrqY.js} +1 -1
  76. package/dist/cli/{remove-C9zwn-Kk.js → remove-B4ad996E.js} +5 -5
  77. package/dist/cli/{render-DQCU_kBW.js → render-C-Mfq-o3.js} +3 -3
  78. package/dist/cli/{run-DOD00FFl.js → run-D2nuyyPo.js} +47 -39
  79. package/dist/cli/{run-CVaBuT18.js → run-cLdnJHH0.js} +25 -25
  80. package/dist/cli/{shared-COtj7l3r.js → shared-DCHxLAEL.js} +1 -1
  81. package/dist/cli/{snapshot-BvlEmTB0.js → snapshot-CloKPNxv.js} +2 -2
  82. package/dist/cli/{source-BhZRCitG.js → source-Bwyp18Rj.js} +1 -1
  83. package/dist/cli/{spec-DsMWuJLv.js → spec-DAUF4ybu.js} +2 -2
  84. package/dist/cli/{spec-Bo2wIViH.js → spec-DsVq4_qV.js} +1 -1
  85. package/dist/cli/{sql-layout-CA7xgRjR.js → sql-layout-CHpEL0oq.js} +3 -3
  86. package/dist/cli/{sync-D9xSGdzO.js → sync-DZu1r34s.js} +4 -4
  87. package/dist/cli/{upgrade-XK_CQKVJ.js → upgrade-A-BALvp3.js} +2 -2
  88. package/dist/cli/{upgrade-Ykf0LLEB.js → upgrade-Bpvi70zm.js} +5 -5
  89. package/dist/cli/{version-Dfdz7KSh.js → version-B59mZJoy.js} +1 -1
  90. package/dist/client/index.d.ts +5 -5
  91. package/dist/client/native/index.d.ts +4 -4
  92. package/dist/config/index.d.ts +2 -2
  93. package/dist/config/index.js +4 -4
  94. package/dist/{config-Bu6pwqcO.js → config-BZWSFxkG.js} +3 -3
  95. package/dist/{config-MDRA2sre.js → config-DQP0IvDX.js} +1 -1
  96. package/dist/{context-BGC0J3t9.d.ts → context-CderJRZf.d.ts} +1 -1
  97. package/dist/contract/index.d.ts +3 -3
  98. package/dist/{controller-CQrkLoRX.d.ts → controller-DaWA9eWS.d.ts} +1 -1
  99. package/dist/create/index.d.ts +3 -3
  100. package/dist/create/index.js +3 -3
  101. package/dist/create/lite/index.d.ts +3 -3
  102. package/dist/create/lite/index.js +2 -2
  103. package/dist/{entitlements-BOWTZaRf.d.ts → entitlements-BefkpQIz.d.ts} +1 -1
  104. package/dist/{field-errors-DxPZYw2m.d.ts → field-errors-D1meOs_H.d.ts} +4 -4
  105. package/dist/{index-QTZIopQj.d.ts → index-BQlLxOj5.d.ts} +1 -1
  106. package/dist/{index-CJB50jzQ.d.ts → index-BbDiBiKt.d.ts} +4 -4
  107. package/dist/{index-Bz0WLuh_.d.ts → index-C13UgV67.d.ts} +2 -2
  108. package/dist/{index-Bhkag9ZE.d.ts → index-ChLuLxy-.d.ts} +6 -6
  109. package/dist/{index-CeUwyJ3Z.d.ts → index-D9aV0Fvx.d.ts} +2 -2
  110. package/dist/{index-BfU0KR0X.d.ts → index-DXUiRyEk.d.ts} +1 -1
  111. package/dist/{index-DNAkWDXc.d.ts → index-ZQZMQF4l.d.ts} +1 -1
  112. package/dist/{instances-D31jrmKh.js → instances-D9YrkoAy.js} +28 -1
  113. package/dist/mapper/bin.js +5 -5
  114. package/dist/mcp/index.d.ts +1 -1
  115. package/dist/next/index.d.ts +4 -4
  116. package/dist/{operations-BG6prEnh.d.ts → operations-t_hlXkS4.d.ts} +1 -1
  117. package/dist/{options-CgMiQGOF.js → options-C9bp3SEA.js} +2 -0
  118. package/dist/{options-Sq4bYbf5.js → options-CuaWhsQS.js} +2 -0
  119. package/dist/{options-DjFbIRgV.js → options-DjdxZgHi.js} +2 -1
  120. package/dist/{options-C-NFS6e3.js → options-DxgZ8tVc.js} +2 -1
  121. package/dist/otel/index.js +4 -4
  122. package/dist/{permissions-CoHsUtZS.d.ts → permissions-C8p6RlIZ.d.ts} +1 -1
  123. package/dist/{ports-XvgCe7ey.d.ts → ports-C-8uduFM.d.ts} +1 -1
  124. package/dist/powersync/index.d.ts +2 -2
  125. package/dist/preset/index.d.ts +3 -3
  126. package/dist/preset/index.js +3 -3
  127. package/dist/{preset-om2rbdYw.js → preset-B_sSI9vg.js} +2 -2
  128. package/dist/{project-B7nqCzn5.js → project-DVlXQGEp.js} +5 -5
  129. package/dist/{push-token-kcc04ZaS.d.ts → push-token-D41lOoE8.d.ts} +1 -1
  130. package/dist/react/index.d.ts +5 -5
  131. package/dist/react/native/index.d.ts +1 -1
  132. package/dist/react/server.d.ts +5 -5
  133. package/dist/realtime/index.d.ts +3 -3
  134. package/dist/records/index.d.ts +3 -3
  135. package/dist/{resolved-names-DYYyh35i.js → resolved-names-h-3UbKcw.js} +1 -1
  136. package/dist/server/index.d.ts +3 -3
  137. package/dist/solid/index.d.ts +5 -5
  138. package/dist/sql/index.d.ts +5 -5
  139. package/dist/sql/index.js +2 -2
  140. package/dist/{sql-DdtukoIm.js → sql-C9nO-Mat.js} +250 -88
  141. package/dist/ssr/index.d.ts +1 -1
  142. package/dist/svelte/index.d.ts +5 -5
  143. package/dist/{tenant-DkKbvK5T.d.ts → tenant-gezshhcs.d.ts} +1 -1
  144. package/dist/testing/index.d.ts +3 -3
  145. package/dist/testing/index.js +1 -1
  146. package/dist/{topic-B6zuexk7.d.ts → topic-BVq5RdsI.d.ts} +1 -1
  147. package/dist/{types-BvHw2cCS.d.ts → types-hTj5OuFo.d.ts} +2 -2
  148. package/dist/vue/index.d.ts +5 -5
  149. package/dist/{watch-topic-YYSVJGDY.d.ts → watch-topic-BOclyLFd.d.ts} +1 -1
  150. package/dist/yjs/index.d.ts +1 -1
  151. package/package.json +1 -1
  152. package/schemas/config-v1.json +36 -0
  153. package/dist/cli/add-C13ZqJ_N.js +0 -1
  154. package/dist/cli/powersync-DoCruiOt.js +0 -1
@@ -2,8 +2,8 @@ import { a as SessionActor, c as agentClaims, r as AgentActOptions } from "../..
2
2
  import { d as KnowledgeSearchOptions, o as KnowledgeHit, r as Knowledge } from "../../knowledge-BBC2sfAY.js";
3
3
  import { t as Agent } from "../../agents-DXiOPB3V.js";
4
4
  import { P as AiToolPolicy, _ as AiModerationAction, b as AiModerationStage, i as AiChat } from "../../ai-chat-DlcBdOhJ.js";
5
- import { r as AuthorizationOperation } from "../../authorization-DpVtxuKM.js";
6
- import { t as OperationTable } from "../../operations-BG6prEnh.js";
5
+ import { r as AuthorizationOperation } from "../../authorization-D1P3VBOd.js";
6
+ import { t as OperationTable } from "../../operations-t_hlXkS4.js";
7
7
  import { i as SearchToolOptions, r as ResultsFilter } from "../../embeddings-rVR2AKVz.js";
8
8
  import { n as GatewayOptions } from "../../gateway-options-Mut8jih_.js";
9
9
  import { LanguageModel, LanguageModelMiddleware, StopCondition, ToolLoopAgent, ToolLoopAgentSettings, ToolSet } from "ai";
@@ -1,4 +1,4 @@
1
- import { Tr as AppTableConfig } from "./context-BGC0J3t9.js";
1
+ import { Tr as AppTableConfig } from "./context-CderJRZf.js";
2
2
  /**
3
3
  * The columns every app table gets, which `columns` may not name: `id`,
4
4
  * `created_at`, `updated_at`, `user_id` and the tenant column
@@ -2173,6 +2173,13 @@ type CalendarSqlOptions = {
2173
2173
  type CatalogSqlOptions = {
2174
2174
  readonly storefront?: string;
2175
2175
  readonly extraColumns?: ExtraColumns;
2176
+ /** App columns of the variants table, which `saveVariant` sets from `fields`. */
2177
+ readonly variantExtraColumns?: ExtraColumns;
2178
+ /**
2179
+ * App columns of the categories table, which `saveCategory` sets from
2180
+ * `fields`.
2181
+ */
2182
+ readonly categoryExtraColumns?: ExtraColumns;
2176
2183
  /** Language tags the catalog translates into; the first is the default. */
2177
2184
  readonly locales?: readonly string[];
2178
2185
  /**
@@ -2264,6 +2271,12 @@ type DealsSqlOptions = {
2264
2271
  readonly readAll?: boolean;
2265
2272
  readonly extraColumns?: ExtraColumns;
2266
2273
  readonly lineExtraColumns?: ExtraColumns;
2274
+ /**
2275
+ * `"percent"` when your own line table keeps discount and tax rates as
2276
+ * percentages, such as `vat_rate numeric(5, 2)`: the block converts them from
2277
+ * and to basis points. Default `"bps"`.
2278
+ */
2279
+ readonly lineRates?: "bps" | "percent";
2267
2280
  };
2268
2281
  /** `blocks.documents.options`. */
2269
2282
  type DocumentsSqlOptions = {
@@ -2441,6 +2454,17 @@ type InvoicesSqlOptions = {
2441
2454
  readonly termsDays?: number;
2442
2455
  readonly extraColumns?: ExtraColumns;
2443
2456
  readonly lineExtraColumns?: ExtraColumns;
2457
+ /**
2458
+ * `"percent"` when your own line table keeps discount and tax rates as
2459
+ * percentages, such as `vat_rate numeric(5, 2)`: the block converts them from
2460
+ * and to basis points. Default `"bps"`.
2461
+ */
2462
+ readonly lineRates?: "bps" | "percent";
2463
+ /**
2464
+ * App columns of the charges table, such as a `not null` kind, which
2465
+ * `charge()` sets from `fields`.
2466
+ */
2467
+ readonly chargeExtraColumns?: ExtraColumns;
2444
2468
  /**
2445
2469
  * `"app"` when the app keeps the totals columns itself, such as with VAT per
2446
2470
  * rate: the block never recounts or writes them and reads what they hold.
@@ -2689,6 +2713,12 @@ type QuotesSqlOptions = {
2689
2713
  readonly validDays?: number;
2690
2714
  readonly extraColumns?: ExtraColumns;
2691
2715
  readonly lineExtraColumns?: ExtraColumns;
2716
+ /**
2717
+ * `"percent"` when your own line table keeps discount and tax rates as
2718
+ * percentages, such as `vat_rate numeric(5, 2)`: the block converts them from
2719
+ * and to basis points. Default `"bps"`.
2720
+ */
2721
+ readonly lineRates?: "bps" | "percent";
2692
2722
  };
2693
2723
  /** `blocks.reactions.options`. */
2694
2724
  type ReactionsSqlOptions = {
@@ -2855,6 +2885,13 @@ type TimeTrackingSqlOptions = {
2855
2885
  * running and `stop_timer` takes the entry. Needs `overlap: "allow"`.
2856
2886
  */
2857
2887
  readonly timers?: "one" | "many";
2888
+ /**
2889
+ * The entry columns a submitted or approved week refuses to change, as
2890
+ * logical names (`startedAt`) or the table's own column names. Default: the
2891
+ * ones that change logged time (start, end or duration, subject, owner and
2892
+ * rate), so a billable flag, a note or a link column stays writable.
2893
+ */
2894
+ readonly lockedColumns?: readonly string[];
2858
2895
  };
2859
2896
  /** `blocks.trash.options`. */
2860
2897
  type TrashSqlOptions = {
@@ -6,7 +6,8 @@ const quotesSqlOptions = blockOptions({
6
6
  prefix: option.string({ default: "Q-" }),
7
7
  validDays: option.number({ default: 30 }),
8
8
  extraColumns: option.extraColumns(),
9
- lineExtraColumns: option.extraColumns()
9
+ lineExtraColumns: option.extraColumns(),
10
+ lineRates: option.string({ default: "bps" })
10
11
  });
11
12
  // src/blocks/quotes/automations.ts
12
13
  /**
@@ -4,7 +4,7 @@ import { t as BetterSupabase, y as Db } from "./define-ITQA71fw.js";
4
4
  import { n as DataEngine } from "./data-engine-CMENsp3d.js";
5
5
  import { Dn as GeneratedBlocks } from "./define-block-COmMkx2x.js";
6
6
  import { rt as BetterQueries } from "./index-BIAtapnD.js";
7
- import { t as ClientPorts } from "./ports-XvgCe7ey.js";
7
+ import { t as ClientPorts } from "./ports-C-8uduFM.js";
8
8
  import { SupabaseClient } from "@supabase/supabase-js";
9
9
  interface AuthUser {
10
10
  readonly id: string;
@@ -1,7 +1,7 @@
1
1
  import { Dn as GeneratedBlocks } from "./define-block-COmMkx2x.js";
2
- import { n as TopicPort } from "./watch-topic-YYSVJGDY.js";
3
- import { t as ClientPorts } from "./ports-XvgCe7ey.js";
4
- import { t as AuthPort } from "./controller-CQrkLoRX.js";
2
+ import { n as TopicPort } from "./watch-topic-BOclyLFd.js";
3
+ import { t as ClientPorts } from "./ports-C-8uduFM.js";
4
+ import { t as AuthPort } from "./controller-DaWA9eWS.js";
5
5
  import { SupabaseClient } from "@supabase/supabase-js";
6
6
  /**
7
7
  * What the block bindings hand their controllers: the provider's client,
@@ -1,4 +1,4 @@
1
- import { cn as ResolvedConfig } from "./context-BGC0J3t9.js";
1
+ import { cn as ResolvedConfig } from "./context-CderJRZf.js";
2
2
  /**
3
3
  * One block table as the config names it: unquoted schema and table, and each
4
4
  * logical column's written name, or `null` when an adopted table lacks it.
@@ -5,9 +5,9 @@ import { a as AiMessagePart, c as AiReasoningPart, d as AiTextPart, f as AiToolA
5
5
  import { A as AiStoredMessageStatus, B as AiHarnessSession, C as AiProject, D as AiSaveResult, E as AiRunStatus, F as AiUserMessageTrigger, G as AiRun, H as AiHarnessSessions, I as SharedAiChat, J as AiRunStep, K as AiRunQuery, L as aiChatListTopic, M as AiToolApproval, N as AiToolApprovalRequest, O as AiShareLink, P as AiToolPolicy, Q as createHarnessSessions, R as aiChatTopic, S as AiPendingInputRequest, T as AiRunRelease, U as AiHarnessStatus, V as AiHarnessSessionPatch, W as AiPendingApproval, X as AiRunStepStatus, Y as AiRunStepInput, Z as AiRuns, _ as AiModerationAction, a as AiChatInput, b as AiModerationStage, c as AiChatPatch, d as AiChatShare, f as AiChatVisibility, g as AiModelInput, h as AiModel, i as AiChat, j as AiStreamClaim, k as AiStoredMessage, l as AiChatQuery, m as AiMessageSibling, n as AiApprovalDecision, o as AiChatOptions, p as AiFeedback, q as AiRunState, r as AiAssistantMessageOptions, s as AiChatPage, t as AiAppendResult, u as AiChatRecord, v as AiModerationEvent, w as AiProjectInput, x as AiPendingInput, y as AiModerationInput, z as createAiChat } from "../../ai-chat-DlcBdOhJ.js";
6
6
  import { a as NewAiSandbox, i as AiSandboxes, n as AiSandboxStatus, r as AiSandboxStopper, t as AiSandbox } from "../../sandboxes-B2hBoBvJ.js";
7
7
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
8
- import { p as SubscriptionStatus } from "../../topic-B6zuexk7.js";
9
- import { n as TopicPort } from "../../watch-topic-YYSVJGDY.js";
10
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
8
+ import { p as SubscriptionStatus } from "../../topic-BVq5RdsI.js";
9
+ import { n as TopicPort } from "../../watch-topic-BOclyLFd.js";
10
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
11
11
  import { StandardSchemaV1 } from "@standard-schema/spec";
12
12
  /**
13
13
  * The `type` of each part in the canonical AI message (version 1); the SQL
@@ -8,9 +8,9 @@ import { r as BlockTemporalOptions } from "../../block-helpers-disoUWCp.js";
8
8
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
9
9
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
10
10
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
11
- import { p as SubscriptionStatus } from "../../topic-B6zuexk7.js";
12
- import { n as TopicPort } from "../../watch-topic-YYSVJGDY.js";
13
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
11
+ import { p as SubscriptionStatus } from "../../topic-BVq5RdsI.js";
12
+ import { n as TopicPort } from "../../watch-topic-BOclyLFd.js";
13
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
14
14
  type AnnouncementSeverity = "info" | "success" | "warning" | "critical";
15
15
  /**
16
16
  * Who sees it: everyone, members of some tenants, members with some roles, or
@@ -1,4 +1,4 @@
1
1
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
2
2
  import { _ as createApiKeys, a as ApiKeyExtraClaims, c as ApiKeyState, d as CreateApiKeyInput, f as CreatedApiKey, g as apiKeyResolver, h as apiKeyClaims, i as ApiKeyExtraClaim, l as ApiKeys, m as apiKeyChecksum, n as ApiKeyCheck, o as ApiKeyReservedClaim, p as ParsedApiKey, r as ApiKeyClaimsOptions, s as ApiKeyResolverOptions, t as ApiKey, u as ApiKeysOptions, v as parseApiKey } from "../../api-keys-DbIbkGxx.js";
3
- import { a as ApiKeyDraft, c as ApiKeysControllerOptions, d as ApiKeyAuth, f as ApiKeyContributions, i as ApiKeyChange, l as ApiKeysSnapshot, m as withApiKey, n as ApiKeysEvents, o as ApiKeysActions, p as WithApiKeyOptions, r as apiKeysEvents, s as ApiKeysController, t as apiKeysBlock, u as createApiKeysController } from "../../index-BfU0KR0X.js";
3
+ import { a as ApiKeyDraft, c as ApiKeysControllerOptions, d as ApiKeyAuth, f as ApiKeyContributions, i as ApiKeyChange, l as ApiKeysSnapshot, m as withApiKey, n as ApiKeysEvents, o as ApiKeysActions, p as WithApiKeyOptions, r as apiKeysEvents, s as ApiKeysController, t as apiKeysBlock, u as createApiKeysController } from "../../index-DXUiRyEk.js";
4
4
  export { type ApiKey, type ApiKeyAuth, type ApiKeyChange, type ApiKeyCheck, type ApiKeyClaimsOptions, type ApiKeyContributions, type ApiKeyDraft, type ApiKeyExtraClaim, type ApiKeyExtraClaims, type ApiKeyReservedClaim, type ApiKeyResolverOptions, type ApiKeyState, type ApiKeys, type ApiKeysActions, type ApiKeysController, type ApiKeysControllerOptions, type ApiKeysEvents, type ApiKeysOptions, type ApiKeysSnapshot, type BlockTransport, type CreateApiKeyInput, type CreatedApiKey, type ParsedApiKey, type WithApiKeyOptions, apiKeyChecksum, apiKeyClaims, apiKeyResolver, apiKeysBlock, apiKeysEvents, createApiKeys, createApiKeysController, dbTransport, parseApiKey, rpcTransport, sqlTransport, withApiKey };
@@ -3,7 +3,7 @@ import { Ct as Events, ot as StorageObjectEventData, y as AttachmentEventData }
3
3
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
4
4
  import { t as Author } from "../../block-authors-C5z3tGVu.js";
5
5
  import { At as NewAttachment, Ct as AttachmentScannerOptions, Dt as AttachmentVersion, Et as AttachmentUpload, Ft as ScannedObject, It as attachmentVersionOf, Lt as createAttachmentScanner, Mt as ObjectScanner, Nt as ObjectScannerOptions, Ot as Attachments, Pt as ScanVerdict, Rt as createAttachments, Sn as EntitySchema, St as AttachmentScanner, Tt as AttachmentStorage, _t as AttachmentDownload, bt as AttachmentReplacement, c as BlockOf, gt as AttachmentBucket, ht as Attachment, jt as ObjectScanJob, kt as AttachmentsOptions, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding, vt as AttachmentImageUrlOptions, wt as AttachmentStatus, xt as AttachmentScanJob, yt as AttachmentImages, zt as createObjectScanner } from "../../define-block-COmMkx2x.js";
6
- import { n as Controller } from "../../controller-CQrkLoRX.js";
6
+ import { n as Controller } from "../../controller-DaWA9eWS.js";
7
7
  /** A pending write to a record's files, for `useOptimistic`. */
8
8
  type AttachmentsOptimisticAction = {
9
9
  readonly type: "add";
@@ -11,9 +11,9 @@ import { Yt as WhereInput, t as BetterSupabase } from "../../define-ITQA71fw.js"
11
11
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
12
12
  import { i as EventSink, t as CloudEvent } from "../../cloud-event-DXWmXrus.js";
13
13
  import { i as ListDefinition } from "../../list-query-C7V8kUaD.js";
14
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
14
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
15
15
  import { a as UndoToken } from "../../undo-22ofP6Zp.js";
16
- import { n as AuditCategory } from "../../context-BGC0J3t9.js";
16
+ import { n as AuditCategory } from "../../context-CderJRZf.js";
17
17
  interface PurgeAuditLogOptions extends BlockTemporalOptions {
18
18
  /**
19
19
  * How long entries are kept when `retention` has no answer. Defaults to `1
@@ -8,7 +8,7 @@ import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport,
8
8
  import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DrA_d1dJ.js";
9
9
  import { _ as FilterRule, d as FilterLimits, f as FilterNode, h as FilterQuery, i as FilterCombinator, m as FilterOperatorSpec, r as FilterClock } from "../../filter-query-DV-x8fio.js";
10
10
  import { $t as createActionRegistry, Bt as Action, Gt as ActionInfo, Ht as ActionContext, Jt as ActionRegistry, Kt as ActionOrigin, L as NotifierInput, Qt as actionKey, Ut as ActionDescriptor, Vt as ActionCall, Wt as ActionHandler, Yt as ActionSpec, Zt as DefaultAutomation, c as BlockOf, en as defineAction, qt as ActionRef } from "../../define-block-COmMkx2x.js";
11
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
11
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
12
12
  import { o as ApprovalRequestInput } from "../../approvals-DZoGtNFv.js";
13
13
  import { n as FilterRecordField, t as FilterEvaluation } from "../../filter-evaluate-Bz3Fzhz2.js";
14
14
  import { a as checkRuleConditions, c as ruleFilterFields, i as RuleFieldDefinition, n as RuleField, o as defineRuleFields, r as RuleFieldCatalog, s as ruleFilterFieldInfo, t as RULE_LIMITS } from "../../fields-CAVk9dxX.js";
@@ -9,7 +9,7 @@ import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
9
9
  import { n as StripeSource, r as StripeTaxId, t as StripeClient } from "../../stripe-Bl-sjnl6.js";
10
10
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
11
11
  import { i as EventSink } from "../../cloud-event-DXWmXrus.js";
12
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
12
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
13
13
  import { d as stripeInboxVerify, f as verifyStripeWebhook, u as signStripeWebhook } from "../../verify-BQu3eBNW.js";
14
14
  /** The events of the `billing` block: type to data. */
15
15
  type BillingEvents = {
@@ -1,7 +1,7 @@
1
1
  import { b as DbError } from "../../result-DTOQRyGY.js";
2
2
  import { Ct as Events, tt as SchedulingEventData } from "../../events-DVt3Z9hw.js";
3
3
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
4
- import { n as Controller } from "../../controller-CQrkLoRX.js";
4
+ import { n as Controller } from "../../controller-DaWA9eWS.js";
5
5
  import { o as WeeklyHours } from "../../availability-CebEOfMN.js";
6
6
  import { C as bookingSeriesOf, S as BookingWeekday, T as parseRecurrence, _ as BookedSeries, a as BookingExceptionInput, b as BookingSeriesScope, c as BookingResourceInput, d as BookingStatus, f as Bookings, g as createBookings, h as PublicBookingService, i as BookingDuration, l as BookingServiceInput, m as PlacedBooking, n as Booking, o as BookingExpirePayload, p as BookingsOptions, r as BookingCustomer, s as BookingRange, t as BOOKING_EXPIRE_QUEUE, u as BookingSlot, v as BookingRecurrence, w as formatRecurrence, x as BookingSeriesStatus, y as BookingSeries } from "../../bookings-Br0VXzaf.js";
7
7
  import { t as EventCalendarEvent } from "../../event-calendar-DUtFyRrv.js";
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-0LfhvwE4.js";
7
7
  import { t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
8
8
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
9
9
  import { Sn as EntitySchema, c as BlockOf } from "../../define-block-COmMkx2x.js";
10
- import { n as Controller } from "../../controller-CQrkLoRX.js";
10
+ import { n as Controller } from "../../controller-DaWA9eWS.js";
11
11
  import { C as CalendarReminder, D as ToIcsOptions, E as ParsedIcs, O as parseIcs, S as CalendarEventStatus, T as IcsSource, _ as expandOccurrences, a as FreeBusy, b as AttendeeRole, c as WorkingHoursInput, d as workingHoursOf, f as CalendarEvent, g as SplitRules, h as OccurrenceRange, i as CommonFreeTimeOptions, k as toIcs, l as commonFreeTime, m as OccurrenceOptions, n as CalendarEventKind, o as WeeklyHours, p as CalendarOccurrence, r as CalendarTransparency, s as WorkingHours, t as BusyRange, u as freeBusyOf, v as splitRule, w as IcsEvent, x as CalendarAttendee, y as AttendeeResponse } from "../../availability-CebEOfMN.js";
12
12
  import { a as fromEventCalendarUpdate, c as toEventCalendarResources, i as OccurrenceMove, n as EventCalendarOptions, o as seriesOf, r as EventCalendarResource, s as toEventCalendarEvents, t as EventCalendarEvent } from "../../event-calendar-DUtFyRrv.js";
13
13
  import { t as VisibleRange } from "../../range-BN3kpJAE.js";
@@ -39,6 +39,13 @@ interface ProductInput {
39
39
  readonly description?: string;
40
40
  /** Default `physical`. */
41
41
  readonly kind?: ProductKind;
42
+ /**
43
+ * The product's own price and currency, when your products table maps `price`
44
+ * and `currency`. Left out, the columns keep their value.
45
+ */
46
+ readonly price?: Money;
47
+ /** When your products table maps `trackInventory`. */
48
+ readonly trackInventory?: boolean;
42
49
  }
43
50
  interface SavedProduct {
44
51
  readonly id: string;
@@ -75,12 +82,16 @@ interface VariantInput {
75
82
  readonly trackInventory?: boolean;
76
83
  /** Whether it sells with no stock available. Default `false`. */
77
84
  readonly allowBackorder?: boolean;
85
+ /** The extra columns (`options.variantExtraColumns`) by name. */
86
+ readonly fields?: Readonly<Record<string, unknown>>;
78
87
  }
79
88
  interface SavedVariant {
80
89
  readonly id: string;
81
90
  readonly sku: string;
82
91
  /** Its rank key among the product's variants. */
83
92
  readonly rank: string;
93
+ /** The extra columns, with `options.variantExtraColumns`. */
94
+ readonly fields?: Readonly<Record<string, unknown>>;
84
95
  }
85
96
  interface PriceListInput {
86
97
  readonly id?: string;
@@ -123,11 +134,15 @@ interface CategoryInput {
123
134
  readonly name: string;
124
135
  readonly slug?: string;
125
136
  readonly description?: string;
137
+ /** The extra columns (`options.categoryExtraColumns`) by name. */
138
+ readonly fields?: Readonly<Record<string, unknown>>;
126
139
  }
127
140
  interface SavedCategory {
128
141
  readonly id: string;
129
142
  readonly slug: string;
130
143
  readonly rank: string;
144
+ /** The extra columns, with `options.categoryExtraColumns`. */
145
+ readonly fields?: Readonly<Record<string, unknown>>;
131
146
  }
132
147
  interface CollectionBase {
133
148
  readonly id?: string;
@@ -1,16 +1,16 @@
1
1
  import { n as dbError } from "../../errors-B7tCfCvX.js";
2
2
  import { n as isRecord } from "../../guards-CsRa6v57.js";
3
3
  import { t as AsyncResult } from "../../result-8xza7w5W.js";
4
- import { t as catalogSqlOptions } from "../../options-CgMiQGOF.js";
4
+ import { t as catalogSqlOptions } from "../../options-C9bp3SEA.js";
5
5
  import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
6
6
  import { A as recordsOf, L as textOf, O as recordOf, T as pageOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, h as instantOf, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
7
7
  import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
8
- import { n as entitySchema } from "../../entity-schema-DEIz0I8i.js";
8
+ import { n as entitySchema, r as moneyField } from "../../entity-schema-DEIz0I8i.js";
9
9
  import { c as withFields, n as blockFields, r as extraFieldsArg } from "../../block-fields-Bjcv6_zc.js";
10
10
  import { n as defineBlock } from "../../define-block-22Jv4U_-.js";
11
11
  import { t as rankBetweenResult } from "../../rank-result-DzaTKKhH.js";
12
12
  import { d as money } from "../../money-DH--bbYr.js";
13
- import { a as optionalAmountText, o as optionalMoneyOf } from "../../money-codec-SKPm8FPw.js";
13
+ import { a as optionalAmountText, o as optionalMoneyOf, t as amountText } from "../../money-codec-SKPm8FPw.js";
14
14
  // src/blocks/catalog/catalog.ts
15
15
  const PRODUCT_KINDS = [
16
16
  "physical",
@@ -35,7 +35,8 @@ function variantOf(value) {
35
35
  return {
36
36
  id: textOf(row["id"]),
37
37
  sku: textOf(row["sku"]),
38
- rank: textOf(row["rank"])
38
+ rank: textOf(row["rank"]),
39
+ ...isRecord(row["fields"]) ? { fields: row["fields"] } : {}
39
40
  };
40
41
  }
41
42
  function priceOf(value) {
@@ -115,7 +116,8 @@ function variantArgs(productId, variantId, input) {
115
116
  barcode: input.barcode ?? null,
116
117
  weight_grams: input.weightGrams ?? null,
117
118
  track_inventory: input.trackInventory ?? null,
118
- allow_backorder: input.allowBackorder ?? null
119
+ allow_backorder: input.allowBackorder ?? null,
120
+ fields: input.fields
119
121
  };
120
122
  }
121
123
  /**
@@ -126,13 +128,16 @@ function createCatalog(options) {
126
128
  applyTemporal(options);
127
129
  const call = blockCall(options.transport, options.schema, options.mappers);
128
130
  const fields = blockFields(options.fields, "product fields");
129
- const saveProduct = (organizationId, productId, { title, slug, description, kind, ...extra }) => AsyncResult.from(() => extraFieldsArg(fields, extra)).andThen((more) => call("save_product", {
131
+ const saveProduct = (organizationId, productId, { title, slug, description, kind, price, trackInventory, ...extra }) => AsyncResult.from(() => extraFieldsArg(fields, extra)).andThen((more) => call("save_product", {
130
132
  tenant: organizationId,
131
133
  product: productId,
132
134
  title,
133
135
  slug: slug ?? null,
134
136
  description: description ?? null,
135
137
  kind: kind ?? null,
138
+ price: price === void 0 ? void 0 : amountText(price),
139
+ currency: price?.currency,
140
+ track_inventory: trackInventory,
136
141
  ...more
137
142
  }, (value) => value)).andThen((value) => withFields(fields, value, productOf(value)));
138
143
  return withBlockHooks({
@@ -217,13 +222,15 @@ function createCatalog(options) {
217
222
  parent: input.parentId ?? null,
218
223
  name: input.name,
219
224
  slug: input.slug ?? null,
220
- description: input.description ?? null
225
+ description: input.description ?? null,
226
+ fields: input.fields
221
227
  }, (value) => {
222
228
  const row = recordOf(value, "save_category");
223
229
  return {
224
230
  id: textOf(row["id"]),
225
231
  slug: textOf(row["slug"]),
226
- rank: textOf(row["rank"])
232
+ rank: textOf(row["rank"]),
233
+ ...isRecord(row["fields"]) ? { fields: row["fields"] } : {}
227
234
  };
228
235
  }),
229
236
  moveCategory: (categoryId, parentId, neighbors) => {
@@ -402,6 +409,14 @@ const productInputSchema = entitySchema({
402
409
  kind: "enum",
403
410
  values: PRODUCT_KINDS,
404
411
  optional: true
412
+ },
413
+ price: {
414
+ ...moneyField,
415
+ optional: true
416
+ },
417
+ trackInventory: {
418
+ kind: "boolean",
419
+ optional: true
405
420
  }
406
421
  }
407
422
  });
@@ -7,14 +7,14 @@ import { n as Logger } from "../../logger-0LfhvwE4.js";
7
7
  import { a as BlockTenantOptions, i as CursorPageOptions, r as BlockTemporalOptions } from "../../block-helpers-disoUWCp.js";
8
8
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
9
9
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
10
- import { F as CommentsSqlOptions } from "../../authorization-DpVtxuKM.js";
10
+ import { F as CommentsSqlOptions } from "../../authorization-D1P3VBOd.js";
11
11
  import { t as Author } from "../../block-authors-C5z3tGVu.js";
12
12
  import { a as isFileAnchor, i as fileAnchor, n as FileAnchor, o as conversationTopic, r as FileAnchorAt, t as AnchorRegion } from "../../anchors-sCLvYj-8.js";
13
13
  import { c as MessageEdit, l as MessageEdition, o as Message } from "../../messaging-D5z2TR37.js";
14
14
  import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding } from "../../define-block-COmMkx2x.js";
15
- import { p as SubscriptionStatus } from "../../topic-B6zuexk7.js";
16
- import { n as TopicPort } from "../../watch-topic-YYSVJGDY.js";
17
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
15
+ import { p as SubscriptionStatus } from "../../topic-BVq5RdsI.js";
16
+ import { n as TopicPort } from "../../watch-topic-BOclyLFd.js";
17
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
18
18
  interface CommentsOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTemporalOptions, BlockTenantOptions {
19
19
  /**
20
20
  * A Standard Schema for the message extra columns
@@ -1,6 +1,6 @@
1
1
  import { t as temporal } from "../../temporal-required-w_2u4EDp.js";
2
2
  import { a as ok, r as err, t as AsyncResult } from "../../result-8xza7w5W.js";
3
- import { t as dealsSqlOptions } from "../../options-C-NFS6e3.js";
3
+ import { t as dealsSqlOptions } from "../../options-DxgZ8tVc.js";
4
4
  import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
5
5
  import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, a as bigintOf, d as enumOrThrow, j as requiredInstant, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
6
6
  import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
@@ -4,8 +4,8 @@ import { n as SqlClient } from "../../executor-CFmee_nV.js";
4
4
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
5
5
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
6
6
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
7
- import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-BOWTZaRf.js";
8
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
7
+ import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-BefkpQIz.js";
8
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
9
9
  /** The Stripe event sent when a customer's active entitlements change. */
10
10
  export declare const ENTITLEMENTS_UPDATED = "entitlements.active_entitlement_summary.updated";
11
11
  /**
@@ -8,7 +8,7 @@ import { r as BlockTemporalOptions } from "../../block-helpers-disoUWCp.js";
8
8
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
9
9
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
10
10
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
11
- import { n as Controller } from "../../controller-CQrkLoRX.js";
11
+ import { n as Controller } from "../../controller-DaWA9eWS.js";
12
12
  import { _ as isFormDefinition, a as FormDefinition, c as FormJson, d as FormScoring, f as FormStep, g as formSchema, h as formDefinitionProblems, i as FormCondition, l as FormJsonSchema, m as UNSCORED_FIELD_TYPES, n as FORM_FIELD_TYPES, o as FormField, p as NPS_MAX, r as FORM_SCHEMA_DIALECT, s as FormFieldType, t as FORM_DEFINITION_SCHEMA, u as FormOption } from "../../form-definition-BN8shngm.js";
13
13
  import { StandardSchemaV1 } from "@standard-schema/spec";
14
14
  /** A submission's answers, by field key. */
@@ -2,10 +2,10 @@ import { Ct as Events, H as InboxEventData } from "../../events-DVt3Z9hw.js";
2
2
  import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
3
3
  import { d as MessageKind, p as MessageReaction, u as MessageFile } from "../../messaging-D5z2TR37.js";
4
4
  import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-COmMkx2x.js";
5
- import { p as SubscriptionStatus } from "../../topic-B6zuexk7.js";
6
- import { n as TopicPort } from "../../watch-topic-YYSVJGDY.js";
7
- import { l as StoragePort } from "../../ports-XvgCe7ey.js";
8
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
5
+ import { p as SubscriptionStatus } from "../../topic-BVq5RdsI.js";
6
+ import { n as TopicPort } from "../../watch-topic-BOclyLFd.js";
7
+ import { l as StoragePort } from "../../ports-C-8uduFM.js";
8
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
9
9
  import { S as StoredInboundEvent, _ as MessageDirection, a as ConversationEvent, b as PurgedContact, c as DeliveryStatus, d as InboxCounts, f as InboxFileSource, g as MessageDelivery, h as InboxUpload, i as Conversation, l as InboundResult, m as InboxRow, n as BotMode, o as ConversationPriority, p as InboxMessage, r as Contact, s as ConversationStatus, t as AuthorType, u as InboxChannel, v as MessageTemplate, x as ScheduledInboxMessage, y as PendingInboxFile } from "../../types-TH3zlMiM.js";
10
10
  import { a as Inbox, c as InboxPatch, d as ScheduledMessageInput, f as StartConversationInput, i as InboundInput, l as MessageInput, m as createInbox, n as ConversationFilter, o as InboxHooks, p as TemplateInput, r as CreateInboxInput, s as InboxOptions, t as ContactInput, u as MessagePageOptions } from "../../inbox-DavCzW7b.js";
11
11
  export declare const INBOX_CHANNELS: readonly InboxChannel[];
@@ -12,7 +12,7 @@ import { a as OptionInput, c as OptionSpecs, d as optionsJsonSchema, i as Option
12
12
  import { A as CreateBlocksOptions, An as BlockNaming, C as BlockContext, Cn as EntitySchemaSpec, D as Blocks, Dn as GeneratedBlocks, E as BlockSinks, En as GeneratedBlock, F as BlockPorts, Fn as entityNames, I as Notifier, L as NotifierInput, M as createBlockClient, Mn as EntityNames, N as createBlocks, Nn as EntityNoun, O as BlocksEventMap, On as fillTopic, P as defineBlocks, Pn as EntityRename, R as PortName, S as BlockClientSource, Sn as EntitySchema, T as BlockSet, Tn as entitySchema, _ as BlockProvider, a as BlockConsumes, b as BLOCK_EVENT_SOURCE, bn as BlockSchemas, c as BlockOf, d as ClientOf, f as ConsumedPorts, g as BlockEnvKey, h as defineBlock, i as BlockCategory, j as UniquePort, jn as blockNames, k as BlocksHooks, kn as generatedOptions, l as BlockOptionSchemas, m as UsingOptions, n as BLOCK_CATEGORIES, o as BlockDefinition, p as ProvidedPorts, r as Block, s as BlockInvalidates, t as AnyBlock, tn as AnyRecordBinding, u as BlockProvides, v as BlockWiring, w as BlockMap, wn as EntitySchemas, x as BlockClientOptions, xn as EntityFieldSpecs, y as BlockWorker } from "../define-block-COmMkx2x.js";
13
13
  import { t as VisibleRange } from "../range-BN3kpJAE.js";
14
14
  import { t as subjectKey } from "../block-subjects-Br2MQNFn.js";
15
- import { t as BlockEnv } from "../block-env-UX42PHLP.js";
15
+ import { t as BlockEnv } from "../block-env-h_uPl2f_.js";
16
16
  /** What a hook passes a block creator from the env. */
17
17
  interface EnvBlockOptions {
18
18
  readonly transport: BlockTransport;
@@ -27,6 +27,8 @@ interface InvoiceCharge {
27
27
  readonly amount: Money;
28
28
  readonly description?: string;
29
29
  readonly createdAt?: Temporal.Instant;
30
+ /** The charge's extra columns (`options.chargeExtraColumns`). */
31
+ readonly fields?: Readonly<Record<string, unknown>>;
30
32
  }
31
33
  /** An invoice. `F` types the extra columns the `fields` schema describes. */
32
34
  interface Invoice<F extends object = Record<never, never>> {
@@ -120,6 +122,8 @@ interface Invoices<F extends object = Record<never, never>> {
120
122
  charge(invoiceId: string, charge: {
121
123
  readonly amount: Money;
122
124
  readonly description?: string;
125
+ /** The charge's extra columns (`options.chargeExtraColumns`) by name. */
126
+ readonly fields?: Readonly<Record<string, unknown>>;
123
127
  }): AsyncResult<Invoice<F>>;
124
128
  aging(organizationId: string, currency: string, asOf?: Temporal.PlainDate): AsyncResult<InvoiceAging>;
125
129
  /**
@@ -1,5 +1,6 @@
1
+ import { n as isRecord } from "../../guards-CsRa6v57.js";
1
2
  import { t as AsyncResult } from "../../result-8xza7w5W.js";
2
- import { t as invoicesSqlOptions } from "../../options-Sq4bYbf5.js";
3
+ import { t as invoicesSqlOptions } from "../../options-CuaWhsQS.js";
3
4
  import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
4
5
  import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, a as bigintOf, d as enumOrThrow, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
5
6
  import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
@@ -86,7 +87,8 @@ function invoiceOf(value) {
86
87
  id: textOf(charge["id"]),
87
88
  amount: moneyOf(charge["amount"], currency, "invoice charge amount"),
88
89
  description: optionalText(charge["description"]),
89
- createdAt: optionalInstant(charge["createdAt"])
90
+ createdAt: optionalInstant(charge["createdAt"]),
91
+ fields: isRecord(charge["fields"]) ? charge["fields"] : void 0
90
92
  })),
91
93
  paidAt: optionalInstant(row["paid_at"]),
92
94
  voidReason: optionalText(row["void_reason"]),
@@ -172,7 +174,8 @@ function createInvoices(options) {
172
174
  invoice: invoiceId,
173
175
  amount: amountText(charge.amount),
174
176
  currency: charge.amount.currency,
175
- description: charge.description ?? null
177
+ description: charge.description ?? null,
178
+ fields: charge.fields
176
179
  }),
177
180
  aging: (organizationId, currency, asOf) => amountsError(currency, []) === void 0 ? call("invoice_aging", {
178
181
  tenant: organizationId,
@@ -4,14 +4,14 @@ import { Ct as Events } from "../../events-DVt3Z9hw.js";
4
4
  import { _ as ConversationEventData, k as MessageEventData } from "../../index-D18su_r5.js";
5
5
  import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
6
6
  import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DrA_d1dJ.js";
7
- import { P as MessagingSqlOptions } from "../../authorization-DpVtxuKM.js";
7
+ import { P as MessagingSqlOptions } from "../../authorization-D1P3VBOd.js";
8
8
  import { a as isFileAnchor, i as fileAnchor, n as FileAnchor, o as conversationTopic, r as FileAnchorAt, t as AnchorRegion } from "../../anchors-sCLvYj-8.js";
9
9
  import { _ as NotifyLevel, a as FollowTarget, b as UnreadCount, c as MessageEdit, d as MessageKind, f as MessageListOptions, g as NewMessage, h as MessagingOptions, i as ConversationSummary, l as MessageEdition, m as Messaging, n as ConversationAccess, o as Message, p as MessageReaction, r as ConversationKind, s as MessageCursor, t as Conversation, u as MessageFile, v as OpenConversation, x as createMessaging, y as RecordMention } from "../../messaging-D5z2TR37.js";
10
10
  import { a as ThreadSummary, i as ThreadSummarizer, n as SummaryMessage, o as ThreadSummaryInput, r as SummaryTarget, s as ThreadSummaryOutput, t as SummarizeOptions } from "../../summaries-CUemsYwV.js";
11
11
  import { Sn as EntitySchema, c as BlockOf } from "../../define-block-COmMkx2x.js";
12
- import { p as SubscriptionStatus } from "../../topic-B6zuexk7.js";
13
- import { n as TopicPort } from "../../watch-topic-YYSVJGDY.js";
14
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
12
+ import { p as SubscriptionStatus } from "../../topic-BVq5RdsI.js";
13
+ import { n as TopicPort } from "../../watch-topic-BOclyLFd.js";
14
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
15
15
  type MentionScope = "channel" | "here";
16
16
  interface ParsedMentions {
17
17
  /** Mentioned user ids, lowercase, in order and without repeats. */
@@ -1,7 +1,7 @@
1
1
  import { b as DbError, f as Result } from "../../result-DTOQRyGY.js";
2
2
  import { t as Aal } from "../../mfa-CM5r904M.js";
3
3
  import { r as Block } from "../../define-block-COmMkx2x.js";
4
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
4
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
5
5
  import { t as AuthReply } from "../../auth-reply-BMPJQssh.js";
6
6
  /** A factor as `auth.mfa.listFactors()` returns it. */
7
7
  interface RawMfaFactor {
@@ -10,9 +10,9 @@ import { t as BlockProblemOptions } from "../../problem-NGBjN-TO.js";
10
10
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
11
11
  import { i as EventSink, t as CloudEvent } from "../../cloud-event-DXWmXrus.js";
12
12
  import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-CxwsRnfV.js";
13
- import { p as SubscriptionStatus } from "../../topic-B6zuexk7.js";
14
- import { n as TopicPort } from "../../watch-topic-YYSVJGDY.js";
15
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
13
+ import { p as SubscriptionStatus } from "../../topic-BVq5RdsI.js";
14
+ import { n as TopicPort } from "../../watch-topic-BOclyLFd.js";
15
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
16
16
  import { n as VerifyOptions } from "../../signatures-jPr9JXyw.js";
17
17
  import { a as NotificationItem, i as NotificationAction, n as NotificationMessage, o as NotificationSubject, r as NotificationSendResult, s as RenderedText, t as NotificationChannel } from "../../channel-B_kufDZy.js";
18
18
  import { a as DeliveryTransport, c as UnsubscribeTarget, i as DeliverySendOptions, l as mailHeaders, n as DeliveryMessages, o as EmailMessage, r as DeliveryReceipt, s as MailCategory, t as DeliveryChannel } from "../../delivery-CWcbh87x.js";
@@ -5,7 +5,7 @@ import { n as BlockOptions } from "../../block-helpers-disoUWCp.js";
5
5
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
6
6
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
7
7
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
8
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
8
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
9
9
  type ChecklistScope = "user" | "organization";
10
10
  /** One step. `events` completes it when the outbox records one of those types. */
11
11
  interface ChecklistStep<Id extends string = string> {
@@ -7,9 +7,9 @@ import { Ct as Events, W as InvitationEventData, Z as OrganizationEventData, o a
7
7
  import { r as BlockTemporalOptions } from "../../block-helpers-disoUWCp.js";
8
8
  import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-BEtC_Kis.js";
9
9
  import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DrA_d1dJ.js";
10
- import { N as PlatformRolesOption } from "../../authorization-DpVtxuKM.js";
10
+ import { N as PlatformRolesOption } from "../../authorization-D1P3VBOd.js";
11
11
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
12
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
12
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
13
13
  declare const INVITATION_ERRORS: {
14
14
  readonly INVITATION_FORBIDDEN: "42501";
15
15
  readonly INVITATION_ROLE_FORBIDDEN: "42501";
@@ -6,7 +6,7 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
6
6
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
7
7
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
8
8
  import { B as PermissionFlags, H as can, U as permissionFlags, V as PermissionSet, W as permissionMatches } from "../../index-BIAtapnD.js";
9
- import { n as Controller, t as AuthPort } from "../../controller-CQrkLoRX.js";
9
+ import { n as Controller, t as AuthPort } from "../../controller-DaWA9eWS.js";
10
10
  interface PermissionsOptions extends BlockOptions {
11
11
  /** `withBlockHooks` hooks around the client's methods. */
12
12
  readonly hooks?: BlockHooks<Permissions>;
@@ -10,7 +10,7 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
10
10
  import { n as BlockHooks } from "../../block-hooks-DrA_d1dJ.js";
11
11
  import { c as BlockOf } from "../../define-block-COmMkx2x.js";
12
12
  import { n as NotificationMessage, t as NotificationChannel } from "../../channel-B_kufDZy.js";
13
- import { t as ExpoNotificationsLike } from "../../push-token-kcc04ZaS.js";
13
+ import { t as ExpoNotificationsLike } from "../../push-token-D41lOoE8.js";
14
14
  type PushPlatform = "ios" | "android" | "web";
15
15
  type PushProvider = "expo" | "fcm" | "apns" | "webpush";
16
16
  /**
@@ -1,6 +1,6 @@
1
1
  import { n as isRecord } from "../../guards-CsRa6v57.js";
2
2
  import { t as AsyncResult } from "../../result-8xza7w5W.js";
3
- import { n as QUOTE_TO_ORDER, r as quotesSqlOptions, t as QUOTES_AUTOMATIONS } from "../../automations-Bw5cX7oj.js";
3
+ import { n as QUOTE_TO_ORDER, r as quotesSqlOptions, t as QUOTES_AUTOMATIONS } from "../../automations-D4QTP8nI.js";
4
4
  import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
5
5
  import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, a as bigintOf, d as enumOrThrow, j as requiredInstant, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
6
6
  import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";