29 lines
662 B
JavaScript
29 lines
662 B
JavaScript
/**
|
|
* @template Query
|
|
* @template Model
|
|
* @typedef {{ execute(query: Query, context?: RequestContext): Promise<Result<Model>> }} ResourceQueryPort
|
|
*/
|
|
|
|
/**
|
|
* @template Command
|
|
* @template Model
|
|
* @typedef {{ execute(command: Command, context?: RequestContext): Promise<Result<Model>> }} ResourceCommandPort
|
|
*/
|
|
|
|
/**
|
|
* @typedef {{
|
|
* operationId: string,
|
|
* routeId: string,
|
|
* signal?: AbortSignal,
|
|
* idempotencyKey?: string
|
|
* }} RequestContext
|
|
*/
|
|
|
|
/**
|
|
* @template Value
|
|
* @typedef {{ ok: true, value: Value, meta?: Record<string, unknown> } |
|
|
* { ok: false, error: import("../../contracts/errors.js").ApiFailure }} Result
|
|
*/
|
|
|
|
export {};
|