better-supabase 0.21.0 → 0.23.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/{access-sql-CNIgUqWf.js → access-sql-bjWFUWlk.js} +11 -0
- package/dist/{adapter-DZJZTY6g.js → adapter-D4aNBxhm.js} +2 -2
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/api-3C0AWFeP.js +696 -0
- package/dist/{api-Cj4W_pqT.d.ts → api-CHObZL7m.d.ts} +1 -1
- package/dist/{app-tables-C5HjXs2k.d.ts → app-tables-CJO6pWwy.d.ts} +1 -1
- package/dist/astro/index.js +5 -5
- package/dist/{authorization-DhoA7dsD.d.ts → authorization-Dtwpjeuz.d.ts} +91 -13
- package/dist/{bind-CFsctoFJ.d.ts → bind-DaoTunvE.d.ts} +1 -1
- package/dist/{block-env-BrUNeuJ_.d.ts → block-env-DUyo2I5O.d.ts} +3 -3
- package/dist/blocks/access-requests/index.js +1 -1
- package/dist/blocks/activities/index.js +1 -1
- package/dist/blocks/agents/index.js +1 -1
- package/dist/blocks/ai-chat/index.d.ts +3 -3
- package/dist/blocks/ai-chat/index.js +1 -1
- package/dist/blocks/ai-keys/index.js +1 -1
- package/dist/blocks/announcements/index.d.ts +3 -3
- package/dist/blocks/announcements/index.js +1 -1
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/api-keys/index.js +1 -1
- package/dist/blocks/approvals/index.js +1 -1
- package/dist/blocks/assets/index.js +1 -1
- package/dist/blocks/assignment/index.js +1 -1
- package/dist/blocks/attachments/index.d.ts +1 -1
- package/dist/blocks/attachments/index.js +1 -1
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/audit/index.js +1 -1
- package/dist/blocks/automations/index.d.ts +1 -1
- package/dist/blocks/automations/index.js +1 -1
- package/dist/blocks/billable-time/index.js +1 -1
- package/dist/blocks/billing/index.d.ts +1 -1
- package/dist/blocks/billing/index.js +2 -2
- package/dist/blocks/bookings/index.d.ts +1 -1
- package/dist/blocks/bookings/index.js +1 -1
- package/dist/blocks/bulk/index.js +1 -1
- package/dist/blocks/calendar/index.d.ts +5 -1
- package/dist/blocks/calendar/index.js +7 -4
- package/dist/blocks/catalog/index.js +1 -1
- package/dist/blocks/channels/index.js +1 -1
- package/dist/blocks/collections/index.js +1 -1
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/compliance/index.js +1 -1
- package/dist/blocks/connectors/index.js +1 -1
- package/dist/blocks/contacts/index.js +1 -1
- package/dist/blocks/content/index.js +1 -1
- package/dist/blocks/contracts/index.js +1 -1
- package/dist/blocks/courses/index.js +1 -1
- package/dist/blocks/custom-fields/index.d.ts +43 -1
- package/dist/blocks/custom-fields/index.js +41 -2
- package/dist/blocks/data-lifecycle/index.js +1 -1
- package/dist/blocks/deals/index.js +1 -1
- package/dist/blocks/dispatch/index.js +1 -1
- package/dist/blocks/documents/index.js +1 -1
- package/dist/blocks/domains/index.js +1 -1
- package/dist/blocks/donations/index.js +1 -1
- package/dist/blocks/drive/index.d.ts +1 -1
- package/dist/blocks/drive/index.js +1 -1
- package/dist/blocks/employees/index.d.ts +4 -0
- package/dist/blocks/employees/index.js +2 -2
- package/dist/blocks/enrichment/index.js +1 -1
- package/dist/blocks/enrollments/index.js +1 -1
- package/dist/blocks/entitlements/index.d.ts +2 -2
- package/dist/blocks/expenses/index.js +1 -1
- package/dist/blocks/flags/index.js +1 -1
- package/dist/blocks/forecasts/index.js +1 -1
- package/dist/blocks/forms/index.d.ts +1 -1
- package/dist/blocks/forms/index.js +1 -1
- package/dist/blocks/guests/index.js +1 -1
- package/dist/blocks/hiring/index.js +1 -1
- package/dist/blocks/imports/index.js +1 -1
- package/dist/blocks/inbox/index.d.ts +4 -4
- package/dist/blocks/inbox/index.js +1 -1
- package/dist/blocks/incidents/index.js +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.js +2 -2
- package/dist/blocks/inventory/index.js +1 -1
- package/dist/blocks/invoices/index.js +1 -1
- package/dist/blocks/leases/index.js +1 -1
- package/dist/blocks/leave/index.js +1 -1
- package/dist/blocks/ledger/index.js +1 -1
- package/dist/blocks/mail-sync/index.js +1 -1
- package/dist/blocks/messaging/index.d.ts +4 -4
- package/dist/blocks/messaging/index.js +1 -1
- package/dist/blocks/metrics/index.js +1 -1
- package/dist/blocks/mfa/index.d.ts +1 -1
- package/dist/blocks/moderation/index.js +1 -1
- package/dist/blocks/notifications/index.d.ts +3 -3
- package/dist/blocks/notifications/index.js +3 -3
- package/dist/blocks/numbering/index.js +1 -1
- package/dist/blocks/oauth-server/index.js +1 -1
- package/dist/blocks/onboarding/index.d.ts +1 -1
- package/dist/blocks/orders/index.js +1 -1
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/organizations/index.js +1 -1
- package/dist/blocks/outbox/index.js +1 -1
- package/dist/blocks/passes/index.js +1 -1
- package/dist/blocks/permissions/index.d.ts +1 -1
- package/dist/blocks/pipelines/index.js +1 -1
- package/dist/blocks/posts/index.js +1 -1
- package/dist/blocks/promotions/index.js +1 -1
- package/dist/blocks/push/index.d.ts +1 -1
- package/dist/blocks/push/index.js +1 -1
- package/dist/blocks/quotes/index.js +1 -1
- package/dist/blocks/reactions/index.d.ts +3 -3
- package/dist/blocks/reactions/index.js +1 -1
- package/dist/blocks/relations/index.js +1 -1
- package/dist/blocks/reminders/index.js +1 -1
- package/dist/blocks/reviews/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +1 -1
- package/dist/blocks/saved-views/index.js +1 -1
- package/dist/blocks/scores/index.js +1 -1
- package/dist/blocks/search/index.d.ts +4 -2
- package/dist/blocks/search/index.js +3 -1
- package/dist/blocks/security-events/index.js +1 -1
- package/dist/blocks/segments/index.js +1 -1
- package/dist/blocks/sequences/index.js +1 -1
- package/dist/blocks/service-accounts/index.js +1 -1
- package/dist/blocks/sessions/index.d.ts +1 -1
- package/dist/blocks/settings/index.d.ts +1 -1
- package/dist/blocks/settings/index.js +1 -1
- package/dist/blocks/share-links/index.d.ts +28 -3
- package/dist/blocks/share-links/index.js +59 -23
- package/dist/blocks/shipments/index.js +1 -1
- package/dist/blocks/signatures/index.js +1 -1
- package/dist/blocks/signing-keys/index.js +1 -1
- package/dist/blocks/sla/index.js +1 -1
- package/dist/blocks/sso/index.js +1 -1
- package/dist/blocks/state-machine/index.js +1 -1
- package/dist/blocks/subjects/index.d.ts +1 -1
- package/dist/blocks/tags/index.d.ts +18 -3
- package/dist/blocks/tags/index.js +16 -3
- package/dist/blocks/tasks/index.js +2 -2
- package/dist/blocks/teams/index.d.ts +26 -4
- package/dist/blocks/teams/index.js +11 -4
- package/dist/blocks/templates/index.js +1 -1
- package/dist/blocks/time-tracking/index.d.ts +18 -0
- package/dist/blocks/time-tracking/index.js +13 -4
- package/dist/blocks/timeline/index.js +1 -1
- package/dist/blocks/trash/index.js +1 -1
- package/dist/blocks/undo/index.d.ts +1 -1
- package/dist/blocks/usage/index.d.ts +1 -1
- package/dist/blocks/vercel-marketplace/index.js +1 -1
- package/dist/blocks/versions/index.js +1 -1
- package/dist/blocks/waitlist/index.js +1 -1
- package/dist/blocks/webhooks/index.js +4 -4
- package/dist/blocks/workflow-editor/index.d.ts +3 -3
- package/dist/blocks/workflow-editor/index.js +1 -1
- package/dist/blocks/workflows/index.d.ts +3 -3
- package/dist/blocks/workflows/index.js +1 -1
- package/dist/cli/{add-BTDPjVGC.js → add-C7lKQNBL.js} +11 -11
- package/dist/cli/{add-C0w-mVTQ.js → add-DVHniZOO.js} +2 -2
- package/dist/cli/add-vZRn-uH0.js +1 -0
- package/dist/cli/{backfill-BDdBs6Ne.js → backfill-Lrn-Qp5X.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-Bs-lA-U_.js → blocks-2Yw9t-_U.js} +1 -1
- package/dist/cli/{blocks-CQLME-HQ.js → blocks-BKNd886C.js} +1 -1
- package/dist/cli/{cache-DDKao2Va.js → cache-ByhPVMo-.js} +1 -1
- package/dist/cli/{codemod-Bjl998Do.js → codemod-C0eXpzFu.js} +1 -1
- package/dist/cli/{config-BH0goim0.js → config-BVfeG3A5.js} +37 -5
- package/dist/cli/{config-CTRzkX0H.js → config-CeaQMrvS.js} +1 -1
- package/dist/cli/{content-mapper-DgSTl-DL.js → content-mapper-qH-_YQ8H.js} +2 -2
- package/dist/cli/{db-DCeyHS1y.js → db-DwjyUbAh.js} +2 -2
- package/dist/cli/{doctor-CMLWbt44.js → doctor-BnxkqXGA.js} +21 -19
- package/dist/cli/{gen-D3VX8WdV.js → gen-aERmP3Sw.js} +14 -14
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-D6D6eWze.js → init-DWUqVSVW.js} +6 -6
- package/dist/cli/{live-C_xgTOfD.js → live-KcdTBUij.js} +2 -2
- package/dist/cli/{mcp-B0Irjbes.js → mcp-Dsjjo-LT.js} +2 -2
- package/dist/cli/{metadata-cLXra-XB.js → metadata-DWQSIZ59.js} +3 -3
- package/dist/cli/{migration-safety-OUK-Afbb.js → migration-safety-Cy7xlU4G.js} +2 -2
- package/dist/cli/{migrations-CHenMvl_.js → migrations-CUjNXokR.js} +1 -1
- package/dist/cli/{module-migration-6V7vXWUK.js → module-migration-C6NLY9iZ.js} +2 -2
- package/dist/cli/powersync-BOhjVQCb.js +1 -0
- package/dist/cli/{powersync-D83yAFbl.js → powersync-CE_hQdgc.js} +2 -2
- package/dist/cli/{print-C0OmQyTu.js → print-Cy_ram9N.js} +2 -2
- package/dist/cli/{remove-BWlOngNT.js → remove-DmwjzqaW.js} +5 -5
- package/dist/cli/{render-9m70qveo.js → render-CF09FCra.js} +7 -4
- package/dist/cli/{run-He3M-ZRq.js → run-BYpZ8FjF.js} +25 -25
- package/dist/cli/{run-gE4eAazR.js → run-lh-chAJW.js} +8 -8
- package/dist/cli/{seed-CdSxunFT.js → seed-BMynpMPy.js} +2 -2
- package/dist/cli/seed-CO3j_bly.js +1 -0
- package/dist/cli/{shared-Cx2WFVWq.js → shared-D05A6t1e.js} +1 -1
- package/dist/cli/{snapshot-CZb3uVKE.js → snapshot-BITNbA5V.js} +3 -3
- package/dist/cli/{source-CrYSCdPZ.js → source-GGJHuzpH.js} +1 -1
- package/dist/cli/{source-args-z-jkabmO.js → source-args-CDmmFmFG.js} +1 -1
- package/dist/cli/{spec-Cn5RhuQc.js → spec-BGcRdlhN.js} +2 -2
- package/dist/cli/{spec-D4b9ePuQ.js → spec-BjxXWaNQ.js} +1 -1
- package/dist/cli/{sql-layout-CLJ67h3L.js → sql-layout-BoD5ynN9.js} +2 -2
- package/dist/cli/{sync-B8VGiaHk.js → sync-_QlsTmqu.js} +3 -3
- package/dist/cli/{upgrade-BvBWK3Fo.js → upgrade-Cwhb1M7O.js} +4 -4
- package/dist/cli/{upgrade-DMiYx1C8.js → upgrade-n9ar1kc4.js} +2 -2
- package/dist/cli/{version-BVg2Z6yv.js → version-RSpJIWDd.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{composite-Dw5ofSF_.js → composite-CBRbvn5j.js} +2 -2
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +4 -4
- package/dist/{config-BOt5T6Vs.js → config-RwpFcPq8.js} +3 -3
- package/dist/{config-CD2OGfCG.js → config-vHLJ8SKf.js} +1 -1
- package/dist/{context-sgrUjA3U.d.ts → context-CMf4OKpN.d.ts} +72 -16
- package/dist/{controller-B6vWdKSa.d.ts → controller-BGto_kYM.d.ts} +1 -1
- package/dist/create/index.d.ts +72 -451
- package/dist/create/index.js +15 -1687
- package/dist/create/lite/index.d.ts +250 -13
- package/dist/create/lite/index.js +1007 -24
- package/dist/credentials/index.js +1 -1
- package/dist/edge/index.js +7 -7
- package/dist/elysia/index.js +1 -1
- package/dist/{entitlements-BPaPd3MD.d.ts → entitlements-CIhVQ-0u.d.ts} +1 -1
- package/dist/events/index.js +1 -1
- package/dist/expo/index.js +3 -3
- package/dist/{field-errors-DBgDCITw.d.ts → field-errors-BDhPaO0a.d.ts} +4 -4
- package/dist/{framework-DXM1vNcV.js → framework-DYEUraqt.js} +1 -1
- package/dist/h3/index.js +1 -1
- package/dist/h3/v1/index.js +1 -1
- package/dist/hono/index.js +6 -6
- package/dist/{index-ByF22_C6.d.ts → index--OhYKouV.d.ts} +2 -2
- package/dist/{index-Bt7_mxn0.d.ts → index-4MStWaeF.d.ts} +185 -7
- package/dist/{index-5JSxY1MG.d.ts → index-CFWlHuVY.d.ts} +77 -2
- package/dist/{index-CdMZQCYR.d.ts → index-lV43eM34.d.ts} +2 -2
- package/dist/{index-C4sjewrr.d.ts → index-ujNqgZ6B.d.ts} +6 -6
- package/dist/{app-tables-DyswUg6J.js → instances-BPJSESPx.js} +176 -11
- package/dist/{kit-DhlB-vv_.js → kit-Bcd9wYCV.js} +1 -1
- package/dist/mapper/bin.js +6 -6
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +6 -6
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/index.d.ts +3 -3
- package/dist/next/index.js +7 -7
- package/dist/node/index.js +1 -1
- package/dist/{operations-DC3wU3Sy.d.ts → operations-qSBBV5vl.d.ts} +1 -1
- package/dist/{options-fMxhtuVR.js → options-BJtdsK7b.js} +4 -1
- package/dist/{options-DhdazgTZ.js → options-BPp2zzsz.js} +3 -1
- package/dist/options-BSsYXjhC.js +9 -0
- package/dist/{options-ChiL-4ZS.js → options-D4ADKTKo.js} +3 -1
- package/dist/{options-C1-pwEqm.js → options-DztCKw_f.js} +4 -1
- package/dist/{options-BfFC4iFE.js → options-jsOCvLUz.js} +3 -1
- package/dist/orpc/index.d.ts +1 -1
- package/dist/orpc/index.js +5 -5
- package/dist/otel/index.js +4 -4
- package/dist/{ports-BbBJVyS0.d.ts → ports-DbHiNSAa.d.ts} +1 -1
- package/dist/powersync/index.d.ts +2 -2
- package/dist/preset/index.d.ts +4 -4
- package/dist/preset/index.js +4 -4
- package/dist/{preset-B3CukUhu.js → preset-B1xXOJ0T.js} +179 -7
- package/dist/project-BM6QMtzV.js +1760 -0
- package/dist/{push-token-CPJfPFa2.d.ts → push-token-BwF1fyjA.d.ts} +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +2 -2
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/react/server.js +2 -2
- package/dist/{react-_D_CeZMk.js → react-CcrQQl0_.js} +2 -2
- package/dist/react-router/index.js +5 -5
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -1
- package/dist/records/index.d.ts +3 -3
- package/dist/{refusal-D48CMqpQ.js → refusal-DDlInPff.js} +2 -2
- package/dist/{instances-DDt7NdVl.js → resolved-names-WzRYhUez.js} +2 -146
- package/dist/{resource-R3KToNze.js → resource-BUJcZKiW.js} +2 -2
- package/dist/{resources-DqIwoQsP.js → resources-jb3R6rEa.js} +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +7 -7
- package/dist/{sign-in-1FJiXXyG.js → sign-in-NO7LWlw4.js} +2 -2
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid/index.js +1 -1
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +2 -693
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +5 -5
- package/dist/{sql-BjjgwJKg.js → sql-CNH8kjLS.js} +2727 -955
- package/dist/ssr/index.d.ts +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/subjects-NomQg6Eg.d.ts +131 -0
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +1 -1
- package/dist/sveltekit/index.js +5 -5
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tenant-BHvMFNXl.d.ts → tenant-D4BA7XQ-.d.ts} +1 -1
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +5 -5
- package/dist/{topic-J9I3yu6f.js → topic-F0FKzJyQ.js} +2 -2
- package/dist/{topic-gTVjLGTk.d.ts → topic-utZqhw96.d.ts} +1 -1
- package/dist/types-DLnBJ3ST.d.ts +461 -0
- package/dist/vue/index.d.ts +5 -5
- package/dist/vue/index.js +1 -1
- package/dist/{watch-topic-C6HhbnVz.d.ts → watch-topic-B1UCoQfz.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-DELaQEp3.js → workflow-sdk-CE8sEK57.js} +38 -1
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +166 -2
- package/dist/cli/add-CspY9jKT.js +0 -1
- package/dist/cli/powersync-DwhCH0gs.js +0 -1
- package/dist/cli/seed-CXJvTU5D.js +0 -1
- package/dist/options-CTv-xmbA.js +0 -5
- package/dist/subjects-DvmQeF_F.d.ts +0 -79
- package/dist/types-DGHfTW8_.d.ts +0 -9
- package/dist/{build-CM8PJqwW.js → build-CH2N3Yf0.js} +3 -3
- package/dist/{create-blocks-CUS28FfS.js → create-blocks-BfrDUSM6.js} +1 -1
- package/dist/{data-hooks-tgF1Ct0F.js → data-hooks-CdcZfVS1.js} +1 -1
- package/dist/{respond-3RKp6VgU.js → respond-CZMWbUs3.js} +1 -1
package/dist/preset/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as integrationsForFramework, S as PRESET_TENANT_NAMES, T as presetValueLabel, _ as isPresetName, a as presetOf, b as DEFAULT_CONVENTIONS, c as presetSpec, d as resolvePreset, f as DEFAULT_PRESET_NAME, g as defaultPreset, h as PRESET_NAMES, i as presetConfig, l as listNames, m as PRESET_GROUPS, o as presetFromSpec, p as PRESETS, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as namedPreset, w as presetField, x as PRESET_FRAMEWORKS, y as CONVENTION_FIELDS } from "../config-
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
export { APP_COLUMN_FORMATS, APP_NAME_MAX, CONVENTION_FIELDS, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, DesignParseError, DesignTooLongError, MAX_DESIGN_CODE_LENGTH, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, conventionConfig, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, expandPreset, glueCommand, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign };
|
|
1
|
+
import { C as integrationsForFramework, S as PRESET_TENANT_NAMES, T as presetValueLabel, _ as isPresetName, a as presetOf, b as DEFAULT_CONVENTIONS, c as presetSpec, d as resolvePreset, f as DEFAULT_PRESET_NAME, g as defaultPreset, h as PRESET_NAMES, i as presetConfig, l as listNames, m as PRESET_GROUPS, o as presetFromSpec, p as PRESETS, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as namedPreset, w as presetField, x as PRESET_FRAMEWORKS, y as CONVENTION_FIELDS } from "../config-vHLJ8SKf.js";
|
|
2
|
+
import { D as APP_COLUMN_FORMATS, M as PRESET_CATALOG, b as isAppDefault, c as APP_NAME_MAX, d as appIdentifierError, f as appNameLengthError, i as instancePrefix, n as INSTANCE_NAME, p as appReservedColumns, t as CORE_BLOCKS, y as appDefaultError } from "../instances-BPJSESPx.js";
|
|
3
|
+
import { A as isDesignCode, B as safeDesignFileSource, C as decodeDesign, D as designOf, E as designFormat, F as presetArgumentOf, G as presetGlue, H as PROVIDER_COMMENT, I as presetConfigSource, L as presetInstallCommand, M as parseDesign, N as presetAndDesignOf, O as designSchema, P as presetApplyCommand, R as presetKey, S as createUrl, T as designFileSource, U as glueCommand, V as safeParseDesign, W as presetBlocksSource, _ as DESIGN_FORMAT, a as installedBlocks, b as MAX_DESIGN_CODE_LENGTH, c as instancesOf, d as withInstance, f as withoutInstance, g as DESIGN_FILE, h as CREATE_URL, i as entityName, k as encodeDesign, l as presetInstances, m as diffDesigns, n as blockRequires, o as instanceBlock, p as diffAppTables, r as canAddInstance, s as instanceNameProblem, t as blockEntities, u as withEntityName, v as DesignParseError, w as designConfig, x as createQuery, y as DesignTooLongError, z as readDesignFile } from "../preset-B1xXOJ0T.js";
|
|
4
|
+
export { APP_COLUMN_FORMATS, APP_NAME_MAX, CONVENTION_FIELDS, CREATE_URL, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, DesignParseError, DesignTooLongError, INSTANCE_NAME, MAX_DESIGN_CODE_LENGTH, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, CORE_BLOCKS as SINGLE_INSTANCE_BLOCKS, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, blockEntities, blockRequires, canAddInstance, conventionConfig, createQuery, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, entityName, expandPreset, glueCommand, installedBlocks, instanceBlock, instanceNameProblem, instancePrefix, instancesOf, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetArgumentOf, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetInstances, presetKey, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign, withEntityName, withInstance, withoutInstance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as groupEntries, a as presetOf, c as presetSpec, g as defaultPreset, i as presetConfig, s as presetOfSpec } from "./config-
|
|
2
|
-
import {
|
|
1
|
+
import { M as groupEntries, a as presetOf, c as presetSpec, d as resolvePreset, g as defaultPreset, i as presetConfig, s as presetOfSpec } from "./config-vHLJ8SKf.js";
|
|
2
|
+
import { F as asBlocksConfig, M as PRESET_CATALOG, _ as appTablesOf, n as INSTANCE_NAME, t as CORE_BLOCKS } from "./instances-BPJSESPx.js";
|
|
3
3
|
import { r as FIELD_FORMATS } from "./field-formats-C6QKA3UR.js";
|
|
4
4
|
import { t as isSqlType } from "./sql-type-iUSZpaUu.js";
|
|
5
5
|
//#region src/preset/render.ts
|
|
@@ -120,6 +120,7 @@ function glueCommand(items) {
|
|
|
120
120
|
}
|
|
121
121
|
//#endregion
|
|
122
122
|
//#region src/preset/design.ts
|
|
123
|
+
/** Where Create links point. */
|
|
123
124
|
const CREATE_URL = "https://app.bettersupabase.com/create";
|
|
124
125
|
/**
|
|
125
126
|
* The first character of a design code: how it is encoded. `0` is deflate-raw
|
|
@@ -516,14 +517,31 @@ function designConfig(resolved, design) {
|
|
|
516
517
|
* design file (`designFileSource`) instead.
|
|
517
518
|
*/
|
|
518
519
|
async function createUrl(resolved, design = {}) {
|
|
519
|
-
|
|
520
|
+
return `${CREATE_URL}?${await createQuery(resolved.preset, design)}`;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* The query `/create` and its routes read a selection from: `preset=<name>` for
|
|
524
|
+
* a named preset without a design, otherwise `design=<code>` with the preset
|
|
525
|
+
* inside the design. Throws a `DesignTooLongError` when the design is too long
|
|
526
|
+
* for a link.
|
|
527
|
+
*/
|
|
528
|
+
async function createQuery(preset, design = {}) {
|
|
529
|
+
const spec = presetSpec(preset);
|
|
520
530
|
const rest = withoutPreset(design);
|
|
521
|
-
if (typeof
|
|
522
|
-
return
|
|
531
|
+
if (typeof spec === "string" && Object.keys(rest).length === 0) return `preset=${spec}`;
|
|
532
|
+
return `design=${await encodeDesign({
|
|
523
533
|
...rest,
|
|
524
|
-
preset
|
|
534
|
+
preset: spec
|
|
525
535
|
})}`;
|
|
526
536
|
}
|
|
537
|
+
/** The value `--preset` takes for a `createQuery`: the name, or the quoted URL. */
|
|
538
|
+
function presetArgumentOf(query) {
|
|
539
|
+
return query.startsWith("preset=") ? query.slice(7) : `"${CREATE_URL}?${query}"`;
|
|
540
|
+
}
|
|
541
|
+
/** A string that is equal for equal presets, for comparing selections. */
|
|
542
|
+
function presetKey(preset) {
|
|
543
|
+
return JSON.stringify(presetSpec(preset));
|
|
544
|
+
}
|
|
527
545
|
/**
|
|
528
546
|
* `better-supabase.config.ts` for a preset and an optional design: every block
|
|
529
547
|
* with its reason, the conventions that differ from the defaults and the app
|
|
@@ -872,4 +890,158 @@ function diffDesigns(before, after) {
|
|
|
872
890
|
return diffAppTables(before.appTables ?? {}, after.appTables ?? {});
|
|
873
891
|
}
|
|
874
892
|
//#endregion
|
|
875
|
-
|
|
893
|
+
//#region src/preset/instances.ts
|
|
894
|
+
/** Whether a preset can install `block` a second time, under another name. */
|
|
895
|
+
function canAddInstance(block) {
|
|
896
|
+
return !CORE_BLOCKS.has(block);
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* What `block` requires, at every access level: the dependencies `uses` must
|
|
900
|
+
* name.
|
|
901
|
+
*/
|
|
902
|
+
function blockRequires(block, catalog = PRESET_CATALOG) {
|
|
903
|
+
const entry = catalog.blocks.find((each) => each.name === block);
|
|
904
|
+
return [.../* @__PURE__ */ new Set([...entry?.requires ?? [], ...Object.values(entry?.requiresByAccess ?? {}).flat()])];
|
|
905
|
+
}
|
|
906
|
+
/** The blocks a preset installs, by name. */
|
|
907
|
+
function installedBlocks(preset) {
|
|
908
|
+
return new Set(resolvePreset(preset).blocks.map((block) => block.name));
|
|
909
|
+
}
|
|
910
|
+
const ENTITIES = new Map(PRESET_CATALOG.blocks.map((block) => [block.name, Object.entries(block.entities?.specs ?? {}).flatMap(([key, spec]) => spec.table === void 0 || spec.global === true ? [] : [{
|
|
911
|
+
key,
|
|
912
|
+
table: spec.table,
|
|
913
|
+
singular: spec.singular,
|
|
914
|
+
required: spec.primary === true || spec.subject !== void 0
|
|
915
|
+
}])]));
|
|
916
|
+
/**
|
|
917
|
+
* The entities `block` lets an instance rename; the tenant is renamed by
|
|
918
|
+
* `tenantName`.
|
|
919
|
+
*/
|
|
920
|
+
function blockEntities(block) {
|
|
921
|
+
return ENTITIES.get(block) ?? [];
|
|
922
|
+
}
|
|
923
|
+
/** The block `instance` installs. */
|
|
924
|
+
function instanceBlock(preset, instance) {
|
|
925
|
+
return preset.instances?.[instance]?.block ?? instance;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Every instance the preset installs: each installed block under its own name,
|
|
929
|
+
* then each `instances` entry that installs a block under another name.
|
|
930
|
+
*/
|
|
931
|
+
function presetInstances(preset) {
|
|
932
|
+
return [...resolvePreset(preset).blocks.map(({ name }) => ({
|
|
933
|
+
name,
|
|
934
|
+
block: name
|
|
935
|
+
})), ...Object.entries(preset.instances ?? {}).flatMap(([name, instance]) => {
|
|
936
|
+
const block = instance.block ?? name;
|
|
937
|
+
return block === name ? [] : [{
|
|
938
|
+
name,
|
|
939
|
+
block
|
|
940
|
+
}];
|
|
941
|
+
})];
|
|
942
|
+
}
|
|
943
|
+
/** The instances of `block`, its own one first when the preset selects it. */
|
|
944
|
+
function instancesOf(preset, block) {
|
|
945
|
+
return presetInstances(preset).filter((each) => each.block === block);
|
|
946
|
+
}
|
|
947
|
+
/** The name `instance` gives `entity`, or undefined when it keeps the default. */
|
|
948
|
+
function entityName(preset, instance, entity) {
|
|
949
|
+
return preset.instances?.[instance]?.names?.[entity];
|
|
950
|
+
}
|
|
951
|
+
function withInstances(preset, instances) {
|
|
952
|
+
if (Object.keys(instances).length > 0) return {
|
|
953
|
+
...preset,
|
|
954
|
+
instances
|
|
955
|
+
};
|
|
956
|
+
const { instances: _instances, ...rest } = preset;
|
|
957
|
+
return rest;
|
|
958
|
+
}
|
|
959
|
+
/** An instance without its empty `names`, `uses` or `on`. */
|
|
960
|
+
function compact(instance) {
|
|
961
|
+
const { names, uses, on, ...rest } = instance;
|
|
962
|
+
return {
|
|
963
|
+
...rest,
|
|
964
|
+
...names === void 0 || Object.keys(names).length === 0 ? {} : { names },
|
|
965
|
+
...uses === void 0 || Object.keys(uses).length === 0 ? {} : { uses },
|
|
966
|
+
...on === void 0 || (Array.isArray(on) ? on.length === 0 : Object.keys(on).length === 0) ? {} : { on }
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* The preset with `instance` naming `entity` `name`; undefined, or the entity's
|
|
971
|
+
* default, goes back to the default. An entry left empty is dropped.
|
|
972
|
+
*/
|
|
973
|
+
function withEntityName(preset, instance, entity, name) {
|
|
974
|
+
const fallback = blockEntities(instanceBlock(preset, instance)).find((each) => each.key === entity)?.singular;
|
|
975
|
+
const current = preset.instances?.[instance] ?? {};
|
|
976
|
+
const { [entity]: _previous, ...names } = current.names ?? {};
|
|
977
|
+
const next = compact({
|
|
978
|
+
...current,
|
|
979
|
+
names: name === void 0 || name === fallback ? names : {
|
|
980
|
+
...names,
|
|
981
|
+
[entity]: name
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
const { [instance]: _instance, ...others } = preset.instances ?? {};
|
|
985
|
+
return withInstances(preset, Object.keys(next).length === 0 ? others : {
|
|
986
|
+
...others,
|
|
987
|
+
[instance]: next
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
/** Why `name` can't name a new instance, or undefined when it can. */
|
|
991
|
+
function instanceNameProblem(preset, name) {
|
|
992
|
+
if (!INSTANCE_NAME.test(name)) return "Start with a lowercase letter, then use letters, digits and hyphens.";
|
|
993
|
+
if (PRESET_CATALOG.blocks.some((block) => block.name === name)) return `"${name}" is a block name. Choose another name.`;
|
|
994
|
+
if (presetInstances(preset).some((each) => each.name === name)) return `"${name}" is already an instance. Choose another name.`;
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* The preset with `name` set to `instance`: a new instance, or new settings for
|
|
998
|
+
* one already there. `instance.block` defaults to `name`.
|
|
999
|
+
*/
|
|
1000
|
+
function withInstance(preset, name, instance) {
|
|
1001
|
+
const block = instance.block ?? name;
|
|
1002
|
+
const existing = instancesOf(preset, block).filter((each) => each.name !== name);
|
|
1003
|
+
const next = withInstances(preset, {
|
|
1004
|
+
...preset.instances,
|
|
1005
|
+
[name]: compact(instance)
|
|
1006
|
+
});
|
|
1007
|
+
const [first] = existing;
|
|
1008
|
+
return existing.length === 1 && first !== void 0 ? pinDependents(next, block, first.name, name) : next;
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Keeps the instances that required `block` on `target`, its only instance
|
|
1012
|
+
* until `added` joined it, so a second instance changes nothing they read.
|
|
1013
|
+
*/
|
|
1014
|
+
function pinDependents(preset, block, target, added) {
|
|
1015
|
+
const instances = { ...preset.instances };
|
|
1016
|
+
for (const each of presetInstances(preset)) {
|
|
1017
|
+
const entry = instances[each.name] ?? {};
|
|
1018
|
+
if (each.name !== added && blockRequires(each.block).includes(block) && entry.uses?.[block] === void 0) instances[each.name] = {
|
|
1019
|
+
...entry,
|
|
1020
|
+
uses: {
|
|
1021
|
+
...entry.uses,
|
|
1022
|
+
[block]: target
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
return withInstances(preset, instances);
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* The preset without the instance `name`: its entry, the `uses` entries of
|
|
1030
|
+
* other instances that pointed at it, and the ones a dependency left with one
|
|
1031
|
+
* instance no longer needs. A block's own instance is removed by deselecting
|
|
1032
|
+
* the block instead.
|
|
1033
|
+
*/
|
|
1034
|
+
function withoutInstance(preset, name) {
|
|
1035
|
+
const { [name]: _removed, ...rest } = preset.instances ?? {};
|
|
1036
|
+
const remaining = presetInstances(withInstances(preset, rest));
|
|
1037
|
+
const single = (dependency) => remaining.filter((each) => each.block === dependency).length === 1;
|
|
1038
|
+
return withInstances(preset, Object.fromEntries(Object.entries(rest).flatMap(([key, instance]) => {
|
|
1039
|
+
const kept = compact({
|
|
1040
|
+
...instance,
|
|
1041
|
+
uses: Object.fromEntries(Object.entries(instance.uses ?? {}).filter(([dependency, target]) => target !== name && !(target === dependency && single(dependency))))
|
|
1042
|
+
});
|
|
1043
|
+
return Object.keys(kept).length === 0 ? [] : [[key, kept]];
|
|
1044
|
+
})));
|
|
1045
|
+
}
|
|
1046
|
+
//#endregion
|
|
1047
|
+
export { isDesignCode as A, safeDesignFileSource as B, decodeDesign as C, designOf as D, designFormat as E, presetArgumentOf as F, presetGlue as G, PROVIDER_COMMENT as H, presetConfigSource as I, presetInstallCommand as L, parseDesign as M, presetAndDesignOf as N, designSchema as O, presetApplyCommand as P, presetKey as R, createUrl as S, designFileSource as T, glueCommand as U, safeParseDesign as V, presetBlocksSource as W, DESIGN_FORMAT as _, installedBlocks as a, MAX_DESIGN_CODE_LENGTH as b, instancesOf as c, withInstance as d, withoutInstance as f, DESIGN_FILE as g, CREATE_URL as h, entityName as i, jsonPointer as j, encodeDesign as k, presetInstances as l, diffDesigns as m, blockRequires as n, instanceBlock as o, diffAppTables as p, canAddInstance as r, instanceNameProblem as s, blockEntities as t, withEntityName as u, DesignParseError as v, designConfig as w, createQuery as x, DesignTooLongError as y, readDesignFile as z };
|