@fougere/core 0.5.0-alpha.1 → 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 +14 -91
- 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 +6 -16
- package/dist/boot/auth.d.ts.map +1 -1
- package/dist/boot/boot.d.ts +5 -18
- package/dist/boot/boot.d.ts.map +1 -1
- package/dist/boot/boot.js +4 -11
- package/dist/boot/boot.js.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +106 -163
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/card.d.ts +5 -0
- package/dist/boot/card.d.ts.map +1 -0
- package/dist/boot/card.js +71 -0
- package/dist/boot/card.js.map +1 -0
- package/dist/boot/frame.d.ts +8 -32
- package/dist/boot/frame.d.ts.map +1 -1
- package/dist/boot/frame.js +23 -57
- package/dist/boot/frame.js.map +1 -1
- package/dist/boot/hosted.d.ts +3 -19
- package/dist/boot/hosted.d.ts.map +1 -1
- package/dist/boot/hosted.js +12 -17
- package/dist/boot/hosted.js.map +1 -1
- package/dist/boot/ownership.d.ts +5 -36
- package/dist/boot/ownership.d.ts.map +1 -1
- package/dist/boot/ownership.js +9 -49
- package/dist/boot/ownership.js.map +1 -1
- package/dist/boot/ports.d.ts +2 -15
- 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 +11 -0
- package/dist/boot/runner.d.ts.map +1 -0
- package/dist/boot/runner.js +13 -0
- package/dist/boot/runner.js.map +1 -0
- package/dist/boot/seed.d.ts +5 -32
- package/dist/boot/seed.d.ts.map +1 -1
- package/dist/boot/seed.js +10 -41
- package/dist/boot/seed.js.map +1 -1
- package/dist/boot/statement-drift.d.ts +4 -22
- 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 +8 -12
- package/dist/boot/together.d.ts.map +1 -1
- package/dist/boot/together.js +28 -65
- package/dist/boot/together.js.map +1 -1
- package/dist/boot/types.d.ts +36 -180
- 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 +41 -0
- package/dist/declare.d.ts.map +1 -0
- package/dist/{scan/declare.js → declare.js} +6 -31
- package/dist/declare.js.map +1 -0
- 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 +19 -0
- package/dist/descriptor/Fronds.d.ts.map +1 -0
- package/dist/descriptor/Fronds.js +40 -0
- package/dist/descriptor/Fronds.js.map +1 -0
- package/dist/descriptor/frond.d.ts +135 -0
- package/dist/descriptor/frond.d.ts.map +1 -0
- package/dist/{scan → descriptor}/frond.js.map +1 -1
- package/dist/dispatch/ArgumentResolver.d.ts +6 -3
- package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
- package/dist/dispatch/ArgumentResolver.js +48 -3
- 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 -3
- 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 +9 -8
- package/dist/dispatch/StorageGuard.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.js +66 -23
- 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 +6 -3
- package/dist/effective-operation.d.ts.map +1 -1
- package/dist/effective-operation.js +49 -27
- 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 +8 -71
- 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/graph.d.ts +1 -1
- package/dist/graph.d.ts.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 +2 -8
- 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 +28 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -22
- 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 +19 -35
- package/dist/prefab/crud.d.ts.map +1 -1
- package/dist/prefab/crud.js +39 -66
- package/dist/prefab/crud.js.map +1 -1
- package/dist/prefab/mirror.d.ts +5 -27
- package/dist/prefab/mirror.d.ts.map +1 -1
- package/dist/prefab/mirror.js +6 -24
- 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 +12 -80
- package/dist/prefab/repository.d.ts.map +1 -1
- package/dist/prefab/repository.js +22 -35
- 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 +2 -6
- package/dist/scan/emit.d.ts.map +1 -1
- package/dist/scan/emit.js +5 -39
- package/dist/scan/emit.js.map +1 -1
- package/dist/scan/handler-parser.d.ts +9 -76
- package/dist/scan/handler-parser.d.ts.map +1 -1
- package/dist/scan/handler-parser.js +28 -85
- package/dist/scan/handler-parser.js.map +1 -1
- package/dist/scan/result.d.ts +28 -0
- package/dist/scan/result.d.ts.map +1 -0
- package/dist/scan/result.js +2 -0
- package/dist/scan/result.js.map +1 -0
- package/dist/scan/scanner.d.ts +3 -28
- package/dist/scan/scanner.d.ts.map +1 -1
- package/dist/scan/scanner.js +36 -135
- package/dist/scan/scanner.js.map +1 -1
- package/dist/scan/statement.d.ts +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 +92 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +50 -0
- package/dist/storage.js.map +1 -0
- 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 +6 -39
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +19 -39
- 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/wire/RouteAddress.d.ts +24 -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 +36 -0
- package/dist/wire/binding.d.ts.map +1 -0
- package/dist/{boot → wire}/binding.js +5 -62
- package/dist/wire/binding.js.map +1 -0
- package/dist/wire/call.d.ts +25 -172
- package/dist/wire/call.d.ts.map +1 -1
- package/dist/wire/call.js +15 -166
- 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 +12 -74
- package/dist/wire/operation.d.ts.map +1 -1
- package/dist/wire/operation.js +4 -66
- package/dist/wire/operation.js.map +1 -1
- package/dist/wire/signature.d.ts +37 -0
- package/dist/wire/signature.d.ts.map +1 -0
- package/dist/wire/signature.js +2 -0
- package/dist/wire/signature.js.map +1 -0
- package/package.json +3 -3
- package/src/boot/Emissions.ts +22 -119
- 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 +6 -16
- package/src/boot/boot.ts +8 -23
- package/src/boot/bootstrap.ts +117 -173
- package/src/boot/card.ts +84 -0
- package/src/boot/frame.ts +31 -65
- package/src/boot/hosted.ts +15 -40
- package/src/boot/ownership.ts +14 -49
- package/src/boot/ports.ts +2 -15
- package/src/boot/remote.ts +11 -58
- package/src/boot/runner.ts +17 -0
- package/src/boot/seed.ts +11 -42
- package/src/boot/statement-drift.ts +10 -28
- package/src/boot/together.ts +38 -72
- package/src/boot/types.ts +36 -180
- 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/{scan/declare.ts → declare.ts} +11 -42
- package/src/define.ts +2 -3
- package/src/descriptor/Fronds.ts +47 -0
- package/src/descriptor/frond.ts +145 -0
- package/src/dispatch/ArgumentResolver.ts +54 -8
- 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 -4
- 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 +75 -23
- 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 +60 -37
- 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 +8 -71
- package/src/graph.ts +1 -1
- package/src/identity-keys.ts +3 -16
- package/src/identity.ts +12 -80
- package/src/imports.ts +3 -32
- package/src/index.ts +28 -33
- package/src/loader.ts +2 -16
- package/src/node.ts +2 -11
- package/src/prefab/collector.ts +1 -22
- package/src/prefab/crud.ts +51 -90
- package/src/prefab/mirror.ts +9 -49
- package/src/prefab/prefab.ts +2 -21
- package/src/prefab/presenter.ts +2 -36
- package/src/prefab/repository.ts +32 -108
- 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 +7 -43
- package/src/scan/handler-parser.ts +41 -163
- package/src/scan/result.ts +29 -0
- package/src/scan/scanner.ts +40 -138
- package/src/scan/statement.ts +6 -31
- package/src/source.ts +44 -0
- package/src/storage.ts +141 -0
- package/src/store.ts +152 -0
- package/src/verify.ts +19 -60
- package/src/wire/CallLog.ts +30 -0
- package/src/{contract → wire}/Invocation.ts +24 -17
- package/src/{contract → wire}/RouteAddress.ts +10 -0
- package/src/wire/binding.ts +102 -0
- package/src/wire/call.ts +30 -261
- 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 +13 -110
- package/src/wire/signature.ts +38 -0
- package/dist/boot/HandlerFacade.d.ts.map +0 -1
- package/dist/boot/HandlerFacade.js.map +0 -1
- package/dist/boot/binding.d.ts +0 -60
- package/dist/boot/binding.d.ts.map +0 -1
- package/dist/boot/binding.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 +0 -17
- 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/orm.d.ts +0 -207
- package/dist/orm.d.ts.map +0 -1
- package/dist/orm.js +0 -66
- package/dist/orm.js.map +0 -1
- package/dist/scan/Fronds.d.ts +0 -45
- package/dist/scan/Fronds.d.ts.map +0 -1
- package/dist/scan/Fronds.js +0 -66
- package/dist/scan/Fronds.js.map +0 -1
- package/dist/scan/declare.d.ts +0 -71
- package/dist/scan/declare.d.ts.map +0 -1
- package/dist/scan/declare.js.map +0 -1
- package/dist/scan/frond.d.ts +0 -224
- package/dist/scan/frond.d.ts.map +0 -1
- package/src/boot/HandlerFacade.ts +0 -242
- package/src/boot/binding.ts +0 -182
- 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/orm.ts +0 -252
- package/src/scan/Fronds.ts +0 -73
- package/src/scan/frond.ts +0 -235
- /package/dist/{scan → descriptor}/frond.js +0 -0
- /package/dist/{contract → wire}/CallLog.js +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { InvocationContext } from '../contract/Invocation.js';
|
|
2
|
-
import type { OperationContract } from '../wire/operation.js';
|
|
3
|
-
import { type AppMiddleware } from '../wire/middleware.js';
|
|
4
|
-
import type { ArgumentResolver } from './ArgumentResolver.js';
|
|
5
|
-
import type { InputValidator } from './InputValidator.js';
|
|
6
|
-
import type { OutputProjector } from './OutputProjector.js';
|
|
7
|
-
export interface OperationExecution {
|
|
8
|
-
entity: string;
|
|
9
|
-
frond: string;
|
|
10
|
-
operation: string;
|
|
11
|
-
contract: OperationContract | undefined;
|
|
12
|
-
middlewares: () => AppMiddleware[];
|
|
13
|
-
validator: InputValidator;
|
|
14
|
-
arguments: ArgumentResolver;
|
|
15
|
-
invoke: (args: unknown[]) => unknown | Promise<unknown>;
|
|
16
|
-
projector: OutputProjector;
|
|
17
|
-
present?: (result: unknown, invocation: InvocationContext) => Promise<unknown>;
|
|
18
|
-
}
|
|
19
|
-
/** Executes one operation through the same ordered boundary steps on every route. */
|
|
20
|
-
export declare class OperationExecutor {
|
|
21
|
-
private readonly execution;
|
|
22
|
-
constructor(execution: OperationExecution);
|
|
23
|
-
execute(input?: Partial<InvocationContext>): Promise<unknown>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=OperationExecutor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OperationExecutor.d.ts","sourceRoot":"","sources":["../../src/dispatch/OperationExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACxC,WAAW,EAAE,MAAM,aAAa,EAAE,CAAC;IACnC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAChF;AAED,qFAAqF;AACrF,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,kBAAkB;IAEpD,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;CA8BpE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { canonicalInvocation } from '../contract/Invocation.js';
|
|
2
|
-
import { runMiddlewares, } from '../wire/middleware.js';
|
|
3
|
-
/** Executes one operation through the same ordered boundary steps on every route. */
|
|
4
|
-
export class OperationExecutor {
|
|
5
|
-
execution;
|
|
6
|
-
constructor(execution) {
|
|
7
|
-
this.execution = execution;
|
|
8
|
-
}
|
|
9
|
-
async execute(input) {
|
|
10
|
-
const invocation = canonicalInvocation(input);
|
|
11
|
-
const context = {
|
|
12
|
-
entity: this.execution.entity,
|
|
13
|
-
frond: this.execution.frond,
|
|
14
|
-
operation: this.execution.operation,
|
|
15
|
-
args: [],
|
|
16
|
-
state: invocation.state,
|
|
17
|
-
invocation,
|
|
18
|
-
};
|
|
19
|
-
return runMiddlewares(this.execution.middlewares(), context, async () => {
|
|
20
|
-
const effective = this.execution.validator.validate(this.execution.contract?.input, invocation, context.entity, context.operation);
|
|
21
|
-
context.invocation = effective;
|
|
22
|
-
const args = this.execution.contract?.binding
|
|
23
|
-
? await this.execution.arguments.resolve(this.execution.contract.binding, effective)
|
|
24
|
-
: [];
|
|
25
|
-
const projected = this.execution.projector.project(await this.execution.invoke(args));
|
|
26
|
-
return this.execution.present
|
|
27
|
-
? this.execution.present(projected, effective)
|
|
28
|
-
: projected;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=OperationExecutor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OperationExecutor.js","sourceRoot":"","sources":["../../src/dispatch/OperationExecutor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EACL,cAAc,GAGf,MAAM,uBAAuB,CAAC;AAkB/B,qFAAqF;AACrF,MAAM,OAAO,iBAAiB;IACC;IAA7B,YAA6B,SAA6B;QAA7B,cAAS,GAAT,SAAS,CAAoB;IAAG,CAAC;IAE9D,KAAK,CAAC,OAAO,CAAC,KAAkC;QAC9C,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAqB;YAChC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;YAC7B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK;YAC3B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS;YACnC,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,UAAU;SACX,CAAC;QACF,OAAO,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;YACtE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CACjD,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAC9B,UAAU,EACV,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,SAAS,CAClB,CAAC;YACF,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;YAE/B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO;gBAC3C,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;gBACpF,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAChD,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAClC,CAAC;YACF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO;gBAC3B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;gBAC9C,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { OutputView } from './OutputView.js';
|
|
2
|
-
/**
|
|
3
|
-
* Projects one operation result onto the fields its audience may read.
|
|
4
|
-
*
|
|
5
|
-
* One of the two exits a judge watches; `StorageGuard` is the other.
|
|
6
|
-
*/
|
|
7
|
-
export declare class OutputProjector {
|
|
8
|
-
private readonly view;
|
|
9
|
-
constructor(view: OutputView);
|
|
10
|
-
project(result: unknown): unknown;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=OutputProjector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OutputProjector.d.ts","sourceRoot":"","sources":["../../src/dispatch/OutputProjector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;GAIG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;CAmBlC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Visibility } from '@fougere/schema';
|
|
2
|
-
import { preserveArrayProperties } from './ArrayResult.js';
|
|
3
|
-
/**
|
|
4
|
-
* Projects one operation result onto the fields its audience may read.
|
|
5
|
-
*
|
|
6
|
-
* One of the two exits a judge watches; `StorageGuard` is the other.
|
|
7
|
-
*/
|
|
8
|
-
export class OutputProjector {
|
|
9
|
-
view;
|
|
10
|
-
constructor(view) {
|
|
11
|
-
this.view = view;
|
|
12
|
-
}
|
|
13
|
-
project(result) {
|
|
14
|
-
if (result === null || result === undefined)
|
|
15
|
-
return result;
|
|
16
|
-
if (Array.isArray(result)) {
|
|
17
|
-
return preserveArrayProperties(result, result.map((item) => this.project(item)));
|
|
18
|
-
}
|
|
19
|
-
if (typeof result !== 'object')
|
|
20
|
-
return result;
|
|
21
|
-
const record = result;
|
|
22
|
-
const scoped = this.view.closed
|
|
23
|
-
? Object.fromEntries(Object.keys(this.view.fields)
|
|
24
|
-
.filter((key) => key in record)
|
|
25
|
-
.map((key) => [key, record[key]]))
|
|
26
|
-
: record;
|
|
27
|
-
return Visibility.of(this.view.fields).encode(scoped);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=OutputProjector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OutputProjector.js","sourceRoot":"","sources":["../../src/dispatch/OutputProjector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG3D;;;;GAIG;AACH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,OAAO,CAAC,MAAe;QACrB,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;QAE3D,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,OAAO,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnF,CAAC;QAED,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;QAE9C,MAAM,MAAM,GAAG,MAAiC,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM;YAC7B,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;iBAC1B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,MAAM,CAAC;iBAC9B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CACpC;YACH,CAAC,CAAC,MAAM,CAAC;QACX,OAAO,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { InvocationContext } from '../contract/Invocation.js';
|
|
2
|
-
import type { PresenterEntry } from '../scan/frond.js';
|
|
3
|
-
import type { ArgumentResolver } from './ArgumentResolver.js';
|
|
4
|
-
import type { PresenterArgs } from './PresenterExecutor.js';
|
|
5
|
-
/** Resolves the invocation-dependent arguments of every computed presenter field. */
|
|
6
|
-
export declare class PresenterArgumentResolver {
|
|
7
|
-
private readonly argumentsResolver;
|
|
8
|
-
private readonly collectorTypes;
|
|
9
|
-
constructor(argumentsResolver: ArgumentResolver, collectorTypes: Set<string>);
|
|
10
|
-
resolve(meta: PresenterEntry, invocation: InvocationContext): Promise<PresenterArgs>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=PresenterArgumentResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterArgumentResolver.d.ts","sourceRoot":"","sources":["../../src/dispatch/PresenterArgumentResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,qFAAqF;AACrF,qBAAa,yBAAyB;IAElC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADd,iBAAiB,EAAE,gBAAgB,EACnC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC;IAGxC,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;CAW3F"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { computeBindingPlan } from '../boot/binding.js';
|
|
2
|
-
/** Resolves the invocation-dependent arguments of every computed presenter field. */
|
|
3
|
-
export class PresenterArgumentResolver {
|
|
4
|
-
argumentsResolver;
|
|
5
|
-
collectorTypes;
|
|
6
|
-
constructor(argumentsResolver, collectorTypes) {
|
|
7
|
-
this.argumentsResolver = argumentsResolver;
|
|
8
|
-
this.collectorTypes = collectorTypes;
|
|
9
|
-
}
|
|
10
|
-
async resolve(meta, invocation) {
|
|
11
|
-
const argumentsByField = {};
|
|
12
|
-
for (const field of meta.fieldMeta) {
|
|
13
|
-
if (!field.params?.length)
|
|
14
|
-
continue;
|
|
15
|
-
argumentsByField[field.name] = await this.argumentsResolver.resolve(computeBindingPlan(field.params, this.collectorTypes), invocation);
|
|
16
|
-
}
|
|
17
|
-
return argumentsByField;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=PresenterArgumentResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterArgumentResolver.js","sourceRoot":"","sources":["../../src/dispatch/PresenterArgumentResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAMxD,qFAAqF;AACrF,MAAM,OAAO,yBAAyB;IAEjB;IACA;IAFnB,YACmB,iBAAmC,EACnC,cAA2B;QAD3B,sBAAiB,GAAjB,iBAAiB,CAAkB;QACnC,mBAAc,GAAd,cAAc,CAAa;IAC3C,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,IAAoB,EAAE,UAA6B;QAC/D,MAAM,gBAAgB,GAAkB,EAAE,CAAC;QAC3C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM;gBAAE,SAAS;YACpC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CACjE,kBAAkB,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,EACrD,UAAU,CACX,CAAC;QACJ,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RouteAddress } from '../contract/RouteAddress.js';
|
|
2
|
-
import type { Route } from './Route.js';
|
|
3
|
-
import type { RouteResolver } from './RouteResolver.js';
|
|
4
|
-
type RemoteFacade = Record<string, Function>;
|
|
5
|
-
export type RemoteFacadeResolver = (entity: string) => RemoteFacade | undefined;
|
|
6
|
-
/** Builds a remote route on the first call, after the remote façade can be resolved. */
|
|
7
|
-
export declare class RemoteRouteResolver implements RouteResolver {
|
|
8
|
-
private readonly facades;
|
|
9
|
-
constructor(facades: RemoteFacadeResolver);
|
|
10
|
-
resolve(address: RouteAddress): Route | undefined;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=RemoteRouteResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteRouteResolver.d.ts","sourceRoot":"","sources":["../../src/dispatch/RemoteRouteResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC7C,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;AAEhF,wFAAwF;AACxF,qBAAa,mBAAoB,YAAW,aAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,oBAAoB;IAE1D,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,GAAG,SAAS;CAQlD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteRouteResolver.js","sourceRoot":"","sources":["../../src/dispatch/RemoteRouteResolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOrD,wFAAwF;AACxF,MAAM,OAAO,mBAAmB;IACD;IAA7B,YAA6B,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;IAAG,CAAC;IAE9D,OAAO,CAAC,OAAqB;QAC3B,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAEpD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,OAAO,SAAS,KAAK,UAAU;YAAE,OAAO,SAAS,CAAC;QACtD,OAAO,IAAI,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Call } from '../contract/Call.js';
|
|
2
|
-
import { FougereError } from '../wire/errors.js';
|
|
3
|
-
import type { Route } from './Route.js';
|
|
4
|
-
import type { RoutePolicy } from './RoutePolicy.js';
|
|
5
|
-
/** Describes an unresolved route from the destinations visible to one dispatcher. */
|
|
6
|
-
export declare class RouteNotFoundError extends FougereError {
|
|
7
|
-
readonly servedOperations: readonly string[];
|
|
8
|
-
constructor(call: Call, routes: readonly Route[], policy?: RoutePolicy);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=RouteNotFoundError.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RouteNotFoundError.d.ts","sourceRoot":"","sources":["../../src/dispatch/RouteNotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAa,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,qFAAqF;AACrF,qBAAa,kBAAmB,SAAQ,YAAY;IAClD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;gBAEjC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW;CAmBvE"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ErrorCode, FougereError } from '../wire/errors.js';
|
|
2
|
-
/** Describes an unresolved route from the destinations visible to one dispatcher. */
|
|
3
|
-
export class RouteNotFoundError extends FougereError {
|
|
4
|
-
servedOperations;
|
|
5
|
-
constructor(call, routes, policy) {
|
|
6
|
-
const served = routes
|
|
7
|
-
.filter((route) => !policy || policy.accepts(route))
|
|
8
|
-
.filter((route) => route.address.entity === call.address.entity)
|
|
9
|
-
.filter((route) => route.kind === 'system'
|
|
10
|
-
|| route.address.surface === call.address.surface)
|
|
11
|
-
.map((route) => route.address.operation);
|
|
12
|
-
const operation = call.address.operation;
|
|
13
|
-
const entity = call.address.entity;
|
|
14
|
-
const message = entity === 'rpc'
|
|
15
|
-
? `Unknown rpc operation '${operation}'. `
|
|
16
|
-
+ (served.length ? `It serves ${served.join(', ')}.` : 'It serves nothing.')
|
|
17
|
-
: served.length
|
|
18
|
-
? `Unknown operation '${operation}' on '${entity}'. It serves ${served.join(', ')}.`
|
|
19
|
-
: `No route serves '${call.address}'`;
|
|
20
|
-
super({ code: ErrorCode.NOT_FOUND, message, entity, operation });
|
|
21
|
-
this.servedOperations = served;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=RouteNotFoundError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RouteNotFoundError.js","sourceRoot":"","sources":["../../src/dispatch/RouteNotFoundError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI5D,qFAAqF;AACrF,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACzC,gBAAgB,CAAoB;IAE7C,YAAY,IAAU,EAAE,MAAwB,EAAE,MAAoB;QACpE,MAAM,MAAM,GAAG,MAAM;aAClB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aACnD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;aAC/D,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ;eACrC,KAAK,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;aACnD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QACnC,MAAM,OAAO,GAAG,MAAM,KAAK,KAAK;YAC9B,CAAC,CAAC,0BAA0B,SAAS,KAAK;kBACtC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC;YAC9E,CAAC,CAAC,MAAM,CAAC,MAAM;gBACb,CAAC,CAAC,sBAAsB,SAAS,SAAS,MAAM,gBAAgB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBACpF,CAAC,CAAC,oBAAoB,IAAI,CAAC,OAAO,GAAG,CAAC;QAE1C,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type Operation = (...args: any[]) => unknown;
|
|
2
|
-
/** Facade for a remote contract whose operation names are not known before discovery. */
|
|
3
|
-
export declare class DynamicFacade {
|
|
4
|
-
private readonly operation;
|
|
5
|
-
readonly operations: Record<string, Operation>;
|
|
6
|
-
constructor(operation: (name: string) => Operation);
|
|
7
|
-
private isOperationName;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=DynamicFacade.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFacade.d.ts","sourceRoot":"","sources":["../../src/entry/DynamicFacade.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC;AAE7C,yFAAyF;AACzF,qBAAa,aAAa;IAGZ,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBAElB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS;IAenE,OAAO,CAAC,eAAe;CAMxB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/** Facade for a remote contract whose operation names are not known before discovery. */
|
|
2
|
-
export class DynamicFacade {
|
|
3
|
-
operation;
|
|
4
|
-
operations;
|
|
5
|
-
constructor(operation) {
|
|
6
|
-
this.operation = operation;
|
|
7
|
-
this.operations = new Proxy({}, {
|
|
8
|
-
get: (_target, name) => this.isOperationName(name) ? this.operation(name) : undefined,
|
|
9
|
-
has: (_target, name) => this.isOperationName(name),
|
|
10
|
-
getOwnPropertyDescriptor: (_target, name) => this.isOperationName(name)
|
|
11
|
-
? {
|
|
12
|
-
value: this.operation(name),
|
|
13
|
-
writable: false,
|
|
14
|
-
enumerable: true,
|
|
15
|
-
configurable: true,
|
|
16
|
-
}
|
|
17
|
-
: undefined,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
isOperationName(name) {
|
|
21
|
-
return typeof name === 'string'
|
|
22
|
-
&& name !== 'then'
|
|
23
|
-
&& name !== 'toJSON'
|
|
24
|
-
&& !Object.hasOwn(Object.prototype, name);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=DynamicFacade.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFacade.js","sourceRoot":"","sources":["../../src/entry/DynamicFacade.ts"],"names":[],"mappings":"AAEA,yFAAyF;AACzF,MAAM,OAAO,aAAa;IAGK;IAFpB,UAAU,CAA4B;IAE/C,YAA6B,SAAsC;QAAtC,cAAS,GAAT,SAAS,CAA6B;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE;YAC9B,GAAG,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;YACrF,GAAG,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAClD,wBAAwB,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACrE,CAAC,CAAC;oBACE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;oBAC3B,QAAQ,EAAE,KAAK;oBACf,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;iBACnB;gBACH,CAAC,CAAC,SAAS;SACd,CAAC,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,IAAqB;QAC3C,OAAO,OAAO,IAAI,KAAK,QAAQ;eAC1B,IAAI,KAAK,MAAM;eACf,IAAI,KAAK,QAAQ;eACjB,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DispatchPort } from '../dispatch/DispatchPort.js';
|
|
2
|
-
/** Object-shaped entry that turns facade method calls into canonical dispatches. */
|
|
3
|
-
export declare class FacadeEntry {
|
|
4
|
-
private readonly dispatcher;
|
|
5
|
-
private readonly entity;
|
|
6
|
-
private readonly surface?;
|
|
7
|
-
readonly operations: Record<string, Function>;
|
|
8
|
-
constructor(dispatcher: DispatchPort, entity: string, operationNames?: Iterable<string>, surface?: string | undefined);
|
|
9
|
-
private operation;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=FacadeEntry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FacadeEntry.d.ts","sourceRoot":"","sources":["../../src/entry/FacadeEntry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,oFAAoF;AACpF,qBAAa,WAAW;IAIpB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAN3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;gBAG3B,UAAU,EAAE,YAAY,EACxB,MAAM,EAAE,MAAM,EAC/B,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,EAChB,OAAO,CAAC,EAAE,MAAM,YAAA;IAOnC,OAAO,CAAC,SAAS;CAUlB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Call } from '../contract/Call.js';
|
|
2
|
-
import { RouteAddress } from '../contract/RouteAddress.js';
|
|
3
|
-
import { DynamicFacade } from './DynamicFacade.js';
|
|
4
|
-
/** Object-shaped entry that turns facade method calls into canonical dispatches. */
|
|
5
|
-
export class FacadeEntry {
|
|
6
|
-
dispatcher;
|
|
7
|
-
entity;
|
|
8
|
-
surface;
|
|
9
|
-
operations;
|
|
10
|
-
constructor(dispatcher, entity, operationNames, surface) {
|
|
11
|
-
this.dispatcher = dispatcher;
|
|
12
|
-
this.entity = entity;
|
|
13
|
-
this.surface = surface;
|
|
14
|
-
this.operations = operationNames
|
|
15
|
-
? Object.fromEntries([...operationNames].map((name) => [name, this.operation(name)]))
|
|
16
|
-
: new DynamicFacade((name) => this.operation(name)).operations;
|
|
17
|
-
}
|
|
18
|
-
operation(name) {
|
|
19
|
-
return (invocation) => this.dispatcher.dispatch(new Call(new RouteAddress({
|
|
20
|
-
entity: this.entity,
|
|
21
|
-
operation: name,
|
|
22
|
-
...(this.surface !== undefined ? { surface: this.surface } : {}),
|
|
23
|
-
}), invocation));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=FacadeEntry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FacadeEntry.js","sourceRoot":"","sources":["../../src/entry/FacadeEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,oFAAoF;AACpF,MAAM,OAAO,WAAW;IAIH;IACA;IAEA;IANV,UAAU,CAA2B;IAE9C,YACmB,UAAwB,EACxB,MAAc,EAC/B,cAAiC,EAChB,OAAgB;QAHhB,eAAU,GAAV,UAAU,CAAc;QACxB,WAAM,GAAN,MAAM,CAAQ;QAEd,YAAO,GAAP,OAAO,CAAS;QAEjC,IAAI,CAAC,UAAU,GAAG,cAAc;YAC9B,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACrF,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;IACnE,CAAC;IAEO,SAAS,CAAC,IAAY;QAC5B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,IAAI,CACtD,IAAI,YAAY,CAAC;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,IAAI;YACf,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjE,CAAC,EACF,UAAU,CACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DispatchPort } from '../dispatch/DispatchPort.js';
|
|
2
|
-
import type { FrondCall, Transport } from '../wire/call.js';
|
|
3
|
-
import type { InvocationContext } from '../contract/Invocation.js';
|
|
4
|
-
/** Object entry for the historical transport contract. */
|
|
5
|
-
export declare class TransportEntry {
|
|
6
|
-
private readonly dispatcher;
|
|
7
|
-
private readonly surface?;
|
|
8
|
-
constructor(dispatcher: DispatchPort, surface?: string | undefined);
|
|
9
|
-
receive(legacy: FrondCall, invocation: InvocationContext): Promise<unknown>;
|
|
10
|
-
}
|
|
11
|
-
/** Adapt the historical transport signature to the canonical dispatch port. */
|
|
12
|
-
export declare function createTransportEntry(dispatcher: DispatchPort, surface?: string): Transport;
|
|
13
|
-
//# sourceMappingURL=TransportEntry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransportEntry.d.ts","sourceRoot":"","sources":["../../src/entry/TransportEntry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,0DAA0D;AAC1D,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;gBADR,UAAU,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,MAAM,YAAA;IAGnC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;CAU5E;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAG1F"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Call } from '../contract/Call.js';
|
|
2
|
-
import { RouteAddress } from '../contract/RouteAddress.js';
|
|
3
|
-
/** Object entry for the historical transport contract. */
|
|
4
|
-
export class TransportEntry {
|
|
5
|
-
dispatcher;
|
|
6
|
-
surface;
|
|
7
|
-
constructor(dispatcher, surface) {
|
|
8
|
-
this.dispatcher = dispatcher;
|
|
9
|
-
this.surface = surface;
|
|
10
|
-
}
|
|
11
|
-
receive(legacy, invocation) {
|
|
12
|
-
return this.dispatcher.dispatch(new Call(new RouteAddress({
|
|
13
|
-
entity: legacy.entity,
|
|
14
|
-
operation: legacy.op,
|
|
15
|
-
...(this.surface !== undefined ? { surface: this.surface } : {}),
|
|
16
|
-
}), invocation));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
/** Adapt the historical transport signature to the canonical dispatch port. */
|
|
20
|
-
export function createTransportEntry(dispatcher, surface) {
|
|
21
|
-
const entry = new TransportEntry(dispatcher, surface);
|
|
22
|
-
return entry.receive.bind(entry);
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=TransportEntry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransportEntry.js","sourceRoot":"","sources":["../../src/entry/TransportEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAK3D,0DAA0D;AAC1D,MAAM,OAAO,cAAc;IAEN;IACA;IAFnB,YACmB,UAAwB,EACxB,OAAgB;QADhB,eAAU,GAAV,UAAU,CAAc;QACxB,YAAO,GAAP,OAAO,CAAS;IAChC,CAAC;IAEJ,OAAO,CAAC,MAAiB,EAAE,UAA6B;QACtD,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,IAAI,CACtC,IAAI,YAAY,CAAC;YACf,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,MAAM,CAAC,EAAE;YACpB,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjE,CAAC,EACF,UAAU,CACX,CAAC,CAAC;IACL,CAAC;CACF;AAED,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB,CAAC,UAAwB,EAAE,OAAgB;IAC7E,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/orm.d.ts
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { type SchemaView } from '@fougere/schema';
|
|
2
|
-
/** Options for list queries — pagination, sorting, counting. */
|
|
3
|
-
export interface ListOptions {
|
|
4
|
-
/** Number of records to return. */
|
|
5
|
-
limit?: number;
|
|
6
|
-
/** Offset-based: skip N records. */
|
|
7
|
-
offset?: number;
|
|
8
|
-
/** Page-based: 1-indexed page number (requires limit). */
|
|
9
|
-
page?: number;
|
|
10
|
-
/** Cursor-based: fetch records after this ID. */
|
|
11
|
-
after?: string;
|
|
12
|
-
/** Field name to order by. */
|
|
13
|
-
orderBy?: string;
|
|
14
|
-
/** Sort direction (default: 'asc'). */
|
|
15
|
-
order?: 'asc' | 'desc';
|
|
16
|
-
/** If true, also returns total count (for pagination UIs). */
|
|
17
|
-
count?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Equality criteria, field by field — `{ orderId: '…' }`. Named rather than spread
|
|
20
|
-
* across the options so an unknown key stays ignored instead of silently becoming a
|
|
21
|
-
* filter. `listBy(criteria)` is the same thing said as an intention.
|
|
22
|
-
*/
|
|
23
|
-
where?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
/** Result of list() — extends Array so it's backward compatible. */
|
|
26
|
-
export interface ListResult<T> extends Array<T> {
|
|
27
|
-
/** Total number of matching records (only set when count: true). */
|
|
28
|
-
total?: number;
|
|
29
|
-
/** Cursor of the last item (for cursor-based pagination). */
|
|
30
|
-
endCursor?: string;
|
|
31
|
-
/** Whether more records exist after endCursor. */
|
|
32
|
-
hasMore?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/** Refuse an option the port does not answer to, naming it and what was expected. */
|
|
35
|
-
export declare function assertListOptions(options: object | undefined, entity: string): void;
|
|
36
|
-
/** Select option — restrict returned fields to those of a SchemaView. */
|
|
37
|
-
export interface SelectOption {
|
|
38
|
-
select?: SchemaView;
|
|
39
|
-
}
|
|
40
|
-
/** Per-entity ORM — scoped CRUD operations on a single entity type. */
|
|
41
|
-
export interface EntityOrm<T = Record<string, unknown>> {
|
|
42
|
-
list(options?: ListOptions & SelectOption): Promise<ListResult<T>>;
|
|
43
|
-
findById(id: string, options?: SelectOption): Promise<T | undefined>;
|
|
44
|
-
/**
|
|
45
|
-
* Read by criteria — `findBy({ email })` for the one, `findAllBy({ orderId })` for the
|
|
46
|
-
* many, which is what a one-to-many relation *is*.
|
|
47
|
-
*
|
|
48
|
-
* Both existed on the SQL implementation from the start and neither was declared here.
|
|
49
|
-
* A port that hides what it offers is a port nobody can use: `auth-better` cast its way
|
|
50
|
-
* in (`orm as OrmWithFindBy`), a presenter that needed the lines of an order read the
|
|
51
|
-
* whole table instead, and the GraphQL relation resolver passed criteria to `list()`
|
|
52
|
-
* — which drops what it does not know.
|
|
53
|
-
*/
|
|
54
|
-
findBy(criteria: Partial<T> | Record<string, unknown>, options?: SelectOption): Promise<T | undefined>;
|
|
55
|
-
findAllBy(criteria: Partial<T> | Record<string, unknown>, options?: SelectOption): Promise<T[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Read a SET of rows by their key, in one go — the gesture every other one was
|
|
58
|
-
* being bent into.
|
|
59
|
-
*
|
|
60
|
-
* `findAllBy` compares with `=`, so a list of ids could not be passed to it; the
|
|
61
|
-
* only way to read N rows was `list()` then filter in memory, which is what 14 of
|
|
62
|
-
* 14 handlers of a real app measured on 2026-08-14 were doing. It is invisible on
|
|
63
|
-
* SQLite and it is the whole table the day the rows are not local.
|
|
64
|
-
*
|
|
65
|
-
* It answers a MAP, because the caller holds keys and not positions: a page zips
|
|
66
|
-
* against it by `get(row.authorId)`, a miss is the absence of a key, and a repeated
|
|
67
|
-
* key is one entry. The list form this replaced promised that zip and could not
|
|
68
|
-
* keep it — dropping a miss shifts every later position — so each caller rebuilt
|
|
69
|
-
* the very index the implementation had just thrown away.
|
|
70
|
-
*/
|
|
71
|
-
findByKeys(ids: readonly string[], options?: SelectOption): Promise<Map<string, T>>;
|
|
72
|
-
/**
|
|
73
|
-
* Its dual: the rows that point AT each of these keys, grouped by the one they point at.
|
|
74
|
-
*
|
|
75
|
-
* `findByKeys` answers the side a row designates — one each, at most. This answers the
|
|
76
|
-
* side that designates the row — several each, and a key with none is simply absent.
|
|
77
|
-
* Together they are both directions of a relation, each in one query.
|
|
78
|
-
*
|
|
79
|
-
* Written because the page-shaped gesture only covered one of them: a presenter holding
|
|
80
|
-
* its page and wanting "the items of these lists" had no vocabulary for it and read the
|
|
81
|
-
* whole table instead, measured on a real app. `field` names the foreign key on THIS
|
|
82
|
-
* entity, the one carrying the value.
|
|
83
|
-
*/
|
|
84
|
-
findAllByKeys(field: string, keys: readonly string[], options?: SelectOption): Promise<Map<string, T[]>>;
|
|
85
|
-
create(input: Partial<T>, options?: SelectOption): Promise<T>;
|
|
86
|
-
/**
|
|
87
|
-
* Write the row, or make the existing one look like this — one statement.
|
|
88
|
-
*
|
|
89
|
-
* What an import needs and the port did not have: `create` throws on the second run,
|
|
90
|
-
* so re-reading a source meant deleting first. Measured pulling an API twice.
|
|
91
|
-
*
|
|
92
|
-
* The key and the creation stamps survive an overwrite — a row keeps the moment it
|
|
93
|
-
* appeared. An engine with no upsert clause refuses by name rather than emulating
|
|
94
|
-
* one with a read in front, which would promise an atomicity it has not got.
|
|
95
|
-
*/
|
|
96
|
-
upsert(input: Partial<T>, options?: SelectOption): Promise<T>;
|
|
97
|
-
/**
|
|
98
|
-
* A whole page in one statement — what an import writes through.
|
|
99
|
-
*
|
|
100
|
-
* Row by row, 500 rows were 500 statements (measured); the shape of an import is a
|
|
101
|
-
* page, so the write is one too. Answers how many rows were written rather than the
|
|
102
|
-
* rows: `create` hands back the complete row because a caller acts on it, and an
|
|
103
|
-
* import acts on none of them — re-reading a page for a symmetry nobody uses would
|
|
104
|
-
* double the work.
|
|
105
|
-
*/
|
|
106
|
-
upsertAll(inputs: readonly Partial<T>[], options?: SelectOption): Promise<number>;
|
|
107
|
-
update(id: string, input: Partial<T>, options?: SelectOption): Promise<T>;
|
|
108
|
-
delete(id: string): Promise<boolean>;
|
|
109
|
-
/** Returns a scoped ORM that restricts all read results to the fields of the given schema. */
|
|
110
|
-
output(schema: SchemaView): EntityOrm<T>;
|
|
111
|
-
/**
|
|
112
|
-
* What this ORM wraps — the Kysely instance for the SQL one, something else elsewhere.
|
|
113
|
-
*
|
|
114
|
-
* Every judge sits on the ORM's own methods, so a statement issued here meets none of
|
|
115
|
-
* them: a value the entity refuses lands in the table without a word. It is the port's
|
|
116
|
-
* own escape hatch rather than a handle on the side, so it keeps the scope the container
|
|
117
|
-
* gave you — `productOrm.client` reaches the products, not the whole database.
|
|
118
|
-
*
|
|
119
|
-
* `unknown` on purpose: the client belongs to the implementation, and narrowing it is
|
|
120
|
-
* the caller saying out loud which one they are standing on.
|
|
121
|
-
*/
|
|
122
|
-
readonly client: unknown;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Factory that creates an EntityOrm for a given entity.
|
|
126
|
-
* Called by bootstrap for every scanned entity.
|
|
127
|
-
*/
|
|
128
|
-
export type OrmFactory = (entity: SchemaView, name: string) => EntityOrm;
|
|
129
|
-
/**
|
|
130
|
-
* Container key of an entity's storage — 'reading' → 'ReadingOrm'.
|
|
131
|
-
*
|
|
132
|
-
* The twin of {@link repositoryKeyOf} and of `facadeKeyOf`: the key of a thing
|
|
133
|
-
* lives with the thing. This one was spelled by hand in four places in
|
|
134
|
-
* `bootstrap.ts` and a fifth in `scanner.ts` — where the SCAN derives what a
|
|
135
|
-
* constructor asks for. Two readers of one convention, neither of them naming it,
|
|
136
|
-
* so a rename would have moved one and left the other resolving to nothing.
|
|
137
|
-
*/
|
|
138
|
-
export declare function ormKeyOf(entity: string): string;
|
|
139
|
-
/**
|
|
140
|
-
* `Together<[Account, Ledger]>` — writes that stand or fall as one.
|
|
141
|
-
*
|
|
142
|
-
* `EntityOrm` is the port whose every gesture is ONE statement, and one statement is
|
|
143
|
-
* atomic in every engine. This is the port whose unit is a BLOCK: what the callback did
|
|
144
|
-
* happens entirely, or not at all. Nothing else separates them — the arity of the unit
|
|
145
|
-
* of work is the whole distinction, which is why this lives here and not in a file of
|
|
146
|
-
* its own.
|
|
147
|
-
*
|
|
148
|
-
* ```ts
|
|
149
|
-
* constructor(private together: Together<[Account, Ledger]>) {}
|
|
150
|
-
*
|
|
151
|
-
* await this.together.run(async ([accounts, ledger]) => {
|
|
152
|
-
* await accounts.update(from, { balance: b - amount });
|
|
153
|
-
* await ledger.create({ from, to, amount });
|
|
154
|
-
* });
|
|
155
|
-
* ```
|
|
156
|
-
*
|
|
157
|
-
* **The second list is providers**, rebuilt inside the frame so that what THEY write is
|
|
158
|
-
* covered too — a `Mirror` writes its pages through `EntityOrm<T>`, so naming it puts
|
|
159
|
-
* them under the same unwind, with no locator and no second injection path:
|
|
160
|
-
*
|
|
161
|
-
* ```ts
|
|
162
|
-
* constructor(private together: Together<[RateCard, Ledger], [RateMirror]>) {}
|
|
163
|
-
*
|
|
164
|
-
* await this.together.run(async ([rates, ledger], [mirror]) => { await mirror.refresh(); });
|
|
165
|
-
* ```
|
|
166
|
-
*
|
|
167
|
-
* Two lists rather than one, because in a signature an entity and a provider are both
|
|
168
|
-
* written as a class name and their instance types do not separate them — the type would
|
|
169
|
-
* have to guess, by looking for methods or for a brand, and both answers are worse than
|
|
170
|
-
* saying it. They are two different facts anyway: what the unwind covers, and what is
|
|
171
|
-
* rebuilt to make that true.
|
|
172
|
-
*
|
|
173
|
-
* **All or nothing is the promise; isolation is not.** On one engine the members are
|
|
174
|
-
* rebuilt over a transaction and the engine gives both. Across engines a transaction
|
|
175
|
-
* cannot exist, so the frame keeps the before-image of each write and replays the
|
|
176
|
-
* inverse in reverse order — the unwind holds, the isolation does not, and a reader
|
|
177
|
-
* between two writes sees the half. The boot says which of the two it built rather
|
|
178
|
-
* than letting the author assume the stronger one.
|
|
179
|
-
*/
|
|
180
|
-
export interface Together<E extends readonly unknown[], P extends readonly unknown[] = []> {
|
|
181
|
-
run<R>(fn: (entities: {
|
|
182
|
-
[K in keyof E]: EntityOrm<E[K]>;
|
|
183
|
-
}, providers: P) => Promise<R>): Promise<R>;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* The container key of a frame — `[['Account', 'Ledger'], ['RateMirror']]` →
|
|
187
|
-
* 'Account+Ledger|RateMirrorTogether'.
|
|
188
|
-
*
|
|
189
|
-
* The DECLARED order, not a sorted one. The tuples are what the callback destructures, so
|
|
190
|
-
* reordering here would hand `[ledger, accounts]` to a signature that says the opposite —
|
|
191
|
-
* the type and the runtime disagreeing about the same line. Two orders of one frame are
|
|
192
|
-
* therefore two keys and two registrations; they cost nothing, a frame holding no state
|
|
193
|
-
* between runs.
|
|
194
|
-
*/
|
|
195
|
-
export declare function togetherKeyOf(entities: readonly string[], providers?: readonly string[]): string;
|
|
196
|
-
/**
|
|
197
|
-
* The members behind a frame key, or `undefined` when the key is not one.
|
|
198
|
-
*
|
|
199
|
-
* The dual of the line above, and here for the reason `factOfEmitKey` is: the boot reads
|
|
200
|
-
* the key back out of a handler's `deps` to know which frames to build. A key and the way
|
|
201
|
-
* to undo it belong together — the pair that is split is the pair that drifts.
|
|
202
|
-
*/
|
|
203
|
-
export declare function membersOfTogetherKey(key: string): {
|
|
204
|
-
entities: string[];
|
|
205
|
-
providers: string[];
|
|
206
|
-
} | undefined;
|
|
207
|
-
//# sourceMappingURL=orm.d.ts.map
|
package/dist/orm.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orm.d.ts","sourceRoot":"","sources":["../src/orm.ts"],"names":[],"mappings":"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"}
|