@controller-contract/server 0.3.0 → 0.3.3
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/index.d.mts +3 -4
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ControllerContract, ExitOutput, FailOutput, InputChannel, Method, NextOutput, NoInput, Output, ParamsFrom, PassOutput } from "@controller-contract/core";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
-
|
|
4
3
|
//#region src/classes/controller-contract-controller/controller-contract-controller.d.ts
|
|
5
4
|
type ControllerContractController<TMethod extends Method, TPath extends string, TParamsInput, TQueryInput, TBodyInput, TOuput extends Output, TRouter> = (() => TRouter) & {
|
|
6
5
|
'~cc'?: TMethod | TPath | TParamsInput | TQueryInput | TBodyInput | TOuput;
|
|
@@ -60,7 +59,7 @@ declare const StandardOutputs: Readonly<{
|
|
|
60
59
|
//#region src/types/index.d.ts
|
|
61
60
|
type BuilderIntegratorFn<TFrameworkContext, TFrameworkInject, TFrameworkRouter> = (spec: ControllerContractSpec<TFrameworkContext, TFrameworkInject>) => TFrameworkRouter;
|
|
62
61
|
type RouterIntegratorFn<TRouter> = <TRoutes extends Record<any, ControllerContractController<any, any, any, any, any, any, TRouter>>>(routes: TRoutes) => TRouter;
|
|
63
|
-
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
62
|
+
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
64
63
|
type OutputFn<TFrameworkContext, TPath extends string, TOutput> = (context: Prettify<TFrameworkContext & {
|
|
65
64
|
params: ParamsFrom<TPath>;
|
|
66
65
|
outputs: typeof outputs;
|
|
@@ -69,7 +68,7 @@ type SanitizedOutputFn<TFrameworkContext, TPath extends string, TInput, TOutput>
|
|
|
69
68
|
input: TInput;
|
|
70
69
|
}, TPath, TOutput>;
|
|
71
70
|
type InferControllerContract<T> = T extends ControllerContractController<infer M, infer P, any, infer Q, infer B, infer O, any> ? ControllerContract<M, P, ParamsFrom<P>, Q, B, O> : never;
|
|
72
|
-
type MapToControllerContract<TRoutes> = { [TRouteName in Extract<keyof TRoutes, string> as Capitalize<TRouteName>]: InferControllerContract<TRoutes[TRouteName]
|
|
71
|
+
type MapToControllerContract<TRoutes> = { [TRouteName in Extract<keyof TRoutes, string> as Capitalize<TRouteName>]: InferControllerContract<TRoutes[TRouteName]>; };
|
|
73
72
|
//#endregion
|
|
74
73
|
//#region src/classes/controller-contract-controller-builder/builder-steps/post-input-step.d.ts
|
|
75
74
|
declare class PostInputStep<TFrameworkContext, TFrameworkInject, TRouter, const TMethod extends Method, const TPath extends string, const TChannel extends InputChannel, TInput, TOutputFromInput extends Output> {
|
|
@@ -80,7 +79,7 @@ declare class PostInputStep<TFrameworkContext, TFrameworkInject, TRouter, const
|
|
|
80
79
|
private readonly channel;
|
|
81
80
|
private readonly schema;
|
|
82
81
|
constructor(injectable: TFrameworkInject, integrator: BuilderIntegratorFn<TFrameworkContext, TFrameworkInject, TRouter>, method: TMethod, path: TPath, channel: TChannel, schema: StandardSchemaV1<TInput>);
|
|
83
|
-
output<TOutput extends Output>(outputFn: SanitizedOutputFn<TFrameworkContext, TPath, TInput, TOutput>): ControllerContractController<TMethod, TPath, ParamsFrom<TPath>, TChannel extends
|
|
82
|
+
output<TOutput extends Output>(outputFn: SanitizedOutputFn<TFrameworkContext, TPath, TInput, TOutput>): ControllerContractController<TMethod, TPath, ParamsFrom<TPath>, TChannel extends 'query' ? TInput : NoInput, TChannel extends 'body' ? TInput : NoInput, TOutputFromInput | TOutput, TRouter>;
|
|
84
83
|
}
|
|
85
84
|
//#endregion
|
|
86
85
|
//#region src/classes/controller-contract-controller-builder/builder-steps/post-endpoint-step.d.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@controller-contract/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"author": "kennychulo",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"tsdown": "0.22.0",
|
|
23
|
-
"typescript": "6.0.3"
|
|
21
|
+
"@controller-contract/core": "0.3.2"
|
|
24
22
|
},
|
|
25
23
|
"dependencies": {
|
|
26
|
-
"@controller-contract/core": "0.2.12",
|
|
27
24
|
"@standard-schema/spec": "1.1.0"
|
|
28
25
|
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@controller-contract/core": "0.3.2"
|
|
28
|
+
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsdown",
|
|
31
31
|
"release": "pnpm publish"
|