@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
|
@@ -2,13 +2,7 @@
|
|
|
2
2
|
* Logger middleware — logs every operation with timing.
|
|
3
3
|
*/
|
|
4
4
|
import type { AppMiddleware } from './middleware.js';
|
|
5
|
-
import type { Logger } from '../
|
|
6
|
-
/**
|
|
7
|
-
* Create a logger middleware that logs operation entry, exit, and errors.
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* app.use(loggerMiddleware(app.resolve('Logger')))
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
5
|
+
import type { Logger } from '../builtin/logger.js';
|
|
6
|
+
/** Create a logger middleware that logs operation entry, exit, and errors. */
|
|
13
7
|
export declare function loggerMiddleware(logger: Logger): AppMiddleware;
|
|
14
8
|
//# sourceMappingURL=loggerMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loggerMiddleware.d.ts","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"loggerMiddleware.d.ts","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAe9D"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a logger middleware that logs operation entry, exit, and errors.
|
|
3
|
-
*
|
|
4
|
-
* ```ts
|
|
5
|
-
* app.use(loggerMiddleware(app.resolve('Logger')))
|
|
6
|
-
* ```
|
|
7
|
-
*/
|
|
1
|
+
/** Create a logger middleware that logs operation entry, exit, and errors. */
|
|
8
2
|
export function loggerMiddleware(logger) {
|
|
9
3
|
return async (ctx, next) => {
|
|
10
4
|
const start = performance.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loggerMiddleware.js","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"loggerMiddleware.js","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAMA,8EAA8E;AAC9E,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5B,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9D,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* App-level middleware — intercepts handler facade operations.
|
|
3
|
-
*
|
|
4
|
-
* Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
|
|
5
|
-
*/
|
|
1
|
+
/** App-level middleware — intercepts handler facade operations. */
|
|
6
2
|
export interface OperationContext {
|
|
7
3
|
/** Entity name (e.g. 'product'). */
|
|
8
4
|
entity: string;
|
|
@@ -17,8 +13,8 @@ export interface OperationContext {
|
|
|
17
13
|
args: unknown[];
|
|
18
14
|
/** Extensible bag — middlewares deposit data here (user, permissions, etc.). */
|
|
19
15
|
state: Record<string, unknown>;
|
|
20
|
-
/** Transport-agnostic invocation context (params, query,
|
|
21
|
-
invocation?: import('../
|
|
16
|
+
/** Transport-agnostic invocation context (params, query, input, state). */
|
|
17
|
+
invocation?: import('../wire/Invocation.js').InvocationContext;
|
|
22
18
|
}
|
|
23
19
|
export type AppNext = () => Promise<unknown>;
|
|
24
20
|
export type AppMiddleware = (ctx: OperationContext, next: AppNext) => Promise<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAGnE,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,uBAAuB,EAAE,iBAAiB,CAAC;CAChE;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIvF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,aAAa,EAAE,EAC5B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CASlB"}
|
package/dist/wire/middleware.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* App-level middleware — intercepts handler facade operations.
|
|
3
|
-
*
|
|
4
|
-
* Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
|
|
5
|
-
*/
|
|
1
|
+
/** App-level middleware — intercepts handler facade operations. */
|
|
6
2
|
// ── Runner ──────────────────────────────────────
|
|
7
3
|
/**
|
|
8
4
|
* Execute a middleware chain (onion model) then the handler.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAwBnE,mDAAmD;AAEnD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,WAA4B,EAC5B,GAAqB,EACrB,OAAgB;IAEhB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,GAAqB,EAAE;QAClC,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC;IACF,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC"}
|
package/dist/wire/operation.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { SchemaView } from '@fougere/schema';
|
|
2
2
|
import type { BindingPlan } from './binding.js';
|
|
3
3
|
import type { Signature, TypeRef, Param } from './signature.js';
|
|
4
|
-
/**
|
|
5
|
-
* The contract of one operation — everything the façade needs to serve a call.
|
|
6
|
-
*
|
|
7
|
-
* Produced two ways, indistinguishable once here: the scan DERIVES it from a
|
|
8
|
-
* method's parsed signature, a prefab handler DECLARES it outright. The façade
|
|
9
|
-
* consumes contracts and nothing else — it knows no operation by name, and a
|
|
10
|
-
* declared contract survives a scan that resolved nothing.
|
|
11
|
-
*/
|
|
4
|
+
/** The contract of one operation — everything the façade needs to serve a call. */
|
|
12
5
|
export interface OperationContract {
|
|
13
6
|
/** Judged on the way in. The view carries its own mode (`partial()` → patch). */
|
|
14
7
|
input?: SchemaView;
|
|
@@ -16,42 +9,14 @@ export interface OperationContract {
|
|
|
16
9
|
output?: SchemaView;
|
|
17
10
|
/** Where each argument is read from in the invocation. */
|
|
18
11
|
binding?: BindingPlan;
|
|
19
|
-
/**
|
|
20
|
-
* The operation in words, for a caller that meets it over the wire and has to
|
|
21
|
-
* choose. Same three producers as the rest: the scan derives it from the method's
|
|
22
|
-
* doc comment, a prefab declares it, config states it and wins.
|
|
23
|
-
*/
|
|
12
|
+
/** The operation in words, for a caller that meets it over the wire and has to choose. */
|
|
24
13
|
description?: string;
|
|
25
|
-
/**
|
|
26
|
-
* How MUCH comes back — the half of the return type that `output` cannot say.
|
|
27
|
-
*
|
|
28
|
-
* `output` is the shape of ONE row; it is silent on whether the op hands back one,
|
|
29
|
-
* several, or a page. The prefab knows (`list` returns a `ListResult`, `findById`
|
|
30
|
-
* returns `T | undefined`) and the card did not, so anything generating a signature
|
|
31
|
-
* from the card would have written `list(): Promise<Post[]>` — false, and a false
|
|
32
|
-
* signature is worse than none.
|
|
33
|
-
*
|
|
34
|
-
* `none` says there is no shaped output at all (a boolean, a void), not that the op
|
|
35
|
-
* returns nothing.
|
|
36
|
-
*/
|
|
14
|
+
/** How MUCH comes back — the half of the return type that `output` cannot say. */
|
|
37
15
|
cardinality?: 'one' | 'maybe' | 'many' | 'page' | 'none';
|
|
38
|
-
/**
|
|
39
|
-
* The argument names and TYPES — the one thing `binding` cannot say.
|
|
40
|
-
*
|
|
41
|
-
* `binding` says where an argument is read from, `cardinality` how much comes back;
|
|
42
|
-
* neither gives a type, and a GraphQL argument needs one. So this is not the scan's
|
|
43
|
-
* private material: a prefab fills it too, from signatures it wrote itself. `binding`
|
|
44
|
-
* still wins on where an argument comes from.
|
|
45
|
-
*/
|
|
16
|
+
/** The argument names and TYPES — the one thing `binding` cannot say. */
|
|
46
17
|
signature?: Signature;
|
|
47
18
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Read an op's cardinality off its parsed return type.
|
|
50
|
-
*
|
|
51
|
-
* `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
|
|
52
|
-
* `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
|
|
53
|
-
* a plain list and lose its `total`/`hasMore`.
|
|
54
|
-
*/
|
|
19
|
+
/** Read an op's cardinality off its parsed return type. */
|
|
55
20
|
export declare function cardinalityOf(type: TypeRef | undefined): OperationContract['cardinality'];
|
|
56
21
|
/** Map of operation name → its contract. */
|
|
57
22
|
export type OperationsMap = Map<string, OperationContract>;
|
|
@@ -69,9 +34,8 @@ export declare function knownVerbs(): {
|
|
|
69
34
|
command: string[];
|
|
70
35
|
};
|
|
71
36
|
/**
|
|
72
|
-
* Infer only when the leading word names one convention and a composed clause does not
|
|
73
|
-
*
|
|
74
|
-
* `getOrCreateUser` have no inferred kind instead of falling through to command/query.
|
|
37
|
+
* Infer only when the leading word names one convention and a composed clause does not name the
|
|
38
|
+
* opposite one.
|
|
75
39
|
*/
|
|
76
40
|
export declare function inferOperationKind(name: string): OperationKindInference;
|
|
77
41
|
/** Explicit config is authoritative; otherwise the finite convention may decline. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/wire/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/wire/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEhE,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,gCAAgC;IAChC,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACzD,yEAAyE;IACzE,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAQzF;AAKD,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE3D,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAQ/B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhD,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAuBD,oFAAoF;AACpF,wBAAgB,UAAU,IAAI;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAEnE;AAYD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CA4BvE;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,GACnD,aAAa,GAAG,SAAS,CAE3B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,GACnD,OAAO,CAET"}
|
package/dist/wire/operation.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read an op's cardinality off its parsed return type.
|
|
3
|
-
*
|
|
4
|
-
* `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
|
|
5
|
-
* `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
|
|
6
|
-
* a plain list and lose its `total`/`hasMore`.
|
|
7
|
-
*/
|
|
1
|
+
/** Read an op's cardinality off its parsed return type. */
|
|
8
2
|
export function cardinalityOf(type) {
|
|
9
3
|
if (!type)
|
|
10
4
|
return undefined;
|
|
@@ -21,11 +15,7 @@ export function cardinalityOf(type) {
|
|
|
21
15
|
}
|
|
22
16
|
/** A return that carries no schema — the card has nothing to project onto it. */
|
|
23
17
|
const PRIMITIVE_RETURNS = new Set(['boolean', 'string', 'number', 'void', 'undefined', 'unknown', 'any']);
|
|
24
|
-
/**
|
|
25
|
-
* Deliberately finite: these are verbs whose leading use carries a stable read meaning.
|
|
26
|
-
* `stats` and `check` preserve conventions already used by the project; the rest are the
|
|
27
|
-
* ordinary query vocabulary shared by the built-in adapters.
|
|
28
|
-
*/
|
|
18
|
+
/** Deliberately finite. */
|
|
29
19
|
const QUERY_VERBS = new Set([
|
|
30
20
|
'all', 'check', 'count', 'exists', 'fetch', 'find', 'get', 'has', 'health', 'list',
|
|
31
21
|
'load', 'mine', 'ping', 'quote', 'read', 'search', 'stats', 'status', 'who',
|
|
@@ -57,9 +47,8 @@ function wordsOf(name) {
|
|
|
57
47
|
.map((word) => word.toLowerCase());
|
|
58
48
|
}
|
|
59
49
|
/**
|
|
60
|
-
* Infer only when the leading word names one convention and a composed clause does not
|
|
61
|
-
*
|
|
62
|
-
* `getOrCreateUser` have no inferred kind instead of falling through to command/query.
|
|
50
|
+
* Infer only when the leading word names one convention and a composed clause does not name the
|
|
51
|
+
* opposite one.
|
|
63
52
|
*/
|
|
64
53
|
export function inferOperationKind(name) {
|
|
65
54
|
const words = wordsOf(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/wire/operation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/wire/operation.ts"],"names":[],"mappings":"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"}
|
package/dist/wire/signature.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A method's signature, as a contract is built from it — the shape, never the reading.
|
|
3
|
-
*
|
|
4
|
-
* The scan derives one from source; `frond.config.ts` states one. Neither owns the shape.
|
|
5
|
-
*/
|
|
1
|
+
/** A method's signature, as a contract is built from it — the shape, never the reading. */
|
|
6
2
|
/** A type reference — primitives, entities, arrays, generics. */
|
|
7
3
|
export interface TypeRef {
|
|
8
4
|
/** Raw type text as written in source (e.g. 'Pagination<Post>'). */
|
|
@@ -11,13 +7,7 @@ export interface TypeRef {
|
|
|
11
7
|
name: string;
|
|
12
8
|
/** Whether this is an array (T[] or Array<T>) — true at any depth. */
|
|
13
9
|
array?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* How MANY array levels: `string[]` is 1, `string[][]` is 2. `array` only ever said
|
|
16
|
-
* "at least one", which sufficed while one level meant one thing. It stopped sufficing
|
|
17
|
-
* when a presenter method started taking the page — there the outer level IS the page
|
|
18
|
-
* and what remains is the field, so telling `string[]` from `string[][]` is telling a
|
|
19
|
-
* computed string from a computed list.
|
|
20
|
-
*/
|
|
10
|
+
/** How MANY array levels. */
|
|
21
11
|
arrayDepth?: number;
|
|
22
12
|
/** Generic type arguments (e.g. for Pagination<Post> → [{ name: 'Post' }]). */
|
|
23
13
|
generics?: TypeRef[];
|
|
@@ -39,20 +29,9 @@ export interface Signature {
|
|
|
39
29
|
name: string;
|
|
40
30
|
params: Param[];
|
|
41
31
|
returnType?: TypeRef;
|
|
42
|
-
/**
|
|
43
|
-
* Came from a base class, not from the file being scanned. What a prefab
|
|
44
|
-
* handler declares about its own ops beats this — the scan reads a signature
|
|
45
|
-
* and guesses, the builder knows.
|
|
46
|
-
*/
|
|
32
|
+
/** Came from a base class, not from the file being scanned. */
|
|
47
33
|
inherited?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* The operation in words — the first sentence of the method's doc comment.
|
|
50
|
-
*
|
|
51
|
-
* Not a new thing to write: handlers already carry it (`/** Judge: the author,
|
|
52
|
-
* a draft… */`), the AST already holds it, and nothing read it. A caller that
|
|
53
|
-
* discovers an operation over the wire has its name and its schema; what the
|
|
54
|
-
* operation is FOR lived only in the source.
|
|
55
|
-
*/
|
|
34
|
+
/** The operation in words — the first sentence of the method's doc comment. */
|
|
56
35
|
description?: string;
|
|
57
36
|
}
|
|
58
37
|
//# sourceMappingURL=signature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/wire/signature.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/wire/signature.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,oCAAoC;AACpC,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-alpha.0",
|
|
4
4
|
"description": "The core — scan, call contract, façades, remote stand-ins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@typescript/typescript6": "^6.0.2",
|
|
58
58
|
"dequal": "^2.0.3",
|
|
59
|
-
"@fougere/container": "0.
|
|
60
|
-
"@fougere/schema": "0.
|
|
59
|
+
"@fougere/container": "0.7.0-alpha.0",
|
|
60
|
+
"@fougere/schema": "0.7.0-alpha.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "^22.0.0"
|
package/src/boot/Emissions.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { Container } from '@fougere/container';
|
|
|
3
3
|
import { validationErrorsOf } from '../wire/errors.js';
|
|
4
4
|
import { emitKeyOf, factsAnnouncedBy } from '../emit.js';
|
|
5
5
|
import { ambient } from '#ambient';
|
|
6
|
-
import { EMPTY_INVOCATION } from '../
|
|
7
|
-
import type { Logger } from '../
|
|
6
|
+
import { EMPTY_INVOCATION } from '../wire/Invocation.js';
|
|
7
|
+
import type { Logger } from '../builtin/logger.js';
|
|
8
8
|
import type { Fronds } from '../descriptor/Fronds.js';
|
|
9
9
|
import type { OperationsMap } from '../wire/operation.js';
|
|
10
10
|
|
|
@@ -17,25 +17,15 @@ interface Listener {
|
|
|
17
17
|
/** Carries an announced fact out of this process — see `CreateAppOptions.onEmit`. */
|
|
18
18
|
type Carrier = (fact: string, payload: unknown) => void | Promise<void>;
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Emissions — the only place in Fougere where an initiator names a SUBJECT.
|
|
22
|
-
*
|
|
23
|
-
* It was eight closures over four collections in the middle of the boot, which is a
|
|
24
|
-
* class that had not been named: the announced set, the subscriber index, the chain
|
|
25
|
-
* carried in async context, and the shapes a fact is judged against.
|
|
26
|
-
*
|
|
27
|
-
* **It is a resolver, not a channel.** It answers *who*, then hands over to the door
|
|
28
|
-
* that already exists — so a subscriber keeps its judge, its binding and its
|
|
29
|
-
* middlewares, and nothing here is durable.
|
|
30
|
-
*/
|
|
20
|
+
/** Emissions — the only place in Fougere where an initiator names a SUBJECT. */
|
|
31
21
|
export class Emissions {
|
|
32
22
|
/** Who listens to what. Filled as each door's contracts are resolved. */
|
|
33
23
|
private readonly subscribers = new Map<string, Listener[]>();
|
|
34
24
|
|
|
35
25
|
/**
|
|
36
|
-
* What is announced here, read from the DEPS and not from the subscribers: a handler
|
|
37
|
-
*
|
|
38
|
-
*
|
|
26
|
+
* What is announced here, read from the DEPS and not from the subscribers: a handler declaring
|
|
27
|
+
* `Emit<PostPublished>` must resolve it whether or not anybody listens, and announcing to nobody
|
|
28
|
+
* is legal.
|
|
39
29
|
*/
|
|
40
30
|
private readonly announced: Set<string>;
|
|
41
31
|
|
|
@@ -52,13 +42,6 @@ export class Emissions {
|
|
|
52
42
|
/**
|
|
53
43
|
* Who listens to what — read from the PLAN, where `{ kind: 'fact' }` is a sentence
|
|
54
44
|
* `computeBindingPlan` already wrote, so nothing re-derives what a parameter is.
|
|
55
|
-
*
|
|
56
|
-
* It is called for a frond hosted here AND for one declared remote. A remote frond is
|
|
57
|
-
* still scanned — only its hosting is elsewhere — so its subscriptions are known, and
|
|
58
|
-
* its door resolves to a doublure. That is the whole reason an emission crosses a
|
|
59
|
-
* process without a line of transport code: the emitter learned the signature locally
|
|
60
|
-
* and calls the same key. Noting only the hosted ones left the index EMPTY under a
|
|
61
|
-
* split, and a fact announced to a remote listener reached nobody, in silence.
|
|
62
45
|
*/
|
|
63
46
|
note(contracts: OperationsMap, door: string): void {
|
|
64
47
|
for (const [op, contract] of contracts) {
|
|
@@ -71,7 +54,7 @@ export class Emissions {
|
|
|
71
54
|
}
|
|
72
55
|
}
|
|
73
56
|
|
|
74
|
-
/** The shape a fact is
|
|
57
|
+
/** The shape a fact is validated by, when the fact is a declared entity. */
|
|
75
58
|
shapeOf(fact: string): SchemaView | undefined {
|
|
76
59
|
return this.shapes.get(fact);
|
|
77
60
|
}
|
|
@@ -81,13 +64,7 @@ export class Emissions {
|
|
|
81
64
|
return [...this.subscribers.keys()];
|
|
82
65
|
}
|
|
83
66
|
|
|
84
|
-
/**
|
|
85
|
-
* Register one emission value per fact — announced here, or merely listened to.
|
|
86
|
-
*
|
|
87
|
-
* A process that only subscribes still needs the value, because `deliver` is what a
|
|
88
|
-
* carrier calls and it goes through the same door. Called once every door has been
|
|
89
|
-
* built, so the two sets are complete.
|
|
90
|
-
*/
|
|
67
|
+
/** Register one emission value per fact — announced here, or merely listened to. */
|
|
91
68
|
register(): void {
|
|
92
69
|
for (const fact of new Set([...this.announced, ...this.subscribers.keys()])) {
|
|
93
70
|
this.container.registerValue(emitKeyOf(fact), (raw: unknown) => this.announce(fact, raw));
|
|
@@ -97,69 +74,27 @@ export class Emissions {
|
|
|
97
74
|
}
|
|
98
75
|
}
|
|
99
76
|
|
|
100
|
-
/**
|
|
101
|
-
* Announcing. Dispatch, never delivery — the emitter is handed back the moment every
|
|
102
|
-
* subscriber has been HANDED the fact, not when any of them is done.
|
|
103
|
-
*
|
|
104
|
-
* The `EventBus` this replaces did `await Promise.all(handlers)` and passed their
|
|
105
|
-
* rejections up, which made a publication hostage to its own indexer.
|
|
106
|
-
*/
|
|
77
|
+
/** Announcing. */
|
|
107
78
|
private async announce(fact: string, raw: unknown): Promise<void> {
|
|
108
79
|
/**
|
|
109
|
-
* A fact announced inside a frame that then rolls back is a lie, and nothing can take
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* provisional.
|
|
113
|
-
*
|
|
114
|
-
* Refused rather than deferred to the commit. Deferring would make `Emit<T>` behave
|
|
115
|
-
* differently depending on where it is called from, which is the hidden runtime the
|
|
116
|
-
* doctrine refuses; and it opens a window between the commit and the announcement whose
|
|
117
|
-
* only remedy is an outbox — a table, therefore durability, the one thing Fougere says
|
|
118
|
-
* it does not hold.
|
|
119
|
-
*
|
|
120
|
-
* A fact designates something that HAS happened. `run` returning is when that becomes
|
|
121
|
-
* true, so that is where the announcement belongs.
|
|
80
|
+
* A fact announced inside a frame that then rolls back is a lie, and nothing can take it back:
|
|
81
|
+
* announcing is DISPATCH — every subscriber has been handed the fact and the carrier has
|
|
82
|
+
* already put it on the wire — while the frame's writes are still provisional.
|
|
122
83
|
*/
|
|
123
84
|
await ambient.beforeAnnounce(fact);
|
|
124
85
|
|
|
125
86
|
const payload = this.stamped(fact, raw);
|
|
126
87
|
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
* The local dispatch finds its listeners by having READ their code, so it stops at
|
|
131
|
-
* the repository boundary: another team's Frond is not on this disk, and the
|
|
132
|
-
* emission reaches nobody. A carrier hands the fact to a name instead, and the far
|
|
133
|
-
* side subscribes to that same name from ITS own code. Neither reads the other.
|
|
134
|
-
*
|
|
135
|
-
* `deliver` deliberately does NOT come here: a hub that resolved this value to hand
|
|
136
|
-
* on an incoming reading echoed it straight back to the whole fleet.
|
|
137
|
-
*/
|
|
138
|
-
const carried = this.carry?.(fact, payload);
|
|
139
|
-
if (carried) void Promise.resolve(carried).catch((cause) => this.log.error(`${fact} — carrier refused it`, cause));
|
|
88
|
+
/** Whoever is not in this process — and it is the ONLY way to reach them. */
|
|
89
|
+
const delivery = this.carry?.(fact, payload);
|
|
90
|
+
if (delivery) void Promise.resolve(delivery).catch((cause) => this.log.error(`${fact} — carrier refused it`, cause));
|
|
140
91
|
|
|
141
92
|
for (const { door, op, done } of this.handToListeners(fact, payload)) {
|
|
142
93
|
void done.catch((cause) => this.log.error(`${fact} → ${door}.${op}`, this.describeRefusal(fact, cause) ?? cause));
|
|
143
94
|
}
|
|
144
95
|
}
|
|
145
96
|
|
|
146
|
-
/**
|
|
147
|
-
* Receiving. **The opposite rule, deliberately**: this one waits, and it tells.
|
|
148
|
-
*
|
|
149
|
-
* `deliver` is what a CARRIER calls, and a carrier's whole job is to know whether the
|
|
150
|
-
* fact landed — at-least-once is retrying what failed, so a delivery that cannot report
|
|
151
|
-
* makes durability impossible to build on top. It used to be the announcement itself:
|
|
152
|
-
* it resolved before any subscriber had run and swallowed every failure into a log, so a
|
|
153
|
-
* queue calling it could only ever ack blindly.
|
|
154
|
-
*
|
|
155
|
-
* That is not a contradiction of "dispatch is not delivery". That rule protects the
|
|
156
|
-
* EMITTER, which must not become hostage to a subscriber; a carrier is not the emitter,
|
|
157
|
-
* it is precisely the party whose business this is.
|
|
158
|
-
*
|
|
159
|
-
* What it still does not do is HOLD anything. A fact refused here is refused, and the
|
|
160
|
-
* carrier decides whether it comes back — which is the whole of Fougere's position on
|
|
161
|
-
* durability: the channel goes underneath, it is not reimplemented here.
|
|
162
|
-
*/
|
|
97
|
+
/** Receiving. */
|
|
163
98
|
async deliver(fact: string, payload: unknown): Promise<void> {
|
|
164
99
|
const handed = this.handToListeners(fact, payload);
|
|
165
100
|
const settled = await Promise.allSettled(handed.map((h) => h.done));
|
|
@@ -180,22 +115,8 @@ export class Emissions {
|
|
|
180
115
|
}
|
|
181
116
|
|
|
182
117
|
/**
|
|
183
|
-
* The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped,
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* `applyCreate` (`schema/src/schema/axis/lifecycle/apply.ts`) is where the split is realized:
|
|
187
|
-
* the judge never fills a hole, the STORAGE does, at the point of persistence. A fact has no storage, so nobody did — the judge declared an
|
|
188
|
-
* absent `created()` legal and omitted it, and a subscriber received a value missing a
|
|
189
|
-
* field its own type promises. Announcing is a fact's point of persistence.
|
|
190
|
-
*
|
|
191
|
-
* Announcing only, never `deliver`: a fact that arrives from elsewhere was stamped by
|
|
192
|
-
* its sender, and stamping it again would give one fact a different identity in every
|
|
193
|
-
* process that relayed it.
|
|
194
|
-
*
|
|
195
|
-
* **A typed emitter cannot reach this yet.** `Emit<T>` names the ROW type, where a
|
|
196
|
-
* `created()` field is present and required, so `announce({ id, title })` is a compile
|
|
197
|
-
* error and the author writes `at: new Date()` anyway. So this runs for a payload built
|
|
198
|
-
* outside the type — a bridge, a replay, a test — and is inert for everyone else.
|
|
118
|
+
* The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped, an id
|
|
119
|
+
* generated, a default applied.
|
|
199
120
|
*/
|
|
200
121
|
private stamped(fact: string, raw: unknown): unknown {
|
|
201
122
|
const shape = this.shapes.get(fact);
|
|
@@ -204,16 +125,7 @@ export class Emissions {
|
|
|
204
125
|
: raw;
|
|
205
126
|
}
|
|
206
127
|
|
|
207
|
-
/**
|
|
208
|
-
* Hand the fact to every listener in THIS process, and give back one promise each.
|
|
209
|
-
*
|
|
210
|
-
* The call goes THROUGH the door, so a subscriber meets the same judge, the same binding
|
|
211
|
-
* and the same middlewares as any caller. Nothing new answers for correctness — that is
|
|
212
|
-
* the dividend of a subscriber being an ordinary op rather than a special kind.
|
|
213
|
-
*
|
|
214
|
-
* It returns the promises rather than settling them, because the two callers want
|
|
215
|
-
* opposite things and only one of them is wrong to wait.
|
|
216
|
-
*/
|
|
128
|
+
/** Hand the fact to every listener in THIS process, and give back one promise each. */
|
|
217
129
|
private handToListeners(fact: string, payload: unknown): (Listener & { done: Promise<unknown> })[] {
|
|
218
130
|
const walked = ambient.currentChain();
|
|
219
131
|
if (walked.includes(fact)) {
|
|
@@ -239,21 +151,12 @@ export class Emissions {
|
|
|
239
151
|
} catch (cause) {
|
|
240
152
|
throw new Error(`${fact} → ${door} could not be reached`, { cause });
|
|
241
153
|
}
|
|
242
|
-
return facade[op]({ ...EMPTY_INVOCATION,
|
|
154
|
+
return facade[op]({ ...EMPTY_INVOCATION, input: payload });
|
|
243
155
|
}),
|
|
244
156
|
}));
|
|
245
157
|
}
|
|
246
158
|
|
|
247
|
-
/**
|
|
248
|
-
* A subscriber refusing the SHAPE, said in one line instead of dumped as an error.
|
|
249
|
-
*
|
|
250
|
-
* This is the one refusal nobody else will ever see. A door hands its 400 back to the
|
|
251
|
-
* caller who can fix it; a fact is dispatched, not delivered, so the sender learns
|
|
252
|
-
* nothing and the log is the whole of the evidence. The most likely cause is also the
|
|
253
|
-
* one a stack trace hides worst — this process's copy is older than the sender's — so
|
|
254
|
-
* the line names the fields and the remedy, and hedges because a genuinely bad payload
|
|
255
|
-
* produces the same refusal.
|
|
256
|
-
*/
|
|
159
|
+
/** A subscriber refusing the SHAPE, said in one line instead of dumped as an error. */
|
|
257
160
|
private describeRefusal(fact: string, cause: unknown): string | undefined {
|
|
258
161
|
const refusals = validationErrorsOf(cause);
|
|
259
162
|
if (!refusals?.length) return undefined;
|
package/src/boot/ambient-port.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a call needs to know about the call it is inside, and the two ways to answer it.
|
|
3
|
-
*
|
|
4
|
-
* One realization reads an async context (`ambient.als.ts`), the other cannot and waits
|
|
5
|
-
* its turn instead (`ambient.queue.ts`). `#ambient` in package.json picks one per runtime,
|
|
6
|
-
* so a bundle for a host without async context never names `node:async_hooks`.
|
|
7
|
-
*/
|
|
1
|
+
/** What a call needs to know about the call it is inside, and the two ways to answer it. */
|
|
8
2
|
export interface Ambient {
|
|
9
3
|
/** True when this runtime has no async context, and the boot says so. */
|
|
10
4
|
readonly degraded: boolean;
|
|
11
5
|
|
|
12
|
-
/**
|
|
13
|
-
* Run `fn` as the frame `key`. A frame opened inside another must not proceed.
|
|
14
|
-
*
|
|
15
|
-
* Measured on SQLite: a second transaction on the same connection WAITS for the first,
|
|
16
|
-
* so a nested frame hangs on one engine and returns when split across two.
|
|
17
|
-
*/
|
|
6
|
+
/** Run `fn` as the frame `key`. */
|
|
18
7
|
enterFrame<R>(key: string, fn: () => Promise<R>): Promise<R>;
|
|
19
8
|
|
|
20
9
|
/**
|
|
@@ -23,17 +12,7 @@ export interface Ambient {
|
|
|
23
12
|
*/
|
|
24
13
|
beforeAnnounce(fact: string): Promise<void>;
|
|
25
14
|
|
|
26
|
-
/**
|
|
27
|
-
* The facts already being announced up the stack, so a fact cannot cause itself.
|
|
28
|
-
*
|
|
29
|
-
* A CHAIN and not a depth: `A → B → D` and `A → C → D` is a diamond, perfectly legal,
|
|
30
|
-
* while `A → … → A` never ends. Empty where it cannot be followed.
|
|
31
|
-
*
|
|
32
|
-
* Detecting this at boot was the first idea and it was wrong: `Emit<G>` is a CONSTRUCTOR
|
|
33
|
-
* dependency, so it belongs to the handler and not to one of its methods. A handler that
|
|
34
|
-
* subscribes to `A` in one method and emits `G` from another would have been refused for
|
|
35
|
-
* a cycle it never walks.
|
|
36
|
-
*/
|
|
15
|
+
/** The facts already being announced up the stack, so a fact cannot cause itself. */
|
|
37
16
|
currentChain(): readonly string[];
|
|
38
17
|
|
|
39
18
|
/** Run `fn` with `fact` appended to the emission chain. */
|
package/src/boot/ambient.als.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The realization that can tell whose frame is open: an async context.
|
|
3
|
-
*
|
|
4
|
-
* Chosen by `#ambient` wherever `node:async_hooks` exists — Node, Deno, Bun, and workerd
|
|
5
|
-
* with `nodejs_als`. Every refusal here is immediate and names its cause.
|
|
6
|
-
*/
|
|
1
|
+
/** The realization that can tell whose frame is open: an async context. */
|
|
7
2
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
8
3
|
import type { Ambient } from './ambient-port.js';
|
|
9
4
|
|
|
@@ -14,10 +9,10 @@ export const ambient: Ambient = {
|
|
|
14
9
|
degraded: false,
|
|
15
10
|
|
|
16
11
|
enterFrame<R>(key: string, fn: () => Promise<R>): Promise<R> {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
12
|
+
const open = frame.getStore();
|
|
13
|
+
if (open !== undefined) {
|
|
19
14
|
return Promise.reject(new Error(
|
|
20
|
-
`Together<[…]> (${key}) cannot be opened inside ${
|
|
15
|
+
`Together<[…]> (${key}) cannot be opened inside ${open}: on one engine the second `
|
|
21
16
|
+ `transaction waits for the first and the call hangs. Two frames that must both hold `
|
|
22
17
|
+ `are ONE frame — declare a single Together naming every member.`,
|
|
23
18
|
));
|
|
@@ -26,10 +21,10 @@ export const ambient: Ambient = {
|
|
|
26
21
|
},
|
|
27
22
|
|
|
28
23
|
beforeAnnounce(fact: string): Promise<void> {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
24
|
+
const open = frame.getStore();
|
|
25
|
+
if (open === undefined) return Promise.resolve();
|
|
31
26
|
return Promise.reject(new Error(
|
|
32
|
-
`${fact} cannot be announced inside Together<[…]> (${
|
|
27
|
+
`${fact} cannot be announced inside Together<[…]> (${open}): announcing is dispatch, `
|
|
33
28
|
+ `so subscribers and the carrier would have it while these writes can still be taken `
|
|
34
29
|
+ `back. Announce after run() returns, when it is true.`,
|
|
35
30
|
));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The realization for a runtime with no async context: it cannot tell whose frame is
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Two consequences the boot reports rather than hides: frames run one at a time, and a
|
|
6
|
-
* frame opened inside another is not refused, it waits for itself and times out.
|
|
2
|
+
* The realization for a runtime with no async context: it cannot tell whose frame is open, so it
|
|
3
|
+
* never guesses — it waits its turn.
|
|
7
4
|
*/
|
|
8
5
|
import type { Ambient } from './ambient-port.js';
|
|
9
6
|
|