@fougere/app 0.6.0-alpha.0 → 0.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.ts +1 -7
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/boot.d.ts +14 -85
- package/dist/boot.d.ts.map +1 -1
- package/dist/boot.js +17 -77
- package/dist/boot.js.map +1 -1
- package/dist/client.d.ts +5 -24
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -32
- package/dist/client.js.map +1 -1
- package/dist/express.d.ts +2 -12
- package/dist/express.d.ts.map +1 -1
- package/dist/express.js +4 -52
- package/dist/express.js.map +1 -1
- package/dist/form.d.ts +11 -56
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +15 -33
- package/dist/form.js.map +1 -1
- package/dist/graphql.d.ts +2 -28
- package/dist/graphql.d.ts.map +1 -1
- package/dist/graphql.js +1 -6
- package/dist/graphql.js.map +1 -1
- package/dist/index.d.ts +1 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -11
- package/dist/index.js.map +1 -1
- package/dist/rest.d.ts +2 -16
- package/dist/rest.d.ts.map +1 -1
- package/dist/rest.js +4 -34
- package/dist/rest.js.map +1 -1
- package/dist/serve.d.ts +10 -57
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +12 -55
- package/dist/serve.js.map +1 -1
- package/dist/session.d.ts +2 -7
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +2 -7
- package/dist/session.js.map +1 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -11
- package/dist/state.js.map +1 -1
- package/dist/web.d.ts +3 -19
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +4 -32
- package/dist/web.js.map +1 -1
- package/package.json +11 -11
- package/src/auth.ts +1 -7
- package/src/boot.ts +28 -134
- package/src/client.ts +7 -33
- package/src/express.ts +4 -52
- package/src/form.ts +20 -73
- package/src/graphql.ts +2 -28
- package/src/index.ts +1 -11
- package/src/rest.ts +4 -34
- package/src/serve.ts +13 -60
- package/src/session.ts +2 -7
- package/src/state.ts +1 -11
- package/src/web.ts +4 -32
package/dist/auth.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth accessor — reads the AuthRuntime that the core mounted on the app.
|
|
3
|
-
*
|
|
4
|
-
* Auth is no longer a separate singleton: it lives on `app.auth`, built once
|
|
5
|
-
* during boot from the `auth` field of fougere.config.ts. This accessor is a
|
|
6
|
-
* thin async helper for server code (middleware, routes, /api/me).
|
|
7
|
-
*/
|
|
1
|
+
/** Auth accessor — reads the AuthRuntime that the core mounted on the app. */
|
|
8
2
|
import type { AuthRuntime } from '@fougere/core';
|
|
9
3
|
/** Get the auth runtime resolved at boot. Throws if no `auth` was declared in fougere.config.ts. */
|
|
10
4
|
export declare function useFougereAuth(): Promise<AuthRuntime>;
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,oGAAoG;AACpG,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAQ3D"}
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
|
package/dist/boot.d.ts
CHANGED
|
@@ -1,71 +1,23 @@
|
|
|
1
|
-
import type { App, CreateAppOptions,
|
|
2
|
-
import {
|
|
1
|
+
import type { App, CreateAppOptions, FougereConfig, Transport } from '@fougere/core';
|
|
2
|
+
import type { ResolvedStorage } from '@fougere/defaults';
|
|
3
3
|
export interface FougereServerConfig {
|
|
4
|
-
/** Storage handle. Forwarded to the auth provider via AuthContext.db. */
|
|
5
|
-
db?: unknown;
|
|
6
|
-
/** Per-entity storage factory. */
|
|
7
|
-
storageFactory?: (entity: SchemaView, name: string) => Storage;
|
|
8
4
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* seeding — Nuxt's generated plugin did exactly that, and its copy of the seeding loop
|
|
13
|
-
* drifted. Declaring `{ name: 'seeds', up }` replaces that one member and leaves the
|
|
14
|
-
* rest of the ascent alone.
|
|
5
|
+
* The whole data layer, as `resolveStorage` composed it — where the rows are, which source
|
|
6
|
+
* transacts, what to close. Handed over as ONE subject: a host that passed the factory alone
|
|
7
|
+
* lost the transaction and the connection's owner, and nothing said so.
|
|
15
8
|
*/
|
|
9
|
+
storage?: ResolvedStorage;
|
|
10
|
+
/** What this app takes on beyond its fronds, each stating what it does and what it undoes. */
|
|
16
11
|
extensions?: CreateAppOptions['extensions'];
|
|
17
|
-
/**
|
|
18
|
-
* What the boot line names as the host — 'Nuxt/Nitro', 'Next'. Stated by the
|
|
19
|
-
* adapter, never sniffed: a boot that guesses its host from what happens to be
|
|
20
|
-
* importable is the hidden runtime the doctrine refuses.
|
|
21
|
-
*/
|
|
12
|
+
/** What the boot line names as the host — 'Nuxt/Nitro', 'Next'. */
|
|
22
13
|
host?: string;
|
|
23
|
-
/**
|
|
24
|
-
* What this app is built from, when the host already knows.
|
|
25
|
-
*
|
|
26
|
-
* Absent, `boot()` reads the fronds off the disk — right on a server, impossible on a
|
|
27
|
-
* runtime that has none: measured on workerd, `readdir` throws through unenv's shim and
|
|
28
|
-
* the app comes up with ZERO fronds, so every page renders and every door answers
|
|
29
|
-
* NOT_FOUND. A host that scanned at BUILD time can say so instead, and `fougere build`
|
|
30
|
-
* writes exactly this value down.
|
|
31
|
-
*
|
|
32
|
-
* Same slot as `CreateAppOptions.scan` and for the same reason: producing the value
|
|
33
|
-
* reads a disk, consuming it does not.
|
|
34
|
-
*/
|
|
14
|
+
/** What this app is built from, when the host already knows. */
|
|
35
15
|
scan?: CreateAppOptions['scan'];
|
|
36
|
-
/**
|
|
37
|
-
* What this app STATES it hosts — `frond('blog', { entities: [Post] })`.
|
|
38
|
-
*
|
|
39
|
-
* Stating this and no `scan` is how a host stops scanning at boot: nothing reads a
|
|
40
|
-
* disk, nothing loads `typescript`, and what was not named does not exist. It is the
|
|
41
|
-
* one door Next, Vite, React, Svelte and a bare Express share — none of them scans on
|
|
42
|
-
* its own, they all arrive here, and this line used to end in a scan for every one.
|
|
43
|
-
*/
|
|
16
|
+
/** What this app STATES it hosts — `frond('blog', { entities: [Post] })`. */
|
|
44
17
|
fronds?: CreateAppOptions['fronds'];
|
|
45
|
-
/**
|
|
46
|
-
* What `fougere.config.ts` says, when the host already read it.
|
|
47
|
-
*
|
|
48
|
-
* The same rule as `scan`, and found the same way: `boot()` re-reads the file at
|
|
49
|
-
* runtime, which a Worker cannot do — measured, a consumer's `remotes:` never reached
|
|
50
|
-
* the boot and its pages rendered empty with nothing said. A host that read the config
|
|
51
|
-
* at BUILD time states it here instead.
|
|
52
|
-
*
|
|
53
|
-
* `auth` is deliberately not part of what a codegen'd host can carry: it holds a live
|
|
54
|
-
* provider, not a value. An app that authenticates reads its own config.
|
|
55
|
-
*/
|
|
18
|
+
/** What `fougere.config.ts` says, when the host already read it. */
|
|
56
19
|
config?: Partial<FougereConfig>;
|
|
57
|
-
/**
|
|
58
|
-
* Who performs an outgoing call, when the default cannot.
|
|
59
|
-
*
|
|
60
|
-
* `boot()` builds an HTTP transport from `remotes:` and that is right nearly
|
|
61
|
-
* everywhere. It is not right on Cloudflare: a Worker calling a sibling's public URL
|
|
62
|
-
* is refused by the edge with error 1042, so two Workers of one account reach each
|
|
63
|
-
* other through a SERVICE BINDING and through nothing else. A binding is a value only
|
|
64
|
-
* the host holds, so only the host can state this.
|
|
65
|
-
*
|
|
66
|
-
* It replaces the default entirely — signing included, since a host that builds its
|
|
67
|
-
* own transport is the one that knows what to put on the wire.
|
|
68
|
-
*/
|
|
20
|
+
/** Who performs an outgoing call, when the default cannot. */
|
|
69
21
|
remoteTransport?: (url: string) => Transport;
|
|
70
22
|
}
|
|
71
23
|
/**
|
|
@@ -73,33 +25,10 @@ export interface FougereServerConfig {
|
|
|
73
25
|
* setup based on `config.db` in fougere.config.ts.
|
|
74
26
|
*/
|
|
75
27
|
export declare function configureFougere(config: FougereServerConfig): void;
|
|
76
|
-
/**
|
|
77
|
-
* Add to what is already stated, instead of replacing it.
|
|
78
|
-
*
|
|
79
|
-
* A host states its app in PIECES when the pieces are known at different moments: a
|
|
80
|
-
* build writes the scan and the config into a generated plugin, and a value only the
|
|
81
|
-
* running process holds — a Cloudflare service binding — cannot be written there at all.
|
|
82
|
-
* Its dual is `configureFougere`, which replaces; `reloadFougere` depends on that
|
|
83
|
-
* replacement, so merging silently would have broken the turn of the ring.
|
|
84
|
-
*/
|
|
28
|
+
/** Add to what is already stated, instead of replacing it. */
|
|
85
29
|
export declare function extendFougere(config: Partial<FougereServerConfig>): void;
|
|
86
30
|
/** Get the booted Fougere app. Lazy — boots on first call, then caches. */
|
|
87
31
|
export declare function useFougereApp(): Promise<App>;
|
|
88
|
-
/**
|
|
89
|
-
* Turn the ring: instantiate the app again, then let the previous one go.
|
|
90
|
-
*
|
|
91
|
-
* This is what "reload" means for anything the config CONSUMED — a value that built
|
|
92
|
-
* something cannot move under what it built, so the thing is built again. Its dual is
|
|
93
|
-
* `applyConfig`, for values that are merely consulted and need no turn at all.
|
|
94
|
-
*
|
|
95
|
-
* Every door reaches the app through `useFougereApp()` inside the request it serves and
|
|
96
|
-
* none holds it across two, which is what makes the swap invisible: the next request
|
|
97
|
-
* lands on the new app whether or not the old one has finished being released.
|
|
98
|
-
*
|
|
99
|
-
* A call already running finishes on the OLD app: it is drained before being released,
|
|
100
|
-
* so nothing has its storage closed underneath it. `timeoutMs` bounds that wait, and a
|
|
101
|
-
* drain that runs out REJECTS — the app is left alone rather than released under work,
|
|
102
|
-
* because a caller who cannot wait must choose that on purpose.
|
|
103
|
-
*/
|
|
32
|
+
/** Turn the ring. */
|
|
104
33
|
export declare function reloadFougere(timeoutMs?: number): Promise<App>;
|
|
105
34
|
//# sourceMappingURL=boot.d.ts.map
|
package/dist/boot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAW,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKzD,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,8FAA8F;IAC9F,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC5C,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,6EAA6E;IAC7E,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,8DAA8D;IAC9D,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;CAC9C;AASD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,QAG3D;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAGjE;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAK5C;AAED,qBAAqB;AACrB,wBAAsB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAWpE"}
|
package/dist/boot.js
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fougere server bootstrap — single entry point for an app's lifecycle,
|
|
3
|
-
* whatever hosts it.
|
|
4
|
-
*
|
|
5
|
-
* Nothing here knows h3, Nitro, Vue or React: a boot reads `fougere.config.ts`,
|
|
6
|
-
* scans fronds off the filesystem and hands back an `App`. That is why it lives
|
|
7
|
-
* in `@fougere/app` rather than in one of the two adapters — the second host
|
|
8
|
-
* would otherwise have copied it, and a copied boot drifts (the seeding loop
|
|
9
|
-
* already did, `core/src/boot/seed.ts`).
|
|
10
|
-
*
|
|
11
|
-
* Default path (zero-config): fougere.config.ts declares `db: 'sqlite'` and
|
|
12
|
-
* everything else; this module auto-resolves the storage handle, builds an
|
|
13
|
-
* storageFactory, runs auto-DDL from the entities, and boots the app.
|
|
14
|
-
*
|
|
15
|
-
* Escape hatch: `configureFougere({ db, storageFactory })` can be called from the
|
|
16
|
-
* host's own startup (a Nitro plugin, a Next instrumentation hook) if the user
|
|
17
|
-
* wants a custom data layer — alternative driver, managed migrations, etc.
|
|
18
|
-
*/
|
|
1
|
+
/** Fougere server bootstrap — single entry point for an app's lifecycle, whatever hosts it. */
|
|
19
2
|
import { createApp, identityFromEnv, Logger, migrating, seeding } from '@fougere/core';
|
|
20
3
|
import { scanProject, loadCascadedConfig, setModuleLoader, frondAliases, resolveConventions } from '@fougere/core/node';
|
|
21
4
|
import { createContainer } from '@fougere/container';
|
|
@@ -32,15 +15,7 @@ export function configureFougere(config) {
|
|
|
32
15
|
_config = config;
|
|
33
16
|
_appPromise = null;
|
|
34
17
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Add to what is already stated, instead of replacing it.
|
|
37
|
-
*
|
|
38
|
-
* A host states its app in PIECES when the pieces are known at different moments: a
|
|
39
|
-
* build writes the scan and the config into a generated plugin, and a value only the
|
|
40
|
-
* running process holds — a Cloudflare service binding — cannot be written there at all.
|
|
41
|
-
* Its dual is `configureFougere`, which replaces; `reloadFougere` depends on that
|
|
42
|
-
* replacement, so merging silently would have broken the turn of the ring.
|
|
43
|
-
*/
|
|
18
|
+
/** Add to what is already stated, instead of replacing it. */
|
|
44
19
|
export function extendFougere(config) {
|
|
45
20
|
_config = { ..._config, ...config };
|
|
46
21
|
_appPromise = null;
|
|
@@ -52,22 +27,7 @@ export function useFougereApp() {
|
|
|
52
27
|
}
|
|
53
28
|
return _appPromise;
|
|
54
29
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Turn the ring: instantiate the app again, then let the previous one go.
|
|
57
|
-
*
|
|
58
|
-
* This is what "reload" means for anything the config CONSUMED — a value that built
|
|
59
|
-
* something cannot move under what it built, so the thing is built again. Its dual is
|
|
60
|
-
* `applyConfig`, for values that are merely consulted and need no turn at all.
|
|
61
|
-
*
|
|
62
|
-
* Every door reaches the app through `useFougereApp()` inside the request it serves and
|
|
63
|
-
* none holds it across two, which is what makes the swap invisible: the next request
|
|
64
|
-
* lands on the new app whether or not the old one has finished being released.
|
|
65
|
-
*
|
|
66
|
-
* A call already running finishes on the OLD app: it is drained before being released,
|
|
67
|
-
* so nothing has its storage closed underneath it. `timeoutMs` bounds that wait, and a
|
|
68
|
-
* drain that runs out REJECTS — the app is left alone rather than released under work,
|
|
69
|
-
* because a caller who cannot wait must choose that on purpose.
|
|
70
|
-
*/
|
|
30
|
+
/** Turn the ring. */
|
|
71
31
|
export async function reloadFougere(timeoutMs) {
|
|
72
32
|
const previous = _appPromise;
|
|
73
33
|
_appPromise = null;
|
|
@@ -122,33 +82,16 @@ async function boot() {
|
|
|
122
82
|
// Auto-resolve the data layer from config.db when the user didn't provide a
|
|
123
83
|
// custom one via configureFougere. The resolution itself lives in @fougere/defaults
|
|
124
84
|
// — this host must not know which storage package backs `db:`.
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
// The storage's two halves, kept together: its ascent is an extension, its connection
|
|
128
|
-
// is not — it is opened here, before the container, so it closes after the container.
|
|
129
|
-
let storageMigrate;
|
|
130
|
-
let closeStorage;
|
|
131
|
-
// Where the rows are, and how to open a transaction there — read from the same storage
|
|
132
|
-
// resolution, because a frame's realization is decided by `sources:` and nothing else.
|
|
133
|
-
let sourceOf;
|
|
134
|
-
let transacted;
|
|
135
|
-
if (!storageFactory) {
|
|
85
|
+
let storage = _config.storage;
|
|
86
|
+
if (!storage) {
|
|
136
87
|
const { resolveStorage } = await import('@fougere/defaults');
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
log.debug('auto-resolving storage from config.db');
|
|
140
|
-
db = storage.db;
|
|
141
|
-
storageFactory = storage.storageFactory;
|
|
142
|
-
sourceOf = storage.sourceOf;
|
|
143
|
-
transacted = storage.transacted;
|
|
144
|
-
storageMigrate = storage.migrate;
|
|
145
|
-
closeStorage = storage.close;
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
log.debug('no db declared — falling back to in-memory storage');
|
|
149
|
-
storageFactory = createMemoryStorage;
|
|
150
|
-
}
|
|
88
|
+
storage = resolveStorage(fileConfig.db, fileConfig.sources);
|
|
89
|
+
log.debug(storage.storageFactory ? 'auto-resolving storage from config.db' : 'no db declared — falling back to in-memory storage');
|
|
151
90
|
}
|
|
91
|
+
// The storage's two halves, kept together: its ascent is an extension, its connection
|
|
92
|
+
// is not — it is opened here, before the container, so it closes after the container.
|
|
93
|
+
const storageFactory = storage.storageFactory ?? createMemoryStorage;
|
|
94
|
+
const storageMigrate = storage.migrate;
|
|
152
95
|
// Layer-2 wiring: `remotes: { catalog: 'http://...' }` in fougere.config.ts
|
|
153
96
|
// is all the user writes — the default transport comes from here.
|
|
154
97
|
// The host's word wins here too — and where it speaks, nothing below runs: building
|
|
@@ -179,18 +122,15 @@ async function boot() {
|
|
|
179
122
|
: {}),
|
|
180
123
|
createContainer,
|
|
181
124
|
storageFactory,
|
|
182
|
-
sourceOf,
|
|
183
|
-
|
|
184
|
-
|
|
125
|
+
sourceOf: storage.sourceOf,
|
|
126
|
+
transacts: storage.transacts,
|
|
127
|
+
transacted: storage.transacted,
|
|
128
|
+
db: storage.db,
|
|
185
129
|
auth: fileConfig.auth,
|
|
186
130
|
adapters: fileConfig.adapters,
|
|
187
131
|
remotes: fileConfig.remotes,
|
|
188
132
|
remoteTransport,
|
|
189
|
-
/**
|
|
190
|
-
* The whole ascent, one ordered list: tables, then rows, then what the host adds.
|
|
191
|
-
* A host wanting its OWN seeding declares `{ name: 'seeds', … }` and replaces that
|
|
192
|
-
* member — it no longer has to claim everything after the boot to get it.
|
|
193
|
-
*/
|
|
133
|
+
/** The whole ascent, one ordered list. */
|
|
194
134
|
extensions: [
|
|
195
135
|
// The slot is declared even when this host resolved no storage — a host that resolved
|
|
196
136
|
// its own (the Nitro plugin does, for its bundler) then REPLACES this member in place
|
|
@@ -202,7 +142,7 @@ async function boot() {
|
|
|
202
142
|
// Opened before the container, so released after it. Never wired here until now:
|
|
203
143
|
// this host boots the storage and no host closed one, which is what made a reload
|
|
204
144
|
// leak the pool of every app it discarded.
|
|
205
|
-
onDispose:
|
|
145
|
+
onDispose: storage.close,
|
|
206
146
|
});
|
|
207
147
|
log.info(`ascent: ${app.extensions().join(' → ') || 'nothing declared'}`);
|
|
208
148
|
const ms = (performance.now() - bootStart).toFixed(0);
|
package/dist/boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA4B9D,oDAAoD;AAEpD,IAAI,OAAO,GAAwB,EAAE,CAAC;AACtC,IAAI,WAAW,GAAwB,IAAI,CAAC;AAE5C,oDAAoD;AAEpD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA2B;IAC1D,OAAO,GAAG,MAAM,CAAC;IACjB,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,MAAoC;IAChE,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;IACpC,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,IAAI,EAAE,CAAC;IACvB,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,qBAAqB;AACrB,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,SAAkB;IACpD,MAAM,QAAQ,GAAG,WAAW,CAAC;IAC7B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couple, minus the reactivity — everything `useQuery`/`useCommand` decide
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Designation is class + verb: the imported entity class carries the metadata,
|
|
6
|
-
* its name carries the registration key. That is true in Vue and in React, and so
|
|
7
|
-
* is the link — a successful command on an entity revalidates every mounted query
|
|
8
|
-
* on that entity, because the entity is designated on both sides and nothing has
|
|
9
|
-
* to be declared. What differs between hosts is only HOW a value becomes reactive
|
|
10
|
-
* and how a revalidation is triggered, which is ~50 lines each and belongs to them.
|
|
11
|
-
*
|
|
12
|
-
* Browser-safe by construction: this module reaches `@fougere/core/contract` and
|
|
13
|
-
* the transport's client subpath, never the boot. `@fougere/app/client` is the
|
|
14
|
-
* subpath that keeps it that way.
|
|
2
|
+
* The couple, minus the reactivity — everything `useQuery`/`useCommand` decide before a
|
|
3
|
+
* framework's state primitives get involved.
|
|
15
4
|
*/
|
|
16
5
|
import { FougereError, type InvocationContext, type FrondCall } from '@fougere/core/contract';
|
|
17
6
|
/** An entity class is a designation: its name is the registration key. */
|
|
@@ -19,7 +8,7 @@ export type EntityClass = {
|
|
|
19
8
|
name: string;
|
|
20
9
|
};
|
|
21
10
|
/** What a page provides of an invocation — the rest is stamped server-side. */
|
|
22
|
-
export type CallInput = Partial<Pick<InvocationContext, 'params' | 'query' | '
|
|
11
|
+
export type CallInput = Partial<Pick<InvocationContext, 'params' | 'query' | 'input'>>;
|
|
23
12
|
/** The one door the browser knows. A named surface adds `/{surface}` to it. */
|
|
24
13
|
export declare const CALL_ENDPOINT = "/_fougere/call";
|
|
25
14
|
export type Fetcher = <T>(url: string, options: {
|
|
@@ -30,11 +19,7 @@ export type Fetcher = <T>(url: string, options: {
|
|
|
30
19
|
export declare function entityKeyOf(entity: EntityClass): string;
|
|
31
20
|
export declare function callOf(entity: EntityClass, op: string): FrondCall;
|
|
32
21
|
export declare function invocationOf(input?: CallInput): InvocationContext;
|
|
33
|
-
/**
|
|
34
|
-
* The cache key of a read. Same designation and same input means the same key —
|
|
35
|
-
* which is what lets two components asking the same thing share one request, and
|
|
36
|
-
* what the command side matches against to revalidate.
|
|
37
|
-
*/
|
|
22
|
+
/** The cache key of a read. */
|
|
38
23
|
export declare function queryKeyOf(entityKey: string, op: string, input?: CallInput): string;
|
|
39
24
|
export declare function sendCall(fetcher: Fetcher, call: FrondCall, invocation: InvocationContext, endpoint?: string): Promise<unknown>;
|
|
40
25
|
/** Register a mounted read. Returns the unregistration, for the host's scope teardown. */
|
|
@@ -53,11 +38,7 @@ export declare function pageOf(data: unknown): {
|
|
|
53
38
|
hasMore?: boolean;
|
|
54
39
|
endCursor?: string;
|
|
55
40
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Whatever failed, as the error the primitives promise. A transport failure is not
|
|
58
|
-
* a domain refusal, so it arrives under SERVICE_UNAVAILABLE rather than borrowing a
|
|
59
|
-
* code the server never sent.
|
|
60
|
-
*/
|
|
41
|
+
/** Whatever failed, as the error the primitives promise. */
|
|
61
42
|
export declare function asFougereError(err: unknown, entityKey: string, op: string): FougereError;
|
|
62
43
|
export { formFieldsOf, tableColumnsOf, payloadOf, errorsByField, type FormEntity, type FormField, type TableColumn, } from './form.js';
|
|
63
44
|
export { sessionViewOf, type SessionView } from './session.js';
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,YAAY,EAGZ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAC;AAGhC,0EAA0E;AAC1E,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,+EAA+E;AAC/E,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE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AAO,EAAE,OAOrB,CAAC;AAIF,yFAAyF;AACzF,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,EAAE,CAM7C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAUxF;AAKD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The couple, minus the reactivity — everything `useQuery`/`useCommand` decide
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Designation is class + verb: the imported entity class carries the metadata,
|
|
6
|
-
* its name carries the registration key. That is true in Vue and in React, and so
|
|
7
|
-
* is the link — a successful command on an entity revalidates every mounted query
|
|
8
|
-
* on that entity, because the entity is designated on both sides and nothing has
|
|
9
|
-
* to be declared. What differs between hosts is only HOW a value becomes reactive
|
|
10
|
-
* and how a revalidation is triggered, which is ~50 lines each and belongs to them.
|
|
11
|
-
*
|
|
12
|
-
* Browser-safe by construction: this module reaches `@fougere/core/contract` and
|
|
13
|
-
* the transport's client subpath, never the boot. `@fougere/app/client` is the
|
|
14
|
-
* subpath that keeps it that way.
|
|
2
|
+
* The couple, minus the reactivity — everything `useQuery`/`useCommand` decide before a
|
|
3
|
+
* framework's state primitives get involved.
|
|
15
4
|
*/
|
|
16
5
|
import { FougereError, ErrorCode, lowerFirst, } from '@fougere/core/contract';
|
|
17
6
|
import { frameCall, unframeResponse } from '@fougere/transport-http/client';
|
|
@@ -26,13 +15,9 @@ export function callOf(entity, op) {
|
|
|
26
15
|
return { entity: entityKeyOf(entity), op };
|
|
27
16
|
}
|
|
28
17
|
export function invocationOf(input) {
|
|
29
|
-
return { params: {}, query: {},
|
|
18
|
+
return { params: {}, query: {}, input: undefined, state: {}, ...input };
|
|
30
19
|
}
|
|
31
|
-
/**
|
|
32
|
-
* The cache key of a read. Same designation and same input means the same key —
|
|
33
|
-
* which is what lets two components asking the same thing share one request, and
|
|
34
|
-
* what the command side matches against to revalidate.
|
|
35
|
-
*/
|
|
20
|
+
/** The cache key of a read. */
|
|
36
21
|
export function queryKeyOf(entityKey, op, input) {
|
|
37
22
|
return `fougere:${entityKey}.${op}:${JSON.stringify(input ?? {})}`;
|
|
38
23
|
}
|
|
@@ -57,14 +42,7 @@ export function trackQuery(entityKey, key) {
|
|
|
57
42
|
export function mountedKeys(entityKey) {
|
|
58
43
|
return [...(mounted.get(entityKey) ?? [])];
|
|
59
44
|
}
|
|
60
|
-
/**
|
|
61
|
-
* `mountedKeys` says WHICH reads a command invalidates; these say how to make one
|
|
62
|
-
* happen. Both halves turned out to be host-independent — Nuxt is the exception,
|
|
63
|
-
* because `refreshNuxtData` already is this registry.
|
|
64
|
-
*
|
|
65
|
-
* They lived in `@fougere/react` until a second non-Nuxt client needed them, which
|
|
66
|
-
* is when it became visible that nothing in them is React.
|
|
67
|
-
*/
|
|
45
|
+
/** `mountedKeys` says WHICH reads a command invalidates; these say how to make one happen. */
|
|
68
46
|
const refetchers = new Map();
|
|
69
47
|
/** Register a mounted read's refetch. Returns the unregistration. */
|
|
70
48
|
export function onRefetch(key, run) {
|
|
@@ -100,11 +78,7 @@ export function itemsOf(data) {
|
|
|
100
78
|
export function pageOf(data) {
|
|
101
79
|
return (data ?? {});
|
|
102
80
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Whatever failed, as the error the primitives promise. A transport failure is not
|
|
105
|
-
* a domain refusal, so it arrives under SERVICE_UNAVAILABLE rather than borrowing a
|
|
106
|
-
* code the server never sent.
|
|
107
|
-
*/
|
|
81
|
+
/** Whatever failed, as the error the primitives promise. */
|
|
108
82
|
export function asFougereError(err, entityKey, op) {
|
|
109
83
|
return err instanceof FougereError
|
|
110
84
|
? err
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,GAGX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAoB,MAAM,gCAAgC,CAAC;AAQ9F,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAI9C,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC7C,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAmB,EAAE,EAAU;IACpD,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAiB;IAC5C,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC;AAC1E,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,UAAU,CAAC,SAAiB,EAAE,EAAU,EAAE,KAAiB;IACzE,O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CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAAC,GAAY,EAAE,SAAiB,EAAE,EAAU;IACxE,OAAO,GAAG,YAAY,YAAY;QAChC,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,IAAI,YAAY,CAAC;YACf,IAAI,EAAE,SAAS,CAAC,mBAAmB;YACnC,OAAO,EAAG,GAAa,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC;YAC/C,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,GAAG;SACX,CAAC,CAAC;AACT,CAAC;AAED,+EAA+E;AAC/E,iFAAiF;AACjF,0BAA0B;AAC1B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,GAId,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAC"}
|
package/dist/express.d.ts
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
type Next = (err?: unknown) => void;
|
|
2
2
|
export type ExpressMiddleware = (req: any, res: any, next: Next) => void;
|
|
3
|
-
/**
|
|
4
|
-
* The call envelope, at `/_fougere/call` — the door the browser primitives use.
|
|
5
|
-
*
|
|
6
|
-
* Mounted with `app.use()`, Express strips nothing, so the path still carries the
|
|
7
|
-
* audience segment (`/_fougere/call/public`) that `surfaceOf` reads.
|
|
8
|
-
*/
|
|
3
|
+
/** The call envelope, at `/_fougere/call` — the door the browser primitives use. */
|
|
9
4
|
export declare function fougereCall(mountPath?: string): ExpressMiddleware;
|
|
10
5
|
/** The session view, at `/_fougere/session`. */
|
|
11
6
|
export declare function fougereSession(mountPath?: string): ExpressMiddleware;
|
|
12
|
-
/**
|
|
13
|
-
* The REST projection, under `/api` by default.
|
|
14
|
-
*
|
|
15
|
-
* A path this app does not serve calls `next()` — so an app's own `/api/health` keeps
|
|
16
|
-
* answering whether it was registered before or after this middleware.
|
|
17
|
-
*/
|
|
7
|
+
/** The REST projection, under `/api` by default. */
|
|
18
8
|
export declare function fougereRest(mountPath?: string): ExpressMiddleware;
|
|
19
9
|
/** GraphQL, at `/graphql` by default. Declines when the app declares no such adapter. */
|
|
20
10
|
export declare function fougereGraphQL(mountPath?: string): ExpressMiddleware;
|
package/dist/express.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AA2BA,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AACpC,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;AA+BzE,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,SAAS,SAAmB,GAAG,iBAAiB,CAqB3E;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,SAAS,SAAsB,GAAG,iBAAiB,CAKjF;AAED,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,SAAS,SAAS,GAAG,iBAAiB,CA4BjE;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,SAAS,SAAa,GAAG,iBAAiB,CAoBxE;AAED;sDACsD;AACtD,wBAAgB,OAAO,IAAI,iBAAiB,CAY3C"}
|
package/dist/express.js
CHANGED
|
@@ -1,48 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The doors as Express middlewares — the form an Express app expects.
|
|
3
|
-
*
|
|
4
|
-
* ```ts
|
|
5
|
-
* const app = express();
|
|
6
|
-
* app.use(express.json());
|
|
7
|
-
* app.use(fougere()); // ← one line, like cors() or express.json()
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* This replaces an earlier `mountDoors(createExpressRouter(app))`, which was wrong in
|
|
11
|
-
* two ways at once. It handed the app INTO a function instead of adding something to
|
|
12
|
-
* the app, and it made the caller name Express 5's wildcard syntax (`/api/*splat`) —
|
|
13
|
-
* a detail that belongs to the framework, not to its user. Worse, it mounted all
|
|
14
|
-
* three doors together with no way to take two of them.
|
|
15
|
-
*
|
|
16
|
-
* A middleware fixes both by construction, because Express already says WHERE:
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* app.use(fougere()); // the three doors, at the paths the client knows
|
|
20
|
-
* app.use('/admin', fougereRest()); // REST only, wherever you want it
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* And `next()` is the passthrough these doors were already imitating: `serveRest`
|
|
24
|
-
* answers `{ kind: 'pass' }` for a path it does not serve, which is exactly what
|
|
25
|
-
* Express means by calling the next handler. The middleware stops inventing it.
|
|
26
|
-
*
|
|
27
|
-
* The names mirror `@fougere/app/web` on purpose — same doors, host-shaped. `/web`
|
|
28
|
-
* gives you `Request` → `Response` handlers; this gives you middlewares.
|
|
29
|
-
*
|
|
30
|
-
* Nothing here imports express: the shapes are structural, so the package keeps its
|
|
31
|
-
* dependency list and a test can hand it a plain object.
|
|
32
|
-
*/
|
|
1
|
+
/** The doors as Express middlewares — the form an Express app expects. */
|
|
33
2
|
import { readExpressBody } from '@fougere/http';
|
|
34
3
|
import { serveRest, serveRpc, rpcParseError } from './serve.js';
|
|
35
4
|
import { serveGraphQL } from './graphql.js';
|
|
36
5
|
import { sessionViewOf } from './session.js';
|
|
37
6
|
import { useFougereApp } from './boot.js';
|
|
38
|
-
/**
|
|
39
|
-
* Who the caller is, from what ran before.
|
|
40
|
-
*
|
|
41
|
-
* Express has no ambient request, so an app that resolves its own session says so by
|
|
42
|
-
* putting it on the request — `req.fougereState`, or a bare `req.user`, which is what
|
|
43
|
-
* passport and most middlewares already set. Nothing is taken from the payload: the
|
|
44
|
-
* browser sits outside the topology.
|
|
45
|
-
*/
|
|
7
|
+
/** Who the caller is, from what ran before. */
|
|
46
8
|
function stateOf(req) {
|
|
47
9
|
if (req.fougereState)
|
|
48
10
|
return req.fougereState;
|
|
@@ -66,12 +28,7 @@ function fail(res, next, err) {
|
|
|
66
28
|
}
|
|
67
29
|
next(err);
|
|
68
30
|
}
|
|
69
|
-
/**
|
|
70
|
-
* The call envelope, at `/_fougere/call` — the door the browser primitives use.
|
|
71
|
-
*
|
|
72
|
-
* Mounted with `app.use()`, Express strips nothing, so the path still carries the
|
|
73
|
-
* audience segment (`/_fougere/call/public`) that `surfaceOf` reads.
|
|
74
|
-
*/
|
|
31
|
+
/** The call envelope, at `/_fougere/call` — the door the browser primitives use. */
|
|
75
32
|
export function fougereCall(mountPath = '/_fougere/call') {
|
|
76
33
|
return (req, res, next) => {
|
|
77
34
|
const path = pathOf(req);
|
|
@@ -104,12 +61,7 @@ export function fougereSession(mountPath = '/_fougere/session') {
|
|
|
104
61
|
res.status(200).json(sessionViewOf(stateOf(req)));
|
|
105
62
|
};
|
|
106
63
|
}
|
|
107
|
-
/**
|
|
108
|
-
* The REST projection, under `/api` by default.
|
|
109
|
-
*
|
|
110
|
-
* A path this app does not serve calls `next()` — so an app's own `/api/health` keeps
|
|
111
|
-
* answering whether it was registered before or after this middleware.
|
|
112
|
-
*/
|
|
64
|
+
/** The REST projection, under `/api` by default. */
|
|
113
65
|
export function fougereRest(mountPath = '/api') {
|
|
114
66
|
return (req, res, next) => {
|
|
115
67
|
const path = pathOf(req);
|
package/dist/express.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"express.js","sourceRoot":"","sources":["../src/express.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,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