zitejs 0.10.0-start.9 → 0.10.1-device.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/cjs/auth/actions.d.ts +28 -0
- package/dist/cjs/auth/actions.js +95 -0
- package/dist/cjs/auth/client.d.ts +357 -0
- package/dist/cjs/auth/client.js +71 -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/auth/useAuth.test.js +1 -0
- package/dist/cjs/backend/index.d.ts +15 -9
- package/dist/cjs/backend/index.js +13 -13
- package/dist/cjs/backend/index.test.js +102 -102
- package/dist/cjs/bundle/index.d.ts +8 -0
- package/dist/cjs/bundle/index.js +38 -24
- package/dist/cjs/caller/index.js +37 -48
- package/dist/cjs/check/index.d.ts +20 -9
- package/dist/cjs/check/index.js +113 -88
- 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 +1 -0
- package/dist/cjs/integrations/rules.js +48 -43
- package/dist/cjs/integrations/rules.test.js +60 -54
- package/dist/cjs/internal/appMode.d.ts +14 -0
- package/dist/cjs/internal/appMode.js +19 -0
- package/dist/cjs/internal/browserMode.d.ts +2 -0
- package/dist/cjs/internal/browserMode.js +18 -0
- package/dist/cjs/internal/deviceCache.d.ts +11 -0
- package/dist/cjs/internal/deviceCache.js +29 -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/query/deviceCache.d.ts +14 -0
- package/dist/cjs/query/deviceCache.js +304 -0
- package/dist/cjs/query/index.d.ts +19 -0
- package/dist/cjs/query/index.js +369 -0
- 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} +9 -4
- package/dist/cjs/start/{entries.js → build/entries.js} +38 -21
- package/dist/cjs/start/build/placeholders/devApp.d.ts +1 -0
- package/dist/cjs/start/build/placeholders/devApp.js +6 -0
- package/dist/cjs/start/{describeBuilt.d.ts → 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.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 +655 -655
- 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 +87 -42
- package/dist/cjs/vite/index.test.js +36 -0
- package/dist/esm/auth/actions.d.ts +28 -0
- package/dist/esm/auth/actions.js +57 -0
- package/dist/esm/auth/client.d.ts +357 -0
- package/dist/esm/auth/client.js +67 -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/auth/useAuth.test.js +1 -0
- package/dist/esm/backend/index.d.ts +15 -9
- package/dist/esm/backend/index.js +13 -13
- package/dist/esm/backend/index.test.js +106 -106
- package/dist/esm/bundle/index.d.ts +8 -0
- package/dist/esm/bundle/index.js +37 -24
- package/dist/esm/caller/index.js +37 -48
- package/dist/esm/check/index.d.ts +20 -9
- package/dist/esm/check/index.js +117 -93
- 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 +1 -0
- package/dist/esm/integrations/rules.js +48 -43
- package/dist/esm/integrations/rules.test.js +62 -56
- package/dist/esm/internal/appMode.d.ts +14 -0
- package/dist/esm/internal/appMode.js +13 -0
- package/dist/esm/internal/browserMode.d.ts +2 -0
- package/dist/esm/internal/browserMode.js +15 -0
- package/dist/esm/internal/deviceCache.d.ts +11 -0
- package/dist/esm/internal/deviceCache.js +24 -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/query/deviceCache.d.ts +14 -0
- package/dist/esm/query/deviceCache.js +301 -0
- package/dist/esm/query/index.d.ts +19 -0
- package/dist/esm/query/index.js +366 -0
- 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/{registration.d.ts → automations/registration.d.ts} +1 -1
- package/dist/esm/start/{registration.js → automations/registration.js} +11 -7
- 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} +9 -4
- package/dist/esm/start/{entries.js → build/entries.js} +38 -22
- 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 +491 -0
- package/dist/esm/start/classicOnly.d.ts +1 -0
- package/dist/esm/start/classicOnly.js +4 -0
- package/dist/esm/start/{describe.d.ts → describe/describe.d.ts} +44 -9
- package/dist/esm/start/describe/describe.js +372 -0
- package/dist/esm/start/{describeBuilt.d.ts → 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 +15 -4
- package/dist/esm/start/errors.js +87 -28
- package/dist/esm/start/errors.test.js +47 -16
- 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 -1
- package/dist/esm/start/factories.test-d.js +52 -12
- 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 -66
- package/dist/esm/start/index.js +7 -146
- 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/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/{airtable → platform/airtable}/dispatch.d.ts +5 -2
- package/dist/esm/start/{airtable → platform/airtable}/dispatch.js +195 -119
- package/dist/esm/start/{airtable → platform/airtable}/formulas.d.ts +2 -1
- package/dist/esm/start/{airtable → platform/airtable}/formulas.js +51 -25
- 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/{data → platform/data}/baseRunner.d.ts +11 -6
- package/dist/esm/start/platform/data/baseRunner.js +117 -0
- package/dist/esm/start/{data → platform/data}/dispatch.d.ts +3 -2
- package/dist/esm/start/{data → platform/data}/dispatch.js +69 -51
- 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/{data → platform/data}/transformations.d.ts +0 -31
- package/dist/esm/start/{data → platform/data}/transformations.js +0 -56
- package/dist/esm/start/{data → platform/data}/types.d.ts +4 -1
- package/dist/esm/start/{data → platform/data}/types.js +2 -2
- 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/{redactSecrets.js → platform/redactSecrets.js} +32 -7
- package/dist/esm/start/platform/redactSecrets.test.d.ts +1 -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 +3 -7
- package/dist/esm/start/previewClaim.js +9 -17
- 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 +27 -4
- package/dist/esm/start/router.js +221 -22
- 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} +6 -5
- 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 +270 -56
- package/dist/esm/start/version.d.ts +1 -1
- package/dist/esm/start/version.js +1 -1
- 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 +659 -659
- 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 +92 -47
- package/dist/esm/vite/index.test.js +36 -0
- package/package.json +106 -38
- package/dist/cjs/auth-server/index.d.ts +0 -369
- package/dist/cjs/auth-server/index.js +0 -119
- package/dist/cjs/check/start/describeRules.d.ts +0 -35
- package/dist/cjs/check/start/describeRules.js +0 -89
- package/dist/cjs/check/start/problem.d.ts +0 -11
- package/dist/cjs/check/start/problem.js +0 -5
- package/dist/cjs/check/start/sourceRules.d.ts +0 -3
- package/dist/cjs/check/start/sourceRules.js +0 -441
- 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/check/start/describeRules.d.ts +0 -35
- package/dist/esm/check/start/describeRules.js +0 -86
- package/dist/esm/check/start/problem.d.ts +0 -11
- package/dist/esm/check/start/problem.js +0 -1
- package/dist/esm/check/start/sourceRules.d.ts +0 -3
- package/dist/esm/check/start/sourceRules.js +0 -438
- package/dist/esm/start/airtable/index.d.ts +0 -11
- package/dist/esm/start/airtable/index.js +0 -70
- package/dist/esm/start/authHooks.js +0 -10
- package/dist/esm/start/data/baseRunner.js +0 -83
- package/dist/esm/start/data/index.d.ts +0 -18
- package/dist/esm/start/data/index.js +0 -76
- package/dist/esm/start/describe.js +0 -204
- package/dist/esm/start/describeBuilt.js +0 -66
- package/dist/esm/start/instance.js +0 -80
- package/dist/esm/start/problems.d.ts +0 -19
- package/dist/esm/start/problems.js +0 -8
- package/dist/esm/start/redactSecrets.d.ts +0 -7
- package/dist/esm/start/runLog.d.ts +0 -8
- package/dist/esm/start/runLog.js +0 -76
- 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 -55
- package/dist/esm/start/server.js +0 -317
- package/dist/esm/start/vite.d.ts +0 -9
- package/dist/esm/start/vite.js +0 -173
- package/dist/esm/start/worker.d.ts +0 -11
- package/dist/esm/start/worker.js +0 -20
- package/dist/esm/start/workflow.d.ts +0 -53
- package/dist/esm/start/workflow.js +0 -13
- package/dist/esm/start/workflow.test-d.js +0 -44
- package/dist/esm/start/workflowRun.d.ts +0 -80
- package/dist/esm/start/workflowRun.js +0 -108
- /package/dist/{esm/start/redactSecrets.test.d.ts → cjs/runtime/sendEmailParamsTypes.test-d.d.ts} +0 -0
- /package/dist/{esm/start/workflow.test-d.d.ts → cjs/steps/index.test.d.ts} +0 -0
- /package/dist/esm/start/{authHooksModule.d.ts → build/placeholders/authHooksModule.d.ts} +0 -0
- /package/dist/esm/start/{authHooksModule.js → build/placeholders/authHooksModule.js} +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
- /package/dist/esm/start/{airtable → platform/airtable}/arrayFields.d.ts +0 -0
- /package/dist/esm/start/{airtable → platform/airtable}/arrayFields.js +0 -0
- /package/dist/esm/start/{data → platform/data}/sqlNameMappings.d.ts +0 -0
- /package/dist/esm/start/{data → platform/data}/sqlNameMappings.js +0 -0
- /package/dist/esm/start/{redactSecrets.test.js → platform/redactSecrets.test.js} +0 -0
- /package/dist/esm/start/{authHooks.d.ts → serve/authHooks.d.ts} +0 -0
package/dist/cjs/vite/index.js
CHANGED
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ziteId = ziteId;
|
|
7
7
|
const parser_1 = require("@babel/parser");
|
|
8
8
|
const magic_string_1 = __importDefault(require("magic-string"));
|
|
9
|
+
const fs_1 = require("fs");
|
|
9
10
|
const path_1 = __importDefault(require("path"));
|
|
10
11
|
const estree_walker_1 = require("estree-walker");
|
|
11
12
|
const domTagNames_js_1 = require("./domTagNames.js");
|
|
12
|
-
const validExtensions = new Set([
|
|
13
|
-
const fragmentNames = new Set([
|
|
13
|
+
const validExtensions = new Set(['.jsx', '.tsx']);
|
|
14
|
+
const fragmentNames = new Set(['Fragment', 'React.Fragment']);
|
|
14
15
|
// react-three-fiber reads a dashed prop as a path into the three.js object, so
|
|
15
16
|
// any data-zite-* prop that reaches one throws. Components from the three
|
|
16
17
|
// ecosystem (drei, react-spring's `animated`) spread their props onto three
|
|
@@ -18,20 +19,20 @@ const fragmentNames = new Set(["Fragment", "React.Fragment"]);
|
|
|
18
19
|
// component is only tagged where it is known to render DOM: under a DOM
|
|
19
20
|
// element or drei's <Html>. In files that import the three ecosystem, a JSX
|
|
20
21
|
// tree's root is not assumed to be DOM, since scene components live there.
|
|
21
|
-
const threeIntrinsicDomNames = new Set([
|
|
22
|
+
const threeIntrinsicDomNames = new Set(['audio', 'line', 'path', 'source']);
|
|
22
23
|
function isThreeModule(source) {
|
|
23
|
-
return
|
|
24
|
+
return source.startsWith('@react-three/') || source === '@react-spring/three';
|
|
24
25
|
}
|
|
25
26
|
/** Local binding name -> imported name ("*" for a namespace import). */
|
|
26
27
|
function getThreeImports(ast) {
|
|
27
28
|
const imports = new Map();
|
|
28
29
|
for (const statement of ast.program.body) {
|
|
29
|
-
if (statement.type ===
|
|
30
|
+
if (statement.type === 'ImportDeclaration' &&
|
|
30
31
|
isThreeModule(statement.source.value)) {
|
|
31
32
|
for (const specifier of statement.specifiers) {
|
|
32
|
-
imports.set(specifier.local.name, specifier.type ===
|
|
33
|
-
? specifier.imported.name ?? specifier.imported.value
|
|
34
|
-
:
|
|
33
|
+
imports.set(specifier.local.name, specifier.type === 'ImportSpecifier'
|
|
34
|
+
? (specifier.imported.name ?? specifier.imported.value)
|
|
35
|
+
: '*');
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -39,18 +40,18 @@ function getThreeImports(ast) {
|
|
|
39
40
|
}
|
|
40
41
|
/** The three-ecosystem name an element refers to, if it comes from one. */
|
|
41
42
|
function getThreeName(componentName, threeImports) {
|
|
42
|
-
const segments = componentName.split(
|
|
43
|
+
const segments = componentName.split('.');
|
|
43
44
|
const imported = threeImports.get(segments[0]);
|
|
44
45
|
if (imported === undefined) {
|
|
45
46
|
return null;
|
|
46
47
|
}
|
|
47
|
-
return imported ===
|
|
48
|
+
return imported === '*' ? segments[segments.length - 1] : imported;
|
|
48
49
|
}
|
|
49
50
|
function getComponentName(elementName) {
|
|
50
|
-
if (elementName.type ===
|
|
51
|
+
if (elementName.type === 'JSXIdentifier') {
|
|
51
52
|
return elementName.name;
|
|
52
53
|
}
|
|
53
|
-
if (elementName.type ===
|
|
54
|
+
if (elementName.type === 'JSXMemberExpression') {
|
|
54
55
|
const object = getComponentName(elementName.object);
|
|
55
56
|
const property = elementName.property.name;
|
|
56
57
|
return object ? `${object}.${property}` : property;
|
|
@@ -61,96 +62,140 @@ function classifyElement(name) {
|
|
|
61
62
|
if (fragmentNames.has(name)) {
|
|
62
63
|
return null;
|
|
63
64
|
}
|
|
64
|
-
if (!/^[a-z]/.test(name) || name.includes(
|
|
65
|
-
return
|
|
65
|
+
if (!/^[a-z]/.test(name) || name.includes('.')) {
|
|
66
|
+
return 'component';
|
|
66
67
|
}
|
|
67
|
-
if (domTagNames_js_1.domTagNames.has(name) || name.includes(
|
|
68
|
-
return
|
|
68
|
+
if (domTagNames_js_1.domTagNames.has(name) || name.includes('-')) {
|
|
69
|
+
return 'dom';
|
|
69
70
|
}
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* What zitejs/query needs to keep data on the device, in a built page: an id
|
|
75
|
+
* for this build, so data an older build saved is never shown, and the app's
|
|
76
|
+
* `deviceCache` from `zite.config.json` beside the vite config. Only `"disk"`
|
|
77
|
+
* keeps anything: an app that hasn't chosen, or whose config can't be read,
|
|
78
|
+
* keeps nothing.
|
|
79
|
+
*/
|
|
80
|
+
const deviceCacheTags = (appDir, build) => {
|
|
81
|
+
let deviceCache;
|
|
82
|
+
try {
|
|
83
|
+
deviceCache = JSON.parse((0, fs_1.readFileSync)(path_1.default.join(appDir, 'zite.config.json'), 'utf8')).deviceCache;
|
|
84
|
+
}
|
|
85
|
+
catch { }
|
|
86
|
+
return [
|
|
87
|
+
{ tag: 'meta', attrs: { name: 'zite-build', content: build } },
|
|
88
|
+
...(deviceCache === 'disk'
|
|
89
|
+
? []
|
|
90
|
+
: [
|
|
91
|
+
{
|
|
92
|
+
tag: 'meta',
|
|
93
|
+
attrs: { name: 'zite-device-cache', content: 'memory' },
|
|
94
|
+
},
|
|
95
|
+
]),
|
|
96
|
+
];
|
|
97
|
+
};
|
|
72
98
|
function ziteId() {
|
|
73
99
|
const cwd = process.cwd();
|
|
100
|
+
let appDir = cwd;
|
|
101
|
+
let building = false;
|
|
102
|
+
// One per build, shared by every page of it.
|
|
103
|
+
const build = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
74
104
|
return {
|
|
75
|
-
name:
|
|
76
|
-
enforce:
|
|
105
|
+
name: 'vite-plugin-zite-id',
|
|
106
|
+
enforce: 'pre',
|
|
107
|
+
configResolved(config) {
|
|
108
|
+
// Beside the vite config, as the app's own config reads zite.config.json:
|
|
109
|
+
// the build's cwd isn't always the app's directory.
|
|
110
|
+
appDir = config.configFile
|
|
111
|
+
? path_1.default.dirname(config.configFile)
|
|
112
|
+
: config.root;
|
|
113
|
+
building = config.command === 'build';
|
|
114
|
+
},
|
|
115
|
+
transformIndexHtml() {
|
|
116
|
+
return building ? deviceCacheTags(appDir, build) : [];
|
|
117
|
+
},
|
|
77
118
|
async transform(code, id) {
|
|
78
119
|
// TanStack's route code splitting moves a route's component into its own module, `route.tsx?tsr-split=…`.
|
|
79
|
-
const file = id.split(
|
|
80
|
-
if (!validExtensions.has(path_1.default.extname(file)) ||
|
|
120
|
+
const file = id.split('?')[0];
|
|
121
|
+
if (!validExtensions.has(path_1.default.extname(file)) ||
|
|
122
|
+
file.includes('node_modules')) {
|
|
81
123
|
return null;
|
|
82
124
|
}
|
|
83
125
|
const relativePath = path_1.default.relative(cwd, file);
|
|
84
126
|
try {
|
|
85
127
|
const ast = (0, parser_1.parse)(code, {
|
|
86
|
-
sourceType:
|
|
87
|
-
plugins: [
|
|
128
|
+
sourceType: 'module',
|
|
129
|
+
plugins: ['jsx', 'typescript'],
|
|
88
130
|
});
|
|
89
131
|
const magicString = new magic_string_1.default(code);
|
|
90
132
|
const threeImports = getThreeImports(ast);
|
|
91
|
-
const rootContext = threeImports.size > 0 ?
|
|
133
|
+
const rootContext = threeImports.size > 0 ? 'unknown' : 'dom';
|
|
92
134
|
// The render context each open JSXElement gives its children.
|
|
93
135
|
const contextStack = [];
|
|
94
136
|
(0, estree_walker_1.walk)(ast, {
|
|
95
137
|
leave(_node) {
|
|
96
|
-
if (_node.type ===
|
|
138
|
+
if (_node.type === 'JSXElement') {
|
|
97
139
|
contextStack.pop();
|
|
98
140
|
}
|
|
99
141
|
},
|
|
100
142
|
enter(_node) {
|
|
101
143
|
const node = _node;
|
|
102
|
-
if (node.type ===
|
|
144
|
+
if (node.type === 'JSXElement') {
|
|
103
145
|
const openingElement = node.openingElement;
|
|
104
146
|
const children = node.children;
|
|
105
147
|
const context = contextStack[contextStack.length - 1] ?? rootContext;
|
|
106
148
|
const componentName = getComponentName(openingElement.name);
|
|
107
|
-
const kind = componentName
|
|
149
|
+
const kind = componentName
|
|
150
|
+
? classifyElement(componentName)
|
|
151
|
+
: null;
|
|
108
152
|
const threeName = componentName
|
|
109
153
|
? getThreeName(componentName, threeImports)
|
|
110
154
|
: null;
|
|
111
155
|
let childContext = context;
|
|
112
|
-
if (threeName ===
|
|
113
|
-
childContext =
|
|
156
|
+
if (threeName === 'Html') {
|
|
157
|
+
childContext = 'dom';
|
|
114
158
|
}
|
|
115
159
|
else if (threeName !== null) {
|
|
116
|
-
childContext =
|
|
160
|
+
childContext = 'scene';
|
|
117
161
|
}
|
|
118
|
-
else if (kind ===
|
|
119
|
-
childContext =
|
|
162
|
+
else if (kind === 'dom') {
|
|
163
|
+
childContext = 'dom';
|
|
120
164
|
}
|
|
121
165
|
else if (componentName &&
|
|
122
166
|
kind === null &&
|
|
123
167
|
!fragmentNames.has(componentName)) {
|
|
124
|
-
childContext =
|
|
168
|
+
childContext = 'scene';
|
|
125
169
|
}
|
|
126
170
|
contextStack.push(childContext);
|
|
127
171
|
if (!componentName || !kind) {
|
|
128
172
|
return;
|
|
129
173
|
}
|
|
130
|
-
const isTagged = kind ===
|
|
131
|
-
? threeName ===
|
|
132
|
-
(threeName === null && context ===
|
|
174
|
+
const isTagged = kind === 'component'
|
|
175
|
+
? threeName === 'Canvas' ||
|
|
176
|
+
(threeName === null && context === 'dom')
|
|
133
177
|
: !threeIntrinsicDomNames.has(componentName) ||
|
|
134
|
-
context ===
|
|
178
|
+
context === 'dom';
|
|
135
179
|
if (!isTagged) {
|
|
136
180
|
return;
|
|
137
181
|
}
|
|
138
182
|
// A module split from one already tagged keeps its tags.
|
|
139
|
-
if (openingElement.attributes?.some((attr) => attr.type ===
|
|
183
|
+
if (openingElement.attributes?.some((attr) => attr.type === 'JSXAttribute' &&
|
|
184
|
+
attr.name?.name === 'data-zite-id')) {
|
|
140
185
|
return;
|
|
141
186
|
}
|
|
142
187
|
const line = openingElement.loc?.start?.line ?? 0;
|
|
143
188
|
const col = openingElement.loc?.start?.column ?? 0;
|
|
144
189
|
const dataComponentId = `${relativePath}|${line}|${col}`;
|
|
145
190
|
let attributes = ` data-zite-id="${dataComponentId}"`;
|
|
146
|
-
if (kind ===
|
|
191
|
+
if (kind === 'component') {
|
|
147
192
|
attributes += ` data-zite-component="${componentName}"`;
|
|
148
193
|
}
|
|
149
194
|
if (children.length === 1 &&
|
|
150
|
-
(children[0].type ===
|
|
151
|
-
children[0].type ===
|
|
152
|
-
(children[0].type ===
|
|
153
|
-
children[0].expression.type ===
|
|
195
|
+
(children[0].type === 'JSXText' ||
|
|
196
|
+
children[0].type === 'StringLiteral' ||
|
|
197
|
+
(children[0].type === 'JSXExpressionContainer' &&
|
|
198
|
+
children[0].expression.type === 'StringLiteral'))) {
|
|
154
199
|
attributes += ` data-zite-editable="true"`;
|
|
155
200
|
}
|
|
156
201
|
magicString.appendLeft(openingElement.name.end ?? 0, attributes);
|
|
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const os_1 = require("os");
|
|
6
8
|
const path_1 = __importDefault(require("path"));
|
|
7
9
|
const vitest_1 = require("vitest");
|
|
8
10
|
const index_js_1 = require("./index.js");
|
|
@@ -115,3 +117,37 @@ async function transform(code, file = 'src/App.tsx') {
|
|
|
115
117
|
(0, vitest_1.expect)(await transform(source)).toBe(source);
|
|
116
118
|
});
|
|
117
119
|
});
|
|
120
|
+
(0, vitest_1.describe)("ziteId's tags for zitejs/query's device cache", () => {
|
|
121
|
+
const plugin = (command, config) => {
|
|
122
|
+
const dir = (0, fs_1.mkdtempSync)(path_1.default.join((0, os_1.tmpdir)(), 'zite-app-'));
|
|
123
|
+
if (config) {
|
|
124
|
+
(0, fs_1.writeFileSync)(path_1.default.join(dir, 'zite.config.json'), JSON.stringify(config));
|
|
125
|
+
}
|
|
126
|
+
const instance = (0, index_js_1.ziteId)();
|
|
127
|
+
instance.configResolved({
|
|
128
|
+
command,
|
|
129
|
+
configFile: path_1.default.join(dir, 'vite.config.ts'),
|
|
130
|
+
root: process.cwd(),
|
|
131
|
+
});
|
|
132
|
+
return () => Object.fromEntries(instance.transformIndexHtml().map(t => [
|
|
133
|
+
t.attrs?.name,
|
|
134
|
+
t.attrs?.content,
|
|
135
|
+
]));
|
|
136
|
+
};
|
|
137
|
+
(0, vitest_1.it)('keeps data on the device only for an app that chose disk', () => {
|
|
138
|
+
(0, vitest_1.expect)(plugin('build', { deviceCache: 'disk' })()['zite-device-cache']).toBeUndefined();
|
|
139
|
+
(0, vitest_1.expect)(plugin('build', { deviceCache: 'memory' })()['zite-device-cache']).toBe('memory');
|
|
140
|
+
(0, vitest_1.expect)(plugin('build', { id: 'app' })()['zite-device-cache']).toBe('memory');
|
|
141
|
+
(0, vitest_1.expect)(plugin('build')()['zite-device-cache']).toBe('memory');
|
|
142
|
+
});
|
|
143
|
+
(0, vitest_1.it)('gives every page of a build the same id, and each build its own', () => {
|
|
144
|
+
const pages = plugin('build', { deviceCache: 'disk' });
|
|
145
|
+
const id = pages()['zite-build'];
|
|
146
|
+
(0, vitest_1.expect)(id).toMatch(/\w{6,}/);
|
|
147
|
+
(0, vitest_1.expect)(pages()['zite-build']).toBe(id);
|
|
148
|
+
(0, vitest_1.expect)(plugin('build', { deviceCache: 'disk' })()['zite-build']).not.toBe(id);
|
|
149
|
+
});
|
|
150
|
+
(0, vitest_1.it)('tags nothing on a dev server', () => {
|
|
151
|
+
(0, vitest_1.expect)(plugin('serve', { deviceCache: 'disk' })()).toEqual({});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ProfileChanges } from './profileUpdates.js';
|
|
2
|
+
export declare function loginWithRedirect(opts?: {
|
|
3
|
+
redirectUrl?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Ignored. There is one sign-in screen now — the server works out
|
|
6
|
+
* from the email whether it's a sign-in or a sign-up. Still accepted, because
|
|
7
|
+
* app source written before that change would otherwise stop typechecking on
|
|
8
|
+
* its next build, and a typecheck error fails the build outright.
|
|
9
|
+
*/
|
|
10
|
+
initialView?: 'login' | 'signup';
|
|
11
|
+
}): void;
|
|
12
|
+
export declare function logout(opts?: {
|
|
13
|
+
returnTo?: string;
|
|
14
|
+
}): void;
|
|
15
|
+
export declare function updateProfile(data: ProfileChanges): Promise<{
|
|
16
|
+
data: {
|
|
17
|
+
status: boolean;
|
|
18
|
+
};
|
|
19
|
+
error: null;
|
|
20
|
+
} | {
|
|
21
|
+
data: null;
|
|
22
|
+
error: {
|
|
23
|
+
code?: string | undefined | undefined;
|
|
24
|
+
message?: string | undefined | undefined;
|
|
25
|
+
status: number;
|
|
26
|
+
statusText: string;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { USAGE_TOKEN_QUERY_PARAM } from './constants.js';
|
|
2
|
+
import { browserPreviewClaim, PREVIEW_CLAIM_PARAM } from './previewClaim.js';
|
|
3
|
+
import { profileUpdated } from './profileUpdates.js';
|
|
4
|
+
import { forgetDeviceCache } from '../internal/deviceCache.js';
|
|
5
|
+
export function loginWithRedirect(opts) {
|
|
6
|
+
if (window.location.pathname.startsWith('/auth/'))
|
|
7
|
+
return;
|
|
8
|
+
// Default to wherever the user already is, so a deep link survives the round
|
|
9
|
+
// trip through login without every app having to remember to pass it. Pass
|
|
10
|
+
// `redirectUrl` only to send them somewhere else instead.
|
|
11
|
+
//
|
|
12
|
+
// Resolved to an absolute URL either way, on purpose: better-auth
|
|
13
|
+
// character-checks a *relative* callbackURL — an encoded space, a fragment or
|
|
14
|
+
// any non-ASCII in the path fails its regex and the destination is dropped —
|
|
15
|
+
// but never inspects the path of an absolute one. Normalising here means a
|
|
16
|
+
// caller can pass whichever form reads best without having to know that.
|
|
17
|
+
const target = new URL(opts?.redirectUrl ?? window.location.href, window.location.href);
|
|
18
|
+
// Say nothing when there's nothing to say. The sign-in page already returns
|
|
19
|
+
// people to the app root when it isn't told otherwise, so naming the root
|
|
20
|
+
// spells out the default — and puts an encoded copy of the app's own URL in
|
|
21
|
+
// the address bar of every logged-out visitor to the front page, which is the
|
|
22
|
+
// common case. Only pass a destination when it IS one.
|
|
23
|
+
const isRoot = target.pathname === '/' && target.search === '' && target.hash === '';
|
|
24
|
+
const params = new URLSearchParams();
|
|
25
|
+
if (!isRoot)
|
|
26
|
+
params.set('redirectUrl', target.toString());
|
|
27
|
+
// The editor preview rides its usageToken on the app URL; the sign-in page
|
|
28
|
+
// only shows its editor surface ("Preview as" picker) when that token reaches
|
|
29
|
+
// it. Capturing the current URL carries it implicitly — but an explicit
|
|
30
|
+
// `redirectUrl` names a bare path, and would silently drop it. Forward it
|
|
31
|
+
// top-level either way, so how the app phrases its redirect can't decide
|
|
32
|
+
// whether the editor gets a preview. Published visitors never have one.
|
|
33
|
+
const usageToken = new URL(window.location.href).searchParams.get(USAGE_TOKEN_QUERY_PARAM) ??
|
|
34
|
+
window._ziteUsageToken;
|
|
35
|
+
if (usageToken)
|
|
36
|
+
params.set(USAGE_TOKEN_QUERY_PARAM, usageToken);
|
|
37
|
+
// A Start app's preview also needs its claim where the editor's frame dropped
|
|
38
|
+
// the cookie, as `loginHref()` sends it. Classic previews never have one.
|
|
39
|
+
const claim = browserPreviewClaim();
|
|
40
|
+
if (claim)
|
|
41
|
+
params.set(PREVIEW_CLAIM_PARAM, claim);
|
|
42
|
+
const query = params.toString();
|
|
43
|
+
window.location.href = query ? `/auth/login?${query}` : '/auth/login';
|
|
44
|
+
}
|
|
45
|
+
export function logout(opts) {
|
|
46
|
+
forgetDeviceCache();
|
|
47
|
+
void import('./client.js').then(({ signOut }) => signOut().then(() => {
|
|
48
|
+
window.location.href = opts?.returnTo || '/';
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
export async function updateProfile(data) {
|
|
52
|
+
const { authClient } = await import('./client.js');
|
|
53
|
+
const result = await authClient.updateUser(data);
|
|
54
|
+
if (!result.error)
|
|
55
|
+
profileUpdated(data);
|
|
56
|
+
return result;
|
|
57
|
+
}
|