zitejs 0.10.0-start.3 → 0.10.0-start.30
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/cjs/auth/actions.d.ts +28 -0
- package/dist/cjs/auth/actions.js +93 -0
- package/dist/cjs/auth/client.d.ts +357 -0
- package/dist/cjs/auth/client.js +66 -0
- package/dist/cjs/auth/config.js +9 -3
- package/dist/cjs/auth/index.d.ts +2 -249
- package/dist/cjs/auth/index.js +11 -108
- package/dist/cjs/auth/index.test.js +60 -0
- package/dist/cjs/auth/previewClaim.d.ts +7 -0
- package/dist/cjs/auth/previewClaim.js +16 -0
- package/dist/cjs/auth/profileUpdates.d.ts +9 -0
- package/dist/cjs/auth/profileUpdates.js +11 -0
- package/dist/cjs/backend/index.d.ts +123 -5
- package/dist/cjs/backend/index.js +13 -13
- package/dist/cjs/backend/index.test.js +144 -86
- package/dist/cjs/bundle/index.d.ts +8 -0
- package/dist/cjs/bundle/index.js +38 -24
- package/dist/cjs/caller/index.js +43 -43
- package/dist/cjs/check/index.d.ts +44 -1
- package/dist/cjs/check/index.js +188 -113
- package/dist/cjs/check/start/routeTree.d.ts +8 -0
- package/dist/cjs/check/start/routeTree.js +118 -0
- package/dist/cjs/check/start/tsgo.d.ts +2 -0
- package/dist/cjs/check/start/tsgo.js +35 -0
- package/dist/cjs/cli.js +10 -4
- package/dist/cjs/client/index.d.ts +26 -2
- package/dist/cjs/client/index.js +25 -25
- package/dist/cjs/dev/index.js +79 -54
- package/dist/cjs/dev/signin.d.ts +16 -0
- package/dist/cjs/dev/signin.js +84 -0
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/integrations/client.d.ts +3 -3
- package/dist/cjs/integrations/client.js +5 -4
- package/dist/cjs/integrations/client.test-d.js +15 -15
- package/dist/cjs/integrations/index.d.ts +2 -2
- package/dist/cjs/integrations/rules.d.ts +14 -0
- package/dist/cjs/integrations/rules.js +67 -33
- package/dist/cjs/integrations/rules.test.js +60 -53
- package/dist/cjs/internal/appMode.d.ts +14 -0
- package/dist/cjs/internal/appMode.js +19 -0
- package/dist/cjs/internal/env.js +3 -2
- package/dist/cjs/internal/platformFetch.d.ts +2 -0
- package/dist/cjs/internal/platformFetch.js +14 -0
- package/dist/cjs/internal/reservedIds.d.ts +8 -0
- package/dist/cjs/internal/reservedIds.js +14 -0
- package/dist/cjs/internal/serviceUrls.d.ts +5 -0
- package/dist/cjs/internal/serviceUrls.js +14 -0
- package/dist/cjs/pdf/index.js +2 -1
- package/dist/cjs/runtime/filterConditionTypes.test-d.js +11 -11
- package/dist/cjs/runtime/index.d.ts +126 -39
- package/dist/cjs/runtime/index.js +32 -26
- package/dist/cjs/runtime/index.test.js +34 -34
- package/dist/cjs/runtime/sendEmailParamsTypes.test-d.js +50 -0
- package/dist/cjs/runtime/writeResultTypes.test-d.js +8 -8
- package/dist/cjs/sourceRoots.js +15 -15
- package/dist/cjs/sourceRoots.test.js +29 -27
- package/dist/cjs/start/{entries.d.ts → build/entries.d.ts} +13 -4
- package/dist/cjs/start/{entries.js → build/entries.js} +49 -21
- package/dist/cjs/start/build/placeholders/devApp.d.ts +1 -0
- package/dist/cjs/start/build/placeholders/devApp.js +6 -0
- package/dist/{esm/start → cjs/start/describe}/describeBuilt.d.ts +2 -0
- package/dist/cjs/start/{describeBuilt.js → describe/describeBuilt.js} +55 -17
- package/dist/cjs/start/platform/aiUsage.d.ts +29 -0
- package/dist/cjs/start/platform/aiUsage.js +215 -0
- package/dist/cjs/start/platform/airtable/cache.d.ts +17 -0
- package/dist/cjs/start/platform/airtable/cache.js +93 -0
- package/dist/cjs/start/protocol.d.ts +19 -0
- package/dist/cjs/start/protocol.js +33 -0
- package/dist/cjs/start/serve/local/provider.d.ts +25 -0
- package/dist/cjs/start/serve/local/provider.js +196 -0
- package/dist/cjs/start/serve/provider.d.ts +19 -0
- package/dist/cjs/start/serve/provider.js +86 -0
- package/dist/cjs/start/types.d.ts +373 -0
- package/dist/cjs/start/types.js +2 -0
- package/dist/cjs/steps/index.d.ts +78 -0
- package/dist/cjs/steps/index.js +507 -0
- package/dist/cjs/steps/index.test.d.ts +1 -0
- package/dist/cjs/steps/index.test.js +635 -0
- package/dist/cjs/sync/index.d.ts +1 -1
- package/dist/cjs/sync/index.js +28 -27
- package/dist/cjs/sync/lib.d.ts +15 -8
- package/dist/cjs/sync/lib.js +660 -663
- package/dist/cjs/sync/lib.test.js +177 -46
- package/dist/cjs/sync/sdkNames.d.ts +67 -9
- package/dist/cjs/sync/sdkNames.js +97 -31
- package/dist/cjs/sync/sdkNames.test.js +189 -113
- package/dist/cjs/types/fields.d.ts +9 -2
- package/dist/cjs/types/fields.js +110 -96
- package/dist/cjs/types/index.d.ts +2 -2
- package/dist/cjs/types/tables.d.ts +17 -1
- package/dist/cjs/upload/index.js +89 -24
- package/dist/cjs/upload/index.test.js +104 -1
- package/dist/cjs/vite/domTagNames.js +252 -252
- package/dist/cjs/vite/index.d.ts +1 -1
- package/dist/cjs/vite/index.js +51 -42
- package/dist/cjs/vite/index.test.js +10 -2
- package/dist/esm/auth/actions.d.ts +28 -0
- package/dist/esm/auth/actions.js +55 -0
- package/dist/esm/auth/client.d.ts +357 -0
- package/dist/esm/auth/client.js +62 -0
- package/dist/esm/auth/config.js +9 -3
- package/dist/esm/auth/index.d.ts +2 -249
- package/dist/esm/auth/index.js +2 -103
- package/dist/esm/auth/index.test.js +60 -0
- package/dist/esm/auth/previewClaim.d.ts +7 -0
- package/dist/esm/auth/previewClaim.js +12 -0
- package/dist/esm/auth/profileUpdates.d.ts +9 -0
- package/dist/esm/auth/profileUpdates.js +6 -0
- package/dist/esm/backend/index.d.ts +123 -5
- package/dist/esm/backend/index.js +13 -13
- package/dist/esm/backend/index.test.js +148 -90
- package/dist/esm/bundle/index.d.ts +8 -0
- package/dist/esm/bundle/index.js +37 -24
- package/dist/esm/caller/index.js +44 -44
- package/dist/esm/check/index.d.ts +44 -1
- package/dist/esm/check/index.js +187 -116
- package/dist/esm/check/start/routeTree.d.ts +8 -0
- package/dist/esm/check/start/routeTree.js +77 -0
- package/dist/esm/check/start/tsgo.d.ts +2 -0
- package/dist/esm/check/start/tsgo.js +29 -0
- package/dist/esm/cli.js +10 -4
- package/dist/esm/client/index.d.ts +26 -2
- package/dist/esm/client/index.js +25 -25
- package/dist/esm/dev/index.js +86 -61
- package/dist/esm/dev/signin.d.ts +16 -0
- package/dist/esm/dev/signin.js +80 -0
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +3 -3
- package/dist/esm/integrations/client.d.ts +3 -3
- package/dist/esm/integrations/client.js +6 -5
- package/dist/esm/integrations/client.test-d.js +19 -19
- package/dist/esm/integrations/index.d.ts +2 -2
- package/dist/esm/integrations/index.js +1 -1
- package/dist/esm/integrations/rules.d.ts +14 -0
- package/dist/esm/integrations/rules.js +67 -33
- package/dist/esm/integrations/rules.test.js +62 -55
- package/dist/esm/internal/appMode.d.ts +14 -0
- package/dist/esm/internal/appMode.js +13 -0
- package/dist/esm/internal/env.js +3 -2
- package/dist/esm/internal/platformFetch.d.ts +2 -0
- package/dist/esm/internal/platformFetch.js +9 -0
- package/dist/esm/internal/reservedIds.d.ts +8 -0
- package/dist/esm/internal/reservedIds.js +10 -0
- package/dist/esm/internal/serviceUrls.d.ts +5 -0
- package/dist/esm/internal/serviceUrls.js +10 -0
- package/dist/esm/pdf/index.js +2 -1
- package/dist/esm/runtime/filterConditionTypes.test-d.js +12 -12
- package/dist/esm/runtime/index.d.ts +126 -39
- package/dist/esm/runtime/index.js +35 -29
- package/dist/esm/runtime/index.test.js +36 -36
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +48 -0
- package/dist/esm/runtime/writeResultTypes.test-d.js +9 -9
- package/dist/esm/signin/conformance.d.ts +100 -0
- package/dist/esm/signin/conformance.js +616 -0
- package/dist/esm/signin/cookies.d.ts +28 -0
- package/dist/esm/signin/cookies.js +67 -0
- package/dist/esm/signin/encoding.d.ts +1 -0
- package/dist/esm/signin/encoding.js +12 -0
- package/dist/esm/signin/endpoints.d.ts +12 -0
- package/dist/esm/signin/endpoints.js +32 -0
- package/dist/esm/signin/http.d.ts +25 -0
- package/dist/esm/signin/http.js +106 -0
- package/dist/esm/signin/index.d.ts +8 -0
- package/dist/esm/signin/index.js +9 -0
- package/dist/esm/signin/keys.d.ts +35 -0
- package/dist/esm/signin/keys.js +230 -0
- package/dist/esm/signin/paths.d.ts +2 -0
- package/dist/esm/signin/paths.js +5 -0
- package/dist/esm/signin/seal.d.ts +19 -0
- package/dist/esm/signin/seal.js +47 -0
- package/dist/esm/signin/signin.d.ts +60 -0
- package/dist/esm/signin/signin.js +447 -0
- package/dist/esm/signin/transport.d.ts +112 -0
- package/dist/esm/signin/transport.js +1 -0
- package/dist/esm/signin/verifier.d.ts +2 -0
- package/dist/esm/signin/verifier.js +4 -0
- package/dist/esm/signin/verify.d.ts +83 -0
- package/dist/esm/signin/verify.js +142 -0
- package/dist/esm/sourceRoots.js +17 -17
- package/dist/esm/sourceRoots.test.js +34 -32
- package/dist/esm/start/access.d.ts +19 -0
- package/dist/esm/start/access.js +43 -0
- package/dist/esm/start/auth.d.ts +28 -0
- package/dist/esm/start/auth.js +33 -0
- package/dist/esm/start/automations/quiet.d.ts +2 -0
- package/dist/esm/start/automations/quiet.js +36 -0
- package/dist/esm/start/automations/registration.d.ts +13 -0
- package/dist/esm/start/automations/registration.js +25 -0
- package/dist/esm/start/automations/steps.d.ts +29 -0
- package/dist/esm/start/automations/steps.js +95 -0
- package/dist/esm/start/automations/workflow.d.ts +83 -0
- package/dist/esm/start/automations/workflow.js +36 -0
- package/dist/esm/start/automations/workflow.test-d.d.ts +1 -0
- package/dist/esm/start/automations/workflow.test-d.js +130 -0
- package/dist/esm/start/automations/workflowRun.d.ts +130 -0
- package/dist/esm/start/automations/workflowRun.js +185 -0
- package/dist/esm/start/barrel.test-d.d.ts +10 -0
- package/dist/esm/start/barrel.test-d.js +6 -0
- package/dist/esm/start/{entries.d.ts → build/entries.d.ts} +13 -4
- package/dist/esm/start/build/entries.js +109 -0
- package/dist/esm/start/build/placeholders/authHooksModule.d.ts +1 -0
- package/dist/esm/start/build/placeholders/authHooksModule.js +3 -0
- package/dist/esm/start/build/placeholders/devApp.d.ts +1 -0
- package/dist/esm/start/build/placeholders/devApp.js +3 -0
- package/dist/esm/start/build/placeholders/devSignIn.d.ts +1 -0
- package/dist/esm/start/build/placeholders/devSignIn.js +3 -0
- package/dist/esm/start/build/placeholders/siteHead.d.ts +2 -0
- package/dist/esm/start/build/placeholders/siteHead.js +3 -0
- package/dist/esm/start/{workflowModules.js → build/placeholders/workflowModules.js} +1 -1
- package/dist/esm/start/build/placeholders/workspaceSchema.d.ts +2 -0
- package/dist/esm/start/build/placeholders/workspaceSchema.js +3 -0
- package/dist/esm/start/build/registrationHash.d.ts +11 -0
- package/dist/esm/start/build/registrationHash.js +88 -0
- package/dist/esm/start/build/sdk/axios.d.ts +76 -0
- package/dist/esm/start/build/sdk/axios.js +253 -0
- package/dist/esm/start/build/sdk/nodeFetch.d.ts +41 -0
- package/dist/esm/start/build/sdk/nodeFetch.js +35 -0
- package/dist/esm/start/build/sdk/undici.d.ts +34 -0
- package/dist/esm/start/build/sdk/undici.js +18 -0
- package/dist/esm/start/build/sdkPatches.d.ts +22 -0
- package/dist/esm/start/build/sdkPatches.js +430 -0
- package/dist/esm/start/build/siteHead.d.ts +26 -0
- package/dist/esm/start/build/siteHead.js +88 -0
- package/dist/esm/start/build/vite.d.ts +50 -0
- package/dist/esm/start/build/vite.js +487 -0
- package/dist/esm/start/classicOnly.d.ts +1 -0
- package/dist/esm/start/classicOnly.js +4 -0
- package/dist/esm/start/clientErrorMessage.test.d.ts +1 -0
- package/dist/esm/start/clientErrorMessage.test.js +105 -0
- package/dist/esm/start/describe/describe.d.ts +120 -0
- package/dist/esm/start/describe/describe.js +372 -0
- package/dist/{cjs/start → esm/start/describe}/describeBuilt.d.ts +2 -0
- package/dist/esm/start/describe/describeBuilt.js +102 -0
- package/dist/esm/start/{descriptions.js → describe/descriptions.js} +17 -10
- package/dist/esm/start/errors.d.ts +62 -0
- package/dist/esm/start/errors.js +163 -0
- package/dist/esm/start/errors.test.d.ts +1 -0
- package/dist/esm/start/errors.test.js +54 -0
- package/dist/esm/start/factories.d.ts +14 -0
- package/dist/esm/start/factories.js +23 -0
- package/dist/esm/start/factories.test-d.d.ts +2 -0
- package/dist/esm/start/factories.test-d.js +60 -0
- package/dist/esm/start/failures.d.ts +7 -0
- package/dist/esm/start/failures.js +62 -0
- package/dist/esm/start/fnFactory.d.ts +16 -0
- package/dist/esm/start/fnFactory.js +1 -0
- package/dist/esm/start/host.d.ts +2 -2
- package/dist/esm/start/host.js +3 -3
- package/dist/esm/start/index.d.ts +10 -70
- package/dist/esm/start/index.js +7 -152
- package/dist/esm/start/login.d.ts +5 -0
- package/dist/esm/start/login.js +29 -0
- package/dist/esm/start/middlewareKind.d.ts +13 -0
- package/dist/esm/start/middlewareKind.js +9 -0
- package/dist/esm/start/platform/aiUsage.d.ts +29 -0
- package/dist/esm/start/platform/aiUsage.js +210 -0
- package/dist/esm/start/platform/airtable/arrayFields.d.ts +10 -0
- package/dist/esm/start/platform/airtable/arrayFields.js +30 -0
- package/dist/esm/start/platform/airtable/built.d.ts +2 -0
- package/dist/esm/start/platform/airtable/built.js +3 -0
- package/dist/esm/start/platform/airtable/cache.d.ts +17 -0
- package/dist/esm/start/platform/airtable/cache.js +89 -0
- package/dist/esm/start/platform/airtable/dispatch.d.ts +57 -0
- package/dist/esm/start/platform/airtable/dispatch.js +541 -0
- package/dist/esm/start/platform/airtable/formulas.d.ts +70 -0
- package/dist/esm/start/platform/airtable/formulas.js +261 -0
- package/dist/esm/start/platform/airtable/index.d.ts +6 -0
- package/dist/esm/start/platform/airtable/index.js +51 -0
- package/dist/esm/start/platform/airtable/settings.d.ts +37 -0
- package/dist/esm/start/platform/airtable/settings.js +138 -0
- package/dist/esm/start/platform/analytics.d.ts +3 -0
- package/dist/esm/start/platform/analytics.js +59 -0
- package/dist/esm/start/platform/calls.d.ts +5 -0
- package/dist/esm/start/platform/calls.js +104 -0
- package/dist/esm/start/platform/caps.d.ts +9 -0
- package/dist/esm/start/platform/caps.js +35 -0
- package/dist/esm/start/platform/connections.d.ts +25 -0
- package/dist/esm/start/platform/connections.js +198 -0
- package/dist/esm/start/platform/data/baseRunner.d.ts +97 -0
- package/dist/esm/start/platform/data/baseRunner.js +117 -0
- package/dist/esm/start/platform/data/dispatch.d.ts +17 -0
- package/dist/esm/start/platform/data/dispatch.js +216 -0
- package/dist/esm/start/platform/data/fetch.d.ts +7 -0
- package/dist/esm/start/platform/data/fetch.js +9 -0
- package/dist/esm/start/platform/data/index.d.ts +27 -0
- package/dist/esm/start/platform/data/index.js +75 -0
- package/dist/esm/start/platform/data/names.d.ts +7 -0
- package/dist/esm/start/platform/data/names.js +18 -0
- package/dist/esm/start/platform/data/sqlNameMappings.d.ts +58 -0
- package/dist/esm/start/platform/data/sqlNameMappings.js +92 -0
- package/dist/esm/start/platform/data/transformations.d.ts +97 -0
- package/dist/esm/start/platform/data/transformations.js +262 -0
- package/dist/esm/start/platform/data/types.d.ts +94 -0
- package/dist/esm/start/platform/data/types.js +14 -0
- package/dist/esm/start/platform/local.d.ts +6 -0
- package/dist/esm/start/platform/local.js +18 -0
- package/dist/esm/start/platform/meta.d.ts +3 -0
- package/dist/esm/start/platform/meta.js +33 -0
- package/dist/esm/start/platform/outbound.d.ts +17 -0
- package/dist/esm/start/platform/outbound.js +510 -0
- package/dist/esm/start/platform/redactSecrets.d.ts +13 -0
- package/dist/esm/start/platform/redactSecrets.js +156 -0
- package/dist/esm/start/platform/redactSecrets.test.d.ts +1 -0
- package/dist/esm/start/platform/redactSecrets.test.js +151 -0
- package/dist/esm/start/platform/requestSecrets.d.ts +15 -0
- package/dist/esm/start/platform/requestSecrets.js +41 -0
- package/dist/esm/start/platform/runLog.d.ts +40 -0
- package/dist/esm/start/platform/runLog.js +149 -0
- package/dist/esm/start/platform/services.d.ts +7 -0
- package/dist/esm/start/platform/services.js +46 -0
- package/dist/esm/start/platform/steps.d.ts +9 -0
- package/dist/esm/start/platform/steps.js +60 -0
- package/dist/esm/start/platform/telemetry.d.ts +13 -0
- package/dist/esm/start/platform/telemetry.js +71 -0
- package/dist/esm/start/platform/transport.d.ts +28 -0
- package/dist/esm/start/platform/transport.js +59 -0
- package/dist/esm/start/platformHead.d.ts +23 -0
- package/dist/esm/start/platformHead.js +133 -0
- package/dist/esm/start/previewClaim.d.ts +6 -0
- package/dist/esm/start/previewClaim.js +24 -0
- package/dist/esm/start/protocol.d.ts +19 -0
- package/dist/esm/start/protocol.js +27 -0
- package/dist/esm/start/roles.d.ts +12 -0
- package/dist/esm/start/roles.js +27 -0
- package/dist/esm/start/router.d.ts +33 -6
- package/dist/esm/start/router.js +259 -16
- package/dist/esm/start/serve/authHooks.d.ts +7 -0
- package/dist/esm/start/serve/authHooks.js +18 -0
- package/dist/esm/start/serve/demo.d.ts +9 -0
- package/dist/esm/start/serve/demo.js +24 -0
- package/dist/esm/start/serve/fetch.d.ts +1 -0
- package/dist/esm/start/serve/fetch.js +6 -0
- package/dist/esm/start/{instance.d.ts → serve/instance.d.ts} +7 -7
- package/dist/esm/start/serve/instance.js +134 -0
- package/dist/esm/start/serve/invoke.d.ts +13 -0
- package/dist/esm/start/serve/invoke.js +126 -0
- package/dist/esm/start/serve/local/load.d.ts +8 -0
- package/dist/esm/start/serve/local/load.js +44 -0
- package/dist/esm/start/serve/local/provider.d.ts +25 -0
- package/dist/esm/start/serve/local/provider.js +188 -0
- package/dist/esm/start/serve/local/signIn.d.ts +28 -0
- package/dist/esm/start/serve/local/signIn.js +123 -0
- package/dist/esm/start/serve/pageHead.d.ts +20 -0
- package/dist/esm/start/serve/pageHead.js +34 -0
- package/dist/esm/start/serve/provider.d.ts +19 -0
- package/dist/esm/start/serve/provider.js +78 -0
- package/dist/esm/start/serve/requestEnv.d.ts +2 -0
- package/dist/esm/start/serve/requestEnv.js +84 -0
- package/dist/esm/start/serve/scope.d.ts +18 -0
- package/dist/esm/start/serve/scope.js +67 -0
- package/dist/esm/start/serve/server.d.ts +56 -0
- package/dist/esm/start/serve/server.js +297 -0
- package/dist/esm/start/serve/uploads.d.ts +2 -0
- package/dist/esm/start/serve/uploads.js +49 -0
- package/dist/esm/start/serve/worker.d.ts +6 -0
- package/dist/esm/start/serve/worker.js +12 -0
- package/dist/esm/start/types.d.ts +316 -24
- package/dist/esm/start/version.d.ts +1 -0
- package/dist/esm/start/version.js +2 -0
- package/dist/esm/steps/index.d.ts +78 -0
- package/dist/esm/steps/index.js +502 -0
- package/dist/esm/steps/index.test.d.ts +1 -0
- package/dist/esm/steps/index.test.js +633 -0
- package/dist/esm/sync/index.d.ts +1 -1
- package/dist/esm/sync/index.js +32 -31
- package/dist/esm/sync/lib.d.ts +15 -8
- package/dist/esm/sync/lib.js +664 -667
- package/dist/esm/sync/lib.test.js +177 -46
- package/dist/esm/sync/sdkNames.d.ts +67 -9
- package/dist/esm/sync/sdkNames.js +94 -30
- package/dist/esm/sync/sdkNames.test.js +192 -116
- package/dist/esm/types/fields.d.ts +9 -2
- package/dist/esm/types/fields.js +110 -96
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/types/index.js +2 -2
- package/dist/esm/types/tables.d.ts +17 -1
- package/dist/esm/types/tables.js +2 -2
- package/dist/esm/upload/index.js +89 -24
- package/dist/esm/upload/index.test.js +104 -1
- package/dist/esm/vite/domTagNames.js +252 -252
- package/dist/esm/vite/index.d.ts +1 -1
- package/dist/esm/vite/index.js +56 -47
- package/dist/esm/vite/index.test.js +10 -2
- package/package.json +111 -40
- package/dist/cjs/auth-server/index.d.ts +0 -369
- package/dist/cjs/auth-server/index.js +0 -119
- package/dist/cjs/start/problems.d.ts +0 -19
- package/dist/cjs/start/problems.js +0 -11
- package/dist/esm/auth-server/index.d.ts +0 -369
- package/dist/esm/auth-server/index.js +0 -116
- package/dist/esm/start/describe.d.ts +0 -56
- package/dist/esm/start/describe.js +0 -147
- package/dist/esm/start/describeBuilt.js +0 -66
- package/dist/esm/start/entries.js +0 -82
- package/dist/esm/start/instance.js +0 -73
- package/dist/esm/start/problems.d.ts +0 -19
- package/dist/esm/start/problems.js +0 -8
- package/dist/esm/start/runLog.d.ts +0 -5
- package/dist/esm/start/runLog.js +0 -18
- package/dist/esm/start/scope.d.ts +0 -15
- package/dist/esm/start/scope.js +0 -58
- package/dist/esm/start/server.d.ts +0 -37
- package/dist/esm/start/server.js +0 -159
- package/dist/esm/start/vite.d.ts +0 -9
- package/dist/esm/start/vite.js +0 -143
- package/dist/esm/start/workflow.d.ts +0 -36
- package/dist/esm/start/workflow.js +0 -13
- package/dist/esm/start/workflow.test-d.js +0 -24
- package/dist/esm/start/workflowRun.d.ts +0 -80
- package/dist/esm/start/workflowRun.js +0 -107
- /package/dist/{esm/start/workflow.test-d.d.ts → cjs/runtime/sendEmailParamsTypes.test-d.d.ts} +0 -0
- /package/dist/esm/start/{workflowModules.d.ts → build/placeholders/workflowModules.d.ts} +0 -0
- /package/dist/esm/start/{descriptions.d.ts → describe/descriptions.d.ts} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// The platform's own requests on the request's app token. A request with no token or platform URLs reaches nothing: the
|
|
2
|
+
// host dispatches every request with both, and `local` mints its own.
|
|
3
|
+
import { platformFetch } from '../../internal/platformFetch.js';
|
|
4
|
+
import { DEMO_UNAVAILABLE_MESSAGE } from './data/dispatch.js';
|
|
5
|
+
const BACKEND_TIMEOUT_MS = 5_000;
|
|
6
|
+
export class PlatformError extends Error {
|
|
7
|
+
route;
|
|
8
|
+
status;
|
|
9
|
+
constructor(route, status) {
|
|
10
|
+
super(`${route} answered ${status}`);
|
|
11
|
+
this.route = route;
|
|
12
|
+
this.status = status;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** Thrown for a platform call on a request that has no token or no platform URLs. */
|
|
16
|
+
export class NoPlatformError extends Error {
|
|
17
|
+
constructor() {
|
|
18
|
+
super("This request has no app token or platform URLs: Zite didn't dispatch it");
|
|
19
|
+
this.name = 'NoPlatformError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** What a demo's call is refused with when it would act on the author's live app. */
|
|
23
|
+
export const DEMO_REFUSED = {
|
|
24
|
+
error: { code: 'FORBIDDEN', message: DEMO_UNAVAILABLE_MESSAGE },
|
|
25
|
+
};
|
|
26
|
+
/** The request's token and where to send it, renewed first if it's about to expire; undefined without either. */
|
|
27
|
+
export const directAccess = async (host) => {
|
|
28
|
+
const urls = host.provider?.urls;
|
|
29
|
+
const token = urls ? await host.provider?.token() : undefined;
|
|
30
|
+
return urls && token ? { token, urls } : undefined;
|
|
31
|
+
};
|
|
32
|
+
/** As `directAccess`, failing loudly without a token or URLs. */
|
|
33
|
+
export const requireAccess = async (host) => {
|
|
34
|
+
const access = await directAccess(host);
|
|
35
|
+
if (!access)
|
|
36
|
+
throw new NoPlatformError();
|
|
37
|
+
return access;
|
|
38
|
+
};
|
|
39
|
+
/** One request to the platform as JSON, on the token. */
|
|
40
|
+
export const sendOnToken = (token, url, init) => platformFetch(new Request(url, {
|
|
41
|
+
method: init.method,
|
|
42
|
+
headers: {
|
|
43
|
+
authorization: `Bearer ${token}`,
|
|
44
|
+
'content-type': 'application/json',
|
|
45
|
+
},
|
|
46
|
+
body: init.body,
|
|
47
|
+
...(init.timeoutMs && { signal: AbortSignal.timeout(init.timeoutMs) }),
|
|
48
|
+
}));
|
|
49
|
+
export const platformJson = async (access, method, url, route, body) => {
|
|
50
|
+
const response = await sendOnToken(access.token, url, {
|
|
51
|
+
method,
|
|
52
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
53
|
+
timeoutMs: BACKEND_TIMEOUT_MS,
|
|
54
|
+
});
|
|
55
|
+
if (!response.ok)
|
|
56
|
+
throw new PlatformError(route, response.status);
|
|
57
|
+
return (await response.json());
|
|
58
|
+
};
|
|
59
|
+
export const backendJson = (access, method, path, body) => platformJson(access, method, `${access.urls.backend}/v1/start/app${path}`, path, body);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { PlatformHead } from './types.js';
|
|
3
|
+
type Meta = JSX.IntrinsicElements['meta'];
|
|
4
|
+
type Link = JSX.IntrinsicElements['link'];
|
|
5
|
+
type Script = JSX.IntrinsicElements['script'];
|
|
6
|
+
/** What a route's `head()` answers, as TanStack's React router types it. */
|
|
7
|
+
export type RouteHead = {
|
|
8
|
+
meta?: Array<Meta | undefined>;
|
|
9
|
+
links?: Array<Link | undefined>;
|
|
10
|
+
scripts?: Array<Script | undefined>;
|
|
11
|
+
styles?: Array<JSX.IntrinsicElements['style'] | undefined>;
|
|
12
|
+
};
|
|
13
|
+
/** Where an installable app's web manifest is served. */
|
|
14
|
+
export declare const MANIFEST_PATH = "/manifest.webmanifest";
|
|
15
|
+
/** @internal Takes in what the page carried. */
|
|
16
|
+
export declare const keepHydratedHead: (head: PlatformHead | undefined) => void;
|
|
17
|
+
/**
|
|
18
|
+
* @internal The root route's head: the app's Settings first, as the site-wide default for its title, description and
|
|
19
|
+
* share tags, which `own` (the root's own entries) and any page's head() can set their own of. The platform's favicon,
|
|
20
|
+
* manifest and installable-app tags and its scripts come with them, and nothing of the app's replaces those.
|
|
21
|
+
*/
|
|
22
|
+
export declare const withPlatformHead: (own?: RouteHead) => RouteHead;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { currentHost } from './host.js';
|
|
2
|
+
/** Where an installable app's web manifest is served. */
|
|
3
|
+
export const MANIFEST_PATH = '/manifest.webmanifest';
|
|
4
|
+
// The browser's, from the page it hydrated; the server's is the request's own.
|
|
5
|
+
let hydrated;
|
|
6
|
+
/** @internal Takes in what the page carried. */
|
|
7
|
+
export const keepHydratedHead = (head) => {
|
|
8
|
+
hydrated = head;
|
|
9
|
+
};
|
|
10
|
+
const PWA_METAS = new Set([
|
|
11
|
+
'theme-color',
|
|
12
|
+
'mobile-web-app-capable',
|
|
13
|
+
'apple-mobile-web-app-capable',
|
|
14
|
+
'apple-mobile-web-app-title',
|
|
15
|
+
]);
|
|
16
|
+
const PLATFORM_SCRIPTS = [
|
|
17
|
+
'data-zite-branding',
|
|
18
|
+
'data-zite-analytics',
|
|
19
|
+
'data-zite-demo',
|
|
20
|
+
];
|
|
21
|
+
// Safe inside a <script>: nothing in it can close the tag.
|
|
22
|
+
const scriptJson = (value) => JSON.stringify(value).replace(/</g, '\\u003c');
|
|
23
|
+
const metaKey = (meta) => meta?.name ?? meta?.property;
|
|
24
|
+
const rels = (link) => (link?.rel ?? '').toLowerCase().split(/\s+/);
|
|
25
|
+
// Only the platform writes these, each marked so a copy in the app's own head can be told apart.
|
|
26
|
+
const platformScript = (marker, children) => ({
|
|
27
|
+
...{ [marker]: 'true' },
|
|
28
|
+
children,
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* @internal The root route's head: the app's Settings first, as the site-wide default for its title, description and
|
|
32
|
+
* share tags, which `own` (the root's own entries) and any page's head() can set their own of. The platform's favicon,
|
|
33
|
+
* manifest and installable-app tags and its scripts come with them, and nothing of the app's replaces those.
|
|
34
|
+
*/
|
|
35
|
+
export const withPlatformHead = (own = {}) => {
|
|
36
|
+
const head = typeof window === 'undefined' ? currentHost()?.head : hydrated;
|
|
37
|
+
if (!head)
|
|
38
|
+
return own;
|
|
39
|
+
const { site, platform } = head;
|
|
40
|
+
const appleTouchIcon = site.appleTouchIcon ?? site.icon;
|
|
41
|
+
const shared = site.title !== undefined ||
|
|
42
|
+
site.description !== undefined ||
|
|
43
|
+
site.image !== undefined;
|
|
44
|
+
const meta = [
|
|
45
|
+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
46
|
+
...(site.title !== undefined
|
|
47
|
+
? [
|
|
48
|
+
{ title: site.title },
|
|
49
|
+
{ property: 'og:title', content: site.title },
|
|
50
|
+
{ property: 'og:site_name', content: site.title || 'Zite' },
|
|
51
|
+
{ name: 'twitter:title', content: site.title },
|
|
52
|
+
]
|
|
53
|
+
: []),
|
|
54
|
+
...(site.description !== undefined
|
|
55
|
+
? [
|
|
56
|
+
{ name: 'description', content: site.description },
|
|
57
|
+
{ property: 'og:description', content: site.description },
|
|
58
|
+
{ name: 'twitter:description', content: site.description },
|
|
59
|
+
]
|
|
60
|
+
: []),
|
|
61
|
+
...(shared
|
|
62
|
+
? [
|
|
63
|
+
{ property: 'og:type', content: 'website' },
|
|
64
|
+
{ name: 'twitter:card', content: 'summary_large_image' },
|
|
65
|
+
]
|
|
66
|
+
: []),
|
|
67
|
+
...(site.image
|
|
68
|
+
? [
|
|
69
|
+
{ property: 'og:image', content: site.image },
|
|
70
|
+
{ name: 'twitter:image', content: site.image },
|
|
71
|
+
]
|
|
72
|
+
: []),
|
|
73
|
+
...(site.manifest
|
|
74
|
+
? [
|
|
75
|
+
{ name: 'theme-color', content: site.manifest.theme_color },
|
|
76
|
+
{ name: 'mobile-web-app-capable', content: 'yes' },
|
|
77
|
+
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
|
78
|
+
{
|
|
79
|
+
name: 'apple-mobile-web-app-title',
|
|
80
|
+
content: site.manifest.short_name,
|
|
81
|
+
},
|
|
82
|
+
]
|
|
83
|
+
: []),
|
|
84
|
+
];
|
|
85
|
+
const links = [
|
|
86
|
+
...(site.icon
|
|
87
|
+
? [{ rel: 'icon', type: 'image/x-icon', href: site.icon }]
|
|
88
|
+
: []),
|
|
89
|
+
...(appleTouchIcon
|
|
90
|
+
? [{ rel: 'apple-touch-icon', href: appleTouchIcon }]
|
|
91
|
+
: []),
|
|
92
|
+
...(site.manifest
|
|
93
|
+
? [
|
|
94
|
+
{
|
|
95
|
+
rel: 'manifest',
|
|
96
|
+
href: MANIFEST_PATH,
|
|
97
|
+
crossOrigin: 'use-credentials',
|
|
98
|
+
},
|
|
99
|
+
]
|
|
100
|
+
: []),
|
|
101
|
+
];
|
|
102
|
+
// The demo's listing before the runtime, whose demo bridge reads it as it starts.
|
|
103
|
+
const scripts = platform
|
|
104
|
+
? [
|
|
105
|
+
...(platform.demo
|
|
106
|
+
? [
|
|
107
|
+
platformScript('data-zite-demo', `window.__ziteDemo = ${scriptJson(platform.demo)};`),
|
|
108
|
+
]
|
|
109
|
+
: []),
|
|
110
|
+
...(platform.runtimeUrl ? [{ src: platform.runtimeUrl }] : []),
|
|
111
|
+
platformScript('data-zite-branding', `window.__ziteBranding = ${platform.branding};`),
|
|
112
|
+
platformScript('data-zite-analytics', `window.__ziteAnalytics = ${scriptJson(platform.analytics)};`),
|
|
113
|
+
]
|
|
114
|
+
: [];
|
|
115
|
+
const kept = (rel) => (rel === 'icon' && !!site.icon) ||
|
|
116
|
+
(rel === 'apple-touch-icon' && !!appleTouchIcon) ||
|
|
117
|
+
(rel === 'manifest' && !!site.manifest);
|
|
118
|
+
return {
|
|
119
|
+
...own,
|
|
120
|
+
meta: [
|
|
121
|
+
...meta,
|
|
122
|
+
...(own.meta ?? []).filter(entry => !(site.manifest && PWA_METAS.has(metaKey(entry) ?? ''))),
|
|
123
|
+
],
|
|
124
|
+
links: [
|
|
125
|
+
...links,
|
|
126
|
+
...(own.links ?? []).filter(link => !rels(link).some(kept)),
|
|
127
|
+
],
|
|
128
|
+
scripts: [
|
|
129
|
+
...scripts,
|
|
130
|
+
...(own.scripts ?? []).filter(script => !PLATFORM_SCRIPTS.some(marker => script && marker in script)),
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PREVIEW_CLAIM_PARAM } from '../auth/previewClaim.js';
|
|
2
|
+
export { PREVIEW_CLAIM_PARAM };
|
|
3
|
+
/** An editor preview's access: on the server the host hands it over, in the browser it's on the URL. */
|
|
4
|
+
export declare const previewClaim: () => string | undefined;
|
|
5
|
+
/** Every same-origin fetch from the page carries the claim: server functions and the app's own routes alike. */
|
|
6
|
+
export declare const carryPreviewClaim: (claim: string) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { browserPreviewClaim, PREVIEW_CLAIM_PARAM, } from '../auth/previewClaim.js';
|
|
2
|
+
import { currentHost } from './host.js';
|
|
3
|
+
import { PREVIEW_CLAIM_HEADER } from './protocol.js';
|
|
4
|
+
export { PREVIEW_CLAIM_PARAM };
|
|
5
|
+
/** An editor preview's access: on the server the host hands it over, in the browser it's on the URL. */
|
|
6
|
+
export const previewClaim = () => typeof window === 'undefined'
|
|
7
|
+
? currentHost()?.previewClaim
|
|
8
|
+
: browserPreviewClaim();
|
|
9
|
+
let carrying = false;
|
|
10
|
+
/** Every same-origin fetch from the page carries the claim: server functions and the app's own routes alike. */
|
|
11
|
+
export const carryPreviewClaim = (claim) => {
|
|
12
|
+
if (carrying || typeof window === 'undefined')
|
|
13
|
+
return;
|
|
14
|
+
carrying = true;
|
|
15
|
+
const original = window.fetch.bind(window);
|
|
16
|
+
window.fetch = (input, init) => {
|
|
17
|
+
const target = new URL(input instanceof Request ? input.url : String(input), window.location.href);
|
|
18
|
+
if (target.origin !== window.location.origin)
|
|
19
|
+
return original(input, init);
|
|
20
|
+
const headers = new Headers(init?.headers ?? (input instanceof Request ? input.headers : undefined));
|
|
21
|
+
headers.set(PREVIEW_CLAIM_HEADER, claim);
|
|
22
|
+
return original(input, { ...init, headers });
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { isReservedIntegrationId, RESERVED_INTEGRATION_IDS, } from '../internal/reservedIds.js';
|
|
2
|
+
export type { AppContext, ExpiringToken, HostConnection, HostMode, HostPage, HostProps, PlatformBinding, SiteHead, WebManifest, } from './types.js';
|
|
3
|
+
/** What the host dispatches a request to do beside serving it; without props, only `warm` and `describe`. */
|
|
4
|
+
export declare const INVOKE_KINDS: readonly ["webhook", "describe", "workflow", "register", "warm", "authHook", "function"];
|
|
5
|
+
export type InvokeKind = (typeof INVOKE_KINDS)[number];
|
|
6
|
+
export declare const isInvokeKind: (kind: unknown) => kind is InvokeKind;
|
|
7
|
+
/** `warm` or `describe`, on a request the host sends without props. */
|
|
8
|
+
export declare const INVOKE_HEADER = "x-zite-invoke";
|
|
9
|
+
/** Where the host POSTs a workflow, registration, auth hook or test run, with `{ input }`. */
|
|
10
|
+
export declare const INVOKE_PATH = "/_zite/invoke";
|
|
11
|
+
/** On describe's answer: the zitejs the build's server code was bundled from. */
|
|
12
|
+
export declare const RUNTIME_VERSION_HEADER = "x-zitejs-version";
|
|
13
|
+
/** An editor preview's access, on every same-origin fetch its pages make. */
|
|
14
|
+
export declare const PREVIEW_CLAIM_HEADER = "x-zite-preview";
|
|
15
|
+
/** At the gateway, the connection a call on Zite's AI key bills to. */
|
|
16
|
+
export declare const GATEWAY_CONNECTION_HEADER = "x-zite-gateway-connection";
|
|
17
|
+
/** On a demo's refused answer, beside its 403, so the platform's runtime shows the demo notice. */
|
|
18
|
+
export declare const ERROR_CODE_HEADER = "x-zite-error-code";
|
|
19
|
+
export declare const DEMO_READ_ONLY_CODE = "DEMO_READ_ONLY";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// What a Start build and the platform's host say to each other on the wire. Import-free but for the reserved ids,
|
|
2
|
+
// themselves import-free, so the host takes these without loading anything of zitejs.
|
|
3
|
+
export { isReservedIntegrationId, RESERVED_INTEGRATION_IDS, } from '../internal/reservedIds.js';
|
|
4
|
+
/** What the host dispatches a request to do beside serving it; without props, only `warm` and `describe`. */
|
|
5
|
+
export const INVOKE_KINDS = [
|
|
6
|
+
'webhook',
|
|
7
|
+
'describe',
|
|
8
|
+
'workflow',
|
|
9
|
+
'register',
|
|
10
|
+
'warm',
|
|
11
|
+
'authHook',
|
|
12
|
+
'function',
|
|
13
|
+
];
|
|
14
|
+
export const isInvokeKind = (kind) => INVOKE_KINDS.includes(kind);
|
|
15
|
+
/** `warm` or `describe`, on a request the host sends without props. */
|
|
16
|
+
export const INVOKE_HEADER = 'x-zite-invoke';
|
|
17
|
+
/** Where the host POSTs a workflow, registration, auth hook or test run, with `{ input }`. */
|
|
18
|
+
export const INVOKE_PATH = '/_zite/invoke';
|
|
19
|
+
/** On describe's answer: the zitejs the build's server code was bundled from. */
|
|
20
|
+
export const RUNTIME_VERSION_HEADER = 'x-zitejs-version';
|
|
21
|
+
/** An editor preview's access, on every same-origin fetch its pages make. */
|
|
22
|
+
export const PREVIEW_CLAIM_HEADER = 'x-zite-preview';
|
|
23
|
+
/** At the gateway, the connection a call on Zite's AI key bills to. */
|
|
24
|
+
export const GATEWAY_CONNECTION_HEADER = 'x-zite-gateway-connection';
|
|
25
|
+
/** On a demo's refused answer, beside its 403, so the platform's runtime shows the demo notice. */
|
|
26
|
+
export const ERROR_CODE_HEADER = 'x-zite-error-code';
|
|
27
|
+
export const DEMO_READ_ONLY_CODE = 'DEMO_READ_ONLY';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { User } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* By the role's id, as classic's does: a role's name can change. Takes the user, or a context carrying one as
|
|
4
|
+
* classic's `hasRole(context, id)` does; signed out, no one has a role.
|
|
5
|
+
*/
|
|
6
|
+
export declare const hasRole: (who: User | {
|
|
7
|
+
user: User | null;
|
|
8
|
+
} | null | undefined, roleId: string) => boolean;
|
|
9
|
+
/** Signed-in users with this role, by its id. */
|
|
10
|
+
export declare const role: (id: string) => import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, readonly [import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, undefined, {
|
|
11
|
+
user: User;
|
|
12
|
+
}>], undefined>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createMiddleware } from '@tanstack/react-start';
|
|
2
|
+
import { signedIn } from './access.js';
|
|
3
|
+
import { ZiteError } from './errors.js';
|
|
4
|
+
import { withStatus } from './failures.js';
|
|
5
|
+
import { tag } from './middlewareKind.js';
|
|
6
|
+
/**
|
|
7
|
+
* By the role's id, as classic's does: a role's name can change. Takes the user, or a context carrying one as
|
|
8
|
+
* classic's `hasRole(context, id)` does; signed out, no one has a role.
|
|
9
|
+
*/
|
|
10
|
+
export const hasRole = (who, roleId) => {
|
|
11
|
+
const user = who && 'user' in who ? who.user : who;
|
|
12
|
+
return user?.roles.some(({ id }) => id === roleId) ?? false;
|
|
13
|
+
};
|
|
14
|
+
/** Signed-in users with this role, by its id. */
|
|
15
|
+
export const role = (id) => tag(createMiddleware()
|
|
16
|
+
.middleware([signedIn])
|
|
17
|
+
.server(({ next, context, serverFnMeta }) => withStatus(!!serverFnMeta, async () => {
|
|
18
|
+
if (!hasRole(context.user, id)) {
|
|
19
|
+
// A role's id means nothing to the app's users; the editor still reads which one.
|
|
20
|
+
throw new ZiteError({
|
|
21
|
+
code: 'FORBIDDEN',
|
|
22
|
+
message: `Requires the ${id} role`,
|
|
23
|
+
userFacingMessage: "You don't have access to this.",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return next();
|
|
27
|
+
})), { kind: 'role', role: id });
|
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { type AnyRoute, type RouterConstructorOptions, type RouterHistory } from '@tanstack/react-router';
|
|
3
|
+
import { type ProfileChanges } from '../auth/profileUpdates.js';
|
|
4
|
+
import type { HostMode, PlatformHead, User } from './types.js';
|
|
5
|
+
export declare const QUERY_STALE_TIME_MS = 30000;
|
|
3
6
|
/** The router context every Zite app's root route declares: `createRootRouteWithContext<ZiteRouterContext>()`. */
|
|
4
7
|
export type ZiteRouterContext = {
|
|
5
8
|
user: User | null;
|
|
9
|
+
queryClient: QueryClient;
|
|
6
10
|
};
|
|
7
11
|
type Dehydrated = {
|
|
8
12
|
user: User | null;
|
|
13
|
+
mode?: HostMode;
|
|
14
|
+
head?: PlatformHead;
|
|
9
15
|
};
|
|
10
|
-
type ZiteRouterOptions<TRouteTree extends AnyRoute> = Omit<RouterConstructorOptions<TRouteTree, "never", false, RouterHistory, Dehydrated>, "context" | "dehydrate" | "hydrate">;
|
|
11
16
|
/**
|
|
12
|
-
*
|
|
13
|
-
* the
|
|
14
|
-
|
|
17
|
+
* @internal What a page carries to the browser beside its queries: the signed-in user, the mode it was served in, and
|
|
18
|
+
* the platform's head entries, which the browser renders again as it navigates.
|
|
19
|
+
*/
|
|
20
|
+
export declare const dehydrateZite: (context: ZiteRouterContext) => Dehydrated;
|
|
21
|
+
/** @internal The user after a profile edit, named as the host names them: first and last name, else the email. */
|
|
22
|
+
export declare const withProfile: (user: User, changes: ProfileChanges) => User;
|
|
23
|
+
/** @internal In the browser: `updateProfile` from zitejs/auth updates the router's user and reruns its guards and loaders. */
|
|
24
|
+
export declare const refreshOnProfileUpdate: (router: {
|
|
25
|
+
invalidate: () => Promise<void>;
|
|
26
|
+
}, context: ZiteRouterContext) => void;
|
|
27
|
+
/** @internal Takes in what the page carried. */
|
|
28
|
+
export declare const hydrateZite: (context: ZiteRouterContext, dehydrated: Dehydrated) => void;
|
|
29
|
+
type ZiteRouterOptions<TRouteTree extends AnyRoute> = Omit<RouterConstructorOptions<TRouteTree, 'never', false, RouterHistory, Dehydrated>, 'context' | 'dehydrate' | 'hydrate'>;
|
|
30
|
+
/**
|
|
31
|
+
* @internal Tells the editor's preview the page crashed, as classic's runtime reports an emptied #root: a Start page
|
|
32
|
+
* has none, and an error a route's boundary catches is the crash. Being signed out isn't one.
|
|
33
|
+
*/
|
|
34
|
+
export declare const reportCrash: (error: unknown) => void;
|
|
35
|
+
/**
|
|
36
|
+
* The router for `src/router.tsx`. The signed-in user is in `context.user`: on the server from the platform, in the
|
|
37
|
+
* browser from the page it rendered, so no request asks for it again. `context.queryClient` is new for each request
|
|
38
|
+
* on the server, so a page never renders with another visitor's cached queries, and its queries reach the browser
|
|
39
|
+
* with the page.
|
|
15
40
|
*/
|
|
16
41
|
export declare function createZiteRouter<TRouteTree extends AnyRoute>(options: ZiteRouterOptions<TRouteTree>): import("@tanstack/router-core").RouterCore<TRouteTree, "never", false, RouterHistory, Dehydrated>;
|
|
42
|
+
/** @internal Whether createZiteRouter built it: describe refuses a router file whose router it didn't. */
|
|
43
|
+
export declare const isZiteRouter: (router: unknown) => boolean;
|
|
17
44
|
export {};
|