@fougere/app
The host-independent half of a Fougere app: boot, call envelope, REST table, form contract.
Entries: @fougere/app · @fougere/app/client · @fougere/app/answer · @fougere/app/web · @fougere/app/express
What you import
| name | |
|---|---|
configureFougere | Overrides the data layer sources: would give. |
extendFougere | Add to what is already stated, instead of replacing it. |
useFougereApp | The booted app: boots on first call and keeps it; a refusal is not kept. |
useFougereConfig | What fougere.config.ts says, read once and without booting. |
reloadFougere | Turn the ring. |
useFougereAuth | Get the auth runtime resolved at boot. Throws when no process-local frond brought one. |
authOf | |
tableOf | The table, per frond. |
prefixOf | |
invokeOn | Calls an operation server-side, in process or over the wire as the topology says. |
sessionOn | The session of the request a server renders, asked of the auth frond as a page would ask it. |
errorsByField | Index validator errors by field — local validator and remote validator share this shape. |
formFieldsOf | The fields a create form is made of. |
openingOf | What a form opens on: initial, else the declared defaults. |
payloadOf | The body of the form's values: an empty control is null where the field admits it, else absent. |
tableColumnsOf | The columns a list is made of. |
Choices | The rows a reference field offers — a handful, and a search to reach the others. |
SESSION_CALL | |
sessionOf | The session, asked through the envelope a page calls everything else through. |
stateFor | The request state for these headers. Empty when no auth is declared, or nobody is signed in. |
jsonBodyOf | The JSON body of a request, within maxBodyBytes; no body reads as undefined, another type is refused. |
graphqlSurfaceOf | The surface a GraphQL path selects. Ex: /graphql/public → public. |
createMemoryStorage |
Types
TypeScript types only — they do not run. Import them with import type to type your own code: a variable, a parameter, an option object.
| name | |
|---|---|
FougereServerConfig | |
SchemaView | |
FormRow | The row an entity class builds, which is what its form fills and what create answers. |
FormValues | What the form holds — any field, none of them yet. |
FormErrors | One message per refused field. |
FormFieldName | A field of that row, by name. |
FormField | |
FormReference | The entity a reference points at, and which of its fields names one of its rows. |
Choice | One row a reference may point at, as a form offers it. |
Offer | What one load offers, and whether the target holds more than it — which is when a search is worth showing. |
TableColumn | |
SessionView | |
GraphQLDocument | The GraphQL facade — declared like the others, mounted like the others. A document, its variables, and which operation of it to run. |