@palbase/backend 36.0.1 → 37.0.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.
@@ -7015,19 +7015,21 @@ function registerOperation(registry, op) {
7015
7015
  } : {}
7016
7016
  };
7017
7017
  const resolvedThrows = resolveThrows(op.throws);
7018
- const responses = {
7019
- 200: {
7020
- description: "Success",
7021
- content: {
7022
- "application/json": {
7023
- // A streaming operation's response is ONE FRAME, and its schema is the
7024
- // declared frame — not the handler's return type, which is void. Without
7025
- // this the document describes an untyped response and every generated
7026
- // client is opaque (measured live: the contract gate refuses the deploy).
7027
- schema: op.sseConfig !== void 0 ? op.sseConfig.frame : op.returnSchema !== void 0 ? op.returnSchema : import_zod2.z.unknown()
7028
- }
7018
+ const returnKind = op.returnSchema?._def?.typeName;
7019
+ const noContent = op.sseConfig === void 0 && (returnKind === "ZodVoid" || returnKind === "ZodUndefined");
7020
+ const successResponse = noContent ? {
7021
+ description: "No Content"
7022
+ } : {
7023
+ description: "Success",
7024
+ content: {
7025
+ "application/json": {
7026
+ // SSE's schema describes one frame, not the void handler return.
7027
+ schema: op.sseConfig?.frame ?? op.returnSchema ?? import_zod2.z.unknown()
7029
7028
  }
7030
- },
7029
+ }
7030
+ };
7031
+ const responses = {
7032
+ [noContent ? 204 : 200]: successResponse,
7031
7033
  400: errorResponse("Validation error"),
7032
7034
  401: errorResponse("Unauthorized"),
7033
7035
  403: errorResponse("Forbidden"),