jazz-tools 2.0.0-alpha.9 → 2.0.0-beta.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/LICENSE +21 -0
- package/README.md +134 -7
- package/bin/jazz-tools.js +95 -68
- package/dist/_dev/inspector-cache-runtime.d.ts +8 -0
- package/dist/_dev/inspector-cache-runtime.d.ts.map +1 -0
- package/dist/_dev/inspector-cache-runtime.js +246 -0
- package/dist/_dev/inspector-cache-runtime.js.map +1 -0
- package/dist/_dev/inspector-client.d.ts +15 -0
- package/dist/_dev/inspector-client.d.ts.map +1 -0
- package/dist/_dev/inspector-client.js +134 -0
- package/dist/_dev/inspector-client.js.map +1 -0
- package/dist/_dev/native-account-session.d.ts +23 -0
- package/dist/_dev/native-account-session.d.ts.map +1 -0
- package/dist/_dev/native-account-session.js +61 -0
- package/dist/_dev/native-account-session.js.map +1 -0
- package/dist/_dev/native-binding-codec.d.ts +9 -0
- package/dist/_dev/native-binding-codec.d.ts.map +1 -0
- package/dist/_dev/native-binding-codec.js +9 -0
- package/dist/_dev/native-binding-codec.js.map +1 -0
- package/dist/accounts/account-manager-core.d.ts +87 -0
- package/dist/accounts/account-manager-core.d.ts.map +1 -0
- package/dist/accounts/account-manager-core.js +236 -0
- package/dist/accounts/account-manager-core.js.map +1 -0
- package/dist/accounts/browser-host.d.ts +8 -0
- package/dist/accounts/browser-host.d.ts.map +1 -0
- package/dist/accounts/browser-host.js +16 -0
- package/dist/accounts/browser-host.js.map +1 -0
- package/dist/accounts/config-capability.d.ts +26 -0
- package/dist/accounts/config-capability.d.ts.map +1 -0
- package/dist/accounts/config-capability.js +58 -0
- package/dist/accounts/config-capability.js.map +1 -0
- package/dist/accounts/context.d.ts +14 -0
- package/dist/accounts/context.d.ts.map +1 -0
- package/dist/accounts/context.js +214 -0
- package/dist/accounts/context.js.map +1 -0
- package/dist/accounts/enrollment.d.ts +95 -0
- package/dist/accounts/enrollment.d.ts.map +1 -0
- package/dist/accounts/enrollment.js +314 -0
- package/dist/accounts/enrollment.js.map +1 -0
- package/dist/accounts/exports.d.ts +3 -0
- package/dist/accounts/exports.d.ts.map +1 -0
- package/dist/accounts/exports.js +5 -0
- package/dist/accounts/exports.js.map +1 -0
- package/dist/accounts/local-first.d.ts +17 -0
- package/dist/accounts/local-first.d.ts.map +1 -0
- package/dist/accounts/local-first.js +62 -0
- package/dist/accounts/local-first.js.map +1 -0
- package/dist/accounts/persistence.d.ts +79 -0
- package/dist/accounts/persistence.d.ts.map +1 -0
- package/dist/accounts/persistence.js +533 -0
- package/dist/accounts/persistence.js.map +1 -0
- package/dist/accounts/process-store.d.ts +27 -0
- package/dist/accounts/process-store.d.ts.map +1 -0
- package/dist/accounts/process-store.js +49 -0
- package/dist/accounts/process-store.js.map +1 -0
- package/dist/accounts/registry-client.d.ts +79 -0
- package/dist/accounts/registry-client.d.ts.map +1 -0
- package/dist/accounts/registry-client.js +153 -0
- package/dist/accounts/registry-client.js.map +1 -0
- package/dist/accounts/state.d.ts +76 -0
- package/dist/accounts/state.d.ts.map +1 -0
- package/dist/accounts/state.js +172 -0
- package/dist/accounts/state.js.map +1 -0
- package/dist/app-file-enums.d.ts +9 -0
- package/dist/app-file-enums.d.ts.map +1 -0
- package/dist/app-file-enums.js +34 -0
- package/dist/app-file-enums.js.map +1 -0
- package/dist/authoring.d.ts +9 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +9 -0
- package/dist/authoring.js.map +1 -0
- package/dist/backend/admission.d.ts +28 -0
- package/dist/backend/admission.d.ts.map +1 -0
- package/dist/backend/admission.js +146 -0
- package/dist/backend/admission.js.map +1 -0
- package/dist/backend/api.d.ts +12 -0
- package/dist/backend/api.d.ts.map +1 -0
- package/dist/backend/api.js +11 -0
- package/dist/backend/api.js.map +1 -0
- package/dist/backend/backend-clients.d.ts +76 -0
- package/dist/backend/backend-clients.d.ts.map +1 -0
- package/dist/backend/backend-clients.js +237 -0
- package/dist/backend/backend-clients.js.map +1 -0
- package/dist/backend/backend-issuer.d.ts +6 -0
- package/dist/backend/backend-issuer.d.ts.map +1 -0
- package/dist/backend/backend-issuer.js +6 -0
- package/dist/backend/backend-issuer.js.map +1 -0
- package/dist/backend/backend-native.d.ts +40 -0
- package/dist/backend/backend-native.d.ts.map +1 -0
- package/dist/backend/backend-native.js +37 -0
- package/dist/backend/backend-native.js.map +1 -0
- package/dist/backend/blobs.d.ts +130 -0
- package/dist/backend/blobs.d.ts.map +1 -0
- package/dist/backend/blobs.js +132 -0
- package/dist/backend/blobs.js.map +1 -0
- package/dist/backend/core-transport.d.ts +61 -0
- package/dist/backend/core-transport.d.ts.map +1 -0
- package/dist/backend/core-transport.js +106 -0
- package/dist/backend/core-transport.js.map +1 -0
- package/dist/backend/create-jazz-context.d.ts +94 -28
- package/dist/backend/create-jazz-context.d.ts.map +1 -1
- package/dist/backend/create-jazz-context.js +661 -67
- package/dist/backend/create-jazz-context.js.map +1 -1
- package/dist/backend/create-jazz-session.d.ts +125 -0
- package/dist/backend/create-jazz-session.d.ts.map +1 -0
- package/dist/backend/create-jazz-session.js +528 -0
- package/dist/backend/create-jazz-session.js.map +1 -0
- package/dist/backend/create-jazz.d.ts +677 -0
- package/dist/backend/create-jazz.d.ts.map +1 -0
- package/dist/backend/create-jazz.js +4076 -0
- package/dist/backend/create-jazz.js.map +1 -0
- package/dist/backend/early-db.d.ts +29 -0
- package/dist/backend/early-db.d.ts.map +1 -0
- package/dist/backend/early-db.js +203 -0
- package/dist/backend/early-db.js.map +1 -0
- package/dist/backend/external-jwt.d.ts +27 -0
- package/dist/backend/external-jwt.d.ts.map +1 -0
- package/dist/backend/external-jwt.js +404 -0
- package/dist/backend/external-jwt.js.map +1 -0
- package/dist/backend/from-jwt.d.ts +64 -0
- package/dist/backend/from-jwt.d.ts.map +1 -0
- package/dist/backend/from-jwt.js +104 -0
- package/dist/backend/from-jwt.js.map +1 -0
- package/dist/backend/index.d.ts +6 -3
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +18 -2
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/inspect-ui.d.ts +14 -0
- package/dist/backend/inspect-ui.d.ts.map +1 -0
- package/dist/backend/inspect-ui.js +156 -0
- package/dist/backend/inspect-ui.js.map +1 -0
- package/dist/backend/inspect.d.ts +133 -0
- package/dist/backend/inspect.d.ts.map +1 -0
- package/dist/backend/inspect.js +1001 -0
- package/dist/backend/inspect.js.map +1 -0
- package/dist/backend/inspector-ui/0.js +2 -0
- package/dist/backend/inspector-ui/1.js +2 -0
- package/dist/backend/inspector-ui/10.js +2 -0
- package/dist/backend/inspector-ui/11.js +2 -0
- package/dist/backend/inspector-ui/12.js +2 -0
- package/dist/backend/inspector-ui/13.js +2 -0
- package/dist/backend/inspector-ui/14.js +2 -0
- package/dist/backend/inspector-ui/15.js +2 -0
- package/dist/backend/inspector-ui/16.js +2 -0
- package/dist/backend/inspector-ui/17.js +2 -0
- package/dist/backend/inspector-ui/18.js +2 -0
- package/dist/backend/inspector-ui/19.js +2 -0
- package/dist/backend/inspector-ui/2.js +2 -0
- package/dist/backend/inspector-ui/20.js +2 -0
- package/dist/backend/inspector-ui/21.js +2 -0
- package/dist/backend/inspector-ui/3.js +2 -0
- package/dist/backend/inspector-ui/4.js +2 -0
- package/dist/backend/inspector-ui/5.js +2 -0
- package/dist/backend/inspector-ui/6.js +2 -0
- package/dist/backend/inspector-ui/7.js +2 -0
- package/dist/backend/inspector-ui/8.js +2 -0
- package/dist/backend/inspector-ui/9.js +2 -0
- package/dist/backend/inspector-ui-files.d.ts +4 -0
- package/dist/backend/inspector-ui-files.d.ts.map +1 -0
- package/dist/backend/inspector-ui-files.js +26 -0
- package/dist/backend/no-account-error.d.ts +23 -0
- package/dist/backend/no-account-error.d.ts.map +1 -0
- package/dist/backend/no-account-error.js +30 -0
- package/dist/backend/no-account-error.js.map +1 -0
- package/dist/backend/node-native.d.ts +3 -0
- package/dist/backend/node-native.d.ts.map +1 -0
- package/dist/backend/node-native.js +19 -0
- package/dist/backend/node-native.js.map +1 -0
- package/dist/backend/node-peers.d.ts +10 -0
- package/dist/backend/node-peers.d.ts.map +1 -0
- package/dist/backend/node-peers.js +37 -0
- package/dist/backend/node-peers.js.map +1 -0
- package/dist/backend/optional-peer.d.ts +9 -0
- package/dist/backend/optional-peer.d.ts.map +1 -0
- package/dist/backend/optional-peer.js +24 -0
- package/dist/backend/optional-peer.js.map +1 -0
- package/dist/backend/request-auth.d.ts +69 -0
- package/dist/backend/request-auth.d.ts.map +1 -0
- package/dist/backend/request-auth.js +122 -0
- package/dist/backend/request-auth.js.map +1 -0
- package/dist/backend/session-expiry.d.ts +61 -0
- package/dist/backend/session-expiry.d.ts.map +1 -0
- package/dist/backend/session-expiry.js +102 -0
- package/dist/backend/session-expiry.js.map +1 -0
- package/dist/backend/signing-key.d.ts +32 -0
- package/dist/backend/signing-key.d.ts.map +1 -0
- package/dist/backend/signing-key.js +63 -0
- package/dist/backend/signing-key.js.map +1 -0
- package/dist/backend/socket-deadline.d.ts +23 -0
- package/dist/backend/socket-deadline.d.ts.map +1 -0
- package/dist/backend/socket-deadline.js +70 -0
- package/dist/backend/socket-deadline.js.map +1 -0
- package/dist/backend/store-log.d.ts +3 -0
- package/dist/backend/store-log.d.ts.map +1 -0
- package/dist/backend/store-log.js +16 -0
- package/dist/backend/store-log.js.map +1 -0
- package/dist/backend/thin-relay.d.ts +66 -0
- package/dist/backend/thin-relay.d.ts.map +1 -0
- package/dist/backend/thin-relay.js +204 -0
- package/dist/backend/thin-relay.js.map +1 -0
- package/dist/backend/thin-session-client.d.ts +23 -0
- package/dist/backend/thin-session-client.d.ts.map +1 -0
- package/dist/backend/thin-session-client.js +69 -0
- package/dist/backend/thin-session-client.js.map +1 -0
- package/dist/backend/upgrade-status.d.ts +19 -0
- package/dist/backend/upgrade-status.d.ts.map +1 -0
- package/dist/backend/upgrade-status.js +55 -0
- package/dist/backend/upgrade-status.js.map +1 -0
- package/dist/backend/vercel-store.d.ts +345 -0
- package/dist/backend/vercel-store.d.ts.map +1 -0
- package/dist/backend/vercel-store.js +1387 -0
- package/dist/backend/vercel-store.js.map +1 -0
- package/dist/backend/workerd-backend.d.ts +36 -0
- package/dist/backend/workerd-backend.d.ts.map +1 -0
- package/dist/backend/workerd-backend.js +97 -0
- package/dist/backend/workerd-backend.js.map +1 -0
- package/dist/backend/workerd.d.ts +3 -0
- package/dist/backend/workerd.d.ts.map +1 -0
- package/dist/backend/workerd.js +39 -0
- package/dist/backend/workerd.js.map +1 -0
- package/dist/backend/ws-peer.d.ts +32 -0
- package/dist/backend/ws-peer.d.ts.map +1 -0
- package/dist/backend/ws-peer.js +41 -0
- package/dist/backend/ws-peer.js.map +1 -0
- package/dist/better-auth-adapter/fixtures/app.d.ts +151 -0
- package/dist/better-auth-adapter/fixtures/app.d.ts.map +1 -0
- package/dist/better-auth-adapter/fixtures/app.js +13 -0
- package/dist/better-auth-adapter/fixtures/app.js.map +1 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.d.ts +20 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.d.ts.map +1 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.js +27 -0
- package/dist/better-auth-adapter/fixtures/issuer-upgrade.js.map +1 -0
- package/dist/better-auth-adapter/index.d.ts +13 -0
- package/dist/better-auth-adapter/index.d.ts.map +1 -0
- package/dist/better-auth-adapter/index.js +406 -0
- package/dist/better-auth-adapter/index.js.map +1 -0
- package/dist/better-auth-adapter/indexes.d.ts +9 -0
- package/dist/better-auth-adapter/indexes.d.ts.map +1 -0
- package/dist/better-auth-adapter/indexes.js +40 -0
- package/dist/better-auth-adapter/indexes.js.map +1 -0
- package/dist/better-auth-adapter/schema.d.ts +88 -0
- package/dist/better-auth-adapter/schema.d.ts.map +1 -0
- package/dist/better-auth-adapter/schema.js +332 -0
- package/dist/better-auth-adapter/schema.js.map +1 -0
- package/dist/better-auth-adapter/types.d.ts +13 -0
- package/dist/better-auth-adapter/types.d.ts.map +1 -0
- package/dist/better-auth-adapter/types.js +2 -0
- package/dist/better-auth-adapter/types.js.map +1 -0
- package/dist/better-auth-adapter/utils.d.ts +53 -0
- package/dist/better-auth-adapter/utils.d.ts.map +1 -0
- package/dist/better-auth-adapter/utils.js +126 -0
- package/dist/better-auth-adapter/utils.js.map +1 -0
- package/dist/browser-benchmark-mode.d.ts +6 -0
- package/dist/browser-benchmark-mode.d.ts.map +1 -0
- package/dist/browser-benchmark-mode.js +13 -0
- package/dist/browser-benchmark-mode.js.map +1 -0
- package/dist/classic-api.d.ts +59 -0
- package/dist/classic-api.d.ts.map +1 -0
- package/dist/classic-api.js +122 -0
- package/dist/classic-api.js.map +1 -0
- package/dist/cli.d.ts +38 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +457 -265
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -0
- package/dist/cloud/api.d.ts +11 -0
- package/dist/cloud/api.d.ts.map +1 -0
- package/dist/cloud/api.js +46 -0
- package/dist/cloud/api.js.map +1 -0
- package/dist/cloud/commands.d.ts +13 -0
- package/dist/cloud/commands.d.ts.map +1 -0
- package/dist/cloud/commands.js +425 -0
- package/dist/cloud/commands.js.map +1 -0
- package/dist/cloud/credentials.d.ts +49 -0
- package/dist/cloud/credentials.d.ts.map +1 -0
- package/dist/cloud/credentials.js +219 -0
- package/dist/cloud/credentials.js.map +1 -0
- package/dist/cloud/session.d.ts +57 -0
- package/dist/cloud/session.d.ts.map +1 -0
- package/dist/cloud/session.js +269 -0
- package/dist/cloud/session.js.map +1 -0
- package/dist/codegen/relation-analyzer.d.ts +5 -12
- package/dist/codegen/relation-analyzer.d.ts.map +1 -1
- package/dist/codegen/relation-analyzer.js +53 -64
- package/dist/codegen/relation-analyzer.js.map +1 -1
- package/dist/dev/app-files.d.ts +32 -0
- package/dist/dev/app-files.d.ts.map +1 -0
- package/dist/dev/app-files.js +72 -0
- package/dist/dev/app-files.js.map +1 -0
- package/dist/dev/catalogue-api.d.ts +147 -0
- package/dist/dev/catalogue-api.d.ts.map +1 -0
- package/dist/dev/catalogue-api.js +127 -0
- package/dist/dev/catalogue-api.js.map +1 -0
- package/dist/dev/catalogue.d.ts +69 -0
- package/dist/dev/catalogue.d.ts.map +1 -0
- package/dist/dev/catalogue.js +70 -0
- package/dist/dev/catalogue.js.map +1 -0
- package/dist/dev/codegen-napi.d.ts +139 -0
- package/dist/dev/codegen-napi.d.ts.map +1 -0
- package/dist/dev/codegen-napi.js +157 -0
- package/dist/dev/codegen-napi.js.map +1 -0
- package/dist/dev/dev-server.d.ts +62 -0
- package/dist/dev/dev-server.d.ts.map +1 -0
- package/dist/dev/dev-server.js +164 -0
- package/dist/dev/dev-server.js.map +1 -0
- package/dist/dev/index.d.ts +3 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +3 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/dev/inspector-overlay/browser-control-registry.d.ts +10 -0
- package/dist/dev/inspector-overlay/browser-control-registry.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/browser-control-registry.js +188 -0
- package/dist/dev/inspector-overlay/browser-control-registry.js.map +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/ExportResult-C0ZojfNk.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-0Idv0niF.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/backend-DHeT1LCS.css +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/create-legacy-browser-delegate-DeI8PAZ5.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/diag-api-3Z_Eel3W.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-BB6DtWpZ.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-B_xpsQL2.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-CE7mSo95.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-CcBEG-yV.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-DZrCzNXM.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/esm-k373aadI.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/index-DUKUt96e.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz-broker-worker-C_mr9Omd.js +5 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm-BOvbCHn3.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/jazz_wasm_bg-BG8gazqt.wasm +0 -0
- package/dist/dev/inspector-overlay/embedded/assets/node-foreground-node-lease.browser-2mfp13Qb.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/dev/inspector-overlay/embedded/assets/src-4JwhxZaW.js +16 -0
- package/dist/dev/inspector-overlay/embedded/assets/src-Cq8gSOLx.css +1 -0
- package/dist/dev/inspector-overlay/embedded/backend.html +17 -0
- package/dist/dev/inspector-overlay/embedded/embedded.html +15 -0
- package/dist/dev/inspector-overlay/embedded/favicon.ico +0 -0
- package/dist/dev/inspector-overlay/host-bridge.d.ts +8 -0
- package/dist/dev/inspector-overlay/host-bridge.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/host-bridge.js +139 -0
- package/dist/dev/inspector-overlay/host-bridge.js.map +1 -0
- package/dist/dev/inspector-overlay/inspector-host-types.d.ts +35 -0
- package/dist/dev/inspector-overlay/inspector-host-types.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/inspector-host-types.js +10 -0
- package/dist/dev/inspector-overlay/inspector-host-types.js.map +1 -0
- package/dist/dev/inspector-overlay/loader.d.ts +24 -0
- package/dist/dev/inspector-overlay/loader.d.ts.map +1 -0
- package/dist/dev/inspector-overlay/loader.js +533 -0
- package/dist/dev/inspector-overlay/loader.js.map +1 -0
- package/dist/dev/migration-graph.d.ts +32 -0
- package/dist/dev/migration-graph.d.ts.map +1 -0
- package/dist/dev/migration-graph.js +136 -0
- package/dist/dev/migration-graph.js.map +1 -0
- package/dist/dev/migrations.d.ts +145 -0
- package/dist/dev/migrations.d.ts.map +1 -0
- package/dist/dev/migrations.js +700 -0
- package/dist/dev/migrations.js.map +1 -0
- package/dist/dev/project.d.ts +65 -0
- package/dist/dev/project.d.ts.map +1 -0
- package/dist/dev/project.js +179 -0
- package/dist/dev/project.js.map +1 -0
- package/dist/dev/schema-utils.d.ts +8 -0
- package/dist/dev/schema-utils.d.ts.map +1 -0
- package/dist/dev/schema-utils.js +75 -0
- package/dist/dev/schema-utils.js.map +1 -0
- package/dist/dev/schema-validation.d.ts +5 -0
- package/dist/dev/schema-validation.d.ts.map +1 -0
- package/dist/dev/schema-validation.js +11 -0
- package/dist/dev/schema-validation.js.map +1 -0
- package/dist/dev/ts-project.d.ts +77 -0
- package/dist/dev/ts-project.d.ts.map +1 -0
- package/dist/dev/ts-project.js +191 -0
- package/dist/dev/ts-project.js.map +1 -0
- package/dist/drivers/index.d.ts +1 -1
- package/dist/drivers/index.d.ts.map +1 -1
- package/dist/drivers/index.js.map +1 -1
- package/dist/drivers/schema-wire.d.ts +19 -3
- package/dist/drivers/schema-wire.d.ts.map +1 -1
- package/dist/drivers/schema-wire.js +61 -11
- package/dist/drivers/schema-wire.js.map +1 -1
- package/dist/drivers/types.d.ts +166 -29
- package/dist/drivers/types.d.ts.map +1 -1
- package/dist/drivers/types.js +5 -2
- package/dist/drivers/types.js.map +1 -1
- package/dist/dsl.d.ts +276 -121
- package/dist/dsl.d.ts.map +1 -1
- package/dist/dsl.js +196 -160
- package/dist/dsl.js.map +1 -1
- package/dist/durable-object/index.d.ts +26 -0
- package/dist/durable-object/index.d.ts.map +1 -0
- package/dist/durable-object/index.js +26 -0
- package/dist/durable-object/index.js.map +1 -0
- package/dist/e2ee/SODIUM-LICENSE.txt +36 -0
- package/dist/e2ee/SODIUM-SOURCES.json +4 -0
- package/dist/e2ee/browser.d.ts +18 -0
- package/dist/e2ee/browser.d.ts.map +1 -0
- package/dist/e2ee/browser.js +111 -0
- package/dist/e2ee/browser.js.map +1 -0
- package/dist/e2ee/context.d.ts +23 -0
- package/dist/e2ee/context.d.ts.map +1 -0
- package/dist/e2ee/context.js +49 -0
- package/dist/e2ee/context.js.map +1 -0
- package/dist/e2ee/crypto.d.ts +10 -0
- package/dist/e2ee/crypto.d.ts.map +1 -0
- package/dist/e2ee/crypto.js +22 -0
- package/dist/e2ee/crypto.js.map +1 -0
- package/dist/e2ee/envelope.d.ts +22 -0
- package/dist/e2ee/envelope.d.ts.map +1 -0
- package/dist/e2ee/envelope.js +52 -0
- package/dist/e2ee/envelope.js.map +1 -0
- package/dist/e2ee/index.d.ts +14 -0
- package/dist/e2ee/index.d.ts.map +1 -0
- package/dist/e2ee/index.js +3 -0
- package/dist/e2ee/index.js.map +1 -0
- package/dist/e2ee/large-value.d.ts +20 -0
- package/dist/e2ee/large-value.d.ts.map +1 -0
- package/dist/e2ee/large-value.js +204 -0
- package/dist/e2ee/large-value.js.map +1 -0
- package/dist/e2ee/native.d.ts +18 -0
- package/dist/e2ee/native.d.ts.map +1 -0
- package/dist/e2ee/native.js +91 -0
- package/dist/e2ee/native.js.map +1 -0
- package/dist/e2ee/record-frame.d.ts +3 -0
- package/dist/e2ee/record-frame.d.ts.map +1 -0
- package/dist/e2ee/record-frame.js +18 -0
- package/dist/e2ee/record-frame.js.map +1 -0
- package/dist/e2ee/signer.d.ts +10 -0
- package/dist/e2ee/signer.d.ts.map +1 -0
- package/dist/e2ee/signer.js +54 -0
- package/dist/e2ee/signer.js.map +1 -0
- package/dist/e2ee/sodium-browser.d.ts +2 -0
- package/dist/e2ee/sodium-browser.d.ts.map +1 -0
- package/dist/e2ee/sodium-browser.js +3432 -0
- package/dist/e2ee/sodium.d.ts +20 -0
- package/dist/e2ee/sodium.d.ts.map +1 -0
- package/dist/e2ee/sodium.js +165 -0
- package/dist/e2ee/sodium.js.map +1 -0
- package/dist/e2ee/types.d.ts +92 -0
- package/dist/e2ee/types.d.ts.map +1 -0
- package/dist/e2ee/types.js +2 -0
- package/dist/e2ee/types.js.map +1 -0
- package/dist/effect/backend/index.d.ts +8 -0
- package/dist/effect/backend/index.d.ts.map +1 -0
- package/dist/effect/backend/index.js +8 -0
- package/dist/effect/backend/index.js.map +1 -0
- package/dist/effect/errors.d.ts +53 -0
- package/dist/effect/errors.d.ts.map +1 -0
- package/dist/effect/errors.js +61 -0
- package/dist/effect/errors.js.map +1 -0
- package/dist/effect/index.d.ts +9 -0
- package/dist/effect/index.d.ts.map +1 -0
- package/dist/effect/index.js +9 -0
- package/dist/effect/index.js.map +1 -0
- package/dist/effect/jazz-backend.d.ts +69 -0
- package/dist/effect/jazz-backend.d.ts.map +1 -0
- package/dist/effect/jazz-backend.js +95 -0
- package/dist/effect/jazz-backend.js.map +1 -0
- package/dist/effect/jazz.d.ts +129 -0
- package/dist/effect/jazz.d.ts.map +1 -0
- package/dist/effect/jazz.js +182 -0
- package/dist/effect/jazz.js.map +1 -0
- package/dist/expo/create-account-manager.d.ts +28 -0
- package/dist/expo/create-account-manager.d.ts.map +1 -0
- package/dist/expo/create-account-manager.js +35 -0
- package/dist/expo/create-account-manager.js.map +1 -0
- package/dist/expo/create-jazz-session.d.ts +66 -0
- package/dist/expo/create-jazz-session.d.ts.map +1 -0
- package/dist/expo/create-jazz-session.js +96 -0
- package/dist/expo/create-jazz-session.js.map +1 -0
- package/dist/expo/index.d.ts +12 -0
- package/dist/expo/index.d.ts.map +1 -0
- package/dist/expo/index.js +10 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/expo/metro.d.ts +20 -0
- package/dist/expo/metro.d.ts.map +1 -0
- package/dist/expo/metro.js +58 -0
- package/dist/expo/metro.js.map +1 -0
- package/dist/expo/polyfills.d.ts +2 -0
- package/dist/expo/polyfills.d.ts.map +1 -0
- package/dist/expo/polyfills.js +5 -0
- package/dist/expo/polyfills.js.map +1 -0
- package/dist/expo/provider.d.ts +10 -0
- package/dist/expo/provider.d.ts.map +1 -0
- package/dist/expo/provider.js +11 -0
- package/dist/expo/provider.js.map +1 -0
- package/dist/index.d.ts +21 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/dist/inspect/cli.d.ts +12 -0
- package/dist/inspect/cli.d.ts.map +1 -0
- package/dist/inspect/cli.js +320 -0
- package/dist/inspect/cli.js.map +1 -0
- package/dist/inspect/client.d.ts +67 -0
- package/dist/inspect/client.d.ts.map +1 -0
- package/dist/inspect/client.js +254 -0
- package/dist/inspect/client.js.map +1 -0
- package/dist/inspect/mcp.d.ts +28 -0
- package/dist/inspect/mcp.d.ts.map +1 -0
- package/dist/inspect/mcp.js +441 -0
- package/dist/inspect/mcp.js.map +1 -0
- package/dist/inspect/protocol.d.ts +317 -0
- package/dist/inspect/protocol.d.ts.map +1 -0
- package/dist/inspect/protocol.js +544 -0
- package/dist/inspect/protocol.js.map +1 -0
- package/dist/inspector/index.d.ts +10 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +27 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/internal/inspector-query.d.ts +6 -0
- package/dist/internal/inspector-query.d.ts.map +1 -0
- package/dist/internal/inspector-query.js +20 -0
- package/dist/internal/inspector-query.js.map +1 -0
- package/dist/ir.d.ts +43 -7
- package/dist/ir.d.ts.map +1 -1
- package/dist/ir.js +509 -1
- package/dist/ir.js.map +1 -1
- package/dist/json-value.d.ts +6 -0
- package/dist/json-value.d.ts.map +1 -0
- package/dist/json-value.js +2 -0
- package/dist/json-value.js.map +1 -0
- package/dist/local-first/index.d.ts +18 -0
- package/dist/local-first/index.d.ts.map +1 -0
- package/dist/local-first/index.js +17 -0
- package/dist/local-first/index.js.map +1 -0
- package/dist/local-first-auth/browser.d.ts +18 -0
- package/dist/local-first-auth/browser.d.ts.map +1 -0
- package/dist/local-first-auth/browser.js +26 -0
- package/dist/local-first-auth/browser.js.map +1 -0
- package/dist/local-first-auth/encoding.d.ts +10 -0
- package/dist/local-first-auth/encoding.d.ts.map +1 -0
- package/dist/local-first-auth/encoding.js +38 -0
- package/dist/local-first-auth/encoding.js.map +1 -0
- package/dist/local-first-auth/identity.d.ts +73 -0
- package/dist/local-first-auth/identity.d.ts.map +1 -0
- package/dist/local-first-auth/identity.js +258 -0
- package/dist/local-first-auth/identity.js.map +1 -0
- package/dist/local-first-auth/index.d.ts +6 -0
- package/dist/local-first-auth/index.d.ts.map +1 -0
- package/dist/local-first-auth/index.js +4 -0
- package/dist/local-first-auth/index.js.map +1 -0
- package/dist/local-first-auth/passkey.d.ts +22 -0
- package/dist/local-first-auth/passkey.d.ts.map +1 -0
- package/dist/local-first-auth/passkey.js +116 -0
- package/dist/local-first-auth/passkey.js.map +1 -0
- package/dist/local-first-auth/recovery-phrase.d.ts +10 -0
- package/dist/local-first-auth/recovery-phrase.d.ts.map +1 -0
- package/dist/local-first-auth/recovery-phrase.js +59 -0
- package/dist/local-first-auth/recovery-phrase.js.map +1 -0
- package/dist/local-first-auth/secret.d.ts +25 -0
- package/dist/local-first-auth/secret.d.ts.map +1 -0
- package/dist/local-first-auth/secret.js +68 -0
- package/dist/local-first-auth/secret.js.map +1 -0
- package/dist/local-first-auth/server.d.ts +13 -0
- package/dist/local-first-auth/server.d.ts.map +1 -0
- package/dist/local-first-auth/server.js +32 -0
- package/dist/local-first-auth/server.js.map +1 -0
- package/dist/local-first-auth/store.d.ts +51 -0
- package/dist/local-first-auth/store.d.ts.map +1 -0
- package/dist/local-first-auth/store.js +112 -0
- package/dist/local-first-auth/store.js.map +1 -0
- package/dist/magic-columns.d.ts +40 -0
- package/dist/magic-columns.d.ts.map +1 -0
- package/dist/magic-columns.js +110 -0
- package/dist/magic-columns.js.map +1 -0
- package/dist/migration-namespace.d.ts +12 -0
- package/dist/migration-namespace.d.ts.map +1 -0
- package/dist/migration-namespace.js +13 -0
- package/dist/migration-namespace.js.map +1 -0
- package/dist/migrations.d.ts +286 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +188 -0
- package/dist/migrations.js.map +1 -0
- package/dist/module-interop.d.ts +17 -0
- package/dist/module-interop.d.ts.map +1 -0
- package/dist/module-interop.js +32 -0
- package/dist/module-interop.js.map +1 -0
- package/dist/observed-jazz-client.d.ts +15 -0
- package/dist/observed-jazz-client.d.ts.map +1 -0
- package/dist/observed-jazz-client.js +47 -0
- package/dist/observed-jazz-client.js.map +1 -0
- package/dist/passkey-backup.d.ts +3 -0
- package/dist/passkey-backup.d.ts.map +1 -0
- package/dist/passkey-backup.js +2 -0
- package/dist/passkey-backup.js.map +1 -0
- package/dist/passphrase.d.ts +2 -0
- package/dist/passphrase.d.ts.map +1 -0
- package/dist/passphrase.js +2 -0
- package/dist/passphrase.js.map +1 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.d.ts +89 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.js +62 -0
- package/dist/permissions/__fixtures__/big-label-better-auth.js.map +1 -0
- package/dist/permissions/__fixtures__/big-label.d.ts +332 -0
- package/dist/permissions/__fixtures__/big-label.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/big-label.js +177 -0
- package/dist/permissions/__fixtures__/big-label.js.map +1 -0
- package/dist/permissions/__fixtures__/chat-react.d.ts +112 -0
- package/dist/permissions/__fixtures__/chat-react.d.ts.map +1 -0
- package/dist/permissions/__fixtures__/chat-react.js +51 -0
- package/dist/permissions/__fixtures__/chat-react.js.map +1 -0
- package/dist/permissions/compile.d.ts +182 -0
- package/dist/permissions/compile.d.ts.map +1 -0
- package/dist/permissions/compile.js +715 -0
- package/dist/permissions/compile.js.map +1 -0
- package/dist/permissions/dsl.d.ts +158 -0
- package/dist/permissions/dsl.d.ts.map +1 -0
- package/dist/permissions/dsl.js +391 -0
- package/dist/permissions/dsl.js.map +1 -0
- package/dist/permissions/relation.d.ts +84 -0
- package/dist/permissions/relation.d.ts.map +1 -0
- package/dist/permissions/relation.js +150 -0
- package/dist/permissions/relation.js.map +1 -0
- package/dist/permissions/types.d.ts +357 -0
- package/dist/permissions/types.d.ts.map +1 -0
- package/dist/permissions/types.js +5 -0
- package/dist/permissions/types.js.map +1 -0
- package/dist/printer/app-json.d.ts +96 -0
- package/dist/printer/app-json.d.ts.map +1 -0
- package/dist/printer/app-json.js +18 -0
- package/dist/printer/app-json.js.map +1 -0
- package/dist/printer/cli.d.ts +15 -0
- package/dist/printer/cli.d.ts.map +1 -0
- package/dist/printer/cli.js +76 -0
- package/dist/printer/cli.js.map +1 -0
- package/dist/printer/defs.d.ts +11 -0
- package/dist/printer/defs.d.ts.map +1 -0
- package/dist/printer/defs.js +123 -0
- package/dist/printer/defs.js.map +1 -0
- package/dist/printer/expr.d.ts +281 -0
- package/dist/printer/expr.d.ts.map +1 -0
- package/dist/printer/expr.js +940 -0
- package/dist/printer/expr.js.map +1 -0
- package/dist/printer/format.d.ts +17 -0
- package/dist/printer/format.d.ts.map +1 -0
- package/dist/printer/format.js +315 -0
- package/dist/printer/format.js.map +1 -0
- package/dist/printer/index.d.ts +31 -0
- package/dist/printer/index.d.ts.map +1 -0
- package/dist/printer/index.js +51 -0
- package/dist/printer/index.js.map +1 -0
- package/dist/printer/migrations.d.ts +28 -0
- package/dist/printer/migrations.d.ts.map +1 -0
- package/dist/printer/migrations.js +179 -0
- package/dist/printer/migrations.js.map +1 -0
- package/dist/printer/names.d.ts +17 -0
- package/dist/printer/names.d.ts.map +1 -0
- package/dist/printer/names.js +124 -0
- package/dist/printer/names.js.map +1 -0
- package/dist/printer/permissions.d.ts +60 -0
- package/dist/printer/permissions.d.ts.map +1 -0
- package/dist/printer/permissions.js +1167 -0
- package/dist/printer/permissions.js.map +1 -0
- package/dist/printer/schema.d.ts +18 -0
- package/dist/printer/schema.d.ts.map +1 -0
- package/dist/printer/schema.js +132 -0
- package/dist/printer/schema.js.map +1 -0
- package/dist/prosemirror/anchors.d.ts +30 -0
- package/dist/prosemirror/anchors.d.ts.map +1 -0
- package/dist/prosemirror/anchors.js +28 -0
- package/dist/prosemirror/anchors.js.map +1 -0
- package/dist/prosemirror/index.d.ts +7 -0
- package/dist/prosemirror/index.d.ts.map +1 -0
- package/dist/prosemirror/index.js +7 -0
- package/dist/prosemirror/index.js.map +1 -0
- package/dist/prosemirror/markdown.d.ts +95 -0
- package/dist/prosemirror/markdown.d.ts.map +1 -0
- package/dist/prosemirror/markdown.js +428 -0
- package/dist/prosemirror/markdown.js.map +1 -0
- package/dist/prosemirror/overlays.d.ts +69 -0
- package/dist/prosemirror/overlays.d.ts.map +1 -0
- package/dist/prosemirror/overlays.js +143 -0
- package/dist/prosemirror/overlays.js.map +1 -0
- package/dist/prosemirror/presence.d.ts +39 -0
- package/dist/prosemirror/presence.d.ts.map +1 -0
- package/dist/prosemirror/presence.js +88 -0
- package/dist/prosemirror/presence.js.map +1 -0
- package/dist/prosemirror/sync.d.ts +60 -0
- package/dist/prosemirror/sync.d.ts.map +1 -0
- package/dist/prosemirror/sync.js +196 -0
- package/dist/prosemirror/sync.js.map +1 -0
- package/dist/prosemirror/text-map.d.ts +21 -0
- package/dist/prosemirror/text-map.d.ts.map +1 -0
- package/dist/prosemirror/text-map.js +85 -0
- package/dist/prosemirror/text-map.js.map +1 -0
- package/dist/react/create-jazz-client.d.ts +2 -11
- package/dist/react/create-jazz-client.d.ts.map +1 -1
- package/dist/react/create-jazz-client.js +1 -47
- package/dist/react/create-jazz-client.js.map +1 -1
- package/dist/react/index.d.ts +14 -7
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +8 -6
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider-props.d.ts +7 -0
- package/dist/react/provider-props.d.ts.map +1 -0
- package/dist/react/provider-props.js +15 -0
- package/dist/react/provider-props.js.map +1 -0
- package/dist/react/provider.d.ts +19 -15
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +25 -5
- package/dist/react/provider.js.map +1 -1
- package/dist/react/use-all.d.ts +1 -1
- package/dist/react/use-all.d.ts.map +1 -1
- package/dist/react/use-all.js +1 -1
- package/dist/react/use-all.js.map +1 -1
- package/dist/react/use-one.d.ts +2 -0
- package/dist/react/use-one.d.ts.map +1 -0
- package/dist/react/use-one.js +2 -0
- package/dist/react/use-one.js.map +1 -0
- package/dist/react-core/index.d.ts +9 -4
- package/dist/react-core/index.d.ts.map +1 -1
- package/dist/react-core/index.js +10 -2
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-core/provider.d.ts +48 -12
- package/dist/react-core/provider.d.ts.map +1 -1
- package/dist/react-core/provider.js +117 -13
- package/dist/react-core/provider.js.map +1 -1
- package/dist/react-core/session-context.d.ts +7 -0
- package/dist/react-core/session-context.d.ts.map +1 -0
- package/dist/react-core/session-context.js +8 -0
- package/dist/react-core/session-context.js.map +1 -0
- package/dist/react-core/session.d.ts +63 -0
- package/dist/react-core/session.d.ts.map +1 -0
- package/dist/react-core/session.js +97 -0
- package/dist/react-core/session.js.map +1 -0
- package/dist/react-core/use-all.d.ts +95 -3
- package/dist/react-core/use-all.d.ts.map +1 -1
- package/dist/react-core/use-all.js +126 -52
- package/dist/react-core/use-all.js.map +1 -1
- package/dist/react-core/use-auth-state.d.ts +13 -0
- package/dist/react-core/use-auth-state.d.ts.map +1 -0
- package/dist/react-core/use-auth-state.js +15 -0
- package/dist/react-core/use-auth-state.js.map +1 -0
- package/dist/react-core/use-one.d.ts +58 -0
- package/dist/react-core/use-one.d.ts.map +1 -0
- package/dist/react-core/use-one.js +19 -0
- package/dist/react-core/use-one.js.map +1 -0
- package/dist/react-core/use-sync-status.d.ts +8 -0
- package/dist/react-core/use-sync-status.d.ts.map +1 -0
- package/dist/react-core/use-sync-status.js +12 -0
- package/dist/react-core/use-sync-status.js.map +1 -0
- package/dist/react-native/abort-signal.d.ts +9 -0
- package/dist/react-native/abort-signal.d.ts.map +1 -0
- package/dist/react-native/abort-signal.js +51 -0
- package/dist/react-native/abort-signal.js.map +1 -0
- package/dist/react-native/account-session.d.ts +11 -0
- package/dist/react-native/account-session.d.ts.map +1 -0
- package/dist/react-native/account-session.js +59 -0
- package/dist/react-native/account-session.js.map +1 -0
- package/dist/react-native/create-account-manager.d.ts +28 -0
- package/dist/react-native/create-account-manager.d.ts.map +1 -0
- package/dist/react-native/create-account-manager.js +30 -0
- package/dist/react-native/create-account-manager.js.map +1 -0
- package/dist/react-native/create-db.d.ts +8 -0
- package/dist/react-native/create-db.d.ts.map +1 -0
- package/dist/react-native/create-db.js +9 -0
- package/dist/react-native/create-db.js.map +1 -0
- package/dist/react-native/create-jazz-client.d.ts +12 -10
- package/dist/react-native/create-jazz-client.d.ts.map +1 -1
- package/dist/react-native/create-jazz-client.js +6 -21
- package/dist/react-native/create-jazz-client.js.map +1 -1
- package/dist/react-native/create-jazz-session.d.ts +66 -0
- package/dist/react-native/create-jazz-session.d.ts.map +1 -0
- package/dist/react-native/create-jazz-session.js +96 -0
- package/dist/react-native/create-jazz-session.js.map +1 -0
- package/dist/react-native/errors.d.ts +6 -0
- package/dist/react-native/errors.d.ts.map +1 -0
- package/dist/react-native/errors.js +6 -0
- package/dist/react-native/errors.js.map +1 -0
- package/dist/react-native/index.d.ts +19 -9
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +13 -7
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/native-foreground-db.d.ts +227 -0
- package/dist/react-native/native-foreground-db.d.ts.map +1 -0
- package/dist/react-native/native-foreground-db.js +905 -0
- package/dist/react-native/native-foreground-db.js.map +1 -0
- package/dist/react-native/native-relay.d.ts +7 -0
- package/dist/react-native/native-relay.d.ts.map +1 -0
- package/dist/react-native/native-relay.js +14 -0
- package/dist/react-native/native-relay.js.map +1 -0
- package/dist/react-native/provider.d.ts +19 -13
- package/dist/react-native/provider.d.ts.map +1 -1
- package/dist/react-native/provider.js +25 -5
- package/dist/react-native/provider.js.map +1 -1
- package/dist/react-native/runtime-source.d.ts +62 -0
- package/dist/react-native/runtime-source.d.ts.map +1 -0
- package/dist/react-native/runtime-source.js +314 -0
- package/dist/react-native/runtime-source.js.map +1 -0
- package/dist/react-native/use-all.d.ts +1 -1
- package/dist/react-native/use-all.d.ts.map +1 -1
- package/dist/react-native/use-all.js +1 -1
- package/dist/react-native/use-all.js.map +1 -1
- package/dist/react-native/use-one.d.ts +2 -0
- package/dist/react-native/use-one.d.ts.map +1 -0
- package/dist/react-native/use-one.js +2 -0
- package/dist/react-native/use-one.js.map +1 -0
- package/dist/reconcile-array.d.ts +45 -0
- package/dist/reconcile-array.d.ts.map +1 -0
- package/dist/reconcile-array.js +252 -0
- package/dist/reconcile-array.js.map +1 -0
- package/dist/relationships.d.ts +18 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +28 -0
- package/dist/relationships.js.map +1 -0
- package/dist/runtime/auth-renewal-backoff.d.ts +14 -0
- package/dist/runtime/auth-renewal-backoff.d.ts.map +1 -0
- package/dist/runtime/auth-renewal-backoff.js +23 -0
- package/dist/runtime/auth-renewal-backoff.js.map +1 -0
- package/dist/runtime/auth-request-deadline.d.ts +3 -0
- package/dist/runtime/auth-request-deadline.d.ts.map +1 -0
- package/dist/runtime/auth-request-deadline.js +24 -0
- package/dist/runtime/auth-request-deadline.js.map +1 -0
- package/dist/runtime/auth-secret-codec.d.ts +21 -0
- package/dist/runtime/auth-secret-codec.d.ts.map +1 -0
- package/dist/runtime/auth-secret-codec.js +32 -0
- package/dist/runtime/auth-secret-codec.js.map +1 -0
- package/dist/runtime/auth-secret-store.d.ts +7 -0
- package/dist/runtime/auth-secret-store.d.ts.map +1 -0
- package/dist/runtime/auth-secret-store.js +12 -0
- package/dist/runtime/auth-secret-store.js.map +1 -0
- package/dist/runtime/auth-state.d.ts +47 -0
- package/dist/runtime/auth-state.d.ts.map +1 -0
- package/dist/runtime/auth-state.js +161 -0
- package/dist/runtime/auth-state.js.map +1 -0
- package/dist/runtime/author-id.d.ts +42 -0
- package/dist/runtime/author-id.d.ts.map +1 -0
- package/dist/runtime/author-id.js +172 -0
- package/dist/runtime/author-id.js.map +1 -0
- package/dist/runtime/authority-changed-error.d.ts +56 -0
- package/dist/runtime/authority-changed-error.d.ts.map +1 -0
- package/dist/runtime/authority-changed-error.js +74 -0
- package/dist/runtime/authority-changed-error.js.map +1 -0
- package/dist/runtime/backlog-rows.d.ts +3 -0
- package/dist/runtime/backlog-rows.d.ts.map +1 -0
- package/dist/runtime/backlog-rows.js +7 -0
- package/dist/runtime/backlog-rows.js.map +1 -0
- package/dist/runtime/browser-physical-database-epoch.d.ts +37 -0
- package/dist/runtime/browser-physical-database-epoch.d.ts.map +1 -0
- package/dist/runtime/browser-physical-database-epoch.js +89 -0
- package/dist/runtime/browser-physical-database-epoch.js.map +1 -0
- package/dist/runtime/browser-storage-invalidation.d.ts +8 -0
- package/dist/runtime/browser-storage-invalidation.d.ts.map +1 -0
- package/dist/runtime/browser-storage-invalidation.js +20 -0
- package/dist/runtime/browser-storage-invalidation.js.map +1 -0
- package/dist/runtime/browser-store-generation.d.ts +15 -0
- package/dist/runtime/browser-store-generation.d.ts.map +1 -0
- package/dist/runtime/browser-store-generation.js +48 -0
- package/dist/runtime/browser-store-generation.js.map +1 -0
- package/dist/runtime/browser-worker-assets.d.ts +31 -0
- package/dist/runtime/browser-worker-assets.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.js +40 -0
- package/dist/runtime/browser-worker-assets.js.map +1 -0
- package/dist/runtime/browser-worker-assets.metro.d.ts +28 -0
- package/dist/runtime/browser-worker-assets.metro.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.metro.js +52 -0
- package/dist/runtime/browser-worker-assets.metro.js.map +1 -0
- package/dist/runtime/browser-worker-assets.native.d.ts +7 -0
- package/dist/runtime/browser-worker-assets.native.d.ts.map +1 -0
- package/dist/runtime/browser-worker-assets.native.js +8 -0
- package/dist/runtime/browser-worker-assets.native.js.map +1 -0
- package/dist/runtime/browser-worker-config.d.ts +78 -0
- package/dist/runtime/browser-worker-config.d.ts.map +1 -0
- package/dist/runtime/browser-worker-config.js +299 -0
- package/dist/runtime/browser-worker-config.js.map +1 -0
- package/dist/runtime/client-config-key.d.ts +6 -0
- package/dist/runtime/client-config-key.d.ts.map +1 -0
- package/dist/runtime/client-config-key.js +83 -0
- package/dist/runtime/client-config-key.js.map +1 -0
- package/dist/runtime/client-migrations.d.ts +27 -0
- package/dist/runtime/client-migrations.d.ts.map +1 -0
- package/dist/runtime/client-migrations.js +25 -0
- package/dist/runtime/client-migrations.js.map +1 -0
- package/dist/runtime/client-registry.d.ts +21 -0
- package/dist/runtime/client-registry.d.ts.map +1 -0
- package/dist/runtime/client-registry.js +169 -0
- package/dist/runtime/client-registry.js.map +1 -0
- package/dist/runtime/client-scope.d.ts +38 -0
- package/dist/runtime/client-scope.d.ts.map +1 -0
- package/dist/runtime/client-scope.js +64 -0
- package/dist/runtime/client-scope.js.map +1 -0
- package/dist/runtime/client-session.d.ts +56 -14
- package/dist/runtime/client-session.d.ts.map +1 -1
- package/dist/runtime/client-session.js +211 -195
- package/dist/runtime/client-session.js.map +1 -1
- package/dist/runtime/client.d.ts +721 -194
- package/dist/runtime/client.d.ts.map +1 -1
- package/dist/runtime/client.js +1213 -434
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/column-transforms.d.ts +26 -0
- package/dist/runtime/column-transforms.d.ts.map +1 -0
- package/dist/runtime/column-transforms.js +186 -0
- package/dist/runtime/column-transforms.js.map +1 -0
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts +178 -0
- package/dist/runtime/connection-manager/browser-connection-manager.d.ts.map +1 -0
- package/dist/runtime/connection-manager/browser-connection-manager.js +1030 -0
- package/dist/runtime/connection-manager/browser-connection-manager.js.map +1 -0
- package/dist/runtime/connection-manager/direct-connection-manager.d.ts +28 -0
- package/dist/runtime/connection-manager/direct-connection-manager.d.ts.map +1 -0
- package/dist/runtime/connection-manager/direct-connection-manager.js +202 -0
- package/dist/runtime/connection-manager/direct-connection-manager.js.map +1 -0
- package/dist/runtime/connection-manager/index.d.ts +5 -0
- package/dist/runtime/connection-manager/index.d.ts.map +1 -0
- package/dist/runtime/connection-manager/index.js +4 -0
- package/dist/runtime/connection-manager/index.js.map +1 -0
- package/dist/runtime/connection-manager/types.d.ts +174 -0
- package/dist/runtime/connection-manager/types.d.ts.map +1 -0
- package/dist/runtime/connection-manager/types.js +396 -0
- package/dist/runtime/connection-manager/types.js.map +1 -0
- package/dist/runtime/context.d.ts +100 -30
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/core-tick-failed-error.d.ts +31 -0
- package/dist/runtime/core-tick-failed-error.d.ts.map +1 -0
- package/dist/runtime/core-tick-failed-error.js +45 -0
- package/dist/runtime/core-tick-failed-error.js.map +1 -0
- package/dist/runtime/credentialed-transport.d.ts +42 -0
- package/dist/runtime/credentialed-transport.d.ts.map +1 -0
- package/dist/runtime/credentialed-transport.js +178 -0
- package/dist/runtime/credentialed-transport.js.map +1 -0
- package/dist/runtime/db-access-context.d.ts +14 -0
- package/dist/runtime/db-access-context.d.ts.map +1 -0
- package/dist/runtime/db-access-context.js +26 -0
- package/dist/runtime/db-access-context.js.map +1 -0
- package/dist/runtime/db-internal-session.d.ts +7 -0
- package/dist/runtime/db-internal-session.d.ts.map +1 -0
- package/dist/runtime/db-internal-session.js +21 -0
- package/dist/runtime/db-internal-session.js.map +1 -0
- package/dist/runtime/db-replaced-error.d.ts +21 -0
- package/dist/runtime/db-replaced-error.d.ts.map +1 -0
- package/dist/runtime/db-replaced-error.js +22 -0
- package/dist/runtime/db-replaced-error.js.map +1 -0
- package/dist/runtime/db.d.ts +857 -215
- package/dist/runtime/db.d.ts.map +1 -1
- package/dist/runtime/db.js +3474 -834
- package/dist/runtime/db.js.map +1 -1
- package/dist/runtime/default-create-db.d.ts +5 -0
- package/dist/runtime/default-create-db.d.ts.map +1 -0
- package/dist/runtime/default-create-db.js +7 -0
- package/dist/runtime/default-create-db.js.map +1 -0
- package/dist/runtime/default-runtime-source.d.ts +41 -0
- package/dist/runtime/default-runtime-source.d.ts.map +1 -0
- package/dist/runtime/default-runtime-source.js +326 -0
- package/dist/runtime/default-runtime-source.js.map +1 -0
- package/dist/runtime/delete-local-first-store.d.ts +12 -0
- package/dist/runtime/delete-local-first-store.d.ts.map +1 -0
- package/dist/runtime/delete-local-first-store.js +12 -0
- package/dist/runtime/delete-local-first-store.js.map +1 -0
- package/dist/runtime/deterministic-bytes.d.ts +6 -0
- package/dist/runtime/deterministic-bytes.d.ts.map +1 -0
- package/dist/runtime/deterministic-bytes.js +18 -0
- package/dist/runtime/deterministic-bytes.js.map +1 -0
- package/dist/runtime/graceful-shutdown-error.d.ts +17 -0
- package/dist/runtime/graceful-shutdown-error.d.ts.map +1 -0
- package/dist/runtime/graceful-shutdown-error.js +31 -0
- package/dist/runtime/graceful-shutdown-error.js.map +1 -0
- package/dist/runtime/hex.d.ts +21 -0
- package/dist/runtime/hex.d.ts.map +1 -0
- package/dist/runtime/hex.js +62 -0
- package/dist/runtime/hex.js.map +1 -0
- package/dist/runtime/history-relation.d.ts +8 -0
- package/dist/runtime/history-relation.d.ts.map +1 -0
- package/dist/runtime/history-relation.js +44 -0
- package/dist/runtime/history-relation.js.map +1 -0
- package/dist/runtime/in-process-transport.d.ts +18 -0
- package/dist/runtime/in-process-transport.d.ts.map +1 -0
- package/dist/runtime/in-process-transport.js +32 -0
- package/dist/runtime/in-process-transport.js.map +1 -0
- package/dist/runtime/index.d.ts +22 -13
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +14 -12
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/indexeddb-page-store.d.ts +214 -0
- package/dist/runtime/indexeddb-page-store.d.ts.map +1 -0
- package/dist/runtime/indexeddb-page-store.js +848 -0
- package/dist/runtime/indexeddb-page-store.js.map +1 -0
- package/dist/runtime/introspection-fetch.d.ts +18 -0
- package/dist/runtime/introspection-fetch.d.ts.map +1 -0
- package/dist/runtime/introspection-fetch.js +12 -0
- package/dist/runtime/introspection-fetch.js.map +1 -0
- package/dist/runtime/json-schema-evaluate.d.ts +55 -0
- package/dist/runtime/json-schema-evaluate.d.ts.map +1 -0
- package/dist/runtime/json-schema-evaluate.js +946 -0
- package/dist/runtime/json-schema-evaluate.js.map +1 -0
- package/dist/runtime/json-schema-formats.d.ts +14 -0
- package/dist/runtime/json-schema-formats.d.ts.map +1 -0
- package/dist/runtime/json-schema-formats.js +555 -0
- package/dist/runtime/json-schema-formats.js.map +1 -0
- package/dist/runtime/json-schema-json.d.ts +41 -0
- package/dist/runtime/json-schema-json.d.ts.map +1 -0
- package/dist/runtime/json-schema-json.js +309 -0
- package/dist/runtime/json-schema-json.js.map +1 -0
- package/dist/runtime/json-schema-metaschemas.d.ts +1403 -0
- package/dist/runtime/json-schema-metaschemas.d.ts.map +1 -0
- package/dist/runtime/json-schema-metaschemas.js +64 -0
- package/dist/runtime/json-schema-metaschemas.js.map +1 -0
- package/dist/runtime/json-schema-regex.d.ts +32 -0
- package/dist/runtime/json-schema-regex.d.ts.map +1 -0
- package/dist/runtime/json-schema-regex.js +895 -0
- package/dist/runtime/json-schema-regex.js.map +1 -0
- package/dist/runtime/json-schema-validator.d.ts +50 -0
- package/dist/runtime/json-schema-validator.d.ts.map +1 -0
- package/dist/runtime/json-schema-validator.js +404 -0
- package/dist/runtime/json-schema-validator.js.map +1 -0
- package/dist/runtime/json-text.js.map +1 -1
- package/dist/runtime/local-first-token.d.ts +11 -0
- package/dist/runtime/local-first-token.d.ts.map +1 -0
- package/dist/runtime/local-first-token.js +20 -0
- package/dist/runtime/local-first-token.js.map +1 -0
- package/dist/runtime/local-first-unavailable.d.ts +40 -0
- package/dist/runtime/local-first-unavailable.d.ts.map +1 -0
- package/dist/runtime/local-first-unavailable.js +81 -0
- package/dist/runtime/local-first-unavailable.js.map +1 -0
- package/dist/runtime/local-first-upgrade.d.ts +36 -0
- package/dist/runtime/local-first-upgrade.d.ts.map +1 -0
- package/dist/runtime/local-first-upgrade.js +31 -0
- package/dist/runtime/local-first-upgrade.js.map +1 -0
- package/dist/runtime/local-write-observer.d.ts +5 -0
- package/dist/runtime/local-write-observer.d.ts.map +1 -0
- package/dist/runtime/local-write-observer.js +31 -0
- package/dist/runtime/local-write-observer.js.map +1 -0
- package/dist/runtime/metro-setup-error.d.ts +20 -0
- package/dist/runtime/metro-setup-error.d.ts.map +1 -0
- package/dist/runtime/metro-setup-error.js +22 -0
- package/dist/runtime/metro-setup-error.js.map +1 -0
- package/dist/runtime/native-artifact-compatibility.d.ts +12 -0
- package/dist/runtime/native-artifact-compatibility.d.ts.map +1 -0
- package/dist/runtime/native-artifact-compatibility.js +26 -0
- package/dist/runtime/native-artifact-compatibility.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts +2 -0
- package/dist/runtime/native-artifact-fingerprint-napi.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-napi.js +3 -0
- package/dist/runtime/native-artifact-fingerprint-napi.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts +2 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.js +3 -0
- package/dist/runtime/native-artifact-fingerprint-wasm.js.map +1 -0
- package/dist/runtime/native-artifact-fingerprints.d.ts +5 -0
- package/dist/runtime/native-artifact-fingerprints.d.ts.map +1 -0
- package/dist/runtime/native-artifact-fingerprints.js +7 -0
- package/dist/runtime/native-artifact-fingerprints.js.map +1 -0
- package/dist/runtime/native-artifact-mismatch-error.d.ts +25 -0
- package/dist/runtime/native-artifact-mismatch-error.d.ts.map +1 -0
- package/dist/runtime/native-artifact-mismatch-error.js +34 -0
- package/dist/runtime/native-artifact-mismatch-error.js.map +1 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts +23 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js +45 -0
- package/dist/runtime/native-runtime/attached-browser-worker-connection.js.map +1 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.d.ts +15 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.d.ts.map +1 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.js +64 -0
- package/dist/runtime/native-runtime/auxiliary-receive-deadline.js.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts +34 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.d.ts.map +1 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js +61 -0
- package/dist/runtime/native-runtime/broker-worker-load-failure.js.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts +109 -0
- package/dist/runtime/native-runtime/browser-follower-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-follower-connection.js +558 -0
- package/dist/runtime/native-runtime/browser-follower-connection.js.map +1 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts +130 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js +988 -0
- package/dist/runtime/native-runtime/browser-shared-worker-connection.js.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts +527 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.js +296 -0
- package/dist/runtime/native-runtime/browser-worker-protocol.js.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-transport.d.ts +56 -0
- package/dist/runtime/native-runtime/browser-worker-transport.d.ts.map +1 -0
- package/dist/runtime/native-runtime/browser-worker-transport.js +305 -0
- package/dist/runtime/native-runtime/browser-worker-transport.js.map +1 -0
- package/dist/runtime/native-runtime/exact-integer.d.ts +7 -0
- package/dist/runtime/native-runtime/exact-integer.d.ts.map +1 -0
- package/dist/runtime/native-runtime/exact-integer.js +18 -0
- package/dist/runtime/native-runtime/exact-integer.js.map +1 -0
- package/dist/runtime/native-runtime/http-stream-socket.d.ts +103 -0
- package/dist/runtime/native-runtime/http-stream-socket.d.ts.map +1 -0
- package/dist/runtime/native-runtime/http-stream-socket.js +554 -0
- package/dist/runtime/native-runtime/http-stream-socket.js.map +1 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.d.ts +4 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.d.ts.map +1 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.js +33 -0
- package/dist/runtime/native-runtime/inspector-control-lifecycle.js.map +1 -0
- package/dist/runtime/native-runtime/native-codec.d.ts +172 -0
- package/dist/runtime/native-runtime/native-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-codec.js +629 -0
- package/dist/runtime/native-runtime/native-codec.js.map +1 -0
- package/dist/runtime/native-runtime/native-error-code.d.ts +39 -0
- package/dist/runtime/native-runtime/native-error-code.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-error-code.js +64 -0
- package/dist/runtime/native-runtime/native-error-code.js.map +1 -0
- package/dist/runtime/native-runtime/native-row-codec.d.ts +161 -0
- package/dist/runtime/native-runtime/native-row-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-row-codec.js +903 -0
- package/dist/runtime/native-runtime/native-row-codec.js.map +1 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.d.ts +15 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.js +25 -0
- package/dist/runtime/native-runtime/native-row-descriptor-key.js.map +1 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts +913 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.d.ts.map +1 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.js +5999 -0
- package/dist/runtime/native-runtime/native-runtime-adapter.js.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.d.ts +17 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.d.ts.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.js +4 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.browser.js.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.d.ts +19 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.d.ts.map +1 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.js +297 -0
- package/dist/runtime/native-runtime/node-foreground-node-lease.js.map +1 -0
- package/dist/runtime/native-runtime/row-values-transport.d.ts +2 -0
- package/dist/runtime/native-runtime/row-values-transport.d.ts.map +1 -0
- package/dist/runtime/native-runtime/row-values-transport.js +21 -0
- package/dist/runtime/native-runtime/row-values-transport.js.map +1 -0
- package/dist/runtime/native-runtime/schema-codec.d.ts +10 -0
- package/dist/runtime/native-runtime/schema-codec.d.ts.map +1 -0
- package/dist/runtime/native-runtime/schema-codec.js +13 -0
- package/dist/runtime/native-runtime/schema-codec.js.map +1 -0
- package/dist/runtime/native-runtime/session-renewal-wire.d.ts +48 -0
- package/dist/runtime/native-runtime/session-renewal-wire.d.ts.map +1 -0
- package/dist/runtime/native-runtime/session-renewal-wire.js +107 -0
- package/dist/runtime/native-runtime/session-renewal-wire.js.map +1 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts +34 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.d.ts.map +1 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.js +146 -0
- package/dist/runtime/native-runtime/stream-endpoint-memory.js.map +1 -0
- package/dist/runtime/native-runtime/websocket.d.ts +327 -0
- package/dist/runtime/native-runtime/websocket.d.ts.map +1 -0
- package/dist/runtime/native-runtime/websocket.js +1112 -0
- package/dist/runtime/native-runtime/websocket.js.map +1 -0
- package/dist/runtime/newer-build-reload.d.ts +30 -0
- package/dist/runtime/newer-build-reload.d.ts.map +1 -0
- package/dist/runtime/newer-build-reload.js +59 -0
- package/dist/runtime/newer-build-reload.js.map +1 -0
- package/dist/runtime/page-cache.d.ts +44 -0
- package/dist/runtime/page-cache.d.ts.map +1 -0
- package/dist/runtime/page-cache.js +104 -0
- package/dist/runtime/page-cache.js.map +1 -0
- package/dist/runtime/page-handle.d.ts +83 -0
- package/dist/runtime/page-handle.d.ts.map +1 -0
- package/dist/runtime/page-handle.js +151 -0
- package/dist/runtime/page-handle.js.map +1 -0
- package/dist/runtime/passkey-backup.d.ts +3 -0
- package/dist/runtime/passkey-backup.d.ts.map +1 -0
- package/dist/runtime/passkey-backup.js +2 -0
- package/dist/runtime/passkey-backup.js.map +1 -0
- package/dist/runtime/platform-url.d.ts +10 -0
- package/dist/runtime/platform-url.d.ts.map +1 -0
- package/dist/runtime/platform-url.js +3 -0
- package/dist/runtime/platform-url.js.map +1 -0
- package/dist/runtime/platform-url.native.d.ts +6 -0
- package/dist/runtime/platform-url.native.d.ts.map +1 -0
- package/dist/runtime/platform-url.native.js +38 -0
- package/dist/runtime/platform-url.native.js.map +1 -0
- package/dist/runtime/query-adapter.d.ts +7 -15
- package/dist/runtime/query-adapter.d.ts.map +1 -1
- package/dist/runtime/query-adapter.js +390 -110
- package/dist/runtime/query-adapter.js.map +1 -1
- package/dist/runtime/query-builder-shape.d.ts +75 -0
- package/dist/runtime/query-builder-shape.d.ts.map +1 -0
- package/dist/runtime/query-builder-shape.js +225 -0
- package/dist/runtime/query-builder-shape.js.map +1 -0
- package/dist/runtime/query-column-name.d.ts +3 -0
- package/dist/runtime/query-column-name.d.ts.map +1 -0
- package/dist/runtime/query-column-name.js +10 -0
- package/dist/runtime/query-column-name.js.map +1 -0
- package/dist/runtime/query-output-table.d.ts +5 -0
- package/dist/runtime/query-output-table.d.ts.map +1 -0
- package/dist/runtime/query-output-table.js +30 -0
- package/dist/runtime/query-output-table.js.map +1 -0
- package/dist/runtime/recovery-phrase.d.ts +3 -0
- package/dist/runtime/recovery-phrase.d.ts.map +1 -0
- package/dist/runtime/recovery-phrase.js +2 -0
- package/dist/runtime/recovery-phrase.js.map +1 -0
- package/dist/runtime/remote-link-state.d.ts +20 -0
- package/dist/runtime/remote-link-state.d.ts.map +1 -0
- package/dist/runtime/remote-link-state.js +5 -0
- package/dist/runtime/remote-link-state.js.map +1 -0
- package/dist/runtime/removed-provider-props.d.ts +17 -0
- package/dist/runtime/removed-provider-props.d.ts.map +1 -0
- package/dist/runtime/removed-provider-props.js +16 -0
- package/dist/runtime/removed-provider-props.js.map +1 -0
- package/dist/runtime/row-transformer.d.ts +17 -3
- package/dist/runtime/row-transformer.d.ts.map +1 -1
- package/dist/runtime/row-transformer.js +163 -38
- package/dist/runtime/row-transformer.js.map +1 -1
- package/dist/runtime/run-cleanup-steps.d.ts +5 -0
- package/dist/runtime/run-cleanup-steps.d.ts.map +1 -0
- package/dist/runtime/run-cleanup-steps.js +19 -0
- package/dist/runtime/run-cleanup-steps.js.map +1 -0
- package/dist/runtime/runtime-closed-error.d.ts +9 -0
- package/dist/runtime/runtime-closed-error.d.ts.map +1 -0
- package/dist/runtime/runtime-closed-error.js +12 -0
- package/dist/runtime/runtime-closed-error.js.map +1 -0
- package/dist/runtime/runtime-config.d.ts +13 -0
- package/dist/runtime/runtime-config.d.ts.map +1 -0
- package/dist/runtime/runtime-config.js +115 -0
- package/dist/runtime/runtime-config.js.map +1 -0
- package/dist/runtime/runtime-entropy.d.ts +14 -0
- package/dist/runtime/runtime-entropy.d.ts.map +1 -0
- package/dist/runtime/runtime-entropy.js +43 -0
- package/dist/runtime/runtime-entropy.js.map +1 -0
- package/dist/runtime/runtime-source.d.ts +206 -0
- package/dist/runtime/runtime-source.d.ts.map +1 -0
- package/dist/runtime/runtime-source.js +64 -0
- package/dist/runtime/runtime-source.js.map +1 -0
- package/dist/runtime/schema-metadata.d.ts +22 -0
- package/dist/runtime/schema-metadata.d.ts.map +1 -0
- package/dist/runtime/schema-metadata.js +70 -0
- package/dist/runtime/schema-metadata.js.map +1 -0
- package/dist/runtime/select-projection.d.ts +5 -0
- package/dist/runtime/select-projection.d.ts.map +1 -0
- package/dist/runtime/select-projection.js +47 -0
- package/dist/runtime/select-projection.js.map +1 -0
- package/dist/runtime/snapshot-ref.d.ts +24 -0
- package/dist/runtime/snapshot-ref.d.ts.map +1 -0
- package/dist/runtime/snapshot-ref.js +43 -0
- package/dist/runtime/snapshot-ref.js.map +1 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts +53 -0
- package/dist/runtime/store-held-by-another-tab-error.d.ts.map +1 -0
- package/dist/runtime/store-held-by-another-tab-error.js +55 -0
- package/dist/runtime/store-held-by-another-tab-error.js.map +1 -0
- package/dist/runtime/streaming-source.d.ts +4 -0
- package/dist/runtime/streaming-source.d.ts.map +1 -0
- package/dist/runtime/streaming-source.js +53 -0
- package/dist/runtime/streaming-source.js.map +1 -0
- package/dist/runtime/structural-values.d.ts +6 -0
- package/dist/runtime/structural-values.d.ts.map +1 -0
- package/dist/runtime/structural-values.js +51 -0
- package/dist/runtime/structural-values.js.map +1 -0
- package/dist/runtime/subscription-manager.d.ts +103 -14
- package/dist/runtime/subscription-manager.d.ts.map +1 -1
- package/dist/runtime/subscription-manager.js +1051 -25
- package/dist/runtime/subscription-manager.js.map +1 -1
- package/dist/runtime/sync-status.d.ts +178 -0
- package/dist/runtime/sync-status.d.ts.map +1 -0
- package/dist/runtime/sync-status.js +163 -0
- package/dist/runtime/sync-status.js.map +1 -0
- package/dist/runtime/sync-telemetry.d.ts +35 -0
- package/dist/runtime/sync-telemetry.d.ts.map +1 -0
- package/dist/runtime/sync-telemetry.js +354 -0
- package/dist/runtime/sync-telemetry.js.map +1 -0
- package/dist/runtime/system-identity.d.ts +5 -0
- package/dist/runtime/system-identity.d.ts.map +1 -0
- package/dist/runtime/system-identity.js +10 -0
- package/dist/runtime/system-identity.js.map +1 -0
- package/dist/runtime/telemetry-env.d.ts +2 -0
- package/dist/runtime/telemetry-env.d.ts.map +1 -0
- package/dist/runtime/telemetry-env.js +16 -0
- package/dist/runtime/telemetry-env.js.map +1 -0
- package/dist/runtime/telemetry-env.native.d.ts +3 -0
- package/dist/runtime/telemetry-env.native.d.ts.map +1 -0
- package/dist/runtime/telemetry-env.native.js +7 -0
- package/dist/runtime/telemetry-env.native.js.map +1 -0
- package/dist/runtime/text-anchors.d.ts +58 -0
- package/dist/runtime/text-anchors.d.ts.map +1 -0
- package/dist/runtime/text-anchors.js +9 -0
- package/dist/runtime/text-anchors.js.map +1 -0
- package/dist/runtime/unsupported-storage-codecs-error.d.ts +53 -0
- package/dist/runtime/unsupported-storage-codecs-error.d.ts.map +1 -0
- package/dist/runtime/unsupported-storage-codecs-error.js +74 -0
- package/dist/runtime/unsupported-storage-codecs-error.js.map +1 -0
- package/dist/runtime/url.d.ts +32 -0
- package/dist/runtime/url.d.ts.map +1 -0
- package/dist/runtime/url.js +96 -0
- package/dist/runtime/url.js.map +1 -0
- package/dist/runtime/utf8.d.ts +10 -0
- package/dist/runtime/utf8.d.ts.map +1 -0
- package/dist/runtime/utf8.js +93 -0
- package/dist/runtime/utf8.js.map +1 -0
- package/dist/runtime/util.d.ts +18 -0
- package/dist/runtime/util.d.ts.map +1 -0
- package/dist/runtime/util.js +59 -0
- package/dist/runtime/util.js.map +1 -0
- package/dist/runtime/value-converter.d.ts +9 -17
- package/dist/runtime/value-converter.d.ts.map +1 -1
- package/dist/runtime/value-converter.js +156 -42
- package/dist/runtime/value-converter.js.map +1 -1
- package/dist/runtime/wasm-loader.d.ts +6 -0
- package/dist/runtime/wasm-loader.d.ts.map +1 -0
- package/dist/runtime/wasm-loader.js +127 -0
- package/dist/runtime/wasm-loader.js.map +1 -0
- package/dist/runtime/write-preparation.d.ts +24 -0
- package/dist/runtime/write-preparation.d.ts.map +1 -0
- package/dist/runtime/write-preparation.js +63 -0
- package/dist/runtime/write-preparation.js.map +1 -0
- package/dist/runtime/write-row.d.ts +8 -0
- package/dist/runtime/write-row.d.ts.map +1 -0
- package/dist/runtime/write-row.js +17 -0
- package/dist/runtime/write-row.js.map +1 -0
- package/dist/schema-builders.d.ts +48 -0
- package/dist/schema-builders.d.ts.map +1 -0
- package/dist/schema-builders.js +26 -0
- package/dist/schema-builders.js.map +1 -0
- package/dist/schema-dsl/define-schema.d.ts +32 -0
- package/dist/schema-dsl/define-schema.d.ts.map +1 -0
- package/dist/schema-dsl/define-schema.js +80 -0
- package/dist/schema-dsl/define-schema.js.map +1 -0
- package/dist/schema-dsl/readable-app.d.ts +30 -0
- package/dist/schema-dsl/readable-app.d.ts.map +1 -0
- package/dist/schema-dsl/readable-app.js +139 -0
- package/dist/schema-dsl/readable-app.js.map +1 -0
- package/dist/schema-dsl/table.d.ts +101 -0
- package/dist/schema-dsl/table.d.ts.map +1 -0
- package/dist/schema-dsl/table.js +153 -0
- package/dist/schema-dsl/table.js.map +1 -0
- package/dist/schema-errors.d.ts +6 -0
- package/dist/schema-errors.d.ts.map +1 -0
- package/dist/schema-errors.js +6 -0
- package/dist/schema-errors.js.map +1 -0
- package/dist/schema-loader.d.ts +16 -0
- package/dist/schema-loader.d.ts.map +1 -0
- package/dist/schema-loader.js +108 -0
- package/dist/schema-loader.js.map +1 -0
- package/dist/schema-name.d.ts +2 -0
- package/dist/schema-name.d.ts.map +1 -0
- package/dist/schema-name.js +19 -0
- package/dist/schema-name.js.map +1 -0
- package/dist/schema-namespace.d.ts +7 -0
- package/dist/schema-namespace.d.ts.map +1 -0
- package/dist/schema-namespace.js +7 -0
- package/dist/schema-namespace.js.map +1 -0
- package/dist/schema-permissions.d.ts +12 -0
- package/dist/schema-permissions.d.ts.map +1 -0
- package/dist/schema-permissions.js +17 -0
- package/dist/schema-permissions.js.map +1 -0
- package/dist/schema-source.d.ts +11 -0
- package/dist/schema-source.d.ts.map +1 -0
- package/dist/schema-source.js +53 -0
- package/dist/schema-source.js.map +1 -0
- package/dist/schema.d.ts +95 -38
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -16
- package/dist/schema.js.map +1 -1
- package/dist/session/backend-watch.d.ts +186 -0
- package/dist/session/backend-watch.d.ts.map +1 -0
- package/dist/session/backend-watch.js +698 -0
- package/dist/session/backend-watch.js.map +1 -0
- package/dist/session/config-options.d.ts +15 -0
- package/dist/session/config-options.d.ts.map +1 -0
- package/dist/session/config-options.js +55 -0
- package/dist/session/config-options.js.map +1 -0
- package/dist/session/consumer.d.ts +3 -0
- package/dist/session/consumer.d.ts.map +1 -0
- package/dist/session/consumer.js +3 -0
- package/dist/session/consumer.js.map +1 -0
- package/dist/session/create-jazz-session.d.ts +123 -0
- package/dist/session/create-jazz-session.d.ts.map +1 -0
- package/dist/session/create-jazz-session.js +542 -0
- package/dist/session/create-jazz-session.js.map +1 -0
- package/dist/session/follow-user.d.ts +72 -0
- package/dist/session/follow-user.d.ts.map +1 -0
- package/dist/session/follow-user.js +147 -0
- package/dist/session/follow-user.js.map +1 -0
- package/dist/session/jazz-session.d.ts +234 -0
- package/dist/session/jazz-session.d.ts.map +1 -0
- package/dist/session/jazz-session.js +528 -0
- package/dist/session/jazz-session.js.map +1 -0
- package/dist/session/native-backend-watch.d.ts +4 -0
- package/dist/session/native-backend-watch.d.ts.map +1 -0
- package/dist/session/native-backend-watch.js +14 -0
- package/dist/session/native-backend-watch.js.map +1 -0
- package/dist/session/no-kept-device-account-error.d.ts +6 -0
- package/dist/session/no-kept-device-account-error.d.ts.map +1 -0
- package/dist/session/no-kept-device-account-error.js +8 -0
- package/dist/session/no-kept-device-account-error.js.map +1 -0
- package/dist/session/replica-ledger.d.ts +164 -0
- package/dist/session/replica-ledger.d.ts.map +1 -0
- package/dist/session/replica-ledger.js +496 -0
- package/dist/session/replica-ledger.js.map +1 -0
- package/dist/session/state.d.ts +135 -0
- package/dist/session/state.d.ts.map +1 -0
- package/dist/session/state.js +535 -0
- package/dist/session/state.js.map +1 -0
- package/dist/shared/index.d.ts +20 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +17 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.d.ts +13 -0
- package/dist/solid/create-solid-jazz-client-internal.d.ts.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.js +82 -0
- package/dist/solid/create-solid-jazz-client-internal.js.map +1 -0
- package/dist/solid/create-solid-jazz-client-internal.ssr.js +101 -0
- package/dist/solid/create-solid-jazz-client-internal.ssr.js.map +1 -0
- package/dist/solid/create-solid-jazz-client.d.ts +24 -0
- package/dist/solid/create-solid-jazz-client.d.ts.map +1 -0
- package/dist/solid/create-solid-jazz-client.js +42 -0
- package/dist/solid/create-solid-jazz-client.js.map +1 -0
- package/dist/solid/create-solid-jazz-client.ssr.js +45 -0
- package/dist/solid/create-solid-jazz-client.ssr.js.map +1 -0
- package/dist/solid/index.d.ts +13 -0
- package/dist/solid/index.d.ts.map +1 -0
- package/dist/solid/index.js +9 -0
- package/dist/solid/index.ssr.js +9 -0
- package/dist/solid/provider.d.ts +25 -0
- package/dist/solid/provider.d.ts.map +1 -0
- package/dist/solid/provider.js +48 -0
- package/dist/solid/provider.js.map +1 -0
- package/dist/solid/provider.ssr.js +48 -0
- package/dist/solid/provider.ssr.js.map +1 -0
- package/dist/solid/session-context.d.ts +14 -0
- package/dist/solid/session-context.d.ts.map +1 -0
- package/dist/solid/session-context.js +6 -0
- package/dist/solid/session-context.js.map +1 -0
- package/dist/solid/session-context.ssr.js +10 -0
- package/dist/solid/session-context.ssr.js.map +1 -0
- package/dist/solid/session.d.ts +55 -0
- package/dist/solid/session.d.ts.map +1 -0
- package/dist/solid/session.js +130 -0
- package/dist/solid/session.js.map +1 -0
- package/dist/solid/session.ssr.js +156 -0
- package/dist/solid/session.ssr.js.map +1 -0
- package/dist/solid/solid-jazz-client-store.d.ts +11 -0
- package/dist/solid/solid-jazz-client-store.d.ts.map +1 -0
- package/dist/solid/solid-jazz-client-store.js +38 -0
- package/dist/solid/solid-jazz-client-store.js.map +1 -0
- package/dist/solid/solid-jazz-client-store.ssr.js +39 -0
- package/dist/solid/solid-jazz-client-store.ssr.js.map +1 -0
- package/dist/solid/use-all.d.ts +18 -0
- package/dist/solid/use-all.d.ts.map +1 -0
- package/dist/solid/use-all.js +71 -0
- package/dist/solid/use-all.js.map +1 -0
- package/dist/solid/use-all.ssr.js +84 -0
- package/dist/solid/use-all.ssr.js.map +1 -0
- package/dist/solid/use-one.d.ts +18 -0
- package/dist/solid/use-one.d.ts.map +1 -0
- package/dist/solid/use-one.js +27 -0
- package/dist/solid/use-one.js.map +1 -0
- package/dist/solid/use-one.ssr.js +27 -0
- package/dist/solid/use-one.ssr.js.map +1 -0
- package/dist/solid/use-sync-status.d.ts +8 -0
- package/dist/solid/use-sync-status.d.ts.map +1 -0
- package/dist/solid/use-sync-status.js +13 -0
- package/dist/solid/use-sync-status.js.map +1 -0
- package/dist/solid/use-sync-status.ssr.js +20 -0
- package/dist/solid/use-sync-status.ssr.js.map +1 -0
- package/dist/subscription-store-internal.d.ts +11 -0
- package/dist/subscription-store-internal.d.ts.map +1 -0
- package/dist/subscription-store-internal.js +18 -0
- package/dist/subscription-store-internal.js.map +1 -0
- package/dist/subscriptions-orchestrator.d.ts +92 -14
- package/dist/subscriptions-orchestrator.d.ts.map +1 -1
- package/dist/subscriptions-orchestrator.js +390 -75
- package/dist/subscriptions-orchestrator.js.map +1 -1
- package/dist/svelte/JazzProvider.svelte +110 -0
- package/dist/svelte/JazzProvider.svelte.d.ts +24 -0
- package/dist/svelte/JazzProvider.svelte.d.ts.map +1 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte +83 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts +15 -0
- package/dist/svelte/JazzSvelteClientProvider.svelte.d.ts.map +1 -0
- package/dist/svelte/context.svelte.d.ts +19 -3
- package/dist/svelte/context.svelte.d.ts.map +1 -1
- package/dist/svelte/context.svelte.js +21 -5
- package/dist/svelte/create-jazz-client.d.ts +2 -8
- package/dist/svelte/create-jazz-client.d.ts.map +1 -1
- package/dist/svelte/create-jazz-client.js +1 -17
- package/dist/svelte/index.d.ts +14 -7
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +10 -7
- package/dist/svelte/query-subscription.svelte.d.ts +60 -0
- package/dist/svelte/query-subscription.svelte.d.ts.map +1 -0
- package/dist/svelte/query-subscription.svelte.js +135 -0
- package/dist/svelte/session-state.d.ts +27 -0
- package/dist/svelte/session-state.d.ts.map +1 -0
- package/dist/svelte/session-state.js +49 -0
- package/dist/svelte/sync-status.d.ts +11 -0
- package/dist/svelte/sync-status.d.ts.map +1 -0
- package/dist/svelte/sync-status.js +15 -0
- package/dist/testing/fixtures/with-bigint/schema.d.ts +18 -0
- package/dist/testing/fixtures/with-bigint/schema.d.ts.map +1 -0
- package/dist/testing/fixtures/with-bigint/schema.js +15 -0
- package/dist/testing/fixtures/with-bigint/schema.js.map +1 -0
- package/dist/testing/index.d.ts +6 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +5 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/policy-test-app.d.ts +129 -0
- package/dist/testing/policy-test-app.d.ts.map +1 -0
- package/dist/testing/policy-test-app.js +229 -0
- package/dist/testing/policy-test-app.js.map +1 -0
- package/dist/testing/test-app.d.ts +272 -0
- package/dist/testing/test-app.d.ts.map +1 -0
- package/dist/testing/test-app.js +62 -0
- package/dist/testing/test-app.js.map +1 -0
- package/dist/testing/test-jazz.d.ts +119 -0
- package/dist/testing/test-jazz.d.ts.map +1 -0
- package/dist/testing/test-jazz.js +162 -0
- package/dist/testing/test-jazz.js.map +1 -0
- package/dist/testing/test-jwt-issuer.d.ts +19 -0
- package/dist/testing/test-jwt-issuer.d.ts.map +1 -0
- package/dist/testing/test-jwt-issuer.js +40 -0
- package/dist/testing/test-jwt-issuer.js.map +1 -0
- package/dist/text-field/index.d.ts +40 -0
- package/dist/text-field/index.d.ts.map +1 -0
- package/dist/text-field/index.js +129 -0
- package/dist/text-field/index.js.map +1 -0
- package/dist/thin/index.d.ts +80 -0
- package/dist/thin/index.d.ts.map +1 -0
- package/dist/thin/index.js +219 -0
- package/dist/thin/index.js.map +1 -0
- package/dist/thin/self-signed-token.d.ts +13 -0
- package/dist/thin/self-signed-token.d.ts.map +1 -0
- package/dist/thin/self-signed-token.js +100 -0
- package/dist/thin/self-signed-token.js.map +1 -0
- package/dist/thin/thin-runtime-source.d.ts +19 -0
- package/dist/thin/thin-runtime-source.d.ts.map +1 -0
- package/dist/thin/thin-runtime-source.js +66 -0
- package/dist/thin/thin-runtime-source.js.map +1 -0
- package/dist/thin/thin-runtime.d.ts +294 -0
- package/dist/thin/thin-runtime.d.ts.map +1 -0
- package/dist/thin/thin-runtime.js +1492 -0
- package/dist/thin/thin-runtime.js.map +1 -0
- package/dist/thin/wire.d.ts +160 -0
- package/dist/thin/wire.d.ts.map +1 -0
- package/dist/thin/wire.js +304 -0
- package/dist/thin/wire.js.map +1 -0
- package/dist/typed-app.d.ts +644 -0
- package/dist/typed-app.d.ts.map +1 -0
- package/dist/typed-app.js +549 -0
- package/dist/typed-app.js.map +1 -0
- package/dist/vue/create-jazz-client.d.ts +3 -0
- package/dist/vue/create-jazz-client.d.ts.map +1 -0
- package/dist/vue/create-jazz-client.js +2 -0
- package/dist/vue/create-jazz-client.js.map +1 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +9 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/provider.d.ts +50 -0
- package/dist/vue/provider.d.ts.map +1 -0
- package/dist/vue/provider.js +97 -0
- package/dist/vue/provider.js.map +1 -0
- package/dist/vue/session-key.d.ts +15 -0
- package/dist/vue/session-key.d.ts.map +1 -0
- package/dist/vue/session-key.js +7 -0
- package/dist/vue/session-key.js.map +1 -0
- package/dist/vue/session.d.ts +40 -0
- package/dist/vue/session.d.ts.map +1 -0
- package/dist/vue/session.js +112 -0
- package/dist/vue/session.js.map +1 -0
- package/dist/vue/use-all.d.ts +61 -0
- package/dist/vue/use-all.d.ts.map +1 -0
- package/dist/vue/use-all.js +104 -0
- package/dist/vue/use-all.js.map +1 -0
- package/dist/vue/use-one.d.ts +24 -0
- package/dist/vue/use-one.d.ts.map +1 -0
- package/dist/vue/use-one.js +17 -0
- package/dist/vue/use-one.js.map +1 -0
- package/dist/vue/use-sync-status.d.ts +9 -0
- package/dist/vue/use-sync-status.d.ts.map +1 -0
- package/dist/vue/use-sync-status.js +16 -0
- package/dist/vue/use-sync-status.js.map +1 -0
- package/dist/web/create-jazz-client.d.ts +12 -0
- package/dist/web/create-jazz-client.d.ts.map +1 -0
- package/dist/web/create-jazz-client.js +35 -0
- package/dist/web/create-jazz-client.js.map +1 -0
- package/dist/web/lazy-local-first.d.ts +5 -0
- package/dist/web/lazy-local-first.d.ts.map +1 -0
- package/dist/web/lazy-local-first.js +8 -0
- package/dist/web/lazy-local-first.js.map +1 -0
- package/dist/web/registered-jazz-client.d.ts +15 -0
- package/dist/web/registered-jazz-client.d.ts.map +1 -0
- package/dist/web/registered-jazz-client.js +35 -0
- package/dist/web/registered-jazz-client.js.map +1 -0
- package/dist/where-operators.d.ts +13 -0
- package/dist/where-operators.d.ts.map +1 -0
- package/dist/where-operators.js +66 -0
- package/dist/where-operators.js.map +1 -0
- package/dist/window-client-storage.d.ts +7 -0
- package/dist/window-client-storage.d.ts.map +1 -0
- package/dist/window-client-storage.js +27 -0
- package/dist/window-client-storage.js.map +1 -0
- package/dist/worker/jazz-broker-worker-core.d.ts +34 -0
- package/dist/worker/jazz-broker-worker-core.d.ts.map +1 -0
- package/dist/worker/jazz-broker-worker-core.js +2241 -0
- package/dist/worker/jazz-broker-worker-core.js.map +1 -0
- package/dist/worker/jazz-broker-worker.d.ts +3 -0
- package/dist/worker/jazz-broker-worker.d.ts.map +1 -0
- package/dist/worker/jazz-broker-worker.js +5 -0
- package/dist/worker/jazz_wasm_bg.wasm +0 -0
- package/dist/worker/mutation-error-delivery.d.ts +8 -0
- package/dist/worker/mutation-error-delivery.d.ts.map +1 -0
- package/dist/worker/mutation-error-delivery.js +10 -0
- package/dist/worker/mutation-error-delivery.js.map +1 -0
- package/dist/worker/runtime-admission.d.ts +34 -0
- package/dist/worker/runtime-admission.d.ts.map +1 -0
- package/dist/worker/runtime-admission.js +60 -0
- package/dist/worker/runtime-admission.js.map +1 -0
- package/dist/worker/vite-dev-broker.d.ts +2 -0
- package/dist/worker/vite-dev-broker.d.ts.map +1 -0
- package/dist/worker/vite-dev-broker.js +8 -0
- package/dist/worker/vite-dev-broker.js.map +1 -0
- package/package.json +299 -37
- package/bin/native/.gitkeep +0 -0
- package/bin/native/jazz-tools-darwin-arm64 +0 -0
- package/bin/native/jazz-tools-darwin-x64 +0 -0
- package/bin/native/jazz-tools-linux-arm64 +0 -0
- package/bin/native/jazz-tools-linux-x64 +0 -0
- package/bin/native/jazz-tools-windows-x64.exe +0 -0
- package/dist/backend/create-jazz-context.test.d.ts +0 -2
- package/dist/backend/create-jazz-context.test.d.ts.map +0 -1
- package/dist/backend/create-jazz-context.test.js +0 -141
- package/dist/backend/create-jazz-context.test.js.map +0 -1
- package/dist/cli.test.d.ts +0 -2
- package/dist/cli.test.d.ts.map +0 -1
- package/dist/cli.test.js +0 -154
- package/dist/cli.test.js.map +0 -1
- package/dist/codegen/codegen.test.d.ts +0 -2
- package/dist/codegen/codegen.test.d.ts.map +0 -1
- package/dist/codegen/codegen.test.js +0 -914
- package/dist/codegen/codegen.test.js.map +0 -1
- package/dist/codegen/index.d.ts +0 -18
- package/dist/codegen/index.d.ts.map +0 -1
- package/dist/codegen/index.js +0 -22
- package/dist/codegen/index.js.map +0 -1
- package/dist/codegen/query-builder-generator.d.ts +0 -26
- package/dist/codegen/query-builder-generator.d.ts.map +0 -1
- package/dist/codegen/query-builder-generator.js +0 -342
- package/dist/codegen/query-builder-generator.js.map +0 -1
- package/dist/codegen/schema-reader.d.ts +0 -12
- package/dist/codegen/schema-reader.d.ts.map +0 -1
- package/dist/codegen/schema-reader.js +0 -180
- package/dist/codegen/schema-reader.js.map +0 -1
- package/dist/codegen/type-generator.d.ts +0 -29
- package/dist/codegen/type-generator.d.ts.map +0 -1
- package/dist/codegen/type-generator.js +0 -296
- package/dist/codegen/type-generator.js.map +0 -1
- package/dist/dev-tools/dev-tools.d.ts +0 -15
- package/dist/dev-tools/dev-tools.d.ts.map +0 -1
- package/dist/dev-tools/dev-tools.js +0 -297
- package/dist/dev-tools/dev-tools.js.map +0 -1
- package/dist/dev-tools/extension-panel.d.ts +0 -19
- package/dist/dev-tools/extension-panel.d.ts.map +0 -1
- package/dist/dev-tools/extension-panel.js +0 -419
- package/dist/dev-tools/extension-panel.js.map +0 -1
- package/dist/dev-tools/index.d.ts +0 -3
- package/dist/dev-tools/index.d.ts.map +0 -1
- package/dist/dev-tools/index.js +0 -3
- package/dist/dev-tools/index.js.map +0 -1
- package/dist/dev-tools/protocol.d.ts +0 -49
- package/dist/dev-tools/protocol.d.ts.map +0 -1
- package/dist/dev-tools/protocol.js +0 -40
- package/dist/dev-tools/protocol.js.map +0 -1
- package/dist/dsl.test.d.ts +0 -2
- package/dist/dsl.test.d.ts.map +0 -1
- package/dist/dsl.test.js +0 -51
- package/dist/dsl.test.js.map +0 -1
- package/dist/permissions/index.d.ts +0 -146
- package/dist/permissions/index.d.ts.map +0 -1
- package/dist/permissions/index.js +0 -1211
- package/dist/permissions/index.js.map +0 -1
- package/dist/permissions/index.test.d.ts +0 -2
- package/dist/permissions/index.test.d.ts.map +0 -1
- package/dist/permissions/index.test.js +0 -830
- package/dist/permissions/index.test.js.map +0 -1
- package/dist/permissions/type-inference.test.d.ts +0 -2
- package/dist/permissions/type-inference.test.d.ts.map +0 -1
- package/dist/permissions/type-inference.test.js +0 -149
- package/dist/permissions/type-inference.test.js.map +0 -1
- package/dist/react/create-jazz-client.integration.test.d.ts +0 -2
- package/dist/react/create-jazz-client.integration.test.d.ts.map +0 -1
- package/dist/react/create-jazz-client.integration.test.js +0 -82
- package/dist/react/create-jazz-client.integration.test.js.map +0 -1
- package/dist/react/create-jazz-client.test.d.ts +0 -2
- package/dist/react/create-jazz-client.test.d.ts.map +0 -1
- package/dist/react/create-jazz-client.test.js +0 -135
- package/dist/react/create-jazz-client.test.js.map +0 -1
- package/dist/react/synthetic-user-switcher.d.ts +0 -9
- package/dist/react/synthetic-user-switcher.d.ts.map +0 -1
- package/dist/react/synthetic-user-switcher.js +0 -65
- package/dist/react/synthetic-user-switcher.js.map +0 -1
- package/dist/react/synthetic-users.d.ts +0 -2
- package/dist/react/synthetic-users.d.ts.map +0 -1
- package/dist/react/synthetic-users.js +0 -2
- package/dist/react/synthetic-users.js.map +0 -1
- package/dist/react/synthetic-users.test.d.ts +0 -2
- package/dist/react/synthetic-users.test.d.ts.map +0 -1
- package/dist/react/synthetic-users.test.js +0 -43
- package/dist/react/synthetic-users.test.js.map +0 -1
- package/dist/react/use-link-external-identity.d.ts +0 -25
- package/dist/react/use-link-external-identity.d.ts.map +0 -1
- package/dist/react/use-link-external-identity.js +0 -45
- package/dist/react/use-link-external-identity.js.map +0 -1
- package/dist/react-native/create-jazz-client.test.d.ts +0 -2
- package/dist/react-native/create-jazz-client.test.d.ts.map +0 -1
- package/dist/react-native/create-jazz-client.test.js +0 -162
- package/dist/react-native/create-jazz-client.test.js.map +0 -1
- package/dist/react-native/create-jazz-rn-runtime.d.ts +0 -13
- package/dist/react-native/create-jazz-rn-runtime.d.ts.map +0 -1
- package/dist/react-native/create-jazz-rn-runtime.js +0 -7
- package/dist/react-native/create-jazz-rn-runtime.js.map +0 -1
- package/dist/react-native/db.d.ts +0 -16
- package/dist/react-native/db.d.ts.map +0 -1
- package/dist/react-native/db.js +0 -50
- package/dist/react-native/db.js.map +0 -1
- package/dist/react-native/db.test.d.ts +0 -2
- package/dist/react-native/db.test.d.ts.map +0 -1
- package/dist/react-native/db.test.js +0 -148
- package/dist/react-native/db.test.js.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.d.ts +0 -56
- package/dist/react-native/jazz-rn-runtime-adapter.d.ts.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.js +0 -192
- package/dist/react-native/jazz-rn-runtime-adapter.js.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.test.d.ts +0 -2
- package/dist/react-native/jazz-rn-runtime-adapter.test.d.ts.map +0 -1
- package/dist/react-native/jazz-rn-runtime-adapter.test.js +0 -165
- package/dist/react-native/jazz-rn-runtime-adapter.test.js.map +0 -1
- package/dist/runtime/client-session.test.d.ts +0 -2
- package/dist/runtime/client-session.test.d.ts.map +0 -1
- package/dist/runtime/client-session.test.js +0 -84
- package/dist/runtime/client-session.test.js.map +0 -1
- package/dist/runtime/client.for-request.test.d.ts +0 -2
- package/dist/runtime/client.for-request.test.d.ts.map +0 -1
- package/dist/runtime/client.for-request.test.js +0 -191
- package/dist/runtime/client.for-request.test.js.map +0 -1
- package/dist/runtime/cloud-server.integration.test.d.ts +0 -2
- package/dist/runtime/cloud-server.integration.test.d.ts.map +0 -1
- package/dist/runtime/cloud-server.integration.test.js +0 -1210
- package/dist/runtime/cloud-server.integration.test.js.map +0 -1
- package/dist/runtime/dynamic-query.d.ts +0 -10
- package/dist/runtime/dynamic-query.d.ts.map +0 -1
- package/dist/runtime/dynamic-query.js +0 -11
- package/dist/runtime/dynamic-query.js.map +0 -1
- package/dist/runtime/leader-lock.d.ts +0 -15
- package/dist/runtime/leader-lock.d.ts.map +0 -1
- package/dist/runtime/leader-lock.js +0 -49
- package/dist/runtime/leader-lock.js.map +0 -1
- package/dist/runtime/local-auth.d.ts +0 -32
- package/dist/runtime/local-auth.d.ts.map +0 -1
- package/dist/runtime/local-auth.js +0 -93
- package/dist/runtime/local-auth.js.map +0 -1
- package/dist/runtime/local-auth.test.d.ts +0 -2
- package/dist/runtime/local-auth.test.d.ts.map +0 -1
- package/dist/runtime/local-auth.test.js +0 -50
- package/dist/runtime/local-auth.test.js.map +0 -1
- package/dist/runtime/query-adapter.test.d.ts +0 -5
- package/dist/runtime/query-adapter.test.d.ts.map +0 -1
- package/dist/runtime/query-adapter.test.js +0 -1249
- package/dist/runtime/query-adapter.test.js.map +0 -1
- package/dist/runtime/row-transformer.test.d.ts +0 -5
- package/dist/runtime/row-transformer.test.d.ts.map +0 -1
- package/dist/runtime/row-transformer.test.js +0 -385
- package/dist/runtime/row-transformer.test.js.map +0 -1
- package/dist/runtime/schema-fetch.d.ts +0 -17
- package/dist/runtime/schema-fetch.d.ts.map +0 -1
- package/dist/runtime/schema-fetch.js +0 -33
- package/dist/runtime/schema-fetch.js.map +0 -1
- package/dist/runtime/schema-fetch.test.d.ts +0 -2
- package/dist/runtime/schema-fetch.test.d.ts.map +0 -1
- package/dist/runtime/schema-fetch.test.js +0 -87
- package/dist/runtime/schema-fetch.test.js.map +0 -1
- package/dist/runtime/subscription-manager.test.d.ts +0 -5
- package/dist/runtime/subscription-manager.test.d.ts.map +0 -1
- package/dist/runtime/subscription-manager.test.js +0 -120
- package/dist/runtime/subscription-manager.test.js.map +0 -1
- package/dist/runtime/sync-transport.d.ts +0 -163
- package/dist/runtime/sync-transport.d.ts.map +0 -1
- package/dist/runtime/sync-transport.js +0 -477
- package/dist/runtime/sync-transport.js.map +0 -1
- package/dist/runtime/sync-transport.test.d.ts +0 -2
- package/dist/runtime/sync-transport.test.d.ts.map +0 -1
- package/dist/runtime/sync-transport.test.js +0 -310
- package/dist/runtime/sync-transport.test.js.map +0 -1
- package/dist/runtime/tab-leader-election.d.ts +0 -97
- package/dist/runtime/tab-leader-election.d.ts.map +0 -1
- package/dist/runtime/tab-leader-election.js +0 -339
- package/dist/runtime/tab-leader-election.js.map +0 -1
- package/dist/runtime/tab-leader-election.test.d.ts +0 -2
- package/dist/runtime/tab-leader-election.test.d.ts.map +0 -1
- package/dist/runtime/tab-leader-election.test.js +0 -278
- package/dist/runtime/tab-leader-election.test.js.map +0 -1
- package/dist/runtime/testing/wasm-runtime-test-utils.d.ts +0 -13
- package/dist/runtime/testing/wasm-runtime-test-utils.d.ts.map +0 -1
- package/dist/runtime/testing/wasm-runtime-test-utils.js +0 -76
- package/dist/runtime/testing/wasm-runtime-test-utils.js.map +0 -1
- package/dist/runtime/utils.d.ts +0 -2
- package/dist/runtime/utils.d.ts.map +0 -1
- package/dist/runtime/utils.js +0 -16
- package/dist/runtime/utils.js.map +0 -1
- package/dist/runtime/value-converter.test.d.ts +0 -5
- package/dist/runtime/value-converter.test.d.ts.map +0 -1
- package/dist/runtime/value-converter.test.js +0 -222
- package/dist/runtime/value-converter.test.js.map +0 -1
- package/dist/runtime/worker-bridge.d.ts +0 -82
- package/dist/runtime/worker-bridge.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.js +0 -308
- package/dist/runtime/worker-bridge.js.map +0 -1
- package/dist/runtime/worker-bridge.race-harness.test.d.ts +0 -2
- package/dist/runtime/worker-bridge.race-harness.test.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.race-harness.test.js +0 -284
- package/dist/runtime/worker-bridge.race-harness.test.js.map +0 -1
- package/dist/runtime/worker-bridge.test.d.ts +0 -2
- package/dist/runtime/worker-bridge.test.d.ts.map +0 -1
- package/dist/runtime/worker-bridge.test.js +0 -233
- package/dist/runtime/worker-bridge.test.js.map +0 -1
- package/dist/sql-gen.d.ts +0 -4
- package/dist/sql-gen.d.ts.map +0 -1
- package/dist/sql-gen.js +0 -163
- package/dist/sql-gen.js.map +0 -1
- package/dist/sql-gen.test.d.ts +0 -2
- package/dist/sql-gen.test.d.ts.map +0 -1
- package/dist/sql-gen.test.js +0 -412
- package/dist/sql-gen.test.js.map +0 -1
- package/dist/subscriptions-orchestrator.integration.test.d.ts +0 -2
- package/dist/subscriptions-orchestrator.integration.test.d.ts.map +0 -1
- package/dist/subscriptions-orchestrator.integration.test.js +0 -192
- package/dist/subscriptions-orchestrator.integration.test.js.map +0 -1
- package/dist/subscriptions-orchestrator.test.d.ts +0 -2
- package/dist/subscriptions-orchestrator.test.d.ts.map +0 -1
- package/dist/subscriptions-orchestrator.test.js +0 -367
- package/dist/subscriptions-orchestrator.test.js.map +0 -1
- package/dist/svelte/JazzSvelteProvider.svelte +0 -49
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts +0 -13
- package/dist/svelte/JazzSvelteProvider.svelte.d.ts.map +0 -1
- package/dist/svelte/SyntheticUserSwitcher.svelte +0 -121
- package/dist/svelte/SyntheticUserSwitcher.svelte.d.ts +0 -11
- package/dist/svelte/SyntheticUserSwitcher.svelte.d.ts.map +0 -1
- package/dist/svelte/context.test.d.ts +0 -2
- package/dist/svelte/context.test.d.ts.map +0 -1
- package/dist/svelte/context.test.js +0 -55
- package/dist/svelte/create-jazz-client.test.d.ts +0 -2
- package/dist/svelte/create-jazz-client.test.d.ts.map +0 -1
- package/dist/svelte/create-jazz-client.test.js +0 -50
- package/dist/svelte/use-all.svelte.d.ts +0 -32
- package/dist/svelte/use-all.svelte.d.ts.map +0 -1
- package/dist/svelte/use-all.svelte.js +0 -61
- package/dist/svelte/use-all.test.d.ts +0 -2
- package/dist/svelte/use-all.test.d.ts.map +0 -1
- package/dist/svelte/use-all.test.js +0 -158
- package/dist/svelte/use-link-external-identity.d.ts +0 -25
- package/dist/svelte/use-link-external-identity.d.ts.map +0 -1
- package/dist/svelte/use-link-external-identity.js +0 -33
- package/dist/svelte/use-link-external-identity.test.d.ts +0 -2
- package/dist/svelte/use-link-external-identity.test.d.ts.map +0 -1
- package/dist/svelte/use-link-external-identity.test.js +0 -97
- package/dist/synthetic-user-switcher.d.ts +0 -16
- package/dist/synthetic-user-switcher.d.ts.map +0 -1
- package/dist/synthetic-user-switcher.js +0 -134
- package/dist/synthetic-user-switcher.js.map +0 -1
- package/dist/synthetic-users.d.ts +0 -32
- package/dist/synthetic-users.d.ts.map +0 -1
- package/dist/synthetic-users.js +0 -124
- package/dist/synthetic-users.js.map +0 -1
- package/dist/testing/fixtures/basic/app.d.ts +0 -55
- package/dist/testing/fixtures/basic/app.d.ts.map +0 -1
- package/dist/testing/fixtures/basic/app.js +0 -174
- package/dist/testing/fixtures/basic/app.js.map +0 -1
- package/dist/testing/fixtures/basic/current.d.ts +0 -2
- package/dist/testing/fixtures/basic/current.d.ts.map +0 -1
- package/dist/testing/fixtures/basic/current.js +0 -6
- package/dist/testing/fixtures/basic/current.js.map +0 -1
- package/dist/testing/index.test.d.ts +0 -2
- package/dist/testing/index.test.d.ts.map +0 -1
- package/dist/testing/index.test.js +0 -234
- package/dist/testing/index.test.js.map +0 -1
- package/dist/testing/local-jazz-server.d.ts +0 -34
- package/dist/testing/local-jazz-server.d.ts.map +0 -1
- package/dist/testing/local-jazz-server.js +0 -313
- package/dist/testing/local-jazz-server.js.map +0 -1
- package/dist/testing/relation-ir-test-helpers.d.ts +0 -3
- package/dist/testing/relation-ir-test-helpers.d.ts.map +0 -1
- package/dist/testing/relation-ir-test-helpers.js +0 -258
- package/dist/testing/relation-ir-test-helpers.js.map +0 -1
- package/dist/worker/jazz-worker.d.ts +0 -9
- package/dist/worker/jazz-worker.d.ts.map +0 -1
- package/dist/worker/jazz-worker.js +0 -555
- package/dist/worker/jazz-worker.js.map +0 -1
- package/dist/worker/jazz-worker.ts +0 -630
- package/dist/worker/worker-protocol.d.ts +0 -136
- package/dist/worker/worker-protocol.d.ts.map +0 -1
- package/dist/worker/worker-protocol.js +0 -7
- package/dist/worker/worker-protocol.js.map +0 -1
|
@@ -0,0 +1,1167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `jazz.permissions.json` → the permissions DSL (`definePermissions`), printed
|
|
3
|
+
* idiomatically:
|
|
4
|
+
*
|
|
5
|
+
* - `update {old, new}` → `updateIf` / `updateTo`;
|
|
6
|
+
* - `allowedTo.op(rel)` → `allowedTo.op(row.rel)`;
|
|
7
|
+
* - `exists t(id = this.col, …)` along a forward relation → `row.rel.where({…})`;
|
|
8
|
+
* - a self-`exists(id = this.id, a = this.a, …)` in `updateTo` → `{ a: old.a, … }`;
|
|
9
|
+
* - `in` lists → arrays; session-claim checks → `eq` / `isIn`;
|
|
10
|
+
* - any sub-expression that repeats → one `const` helper. What it takes from
|
|
11
|
+
* the checked row becomes a parameter (a column's value, or the row itself
|
|
12
|
+
* for its relations), and so does a literal that differs between the
|
|
13
|
+
* places it repeats (`isMembershipWithRole(organizationId, role)`).
|
|
14
|
+
*
|
|
15
|
+
* What the DSL can't spell is reported in `unsupported` (with its JSON path)
|
|
16
|
+
* rather than printed, so callers can refuse.
|
|
17
|
+
*
|
|
18
|
+
* How helpers are found: every sub-expression is printed as a fragment whose
|
|
19
|
+
* row values and literals are numbered placeholders. Pass 1 records each
|
|
20
|
+
* candidate occurrence (its shape, with every placeholder abstract, and the
|
|
21
|
+
* occurrences inside it); the selection takes the largest shapes that repeat
|
|
22
|
+
* first. Pass 2 walks the policies in the same order, so occurrence numbers
|
|
23
|
+
* match, and replaces each occurrence of a selected shape by a call.
|
|
24
|
+
*/
|
|
25
|
+
import { columnKind, } from "./app-json.js";
|
|
26
|
+
import { parseExpr, } from "./expr.js";
|
|
27
|
+
import { camel, fresh, isBindable, jsLiteral, member, pascal, propKey, singular } from "./names.js";
|
|
28
|
+
const FLIP = {
|
|
29
|
+
"=": "=",
|
|
30
|
+
"!=": "!=",
|
|
31
|
+
"<": ">",
|
|
32
|
+
"<=": ">=",
|
|
33
|
+
">": "<",
|
|
34
|
+
">=": "<=",
|
|
35
|
+
};
|
|
36
|
+
const OP_FN = {
|
|
37
|
+
"!=": "ne",
|
|
38
|
+
"<": "lt",
|
|
39
|
+
"<=": "lte",
|
|
40
|
+
">": "gt",
|
|
41
|
+
">=": "gte",
|
|
42
|
+
};
|
|
43
|
+
const PLACEHOLDER = (i) => `${i}`;
|
|
44
|
+
const PLACEHOLDER_RE = /(\d+)/g;
|
|
45
|
+
const TOOL_ORDER = [
|
|
46
|
+
"exists",
|
|
47
|
+
"allowedTo",
|
|
48
|
+
"session",
|
|
49
|
+
"anyOf",
|
|
50
|
+
"allOf",
|
|
51
|
+
"not",
|
|
52
|
+
"eq",
|
|
53
|
+
"ne",
|
|
54
|
+
"gt",
|
|
55
|
+
"gte",
|
|
56
|
+
"lt",
|
|
57
|
+
"lte",
|
|
58
|
+
"contains",
|
|
59
|
+
"isIn",
|
|
60
|
+
"typed",
|
|
61
|
+
"from",
|
|
62
|
+
"union",
|
|
63
|
+
"recursive",
|
|
64
|
+
"outer",
|
|
65
|
+
"frontier",
|
|
66
|
+
"rowId",
|
|
67
|
+
"param",
|
|
68
|
+
"jsonValue",
|
|
69
|
+
];
|
|
70
|
+
class Unprintable extends Error {
|
|
71
|
+
text;
|
|
72
|
+
reason;
|
|
73
|
+
constructor(text, reason) {
|
|
74
|
+
super(reason);
|
|
75
|
+
this.text = text;
|
|
76
|
+
this.reason = reason;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export function printPermissions(app, permissions, options = {}) {
|
|
80
|
+
const schemaName = options.schemaName ?? "schema";
|
|
81
|
+
const skip = new Set(options.skipTables ?? []);
|
|
82
|
+
const constants = options.constants ?? new Map();
|
|
83
|
+
const dsl = options.dsl ?? "s";
|
|
84
|
+
const first = new Printer(app, permissions, schemaName, constants, undefined, dsl);
|
|
85
|
+
first.print(skip);
|
|
86
|
+
const taken = new Set([
|
|
87
|
+
schemaName,
|
|
88
|
+
"s",
|
|
89
|
+
"permissions",
|
|
90
|
+
"definePermissions",
|
|
91
|
+
"old",
|
|
92
|
+
...TOOL_ORDER,
|
|
93
|
+
...constants.values(),
|
|
94
|
+
...Object.keys(app.tables).map((t) => rowName(t)),
|
|
95
|
+
]);
|
|
96
|
+
const selected = selectHelpers(first.occurrences, taken);
|
|
97
|
+
// A helper's parameters follow what its uses pass once inner helpers are
|
|
98
|
+
// calls; inner helpers' parameters change what outer ones see, so repeat
|
|
99
|
+
// until they settle.
|
|
100
|
+
let printer;
|
|
101
|
+
let body = "";
|
|
102
|
+
for (let round = 0; round < 8; round++) {
|
|
103
|
+
printer = new Printer(app, permissions, schemaName, constants, selected, dsl);
|
|
104
|
+
body = printer.print(skip);
|
|
105
|
+
let changed = false;
|
|
106
|
+
for (const [key, helper] of selected.byKey) {
|
|
107
|
+
const params = paramsOf(printer.seen.get(key) ?? []);
|
|
108
|
+
if (JSON.stringify(params) !== JSON.stringify(helper.params)) {
|
|
109
|
+
helper.params = params;
|
|
110
|
+
changed = true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (!changed)
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
const lines = [];
|
|
117
|
+
const tools = ["definePermissions", ...TOOL_ORDER.filter((t) => printer.tools.has(t))];
|
|
118
|
+
lines.push(`const { ${tools.join(", ")} } = ${schemaName};`, "");
|
|
119
|
+
for (const helper of printer.helperOrder)
|
|
120
|
+
lines.push(printHelper(helper, printer.bodies.get(helper)), "");
|
|
121
|
+
for (const note of options.notes ?? [])
|
|
122
|
+
lines.push(`// ${note}`);
|
|
123
|
+
const spreads = (options.spreads ?? []).map((s) => `...${s},`);
|
|
124
|
+
lines.push(`export const permissions = definePermissions({`, ...spreads, body, `});`);
|
|
125
|
+
return {
|
|
126
|
+
code: lines.join("\n") + "\n",
|
|
127
|
+
unsupported: printer.unsupported,
|
|
128
|
+
constantsUsed: [...printer.constantsUsed],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function rowName(table) {
|
|
132
|
+
const name = singular(table);
|
|
133
|
+
return isBindable(name) && !TOOL_ORDER.includes(name) && name !== "old" ? name : "row";
|
|
134
|
+
}
|
|
135
|
+
/** Parameters from a helper's uses: row values always, literals where they differ. */
|
|
136
|
+
function paramsOf(all) {
|
|
137
|
+
const first = all[0] ?? [];
|
|
138
|
+
const uses = all.filter((u) => u.length === first.length);
|
|
139
|
+
return first.map((arg, i) => {
|
|
140
|
+
if (arg.literal && uses.every((u) => u[i]?.text === arg.text))
|
|
141
|
+
return { fixed: arg.text };
|
|
142
|
+
return { name: arg.name, type: arg.type };
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function selectHelpers(occurrences, taken) {
|
|
146
|
+
const byKey = new Map();
|
|
147
|
+
occurrences.forEach((o, i) => byKey.set(o.key, [...(byKey.get(o.key) ?? []), i]));
|
|
148
|
+
const parent = new Map();
|
|
149
|
+
occurrences.forEach((o, i) => o.children.forEach((c) => c !== i && !parent.has(c) && parent.set(c, i)));
|
|
150
|
+
const ancestors = (i) => {
|
|
151
|
+
const out = [];
|
|
152
|
+
for (let p = parent.get(i); p !== undefined; p = parent.get(p))
|
|
153
|
+
out.push(p);
|
|
154
|
+
return out;
|
|
155
|
+
};
|
|
156
|
+
// Largest shapes first: a repeated `anyOf(isCrew(…), isChief(…))` before its parts.
|
|
157
|
+
const keys = [...byKey.keys()].sort((a, b) => b.length - a.length || (a < b ? -1 : 1));
|
|
158
|
+
const chosen = new Set();
|
|
159
|
+
for (const key of keys) {
|
|
160
|
+
// Uses outside chosen helpers, plus one per chosen helper whose body holds it.
|
|
161
|
+
let uses = 0;
|
|
162
|
+
const bodies = new Set();
|
|
163
|
+
for (const i of byKey.get(key)) {
|
|
164
|
+
const holder = ancestors(i).find((a) => chosen.has(occurrences[a].key));
|
|
165
|
+
if (holder === undefined)
|
|
166
|
+
uses++;
|
|
167
|
+
else
|
|
168
|
+
bodies.add(occurrences[holder].key);
|
|
169
|
+
}
|
|
170
|
+
if (uses + bodies.size >= 2)
|
|
171
|
+
chosen.add(key);
|
|
172
|
+
}
|
|
173
|
+
// Parameters: row values always, literals where they differ between uses.
|
|
174
|
+
const helpers = new Map();
|
|
175
|
+
const drafts = [];
|
|
176
|
+
for (const key of keys.filter((k) => chosen.has(k)).reverse()) {
|
|
177
|
+
const occ = byKey.get(key).map((i) => occurrences[i]);
|
|
178
|
+
const firstOcc = occ[0];
|
|
179
|
+
const params = paramsOf(occ.map((o) => o.args));
|
|
180
|
+
const varying = params.flatMap((p, i) => "name" in p && firstOcc.args[i].literal ? [p.name] : []);
|
|
181
|
+
const fixed = params.flatMap((p, i) => "fixed" in p ? [`${pascal(firstOcc.args[i].name)}${pascal(p.fixed.replace(/"/g, ""))}`] : []);
|
|
182
|
+
// A combination too long to name by its parts is named for the row it checks.
|
|
183
|
+
const row = /^\w+\.Row<typeof \w+, "(\w+)">$/.exec(firstOcc.args.find((a) => /^\w+\.Row</.test(a.type))?.type ?? "")?.[1];
|
|
184
|
+
const hint = (firstOcc.hint === "anyRule" || firstOcc.hint === "allRules") && row
|
|
185
|
+
? `${camel(singular(row))}Rule`
|
|
186
|
+
: firstOcc.hint;
|
|
187
|
+
const base = hint + varying.map((n) => `With${pascal(n)}`).join("");
|
|
188
|
+
const helper = { name: "", params };
|
|
189
|
+
helpers.set(key, helper);
|
|
190
|
+
drafts.push({ base, qualifiers: fixed, helper });
|
|
191
|
+
}
|
|
192
|
+
// Names: the base; helpers sharing one are told apart by their fixed literals.
|
|
193
|
+
let generic = 0;
|
|
194
|
+
const counts = new Map();
|
|
195
|
+
for (const d of drafts)
|
|
196
|
+
counts.set(d.base, (counts.get(d.base) ?? 0) + 1);
|
|
197
|
+
for (const d of drafts) {
|
|
198
|
+
let name = d.base;
|
|
199
|
+
if ((counts.get(d.base) ?? 0) > 1 && d.qualifiers.length)
|
|
200
|
+
name += `With${d.qualifiers.join("And")}`;
|
|
201
|
+
if (name.length > 40)
|
|
202
|
+
name = d.base;
|
|
203
|
+
// A name too long to read (or a guess like `…AndMore`) is worse than a
|
|
204
|
+
// short one for the author to rename.
|
|
205
|
+
const words = name.replace(/^(is|can|has)(?=[A-Z])/, "").split(/(?=[A-Z])/).length;
|
|
206
|
+
if (words > 4 || /More|Rule$|Rules$/.test(name))
|
|
207
|
+
name = `rule${++generic}`;
|
|
208
|
+
d.helper.name = fresh(name, taken);
|
|
209
|
+
}
|
|
210
|
+
return { byKey: helpers, keyOf: occurrences.map((o) => o.key) };
|
|
211
|
+
}
|
|
212
|
+
function printHelper(helper, source) {
|
|
213
|
+
const taken = new Set();
|
|
214
|
+
const names = helper.params.map((p) => "name" in p ? fresh(isBindable(p.name) ? p.name : "value", taken) : "");
|
|
215
|
+
let body = source;
|
|
216
|
+
// `{ chatId: chatId }` → `{ chatId }`
|
|
217
|
+
body = body.replace(/([A-Za-z_$][A-Za-z0-9_$]*): (\d+)/g, (all, key, i) => names[Number(i)] === key ? key : all);
|
|
218
|
+
body = body.replace(PLACEHOLDER_RE, (_, i) => {
|
|
219
|
+
const p = helper.params[Number(i)];
|
|
220
|
+
return "fixed" in p ? p.fixed : names[Number(i)];
|
|
221
|
+
});
|
|
222
|
+
const params = helper.params.flatMap((p, i) => ("name" in p ? [`${names[i]}: ${p.type}`] : []));
|
|
223
|
+
if (params.length === 0)
|
|
224
|
+
return `const ${helper.name} = ${body};`;
|
|
225
|
+
return `const ${helper.name} = (${params.join(", ")}) => ${body};`;
|
|
226
|
+
}
|
|
227
|
+
// ---------------------------------------------------------------------------
|
|
228
|
+
// Fragments
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
const lit = (text, hint) => ({
|
|
231
|
+
text,
|
|
232
|
+
args: [],
|
|
233
|
+
occ: [],
|
|
234
|
+
...(hint ? { hint } : {}),
|
|
235
|
+
});
|
|
236
|
+
/**
|
|
237
|
+
* Join fragments with `render`, renumbering their placeholders. A row value
|
|
238
|
+
* used twice is one placeholder; literals stay apart (they may differ).
|
|
239
|
+
*/
|
|
240
|
+
function join(parts, render) {
|
|
241
|
+
const args = [];
|
|
242
|
+
const texts = parts.map((part) => part.text.replace(PLACEHOLDER_RE, (_, i) => {
|
|
243
|
+
const arg = part.args[Number(i)];
|
|
244
|
+
let at = arg.literal ? -1 : args.findIndex((a) => !a.literal && a.text === arg.text);
|
|
245
|
+
if (at < 0) {
|
|
246
|
+
args.push(arg);
|
|
247
|
+
at = args.length - 1;
|
|
248
|
+
}
|
|
249
|
+
return PLACEHOLDER(at);
|
|
250
|
+
}));
|
|
251
|
+
const joined = {
|
|
252
|
+
text: render(texts),
|
|
253
|
+
args,
|
|
254
|
+
old: parts.some((p) => p.old),
|
|
255
|
+
occ: parts.flatMap((p) => p.occ),
|
|
256
|
+
};
|
|
257
|
+
if (parts.some((p) => p.inline))
|
|
258
|
+
joined.inline = join(parts.map((p) => p.inline ?? p), render);
|
|
259
|
+
return joined;
|
|
260
|
+
}
|
|
261
|
+
/** Number placeholders by first appearance; fold `row.col` into a `row` argument. */
|
|
262
|
+
function canonical(frag) {
|
|
263
|
+
const rows = new Map(frag.args.map((a, i) => [a.text, i]));
|
|
264
|
+
let text = frag.text.replace(PLACEHOLDER_RE, (all, i) => {
|
|
265
|
+
const arg = frag.args[Number(i)];
|
|
266
|
+
if (arg.literal)
|
|
267
|
+
return all;
|
|
268
|
+
const dot = arg.text.lastIndexOf(".");
|
|
269
|
+
const row = dot > 0 ? rows.get(arg.text.slice(0, dot)) : undefined;
|
|
270
|
+
return row !== undefined && row !== Number(i)
|
|
271
|
+
? `${PLACEHOLDER(row)}${arg.text.slice(dot)}`
|
|
272
|
+
: all;
|
|
273
|
+
});
|
|
274
|
+
const order = [];
|
|
275
|
+
text = text.replace(PLACEHOLDER_RE, (_, i) => {
|
|
276
|
+
let at = order.indexOf(Number(i));
|
|
277
|
+
if (at < 0) {
|
|
278
|
+
order.push(Number(i));
|
|
279
|
+
at = order.length - 1;
|
|
280
|
+
}
|
|
281
|
+
return PLACEHOLDER(at);
|
|
282
|
+
});
|
|
283
|
+
return { ...frag, text, args: order.map((i) => frag.args[i]) };
|
|
284
|
+
}
|
|
285
|
+
function fill(frag) {
|
|
286
|
+
return frag.text.replace(PLACEHOLDER_RE, (_, i) => frag.args[Number(i)].text);
|
|
287
|
+
}
|
|
288
|
+
// ---------------------------------------------------------------------------
|
|
289
|
+
// The printer
|
|
290
|
+
// ---------------------------------------------------------------------------
|
|
291
|
+
class Printer {
|
|
292
|
+
app;
|
|
293
|
+
permissions;
|
|
294
|
+
schemaName;
|
|
295
|
+
constants;
|
|
296
|
+
selection;
|
|
297
|
+
dsl;
|
|
298
|
+
tools = new Set();
|
|
299
|
+
unsupported = [];
|
|
300
|
+
occurrences = [];
|
|
301
|
+
constantsUsed = new Set();
|
|
302
|
+
/** Helpers in the order their bodies were found: inner ones first. */
|
|
303
|
+
helperOrder = [];
|
|
304
|
+
/** Per selected shape, the arguments of each use (inner helpers as calls). */
|
|
305
|
+
seen = new Map();
|
|
306
|
+
/** Each helper's body: its first use, inner helpers as calls. */
|
|
307
|
+
bodies = new Map();
|
|
308
|
+
constructor(app, permissions, schemaName, constants, selection, dsl = "s") {
|
|
309
|
+
this.app = app;
|
|
310
|
+
this.permissions = permissions;
|
|
311
|
+
this.schemaName = schemaName;
|
|
312
|
+
this.constants = constants;
|
|
313
|
+
this.selection = selection;
|
|
314
|
+
this.dsl = dsl;
|
|
315
|
+
}
|
|
316
|
+
print(skip) {
|
|
317
|
+
const out = [];
|
|
318
|
+
for (const table of Object.keys(this.app.tables).sort()) {
|
|
319
|
+
if (skip.has(table))
|
|
320
|
+
continue;
|
|
321
|
+
out.push(this.table(table, this.permissions.tables[table] ?? {}));
|
|
322
|
+
}
|
|
323
|
+
return out.join("\n");
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* A candidate helper: recorded in pass 1, replaced by a call in pass 2 when
|
|
327
|
+
* its shape was selected (and the first one kept as the helper's body).
|
|
328
|
+
*/
|
|
329
|
+
shaped(frag, hint, table, literalsInHint = false) {
|
|
330
|
+
if (frag.old)
|
|
331
|
+
return { ...frag, hint };
|
|
332
|
+
const c = canonical(frag);
|
|
333
|
+
const id = this.occurrences.length;
|
|
334
|
+
const key = (table ? `${table}|` : "") + c.text;
|
|
335
|
+
this.occurrences.push({ key, text: c.text, args: c.args, hint, children: frag.occ });
|
|
336
|
+
// Pass 2 matches pass 1 by occurrence number: inner helpers are calls now.
|
|
337
|
+
const shape = this.selection?.keyOf[id] ?? key;
|
|
338
|
+
const helper = this.selection?.byKey.get(shape);
|
|
339
|
+
const label = literalsInHint
|
|
340
|
+
? hint
|
|
341
|
+
: hint +
|
|
342
|
+
c.args
|
|
343
|
+
.filter((a) => a.literal)
|
|
344
|
+
.map((a) => pascal(a.text.replace(/"/g, "")))
|
|
345
|
+
.join("");
|
|
346
|
+
this.seen.set(shape, [...(this.seen.get(shape) ?? []), c.args]);
|
|
347
|
+
// A use that doesn't line up with the helper (its arguments shifted by an inner one) stays inline.
|
|
348
|
+
if (!helper || helper.params.length !== c.args.length) {
|
|
349
|
+
return { ...c, occ: [...frag.occ, id], hint, label, inline: frag.inline };
|
|
350
|
+
}
|
|
351
|
+
if (!this.bodies.has(helper)) {
|
|
352
|
+
this.bodies.set(helper, c.text);
|
|
353
|
+
this.helperOrder.push(helper);
|
|
354
|
+
}
|
|
355
|
+
const args = [];
|
|
356
|
+
const callArgs = [];
|
|
357
|
+
helper.params.forEach((p, i) => {
|
|
358
|
+
if ("fixed" in p)
|
|
359
|
+
return;
|
|
360
|
+
args.push(c.args[i]);
|
|
361
|
+
callArgs.push(PLACEHOLDER(args.length - 1));
|
|
362
|
+
});
|
|
363
|
+
const takes = helper.params.some((p) => "name" in p);
|
|
364
|
+
const text = takes ? `${helper.name}(${callArgs.join(", ")})` : helper.name;
|
|
365
|
+
const passed = args
|
|
366
|
+
.filter((a) => a.literal)
|
|
367
|
+
.map((a) => pascal(a.text.replace(/"/g, "")))
|
|
368
|
+
.join("");
|
|
369
|
+
return {
|
|
370
|
+
text,
|
|
371
|
+
args,
|
|
372
|
+
call: true,
|
|
373
|
+
occ: [id],
|
|
374
|
+
hint: helper.name,
|
|
375
|
+
label: helper.name.replace(/With[A-Z]\w*$/, "") + passed,
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
table(table, rules) {
|
|
379
|
+
const entries = [];
|
|
380
|
+
const path = `tables.${table}`;
|
|
381
|
+
const rule = (op, policy, allowOld = false) => {
|
|
382
|
+
if (policy === undefined)
|
|
383
|
+
return;
|
|
384
|
+
entries.push(`${op}: ${this.rule(table, policy, `${path}.${op}`, allowOld)},`);
|
|
385
|
+
};
|
|
386
|
+
rule("read", rules.read);
|
|
387
|
+
rule("insert", rules.insert);
|
|
388
|
+
const update = rules.update;
|
|
389
|
+
if (update !== undefined && typeof update === "object" && "old" in update && "new" in update) {
|
|
390
|
+
rule("updateIf", update.old);
|
|
391
|
+
rule("updateTo", update.new, true);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
rule("update", update);
|
|
395
|
+
}
|
|
396
|
+
rule("delete", rules.delete);
|
|
397
|
+
const comment = rules.$comment ? lineComment(rules.$comment) : "";
|
|
398
|
+
if (entries.length === 0)
|
|
399
|
+
return `${comment}${propKey(table)}: {},`;
|
|
400
|
+
return `${comment}${propKey(table)}: {\n${entries.join("\n")}\n},`;
|
|
401
|
+
}
|
|
402
|
+
rule(table, policy, path, allowOld) {
|
|
403
|
+
const ctx = { table, row: rowName(table), allowOld };
|
|
404
|
+
let frag;
|
|
405
|
+
try {
|
|
406
|
+
frag = this.policy(policy, ctx, path);
|
|
407
|
+
}
|
|
408
|
+
catch (error) {
|
|
409
|
+
if (!(error instanceof Unprintable))
|
|
410
|
+
throw error;
|
|
411
|
+
this.unsupported.push({ path, text: error.text, reason: error.reason });
|
|
412
|
+
return "false";
|
|
413
|
+
}
|
|
414
|
+
const shown = frag.inline ?? frag;
|
|
415
|
+
const text = fill(shown);
|
|
416
|
+
const body = text.startsWith("{") ? `(${text})` : text;
|
|
417
|
+
const usesRow = shown.args.some((a) => !a.literal);
|
|
418
|
+
if (frag.old)
|
|
419
|
+
return `(${ctx.row}, old) => ${body}`;
|
|
420
|
+
if (usesRow)
|
|
421
|
+
return `(${ctx.row}) => ${body}`;
|
|
422
|
+
return text;
|
|
423
|
+
}
|
|
424
|
+
policy(policy, ctx, path) {
|
|
425
|
+
if (typeof policy === "string") {
|
|
426
|
+
let ast;
|
|
427
|
+
try {
|
|
428
|
+
ast = parseExpr(policy);
|
|
429
|
+
}
|
|
430
|
+
catch (error) {
|
|
431
|
+
throw new Unprintable(policy, error.message);
|
|
432
|
+
}
|
|
433
|
+
if (JSON.stringify(ast).includes('"kind":"call"')) {
|
|
434
|
+
throw new Unprintable(policy, "`defs` are not part of the alpha.66 format; inline them first");
|
|
435
|
+
}
|
|
436
|
+
try {
|
|
437
|
+
return this.expr(ast, ctx, { table: ctx.table });
|
|
438
|
+
}
|
|
439
|
+
catch (error) {
|
|
440
|
+
if (error instanceof Unprintable && error.text === "")
|
|
441
|
+
throw new Unprintable(policy, error.reason);
|
|
442
|
+
throw error;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if ("anyOf" in policy) {
|
|
446
|
+
return this.combinator("anyOf", policy.anyOf.map((p, i) => this.policy(p, ctx, `${path}.anyOf[${i}]`)));
|
|
447
|
+
}
|
|
448
|
+
if ("allOf" in policy) {
|
|
449
|
+
const items = policy.allOf.map((p) => (typeof p === "string" ? safeParse(p) : undefined));
|
|
450
|
+
const merged = this.mergeConditions(items, ctx, { table: ctx.table });
|
|
451
|
+
if (merged)
|
|
452
|
+
return merged;
|
|
453
|
+
return this.combinator("allOf", policy.allOf.map((p, i) => this.policy(p, ctx, `${path}.allOf[${i}]`)));
|
|
454
|
+
}
|
|
455
|
+
if ("where" in policy) {
|
|
456
|
+
const inner = this.policy(policy.where, ctx, `${path}.where`);
|
|
457
|
+
return { ...inner, text: `${lineComment(policy.$comment)}${inner.text}` };
|
|
458
|
+
}
|
|
459
|
+
throw new Unprintable(JSON.stringify(policy), "a policy with both `using` and `withCheck` has no DSL form");
|
|
460
|
+
}
|
|
461
|
+
/** `anyOf(…)` / `allOf(…)` / `not(…)`: a helper when it repeats. */
|
|
462
|
+
combinator(fn, items) {
|
|
463
|
+
this.tools.add(fn);
|
|
464
|
+
const frag = join(items, (texts) => `${fn}(${texts.join(", ")})`);
|
|
465
|
+
if (items.length === 0 || (fn !== "not" && items.length < 2))
|
|
466
|
+
return frag;
|
|
467
|
+
const hints = items.map((i) => i.label ?? i.hint ?? "rule");
|
|
468
|
+
let hint;
|
|
469
|
+
if (fn === "not")
|
|
470
|
+
hint = `not${pascal(hints[0])}`;
|
|
471
|
+
else {
|
|
472
|
+
const sep = fn === "anyOf" ? "Or" : "And";
|
|
473
|
+
// `isMembershipAdmin`, `isMembershipEditor` → `isMembershipAdminOrEditor`.
|
|
474
|
+
const named = (parts) => {
|
|
475
|
+
const words = parts.map((p) => p.split(/(?=[A-Z])/));
|
|
476
|
+
return words
|
|
477
|
+
.map((w, i) => {
|
|
478
|
+
if (i === 0)
|
|
479
|
+
return w.join("");
|
|
480
|
+
let shared = 0;
|
|
481
|
+
while (shared < w.length - 1 && w[shared] === words[0][shared])
|
|
482
|
+
shared++;
|
|
483
|
+
return pascal(w
|
|
484
|
+
.slice(shared)
|
|
485
|
+
.join("")
|
|
486
|
+
.replace(/^is(?=[A-Z])/, ""));
|
|
487
|
+
})
|
|
488
|
+
.join(sep);
|
|
489
|
+
};
|
|
490
|
+
// Short enough to read: all the parts, else the first and "…OrMore".
|
|
491
|
+
hint = named(hints);
|
|
492
|
+
if (hint.length > 40)
|
|
493
|
+
hint = named([hints[0], "more"]);
|
|
494
|
+
if (hint.length > 40)
|
|
495
|
+
hint = fn === "anyOf" ? "anyRule" : "allRules";
|
|
496
|
+
}
|
|
497
|
+
return this.shaped(frag, hint, undefined, true);
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* `a = 1 and b = 2` → `{ a: 1, b: 2 }`, when every item is a plain
|
|
501
|
+
* condition on a distinct column of the scope.
|
|
502
|
+
*/
|
|
503
|
+
mergeConditions(items, ctx, scope) {
|
|
504
|
+
if (items.length < 2 || items.some((i) => i === undefined))
|
|
505
|
+
return undefined;
|
|
506
|
+
const entries = [];
|
|
507
|
+
for (const item of items) {
|
|
508
|
+
const cond = this.condition(item, ctx, scope);
|
|
509
|
+
if (!cond || entries.some(([k]) => k === cond[0]))
|
|
510
|
+
return undefined;
|
|
511
|
+
entries.push(cond);
|
|
512
|
+
}
|
|
513
|
+
return this.conditionObject(entries, scope);
|
|
514
|
+
}
|
|
515
|
+
/** A condition object: a helper when it is a check on the session that repeats (`mine`). */
|
|
516
|
+
conditionObject(entries, scope) {
|
|
517
|
+
const frag = objectFrag(entries);
|
|
518
|
+
frag.hint = frag.label = conditionHint(entries);
|
|
519
|
+
if (scope.inExists || entries.length !== 1)
|
|
520
|
+
return frag;
|
|
521
|
+
const [key, value] = entries[0];
|
|
522
|
+
if (!value.text.startsWith("session."))
|
|
523
|
+
return frag;
|
|
524
|
+
const hint = value.text === "session.user"
|
|
525
|
+
? key.startsWith("$createdBy")
|
|
526
|
+
? "createdByMe"
|
|
527
|
+
: key === "userId"
|
|
528
|
+
? "mine"
|
|
529
|
+
: `${camel(key.replace(/Id$/, ""))}IsMe`
|
|
530
|
+
: `${camel(key.replace(/^\$/, ""))}FromSession`;
|
|
531
|
+
return this.shaped(frag, hint, undefined, true);
|
|
532
|
+
}
|
|
533
|
+
expr(ast, ctx, scope) {
|
|
534
|
+
switch (ast.kind) {
|
|
535
|
+
case "bool":
|
|
536
|
+
return lit(String(ast.value));
|
|
537
|
+
case "or":
|
|
538
|
+
return this.combinator("anyOf", ast.items.map((i) => this.expr(i, ctx, scope)));
|
|
539
|
+
case "and": {
|
|
540
|
+
const merged = this.mergeConditions(ast.items, ctx, scope);
|
|
541
|
+
if (merged)
|
|
542
|
+
return merged;
|
|
543
|
+
return this.combinator("allOf", ast.items.map((i) => this.expr(i, ctx, scope)));
|
|
544
|
+
}
|
|
545
|
+
case "not":
|
|
546
|
+
return this.combinator("not", [this.expr(ast.inner, ctx, scope)]);
|
|
547
|
+
case "exists":
|
|
548
|
+
return this.exists(ast, ctx, scope);
|
|
549
|
+
case "existsRel":
|
|
550
|
+
this.tools.add("exists");
|
|
551
|
+
return lit(`exists(${this.relation(ast.relation)})`, "relationExists");
|
|
552
|
+
case "allowed": {
|
|
553
|
+
if (scope.inExists)
|
|
554
|
+
throw new Unprintable("", "`allowedTo` inside `exists`");
|
|
555
|
+
this.tools.add("allowedTo");
|
|
556
|
+
const depth = ast.maxDepth !== undefined ? `, { maxDepth: ${ast.maxDepth} }` : "";
|
|
557
|
+
if (ast.target.kind === "via" && ast.target.table !== undefined) {
|
|
558
|
+
const target = member(member(`${this.schemaName}.tables`, ast.target.table), ast.target.column);
|
|
559
|
+
return lit(`allowedTo.${ast.op}(${target}${depth})`, `can${pascal(ast.op)}Via${pascal(ast.target.table)}`);
|
|
560
|
+
}
|
|
561
|
+
const name = ast.target.kind === "relation" ? ast.target.name : ast.target.column;
|
|
562
|
+
return {
|
|
563
|
+
text: `allowedTo.${ast.op}(${member(PLACEHOLDER(0), name)}${depth})`,
|
|
564
|
+
args: [this.rowArg(ctx)],
|
|
565
|
+
occ: [],
|
|
566
|
+
hint: `can${pascal(ast.op)}${pascal(name)}`,
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
case "call":
|
|
570
|
+
throw new Unprintable("", "`defs` calls are not part of the alpha.66 format");
|
|
571
|
+
default: {
|
|
572
|
+
const cond = this.condition(ast, ctx, scope);
|
|
573
|
+
if (cond)
|
|
574
|
+
return this.conditionObject([cond], scope);
|
|
575
|
+
const session = this.sessionComparison(ast, ctx, scope);
|
|
576
|
+
if (session)
|
|
577
|
+
return session;
|
|
578
|
+
throw new Unprintable("", "a comparison the DSL has no condition for");
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/** The checked row itself, as an argument (for its relations). */
|
|
583
|
+
rowArg(ctx) {
|
|
584
|
+
return {
|
|
585
|
+
text: ctx.row,
|
|
586
|
+
name: ctx.row,
|
|
587
|
+
type: `${this.dsl}.Row<typeof ${this.schemaName}, ${JSON.stringify(ctx.table)}>`,
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
/** A column of the checked row, as an argument. */
|
|
591
|
+
columnArg(ctx, column) {
|
|
592
|
+
return {
|
|
593
|
+
text: member(ctx.row, column),
|
|
594
|
+
name: column,
|
|
595
|
+
type: valueType(this.kindOf(ctx.table, column), this.dsl),
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
/** `exists t(…)`, idiomatically. */
|
|
599
|
+
exists(ast, ctx, scope) {
|
|
600
|
+
if (scope.inExists) {
|
|
601
|
+
// An `exists` inside another: its conditions name only its own rows.
|
|
602
|
+
return this.existsGeneric(ast, ctx, {
|
|
603
|
+
table: ast.table,
|
|
604
|
+
alias: ast.alias,
|
|
605
|
+
inExists: true,
|
|
606
|
+
nested: true,
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
const inner = { table: ast.table, alias: ast.alias, inExists: true };
|
|
610
|
+
/** The checked row's column that `c` compares `col` of `t` with. */
|
|
611
|
+
const outerOf = (c, col) => {
|
|
612
|
+
if (c?.kind !== "cmp" || c.op !== "=")
|
|
613
|
+
return undefined;
|
|
614
|
+
if (c.left.kind !== "column" || !this.isInnerColumn(c.left, inner) || c.left.name !== col)
|
|
615
|
+
return undefined;
|
|
616
|
+
return this.outerColumn(c.right, inner);
|
|
617
|
+
};
|
|
618
|
+
// `{ a: old.a, b: old.b }`: the old row is the same table's row with this id,
|
|
619
|
+
// each condition comparing one of its columns with the new row's.
|
|
620
|
+
if (ctx.allowOld && ast.table === ctx.table && ast.hops.length === 0) {
|
|
621
|
+
const idIndex = ast.conditions.findIndex((c) => outerOf(c, "id") === "id");
|
|
622
|
+
const rest = ast.conditions.filter((_, i) => i !== idIndex);
|
|
623
|
+
const olds = rest.map((c) => c.kind === "cmp" &&
|
|
624
|
+
c.left.kind === "column" &&
|
|
625
|
+
this.isInnerColumn(c.left, inner) &&
|
|
626
|
+
this.outerColumn(c.right, inner) === c.left.name
|
|
627
|
+
? { column: c.left.name, op: FLIP[c.op] }
|
|
628
|
+
: undefined);
|
|
629
|
+
const columns = new Set(olds.map((o) => o?.column));
|
|
630
|
+
if (idIndex >= 0 && rest.length > 0 && olds.every((o) => o) && columns.size === olds.length) {
|
|
631
|
+
const text = objectText(olds.map((o) => {
|
|
632
|
+
const value = member("old", o.column);
|
|
633
|
+
const op = o.op;
|
|
634
|
+
return [o.column, op === "=" ? value : this.fn(OP_FN[op], value)];
|
|
635
|
+
}));
|
|
636
|
+
return { text, args: [], occ: [], old: true, hint: "unchanged" };
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
// `row.rel.where({…})` along a forward relation: the one form for that check.
|
|
640
|
+
if (ast.hops.length === 0) {
|
|
641
|
+
const idIndex = ast.conditions.findIndex((c) => outerOf(c, "id") !== undefined);
|
|
642
|
+
if (idIndex >= 0) {
|
|
643
|
+
const column = outerOf(ast.conditions[idIndex], "id");
|
|
644
|
+
const relations = this.app.tables[ctx.table]?.relations ?? {};
|
|
645
|
+
const rel = Object.entries(relations).find(([, r]) => "rel" in r && r.rel === ast.table && r.column === column);
|
|
646
|
+
if (rel) {
|
|
647
|
+
const rest = ast.conditions.filter((_, i) => i !== idIndex);
|
|
648
|
+
const conds = this.conditions(rest, ctx, inner);
|
|
649
|
+
if (conds && conds.extras.length === 0) {
|
|
650
|
+
const where = conds.object ?? lit("{}");
|
|
651
|
+
const row = { text: PLACEHOLDER(0), args: [this.rowArg(ctx)], occ: [] };
|
|
652
|
+
const inline = join([row, where], ([r, w]) => `${member(r, rel[0])}.where(${w})`);
|
|
653
|
+
// The same check by value, for helpers: `exists.shows({ id: showId, … })`.
|
|
654
|
+
this.tools.add("exists");
|
|
655
|
+
const id = {
|
|
656
|
+
text: PLACEHOLDER(0),
|
|
657
|
+
args: [{ ...this.columnArg(ctx, column), name: column }],
|
|
658
|
+
occ: [],
|
|
659
|
+
};
|
|
660
|
+
const entries = [["id", id], ...conds.entries];
|
|
661
|
+
const byValue = join(entries.map(([, v]) => v), (texts) => `${member("exists", ast.table)}(${objectText(entries.map(([k], i) => [k, texts[i]]))})`);
|
|
662
|
+
// `isChief` for a check of the session's user (`chiefAccount = session.user`),
|
|
663
|
+
// `releaseMatches` for one comparing the target with the row.
|
|
664
|
+
const mine = conds.entries.find(([, v]) => v.text === "session.user");
|
|
665
|
+
const role = mine && camel(mine[0].replace(/(Account|User|UserId|Id)$/, ""));
|
|
666
|
+
const plainUser = mine && /^(account|user|userId|owner|ownerId)$/.test(mine[0]);
|
|
667
|
+
const hint = mine && (plainUser || !role)
|
|
668
|
+
? `isMy${pascal(singular(ast.table))}`
|
|
669
|
+
: role
|
|
670
|
+
? `is${pascal(role)}`
|
|
671
|
+
: conds.entries.length === 0
|
|
672
|
+
? `has${pascal(singular(ast.table))}`
|
|
673
|
+
: `${camel(singular(ast.table))}Matches`;
|
|
674
|
+
const shaped = this.shaped(byValue, hint);
|
|
675
|
+
// A helper's call stays a call; otherwise the rule reads the relation.
|
|
676
|
+
return shaped.call ? shaped : { ...shaped, inline };
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return this.existsGeneric(ast, ctx, inner);
|
|
682
|
+
}
|
|
683
|
+
existsGeneric(ast, ctx, inner) {
|
|
684
|
+
this.tools.add("exists");
|
|
685
|
+
const head = this.conditions(ast.conditions, ctx, inner);
|
|
686
|
+
if (!head)
|
|
687
|
+
throw new Unprintable("", "an `exists` whose conditions aren't plain column conditions");
|
|
688
|
+
const parts = [head.object ?? lit("{}"), ...head.extras];
|
|
689
|
+
let frag = join(parts, (texts) => `${member("exists", ast.table)}(${texts.join(", ")})`);
|
|
690
|
+
let table = ast.table;
|
|
691
|
+
for (const hop of ast.hops) {
|
|
692
|
+
const target = this.relationTarget(table, hop.relation);
|
|
693
|
+
if (!target)
|
|
694
|
+
throw new Unprintable("", `unknown relation \`${hop.relation}\` of ${table}`);
|
|
695
|
+
const conds = this.conditions(hop.conditions, ctx, {
|
|
696
|
+
table: target,
|
|
697
|
+
inExists: true,
|
|
698
|
+
nested: inner.nested,
|
|
699
|
+
});
|
|
700
|
+
if (!conds)
|
|
701
|
+
throw new Unprintable("", "a hop whose conditions aren't plain column conditions");
|
|
702
|
+
const hopParts = conds.object || conds.extras.length ? [conds.object ?? lit("{}"), ...conds.extras] : [];
|
|
703
|
+
frag = join([frag, ...hopParts], ([h, ...rest]) => `${h}.hop(${[JSON.stringify(hop.relation), ...rest].join(", ")})`);
|
|
704
|
+
table = target;
|
|
705
|
+
}
|
|
706
|
+
const hint = `is${pascal(singular(ast.table))}`;
|
|
707
|
+
if (inner.nested)
|
|
708
|
+
return { ...frag, hint };
|
|
709
|
+
return this.shaped(frag, hint);
|
|
710
|
+
}
|
|
711
|
+
relationTarget(table, relation) {
|
|
712
|
+
const r = this.app.tables[table]?.relations?.[relation];
|
|
713
|
+
if (!r)
|
|
714
|
+
return undefined;
|
|
715
|
+
return "rel" in r ? r.rel : r.reverse;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Conditions inside `exists` (or a hop): one object of plain conditions,
|
|
719
|
+
* then the policies that aren't (`exists.t({ a: 1 }, anyOf(…))`).
|
|
720
|
+
*/
|
|
721
|
+
conditions(items, ctx, scope) {
|
|
722
|
+
const flat = [];
|
|
723
|
+
for (const item of items) {
|
|
724
|
+
if (item.kind === "and")
|
|
725
|
+
flat.push(...item.items);
|
|
726
|
+
else
|
|
727
|
+
flat.push(item);
|
|
728
|
+
}
|
|
729
|
+
const entries = [];
|
|
730
|
+
const extraItems = [];
|
|
731
|
+
for (const item of flat) {
|
|
732
|
+
const cond = this.condition(item, ctx, scope);
|
|
733
|
+
if (!cond || entries.some(([k]) => k === cond[0]))
|
|
734
|
+
extraItems.push(item);
|
|
735
|
+
else
|
|
736
|
+
entries.push(cond);
|
|
737
|
+
}
|
|
738
|
+
const extras = extraItems.map((item) => this.expr(item, ctx, scope));
|
|
739
|
+
if (entries.length === 0)
|
|
740
|
+
return { object: undefined, extras, entries };
|
|
741
|
+
// A constant object may be a helper used elsewhere (`msg.sender.where(mine)`).
|
|
742
|
+
const constant = entries.every(([, v]) => v.args.every((a) => a.literal));
|
|
743
|
+
const object = constant
|
|
744
|
+
? this.conditionObject(entries, { table: scope.table })
|
|
745
|
+
: objectFrag(entries);
|
|
746
|
+
object.hint ??= conditionHint(entries);
|
|
747
|
+
return { object, extras, entries };
|
|
748
|
+
}
|
|
749
|
+
isInnerColumn(op, scope) {
|
|
750
|
+
if (op.kind !== "column")
|
|
751
|
+
return false;
|
|
752
|
+
if (op.qual.kind === "none")
|
|
753
|
+
return true;
|
|
754
|
+
if (op.qual.kind === "named")
|
|
755
|
+
return op.qual.name === (scope.alias ?? scope.table) || op.qual.name === scope.table;
|
|
756
|
+
if (!scope.inExists)
|
|
757
|
+
return op.qual.kind === "this";
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
/** The checked row's column a value names, inside `exists`. */
|
|
761
|
+
outerColumn(op, scope) {
|
|
762
|
+
if (!scope.inExists || op.kind !== "column" || this.isInnerColumn(op, scope))
|
|
763
|
+
return undefined;
|
|
764
|
+
return op.name;
|
|
765
|
+
}
|
|
766
|
+
/** A plain condition `[key, value]` on a column of the scope. */
|
|
767
|
+
condition(ast, ctx, scope) {
|
|
768
|
+
const column = (op) => op.kind === "column" && this.isInnerColumn(op, scope) ? op.name : undefined;
|
|
769
|
+
switch (ast.kind) {
|
|
770
|
+
case "cmp": {
|
|
771
|
+
let left = column(ast.left);
|
|
772
|
+
let right = ast.right;
|
|
773
|
+
let op = ast.op;
|
|
774
|
+
if (left === undefined) {
|
|
775
|
+
const flipped = column(ast.right);
|
|
776
|
+
if (flipped === undefined)
|
|
777
|
+
return undefined;
|
|
778
|
+
left = flipped;
|
|
779
|
+
right = ast.left;
|
|
780
|
+
op = FLIP[op];
|
|
781
|
+
}
|
|
782
|
+
const value = this.value(right, ctx, scope, this.kindOf(scope.table, left), left, this.enumType(scope.table, left));
|
|
783
|
+
if (!value)
|
|
784
|
+
return undefined;
|
|
785
|
+
// A value from the checked row takes the name of the column it is compared with:
|
|
786
|
+
// `exists.members({ bandId })`, not `{ bandId: id }`.
|
|
787
|
+
value.args = value.args.map((a) => (a.literal ? a : { ...a, name: left }));
|
|
788
|
+
if (right.kind === "null") {
|
|
789
|
+
if (op === "=")
|
|
790
|
+
return [left, value];
|
|
791
|
+
if (op === "!=")
|
|
792
|
+
return [left, wrap(value, (t) => this.fn("ne", t))];
|
|
793
|
+
return undefined;
|
|
794
|
+
}
|
|
795
|
+
if (op === "=")
|
|
796
|
+
return [left, value];
|
|
797
|
+
const fn = OP_FN[op];
|
|
798
|
+
return [left, wrap(value, (t) => this.fn(fn, t))];
|
|
799
|
+
}
|
|
800
|
+
case "inList": {
|
|
801
|
+
const left = column(ast.left);
|
|
802
|
+
if (left === undefined)
|
|
803
|
+
return undefined;
|
|
804
|
+
const kind = this.kindOf(scope.table, left);
|
|
805
|
+
// A named list (`invitableRoles`) by name.
|
|
806
|
+
if (ast.values.every((v) => v.kind === "string" || v.kind === "number" || v.kind === "bool")) {
|
|
807
|
+
const text = `[${ast.values.map((v) => this.plainLiteral(v, kind)).join(", ")}]`;
|
|
808
|
+
const named = this.constants.get(text);
|
|
809
|
+
if (named) {
|
|
810
|
+
this.constantsUsed.add(named);
|
|
811
|
+
return [left, lit(named)];
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
// An enum column's list takes its union too: `role: [role]` with `role: "admin" | …`.
|
|
815
|
+
const type = this.enumType(scope.table, left);
|
|
816
|
+
const values = ast.values.map((v) => this.value(v, ctx, scope, kind, left, type));
|
|
817
|
+
if (values.some((v) => !v))
|
|
818
|
+
return undefined;
|
|
819
|
+
return [left, join(values, (texts) => `[${texts.join(", ")}]`)];
|
|
820
|
+
}
|
|
821
|
+
case "inSession": {
|
|
822
|
+
const left = column(ast.left);
|
|
823
|
+
if (left === undefined)
|
|
824
|
+
return undefined;
|
|
825
|
+
return [left, lit(this.fn("isIn", this.sessionText(ast.path)))];
|
|
826
|
+
}
|
|
827
|
+
case "contains": {
|
|
828
|
+
const left = column(ast.left);
|
|
829
|
+
if (left === undefined)
|
|
830
|
+
return undefined;
|
|
831
|
+
const value = this.value(ast.right, ctx, scope, undefined, left);
|
|
832
|
+
if (!value)
|
|
833
|
+
return undefined;
|
|
834
|
+
return [left, wrap(value, (t) => this.fn("contains", t))];
|
|
835
|
+
}
|
|
836
|
+
default:
|
|
837
|
+
return undefined;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
/** The relation IR: `from.files("f").join(…).where(…)`. */
|
|
841
|
+
relation(rel) {
|
|
842
|
+
switch (rel.kind) {
|
|
843
|
+
case "scan":
|
|
844
|
+
this.tools.add("from");
|
|
845
|
+
return `${member("from", rel.table)}(${rel.alias !== undefined ? JSON.stringify(rel.alias) : ""})`;
|
|
846
|
+
case "join": {
|
|
847
|
+
const opts = [];
|
|
848
|
+
if (rel.on.length) {
|
|
849
|
+
opts.push(`on: [${rel.on.map((c) => `[${colRefText(c.left)}, ${colRefText(c.right)}]`).join(", ")}]`);
|
|
850
|
+
}
|
|
851
|
+
if (rel.joinKind === "left")
|
|
852
|
+
opts.push("left: true");
|
|
853
|
+
const right = this.relation(rel.right);
|
|
854
|
+
return `${this.relation(rel.left)}.join(${right}${opts.length ? `, { ${opts.join(", ")} }` : ""})`;
|
|
855
|
+
}
|
|
856
|
+
case "filter":
|
|
857
|
+
return `${this.relation(rel.input)}.where(${this.predicate(rel.predicate)})`;
|
|
858
|
+
case "project": {
|
|
859
|
+
const cols = rel.columns.map((c) => `${propKey(c.alias)}: ${this.keyText(c.expr)}`);
|
|
860
|
+
return `${this.relation(rel.input)}.select({${cols.length ? ` ${cols.join(", ")} ` : ""}})`;
|
|
861
|
+
}
|
|
862
|
+
case "distinct":
|
|
863
|
+
return `${this.relation(rel.input)}.distinctOn(${rel.key.map((k) => this.keyText(k)).join(", ")})`;
|
|
864
|
+
case "orderBy": {
|
|
865
|
+
const terms = rel.terms.map((t) => t.direction === "desc" ? `[${colRefText(t.column)}, "desc"]` : colRefText(t.column));
|
|
866
|
+
return `${this.relation(rel.input)}.orderBy(${terms.join(", ")})`;
|
|
867
|
+
}
|
|
868
|
+
case "limit":
|
|
869
|
+
return `${this.relation(rel.input)}.limit(${rel.limit})`;
|
|
870
|
+
case "offset":
|
|
871
|
+
return `${this.relation(rel.input)}.offset(${rel.offset})`;
|
|
872
|
+
// `union` and `recursive` are sources: a query starts from them with `from(…)`.
|
|
873
|
+
case "union": {
|
|
874
|
+
this.tools.add("union");
|
|
875
|
+
this.tools.add("from");
|
|
876
|
+
const arms = rel.inputs.map((a) => `${propKey(a.label)}: ${this.relation(a.input)}`);
|
|
877
|
+
return `from(union({ ${arms.join(", ")} }))`;
|
|
878
|
+
}
|
|
879
|
+
case "gather": {
|
|
880
|
+
this.tools.add("recursive");
|
|
881
|
+
this.tools.add("from");
|
|
882
|
+
const depth = rel.maxDepth === "fixpoint" ? '"fixpoint"' : String(rel.maxDepth);
|
|
883
|
+
return `from(recursive({ seed: ${this.relation(rel.seed)}, step: ${this.relation(rel.step)}, frontier: ${this.keyText(rel.frontierKey)}, dedupe: [${rel.dedupeKey.map((k) => this.keyText(k)).join(", ")}], maxDepth: ${depth} }))`;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
keyText(key) {
|
|
888
|
+
if (key.kind === "rowId")
|
|
889
|
+
return this.fn("rowId", JSON.stringify(key.row));
|
|
890
|
+
return colRefText(key.column);
|
|
891
|
+
}
|
|
892
|
+
/** A relation predicate: condition objects keyed by `"scope.col"`, and the combinators. */
|
|
893
|
+
predicate(p) {
|
|
894
|
+
switch (p.kind) {
|
|
895
|
+
case "true":
|
|
896
|
+
case "false":
|
|
897
|
+
return p.kind;
|
|
898
|
+
case "or":
|
|
899
|
+
return this.call("anyOf", p.items.map((i) => this.predicate(i)));
|
|
900
|
+
case "and": {
|
|
901
|
+
const entries = p.items.map((i) => this.predEntry(i));
|
|
902
|
+
if (entries.length > 1 &&
|
|
903
|
+
entries.every((e) => e) &&
|
|
904
|
+
new Set(entries.map((e) => e[0])).size === entries.length) {
|
|
905
|
+
return objectText(entries);
|
|
906
|
+
}
|
|
907
|
+
return this.call("allOf", p.items.map((i) => this.predicate(i)));
|
|
908
|
+
}
|
|
909
|
+
case "not":
|
|
910
|
+
return this.call("not", [this.predicate(p.inner)]);
|
|
911
|
+
default:
|
|
912
|
+
return objectText([this.predEntry(p)]);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
predEntry(p) {
|
|
916
|
+
switch (p.kind) {
|
|
917
|
+
case "cmp": {
|
|
918
|
+
const v = this.valueRef(p.right);
|
|
919
|
+
return [colRefKey(p.left), p.op === "=" ? v : this.fn(OP_FN[p.op], v)];
|
|
920
|
+
}
|
|
921
|
+
case "isNull":
|
|
922
|
+
return [colRefKey(p.column), "null"];
|
|
923
|
+
case "isNotNull":
|
|
924
|
+
return [colRefKey(p.column), this.fn("ne", "null")];
|
|
925
|
+
case "in":
|
|
926
|
+
return [colRefKey(p.left), `[${p.values.map((v) => this.valueRef(v)).join(", ")}]`];
|
|
927
|
+
case "contains":
|
|
928
|
+
return [colRefKey(p.left), this.fn("contains", this.valueRef(p.right))];
|
|
929
|
+
default:
|
|
930
|
+
return undefined;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
valueRef(v) {
|
|
934
|
+
switch (v.kind) {
|
|
935
|
+
case "literal":
|
|
936
|
+
if (v.value !== null &&
|
|
937
|
+
typeof v.value === "object" &&
|
|
938
|
+
"kind" in v.value &&
|
|
939
|
+
!v.text.startsWith("json(")) {
|
|
940
|
+
return this.typed(v.value);
|
|
941
|
+
}
|
|
942
|
+
if (v.text.startsWith("json("))
|
|
943
|
+
return this.fn("jsonValue", jsLiteral(v.value));
|
|
944
|
+
return JSON.stringify(v.value);
|
|
945
|
+
case "session":
|
|
946
|
+
return this.sessionText(v.path);
|
|
947
|
+
case "param":
|
|
948
|
+
return this.fn("param", JSON.stringify(v.name));
|
|
949
|
+
case "outer":
|
|
950
|
+
case "frontier":
|
|
951
|
+
return this.fn(v.kind, colRefText(v.column));
|
|
952
|
+
case "rowId":
|
|
953
|
+
return this.fn("rowId", JSON.stringify(v.row));
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
call(fn, args) {
|
|
957
|
+
this.tools.add(fn);
|
|
958
|
+
return `${fn}(${args.join(", ")})`;
|
|
959
|
+
}
|
|
960
|
+
sessionText(path) {
|
|
961
|
+
this.tools.add("session");
|
|
962
|
+
return path.reduce((acc, part) => member(acc, part), "session");
|
|
963
|
+
}
|
|
964
|
+
/** `typed.int(5)`: exactly that value, as the file's typed literal. */
|
|
965
|
+
typed(t) {
|
|
966
|
+
this.tools.add("typed");
|
|
967
|
+
const num = (v) => (/^-?\d+(\.\d+)?$/.test(v) ? v : JSON.stringify(v));
|
|
968
|
+
switch (t.kind) {
|
|
969
|
+
case "literal":
|
|
970
|
+
return `typed.literal(${t.raw ?? JSON.stringify(t.value)})`;
|
|
971
|
+
case "int":
|
|
972
|
+
case "timestamp":
|
|
973
|
+
case "double":
|
|
974
|
+
return `typed.${t.kind}(${num(t.value)})`;
|
|
975
|
+
case "bigint":
|
|
976
|
+
return `typed.bigint(${/^-?\d+$/.test(t.value) ? `${t.value}n` : JSON.stringify(t.value)})`;
|
|
977
|
+
case "text":
|
|
978
|
+
case "uuid":
|
|
979
|
+
case "bytes":
|
|
980
|
+
case "txid":
|
|
981
|
+
return `typed.${t.kind}(${JSON.stringify(t.value)})`;
|
|
982
|
+
case "bool":
|
|
983
|
+
return `typed.bool(${t.value})`;
|
|
984
|
+
case "null":
|
|
985
|
+
return "null";
|
|
986
|
+
case "array":
|
|
987
|
+
return `typed.array(${t.items.map((i) => this.typed(i)).join(", ")})`;
|
|
988
|
+
case "row":
|
|
989
|
+
return `typed.row(${[t.id === null ? "null" : JSON.stringify(t.id), ...t.values.map((v) => this.typed(v))].join(", ")})`;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
/** `session.claims.role = 'admin'` → `eq(session.claims.role, "admin")`: a helper when it repeats. */
|
|
993
|
+
sessionComparison(ast, ctx, scope) {
|
|
994
|
+
const plain = (op) => op.kind === "session" ? undefined : this.value(op, ctx, scope, undefined);
|
|
995
|
+
const claim = (path) => camel(path[path.length - 1]);
|
|
996
|
+
if (ast.kind === "cmp") {
|
|
997
|
+
let [left, right, op] = [ast.left, ast.right, ast.op];
|
|
998
|
+
if (left.kind !== "session")
|
|
999
|
+
[left, right, op] = [right, left, FLIP[op]];
|
|
1000
|
+
if (left.kind !== "session")
|
|
1001
|
+
return undefined;
|
|
1002
|
+
const value = plain(right);
|
|
1003
|
+
if (!value || value.args.some((a) => !a.literal))
|
|
1004
|
+
return undefined;
|
|
1005
|
+
const fn = op === "=" ? "eq" : OP_FN[op];
|
|
1006
|
+
const session = this.sessionText(left.path);
|
|
1007
|
+
const frag = wrap(value, (t) => this.fn(fn, `${session}, ${t}`));
|
|
1008
|
+
const shown = fill(value).replace(/"/g, "");
|
|
1009
|
+
const hint = op === "=" ? `${claim(left.path)}Is${pascal(shown) || "Set"}` : `${claim(left.path)}Check`;
|
|
1010
|
+
return this.shaped(frag, hint, undefined, true);
|
|
1011
|
+
}
|
|
1012
|
+
if (ast.kind === "inList" && ast.left.kind === "session") {
|
|
1013
|
+
const values = ast.values.map((v) => plain(v));
|
|
1014
|
+
if (values.some((v) => !v || v.args.some((a) => !a.literal)))
|
|
1015
|
+
return undefined;
|
|
1016
|
+
const session = this.sessionText(ast.left.path);
|
|
1017
|
+
const list = join(values, (texts) => `[${texts.join(", ")}]`);
|
|
1018
|
+
const named = this.constants.get(fill(list));
|
|
1019
|
+
if (named)
|
|
1020
|
+
this.constantsUsed.add(named);
|
|
1021
|
+
const frag = named
|
|
1022
|
+
? lit(this.fn("isIn", `${session}, ${named}`))
|
|
1023
|
+
: wrap(list, (t) => this.fn("isIn", `${session}, ${t}`));
|
|
1024
|
+
const shown = named
|
|
1025
|
+
? pascal(named)
|
|
1026
|
+
: values.map((v) => pascal(fill(v).replace(/"/g, ""))).join("Or");
|
|
1027
|
+
return this.shaped(frag, `${claim(ast.left.path)}In${shown}`, undefined, true);
|
|
1028
|
+
}
|
|
1029
|
+
if (ast.kind === "contains" && ast.left.kind === "session") {
|
|
1030
|
+
const value = plain(ast.right);
|
|
1031
|
+
if (!value || value.args.some((a) => !a.literal))
|
|
1032
|
+
return undefined;
|
|
1033
|
+
const session = this.sessionText(ast.left.path);
|
|
1034
|
+
return wrap(value, (t) => this.fn("contains", `${session}, ${t}`));
|
|
1035
|
+
}
|
|
1036
|
+
return undefined;
|
|
1037
|
+
}
|
|
1038
|
+
fn(name, arg) {
|
|
1039
|
+
this.tools.add(name);
|
|
1040
|
+
return `${name}(${arg})`;
|
|
1041
|
+
}
|
|
1042
|
+
/** An enum column's values as a TS union, for helper parameters. */
|
|
1043
|
+
enumType(table, column) {
|
|
1044
|
+
const spec = this.app.tables[table]?.columns[column];
|
|
1045
|
+
if (typeof spec !== "object" || !spec.enum)
|
|
1046
|
+
return undefined;
|
|
1047
|
+
return spec.enum.map((v) => JSON.stringify(v)).join(" | ");
|
|
1048
|
+
}
|
|
1049
|
+
kindOf(table, column) {
|
|
1050
|
+
if (column === "id")
|
|
1051
|
+
return "uuid";
|
|
1052
|
+
return columnKind(this.app.tables[table]?.columns[column]);
|
|
1053
|
+
}
|
|
1054
|
+
plainLiteral(op, kind) {
|
|
1055
|
+
switch (op.kind) {
|
|
1056
|
+
case "string":
|
|
1057
|
+
return JSON.stringify(op.value);
|
|
1058
|
+
case "number":
|
|
1059
|
+
return kind === "bigint" ? `${op.raw}n` : op.raw;
|
|
1060
|
+
case "bool":
|
|
1061
|
+
return String(op.value);
|
|
1062
|
+
default:
|
|
1063
|
+
return undefined;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* A value: a literal (a placeholder, so a helper may take it), `null`, a
|
|
1068
|
+
* session value, or a column of the checked row (a placeholder too).
|
|
1069
|
+
*/
|
|
1070
|
+
value(op, ctx, scope, kind, key = "value", type) {
|
|
1071
|
+
switch (op.kind) {
|
|
1072
|
+
case "string":
|
|
1073
|
+
case "number":
|
|
1074
|
+
case "bool": {
|
|
1075
|
+
const text = this.plainLiteral(op, kind);
|
|
1076
|
+
const named = this.constants.get(text);
|
|
1077
|
+
if (named) {
|
|
1078
|
+
this.constantsUsed.add(named);
|
|
1079
|
+
return lit(named);
|
|
1080
|
+
}
|
|
1081
|
+
const valueKind = kind && kind !== "enum" && kind !== "json" && kind !== "array"
|
|
1082
|
+
? kind
|
|
1083
|
+
: op.kind === "string"
|
|
1084
|
+
? "string"
|
|
1085
|
+
: op.kind === "bool"
|
|
1086
|
+
? "boolean"
|
|
1087
|
+
: "float";
|
|
1088
|
+
const name = camel(key.replace(/^\$/, "").replace(/\./g, " ")) || "value";
|
|
1089
|
+
return {
|
|
1090
|
+
text: PLACEHOLDER(0),
|
|
1091
|
+
args: [{ text, name, type: type ?? valueType(valueKind, this.dsl), literal: true }],
|
|
1092
|
+
occ: [],
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
case "null":
|
|
1096
|
+
return lit("null");
|
|
1097
|
+
case "session":
|
|
1098
|
+
return lit(this.sessionText(op.path));
|
|
1099
|
+
case "typed":
|
|
1100
|
+
return lit(this.typed(op.value));
|
|
1101
|
+
case "column": {
|
|
1102
|
+
if (!scope.inExists || scope.nested)
|
|
1103
|
+
return undefined;
|
|
1104
|
+
if (this.isInnerColumn(op, scope))
|
|
1105
|
+
return undefined;
|
|
1106
|
+
if (op.qual.kind === "named" && op.qual.name !== ctx.table)
|
|
1107
|
+
return undefined;
|
|
1108
|
+
return { text: PLACEHOLDER(0), args: [this.columnArg(ctx, op.name)], occ: [] };
|
|
1109
|
+
}
|
|
1110
|
+
case "param":
|
|
1111
|
+
return undefined;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
function valueType(kind, dsl = "s") {
|
|
1116
|
+
if (kind === "uuid")
|
|
1117
|
+
return `${dsl}.Uuid`;
|
|
1118
|
+
return `${dsl}.Value<${JSON.stringify(kind ?? "string")}>`;
|
|
1119
|
+
}
|
|
1120
|
+
/** `value` inside `render(…)`, keeping its placeholders. */
|
|
1121
|
+
function wrap(value, render) {
|
|
1122
|
+
return {
|
|
1123
|
+
...value,
|
|
1124
|
+
text: render(value.text),
|
|
1125
|
+
...(value.inline ? { inline: wrap(value.inline, render) } : {}),
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
function objectFrag(entries) {
|
|
1129
|
+
return join(entries.map(([, v]) => v), (texts) => objectText(entries.map(([k], i) => [k, texts[i]])));
|
|
1130
|
+
}
|
|
1131
|
+
/** A name for a condition object: its first key and literal (`roleAdmin`), or its keys. */
|
|
1132
|
+
function conditionHint(entries) {
|
|
1133
|
+
const [key, value] = entries[0];
|
|
1134
|
+
const name = camel(key.replace(/^\$/, "").replace(/\./g, " "));
|
|
1135
|
+
const shown = fill(value);
|
|
1136
|
+
if (/^"[A-Za-z][\w -]*"$/.test(shown))
|
|
1137
|
+
return `${name}${pascal(shown.slice(1, -1))}`;
|
|
1138
|
+
if (shown === "true")
|
|
1139
|
+
return name;
|
|
1140
|
+
if (shown === "null")
|
|
1141
|
+
return `no${pascal(name)}`;
|
|
1142
|
+
return entries.length > 1 ? `${name}And${pascal(camel(entries[1][0]))}` : name;
|
|
1143
|
+
}
|
|
1144
|
+
function colRefKey(c) {
|
|
1145
|
+
return c.scope !== undefined ? `${c.scope}.${c.column}` : c.column;
|
|
1146
|
+
}
|
|
1147
|
+
function colRefText(c) {
|
|
1148
|
+
return JSON.stringify(colRefKey(c));
|
|
1149
|
+
}
|
|
1150
|
+
function objectText(entries) {
|
|
1151
|
+
return `{ ${entries.map(([k, v]) => `${propKey(k)}: ${v}`).join(", ")} }`;
|
|
1152
|
+
}
|
|
1153
|
+
function lineComment(text) {
|
|
1154
|
+
return text
|
|
1155
|
+
.split("\n")
|
|
1156
|
+
.map((line) => `// ${line}`.trimEnd() + "\n")
|
|
1157
|
+
.join("");
|
|
1158
|
+
}
|
|
1159
|
+
function safeParse(text) {
|
|
1160
|
+
try {
|
|
1161
|
+
return parseExpr(text);
|
|
1162
|
+
}
|
|
1163
|
+
catch {
|
|
1164
|
+
return undefined;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
//# sourceMappingURL=permissions.js.map
|