zitejs 0.9.153 → 0.9.155
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 +6 -6
- package/dist/cjs/backend/index.js +13 -13
- package/dist/cjs/backend/index.test.js +102 -102
- package/dist/cjs/bundle/index.js +29 -16
- package/dist/cjs/caller/index.js +43 -43
- package/dist/cjs/check/index.d.ts +44 -1
- package/dist/cjs/check/index.js +198 -61
- 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 +19 -6
- package/dist/cjs/client/index.d.ts +2 -2
- package/dist/cjs/client/index.js +25 -25
- package/dist/cjs/dev/index.js +81 -53
- 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.js +42 -42
- package/dist/cjs/integrations/rules.test.js +60 -55
- 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 +22 -22
- package/dist/cjs/runtime/index.js +28 -28
- package/dist/cjs/runtime/index.test.js +34 -34
- package/dist/cjs/runtime/sendEmailParamsTypes.test-d.js +29 -29
- 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/build/entries.d.ts +25 -0
- package/dist/cjs/start/build/entries.js +121 -0
- 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/describe/describeBuilt.d.ts +5 -0
- package/dist/cjs/start/describe/describeBuilt.js +144 -0
- 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 +8 -8
- package/dist/cjs/steps/index.js +53 -53
- package/dist/cjs/steps/index.test.js +218 -218
- 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 +651 -665
- package/dist/cjs/sync/lib.test.js +81 -14
- 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 +1 -1
- package/dist/cjs/types/fields.js +105 -97
- package/dist/cjs/types/index.d.ts +2 -2
- package/dist/cjs/types/tables.d.ts +1 -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 +6 -6
- package/dist/esm/backend/index.js +13 -13
- package/dist/esm/backend/index.test.js +106 -106
- package/dist/esm/bundle/index.js +29 -16
- package/dist/esm/caller/index.js +44 -44
- package/dist/esm/check/index.d.ts +44 -1
- package/dist/esm/check/index.js +194 -61
- 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 +19 -6
- package/dist/esm/client/index.d.ts +2 -2
- package/dist/esm/client/index.js +25 -25
- package/dist/esm/dev/index.js +88 -60
- 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.js +42 -42
- package/dist/esm/integrations/rules.test.js +62 -57
- 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 +22 -22
- package/dist/esm/runtime/index.js +31 -31
- package/dist/esm/runtime/index.test.js +36 -36
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +30 -30
- 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/build/entries.d.ts +25 -0
- 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/build/placeholders/workflowModules.d.ts +1 -0
- package/dist/esm/start/build/placeholders/workflowModules.js +3 -0
- 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/esm/start/describe/describeBuilt.d.ts +5 -0
- package/dist/esm/start/describe/describeBuilt.js +102 -0
- package/dist/esm/start/describe/descriptions.d.ts +4 -0
- package/dist/esm/start/describe/descriptions.js +54 -0
- 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 +3 -0
- package/dist/esm/start/host.js +4 -0
- package/dist/esm/start/index.d.ts +10 -0
- package/dist/esm/start/index.js +7 -0
- 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 +44 -0
- package/dist/esm/start/router.js +280 -0
- 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/serve/instance.d.ts +12 -0
- 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 +373 -0
- package/dist/esm/start/types.js +1 -0
- package/dist/esm/start/version.d.ts +1 -0
- package/dist/esm/start/version.js +2 -0
- package/dist/esm/steps/index.d.ts +8 -8
- package/dist/esm/steps/index.js +54 -54
- package/dist/esm/steps/index.test.js +220 -220
- 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 +655 -669
- package/dist/esm/sync/lib.test.js +81 -14
- 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 +1 -1
- package/dist/esm/types/fields.js +106 -98
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/types/index.js +2 -2
- package/dist/esm/types/tables.d.ts +1 -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 +129 -16
- package/dist/cjs/auth-server/index.d.ts +0 -369
- package/dist/cjs/auth-server/index.js +0 -119
- package/dist/cjs/meta/index.d.ts +0 -14
- package/dist/cjs/meta/index.js +0 -12
- package/dist/cjs/notifications/index.d.ts +0 -25
- package/dist/cjs/notifications/index.js +0 -12
- package/dist/esm/auth-server/index.d.ts +0 -369
- package/dist/esm/auth-server/index.js +0 -116
- package/dist/esm/meta/index.d.ts +0 -14
- package/dist/esm/meta/index.js +0 -8
- package/dist/esm/notifications/index.d.ts +0 -25
- package/dist/esm/notifications/index.js +0 -8
package/dist/cjs/vite/index.js
CHANGED
|
@@ -9,8 +9,8 @@ const magic_string_1 = __importDefault(require("magic-string"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const estree_walker_1 = require("estree-walker");
|
|
11
11
|
const domTagNames_js_1 = require("./domTagNames.js");
|
|
12
|
-
const validExtensions = new Set([
|
|
13
|
-
const fragmentNames = new Set([
|
|
12
|
+
const validExtensions = new Set(['.jsx', '.tsx']);
|
|
13
|
+
const fragmentNames = new Set(['Fragment', 'React.Fragment']);
|
|
14
14
|
// react-three-fiber reads a dashed prop as a path into the three.js object, so
|
|
15
15
|
// any data-zite-* prop that reaches one throws. Components from the three
|
|
16
16
|
// ecosystem (drei, react-spring's `animated`) spread their props onto three
|
|
@@ -18,20 +18,20 @@ const fragmentNames = new Set(["Fragment", "React.Fragment"]);
|
|
|
18
18
|
// component is only tagged where it is known to render DOM: under a DOM
|
|
19
19
|
// element or drei's <Html>. In files that import the three ecosystem, a JSX
|
|
20
20
|
// tree's root is not assumed to be DOM, since scene components live there.
|
|
21
|
-
const threeIntrinsicDomNames = new Set([
|
|
21
|
+
const threeIntrinsicDomNames = new Set(['audio', 'line', 'path', 'source']);
|
|
22
22
|
function isThreeModule(source) {
|
|
23
|
-
return
|
|
23
|
+
return source.startsWith('@react-three/') || source === '@react-spring/three';
|
|
24
24
|
}
|
|
25
25
|
/** Local binding name -> imported name ("*" for a namespace import). */
|
|
26
26
|
function getThreeImports(ast) {
|
|
27
27
|
const imports = new Map();
|
|
28
28
|
for (const statement of ast.program.body) {
|
|
29
|
-
if (statement.type ===
|
|
29
|
+
if (statement.type === 'ImportDeclaration' &&
|
|
30
30
|
isThreeModule(statement.source.value)) {
|
|
31
31
|
for (const specifier of statement.specifiers) {
|
|
32
|
-
imports.set(specifier.local.name, specifier.type ===
|
|
33
|
-
? specifier.imported.name ?? specifier.imported.value
|
|
34
|
-
:
|
|
32
|
+
imports.set(specifier.local.name, specifier.type === 'ImportSpecifier'
|
|
33
|
+
? (specifier.imported.name ?? specifier.imported.value)
|
|
34
|
+
: '*');
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -39,18 +39,18 @@ function getThreeImports(ast) {
|
|
|
39
39
|
}
|
|
40
40
|
/** The three-ecosystem name an element refers to, if it comes from one. */
|
|
41
41
|
function getThreeName(componentName, threeImports) {
|
|
42
|
-
const segments = componentName.split(
|
|
42
|
+
const segments = componentName.split('.');
|
|
43
43
|
const imported = threeImports.get(segments[0]);
|
|
44
44
|
if (imported === undefined) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
return imported ===
|
|
47
|
+
return imported === '*' ? segments[segments.length - 1] : imported;
|
|
48
48
|
}
|
|
49
49
|
function getComponentName(elementName) {
|
|
50
|
-
if (elementName.type ===
|
|
50
|
+
if (elementName.type === 'JSXIdentifier') {
|
|
51
51
|
return elementName.name;
|
|
52
52
|
}
|
|
53
|
-
if (elementName.type ===
|
|
53
|
+
if (elementName.type === 'JSXMemberExpression') {
|
|
54
54
|
const object = getComponentName(elementName.object);
|
|
55
55
|
const property = elementName.property.name;
|
|
56
56
|
return object ? `${object}.${property}` : property;
|
|
@@ -61,91 +61,100 @@ function classifyElement(name) {
|
|
|
61
61
|
if (fragmentNames.has(name)) {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
if (!/^[a-z]/.test(name) || name.includes(
|
|
65
|
-
return
|
|
64
|
+
if (!/^[a-z]/.test(name) || name.includes('.')) {
|
|
65
|
+
return 'component';
|
|
66
66
|
}
|
|
67
|
-
if (domTagNames_js_1.domTagNames.has(name) || name.includes(
|
|
68
|
-
return
|
|
67
|
+
if (domTagNames_js_1.domTagNames.has(name) || name.includes('-')) {
|
|
68
|
+
return 'dom';
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
72
|
function ziteId() {
|
|
73
73
|
const cwd = process.cwd();
|
|
74
74
|
return {
|
|
75
|
-
name:
|
|
76
|
-
enforce:
|
|
75
|
+
name: 'vite-plugin-zite-id',
|
|
76
|
+
enforce: 'pre',
|
|
77
77
|
async transform(code, id) {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
// TanStack's route code splitting moves a route's component into its own module, `route.tsx?tsr-split=…`.
|
|
79
|
+
const file = id.split('?')[0];
|
|
80
|
+
if (!validExtensions.has(path_1.default.extname(file)) ||
|
|
81
|
+
file.includes('node_modules')) {
|
|
80
82
|
return null;
|
|
81
83
|
}
|
|
82
|
-
const relativePath = path_1.default.relative(cwd,
|
|
84
|
+
const relativePath = path_1.default.relative(cwd, file);
|
|
83
85
|
try {
|
|
84
86
|
const ast = (0, parser_1.parse)(code, {
|
|
85
|
-
sourceType:
|
|
86
|
-
plugins: [
|
|
87
|
+
sourceType: 'module',
|
|
88
|
+
plugins: ['jsx', 'typescript'],
|
|
87
89
|
});
|
|
88
90
|
const magicString = new magic_string_1.default(code);
|
|
89
91
|
const threeImports = getThreeImports(ast);
|
|
90
|
-
const rootContext = threeImports.size > 0 ?
|
|
92
|
+
const rootContext = threeImports.size > 0 ? 'unknown' : 'dom';
|
|
91
93
|
// The render context each open JSXElement gives its children.
|
|
92
94
|
const contextStack = [];
|
|
93
95
|
(0, estree_walker_1.walk)(ast, {
|
|
94
96
|
leave(_node) {
|
|
95
|
-
if (_node.type ===
|
|
97
|
+
if (_node.type === 'JSXElement') {
|
|
96
98
|
contextStack.pop();
|
|
97
99
|
}
|
|
98
100
|
},
|
|
99
101
|
enter(_node) {
|
|
100
102
|
const node = _node;
|
|
101
|
-
if (node.type ===
|
|
103
|
+
if (node.type === 'JSXElement') {
|
|
102
104
|
const openingElement = node.openingElement;
|
|
103
105
|
const children = node.children;
|
|
104
106
|
const context = contextStack[contextStack.length - 1] ?? rootContext;
|
|
105
107
|
const componentName = getComponentName(openingElement.name);
|
|
106
|
-
const kind = componentName
|
|
108
|
+
const kind = componentName
|
|
109
|
+
? classifyElement(componentName)
|
|
110
|
+
: null;
|
|
107
111
|
const threeName = componentName
|
|
108
112
|
? getThreeName(componentName, threeImports)
|
|
109
113
|
: null;
|
|
110
114
|
let childContext = context;
|
|
111
|
-
if (threeName ===
|
|
112
|
-
childContext =
|
|
115
|
+
if (threeName === 'Html') {
|
|
116
|
+
childContext = 'dom';
|
|
113
117
|
}
|
|
114
118
|
else if (threeName !== null) {
|
|
115
|
-
childContext =
|
|
119
|
+
childContext = 'scene';
|
|
116
120
|
}
|
|
117
|
-
else if (kind ===
|
|
118
|
-
childContext =
|
|
121
|
+
else if (kind === 'dom') {
|
|
122
|
+
childContext = 'dom';
|
|
119
123
|
}
|
|
120
124
|
else if (componentName &&
|
|
121
125
|
kind === null &&
|
|
122
126
|
!fragmentNames.has(componentName)) {
|
|
123
|
-
childContext =
|
|
127
|
+
childContext = 'scene';
|
|
124
128
|
}
|
|
125
129
|
contextStack.push(childContext);
|
|
126
130
|
if (!componentName || !kind) {
|
|
127
131
|
return;
|
|
128
132
|
}
|
|
129
|
-
const isTagged = kind ===
|
|
130
|
-
? threeName ===
|
|
131
|
-
(threeName === null && context ===
|
|
133
|
+
const isTagged = kind === 'component'
|
|
134
|
+
? threeName === 'Canvas' ||
|
|
135
|
+
(threeName === null && context === 'dom')
|
|
132
136
|
: !threeIntrinsicDomNames.has(componentName) ||
|
|
133
|
-
context ===
|
|
137
|
+
context === 'dom';
|
|
134
138
|
if (!isTagged) {
|
|
135
139
|
return;
|
|
136
140
|
}
|
|
141
|
+
// A module split from one already tagged keeps its tags.
|
|
142
|
+
if (openingElement.attributes?.some((attr) => attr.type === 'JSXAttribute' &&
|
|
143
|
+
attr.name?.name === 'data-zite-id')) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
137
146
|
const line = openingElement.loc?.start?.line ?? 0;
|
|
138
147
|
const col = openingElement.loc?.start?.column ?? 0;
|
|
139
148
|
const dataComponentId = `${relativePath}|${line}|${col}`;
|
|
140
149
|
let attributes = ` data-zite-id="${dataComponentId}"`;
|
|
141
|
-
if (kind ===
|
|
150
|
+
if (kind === 'component') {
|
|
142
151
|
attributes += ` data-zite-component="${componentName}"`;
|
|
143
152
|
}
|
|
144
153
|
if (children.length === 1 &&
|
|
145
|
-
(children[0].type ===
|
|
146
|
-
children[0].type ===
|
|
147
|
-
(children[0].type ===
|
|
148
|
-
children[0].expression.type ===
|
|
154
|
+
(children[0].type === 'JSXText' ||
|
|
155
|
+
children[0].type === 'StringLiteral' ||
|
|
156
|
+
(children[0].type === 'JSXExpressionContainer' &&
|
|
157
|
+
children[0].expression.type === 'StringLiteral'))) {
|
|
149
158
|
attributes += ` data-zite-editable="true"`;
|
|
150
159
|
}
|
|
151
160
|
magicString.appendLeft(openingElement.name.end ?? 0, attributes);
|
|
@@ -6,16 +6,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const vitest_1 = require("vitest");
|
|
8
8
|
const index_js_1 = require("./index.js");
|
|
9
|
-
async function transform(code) {
|
|
9
|
+
async function transform(code, file = 'src/App.tsx') {
|
|
10
10
|
const plugin = (0, index_js_1.ziteId)();
|
|
11
11
|
const handler = plugin.transform;
|
|
12
|
-
const result = await handler(code, path_1.default.join(process.cwd(),
|
|
12
|
+
const result = await handler(code, path_1.default.join(process.cwd(), file));
|
|
13
13
|
if (!result) {
|
|
14
14
|
throw new Error('transform returned null');
|
|
15
15
|
}
|
|
16
16
|
return result.code;
|
|
17
17
|
}
|
|
18
18
|
(0, vitest_1.describe)('ziteId', () => {
|
|
19
|
+
(0, vitest_1.it)("tags a route's component that TanStack split into its own module, by the source file", async () => {
|
|
20
|
+
const code = await transform('const a = <p>Hi</p>;', 'src/routes/index.tsx?tsr-split=component');
|
|
21
|
+
(0, vitest_1.expect)(code).toContain('<p data-zite-id="src/routes/index.tsx|1|10" data-zite-editable="true">');
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.it)('leaves an element that already has its tag', async () => {
|
|
24
|
+
const code = await transform('const a = <p data-zite-id="src/routes/index.tsx|1|10">Hi</p>;');
|
|
25
|
+
(0, vitest_1.expect)(code.match(/data-zite-id/g)).toHaveLength(1);
|
|
26
|
+
});
|
|
19
27
|
(0, vitest_1.it)('tags html and svg elements without a component name', async () => {
|
|
20
28
|
const code = await transform('const a = <div><svg><path d="M0" /></svg><p>Hello</p></div>;');
|
|
21
29
|
(0, vitest_1.expect)(code).toContain('<div data-zite-id="src/App.tsx|1|10">');
|
|
@@ -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,55 @@
|
|
|
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
|
+
export function loginWithRedirect(opts) {
|
|
5
|
+
if (window.location.pathname.startsWith('/auth/'))
|
|
6
|
+
return;
|
|
7
|
+
// Default to wherever the user already is, so a deep link survives the round
|
|
8
|
+
// trip through login without every app having to remember to pass it. Pass
|
|
9
|
+
// `redirectUrl` only to send them somewhere else instead.
|
|
10
|
+
//
|
|
11
|
+
// Resolved to an absolute URL either way, on purpose: better-auth
|
|
12
|
+
// character-checks a *relative* callbackURL — an encoded space, a fragment or
|
|
13
|
+
// any non-ASCII in the path fails its regex and the destination is dropped —
|
|
14
|
+
// but never inspects the path of an absolute one. Normalising here means a
|
|
15
|
+
// caller can pass whichever form reads best without having to know that.
|
|
16
|
+
const target = new URL(opts?.redirectUrl ?? window.location.href, window.location.href);
|
|
17
|
+
// Say nothing when there's nothing to say. The sign-in page already returns
|
|
18
|
+
// people to the app root when it isn't told otherwise, so naming the root
|
|
19
|
+
// spells out the default — and puts an encoded copy of the app's own URL in
|
|
20
|
+
// the address bar of every logged-out visitor to the front page, which is the
|
|
21
|
+
// common case. Only pass a destination when it IS one.
|
|
22
|
+
const isRoot = target.pathname === '/' && target.search === '' && target.hash === '';
|
|
23
|
+
const params = new URLSearchParams();
|
|
24
|
+
if (!isRoot)
|
|
25
|
+
params.set('redirectUrl', target.toString());
|
|
26
|
+
// The editor preview rides its usageToken on the app URL; the sign-in page
|
|
27
|
+
// only shows its editor surface ("Preview as" picker) when that token reaches
|
|
28
|
+
// it. Capturing the current URL carries it implicitly — but an explicit
|
|
29
|
+
// `redirectUrl` names a bare path, and would silently drop it. Forward it
|
|
30
|
+
// top-level either way, so how the app phrases its redirect can't decide
|
|
31
|
+
// whether the editor gets a preview. Published visitors never have one.
|
|
32
|
+
const usageToken = new URL(window.location.href).searchParams.get(USAGE_TOKEN_QUERY_PARAM) ??
|
|
33
|
+
window._ziteUsageToken;
|
|
34
|
+
if (usageToken)
|
|
35
|
+
params.set(USAGE_TOKEN_QUERY_PARAM, usageToken);
|
|
36
|
+
// A Start app's preview also needs its claim where the editor's frame dropped
|
|
37
|
+
// the cookie, as `loginHref()` sends it. Classic previews never have one.
|
|
38
|
+
const claim = browserPreviewClaim();
|
|
39
|
+
if (claim)
|
|
40
|
+
params.set(PREVIEW_CLAIM_PARAM, claim);
|
|
41
|
+
const query = params.toString();
|
|
42
|
+
window.location.href = query ? `/auth/login?${query}` : '/auth/login';
|
|
43
|
+
}
|
|
44
|
+
export function logout(opts) {
|
|
45
|
+
void import('./client.js').then(({ signOut }) => signOut().then(() => {
|
|
46
|
+
window.location.href = opts?.returnTo || '/';
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
export async function updateProfile(data) {
|
|
50
|
+
const { authClient } = await import('./client.js');
|
|
51
|
+
const result = await authClient.updateUser(data);
|
|
52
|
+
if (!result.error)
|
|
53
|
+
profileUpdated(data);
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { loginWithRedirect, logout } from './actions.js';
|
|
2
|
+
import type { User } from './index.js';
|
|
3
|
+
export declare const authClient: import("better-auth/react").ReactAuthClient<{
|
|
4
|
+
baseURL: string;
|
|
5
|
+
plugins: ({
|
|
6
|
+
id: "magic-link";
|
|
7
|
+
version: string;
|
|
8
|
+
$InferServerPlugin: ReturnType<(options: import("better-auth/plugins/magic-link").MagicLinkOptions) => {
|
|
9
|
+
id: "magic-link";
|
|
10
|
+
version: string;
|
|
11
|
+
endpoints: {
|
|
12
|
+
signInMagicLink: import("better-call").StrictEndpoint<"/sign-in/magic-link", {
|
|
13
|
+
method: "POST";
|
|
14
|
+
requireHeaders: true;
|
|
15
|
+
body: import("zod").ZodObject<{
|
|
16
|
+
email: import("zod").ZodEmail;
|
|
17
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
22
|
+
}, import("zod/v4/core").$strip>;
|
|
23
|
+
metadata: {
|
|
24
|
+
openapi: {
|
|
25
|
+
operationId: string;
|
|
26
|
+
description: string;
|
|
27
|
+
responses: {
|
|
28
|
+
200: {
|
|
29
|
+
description: string;
|
|
30
|
+
content: {
|
|
31
|
+
"application/json": {
|
|
32
|
+
schema: {
|
|
33
|
+
type: "object";
|
|
34
|
+
properties: {
|
|
35
|
+
status: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}, {
|
|
47
|
+
status: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
magicLinkVerify: import("better-call").StrictEndpoint<"/magic-link/verify", {
|
|
50
|
+
method: "GET";
|
|
51
|
+
query: import("zod").ZodObject<{
|
|
52
|
+
token: import("zod").ZodString;
|
|
53
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
55
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
56
|
+
}, import("zod/v4/core").$strip>;
|
|
57
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
|
|
58
|
+
requireHeaders: true;
|
|
59
|
+
metadata: {
|
|
60
|
+
openapi: {
|
|
61
|
+
operationId: string;
|
|
62
|
+
description: string;
|
|
63
|
+
responses: {
|
|
64
|
+
200: {
|
|
65
|
+
description: string;
|
|
66
|
+
content: {
|
|
67
|
+
"application/json": {
|
|
68
|
+
schema: {
|
|
69
|
+
type: "object";
|
|
70
|
+
properties: {
|
|
71
|
+
session: {
|
|
72
|
+
$ref: string;
|
|
73
|
+
};
|
|
74
|
+
user: {
|
|
75
|
+
$ref: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
token: string;
|
|
87
|
+
user: {
|
|
88
|
+
id: string;
|
|
89
|
+
createdAt: Date;
|
|
90
|
+
updatedAt: Date;
|
|
91
|
+
email: string;
|
|
92
|
+
emailVerified: boolean;
|
|
93
|
+
name: string;
|
|
94
|
+
image?: string | null | undefined;
|
|
95
|
+
};
|
|
96
|
+
session: {
|
|
97
|
+
id: string;
|
|
98
|
+
createdAt: Date;
|
|
99
|
+
updatedAt: Date;
|
|
100
|
+
userId: string;
|
|
101
|
+
expiresAt: Date;
|
|
102
|
+
token: string;
|
|
103
|
+
ipAddress?: string | null | undefined;
|
|
104
|
+
userAgent?: string | null | undefined;
|
|
105
|
+
};
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
rateLimit: {
|
|
109
|
+
pathMatcher(path: string): boolean;
|
|
110
|
+
window: number;
|
|
111
|
+
max: number;
|
|
112
|
+
}[];
|
|
113
|
+
options: import("better-auth/plugins/magic-link").MagicLinkOptions;
|
|
114
|
+
}>;
|
|
115
|
+
} | {
|
|
116
|
+
id: "additional-fields-client";
|
|
117
|
+
version: string;
|
|
118
|
+
$InferServerPlugin: {
|
|
119
|
+
id: "additional-fields-client";
|
|
120
|
+
version: string;
|
|
121
|
+
schema: {
|
|
122
|
+
user: {
|
|
123
|
+
fields: {
|
|
124
|
+
firstName: {
|
|
125
|
+
type: "string";
|
|
126
|
+
required: false;
|
|
127
|
+
};
|
|
128
|
+
lastName: {
|
|
129
|
+
type: "string";
|
|
130
|
+
required: false;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
session: {
|
|
135
|
+
fields: {};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
})[];
|
|
140
|
+
}>;
|
|
141
|
+
export declare const useSession: () => {
|
|
142
|
+
data: {
|
|
143
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
144
|
+
id: string;
|
|
145
|
+
createdAt: Date;
|
|
146
|
+
updatedAt: Date;
|
|
147
|
+
email: string;
|
|
148
|
+
emailVerified: boolean;
|
|
149
|
+
name: string;
|
|
150
|
+
image?: string | null | undefined;
|
|
151
|
+
} & {} & {
|
|
152
|
+
firstName?: string | null | undefined;
|
|
153
|
+
lastName?: string | null | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
session: import("better-auth/react").StripEmptyObjects<{
|
|
156
|
+
id: string;
|
|
157
|
+
createdAt: Date;
|
|
158
|
+
updatedAt: Date;
|
|
159
|
+
userId: string;
|
|
160
|
+
expiresAt: Date;
|
|
161
|
+
token: string;
|
|
162
|
+
ipAddress?: string | null | undefined;
|
|
163
|
+
userAgent?: string | null | undefined;
|
|
164
|
+
} & {} & {}>;
|
|
165
|
+
} | null;
|
|
166
|
+
isPending: boolean;
|
|
167
|
+
isRefetching: boolean;
|
|
168
|
+
error: import("@better-fetch/fetch").BetterFetchError | null;
|
|
169
|
+
refetch: (queryParams?: {
|
|
170
|
+
query?: import("better-auth").SessionQueryParams;
|
|
171
|
+
} | undefined) => Promise<void>;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* `loginWithRedirect` and `logout` are returned as well as exported. The
|
|
175
|
+
* pre-monorepo `useAuth()` returned them, so app code that destructures them
|
|
176
|
+
* from the hook is common — and returning them here means the legacy compat
|
|
177
|
+
* shim is the only thing that has to know that, not every migrated app.
|
|
178
|
+
*/
|
|
179
|
+
export declare function useAuth(): {
|
|
180
|
+
user: User | null;
|
|
181
|
+
isLoading: boolean;
|
|
182
|
+
loginWithRedirect: typeof loginWithRedirect;
|
|
183
|
+
logout: typeof logout;
|
|
184
|
+
};
|
|
185
|
+
export declare const signIn: {
|
|
186
|
+
magicLink: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
187
|
+
email: string;
|
|
188
|
+
name?: string | undefined;
|
|
189
|
+
callbackURL?: string | undefined;
|
|
190
|
+
newUserCallbackURL?: string | undefined;
|
|
191
|
+
errorCallbackURL?: string | undefined;
|
|
192
|
+
metadata?: Record<string, any> | undefined;
|
|
193
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
194
|
+
email: string;
|
|
195
|
+
name?: string | undefined;
|
|
196
|
+
callbackURL?: string | undefined;
|
|
197
|
+
newUserCallbackURL?: string | undefined;
|
|
198
|
+
errorCallbackURL?: string | undefined;
|
|
199
|
+
metadata?: Record<string, any> | undefined;
|
|
200
|
+
} & {
|
|
201
|
+
fetchOptions?: FetchOptions | undefined;
|
|
202
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
203
|
+
status: boolean;
|
|
204
|
+
}, {
|
|
205
|
+
code?: string | undefined;
|
|
206
|
+
message?: string | undefined;
|
|
207
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
208
|
+
} & {
|
|
209
|
+
social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
210
|
+
provider: "salesforce" | "slack" | "linear" | "notion" | "linkedin" | "github" | "dropbox" | (string & {}) | "huggingface" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "kick" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
211
|
+
callbackURL?: string | undefined;
|
|
212
|
+
newUserCallbackURL?: string | undefined;
|
|
213
|
+
errorCallbackURL?: string | undefined;
|
|
214
|
+
disableRedirect?: boolean | undefined;
|
|
215
|
+
idToken?: {
|
|
216
|
+
token: string;
|
|
217
|
+
nonce?: string | undefined;
|
|
218
|
+
accessToken?: string | undefined;
|
|
219
|
+
refreshToken?: string | undefined;
|
|
220
|
+
expiresAt?: number | undefined;
|
|
221
|
+
user?: {
|
|
222
|
+
name?: {
|
|
223
|
+
firstName?: string | undefined;
|
|
224
|
+
lastName?: string | undefined;
|
|
225
|
+
} | undefined;
|
|
226
|
+
email?: string | undefined;
|
|
227
|
+
} | undefined;
|
|
228
|
+
} | undefined;
|
|
229
|
+
scopes?: string[] | undefined;
|
|
230
|
+
requestSignUp?: boolean | undefined;
|
|
231
|
+
loginHint?: string | undefined;
|
|
232
|
+
additionalData?: Record<string, any> | undefined;
|
|
233
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
234
|
+
provider: "salesforce" | "slack" | "linear" | "notion" | "linkedin" | "github" | "dropbox" | (string & {}) | "huggingface" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "spotify" | "twitch" | "twitter" | "kick" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
235
|
+
callbackURL?: string | undefined;
|
|
236
|
+
newUserCallbackURL?: string | undefined;
|
|
237
|
+
errorCallbackURL?: string | undefined;
|
|
238
|
+
disableRedirect?: boolean | undefined;
|
|
239
|
+
idToken?: {
|
|
240
|
+
token: string;
|
|
241
|
+
nonce?: string | undefined;
|
|
242
|
+
accessToken?: string | undefined;
|
|
243
|
+
refreshToken?: string | undefined;
|
|
244
|
+
expiresAt?: number | undefined;
|
|
245
|
+
user?: {
|
|
246
|
+
name?: {
|
|
247
|
+
firstName?: string | undefined;
|
|
248
|
+
lastName?: string | undefined;
|
|
249
|
+
} | undefined;
|
|
250
|
+
email?: string | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
} | undefined;
|
|
253
|
+
scopes?: string[] | undefined;
|
|
254
|
+
requestSignUp?: boolean | undefined;
|
|
255
|
+
loginHint?: string | undefined;
|
|
256
|
+
additionalData?: Record<string, any> | undefined;
|
|
257
|
+
} & {
|
|
258
|
+
fetchOptions?: FetchOptions | undefined;
|
|
259
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
260
|
+
redirect: boolean;
|
|
261
|
+
url: string;
|
|
262
|
+
} | (Omit<{
|
|
263
|
+
redirect: boolean;
|
|
264
|
+
token: string;
|
|
265
|
+
url: undefined;
|
|
266
|
+
user: {
|
|
267
|
+
id: string;
|
|
268
|
+
createdAt: Date;
|
|
269
|
+
updatedAt: Date;
|
|
270
|
+
email: string;
|
|
271
|
+
emailVerified: boolean;
|
|
272
|
+
name: string;
|
|
273
|
+
image?: string | null | undefined | undefined;
|
|
274
|
+
};
|
|
275
|
+
}, "user"> & {
|
|
276
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
277
|
+
id: string;
|
|
278
|
+
createdAt: Date;
|
|
279
|
+
updatedAt: Date;
|
|
280
|
+
email: string;
|
|
281
|
+
emailVerified: boolean;
|
|
282
|
+
name: string;
|
|
283
|
+
image?: string | null | undefined;
|
|
284
|
+
} & {} & {
|
|
285
|
+
firstName?: string | null | undefined;
|
|
286
|
+
lastName?: string | null | undefined;
|
|
287
|
+
}>;
|
|
288
|
+
}), {
|
|
289
|
+
code?: string | undefined;
|
|
290
|
+
message?: string | undefined;
|
|
291
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
292
|
+
} & {
|
|
293
|
+
email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
294
|
+
email: string;
|
|
295
|
+
password: string;
|
|
296
|
+
callbackURL?: string | undefined;
|
|
297
|
+
rememberMe?: boolean | undefined;
|
|
298
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
299
|
+
email: string;
|
|
300
|
+
password: string;
|
|
301
|
+
callbackURL?: string | undefined;
|
|
302
|
+
rememberMe?: boolean | undefined;
|
|
303
|
+
} & {
|
|
304
|
+
fetchOptions?: FetchOptions | undefined;
|
|
305
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
|
|
306
|
+
redirect: boolean;
|
|
307
|
+
token: string;
|
|
308
|
+
url?: string | undefined;
|
|
309
|
+
user: {
|
|
310
|
+
id: string;
|
|
311
|
+
createdAt: Date;
|
|
312
|
+
updatedAt: Date;
|
|
313
|
+
email: string;
|
|
314
|
+
emailVerified: boolean;
|
|
315
|
+
name: string;
|
|
316
|
+
image?: string | null | undefined | undefined;
|
|
317
|
+
};
|
|
318
|
+
}, "user"> & {
|
|
319
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
320
|
+
id: string;
|
|
321
|
+
createdAt: Date;
|
|
322
|
+
updatedAt: Date;
|
|
323
|
+
email: string;
|
|
324
|
+
emailVerified: boolean;
|
|
325
|
+
name: string;
|
|
326
|
+
image?: string | null | undefined;
|
|
327
|
+
} & {} & {
|
|
328
|
+
firstName?: string | null | undefined;
|
|
329
|
+
lastName?: string | null | undefined;
|
|
330
|
+
}>;
|
|
331
|
+
}, {
|
|
332
|
+
code?: string | undefined;
|
|
333
|
+
message?: string | undefined;
|
|
334
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
335
|
+
};
|
|
336
|
+
export declare const signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
337
|
+
query?: Record<string, any> | undefined;
|
|
338
|
+
fetchOptions?: FetchOptions | undefined;
|
|
339
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
340
|
+
success: boolean;
|
|
341
|
+
}, {
|
|
342
|
+
code?: string | undefined;
|
|
343
|
+
message?: string | undefined;
|
|
344
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
345
|
+
export declare const signUp: {
|
|
346
|
+
email: (data: {
|
|
347
|
+
email: string;
|
|
348
|
+
password: string;
|
|
349
|
+
name: string;
|
|
350
|
+
[key: string]: unknown;
|
|
351
|
+
}) => Promise<{
|
|
352
|
+
error?: {
|
|
353
|
+
message?: string;
|
|
354
|
+
} | null;
|
|
355
|
+
data?: unknown;
|
|
356
|
+
}>;
|
|
357
|
+
};
|