zitejs 0.10.0-start.9 → 0.10.1-device.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/auth/actions.d.ts +28 -0
- package/dist/cjs/auth/actions.js +95 -0
- package/dist/cjs/auth/client.d.ts +357 -0
- package/dist/cjs/auth/client.js +71 -0
- package/dist/cjs/auth/config.js +9 -3
- package/dist/cjs/auth/index.d.ts +2 -249
- package/dist/cjs/auth/index.js +11 -108
- package/dist/cjs/auth/index.test.js +60 -0
- package/dist/cjs/auth/previewClaim.d.ts +7 -0
- package/dist/cjs/auth/previewClaim.js +16 -0
- package/dist/cjs/auth/profileUpdates.d.ts +9 -0
- package/dist/cjs/auth/profileUpdates.js +11 -0
- package/dist/cjs/auth/useAuth.test.js +1 -0
- package/dist/cjs/backend/index.d.ts +15 -9
- package/dist/cjs/backend/index.js +13 -13
- package/dist/cjs/backend/index.test.js +102 -102
- package/dist/cjs/bundle/index.d.ts +8 -0
- package/dist/cjs/bundle/index.js +38 -24
- package/dist/cjs/caller/index.js +37 -48
- package/dist/cjs/check/index.d.ts +20 -9
- package/dist/cjs/check/index.js +113 -88
- package/dist/cjs/check/start/routeTree.d.ts +8 -0
- package/dist/cjs/check/start/routeTree.js +118 -0
- package/dist/cjs/check/start/tsgo.d.ts +2 -0
- package/dist/cjs/check/start/tsgo.js +35 -0
- package/dist/cjs/cli.js +10 -4
- package/dist/cjs/client/index.d.ts +26 -2
- package/dist/cjs/client/index.js +25 -25
- package/dist/cjs/dev/index.js +79 -54
- package/dist/cjs/dev/signin.d.ts +16 -0
- package/dist/cjs/dev/signin.js +84 -0
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/integrations/client.d.ts +3 -3
- package/dist/cjs/integrations/client.js +5 -4
- package/dist/cjs/integrations/client.test-d.js +15 -15
- package/dist/cjs/integrations/index.d.ts +2 -2
- package/dist/cjs/integrations/rules.d.ts +1 -0
- package/dist/cjs/integrations/rules.js +48 -43
- package/dist/cjs/integrations/rules.test.js +60 -54
- package/dist/cjs/internal/appMode.d.ts +14 -0
- package/dist/cjs/internal/appMode.js +19 -0
- package/dist/cjs/internal/browserMode.d.ts +2 -0
- package/dist/cjs/internal/browserMode.js +18 -0
- package/dist/cjs/internal/deviceCache.d.ts +11 -0
- package/dist/cjs/internal/deviceCache.js +29 -0
- package/dist/cjs/internal/env.js +3 -2
- package/dist/cjs/internal/platformFetch.d.ts +2 -0
- package/dist/cjs/internal/platformFetch.js +14 -0
- package/dist/cjs/internal/reservedIds.d.ts +8 -0
- package/dist/cjs/internal/reservedIds.js +14 -0
- package/dist/cjs/internal/serviceUrls.d.ts +5 -0
- package/dist/cjs/internal/serviceUrls.js +14 -0
- package/dist/cjs/pdf/index.js +2 -1
- package/dist/cjs/query/deviceCache.d.ts +14 -0
- package/dist/cjs/query/deviceCache.js +304 -0
- package/dist/cjs/query/index.d.ts +19 -0
- package/dist/cjs/query/index.js +369 -0
- package/dist/cjs/runtime/filterConditionTypes.test-d.js +11 -11
- package/dist/cjs/runtime/index.d.ts +126 -39
- package/dist/cjs/runtime/index.js +32 -26
- package/dist/cjs/runtime/index.test.js +34 -34
- package/dist/cjs/runtime/sendEmailParamsTypes.test-d.js +50 -0
- package/dist/cjs/runtime/writeResultTypes.test-d.js +8 -8
- package/dist/cjs/sourceRoots.js +15 -15
- package/dist/cjs/sourceRoots.test.js +29 -27
- package/dist/cjs/start/{entries.d.ts → build/entries.d.ts} +9 -4
- package/dist/cjs/start/{entries.js → build/entries.js} +38 -21
- package/dist/cjs/start/build/placeholders/devApp.d.ts +1 -0
- package/dist/cjs/start/build/placeholders/devApp.js +6 -0
- package/dist/cjs/start/{describeBuilt.d.ts → describe/describeBuilt.d.ts} +2 -0
- package/dist/cjs/start/{describeBuilt.js → describe/describeBuilt.js} +55 -17
- package/dist/cjs/start/platform/aiUsage.d.ts +29 -0
- package/dist/cjs/start/platform/aiUsage.js +215 -0
- package/dist/cjs/start/platform/airtable/cache.d.ts +17 -0
- package/dist/cjs/start/platform/airtable/cache.js +93 -0
- package/dist/cjs/start/protocol.d.ts +19 -0
- package/dist/cjs/start/protocol.js +33 -0
- package/dist/cjs/start/serve/local/provider.d.ts +25 -0
- package/dist/cjs/start/serve/local/provider.js +196 -0
- package/dist/cjs/start/serve/provider.d.ts +19 -0
- package/dist/cjs/start/serve/provider.js +86 -0
- package/dist/cjs/start/types.d.ts +373 -0
- package/dist/cjs/start/types.js +2 -0
- package/dist/cjs/steps/index.d.ts +78 -0
- package/dist/cjs/steps/index.js +507 -0
- package/dist/cjs/steps/index.test.js +635 -0
- package/dist/cjs/sync/index.d.ts +1 -1
- package/dist/cjs/sync/index.js +28 -27
- package/dist/cjs/sync/lib.d.ts +15 -8
- package/dist/cjs/sync/lib.js +655 -655
- package/dist/cjs/sync/lib.test.js +177 -46
- package/dist/cjs/sync/sdkNames.d.ts +67 -9
- package/dist/cjs/sync/sdkNames.js +97 -31
- package/dist/cjs/sync/sdkNames.test.js +189 -113
- package/dist/cjs/types/fields.d.ts +9 -2
- package/dist/cjs/types/fields.js +110 -96
- package/dist/cjs/types/index.d.ts +2 -2
- package/dist/cjs/types/tables.d.ts +17 -1
- package/dist/cjs/upload/index.js +89 -24
- package/dist/cjs/upload/index.test.js +104 -1
- package/dist/cjs/vite/domTagNames.js +252 -252
- package/dist/cjs/vite/index.d.ts +1 -1
- package/dist/cjs/vite/index.js +87 -42
- package/dist/cjs/vite/index.test.js +36 -0
- package/dist/esm/auth/actions.d.ts +28 -0
- package/dist/esm/auth/actions.js +57 -0
- package/dist/esm/auth/client.d.ts +357 -0
- package/dist/esm/auth/client.js +67 -0
- package/dist/esm/auth/config.js +9 -3
- package/dist/esm/auth/index.d.ts +2 -249
- package/dist/esm/auth/index.js +2 -103
- package/dist/esm/auth/index.test.js +60 -0
- package/dist/esm/auth/previewClaim.d.ts +7 -0
- package/dist/esm/auth/previewClaim.js +12 -0
- package/dist/esm/auth/profileUpdates.d.ts +9 -0
- package/dist/esm/auth/profileUpdates.js +6 -0
- package/dist/esm/auth/useAuth.test.js +1 -0
- package/dist/esm/backend/index.d.ts +15 -9
- package/dist/esm/backend/index.js +13 -13
- package/dist/esm/backend/index.test.js +106 -106
- package/dist/esm/bundle/index.d.ts +8 -0
- package/dist/esm/bundle/index.js +37 -24
- package/dist/esm/caller/index.js +37 -48
- package/dist/esm/check/index.d.ts +20 -9
- package/dist/esm/check/index.js +117 -93
- package/dist/esm/check/start/routeTree.d.ts +8 -0
- package/dist/esm/check/start/routeTree.js +77 -0
- package/dist/esm/check/start/tsgo.d.ts +2 -0
- package/dist/esm/check/start/tsgo.js +29 -0
- package/dist/esm/cli.js +10 -4
- package/dist/esm/client/index.d.ts +26 -2
- package/dist/esm/client/index.js +25 -25
- package/dist/esm/dev/index.js +86 -61
- package/dist/esm/dev/signin.d.ts +16 -0
- package/dist/esm/dev/signin.js +80 -0
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +3 -3
- package/dist/esm/integrations/client.d.ts +3 -3
- package/dist/esm/integrations/client.js +6 -5
- package/dist/esm/integrations/client.test-d.js +19 -19
- package/dist/esm/integrations/index.d.ts +2 -2
- package/dist/esm/integrations/index.js +1 -1
- package/dist/esm/integrations/rules.d.ts +1 -0
- package/dist/esm/integrations/rules.js +48 -43
- package/dist/esm/integrations/rules.test.js +62 -56
- package/dist/esm/internal/appMode.d.ts +14 -0
- package/dist/esm/internal/appMode.js +13 -0
- package/dist/esm/internal/browserMode.d.ts +2 -0
- package/dist/esm/internal/browserMode.js +15 -0
- package/dist/esm/internal/deviceCache.d.ts +11 -0
- package/dist/esm/internal/deviceCache.js +24 -0
- package/dist/esm/internal/env.js +3 -2
- package/dist/esm/internal/platformFetch.d.ts +2 -0
- package/dist/esm/internal/platformFetch.js +9 -0
- package/dist/esm/internal/reservedIds.d.ts +8 -0
- package/dist/esm/internal/reservedIds.js +10 -0
- package/dist/esm/internal/serviceUrls.d.ts +5 -0
- package/dist/esm/internal/serviceUrls.js +10 -0
- package/dist/esm/pdf/index.js +2 -1
- package/dist/esm/query/deviceCache.d.ts +14 -0
- package/dist/esm/query/deviceCache.js +301 -0
- package/dist/esm/query/index.d.ts +19 -0
- package/dist/esm/query/index.js +366 -0
- package/dist/esm/runtime/filterConditionTypes.test-d.js +12 -12
- package/dist/esm/runtime/index.d.ts +126 -39
- package/dist/esm/runtime/index.js +35 -29
- package/dist/esm/runtime/index.test.js +36 -36
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +48 -0
- package/dist/esm/runtime/writeResultTypes.test-d.js +9 -9
- package/dist/esm/signin/conformance.d.ts +100 -0
- package/dist/esm/signin/conformance.js +616 -0
- package/dist/esm/signin/cookies.d.ts +28 -0
- package/dist/esm/signin/cookies.js +67 -0
- package/dist/esm/signin/encoding.d.ts +1 -0
- package/dist/esm/signin/encoding.js +12 -0
- package/dist/esm/signin/endpoints.d.ts +12 -0
- package/dist/esm/signin/endpoints.js +32 -0
- package/dist/esm/signin/http.d.ts +25 -0
- package/dist/esm/signin/http.js +106 -0
- package/dist/esm/signin/index.d.ts +8 -0
- package/dist/esm/signin/index.js +9 -0
- package/dist/esm/signin/keys.d.ts +35 -0
- package/dist/esm/signin/keys.js +230 -0
- package/dist/esm/signin/paths.d.ts +2 -0
- package/dist/esm/signin/paths.js +5 -0
- package/dist/esm/signin/seal.d.ts +19 -0
- package/dist/esm/signin/seal.js +47 -0
- package/dist/esm/signin/signin.d.ts +60 -0
- package/dist/esm/signin/signin.js +447 -0
- package/dist/esm/signin/transport.d.ts +112 -0
- package/dist/esm/signin/transport.js +1 -0
- package/dist/esm/signin/verifier.d.ts +2 -0
- package/dist/esm/signin/verifier.js +4 -0
- package/dist/esm/signin/verify.d.ts +83 -0
- package/dist/esm/signin/verify.js +142 -0
- package/dist/esm/sourceRoots.js +17 -17
- package/dist/esm/sourceRoots.test.js +34 -32
- package/dist/esm/start/access.d.ts +19 -0
- package/dist/esm/start/access.js +43 -0
- package/dist/esm/start/auth.d.ts +28 -0
- package/dist/esm/start/auth.js +33 -0
- package/dist/esm/start/automations/quiet.d.ts +2 -0
- package/dist/esm/start/automations/quiet.js +36 -0
- package/dist/esm/start/{registration.d.ts → automations/registration.d.ts} +1 -1
- package/dist/esm/start/{registration.js → automations/registration.js} +11 -7
- package/dist/esm/start/automations/steps.d.ts +29 -0
- package/dist/esm/start/automations/steps.js +95 -0
- package/dist/esm/start/automations/workflow.d.ts +83 -0
- package/dist/esm/start/automations/workflow.js +36 -0
- package/dist/esm/start/automations/workflow.test-d.d.ts +1 -0
- package/dist/esm/start/automations/workflow.test-d.js +130 -0
- package/dist/esm/start/automations/workflowRun.d.ts +130 -0
- package/dist/esm/start/automations/workflowRun.js +185 -0
- package/dist/esm/start/barrel.test-d.d.ts +10 -0
- package/dist/esm/start/barrel.test-d.js +6 -0
- package/dist/esm/start/{entries.d.ts → build/entries.d.ts} +9 -4
- package/dist/esm/start/{entries.js → build/entries.js} +38 -22
- package/dist/esm/start/build/placeholders/devApp.d.ts +1 -0
- package/dist/esm/start/build/placeholders/devApp.js +3 -0
- package/dist/esm/start/build/placeholders/devSignIn.d.ts +1 -0
- package/dist/esm/start/build/placeholders/devSignIn.js +3 -0
- package/dist/esm/start/build/placeholders/siteHead.d.ts +2 -0
- package/dist/esm/start/build/placeholders/siteHead.js +3 -0
- package/dist/esm/start/{workflowModules.js → build/placeholders/workflowModules.js} +1 -1
- package/dist/esm/start/build/placeholders/workspaceSchema.d.ts +2 -0
- package/dist/esm/start/build/placeholders/workspaceSchema.js +3 -0
- package/dist/esm/start/build/registrationHash.d.ts +11 -0
- package/dist/esm/start/build/registrationHash.js +88 -0
- package/dist/esm/start/build/sdk/axios.d.ts +76 -0
- package/dist/esm/start/build/sdk/axios.js +253 -0
- package/dist/esm/start/build/sdk/nodeFetch.d.ts +41 -0
- package/dist/esm/start/build/sdk/nodeFetch.js +35 -0
- package/dist/esm/start/build/sdk/undici.d.ts +34 -0
- package/dist/esm/start/build/sdk/undici.js +18 -0
- package/dist/esm/start/build/sdkPatches.d.ts +22 -0
- package/dist/esm/start/build/sdkPatches.js +430 -0
- package/dist/esm/start/build/siteHead.d.ts +26 -0
- package/dist/esm/start/build/siteHead.js +88 -0
- package/dist/esm/start/build/vite.d.ts +50 -0
- package/dist/esm/start/build/vite.js +491 -0
- package/dist/esm/start/classicOnly.d.ts +1 -0
- package/dist/esm/start/classicOnly.js +4 -0
- package/dist/esm/start/{describe.d.ts → describe/describe.d.ts} +44 -9
- package/dist/esm/start/describe/describe.js +372 -0
- package/dist/esm/start/{describeBuilt.d.ts → describe/describeBuilt.d.ts} +2 -0
- package/dist/esm/start/describe/describeBuilt.js +102 -0
- package/dist/esm/start/{descriptions.js → describe/descriptions.js} +17 -10
- package/dist/esm/start/errors.d.ts +15 -4
- package/dist/esm/start/errors.js +87 -28
- package/dist/esm/start/errors.test.js +47 -16
- package/dist/esm/start/factories.d.ts +14 -0
- package/dist/esm/start/factories.js +23 -0
- package/dist/esm/start/factories.test-d.d.ts +2 -1
- package/dist/esm/start/factories.test-d.js +52 -12
- package/dist/esm/start/failures.d.ts +7 -0
- package/dist/esm/start/failures.js +62 -0
- package/dist/esm/start/fnFactory.d.ts +16 -0
- package/dist/esm/start/fnFactory.js +1 -0
- package/dist/esm/start/host.d.ts +2 -2
- package/dist/esm/start/host.js +3 -3
- package/dist/esm/start/index.d.ts +10 -66
- package/dist/esm/start/index.js +7 -146
- package/dist/esm/start/login.d.ts +5 -0
- package/dist/esm/start/login.js +29 -0
- package/dist/esm/start/middlewareKind.d.ts +13 -0
- package/dist/esm/start/middlewareKind.js +9 -0
- package/dist/esm/start/platform/aiUsage.d.ts +29 -0
- package/dist/esm/start/platform/aiUsage.js +210 -0
- package/dist/esm/start/platform/airtable/built.d.ts +2 -0
- package/dist/esm/start/platform/airtable/built.js +3 -0
- package/dist/esm/start/platform/airtable/cache.d.ts +17 -0
- package/dist/esm/start/platform/airtable/cache.js +89 -0
- package/dist/esm/start/{airtable → platform/airtable}/dispatch.d.ts +5 -2
- package/dist/esm/start/{airtable → platform/airtable}/dispatch.js +195 -119
- package/dist/esm/start/{airtable → platform/airtable}/formulas.d.ts +2 -1
- package/dist/esm/start/{airtable → platform/airtable}/formulas.js +51 -25
- package/dist/esm/start/platform/airtable/index.d.ts +6 -0
- package/dist/esm/start/platform/airtable/index.js +51 -0
- package/dist/esm/start/platform/airtable/settings.d.ts +37 -0
- package/dist/esm/start/platform/airtable/settings.js +138 -0
- package/dist/esm/start/platform/analytics.d.ts +3 -0
- package/dist/esm/start/platform/analytics.js +59 -0
- package/dist/esm/start/platform/calls.d.ts +5 -0
- package/dist/esm/start/platform/calls.js +104 -0
- package/dist/esm/start/platform/caps.d.ts +9 -0
- package/dist/esm/start/platform/caps.js +35 -0
- package/dist/esm/start/platform/connections.d.ts +25 -0
- package/dist/esm/start/platform/connections.js +198 -0
- package/dist/esm/start/{data → platform/data}/baseRunner.d.ts +11 -6
- package/dist/esm/start/platform/data/baseRunner.js +117 -0
- package/dist/esm/start/{data → platform/data}/dispatch.d.ts +3 -2
- package/dist/esm/start/{data → platform/data}/dispatch.js +69 -51
- package/dist/esm/start/platform/data/fetch.d.ts +7 -0
- package/dist/esm/start/platform/data/fetch.js +9 -0
- package/dist/esm/start/platform/data/index.d.ts +27 -0
- package/dist/esm/start/platform/data/index.js +75 -0
- package/dist/esm/start/platform/data/names.d.ts +7 -0
- package/dist/esm/start/platform/data/names.js +18 -0
- package/dist/esm/start/{data → platform/data}/transformations.d.ts +0 -31
- package/dist/esm/start/{data → platform/data}/transformations.js +0 -56
- package/dist/esm/start/{data → platform/data}/types.d.ts +4 -1
- package/dist/esm/start/{data → platform/data}/types.js +2 -2
- package/dist/esm/start/platform/local.d.ts +6 -0
- package/dist/esm/start/platform/local.js +18 -0
- package/dist/esm/start/platform/meta.d.ts +3 -0
- package/dist/esm/start/platform/meta.js +33 -0
- package/dist/esm/start/platform/outbound.d.ts +17 -0
- package/dist/esm/start/platform/outbound.js +510 -0
- package/dist/esm/start/platform/redactSecrets.d.ts +13 -0
- package/dist/esm/start/{redactSecrets.js → platform/redactSecrets.js} +32 -7
- package/dist/esm/start/platform/redactSecrets.test.d.ts +1 -0
- package/dist/esm/start/platform/requestSecrets.d.ts +15 -0
- package/dist/esm/start/platform/requestSecrets.js +41 -0
- package/dist/esm/start/platform/runLog.d.ts +40 -0
- package/dist/esm/start/platform/runLog.js +149 -0
- package/dist/esm/start/platform/services.d.ts +7 -0
- package/dist/esm/start/platform/services.js +46 -0
- package/dist/esm/start/platform/steps.d.ts +9 -0
- package/dist/esm/start/platform/steps.js +60 -0
- package/dist/esm/start/platform/telemetry.d.ts +13 -0
- package/dist/esm/start/platform/telemetry.js +71 -0
- package/dist/esm/start/platform/transport.d.ts +28 -0
- package/dist/esm/start/platform/transport.js +59 -0
- package/dist/esm/start/platformHead.d.ts +23 -0
- package/dist/esm/start/platformHead.js +133 -0
- package/dist/esm/start/previewClaim.d.ts +3 -7
- package/dist/esm/start/previewClaim.js +9 -17
- package/dist/esm/start/protocol.d.ts +19 -0
- package/dist/esm/start/protocol.js +27 -0
- package/dist/esm/start/roles.d.ts +12 -0
- package/dist/esm/start/roles.js +27 -0
- package/dist/esm/start/router.d.ts +27 -4
- package/dist/esm/start/router.js +221 -22
- package/dist/esm/start/serve/authHooks.js +18 -0
- package/dist/esm/start/serve/demo.d.ts +9 -0
- package/dist/esm/start/serve/demo.js +24 -0
- package/dist/esm/start/serve/fetch.d.ts +1 -0
- package/dist/esm/start/serve/fetch.js +6 -0
- package/dist/esm/start/{instance.d.ts → serve/instance.d.ts} +6 -5
- package/dist/esm/start/serve/instance.js +134 -0
- package/dist/esm/start/serve/invoke.d.ts +13 -0
- package/dist/esm/start/serve/invoke.js +126 -0
- package/dist/esm/start/serve/local/load.d.ts +8 -0
- package/dist/esm/start/serve/local/load.js +44 -0
- package/dist/esm/start/serve/local/provider.d.ts +25 -0
- package/dist/esm/start/serve/local/provider.js +188 -0
- package/dist/esm/start/serve/local/signIn.d.ts +28 -0
- package/dist/esm/start/serve/local/signIn.js +123 -0
- package/dist/esm/start/serve/pageHead.d.ts +20 -0
- package/dist/esm/start/serve/pageHead.js +34 -0
- package/dist/esm/start/serve/provider.d.ts +19 -0
- package/dist/esm/start/serve/provider.js +78 -0
- package/dist/esm/start/serve/requestEnv.d.ts +2 -0
- package/dist/esm/start/serve/requestEnv.js +84 -0
- package/dist/esm/start/serve/scope.d.ts +18 -0
- package/dist/esm/start/serve/scope.js +67 -0
- package/dist/esm/start/serve/server.d.ts +56 -0
- package/dist/esm/start/serve/server.js +297 -0
- package/dist/esm/start/serve/uploads.d.ts +2 -0
- package/dist/esm/start/serve/uploads.js +49 -0
- package/dist/esm/start/serve/worker.d.ts +6 -0
- package/dist/esm/start/serve/worker.js +12 -0
- package/dist/esm/start/types.d.ts +270 -56
- package/dist/esm/start/version.d.ts +1 -1
- package/dist/esm/start/version.js +1 -1
- package/dist/esm/steps/index.d.ts +78 -0
- package/dist/esm/steps/index.js +502 -0
- package/dist/esm/steps/index.test.d.ts +1 -0
- package/dist/esm/steps/index.test.js +633 -0
- package/dist/esm/sync/index.d.ts +1 -1
- package/dist/esm/sync/index.js +32 -31
- package/dist/esm/sync/lib.d.ts +15 -8
- package/dist/esm/sync/lib.js +659 -659
- package/dist/esm/sync/lib.test.js +177 -46
- package/dist/esm/sync/sdkNames.d.ts +67 -9
- package/dist/esm/sync/sdkNames.js +94 -30
- package/dist/esm/sync/sdkNames.test.js +192 -116
- package/dist/esm/types/fields.d.ts +9 -2
- package/dist/esm/types/fields.js +110 -96
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/types/index.js +2 -2
- package/dist/esm/types/tables.d.ts +17 -1
- package/dist/esm/types/tables.js +2 -2
- package/dist/esm/upload/index.js +89 -24
- package/dist/esm/upload/index.test.js +104 -1
- package/dist/esm/vite/domTagNames.js +252 -252
- package/dist/esm/vite/index.d.ts +1 -1
- package/dist/esm/vite/index.js +92 -47
- package/dist/esm/vite/index.test.js +36 -0
- package/package.json +106 -38
- package/dist/cjs/auth-server/index.d.ts +0 -369
- package/dist/cjs/auth-server/index.js +0 -119
- package/dist/cjs/check/start/describeRules.d.ts +0 -35
- package/dist/cjs/check/start/describeRules.js +0 -89
- package/dist/cjs/check/start/problem.d.ts +0 -11
- package/dist/cjs/check/start/problem.js +0 -5
- package/dist/cjs/check/start/sourceRules.d.ts +0 -3
- package/dist/cjs/check/start/sourceRules.js +0 -441
- package/dist/cjs/start/problems.d.ts +0 -19
- package/dist/cjs/start/problems.js +0 -11
- package/dist/esm/auth-server/index.d.ts +0 -369
- package/dist/esm/auth-server/index.js +0 -116
- package/dist/esm/check/start/describeRules.d.ts +0 -35
- package/dist/esm/check/start/describeRules.js +0 -86
- package/dist/esm/check/start/problem.d.ts +0 -11
- package/dist/esm/check/start/problem.js +0 -1
- package/dist/esm/check/start/sourceRules.d.ts +0 -3
- package/dist/esm/check/start/sourceRules.js +0 -438
- package/dist/esm/start/airtable/index.d.ts +0 -11
- package/dist/esm/start/airtable/index.js +0 -70
- package/dist/esm/start/authHooks.js +0 -10
- package/dist/esm/start/data/baseRunner.js +0 -83
- package/dist/esm/start/data/index.d.ts +0 -18
- package/dist/esm/start/data/index.js +0 -76
- package/dist/esm/start/describe.js +0 -204
- package/dist/esm/start/describeBuilt.js +0 -66
- package/dist/esm/start/instance.js +0 -80
- package/dist/esm/start/problems.d.ts +0 -19
- package/dist/esm/start/problems.js +0 -8
- package/dist/esm/start/redactSecrets.d.ts +0 -7
- package/dist/esm/start/runLog.d.ts +0 -8
- package/dist/esm/start/runLog.js +0 -76
- package/dist/esm/start/scope.d.ts +0 -15
- package/dist/esm/start/scope.js +0 -58
- package/dist/esm/start/server.d.ts +0 -55
- package/dist/esm/start/server.js +0 -317
- package/dist/esm/start/vite.d.ts +0 -9
- package/dist/esm/start/vite.js +0 -173
- package/dist/esm/start/worker.d.ts +0 -11
- package/dist/esm/start/worker.js +0 -20
- package/dist/esm/start/workflow.d.ts +0 -53
- package/dist/esm/start/workflow.js +0 -13
- package/dist/esm/start/workflow.test-d.js +0 -44
- package/dist/esm/start/workflowRun.d.ts +0 -80
- package/dist/esm/start/workflowRun.js +0 -108
- /package/dist/{esm/start/redactSecrets.test.d.ts → cjs/runtime/sendEmailParamsTypes.test-d.d.ts} +0 -0
- /package/dist/{esm/start/workflow.test-d.d.ts → cjs/steps/index.test.d.ts} +0 -0
- /package/dist/esm/start/{authHooksModule.d.ts → build/placeholders/authHooksModule.d.ts} +0 -0
- /package/dist/esm/start/{authHooksModule.js → build/placeholders/authHooksModule.js} +0 -0
- /package/dist/esm/start/{workflowModules.d.ts → build/placeholders/workflowModules.d.ts} +0 -0
- /package/dist/esm/start/{descriptions.d.ts → describe/descriptions.d.ts} +0 -0
- /package/dist/esm/start/{airtable → platform/airtable}/arrayFields.d.ts +0 -0
- /package/dist/esm/start/{airtable → platform/airtable}/arrayFields.js +0 -0
- /package/dist/esm/start/{data → platform/data}/sqlNameMappings.d.ts +0 -0
- /package/dist/esm/start/{data → platform/data}/sqlNameMappings.js +0 -0
- /package/dist/esm/start/{redactSecrets.test.js → platform/redactSecrets.test.js} +0 -0
- /package/dist/esm/start/{authHooks.d.ts → serve/authHooks.d.ts} +0 -0
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from
|
|
2
|
-
import { generateSchema, generateDbTs } from
|
|
3
|
-
import { normalizeSchemaNames } from
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { generateSchema, generateDbTs } from './lib.js';
|
|
3
|
+
import { normalizeSchemaNames } from './sdkNames.js';
|
|
4
4
|
// `generateSchema` warns on every rename; silence it so the suite stays
|
|
5
5
|
// readable, and assert on the emitted names instead.
|
|
6
6
|
beforeEach(() => {
|
|
7
|
-
vi.spyOn(console,
|
|
7
|
+
vi.spyOn(console, 'warn').mockImplementation(() => { });
|
|
8
8
|
});
|
|
9
9
|
afterEach(() => {
|
|
10
10
|
vi.restoreAllMocks();
|
|
11
11
|
});
|
|
12
|
-
const field = (id, name) => ({ id, name, type:
|
|
12
|
+
const field = (id, name) => ({ id, name, type: 'single_line_text', order: 0 });
|
|
13
13
|
const database = (tables) => ({
|
|
14
|
-
id:
|
|
15
|
-
name:
|
|
14
|
+
id: 'base_1',
|
|
15
|
+
name: 'Base',
|
|
16
16
|
tables,
|
|
17
|
-
createdAt:
|
|
18
|
-
updatedAt:
|
|
19
|
-
url:
|
|
17
|
+
createdAt: '',
|
|
18
|
+
updatedAt: '',
|
|
19
|
+
url: '',
|
|
20
20
|
});
|
|
21
21
|
/** Every key in the emitted `export const zite = { … }` literal. */
|
|
22
22
|
const ziteKeys = (source) => {
|
|
23
|
-
const body = source.slice(source.indexOf(
|
|
24
|
-
return [...body.matchAll(/^ {2}([A-Za-z_$][\w$]*):/gm)].map(
|
|
23
|
+
const body = source.slice(source.indexOf('export const zite = {'));
|
|
24
|
+
return [...body.matchAll(/^ {2}([A-Za-z_$][\w$]*):/gm)].map(m => m[1]);
|
|
25
25
|
};
|
|
26
26
|
/** Every property key on one emitted record type. */
|
|
27
27
|
const recordTypeKeys = (source, typeName) => {
|
|
28
28
|
const start = source.indexOf(`export type ${typeName} = {`);
|
|
29
|
-
const body = source.slice(start, source.indexOf(
|
|
30
|
-
return [...body.matchAll(/^ {2}([A-Za-z_$][\w$]*)\??:/gm)].map(
|
|
29
|
+
const body = source.slice(start, source.indexOf('};', start));
|
|
30
|
+
return [...body.matchAll(/^ {2}([A-Za-z_$][\w$]*)\??:/gm)].map(m => m[1]);
|
|
31
31
|
};
|
|
32
|
-
describe(
|
|
32
|
+
describe('reserved platform accessors', () => {
|
|
33
33
|
// Sudzy Dashboard: a table named "Notifications" emitted a second
|
|
34
34
|
// `notifications:` key and the platform client — written last — won, so the
|
|
35
35
|
// table lost findAll and typed as `{ create(NotificationsCreateParams) }`.
|
|
36
36
|
// The platform client is unpublished, so the name belongs to the table
|
|
37
37
|
// again and there is nothing left to collide with.
|
|
38
|
-
it(
|
|
39
|
-
const schema = generateSchema(database([{ id:
|
|
40
|
-
expect(schema.tables[0].sdkName).toBe(
|
|
38
|
+
it('lets a table keep the notifications accessor', () => {
|
|
39
|
+
const schema = generateSchema(database([{ id: 'tbl_1', name: 'Notifications', fields: [] }]));
|
|
40
|
+
expect(schema.tables[0].sdkName).toBe('notifications');
|
|
41
41
|
const keys = ziteKeys(generateDbTs(schema));
|
|
42
|
-
expect(keys.filter(
|
|
42
|
+
expect(keys.filter(k => k === 'notifications')).toHaveLength(1);
|
|
43
43
|
expect(new Set(keys).size).toBe(keys.length);
|
|
44
44
|
});
|
|
45
|
-
it.each([
|
|
46
|
-
const schema = generateSchema(database([{ id:
|
|
45
|
+
it.each(['sql', 'auth'])('keeps the platform %s accessor for the platform', reserved => {
|
|
46
|
+
const schema = generateSchema(database([{ id: 'tbl_1', name: reserved, fields: [] }]));
|
|
47
47
|
expect(schema.tables[0].sdkName).toBe(`${reserved}2`);
|
|
48
48
|
const keys = ziteKeys(generateDbTs(schema));
|
|
49
49
|
expect(new Set(keys).size).toBe(keys.length);
|
|
50
50
|
});
|
|
51
|
-
it.each([
|
|
52
|
-
const schema = generateSchema(database([{ id:
|
|
51
|
+
it.each(['__proto__', 'constructor', 'prototype'])('refuses %s as a table accessor', hazard => {
|
|
52
|
+
const schema = generateSchema(database([{ id: 'tbl_1', name: hazard, fields: [] }]));
|
|
53
53
|
expect(schema.tables[0].sdkName).not.toBe(hazard);
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
|
-
describe(
|
|
56
|
+
describe('collision de-duplication', () => {
|
|
57
57
|
// Nevada Car Coalition: 1.0's generator suffixed colliding names, so the app
|
|
58
58
|
// was written against `category1` / `sponsor1`. 2.0 had no accumulator at
|
|
59
59
|
// all, so the second field silently overwrote the first.
|
|
60
|
-
it(
|
|
60
|
+
it('keeps both fields when two display names normalize alike', () => {
|
|
61
61
|
const schema = generateSchema(database([
|
|
62
62
|
{
|
|
63
|
-
id:
|
|
64
|
-
name:
|
|
65
|
-
fields: [field(
|
|
63
|
+
id: 'tbl_1',
|
|
64
|
+
name: 'K9 Winners',
|
|
65
|
+
fields: [field('fld_1', 'Category'), field('fld_2', 'category')],
|
|
66
66
|
},
|
|
67
67
|
]));
|
|
68
|
-
const names = schema.tables[0].fields.map(
|
|
69
|
-
expect(names).toEqual([
|
|
70
|
-
const keys = recordTypeKeys(generateDbTs(schema),
|
|
71
|
-
expect(keys).toEqual([
|
|
68
|
+
const names = schema.tables[0].fields.map(f => f.sdkName);
|
|
69
|
+
expect(names).toEqual(['category', 'category2']);
|
|
70
|
+
const keys = recordTypeKeys(generateDbTs(schema), 'K9WinnersRecordType');
|
|
71
|
+
expect(keys).toEqual(['id', 'category', 'category2']);
|
|
72
72
|
});
|
|
73
|
-
it(
|
|
73
|
+
it('de-duplicates two tables that normalize alike', () => {
|
|
74
74
|
const schema = generateSchema(database([
|
|
75
|
-
{ id:
|
|
76
|
-
{ id:
|
|
75
|
+
{ id: 'tbl_1', name: 'Orders', fields: [] },
|
|
76
|
+
{ id: 'tbl_2', name: 'orders', fields: [] },
|
|
77
77
|
]));
|
|
78
|
-
expect(schema.tables.map(
|
|
78
|
+
expect(schema.tables.map(t => t.sdkName)).toEqual(['orders', 'orders2']);
|
|
79
79
|
});
|
|
80
80
|
// Two sdkNames sharing a PascalCase form emit `FooRecordType` twice, which is
|
|
81
81
|
// a duplicate identifier even though the accessors differ.
|
|
82
|
-
it(
|
|
82
|
+
it('separates tables whose class names would collide', () => {
|
|
83
83
|
const source = generateDbTs({
|
|
84
84
|
tables: [
|
|
85
|
-
{ id:
|
|
86
|
-
{ id:
|
|
85
|
+
{ id: 'tbl_1', sdkName: 'orders', fields: [] },
|
|
86
|
+
{ id: 'tbl_2', sdkName: 'Orders', fields: [] },
|
|
87
87
|
],
|
|
88
88
|
});
|
|
89
|
-
const declared = [...source.matchAll(/export type (\w+RecordType)/g)].map(
|
|
89
|
+
const declared = [...source.matchAll(/export type (\w+RecordType)/g)].map(m => m[1]);
|
|
90
90
|
expect(new Set(declared).size).toBe(declared.length);
|
|
91
91
|
});
|
|
92
|
-
it(
|
|
93
|
-
const schema = generateSchema(database([{ id:
|
|
94
|
-
expect(schema.tables[0].fields[0].sdkName).toBe(
|
|
95
|
-
expect(recordTypeKeys(generateDbTs(schema),
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
it('reserves id so a field named ID stays readable', () => {
|
|
93
|
+
const schema = generateSchema(database([{ id: 'tbl_1', name: 'Rows', fields: [field('fld_1', 'ID')] }]));
|
|
94
|
+
expect(schema.tables[0].fields[0].sdkName).toBe('id2');
|
|
95
|
+
expect(recordTypeKeys(generateDbTs(schema), 'RowsRecordType')).toEqual([
|
|
96
|
+
'id',
|
|
97
|
+
'id2',
|
|
98
98
|
]);
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
-
describe(
|
|
101
|
+
describe('name stability', () => {
|
|
102
102
|
const existing = {
|
|
103
103
|
tables: [
|
|
104
104
|
{
|
|
105
|
-
id:
|
|
106
|
-
sdkName:
|
|
105
|
+
id: 'tbl_1',
|
|
106
|
+
sdkName: 'priceList',
|
|
107
107
|
fields: [
|
|
108
|
-
{ id:
|
|
108
|
+
{ id: 'fld_1', sdkName: 'srp', definition: { type: 'number' } },
|
|
109
109
|
],
|
|
110
110
|
},
|
|
111
111
|
],
|
|
112
112
|
};
|
|
113
113
|
// Kelly: the app was written against `srp`, and the field's display name has
|
|
114
114
|
// drifted since. A locked name is what the app compiles against.
|
|
115
|
-
it(
|
|
115
|
+
it('preserves a locked name over the one the display name would produce', () => {
|
|
116
116
|
const schema = generateSchema(database([
|
|
117
117
|
{
|
|
118
|
-
id:
|
|
119
|
-
name:
|
|
120
|
-
fields: [field(
|
|
118
|
+
id: 'tbl_1',
|
|
119
|
+
name: 'Price List',
|
|
120
|
+
fields: [field('fld_1', 'SRP (Suggested Retail Price)')],
|
|
121
121
|
},
|
|
122
122
|
]), existing);
|
|
123
|
-
expect(schema.tables[0].fields[0].sdkName).toBe(
|
|
123
|
+
expect(schema.tables[0].fields[0].sdkName).toBe('srp');
|
|
124
124
|
});
|
|
125
|
-
it(
|
|
125
|
+
it('does not let a new field displace a locked one', () => {
|
|
126
126
|
const schema = generateSchema(database([
|
|
127
127
|
{
|
|
128
|
-
id:
|
|
129
|
-
name:
|
|
128
|
+
id: 'tbl_1',
|
|
129
|
+
name: 'Price List',
|
|
130
130
|
// The new field's fresh name is exactly what fld_1 holds.
|
|
131
|
-
fields: [field(
|
|
131
|
+
fields: [field('fld_2', 'SRP'), field('fld_1', 'Anything')],
|
|
132
132
|
},
|
|
133
133
|
]), existing);
|
|
134
|
-
const byId = Object.fromEntries(schema.tables[0].fields.map(
|
|
135
|
-
expect(byId.fld_1).toBe(
|
|
136
|
-
expect(byId.fld_2).toBe(
|
|
134
|
+
const byId = Object.fromEntries(schema.tables[0].fields.map(f => [f.id, f.sdkName]));
|
|
135
|
+
expect(byId.fld_1).toBe('srp');
|
|
136
|
+
expect(byId.fld_2).toBe('srp2');
|
|
137
137
|
});
|
|
138
|
-
it(
|
|
138
|
+
it('is stable across repeated generation', () => {
|
|
139
139
|
const db = database([
|
|
140
140
|
{
|
|
141
|
-
id:
|
|
142
|
-
name:
|
|
143
|
-
fields: [field(
|
|
141
|
+
id: 'tbl_1',
|
|
142
|
+
name: 'Notifications',
|
|
143
|
+
fields: [field('fld_1', 'Category'), field('fld_2', 'category')],
|
|
144
144
|
},
|
|
145
145
|
]);
|
|
146
146
|
const first = generateSchema(db);
|
|
@@ -149,36 +149,110 @@ describe("name stability", () => {
|
|
|
149
149
|
expect(second).toEqual(first);
|
|
150
150
|
expect(third).toEqual(first);
|
|
151
151
|
});
|
|
152
|
-
it(
|
|
152
|
+
it('recomputes a name that is not a valid identifier', () => {
|
|
153
153
|
const schema = generateSchema(database([
|
|
154
|
-
{ id:
|
|
154
|
+
{ id: 'tbl_1', name: 'Rows', fields: [field('fld_1', 'Time')] },
|
|
155
155
|
]), {
|
|
156
156
|
tables: [
|
|
157
157
|
{
|
|
158
|
-
id:
|
|
159
|
-
sdkName:
|
|
158
|
+
id: 'tbl_1',
|
|
159
|
+
sdkName: 'rows',
|
|
160
160
|
fields: [
|
|
161
161
|
{
|
|
162
|
-
id:
|
|
163
|
-
sdkName:
|
|
164
|
-
definition: { type:
|
|
162
|
+
id: 'fld_1',
|
|
163
|
+
sdkName: 'timeSeconds)',
|
|
164
|
+
definition: { type: 'number' },
|
|
165
165
|
},
|
|
166
166
|
],
|
|
167
167
|
},
|
|
168
168
|
],
|
|
169
169
|
});
|
|
170
|
-
expect(schema.tables[0].fields[0].sdkName).toBe(
|
|
170
|
+
expect(schema.tables[0].fields[0].sdkName).toBe('time');
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
// base-runner's SQL resolver refuses a whole base when two names differ only by
|
|
174
|
+
// case, so a fresh name must not match an existing one ignoring case.
|
|
175
|
+
describe('names that differ only by case', () => {
|
|
176
|
+
const locked = (tables) => ({
|
|
177
|
+
tables: tables.map(table => ({
|
|
178
|
+
...table,
|
|
179
|
+
fields: table.fields.map(([id, sdkName]) => ({
|
|
180
|
+
id,
|
|
181
|
+
sdkName,
|
|
182
|
+
definition: { type: 'single_line_text' },
|
|
183
|
+
})),
|
|
184
|
+
})),
|
|
185
|
+
});
|
|
186
|
+
const fieldsOf = (schema) => Object.fromEntries(schema.tables[0].fields.map(f => [f.id, f.sdkName]));
|
|
187
|
+
it("step a fresh field around a baked one, so aPIKey and a new API Key don't break SQL", () => {
|
|
188
|
+
const schema = generateSchema(database([
|
|
189
|
+
{
|
|
190
|
+
id: 'tbl_1',
|
|
191
|
+
name: 'Keys',
|
|
192
|
+
fields: [field('fld_old', 'API Key'), field('fld_new', 'API Key')],
|
|
193
|
+
},
|
|
194
|
+
]), locked([
|
|
195
|
+
{ id: 'tbl_1', sdkName: 'keys', fields: [['fld_old', 'aPIKey']] },
|
|
196
|
+
]));
|
|
197
|
+
expect(fieldsOf(schema)).toEqual({ fld_old: 'aPIKey', fld_new: 'apiKey2' });
|
|
198
|
+
});
|
|
199
|
+
it('step a fresh field around another fresh one', () => {
|
|
200
|
+
const schema = generateSchema(database([
|
|
201
|
+
{
|
|
202
|
+
id: 'tbl_1',
|
|
203
|
+
name: 'Keys',
|
|
204
|
+
fields: [field('fld_1', 'API Key'), field('fld_2', 'A PI Key')],
|
|
205
|
+
},
|
|
206
|
+
]));
|
|
207
|
+
expect(fieldsOf(schema)).toEqual({ fld_1: 'apiKey', fld_2: 'aPiKey2' });
|
|
208
|
+
});
|
|
209
|
+
it('step a fresh table around a baked one by the class name the client sends', () => {
|
|
210
|
+
const schema = generateSchema(database([
|
|
211
|
+
{ id: 'tbl_old', name: 'VIP Customers', fields: [] },
|
|
212
|
+
{ id: 'tbl_new', name: 'VIP Customers', fields: [] },
|
|
213
|
+
]), locked([{ id: 'tbl_old', sdkName: 'vIPCustomers', fields: [] }]));
|
|
214
|
+
expect(schema.tables.map(t => t.sdkName)).toEqual([
|
|
215
|
+
'vIPCustomers',
|
|
216
|
+
'vipCustomers2',
|
|
217
|
+
]);
|
|
218
|
+
});
|
|
219
|
+
it('never move a baked name, even two that already clash', () => {
|
|
220
|
+
const schema = generateSchema(database([
|
|
221
|
+
{
|
|
222
|
+
id: 'tbl_1',
|
|
223
|
+
name: 'Keys',
|
|
224
|
+
fields: [field('fld_1', 'API Key'), field('fld_2', 'Api key')],
|
|
225
|
+
},
|
|
226
|
+
]), locked([
|
|
227
|
+
{
|
|
228
|
+
id: 'tbl_1',
|
|
229
|
+
sdkName: 'keys',
|
|
230
|
+
fields: [
|
|
231
|
+
['fld_1', 'aPIKey'],
|
|
232
|
+
['fld_2', 'apiKey'],
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
]));
|
|
236
|
+
expect(fieldsOf(schema)).toEqual({ fld_1: 'aPIKey', fld_2: 'apiKey' });
|
|
237
|
+
expect(normalizeSchemaNames(schema).renames).toEqual([]);
|
|
238
|
+
});
|
|
239
|
+
it('leave a fresh name alone when it matches one only in another table', () => {
|
|
240
|
+
const schema = generateSchema(database([
|
|
241
|
+
{ id: 'tbl_1', name: 'Keys', fields: [field('fld_1', 'API Key')] },
|
|
242
|
+
{ id: 'tbl_2', name: 'Other', fields: [field('fld_2', 'API Key')] },
|
|
243
|
+
]), locked([{ id: 'tbl_1', sdkName: 'keys', fields: [['fld_1', 'aPIKey']] }]));
|
|
244
|
+
expect(schema.tables[1].fields[0].sdkName).toBe('apiKey');
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
describe('normalizeSchemaNames', () => {
|
|
248
|
+
it('is a no-op on a well-formed schema', () => {
|
|
175
249
|
const schema = {
|
|
176
250
|
tables: [
|
|
177
251
|
{
|
|
178
|
-
id:
|
|
179
|
-
sdkName:
|
|
252
|
+
id: 'tbl_1',
|
|
253
|
+
sdkName: 'orders',
|
|
180
254
|
fields: [
|
|
181
|
-
{ id:
|
|
255
|
+
{ id: 'fld_1', sdkName: 'total', definition: { type: 'number' } },
|
|
182
256
|
],
|
|
183
257
|
},
|
|
184
258
|
],
|
|
@@ -190,47 +264,49 @@ describe("normalizeSchemaNames", () => {
|
|
|
190
264
|
// A schema committed before allocation existed. The sandbox's boot-time
|
|
191
265
|
// `zitejs generate` reads it with no generateSchema pass in front, so this is
|
|
192
266
|
// the only thing standing between it and a TS1117 it cannot build past.
|
|
193
|
-
it(
|
|
267
|
+
it('repairs a committed schema that already holds the collision', () => {
|
|
194
268
|
// `sql`, not `notifications` — the latter stopped being a platform
|
|
195
269
|
// accessor when the client was unpublished, so a schema holding it is
|
|
196
270
|
// no longer a collision to repair.
|
|
197
271
|
const source = generateDbTs({
|
|
198
272
|
tables: [
|
|
199
|
-
{ id:
|
|
200
|
-
{ id:
|
|
273
|
+
{ id: 'tbl_1', sdkName: 'sql', fields: [] },
|
|
274
|
+
{ id: 'tbl_2', sdkName: 'orders', fields: [] },
|
|
201
275
|
],
|
|
202
276
|
});
|
|
203
277
|
const keys = ziteKeys(source);
|
|
204
278
|
expect(new Set(keys).size).toBe(keys.length);
|
|
205
|
-
expect(keys).toContain(
|
|
279
|
+
expect(keys).toContain('sql2');
|
|
206
280
|
});
|
|
207
281
|
});
|
|
208
|
-
describe(
|
|
282
|
+
describe('table display names', () => {
|
|
209
283
|
// `sdkName` is locked to the id so user code keeps compiling; `name` is the
|
|
210
284
|
// opposite and must always take the live value. Locking it too — the easy
|
|
211
285
|
// mistake, since the line above it does exactly that — freezes it at the
|
|
212
286
|
// table's first name and defeats the point.
|
|
213
|
-
it(
|
|
214
|
-
const first = generateSchema(database([
|
|
215
|
-
|
|
216
|
-
|
|
287
|
+
it('follows a rename while the sdkName stays locked', () => {
|
|
288
|
+
const first = generateSchema(database([
|
|
289
|
+
{ id: 'tbl_1', name: 'Slots', fields: [field('fld_1', 'At')] },
|
|
290
|
+
]));
|
|
291
|
+
expect(first.tables[0].sdkName).toBe('slots');
|
|
292
|
+
expect(first.tables[0].name).toBe('Slots');
|
|
217
293
|
const renamed = generateSchema(database([
|
|
218
|
-
{ id:
|
|
294
|
+
{ id: 'tbl_1', name: 'Time Slots', fields: [field('fld_1', 'At')] },
|
|
219
295
|
]), first);
|
|
220
|
-
expect(renamed.tables[0].sdkName).toBe(
|
|
221
|
-
expect(renamed.tables[0].name).toBe(
|
|
296
|
+
expect(renamed.tables[0].sdkName).toBe('slots');
|
|
297
|
+
expect(renamed.tables[0].name).toBe('Time Slots');
|
|
222
298
|
expect(generateDbTs(renamed)).toContain('/** A record in the "Time Slots" table, as it is read back. */');
|
|
223
299
|
});
|
|
224
300
|
// `buildLegacySchemaSeed` (restly, migration) builds a seed carrying only
|
|
225
301
|
// `sdkName`. Reading `name` off the seed would emit `undefined` for every
|
|
226
302
|
// table on every newly migrated project.
|
|
227
|
-
it(
|
|
303
|
+
it('takes the live name even when the seed has none', () => {
|
|
228
304
|
const seed = {
|
|
229
|
-
tables: [{ id:
|
|
305
|
+
tables: [{ id: 'tbl_1', sdkName: 'salesDeals', fields: [] }],
|
|
230
306
|
};
|
|
231
|
-
const schema = generateSchema(database([{ id:
|
|
232
|
-
expect(schema.tables[0].sdkName).toBe(
|
|
233
|
-
expect(schema.tables[0].name).toBe(
|
|
307
|
+
const schema = generateSchema(database([{ id: 'tbl_1', name: 'Deals', fields: [] }]), seed);
|
|
308
|
+
expect(schema.tables[0].sdkName).toBe('salesDeals');
|
|
309
|
+
expect(schema.tables[0].name).toBe('Deals');
|
|
234
310
|
});
|
|
235
311
|
});
|
|
236
312
|
/**
|
|
@@ -240,44 +316,44 @@ describe("table display names", () => {
|
|
|
240
316
|
* every app carried over from it compiles against THAT name — so this is a
|
|
241
317
|
* disagreement with the apps in the wild, not a cosmetic preference.
|
|
242
318
|
*/
|
|
243
|
-
describe(
|
|
244
|
-
const nameFor = (tableName) => generateSchema(database([{ id:
|
|
319
|
+
describe('diacritics in a fresh sdkName', () => {
|
|
320
|
+
const nameFor = (tableName) => generateSchema(database([{ id: 'tbl_1', name: tableName, fields: [] }]))
|
|
245
321
|
.tables[0].sdkName;
|
|
246
322
|
it.each([
|
|
247
|
-
[
|
|
248
|
-
[
|
|
249
|
-
[
|
|
250
|
-
[
|
|
251
|
-
[
|
|
323
|
+
['Fiches Filières', 'fichesFilieres'],
|
|
324
|
+
['Recherches Métiers', 'recherchesMetiers'],
|
|
325
|
+
['Profil Compétences', 'profilCompetences'],
|
|
326
|
+
['Café Menu', 'cafeMenu'],
|
|
327
|
+
['Señor Clients', 'senorClients'],
|
|
252
328
|
// Real, from a migrated base: an all-caps name where the accent sits inside
|
|
253
329
|
// an acronym run, so the de-acronym pass has to see the folded letter.
|
|
254
|
-
[
|
|
255
|
-
])(
|
|
330
|
+
['XICOH TRÁMITES', 'xicohTramites'],
|
|
331
|
+
])('folds %s into %s', (display, sdkName) => {
|
|
256
332
|
expect(nameFor(display)).toBe(sdkName);
|
|
257
333
|
});
|
|
258
|
-
it(
|
|
334
|
+
it('folds a field name the same way', () => {
|
|
259
335
|
const schema = generateSchema(database([
|
|
260
336
|
{
|
|
261
|
-
id:
|
|
262
|
-
name:
|
|
263
|
-
fields: [field(
|
|
337
|
+
id: 'tbl_1',
|
|
338
|
+
name: 'Trámites',
|
|
339
|
+
fields: [field('fld_1', 'Horario de Atención')],
|
|
264
340
|
},
|
|
265
341
|
]));
|
|
266
|
-
expect(schema.tables[0].fields[0].sdkName).toBe(
|
|
342
|
+
expect(schema.tables[0].fields[0].sdkName).toBe('horarioDeAtencion');
|
|
267
343
|
});
|
|
268
|
-
it(
|
|
344
|
+
it('leaves a name with no ASCII letters degenerate, as 1.0 did', () => {
|
|
269
345
|
// NFD only folds Latin diacritics. Nothing here to fold onto, so this
|
|
270
346
|
// collapses exactly as before — called out so the narrower scope is a
|
|
271
347
|
// decision on the record rather than an oversight.
|
|
272
|
-
expect(nameFor(
|
|
348
|
+
expect(nameFor('Посещения')).toBe('_');
|
|
273
349
|
});
|
|
274
|
-
it(
|
|
350
|
+
it('does not rename a table already locked to the old spelling', () => {
|
|
275
351
|
// The whole point of the lock: an app compiling against `fichesFiliRes`
|
|
276
352
|
// keeps it. Only names allocated from here on change.
|
|
277
353
|
const existingSchema = {
|
|
278
|
-
tables: [{ id:
|
|
354
|
+
tables: [{ id: 'tbl_1', sdkName: 'fichesFiliRes', fields: [] }],
|
|
279
355
|
};
|
|
280
|
-
const schema = generateSchema(database([{ id:
|
|
281
|
-
expect(schema.tables[0].sdkName).toBe(
|
|
356
|
+
const schema = generateSchema(database([{ id: 'tbl_1', name: 'Fiches Filières', fields: [] }]), existingSchema);
|
|
357
|
+
expect(schema.tables[0].sdkName).toBe('fichesFiliRes');
|
|
282
358
|
});
|
|
283
359
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const numberFormatEnum: readonly ["local", "comma_period", "period_comma", "space_comma", "space_period", "no_separator"];
|
|
3
3
|
export type NumberFormat = (typeof numberFormatEnum)[number];
|
|
4
4
|
export declare const dateFormatEnum: readonly ["local", "long", "us", "european", "iso"];
|
|
@@ -7,7 +7,7 @@ export declare const timeFormatEnum: readonly ["12h", "24h"];
|
|
|
7
7
|
export type TimeFormat = (typeof timeFormatEnum)[number];
|
|
8
8
|
export declare const durationFormatEnum: readonly ["h:mm", "h:mm:ss", "h:mm:ss.s", "h:mm:ss.ss", "h:mm:ss.sss"];
|
|
9
9
|
export type DurationFormat = (typeof durationFormatEnum)[number];
|
|
10
|
-
export declare const fieldTypeEnum: readonly ["currency", "single_line_text", "long_text", "rich_text", "number", "single_select", "multiple_select", "date", "datetime", "checkbox", "attachments", "email", "url", "phone_number", "rating", "duration", "percent", "linked_record", "lookup", "source", "formula", "autonumber", "created_at", "updated_at", "rollup", "updated_by", "user"];
|
|
10
|
+
export declare const fieldTypeEnum: readonly ["currency", "single_line_text", "long_text", "rich_text", "number", "single_select", "multiple_select", "date", "datetime", "checkbox", "attachments", "email", "url", "phone_number", "rating", "duration", "percent", "linked_record", "lookup", "source", "formula", "autonumber", "created_at", "updated_at", "rollup", "created_by", "updated_by", "user"];
|
|
11
11
|
export type FieldType = (typeof fieldTypeEnum)[number];
|
|
12
12
|
export declare const fieldTypeSchema: z.ZodEnum<{
|
|
13
13
|
number: "number";
|
|
@@ -35,6 +35,7 @@ export declare const fieldTypeSchema: z.ZodEnum<{
|
|
|
35
35
|
created_at: "created_at";
|
|
36
36
|
updated_at: "updated_at";
|
|
37
37
|
rollup: "rollup";
|
|
38
|
+
created_by: "created_by";
|
|
38
39
|
updated_by: "updated_by";
|
|
39
40
|
user: "user";
|
|
40
41
|
}>;
|
|
@@ -240,6 +241,7 @@ export declare const rollupTemplateSchema: z.ZodObject<{
|
|
|
240
241
|
text: "text";
|
|
241
242
|
}>>;
|
|
242
243
|
}, z.core.$strip>;
|
|
244
|
+
export declare const createdByTemplateSchema: z.ZodObject<{}, z.core.$strip>;
|
|
243
245
|
export declare const updatedByTemplateSchema: z.ZodObject<{}, z.core.$strip>;
|
|
244
246
|
export declare const userTemplateSchema: z.ZodObject<{
|
|
245
247
|
allowMultiple: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
|
|
@@ -554,6 +556,10 @@ export declare const publicFieldDefinitionSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
554
556
|
text: "text";
|
|
555
557
|
}>>;
|
|
556
558
|
}, z.core.$strip>;
|
|
559
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
560
|
+
name: z.ZodString;
|
|
561
|
+
type: z.ZodLiteral<"created_by">;
|
|
562
|
+
template: z.ZodObject<{}, z.core.$strip>;
|
|
557
563
|
}, z.core.$strip>, z.ZodObject<{
|
|
558
564
|
name: z.ZodString;
|
|
559
565
|
type: z.ZodLiteral<"updated_by">;
|
|
@@ -661,6 +667,7 @@ export type FieldTemplateMap = {
|
|
|
661
667
|
linked_record: z.infer<typeof linkedRecordTemplateSchema>;
|
|
662
668
|
lookup: z.infer<typeof lookupTemplateSchema>;
|
|
663
669
|
rollup: z.infer<typeof rollupTemplateSchema>;
|
|
670
|
+
created_by: z.infer<typeof createdByTemplateSchema>;
|
|
664
671
|
updated_by: z.infer<typeof updatedByTemplateSchema>;
|
|
665
672
|
user: z.infer<typeof userTemplateSchema>;
|
|
666
673
|
source: z.infer<typeof sourceTemplateSchema>;
|