@fougere/core 0.3.0-alpha.0 → 0.5.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.js +1 -1
- package/dist/boot/Emissions.js.map +1 -1
- package/dist/boot/HandlerFacade.js +2 -2
- package/dist/boot/HandlerFacade.js.map +1 -1
- package/dist/boot/apply.d.ts.map +1 -1
- package/dist/boot/apply.js +2 -12
- package/dist/boot/apply.js.map +1 -1
- package/dist/boot/binding.d.ts +1 -1
- package/dist/boot/binding.d.ts.map +1 -1
- package/dist/boot/binding.js +4 -4
- package/dist/boot/binding.js.map +1 -1
- package/dist/boot/boot.d.ts +1 -1
- package/dist/boot/boot.d.ts.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +26 -17
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/frame.d.ts +1 -1
- package/dist/boot/frame.d.ts.map +1 -1
- package/dist/boot/frame.js +5 -14
- package/dist/boot/frame.js.map +1 -1
- package/dist/boot/hosted.d.ts +29 -0
- package/dist/boot/hosted.d.ts.map +1 -0
- package/dist/boot/hosted.js +38 -0
- package/dist/boot/hosted.js.map +1 -0
- package/dist/boot/ownership.d.ts +0 -3
- package/dist/boot/ownership.d.ts.map +1 -1
- package/dist/boot/ownership.js +5 -5
- package/dist/boot/ownership.js.map +1 -1
- package/dist/boot/remote.d.ts +1 -1
- package/dist/boot/remote.d.ts.map +1 -1
- package/dist/boot/remote.js +3 -3
- package/dist/boot/remote.js.map +1 -1
- package/dist/boot/statement-drift.d.ts +24 -0
- package/dist/boot/statement-drift.d.ts.map +1 -0
- package/dist/boot/statement-drift.js +38 -0
- package/dist/boot/statement-drift.js.map +1 -0
- package/dist/boot/together.d.ts.map +1 -1
- package/dist/boot/together.js +6 -6
- package/dist/boot/together.js.map +1 -1
- package/dist/boot/types.d.ts +17 -4
- package/dist/boot/types.d.ts.map +1 -1
- package/dist/contract/CallLog.d.ts +57 -0
- package/dist/contract/CallLog.d.ts.map +1 -0
- package/dist/contract/CallLog.js +2 -0
- package/dist/contract/CallLog.js.map +1 -0
- package/dist/contract.d.ts +9 -4
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +12 -5
- package/dist/contract.js.map +1 -1
- package/dist/dispatch/DispatchLifecycle.d.ts +9 -1
- package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
- package/dist/dispatch/DispatchLifecycle.js +17 -2
- package/dist/dispatch/DispatchLifecycle.js.map +1 -1
- package/dist/dispatch/InFlight.d.ts +0 -1
- package/dist/dispatch/InFlight.d.ts.map +1 -1
- package/dist/dispatch/InFlight.js +0 -3
- package/dist/dispatch/InFlight.js.map +1 -1
- package/dist/dispatch/InputValidator.d.ts.map +1 -1
- package/dist/dispatch/InputValidator.js +3 -2
- package/dist/dispatch/InputValidator.js.map +1 -1
- package/dist/dispatch/OutputProjector.js +2 -2
- package/dist/dispatch/OutputProjector.js.map +1 -1
- package/dist/dispatch/StorageGuard.d.ts.map +1 -1
- package/dist/dispatch/StorageGuard.js +2 -2
- package/dist/dispatch/StorageGuard.js.map +1 -1
- package/dist/effective-operation.d.ts.map +1 -1
- package/dist/effective-operation.js +8 -5
- package/dist/effective-operation.js.map +1 -1
- package/dist/emit.d.ts +2 -2
- package/dist/emit.d.ts.map +1 -1
- package/dist/emit.js +2 -2
- package/dist/emit.js.map +1 -1
- package/dist/identity.js +1 -1
- package/dist/identity.js.map +1 -1
- package/dist/imports.d.ts +1 -1
- package/dist/imports.d.ts.map +1 -1
- package/dist/imports.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +2 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2 -0
- package/dist/node.js.map +1 -1
- package/dist/orm.d.ts.map +1 -1
- package/dist/orm.js +4 -4
- package/dist/orm.js.map +1 -1
- package/dist/prefab/collector.js +2 -2
- package/dist/prefab/collector.js.map +1 -1
- package/dist/prefab/mirror.d.ts.map +1 -1
- package/dist/prefab/mirror.js +2 -2
- package/dist/prefab/mirror.js.map +1 -1
- package/dist/prefab/presenter.d.ts.map +1 -1
- package/dist/prefab/presenter.js +2 -2
- package/dist/prefab/presenter.js.map +1 -1
- package/dist/prefab/repository.d.ts.map +1 -1
- package/dist/prefab/repository.js +2 -2
- package/dist/prefab/repository.js.map +1 -1
- package/dist/scan/bundling.d.ts +14 -0
- package/dist/scan/bundling.d.ts.map +1 -0
- package/dist/scan/bundling.js +26 -0
- package/dist/scan/bundling.js.map +1 -0
- package/dist/scan/declare.d.ts +71 -0
- package/dist/scan/declare.d.ts.map +1 -0
- package/dist/scan/declare.js +125 -0
- package/dist/scan/declare.js.map +1 -0
- package/dist/scan/emit.d.ts.map +1 -1
- package/dist/scan/emit.js +3 -2
- package/dist/scan/emit.js.map +1 -1
- package/dist/scan/handler-parser.d.ts +2 -0
- package/dist/scan/handler-parser.d.ts.map +1 -1
- package/dist/scan/handler-parser.js +52 -13
- package/dist/scan/handler-parser.js.map +1 -1
- package/dist/scan/scanner.d.ts.map +1 -1
- package/dist/scan/scanner.js +37 -11
- package/dist/scan/scanner.js.map +1 -1
- package/dist/scan/statement.d.ts +4 -0
- package/dist/scan/statement.d.ts.map +1 -0
- package/dist/scan/statement.js +112 -0
- package/dist/scan/statement.js.map +1 -0
- package/dist/verify.js +2 -2
- package/dist/verify.js.map +1 -1
- package/dist/wire/call.d.ts +19 -8
- package/dist/wire/call.d.ts.map +1 -1
- package/dist/wire/call.js +17 -6
- package/dist/wire/call.js.map +1 -1
- package/dist/wire/drift.d.ts +55 -0
- package/dist/wire/drift.d.ts.map +1 -0
- package/dist/wire/drift.js +121 -0
- package/dist/wire/drift.js.map +1 -0
- package/dist/wire/middleware.d.ts +1 -1
- package/dist/wire/middleware.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/boot/AppLifecycle.ts +50 -0
- package/src/boot/Emissions.ts +263 -0
- package/src/boot/HandlerFacade.ts +242 -0
- package/src/boot/ambient-port.ts +41 -0
- package/src/boot/ambient.als.ts +43 -0
- package/src/boot/ambient.queue.ts +75 -0
- package/src/boot/apply.ts +47 -0
- package/src/boot/auth.ts +55 -0
- package/src/boot/binding.ts +182 -0
- package/src/boot/boot.ts +125 -0
- package/src/boot/bootstrap.ts +847 -0
- package/src/boot/frame.ts +210 -0
- package/src/boot/hosted.ts +77 -0
- package/src/boot/ownership.ts +137 -0
- package/src/boot/ports.ts +66 -0
- package/src/boot/remote.ts +179 -0
- package/src/boot/seed.ts +158 -0
- package/src/boot/statement-drift.ts +60 -0
- package/src/boot/together.ts +215 -0
- package/src/boot/types.ts +274 -0
- package/src/builtins/config.ts +19 -0
- package/src/builtins/logger.ts +175 -0
- package/src/config-loader.ts +146 -0
- package/src/contract/Call.ts +18 -0
- package/src/contract/CallLog.ts +55 -0
- package/src/contract/Invocation.ts +72 -0
- package/src/contract/RouteAddress.ts +49 -0
- package/src/contract.ts +83 -0
- package/src/crypto/encoding.ts +59 -0
- package/src/crypto/node.ts +30 -0
- package/src/crypto/port.ts +45 -0
- package/src/crypto/webcrypto.ts +55 -0
- package/src/define.ts +10 -0
- package/src/dispatch/ArgumentResolver.ts +17 -0
- package/src/dispatch/ArrayResult.ts +10 -0
- package/src/dispatch/DispatchEvent.ts +38 -0
- package/src/dispatch/DispatchLifecycle.ts +43 -0
- package/src/dispatch/DispatchPort.ts +6 -0
- package/src/dispatch/Dispatcher.ts +48 -0
- package/src/dispatch/InFlight.ts +45 -0
- package/src/dispatch/InputValidator.ts +28 -0
- package/src/dispatch/LocalRoutePolicy.ts +34 -0
- package/src/dispatch/OperationExecutor.ts +60 -0
- package/src/dispatch/OperationRoute.ts +18 -0
- package/src/dispatch/OutputProjector.ts +32 -0
- package/src/dispatch/OutputView.ts +9 -0
- package/src/dispatch/PresenterArgumentResolver.ts +25 -0
- package/src/dispatch/PresenterExecutor.ts +55 -0
- package/src/dispatch/RemoteRouteResolver.ts +21 -0
- package/src/dispatch/Route.ts +11 -0
- package/src/dispatch/RouteNotFoundError.ts +29 -0
- package/src/dispatch/RoutePolicy.ts +8 -0
- package/src/dispatch/RouteRegistry.ts +73 -0
- package/src/dispatch/RouteResolver.ts +7 -0
- package/src/dispatch/StorageGuard.ts +71 -0
- package/src/effective-operation.ts +601 -0
- package/src/emit.ts +90 -0
- package/src/entry/DynamicFacade.ts +28 -0
- package/src/entry/FacadeEntry.ts +32 -0
- package/src/entry/TransportEntry.ts +30 -0
- package/src/frond-config.ts +138 -0
- package/src/graph.ts +180 -0
- package/src/identity-keys.ts +43 -0
- package/src/identity.ts +235 -0
- package/src/imports.ts +123 -0
- package/src/index.ts +120 -0
- package/src/loader.ts +41 -0
- package/src/node.ts +30 -0
- package/src/orm.ts +252 -0
- package/src/prefab/collector.ts +36 -0
- package/src/prefab/crud.ts +188 -0
- package/src/prefab/mirror.ts +122 -0
- package/src/prefab/prefab.ts +46 -0
- package/src/prefab/presenter.ts +63 -0
- package/src/prefab/repository.ts +170 -0
- package/src/scan/Fronds.ts +73 -0
- package/src/scan/bundling.ts +25 -0
- package/src/scan/conventions.ts +122 -0
- package/src/scan/declare.ts +188 -0
- package/src/scan/emit.ts +231 -0
- package/src/scan/frond.ts +235 -0
- package/src/scan/handler-parser.ts +817 -0
- package/src/scan/scanner.ts +757 -0
- package/src/scan/statement.ts +126 -0
- package/src/verify.ts +193 -0
- package/src/wire/call.ts +381 -0
- package/src/wire/drift.ts +131 -0
- package/src/wire/errors.ts +124 -0
- package/src/wire/http-error.ts +77 -0
- package/src/wire/loggerMiddleware.ts +29 -0
- package/src/wire/middleware.ts +47 -0
- package/src/wire/operation.ts +258 -0
- package/dist/boot/Lifecycle.d.ts +0 -4
- package/dist/boot/Lifecycle.d.ts.map +0 -1
- package/dist/boot/Lifecycle.js +0 -3
- package/dist/boot/Lifecycle.js.map +0 -1
- package/dist/boot/egress.d.ts +0 -8
- package/dist/boot/egress.d.ts.map +0 -1
- package/dist/boot/egress.js +0 -11
- package/dist/boot/egress.js.map +0 -1
- package/dist/scan/scan-cache.d.ts +0 -16
- package/dist/scan/scan-cache.d.ts.map +0 -1
- package/dist/scan/scan-cache.js +0 -99
- package/dist/scan/scan-cache.js.map +0 -1
- package/dist/wire/invocation.d.ts +0 -4
- package/dist/wire/invocation.d.ts.map +0 -1
- package/dist/wire/invocation.js +0 -3
- package/dist/wire/invocation.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What this app hosts — what it STATED, or what a scan FOUND.
|
|
3
|
+
*
|
|
4
|
+
* The PRESENCE of the key is the decision, the way `remotes:` states a topology: an app
|
|
5
|
+
* that passes `fronds:` is saying "do not scan", and one that passes `scan:` is handing
|
|
6
|
+
* over what a scanner read. There is no mode to configure because there is no third
|
|
7
|
+
* behaviour to name.
|
|
8
|
+
*
|
|
9
|
+
* Both may arrive, and then they MERGE — but only where a scan costs nothing at runtime.
|
|
10
|
+
* Under Nuxt the scan is a build artifact, so an app may state the frond it wants to own
|
|
11
|
+
* and leave the rest to what the build found. Anywhere the scan would run at START, half a
|
|
12
|
+
* statement buys nothing the whole one does: the disk is read either way.
|
|
13
|
+
*
|
|
14
|
+
* Merging is per frond NAME and per member. A stated frond wins outright on the members it
|
|
15
|
+
* names — stating `entities: [Post]` where a scan found `[Post, Author]` yields `[Post]`,
|
|
16
|
+
* because the point of stating is to decide. Empty is what "I named none" looks like, and
|
|
17
|
+
* `frond()` builds every member, so an empty one is filled rather than enforced.
|
|
18
|
+
*/
|
|
19
|
+
import type { FrondDescriptor, ScanResult } from '../scan/frond.js';
|
|
20
|
+
/** Where an app's fronds come from — either, or both. */
|
|
21
|
+
export interface HostedSources {
|
|
22
|
+
/** What the app states. No disk was read, so no diagnostic can come from it. */
|
|
23
|
+
fronds?: readonly FrondDescriptor[];
|
|
24
|
+
/** What a scanner found, and what it could not do. */
|
|
25
|
+
scan?: ScanResult | (() => Promise<ScanResult> | ScanResult);
|
|
26
|
+
}
|
|
27
|
+
/** What the app hosts, and what the scan — if it ran — could not do. */
|
|
28
|
+
export declare function hostedBy(sources: HostedSources): Promise<ScanResult>;
|
|
29
|
+
//# sourceMappingURL=hosted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted.d.ts","sourceRoot":"","sources":["../../src/boot/hosted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGpE,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,sDAAsD;IACtD,IAAI,CAAC,EAAE,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC;CAC9D;AA2BD,wEAAwE;AACxE,wBAAsB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAqB1E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Fronds } from '../scan/Fronds.js';
|
|
2
|
+
/** A stated frond, completed by what a scan found under the same name. */
|
|
3
|
+
function completed(stated, found) {
|
|
4
|
+
if (!found)
|
|
5
|
+
return stated;
|
|
6
|
+
// Written out rather than looped: a loop over the key union asks TypeScript to prove
|
|
7
|
+
// `found[k]` fits `stated[k]` for every k at once, which it cannot — and the cast that
|
|
8
|
+
// silences it would also silence a member added to the descriptor and forgotten here.
|
|
9
|
+
const fill = (member) => (stated[member].length === 0 ? found[member] : stated[member]);
|
|
10
|
+
return {
|
|
11
|
+
...found,
|
|
12
|
+
...stated,
|
|
13
|
+
providers: fill('providers'),
|
|
14
|
+
entities: fill('entities'),
|
|
15
|
+
handlers: fill('handlers'),
|
|
16
|
+
presenters: fill('presenters'),
|
|
17
|
+
collectors: fill('collectors'),
|
|
18
|
+
seeds: fill('seeds'),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** What the app hosts, and what the scan — if it ran — could not do. */
|
|
22
|
+
export async function hostedBy(sources) {
|
|
23
|
+
const scanned = sources.scan
|
|
24
|
+
? await (typeof sources.scan === 'function' ? sources.scan() : sources.scan)
|
|
25
|
+
: undefined;
|
|
26
|
+
if (!sources.fronds) {
|
|
27
|
+
if (!scanned) {
|
|
28
|
+
throw new Error('createApp needs `fronds:` (what this app states) or `scan:` (what a scanner found). '
|
|
29
|
+
+ 'Neither was given, so nothing is hosted.');
|
|
30
|
+
}
|
|
31
|
+
return scanned;
|
|
32
|
+
}
|
|
33
|
+
const found = scanned?.fronds ?? [];
|
|
34
|
+
const stated = sources.fronds.map((f) => completed(f, found.find((s) => s.name === f.name)));
|
|
35
|
+
const unstated = found.filter((f) => !sources.fronds.some((s) => s.name === f.name));
|
|
36
|
+
return { fronds: Fronds.scanned([...stated, ...unstated]), diagnostics: scanned?.diagnostics ?? [] };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=hosted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted.js","sourceRoot":"","sources":["../../src/boot/hosted.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAa3C,0EAA0E;AAC1E,SAAS,SAAS,CAAC,MAAuB,EAAE,KAAkC;IAC5E,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAC;IAE1B,qFAAqF;IACrF,uFAAuF;IACvF,sFAAsF;IACtF,MAAM,IAAI,GAAG,CAAqB,MAAS,EAAsB,EAAE,CACjE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAEjE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CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtF,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,EAAE,EAAE,CAAC;AACvG,CAAC"}
|
package/dist/boot/ownership.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type EntityConstructor } from '@fougere/schema';
|
|
2
1
|
import type { FrondDescriptor, ProviderEntry } from '../scan/frond.js';
|
|
3
2
|
/**
|
|
4
3
|
* Who owns an entity's storage.
|
|
@@ -37,6 +36,4 @@ export declare function refuseOrmInUserCode(frond: FrondDescriptor, owners: Map<
|
|
|
37
36
|
* `findById` needs storage of its own, whether `Crud()` put them there or an author did.
|
|
38
37
|
*/
|
|
39
38
|
export declare function refuseCrudOnOwned(frond: FrondDescriptor, owners: Map<string, string>): void;
|
|
40
|
-
/** Placeholder so the module's imports stay honest if a caller wants the entity list. */
|
|
41
|
-
export type { EntityConstructor };
|
|
42
39
|
//# sourceMappingURL=ownership.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBjF;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAoC7F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAiB3F"}
|
package/dist/boot/ownership.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { lowerFirst } from '@fougere/schema';
|
|
2
2
|
import { targetOf } from '../prefab/prefab.js';
|
|
3
3
|
import { ownedBy, repositoryKeyOf } from '../prefab/repository.js';
|
|
4
4
|
import { ormKeyOf } from '../orm.js';
|
|
@@ -17,7 +17,7 @@ export function ownersOf(providers) {
|
|
|
17
17
|
if (owned.length < 2)
|
|
18
18
|
continue;
|
|
19
19
|
for (const entity of owned) {
|
|
20
|
-
const name =
|
|
20
|
+
const name = lowerFirst(entity.name);
|
|
21
21
|
const first = owners.get(name);
|
|
22
22
|
if (first && first !== provider.ctor.name) {
|
|
23
23
|
// Refused rather than settled, for the reason `ports:` refuses two implementations
|
|
@@ -38,9 +38,9 @@ export function ownersOf(providers) {
|
|
|
38
38
|
function builtOn(ctor) {
|
|
39
39
|
const owned = ownedBy(ctor);
|
|
40
40
|
if (owned.length > 0)
|
|
41
|
-
return owned.map((e) =>
|
|
41
|
+
return owned.map((e) => lowerFirst(e.name));
|
|
42
42
|
const target = targetOf(ctor);
|
|
43
|
-
return target?.name ? [
|
|
43
|
+
return target?.name ? [lowerFirst(target.name)] : [];
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* `EntityOrm<E>` is not a word of the user's vocabulary — `<E>Repository` is the one way in.
|
|
@@ -121,7 +121,7 @@ export function refuseCrudOnOwned(frond, owners) {
|
|
|
121
121
|
function entityOfOrmKey(dep) {
|
|
122
122
|
if (!dep.endsWith('Orm') || dep === 'Orm')
|
|
123
123
|
return undefined;
|
|
124
|
-
const entity =
|
|
124
|
+
const entity = lowerFirst(dep.slice(0, -'Orm'.length));
|
|
125
125
|
return ormKeyOf(entity) === dep ? entity : undefined;
|
|
126
126
|
}
|
|
127
127
|
//# sourceMappingURL=ownership.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAmC;IAC1D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS;QAC/B,KAAK,MAAM,MAAM,IAAI,KAAK,EAAE,CAAC;YAC3B,MAAM,IAAI,GAAG,UAAU,CAAE,MAA2B,CAAC,IAAI,CAAC,CAAC;YAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC1C,mFAAmF;gBACnF,mFAAmF;gBACnF,8DAA8D;gBAC9D,MAAM,IAAI,KAAK,CACb,eAAe,KAAK,QAAQ,QAAQ,CAAC,IAAI,CAAC,IAAI,aAAa,IAAI,IAAI;s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
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Transport } from '../wire/call.js';
|
|
12
12
|
import { type AppMiddleware } from '../wire/middleware.js';
|
|
13
|
-
import { type InvocationContext } from '../
|
|
13
|
+
import { type InvocationContext } from '../contract/Invocation.js';
|
|
14
14
|
import { type SchemaView } from '@fougere/schema';
|
|
15
15
|
interface Route {
|
|
16
16
|
frond: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAkB,KAAK,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAkB,KAAK,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAErF,OAAO,EAAQ,KAAK,UAAU,EAAyB,MAAM,iBAAiB,CAAC;AAG/E,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACvC;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,GACxC,YAAY,CAkGd;AAED,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,EAAE,GACnD,MAAM,CAYR"}
|
package/dist/boot/remote.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { assertIdentityCard, RPC_ENTITY } from '../wire/call.js';
|
|
2
2
|
import { runMiddlewares } from '../wire/middleware.js';
|
|
3
|
-
import { EMPTY_INVOCATION } from '../
|
|
3
|
+
import { EMPTY_INVOCATION } from '../contract/Invocation.js';
|
|
4
4
|
import { FougereError, ErrorCode } from '../wire/errors.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Card } from '@fougere/schema';
|
|
6
6
|
import { DynamicFacade } from '../entry/DynamicFacade.js';
|
|
7
7
|
export function createRemoteRouter(remotes, makeTransport) {
|
|
8
8
|
const byEntity = new Map();
|
|
@@ -71,7 +71,7 @@ export function createRemoteRouter(remotes, makeTransport) {
|
|
|
71
71
|
byEntity.set(door.name, {
|
|
72
72
|
frond: frond.name,
|
|
73
73
|
transport,
|
|
74
|
-
...(door.schema ? { schema:
|
|
74
|
+
...(door.schema ? { schema: Card.fromDescriptor(door.schema).toSchema() } : {}),
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
}
|
package/dist/boot/remote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/boot/remote.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAA6C,MAAM,uBAAuB,CAA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AAU,kBAAkB,CAChC,MAAc,EACd,MAAoB,EACpB,cAAoD;IAEpD,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,KAAK,EAAE,aAAgC,gBAAgB,EAAE,EAAE;QACtF,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACxD,MAAM,IAAI,GAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAqB;YAC5B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU;SAC5E,CAAC;QACF,OAAO,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CACtD,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;IAEF,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,UAAoB,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a STATED contract and the signature it is about have stopped agreeing.
|
|
3
|
+
*
|
|
4
|
+
* `frond.config.ts` states an operation's contract and wins over the scan — that order is
|
|
5
|
+
* deliberate, and it is the only answer for a method inherited from an installed base class
|
|
6
|
+
* the workspace scan cannot see. But winning silently is how a statement made about
|
|
7
|
+
* `publish(id: string)` keeps applying after the parameter was renamed to `postId`: the
|
|
8
|
+
* façade binds what the config said, the method receives `undefined`, and nothing anywhere
|
|
9
|
+
* says the two disagree.
|
|
10
|
+
*
|
|
11
|
+
* So this compares, and only where BOTH exist — a statement about a signature the scan
|
|
12
|
+
* never read is not drift, it is the case config was built for. It is a `warning` and not
|
|
13
|
+
* a refusal: the statement is still the author's word, and a boot that ran yesterday must
|
|
14
|
+
* not stop running because a parameter moved. What it must not do is stay quiet.
|
|
15
|
+
*/
|
|
16
|
+
import type { FrondDescriptor, HandlerEntry, ScanDiagnostic } from '../scan/frond.js';
|
|
17
|
+
/**
|
|
18
|
+
* What a frond's stated contracts no longer match.
|
|
19
|
+
*
|
|
20
|
+
* Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
|
|
21
|
+
* boot — one comparison, two readers, no second opinion to drift on its own.
|
|
22
|
+
*/
|
|
23
|
+
export declare function statementDrift(frond: FrondDescriptor, handler: HandlerEntry): ScanDiagnostic[];
|
|
24
|
+
//# sourceMappingURL=statement-drift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-drift.d.ts","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAWtF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,EAAE,CA2B9F"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** The parameters a stated binding names, against the ones the method declares. */
|
|
2
|
+
function namesDisagreeing(stated, signature) {
|
|
3
|
+
const declared = new Set(signature.params.map((p) => p.name));
|
|
4
|
+
return stated.map((b) => b.name).filter((name) => !declared.has(name));
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* What a frond's stated contracts no longer match.
|
|
8
|
+
*
|
|
9
|
+
* Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
|
|
10
|
+
* boot — one comparison, two readers, no second opinion to drift on its own.
|
|
11
|
+
*/
|
|
12
|
+
export function statementDrift(frond, handler) {
|
|
13
|
+
const found = [];
|
|
14
|
+
for (const [name, override] of Object.entries(frond.operationsOverrides ?? {})) {
|
|
15
|
+
if (!override.binding)
|
|
16
|
+
continue;
|
|
17
|
+
// The scan's own reading of this method. Absent means config is stating what nothing
|
|
18
|
+
// read — an installed base class, a handler outside the workspace — which is legal.
|
|
19
|
+
const signature = handler.operations.get(name)?.signature;
|
|
20
|
+
if (!signature)
|
|
21
|
+
continue;
|
|
22
|
+
const orphans = namesDisagreeing(override.binding, signature);
|
|
23
|
+
if (orphans.length === 0)
|
|
24
|
+
continue;
|
|
25
|
+
found.push({
|
|
26
|
+
severity: 'warning',
|
|
27
|
+
code: 'stated-binding-drifted',
|
|
28
|
+
filePath: handler.filePath,
|
|
29
|
+
frond: frond.name,
|
|
30
|
+
subject: `${handler.ctor.name}.${name}`,
|
|
31
|
+
message: `frond.config.ts binds ${orphans.map((o) => `\`${o}\``).join(', ')} on `
|
|
32
|
+
+ `${handler.ctor.name}.${name}, which declares (${signature.params.map((p) => p.name).join(', ')}). `
|
|
33
|
+
+ `The statement wins, so those parameters receive nothing.`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return found;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=statement-drift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-drift.js","sourceRoot":"","sources":["../../src/boot/statement-drift.ts"],"names":[],"mappings":"AAmBA,mFAAmF;AACnF,SAAS,gBAAgB,CAAC,MAAmB,EAAE,SAAuB;IACpE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAmB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,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-
{"version":3,"file":"together.d.ts","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"together.d.ts","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAUA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAkD,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,kFAAkF;IAClF,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3F,GAAG,EAAE,MAAM,CAAC;CACb;AAqHD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EACtB,SAAS,EAAE,SAAS,aAAa,EAAE,EACnC,KAAK,EAAE,UAAU,GAChB,IAAI,CAwDN"}
|
package/dist/boot/together.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* one thing a gradient must never leave to assumption.
|
|
9
9
|
*/
|
|
10
10
|
import { ambient } from '#ambient';
|
|
11
|
-
import {
|
|
11
|
+
import { upperFirst, lowerFirst } from '@fougere/schema';
|
|
12
12
|
import { membersOfTogetherKey, ormKeyOf } from '../orm.js';
|
|
13
|
-
import {
|
|
13
|
+
import { StorageGuard } from '../dispatch/StorageGuard.js';
|
|
14
14
|
import { recording, unwind } from './frame.js';
|
|
15
15
|
/**
|
|
16
16
|
* Each declared name, resolved to what it designates.
|
|
@@ -22,7 +22,7 @@ import { recording, unwind } from './frame.js';
|
|
|
22
22
|
*/
|
|
23
23
|
function resolve(names, declared, world) {
|
|
24
24
|
const entities = names.entities.map((member) => {
|
|
25
|
-
const name =
|
|
25
|
+
const name = lowerFirst(member);
|
|
26
26
|
const schema = world.entityByName.get(name);
|
|
27
27
|
if (!schema) {
|
|
28
28
|
throw new Error(`Together<[…${member}…]>: no entity named '${member}' is scanned in this app. ` +
|
|
@@ -69,12 +69,12 @@ function refuseUncoveredWrites(members, key) {
|
|
|
69
69
|
for (const dep of provider.deps) {
|
|
70
70
|
if (!dep.endsWith('Orm'))
|
|
71
71
|
continue;
|
|
72
|
-
const entity =
|
|
72
|
+
const entity = lowerFirst(dep.slice(0, -'Orm'.length));
|
|
73
73
|
if (covered.has(entity))
|
|
74
74
|
continue;
|
|
75
75
|
throw new Error(`Together<[…]> (${key}): ${provider.ctor.name} writes ${entity}, which is not in the ` +
|
|
76
76
|
`frame's entity list — its writes would escape the unwind. Add it: ` +
|
|
77
|
-
`Together<[…, ${
|
|
77
|
+
`Together<[…, ${upperFirst(entity)}], [… ${provider.ctor.name} …]>.`);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -125,7 +125,7 @@ export function registerFrames(scope, keys, providers, world) {
|
|
|
125
125
|
refuseRemote(members, world, key);
|
|
126
126
|
refuseUncoveredWrites(members, key);
|
|
127
127
|
const sources = new Set(members.entities.map((member) => world.sourceOf?.(member.name) ?? 'db'));
|
|
128
|
-
const judge = (orm, name, schema) =>
|
|
128
|
+
const judge = (orm, name, schema) => new StorageGuard(schema.getFields(), name).guard(orm);
|
|
129
129
|
// One engine and a way into it: the engine gives the unwind AND the isolation.
|
|
130
130
|
if (world.transacted && sources.size === 1) {
|
|
131
131
|
const source = [...sources][0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"together.js","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"together.js","sourceRoot":"","sources":["../../src/boot/together.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAmC,MAAM,WAAW,CAAC;AAG5F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAa,MAAM,YAAY,CAAC;AAqB1D;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,KAAkD,EAAE,QAAkC,EAAE,KAAiB;IACxH,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,cAAc,MAAM,yBAAyB,MAAM,4BAA4B;gBAC/E,0EAA0E,CAC3E,CAAC;QACJ,CAAC;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AC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,mBAAmB,GAAG,iBAAiB,CAAC,CAAC;QAC9D,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE;YACvB,GAAG,EAAE,CAAI,EAAqD,EAAc,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;gBAChH,MAAM,OAAO,GAAW,EAAE,CAAC;gBAC3B,MAAM,MAAM,GAAG,CAAC,GAAc,EAAE,IAAY,EAAE,MAAkB,EAAE,EAAE,CAClE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;gBACzE,IAAI,CAAC;oBACH,OAAO,MAAM,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,UAAW,EAAE,MAAM,EAAE,EAAW,CAAC,CAAC;gBAC/E,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,KAAK,CAAC,GAAG,CAAC,IAAI,CACZ,kFAAkF;cAChF,mDAAmD,CACtD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/boot/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { Container } from '@fougere/container';
|
|
9
9
|
import type { Fronds } from '../scan/Fronds.js';
|
|
10
|
-
import type { ScanResult } from '../scan/frond.js';
|
|
10
|
+
import type { FrondDescriptor, ScanResult } from '../scan/frond.js';
|
|
11
11
|
import type { SchemaView } from '@fougere/schema';
|
|
12
12
|
import type { OrmFactory } from '../orm.js';
|
|
13
13
|
import type { AppMiddleware } from '../wire/middleware.js';
|
|
@@ -54,7 +54,16 @@ export interface CreateAppOptions {
|
|
|
54
54
|
* apart, and that is the point: it names no builtin, so a runtime without `node:fs`
|
|
55
55
|
* runs it. `root` and `fronds` used to live here — both were arguments to the scan.
|
|
56
56
|
*/
|
|
57
|
-
scan
|
|
57
|
+
scan?: ScanResult | (() => Promise<ScanResult> | ScanResult);
|
|
58
|
+
/**
|
|
59
|
+
* What this app STATES it hosts — `frond('blog', { entities: [Post] })`.
|
|
60
|
+
*
|
|
61
|
+
* Passing this and not `scan:` is how an app says "do not scan": nothing reads a disk,
|
|
62
|
+
* nothing loads `typescript`, and what was not named does not exist. Passing both fills
|
|
63
|
+
* the members left unnamed from what the scan found — the app's word wins, the way
|
|
64
|
+
* `frond.config.ts` wins over the scan one level down.
|
|
65
|
+
*/
|
|
66
|
+
fronds?: readonly FrondDescriptor[];
|
|
58
67
|
/**
|
|
59
68
|
* Remote fronds — label → address. What each remote hosts is discovered
|
|
60
69
|
* at the first miss (rpc.discover), never declared here.
|
|
@@ -84,7 +93,7 @@ export interface CreateAppOptions {
|
|
|
84
93
|
* empty slot when nothing migrates: a host filling it later REPLACES that member in
|
|
85
94
|
* place instead of adding one after the seeds.
|
|
86
95
|
*/
|
|
87
|
-
extensions?:
|
|
96
|
+
extensions?: readonly (Extension | undefined)[];
|
|
88
97
|
/**
|
|
89
98
|
* Released by `app.dispose()` AFTER the container, for a resource handed in rather
|
|
90
99
|
* than built here — a storage connection is the one case today.
|
|
@@ -138,6 +147,8 @@ export interface App extends DispatchPort {
|
|
|
138
147
|
* the answer is still "not here".
|
|
139
148
|
*/
|
|
140
149
|
adapters: Record<string, boolean | undefined>;
|
|
150
|
+
/** Where a call goes, as the config declared it — frond name to address. */
|
|
151
|
+
remotes: Readonly<Record<string, string>>;
|
|
141
152
|
/** Discovered fronds metadata. */
|
|
142
153
|
fronds: Fronds;
|
|
143
154
|
/** Resolve from root container (shortcut). */
|
|
@@ -145,7 +156,7 @@ export interface App extends DispatchPort {
|
|
|
145
156
|
/**
|
|
146
157
|
* Resolve an entity's schema — the local `entityClass` when it's hosted or
|
|
147
158
|
* scanned here, else reconstructed from the remote's identity card
|
|
148
|
-
* (rpc.discover
|
|
159
|
+
* (`rpc.discover` to `Card.toSchema`). The one way to get a live schema for an
|
|
149
160
|
* entity whose class may not be importable at all (another repo, another
|
|
150
161
|
* language) — a card travelled, but until now its `schema` was thrown away.
|
|
151
162
|
*/
|
|
@@ -251,6 +262,8 @@ export interface App extends DispatchPort {
|
|
|
251
262
|
*/
|
|
252
263
|
serveRpc(op: string, answer: RpcAnswer): void;
|
|
253
264
|
/** Register a global app middleware (runs on every operation). */
|
|
265
|
+
/** Watch every dispatch transition; the returned function unsubscribes. */
|
|
266
|
+
observe(observer: DispatchObserver): () => void;
|
|
254
267
|
use(middleware: AppMiddleware): void;
|
|
255
268
|
/** Register an app middleware scoped to a specific entity. */
|
|
256
269
|
use(entity: string, middleware: AppMiddleware): void;
|
package/dist/boot/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/boot/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/boot/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpE,OA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CAAC;IAC9C,kEAAkE;IAClE,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAAC;IAChD,GAAG,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,8DAA8D;IAC9D,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,IAAI,CAAC;IACrD,oEAAoE;IACpE,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { DispatchEvent } from '../dispatch/DispatchEvent.js';
|
|
2
|
+
/**
|
|
3
|
+
* What crosses the door: the address, the route it took, and the verdict.
|
|
4
|
+
*
|
|
5
|
+
* It lives here rather than beside its producer for the reason `TopologyReport` does: it
|
|
6
|
+
* crosses a process boundary, so a reader that never installed `@fougere/calls` — the CLI
|
|
7
|
+
* — needs its shape, and putting it there is what produces a hand-copied duplicate.
|
|
8
|
+
*
|
|
9
|
+
* Never the body. Same rule the topology report states — a remote destination is named,
|
|
10
|
+
* not disclosed — and it holds here for the same reason: this answer leaves the process.
|
|
11
|
+
*/
|
|
12
|
+
export interface CallRecord {
|
|
13
|
+
/** Monotonic, and the whole cursor protocol: a reader asks for what is above its own. */
|
|
14
|
+
seq: number;
|
|
15
|
+
frond?: string;
|
|
16
|
+
entity: string;
|
|
17
|
+
operation: string;
|
|
18
|
+
surface?: string;
|
|
19
|
+
/** Known at `resolved`, so absent on a call that never found a route. */
|
|
20
|
+
route?: NonNullable<DispatchEvent['routeKind']>;
|
|
21
|
+
/**
|
|
22
|
+
* The traceparent the invocation carried, when one did.
|
|
23
|
+
*
|
|
24
|
+
* One panel reads one process, so this is what lets two of them be sewn: the process
|
|
25
|
+
* that sent and the process that executed share it, and the gap between their two
|
|
26
|
+
* durations IS the cost of the wire rather than a deduction.
|
|
27
|
+
*/
|
|
28
|
+
trace?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The peer that established this call, when one did.
|
|
31
|
+
*
|
|
32
|
+
* A hosted frond serves several consumers, so its own ring mixes them: this is what
|
|
33
|
+
* separates them. Absent on a call nobody signed — a loopback dev boot has no identity.
|
|
34
|
+
*/
|
|
35
|
+
caller?: string;
|
|
36
|
+
startedAt: number;
|
|
37
|
+
/** Known at `settled`. */
|
|
38
|
+
ms?: number;
|
|
39
|
+
verdict: 'running' | 'ok' | 'failed';
|
|
40
|
+
refusal?: {
|
|
41
|
+
code?: string;
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One page of the ring.
|
|
47
|
+
*
|
|
48
|
+
* `dropped` is what the ring could not keep — an absence is named rather than left to
|
|
49
|
+
* look like a quiet period.
|
|
50
|
+
*/
|
|
51
|
+
export interface CallPage {
|
|
52
|
+
calls: CallRecord[];
|
|
53
|
+
cursor: number;
|
|
54
|
+
inFlight: number;
|
|
55
|
+
dropped: number;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=CallLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CallLog.d.ts","sourceRoot":"","sources":["../../src/contract/CallLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,yFAAyF;IACzF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,KAAK,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;IAChD;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC;IACrC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CallLog.js","sourceRoot":"","sources":["../../src/contract/CallLog.ts"],"names":[],"mappings":""}
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { type InvocationContext } from './
|
|
1
|
+
import { type InvocationContext } from './contract/Invocation.js';
|
|
2
2
|
import type { FrondCall } from './wire/call.js';
|
|
3
3
|
export { FougereError, ErrorCode, validationErrorsOf } from './wire/errors.js';
|
|
4
4
|
export { toPublicError } from './wire/http-error.js';
|
|
5
5
|
export type { FougereErrorOptions } from './wire/errors.js';
|
|
6
|
-
export { canonicalInvocation, EMPTY_INVOCATION } from './
|
|
7
|
-
export type { InvocationContext } from './
|
|
6
|
+
export { canonicalInvocation, EMPTY_INVOCATION } from './contract/Invocation.js';
|
|
7
|
+
export type { InvocationContext } from './contract/Invocation.js';
|
|
8
8
|
export { Invocation } from './contract/Invocation.js';
|
|
9
9
|
export type { InvocationInput } from './contract/Invocation.js';
|
|
10
10
|
export { Call } from './contract/Call.js';
|
|
11
11
|
export { RouteAddress } from './contract/RouteAddress.js';
|
|
12
12
|
export type { RouteAddressInput } from './contract/RouteAddress.js';
|
|
13
13
|
export type { FrondCall, Transport, SignedCall } from './wire/call.js';
|
|
14
|
+
export { MAX_BODY_BYTES } from './wire/call.js';
|
|
15
|
+
export { RPC_ENTITY } from './wire/call.js';
|
|
16
|
+
export type { CallPage, CallRecord } from './contract/CallLog.js';
|
|
17
|
+
export { driftOf, agrees, explain } from './wire/drift.js';
|
|
18
|
+
export type { CardDrift } from './wire/drift.js';
|
|
14
19
|
/**
|
|
15
20
|
* What `rpc.discover` answers. It belongs here and not to the runtime: the
|
|
16
21
|
* reserved op travels on the same wire as every other call, so a consumer that
|
|
@@ -31,7 +36,7 @@ export { assertIdentityCard } from './wire/call.js';
|
|
|
31
36
|
* `@fougere/schema` directly: routing four modules through here bought nothing and put
|
|
32
37
|
* this file inside a cycle.
|
|
33
38
|
*/
|
|
34
|
-
export {
|
|
39
|
+
export { lowerFirst } from '@fougere/schema';
|
|
35
40
|
/** A call, fully fabricated: the designation and its completed invocation. */
|
|
36
41
|
export interface CallValue {
|
|
37
42
|
call: FrondCall;
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,E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8,16 +8,23 @@
|
|
|
8
8
|
* bundles never touch the full index (scanner, config loader). `@fougere/schema`
|
|
9
9
|
* is allowed in — measured, it imports no node builtin either.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import { canonicalInvocation } from './
|
|
11
|
+
import { lowerFirst } from '@fougere/schema';
|
|
12
|
+
import { canonicalInvocation } from './contract/Invocation.js';
|
|
13
13
|
export { FougereError, ErrorCode, validationErrorsOf } from './wire/errors.js';
|
|
14
14
|
// A receiver turns a refusal into what may cross a process boundary, and it is not
|
|
15
15
|
// core's boot — reaching it through the main entry dragged the scanner into a bundle.
|
|
16
16
|
export { toPublicError } from './wire/http-error.js';
|
|
17
|
-
export { canonicalInvocation, EMPTY_INVOCATION } from './
|
|
17
|
+
export { canonicalInvocation, EMPTY_INVOCATION } from './contract/Invocation.js';
|
|
18
18
|
export { Invocation } from './contract/Invocation.js';
|
|
19
19
|
export { Call } from './contract/Call.js';
|
|
20
20
|
export { RouteAddress } from './contract/RouteAddress.js';
|
|
21
|
+
export { MAX_BODY_BYTES } from './wire/call.js';
|
|
22
|
+
// The reserved entity, VALUE and not type: a consumer that wants to leave it alone — a
|
|
23
|
+
// call log ignoring its own reader — has to be able to name it.
|
|
24
|
+
export { RPC_ENTITY } from './wire/call.js';
|
|
25
|
+
// The comparison of two cards, which a consumer runs about a producer — browser-safe on
|
|
26
|
+
// purpose: a panel showing the drift holds only the two cards, never the app.
|
|
27
|
+
export { driftOf, agrees, explain } from './wire/drift.js';
|
|
21
28
|
export { assertIdentityCard } from './wire/call.js';
|
|
22
29
|
/**
|
|
23
30
|
* The key a class name is filed under — 'Post' → 'post'. Re-exported rather than
|
|
@@ -28,7 +35,7 @@ export { assertIdentityCard } from './wire/call.js';
|
|
|
28
35
|
* `@fougere/schema` directly: routing four modules through here bought nothing and put
|
|
29
36
|
* this file inside a cycle.
|
|
30
37
|
*/
|
|
31
|
-
export {
|
|
38
|
+
export { lowerFirst } from '@fougere/schema';
|
|
32
39
|
/**
|
|
33
40
|
* Fabricate the call value — one designation, two spellings:
|
|
34
41
|
* `callValueOf(Post, 'list', { query })` (class + verb) or
|
|
@@ -37,7 +44,7 @@ export { registrationKeyOf } from '@fougere/schema';
|
|
|
37
44
|
*/
|
|
38
45
|
export function callValueOf(target, opOrInput, input) {
|
|
39
46
|
const [call, given] = typeof opOrInput === 'string'
|
|
40
|
-
? [{ entity:
|
|
47
|
+
? [{ entity: lowerFirst(target.name), op: opOrInput }, input]
|
|
41
48
|
: [target, opOrInput];
|
|
42
49
|
return { call, invocation: canonicalInvocation(given) };
|
|
43
50
|
}
|