zitejs 0.9.152 → 0.9.154
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.d.ts +1 -0
- package/dist/cjs/integrations/rules.js +44 -41
- 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/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 +69 -21
- 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 +35 -18
- 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 +652 -661
- 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.d.ts +1 -0
- package/dist/esm/integrations/rules.js +44 -41
- 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/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 +69 -21
- package/dist/esm/runtime/index.js +35 -29
- package/dist/esm/runtime/index.test.js +36 -36
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +36 -19
- 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 +656 -665
- 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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.startRouteTreeFooter = void 0;
|
|
40
|
+
exports.regenerateRouteTree = regenerateRouteTree;
|
|
41
|
+
// `src/routeTree.gen.ts` as `vite build` writes it, without vite: tsgo types
|
|
42
|
+
// each `createFileRoute` from it, and only the generator may write it.
|
|
43
|
+
const node_fs_1 = require("node:fs");
|
|
44
|
+
const node_module_1 = require("node:module");
|
|
45
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
46
|
+
const node_url_1 = require("node:url");
|
|
47
|
+
const entries_js_1 = require("../../start/build/entries.js");
|
|
48
|
+
// As Start resolves its entries (start-plugin-core resolve-entries).
|
|
49
|
+
const ENTRY_EXTENSIONS = ['.ts', '.js', '.mts', '.mjs', '.tsx', '.jsx'];
|
|
50
|
+
const resolveEntry = (srcDirectory, name) => {
|
|
51
|
+
const base = node_path_1.default.resolve(srcDirectory, name);
|
|
52
|
+
if ((0, node_fs_1.existsSync)(base) && (0, node_fs_1.statSync)(base).isFile())
|
|
53
|
+
return base;
|
|
54
|
+
return ENTRY_EXTENSIONS.map(extension => base + extension).find(file => (0, node_fs_1.existsSync)(file));
|
|
55
|
+
};
|
|
56
|
+
const importPath = (generatedRouteTree, file) => {
|
|
57
|
+
let relative = node_path_1.default.relative(node_path_1.default.dirname(generatedRouteTree), file);
|
|
58
|
+
if (!relative.startsWith('.'))
|
|
59
|
+
relative = `./${relative}`;
|
|
60
|
+
return relative.split(node_path_1.default.sep).join('/');
|
|
61
|
+
};
|
|
62
|
+
/** Start's footer (start-plugin-core route-tree-footer), which types the router and start instance for `@tanstack/react-start`. */
|
|
63
|
+
const startRouteTreeFooter = (generatedRouteTree, routerFile, startFile) => {
|
|
64
|
+
const blocks = [
|
|
65
|
+
`import type { getRouter } from '${importPath(generatedRouteTree, routerFile)}'`,
|
|
66
|
+
startFile
|
|
67
|
+
? `import type { startInstance } from '${importPath(generatedRouteTree, startFile)}'`
|
|
68
|
+
: "import type { createStart } from '@tanstack/react-start'",
|
|
69
|
+
"declare module '@tanstack/react-start' {\n interface Register {\n ssr: true\n router: Awaited<ReturnType<typeof getRouter>>",
|
|
70
|
+
...(startFile
|
|
71
|
+
? [' config: Awaited<ReturnType<typeof startInstance.getOptions>>']
|
|
72
|
+
: []),
|
|
73
|
+
' }\n}',
|
|
74
|
+
];
|
|
75
|
+
return [blocks.join('\n')];
|
|
76
|
+
};
|
|
77
|
+
exports.startRouteTreeFooter = startRouteTreeFooter;
|
|
78
|
+
/** A package's ESM entry, resolved from `fromFile` as Node would. */
|
|
79
|
+
const importPackage = async (fromFile, name) => {
|
|
80
|
+
const manifest = (0, node_module_1.createRequire)(fromFile).resolve(`${name}/package.json`);
|
|
81
|
+
const { exports, module, main } = JSON.parse((0, node_fs_1.readFileSync)(manifest, 'utf-8'));
|
|
82
|
+
const root = exports?.['.'] ?? exports;
|
|
83
|
+
const entry = root?.import?.default ??
|
|
84
|
+
root?.import ??
|
|
85
|
+
root?.default ??
|
|
86
|
+
module ??
|
|
87
|
+
main ??
|
|
88
|
+
'index.js';
|
|
89
|
+
return Promise.resolve(`${(0, node_url_1.pathToFileURL)(node_path_1.default.join(node_path_1.default.dirname(manifest), entry)).href}`).then(s => __importStar(require(s)));
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Regenerates the route tree with the router generator the app's own
|
|
93
|
+
* `@tanstack/react-start` builds with, configured as zitejs's Start plugin
|
|
94
|
+
* configures it, so the file is the one `vite build` writes, byte for byte.
|
|
95
|
+
*/
|
|
96
|
+
async function regenerateRouteTree(appDir) {
|
|
97
|
+
const root = node_path_1.default.resolve(appDir);
|
|
98
|
+
const srcDirectory = node_path_1.default.join(root, 'src');
|
|
99
|
+
const routesDirectory = node_path_1.default.join(srcDirectory, 'routes');
|
|
100
|
+
if (!(0, node_fs_1.existsSync)(routesDirectory))
|
|
101
|
+
return;
|
|
102
|
+
const generatedRouteTree = node_path_1.default.join(srcDirectory, 'routeTree.gen.ts');
|
|
103
|
+
const routerFile = resolveEntry(srcDirectory, 'router');
|
|
104
|
+
if (!routerFile)
|
|
105
|
+
throw new Error("src/router.tsx is missing: Start reads the app's router from it");
|
|
106
|
+
// zite() points Start's entry at the generated start instance, relative to src/.
|
|
107
|
+
const startFile = resolveEntry(srcDirectory, node_path_1.default.join('..', entries_js_1.START_INSTANCE_ENTRY.replace(/\.ts$/, '')));
|
|
108
|
+
const startManifest = (0, node_module_1.createRequire)(node_path_1.default.join(root, 'package.json')).resolve('@tanstack/react-start/package.json');
|
|
109
|
+
const coreManifest = (0, node_module_1.createRequire)(startManifest).resolve('@tanstack/start-plugin-core/package.json');
|
|
110
|
+
const { getConfig, Generator } = (await importPackage(coreManifest, '@tanstack/router-generator'));
|
|
111
|
+
const footer = (0, exports.startRouteTreeFooter)(generatedRouteTree, routerFile, startFile);
|
|
112
|
+
const config = {
|
|
113
|
+
...getConfig({ routesDirectory, generatedRouteTree }, root),
|
|
114
|
+
target: 'react',
|
|
115
|
+
routeTreeFileFooter: () => footer,
|
|
116
|
+
};
|
|
117
|
+
await new Generator({ config, root }).run();
|
|
118
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findTsgo = findTsgo;
|
|
7
|
+
// TypeScript's native compiler, as the platform's checks run it, found the same
|
|
8
|
+
// way every time: never from PATH, so a check here and one in the sandbox use
|
|
9
|
+
// the same compiler.
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_module_1 = require("node:module");
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
const PACKAGE = '@typescript/native-preview';
|
|
14
|
+
// Where `npm install -g` put it for the node running this: the sandbox image's.
|
|
15
|
+
const globalRoot = () => process.env.npm_config_prefix
|
|
16
|
+
? node_path_1.default.join(process.env.npm_config_prefix, process.platform === 'win32' ? 'node_modules' : 'lib/node_modules')
|
|
17
|
+
: process.platform === 'win32'
|
|
18
|
+
? node_path_1.default.join(node_path_1.default.dirname(process.execPath), 'node_modules')
|
|
19
|
+
: node_path_1.default.join(node_path_1.default.dirname(node_path_1.default.dirname(process.execPath)), 'lib', 'node_modules');
|
|
20
|
+
/** tsgo's launcher: the app's own, walking up from it as Node does, else the global install beside this node. */
|
|
21
|
+
function findTsgo(appDir) {
|
|
22
|
+
let manifest;
|
|
23
|
+
try {
|
|
24
|
+
manifest = (0, node_module_1.createRequire)(node_path_1.default.join(node_path_1.default.resolve(appDir), 'package.json')).resolve(`${PACKAGE}/package.json`);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
const global = node_path_1.default.join(globalRoot(), PACKAGE, 'package.json');
|
|
28
|
+
manifest = (0, node_fs_1.existsSync)(global) ? global : undefined;
|
|
29
|
+
}
|
|
30
|
+
if (!manifest)
|
|
31
|
+
return undefined;
|
|
32
|
+
const { bin } = JSON.parse((0, node_fs_1.readFileSync)(manifest, 'utf-8'));
|
|
33
|
+
const launcher = typeof bin === 'string' ? bin : bin?.tsgo;
|
|
34
|
+
return launcher ? node_path_1.default.join(node_path_1.default.dirname(manifest), launcher) : undefined;
|
|
35
|
+
}
|
package/dist/cjs/cli.js
CHANGED
|
@@ -35,8 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
const dotenv_1 = require("dotenv");
|
|
38
|
-
|
|
39
|
-
(0, dotenv_1.config)({ path: '.env' });
|
|
38
|
+
// Quiet: dotenv 17 prints tips to stdout, which commands like `describe` own.
|
|
39
|
+
(0, dotenv_1.config)({ path: '.env.local', quiet: true });
|
|
40
|
+
(0, dotenv_1.config)({ path: '.env', quiet: true });
|
|
40
41
|
async function main() {
|
|
41
42
|
const command = process.argv[2];
|
|
42
43
|
switch (command) {
|
|
@@ -60,6 +61,11 @@ async function main() {
|
|
|
60
61
|
await runCheck();
|
|
61
62
|
break;
|
|
62
63
|
}
|
|
64
|
+
case 'describe': {
|
|
65
|
+
const { runDescribe } = await Promise.resolve().then(() => __importStar(require('./start/describe/describeBuilt.js')));
|
|
66
|
+
await runDescribe();
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
63
69
|
case 'bundle': {
|
|
64
70
|
const { runBundle } = await Promise.resolve().then(() => __importStar(require('./bundle/index.js')));
|
|
65
71
|
await runBundle();
|
|
@@ -68,18 +74,25 @@ async function main() {
|
|
|
68
74
|
default:
|
|
69
75
|
console.error(command
|
|
70
76
|
? `Unknown command: ${command}`
|
|
71
|
-
: 'Usage: zitejs <sync|dev|generate|check|bundle>');
|
|
77
|
+
: 'Usage: zitejs <sync|dev|generate|check|bundle|describe>');
|
|
72
78
|
console.error('');
|
|
73
79
|
console.error('Commands:');
|
|
74
80
|
console.error(' sync Generate .zite/db.ts from database schema (single-app)');
|
|
75
81
|
console.error(' dev Run sync then watch for changes (like npx convex dev)');
|
|
76
82
|
console.error(' generate Regenerate every app and automation .zite/ (monorepo)');
|
|
77
|
-
console.error(' check
|
|
78
|
-
console.error(
|
|
83
|
+
console.error(' check Typecheck and build every app and automation; a Start app is typechecked with tsgo against its regenerated route tree (--json for a report)');
|
|
84
|
+
console.error(" bundle Bundle endpoints (src/api/*.ts, or an automation's src/index.ts) for cloudflare-lambda");
|
|
85
|
+
console.error(' describe Print what a built TanStack Start app declares: functions, routes, access');
|
|
86
|
+
console.error('');
|
|
87
|
+
console.error("A Start app under `vite dev` reaches Zite's data and services with these, from the app's .env:");
|
|
88
|
+
console.error(" ZITE_DEV_API_KEY Your Zite API key, as the MCP takes it: mints dev tokens for the app zite.config.json's id names; each lasts 15 minutes and is renewed before it expires");
|
|
89
|
+
console.error(' ZITE_DEV_TOKEN A dev token to use as it is instead, never renewed');
|
|
90
|
+
console.error(' ZITE_URLS JSON naming the platform: {"baseRunner","backend","gateway"?,"runs"?,"email"?,"pdf"?,"uploads"?,"steps"?,"schedules"?}; email, pdf, uploads or schedules left out are the backend\'s');
|
|
91
|
+
console.error(' ZITE_DEV_USER JSON of the signed-in stand-in: {"id","email","name"?,"roles"?,"isInternal"?}; unset, nobody is');
|
|
79
92
|
process.exit(1);
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
|
-
main().catch(
|
|
95
|
+
main().catch(err => {
|
|
83
96
|
console.error(err.message);
|
|
84
97
|
process.exit(1);
|
|
85
98
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldType } from
|
|
1
|
+
import type { FieldType } from '../types/fields.js';
|
|
2
2
|
export type Record = {
|
|
3
3
|
id: string;
|
|
4
4
|
data: {
|
|
@@ -23,7 +23,7 @@ export type RecordListOptions = {
|
|
|
23
23
|
};
|
|
24
24
|
type SortQuery = {
|
|
25
25
|
field: string;
|
|
26
|
-
direction:
|
|
26
|
+
direction: 'asc' | 'desc';
|
|
27
27
|
};
|
|
28
28
|
type FilterQuery = ({
|
|
29
29
|
field: string;
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Zite = void 0;
|
|
4
|
-
const TOKEN_PREFIXES = [
|
|
4
|
+
const TOKEN_PREFIXES = ['sk_prod_', 'fillout_token_'];
|
|
5
5
|
function isValidToken(token) {
|
|
6
|
-
return TOKEN_PREFIXES.some(
|
|
6
|
+
return TOKEN_PREFIXES.some(prefix => token.startsWith(prefix));
|
|
7
7
|
}
|
|
8
8
|
const ziteError = async (verb, res) => {
|
|
9
|
-
const ct = res.headers.get(
|
|
10
|
-
if (ct ===
|
|
9
|
+
const ct = res.headers.get('Content-Type')?.split(';')[0];
|
|
10
|
+
if (ct === 'application/json') {
|
|
11
11
|
const body = await res.json();
|
|
12
12
|
if (body?.error?.message)
|
|
13
13
|
return new Error(body.error.message);
|
|
@@ -18,18 +18,18 @@ class Zite {
|
|
|
18
18
|
token;
|
|
19
19
|
baseUrl;
|
|
20
20
|
constructor(token) {
|
|
21
|
-
if (typeof token !==
|
|
22
|
-
throw new Error(
|
|
21
|
+
if (typeof token !== 'string' || !isValidToken(token)) {
|
|
22
|
+
throw new Error('Invalid Zite API key. Visit https://build.fillout.com/home/settings/developer to create one.');
|
|
23
23
|
}
|
|
24
24
|
this.token = token;
|
|
25
|
-
this.baseUrl =
|
|
25
|
+
this.baseUrl = 'https://tables.fillout.com/api/v1';
|
|
26
26
|
}
|
|
27
27
|
request = async (method, url, verb, body) => {
|
|
28
28
|
const res = await fetch(this.baseUrl + url, {
|
|
29
29
|
method,
|
|
30
30
|
headers: {
|
|
31
31
|
Authorization: `Bearer ${this.token}`,
|
|
32
|
-
...(body ? {
|
|
32
|
+
...(body ? { 'Content-Type': 'application/json' } : {}),
|
|
33
33
|
},
|
|
34
34
|
body: body ? JSON.stringify(body) : undefined,
|
|
35
35
|
});
|
|
@@ -39,29 +39,29 @@ class Zite {
|
|
|
39
39
|
return data;
|
|
40
40
|
};
|
|
41
41
|
record = {
|
|
42
|
-
create: (databaseId, tableId, record) => this.request(
|
|
43
|
-
bulkCreate: (databaseId, tableId, records, matchOn) => this.request(
|
|
44
|
-
get: (databaseId, tableId, recordId) => this.request(
|
|
45
|
-
update: (databaseId, tableId, recordId, record) => this.request(
|
|
46
|
-
bulkUpdate: (databaseId, tableId, records) => this.request(
|
|
47
|
-
delete: (databaseId, tableId, recordId) => this.request(
|
|
48
|
-
list: (databaseId, tableId, options) => this.request(
|
|
42
|
+
create: (databaseId, tableId, record) => this.request('POST', `/bases/${e(databaseId)}/tables/${e(tableId)}/records`, 'create record', { record }),
|
|
43
|
+
bulkCreate: (databaseId, tableId, records, matchOn) => this.request('POST', `/bases/${e(databaseId)}/tables/${e(tableId)}/records/bulk`, 'bulk create records', { records, matchOn }),
|
|
44
|
+
get: (databaseId, tableId, recordId) => this.request('GET', `/bases/${e(databaseId)}/tables/${e(tableId)}/records/${e(recordId)}`, 'get record'),
|
|
45
|
+
update: (databaseId, tableId, recordId, record) => this.request('PATCH', `/bases/${e(databaseId)}/tables/${e(tableId)}/records/${e(recordId)}`, 'update record', { record }),
|
|
46
|
+
bulkUpdate: (databaseId, tableId, records) => this.request('PUT', `/bases/${e(databaseId)}/tables/${e(tableId)}/records/bulk`, 'bulk update records', { records }),
|
|
47
|
+
delete: (databaseId, tableId, recordId) => this.request('DELETE', `/bases/${e(databaseId)}/tables/${e(tableId)}/records/${e(recordId)}`, 'delete record'),
|
|
48
|
+
list: (databaseId, tableId, options) => this.request('POST', `/bases/${e(databaseId)}/tables/${e(tableId)}/records/list`, 'list records', options),
|
|
49
49
|
};
|
|
50
50
|
field = {
|
|
51
|
-
create: (databaseId, tableId, field) => this.request(
|
|
52
|
-
update: (databaseId, tableId, fieldId, field) => this.request(
|
|
53
|
-
delete: (databaseId, tableId, fieldId) => this.request(
|
|
51
|
+
create: (databaseId, tableId, field) => this.request('POST', `/bases/${e(databaseId)}/tables/${e(tableId)}/fields`, 'create field', field),
|
|
52
|
+
update: (databaseId, tableId, fieldId, field) => this.request('PATCH', `/bases/${e(databaseId)}/tables/${e(tableId)}/fields/${e(fieldId)}`, 'update field', field),
|
|
53
|
+
delete: (databaseId, tableId, fieldId) => this.request('DELETE', `/bases/${e(databaseId)}/tables/${e(tableId)}/fields/${e(fieldId)}`, 'delete field'),
|
|
54
54
|
};
|
|
55
55
|
table = {
|
|
56
|
-
create: (databaseId, table) => this.request(
|
|
57
|
-
update: (databaseId, tableId, table) => this.request(
|
|
58
|
-
delete: (databaseId, tableId) => this.request(
|
|
56
|
+
create: (databaseId, table) => this.request('POST', `/bases/${e(databaseId)}/tables`, 'create table', table),
|
|
57
|
+
update: (databaseId, tableId, table) => this.request('PATCH', `/bases/${e(databaseId)}/tables/${e(tableId)}`, 'update table', table),
|
|
58
|
+
delete: (databaseId, tableId) => this.request('DELETE', `/bases/${e(databaseId)}/tables/${e(tableId)}`, 'delete table'),
|
|
59
59
|
};
|
|
60
60
|
database = {
|
|
61
|
-
create: (database) => this.request(
|
|
62
|
-
list: () => this.request(
|
|
63
|
-
get: (databaseId) => this.request(
|
|
64
|
-
delete: (databaseId) => this.request(
|
|
61
|
+
create: (database) => this.request('POST', `/bases`, 'create database', database),
|
|
62
|
+
list: () => this.request('GET', `/bases`, 'list databases'),
|
|
63
|
+
get: (databaseId) => this.request('GET', `/bases/${e(databaseId)}`, 'get database'),
|
|
64
|
+
delete: (databaseId) => this.request('DELETE', `/bases/${e(databaseId)}`, 'delete database'),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
exports.Zite = Zite;
|
package/dist/cjs/dev/index.js
CHANGED
|
@@ -7,7 +7,9 @@ const fs_1 = require("fs");
|
|
|
7
7
|
const fs_2 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const sourceRoots_js_1 = require("../sourceRoots.js");
|
|
10
|
+
const entries_js_1 = require("../start/build/entries.js");
|
|
10
11
|
const index_js_1 = require("../sync/index.js");
|
|
12
|
+
const signin_js_1 = require("./signin.js");
|
|
11
13
|
const lib_js_1 = require("../sync/lib.js");
|
|
12
14
|
const rules_js_1 = require("../integrations/rules.js");
|
|
13
15
|
const debounceTimers = new Map();
|
|
@@ -19,9 +21,9 @@ function debounce(key, fn, ms) {
|
|
|
19
21
|
}
|
|
20
22
|
function getFlowId(appDir) {
|
|
21
23
|
try {
|
|
22
|
-
const configPath = (0, path_1.join)(appDir.path,
|
|
24
|
+
const configPath = (0, path_1.join)(appDir.path, 'zite.config.json');
|
|
23
25
|
if ((0, fs_2.existsSync)(configPath)) {
|
|
24
|
-
const config = JSON.parse((0, fs_2.readFileSync)(configPath,
|
|
26
|
+
const config = JSON.parse((0, fs_2.readFileSync)(configPath, 'utf-8'));
|
|
25
27
|
return config.id;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
@@ -31,7 +33,7 @@ function getFlowId(appDir) {
|
|
|
31
33
|
const readJsonFile = (path) => {
|
|
32
34
|
try {
|
|
33
35
|
return (0, fs_2.existsSync)(path)
|
|
34
|
-
? JSON.parse((0, fs_2.readFileSync)(path,
|
|
36
|
+
? JSON.parse((0, fs_2.readFileSync)(path, 'utf-8'))
|
|
35
37
|
: undefined;
|
|
36
38
|
}
|
|
37
39
|
catch {
|
|
@@ -39,19 +41,19 @@ const readJsonFile = (path) => {
|
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
43
|
function getEmailIntegrationId(appDir) {
|
|
42
|
-
return (0, lib_js_1.findEmailIntegrationId)(readJsonFile((0, path_1.join)(appDir.path,
|
|
44
|
+
return (0, lib_js_1.findEmailIntegrationId)(readJsonFile((0, path_1.join)(appDir.path, 'zite.config.json')), readJsonFile('zite.config.json'));
|
|
43
45
|
}
|
|
44
46
|
// `{}` with no file; undefined when unreadable, so a failed read keeps the old file.
|
|
45
47
|
const readConfigIntegrations = (path) => {
|
|
46
48
|
if (!(0, fs_2.existsSync)(path))
|
|
47
49
|
return {};
|
|
48
50
|
const config = readJsonFile(path);
|
|
49
|
-
if (typeof config !==
|
|
51
|
+
if (typeof config !== 'object' || config === null)
|
|
50
52
|
return undefined;
|
|
51
53
|
const { integrations } = config;
|
|
52
54
|
if (integrations == null)
|
|
53
55
|
return {};
|
|
54
|
-
return typeof integrations ===
|
|
56
|
+
return typeof integrations === 'object' && !Array.isArray(integrations)
|
|
55
57
|
? integrations
|
|
56
58
|
: undefined;
|
|
57
59
|
};
|
|
@@ -62,9 +64,9 @@ const readConfigIntegrations = (path) => {
|
|
|
62
64
|
function projectRuntimeHasIntegrationsClient(fromDir, projectRoot = process.cwd()) {
|
|
63
65
|
const root = (0, path_1.resolve)(projectRoot);
|
|
64
66
|
for (let dir = (0, path_1.resolve)(fromDir);; dir = (0, path_1.dirname)(dir)) {
|
|
65
|
-
const pkg = readJsonFile((0, path_1.join)(dir,
|
|
67
|
+
const pkg = readJsonFile((0, path_1.join)(dir, 'node_modules', 'zitejs', 'package.json'));
|
|
66
68
|
if (pkg)
|
|
67
|
-
return pkg.exports?.[
|
|
69
|
+
return pkg.exports?.['./integrations'] !== undefined;
|
|
68
70
|
if (dir === root || (0, path_1.dirname)(dir) === dir)
|
|
69
71
|
return false;
|
|
70
72
|
}
|
|
@@ -73,22 +75,22 @@ function projectRuntimeHasIntegrationsClient(fromDir, projectRoot = process.cwd(
|
|
|
73
75
|
function regenerateAppIntegrationsIndex(appDir) {
|
|
74
76
|
if (!projectRuntimeHasIntegrationsClient(appDir.path))
|
|
75
77
|
return;
|
|
76
|
-
const root = readConfigIntegrations(
|
|
77
|
-
const own = readConfigIntegrations((0, path_1.join)(appDir.path,
|
|
78
|
+
const root = readConfigIntegrations('zite.config.json');
|
|
79
|
+
const own = readConfigIntegrations((0, path_1.join)(appDir.path, 'zite.config.json'));
|
|
78
80
|
if (!root || !own)
|
|
79
81
|
return;
|
|
80
|
-
const intDir = (0, path_1.join)(appDir.path,
|
|
82
|
+
const intDir = (0, path_1.join)(appDir.path, '.zite', 'integrations');
|
|
81
83
|
(0, fs_2.mkdirSync)(intDir, { recursive: true });
|
|
82
|
-
(0, fs_2.writeFileSync)((0, path_1.join)(intDir,
|
|
83
|
-
reexportAirtable: (0, fs_2.existsSync)((0, path_1.join)(intDir,
|
|
84
|
+
(0, fs_2.writeFileSync)((0, path_1.join)(intDir, 'index.ts'), (0, lib_js_1.generateIntegrationsIndex)((0, rules_js_1.gettableIntegrations)(root, own), {
|
|
85
|
+
reexportAirtable: (0, fs_2.existsSync)((0, path_1.join)(intDir, 'airtable.ts')),
|
|
84
86
|
}));
|
|
85
87
|
}
|
|
86
88
|
function getDeclaredEnvVarNames(appDir) {
|
|
87
89
|
try {
|
|
88
|
-
const configPath = (0, path_1.join)(appDir.path,
|
|
90
|
+
const configPath = (0, path_1.join)(appDir.path, 'zite.config.json');
|
|
89
91
|
if (!(0, fs_2.existsSync)(configPath))
|
|
90
92
|
return [];
|
|
91
|
-
const config = JSON.parse((0, fs_2.readFileSync)(configPath,
|
|
93
|
+
const config = JSON.parse((0, fs_2.readFileSync)(configPath, 'utf-8'));
|
|
92
94
|
return Object.keys(config.envVars ?? {});
|
|
93
95
|
}
|
|
94
96
|
catch {
|
|
@@ -96,7 +98,8 @@ function getDeclaredEnvVarNames(appDir) {
|
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
function regenerateAppTypedWrappers(appDir) {
|
|
99
|
-
const
|
|
101
|
+
const runtime = (0, entries_js_1.isStartAppDir)(appDir.path) ? 'start' : 'classic';
|
|
102
|
+
const outDir = (0, path_1.join)(appDir.path, '.zite');
|
|
100
103
|
(0, fs_2.mkdirSync)(outDir, { recursive: true });
|
|
101
104
|
// user.ts and auth.ts no longer generated — User type is fixed in zitejs/auth
|
|
102
105
|
// Email integration: generate the Email client at .zite/integrations/email.ts.
|
|
@@ -104,14 +107,21 @@ function regenerateAppTypedWrappers(appDir) {
|
|
|
104
107
|
// `zitejs/integrations`), so endpoint code uses `import { Email } from 'zitejs/email'`.
|
|
105
108
|
const emailIntegrationId = getEmailIntegrationId(appDir);
|
|
106
109
|
if (emailIntegrationId) {
|
|
107
|
-
const intDir = (0, path_1.join)(outDir,
|
|
110
|
+
const intDir = (0, path_1.join)(outDir, 'integrations');
|
|
108
111
|
(0, fs_2.mkdirSync)(intDir, { recursive: true });
|
|
109
|
-
(0, fs_2.writeFileSync)((0, path_1.join)(intDir,
|
|
112
|
+
(0, fs_2.writeFileSync)((0, path_1.join)(intDir, 'email.ts'), (0, lib_js_1.generateEmailSdk)(emailIntegrationId, runtime));
|
|
110
113
|
}
|
|
111
|
-
|
|
114
|
+
// A Start app imports none of zitejs/backend, which `zite-start` types as
|
|
115
|
+
// empty; this classic wrapper would only break its typecheck.
|
|
116
|
+
const backendPath = (0, path_1.join)(outDir, 'backend.ts');
|
|
117
|
+
if (runtime === 'start') {
|
|
118
|
+
(0, fs_2.rmSync)(backendPath, { force: true });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
(0, fs_2.writeFileSync)(backendPath, (0, lib_js_1.generateBackendWrapperTs)(getDeclaredEnvVarNames(appDir)));
|
|
112
122
|
}
|
|
113
123
|
function regenerateAppApiTs(appDir) {
|
|
114
|
-
const apiDir = (0, path_1.join)(appDir.path,
|
|
124
|
+
const apiDir = (0, path_1.join)(appDir.path, 'src', 'api');
|
|
115
125
|
if (!(0, fs_2.existsSync)(apiDir))
|
|
116
126
|
return;
|
|
117
127
|
// Sorted because `readdir` order is unspecified — it is whatever the
|
|
@@ -123,27 +133,27 @@ function regenerateAppApiTs(appDir) {
|
|
|
123
133
|
// genuine one-endpoint addition shows up as a rewrite of the whole file
|
|
124
134
|
// instead of a few added lines.
|
|
125
135
|
const endpointFiles = (0, fs_2.readdirSync)(apiDir)
|
|
126
|
-
.filter((f) => f.endsWith(
|
|
136
|
+
.filter((f) => f.endsWith('.ts') || f.endsWith('.js'))
|
|
127
137
|
.sort()
|
|
128
138
|
.map((f) => ({
|
|
129
139
|
fileName: f,
|
|
130
|
-
content: (0, fs_2.readFileSync)((0, path_1.join)(apiDir, f),
|
|
140
|
+
content: (0, fs_2.readFileSync)((0, path_1.join)(apiDir, f), 'utf-8'),
|
|
131
141
|
}));
|
|
132
142
|
const content = (0, lib_js_1.generateApiTs)(endpointFiles);
|
|
133
143
|
if (content) {
|
|
134
|
-
const outDir = (0, path_1.join)(appDir.path,
|
|
144
|
+
const outDir = (0, path_1.join)(appDir.path, '.zite');
|
|
135
145
|
(0, fs_2.mkdirSync)(outDir, { recursive: true });
|
|
136
|
-
(0, fs_2.writeFileSync)((0, path_1.join)(outDir,
|
|
146
|
+
(0, fs_2.writeFileSync)((0, path_1.join)(outDir, 'api.ts'), content);
|
|
137
147
|
console.log(`Updated ${appDir.path}/.zite/api.ts`);
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
150
|
function regenerateAppAirtableSdk(appDir) {
|
|
141
|
-
const lockPath = (0, path_1.join)(appDir.path,
|
|
151
|
+
const lockPath = (0, path_1.join)(appDir.path, 'zite.lock');
|
|
142
152
|
console.log(`[airtable-sdk] Checking ${lockPath} exists: ${(0, fs_2.existsSync)(lockPath)}`);
|
|
143
153
|
if (!(0, fs_2.existsSync)(lockPath))
|
|
144
154
|
return;
|
|
145
155
|
try {
|
|
146
|
-
const lockContent = JSON.parse((0, fs_2.readFileSync)(lockPath,
|
|
156
|
+
const lockContent = JSON.parse((0, fs_2.readFileSync)(lockPath, 'utf-8'));
|
|
147
157
|
const integrations = lockContent.integrations ?? {};
|
|
148
158
|
console.log(`[airtable-sdk] Found ${Object.keys(integrations).length} integrations in lock:`, Object.keys(integrations));
|
|
149
159
|
for (const [integrationId, integration] of Object.entries(integrations)) {
|
|
@@ -157,11 +167,11 @@ function regenerateAppAirtableSdk(appDir) {
|
|
|
157
167
|
integrationId,
|
|
158
168
|
tables: int.idMappings.tables,
|
|
159
169
|
};
|
|
160
|
-
const content = (0, lib_js_1.generateAirtableTs)(airtableLock);
|
|
170
|
+
const content = (0, lib_js_1.generateAirtableTs)(airtableLock, (0, entries_js_1.isStartAppDir)(appDir.path) ? 'start' : 'classic');
|
|
161
171
|
if (content) {
|
|
162
|
-
const outDir = (0, path_1.join)(appDir.path,
|
|
172
|
+
const outDir = (0, path_1.join)(appDir.path, '.zite', 'integrations');
|
|
163
173
|
(0, fs_2.mkdirSync)(outDir, { recursive: true });
|
|
164
|
-
(0, fs_2.writeFileSync)((0, path_1.join)(outDir,
|
|
174
|
+
(0, fs_2.writeFileSync)((0, path_1.join)(outDir, 'airtable.ts'), content);
|
|
165
175
|
console.log(`Updated ${appDir.path}/.zite/integrations/airtable.ts`);
|
|
166
176
|
}
|
|
167
177
|
}
|
|
@@ -181,22 +191,24 @@ async function runGenerate() {
|
|
|
181
191
|
// Everything below reads relative paths, so run from an app dir this would
|
|
182
192
|
// find no source roots, write nothing, and still print "Done!".
|
|
183
193
|
const workspaceRoot = (0, sourceRoots_js_1.findWorkspaceRoot)();
|
|
184
|
-
if (workspaceRoot && workspaceRoot !== (0, path_1.resolve)(
|
|
194
|
+
if (workspaceRoot && workspaceRoot !== (0, path_1.resolve)('.')) {
|
|
185
195
|
console.log(`Running from the workspace root: ${workspaceRoot}`);
|
|
186
196
|
process.chdir(workspaceRoot);
|
|
187
197
|
}
|
|
188
198
|
// 1. Generate root .zite/db.ts from zite.schema.json
|
|
189
199
|
try {
|
|
190
|
-
if ((0, fs_2.existsSync)(
|
|
191
|
-
const schema = JSON.parse((0, fs_2.readFileSync)(
|
|
192
|
-
const dbTs = (0, lib_js_1.generateDbTs)(schema
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
if ((0, fs_2.existsSync)('zite.schema.json')) {
|
|
201
|
+
const schema = JSON.parse((0, fs_2.readFileSync)('zite.schema.json', 'utf-8'));
|
|
202
|
+
const dbTs = (0, lib_js_1.generateDbTs)(schema, {
|
|
203
|
+
hasStartApps: (0, entries_js_1.workspaceHasStartApps)(),
|
|
204
|
+
});
|
|
205
|
+
(0, fs_2.mkdirSync)('.zite', { recursive: true });
|
|
206
|
+
(0, fs_2.writeFileSync)((0, path_1.join)('.zite', 'db.ts'), dbTs);
|
|
207
|
+
console.log('Wrote .zite/db.ts');
|
|
196
208
|
}
|
|
197
209
|
}
|
|
198
210
|
catch (err) {
|
|
199
|
-
console.warn(
|
|
211
|
+
console.warn('DB SDK generation failed:', err instanceof Error ? err.message : err);
|
|
200
212
|
}
|
|
201
213
|
// 2. Find every app and automation and regenerate their .zite/ files
|
|
202
214
|
const appDirs = (0, sourceRoots_js_1.listSourceDirs)();
|
|
@@ -205,32 +217,48 @@ async function runGenerate() {
|
|
|
205
217
|
regenerateAppTypedWrappers(app);
|
|
206
218
|
regenerateAppAirtableSdk(app);
|
|
207
219
|
regenerateAppIntegrationsIndex(app);
|
|
220
|
+
(0, entries_js_1.regenerateStartEntries)(app);
|
|
208
221
|
}
|
|
209
|
-
console.log(
|
|
222
|
+
console.log('Done!');
|
|
210
223
|
}
|
|
211
224
|
async function runDev() {
|
|
212
|
-
const env = process.env.ZITE_ENV ??
|
|
225
|
+
const env = process.env.ZITE_ENV ?? 'production';
|
|
213
226
|
console.log(`zitejs dev — environment: ${env}`);
|
|
214
|
-
console.log(
|
|
227
|
+
console.log('');
|
|
215
228
|
// 1. Run initial sync (generates root .zite/db.ts)
|
|
216
229
|
try {
|
|
217
230
|
await (0, index_js_1.runSync)();
|
|
218
231
|
}
|
|
219
232
|
catch (err) {
|
|
220
|
-
console.warn(
|
|
233
|
+
console.warn('Initial sync failed (continuing with watcher):', err instanceof Error ? err.message : err);
|
|
221
234
|
}
|
|
222
|
-
console.log(
|
|
235
|
+
console.log('');
|
|
223
236
|
// 2. Find every app and automation and regenerate their .zite/ files
|
|
224
237
|
const appDirs = (0, sourceRoots_js_1.listSourceDirs)();
|
|
225
238
|
for (const app of appDirs) {
|
|
226
239
|
regenerateAppApiTs(app);
|
|
227
240
|
regenerateAppTypedWrappers(app);
|
|
228
241
|
regenerateAppIntegrationsIndex(app);
|
|
242
|
+
(0, entries_js_1.regenerateStartEntries)(app);
|
|
243
|
+
}
|
|
244
|
+
// Sign-in under `vite dev`: each Start app's issuer, dev client and session secret.
|
|
245
|
+
for (const app of appDirs) {
|
|
246
|
+
if (!(0, entries_js_1.isStartAppDir)(app.path))
|
|
247
|
+
continue;
|
|
248
|
+
try {
|
|
249
|
+
const result = await (0, signin_js_1.writeDevSignIn)(app.path);
|
|
250
|
+
console.log(result.written
|
|
251
|
+
? `Sign-in for ${app.path} under vite dev: ${result.clientId} at ${result.issuer}`
|
|
252
|
+
: `No sign-in for ${app.path} under vite dev: ${result.reason}`);
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
console.warn(`Couldn't set up sign-in for ${app.path}:`, err instanceof Error ? err.message : err);
|
|
256
|
+
}
|
|
229
257
|
}
|
|
230
258
|
// 3. Watch each dir's src/api/ for endpoint changes
|
|
231
259
|
let watchingAny = false;
|
|
232
260
|
for (const app of appDirs) {
|
|
233
|
-
const apiDir = (0, path_1.join)(app.path,
|
|
261
|
+
const apiDir = (0, path_1.join)(app.path, 'src', 'api');
|
|
234
262
|
if (!(0, fs_2.existsSync)(apiDir))
|
|
235
263
|
continue;
|
|
236
264
|
watchingAny = true;
|
|
@@ -238,7 +266,7 @@ async function runDev() {
|
|
|
238
266
|
(0, fs_1.watch)(apiDir, { recursive: true }, (_event, filename) => {
|
|
239
267
|
if (!filename)
|
|
240
268
|
return;
|
|
241
|
-
if (!filename.endsWith(
|
|
269
|
+
if (!filename.endsWith('.ts') && !filename.endsWith('.js'))
|
|
242
270
|
return;
|
|
243
271
|
debounce(app.path, () => {
|
|
244
272
|
console.log(`Endpoint changed in ${app.path}: ${filename}`);
|
|
@@ -247,24 +275,24 @@ async function runDev() {
|
|
|
247
275
|
});
|
|
248
276
|
}
|
|
249
277
|
if (!watchingAny) {
|
|
250
|
-
console.log(
|
|
278
|
+
console.log('No apps with src/api/ found.');
|
|
251
279
|
}
|
|
252
280
|
// 4. Watch zite.schema.json for schema drift
|
|
253
|
-
if ((0, fs_2.existsSync)(
|
|
254
|
-
console.log(
|
|
255
|
-
(0, fs_1.watch)(
|
|
256
|
-
debounce(
|
|
257
|
-
console.log(
|
|
281
|
+
if ((0, fs_2.existsSync)('zite.schema.json')) {
|
|
282
|
+
console.log('Watching zite.schema.json for schema changes...');
|
|
283
|
+
(0, fs_1.watch)('zite.schema.json', () => {
|
|
284
|
+
debounce('schema', async () => {
|
|
285
|
+
console.log('Schema changed — re-running sync...');
|
|
258
286
|
try {
|
|
259
287
|
await (0, index_js_1.runSync)();
|
|
260
288
|
}
|
|
261
289
|
catch (err) {
|
|
262
|
-
console.error(
|
|
290
|
+
console.error('Re-sync failed:', err instanceof Error ? err.message : err);
|
|
263
291
|
}
|
|
264
292
|
}, 500);
|
|
265
293
|
});
|
|
266
294
|
}
|
|
267
|
-
console.log(
|
|
268
|
-
console.log(
|
|
295
|
+
console.log('');
|
|
296
|
+
console.log('Ready. Watching for changes... (Ctrl+C to stop)');
|
|
269
297
|
await new Promise(() => { });
|
|
270
298
|
}
|