@fougere/core 0.1.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/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/binding.d.ts +63 -0
- package/dist/binding.d.ts.map +1 -0
- package/dist/binding.js +107 -0
- package/dist/binding.js.map +1 -0
- package/dist/boot.d.ts +38 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +53 -0
- package/dist/boot.js.map +1 -0
- package/dist/bootstrap.d.ts +4 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +825 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/builtins/config.d.ts +4 -0
- package/dist/builtins/config.d.ts.map +1 -0
- package/dist/builtins/config.js +6 -0
- package/dist/builtins/config.js.map +1 -0
- package/dist/builtins/logger.d.ts +28 -0
- package/dist/builtins/logger.d.ts.map +1 -0
- package/dist/builtins/logger.js +76 -0
- package/dist/builtins/logger.js.map +1 -0
- package/dist/call.d.ts +172 -0
- package/dist/call.d.ts.map +1 -0
- package/dist/call.js +209 -0
- package/dist/call.js.map +1 -0
- package/dist/collector.d.ts +28 -0
- package/dist/collector.d.ts.map +1 -0
- package/dist/collector.js +32 -0
- package/dist/collector.js.map +1 -0
- package/dist/config-loader.d.ts +59 -0
- package/dist/config-loader.d.ts.map +1 -0
- package/dist/config-loader.js +97 -0
- package/dist/config-loader.js.map +1 -0
- package/dist/contract.d.ts +43 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +29 -0
- package/dist/contract.js.map +1 -0
- package/dist/crud.d.ts +61 -0
- package/dist/crud.d.ts.map +1 -0
- package/dist/crud.js +85 -0
- package/dist/crud.js.map +1 -0
- package/dist/define.d.ts +8 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +9 -0
- package/dist/define.js.map +1 -0
- package/dist/egress.d.ts +78 -0
- package/dist/egress.d.ts.map +1 -0
- package/dist/egress.js +185 -0
- package/dist/egress.js.map +1 -0
- package/dist/emit.d.ts +51 -0
- package/dist/emit.d.ts.map +1 -0
- package/dist/emit.js +57 -0
- package/dist/emit.js.map +1 -0
- package/dist/errors.d.ts +22 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +74 -0
- package/dist/errors.js.map +1 -0
- package/dist/frond-config.d.ts +80 -0
- package/dist/frond-config.d.ts.map +1 -0
- package/dist/frond-config.js +32 -0
- package/dist/frond-config.js.map +1 -0
- package/dist/graph.d.ts +33 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +142 -0
- package/dist/graph.js.map +1 -0
- package/dist/handler-parser.d.ts +82 -0
- package/dist/handler-parser.d.ts.map +1 -0
- package/dist/handler-parser.js +505 -0
- package/dist/handler-parser.js.map +1 -0
- package/dist/imports.d.ts +22 -0
- package/dist/imports.d.ts.map +1 -0
- package/dist/imports.js +80 -0
- package/dist/imports.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/invocation.d.ts +20 -0
- package/dist/invocation.d.ts.map +1 -0
- package/dist/invocation.js +15 -0
- package/dist/invocation.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +15 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/error-handler.js +29 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/logger.d.ts +14 -0
- package/dist/middleware/logger.d.ts.map +1 -0
- package/dist/middleware/logger.js +25 -0
- package/dist/middleware/logger.js.map +1 -0
- package/dist/middleware.d.ts +75 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +89 -0
- package/dist/middleware.js.map +1 -0
- package/dist/operation.d.ts +87 -0
- package/dist/operation.d.ts.map +1 -0
- package/dist/operation.js +95 -0
- package/dist/operation.js.map +1 -0
- package/dist/orm.d.ts +96 -0
- package/dist/orm.d.ts.map +1 -0
- package/dist/orm.js +33 -0
- package/dist/orm.js.map +1 -0
- package/dist/presenter.d.ts +63 -0
- package/dist/presenter.d.ts.map +1 -0
- package/dist/presenter.js +72 -0
- package/dist/presenter.js.map +1 -0
- package/dist/remote.d.ts +48 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +135 -0
- package/dist/remote.js.map +1 -0
- package/dist/repository.d.ts +55 -0
- package/dist/repository.d.ts.map +1 -0
- package/dist/repository.js +26 -0
- package/dist/repository.js.map +1 -0
- package/dist/scan-cache.d.ts +10 -0
- package/dist/scan-cache.d.ts.map +1 -0
- package/dist/scan-cache.js +92 -0
- package/dist/scan-cache.js.map +1 -0
- package/dist/scanner.d.ts +34 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +595 -0
- package/dist/scanner.js.map +1 -0
- package/dist/seed.d.ts +28 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +110 -0
- package/dist/seed.js.map +1 -0
- package/dist/types.d.ts +387 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/verify.d.ts +57 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +147 -0
- package/dist/verify.js.map +1 -0
- package/package.json +47 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export { createApp } from './bootstrap.js';
|
|
2
|
+
export { boot } from './boot.js';
|
|
3
|
+
export { orderSeeds, runSeeds } from './seed.js';
|
|
4
|
+
export { defineFougere } from './define.js';
|
|
5
|
+
export { loadConfig, loadCascadedConfig, loadFrondConfigs, mergeGlobal, mergeConfig, configForFrond, resolveConfig, type FougereConfig, type ResolvedConfig } from './config-loader.js';
|
|
6
|
+
export { defineFrond, loadFrondConfig, type FrondConfig, type OperationOverride } from './frond-config.js';
|
|
7
|
+
export { buildGraph, clusterEntities, suggestSplit, type EntityNode, type DomainCluster } from './graph.js';
|
|
8
|
+
export { Crud } from './crud.js';
|
|
9
|
+
export type { CrudOps, CrudOpName, CrudViews, CrudConstructor } from './crud.js';
|
|
10
|
+
export { Presenter, getPresenterTarget, getPresenterFields, getPresenterViews } from './presenter.js';
|
|
11
|
+
export type { PresenterViews } from './presenter.js';
|
|
12
|
+
export { Collector, getCollectorTarget } from './collector.js';
|
|
13
|
+
export { computeBindingPlan, resolveArgs } from './binding.js';
|
|
14
|
+
export type { BindingPlan, ParamBinding, ParamSource, CollectorResolver } from './binding.js';
|
|
15
|
+
export type { InvocationContext } from './invocation.js';
|
|
16
|
+
export { EMPTY_INVOCATION } from './invocation.js';
|
|
17
|
+
export { isReadOp, resolveIsReadOp } from './operation.js';
|
|
18
|
+
export type { OperationContract, OperationsMap } from './operation.js';
|
|
19
|
+
export { scanProject, frondAliases, FROND_DIRS, toRegistrationName, setModuleLoader, type ModuleLoader } from './scanner.js';
|
|
20
|
+
export { runMiddlewares, FougereError, ErrorCode } from './middleware.js';
|
|
21
|
+
export { createLocalRunner, createAppRunner, identityCardOf, RPC_ENTITY } from './call.js';
|
|
22
|
+
export { facadeKeyOf, contractsKeyOf } from './call.js';
|
|
23
|
+
export { type Emit, type Fact, emitKeyOf, factOfEmitKey, factsAnnouncedBy } from './emit.js';
|
|
24
|
+
export { resolveContracts } from './operation.js';
|
|
25
|
+
export type { FrondCall, Transport, IdentityCard, CardOp, Facade } from './call.js';
|
|
26
|
+
export { callValueOf } from './contract.js';
|
|
27
|
+
export type { CallValue } from './contract.js';
|
|
28
|
+
export type { OperationContext, AppNext, AppMiddleware, FougereErrorOptions } from './middleware.js';
|
|
29
|
+
export { toHttpError, toPublicError, httpStatusFor } from './errors.js';
|
|
30
|
+
export { loggerMiddleware } from './middleware/logger.js';
|
|
31
|
+
export { errorMiddleware } from './middleware/error-handler.js';
|
|
32
|
+
export { Logger } from './builtins/logger.js';
|
|
33
|
+
export { Config } from './builtins/config.js';
|
|
34
|
+
export type { EntityOrm, OrmFactory, ListOptions, ListResult } from './orm.js';
|
|
35
|
+
export { LIST_OPTION_KEYS, assertListOptions } from './orm.js';
|
|
36
|
+
export type { App, CreateAppOptions, ScanResult, ScanDiagnostic, FrondDescriptor, FrondSource, ProviderEntry, EntityEntry, HandlerEntry, SeedEntry, SeedFactory, PresenterEntry, PresenterFieldMeta, CollectorEntry, AuthConfig, AuthContext, AuthRuntime, } from './types.js';
|
|
37
|
+
export { ormKeyOf } from './orm.js';
|
|
38
|
+
export { presenterKeyOf } from './presenter.js';
|
|
39
|
+
export { collectorKeyOf } from './collector.js';
|
|
40
|
+
export { Repository, getRepositoryTarget, repositoryKeyOf, type RepositoryOf, type RepositoryConstructor } from './repository.js';
|
|
41
|
+
export { verify, assertSplittable, type Violation } from './verify.js';
|
|
42
|
+
export { crossFrondImports, type CrossFrondImport } from './imports.js';
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxL,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,C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AAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { createApp } from './bootstrap.js';
|
|
2
|
+
export { boot } from './boot.js';
|
|
3
|
+
export { orderSeeds, runSeeds } from './seed.js';
|
|
4
|
+
export { defineFougere } from './define.js';
|
|
5
|
+
export { loadConfig, loadCascadedConfig, loadFrondConfigs, mergeGlobal, mergeConfig, configForFrond, resolveConfig } from './config-loader.js';
|
|
6
|
+
export { defineFrond, loadFrondConfig } from './frond-config.js';
|
|
7
|
+
export { buildGraph, clusterEntities, suggestSplit } from './graph.js';
|
|
8
|
+
export { Crud } from './crud.js';
|
|
9
|
+
export { Presenter, getPresenterTarget, getPresenterFields, getPresenterViews } from './presenter.js';
|
|
10
|
+
export { Collector, getCollectorTarget } from './collector.js';
|
|
11
|
+
export { computeBindingPlan, resolveArgs } from './binding.js';
|
|
12
|
+
export { EMPTY_INVOCATION } from './invocation.js';
|
|
13
|
+
export { isReadOp, resolveIsReadOp } from './operation.js';
|
|
14
|
+
export { scanProject, frondAliases, FROND_DIRS, toRegistrationName, setModuleLoader } from './scanner.js';
|
|
15
|
+
export { runMiddlewares, FougereError, ErrorCode } from './middleware.js';
|
|
16
|
+
export { createLocalRunner, createAppRunner, identityCardOf, RPC_ENTITY } from './call.js';
|
|
17
|
+
// The container keys, exported so any reader asks the same question the bootstrap
|
|
18
|
+
// answers. A second reader that respells one looks in the wrong place and reports
|
|
19
|
+
// nothing found — which is indistinguishable from nothing wrong.
|
|
20
|
+
export { facadeKeyOf, contractsKeyOf } from './call.js';
|
|
21
|
+
export { emitKeyOf, factOfEmitKey, factsAnnouncedBy } from './emit.js';
|
|
22
|
+
export { resolveContracts } from './operation.js';
|
|
23
|
+
export { callValueOf } from './contract.js';
|
|
24
|
+
export { toHttpError, toPublicError, httpStatusFor } from './errors.js';
|
|
25
|
+
export { loggerMiddleware } from './middleware/logger.js';
|
|
26
|
+
export { errorMiddleware } from './middleware/error-handler.js';
|
|
27
|
+
export { Logger } from './builtins/logger.js';
|
|
28
|
+
export { Config } from './builtins/config.js';
|
|
29
|
+
export { LIST_OPTION_KEYS, assertListOptions } from './orm.js';
|
|
30
|
+
export { ormKeyOf } from './orm.js';
|
|
31
|
+
export { presenterKeyOf } from './presenter.js';
|
|
32
|
+
export { collectorKeyOf } from './collector.js';
|
|
33
|
+
export { Repository, getRepositoryTarget, repositoryKeyOf } from './repository.js';
|
|
34
|
+
export { verify, assertSplittable } from './verify.js';
|
|
35
|
+
// Same question as verify(), answered from the source text instead of the model.
|
|
36
|
+
export { crossFrondImports } from './imports.js';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAA2C,MAAM,oBAAoB,CAAC;AACxL,OAAO,EAAE,WAAW,EAAE,eAAe,EAA4C,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAuC,MAAM,YAAY,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEtG,OAAO,EAAE,SAAS,EAA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,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAiD,MAAM,iBAAiB,CAAC;AAClI,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAkB,MAAM,aAAa,CAAC;AACvE,iFAAiF;AACjF,OAAO,EAAE,iBAAiB,EAAyB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InvocationContext — unified cross-transport context.
|
|
3
|
+
*
|
|
4
|
+
* Every bridge (REST, GraphQL, Nuxt, CLI, event bus) produces an
|
|
5
|
+
* InvocationContext before calling a handler facade. The binding
|
|
6
|
+
* algorithm uses it to resolve handler parameters by type.
|
|
7
|
+
*/
|
|
8
|
+
export interface InvocationContext {
|
|
9
|
+
/** Named path/route params (URL segments, CLI positional args). */
|
|
10
|
+
params: Record<string, string>;
|
|
11
|
+
/** Query-string params (CLI flags, search params). */
|
|
12
|
+
query: Record<string, string>;
|
|
13
|
+
/** Payload (HTTP body, event payload, CLI stdin). */
|
|
14
|
+
body: unknown;
|
|
15
|
+
/** State deposited by middlewares (auth, session, tenant). */
|
|
16
|
+
state: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/** Empty context for programmatic / test calls. */
|
|
19
|
+
export declare const EMPTY_INVOCATION: InvocationContext;
|
|
20
|
+
//# sourceMappingURL=invocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../src/invocation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,qDAAqD;IACrD,IAAI,EAAE,OAAO,CAAC;IACd,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,EAAE,iBAK9B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InvocationContext — unified cross-transport context.
|
|
3
|
+
*
|
|
4
|
+
* Every bridge (REST, GraphQL, Nuxt, CLI, event bus) produces an
|
|
5
|
+
* InvocationContext before calling a handler facade. The binding
|
|
6
|
+
* algorithm uses it to resolve handler parameters by type.
|
|
7
|
+
*/
|
|
8
|
+
/** Empty context for programmatic / test calls. */
|
|
9
|
+
export const EMPTY_INVOCATION = {
|
|
10
|
+
params: {},
|
|
11
|
+
query: {},
|
|
12
|
+
body: undefined,
|
|
13
|
+
state: {},
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=invocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocation.js","sourceRoot":"","sources":["../src/invocation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,EAAE;CACV,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error handler middleware — normalizes errors into FougereError.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppMiddleware } from '../middleware.js';
|
|
5
|
+
/**
|
|
6
|
+
* Create an error handler middleware that wraps thrown errors into FougereError.
|
|
7
|
+
*
|
|
8
|
+
* Errors that are already FougereError pass through unchanged.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* app.use(errorMiddleware())
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function errorMiddleware(): AppMiddleware;
|
|
15
|
+
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middleware/error-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,aAAa,CAe/C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FougereError, ErrorCode } from '../middleware.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create an error handler middleware that wraps thrown errors into FougereError.
|
|
4
|
+
*
|
|
5
|
+
* Errors that are already FougereError pass through unchanged.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* app.use(errorMiddleware())
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export function errorMiddleware() {
|
|
12
|
+
return async (ctx, next) => {
|
|
13
|
+
try {
|
|
14
|
+
return await next();
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
if (err instanceof FougereError)
|
|
18
|
+
throw err;
|
|
19
|
+
throw new FougereError({
|
|
20
|
+
code: ErrorCode.INTERNAL_ERROR,
|
|
21
|
+
message: err.message ?? 'Internal error',
|
|
22
|
+
entity: ctx.entity,
|
|
23
|
+
operation: ctx.operation,
|
|
24
|
+
cause: err,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middleware/error-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,EAAE,CAAC;QACtB,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,YAAY,YAAY;gBAAE,MAAM,GAAG,CAAC;YAC3C,MAAM,IAAI,YAAY,CAAC;gBACrB,IAAI,EAAE,SAAS,CAAC,cAAc;gBAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,gBAAgB;gBACxC,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,KAAK,EAAE,GAAG;aACX,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger middleware — logs every operation with timing.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppMiddleware } from '../middleware.js';
|
|
5
|
+
import type { Logger } from '../builtins/logger.js';
|
|
6
|
+
/**
|
|
7
|
+
* Create a logger middleware that logs operation entry, exit, and errors.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* app.use(loggerMiddleware(app.resolve('logger')))
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function loggerMiddleware(logger: Logger): AppMiddleware;
|
|
14
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/middleware/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAe9D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a logger middleware that logs operation entry, exit, and errors.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* app.use(loggerMiddleware(app.resolve('logger')))
|
|
6
|
+
* ```
|
|
7
|
+
*/
|
|
8
|
+
export function loggerMiddleware(logger) {
|
|
9
|
+
return async (ctx, next) => {
|
|
10
|
+
const start = performance.now();
|
|
11
|
+
logger.info(`${ctx.entity}.${ctx.operation}`);
|
|
12
|
+
try {
|
|
13
|
+
const result = await next();
|
|
14
|
+
const ms = (performance.now() - start).toFixed(1);
|
|
15
|
+
logger.info(`${ctx.entity}.${ctx.operation} (${ms}ms)`);
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
const ms = (performance.now() - start).toFixed(1);
|
|
20
|
+
logger.error(`${ctx.entity}.${ctx.operation} (${ms}ms)`, err);
|
|
21
|
+
throw err;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/middleware/logger.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5B,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9D,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-level middleware — intercepts handler facade operations.
|
|
3
|
+
*
|
|
4
|
+
* Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
|
|
5
|
+
*/
|
|
6
|
+
export interface OperationContext {
|
|
7
|
+
/** Entity name (e.g. 'product'). */
|
|
8
|
+
entity: string;
|
|
9
|
+
/** Operation name (e.g. 'create', 'findById', 'searchByTitle'). */
|
|
10
|
+
operation: string;
|
|
11
|
+
/** Arguments passed to the operation. */
|
|
12
|
+
args: unknown[];
|
|
13
|
+
/** Extensible bag — middlewares deposit data here (user, permissions, etc.). */
|
|
14
|
+
state: Record<string, unknown>;
|
|
15
|
+
/** Transport-agnostic invocation context (params, query, body, state). */
|
|
16
|
+
invocation?: import('./invocation.js').InvocationContext;
|
|
17
|
+
}
|
|
18
|
+
export type AppNext = () => Promise<unknown>;
|
|
19
|
+
export type AppMiddleware = (ctx: OperationContext, next: AppNext) => Promise<unknown>;
|
|
20
|
+
/** Semantic error codes — transport-agnostic. Each bridge maps them to its own format. */
|
|
21
|
+
export declare enum ErrorCode {
|
|
22
|
+
VALIDATION_FAILED = "VALIDATION_FAILED",
|
|
23
|
+
BAD_REQUEST = "BAD_REQUEST",
|
|
24
|
+
UNAUTHORIZED = "UNAUTHORIZED",
|
|
25
|
+
FORBIDDEN = "FORBIDDEN",
|
|
26
|
+
NOT_FOUND = "NOT_FOUND",
|
|
27
|
+
GONE = "GONE",
|
|
28
|
+
CONFLICT = "CONFLICT",
|
|
29
|
+
LOCKED = "LOCKED",
|
|
30
|
+
METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED",
|
|
31
|
+
PRECONDITION_FAILED = "PRECONDITION_FAILED",
|
|
32
|
+
PAYLOAD_TOO_LARGE = "PAYLOAD_TOO_LARGE",
|
|
33
|
+
UNPROCESSABLE_ENTITY = "UNPROCESSABLE_ENTITY",
|
|
34
|
+
TOO_MANY_REQUESTS = "TOO_MANY_REQUESTS",
|
|
35
|
+
REQUEST_TIMEOUT = "REQUEST_TIMEOUT",
|
|
36
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
37
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
38
|
+
BAD_GATEWAY = "BAD_GATEWAY",
|
|
39
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
40
|
+
GATEWAY_TIMEOUT = "GATEWAY_TIMEOUT"
|
|
41
|
+
}
|
|
42
|
+
export interface FougereErrorOptions {
|
|
43
|
+
code: ErrorCode;
|
|
44
|
+
message: string;
|
|
45
|
+
entity?: string;
|
|
46
|
+
operation?: string;
|
|
47
|
+
details?: unknown;
|
|
48
|
+
cause?: unknown;
|
|
49
|
+
}
|
|
50
|
+
export declare class FougereError extends Error {
|
|
51
|
+
readonly code: ErrorCode;
|
|
52
|
+
readonly entity?: string;
|
|
53
|
+
readonly operation?: string;
|
|
54
|
+
readonly details?: unknown;
|
|
55
|
+
constructor(options: FougereErrorOptions);
|
|
56
|
+
toJSON(): {
|
|
57
|
+
details?: {} | null | undefined;
|
|
58
|
+
operation?: string | undefined;
|
|
59
|
+
entity?: string | undefined;
|
|
60
|
+
code: ErrorCode;
|
|
61
|
+
message: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Dual of toJSON — rebuild a typed error from its wire form.
|
|
65
|
+
*
|
|
66
|
+
* Wire input is untrusted: an unknown code degrades to INTERNAL_ERROR
|
|
67
|
+
* (original code kept in details) instead of forging a fake semantic code.
|
|
68
|
+
*/
|
|
69
|
+
static fromJSON(json: unknown): FougereError;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Execute a middleware chain (onion model) then the handler.
|
|
73
|
+
*/
|
|
74
|
+
export declare function runMiddlewares(middlewares: AppMiddleware[], ctx: OperationContext, handler: AppNext): Promise<unknown>;
|
|
75
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,iBAAiB,EAAE,iBAAiB,CAAC;CAC1D;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIvF,0FAA0F;AAC1F,oBAAY,SAAS;IAEnB,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IAGvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,kBAAkB,uBAAuB;IAGzC,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,eAAe,oBAAoB;IAGnC,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;CACpC;AAID,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEf,OAAO,EAAE,mBAAmB;IASxC,MAAM;;;;;;;IAUN;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY;CAW7C;AAID;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,aAAa,EAAE,EAC5B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CASlB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-level middleware — intercepts handler facade operations.
|
|
3
|
+
*
|
|
4
|
+
* Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
|
|
5
|
+
*/
|
|
6
|
+
// ── ErrorCode ──────────────────────────────────
|
|
7
|
+
/** Semantic error codes — transport-agnostic. Each bridge maps them to its own format. */
|
|
8
|
+
export var ErrorCode;
|
|
9
|
+
(function (ErrorCode) {
|
|
10
|
+
// Input
|
|
11
|
+
ErrorCode["VALIDATION_FAILED"] = "VALIDATION_FAILED";
|
|
12
|
+
ErrorCode["BAD_REQUEST"] = "BAD_REQUEST";
|
|
13
|
+
// Auth
|
|
14
|
+
ErrorCode["UNAUTHORIZED"] = "UNAUTHORIZED";
|
|
15
|
+
ErrorCode["FORBIDDEN"] = "FORBIDDEN";
|
|
16
|
+
// Resources
|
|
17
|
+
ErrorCode["NOT_FOUND"] = "NOT_FOUND";
|
|
18
|
+
ErrorCode["GONE"] = "GONE";
|
|
19
|
+
ErrorCode["CONFLICT"] = "CONFLICT";
|
|
20
|
+
ErrorCode["LOCKED"] = "LOCKED";
|
|
21
|
+
ErrorCode["METHOD_NOT_ALLOWED"] = "METHOD_NOT_ALLOWED";
|
|
22
|
+
// Limits
|
|
23
|
+
ErrorCode["PRECONDITION_FAILED"] = "PRECONDITION_FAILED";
|
|
24
|
+
ErrorCode["PAYLOAD_TOO_LARGE"] = "PAYLOAD_TOO_LARGE";
|
|
25
|
+
ErrorCode["UNPROCESSABLE_ENTITY"] = "UNPROCESSABLE_ENTITY";
|
|
26
|
+
ErrorCode["TOO_MANY_REQUESTS"] = "TOO_MANY_REQUESTS";
|
|
27
|
+
ErrorCode["REQUEST_TIMEOUT"] = "REQUEST_TIMEOUT";
|
|
28
|
+
// Server
|
|
29
|
+
ErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
|
30
|
+
ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
31
|
+
ErrorCode["BAD_GATEWAY"] = "BAD_GATEWAY";
|
|
32
|
+
ErrorCode["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
|
|
33
|
+
ErrorCode["GATEWAY_TIMEOUT"] = "GATEWAY_TIMEOUT";
|
|
34
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
35
|
+
export class FougereError extends Error {
|
|
36
|
+
code;
|
|
37
|
+
entity;
|
|
38
|
+
operation;
|
|
39
|
+
details;
|
|
40
|
+
constructor(options) {
|
|
41
|
+
super(options.message, { cause: options.cause });
|
|
42
|
+
this.name = 'FougereError';
|
|
43
|
+
this.code = options.code;
|
|
44
|
+
this.entity = options.entity;
|
|
45
|
+
this.operation = options.operation;
|
|
46
|
+
this.details = options.details;
|
|
47
|
+
}
|
|
48
|
+
toJSON() {
|
|
49
|
+
return {
|
|
50
|
+
code: this.code,
|
|
51
|
+
message: this.message,
|
|
52
|
+
...(this.entity && { entity: this.entity }),
|
|
53
|
+
...(this.operation && { operation: this.operation }),
|
|
54
|
+
...(this.details !== undefined && { details: this.details }),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Dual of toJSON — rebuild a typed error from its wire form.
|
|
59
|
+
*
|
|
60
|
+
* Wire input is untrusted: an unknown code degrades to INTERNAL_ERROR
|
|
61
|
+
* (original code kept in details) instead of forging a fake semantic code.
|
|
62
|
+
*/
|
|
63
|
+
static fromJSON(json) {
|
|
64
|
+
const raw = (typeof json === 'object' && json !== null ? json : {});
|
|
65
|
+
const known = Object.values(ErrorCode).includes(raw.code);
|
|
66
|
+
return new FougereError({
|
|
67
|
+
code: known ? raw.code : ErrorCode.INTERNAL_ERROR,
|
|
68
|
+
message: typeof raw.message === 'string' ? raw.message : 'Unknown error',
|
|
69
|
+
entity: typeof raw.entity === 'string' ? raw.entity : undefined,
|
|
70
|
+
operation: typeof raw.operation === 'string' ? raw.operation : undefined,
|
|
71
|
+
details: known ? raw.details : { originalCode: raw.code, details: raw.details },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// ── Runner ──────────────────────────────────────
|
|
76
|
+
/**
|
|
77
|
+
* Execute a middleware chain (onion model) then the handler.
|
|
78
|
+
*/
|
|
79
|
+
export function runMiddlewares(middlewares, ctx, handler) {
|
|
80
|
+
let index = 0;
|
|
81
|
+
const next = () => {
|
|
82
|
+
if (index < middlewares.length) {
|
|
83
|
+
return middlewares[index++](ctx, next);
|
|
84
|
+
}
|
|
85
|
+
return handler();
|
|
86
|
+
};
|
|
87
|
+
return next();
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,kDAAkD;AAElD,0FAA0F;AAC1F,MAAM,CAAN,IAAY,SA6BX;AA7BD,WAAY,SAAS;IACnB,QAAQ;IACR,oDAAuC,CAAA;IACvC,wCAA2B,CAAA;IAE3B,OAAO;IACP,0CAA6B,CAAA;IAC7B,oCAAuB,CAAA;IAEvB,YAAY;IACZ,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,sDAAyC,CAAA;IAEzC,SAAS;IACT,wDAA2C,CAAA;IAC3C,oDAAuC,CAAA;IACvC,0DAA6C,CAAA;IAC7C,oDAAuC,CAAA;IACvC,gDAAmC,CAAA;IAEnC,SAAS;IACT,8CAAiC,CAAA;IACjC,gDAAmC,CAAA;IACnC,wCAA2B,CAAA;IAC3B,wDAA2C,CAAA;IAC3C,gDAAmC,CAAA;AACrC,CAAC,EA7BW,SAAS,KAAT,SAAS,QA6BpB;AAaD,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,CAAY;IAChB,MAAM,CAAU;IAChB,SAAS,CAAU;IACnB,OAAO,CAAW;IAE3B,YAAY,OAA4B;QACtC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS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CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACxE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;SAChF,CAAC,CAAC;IACL,CAAC;CACF;AAED,mDAAmD;AAEnD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,WAA4B,EAC5B,GAAqB,EACrB,OAAgB;IAEhB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,GAAqB,EAAE;QAClC,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC;IACF,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { SchemaLike } from '@fougere/schema';
|
|
2
|
+
import type { BindingPlan } from './binding.js';
|
|
3
|
+
import type { HandlerEntry, FrondDescriptor } from './types.js';
|
|
4
|
+
import type { ParsedMethod, ParsedType, ParsedParam } from './handler-parser.js';
|
|
5
|
+
/**
|
|
6
|
+
* The contract of one operation — everything the façade needs to serve a call.
|
|
7
|
+
*
|
|
8
|
+
* Produced two ways, indistinguishable once here: the scan DERIVES it from a
|
|
9
|
+
* method's parsed signature, a prefab handler DECLARES it outright. The façade
|
|
10
|
+
* consumes contracts and nothing else — it knows no operation by name, and a
|
|
11
|
+
* declared contract survives a scan that resolved nothing.
|
|
12
|
+
*/
|
|
13
|
+
export interface OperationContract {
|
|
14
|
+
/** Judged on the way in. The view carries its own mode (`partial()` → patch). */
|
|
15
|
+
input?: SchemaLike;
|
|
16
|
+
/** Projected on the way out. */
|
|
17
|
+
output?: SchemaLike;
|
|
18
|
+
/** Where each argument is read from in the invocation. */
|
|
19
|
+
binding?: BindingPlan;
|
|
20
|
+
/**
|
|
21
|
+
* The operation in words, for a caller that meets it over the wire and has to
|
|
22
|
+
* choose. Same three producers as the rest: the scan derives it from the method's
|
|
23
|
+
* doc comment, a prefab declares it, config states it and wins.
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* How MUCH comes back — the half of the return type that `output` cannot say.
|
|
28
|
+
*
|
|
29
|
+
* `output` is the shape of ONE row; it is silent on whether the op hands back one,
|
|
30
|
+
* several, or a page. The prefab knows (`list` returns a `ListResult`, `findById`
|
|
31
|
+
* returns `T | undefined`) and the card did not, so anything generating a signature
|
|
32
|
+
* from the card would have written `list(): Promise<Post[]>` — false, and a false
|
|
33
|
+
* signature is worse than none.
|
|
34
|
+
*
|
|
35
|
+
* `none` says there is no shaped output at all (a boolean, a void), not that the op
|
|
36
|
+
* returns nothing.
|
|
37
|
+
*/
|
|
38
|
+
cardinality?: 'one' | 'maybe' | 'many' | 'page' | 'none';
|
|
39
|
+
/** The scan's raw material, when it produced this contract. `binding` wins. */
|
|
40
|
+
signature?: ParsedMethod;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Read an op's cardinality off its parsed return type.
|
|
44
|
+
*
|
|
45
|
+
* `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
|
|
46
|
+
* `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
|
|
47
|
+
* a plain list and lose its `total`/`hasMore`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function cardinalityOf(type: ParsedType | undefined): OperationContract['cardinality'];
|
|
50
|
+
/** Map of operation name → its contract. */
|
|
51
|
+
export type OperationsMap = Map<string, OperationContract>;
|
|
52
|
+
export type { ParsedType, ParsedParam };
|
|
53
|
+
/** Convention-based: returns true if the operation name implies a read (query/GET). */
|
|
54
|
+
export declare function isReadOp(name: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve operation kind honoring per-op overrides (from frond.config.ts).
|
|
57
|
+
* Precedence: explicit override wins over convention.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveIsReadOp(name: string, overrides?: Record<string, {
|
|
60
|
+
kind?: 'query' | 'command';
|
|
61
|
+
}>): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The contract of every operation a handler serves — the three producers, merged once.
|
|
64
|
+
*
|
|
65
|
+
* This lived inline in `buildFacade`, which made the façade the only thing that could
|
|
66
|
+
* answer "what is this op's contract, really?". Anything else asking — a checker, a
|
|
67
|
+
* client generator, a descriptor — had to redo the merge, and a second opinion that
|
|
68
|
+
* drifts reports nothing wrong while looking at the wrong thing.
|
|
69
|
+
*
|
|
70
|
+
* The order is a claim about authority, not a convenience:
|
|
71
|
+
*
|
|
72
|
+
* 1. a prefab DECLARES what it built (`Crud(E).__ops`) — runtime, so it survives a
|
|
73
|
+
* scan that resolved nothing;
|
|
74
|
+
* 2. the scan DERIVES from source — a method written in this very file is the
|
|
75
|
+
* author's own word and beats everything; a method it merely READ on a base
|
|
76
|
+
* class is a guess about someone else's code, and yields to that code's own
|
|
77
|
+
* declaration;
|
|
78
|
+
* 3. `frond.config.ts` STATES — the most explicit statement, made by whoever
|
|
79
|
+
* assembles the app, and the only answer for an op inherited from an installed
|
|
80
|
+
* base class the workspace-only scan cannot see. Merged per key, so stating a
|
|
81
|
+
* `binding` alone does not erase an `input` the scan found.
|
|
82
|
+
*
|
|
83
|
+
* Pure: no container, no instance, no disk. The binding plan is resolved here, so
|
|
84
|
+
* nothing downstream ever meets an AST.
|
|
85
|
+
*/
|
|
86
|
+
export declare function resolveContracts(handler: Pick<HandlerEntry, 'ctor' | 'operations'>, overrides: FrondDescriptor['operationsOverrides'], collectorEntityNames: Set<string>): OperationsMap;
|
|
87
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":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;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAAC,EAClD,SAAS,EAAE,eAAe,CAAC,qBAAqB,CAAC,EACjD,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,GAChC,aAAa,CA0Bf"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { computeBindingPlan } from './binding.js';
|
|
2
|
+
/**
|
|
3
|
+
* Read an op's cardinality off its parsed return type.
|
|
4
|
+
*
|
|
5
|
+
* `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
|
|
6
|
+
* `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
|
|
7
|
+
* a plain list and lose its `total`/`hasMore`.
|
|
8
|
+
*/
|
|
9
|
+
export function cardinalityOf(type) {
|
|
10
|
+
if (!type)
|
|
11
|
+
return undefined;
|
|
12
|
+
const inner = type.name === 'Promise' ? type.generics?.[0] : type;
|
|
13
|
+
if (!inner)
|
|
14
|
+
return 'none';
|
|
15
|
+
if (inner.name === 'ListResult')
|
|
16
|
+
return 'page';
|
|
17
|
+
if (inner.array)
|
|
18
|
+
return 'many';
|
|
19
|
+
if (PRIMITIVE_RETURNS.has(inner.name))
|
|
20
|
+
return 'none';
|
|
21
|
+
return inner.nullable ? 'maybe' : 'one';
|
|
22
|
+
}
|
|
23
|
+
/** A return that carries no schema — the card has nothing to project onto it. */
|
|
24
|
+
const PRIMITIVE_RETURNS = new Set(['boolean', 'string', 'number', 'void', 'undefined', 'unknown', 'any']);
|
|
25
|
+
// ─── Operation intent (read vs write) ──────────
|
|
26
|
+
// Naming convention for inferred handlers — scheduled to die with the
|
|
27
|
+
// handler-kind plan (docs/notes/handler-kind.md). Lives here, NOT in
|
|
28
|
+
// @fougere/schema: it is a runtime convention about operations, not a
|
|
29
|
+
// schema concept.
|
|
30
|
+
const READ_PREFIXES = ['list', 'find', 'get', 'search', 'count', 'exists', 'stats'];
|
|
31
|
+
/** Convention-based: returns true if the operation name implies a read (query/GET). */
|
|
32
|
+
export function isReadOp(name) {
|
|
33
|
+
return READ_PREFIXES.some((p) => name.startsWith(p));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve operation kind honoring per-op overrides (from frond.config.ts).
|
|
37
|
+
* Precedence: explicit override wins over convention.
|
|
38
|
+
*/
|
|
39
|
+
export function resolveIsReadOp(name, overrides) {
|
|
40
|
+
const kind = overrides?.[name]?.kind;
|
|
41
|
+
if (kind)
|
|
42
|
+
return kind === 'query';
|
|
43
|
+
return isReadOp(name);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The contract of every operation a handler serves — the three producers, merged once.
|
|
47
|
+
*
|
|
48
|
+
* This lived inline in `buildFacade`, which made the façade the only thing that could
|
|
49
|
+
* answer "what is this op's contract, really?". Anything else asking — a checker, a
|
|
50
|
+
* client generator, a descriptor — had to redo the merge, and a second opinion that
|
|
51
|
+
* drifts reports nothing wrong while looking at the wrong thing.
|
|
52
|
+
*
|
|
53
|
+
* The order is a claim about authority, not a convenience:
|
|
54
|
+
*
|
|
55
|
+
* 1. a prefab DECLARES what it built (`Crud(E).__ops`) — runtime, so it survives a
|
|
56
|
+
* scan that resolved nothing;
|
|
57
|
+
* 2. the scan DERIVES from source — a method written in this very file is the
|
|
58
|
+
* author's own word and beats everything; a method it merely READ on a base
|
|
59
|
+
* class is a guess about someone else's code, and yields to that code's own
|
|
60
|
+
* declaration;
|
|
61
|
+
* 3. `frond.config.ts` STATES — the most explicit statement, made by whoever
|
|
62
|
+
* assembles the app, and the only answer for an op inherited from an installed
|
|
63
|
+
* base class the workspace-only scan cannot see. Merged per key, so stating a
|
|
64
|
+
* `binding` alone does not erase an `input` the scan found.
|
|
65
|
+
*
|
|
66
|
+
* Pure: no container, no instance, no disk. The binding plan is resolved here, so
|
|
67
|
+
* nothing downstream ever meets an AST.
|
|
68
|
+
*/
|
|
69
|
+
export function resolveContracts(handler, overrides, collectorEntityNames) {
|
|
70
|
+
const declared = handler.ctor.__ops ?? {};
|
|
71
|
+
const contracts = new Map(Object.entries(declared));
|
|
72
|
+
for (const [opName, scanned] of handler.operations) {
|
|
73
|
+
if (scanned.signature?.inherited && opName in declared)
|
|
74
|
+
continue;
|
|
75
|
+
contracts.set(opName, {
|
|
76
|
+
...scanned,
|
|
77
|
+
binding: scanned.binding
|
|
78
|
+
?? (scanned.signature ? computeBindingPlan(scanned.signature.params, collectorEntityNames) : undefined),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
for (const [opName, override] of Object.entries(overrides ?? {})) {
|
|
82
|
+
const { input, output, binding, description } = override;
|
|
83
|
+
if (input === undefined && output === undefined && binding === undefined && description === undefined)
|
|
84
|
+
continue;
|
|
85
|
+
contracts.set(opName, {
|
|
86
|
+
...contracts.get(opName),
|
|
87
|
+
...(input !== undefined && { input }),
|
|
88
|
+
...(output !== undefined && { output }),
|
|
89
|
+
...(binding !== undefined && { binding }),
|
|
90
|
+
...(description !== undefined && { description }),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return contracts;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AA0ClD;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAA4B;IACxD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClE,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAC;IAC1B,IAAI,KAAK,CAAC,IAAI,KAAK,Y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