ts-procedures 9.0.0 → 9.1.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/CHANGELOG.md +540 -0
- package/build/codegen/emit/route-shared.d.ts +4 -2
- package/build/codegen/emit/route-shared.js +13 -13
- package/build/codegen/emit/route-shared.js.map +1 -1
- package/build/codegen/emit-scope.test.js +67 -0
- package/build/codegen/emit-scope.test.js.map +1 -1
- package/build/core/create-http.d.ts +1 -1
- package/build/core/create-http.js +2 -2
- package/build/core/create-http.js.map +1 -1
- package/build/core/create-http.test.js +14 -0
- package/build/core/create-http.test.js.map +1 -1
- package/build/core/procedures.d.ts +1 -1
- package/build/core/types.d.ts +2 -1
- package/docs/client-and-codegen.md +6 -0
- package/docs/migration-v8-to-v9.md +8 -0
- package/package.json +3 -2
- package/src/codegen/emit/route-shared.ts +13 -11
- package/src/codegen/emit-scope.test.ts +73 -0
- package/src/core/create-http.test.ts +16 -0
- package/src/core/create-http.ts +3 -3
- package/src/core/types.ts +2 -1
package/src/core/create-http.ts
CHANGED
|
@@ -40,7 +40,7 @@ export function makeCreateHttp<TContext>(runtime: FactoryRuntime<TContext, any>)
|
|
|
40
40
|
*/
|
|
41
41
|
return function CreateHttp<
|
|
42
42
|
TName extends string,
|
|
43
|
-
TReq extends Record<string, unknown> | undefined,
|
|
43
|
+
TReq extends Record<string, unknown> | undefined = undefined,
|
|
44
44
|
TRes extends { body?: unknown; headers?: unknown } | undefined = undefined,
|
|
45
45
|
TErrorKey extends string = string,
|
|
46
46
|
>(
|
|
@@ -63,8 +63,8 @@ export function makeCreateHttp<TContext>(runtime: FactoryRuntime<TContext, any>)
|
|
|
63
63
|
const { jsonSchema, validations } = computeSchema(
|
|
64
64
|
name,
|
|
65
65
|
{
|
|
66
|
-
req: config.schema
|
|
67
|
-
res: config.schema
|
|
66
|
+
req: config.schema?.req as Record<string, unknown> | undefined,
|
|
67
|
+
res: config.schema?.res as { body?: unknown; headers?: unknown } | undefined,
|
|
68
68
|
},
|
|
69
69
|
{ adapters: runtime.adapters, compile: runtime.compile, definitionInfo },
|
|
70
70
|
)
|
package/src/core/types.ts
CHANGED
|
@@ -76,7 +76,8 @@ export type TCreateHttpConfig<TReq, TRes, TErrorKey extends string = string> = {
|
|
|
76
76
|
scope?: string
|
|
77
77
|
errors?: TErrorKey[]
|
|
78
78
|
description?: string
|
|
79
|
-
|
|
79
|
+
/** Optional — a no-input, no-output route (e.g. a 204 logout) may omit it. */
|
|
80
|
+
schema?: {
|
|
80
81
|
req?: TReq
|
|
81
82
|
res?: TRes
|
|
82
83
|
}
|