@fougere/core 0.6.0-alpha.0 → 0.7.0-alpha.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/README.md +1 -1
- package/dist/boot/Emissions.d.ts +13 -90
- package/dist/boot/Emissions.d.ts.map +1 -1
- package/dist/boot/Emissions.js +21 -118
- package/dist/boot/Emissions.js.map +1 -1
- package/dist/boot/ambient-port.d.ts +3 -24
- package/dist/boot/ambient-port.d.ts.map +1 -1
- package/dist/boot/ambient.als.d.ts.map +1 -1
- package/dist/boot/ambient.als.js +7 -12
- package/dist/boot/ambient.als.js.map +1 -1
- package/dist/boot/ambient.queue.d.ts +2 -5
- package/dist/boot/ambient.queue.d.ts.map +1 -1
- package/dist/boot/ambient.queue.js.map +1 -1
- package/dist/boot/apply.d.ts +1 -13
- package/dist/boot/apply.d.ts.map +1 -1
- package/dist/boot/apply.js +3 -15
- package/dist/boot/apply.js.map +1 -1
- package/dist/boot/auth.d.ts +2 -12
- package/dist/boot/auth.d.ts.map +1 -1
- package/dist/boot/boot.d.ts +3 -16
- package/dist/boot/boot.d.ts.map +1 -1
- package/dist/boot/boot.js +3 -10
- package/dist/boot/boot.js.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +61 -127
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/card.d.ts +1 -17
- package/dist/boot/card.d.ts.map +1 -1
- package/dist/boot/card.js +3 -32
- package/dist/boot/card.js.map +1 -1
- package/dist/boot/frame.d.ts +8 -32
- package/dist/boot/frame.d.ts.map +1 -1
- package/dist/boot/frame.js +20 -54
- package/dist/boot/frame.js.map +1 -1
- package/dist/boot/hosted.d.ts +2 -24
- package/dist/boot/hosted.d.ts.map +1 -1
- package/dist/boot/hosted.js +10 -15
- package/dist/boot/hosted.js.map +1 -1
- package/dist/boot/ownership.d.ts +3 -36
- package/dist/boot/ownership.d.ts.map +1 -1
- package/dist/boot/ownership.js +5 -40
- package/dist/boot/ownership.js.map +1 -1
- package/dist/boot/ports.d.ts +1 -14
- package/dist/boot/ports.d.ts.map +1 -1
- package/dist/boot/ports.js +1 -14
- package/dist/boot/ports.js.map +1 -1
- package/dist/boot/remote.d.ts +5 -38
- package/dist/boot/remote.d.ts.map +1 -1
- package/dist/boot/remote.js +8 -41
- package/dist/boot/remote.js.map +1 -1
- package/dist/boot/runner.d.ts +4 -21
- package/dist/boot/runner.d.ts.map +1 -1
- package/dist/boot/runner.js +4 -17
- package/dist/boot/runner.js.map +1 -1
- package/dist/boot/seed.d.ts +4 -31
- package/dist/boot/seed.d.ts.map +1 -1
- package/dist/boot/seed.js +6 -37
- package/dist/boot/seed.js.map +1 -1
- package/dist/boot/statement-drift.d.ts +2 -21
- package/dist/boot/statement-drift.d.ts.map +1 -1
- package/dist/boot/statement-drift.js +4 -9
- package/dist/boot/statement-drift.js.map +1 -1
- package/dist/boot/together.d.ts +4 -8
- package/dist/boot/together.d.ts.map +1 -1
- package/dist/boot/together.js +15 -50
- package/dist/boot/together.js.map +1 -1
- package/dist/boot/types.d.ts +28 -173
- package/dist/boot/types.d.ts.map +1 -1
- package/dist/builtin/config.d.ts +7 -0
- package/dist/builtin/config.d.ts.map +1 -0
- package/dist/builtin/config.js +15 -0
- package/dist/builtin/config.js.map +1 -0
- package/dist/{builtins → builtin}/logger.d.ts +4 -25
- package/dist/builtin/logger.d.ts.map +1 -0
- package/dist/{builtins → builtin}/logger.js +5 -32
- package/dist/builtin/logger.js.map +1 -0
- package/dist/config-loader.d.ts +9 -67
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +5 -18
- package/dist/config-loader.js.map +1 -1
- package/dist/contract.d.ts +13 -31
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +10 -26
- package/dist/contract.js.map +1 -1
- package/dist/crypto/encoding.d.ts +2 -15
- package/dist/crypto/encoding.d.ts.map +1 -1
- package/dist/crypto/encoding.js +2 -15
- package/dist/crypto/encoding.js.map +1 -1
- package/dist/crypto/node.d.ts.map +1 -1
- package/dist/crypto/node.js +1 -7
- package/dist/crypto/node.js.map +1 -1
- package/dist/crypto/port.d.ts +2 -18
- package/dist/crypto/port.d.ts.map +1 -1
- package/dist/crypto/port.js +1 -17
- package/dist/crypto/port.js.map +1 -1
- package/dist/crypto/webcrypto.d.ts.map +1 -1
- package/dist/crypto/webcrypto.js +1 -12
- package/dist/crypto/webcrypto.js.map +1 -1
- package/dist/declare.d.ts +6 -36
- package/dist/declare.d.ts.map +1 -1
- package/dist/declare.js +4 -29
- package/dist/declare.js.map +1 -1
- package/dist/define.d.ts +2 -3
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +2 -3
- package/dist/define.js.map +1 -1
- package/dist/descriptor/Fronds.d.ts +3 -28
- package/dist/descriptor/Fronds.d.ts.map +1 -1
- package/dist/descriptor/Fronds.js +6 -31
- package/dist/descriptor/Fronds.js.map +1 -1
- package/dist/descriptor/frond.d.ts +14 -63
- package/dist/descriptor/frond.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.js +5 -5
- package/dist/dispatch/ArgumentResolver.js.map +1 -1
- package/dist/dispatch/DispatchEvent.d.ts +2 -2
- package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
- package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.js +1 -7
- package/dist/dispatch/DispatchLifecycle.js.map +1 -1
- package/dist/dispatch/DispatchPort.d.ts +1 -1
- package/dist/dispatch/DispatchPort.d.ts.map +1 -1
- package/dist/dispatch/Dispatcher.d.ts +1 -1
- package/dist/dispatch/Dispatcher.d.ts.map +1 -1
- package/dist/dispatch/Dispatcher.js +2 -2
- package/dist/dispatch/Dispatcher.js.map +1 -1
- package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
- package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
- package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
- package/dist/dispatch/HandlerFacade.js.map +1 -0
- package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
- package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
- package/dist/dispatch/LocalRoutePolicy.js +4 -4
- package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
- package/dist/dispatch/OperationRoute.d.ts +2 -2
- package/dist/dispatch/OperationRoute.d.ts.map +1 -1
- package/dist/dispatch/OutputView.d.ts +3 -2
- package/dist/dispatch/OutputView.d.ts.map +1 -1
- package/dist/dispatch/OutputView.js +19 -1
- package/dist/dispatch/OutputView.js.map +1 -1
- package/dist/dispatch/Route.d.ts +2 -2
- package/dist/dispatch/Route.d.ts.map +1 -1
- package/dist/dispatch/RoutePolicy.d.ts +1 -1
- package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
- package/dist/dispatch/RouteRegistry.d.ts +1 -1
- package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
- package/dist/dispatch/RouteRegistry.js +2 -2
- package/dist/dispatch/RouteRegistry.js.map +1 -1
- package/dist/dispatch/RouteResolver.d.ts +2 -4
- package/dist/dispatch/RouteResolver.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.d.ts +8 -7
- package/dist/dispatch/StorageGuard.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.js +61 -18
- package/dist/dispatch/StorageGuard.js.map +1 -1
- package/dist/dispatch/presenterArguments.d.ts +7 -0
- package/dist/dispatch/presenterArguments.d.ts.map +1 -0
- package/dist/dispatch/presenterArguments.js +12 -0
- package/dist/dispatch/presenterArguments.js.map +1 -0
- package/dist/dispatch/remoteRoutes.d.ts +7 -0
- package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
- package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
- package/dist/dispatch/remoteRoutes.js.map +1 -0
- package/dist/dispatch/routeNotFound.d.ts +9 -0
- package/dist/dispatch/routeNotFound.d.ts.map +1 -0
- package/dist/dispatch/routeNotFound.js +21 -0
- package/dist/dispatch/routeNotFound.js.map +1 -0
- package/dist/dispatch/validateInput.d.ts +5 -0
- package/dist/dispatch/validateInput.d.ts.map +1 -0
- package/dist/dispatch/validateInput.js +20 -0
- package/dist/dispatch/validateInput.js.map +1 -0
- package/dist/effective-operation.d.ts +1 -24
- package/dist/effective-operation.d.ts.map +1 -1
- package/dist/effective-operation.js +21 -50
- package/dist/effective-operation.js.map +1 -1
- package/dist/emit.d.ts +4 -42
- package/dist/emit.d.ts.map +1 -1
- package/dist/emit.js +3 -39
- package/dist/emit.js.map +1 -1
- package/dist/entry/facade.d.ts +8 -0
- package/dist/entry/facade.d.ts.map +1 -0
- package/dist/entry/facade.js +28 -0
- package/dist/entry/facade.js.map +1 -0
- package/dist/entry/transport.d.ts +5 -0
- package/dist/entry/transport.d.ts.map +1 -0
- package/dist/entry/transport.js +11 -0
- package/dist/entry/transport.js.map +1 -0
- package/dist/frond-config.d.ts +7 -70
- package/dist/frond-config.d.ts.map +1 -1
- package/dist/frond-config.js +1 -9
- package/dist/frond-config.js.map +1 -1
- package/dist/identity-keys.d.ts +2 -5
- package/dist/identity-keys.d.ts.map +1 -1
- package/dist/identity-keys.js +3 -16
- package/dist/identity-keys.js.map +1 -1
- package/dist/identity.d.ts +4 -30
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +11 -73
- package/dist/identity.js.map +1 -1
- package/dist/imports.d.ts +1 -7
- package/dist/imports.d.ts.map +1 -1
- package/dist/imports.js +1 -7
- package/dist/imports.js.map +1 -1
- package/dist/index.d.ts +17 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -18
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -8
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1 -8
- package/dist/loader.js.map +1 -1
- package/dist/node.d.ts +2 -11
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2 -11
- package/dist/node.js.map +1 -1
- package/dist/prefab/collector.d.ts +1 -22
- package/dist/prefab/collector.d.ts.map +1 -1
- package/dist/prefab/collector.js +1 -22
- package/dist/prefab/collector.js.map +1 -1
- package/dist/prefab/crud.d.ts +16 -32
- package/dist/prefab/crud.d.ts.map +1 -1
- package/dist/prefab/crud.js +31 -58
- package/dist/prefab/crud.js.map +1 -1
- package/dist/prefab/mirror.d.ts +2 -24
- package/dist/prefab/mirror.d.ts.map +1 -1
- package/dist/prefab/mirror.js +2 -20
- package/dist/prefab/mirror.js.map +1 -1
- package/dist/prefab/prefab.d.ts +1 -7
- package/dist/prefab/prefab.d.ts.map +1 -1
- package/dist/prefab/prefab.js +1 -7
- package/dist/prefab/prefab.js.map +1 -1
- package/dist/prefab/presenter.d.ts +2 -36
- package/dist/prefab/presenter.d.ts.map +1 -1
- package/dist/prefab/presenter.js +2 -36
- package/dist/prefab/presenter.js.map +1 -1
- package/dist/prefab/repository.d.ts +5 -73
- package/dist/prefab/repository.d.ts.map +1 -1
- package/dist/prefab/repository.js +3 -16
- package/dist/prefab/repository.js.map +1 -1
- package/dist/scan/adapters.d.ts +3 -0
- package/dist/scan/adapters.d.ts.map +1 -0
- package/dist/scan/adapters.js +25 -0
- package/dist/scan/adapters.js.map +1 -0
- package/dist/scan/bundling.d.ts +1 -12
- package/dist/scan/bundling.d.ts.map +1 -1
- package/dist/scan/bundling.js +1 -12
- package/dist/scan/bundling.js.map +1 -1
- package/dist/scan/conventions.d.ts +6 -40
- package/dist/scan/conventions.d.ts.map +1 -1
- package/dist/scan/conventions.js +5 -34
- package/dist/scan/conventions.js.map +1 -1
- package/dist/scan/emit.d.ts +1 -5
- package/dist/scan/emit.d.ts.map +1 -1
- package/dist/scan/emit.js +4 -38
- package/dist/scan/emit.js.map +1 -1
- package/dist/scan/handler-parser.d.ts +4 -26
- package/dist/scan/handler-parser.d.ts.map +1 -1
- package/dist/scan/handler-parser.js +26 -83
- package/dist/scan/handler-parser.js.map +1 -1
- package/dist/scan/result.d.ts +3 -16
- package/dist/scan/result.d.ts.map +1 -1
- package/dist/scan/scanner.d.ts +2 -27
- package/dist/scan/scanner.d.ts.map +1 -1
- package/dist/scan/scanner.js +28 -127
- package/dist/scan/scanner.js.map +1 -1
- package/dist/scan/statement.d.ts.map +1 -1
- package/dist/scan/statement.js +4 -30
- package/dist/scan/statement.js.map +1 -1
- package/dist/source.d.ts +41 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +10 -0
- package/dist/source.js.map +1 -0
- package/dist/storage.d.ts +13 -210
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +4 -68
- package/dist/storage.js.map +1 -1
- package/dist/store.d.ts +18 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +146 -0
- package/dist/store.js.map +1 -0
- package/dist/verify.d.ts +5 -38
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +17 -37
- package/dist/verify.js.map +1 -1
- package/dist/wire/CallLog.d.ts +32 -0
- package/dist/wire/CallLog.d.ts.map +1 -0
- package/dist/{contract → wire}/CallLog.js.map +1 -1
- package/dist/wire/Invocation.d.ts +32 -0
- package/dist/wire/Invocation.d.ts.map +1 -0
- package/dist/wire/Invocation.js +66 -0
- package/dist/wire/Invocation.js.map +1 -0
- package/dist/{contract → wire}/RouteAddress.d.ts +5 -0
- package/dist/wire/RouteAddress.d.ts.map +1 -0
- package/dist/{contract → wire}/RouteAddress.js +7 -0
- package/dist/wire/RouteAddress.js.map +1 -0
- package/dist/wire/binding.d.ts +5 -21
- package/dist/wire/binding.d.ts.map +1 -1
- package/dist/wire/binding.js +5 -10
- package/dist/wire/binding.js.map +1 -1
- package/dist/wire/call.d.ts +24 -133
- package/dist/wire/call.d.ts.map +1 -1
- package/dist/wire/call.js +15 -41
- package/dist/wire/call.js.map +1 -1
- package/dist/wire/drift.d.ts +3 -28
- package/dist/wire/drift.d.ts.map +1 -1
- package/dist/wire/drift.js +4 -23
- package/dist/wire/drift.js.map +1 -1
- package/dist/wire/errors.d.ts +4 -24
- package/dist/wire/errors.d.ts.map +1 -1
- package/dist/wire/errors.js +4 -24
- package/dist/wire/errors.js.map +1 -1
- package/dist/wire/http-error.d.ts +2 -13
- package/dist/wire/http-error.d.ts.map +1 -1
- package/dist/wire/http-error.js +5 -19
- package/dist/wire/http-error.js.map +1 -1
- package/dist/wire/loggerMiddleware.d.ts +2 -8
- package/dist/wire/loggerMiddleware.d.ts.map +1 -1
- package/dist/wire/loggerMiddleware.js +1 -7
- package/dist/wire/loggerMiddleware.js.map +1 -1
- package/dist/wire/middleware.d.ts +3 -7
- package/dist/wire/middleware.d.ts.map +1 -1
- package/dist/wire/middleware.js +1 -5
- package/dist/wire/middleware.js.map +1 -1
- package/dist/wire/operation.d.ts +7 -43
- package/dist/wire/operation.d.ts.map +1 -1
- package/dist/wire/operation.js +4 -15
- package/dist/wire/operation.js.map +1 -1
- package/dist/wire/signature.d.ts +4 -25
- package/dist/wire/signature.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/boot/Emissions.ts +21 -118
- package/src/boot/ambient-port.ts +3 -24
- package/src/boot/ambient.als.ts +7 -12
- package/src/boot/ambient.queue.ts +2 -5
- package/src/boot/apply.ts +3 -15
- package/src/boot/auth.ts +2 -12
- package/src/boot/boot.ts +5 -20
- package/src/boot/bootstrap.ts +69 -136
- package/src/boot/card.ts +4 -33
- package/src/boot/frame.ts +28 -62
- package/src/boot/hosted.ts +12 -34
- package/src/boot/ownership.ts +5 -39
- package/src/boot/ports.ts +1 -14
- package/src/boot/remote.ts +11 -58
- package/src/boot/runner.ts +5 -22
- package/src/boot/seed.ts +6 -37
- package/src/boot/statement-drift.ts +5 -24
- package/src/boot/together.ts +18 -51
- package/src/boot/types.ts +28 -173
- package/src/{builtins → builtin}/config.ts +1 -7
- package/src/{builtins → builtin}/logger.ts +6 -39
- package/src/config-loader.ts +12 -71
- package/src/contract.ts +15 -39
- package/src/crypto/encoding.ts +2 -15
- package/src/crypto/node.ts +1 -7
- package/src/crypto/port.ts +2 -18
- package/src/crypto/webcrypto.ts +1 -12
- package/src/declare.ts +8 -39
- package/src/define.ts +2 -3
- package/src/descriptor/Fronds.ts +6 -31
- package/src/descriptor/frond.ts +14 -63
- package/src/dispatch/ArgumentResolver.ts +6 -6
- package/src/dispatch/DispatchEvent.ts +2 -2
- package/src/dispatch/DispatchLifecycle.ts +1 -7
- package/src/dispatch/DispatchPort.ts +1 -1
- package/src/dispatch/Dispatcher.ts +3 -3
- package/src/dispatch/HandlerFacade.ts +231 -0
- package/src/dispatch/LocalRoutePolicy.ts +4 -4
- package/src/dispatch/OperationRoute.ts +2 -2
- package/src/dispatch/OutputView.ts +24 -2
- package/src/dispatch/Route.ts +2 -2
- package/src/dispatch/RoutePolicy.ts +1 -1
- package/src/dispatch/RouteRegistry.ts +2 -2
- package/src/dispatch/RouteResolver.ts +2 -4
- package/src/dispatch/StorageGuard.ts +70 -18
- package/src/dispatch/presenterArguments.ts +25 -0
- package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
- package/src/dispatch/routeNotFound.ts +33 -0
- package/src/dispatch/validateInput.ts +28 -0
- package/src/effective-operation.ts +21 -50
- package/src/emit.ts +5 -63
- package/src/entry/facade.ts +44 -0
- package/src/entry/transport.ts +16 -0
- package/src/frond-config.ts +7 -70
- package/src/identity-keys.ts +3 -16
- package/src/identity.ts +12 -80
- package/src/imports.ts +2 -31
- package/src/index.ts +17 -24
- package/src/loader.ts +2 -16
- package/src/node.ts +2 -11
- package/src/prefab/collector.ts +1 -22
- package/src/prefab/crud.ts +37 -76
- package/src/prefab/mirror.ts +4 -44
- package/src/prefab/prefab.ts +2 -21
- package/src/prefab/presenter.ts +2 -36
- package/src/prefab/repository.ts +7 -83
- package/src/scan/adapters.ts +32 -0
- package/src/scan/bundling.ts +1 -12
- package/src/scan/conventions.ts +6 -40
- package/src/scan/emit.ts +4 -38
- package/src/scan/handler-parser.ts +27 -96
- package/src/scan/result.ts +3 -16
- package/src/scan/scanner.ts +27 -126
- package/src/scan/statement.ts +4 -30
- package/src/source.ts +44 -0
- package/src/storage.ts +14 -234
- package/src/store.ts +152 -0
- package/src/verify.ts +16 -57
- package/src/wire/CallLog.ts +30 -0
- package/src/{contract → wire}/Invocation.ts +24 -17
- package/src/{contract → wire}/RouteAddress.ts +7 -0
- package/src/wire/binding.ts +9 -25
- package/src/wire/call.ts +30 -133
- package/src/wire/drift.ts +5 -30
- package/src/wire/errors.ts +4 -24
- package/src/wire/http-error.ts +5 -19
- package/src/wire/loggerMiddleware.ts +2 -8
- package/src/wire/middleware.ts +3 -7
- package/src/wire/operation.ts +8 -48
- package/src/wire/signature.ts +4 -25
- package/dist/boot/HandlerFacade.d.ts.map +0 -1
- package/dist/boot/HandlerFacade.js.map +0 -1
- package/dist/builtins/config.d.ts +0 -13
- package/dist/builtins/config.d.ts.map +0 -1
- package/dist/builtins/config.js +0 -21
- package/dist/builtins/config.js.map +0 -1
- package/dist/builtins/logger.d.ts.map +0 -1
- package/dist/builtins/logger.js.map +0 -1
- package/dist/contract/Call.d.ts +0 -10
- package/dist/contract/Call.d.ts.map +0 -1
- package/dist/contract/Call.js +0 -15
- package/dist/contract/Call.js.map +0 -1
- package/dist/contract/CallLog.d.ts +0 -57
- package/dist/contract/CallLog.d.ts.map +0 -1
- package/dist/contract/Invocation.d.ts +0 -27
- package/dist/contract/Invocation.d.ts.map +0 -1
- package/dist/contract/Invocation.js +0 -59
- package/dist/contract/Invocation.js.map +0 -1
- package/dist/contract/RouteAddress.d.ts.map +0 -1
- package/dist/contract/RouteAddress.js.map +0 -1
- package/dist/dispatch/InputValidator.d.ts +0 -7
- package/dist/dispatch/InputValidator.d.ts.map +0 -1
- package/dist/dispatch/InputValidator.js +0 -22
- package/dist/dispatch/InputValidator.js.map +0 -1
- package/dist/dispatch/OperationExecutor.d.ts +0 -25
- package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
- package/dist/dispatch/OperationExecutor.js +0 -32
- package/dist/dispatch/OperationExecutor.js.map +0 -1
- package/dist/dispatch/OutputProjector.d.ts +0 -12
- package/dist/dispatch/OutputProjector.d.ts.map +0 -1
- package/dist/dispatch/OutputProjector.js +0 -30
- package/dist/dispatch/OutputProjector.js.map +0 -1
- package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
- package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
- package/dist/dispatch/PresenterArgumentResolver.js +0 -20
- package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
- package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
- package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
- package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
- package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
- package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
- package/dist/dispatch/RouteNotFoundError.js +0 -24
- package/dist/dispatch/RouteNotFoundError.js.map +0 -1
- package/dist/entry/DynamicFacade.d.ts +0 -10
- package/dist/entry/DynamicFacade.d.ts.map +0 -1
- package/dist/entry/DynamicFacade.js +0 -27
- package/dist/entry/DynamicFacade.js.map +0 -1
- package/dist/entry/FacadeEntry.d.ts +0 -11
- package/dist/entry/FacadeEntry.d.ts.map +0 -1
- package/dist/entry/FacadeEntry.js +0 -26
- package/dist/entry/FacadeEntry.js.map +0 -1
- package/dist/entry/TransportEntry.d.ts +0 -13
- package/dist/entry/TransportEntry.d.ts.map +0 -1
- package/dist/entry/TransportEntry.js +0 -24
- package/dist/entry/TransportEntry.js.map +0 -1
- package/dist/rows.d.ts +0 -40
- package/dist/rows.d.ts.map +0 -1
- package/dist/rows.js +0 -146
- package/dist/rows.js.map +0 -1
- package/src/boot/HandlerFacade.ts +0 -242
- package/src/contract/Call.ts +0 -18
- package/src/contract/CallLog.ts +0 -55
- package/src/dispatch/InputValidator.ts +0 -28
- package/src/dispatch/OperationExecutor.ts +0 -60
- package/src/dispatch/OutputProjector.ts +0 -32
- package/src/dispatch/PresenterArgumentResolver.ts +0 -25
- package/src/dispatch/RouteNotFoundError.ts +0 -29
- package/src/entry/DynamicFacade.ts +0 -28
- package/src/entry/FacadeEntry.ts +0 -32
- package/src/entry/TransportEntry.ts +0 -30
- package/src/rows.ts +0 -155
- /package/dist/{contract → wire}/CallLog.js +0 -0
package/dist/boot/remote.d.ts
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Remote façade — what resolve() falls back to.
|
|
3
|
-
*
|
|
4
|
-
* When a handler isn't hosted locally and remotes are declared, resolve()
|
|
5
|
-
* returns a façade-shaped stand-in: same call surface as a local facade,
|
|
6
|
-
* every operation executed through a Transport. Routing is lazy — on the
|
|
7
|
-
* first miss, each declared remote is asked what it hosts (rpc.discover)
|
|
8
|
-
* and the answer is cached. A remote that can't be reached stays pending
|
|
9
|
-
* and is retried on the next miss instead of being cached as absent.
|
|
10
|
-
*/
|
|
1
|
+
/** Remote façade — what resolve() falls back to. */
|
|
11
2
|
import type { Transport } from '../wire/call.js';
|
|
12
3
|
import { type AppMiddleware } from '../wire/middleware.js';
|
|
13
|
-
import { type InvocationContext } from '../
|
|
4
|
+
import { type InvocationContext } from '../wire/Invocation.js';
|
|
14
5
|
import { type SchemaView } from '@fougere/schema';
|
|
15
6
|
interface Route {
|
|
16
7
|
frond: string;
|
|
17
8
|
transport: Transport;
|
|
18
9
|
/**
|
|
19
|
-
* The entity's schema, rebuilt from the identity card — the same
|
|
20
|
-
* `
|
|
21
|
-
* included. Reconstructed once per entity, at discovery time.
|
|
22
|
-
*
|
|
23
|
-
* **Absent when the door stores nothing.** A handler may carry no entity, so the card
|
|
24
|
-
* publishes it with ops and no shape; there is nothing to rebuild and pretending
|
|
25
|
-
* otherwise would hand callers an empty schema that validates everything.
|
|
10
|
+
* The entity's schema, rebuilt from the identity card — the same `SchemaConstructor` shape
|
|
11
|
+
* `entity({...})` produces, live validation included.
|
|
26
12
|
*/
|
|
27
13
|
schema?: SchemaView;
|
|
28
14
|
}
|
|
@@ -31,26 +17,7 @@ export interface RemoteRouter {
|
|
|
31
17
|
}
|
|
32
18
|
export declare function createRemoteRouter(remotes: Record<string, string>, makeTransport: (url: string) => Transport): RemoteRouter;
|
|
33
19
|
type Facade = Record<string, (invocation?: InvocationContext) => Promise<unknown>>;
|
|
34
|
-
/**
|
|
35
|
-
* Façade-shaped stand-in — the consumer can't tell it from a local facade.
|
|
36
|
-
*
|
|
37
|
-
* Every trap answers the same question, and that is the point: the runner asks
|
|
38
|
-
* `Object.hasOwn(facade, op)` before calling, so a proxy that only trapped `get`
|
|
39
|
-
* reported *no* operations and every split call came back `Unknown operation` —
|
|
40
|
-
* `get` said yes, `hasOwn` said no, and the runner believed `hasOwn`.
|
|
41
|
-
*
|
|
42
|
-
* The stand-in claims every legal op name because it cannot know better: routing is
|
|
43
|
-
* lazy on purpose (the card is fetched at the first miss), and the remote is the
|
|
44
|
-
* authority on its own surface anyway. An op it does not serve comes back as its
|
|
45
|
-
* NOT_FOUND — judged where it is owned, which is the same answer a local façade gives.
|
|
46
|
-
*
|
|
47
|
-
* It runs the app's middlewares, like `HandlerFacade` does, because "the consumer can't
|
|
48
|
-
* tell it from a local facade" was false of the one thing a consumer installs: measured,
|
|
49
|
-
* `runMiddlewares` had a single caller, so a frond that moved lost every middleware on
|
|
50
|
-
* the calling side — no log, no retry, no cache — from a `remotes:` line alone.
|
|
51
|
-
* The invocation the transport sends is the one the chain leaves behind, so a middleware
|
|
52
|
-
* can still put something on the wire.
|
|
53
|
-
*/
|
|
20
|
+
/** Façade-shaped stand-in — the consumer can't tell it from a local facade. */
|
|
54
21
|
export declare function createRemoteFacade(entity: string, router: RemoteRouter, middlewaresFor: (address: string) => AppMiddleware[]): Facade;
|
|
55
22
|
export {};
|
|
56
23
|
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAkB,KAAK,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAQ,KAAK,UAAU,EAAyB,MAAM,iBAAiB,CAAC;AAG/E,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACvC;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,GACxC,YAAY,CAoFd;AAED,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnF,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,EAAE,GACnD,MAAM,CAYR"}
|
package/dist/boot/remote.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assertIdentityCard, RPC_ENTITY } from '../wire/call.js';
|
|
2
2
|
import { runMiddlewares } from '../wire/middleware.js';
|
|
3
|
-
import { EMPTY_INVOCATION } from '../
|
|
3
|
+
import { EMPTY_INVOCATION } from '../wire/Invocation.js';
|
|
4
4
|
import { FougereError, ErrorCode } from '../wire/errors.js';
|
|
5
5
|
import { Card } from '@fougere/schema';
|
|
6
|
-
import {
|
|
6
|
+
import { dynamicOperations } from '../entry/facade.js';
|
|
7
7
|
export function createRemoteRouter(remotes, makeTransport) {
|
|
8
8
|
const byEntity = new Map();
|
|
9
9
|
// The remotes config key is a label for the address — the identity card is
|
|
@@ -41,26 +41,12 @@ export function createRemoteRouter(remotes, makeTransport) {
|
|
|
41
41
|
// adding one here would answer a call with a transport to a door that
|
|
42
42
|
// does not exist.
|
|
43
43
|
for (const door of frond.doors) {
|
|
44
|
-
const
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
* `byEntity` is keyed by the door name alone, so the second claim used to be
|
|
49
|
-
* dropped with `if (!byEntity.has(...))` — no warning, and the winner was
|
|
50
|
-
* whichever remote answered first. The local boot already refuses the same
|
|
51
|
-
* collision (`assertOneOwnerPerKey`) and it refused the OTHER duplicate: in
|
|
52
|
-
* process the last frond loaded won, here the first discovered did. One
|
|
53
|
-
* application, two topologies, two different handlers answering — which is
|
|
54
|
-
* precisely the gradient not holding.
|
|
55
|
-
*
|
|
56
|
-
* Refusing is the honest answer while a call names an entity and not a frond.
|
|
57
|
-
* `FrondCall` already carries an optional `frond`; the day it is required, this
|
|
58
|
-
* becomes a disambiguation instead of a refusal.
|
|
59
|
-
*/
|
|
60
|
-
if (held !== undefined && held !== label) {
|
|
44
|
+
const first = claimedBy.get(door.name);
|
|
45
|
+
/** Two remotes claiming one name is refused, not silently arbitrated. */
|
|
46
|
+
if (first !== undefined && first !== label) {
|
|
61
47
|
throw new FougereError({
|
|
62
48
|
code: ErrorCode.INTERNAL_ERROR,
|
|
63
|
-
message: `Two remotes serve '${door.name}': '${
|
|
49
|
+
message: `Two remotes serve '${door.name}': '${first}' and '${label}'.\n`
|
|
64
50
|
+ ` A call names an entity, not a frond, so nothing could choose between them.\n`
|
|
65
51
|
+ ` - Keep one of the two out of \`remotes:\`, or\n`
|
|
66
52
|
+ ` - expose one of them under a different entity name.`,
|
|
@@ -99,26 +85,7 @@ export function createRemoteRouter(remotes, makeTransport) {
|
|
|
99
85
|
},
|
|
100
86
|
};
|
|
101
87
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Façade-shaped stand-in — the consumer can't tell it from a local facade.
|
|
104
|
-
*
|
|
105
|
-
* Every trap answers the same question, and that is the point: the runner asks
|
|
106
|
-
* `Object.hasOwn(facade, op)` before calling, so a proxy that only trapped `get`
|
|
107
|
-
* reported *no* operations and every split call came back `Unknown operation` —
|
|
108
|
-
* `get` said yes, `hasOwn` said no, and the runner believed `hasOwn`.
|
|
109
|
-
*
|
|
110
|
-
* The stand-in claims every legal op name because it cannot know better: routing is
|
|
111
|
-
* lazy on purpose (the card is fetched at the first miss), and the remote is the
|
|
112
|
-
* authority on its own surface anyway. An op it does not serve comes back as its
|
|
113
|
-
* NOT_FOUND — judged where it is owned, which is the same answer a local façade gives.
|
|
114
|
-
*
|
|
115
|
-
* It runs the app's middlewares, like `HandlerFacade` does, because "the consumer can't
|
|
116
|
-
* tell it from a local facade" was false of the one thing a consumer installs: measured,
|
|
117
|
-
* `runMiddlewares` had a single caller, so a frond that moved lost every middleware on
|
|
118
|
-
* the calling side — no log, no retry, no cache — from a `remotes:` line alone.
|
|
119
|
-
* The invocation the transport sends is the one the chain leaves behind, so a middleware
|
|
120
|
-
* can still put something on the wire.
|
|
121
|
-
*/
|
|
88
|
+
/** Façade-shaped stand-in — the consumer can't tell it from a local facade. */
|
|
122
89
|
export function createRemoteFacade(entity, router, middlewaresFor) {
|
|
123
90
|
const opFn = (op) => async (invocation = EMPTY_INVOCATION) => {
|
|
124
91
|
const { frond, transport } = await router.route(entity);
|
|
@@ -128,6 +95,6 @@ export function createRemoteFacade(entity, router, middlewaresFor) {
|
|
|
128
95
|
};
|
|
129
96
|
return runMiddlewares(middlewaresFor(entity), ctx, () => transport(call, ctx.invocation ?? invocation));
|
|
130
97
|
};
|
|
131
|
-
return
|
|
98
|
+
return dynamicOperations(opFn);
|
|
132
99
|
}
|
|
133
100
|
//# sourceMappingURL=remote.js.map
|
package/dist/boot/remote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAA6C,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAA0B,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAA0C,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgBvD,MAAM,UAAU,kBAAkB,CAChC,OAA+B,EAC/B,aAAyC;IAEzC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAiB,CAAC;IAC1C,2EAA2E;IAC3E,8CAA8C;IAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAqB,CAAC;IAEhD,qFAAqF;IACrF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5C,MAAM,QAAQ,GAAG,KAAK,IAAmB,EAAE;QACzC,sFAAsF;QACtF,mFAAmF;QACnF,6EAA6E;QAC7E,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE;YACtC,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,SAAS,CAAC,SAAS;gBACzB,OAAO,EAAE,6BAA6B,MAAM,GAAG;gBAC/C,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAID,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,MAAoB,EACpB,cAAoD;IAEpD,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,KAAK,EAAE,aAAgC,gBAAgB,EAAE,EAAE;QACtF,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACxD,MAAM,IAAI,GAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAqB;YAC5B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU;SAC5E,CAAC;QACF,OAAO,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CACtD,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;IAEF,OAAO,iBAAiB,CAAC,IAAI,CAAW,CAAC;AAC3C,CAAC"}
|
package/dist/boot/runner.d.ts
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A Transport built from an app — the two ways a call enters this process.
|
|
3
|
-
*
|
|
4
|
-
* `Transport` is `wire/`'s shape; making one needs an App and the transport entry.
|
|
5
|
-
*/
|
|
1
|
+
/** A Transport built from an app — the two ways a call enters this process. */
|
|
6
2
|
import type { App } from './types.js';
|
|
7
3
|
import type { Transport } from '../wire/call.js';
|
|
8
|
-
/**
|
|
9
|
-
* Build the local runner — the reference realization of Transport.
|
|
10
|
-
*
|
|
11
|
-
* Resolves strictly from the app's own container: a call that lands here is
|
|
12
|
-
* judged here. A miss is a typed NOT_FOUND, never a forward to another remote.
|
|
13
|
-
*/
|
|
4
|
+
/** Build the local runner — the reference realization of Transport. */
|
|
14
5
|
export declare function createLocalRunner(app: App, surface?: string): Transport;
|
|
15
6
|
/**
|
|
16
|
-
* Build the app runner — same
|
|
17
|
-
*
|
|
18
|
-
* an app's own entry points (browser endpoint, bridges) stand on.
|
|
19
|
-
*
|
|
20
|
-
* `surface` is the audience this runner serves, and it belongs to the DOOR that
|
|
21
|
-
* builds the runner, never to the call: a caller cannot name its own audience
|
|
22
|
-
* any more than it can name its own identity (`state` is stamped server-side
|
|
23
|
-
* for the same reason). Reaching the admin door IS the proof. So `FrondCall`
|
|
24
|
-
* gains nothing and the wire format gains nothing — a remote frond's audience
|
|
25
|
-
* is simply which URL `remotes:` points at.
|
|
7
|
+
* Build the app runner — same verdict, but resolution follows the app's topology: local façades
|
|
8
|
+
* and remote doublures alike.
|
|
26
9
|
*/
|
|
27
10
|
export declare function createAppRunner(app: App, surface?: string): Transport;
|
|
28
11
|
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/boot/runner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/boot/runner.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAEvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAErE"}
|
package/dist/boot/runner.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import { createTransportEntry } from '../entry/
|
|
2
|
-
/**
|
|
3
|
-
* Build the local runner — the reference realization of Transport.
|
|
4
|
-
*
|
|
5
|
-
* Resolves strictly from the app's own container: a call that lands here is
|
|
6
|
-
* judged here. A miss is a typed NOT_FOUND, never a forward to another remote.
|
|
7
|
-
*/
|
|
1
|
+
import { createTransportEntry } from '../entry/transport.js';
|
|
2
|
+
/** Build the local runner — the reference realization of Transport. */
|
|
8
3
|
export function createLocalRunner(app, surface) {
|
|
9
4
|
return createTransportEntry(app.local, surface);
|
|
10
5
|
}
|
|
11
6
|
/**
|
|
12
|
-
* Build the app runner — same
|
|
13
|
-
*
|
|
14
|
-
* an app's own entry points (browser endpoint, bridges) stand on.
|
|
15
|
-
*
|
|
16
|
-
* `surface` is the audience this runner serves, and it belongs to the DOOR that
|
|
17
|
-
* builds the runner, never to the call: a caller cannot name its own audience
|
|
18
|
-
* any more than it can name its own identity (`state` is stamped server-side
|
|
19
|
-
* for the same reason). Reaching the admin door IS the proof. So `FrondCall`
|
|
20
|
-
* gains nothing and the wire format gains nothing — a remote frond's audience
|
|
21
|
-
* is simply which URL `remotes:` points at.
|
|
7
|
+
* Build the app runner — same verdict, but resolution follows the app's topology: local façades
|
|
8
|
+
* and remote doublures alike.
|
|
22
9
|
*/
|
|
23
10
|
export function createAppRunner(app, surface) {
|
|
24
11
|
return createTransportEntry(app, surface);
|
package/dist/boot/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/boot/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/boot/runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAAC,GAAQ,EAAE,OAAgB;IAC1D,OAAO,oBAAoB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAAQ,EAAE,OAAgB;IACxD,OAAO,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/boot/seed.d.ts
CHANGED
|
@@ -1,40 +1,13 @@
|
|
|
1
1
|
import type { FrondDescriptor, SeedEntry } from '../descriptor/frond.js';
|
|
2
2
|
import type { App } from './types.js';
|
|
3
3
|
import type { Extension } from './AppLifecycle.js';
|
|
4
|
-
/**
|
|
5
|
-
* Seeds in dependency order — a `ref()` target is planted before its referrer.
|
|
6
|
-
*
|
|
7
|
-
* The order is a fact about the entity graph, not about the surface running the seeds,
|
|
8
|
-
* so it is stated once here. The Nuxt module read it off a pairwise comparator (which
|
|
9
|
-
* `Array.sort` cannot make transitive: `a` before `b` and `b` before `c` never implies
|
|
10
|
-
* `a` before `c`), and `boot()` had no order at all — the same fact, told twice and
|
|
11
|
-
* wrong both times. A list seeded before its owner failed on the foreign key, and the
|
|
12
|
-
* driver's error named neither the entity nor the file.
|
|
13
|
-
*
|
|
14
|
-
* Kahn, like `orderTables` in `@fougere/adapter-sql` — the same shape one level up: there
|
|
15
|
-
* the nodes are tables and the edges FK columns, here they are seeds and the edges the
|
|
16
|
-
* `one` relations of the entities they target. A cycle cannot be satisfied by ordering,
|
|
17
|
-
* so its remaining seeds keep their scan order and land last: the driver refuses what is
|
|
18
|
-
* genuinely impossible, and everything acyclic around it still gets planted.
|
|
19
|
-
*/
|
|
4
|
+
/** Seeds in dependency order — a `ref()` target is planted before its referrer. */
|
|
20
5
|
export declare function orderSeeds(fronds: FrondDescriptor[]): SeedEntry[];
|
|
21
|
-
/**
|
|
22
|
-
* Plant a set of seeds, in the order given. Reports what it did, one line per entity.
|
|
23
|
-
*
|
|
24
|
-
* The one seeding loop. `boot()` had one and the Nuxt module generated a second into its
|
|
25
|
-
* Nitro plugin, which had drifted: no storage fallback, so an entity with no façade was
|
|
26
|
-
* skipped there and planted here. Two answers to "how does a row get in at boot" is one
|
|
27
|
-
* too many, and the second was the one running in the browser.
|
|
28
|
-
*/
|
|
6
|
+
/** Plant a set of seeds, in the order given. */
|
|
29
7
|
export declare function runSeeds(app: App, seeds: SeedEntry[], report?: (message: string) => void): Promise<void>;
|
|
30
8
|
/**
|
|
31
|
-
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* That is what Nuxt's Nitro plugin had to do: a bundler needs its seed modules spelled out
|
|
35
|
-
* as static imports, so the plugin claimed everything after the boot and its copy of the
|
|
36
|
-
* loop drifted. It now declares an extension under this same name instead, and the delta
|
|
37
|
-
* is one member of a list.
|
|
9
|
+
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take over the
|
|
10
|
+
* whole post-boot to get its own.
|
|
38
11
|
*/
|
|
39
12
|
export declare function seeding(report?: (message: string) => void): Extension;
|
|
40
13
|
//# sourceMappingURL=seed.d.ts.map
|
package/dist/boot/seed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAe,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAe,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,EAAE,CAyCjE;AAQD,gDAAgD;AAChD,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,GAC3C,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAsBD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAQrE"}
|
package/dist/boot/seed.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { Role } from '@fougere/schema';
|
|
2
2
|
import { facadeKeyOf } from '../wire/call.js';
|
|
3
|
-
/**
|
|
4
|
-
* Seeds in dependency order — a `ref()` target is planted before its referrer.
|
|
5
|
-
*
|
|
6
|
-
* The order is a fact about the entity graph, not about the surface running the seeds,
|
|
7
|
-
* so it is stated once here. The Nuxt module read it off a pairwise comparator (which
|
|
8
|
-
* `Array.sort` cannot make transitive: `a` before `b` and `b` before `c` never implies
|
|
9
|
-
* `a` before `c`), and `boot()` had no order at all — the same fact, told twice and
|
|
10
|
-
* wrong both times. A list seeded before its owner failed on the foreign key, and the
|
|
11
|
-
* driver's error named neither the entity nor the file.
|
|
12
|
-
*
|
|
13
|
-
* Kahn, like `orderTables` in `@fougere/adapter-sql` — the same shape one level up: there
|
|
14
|
-
* the nodes are tables and the edges FK columns, here they are seeds and the edges the
|
|
15
|
-
* `one` relations of the entities they target. A cycle cannot be satisfied by ordering,
|
|
16
|
-
* so its remaining seeds keep their scan order and land last: the driver refuses what is
|
|
17
|
-
* genuinely impossible, and everything acyclic around it still gets planted.
|
|
18
|
-
*/
|
|
3
|
+
/** Seeds in dependency order — a `ref()` target is planted before its referrer. */
|
|
19
4
|
export function orderSeeds(fronds) {
|
|
20
5
|
const refs = new Map();
|
|
21
6
|
for (const frond of fronds) {
|
|
@@ -52,14 +37,7 @@ export function orderSeeds(fronds) {
|
|
|
52
37
|
}
|
|
53
38
|
return [...ordered, ...waiting.keys()];
|
|
54
39
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Plant a set of seeds, in the order given. Reports what it did, one line per entity.
|
|
57
|
-
*
|
|
58
|
-
* The one seeding loop. `boot()` had one and the Nuxt module generated a second into its
|
|
59
|
-
* Nitro plugin, which had drifted: no storage fallback, so an entity with no façade was
|
|
60
|
-
* skipped there and planted here. Two answers to "how does a row get in at boot" is one
|
|
61
|
-
* too many, and the second was the one running in the browser.
|
|
62
|
-
*/
|
|
40
|
+
/** Plant a set of seeds, in the order given. */
|
|
63
41
|
export async function runSeeds(app, seeds, report = () => { }) {
|
|
64
42
|
for (const seed of seeds) {
|
|
65
43
|
const resolve = (name) => app.resolve(name + 'Handler');
|
|
@@ -87,11 +65,7 @@ export async function runSeeds(app, seeds, report = () => { }) {
|
|
|
87
65
|
report(` ${seed.entityName}: ${data.length} records`);
|
|
88
66
|
}
|
|
89
67
|
}
|
|
90
|
-
/**
|
|
91
|
-
* A seed is not a client: it writes at boot, from inside. The façade is used when the
|
|
92
|
-
* entity declares one (its judge catches a bad seed early), the storage when it does
|
|
93
|
-
* not — an entity that exposes nothing is still an entity whose reference rows must land.
|
|
94
|
-
*/
|
|
68
|
+
/** A seed is not a client. */
|
|
95
69
|
function doorFor(app, entityName) {
|
|
96
70
|
let handler;
|
|
97
71
|
try {
|
|
@@ -101,7 +75,7 @@ function doorFor(app, entityName) {
|
|
|
101
75
|
if (typeof handler?.list === 'function' && typeof handler.create === 'function') {
|
|
102
76
|
return {
|
|
103
77
|
list: () => handler.list(),
|
|
104
|
-
write: (item) => handler.create({ params: {}, query: {},
|
|
78
|
+
write: (item) => handler.create({ params: {}, query: {}, input: item, state: {} }),
|
|
105
79
|
};
|
|
106
80
|
}
|
|
107
81
|
const storage = app.storageFor(entityName);
|
|
@@ -110,13 +84,8 @@ function doorFor(app, entityName) {
|
|
|
110
84
|
return { list: () => storage.list(), write: (item) => storage.create(item) };
|
|
111
85
|
}
|
|
112
86
|
/**
|
|
113
|
-
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* That is what Nuxt's Nitro plugin had to do: a bundler needs its seed modules spelled out
|
|
117
|
-
* as static imports, so the plugin claimed everything after the boot and its copy of the
|
|
118
|
-
* loop drifted. It now declares an extension under this same name instead, and the delta
|
|
119
|
-
* is one member of a list.
|
|
87
|
+
* The framework's own ascent for rows, named — so a host can REPLACE it rather than take over the
|
|
88
|
+
* whole post-boot to get its own.
|
|
120
89
|
*/
|
|
121
90
|
export function seeding(report) {
|
|
122
91
|
return {
|
package/dist/boot/seed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/boot/seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,MAAyB;IAClD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC5C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;YAClC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAA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,GAAG,EAAE,CAAC,OAAQ,CAAC,IAAI,EAAwB;YACjD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;SACpF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,UAAU,CAE5B,CAAC;IACd,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,MAAkC;IACxD,OAAO;QACL,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,KAAK,EAAE,GAAQ,EAAE,EAAE;YACrB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where a STATED contract and the signature it is about have stopped agreeing.
|
|
3
|
-
*
|
|
4
|
-
* `frond.config.ts` states an operation's contract and wins over the scan — that order is
|
|
5
|
-
* deliberate, and it is the only answer for a method inherited from an installed base class
|
|
6
|
-
* the workspace scan cannot see. But winning silently is how a statement made about
|
|
7
|
-
* `publish(id: string)` keeps applying after the parameter was renamed to `postId`: the
|
|
8
|
-
* façade binds what the config said, the method receives `undefined`, and nothing anywhere
|
|
9
|
-
* says the two disagree.
|
|
10
|
-
*
|
|
11
|
-
* So this compares, and only where BOTH exist — a statement about a signature the scan
|
|
12
|
-
* never read is not drift, it is the case config was built for. It is a `warning` and not
|
|
13
|
-
* a refusal: the statement is still the author's word, and a boot that ran yesterday must
|
|
14
|
-
* not stop running because a parameter moved. What it must not do is stay quiet.
|
|
15
|
-
*/
|
|
1
|
+
/** Where a STATED contract and the signature it is about have stopped agreeing. */
|
|
16
2
|
import type { FrondDescriptor, HandlerEntry } from '../descriptor/frond.js';
|
|
17
3
|
import type { ScanDiagnostic } from '../scan/result.js';
|
|
18
|
-
/**
|
|
19
|
-
* What a frond's stated contracts no longer match.
|
|
20
|
-
*
|
|
21
|
-
* Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
|
|
22
|
-
* boot — one comparison, two readers, no second opinion to drift on its own.
|
|
23
|
-
*/
|
|
4
|
+
/** What a frond's stated contracts no longer match. */
|
|
24
5
|
export declare function statementDrift(frond: FrondDescriptor, handler: HandlerEntry): ScanDiagnostic[];
|
|
25
6
|
//# sourceMappingURL=statement-drift.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statement-drift.d.ts","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"statement-drift.d.ts","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAWxD,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,EAAE,CA2B9F"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
/** The parameters a
|
|
2
|
-
function namesDisagreeing(
|
|
1
|
+
/** The parameters a binding plan names, against the ones the method declares. */
|
|
2
|
+
function namesDisagreeing(plan, signature) {
|
|
3
3
|
const declared = new Set(signature.params.map((p) => p.name));
|
|
4
|
-
return
|
|
4
|
+
return plan.map((b) => b.name).filter((name) => !declared.has(name));
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* What a frond's stated contracts no longer match.
|
|
8
|
-
*
|
|
9
|
-
* Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
|
|
10
|
-
* boot — one comparison, two readers, no second opinion to drift on its own.
|
|
11
|
-
*/
|
|
6
|
+
/** What a frond's stated contracts no longer match. */
|
|
12
7
|
export function statementDrift(frond, handler) {
|
|
13
8
|
const found = [];
|
|
14
9
|
for (const [name, override] of Object.entries(frond.operationsOverrides ?? {})) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statement-drift.js","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statement-drift.js","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,SAAS,gBAAgB,CAAC,IAAiB,EAAE,SAAoB;IAC/D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,cAAc,CAAC,KAAsB,EAAE,OAAqB;IAC1E,MAAM,KAAK,GAAqB,EAAE,CAAC;IAEnC,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,EAAE,CAAC;QAC/E,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,SAAS;QAEhC,qFAAqF;QACrF,oFAAoF;QACpF,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;QAC1D,IAAI,CAAC,SAAS;YAAE,SAAS;QAEzB,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEnC,KAAK,CAAC,IAAI,CAAC;YACT,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;YACvC,OAAO,EAAE,yBAAyB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;kBAC7E,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,qBAAqB,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;kBACtH,0DAA0D;SAC/D,CAAC,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/boot/together.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SchemaView } from '@fougere/schema';
|
|
2
2
|
import type { Container } from '@fougere/container';
|
|
3
3
|
import { type StorageFactory } from '../storage.js';
|
|
4
|
-
import type { Logger } from '../
|
|
4
|
+
import type { Logger } from '../builtin/logger.js';
|
|
5
5
|
import type { ProviderEntry } from '../descriptor/frond.js';
|
|
6
6
|
/** Everything the boot knows that a frame needs, gathered once for every frond. */
|
|
7
7
|
export interface FrameWorld {
|
|
@@ -12,15 +12,11 @@ export interface FrameWorld {
|
|
|
12
12
|
hostedHere: (frond: string) => boolean;
|
|
13
13
|
storageFactory?: StorageFactory;
|
|
14
14
|
sourceOf?: (entityName: string) => string;
|
|
15
|
+
/** Whether that source hands one out — asked before the frame is built, not at the call. */
|
|
16
|
+
transacts?: (source: string) => boolean;
|
|
15
17
|
transacted?: <R>(source: string, fn: (storageFactory: StorageFactory) => Promise<R>) => Promise<R>;
|
|
16
18
|
log: Logger;
|
|
17
19
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Register one frame per key a handler or provider of this frond asked for.
|
|
20
|
-
*
|
|
21
|
-
* Called with the frond's scope, because that is where the asking constructor resolves —
|
|
22
|
-
* while the MEMBERS are looked up app-wide, a frame crossing fronds being the ordinary case
|
|
23
|
-
* rather than the exception (the frond is not the storage boundary; `sources:` is).
|
|
24
|
-
*/
|
|
20
|
+
/** Register one frame per key a handler or provider of this frond asked for. */
|
|
25
21
|
export declare function registerFrames(scope: Container, keys: Iterable<string>, providers: readonly ProviderEntry[], world: FrameWorld): void;
|
|
26
22
|
//# sourceMappingURL=together.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"together.d.ts","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"together.d.ts","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAwE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC1H,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,kFAAkF;IAClF,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,4FAA4F;IAC5F,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACnG,GAAG,EAAE,MAAM,CAAC;CACb;AA6FD,gFAAgF;AAChF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EACtB,SAAS,EAAE,SAAS,aAAa,EAAE,EACnC,KAAK,EAAE,UAAU,GAChB,IAAI,CA0DN"}
|
package/dist/boot/together.js
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Building a frame — what a handler asking for `Together<[…]>` receives.
|
|
3
|
-
*
|
|
4
|
-
* The declaration names its members and nothing else; where they live, and therefore
|
|
5
|
-
* which of the two realizations they get, is read HERE and stated at boot. A frame whose
|
|
6
|
-
* members share an engine is a transaction; one whose members are split replays its own
|
|
7
|
-
* inverses (`frame.ts`). Same user code, two guarantees, and the boot says which — the
|
|
8
|
-
* one thing a gradient must never leave to assumption.
|
|
9
|
-
*/
|
|
1
|
+
/** Building a frame — what a handler asking for `Together<[…]>` receives. */
|
|
10
2
|
import { ambient } from '#ambient';
|
|
11
3
|
import { upperFirst, lowerFirst } from '@fougere/schema';
|
|
12
4
|
import { membersOfTogetherKey, storageKeyOf, entityOfStorageKey } from '../storage.js';
|
|
13
5
|
import { StorageGuard } from '../dispatch/StorageGuard.js';
|
|
14
6
|
import { recording, unwind } from './frame.js';
|
|
15
|
-
/**
|
|
16
|
-
* Each declared name, resolved to what it designates.
|
|
17
|
-
*
|
|
18
|
-
* A name that resolves to nothing is refused rather than skipped: `Together<[Account,
|
|
19
|
-
* Ledgre]>` is a typo whose only other symptom is a frame quietly one member short. The
|
|
20
|
-
* two lists are checked against different registries, which is exactly why the declaration
|
|
21
|
-
* separates them — nothing here has to guess what kind a name is.
|
|
22
|
-
*/
|
|
7
|
+
/** Each declared name, resolved to what it designates. */
|
|
23
8
|
function resolve(names, declared, world) {
|
|
24
9
|
const entities = names.entities.map((member) => {
|
|
25
10
|
const name = lowerFirst(member);
|
|
@@ -41,12 +26,7 @@ function resolve(names, declared, world) {
|
|
|
41
26
|
});
|
|
42
27
|
return { entities, providers };
|
|
43
28
|
}
|
|
44
|
-
/**
|
|
45
|
-
* A member that cannot write here at all — its frond is hosted elsewhere.
|
|
46
|
-
*
|
|
47
|
-
* Refused rather than compensated: a compensated frame still writes through a local storage,
|
|
48
|
-
* and a remote frond registers none. There is nothing to record and nothing to undo.
|
|
49
|
-
*/
|
|
29
|
+
/** A member that cannot write here at all — its frond is hosted elsewhere. */
|
|
50
30
|
function refuseRemote(members, world, key) {
|
|
51
31
|
for (const member of members.entities) {
|
|
52
32
|
const frond = world.frondOf.get(member.name);
|
|
@@ -57,12 +37,7 @@ function refuseRemote(members, world, key) {
|
|
|
57
37
|
}
|
|
58
38
|
}
|
|
59
39
|
}
|
|
60
|
-
/**
|
|
61
|
-
* A provider member writing an entity the frame does not name.
|
|
62
|
-
*
|
|
63
|
-
* The frame does not widen itself to cover it: doing so would pull an entity from another
|
|
64
|
-
* source into the group without anyone writing it down. Named instead, with the one-word fix.
|
|
65
|
-
*/
|
|
40
|
+
/** A provider member writing an entity the frame does not name. */
|
|
66
41
|
function refuseUncoveredWrites(members, key, world) {
|
|
67
42
|
const covered = new Set(members.entities.map((member) => member.name));
|
|
68
43
|
for (const provider of members.providers) {
|
|
@@ -76,13 +51,7 @@ function refuseUncoveredWrites(members, key, world) {
|
|
|
76
51
|
}
|
|
77
52
|
}
|
|
78
53
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Open the block: build every member over `factory`, in a scope of their own.
|
|
81
|
-
*
|
|
82
|
-
* The scope is what makes a provider member work without a locator — its storage keys are
|
|
83
|
-
* registered here, so the container hands it the framed ones through the ordinary
|
|
84
|
-
* constructor. It is disposed when the block ends, whichever way it ended.
|
|
85
|
-
*/
|
|
54
|
+
/** Open the block. */
|
|
86
55
|
async function inScope(parent, members, factory, wrap, fn) {
|
|
87
56
|
const scope = parent.createScope();
|
|
88
57
|
try {
|
|
@@ -102,13 +71,7 @@ async function inScope(parent, members, factory, wrap, fn) {
|
|
|
102
71
|
await scope.dispose();
|
|
103
72
|
}
|
|
104
73
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Register one frame per key a handler or provider of this frond asked for.
|
|
107
|
-
*
|
|
108
|
-
* Called with the frond's scope, because that is where the asking constructor resolves —
|
|
109
|
-
* while the MEMBERS are looked up app-wide, a frame crossing fronds being the ordinary case
|
|
110
|
-
* rather than the exception (the frond is not the storage boundary; `sources:` is).
|
|
111
|
-
*/
|
|
74
|
+
/** Register one frame per key a handler or provider of this frond asked for. */
|
|
112
75
|
export function registerFrames(scope, keys, providers, world) {
|
|
113
76
|
let registered = 0;
|
|
114
77
|
for (const key of new Set(keys)) {
|
|
@@ -123,18 +86,20 @@ export function registerFrames(scope, keys, providers, world) {
|
|
|
123
86
|
refuseRemote(members, world, key);
|
|
124
87
|
refuseUncoveredWrites(members, key, world);
|
|
125
88
|
const sources = new Set(members.entities.map((member) => world.sourceOf?.(member.name) ?? 'db'));
|
|
126
|
-
const
|
|
127
|
-
// One engine and a way into it: the engine gives the unwind AND the isolation.
|
|
128
|
-
|
|
129
|
-
|
|
89
|
+
const validator = (storage, name, schema) => new StorageGuard(schema.getFields(), name).guard(storage);
|
|
90
|
+
// One engine and a way into it: the engine gives the unwind AND the isolation. The
|
|
91
|
+
// question goes to the source these members live in — a composition answering for the
|
|
92
|
+
// default one would compensate a frame whose own engine holds transactions.
|
|
93
|
+
const source = sources.size === 1 ? [...sources][0] : undefined;
|
|
94
|
+
if (world.transacted && source !== undefined && (world.transacts?.(source) ?? true)) {
|
|
130
95
|
world.log.info(`${key} — transaction, source '${source}'`);
|
|
131
96
|
scope.registerValue(key, {
|
|
132
|
-
run: (fn) => ambient.enterFrame(key, () => world.transacted(source, (factory) => inScope(scope, members, factory,
|
|
97
|
+
run: (fn) => ambient.enterFrame(key, () => world.transacted(source, (factory) => inScope(scope, members, factory, validator, fn))),
|
|
133
98
|
});
|
|
134
99
|
continue;
|
|
135
100
|
}
|
|
136
101
|
// Split, or an engine that hands out no transaction: the frame keeps the before-image
|
|
137
|
-
// of every write and replays the inverses itself. `
|
|
102
|
+
// of every write and replays the inverses itself. `validator` stays OUTSIDE `recording`, so
|
|
138
103
|
// a write the entity refuses never enters the journal.
|
|
139
104
|
const why = sources.size > 1
|
|
140
105
|
? members.entities.map((m) => `${m.name} in '${world.sourceOf?.(m.name) ?? 'db'}'`).join(', ')
|
|
@@ -143,7 +108,7 @@ export function registerFrames(scope, keys, providers, world) {
|
|
|
143
108
|
scope.registerValue(key, {
|
|
144
109
|
run: (fn) => ambient.enterFrame(key, async () => {
|
|
145
110
|
const journal = [];
|
|
146
|
-
const record = (storage, name, schema) =>
|
|
111
|
+
const record = (storage, name, schema) => validator(recording(storage, name, schema, journal), name, schema);
|
|
147
112
|
try {
|
|
148
113
|
return await inScope(scope, members, world.storageFactory, record, fn);
|
|
149
114
|
}
|