better-supabase 0.37.0 → 0.38.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/ai-sdk/agents/index.d.ts +2 -2
- package/dist/{app-tables-BlhdqqHf.d.ts → app-tables-D2c0i05-.d.ts} +1 -1
- package/dist/{authorization-C7yjZttV.d.ts → authorization-D8CaAdqU.d.ts} +7 -5
- package/dist/{bind-BspFMDdW.d.ts → bind-5vOwNouG.d.ts} +1 -1
- package/dist/{block-env-CLco8YUl.d.ts → block-env-hco8BLjC.d.ts} +3 -3
- package/dist/block-subjects-CINiJW1R.js +253 -0
- package/dist/{block-tables-DfomofFv.d.ts → block-tables-BsgdB6VG.d.ts} +1 -1
- 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 +1 -1
- package/dist/blocks/catalog/index.d.ts +4 -0
- package/dist/blocks/catalog/index.js +10 -0
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/entitlements/index.d.ts +2 -2
- package/dist/blocks/expenses/index.d.ts +2 -0
- package/dist/blocks/expenses/index.js +10 -3
- 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/invoices/index.d.ts +15 -1
- package/dist/blocks/invoices/index.js +13 -0
- package/dist/blocks/leave/index.js +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/onboarding/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/permissions/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +1 -1
- 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/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/claims/index.d.ts +3 -3
- package/dist/cli/{add-DqfJVb1F.js → add-7nCSDmpt.js} +10 -10
- package/dist/cli/{add-Buuy7BSU.js → add-B4tQpnXP.js} +2 -2
- package/dist/cli/add-CdDneXMN.js +1 -0
- package/dist/cli/{app-table-files-Ku-4tPUu.js → app-table-files-CtO-zxpO.js} +2 -2
- package/dist/cli/{app-tables-Dg0sh4dH.js → app-tables-B7UzcJ_g.js} +2 -2
- package/dist/cli/{backfill-Dspz6kVJ.js → backfill-B2nFDXaS.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-CqVBlc4L.js → blocks-BX_6HUQT.js} +1 -1
- package/dist/cli/{blocks-B8LAph-w.js → blocks-DU4iDrYS.js} +1 -1
- package/dist/cli/{cache-BbuuCIRU.js → cache-bS5bAoF-.js} +1 -1
- package/dist/cli/{codemod-DIAy8uXt.js → codemod-B1sSIE2p.js} +1 -1
- package/dist/cli/{content-mapper-NXfJ5VkP.js → content-mapper-CW6V6VRq.js} +2 -2
- package/dist/cli/{doctor-CUOyLE0c.js → doctor-Dw2pAf1b.js} +15 -15
- package/dist/cli/{gen-s9canfdC.js → gen-BtoSx3go.js} +11 -11
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{init-Zs0Ca5on.js → init-DZXbrKuJ.js} +8 -8
- package/dist/cli/{live-BaLsNove.js → live-CDFfJcdR.js} +2 -2
- package/dist/cli/{mcp-ST7bVpJD.js → mcp-BukxvITV.js} +2 -2
- package/dist/cli/{metadata-aOvlCOOg.js → metadata-iZizGVuY.js} +3 -3
- package/dist/cli/{migrate-ClBx3Ggx.js → migrate-DPnnGLzw.js} +1 -1
- package/dist/cli/{migration-safety-mjm1pghO.js → migration-safety-COcnZbMO.js} +1 -1
- package/dist/cli/{migrations-tzItvwxT.js → migrations-BBt9fmiV.js} +2 -2
- package/dist/cli/{module-migration-D0Rjdvdx.js → module-migration-tCmPLhQp.js} +2 -2
- package/dist/cli/{powersync-DryX_DMG.js → powersync-BRmUJ-uR.js} +3 -3
- package/dist/cli/powersync-CYLPcJ9G.js +1 -0
- package/dist/cli/{print-fOUnKwA9.js → print-DdwQNG_e.js} +2 -2
- package/dist/cli/{providers-BR1d_5jA.js → providers-CaNg6Ayz.js} +1 -1
- package/dist/cli/{prune-workflows-CCjzNrxl.js → prune-workflows-BQQrI3tU.js} +1 -1
- package/dist/cli/{remove-B_0OIusa.js → remove-BEj9YEON.js} +5 -5
- package/dist/cli/{render-BCJKDX3c.js → render-UBqU9r44.js} +3 -3
- package/dist/cli/{run-4VUQTR-R.js → run-3E_IuJzS.js} +9 -9
- package/dist/cli/{run-BctvQX_g.js → run-BXlX9YdD.js} +27 -27
- package/dist/cli/{shared-oY7PGamd.js → shared-agrqD28l.js} +1 -1
- package/dist/cli/{snapshot-CWtER9-4.js → snapshot-DOXmozSq.js} +2 -2
- package/dist/cli/{source-D4uav_v9.js → source-BfJprU-6.js} +1 -1
- package/dist/cli/{spec-BPsyEzqH.js → spec-CgtIHFsl.js} +1 -1
- package/dist/cli/{spec-DTnBeaCD.js → spec-DRpSQGOW.js} +2 -2
- package/dist/cli/{sql-layout-DbhEQqq0.js → sql-layout-Cs3FMWcY.js} +2 -2
- package/dist/cli/{sync-CazH5FX4.js → sync-C_YGIDjk.js} +4 -4
- package/dist/cli/{upgrade-Cyx6ESpc.js → upgrade-ByQeJRGU.js} +5 -5
- package/dist/cli/{upgrade-Dyb4-f0Q.js → upgrade-OG9vaBeX.js} +2 -2
- package/dist/cli/{version-D1ZKUFng.js → version-CF6Yzah0.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +4 -4
- package/dist/{config-Dx3bEPlX.js → config-1-UmQczM.js} +1 -1
- package/dist/{config-uSliwPS6.js → config-AEB5iNEO.js} +4 -123
- package/dist/{context-D6OZQdcT.d.ts → context-CH5FYnVk.d.ts} +1 -1
- package/dist/contract/index.d.ts +3 -3
- package/dist/{controller-DhcSXkAC.d.ts → controller-CJ6rLnpS.d.ts} +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 +2 -2
- package/dist/{entitlements-Bi4y8w8e.d.ts → entitlements-6gODwBSz.d.ts} +1 -1
- package/dist/{field-errors-CJ_i6HFg.d.ts → field-errors-CdSjV9Zo.d.ts} +4 -4
- package/dist/{index-C71uHfVj.d.ts → index-B5awu2SP.d.ts} +2 -2
- package/dist/{index-Cbwvf4yE.d.ts → index-BgRl484n.d.ts} +1 -1
- package/dist/{index-Bm1ftdBA.d.ts → index-CgKieWlO.d.ts} +2 -2
- package/dist/{index-ChvuVimY.d.ts → index-CrOeAgSh.d.ts} +2 -2
- package/dist/{index-Bc5t2QRU.d.ts → index-DnEJVKQ2.d.ts} +6 -6
- package/dist/{index-DrDCN45q.d.ts → index-DzLLMmUB.d.ts} +1 -1
- package/dist/{index-CRwpDGxd.d.ts → index-vkd2LTt2.d.ts} +1 -1
- package/dist/{instances-DKULdpWB.js → instances-Bycf_aus.js} +13 -1
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +1 -1
- package/dist/next/index.d.ts +4 -4
- package/dist/{operations-BDjgCmT9.d.ts → operations-knMnfzgm.d.ts} +1 -1
- package/dist/{options-RYbyaVhv.js → options-CS1DA8q9.js} +1 -0
- package/dist/{options-ScQ6Hnxo.js → options-zsLpIqBA.js} +2 -1
- package/dist/otel/index.js +4 -4
- package/dist/{permissions-BGx22GP3.d.ts → permissions-Ed8WvLgQ.d.ts} +1 -1
- package/dist/{ports-D63bA3p4.d.ts → ports-Bnwy2mlR.d.ts} +1 -1
- package/dist/powersync/index.d.ts +2 -2
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-oc_liUHz.js → preset-DkeXFh7e.js} +2 -2
- package/dist/{project-Cs0kz5OP.js → project-By0R8ioI.js} +5 -5
- package/dist/{push-token-BsyX0KlT.d.ts → push-token-CJbEvwjI.d.ts} +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/realtime/index.d.ts +3 -3
- package/dist/records/index.d.ts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/solid/index.d.ts +5 -5
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +3 -3
- package/dist/{sql-CWYbu_6y.js → sql-B2cMvGnZ.js} +359 -47
- package/dist/ssr/index.d.ts +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/{tenant-DqnE50Ju.d.ts → tenant-eZNRWTRJ.d.ts} +1 -1
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +1 -1
- package/dist/{topic-Dp7VGPd-.d.ts → topic-D7F2FBNp.d.ts} +1 -1
- package/dist/{types-DLXTmZtm.d.ts → types-bqvFoBhf.d.ts} +2 -2
- package/dist/vue/index.d.ts +5 -5
- package/dist/{watch-topic-CtJAkWT4.d.ts → watch-topic-BIEaSN0Y.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-pB1jCLIL.js → workflow-sdk-6psRpDIo.js} +1 -69
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +10 -0
- package/dist/cli/add-8zKWiO0X.js +0 -1
- package/dist/cli/powersync-vvu2-72V.js +0 -1
- package/dist/resolved-names-sd6RuTju.js +0 -130
|
@@ -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-DWXAxvkN.js";
|
|
3
3
|
import { t as Agent } from "../../agents-BwUHtvD6.js";
|
|
4
4
|
import { R as AiToolPolicy, t as AiChat, w as AiModerationStage, x as AiModerationAction } from "../../ai-chat-BZhfCHHr.js";
|
|
5
|
-
import { r as AuthorizationOperation } from "../../authorization-
|
|
6
|
-
import { t as OperationTable } from "../../operations-
|
|
5
|
+
import { r as AuthorizationOperation } from "../../authorization-D8CaAdqU.js";
|
|
6
|
+
import { t as OperationTable } from "../../operations-knMnfzgm.js";
|
|
7
7
|
import { i as SearchToolOptions, r as ResultsFilter } from "../../embeddings-CI6P_mtD.js";
|
|
8
8
|
import { n as GatewayOptions } from "../../gateway-options-Mut8jih_.js";
|
|
9
9
|
import { LanguageModel, LanguageModelMiddleware, StopCondition, ToolLoopAgent, ToolLoopAgentSettings, ToolSet } from "ai";
|
|
@@ -344,8 +344,8 @@ interface BlockNameRegistry {
|
|
|
344
344
|
readonly "variantTranslations": "tenant" | "variant" | "locale" | "title" | "updatedAt";
|
|
345
345
|
readonly "media": "id" | "tenant" | "product" | "variant" | "attachment" | "position" | "alt" | "createdAt";
|
|
346
346
|
};
|
|
347
|
-
readonly functions: "add_to_collection" | "channel_price" | "channel_products" | "currency_minor_units" | "delete_catalog_channel" | "delete_category" | "delete_collection" | "delete_price" | "delete_price_list" | "delete_product" | "delete_product_option" | "delete_variant" | "move_category" | "product_text" | "publish_storefront" | "rank_variant" | "remove_from_collection" | "reorder_product_options" | "save_catalog_channel" | "save_category" | "save_collection" | "save_price_list" | "save_product" | "save_product_option" | "save_variant" | "set_channel_listing" | "set_price" | "set_product_categories" | "set_product_options" | "set_product_status" | "set_product_translation" | "set_variant_translation" | "storefront_products" | "storefront_tenants" | "variant_price";
|
|
348
|
-
readonly actions: "manage" | "read" | "create" | "update" | "delete";
|
|
347
|
+
readonly functions: "add_to_collection" | "channel_price" | "channel_products" | "currency_minor_units" | "delete_catalog_channel" | "delete_category" | "delete_collection" | "delete_price" | "delete_price_list" | "delete_product" | "delete_product_option" | "delete_variant" | "move_category" | "product_text" | "publish_storefront" | "rank_variant" | "remove_from_collection" | "reorder_product_options" | "save_catalog_channel" | "save_category" | "save_collection" | "save_price_list" | "save_product" | "save_product_option" | "save_variant" | "set_channel_listing" | "set_price" | "set_product_categories" | "set_product_options" | "set_product_status" | "set_product_translation" | "set_variant_status" | "set_variant_translation" | "storefront_products" | "storefront_tenants" | "variant_price";
|
|
348
|
+
readonly actions: "manage" | "read" | "create" | "update" | "delete" | "categoryCreate" | "categoryUpdate" | "categoryDelete";
|
|
349
349
|
readonly hooks: "before_product_save" | "after_product_save" | "before_variant_save" | "after_variant_save" | "before_price_set" | "after_price_set";
|
|
350
350
|
readonly entities: {
|
|
351
351
|
readonly "product": "id" | "tenant_id" | "slug" | "title" | "description" | "kind" | "status" | "created_at" | "updated_at" | "price" | "currency" | "track_inventory";
|
|
@@ -957,8 +957,8 @@ interface BlockNameRegistry {
|
|
|
957
957
|
readonly "lines": "id" | "tenant" | "parent" | "productType" | "productId" | "description" | "quantity" | "unitAmount" | "discountBps" | "taxRateBps" | "taxCode" | "position" | "createdAt";
|
|
958
958
|
readonly "charges": "id" | "tenant" | "invoice" | "amount" | "currency" | "description" | "createdBy" | "createdAt";
|
|
959
959
|
};
|
|
960
|
-
readonly functions: "add_invoice_charge" | "create_invoice" | "credit_invoice" | "invoice_aging" | "issue_invoice" | "record_invoice_payment" | "remove_invoice_charge" | "reverse_invoice_payment" | "set_invoice_lines" | "set_invoice_lines_recount" | "void_invoice" | "write_off_invoice";
|
|
961
|
-
readonly actions: "read" | "write" | "manage" | "create" | "update" | "issue" | "payment" | "credit" | "charge" | "void" | "writeOff" | "reverse";
|
|
960
|
+
readonly functions: "add_invoice_charge" | "create_invoice" | "credit_invoice" | "delete_invoice" | "invoice_aging" | "issue_invoice" | "record_invoice_payment" | "remove_invoice_charge" | "reverse_invoice_payment" | "set_invoice_lines" | "set_invoice_lines_recount" | "update_invoice" | "void_invoice" | "write_off_invoice";
|
|
961
|
+
readonly actions: "read" | "write" | "manage" | "create" | "update" | "issue" | "payment" | "credit" | "charge" | "void" | "writeOff" | "reverse" | "delete";
|
|
962
962
|
readonly hooks: "before_invoice_issue" | "after_invoice_issue" | "before_invoice_payment" | "after_invoice_payment";
|
|
963
963
|
readonly entities: {
|
|
964
964
|
readonly "invoice": "id" | "tenant_id" | "kind" | "number" | "identifier" | "original_id" | "title" | "company_type" | "company_id" | "contact_type" | "contact_id" | "currency" | "status" | "terms_days" | "issued_on" | "due_on" | "paid_total" | "credited_total" | "paid_at" | "voided_at" | "void_reason" | "write_off_reason" | "note" | "origin_type" | "origin_id" | "deposit_bps" | "prices_include_tax" | "created_by" | "created_at" | "updated_at" | "list_total" | "discount_total" | "subtotal" | "tax_total" | "total";
|
|
@@ -1018,7 +1018,7 @@ interface BlockNameRegistry {
|
|
|
1018
1018
|
readonly "balances": "id" | "tenant" | "user" | "employee" | "type" | "kind" | "amount" | "effectiveOn" | "expiresOn" | "request" | "note" | "key" | "createdBy" | "createdAt";
|
|
1019
1019
|
};
|
|
1020
1020
|
readonly functions: "accrue_leave" | "adjust_leave_balance" | "approve_leave_request" | "archive_leave_type" | "cancel_leave_request" | "close_leave_year" | "decide_leave_request" | "leave_available" | "leave_balances" | "leave_is_mine" | "leave_ledger_entries" | "leave_post" | "leave_posted" | "leave_working_days" | "list_leave_requests" | "list_leave_types" | "request_leave" | "save_leave_type" | "split_leave_request" | "update_leave_request";
|
|
1021
|
-
readonly actions: "request" | "read" | "approve" | "manage" | "readConfidential";
|
|
1021
|
+
readonly actions: "request" | "read" | "approve" | "manage" | "readConfidential" | "reapprove";
|
|
1022
1022
|
readonly hooks: "before_leave_request" | "after_leave_request";
|
|
1023
1023
|
readonly entities: {
|
|
1024
1024
|
readonly "request": "id" | "tenant_id" | "user_id" | "employee_id" | "type_id" | "starts_on" | "ends_on" | "partial" | "start_part" | "end_part" | "amount" | "note" | "approval_id" | "approved_at" | "cancelled_at" | "cancelled_by" | "created_at" | "updated_at" | "rejected_at" | "decided_by" | "decision_note";
|
|
@@ -2404,6 +2404,7 @@ type EmployeesSqlOptions = {
|
|
|
2404
2404
|
/** `blocks.expenses.options`. */
|
|
2405
2405
|
type ExpensesSqlOptions = {
|
|
2406
2406
|
readonly extraColumns?: ExtraColumns;
|
|
2407
|
+
readonly categoryExtraColumns?: ExtraColumns;
|
|
2407
2408
|
/**
|
|
2408
2409
|
* `false` runs expenses without the approvals block: a submitted report waits
|
|
2409
2410
|
* until `decide_expense_report` approves or rejects it.
|
|
@@ -2571,6 +2572,7 @@ type LeaveSqlOptions = {
|
|
|
2571
2572
|
*/
|
|
2572
2573
|
readonly approvals?: boolean;
|
|
2573
2574
|
readonly owner?: "user" | "employee";
|
|
2575
|
+
readonly reapprove?: boolean;
|
|
2574
2576
|
};
|
|
2575
2577
|
/** `blocks.memory.options`. */
|
|
2576
2578
|
type MemorySqlOptions = {
|
|
@@ -4,7 +4,7 @@ import { t as BetterSupabase, y as Db } from "./define-C_He1bQO.js";
|
|
|
4
4
|
import { n as DataEngine } from "./data-engine-CX1oYDZl.js";
|
|
5
5
|
import { Dn as GeneratedBlocks } from "./define-block-CDw9YGVh.js";
|
|
6
6
|
import { rt as BetterQueries } from "./index-DAS_5OfK.js";
|
|
7
|
-
import { t as ClientPorts } from "./ports-
|
|
7
|
+
import { t as ClientPorts } from "./ports-Bnwy2mlR.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-CDw9YGVh.js";
|
|
2
|
-
import { n as TopicPort } from "./watch-topic-
|
|
3
|
-
import { t as ClientPorts } from "./ports-
|
|
4
|
-
import { t as AuthPort } from "./controller-
|
|
2
|
+
import { n as TopicPort } from "./watch-topic-BIEaSN0Y.js";
|
|
3
|
+
import { t as ClientPorts } from "./ports-Bnwy2mlR.js";
|
|
4
|
+
import { t as AuthPort } from "./controller-CJ6rLnpS.js";
|
|
5
5
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
6
6
|
/**
|
|
7
7
|
* What the block bindings hand their controllers: the provider's client,
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { a as entityNoun, i as entityNames, n as checkEntityName, s as tenantRename, t as DEFAULT_TENANT } from "./entity-naming-BES3pkQI.js";
|
|
2
|
+
import { I as resolveBlock, L as tenantNameOf, M as PRESET_CATALOG } from "./instances-Bycf_aus.js";
|
|
3
|
+
// src/config/defaults.ts
|
|
4
|
+
/**
|
|
5
|
+
* Every default `resolveConfig` fills in. Other modules (the SQL module
|
|
6
|
+
* registry, the CLI) read their fallbacks from here instead of repeating the
|
|
7
|
+
* literals.
|
|
8
|
+
*/
|
|
9
|
+
const CONFIG_DEFAULTS = {
|
|
10
|
+
output: "src/lib/supabase/generated.ts",
|
|
11
|
+
schemas: ["public"],
|
|
12
|
+
casing: "snake",
|
|
13
|
+
postgrestVersion: "13",
|
|
14
|
+
codecs: {
|
|
15
|
+
timestamptz: "string",
|
|
16
|
+
int8: "number",
|
|
17
|
+
numeric: "number"
|
|
18
|
+
},
|
|
19
|
+
sql: {
|
|
20
|
+
dir: "supabase/schemas",
|
|
21
|
+
prefix: "900_better_supabase",
|
|
22
|
+
testsDir: "supabase/tests"
|
|
23
|
+
},
|
|
24
|
+
seed: {
|
|
25
|
+
entry: "supabase/seed.ts",
|
|
26
|
+
output: "supabase/seeds/000_better_supabase.sql",
|
|
27
|
+
perTenant: "supabase/seed.tenant.ts"
|
|
28
|
+
},
|
|
29
|
+
openapi: {
|
|
30
|
+
entry: "src/lib/openapi.ts",
|
|
31
|
+
output: "openapi.json"
|
|
32
|
+
},
|
|
33
|
+
specs: { failOn: "error" },
|
|
34
|
+
doctor: {
|
|
35
|
+
format: "text",
|
|
36
|
+
sources: ["src/**/*.{ts,tsx}"],
|
|
37
|
+
policyHelperLimit: 5
|
|
38
|
+
},
|
|
39
|
+
gen: { watchInterval: 2e3 },
|
|
40
|
+
env: { output: ".env.local" }
|
|
41
|
+
};
|
|
42
|
+
// src/config/json.ts
|
|
43
|
+
/**
|
|
44
|
+
* The JSON Schema document for a `json[...].schema` entry. A Standard Schema
|
|
45
|
+
* converts for `target` (2020-12 by default); a JSON Schema object is returned
|
|
46
|
+
* as it is.
|
|
47
|
+
*/
|
|
48
|
+
function resolveJsonSchema(source, target = "draft-2020-12") {
|
|
49
|
+
const standard = source["~standard"];
|
|
50
|
+
if (standard === void 0) return source;
|
|
51
|
+
const jsonSchema = standard.jsonSchema;
|
|
52
|
+
if (typeof jsonSchema?.input !== "function") throw new TypeError("json[...].schema: this Standard Schema library does not implement Standard JSON Schema; pass a JSON Schema object instead");
|
|
53
|
+
return jsonSchema.input({ target });
|
|
54
|
+
}
|
|
55
|
+
// src/sql/resolved-names.ts
|
|
56
|
+
const PLACEHOLDER$1 = /\{([^{}]*)\}/g;
|
|
57
|
+
function primaryOf(where, entities) {
|
|
58
|
+
const primary = Object.entries(entities).find(([, spec]) => spec.primary);
|
|
59
|
+
if (primary === void 0) throw new TypeError(`${where}: the block has no primary entity, so name one: ${Object.keys(entities).join(", ") || "none"}`);
|
|
60
|
+
return primary[0];
|
|
61
|
+
}
|
|
62
|
+
/** `blocks.<name>.entities` as entity key to its config, shorthand expanded. */
|
|
63
|
+
function configured(where, entities, config) {
|
|
64
|
+
if (config === void 0) return /* @__PURE__ */ new Map();
|
|
65
|
+
if (typeof config === "string") return /* @__PURE__ */ new Map([[primaryOf(where, entities), { name: config }]]);
|
|
66
|
+
const found = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const [key, value] of Object.entries(config)) {
|
|
68
|
+
if (value === void 0) continue;
|
|
69
|
+
if (!(key in entities)) throw new TypeError(`${where}: unknown entity "${key}". Entities: ${Object.keys(entities).join(", ") || "none"}`);
|
|
70
|
+
found.set(key, typeof value === "string" ? { name: value } : value);
|
|
71
|
+
}
|
|
72
|
+
return found;
|
|
73
|
+
}
|
|
74
|
+
function checkUrl(where, url, columns) {
|
|
75
|
+
for (const [, column] of url.matchAll(PLACEHOLDER$1)) if (columns === void 0 || column === void 0 || !(column in columns)) throw new TypeError(`${where}: "{${column ?? ""}}" is not a column of the entity's table. Columns: ${Object.keys(columns ?? {}).join(", ") || "none"}`);
|
|
76
|
+
return url;
|
|
77
|
+
}
|
|
78
|
+
/** The noun forms a rename matches, for the containment check. */
|
|
79
|
+
const nounForms = (noun) => [noun.singular, noun.plural];
|
|
80
|
+
function checkNoun(where, noun, others) {
|
|
81
|
+
for (const other of others) {
|
|
82
|
+
const taken = nounForms(other).find((form) => new RegExp(`(^|_)${form}(_|$)`).test(noun.singular));
|
|
83
|
+
if (taken !== void 0) throw new TypeError(`${where}: "${noun.singular}" contains "${taken}", another name the blocks rename. Choose another name.`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function resolveEntity(where, key, spec, names, config) {
|
|
87
|
+
const from = entityNoun(spec.singular, spec.plural);
|
|
88
|
+
const to = config?.name === void 0 && config?.plural === void 0 ? from : entityNoun(config.name === void 0 ? spec.singular : checkEntityName(`${where}.${key}`, config.name), config.plural === void 0 ? void 0 : checkEntityName(`${where}.${key}.plural`, config.plural));
|
|
89
|
+
const columns = spec.table === void 0 ? void 0 : names.tables[spec.table]?.columns;
|
|
90
|
+
return {
|
|
91
|
+
key,
|
|
92
|
+
from,
|
|
93
|
+
to,
|
|
94
|
+
primary: spec.primary === true,
|
|
95
|
+
global: spec.global === true,
|
|
96
|
+
...spec.table === void 0 ? {} : { table: spec.table },
|
|
97
|
+
...config?.url === void 0 ? {} : { url: checkUrl(`${where}.${key}.url`, config.url, columns) },
|
|
98
|
+
...spec.subject === void 0 || config?.subject === false ? {} : { subject: spec.subject }
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The final names of `module` under `blocks`: its entities renamed through
|
|
103
|
+
* `blocks.<module>.entities`, and the tenant through
|
|
104
|
+
* `blocks.memberships.names.organization`. Throws on an unknown entity, a name
|
|
105
|
+
* that isn't a lowercase identifier, a `url` placeholder that isn't a column,
|
|
106
|
+
* or a name that contains another noun the blocks rename.
|
|
107
|
+
*/
|
|
108
|
+
function resolveNames(module, names, blocks = {}) {
|
|
109
|
+
const where = `blocks.${module}.names`;
|
|
110
|
+
const specs = names.entities ?? {};
|
|
111
|
+
const config = configured(where, specs, blocks[module]?.entities);
|
|
112
|
+
const tenantName = tenantNameOf(blocks);
|
|
113
|
+
const tenant = tenantName === void 0 ? DEFAULT_TENANT : tenantRename(tenantName).to;
|
|
114
|
+
const entities = Object.fromEntries(Object.entries(specs).map(([key, spec]) => [key, resolveEntity(where, key, spec, names, config.get(key))]));
|
|
115
|
+
const own = Object.values(entities).filter((entity) => !entity.global);
|
|
116
|
+
const defaults = [DEFAULT_TENANT, ...own.map((entity) => entity.from)];
|
|
117
|
+
for (const entity of own) if (entity.to.singular !== entity.from.singular) checkNoun(`${where}.${entity.key}`, entity.to, defaults.filter((noun) => noun !== entity.from));
|
|
118
|
+
const renames = own.map((entity) => ({
|
|
119
|
+
from: entity.from,
|
|
120
|
+
to: entity.to
|
|
121
|
+
}));
|
|
122
|
+
return {
|
|
123
|
+
module,
|
|
124
|
+
entities,
|
|
125
|
+
tenant,
|
|
126
|
+
naming: entityNames([...tenantName === void 0 ? [] : [tenantRename(tenantName)], ...renames]),
|
|
127
|
+
entityNaming: entityNames(renames)
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// src/config/block-subjects.ts
|
|
131
|
+
const CATALOG = new Map(PRESET_CATALOG.blocks.map((block) => [block.name, block]));
|
|
132
|
+
/** `names` and every block they require, from the catalog, in order. */
|
|
133
|
+
function withRequired(names) {
|
|
134
|
+
const found = /* @__PURE__ */ new Set();
|
|
135
|
+
const add = (name) => {
|
|
136
|
+
if (found.has(name)) return;
|
|
137
|
+
found.add(name);
|
|
138
|
+
for (const required of CATALOG.get(name)?.requires ?? []) add(required);
|
|
139
|
+
};
|
|
140
|
+
for (const name of names) add(name);
|
|
141
|
+
return [...found];
|
|
142
|
+
}
|
|
143
|
+
const PLACEHOLDER = /\{([^{}]*)\}/g;
|
|
144
|
+
/** One installed module's names under `blocks`, from the catalog. */
|
|
145
|
+
function catalogNames(module) {
|
|
146
|
+
const entities = CATALOG.get(module)?.entities;
|
|
147
|
+
return entities === void 0 ? void 0 : {
|
|
148
|
+
tables: entities.tables,
|
|
149
|
+
entities: entities.specs
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The entities `blocks.<module>.names` gives a new name, such as `work_item` to
|
|
154
|
+
* `task`, for the block's TypeScript client (`blocks.generated.ts`). Empty when
|
|
155
|
+
* the module renames none.
|
|
156
|
+
*/
|
|
157
|
+
function blockEntityRenames(module, blocks) {
|
|
158
|
+
const names = catalogNames(module);
|
|
159
|
+
if (names === void 0) return [];
|
|
160
|
+
return Object.values(resolveNames(module, names, blocks).entities).filter((entity) => !entity.global && (entity.to.singular !== entity.from.singular || entity.to.plural !== entity.from.plural)).map((entity) => ({
|
|
161
|
+
from: entity.from,
|
|
162
|
+
to: entity.to
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
/** The entities one installed block declares, with their final names. */
|
|
166
|
+
function blockEntities(module, blocks) {
|
|
167
|
+
const names = catalogNames(module);
|
|
168
|
+
if (names === void 0) return [];
|
|
169
|
+
const resolved = resolveNames(module, names, blocks);
|
|
170
|
+
const mapped = resolveBlock(blocks[module]).tables;
|
|
171
|
+
return Object.values(resolved.entities).map((entity) => {
|
|
172
|
+
const logical = entity.table;
|
|
173
|
+
const spec = logical === void 0 ? void 0 : names.tables[logical];
|
|
174
|
+
const target = logical === void 0 ? void 0 : mapped[logical];
|
|
175
|
+
const table = spec === void 0 || target === null ? void 0 : target ?? resolved.naming.rename(spec.name);
|
|
176
|
+
return {
|
|
177
|
+
key: entity.key,
|
|
178
|
+
from: entity.from,
|
|
179
|
+
to: entity.to,
|
|
180
|
+
primary: entity.primary,
|
|
181
|
+
table,
|
|
182
|
+
url: entity.url
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/** The subjects one installed block registers, keyed by renamed entity. */
|
|
187
|
+
function subjectsOf(module, blocks) {
|
|
188
|
+
const entities = CATALOG.get(module)?.entities;
|
|
189
|
+
const names = catalogNames(module);
|
|
190
|
+
const config = resolveBlock(blocks[module]);
|
|
191
|
+
if (entities === void 0 || names === void 0 || config.mode === "custom") return {};
|
|
192
|
+
const resolved = resolveNames(module, names, blocks);
|
|
193
|
+
const key = (action) => config.permissions[action] ?? resolved.entityNaming.rename(entities.keys[action] ?? `${module}.${action}`);
|
|
194
|
+
return Object.fromEntries(Object.values(resolved.entities).flatMap((entity) => {
|
|
195
|
+
const subject = entity.subject;
|
|
196
|
+
const table = entity.table === void 0 ? void 0 : names.tables[entity.table];
|
|
197
|
+
const mapped = entity.table === void 0 ? void 0 : config.tables[entity.table];
|
|
198
|
+
if (subject === void 0 || entity.table === void 0 || table === void 0 || mapped === null) return [];
|
|
199
|
+
const logical = entity.table;
|
|
200
|
+
const column = (name) => config.columns[logical]?.[name] ?? resolved.naming.rename(table.columns[name] ?? name);
|
|
201
|
+
const titled = (key) => config.columns[logical]?.[key] === null && subject.fallbackTitle !== void 0 ? column(subject.fallbackTitle) : column(key);
|
|
202
|
+
const name = mapped ?? resolved.naming.rename(table.name);
|
|
203
|
+
const url = entity.url ?? subject.url;
|
|
204
|
+
const entry = {
|
|
205
|
+
table: name.includes(".") ? name : `${config.schema}.${name}`,
|
|
206
|
+
idType: "uuid",
|
|
207
|
+
tenant: column("tenant"),
|
|
208
|
+
title: titled(subject.title),
|
|
209
|
+
permissions: {
|
|
210
|
+
read: key(subject.permissions.read),
|
|
211
|
+
write: key(subject.permissions.write),
|
|
212
|
+
...subject.permissions.upload === void 0 ? {} : { upload: key(subject.permissions.upload) }
|
|
213
|
+
},
|
|
214
|
+
...subject.deletedAt === void 0 ? {} : { deletedAt: column(subject.deletedAt) },
|
|
215
|
+
...subject.rank === void 0 ? {} : { rank: {
|
|
216
|
+
column: column(subject.rank.column),
|
|
217
|
+
group: column(subject.rank.group)
|
|
218
|
+
} },
|
|
219
|
+
...subject.search === void 0 ? {} : { search: {
|
|
220
|
+
title: titled(subject.search.title),
|
|
221
|
+
body: subject.search.body.filter((name) => config.columns[logical]?.[name] !== null).map(column)
|
|
222
|
+
} },
|
|
223
|
+
...url === void 0 ? {} : { url: url.replaceAll(PLACEHOLDER, (_, placeholder) => `{${column(placeholder)}}`) },
|
|
224
|
+
...subject.cascade === true ? { cascade: true } : {}
|
|
225
|
+
};
|
|
226
|
+
return [[entity.to.singular, entry]];
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The entities of every installed block that registers one (work items, deals,
|
|
231
|
+
* companies and people, products, employees), under their renamed type, then
|
|
232
|
+
* `subjects`. Throws when `subjects` already has a block's type.
|
|
233
|
+
*/
|
|
234
|
+
/** The subject types one installed block registers, by renamed entity. */
|
|
235
|
+
function blockSubjectTypes(module, blocks) {
|
|
236
|
+
return Object.keys(subjectsOf(module, blocks));
|
|
237
|
+
}
|
|
238
|
+
function withBlockSubjects(subjects, blockNames, blocks) {
|
|
239
|
+
const merged = {};
|
|
240
|
+
for (const module of withRequired(blockNames)) for (const [type, entry] of Object.entries(subjectsOf(module, blocks))) {
|
|
241
|
+
if (Object.hasOwn(subjects, type)) throw new TypeError(`records.${type}: the ${module} block registers "${type}" itself; remove records.${type}, or set blocks.${module}.names.<entity>.subject to false to keep your own`);
|
|
242
|
+
merged[type] = entry;
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
...merged,
|
|
246
|
+
...subjects
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function installedBlockSubjects(subjects, installed, blocks) {
|
|
250
|
+
const dropped = new Set(withRequired(installed).filter((module) => !installed.includes(module)).flatMap((module) => blockSubjectTypes(module, blocks)));
|
|
251
|
+
return dropped.size === 0 ? subjects : Object.fromEntries(Object.entries(subjects).filter(([type]) => !dropped.has(type)));
|
|
252
|
+
}
|
|
253
|
+
export { withBlockSubjects as a, CONFIG_DEFAULTS as c, installedBlockSubjects as i, blockEntityRenames as n, resolveNames as o, blockSubjectTypes as r, resolveJsonSchema as s, blockEntities as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as ResolvedConfig } from "./context-
|
|
1
|
+
import { cn as ResolvedConfig } from "./context-CH5FYnVk.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 { $ as createHarnessSessions, A as AiRunStatus, B as SharedAiChat, C as AiModerationInput, D as AiProject, E as AiPendingInputRequest, F as AiStreamClaim, G as AiPendingApproval, H as AiHarnessSessionPatch, I as AiToolApproval, J as AiRunState, K as AiRun, L as AiToolApprovalRequest, M as AiShareLink, N as AiStoredMessage, O as AiProjectInput, P as AiStoredMessageStatus, Q as AiRuns, R as AiToolPolicy, S as AiModerationEvent, T as AiPendingInput, U as AiHarnessSessions, V as AiHarnessSession, W as AiHarnessStatus, X as AiRunStepInput, Y as AiRunStep, Z as AiRunStepStatus, _ as AiFeedback, a as createAiChat, b as AiModelInput, c as AiAssistantMessageOptions, d as AiChatPage, f as AiChatPatch, g as AiChatVisibility, h as AiChatShare, i as aiChatTopic, j as AiSaveResult, k as AiRunRelease, l as AiChatInput, m as AiChatRecord, n as AiChatOptions, o as AiAppendResult, p as AiChatQuery, q as AiRunQuery, r as aiChatListTopic, s as AiApprovalDecision, t as AiChat, v as AiMessageSibling, w as AiModerationStage, x as AiModerationAction, y as AiModel, z as AiUserMessageTrigger } from "../../ai-chat-BZhfCHHr.js";
|
|
6
6
|
import { a as NewAiSandbox, i as AiSandboxes, n as AiSandboxStatus, r as AiSandboxStopper, t as AiSandbox } from "../../sandboxes-BF9RxxCU.js";
|
|
7
7
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
8
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
9
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
10
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
8
|
+
import { p as SubscriptionStatus } from "../../topic-D7F2FBNp.js";
|
|
9
|
+
import { n as TopicPort } from "../../watch-topic-BIEaSN0Y.js";
|
|
10
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.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-BNtM1tqy.js";
|
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
10
10
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
11
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
12
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
13
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
11
|
+
import { p as SubscriptionStatus } from "../../topic-D7F2FBNp.js";
|
|
12
|
+
import { n as TopicPort } from "../../watch-topic-BIEaSN0Y.js";
|
|
13
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.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-CDmOUuLZ.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-BncNDlWG.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-
|
|
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-BgRl484n.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-CDmOUuLZ.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-CDw9YGVh.js";
|
|
6
|
-
import { n as Controller } from "../../controller-
|
|
6
|
+
import { n as Controller } from "../../controller-CJ6rLnpS.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-C_He1bQO.js"
|
|
|
11
11
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
12
12
|
import { i as EventSink, t as CloudEvent } from "../../cloud-event-BjgxkfJJ.js";
|
|
13
13
|
import { i as ListDefinition } from "../../list-query-BkbLV-Yc.js";
|
|
14
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
14
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.js";
|
|
15
15
|
import { a as UndoToken } from "../../undo-CdKp5_2X.js";
|
|
16
|
-
import { n as AuditCategory } from "../../context-
|
|
16
|
+
import { n as AuditCategory } from "../../context-CH5FYnVk.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-CtMsgLQr.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-Xj40B5KT.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-CDw9YGVh.js";
|
|
11
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
11
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.js";
|
|
12
12
|
import { c as ApprovalRequestInput } from "../../approvals-CXW3yFWZ.js";
|
|
13
13
|
import { n as FilterRecordField, t as FilterEvaluation } from "../../filter-evaluate-Bkbb0nuQ.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-CP46SPNE.js";
|
|
@@ -9,7 +9,7 @@ import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.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-CDw9YGVh.js";
|
|
11
11
|
import { i as EventSink } from "../../cloud-event-BjgxkfJJ.js";
|
|
12
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
12
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.js";
|
|
13
13
|
import { d as stripeInboxVerify, f as verifyStripeWebhook, u as signStripeWebhook } from "../../verify-Cpc1upDA.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-DddDlibJ.js";
|
|
3
3
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
4
|
-
import { n as Controller } from "../../controller-
|
|
4
|
+
import { n as Controller } from "../../controller-CJ6rLnpS.js";
|
|
5
5
|
import { o as WeeklyHours } from "../../availability-CZlcrkqD.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-Dj5cvXKv.js";
|
|
7
7
|
import { t as EventCalendarEvent } from "../../event-calendar-DPMcqy7Q.js";
|
|
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
|
7
7
|
import { t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
8
8
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
9
9
|
import { Sn as EntitySchema, c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
10
|
-
import { n as Controller } from "../../controller-
|
|
10
|
+
import { n as Controller } from "../../controller-CJ6rLnpS.js";
|
|
11
11
|
import { A as CalendarAlarmAction, C as IcsEvent, D as parseIcs, E as ToIcsOptions, O as toIcs, S as CalendarEventStatus, T as ParsedIcs, _ 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, j as CalendarReminder, k as CalendarAlarm, 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 IcsSource, x as CalendarAttendee, y as AttendeeResponse } from "../../availability-CZlcrkqD.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-DPMcqy7Q.js";
|
|
13
13
|
import { t as VisibleRange } from "../../range-BN3kpJAE.js";
|
|
@@ -296,6 +296,10 @@ interface Catalog<F extends object = Record<never, never>> {
|
|
|
296
296
|
updateVariant(productId: string, variantId: string, input: VariantInput): AsyncResult<SavedVariant>;
|
|
297
297
|
/** Moves a variant between the variants with rank keys `previous` and `next`. */
|
|
298
298
|
reorderVariant(variantId: string, neighbors: RankNeighbors): AsyncResult<string>;
|
|
299
|
+
setVariantStatus(variantId: string, status: "active" | "archived" | (string & {})): AsyncResult<{
|
|
300
|
+
readonly status: string;
|
|
301
|
+
readonly from: string;
|
|
302
|
+
}>;
|
|
299
303
|
deleteVariant(variantId: string): AsyncResult<boolean>;
|
|
300
304
|
savePriceList(organizationId: string, input: PriceListInput): AsyncResult<{
|
|
301
305
|
readonly id: string;
|
|
@@ -190,6 +190,16 @@ function createCatalog(options) {
|
|
|
190
190
|
from: enumOrThrow(row["from"], PRODUCT_STATUSES, "status")
|
|
191
191
|
};
|
|
192
192
|
}),
|
|
193
|
+
setVariantStatus: (variantId, status) => call("set_variant_status", {
|
|
194
|
+
variant: variantId,
|
|
195
|
+
status
|
|
196
|
+
}, (value) => {
|
|
197
|
+
const row = recordOf(value, "set_variant_status");
|
|
198
|
+
return {
|
|
199
|
+
status: textOf(row["status"]),
|
|
200
|
+
from: textOf(row["from"])
|
|
201
|
+
};
|
|
202
|
+
}),
|
|
193
203
|
deleteProduct: (productId) => call("delete_product", { product: productId }, (value) => value === true),
|
|
194
204
|
saveOption: (productId, input) => call("save_product_option", {
|
|
195
205
|
product: productId,
|
|
@@ -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-BNtM1tqy.js";
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
10
|
-
import { F as CommentsSqlOptions } from "../../authorization-
|
|
10
|
+
import { F as CommentsSqlOptions } from "../../authorization-D8CaAdqU.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-Bfe4p9Pm.js";
|
|
14
14
|
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding } from "../../define-block-CDw9YGVh.js";
|
|
15
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
16
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
17
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
15
|
+
import { p as SubscriptionStatus } from "../../topic-D7F2FBNp.js";
|
|
16
|
+
import { n as TopicPort } from "../../watch-topic-BIEaSN0Y.js";
|
|
17
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.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
|
|
@@ -4,8 +4,8 @@ import { n as SqlClient } from "../../executor-DoSNec_H.js";
|
|
|
4
4
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
5
5
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
6
6
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
7
|
-
import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
7
|
+
import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-6gODwBSz.js";
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.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
|
/**
|
|
@@ -42,6 +42,7 @@ interface ExpenseCategory {
|
|
|
42
42
|
readonly archivedAt?: Temporal.Instant;
|
|
43
43
|
readonly createdAt: Temporal.Instant;
|
|
44
44
|
readonly updatedAt: Temporal.Instant;
|
|
45
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
45
46
|
}
|
|
46
47
|
interface ExpenseCategoryInput {
|
|
47
48
|
readonly key: string;
|
|
@@ -49,6 +50,7 @@ interface ExpenseCategoryInput {
|
|
|
49
50
|
readonly limit?: Money;
|
|
50
51
|
/** Needs the attachments block, where receipts live. */
|
|
51
52
|
readonly receiptOver?: Money;
|
|
53
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
52
54
|
}
|
|
53
55
|
interface ExpenseLine {
|
|
54
56
|
readonly id: string;
|
|
@@ -2,7 +2,7 @@ import { n as dbError } from "../../errors-B7tCfCvX.js";
|
|
|
2
2
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
3
3
|
import { t as temporal } from "../../temporal-required-w_2u4EDp.js";
|
|
4
4
|
import { t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
5
|
-
import { t as expensesSqlOptions } from "../../options-
|
|
5
|
+
import { t as expensesSqlOptions } from "../../options-CS1DA8q9.js";
|
|
6
6
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
7
7
|
import { A as recordsOf, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
8
8
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
@@ -33,7 +33,8 @@ function categoryOf(value, fn) {
|
|
|
33
33
|
updatedAt: requiredInstant(row["updatedAt"], "updatedAt"),
|
|
34
34
|
...optional("limit", optionalMoney(row["limitAmount"], currency, "limit")),
|
|
35
35
|
...optional("receiptOver", optionalMoney(row["receiptOver"], currency, "receiptOver")),
|
|
36
|
-
...optional("archivedAt", optionalInstant(row["archivedAt"], "archivedAt"))
|
|
36
|
+
...optional("archivedAt", optionalInstant(row["archivedAt"], "archivedAt")),
|
|
37
|
+
...optional("fields", isRecord(row["fields"]) ? row["fields"] : void 0)
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
function lineOf(value, fn) {
|
|
@@ -153,7 +154,8 @@ function createExpenses(options) {
|
|
|
153
154
|
name: input.name,
|
|
154
155
|
currency: currency ?? null,
|
|
155
156
|
limit_amount: input.limit ? amountText(input.limit) : null,
|
|
156
|
-
receipt_over: input.receiptOver ? amountText(input.receiptOver) : null
|
|
157
|
+
receipt_over: input.receiptOver ? amountText(input.receiptOver) : null,
|
|
158
|
+
...input.fields === void 0 ? {} : { fields: input.fields }
|
|
157
159
|
}, category("save_expense_category")));
|
|
158
160
|
},
|
|
159
161
|
archiveCategory: (categoryId) => call("archive_expense_category", { category_id: categoryId }, category("archive_expense_category")),
|
|
@@ -351,6 +353,11 @@ const expenseCategoryInputSchema = entitySchema({
|
|
|
351
353
|
receiptOver: {
|
|
352
354
|
...moneyField,
|
|
353
355
|
optional: true
|
|
356
|
+
},
|
|
357
|
+
fields: {
|
|
358
|
+
kind: "json",
|
|
359
|
+
optional: true,
|
|
360
|
+
description: "The extra columns to set."
|
|
354
361
|
}
|
|
355
362
|
}
|
|
356
363
|
});
|
|
@@ -8,7 +8,7 @@ import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
10
10
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
11
|
-
import { n as Controller } from "../../controller-
|
|
11
|
+
import { n as Controller } from "../../controller-CJ6rLnpS.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-DddDlibJ.js";
|
|
|
2
2
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
3
3
|
import { d as MessageKind, p as MessageReaction, u as MessageFile } from "../../messaging-Bfe4p9Pm.js";
|
|
4
4
|
import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
5
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
6
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
7
|
-
import { l as StoragePort } from "../../ports-
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
5
|
+
import { p as SubscriptionStatus } from "../../topic-D7F2FBNp.js";
|
|
6
|
+
import { n as TopicPort } from "../../watch-topic-BIEaSN0Y.js";
|
|
7
|
+
import { l as StoragePort } from "../../ports-Bnwy2mlR.js";
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-CJ6rLnpS.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-D5uf0l4_.js";
|
|
10
10
|
import { _ as InboxDraftSource, a as Inbox, c as InboxPatch, d as ScheduledMessageInput, f as StartConversationInput, g as InboxDraftInput, h as InboxDraft, 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, v as InboxDraftStatus, y as InboxDrafts } from "../../inbox-yGfUVQr2.js";
|
|
11
11
|
export declare const INBOX_CHANNELS: readonly InboxChannel[];
|