@fougere/core 0.12.2-alpha.0 → 0.12.4-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/dist/EffectiveOperationModel.d.ts +1 -4
- package/dist/EffectiveOperationModel.d.ts.map +1 -1
- package/dist/EffectiveOperationModel.js +181 -173
- package/dist/EffectiveOperationModel.js.map +1 -1
- package/dist/FougereConfig.d.ts +5 -3
- package/dist/FougereConfig.d.ts.map +1 -1
- package/dist/FougereConfig.js +11 -13
- package/dist/FougereConfig.js.map +1 -1
- package/dist/FrondDeclaration.d.ts.map +1 -1
- package/dist/FrondDeclaration.js +1 -5
- package/dist/FrondDeclaration.js.map +1 -1
- package/dist/Source.js +1 -1
- package/dist/Source.js.map +1 -1
- package/dist/SourceView.d.ts +0 -2
- package/dist/SourceView.d.ts.map +1 -1
- package/dist/boot/App.d.ts +2 -4
- package/dist/boot/App.d.ts.map +1 -1
- package/dist/boot/AppLifecycle.d.ts +5 -0
- package/dist/boot/AppLifecycle.d.ts.map +1 -1
- package/dist/boot/AppLifecycle.js +19 -10
- package/dist/boot/AppLifecycle.js.map +1 -1
- package/dist/boot/AuthRuntime.d.ts +5 -12
- package/dist/boot/AuthRuntime.d.ts.map +1 -1
- package/dist/boot/AuthRuntime.js +2 -1
- package/dist/boot/AuthRuntime.js.map +1 -1
- package/dist/boot/CreateAppOptions.d.ts +0 -11
- package/dist/boot/CreateAppOptions.d.ts.map +1 -1
- package/dist/boot/Emissions.d.ts.map +1 -1
- package/dist/boot/Emissions.js +3 -6
- package/dist/boot/Emissions.js.map +1 -1
- package/dist/boot/Hosting.d.ts +2 -1
- package/dist/boot/Hosting.d.ts.map +1 -1
- package/dist/boot/bootstrap.d.ts.map +1 -1
- package/dist/boot/bootstrap.js +140 -263
- package/dist/boot/bootstrap.js.map +1 -1
- package/dist/boot/install.d.ts.map +1 -1
- package/dist/boot/install.js +102 -114
- package/dist/boot/install.js.map +1 -1
- package/dist/boot/relations.d.ts.map +1 -1
- package/dist/boot/relations.js.map +1 -1
- package/dist/boot/seed.d.ts.map +1 -1
- package/dist/boot/seed.js.map +1 -1
- package/dist/descriptor/Fronds.d.ts +5 -0
- package/dist/descriptor/Fronds.d.ts.map +1 -1
- package/dist/descriptor/Fronds.js +8 -0
- package/dist/descriptor/Fronds.js.map +1 -1
- package/dist/descriptor/index.d.ts +1 -0
- package/dist/descriptor/index.d.ts.map +1 -1
- package/dist/descriptor/index.js +1 -0
- package/dist/descriptor/index.js.map +1 -1
- package/dist/dispatch/InFlight.d.ts +3 -2
- package/dist/dispatch/InFlight.d.ts.map +1 -1
- package/dist/dispatch/InFlight.js +11 -1
- package/dist/dispatch/InFlight.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -1
- package/dist/node.js.map +1 -1
- package/dist/prefab/CrudConstructor.d.ts.map +1 -1
- package/dist/prefab/CrudConstructor.js.map +1 -1
- package/dist/storage/Comparison.d.ts +2 -2
- package/dist/storage/Comparison.d.ts.map +1 -1
- package/dist/storage/Comparison.js +3 -1
- package/dist/storage/Comparison.js.map +1 -1
- package/dist/wire/Emit.d.ts +0 -2
- package/dist/wire/Emit.d.ts.map +1 -1
- package/dist/wire/Emit.js +1 -1
- package/dist/wire/Emit.js.map +1 -1
- package/dist/wire/Facade.d.ts +7 -0
- package/dist/wire/Facade.d.ts.map +1 -1
- package/dist/wire/Facade.js +13 -0
- package/dist/wire/Facade.js.map +1 -1
- package/dist/wire/OperationContract.d.ts +0 -4
- package/dist/wire/OperationContract.d.ts.map +1 -1
- package/dist/wire/OperationContract.js +1 -1
- package/dist/wire/OperationContract.js.map +1 -1
- package/dist/wire/OperationsMap.d.ts +0 -3
- package/dist/wire/OperationsMap.d.ts.map +1 -1
- package/dist/wire/OperationsMap.js +0 -5
- package/dist/wire/OperationsMap.js.map +1 -1
- package/package.json +4 -4
- package/src/EffectiveOperationModel.ts +221 -201
- package/src/FougereConfig.ts +14 -16
- package/src/FrondDeclaration.ts +1 -7
- package/src/Source.ts +1 -1
- package/src/SourceView.ts +0 -2
- package/src/boot/App.ts +2 -4
- package/src/boot/AppLifecycle.ts +21 -10
- package/src/boot/AuthRuntime.ts +6 -13
- package/src/boot/CreateAppOptions.ts +0 -11
- package/src/boot/Emissions.ts +3 -7
- package/src/boot/Hosting.ts +2 -1
- package/src/boot/bootstrap.ts +168 -300
- package/src/boot/install.ts +120 -146
- package/src/boot/relations.ts +3 -8
- package/src/boot/seed.ts +2 -4
- package/src/descriptor/Fronds.ts +10 -0
- package/src/descriptor/index.ts +1 -0
- package/src/dispatch/InFlight.ts +16 -2
- package/src/index.ts +2 -4
- package/src/node.ts +1 -1
- package/src/prefab/CrudConstructor.ts +0 -11
- package/src/storage/Comparison.ts +7 -4
- package/src/wire/Emit.ts +1 -1
- package/src/wire/Facade.ts +17 -10
- package/src/wire/OperationContract.ts +1 -1
- package/src/wire/OperationsMap.ts +0 -10
- package/dist/boot/AuthConfig.d.ts +0 -14
- package/dist/boot/AuthConfig.d.ts.map +0 -1
- package/dist/boot/AuthConfig.js +0 -2
- package/dist/boot/AuthConfig.js.map +0 -1
- package/dist/boot/AuthContext.d.ts +0 -12
- package/dist/boot/AuthContext.d.ts.map +0 -1
- package/dist/boot/AuthContext.js +0 -2
- package/dist/boot/AuthContext.js.map +0 -1
- package/dist/storage/ComparisonName.d.ts +0 -3
- package/dist/storage/ComparisonName.d.ts.map +0 -1
- package/dist/storage/ComparisonName.js +0 -2
- package/dist/storage/ComparisonName.js.map +0 -1
- package/src/boot/AuthConfig.ts +0 -14
- package/src/boot/AuthContext.ts +0 -12
- package/src/storage/ComparisonName.ts +0 -3
package/src/boot/AuthRuntime.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Storage } from '../storage/Storage.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Runtime returned by an auth provider's create(config, ctx) function.
|
|
6
|
-
* The core mounts this on the App and the HTTP layer (Nuxt module / router) uses it.
|
|
7
|
-
*/
|
|
1
|
+
/** What an auth extension registers under {@link AUTH} once it has risen. */
|
|
8
2
|
export interface AuthRuntime {
|
|
9
|
-
/**
|
|
10
|
-
entities: Record<string, SchemaView>;
|
|
11
|
-
/** Per-entity ORMs the provider built for itself. */
|
|
12
|
-
storages: Record<string, Storage>;
|
|
13
|
-
/** Web Standard handler that processes /auth/* requests. */
|
|
3
|
+
/** Web Standard handler that processes `/auth/*` requests. */
|
|
14
4
|
handler: (request: Request) => Promise<Response>;
|
|
15
5
|
/** Programmatic API exposed by the provider (getSession, signOut, ...). */
|
|
16
6
|
api: Record<string, unknown>;
|
|
17
|
-
/** Effective mount path
|
|
7
|
+
/** Effective mount path. */
|
|
18
8
|
basePath: string;
|
|
19
9
|
}
|
|
10
|
+
|
|
11
|
+
/** The container key an auth provider registers its runtime under. */
|
|
12
|
+
export const AUTH = 'AuthRuntime';
|
|
@@ -6,8 +6,6 @@ import type { StorageFactory } from '../storage/StorageFactory.js';
|
|
|
6
6
|
import type { Constraint } from '../Constraint.js';
|
|
7
7
|
import type { Transport } from '../wire/Transport.js';
|
|
8
8
|
import type { Extension } from './Extension.js';
|
|
9
|
-
import type { AuthConfig } from './AuthConfig.js';
|
|
10
|
-
import type { DispatchObserver } from '../dispatch/DispatchObserver.js';
|
|
11
9
|
import type { App } from './App.js';
|
|
12
10
|
|
|
13
11
|
/** Options for createApp(). */
|
|
@@ -86,13 +84,4 @@ export interface CreateAppOptions {
|
|
|
86
84
|
adapters?: Record<string, boolean | undefined>;
|
|
87
85
|
/** Carries an announced fact out of this process — a broker, a queue, a log. */
|
|
88
86
|
onEmit?: (fact: string, payload: unknown) => void | Promise<void>;
|
|
89
|
-
/** Passive observers of every dispatch transition. */
|
|
90
|
-
dispatchObservers?: readonly DispatchObserver[];
|
|
91
|
-
/**
|
|
92
|
-
* Storage handle to expose to the auth provider via AuthContext.db.
|
|
93
|
-
* Required when `auth` is set.
|
|
94
|
-
*/
|
|
95
|
-
db?: unknown;
|
|
96
|
-
/** Auth declaration to wire into the app at boot. */
|
|
97
|
-
auth?: AuthConfig;
|
|
98
87
|
}
|
package/src/boot/Emissions.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { applyCreate, dotted, lowerFirst, type SchemaView } from '@fougere/schema';
|
|
2
|
+
import { addressOf, facadeKeyOf } from '../wire/Facade.js';
|
|
2
3
|
import type { Container } from '@fougere/container';
|
|
3
4
|
import { validationErrorsOf } from '../wire/FougereError.js';
|
|
4
5
|
import { awaitKeyOf, emitKeyOf, factsAnnouncedBy, factsAwaitedBy } from '../wire/Emit.js';
|
|
@@ -368,12 +369,7 @@ export class Emissions {
|
|
|
368
369
|
}
|
|
369
370
|
}
|
|
370
371
|
|
|
371
|
-
/**
|
|
372
|
-
* The container key a declared CLASS NAME answers under — `RedactHandler` → `redactHandler`,
|
|
373
|
-
* the same key `facadeKeyOf` builds from an address.
|
|
374
|
-
*/
|
|
372
|
+
/** The container key a declared CLASS NAME answers under — `RedactHandler` → `redactHandler`. */
|
|
375
373
|
function facadeOf(declared: string): string {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
return key.endsWith('Handler') ? key : `${key}Handler`;
|
|
374
|
+
return facadeKeyOf(addressOf(declared));
|
|
379
375
|
}
|
package/src/boot/Hosting.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { SchemaView } from '@fougere/schema';
|
|
|
2
2
|
import type { Constraint } from '../Constraint.js';
|
|
3
3
|
import type { Peer } from './Peer.js';
|
|
4
4
|
import type { Journal } from '../dispatch/Journal.js';
|
|
5
|
+
import type { Storage } from '../storage/Storage.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Where an entity's rows are hosted, and what the host keeps — what a `ref()` asks the boot.
|
|
@@ -17,7 +18,7 @@ export interface Hosting {
|
|
|
17
18
|
* Resolved through the frond that owns it, never the asking frond's scope: a scope sees its
|
|
18
19
|
* parent and not its siblings, so a target of another frond was answered by nothing.
|
|
19
20
|
*/
|
|
20
|
-
storageOf(entity: string):
|
|
21
|
+
storageOf(entity: string): Storage | undefined;
|
|
21
22
|
/** Every entity of every frond — a row is named from wherever its namer was declared. */
|
|
22
23
|
entities(): ReadonlyMap<string, SchemaView>;
|
|
23
24
|
/**
|