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.
@@ -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.req as Record<string, unknown> | undefined,
67
- res: config.schema.res as { body?: unknown; headers?: unknown } | undefined,
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
- schema: {
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
  }