@svgrid/enterprise 2.5.2 → 2.6.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/SvAlertRuleEditor.svelte.d.ts +13 -0
- package/dist/SvAlertsManager.svelte.d.ts +14 -0
- package/dist/SvAlertsPanel.svelte.d.ts +9 -0
- package/dist/SvAuthGate.svelte.d.ts +22 -0
- package/dist/SvBoard.svelte.d.ts +35 -0
- package/dist/SvExportMenu.svelte.d.ts +61 -0
- package/dist/SvExpressionEditor.svelte.d.ts +12 -0
- package/dist/SvFileInput.svelte.d.ts +20 -0
- package/dist/SvGridAlerts.svelte.d.ts +77 -0
- package/dist/SvGridBoard.svelte.d.ts +30 -0
- package/dist/SvGridEditPanel.svelte.d.ts +73 -0
- package/dist/SvGridMasterDetail.svelte.d.ts +49 -0
- package/dist/SvGridScheduler.svelte.d.ts +30 -0
- package/dist/SvImportDialog.svelte.d.ts +88 -0
- package/dist/SvLookupInput.svelte.d.ts +21 -0
- package/dist/SvPivotDesigner.svelte.d.ts +176 -0
- package/dist/SvRecordDetail.svelte.d.ts +58 -0
- package/dist/SvSchedule.svelte.d.ts +29 -0
- package/dist/SvSchemaChart.svelte.d.ts +61 -0
- package/dist/SvSchemaDashboard.svelte.d.ts +46 -0
- package/dist/alerts/alert-engine-attach.d.ts +79 -0
- package/dist/alerts/alert-engine-attach.js +106 -0
- package/dist/alerts/alert-engine.d.ts +42 -0
- package/dist/alerts/alert-engine.js +196 -0
- package/dist/alerts/alert-formats.d.ts +26 -0
- package/dist/alerts/alert-formats.js +58 -0
- package/dist/alerts/alert-observer.d.ts +54 -0
- package/dist/alerts/alert-observer.js +156 -0
- package/dist/alerts/alert-scheduler.d.ts +30 -0
- package/dist/alerts/alert-scheduler.js +54 -0
- package/dist/alerts/alert-storage.d.ts +31 -0
- package/dist/alerts/alert-storage.js +92 -0
- package/dist/alerts/alert-store.svelte.d.ts +24 -0
- package/dist/alerts/alert-store.svelte.js +69 -0
- package/dist/alerts/alert-types.d.ts +86 -0
- package/dist/alerts/alert-types.js +1 -0
- package/dist/alerts.d.ts +2 -0
- package/{src/alerts.ts → dist/alerts.js} +9 -9
- package/dist/board.d.ts +7 -0
- package/{src/board.ts → dist/board.js} +13 -14
- package/dist/cdn/svgrid-enterprise.svelte-external.js +2987 -2981
- package/dist/designer/assets/{index-CM5xvaOy.js → index-BF0UH638.js} +3 -3
- package/dist/designer/assets/{src-D-ET9Mmo.js → src-BPJruwB9.js} +184 -184
- package/dist/designer/index.html +2 -2
- package/dist/edit-panel.d.ts +105 -0
- package/dist/edit-panel.js +350 -0
- package/dist/export-conditional.d.ts +31 -0
- package/dist/export-conditional.js +65 -0
- package/dist/export-ooxml.d.ts +93 -0
- package/dist/export-ooxml.js +385 -0
- package/dist/export-pdf.d.ts +107 -0
- package/dist/export-pdf.js +144 -0
- package/dist/export-print.d.ts +55 -0
- package/dist/export-print.js +91 -0
- package/{src/export-serialize.ts → dist/export-serialize.d.ts} +11 -24
- package/dist/export-serialize.js +11 -0
- package/dist/export-xls.d.ts +26 -0
- package/dist/export-xls.js +157 -0
- package/dist/export.d.ts +323 -0
- package/dist/export.js +1021 -0
- package/dist/expressions/evaluate.d.ts +17 -0
- package/dist/expressions/evaluate.js +214 -0
- package/dist/expressions/expression-columns.d.ts +61 -0
- package/dist/expressions/expression-columns.js +72 -0
- package/dist/expressions/expression-types.d.ts +125 -0
- package/dist/expressions/expression-types.js +1 -0
- package/dist/expressions/parse.d.ts +25 -0
- package/dist/expressions/parse.js +537 -0
- package/dist/import.d.ts +232 -0
- package/dist/import.js +846 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +91 -0
- package/dist/install.d.ts +70 -0
- package/dist/install.js +61 -0
- package/dist/license-core.d.ts +37 -0
- package/dist/license-core.js +81 -0
- package/dist/license.d.ts +30 -0
- package/dist/license.js +139 -0
- package/dist/master-detail.d.ts +23 -0
- package/dist/master-detail.js +35 -0
- package/dist/node/studio.js +1 -1
- package/dist/pivot-chart.d.ts +28 -0
- package/dist/pivot-chart.js +71 -0
- package/dist/pivot-designer.d.ts +69 -0
- package/dist/pivot-designer.js +38 -0
- package/dist/pivot-enable.d.ts +6 -0
- package/{src/pivot-enable.ts → dist/pivot-enable.js} +13 -18
- package/dist/pivot.d.ts +111 -0
- package/dist/pivot.js +353 -0
- package/dist/print.d.ts +33 -0
- package/dist/print.js +61 -0
- package/dist/revoked.d.ts +1 -0
- package/{src/revoked.ts → dist/revoked.js} +5 -6
- package/dist/scheduler-assignments.d.ts +64 -0
- package/dist/scheduler-assignments.js +92 -0
- package/dist/scheduler-axis.d.ts +81 -0
- package/dist/scheduler-axis.js +180 -0
- package/{src/scheduler-booking.ts → dist/scheduler-booking.d.ts} +10 -43
- package/dist/scheduler-booking.js +50 -0
- package/dist/scheduler-config.d.ts +177 -0
- package/dist/scheduler-config.js +1 -0
- package/dist/scheduler-dependencies.d.ts +89 -0
- package/dist/scheduler-dependencies.js +179 -0
- package/dist/scheduler-freebusy.d.ts +19 -0
- package/{src/scheduler-freebusy.ts → dist/scheduler-freebusy.js} +9 -19
- package/{src/scheduler-heatmap.ts → dist/scheduler-heatmap.d.ts} +12 -35
- package/dist/scheduler-heatmap.js +41 -0
- package/dist/scheduler-resource-tree.d.ts +48 -0
- package/dist/scheduler-resource-tree.js +78 -0
- package/dist/scheduler-slots.d.ts +37 -0
- package/dist/scheduler-slots.js +80 -0
- package/dist/scheduler-summary.d.ts +41 -0
- package/dist/scheduler-summary.js +54 -0
- package/dist/scheduler.d.ts +7 -0
- package/{src/scheduler.ts → dist/scheduler.js} +13 -14
- package/dist/scheduling.d.ts +132 -0
- package/dist/scheduling.js +228 -0
- package/dist/schema-designer.d.ts +42 -0
- package/dist/schema-designer.js +117 -0
- package/dist/schema.d.ts +369 -0
- package/dist/schema.js +216 -0
- package/dist/smart-shim.d.ts +62 -0
- package/dist/smart-shim.js +34 -0
- package/dist/sources/aggregate.d.ts +43 -0
- package/dist/sources/aggregate.js +60 -0
- package/dist/sources/auth-supabase.d.ts +69 -0
- package/dist/sources/auth-supabase.js +39 -0
- package/dist/sources/dashboard.d.ts +65 -0
- package/dist/sources/dashboard.js +95 -0
- package/dist/sources/field-inference.d.ts +23 -0
- package/dist/sources/field-inference.js +52 -0
- package/dist/sources/filters.d.ts +35 -0
- package/dist/sources/filters.js +52 -0
- package/dist/sources/index.d.ts +18 -0
- package/dist/sources/index.js +18 -0
- package/dist/sources/introspect-supabase.d.ts +30 -0
- package/dist/sources/introspect-supabase.js +134 -0
- package/dist/sources/realtime-supabase.d.ts +37 -0
- package/dist/sources/realtime-supabase.js +52 -0
- package/dist/sources/relation-lookup.d.ts +50 -0
- package/dist/sources/relation-lookup.js +77 -0
- package/dist/sources/rest-adapters.d.ts +48 -0
- package/dist/sources/rest-adapters.js +85 -0
- package/dist/sources/rest.d.ts +38 -0
- package/dist/sources/rest.js +86 -0
- package/dist/sources/schema-from-columns.d.ts +37 -0
- package/dist/sources/schema-from-columns.js +48 -0
- package/dist/sources/supabase.d.ts +33 -0
- package/dist/sources/supabase.js +74 -0
- package/dist/sources/with-entity-rules.d.ts +25 -0
- package/dist/sources/with-entity-rules.js +47 -0
- package/dist/sources/with-relation-labels.d.ts +26 -0
- package/dist/sources/with-relation-labels.js +38 -0
- package/dist/staged-editing.d.ts +85 -0
- package/dist/staged-editing.js +0 -0
- package/dist/studio/bug-report.d.ts +61 -0
- package/dist/studio/bug-report.js +126 -0
- package/dist/studio/cli.d.ts +56 -0
- package/dist/studio/cli.js +70 -0
- package/dist/studio/copilot-core.d.ts +22 -0
- package/{src/studio/copilot-core.ts → dist/studio/copilot-core.js} +34 -38
- package/dist/studio/csv.d.ts +36 -0
- package/dist/studio/csv.js +173 -0
- package/dist/studio/db-connect-string.d.ts +45 -0
- package/dist/studio/db-connect-string.js +113 -0
- package/dist/studio/deploy-cli.d.ts +35 -0
- package/dist/studio/deploy-cli.js +81 -0
- package/dist/studio/emit-project.d.ts +77 -0
- package/dist/studio/emit-project.js +5389 -0
- package/dist/studio/emit-schema.d.ts +110 -0
- package/dist/studio/emit-schema.js +1128 -0
- package/dist/studio/index.d.ts +35 -0
- package/dist/studio/index.js +38 -0
- package/dist/studio/init-flow.d.ts +58 -0
- package/dist/studio/init-flow.js +451 -0
- package/dist/studio/introspect-db.d.ts +47 -0
- package/dist/studio/introspect-db.js +255 -0
- package/dist/studio/introspect-openapi.d.ts +19 -0
- package/dist/studio/introspect-openapi.js +244 -0
- package/dist/studio/introspect-prisma.d.ts +25 -0
- package/dist/studio/introspect-prisma.js +164 -0
- package/dist/studio/introspect.d.ts +35 -0
- package/dist/studio/introspect.js +306 -0
- package/dist/studio/project.d.ts +1327 -0
- package/dist/studio/project.js +1798 -0
- package/dist/studio/sample-data.d.ts +19 -0
- package/dist/studio/sample-data.js +207 -0
- package/dist/studio/samples/ats.d.ts +2 -0
- package/dist/studio/samples/ats.js +194 -0
- package/dist/studio/samples/clinic.d.ts +2 -0
- package/dist/studio/samples/clinic.js +171 -0
- package/dist/studio/samples/crm.d.ts +2 -0
- package/dist/studio/samples/crm.js +280 -0
- package/dist/studio/samples/datasets.d.ts +38 -0
- package/dist/studio/samples/datasets.js +296 -0
- package/dist/studio/samples/ecommerce.d.ts +2 -0
- package/dist/studio/samples/ecommerce.js +178 -0
- package/dist/studio/samples/events.d.ts +2 -0
- package/dist/studio/samples/events.js +192 -0
- package/dist/studio/samples/fleet.d.ts +2 -0
- package/dist/studio/samples/fleet.js +203 -0
- package/dist/studio/samples/gym.d.ts +2 -0
- package/dist/studio/samples/gym.js +205 -0
- package/dist/studio/samples/hr.d.ts +2 -0
- package/dist/studio/samples/hr.js +186 -0
- package/dist/studio/samples/index.d.ts +13 -0
- package/dist/studio/samples/index.js +44 -0
- package/dist/studio/samples/insurance.d.ts +2 -0
- package/dist/studio/samples/insurance.js +220 -0
- package/dist/studio/samples/inventory.d.ts +2 -0
- package/dist/studio/samples/inventory.js +204 -0
- package/dist/studio/samples/invoicing.d.ts +2 -0
- package/dist/studio/samples/invoicing.js +154 -0
- package/dist/studio/samples/library.d.ts +2 -0
- package/dist/studio/samples/library.js +171 -0
- package/dist/studio/samples/live-data.d.ts +5 -0
- package/dist/studio/samples/live-data.js +261 -0
- package/dist/studio/samples/projects.d.ts +2 -0
- package/dist/studio/samples/projects.js +203 -0
- package/dist/studio/samples/realestate.d.ts +2 -0
- package/dist/studio/samples/realestate.js +187 -0
- package/dist/studio/samples/restaurant.d.ts +2 -0
- package/dist/studio/samples/restaurant.js +180 -0
- package/dist/studio/samples/school.d.ts +2 -0
- package/dist/studio/samples/school.js +188 -0
- package/dist/studio/samples/shared.d.ts +142 -0
- package/dist/studio/samples/shared.js +164 -0
- package/dist/studio/samples/starter.d.ts +4 -0
- package/dist/studio/samples/starter.js +237 -0
- package/dist/studio/samples/subscriptions.d.ts +2 -0
- package/dist/studio/samples/subscriptions.js +175 -0
- package/dist/studio/samples/support.d.ts +2 -0
- package/dist/studio/samples/support.js +209 -0
- package/dist/studio/scaffold-app.d.ts +22 -0
- package/{src/studio/scaffold-app.ts → dist/studio/scaffold-app.js} +45 -63
- package/dist/studio/scaffold.d.ts +63 -0
- package/dist/studio/scaffold.js +346 -0
- package/dist/studio/screen-suites.d.ts +193 -0
- package/dist/studio/screen-suites.js +297 -0
- package/dist/studio/themes.d.ts +34 -0
- package/dist/studio/themes.js +41 -0
- package/dist/studio/ui-components.d.ts +89 -0
- package/dist/studio/ui-components.generated.d.ts +29 -0
- package/dist/studio/ui-components.generated.js +7139 -0
- package/dist/studio/ui-components.js +673 -0
- package/dist/studio/user-error.d.ts +23 -0
- package/{src/studio/user-error.ts → dist/studio/user-error.js} +10 -13
- package/dist/studio/verify.d.ts +34 -0
- package/dist/studio/verify.js +47 -0
- package/dist/sveltekit/in-memory.d.ts +14 -0
- package/dist/sveltekit/in-memory.js +113 -0
- package/dist/sveltekit/index.d.ts +6 -0
- package/dist/sveltekit/index.js +5 -0
- package/dist/sveltekit/query-plan.d.ts +44 -0
- package/dist/sveltekit/query-plan.js +76 -0
- package/dist/sveltekit/sql-source.d.ts +47 -0
- package/dist/sveltekit/sql-source.js +106 -0
- package/dist/sveltekit/sql.d.ts +48 -0
- package/dist/sveltekit/sql.js +73 -0
- package/dist/sveltekit/transport.d.ts +209 -0
- package/dist/sveltekit/transport.js +219 -0
- package/{src/sveltekit/types.ts → dist/sveltekit/types.d.ts} +8 -11
- package/dist/sveltekit/types.js +1 -0
- package/dist/upgrade-prompt.d.ts +16 -0
- package/dist/upgrade-prompt.js +141 -0
- package/dist/version.d.ts +13 -0
- package/{src/version.ts → dist/version.js} +1 -1
- package/dist/watermark.d.ts +2 -0
- package/dist/watermark.js +146 -0
- package/package.json +26 -24
- package/src/SvBoard.dom.test.ts +0 -67
- package/src/SvGridAlerts.dom.test.ts +0 -113
- package/src/SvGridEditPanel.dom.test.ts +0 -320
- package/src/SvRecordDetail.dom.test.ts +0 -137
- package/src/SvSchedule.dom.test.ts +0 -57
- package/src/ai-export-pdf.dom.test.ts +0 -77
- package/src/ai-export-xlsx.dom.test.ts +0 -90
- package/src/ai-export.dom.test.ts +0 -114
- package/src/alerts/alert-engine-attach.ts +0 -165
- package/src/alerts/alert-engine.test.ts +0 -135
- package/src/alerts/alert-engine.ts +0 -260
- package/src/alerts/alert-formats.test.ts +0 -87
- package/src/alerts/alert-formats.ts +0 -77
- package/src/alerts/alert-observer.test.ts +0 -189
- package/src/alerts/alert-observer.ts +0 -208
- package/src/alerts/alert-scheduler.ts +0 -96
- package/src/alerts/alert-storage.test.ts +0 -54
- package/src/alerts/alert-storage.ts +0 -116
- package/src/alerts/alert-store.svelte.ts +0 -80
- package/src/alerts/alert-types.ts +0 -94
- package/src/board.dom.test.ts +0 -941
- package/src/edit-panel.test.ts +0 -322
- package/src/edit-panel.ts +0 -379
- package/src/export-conditional.test.ts +0 -60
- package/src/export-conditional.ts +0 -94
- package/src/export-ooxml.test.ts +0 -152
- package/src/export-ooxml.ts +0 -489
- package/src/export-pdf.test.ts +0 -138
- package/src/export-pdf.ts +0 -245
- package/src/export-print.test.ts +0 -66
- package/src/export-print.ts +0 -132
- package/src/export-serialize.test.ts +0 -56
- package/src/export-xls.ts +0 -199
- package/src/export-xlsx-roundtrip.test.ts +0 -120
- package/src/export-xlsx.test.ts +0 -150
- package/src/export.test.ts +0 -349
- package/src/export.ts +0 -1464
- package/src/expressions/evaluate.test.ts +0 -111
- package/src/expressions/evaluate.ts +0 -237
- package/src/expressions/expression-columns.ts +0 -133
- package/src/expressions/expression-types.ts +0 -84
- package/src/expressions/parse.test.ts +0 -106
- package/src/expressions/parse.ts +0 -610
- package/src/import-automap.test.ts +0 -131
- package/src/import-hardening.test.ts +0 -158
- package/src/import.test.ts +0 -415
- package/src/import.ts +0 -1044
- package/src/index.ts +0 -569
- package/src/install.ts +0 -154
- package/src/license-core.test.ts +0 -23
- package/src/license-core.ts +0 -107
- package/src/license-expiry.test.ts +0 -127
- package/src/license.ts +0 -137
- package/src/master-detail.test.ts +0 -61
- package/src/master-detail.ts +0 -42
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -178
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-ZrPsKxob.js +0 -3875
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-ZrPsKxob.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-ACqvWGE2.js +0 -21
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-ACqvWGE2.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-D3w5jt92.js +0 -1938
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-D3w5jt92.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-CC2V3H0y.js +0 -205
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-CC2V3H0y.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-BXP37tAa.js +0 -18
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-BXP37tAa.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-DwubnU5b.js +0 -264
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-DwubnU5b.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-hD7f6PUz.js +0 -697
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-hD7f6PUz.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -134
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -55
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -2
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -46843
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -237
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -2
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -4
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -7
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -4
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -5
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -5
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -5
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -6
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -83
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -559
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -24
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -122
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -2
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -89
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -241
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DBx1SCN6.js +0 -4938
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DBx1SCN6.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-gjfpSTFS.js +0 -495
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-gjfpSTFS.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-DKoOKg8S.js +0 -190
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-DKoOKg8S.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-C0MiR7eR.js +0 -8
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-C0MiR7eR.js.map +0 -1
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-B6Y7P0Q-.js +0 -138
- package/src/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-B6Y7P0Q-.js.map +0 -1
- package/src/pivot-chart.test.ts +0 -86
- package/src/pivot-chart.ts +0 -112
- package/src/pivot-designer.ts +0 -101
- package/src/pivot.test.ts +0 -335
- package/src/pivot.ts +0 -578
- package/src/print.ts +0 -107
- package/src/scheduler-assignments.test.ts +0 -97
- package/src/scheduler-assignments.ts +0 -134
- package/src/scheduler-axis.test.ts +0 -108
- package/src/scheduler-axis.ts +0 -238
- package/src/scheduler-booking.test.ts +0 -57
- package/src/scheduler-config.ts +0 -179
- package/src/scheduler-dependencies.test.ts +0 -155
- package/src/scheduler-dependencies.ts +0 -223
- package/src/scheduler-freebusy.test.ts +0 -41
- package/src/scheduler-heatmap.test.ts +0 -39
- package/src/scheduler-resource-tree.test.ts +0 -84
- package/src/scheduler-resource-tree.ts +0 -107
- package/src/scheduler-slots.test.ts +0 -53
- package/src/scheduler-slots.ts +0 -94
- package/src/scheduler-summary.test.ts +0 -47
- package/src/scheduler-summary.ts +0 -81
- package/src/scheduling.test.ts +0 -194
- package/src/scheduling.ts +0 -293
- package/src/schema-designer.test.ts +0 -121
- package/src/schema-designer.ts +0 -142
- package/src/schema.test.ts +0 -268
- package/src/schema.ts +0 -562
- package/src/smart-shim.ts +0 -107
- package/src/sources/aggregate.test.ts +0 -79
- package/src/sources/aggregate.ts +0 -102
- package/src/sources/auth-supabase.test.ts +0 -80
- package/src/sources/auth-supabase.ts +0 -87
- package/src/sources/dashboard.kpi.test.ts +0 -50
- package/src/sources/dashboard.test.ts +0 -61
- package/src/sources/dashboard.ts +0 -136
- package/src/sources/field-inference.test.ts +0 -60
- package/src/sources/field-inference.ts +0 -63
- package/src/sources/filters.test.ts +0 -58
- package/src/sources/filters.ts +0 -70
- package/src/sources/index.ts +0 -67
- package/src/sources/introspect-supabase.test.ts +0 -112
- package/src/sources/introspect-supabase.ts +0 -139
- package/src/sources/realtime-supabase.test.ts +0 -93
- package/src/sources/realtime-supabase.ts +0 -99
- package/src/sources/relation-lookup.test.ts +0 -99
- package/src/sources/relation-lookup.ts +0 -128
- package/src/sources/rest-adapters.test.ts +0 -95
- package/src/sources/rest-adapters.ts +0 -120
- package/src/sources/rest.test.ts +0 -104
- package/src/sources/rest.ts +0 -129
- package/src/sources/schema-from-columns.test.ts +0 -106
- package/src/sources/schema-from-columns.ts +0 -88
- package/src/sources/supabase.test.ts +0 -110
- package/src/sources/supabase.ts +0 -99
- package/src/sources/with-entity-rules.test.ts +0 -104
- package/src/sources/with-entity-rules.ts +0 -78
- package/src/sources/with-relation-labels.test.ts +0 -75
- package/src/sources/with-relation-labels.ts +0 -73
- package/src/staged-editing.ts +0 -0
- package/src/studio/bug-report.test.ts +0 -101
- package/src/studio/bug-report.ts +0 -165
- package/src/studio/cli.test.ts +0 -187
- package/src/studio/cli.ts +0 -117
- package/src/studio/copilot-core.test.ts +0 -45
- package/src/studio/csv.test.ts +0 -90
- package/src/studio/csv.ts +0 -165
- package/src/studio/db-connect-string.test.ts +0 -94
- package/src/studio/db-connect-string.ts +0 -128
- package/src/studio/deploy-cli.test.ts +0 -56
- package/src/studio/deploy-cli.ts +0 -100
- package/src/studio/emit-project.test.ts +0 -3324
- package/src/studio/emit-project.ts +0 -5377
- package/src/studio/emit-schema.test.ts +0 -111
- package/src/studio/emit-schema.ts +0 -1181
- package/src/studio/index.ts +0 -380
- package/src/studio/init-flow.test.ts +0 -514
- package/src/studio/init-flow.ts +0 -556
- package/src/studio/introspect-db.test.ts +0 -186
- package/src/studio/introspect-db.ts +0 -312
- package/src/studio/introspect-openapi.test.ts +0 -84
- package/src/studio/introspect-openapi.ts +0 -252
- package/src/studio/introspect-prisma.test.ts +0 -99
- package/src/studio/introspect-prisma.ts +0 -175
- package/src/studio/introspect.test.ts +0 -172
- package/src/studio/introspect.ts +0 -310
- package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -1
- package/src/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -3
- package/src/studio/pipeline.test.ts +0 -42
- package/src/studio/project-robust.test.ts +0 -157
- package/src/studio/project.test.ts +0 -929
- package/src/studio/project.ts +0 -2394
- package/src/studio/sample-data.test.ts +0 -58
- package/src/studio/sample-data.ts +0 -203
- package/src/studio/samples/ats.ts +0 -202
- package/src/studio/samples/clinic.ts +0 -179
- package/src/studio/samples/crm.ts +0 -291
- package/src/studio/samples/datasets.test.ts +0 -84
- package/src/studio/samples/datasets.ts +0 -340
- package/src/studio/samples/ecommerce.ts +0 -187
- package/src/studio/samples/events.ts +0 -201
- package/src/studio/samples/fleet.ts +0 -213
- package/src/studio/samples/gym.ts +0 -215
- package/src/studio/samples/hr.ts +0 -195
- package/src/studio/samples/index.ts +0 -55
- package/src/studio/samples/insurance.ts +0 -229
- package/src/studio/samples/inventory.ts +0 -213
- package/src/studio/samples/invoicing.ts +0 -162
- package/src/studio/samples/library.ts +0 -180
- package/src/studio/samples/live-data.test.ts +0 -99
- package/src/studio/samples/live-data.ts +0 -306
- package/src/studio/samples/projects.ts +0 -212
- package/src/studio/samples/realestate.ts +0 -196
- package/src/studio/samples/restaurant.ts +0 -189
- package/src/studio/samples/samples.test.ts +0 -304
- package/src/studio/samples/school.ts +0 -197
- package/src/studio/samples/seed-floor.test.ts +0 -25
- package/src/studio/samples/shared.ts +0 -237
- package/src/studio/samples/starter.ts +0 -251
- package/src/studio/samples/subscriptions.ts +0 -183
- package/src/studio/samples/support.ts +0 -216
- package/src/studio/scaffold-app.test.ts +0 -91
- package/src/studio/scaffold.test.ts +0 -192
- package/src/studio/scaffold.ts +0 -390
- package/src/studio/screen-suites.test.ts +0 -269
- package/src/studio/screen-suites.ts +0 -448
- package/src/studio/themes.ts +0 -62
- package/src/studio/ui-components-surface.test.ts +0 -185
- package/src/studio/ui-components.generated.ts +0 -7154
- package/src/studio/ui-components.ts +0 -742
- package/src/studio/verify.test.ts +0 -47
- package/src/studio/verify.ts +0 -79
- package/src/sveltekit/in-memory.test.ts +0 -104
- package/src/sveltekit/in-memory.ts +0 -129
- package/src/sveltekit/index.ts +0 -24
- package/src/sveltekit/query-plan.test.ts +0 -109
- package/src/sveltekit/query-plan.ts +0 -125
- package/src/sveltekit/sql-source.test.ts +0 -198
- package/src/sveltekit/sql-source.ts +0 -171
- package/src/sveltekit/sql.test.ts +0 -80
- package/src/sveltekit/sql.ts +0 -131
- package/src/sveltekit/transport-scope.test.ts +0 -125
- package/src/sveltekit/transport.test.ts +0 -201
- package/src/sveltekit/transport.ts +0 -373
- package/src/upgrade-prompt.test.ts +0 -71
- package/src/upgrade-prompt.ts +0 -162
- package/src/version.test.ts +0 -17
- package/src/watermark.test.ts +0 -97
- package/src/watermark.ts +0 -156
- /package/{src → dist}/SvAlertRuleEditor.svelte +0 -0
- /package/{src → dist}/SvAlertsManager.svelte +0 -0
- /package/{src → dist}/SvAlertsPanel.svelte +0 -0
- /package/{src → dist}/SvAuthGate.svelte +0 -0
- /package/{src → dist}/SvBoard.svelte +0 -0
- /package/{src → dist}/SvExportMenu.svelte +0 -0
- /package/{src → dist}/SvExpressionEditor.svelte +0 -0
- /package/{src → dist}/SvFileInput.svelte +0 -0
- /package/{src → dist}/SvGridAlerts.svelte +0 -0
- /package/{src → dist}/SvGridBoard.svelte +0 -0
- /package/{src → dist}/SvGridEditPanel.svelte +0 -0
- /package/{src → dist}/SvGridMasterDetail.svelte +0 -0
- /package/{src → dist}/SvGridScheduler.svelte +0 -0
- /package/{src → dist}/SvImportDialog.svelte +0 -0
- /package/{src → dist}/SvLookupInput.svelte +0 -0
- /package/{src → dist}/SvPivotDesigner.svelte +0 -0
- /package/{src → dist}/SvRecordDetail.svelte +0 -0
- /package/{src → dist}/SvSchedule.svelte +0 -0
- /package/{src → dist}/SvSchemaChart.svelte +0 -0
- /package/{src → dist}/SvSchemaDashboard.svelte +0 -0
- /package/{src → dist}/pdfmake-shims.d.ts +0 -0
- /package/{src → dist}/smart.export.d.ts +0 -0
- /package/{src → dist}/smart.export.js +0 -0
- /package/{src → dist}/studio/HANDLERS-DESIGN.md +0 -0
- /package/{src → dist/studio}/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/_svelte_metadata.json +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/_metadata.json +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/attachments-BOv1rBKp.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/constants-B9vgIdCd.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/dev-T1qbW_qD.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/events-Bo11SfVK.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/flags-X7D4vfrZ.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/hydration-oyUje5i1.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/legacy-client-DeSQgSFm.js.map +0 -0
- /package/{src → dist/studio}/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/package.json +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_animate.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_attachments.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_compiler.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_easing.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_events.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_client.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_disclose-version.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_async.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_legacy.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_flags_tracing.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_internal_server.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_legacy.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_motion.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_reactivity_window.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_server.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_store.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/svelte_transition.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-BbWyXNk1.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/utils-DI_fC7vt.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/validate-Dyr3lQv9.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/version-_9FHH-LF.js.map +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js +0 -0
- /package/{src → dist}/studio/node_modules/.vite/vitest/be65d27ae088a0e03fd8e1331d90b01649464cb6/deps___vitest__/warnings-CUbSPnyP.js.map +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export function planToSql(plan, dialect = {}) {
|
|
2
|
+
const q = dialect.quote ?? '"';
|
|
3
|
+
const useIlike = dialect.ilike ?? false;
|
|
4
|
+
const params = [];
|
|
5
|
+
const ph = () => {
|
|
6
|
+
if (dialect.placeholders === '$')
|
|
7
|
+
return `$${params.length}`;
|
|
8
|
+
if (dialect.placeholders === '@')
|
|
9
|
+
return `@p${params.length}`;
|
|
10
|
+
return '?';
|
|
11
|
+
};
|
|
12
|
+
const bind = (v) => {
|
|
13
|
+
params.push(v);
|
|
14
|
+
return ph();
|
|
15
|
+
};
|
|
16
|
+
const columnFor = dialect.column ?? ((f) => f);
|
|
17
|
+
const id = (field) => {
|
|
18
|
+
const c = columnFor(field);
|
|
19
|
+
return `${q}${c.replace(new RegExp(q, 'g'), q + q)}${q}`;
|
|
20
|
+
};
|
|
21
|
+
const like = (field, pattern) => {
|
|
22
|
+
const p = bind(pattern);
|
|
23
|
+
return useIlike ? `${id(field)} ILIKE ${p}` : `LOWER(${id(field)}) LIKE LOWER(${p})`;
|
|
24
|
+
};
|
|
25
|
+
const clauses = [];
|
|
26
|
+
for (const pred of plan.where) {
|
|
27
|
+
clauses.push(predicateSql(pred, { id, bind, like }));
|
|
28
|
+
}
|
|
29
|
+
if (plan.search && plan.search.fields.length > 0) {
|
|
30
|
+
const term = `%${plan.search.term}%`;
|
|
31
|
+
const ors = plan.search.fields.map((f) => like(f, term));
|
|
32
|
+
clauses.push(`(${ors.join(' OR ')})`);
|
|
33
|
+
}
|
|
34
|
+
const where = clauses.join(' AND ');
|
|
35
|
+
const orderBy = plan.orderBy.map((o) => `${id(o.field)} ${o.desc ? 'DESC' : 'ASC'}`).join(', ');
|
|
36
|
+
return {
|
|
37
|
+
where,
|
|
38
|
+
whereText: where ? `WHERE ${where}` : '',
|
|
39
|
+
orderBy,
|
|
40
|
+
orderByText: orderBy ? `ORDER BY ${orderBy}` : '',
|
|
41
|
+
params,
|
|
42
|
+
limit: plan.limit,
|
|
43
|
+
offset: plan.offset,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function predicateSql(pred, ctx) {
|
|
47
|
+
const { id, bind, like } = ctx;
|
|
48
|
+
const col = id(pred.field);
|
|
49
|
+
switch (pred.op) {
|
|
50
|
+
case 'eq':
|
|
51
|
+
return `${col} = ${bind(pred.value)}`;
|
|
52
|
+
case 'contains':
|
|
53
|
+
return like(pred.field, `%${pred.value}%`);
|
|
54
|
+
case 'startsWith':
|
|
55
|
+
return like(pred.field, `${pred.value}%`);
|
|
56
|
+
case 'gt':
|
|
57
|
+
return `${col} > ${bind(pred.value)}`;
|
|
58
|
+
case 'lt':
|
|
59
|
+
return `${col} < ${bind(pred.value)}`;
|
|
60
|
+
case 'between':
|
|
61
|
+
return `${col} BETWEEN ${bind(pred.value)} AND ${bind(pred.valueTo)}`;
|
|
62
|
+
case 'isBlank':
|
|
63
|
+
return `(${col} IS NULL OR ${col} = '')`;
|
|
64
|
+
case 'in': {
|
|
65
|
+
const vals = pred.values ?? [];
|
|
66
|
+
if (vals.length === 0)
|
|
67
|
+
return '1 = 0'; // empty IN () matches nothing
|
|
68
|
+
return `${col} IN (${vals.map((v) => bind(v)).join(', ')})`;
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
return '1 = 1';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SvelteKit transport - the deep integration an agnostic grid can't ship.
|
|
3
|
+
*
|
|
4
|
+
* Two halves that speak one small JSON protocol over a single route:
|
|
5
|
+
*
|
|
6
|
+
* - `createKitDataSource({ endpoint })` runs in the browser (or a `load`
|
|
7
|
+
* function) and returns a `ServerDataSource` that POSTs requests to your
|
|
8
|
+
* endpoint. Drop it straight into `createServerDataSource`.
|
|
9
|
+
*
|
|
10
|
+
* - `createKitHandlers({ schema, source })` runs on the server and returns a
|
|
11
|
+
* `POST` handler for a `+server.ts` route. It parses the protocol, calls
|
|
12
|
+
* your backend `ServerDataSource` (in-memory, SQL, Drizzle, ...), and
|
|
13
|
+
* returns JSON.
|
|
14
|
+
*
|
|
15
|
+
* Example `src/routes/api/customers/+server.ts`:
|
|
16
|
+
*
|
|
17
|
+
* import { createKitHandlers } from '@svgrid/enterprise'
|
|
18
|
+
* import { customerSchema, customerSource } from '../lib/customers'
|
|
19
|
+
* export const { POST } = createKitHandlers({ schema: customerSchema, source: customerSource })
|
|
20
|
+
*
|
|
21
|
+
* Client:
|
|
22
|
+
*
|
|
23
|
+
* const source = createKitDataSource({ endpoint: '/api/customers' })
|
|
24
|
+
* const controller = createServerDataSource(source, { onChange: ... })
|
|
25
|
+
*/
|
|
26
|
+
import type { RowData, ServerDataSource, ServerRequest } from '@svgrid/grid';
|
|
27
|
+
import type { EntitySchema } from '../schema';
|
|
28
|
+
import type { WritableDataSource } from './types';
|
|
29
|
+
/** Wire protocol: the single JSON body shape the client POSTs and the server dispatches on. */
|
|
30
|
+
export type KitMessage<TData> = {
|
|
31
|
+
kind: 'query';
|
|
32
|
+
request: ServerRequest;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'mutate';
|
|
35
|
+
op: 'create';
|
|
36
|
+
input: Partial<TData>;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'mutate';
|
|
39
|
+
op: 'update';
|
|
40
|
+
id: string;
|
|
41
|
+
patch: Partial<TData>;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'mutate';
|
|
44
|
+
op: 'delete';
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
48
|
+
export type KitDataSourceOptions = {
|
|
49
|
+
/** Route that `createKitHandlers` is mounted on, e.g. `'/api/customers'`. */
|
|
50
|
+
endpoint: string;
|
|
51
|
+
/**
|
|
52
|
+
* Fetch implementation. Pass SvelteKit's event `fetch` inside a `load` so
|
|
53
|
+
* requests are same-origin and SSR-safe; defaults to the global `fetch`.
|
|
54
|
+
*/
|
|
55
|
+
fetch?: FetchLike;
|
|
56
|
+
};
|
|
57
|
+
export declare function createKitDataSource<TData extends RowData>(options: KitDataSourceOptions): WritableDataSource<TData>;
|
|
58
|
+
/** The CRUD action a Kit message maps to (`query` -> `read`). */
|
|
59
|
+
export type KitAction = 'read' | 'create' | 'update' | 'delete';
|
|
60
|
+
/** Context passed to the `authorize` guard before every op. */
|
|
61
|
+
export type KitAuthorizeContext<TData extends RowData> = {
|
|
62
|
+
action: KitAction;
|
|
63
|
+
/** The SvelteKit request event, so you can read `locals` / session for the
|
|
64
|
+
* caller's role or user id. Only `request` is guaranteed in non-Kit callers. */
|
|
65
|
+
event: {
|
|
66
|
+
request: Request;
|
|
67
|
+
locals?: Record<string, unknown>;
|
|
68
|
+
};
|
|
69
|
+
message: KitMessage<TData>;
|
|
70
|
+
};
|
|
71
|
+
/** A field-error map (`{ field: message }`); empty/undefined means valid. */
|
|
72
|
+
export type KitFieldErrors = Record<string, string>;
|
|
73
|
+
/** Context passed to a custom `validate` function before a create / update. */
|
|
74
|
+
export type KitValidateContext<TData extends RowData> = {
|
|
75
|
+
action: 'create' | 'update';
|
|
76
|
+
values: Partial<TData>;
|
|
77
|
+
event: {
|
|
78
|
+
request: Request;
|
|
79
|
+
locals?: Record<string, unknown>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/** A row-scoping rule: every row this caller may touch has `field === value`. */
|
|
83
|
+
export type KitScope = {
|
|
84
|
+
field: string;
|
|
85
|
+
value: unknown;
|
|
86
|
+
};
|
|
87
|
+
export type KitHandlerOptions<TData extends RowData> = {
|
|
88
|
+
schema: EntitySchema<TData>;
|
|
89
|
+
source: ServerDataSource<TData>;
|
|
90
|
+
/**
|
|
91
|
+
* Restrict every operation to rows matching one column - the mechanism behind
|
|
92
|
+
* multi-tenancy (`field: 'tenantId'`), and usable for any "you only see your
|
|
93
|
+
* own rows" rule.
|
|
94
|
+
*
|
|
95
|
+
* Enforced on all four paths, because scoping reads alone is not isolation:
|
|
96
|
+
* - **read**: the predicate is merged into the query's filter model;
|
|
97
|
+
* - **create**: the value is stamped onto the row, overriding whatever the
|
|
98
|
+
* client sent;
|
|
99
|
+
* - **update / delete**: the target row is re-read under the scope first, and
|
|
100
|
+
* the write is rejected with `403` if it isn't the caller's - otherwise
|
|
101
|
+
* guessing an id would reach across tenants.
|
|
102
|
+
*
|
|
103
|
+
* Return `null` to apply no scope (e.g. a super-admin). Throwing rejects the
|
|
104
|
+
* request, which is the safer default when a tenant cannot be resolved.
|
|
105
|
+
*/
|
|
106
|
+
scope?: (ctx: {
|
|
107
|
+
event: {
|
|
108
|
+
request: Request;
|
|
109
|
+
locals?: Record<string, unknown>;
|
|
110
|
+
};
|
|
111
|
+
}) => KitScope | null | Promise<KitScope | null>;
|
|
112
|
+
/**
|
|
113
|
+
* Optional server-side guard run BEFORE every op. Return `false` (or throw) to
|
|
114
|
+
* reject the request with `403`. Receives the SvelteKit event, so you can read
|
|
115
|
+
* `event.locals` / the session to resolve the caller's role - this is where
|
|
116
|
+
* server-enforced authorization (RBAC) lives, independent of any client UI.
|
|
117
|
+
*/
|
|
118
|
+
authorize?: (ctx: KitAuthorizeContext<TData>) => boolean | Promise<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Server-enforced validation, run BEFORE a create / update reaches the source.
|
|
121
|
+
* - `true`: validate the payload against the `schema`'s declarative constraints
|
|
122
|
+
* (required, min/max, length, pattern, email/url, per-field + cross-field
|
|
123
|
+
* rules) via `validateAll`. Updates validate only the fields present in the
|
|
124
|
+
* patch. Defect payloads are rejected with `422 { error, fieldErrors }`.
|
|
125
|
+
* - a function: your own check returning a `{ field: message }` map (non-empty
|
|
126
|
+
* -> 422).
|
|
127
|
+
* Default off, so existing routes are unchanged; the Studio generator turns it
|
|
128
|
+
* on. Enforcing here means a client that skips its form validation still can't
|
|
129
|
+
* write bad data.
|
|
130
|
+
*/
|
|
131
|
+
validate?: boolean | ((ctx: KitValidateContext<TData>) => KitFieldErrors | null | undefined | Promise<KitFieldErrors | null | undefined>);
|
|
132
|
+
/**
|
|
133
|
+
* Called AFTER a successful create / update / delete with the change details,
|
|
134
|
+
* so you can write an audit record (who / what / when). Receives the SvelteKit
|
|
135
|
+
* event for `locals` (the actor). Best-effort: a throw here is swallowed and
|
|
136
|
+
* logged, so an audit-sink hiccup never fails the underlying write.
|
|
137
|
+
*/
|
|
138
|
+
audit?: (entry: KitAuditEntry<TData>) => void | Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Business-logic lifecycle hooks, run server-side around each mutation (the
|
|
141
|
+
* Studio generator compiles a screen's visual "triggers" into these). A
|
|
142
|
+
* `before*` hook may transform the payload (return a new object) or throw to
|
|
143
|
+
* reject the write (-> `422 { error }`), so a rule enforced here holds even if
|
|
144
|
+
* the client skips it. `after*` hooks run once the write succeeds (cascades,
|
|
145
|
+
* notifications) - a throw there fails the request (`500`).
|
|
146
|
+
*/
|
|
147
|
+
hooks?: KitHooks<TData>;
|
|
148
|
+
};
|
|
149
|
+
/** The SvelteKit event slice handed to every hook (read `locals` for the actor). */
|
|
150
|
+
export type KitEvent = {
|
|
151
|
+
request: Request;
|
|
152
|
+
locals?: Record<string, unknown>;
|
|
153
|
+
};
|
|
154
|
+
/** Server-side mutation lifecycle hooks (see `KitHandlerOptions.hooks`). */
|
|
155
|
+
export type KitHooks<TData extends RowData> = {
|
|
156
|
+
beforeCreate?: (ctx: {
|
|
157
|
+
values: Partial<TData>;
|
|
158
|
+
event: KitEvent;
|
|
159
|
+
}) => Partial<TData> | void | Promise<Partial<TData> | void>;
|
|
160
|
+
afterCreate?: (ctx: {
|
|
161
|
+
row: TData;
|
|
162
|
+
event: KitEvent;
|
|
163
|
+
}) => void | Promise<void>;
|
|
164
|
+
beforeUpdate?: (ctx: {
|
|
165
|
+
id: string;
|
|
166
|
+
patch: Partial<TData>;
|
|
167
|
+
event: KitEvent;
|
|
168
|
+
}) => Partial<TData> | void | Promise<Partial<TData> | void>;
|
|
169
|
+
afterUpdate?: (ctx: {
|
|
170
|
+
id: string;
|
|
171
|
+
row: TData;
|
|
172
|
+
event: KitEvent;
|
|
173
|
+
}) => void | Promise<void>;
|
|
174
|
+
beforeDelete?: (ctx: {
|
|
175
|
+
id: string;
|
|
176
|
+
event: KitEvent;
|
|
177
|
+
}) => void | Promise<void>;
|
|
178
|
+
afterDelete?: (ctx: {
|
|
179
|
+
id: string;
|
|
180
|
+
event: KitEvent;
|
|
181
|
+
}) => void | Promise<void>;
|
|
182
|
+
};
|
|
183
|
+
/** The change details handed to the `audit` hook after a successful mutation. */
|
|
184
|
+
export type KitAuditEntry<TData extends RowData> = {
|
|
185
|
+
action: 'create' | 'update' | 'delete';
|
|
186
|
+
/** The affected row's id. */
|
|
187
|
+
id: string | null;
|
|
188
|
+
/** Submitted values: create input / update patch. Undefined for delete. */
|
|
189
|
+
values?: Partial<TData>;
|
|
190
|
+
/** The row the source returned (create / update). Undefined for delete. */
|
|
191
|
+
result?: TData;
|
|
192
|
+
event: {
|
|
193
|
+
request: Request;
|
|
194
|
+
locals?: Record<string, unknown>;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
export type KitHandlers = {
|
|
198
|
+
/** SvelteKit `+server.ts` route handler. Export it as `export const { POST } = ...`. */
|
|
199
|
+
POST: (event: {
|
|
200
|
+
request: Request;
|
|
201
|
+
locals?: Record<string, unknown>;
|
|
202
|
+
}) => Promise<Response>;
|
|
203
|
+
/** Lower-level dispatcher over a raw `Request`, for custom wiring or tests. */
|
|
204
|
+
handle: (request: Request, event?: {
|
|
205
|
+
locals?: Record<string, unknown>;
|
|
206
|
+
}) => Promise<Response>;
|
|
207
|
+
};
|
|
208
|
+
export declare function createKitHandlers<TData extends RowData>(options: KitHandlerOptions<TData>): KitHandlers;
|
|
209
|
+
export {};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { validateAll } from '../edit-panel';
|
|
2
|
+
function jsonResponse(data, status = 200) {
|
|
3
|
+
return new Response(JSON.stringify(data), {
|
|
4
|
+
status,
|
|
5
|
+
headers: { 'content-type': 'application/json' },
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
export function createKitDataSource(options) {
|
|
9
|
+
const doFetch = options.fetch ?? ((i, init) => fetch(i, init));
|
|
10
|
+
async function post(body) {
|
|
11
|
+
const res = await doFetch(options.endpoint, {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
headers: { 'content-type': 'application/json' },
|
|
14
|
+
body: JSON.stringify(body),
|
|
15
|
+
});
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
const detail = await res.text().catch(() => '');
|
|
18
|
+
throw new Error(`svgrid kit: ${res.status} ${res.statusText}${detail ? ` - ${detail}` : ''}`);
|
|
19
|
+
}
|
|
20
|
+
return (await res.json());
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
getRows: (request) => post({ kind: 'query', request }),
|
|
24
|
+
createRow: (input) => post({ kind: 'mutate', op: 'create', input }),
|
|
25
|
+
updateRow: (id, patch) => post({ kind: 'mutate', op: 'update', id, patch }),
|
|
26
|
+
deleteRow: (id) => post({ kind: 'mutate', op: 'delete', id }).then(() => undefined),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const actionOf = (msg) => msg.kind === 'query' ? 'read' : msg.op;
|
|
30
|
+
export function createKitHandlers(options) {
|
|
31
|
+
const { source, authorize, validate, audit, hooks, scope } = options;
|
|
32
|
+
const idField = options.schema.idField ?? options.schema.fields.find((f) => f.primaryKey)?.field ?? 'id';
|
|
33
|
+
const rowId = (row) => {
|
|
34
|
+
const v = row?.[idField];
|
|
35
|
+
return v == null ? null : String(v);
|
|
36
|
+
};
|
|
37
|
+
// Best-effort: never let an audit-sink error fail the write it's recording.
|
|
38
|
+
const fireAudit = async (entry) => {
|
|
39
|
+
if (!audit)
|
|
40
|
+
return;
|
|
41
|
+
try {
|
|
42
|
+
await audit(entry);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
console.error('svgrid kit: audit hook failed', err);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
async function handle(request, event) {
|
|
49
|
+
let msg;
|
|
50
|
+
try {
|
|
51
|
+
msg = (await request.json());
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return jsonResponse({ error: 'invalid JSON body' }, 400);
|
|
55
|
+
}
|
|
56
|
+
// Authorize BEFORE touching the source. A thrown guard is treated as a deny.
|
|
57
|
+
if (authorize) {
|
|
58
|
+
let allowed;
|
|
59
|
+
try {
|
|
60
|
+
allowed = await authorize({ action: actionOf(msg), event: { request, locals: event?.locals }, message: msg });
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
return jsonResponse({ error: err instanceof Error ? err.message : 'forbidden' }, 403);
|
|
64
|
+
}
|
|
65
|
+
if (!allowed)
|
|
66
|
+
return jsonResponse({ error: 'forbidden' }, 403);
|
|
67
|
+
}
|
|
68
|
+
// Validate create / update payloads BEFORE the source. 422 on field errors.
|
|
69
|
+
if (validate && msg.kind === 'mutate' && (msg.op === 'create' || msg.op === 'update')) {
|
|
70
|
+
const values = (msg.op === 'create' ? msg.input : msg.patch);
|
|
71
|
+
let errors;
|
|
72
|
+
if (validate === true) {
|
|
73
|
+
const all = await validateAll(options.schema, values);
|
|
74
|
+
// On update, only the supplied fields are validated (a patch omits the rest).
|
|
75
|
+
errors = msg.op === 'update'
|
|
76
|
+
? Object.fromEntries(Object.keys(values).filter((k) => all[k]).map((k) => [k, all[k]]))
|
|
77
|
+
: all;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
errors = await validate({ action: msg.op, values, event: { request, locals: event?.locals } });
|
|
81
|
+
}
|
|
82
|
+
if (errors && Object.keys(errors).length) {
|
|
83
|
+
return jsonResponse({ error: 'validation failed', fieldErrors: errors }, 422);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Resolve the row scope once per request. A thrown resolver is a rejection,
|
|
87
|
+
// not a 500: "I can't tell which tenant you are" must not fall through to
|
|
88
|
+
// an unscoped query.
|
|
89
|
+
let activeScope = null;
|
|
90
|
+
if (scope) {
|
|
91
|
+
try {
|
|
92
|
+
activeScope = (await scope({ event: { request, locals: event?.locals } })) ?? null;
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
return jsonResponse({ error: err instanceof Error ? err.message : 'forbidden' }, 403);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** True when `id` exists AND belongs to the caller's scope. */
|
|
99
|
+
const ownsRow = async (id) => {
|
|
100
|
+
if (!activeScope)
|
|
101
|
+
return true;
|
|
102
|
+
const idField = options.schema.idField ?? options.schema.fields.find((f) => f.primaryKey)?.field ?? 'id';
|
|
103
|
+
const { rows } = await source.getRows({
|
|
104
|
+
startRow: 0,
|
|
105
|
+
endRow: 1,
|
|
106
|
+
pageIndex: 0,
|
|
107
|
+
pageSize: 1,
|
|
108
|
+
sortModel: [],
|
|
109
|
+
filterModel: {
|
|
110
|
+
columns: {
|
|
111
|
+
[idField]: { operator: 'equals', value: id },
|
|
112
|
+
[activeScope.field]: { operator: 'equals', value: String(activeScope.value) },
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
return rows.length > 0;
|
|
117
|
+
};
|
|
118
|
+
try {
|
|
119
|
+
if (msg.kind === 'query') {
|
|
120
|
+
// Merge the scope into the requested filter. Written last so a client
|
|
121
|
+
// that sends its own `tenantId` filter cannot widen the scope.
|
|
122
|
+
const request = activeScope
|
|
123
|
+
? {
|
|
124
|
+
...msg.request,
|
|
125
|
+
filterModel: {
|
|
126
|
+
...msg.request.filterModel,
|
|
127
|
+
columns: {
|
|
128
|
+
...(msg.request.filterModel?.columns ?? {}),
|
|
129
|
+
[activeScope.field]: { operator: 'equals', value: String(activeScope.value) },
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
: msg.request;
|
|
134
|
+
const result = await source.getRows(request);
|
|
135
|
+
return jsonResponse(result);
|
|
136
|
+
}
|
|
137
|
+
if (msg.kind === 'mutate') {
|
|
138
|
+
const evt = { request, locals: event?.locals };
|
|
139
|
+
// Cross-tenant writes: reject before the source sees the id.
|
|
140
|
+
if (activeScope && (msg.op === 'update' || msg.op === 'delete')) {
|
|
141
|
+
if (!(await ownsRow(msg.id)))
|
|
142
|
+
return jsonResponse({ error: 'forbidden' }, 403);
|
|
143
|
+
}
|
|
144
|
+
// A `before*` hook throwing is a business-rule rejection -> 422 (not a 500).
|
|
145
|
+
const runBefore = async (fn) => {
|
|
146
|
+
try {
|
|
147
|
+
return await fn();
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
return jsonResponse({ error: err instanceof Error ? err.message : 'rejected' }, 422);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
if (msg.op === 'create') {
|
|
154
|
+
if (!source.createRow)
|
|
155
|
+
return jsonResponse({ error: 'create not supported' }, 405);
|
|
156
|
+
let input = msg.input;
|
|
157
|
+
if (hooks?.beforeCreate) {
|
|
158
|
+
const r = await runBefore(() => Promise.resolve(hooks.beforeCreate({ values: input, event: evt })));
|
|
159
|
+
if (r instanceof Response)
|
|
160
|
+
return r;
|
|
161
|
+
if (r)
|
|
162
|
+
input = r;
|
|
163
|
+
}
|
|
164
|
+
// Stamp the scope LAST - after the before-hook - so neither the client
|
|
165
|
+
// nor a business rule can write a row into another tenant.
|
|
166
|
+
if (activeScope)
|
|
167
|
+
input = { ...input, [activeScope.field]: activeScope.value };
|
|
168
|
+
const row = await source.createRow(input);
|
|
169
|
+
if (hooks?.afterCreate)
|
|
170
|
+
await hooks.afterCreate({ row, event: evt });
|
|
171
|
+
await fireAudit({ action: 'create', id: rowId(row), values: input, result: row, event: evt });
|
|
172
|
+
return jsonResponse(row);
|
|
173
|
+
}
|
|
174
|
+
if (msg.op === 'update') {
|
|
175
|
+
if (!source.updateRow)
|
|
176
|
+
return jsonResponse({ error: 'update not supported' }, 405);
|
|
177
|
+
let patch = msg.patch;
|
|
178
|
+
if (hooks?.beforeUpdate) {
|
|
179
|
+
const r = await runBefore(() => Promise.resolve(hooks.beforeUpdate({ id: msg.id, patch, event: evt })));
|
|
180
|
+
if (r instanceof Response)
|
|
181
|
+
return r;
|
|
182
|
+
if (r)
|
|
183
|
+
patch = r;
|
|
184
|
+
}
|
|
185
|
+
// A patch must not be able to hand the row to another tenant.
|
|
186
|
+
if (activeScope)
|
|
187
|
+
patch = { ...patch, [activeScope.field]: activeScope.value };
|
|
188
|
+
const row = await source.updateRow(msg.id, patch);
|
|
189
|
+
if (hooks?.afterUpdate)
|
|
190
|
+
await hooks.afterUpdate({ id: msg.id, row, event: evt });
|
|
191
|
+
await fireAudit({ action: 'update', id: msg.id, values: patch, result: row, event: evt });
|
|
192
|
+
return jsonResponse(row);
|
|
193
|
+
}
|
|
194
|
+
if (msg.op === 'delete') {
|
|
195
|
+
if (!source.deleteRow)
|
|
196
|
+
return jsonResponse({ error: 'delete not supported' }, 405);
|
|
197
|
+
if (hooks?.beforeDelete) {
|
|
198
|
+
const r = await runBefore(() => Promise.resolve(hooks.beforeDelete({ id: msg.id, event: evt })));
|
|
199
|
+
if (r instanceof Response)
|
|
200
|
+
return r;
|
|
201
|
+
}
|
|
202
|
+
await source.deleteRow(msg.id);
|
|
203
|
+
if (hooks?.afterDelete)
|
|
204
|
+
await hooks.afterDelete({ id: msg.id, event: evt });
|
|
205
|
+
await fireAudit({ action: 'delete', id: msg.id, event: evt });
|
|
206
|
+
return jsonResponse({ ok: true });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return jsonResponse({ error: 'unknown message kind' }, 400);
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
return jsonResponse({ error: err instanceof Error ? err.message : String(err) }, 500);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
handle,
|
|
217
|
+
POST: (event) => handle(event.request, event),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type { RowData, ServerDataSource } from '@svgrid/grid'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export type WritableDataSource<TData extends RowData> = Required<
|
|
10
|
-
Pick<ServerDataSource<TData>, 'getRows' | 'createRow' | 'updateRow' | 'deleteRow'>
|
|
11
|
-
>
|
|
1
|
+
import type { RowData, ServerDataSource } from '@svgrid/grid';
|
|
2
|
+
/**
|
|
3
|
+
* A `ServerDataSource` that implements the full CRUD contract - the optional
|
|
4
|
+
* `createRow` / `updateRow` / `deleteRow` are required here. Sources that
|
|
5
|
+
* always support writes (the in-memory reference source, the SvelteKit client)
|
|
6
|
+
* return this so callers get the methods without a null check.
|
|
7
|
+
*/
|
|
8
|
+
export type WritableDataSource<TData extends RowData> = Required<Pick<ServerDataSource<TData>, 'getRows' | 'createRow' | 'updateRow' | 'deleteRow'>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Human-readable labels for the Pro surfaces that gate behind a license. */
|
|
2
|
+
export type EnterpriseFeatureLabel = 'Export' | 'Import' | 'Print' | 'AI assistant' | 'Pivot' | 'Studio';
|
|
3
|
+
/**
|
|
4
|
+
* Show the contextual upgrade prompt for `feature`. No-ops if one has already
|
|
5
|
+
* been shown this session, a card is already up, or we're on the server. Safe
|
|
6
|
+
* to call on every Pro feature invocation - it self-throttles.
|
|
7
|
+
*/
|
|
8
|
+
export declare function showUpgradePrompt(feature?: EnterpriseFeatureLabel | string, opts?: {
|
|
9
|
+
expired?: boolean;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* Remove the card if present and re-arm the once-per-session flag so a later
|
|
13
|
+
* `showUpgradePrompt()` can show again. Mainly for hosts that want to control
|
|
14
|
+
* the nudge themselves (and for tests).
|
|
15
|
+
*/
|
|
16
|
+
export declare function dismissUpgradePrompt(): void;
|