@lovrozagar/honey 0.1.0 → 0.2.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.
Files changed (263) hide show
  1. package/README.md +1596 -6
  2. package/dist/accepts.d.ts +6 -0
  3. package/dist/accepts.d.ts.map +1 -0
  4. package/dist/body-limit.d.ts +22 -0
  5. package/dist/body-limit.d.ts.map +1 -0
  6. package/dist/build/index.d.ts +42 -0
  7. package/dist/build/index.d.ts.map +1 -0
  8. package/dist/cli.d.ts +3 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/client/error.d.ts +14 -0
  11. package/dist/client/error.d.ts.map +1 -0
  12. package/dist/client/http.d.ts +88 -0
  13. package/dist/client/http.d.ts.map +1 -0
  14. package/dist/client/index.d.ts +22 -0
  15. package/dist/client/index.d.ts.map +1 -0
  16. package/dist/client/sdk.d.ts +34 -0
  17. package/dist/client/sdk.d.ts.map +1 -0
  18. package/dist/client/sse.d.ts +10 -0
  19. package/dist/client/sse.d.ts.map +1 -0
  20. package/dist/client/types.d.ts +124 -0
  21. package/dist/client/types.d.ts.map +1 -0
  22. package/dist/client/ws.d.ts +15 -0
  23. package/dist/client/ws.d.ts.map +1 -0
  24. package/dist/client-mcp/server.d.ts +10 -0
  25. package/dist/client-mcp/server.d.ts.map +1 -0
  26. package/dist/client-mcp/types.d.ts +16 -0
  27. package/dist/client-mcp/types.d.ts.map +1 -0
  28. package/dist/cloudflare/realtime.d.ts +30 -0
  29. package/dist/cloudflare/realtime.d.ts.map +1 -0
  30. package/dist/codegen-go-cli.d.ts +22 -0
  31. package/dist/codegen-go-cli.d.ts.map +1 -0
  32. package/dist/codegen-go.d.ts +29 -0
  33. package/dist/codegen-go.d.ts.map +1 -0
  34. package/dist/codegen-hash.d.ts +3 -0
  35. package/dist/codegen-hash.d.ts.map +1 -0
  36. package/dist/codegen-ir.d.ts +123 -0
  37. package/dist/codegen-ir.d.ts.map +1 -0
  38. package/dist/codegen-loaders.d.ts +12 -0
  39. package/dist/codegen-loaders.d.ts.map +1 -0
  40. package/dist/codegen-mcp.d.ts +13 -0
  41. package/dist/codegen-mcp.d.ts.map +1 -0
  42. package/dist/codegen-python.d.ts +21 -0
  43. package/dist/codegen-python.d.ts.map +1 -0
  44. package/dist/codegen-rust.d.ts +18 -0
  45. package/dist/codegen-rust.d.ts.map +1 -0
  46. package/dist/codegen-sanitize.d.ts +3 -0
  47. package/dist/codegen-sanitize.d.ts.map +1 -0
  48. package/dist/codegen-schema-naming.d.ts +22 -0
  49. package/dist/codegen-schema-naming.d.ts.map +1 -0
  50. package/dist/codegen.d.ts +178 -0
  51. package/dist/codegen.d.ts.map +1 -0
  52. package/dist/context.d.ts +56 -0
  53. package/dist/context.d.ts.map +1 -0
  54. package/dist/cookie-sign.d.ts +3 -0
  55. package/dist/cookie-sign.d.ts.map +1 -0
  56. package/dist/cookie.d.ts +12 -0
  57. package/dist/cookie.d.ts.map +1 -0
  58. package/dist/cors.d.ts +13 -0
  59. package/dist/cors.d.ts.map +1 -0
  60. package/dist/crypto.d.ts +2 -0
  61. package/dist/crypto.d.ts.map +1 -0
  62. package/dist/csrf.d.ts +9 -0
  63. package/dist/csrf.d.ts.map +1 -0
  64. package/dist/curl-logger.d.ts +33 -0
  65. package/dist/curl-logger.d.ts.map +1 -0
  66. package/dist/detect-runtime.d.ts +16 -0
  67. package/dist/detect-runtime.d.ts.map +1 -0
  68. package/dist/error.d.ts +21 -0
  69. package/dist/error.d.ts.map +1 -0
  70. package/dist/errors.d.ts +40 -0
  71. package/dist/errors.d.ts.map +1 -0
  72. package/dist/etag.d.ts +9 -0
  73. package/dist/etag.d.ts.map +1 -0
  74. package/dist/feature-load.d.ts +3 -0
  75. package/dist/feature-load.d.ts.map +1 -0
  76. package/dist/go-type-emitter.d.ts +33 -0
  77. package/dist/go-type-emitter.d.ts.map +1 -0
  78. package/dist/honey-response.d.ts +82 -0
  79. package/dist/honey-response.d.ts.map +1 -0
  80. package/dist/i18n-slot.d.ts +7 -0
  81. package/dist/i18n-slot.d.ts.map +1 -0
  82. package/dist/i18n.d.ts +26 -0
  83. package/dist/i18n.d.ts.map +1 -0
  84. package/dist/index.d.ts +470 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/init.d.ts +7 -0
  87. package/dist/init.d.ts.map +1 -0
  88. package/dist/input.d.ts +6 -0
  89. package/dist/input.d.ts.map +1 -0
  90. package/dist/ip-restrict.d.ts +12 -0
  91. package/dist/ip-restrict.d.ts.map +1 -0
  92. package/dist/logger.d.ts +45 -0
  93. package/dist/logger.d.ts.map +1 -0
  94. package/dist/meta-spec.d.ts +81 -0
  95. package/dist/meta-spec.d.ts.map +1 -0
  96. package/dist/middleware.d.ts +60 -0
  97. package/dist/middleware.d.ts.map +1 -0
  98. package/dist/node-request.d.ts +59 -0
  99. package/dist/node-request.d.ts.map +1 -0
  100. package/dist/node.d.ts +13 -0
  101. package/dist/node.d.ts.map +1 -0
  102. package/dist/openapi/register.d.ts +3 -0
  103. package/dist/openapi/register.d.ts.map +1 -0
  104. package/dist/openapi/scalar.d.ts +12 -0
  105. package/dist/openapi/scalar.d.ts.map +1 -0
  106. package/dist/openapi/spec-factory.d.ts +31 -0
  107. package/dist/openapi/spec-factory.d.ts.map +1 -0
  108. package/dist/openapi/spec.d.ts +19 -0
  109. package/dist/openapi/spec.d.ts.map +1 -0
  110. package/dist/openapi/swagger.d.ts +12 -0
  111. package/dist/openapi/swagger.d.ts.map +1 -0
  112. package/dist/plugin.d.ts +167 -0
  113. package/dist/plugin.d.ts.map +1 -0
  114. package/dist/powered-by.d.ts +7 -0
  115. package/dist/powered-by.d.ts.map +1 -0
  116. package/dist/pretty-json.d.ts +10 -0
  117. package/dist/pretty-json.d.ts.map +1 -0
  118. package/dist/proxy.d.ts +51 -0
  119. package/dist/proxy.d.ts.map +1 -0
  120. package/dist/python-type-emitter.d.ts +11 -0
  121. package/dist/python-type-emitter.d.ts.map +1 -0
  122. package/dist/realtime/buffer.d.ts +18 -0
  123. package/dist/realtime/buffer.d.ts.map +1 -0
  124. package/dist/realtime/bus.d.ts +11 -0
  125. package/dist/realtime/bus.d.ts.map +1 -0
  126. package/dist/realtime/longpoll.d.ts +23 -0
  127. package/dist/realtime/longpoll.d.ts.map +1 -0
  128. package/dist/realtime/protocol.d.ts +50 -0
  129. package/dist/realtime/protocol.d.ts.map +1 -0
  130. package/dist/realtime/route.d.ts +42 -0
  131. package/dist/realtime/route.d.ts.map +1 -0
  132. package/dist/realtime/runtime.d.ts +74 -0
  133. package/dist/realtime/runtime.d.ts.map +1 -0
  134. package/dist/request-id.d.ts +12 -0
  135. package/dist/request-id.d.ts.map +1 -0
  136. package/dist/request-to-curl.d.ts +9 -0
  137. package/dist/request-to-curl.d.ts.map +1 -0
  138. package/dist/response.d.ts +57 -0
  139. package/dist/response.d.ts.map +1 -0
  140. package/dist/rust-type-emitter.d.ts +32 -0
  141. package/dist/rust-type-emitter.d.ts.map +1 -0
  142. package/dist/secure-headers.d.ts +16 -0
  143. package/dist/secure-headers.d.ts.map +1 -0
  144. package/dist/serve-register.d.ts +2 -0
  145. package/dist/serve-register.d.ts.map +1 -0
  146. package/dist/serve-slot.d.ts +6 -0
  147. package/dist/serve-slot.d.ts.map +1 -0
  148. package/dist/serve.d.ts +21 -0
  149. package/dist/serve.d.ts.map +1 -0
  150. package/dist/server-timing.d.ts +9 -0
  151. package/dist/server-timing.d.ts.map +1 -0
  152. package/dist/static.d.ts +12 -0
  153. package/dist/static.d.ts.map +1 -0
  154. package/dist/telemetry/otel.d.ts +59 -0
  155. package/dist/telemetry/otel.d.ts.map +1 -0
  156. package/dist/testing.d.ts +24 -0
  157. package/dist/testing.d.ts.map +1 -0
  158. package/dist/timeout.d.ts +7 -0
  159. package/dist/timeout.d.ts.map +1 -0
  160. package/dist/tree.d.ts +90 -0
  161. package/dist/tree.d.ts.map +1 -0
  162. package/dist/ts-type-emitter.d.ts +4 -0
  163. package/dist/ts-type-emitter.d.ts.map +1 -0
  164. package/dist/type-emitter.d.ts +8 -0
  165. package/dist/type-emitter.d.ts.map +1 -0
  166. package/dist/type-extractor.d.ts +39 -0
  167. package/dist/type-extractor.d.ts.map +1 -0
  168. package/dist/types.d.ts +451 -0
  169. package/dist/types.d.ts.map +1 -0
  170. package/dist/validation.d.ts +18 -0
  171. package/dist/validation.d.ts.map +1 -0
  172. package/dist/ws/bun.d.ts +28 -0
  173. package/dist/ws/bun.d.ts.map +1 -0
  174. package/dist/ws/cloudflare.d.ts +55 -0
  175. package/dist/ws/cloudflare.d.ts.map +1 -0
  176. package/dist/ws/deno.d.ts +13 -0
  177. package/dist/ws/deno.d.ts.map +1 -0
  178. package/dist/ws/node.d.ts +10 -0
  179. package/dist/ws/node.d.ts.map +1 -0
  180. package/dist/yaml.d.ts +4 -0
  181. package/dist/yaml.d.ts.map +1 -0
  182. package/docs/api-ref/go.md +82 -82
  183. package/docs/api-ref/python.md +82 -82
  184. package/docs/api-ref/rust.md +82 -82
  185. package/docs/api-ref/typescript.md +82 -82
  186. package/docs/invalidate-spec.md +13 -13
  187. package/docs/meta-spec.md +513 -0
  188. package/docs/packaging.md +85 -0
  189. package/docs/sdk.md +87 -73
  190. package/package.json +195 -51
  191. package/src/body-limit.ts +2 -1
  192. package/src/build/index.ts +2 -9
  193. package/src/cli.ts +2 -3
  194. package/src/client/http.ts +204 -223
  195. package/src/client/index.ts +6 -14
  196. package/src/client/sdk.ts +24 -17
  197. package/src/client/types.ts +4 -9
  198. package/src/client/ws.ts +3 -5
  199. package/src/client-mcp/server.ts +1 -4
  200. package/src/cloudflare/realtime.ts +8 -10
  201. package/src/codegen-go-cli.ts +74 -67
  202. package/src/codegen-go.ts +71 -51
  203. package/src/codegen-ir.ts +16 -27
  204. package/src/codegen-loaders.ts +5 -8
  205. package/src/codegen-mcp.ts +9 -27
  206. package/src/codegen-python.ts +47 -27
  207. package/src/codegen-rust.ts +110 -66
  208. package/src/codegen-sanitize.ts +1 -7
  209. package/src/codegen-schema-naming.ts +8 -2
  210. package/src/codegen.ts +299 -196
  211. package/src/context.ts +91 -95
  212. package/src/cookie-sign.ts +5 -13
  213. package/src/cookie.ts +1 -2
  214. package/src/cors.ts +4 -6
  215. package/src/crypto.ts +1 -4
  216. package/src/csrf.ts +3 -3
  217. package/src/curl-logger.ts +14 -32
  218. package/src/detect-runtime.ts +1 -3
  219. package/src/errors.ts +1 -3
  220. package/src/etag.ts +3 -4
  221. package/src/go-type-emitter.ts +45 -40
  222. package/src/honey-response.ts +1 -3
  223. package/src/i18n.ts +3 -12
  224. package/src/index.ts +1168 -1412
  225. package/src/ip-restrict.ts +2 -1
  226. package/src/logger.ts +13 -13
  227. package/src/meta-spec.ts +0 -0
  228. package/src/middleware.ts +111 -79
  229. package/src/node-request.ts +2 -1
  230. package/src/node.ts +9 -10
  231. package/src/openapi/register.ts +1 -2
  232. package/src/openapi/scalar.ts +9 -9
  233. package/src/openapi/spec-factory.ts +2 -2
  234. package/src/openapi/spec.ts +26 -19
  235. package/src/openapi/swagger.ts +9 -9
  236. package/src/plugin.ts +226 -256
  237. package/src/powered-by.ts +2 -1
  238. package/src/pretty-json.ts +2 -1
  239. package/src/proxy.ts +1 -3
  240. package/src/python-type-emitter.ts +37 -12
  241. package/src/realtime/route.ts +1 -1
  242. package/src/realtime/runtime.ts +9 -12
  243. package/src/request-id.ts +3 -4
  244. package/src/request-to-curl.ts +1 -4
  245. package/src/response.ts +150 -199
  246. package/src/rust-type-emitter.ts +66 -25
  247. package/src/secure-headers.ts +2 -1
  248. package/src/serve.ts +3 -12
  249. package/src/server-timing.ts +2 -1
  250. package/src/static.ts +3 -4
  251. package/src/telemetry/otel.ts +1 -6
  252. package/src/testing.ts +2 -11
  253. package/src/timeout.ts +2 -1
  254. package/src/tree.ts +12 -27
  255. package/src/ts-type-emitter.ts +71 -15
  256. package/src/type-emitter.ts +226 -237
  257. package/src/type-extractor.ts +260 -334
  258. package/src/types.ts +168 -68
  259. package/src/validation.ts +7 -30
  260. package/src/ws/bun.ts +2 -9
  261. package/src/ws/cloudflare.ts +13 -16
  262. package/src/ws/deno.ts +31 -40
  263. package/src/ws/node.ts +4 -19
@@ -7,20 +7,20 @@ run `bun run public/honey/core/scripts/gen-api-ref.ts` to regenerate.
7
7
 
8
8
  Every operation's error channel surfaces one of:
9
9
 
10
- | Canonical | Status | Lang symbol | Notes |
11
- | --------- | ------ | ----------- | ----- |
12
- | `BadRequest` | 400 | `BadRequest` | invalid request payload |
13
- | `Unauthorized` | 401 | `Unauthorized` | missing/invalid auth; triggers onAuthExpired + 1 retry |
14
- | `Forbidden` | 403 | `Forbidden` | authenticated but not permitted |
15
- | `NotFound` | 404 | `NotFound` | resource does not exist |
16
- | `Conflict` | 409 | `Conflict` | state conflict / unique violation |
17
- | `UnprocessableEntity` | 422 | `UnprocessableEntity` | schema-valid but semantically rejected |
18
- | `TooManyRequests` | 429 | `TooManyRequests` | rate-limited; consumer handles backoff via hooks |
19
- | `InternalServerError` | 500 | `InternalServerError` | server crash |
20
- | `BadGateway` | 502 | `BadGateway` | upstream failure |
21
- | `ServiceUnavailable` | 503 | `ServiceUnavailable` | server temporarily unavailable |
22
- | `GatewayTimeout` | 504 | `GatewayTimeout` | upstream timeout |
23
- | `StatusError` | * | `StatusError` | fallback for undeclared/other statuses |
10
+ | Canonical | Status | Lang symbol | Notes |
11
+ | --------------------- | ------ | --------------------- | ------------------------------------------------------ |
12
+ | `BadRequest` | 400 | `BadRequest` | invalid request payload |
13
+ | `Unauthorized` | 401 | `Unauthorized` | missing/invalid auth; triggers onAuthExpired + 1 retry |
14
+ | `Forbidden` | 403 | `Forbidden` | authenticated but not permitted |
15
+ | `NotFound` | 404 | `NotFound` | resource does not exist |
16
+ | `Conflict` | 409 | `Conflict` | state conflict / unique violation |
17
+ | `UnprocessableEntity` | 422 | `UnprocessableEntity` | schema-valid but semantically rejected |
18
+ | `TooManyRequests` | 429 | `TooManyRequests` | rate-limited; consumer handles backoff via hooks |
19
+ | `InternalServerError` | 500 | `InternalServerError` | server crash |
20
+ | `BadGateway` | 502 | `BadGateway` | upstream failure |
21
+ | `ServiceUnavailable` | 503 | `ServiceUnavailable` | server temporarily unavailable |
22
+ | `GatewayTimeout` | 504 | `GatewayTimeout` | upstream timeout |
23
+ | `StatusError` | * | `StatusError` | fallback for undeclared/other statuses |
24
24
 
25
25
  Operations with declared `responses: { 4xx: { schema } }` parse the response body into the error's typed `data` field.
26
26
 
@@ -44,10 +44,10 @@ async def refresh_token(self, body: { refresh_token: str }) -> { access_token: s
44
44
 
45
45
  **Responses**
46
46
 
47
- | Status | Content-type | Type |
48
- | ------ | ------------ | ---- |
49
- | `200` | `application/json` | `{ access_token: str, expires_in: int }` |
50
- | `401` | `application/json` | `{ status: int, message: str }` |
47
+ | Status | Content-type | Type |
48
+ | ------ | ------------------ | ---------------------------------------- |
49
+ | `200` | `application/json` | `{ access_token: str, expires_in: int }` |
50
+ | `401` | `application/json` | `{ status: int, message: str }` |
51
51
 
52
52
  ---
53
53
 
@@ -63,16 +63,16 @@ async def get_declared_error(self, status: str) -> None
63
63
 
64
64
  **Path params**
65
65
 
66
- | Name | Type |
67
- | ---- | ---- |
66
+ | Name | Type |
67
+ | -------- | ----- |
68
68
  | `status` | `str` |
69
69
 
70
70
  **Responses**
71
71
 
72
- | Status | Content-type | Type |
73
- | ------ | ------------ | ---- |
74
- | `400` | `application/json` | `{ status: int, message: str }` |
75
- | `404` | `application/json` | `{ status: int, message: str }` |
72
+ | Status | Content-type | Type |
73
+ | --------- | ------------------ | ------------------------------- |
74
+ | `400` | `application/json` | `{ status: int, message: str }` |
75
+ | `404` | `application/json` | `{ status: int, message: str }` |
76
76
  | `default` | `application/json` | `{ status: int, message: str }` |
77
77
 
78
78
  ---
@@ -89,14 +89,14 @@ async def get_error(self, status: int) -> None
89
89
 
90
90
  **Path params**
91
91
 
92
- | Name | Type |
93
- | ---- | ---- |
92
+ | Name | Type |
93
+ | -------- | ----- |
94
94
  | `status` | `int` |
95
95
 
96
96
  **Responses**
97
97
 
98
- | Status | Content-type | Type |
99
- | ------ | ------------ | ---- |
98
+ | Status | Content-type | Type |
99
+ | --------- | ------------------ | ------------------------------- |
100
100
  | `default` | `application/json` | `{ status: int, message: str }` |
101
101
 
102
102
  ---
@@ -113,9 +113,9 @@ async def idempotent_create(self) -> { idempotencyKey: str }
113
113
 
114
114
  **Responses**
115
115
 
116
- | Status | Content-type | Type |
117
- | ------ | ------------ | ---- |
118
- | `200` | `application/json` | `{ idempotencyKey: str }` |
116
+ | Status | Content-type | Type |
117
+ | ------ | ------------------ | ------------------------- |
118
+ | `200` | `application/json` | `{ idempotencyKey: str }` |
119
119
 
120
120
  **Extensions**
121
121
 
@@ -135,15 +135,15 @@ async def connect_realtime(self, reconnect_token: str) -> ResumableConnection
135
135
 
136
136
  **Query params**
137
137
 
138
- | Name | Type |
139
- | ---- | ---- |
138
+ | Name | Type |
139
+ | ----------------- | ----- |
140
140
  | `reconnect_token` | `str` |
141
141
 
142
142
  **Responses**
143
143
 
144
144
  | Status | Content-type | Type |
145
145
  | ------ | ------------ | ---- |
146
- | `101` | `—` | — |
146
+ | `101` | `—` | — |
147
147
 
148
148
  **Extensions**
149
149
 
@@ -163,15 +163,15 @@ async def slow(self, ms: int) -> { ok: bool }
163
163
 
164
164
  **Query params**
165
165
 
166
- | Name | Type |
167
- | ---- | ---- |
166
+ | Name | Type |
167
+ | ---- | ----- |
168
168
  | `ms` | `int` |
169
169
 
170
170
  **Responses**
171
171
 
172
- | Status | Content-type | Type |
173
- | ------ | ------------ | ---- |
174
- | `200` | `application/json` | `{ ok: bool }` |
172
+ | Status | Content-type | Type |
173
+ | ------ | ------------------ | -------------- |
174
+ | `200` | `application/json` | `{ ok: bool }` |
175
175
 
176
176
  ---
177
177
 
@@ -187,16 +187,16 @@ async def stream_events(self, last_event_id: str) -> AsyncIterator[{ event: Opti
187
187
 
188
188
  **Header params**
189
189
 
190
- | Name | Type |
191
- | ---- | ---- |
190
+ | Name | Type |
191
+ | --------------- | ----- |
192
192
  | `Last-Event-ID` | `str` |
193
193
 
194
194
  **Responses**
195
195
 
196
- | Status | Content-type | Type |
197
- | ------ | ------------ | ---- |
198
- | `200` | `text/event-stream` | `{ event: Optional[str], data: Optional[str], id: Optional[str] }` |
199
- | `401` | `application/json` | `{ status: int, message: str }` |
196
+ | Status | Content-type | Type |
197
+ | ------ | ------------------- | ------------------------------------------------------------------ |
198
+ | `200` | `text/event-stream` | `{ event: Optional[str], data: Optional[str], id: Optional[str] }` |
199
+ | `401` | `application/json` | `{ status: int, message: str }` |
200
200
 
201
201
  **Extensions**
202
202
 
@@ -222,10 +222,10 @@ async def upload_blob(self, body: AsyncIterator[bytes]) -> { size: int, hash: st
222
222
 
223
223
  **Responses**
224
224
 
225
- | Status | Content-type | Type |
226
- | ------ | ------------ | ---- |
227
- | `200` | `application/json` | `{ size: int, hash: str }` |
228
- | `401` | `application/json` | `{ status: int, message: str }` |
225
+ | Status | Content-type | Type |
226
+ | ------ | ------------------ | ------------------------------- |
227
+ | `200` | `application/json` | `{ size: int, hash: str }` |
228
+ | `401` | `application/json` | `{ status: int, message: str }` |
229
229
 
230
230
  ---
231
231
 
@@ -241,10 +241,10 @@ async def list_users(self) -> { items: List[{ id: str, name: str, email: str }],
241
241
 
242
242
  **Responses**
243
243
 
244
- | Status | Content-type | Type |
245
- | ------ | ------------ | ---- |
246
- | `200` | `application/json` | `{ items: List[{ id: str, name: str, email: str }], total: int }` |
247
- | `401` | `application/json` | `{ status: int, message: str }` |
244
+ | Status | Content-type | Type |
245
+ | ------ | ------------------ | ----------------------------------------------------------------- |
246
+ | `200` | `application/json` | `{ items: List[{ id: str, name: str, email: str }], total: int }` |
247
+ | `401` | `application/json` | `{ status: int, message: str }` |
248
248
 
249
249
  ---
250
250
 
@@ -266,11 +266,11 @@ async def create_user(self, body: { name: str, email: str }) -> { id: str, name:
266
266
 
267
267
  **Responses**
268
268
 
269
- | Status | Content-type | Type |
270
- | ------ | ------------ | ---- |
271
- | `201` | `application/json` | `{ id: str, name: str, email: str }` |
272
- | `401` | `application/json` | `{ status: int, message: str }` |
273
- | `422` | `application/json` | `{ status: int, message: str }` |
269
+ | Status | Content-type | Type |
270
+ | ------ | ------------------ | ------------------------------------ |
271
+ | `201` | `application/json` | `{ id: str, name: str, email: str }` |
272
+ | `401` | `application/json` | `{ status: int, message: str }` |
273
+ | `422` | `application/json` | `{ status: int, message: str }` |
274
274
 
275
275
  **Extensions**
276
276
 
@@ -290,17 +290,17 @@ async def delete_user(self, id: str) -> None
290
290
 
291
291
  **Path params**
292
292
 
293
- | Name | Type |
294
- | ---- | ---- |
293
+ | Name | Type |
294
+ | ---- | ----- |
295
295
  | `id` | `str` |
296
296
 
297
297
  **Responses**
298
298
 
299
- | Status | Content-type | Type |
300
- | ------ | ------------ | ---- |
301
- | `204` | `—` | — |
302
- | `401` | `application/json` | `{ status: int, message: str }` |
303
- | `404` | `application/json` | `{ status: int, message: str }` |
299
+ | Status | Content-type | Type |
300
+ | ------ | ------------------ | ------------------------------- |
301
+ | `204` | `—` | — |
302
+ | `401` | `application/json` | `{ status: int, message: str }` |
303
+ | `404` | `application/json` | `{ status: int, message: str }` |
304
304
 
305
305
  **Extensions**
306
306
 
@@ -320,17 +320,17 @@ async def get_user(self, id: str) -> { id: str, name: str, email: str }
320
320
 
321
321
  **Path params**
322
322
 
323
- | Name | Type |
324
- | ---- | ---- |
323
+ | Name | Type |
324
+ | ---- | ----- |
325
325
  | `id` | `str` |
326
326
 
327
327
  **Responses**
328
328
 
329
- | Status | Content-type | Type |
330
- | ------ | ------------ | ---- |
331
- | `200` | `application/json` | `{ id: str, name: str, email: str }` |
332
- | `401` | `application/json` | `{ status: int, message: str }` |
333
- | `404` | `application/json` | `{ status: int, message: str }` |
329
+ | Status | Content-type | Type |
330
+ | ------ | ------------------ | ------------------------------------ |
331
+ | `200` | `application/json` | `{ id: str, name: str, email: str }` |
332
+ | `401` | `application/json` | `{ status: int, message: str }` |
333
+ | `404` | `application/json` | `{ status: int, message: str }` |
334
334
 
335
335
  ---
336
336
 
@@ -346,8 +346,8 @@ async def update_user(self, id: str, body: { name: Optional[str], email: Optiona
346
346
 
347
347
  **Path params**
348
348
 
349
- | Name | Type |
350
- | ---- | ---- |
349
+ | Name | Type |
350
+ | ---- | ----- |
351
351
  | `id` | `str` |
352
352
 
353
353
  **Request body**
@@ -358,11 +358,11 @@ async def update_user(self, id: str, body: { name: Optional[str], email: Optiona
358
358
 
359
359
  **Responses**
360
360
 
361
- | Status | Content-type | Type |
362
- | ------ | ------------ | ---- |
363
- | `200` | `application/json` | `{ id: str, name: str, email: str }` |
364
- | `401` | `application/json` | `{ status: int, message: str }` |
365
- | `404` | `application/json` | `{ status: int, message: str }` |
361
+ | Status | Content-type | Type |
362
+ | ------ | ------------------ | ------------------------------------ |
363
+ | `200` | `application/json` | `{ id: str, name: str, email: str }` |
364
+ | `401` | `application/json` | `{ status: int, message: str }` |
365
+ | `404` | `application/json` | `{ status: int, message: str }` |
366
366
 
367
367
  **Extensions**
368
368
 
@@ -382,15 +382,15 @@ async def connect_ws(self, token: str) -> ResumableConnection
382
382
 
383
383
  **Query params**
384
384
 
385
- | Name | Type |
386
- | ---- | ---- |
385
+ | Name | Type |
386
+ | ------- | ----- |
387
387
  | `token` | `str` |
388
388
 
389
389
  **Responses**
390
390
 
391
391
  | Status | Content-type | Type |
392
392
  | ------ | ------------ | ---- |
393
- | `101` | `—` | — |
393
+ | `101` | `—` | — |
394
394
 
395
395
  **Extensions**
396
396
 
@@ -7,20 +7,20 @@ run `bun run public/honey/core/scripts/gen-api-ref.ts` to regenerate.
7
7
 
8
8
  Every operation's error channel surfaces one of:
9
9
 
10
- | Canonical | Status | Lang symbol | Notes |
11
- | --------- | ------ | ----------- | ----- |
12
- | `BadRequest` | 400 | `Error::BadRequest` | invalid request payload |
13
- | `Unauthorized` | 401 | `Error::Unauthorized` | missing/invalid auth; triggers onAuthExpired + 1 retry |
14
- | `Forbidden` | 403 | `Error::Forbidden` | authenticated but not permitted |
15
- | `NotFound` | 404 | `Error::NotFound` | resource does not exist |
16
- | `Conflict` | 409 | `Error::Conflict` | state conflict / unique violation |
17
- | `UnprocessableEntity` | 422 | `Error::UnprocessableEntity` | schema-valid but semantically rejected |
18
- | `TooManyRequests` | 429 | `Error::TooManyRequests` | rate-limited; consumer handles backoff via hooks |
19
- | `InternalServerError` | 500 | `Error::InternalServerError` | server crash |
20
- | `BadGateway` | 502 | `Error::BadGateway` | upstream failure |
21
- | `ServiceUnavailable` | 503 | `Error::ServiceUnavailable` | server temporarily unavailable |
22
- | `GatewayTimeout` | 504 | `Error::GatewayTimeout` | upstream timeout |
23
- | `StatusError` | * | `Error::StatusError` | fallback for undeclared/other statuses |
10
+ | Canonical | Status | Lang symbol | Notes |
11
+ | --------------------- | ------ | ---------------------------- | ------------------------------------------------------ |
12
+ | `BadRequest` | 400 | `Error::BadRequest` | invalid request payload |
13
+ | `Unauthorized` | 401 | `Error::Unauthorized` | missing/invalid auth; triggers onAuthExpired + 1 retry |
14
+ | `Forbidden` | 403 | `Error::Forbidden` | authenticated but not permitted |
15
+ | `NotFound` | 404 | `Error::NotFound` | resource does not exist |
16
+ | `Conflict` | 409 | `Error::Conflict` | state conflict / unique violation |
17
+ | `UnprocessableEntity` | 422 | `Error::UnprocessableEntity` | schema-valid but semantically rejected |
18
+ | `TooManyRequests` | 429 | `Error::TooManyRequests` | rate-limited; consumer handles backoff via hooks |
19
+ | `InternalServerError` | 500 | `Error::InternalServerError` | server crash |
20
+ | `BadGateway` | 502 | `Error::BadGateway` | upstream failure |
21
+ | `ServiceUnavailable` | 503 | `Error::ServiceUnavailable` | server temporarily unavailable |
22
+ | `GatewayTimeout` | 504 | `Error::GatewayTimeout` | upstream timeout |
23
+ | `StatusError` | * | `Error::StatusError` | fallback for undeclared/other statuses |
24
24
 
25
25
  Operations with declared `responses: { 4xx: { schema } }` parse the response body into the error's typed `data` field.
26
26
 
@@ -44,10 +44,10 @@ pub async fn refresh_token(&self, body: struct { refresh_token: String }) -> Res
44
44
 
45
45
  **Responses**
46
46
 
47
- | Status | Content-type | Type |
48
- | ------ | ------------ | ---- |
49
- | `200` | `application/json` | `struct { access_token: String, expires_in: i64 }` |
50
- | `401` | `application/json` | `struct { status: i64, message: String }` |
47
+ | Status | Content-type | Type |
48
+ | ------ | ------------------ | -------------------------------------------------- |
49
+ | `200` | `application/json` | `struct { access_token: String, expires_in: i64 }` |
50
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
51
51
 
52
52
  ---
53
53
 
@@ -63,16 +63,16 @@ pub async fn get_declared_error(&self, status: String) -> Result<(), Error>
63
63
 
64
64
  **Path params**
65
65
 
66
- | Name | Type |
67
- | ---- | ---- |
66
+ | Name | Type |
67
+ | -------- | -------- |
68
68
  | `status` | `String` |
69
69
 
70
70
  **Responses**
71
71
 
72
- | Status | Content-type | Type |
73
- | ------ | ------------ | ---- |
74
- | `400` | `application/json` | `struct { status: i64, message: String }` |
75
- | `404` | `application/json` | `struct { status: i64, message: String }` |
72
+ | Status | Content-type | Type |
73
+ | --------- | ------------------ | ----------------------------------------- |
74
+ | `400` | `application/json` | `struct { status: i64, message: String }` |
75
+ | `404` | `application/json` | `struct { status: i64, message: String }` |
76
76
  | `default` | `application/json` | `struct { status: i64, message: String }` |
77
77
 
78
78
  ---
@@ -89,14 +89,14 @@ pub async fn get_error(&self, status: i64) -> Result<(), Error>
89
89
 
90
90
  **Path params**
91
91
 
92
- | Name | Type |
93
- | ---- | ---- |
92
+ | Name | Type |
93
+ | -------- | ----- |
94
94
  | `status` | `i64` |
95
95
 
96
96
  **Responses**
97
97
 
98
- | Status | Content-type | Type |
99
- | ------ | ------------ | ---- |
98
+ | Status | Content-type | Type |
99
+ | --------- | ------------------ | ----------------------------------------- |
100
100
  | `default` | `application/json` | `struct { status: i64, message: String }` |
101
101
 
102
102
  ---
@@ -113,9 +113,9 @@ pub async fn idempotent_create(&self) -> Result<struct { idempotency_key: String
113
113
 
114
114
  **Responses**
115
115
 
116
- | Status | Content-type | Type |
117
- | ------ | ------------ | ---- |
118
- | `200` | `application/json` | `struct { idempotency_key: String }` |
116
+ | Status | Content-type | Type |
117
+ | ------ | ------------------ | ------------------------------------ |
118
+ | `200` | `application/json` | `struct { idempotency_key: String }` |
119
119
 
120
120
  **Extensions**
121
121
 
@@ -135,15 +135,15 @@ pub async fn connect_realtime(&self, reconnect_token: String) -> Result<Resumabl
135
135
 
136
136
  **Query params**
137
137
 
138
- | Name | Type |
139
- | ---- | ---- |
138
+ | Name | Type |
139
+ | ----------------- | -------- |
140
140
  | `reconnect_token` | `String` |
141
141
 
142
142
  **Responses**
143
143
 
144
144
  | Status | Content-type | Type |
145
145
  | ------ | ------------ | ---- |
146
- | `101` | `—` | — |
146
+ | `101` | `—` | — |
147
147
 
148
148
  **Extensions**
149
149
 
@@ -163,15 +163,15 @@ pub async fn slow(&self, ms: i64) -> Result<struct { ok: bool }, Error>
163
163
 
164
164
  **Query params**
165
165
 
166
- | Name | Type |
167
- | ---- | ---- |
166
+ | Name | Type |
167
+ | ---- | ----- |
168
168
  | `ms` | `i64` |
169
169
 
170
170
  **Responses**
171
171
 
172
- | Status | Content-type | Type |
173
- | ------ | ------------ | ---- |
174
- | `200` | `application/json` | `struct { ok: bool }` |
172
+ | Status | Content-type | Type |
173
+ | ------ | ------------------ | --------------------- |
174
+ | `200` | `application/json` | `struct { ok: bool }` |
175
175
 
176
176
  ---
177
177
 
@@ -187,16 +187,16 @@ pub async fn stream_events(&self, last_event_id: String) -> Result<impl Stream<I
187
187
 
188
188
  **Header params**
189
189
 
190
- | Name | Type |
191
- | ---- | ---- |
190
+ | Name | Type |
191
+ | --------------- | -------- |
192
192
  | `Last-Event-ID` | `String` |
193
193
 
194
194
  **Responses**
195
195
 
196
- | Status | Content-type | Type |
197
- | ------ | ------------ | ---- |
198
- | `200` | `text/event-stream` | `struct { event: Option<String>, data: Option<String>, id: Option<String> }` |
199
- | `401` | `application/json` | `struct { status: i64, message: String }` |
196
+ | Status | Content-type | Type |
197
+ | ------ | ------------------- | ---------------------------------------------------------------------------- |
198
+ | `200` | `text/event-stream` | `struct { event: Option<String>, data: Option<String>, id: Option<String> }` |
199
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
200
200
 
201
201
  **Extensions**
202
202
 
@@ -222,10 +222,10 @@ pub async fn upload_blob(&self, body: impl Stream<Item = Bytes>) -> Result<struc
222
222
 
223
223
  **Responses**
224
224
 
225
- | Status | Content-type | Type |
226
- | ------ | ------------ | ---- |
227
- | `200` | `application/json` | `struct { size: i64, hash: String }` |
228
- | `401` | `application/json` | `struct { status: i64, message: String }` |
225
+ | Status | Content-type | Type |
226
+ | ------ | ------------------ | ----------------------------------------- |
227
+ | `200` | `application/json` | `struct { size: i64, hash: String }` |
228
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
229
229
 
230
230
  ---
231
231
 
@@ -241,10 +241,10 @@ pub async fn list_users(&self) -> Result<struct { items: Vec<struct { id: String
241
241
 
242
242
  **Responses**
243
243
 
244
- | Status | Content-type | Type |
245
- | ------ | ------------ | ---- |
246
- | `200` | `application/json` | `struct { items: Vec<struct { id: String, name: String, email: String }>, total: i64 }` |
247
- | `401` | `application/json` | `struct { status: i64, message: String }` |
244
+ | Status | Content-type | Type |
245
+ | ------ | ------------------ | --------------------------------------------------------------------------------------- |
246
+ | `200` | `application/json` | `struct { items: Vec<struct { id: String, name: String, email: String }>, total: i64 }` |
247
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
248
248
 
249
249
  ---
250
250
 
@@ -266,11 +266,11 @@ pub async fn create_user(&self, body: struct { name: String, email: String }) ->
266
266
 
267
267
  **Responses**
268
268
 
269
- | Status | Content-type | Type |
270
- | ------ | ------------ | ---- |
271
- | `201` | `application/json` | `struct { id: String, name: String, email: String }` |
272
- | `401` | `application/json` | `struct { status: i64, message: String }` |
273
- | `422` | `application/json` | `struct { status: i64, message: String }` |
269
+ | Status | Content-type | Type |
270
+ | ------ | ------------------ | ---------------------------------------------------- |
271
+ | `201` | `application/json` | `struct { id: String, name: String, email: String }` |
272
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
273
+ | `422` | `application/json` | `struct { status: i64, message: String }` |
274
274
 
275
275
  **Extensions**
276
276
 
@@ -290,17 +290,17 @@ pub async fn delete_user(&self, id: String) -> Result<(), Error>
290
290
 
291
291
  **Path params**
292
292
 
293
- | Name | Type |
294
- | ---- | ---- |
293
+ | Name | Type |
294
+ | ---- | -------- |
295
295
  | `id` | `String` |
296
296
 
297
297
  **Responses**
298
298
 
299
- | Status | Content-type | Type |
300
- | ------ | ------------ | ---- |
301
- | `204` | `—` | — |
302
- | `401` | `application/json` | `struct { status: i64, message: String }` |
303
- | `404` | `application/json` | `struct { status: i64, message: String }` |
299
+ | Status | Content-type | Type |
300
+ | ------ | ------------------ | ----------------------------------------- |
301
+ | `204` | `—` | — |
302
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
303
+ | `404` | `application/json` | `struct { status: i64, message: String }` |
304
304
 
305
305
  **Extensions**
306
306
 
@@ -320,17 +320,17 @@ pub async fn get_user(&self, id: String) -> Result<struct { id: String, name: St
320
320
 
321
321
  **Path params**
322
322
 
323
- | Name | Type |
324
- | ---- | ---- |
323
+ | Name | Type |
324
+ | ---- | -------- |
325
325
  | `id` | `String` |
326
326
 
327
327
  **Responses**
328
328
 
329
- | Status | Content-type | Type |
330
- | ------ | ------------ | ---- |
331
- | `200` | `application/json` | `struct { id: String, name: String, email: String }` |
332
- | `401` | `application/json` | `struct { status: i64, message: String }` |
333
- | `404` | `application/json` | `struct { status: i64, message: String }` |
329
+ | Status | Content-type | Type |
330
+ | ------ | ------------------ | ---------------------------------------------------- |
331
+ | `200` | `application/json` | `struct { id: String, name: String, email: String }` |
332
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
333
+ | `404` | `application/json` | `struct { status: i64, message: String }` |
334
334
 
335
335
  ---
336
336
 
@@ -346,8 +346,8 @@ pub async fn update_user(&self, id: String, body: struct { name: Option<String>,
346
346
 
347
347
  **Path params**
348
348
 
349
- | Name | Type |
350
- | ---- | ---- |
349
+ | Name | Type |
350
+ | ---- | -------- |
351
351
  | `id` | `String` |
352
352
 
353
353
  **Request body**
@@ -358,11 +358,11 @@ pub async fn update_user(&self, id: String, body: struct { name: Option<String>,
358
358
 
359
359
  **Responses**
360
360
 
361
- | Status | Content-type | Type |
362
- | ------ | ------------ | ---- |
363
- | `200` | `application/json` | `struct { id: String, name: String, email: String }` |
364
- | `401` | `application/json` | `struct { status: i64, message: String }` |
365
- | `404` | `application/json` | `struct { status: i64, message: String }` |
361
+ | Status | Content-type | Type |
362
+ | ------ | ------------------ | ---------------------------------------------------- |
363
+ | `200` | `application/json` | `struct { id: String, name: String, email: String }` |
364
+ | `401` | `application/json` | `struct { status: i64, message: String }` |
365
+ | `404` | `application/json` | `struct { status: i64, message: String }` |
366
366
 
367
367
  **Extensions**
368
368
 
@@ -382,15 +382,15 @@ pub async fn connect_ws(&self, token: String) -> Result<ResumableConnection, Err
382
382
 
383
383
  **Query params**
384
384
 
385
- | Name | Type |
386
- | ---- | ---- |
385
+ | Name | Type |
386
+ | ------- | -------- |
387
387
  | `token` | `String` |
388
388
 
389
389
  **Responses**
390
390
 
391
391
  | Status | Content-type | Type |
392
392
  | ------ | ------------ | ---- |
393
- | `101` | `—` | — |
393
+ | `101` | `—` | — |
394
394
 
395
395
  **Extensions**
396
396