@rebasepro/server-core 0.0.1-canary.4d4fb3e

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 (254) hide show
  1. package/LICENSE +6 -0
  2. package/README.md +40 -0
  3. package/build-errors.txt +52 -0
  4. package/coverage/clover.xml +3739 -0
  5. package/coverage/coverage-final.json +31 -0
  6. package/coverage/lcov-report/base.css +224 -0
  7. package/coverage/lcov-report/block-navigation.js +87 -0
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +266 -0
  10. package/coverage/lcov-report/prettify.css +1 -0
  11. package/coverage/lcov-report/prettify.js +2 -0
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +210 -0
  14. package/coverage/lcov-report/src/api/ast-schema-editor.ts.html +952 -0
  15. package/coverage/lcov-report/src/api/errors.ts.html +472 -0
  16. package/coverage/lcov-report/src/api/graphql/graphql-schema-generator.ts.html +1069 -0
  17. package/coverage/lcov-report/src/api/graphql/index.html +116 -0
  18. package/coverage/lcov-report/src/api/index.html +176 -0
  19. package/coverage/lcov-report/src/api/openapi-generator.ts.html +565 -0
  20. package/coverage/lcov-report/src/api/rest/api-generator.ts.html +994 -0
  21. package/coverage/lcov-report/src/api/rest/index.html +131 -0
  22. package/coverage/lcov-report/src/api/rest/query-parser.ts.html +550 -0
  23. package/coverage/lcov-report/src/api/schema-editor-routes.ts.html +202 -0
  24. package/coverage/lcov-report/src/api/server.ts.html +823 -0
  25. package/coverage/lcov-report/src/auth/admin-routes.ts.html +973 -0
  26. package/coverage/lcov-report/src/auth/index.html +176 -0
  27. package/coverage/lcov-report/src/auth/jwt.ts.html +574 -0
  28. package/coverage/lcov-report/src/auth/middleware.ts.html +745 -0
  29. package/coverage/lcov-report/src/auth/password.ts.html +310 -0
  30. package/coverage/lcov-report/src/auth/services.ts.html +2074 -0
  31. package/coverage/lcov-report/src/collections/index.html +116 -0
  32. package/coverage/lcov-report/src/collections/loader.ts.html +232 -0
  33. package/coverage/lcov-report/src/db/auth-schema.ts.html +523 -0
  34. package/coverage/lcov-report/src/db/data-transformer.ts.html +1753 -0
  35. package/coverage/lcov-report/src/db/entityService.ts.html +700 -0
  36. package/coverage/lcov-report/src/db/index.html +146 -0
  37. package/coverage/lcov-report/src/db/services/EntityFetchService.ts.html +4048 -0
  38. package/coverage/lcov-report/src/db/services/EntityPersistService.ts.html +883 -0
  39. package/coverage/lcov-report/src/db/services/RelationService.ts.html +3121 -0
  40. package/coverage/lcov-report/src/db/services/entity-helpers.ts.html +442 -0
  41. package/coverage/lcov-report/src/db/services/index.html +176 -0
  42. package/coverage/lcov-report/src/db/services/index.ts.html +124 -0
  43. package/coverage/lcov-report/src/generate-drizzle-schema-logic.ts.html +1960 -0
  44. package/coverage/lcov-report/src/index.html +116 -0
  45. package/coverage/lcov-report/src/services/driver-registry.ts.html +631 -0
  46. package/coverage/lcov-report/src/services/index.html +131 -0
  47. package/coverage/lcov-report/src/services/postgresDataDriver.ts.html +3025 -0
  48. package/coverage/lcov-report/src/storage/LocalStorageController.ts.html +1189 -0
  49. package/coverage/lcov-report/src/storage/S3StorageController.ts.html +970 -0
  50. package/coverage/lcov-report/src/storage/index.html +161 -0
  51. package/coverage/lcov-report/src/storage/storage-registry.ts.html +646 -0
  52. package/coverage/lcov-report/src/storage/types.ts.html +451 -0
  53. package/coverage/lcov-report/src/utils/drizzle-conditions.ts.html +3082 -0
  54. package/coverage/lcov-report/src/utils/index.html +116 -0
  55. package/coverage/lcov.info +7179 -0
  56. package/dist/common/src/collections/CollectionRegistry.d.ts +48 -0
  57. package/dist/common/src/collections/index.d.ts +1 -0
  58. package/dist/common/src/data/buildRebaseData.d.ts +14 -0
  59. package/dist/common/src/index.d.ts +3 -0
  60. package/dist/common/src/util/builders.d.ts +57 -0
  61. package/dist/common/src/util/callbacks.d.ts +6 -0
  62. package/dist/common/src/util/collections.d.ts +11 -0
  63. package/dist/common/src/util/common.d.ts +2 -0
  64. package/dist/common/src/util/conditions.d.ts +26 -0
  65. package/dist/common/src/util/entities.d.ts +36 -0
  66. package/dist/common/src/util/enums.d.ts +3 -0
  67. package/dist/common/src/util/index.d.ts +16 -0
  68. package/dist/common/src/util/navigation_from_path.d.ts +34 -0
  69. package/dist/common/src/util/navigation_utils.d.ts +20 -0
  70. package/dist/common/src/util/parent_references_from_path.d.ts +6 -0
  71. package/dist/common/src/util/paths.d.ts +14 -0
  72. package/dist/common/src/util/permissions.d.ts +5 -0
  73. package/dist/common/src/util/references.d.ts +2 -0
  74. package/dist/common/src/util/relations.d.ts +12 -0
  75. package/dist/common/src/util/resolutions.d.ts +72 -0
  76. package/dist/common/src/util/storage.d.ts +24 -0
  77. package/dist/index-BeMqpmfQ.js +239 -0
  78. package/dist/index-BeMqpmfQ.js.map +1 -0
  79. package/dist/index-bl4J3lNb.js +55823 -0
  80. package/dist/index-bl4J3lNb.js.map +1 -0
  81. package/dist/index.es.js +58 -0
  82. package/dist/index.es.js.map +1 -0
  83. package/dist/index.umd.js +56062 -0
  84. package/dist/index.umd.js.map +1 -0
  85. package/dist/server-core/src/api/ast-schema-editor.d.ts +21 -0
  86. package/dist/server-core/src/api/collections_for_test/callbacks_test_collection.d.ts +2 -0
  87. package/dist/server-core/src/api/errors.d.ts +35 -0
  88. package/dist/server-core/src/api/graphql/graphql-schema-generator.d.ts +35 -0
  89. package/dist/server-core/src/api/graphql/index.d.ts +1 -0
  90. package/dist/server-core/src/api/index.d.ts +9 -0
  91. package/dist/server-core/src/api/openapi-generator.d.ts +2 -0
  92. package/dist/server-core/src/api/rest/api-generator.d.ts +64 -0
  93. package/dist/server-core/src/api/rest/index.d.ts +1 -0
  94. package/dist/server-core/src/api/rest/query-parser.d.ts +9 -0
  95. package/dist/server-core/src/api/schema-editor-routes.d.ts +3 -0
  96. package/dist/server-core/src/api/server.d.ts +40 -0
  97. package/dist/server-core/src/api/types.d.ts +90 -0
  98. package/dist/server-core/src/auth/admin-routes.d.ts +7 -0
  99. package/dist/server-core/src/auth/google-oauth.d.ts +20 -0
  100. package/dist/server-core/src/auth/index.d.ts +12 -0
  101. package/dist/server-core/src/auth/interfaces.d.ts +270 -0
  102. package/dist/server-core/src/auth/jwt.d.ts +42 -0
  103. package/dist/server-core/src/auth/middleware.d.ts +56 -0
  104. package/dist/server-core/src/auth/password.d.ts +22 -0
  105. package/dist/server-core/src/auth/rate-limiter.d.ts +31 -0
  106. package/dist/server-core/src/auth/routes.d.ts +17 -0
  107. package/dist/server-core/src/bootstrappers/index.d.ts +0 -0
  108. package/dist/server-core/src/collections/BackendCollectionRegistry.d.ts +13 -0
  109. package/dist/server-core/src/collections/loader.d.ts +5 -0
  110. package/dist/server-core/src/db/interfaces.d.ts +18 -0
  111. package/dist/server-core/src/email/index.d.ts +6 -0
  112. package/dist/server-core/src/email/smtp-email-service.d.ts +25 -0
  113. package/dist/server-core/src/email/templates.d.ts +33 -0
  114. package/dist/server-core/src/email/types.d.ts +110 -0
  115. package/dist/server-core/src/functions/function-loader.d.ts +17 -0
  116. package/dist/server-core/src/functions/function-routes.d.ts +10 -0
  117. package/dist/server-core/src/functions/index.d.ts +3 -0
  118. package/dist/server-core/src/history/history-routes.d.ts +23 -0
  119. package/dist/server-core/src/history/index.d.ts +1 -0
  120. package/dist/server-core/src/index.d.ts +24 -0
  121. package/dist/server-core/src/init.d.ts +49 -0
  122. package/dist/server-core/src/serve-spa.d.ts +30 -0
  123. package/dist/server-core/src/services/driver-registry.d.ts +78 -0
  124. package/dist/server-core/src/storage/LocalStorageController.d.ts +46 -0
  125. package/dist/server-core/src/storage/S3StorageController.d.ts +36 -0
  126. package/dist/server-core/src/storage/index.d.ts +18 -0
  127. package/dist/server-core/src/storage/routes.d.ts +38 -0
  128. package/dist/server-core/src/storage/storage-registry.d.ts +78 -0
  129. package/dist/server-core/src/storage/types.d.ts +91 -0
  130. package/dist/server-core/src/types/index.d.ts +11 -0
  131. package/dist/server-core/src/utils/logging.d.ts +9 -0
  132. package/dist/server-core/src/utils/sql.d.ts +27 -0
  133. package/dist/types/src/controllers/analytics_controller.d.ts +7 -0
  134. package/dist/types/src/controllers/auth.d.ts +117 -0
  135. package/dist/types/src/controllers/client.d.ts +58 -0
  136. package/dist/types/src/controllers/collection_registry.d.ts +44 -0
  137. package/dist/types/src/controllers/customization_controller.d.ts +54 -0
  138. package/dist/types/src/controllers/data.d.ts +141 -0
  139. package/dist/types/src/controllers/data_driver.d.ts +168 -0
  140. package/dist/types/src/controllers/database_admin.d.ts +11 -0
  141. package/dist/types/src/controllers/dialogs_controller.d.ts +36 -0
  142. package/dist/types/src/controllers/effective_role.d.ts +4 -0
  143. package/dist/types/src/controllers/index.d.ts +17 -0
  144. package/dist/types/src/controllers/local_config_persistence.d.ts +20 -0
  145. package/dist/types/src/controllers/navigation.d.ts +213 -0
  146. package/dist/types/src/controllers/registry.d.ts +51 -0
  147. package/dist/types/src/controllers/side_dialogs_controller.d.ts +67 -0
  148. package/dist/types/src/controllers/side_entity_controller.d.ts +89 -0
  149. package/dist/types/src/controllers/snackbar.d.ts +24 -0
  150. package/dist/types/src/controllers/storage.d.ts +173 -0
  151. package/dist/types/src/index.d.ts +4 -0
  152. package/dist/types/src/rebase_context.d.ts +101 -0
  153. package/dist/types/src/types/backend.d.ts +533 -0
  154. package/dist/types/src/types/builders.d.ts +14 -0
  155. package/dist/types/src/types/chips.d.ts +5 -0
  156. package/dist/types/src/types/collections.d.ts +812 -0
  157. package/dist/types/src/types/data_source.d.ts +64 -0
  158. package/dist/types/src/types/entities.d.ts +145 -0
  159. package/dist/types/src/types/entity_actions.d.ts +98 -0
  160. package/dist/types/src/types/entity_callbacks.d.ts +173 -0
  161. package/dist/types/src/types/entity_link_builder.d.ts +7 -0
  162. package/dist/types/src/types/entity_overrides.d.ts +9 -0
  163. package/dist/types/src/types/entity_views.d.ts +61 -0
  164. package/dist/types/src/types/export_import.d.ts +21 -0
  165. package/dist/types/src/types/index.d.ts +22 -0
  166. package/dist/types/src/types/locales.d.ts +4 -0
  167. package/dist/types/src/types/modify_collections.d.ts +5 -0
  168. package/dist/types/src/types/plugins.d.ts +225 -0
  169. package/dist/types/src/types/properties.d.ts +1091 -0
  170. package/dist/types/src/types/property_config.d.ts +70 -0
  171. package/dist/types/src/types/relations.d.ts +336 -0
  172. package/dist/types/src/types/slots.d.ts +228 -0
  173. package/dist/types/src/types/translations.d.ts +826 -0
  174. package/dist/types/src/types/user_management_delegate.d.ts +120 -0
  175. package/dist/types/src/types/websockets.d.ts +78 -0
  176. package/dist/types/src/users/index.d.ts +2 -0
  177. package/dist/types/src/users/roles.d.ts +22 -0
  178. package/dist/types/src/users/user.d.ts +46 -0
  179. package/history_diff.log +385 -0
  180. package/jest.config.cjs +16 -0
  181. package/package.json +86 -0
  182. package/scratch.ts +8 -0
  183. package/src/api/ast-schema-editor.ts +289 -0
  184. package/src/api/collections_for_test/callbacks_test_collection.ts +57 -0
  185. package/src/api/errors.ts +155 -0
  186. package/src/api/graphql/graphql-schema-generator.ts +334 -0
  187. package/src/api/graphql/index.ts +2 -0
  188. package/src/api/index.ts +11 -0
  189. package/src/api/openapi-generator.ts +160 -0
  190. package/src/api/rest/api-generator.ts +466 -0
  191. package/src/api/rest/index.ts +2 -0
  192. package/src/api/rest/query-parser.ts +155 -0
  193. package/src/api/schema-editor-routes.ts +39 -0
  194. package/src/api/server.ts +245 -0
  195. package/src/api/types.ts +90 -0
  196. package/src/auth/admin-routes.ts +488 -0
  197. package/src/auth/google-oauth.ts +60 -0
  198. package/src/auth/index.ts +21 -0
  199. package/src/auth/interfaces.ts +316 -0
  200. package/src/auth/jwt.ts +164 -0
  201. package/src/auth/middleware.ts +235 -0
  202. package/src/auth/password.ts +75 -0
  203. package/src/auth/rate-limiter.ts +129 -0
  204. package/src/auth/routes.ts +730 -0
  205. package/src/bootstrappers/index.ts +1 -0
  206. package/src/collections/BackendCollectionRegistry.ts +20 -0
  207. package/src/collections/loader.ts +49 -0
  208. package/src/db/interfaces.ts +60 -0
  209. package/src/email/index.ts +17 -0
  210. package/src/email/smtp-email-service.ts +88 -0
  211. package/src/email/templates.ts +301 -0
  212. package/src/email/types.ts +112 -0
  213. package/src/functions/function-loader.ts +91 -0
  214. package/src/functions/function-routes.ts +31 -0
  215. package/src/functions/index.ts +3 -0
  216. package/src/history/history-routes.ts +128 -0
  217. package/src/history/index.ts +2 -0
  218. package/src/index.ts +56 -0
  219. package/src/init.ts +309 -0
  220. package/src/serve-spa.ts +81 -0
  221. package/src/services/driver-registry.ts +182 -0
  222. package/src/storage/LocalStorageController.ts +368 -0
  223. package/src/storage/S3StorageController.ts +295 -0
  224. package/src/storage/index.ts +32 -0
  225. package/src/storage/routes.ts +247 -0
  226. package/src/storage/storage-registry.ts +187 -0
  227. package/src/storage/types.ts +122 -0
  228. package/src/types/index.ts +27 -0
  229. package/src/utils/logging.ts +35 -0
  230. package/src/utils/sql.ts +38 -0
  231. package/test/admin-routes.test.ts +591 -0
  232. package/test/api-generator.test.ts +458 -0
  233. package/test/ast-schema-editor.test.ts +61 -0
  234. package/test/auth-middleware-hono.test.ts +321 -0
  235. package/test/auth-routes.test.ts +868 -0
  236. package/test/driver-registry.test.ts +280 -0
  237. package/test/errors-hono.test.ts +133 -0
  238. package/test/errors.test.ts +150 -0
  239. package/test/jwt-security.test.ts +173 -0
  240. package/test/jwt.test.ts +311 -0
  241. package/test/middleware.test.ts +295 -0
  242. package/test/password.test.ts +165 -0
  243. package/test/query-parser.test.ts +258 -0
  244. package/test/rate-limiter.test.ts +102 -0
  245. package/test/storage-local.test.ts +278 -0
  246. package/test/storage-registry.test.ts +280 -0
  247. package/test/storage-routes.test.ts +218 -0
  248. package/test/storage-s3.test.ts +301 -0
  249. package/test-ast.ts +28 -0
  250. package/test_output.txt +1133 -0
  251. package/tsconfig.json +49 -0
  252. package/tsconfig.prod.json +20 -0
  253. package/vite.config.ts +78 -0
  254. package/vite.config.ts.timestamp-1775065397568-8a853255edf6e.mjs +46 -0
@@ -0,0 +1,1133 @@
1
+ PASS test/query-parser.test.ts
2
+ PASS test/storage-registry.test.ts
3
+ ● Console
4
+
5
+ console.warn
6
+ [StorageRegistry] Storage "anything" not found, falling back to "(default)"
7
+
8
+ 149 |
9
+ 150 | // Fallback to default with warning
10
+ > 151 | console.warn(
11
+ | ^
12
+ 152 | `[StorageRegistry] Storage "${id}" not found, falling back to "${DEFAULT_STORAGE_ID}"`
13
+ 153 | );
14
+ 154 | return this.getDefault();
15
+
16
+ at DefaultStorageRegistry.getOrDefault (src/storage/storage-registry.ts:151:17)
17
+ at test/storage-registry.test.ts:133:44
18
+ at Object.<anonymous> (../../node_modules/expect/build/toThrowMatchers.js:74:11)
19
+ at Object.throwingMatcher [as toThrow] (../../node_modules/expect/build/index.js:320:21)
20
+ at Object.<anonymous> (test/storage-registry.test.ts:133:70)
21
+
22
+ PASS test/jwt-security.test.ts
23
+ PASS test/driver-registry.test.ts
24
+ ● Console
25
+
26
+ console.warn
27
+ [DriverRegistry] Driver "anything" not found, falling back to "(default)"
28
+
29
+ 145 |
30
+ 146 | // Fallback to default with warning
31
+ > 147 | console.warn(
32
+ | ^
33
+ 148 | `[DriverRegistry] Driver "${id}" not found, falling back to "${DEFAULT_DRIVER_ID}"`
34
+ 149 | );
35
+ 150 | return this.getDefault();
36
+
37
+ at DefaultDriverRegistry.getOrDefault (src/services/driver-registry.ts:147:17)
38
+ at test/driver-registry.test.ts:135:44
39
+ at Object.<anonymous> (../../node_modules/expect/build/toThrowMatchers.js:74:11)
40
+ at Object.throwingMatcher [as toThrow] (../../node_modules/expect/build/index.js:320:21)
41
+ at Object.<anonymous> (test/driver-registry.test.ts:135:70)
42
+
43
+ console.warn
44
+ [DriverRegistry] No "(default)" driver provided. Using "key" as the default.
45
+
46
+ 96 | // If no explicit "(default)", use the first one as default
47
+ 97 | const firstId = Object.keys(input)[0];
48
+ > 98 | console.warn(
49
+ | ^
50
+ 99 | `[DriverRegistry] No "${DEFAULT_DRIVER_ID}" driver provided. ` +
51
+ 100 | `Using "${firstId}" as the default.`
52
+ 101 | );
53
+
54
+ at Function.create (src/services/driver-registry.ts:98:25)
55
+ at Object.<anonymous> (test/driver-registry.test.ts:275:52)
56
+
57
+ PASS test/middleware.test.ts
58
+ PASS test/jwt.test.ts
59
+ PASS test/storage-s3.test.ts
60
+ PASS test/auth-middleware-hono.test.ts
61
+ ● Console
62
+
63
+ console.error
64
+ [AUTH] No token found! Auth header: undefined Query: undefined Path: /test
65
+
66
+ 202 | }
67
+ 203 | } else {
68
+ > 204 | console.error("[AUTH] No token found! Auth header:", authHeader, "Query:", queryToken, "Path:", c.req.path);
69
+ | ^
70
+ 205 | c.set("driver", driver);
71
+ 206 | }
72
+ 207 | } catch (error) {
73
+
74
+ at src/auth/middleware.ts:204:29
75
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:23)
76
+ at ../../node_modules/hono/dist/cjs/compose.js:26:12
77
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:31
78
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:332:7)
79
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
80
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
81
+ at Object.<anonymous> (test/auth-middleware-hono.test.ts:196:35)
82
+
83
+ console.error
84
+ [AUTH] No token found! Auth header: undefined Query: undefined Path: /test
85
+
86
+ 202 | }
87
+ 203 | } else {
88
+ > 204 | console.error("[AUTH] No token found! Auth header:", authHeader, "Query:", queryToken, "Path:", c.req.path);
89
+ | ^
90
+ 205 | c.set("driver", driver);
91
+ 206 | }
92
+ 207 | } catch (error) {
93
+
94
+ at src/auth/middleware.ts:204:29
95
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:23)
96
+ at ../../node_modules/hono/dist/cjs/compose.js:26:12
97
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:31
98
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:332:7)
99
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
100
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
101
+ at Object.<anonymous> (test/auth-middleware-hono.test.ts:207:35)
102
+
103
+ console.error
104
+ [AUTH] Rejecting with 401. Path: /test
105
+
106
+ 212 |
107
+ 213 | if (enforceAuth && !c.get("user")) {
108
+ > 214 | console.error("[AUTH] Rejecting with 401. Path:", c.req.path);
109
+ | ^
110
+ 215 | return c.json({ error: { message: "Unauthorized: Invalid or missing token", code: "UNAUTHORIZED" } }, 401);
111
+ 216 | }
112
+ 217 |
113
+
114
+ at src/auth/middleware.ts:214:21
115
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:23)
116
+ at ../../node_modules/hono/dist/cjs/compose.js:26:12
117
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:31
118
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:332:7)
119
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
120
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
121
+ at Object.<anonymous> (test/auth-middleware-hono.test.ts:207:35)
122
+
123
+ console.error
124
+ [AUTH] No token found! Auth header: undefined Query: undefined Path: /test
125
+
126
+ 202 | }
127
+ 203 | } else {
128
+ > 204 | console.error("[AUTH] No token found! Auth header:", authHeader, "Query:", queryToken, "Path:", c.req.path);
129
+ | ^
130
+ 205 | c.set("driver", driver);
131
+ 206 | }
132
+ 207 | } catch (error) {
133
+
134
+ at src/auth/middleware.ts:204:29
135
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:23)
136
+ at ../../node_modules/hono/dist/cjs/compose.js:26:12
137
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:31
138
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:332:7)
139
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
140
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
141
+ at Object.<anonymous> (test/auth-middleware-hono.test.ts:216:35)
142
+
143
+ PASS test/errors.test.ts
144
+ ● Console
145
+
146
+ console.warn
147
+ ⚠️ [API] GET /test → 404 NOT_FOUND: User not found
148
+
149
+ 73 | if (error instanceof ApiError) {
150
+ 74 | // Operational errors — log at warn level
151
+ > 75 | console.warn(
152
+ | ^
153
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
154
+ 77 | );
155
+ 78 | return c.json({
156
+
157
+ at errorHandler (src/api/errors.ts:75:17)
158
+ at Object.<anonymous> (test/errors.test.ts:99:21)
159
+
160
+ console.warn
161
+ ⚠️ [API] GET /test → 400 VALIDATION: Validation failed
162
+
163
+ 73 | if (error instanceof ApiError) {
164
+ 74 | // Operational errors — log at warn level
165
+ > 75 | console.warn(
166
+ | ^
167
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
168
+ 77 | );
169
+ 78 | return c.json({
170
+
171
+ at errorHandler (src/api/errors.ts:75:17)
172
+ at Object.<anonymous> (test/errors.test.ts:110:21)
173
+
174
+ console.error
175
+ ❌ [API] GET /test → 404 NOT_FOUND: Not found
176
+
177
+ 89 |
178
+ 90 | // Unexpected errors — log at error level with full stack
179
+ > 91 | console.error(
180
+ | ^
181
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
182
+ 93 | );
183
+ 94 | console.error(error.stack || error);
184
+
185
+ at errorHandler (src/api/errors.ts:91:13)
186
+ at Object.<anonymous> (test/errors.test.ts:124:21)
187
+
188
+ console.error
189
+ Error: Not found
190
+ at Object.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors.test.ts:123:35)
191
+ at Promise.then.completed (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:298:28)
192
+ at new Promise (<anonymous>)
193
+ at callAsyncCircusFn (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:231:10)
194
+ at _callCircusTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:316:40)
195
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
196
+ at _runTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:252:3)
197
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:126:9)
198
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:121:9)
199
+ at run (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:71:3)
200
+ at runAndTransformResultsToJestFormat (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
201
+ at jestAdapter (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
202
+ at runTestInternal (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:367:16)
203
+ at runTest (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:444:34)
204
+ at Object.worker (/Users/francesco/rebase/node_modules/jest-runner/build/testWorker.js:106:12)
205
+
206
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
207
+ 93 | );
208
+ > 94 | console.error(error.stack || error);
209
+ | ^
210
+ 95 |
211
+ 96 | return c.json({
212
+ 97 | error: {
213
+
214
+ at errorHandler (src/api/errors.ts:94:13)
215
+ at Object.<anonymous> (test/errors.test.ts:124:21)
216
+
217
+ console.error
218
+ ❌ [API] GET /test → 500 INTERNAL_ERROR: Something broke
219
+
220
+ 89 |
221
+ 90 | // Unexpected errors — log at error level with full stack
222
+ > 91 | console.error(
223
+ | ^
224
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
225
+ 93 | );
226
+ 94 | console.error(error.stack || error);
227
+
228
+ at errorHandler (src/api/errors.ts:91:13)
229
+ at Object.<anonymous> (test/errors.test.ts:135:21)
230
+
231
+ console.error
232
+ Error: Something broke
233
+ at Object.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors.test.ts:134:21)
234
+ at Promise.then.completed (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:298:28)
235
+ at new Promise (<anonymous>)
236
+ at callAsyncCircusFn (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:231:10)
237
+ at _callCircusTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:316:40)
238
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
239
+ at _runTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:252:3)
240
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:126:9)
241
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:121:9)
242
+ at run (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:71:3)
243
+ at runAndTransformResultsToJestFormat (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
244
+ at jestAdapter (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
245
+ at runTestInternal (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:367:16)
246
+ at runTest (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:444:34)
247
+ at Object.worker (/Users/francesco/rebase/node_modules/jest-runner/build/testWorker.js:106:12)
248
+
249
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
250
+ 93 | );
251
+ > 94 | console.error(error.stack || error);
252
+ | ^
253
+ 95 |
254
+ 96 | return c.json({
255
+ 97 | error: {
256
+
257
+ at errorHandler (src/api/errors.ts:94:13)
258
+ at Object.<anonymous> (test/errors.test.ts:135:21)
259
+
260
+ console.error
261
+ ❌ [API] GET /test → 429 RATE_LIMITED: Rate limited
262
+
263
+ 89 |
264
+ 90 | // Unexpected errors — log at error level with full stack
265
+ > 91 | console.error(
266
+ | ^
267
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
268
+ 93 | );
269
+ 94 | console.error(error.stack || error);
270
+
271
+ at errorHandler (src/api/errors.ts:91:13)
272
+ at Object.<anonymous> (test/errors.test.ts:146:21)
273
+
274
+ console.error
275
+ Error: Rate limited
276
+ at Object.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors.test.ts:145:35)
277
+ at Promise.then.completed (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:298:28)
278
+ at new Promise (<anonymous>)
279
+ at callAsyncCircusFn (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:231:10)
280
+ at _callCircusTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:316:40)
281
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
282
+ at _runTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:252:3)
283
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:126:9)
284
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:121:9)
285
+ at run (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:71:3)
286
+ at runAndTransformResultsToJestFormat (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
287
+ at jestAdapter (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
288
+ at runTestInternal (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:367:16)
289
+ at runTest (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:444:34)
290
+ at Object.worker (/Users/francesco/rebase/node_modules/jest-runner/build/testWorker.js:106:12)
291
+
292
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
293
+ 93 | );
294
+ > 94 | console.error(error.stack || error);
295
+ | ^
296
+ 95 |
297
+ 96 | return c.json({
298
+ 97 | error: {
299
+
300
+ at errorHandler (src/api/errors.ts:94:13)
301
+ at Object.<anonymous> (test/errors.test.ts:146:21)
302
+
303
+ PASS test/rate-limiter.test.ts
304
+ PASS test/errors-hono.test.ts
305
+ ● Console
306
+
307
+ console.warn
308
+ ⚠️ [API] GET /bad-request → 400 MISSING_FIELD: Missing required field
309
+
310
+ 73 | if (error instanceof ApiError) {
311
+ 74 | // Operational errors — log at warn level
312
+ > 75 | console.warn(
313
+ | ^
314
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
315
+ 77 | );
316
+ 78 | return c.json({
317
+
318
+ at Hono.errorHandler (src/api/errors.ts:75:17)
319
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
320
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
321
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
322
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
323
+ at Object.<anonymous> (test/errors-hono.test.ts:46:31)
324
+
325
+ console.warn
326
+ ⚠️ [API] GET /unauthorized → 401 TOKEN_EXPIRED: Token expired
327
+
328
+ 73 | if (error instanceof ApiError) {
329
+ 74 | // Operational errors — log at warn level
330
+ > 75 | console.warn(
331
+ | ^
332
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
333
+ 77 | );
334
+ 78 | return c.json({
335
+
336
+ at Hono.errorHandler (src/api/errors.ts:75:17)
337
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
338
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
339
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
340
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
341
+ at Object.<anonymous> (test/errors-hono.test.ts:56:31)
342
+
343
+ console.warn
344
+ ⚠️ [API] GET /forbidden → 403 FORBIDDEN: Admin only
345
+
346
+ 73 | if (error instanceof ApiError) {
347
+ 74 | // Operational errors — log at warn level
348
+ > 75 | console.warn(
349
+ | ^
350
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
351
+ 77 | );
352
+ 78 | return c.json({
353
+
354
+ at Hono.errorHandler (src/api/errors.ts:75:17)
355
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
356
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
357
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
358
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
359
+ at Object.<anonymous> (test/errors-hono.test.ts:64:31)
360
+
361
+ console.warn
362
+ ⚠️ [API] GET /not-found → 404 NOT_FOUND: Entity not found
363
+
364
+ 73 | if (error instanceof ApiError) {
365
+ 74 | // Operational errors — log at warn level
366
+ > 75 | console.warn(
367
+ | ^
368
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
369
+ 77 | );
370
+ 78 | return c.json({
371
+
372
+ at Hono.errorHandler (src/api/errors.ts:75:17)
373
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
374
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
375
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
376
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
377
+ at Object.<anonymous> (test/errors-hono.test.ts:72:31)
378
+
379
+ console.warn
380
+ ⚠️ [API] GET /conflict → 409 EMAIL_EXISTS: Email already exists
381
+
382
+ 73 | if (error instanceof ApiError) {
383
+ 74 | // Operational errors — log at warn level
384
+ > 75 | console.warn(
385
+ | ^
386
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
387
+ 77 | );
388
+ 78 | return c.json({
389
+
390
+ at Hono.errorHandler (src/api/errors.ts:75:17)
391
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
392
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
393
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
394
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
395
+ at Object.<anonymous> (test/errors-hono.test.ts:80:31)
396
+
397
+ console.warn
398
+ ⚠️ [API] GET /internal → 500 INTERNAL_ERROR: Database connection failed
399
+
400
+ 73 | if (error instanceof ApiError) {
401
+ 74 | // Operational errors — log at warn level
402
+ > 75 | console.warn(
403
+ | ^
404
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
405
+ 77 | );
406
+ 78 | return c.json({
407
+
408
+ at Hono.errorHandler (src/api/errors.ts:75:17)
409
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
410
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
411
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
412
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
413
+ at Object.<anonymous> (test/errors-hono.test.ts:88:31)
414
+
415
+ console.warn
416
+ ⚠️ [API] GET /service-unavailable → 503 SERVICE_UNAVAILABLE: Feature not configured
417
+
418
+ 73 | if (error instanceof ApiError) {
419
+ 74 | // Operational errors — log at warn level
420
+ > 75 | console.warn(
421
+ | ^
422
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
423
+ 77 | );
424
+ 78 | return c.json({
425
+
426
+ at Hono.errorHandler (src/api/errors.ts:75:17)
427
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
428
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
429
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
430
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
431
+ at Object.<anonymous> (test/errors-hono.test.ts:94:31)
432
+
433
+ console.error
434
+ ❌ [API] GET /generic-error → 500 INTERNAL_ERROR: Something went wrong
435
+
436
+ 89 |
437
+ 90 | // Unexpected errors — log at error level with full stack
438
+ > 91 | console.error(
439
+ | ^
440
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
441
+ 93 | );
442
+ 94 | console.error(error.stack || error);
443
+
444
+ at Hono.errorHandler (src/api/errors.ts:91:13)
445
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
446
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
447
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
448
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
449
+ at Object.<anonymous> (test/errors-hono.test.ts:100:31)
450
+
451
+ console.error
452
+ Error: Something went wrong
453
+ at Array.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors-hono.test.ts:33:19)
454
+ at Hono.#dispatch (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:309:38)
455
+ at Hono.fetch (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:346:26)
456
+ at Hono.request (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:365:17)
457
+ at Object.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors-hono.test.ts:100:31)
458
+ at Promise.then.completed (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:298:28)
459
+ at new Promise (<anonymous>)
460
+ at callAsyncCircusFn (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:231:10)
461
+ at _callCircusTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:316:40)
462
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
463
+ at _runTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:252:3)
464
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:126:9)
465
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:121:9)
466
+ at run (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:71:3)
467
+ at runAndTransformResultsToJestFormat (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
468
+ at jestAdapter (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
469
+ at runTestInternal (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:367:16)
470
+ at runTest (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:444:34)
471
+ at Object.worker (/Users/francesco/rebase/node_modules/jest-runner/build/testWorker.js:106:12)
472
+
473
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
474
+ 93 | );
475
+ > 94 | console.error(error.stack || error);
476
+ | ^
477
+ 95 |
478
+ 96 | return c.json({
479
+ 97 | error: {
480
+
481
+ at Hono.errorHandler (src/api/errors.ts:94:13)
482
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
483
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
484
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
485
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
486
+ at Object.<anonymous> (test/errors-hono.test.ts:100:31)
487
+
488
+ console.error
489
+ ❌ [API] GET /error-with-code → 500 RATE_LIMITED: Rate limited
490
+
491
+ 89 |
492
+ 90 | // Unexpected errors — log at error level with full stack
493
+ > 91 | console.error(
494
+ | ^
495
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
496
+ 93 | );
497
+ 94 | console.error(error.stack || error);
498
+
499
+ at Hono.errorHandler (src/api/errors.ts:91:13)
500
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
501
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
502
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
503
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
504
+ at Object.<anonymous> (test/errors-hono.test.ts:109:31)
505
+
506
+ console.error
507
+ Error: Rate limited
508
+ at Array.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors-hono.test.ts:36:25)
509
+ at Hono.#dispatch (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:309:38)
510
+ at Hono.fetch (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:346:26)
511
+ at Hono.request (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:365:17)
512
+ at Object.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors-hono.test.ts:109:31)
513
+ at Promise.then.completed (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:298:28)
514
+ at new Promise (<anonymous>)
515
+ at callAsyncCircusFn (/Users/francesco/rebase/node_modules/jest-circus/build/utils.js:231:10)
516
+ at _callCircusTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:316:40)
517
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
518
+ at _runTest (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:252:3)
519
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:126:9)
520
+ at _runTestsForDescribeBlock (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:121:9)
521
+ at run (/Users/francesco/rebase/node_modules/jest-circus/build/run.js:71:3)
522
+ at runAndTransformResultsToJestFormat (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
523
+ at jestAdapter (/Users/francesco/rebase/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
524
+ at runTestInternal (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:367:16)
525
+ at runTest (/Users/francesco/rebase/node_modules/jest-runner/build/runTest.js:444:34)
526
+ at Object.worker (/Users/francesco/rebase/node_modules/jest-runner/build/testWorker.js:106:12)
527
+
528
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
529
+ 93 | );
530
+ > 94 | console.error(error.stack || error);
531
+ | ^
532
+ 95 |
533
+ 96 | return c.json({
534
+ 97 | error: {
535
+
536
+ at Hono.errorHandler (src/api/errors.ts:94:13)
537
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
538
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
539
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
540
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
541
+ at Object.<anonymous> (test/errors-hono.test.ts:109:31)
542
+
543
+ console.warn
544
+ ⚠️ [API] GET /unauthorized → 401 TOKEN_EXPIRED: Token expired
545
+
546
+ 73 | if (error instanceof ApiError) {
547
+ 74 | // Operational errors — log at warn level
548
+ > 75 | console.warn(
549
+ | ^
550
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
551
+ 77 | );
552
+ 78 | return c.json({
553
+
554
+ at Hono.errorHandler (src/api/errors.ts:75:17)
555
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
556
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
557
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
558
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
559
+ at Object.<anonymous> (test/errors-hono.test.ts:116:31)
560
+
561
+ console.warn
562
+ ⚠️ [API] GET /bad-request → 400 MISSING_FIELD: Missing required field
563
+
564
+ 73 | if (error instanceof ApiError) {
565
+ 74 | // Operational errors — log at warn level
566
+ > 75 | console.warn(
567
+ | ^
568
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
569
+ 77 | );
570
+ 78 | return c.json({
571
+
572
+ at Hono.errorHandler (src/api/errors.ts:75:17)
573
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
574
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
575
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
576
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
577
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
578
+
579
+ console.warn
580
+ ⚠️ [API] GET /unauthorized → 401 TOKEN_EXPIRED: Token expired
581
+
582
+ 73 | if (error instanceof ApiError) {
583
+ 74 | // Operational errors — log at warn level
584
+ > 75 | console.warn(
585
+ | ^
586
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
587
+ 77 | );
588
+ 78 | return c.json({
589
+
590
+ at Hono.errorHandler (src/api/errors.ts:75:17)
591
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
592
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
593
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
594
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
595
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
596
+
597
+ console.warn
598
+ ⚠️ [API] GET /forbidden → 403 FORBIDDEN: Admin only
599
+
600
+ 73 | if (error instanceof ApiError) {
601
+ 74 | // Operational errors — log at warn level
602
+ > 75 | console.warn(
603
+ | ^
604
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
605
+ 77 | );
606
+ 78 | return c.json({
607
+
608
+ at Hono.errorHandler (src/api/errors.ts:75:17)
609
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
610
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
611
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
612
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
613
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
614
+
615
+ console.warn
616
+ ⚠️ [API] GET /not-found → 404 NOT_FOUND: Entity not found
617
+
618
+ 73 | if (error instanceof ApiError) {
619
+ 74 | // Operational errors — log at warn level
620
+ > 75 | console.warn(
621
+ | ^
622
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
623
+ 77 | );
624
+ 78 | return c.json({
625
+
626
+ at Hono.errorHandler (src/api/errors.ts:75:17)
627
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
628
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
629
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
630
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
631
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
632
+
633
+ console.warn
634
+ ⚠️ [API] GET /internal → 500 INTERNAL_ERROR: Database connection failed
635
+
636
+ 73 | if (error instanceof ApiError) {
637
+ 74 | // Operational errors — log at warn level
638
+ > 75 | console.warn(
639
+ | ^
640
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
641
+ 77 | );
642
+ 78 | return c.json({
643
+
644
+ at Hono.errorHandler (src/api/errors.ts:75:17)
645
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
646
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
647
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
648
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
649
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
650
+
651
+ console.error
652
+ ❌ [API] GET /generic-error → 500 INTERNAL_ERROR: Something went wrong
653
+
654
+ 89 |
655
+ 90 | // Unexpected errors — log at error level with full stack
656
+ > 91 | console.error(
657
+ | ^
658
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
659
+ 93 | );
660
+ 94 | console.error(error.stack || error);
661
+
662
+ at Hono.errorHandler (src/api/errors.ts:91:13)
663
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
664
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
665
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
666
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
667
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
668
+
669
+ console.error
670
+ Error: Something went wrong
671
+ at Array.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors-hono.test.ts:33:19)
672
+ at Hono.#dispatch (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:309:38)
673
+ at Hono.fetch (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:346:26)
674
+ at Hono.request (/Users/francesco/rebase/node_modules/hono/dist/cjs/hono-base.js:365:17)
675
+ at Object.<anonymous> (/Users/francesco/rebase/packages/backend/test/errors-hono.test.ts:126:35)
676
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
677
+
678
+ 92 | `❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code}: ${error.message}`
679
+ 93 | );
680
+ > 94 | console.error(error.stack || error);
681
+ | ^
682
+ 95 |
683
+ 96 | return c.json({
684
+ 97 | error: {
685
+
686
+ at Hono.errorHandler (src/api/errors.ts:94:13)
687
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
688
+ at Hono.#dispatch (../../node_modules/hono/dist/cjs/hono-base.js:313:33)
689
+ at Hono.fetch (../../node_modules/hono/dist/cjs/hono-base.js:346:26)
690
+ at Hono.request (../../node_modules/hono/dist/cjs/hono-base.js:365:17)
691
+ at Object.<anonymous> (test/errors-hono.test.ts:126:35)
692
+
693
+ PASS test/storage-local.test.ts
694
+ FAIL test/admin-routes.test.ts
695
+ ● Test suite failed to run
696
+
697
+ test/admin-routes.test.ts:93:59 - error TS1005: ',' expected.
698
+
699
+ 93 deleteRole: jest.fn().mockResolvedValue(undefined): jest.fn().mockResolvedValue(undefined)
700
+    ~
701
+ test/admin-routes.test.ts:93:65 - error TS1005: ',' expected.
702
+
703
+ 93 deleteRole: jest.fn().mockResolvedValue(undefined): jest.fn().mockResolvedValue(undefined)
704
+    ~
705
+
706
+ PASS test/auth-routes.test.ts
707
+ ● Console
708
+
709
+ console.warn
710
+ ⚠️ [API] POST /auth/register → 409 EMAIL_EXISTS: Email already registered
711
+
712
+ 73 | if (error instanceof ApiError) {
713
+ 74 | // Operational errors — log at warn level
714
+ > 75 | console.warn(
715
+ | ^
716
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
717
+ 77 | );
718
+ 78 | return c.json({
719
+
720
+ at errorHandler (src/api/errors.ts:75:17)
721
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
722
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
723
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
724
+ at Object.<anonymous> (test/auth-routes.test.ts:199:25)
725
+
726
+ console.warn
727
+ ⚠️ [API] POST /auth/register → 400 WEAK_PASSWORD: Too short
728
+
729
+ 73 | if (error instanceof ApiError) {
730
+ 74 | // Operational errors — log at warn level
731
+ > 75 | console.warn(
732
+ | ^
733
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
734
+ 77 | );
735
+ 78 | return c.json({
736
+
737
+ at errorHandler (src/api/errors.ts:75:17)
738
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
739
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
740
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
741
+ at Object.<anonymous> (test/auth-routes.test.ts:209:25)
742
+
743
+ console.warn
744
+ ⚠️ [API] POST /auth/register → 400 INVALID_INPUT: email: Invalid email address
745
+
746
+ 73 | if (error instanceof ApiError) {
747
+ 74 | // Operational errors — log at warn level
748
+ > 75 | console.warn(
749
+ | ^
750
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
751
+ 77 | );
752
+ 78 | return c.json({
753
+
754
+ at errorHandler (src/api/errors.ts:75:17)
755
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
756
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
757
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
758
+ at Object.<anonymous> (test/auth-routes.test.ts:217:25)
759
+
760
+ console.warn
761
+ ⚠️ [API] POST /auth/register → 400 INVALID_INPUT: password: Required
762
+
763
+ 73 | if (error instanceof ApiError) {
764
+ 74 | // Operational errors — log at warn level
765
+ > 75 | console.warn(
766
+ | ^
767
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
768
+ 77 | );
769
+ 78 | return c.json({
770
+
771
+ at errorHandler (src/api/errors.ts:75:17)
772
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
773
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
774
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
775
+ at Object.<anonymous> (test/auth-routes.test.ts:225:25)
776
+
777
+ console.warn
778
+ ⚠️ [API] POST /auth/register → 403 REGISTRATION_DISABLED: Registration is disabled
779
+
780
+ 73 | if (error instanceof ApiError) {
781
+ 74 | // Operational errors — log at warn level
782
+ > 75 | console.warn(
783
+ | ^
784
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
785
+ 77 | );
786
+ 78 | return c.json({
787
+
788
+ at errorHandler (src/api/errors.ts:75:17)
789
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
790
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
791
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
792
+ at Object.<anonymous> (test/auth-routes.test.ts:233:25)
793
+
794
+ console.warn
795
+ ⚠️ [API] POST /auth/login → 401 INVALID_CREDENTIALS: Invalid email or password
796
+
797
+ 73 | if (error instanceof ApiError) {
798
+ 74 | // Operational errors — log at warn level
799
+ > 75 | console.warn(
800
+ | ^
801
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
802
+ 77 | );
803
+ 78 | return c.json({
804
+
805
+ at errorHandler (src/api/errors.ts:75:17)
806
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
807
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
808
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
809
+ at Object.<anonymous> (test/auth-routes.test.ts:276:25)
810
+
811
+ console.warn
812
+ ⚠️ [API] POST /auth/login → 401 INVALID_CREDENTIALS: Invalid email or password
813
+
814
+ 73 | if (error instanceof ApiError) {
815
+ 74 | // Operational errors — log at warn level
816
+ > 75 | console.warn(
817
+ | ^
818
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
819
+ 77 | );
820
+ 78 | return c.json({
821
+
822
+ at errorHandler (src/api/errors.ts:75:17)
823
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
824
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
825
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
826
+ at Object.<anonymous> (test/auth-routes.test.ts:287:25)
827
+
828
+ console.warn
829
+ ⚠️ [API] POST /auth/login → 401 INVALID_CREDENTIALS: Invalid email or password
830
+
831
+ 73 | if (error instanceof ApiError) {
832
+ 74 | // Operational errors — log at warn level
833
+ > 75 | console.warn(
834
+ | ^
835
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
836
+ 77 | );
837
+ 78 | return c.json({
838
+
839
+ at errorHandler (src/api/errors.ts:75:17)
840
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
841
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
842
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
843
+ at Object.<anonymous> (test/auth-routes.test.ts:295:25)
844
+
845
+ console.warn
846
+ ⚠️ [API] POST /auth/login → 400 INVALID_INPUT: email: Required
847
+
848
+ 73 | if (error instanceof ApiError) {
849
+ 74 | // Operational errors — log at warn level
850
+ > 75 | console.warn(
851
+ | ^
852
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
853
+ 77 | );
854
+ 78 | return c.json({
855
+
856
+ at errorHandler (src/api/errors.ts:75:17)
857
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
858
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
859
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
860
+ at Object.<anonymous> (test/auth-routes.test.ts:301:25)
861
+
862
+ console.warn
863
+ ⚠️ [API] POST /auth/google → 503 NOT_CONFIGURED: Google login not configured
864
+
865
+ 73 | if (error instanceof ApiError) {
866
+ 74 | // Operational errors — log at warn level
867
+ > 75 | console.warn(
868
+ | ^
869
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
870
+ 77 | );
871
+ 78 | return c.json({
872
+
873
+ at errorHandler (src/api/errors.ts:75:17)
874
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
875
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
876
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
877
+ at Object.<anonymous> (test/auth-routes.test.ts:318:25)
878
+
879
+ console.warn
880
+ ⚠️ [API] POST /auth/google → 401 INVALID_TOKEN: Invalid Google token
881
+
882
+ 73 | if (error instanceof ApiError) {
883
+ 74 | // Operational errors — log at warn level
884
+ > 75 | console.warn(
885
+ | ^
886
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
887
+ 77 | );
888
+ 78 | return c.json({
889
+
890
+ at errorHandler (src/api/errors.ts:75:17)
891
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
892
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
893
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
894
+ at Object.<anonymous> (test/auth-routes.test.ts:329:25)
895
+
896
+ console.warn
897
+ ⚠️ [API] POST /auth/refresh → 401 INVALID_TOKEN: Invalid refresh token
898
+
899
+ 73 | if (error instanceof ApiError) {
900
+ 74 | // Operational errors — log at warn level
901
+ > 75 | console.warn(
902
+ | ^
903
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
904
+ 77 | );
905
+ 78 | return c.json({
906
+
907
+ at Hono.errorHandler (src/api/errors.ts:75:17)
908
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
909
+ at ../../node_modules/hono/dist/cjs/hono-base.js:317:41
910
+ at Object.<anonymous> (test/auth-routes.test.ts:444:25)
911
+
912
+ console.warn
913
+ ⚠️ [API] POST /auth/refresh → 401 TOKEN_EXPIRED: Refresh token expired
914
+
915
+ 73 | if (error instanceof ApiError) {
916
+ 74 | // Operational errors — log at warn level
917
+ > 75 | console.warn(
918
+ | ^
919
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
920
+ 77 | );
921
+ 78 | return c.json({
922
+
923
+ at Hono.errorHandler (src/api/errors.ts:75:17)
924
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
925
+ at ../../node_modules/hono/dist/cjs/hono-base.js:317:41
926
+ at Object.<anonymous> (test/auth-routes.test.ts:462:25)
927
+
928
+ console.warn
929
+ ⚠️ [API] POST /auth/refresh → 400 INVALID_INPUT: refreshToken: Required
930
+
931
+ 73 | if (error instanceof ApiError) {
932
+ 74 | // Operational errors — log at warn level
933
+ > 75 | console.warn(
934
+ | ^
935
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
936
+ 77 | );
937
+ 78 | return c.json({
938
+
939
+ at Hono.errorHandler (src/api/errors.ts:75:17)
940
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
941
+ at ../../node_modules/hono/dist/cjs/hono-base.js:317:41
942
+ at Object.<anonymous> (test/auth-routes.test.ts:471:25)
943
+
944
+ console.warn
945
+ ⚠️ [API] POST /auth/forgot-password → 503 EMAIL_NOT_CONFIGURED: Email service not configured. Password reset is not available.
946
+
947
+ 73 | if (error instanceof ApiError) {
948
+ 74 | // Operational errors — log at warn level
949
+ > 75 | console.warn(
950
+ | ^
951
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
952
+ 77 | );
953
+ 78 | return c.json({
954
+
955
+ at errorHandler (src/api/errors.ts:75:17)
956
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
957
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
958
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
959
+ at Object.<anonymous> (test/auth-routes.test.ts:525:25)
960
+
961
+ console.warn
962
+ ⚠️ [API] POST /auth/reset-password → 400 INVALID_TOKEN: Invalid or expired reset token
963
+
964
+ 73 | if (error instanceof ApiError) {
965
+ 74 | // Operational errors — log at warn level
966
+ > 75 | console.warn(
967
+ | ^
968
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
969
+ 77 | );
970
+ 78 | return c.json({
971
+
972
+ at errorHandler (src/api/errors.ts:75:17)
973
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
974
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
975
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
976
+ at Object.<anonymous> (test/auth-routes.test.ts:562:25)
977
+
978
+ console.warn
979
+ ⚠️ [API] POST /auth/reset-password → 400 WEAK_PASSWORD: Too weak
980
+
981
+ 73 | if (error instanceof ApiError) {
982
+ 74 | // Operational errors — log at warn level
983
+ > 75 | console.warn(
984
+ | ^
985
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
986
+ 77 | );
987
+ 78 | return c.json({
988
+
989
+ at errorHandler (src/api/errors.ts:75:17)
990
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
991
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
992
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
993
+ at Object.<anonymous> (test/auth-routes.test.ts:572:25)
994
+
995
+ console.warn
996
+ ⚠️ [API] POST /auth/change-password → 401 INVALID_CREDENTIALS: Current password is incorrect
997
+
998
+ 73 | if (error instanceof ApiError) {
999
+ 74 | // Operational errors — log at warn level
1000
+ > 75 | console.warn(
1001
+ | ^
1002
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1003
+ 77 | );
1004
+ 78 | return c.json({
1005
+
1006
+ at errorHandler (src/api/errors.ts:75:17)
1007
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
1008
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
1009
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
1010
+ at Object.<anonymous> (test/auth-routes.test.ts:609:25)
1011
+
1012
+ console.warn
1013
+ ⚠️ [API] POST /auth/change-password → 400 WEAK_PASSWORD: Too short
1014
+
1015
+ 73 | if (error instanceof ApiError) {
1016
+ 74 | // Operational errors — log at warn level
1017
+ > 75 | console.warn(
1018
+ | ^
1019
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1020
+ 77 | );
1021
+ 78 | return c.json({
1022
+
1023
+ at errorHandler (src/api/errors.ts:75:17)
1024
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
1025
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
1026
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
1027
+ at Object.<anonymous> (test/auth-routes.test.ts:621:25)
1028
+
1029
+ console.warn
1030
+ ⚠️ [API] POST /auth/change-password → 400 INVALID_ACCOUNT: Cannot change password for this account
1031
+
1032
+ 73 | if (error instanceof ApiError) {
1033
+ 74 | // Operational errors — log at warn level
1034
+ > 75 | console.warn(
1035
+ | ^
1036
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1037
+ 77 | );
1038
+ 78 | return c.json({
1039
+
1040
+ at errorHandler (src/api/errors.ts:75:17)
1041
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
1042
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
1043
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
1044
+ at Object.<anonymous> (test/auth-routes.test.ts:638:25)
1045
+
1046
+ console.warn
1047
+ ⚠️ [API] POST /auth/send-verification → 400 ALREADY_VERIFIED: Email is already verified
1048
+
1049
+ 73 | if (error instanceof ApiError) {
1050
+ 74 | // Operational errors — log at warn level
1051
+ > 75 | console.warn(
1052
+ | ^
1053
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1054
+ 77 | );
1055
+ 78 | return c.json({
1056
+
1057
+ at errorHandler (src/api/errors.ts:75:17)
1058
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
1059
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
1060
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
1061
+ at Object.<anonymous> (test/auth-routes.test.ts:668:29)
1062
+
1063
+ console.warn
1064
+ ⚠️ [API] POST /auth/send-verification → 503 EMAIL_NOT_CONFIGURED: Email service not configured. Email verification is not available.
1065
+
1066
+ 73 | if (error instanceof ApiError) {
1067
+ 74 | // Operational errors — log at warn level
1068
+ > 75 | console.warn(
1069
+ | ^
1070
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1071
+ 77 | );
1072
+ 78 | return c.json({
1073
+
1074
+ at errorHandler (src/api/errors.ts:75:17)
1075
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
1076
+
1077
+ console.warn
1078
+ ⚠️ [API] GET /auth/verify-email → 400 INVALID_TOKEN: Invalid or expired verification token
1079
+
1080
+ 73 | if (error instanceof ApiError) {
1081
+ 74 | // Operational errors — log at warn level
1082
+ > 75 | console.warn(
1083
+ | ^
1084
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1085
+ 77 | );
1086
+ 78 | return c.json({
1087
+
1088
+ at Hono.errorHandler (src/api/errors.ts:75:17)
1089
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
1090
+ at ../../node_modules/hono/dist/cjs/hono-base.js:317:41
1091
+ at Object.<anonymous> (test/auth-routes.test.ts:707:29)
1092
+
1093
+ console.warn
1094
+ ⚠️ [API] GET /auth/verify-email → 400 INVALID_INPUT: Verification token is required
1095
+
1096
+ 73 | if (error instanceof ApiError) {
1097
+ 74 | // Operational errors — log at warn level
1098
+ > 75 | console.warn(
1099
+ | ^
1100
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1101
+ 77 | );
1102
+ 78 | return c.json({
1103
+
1104
+ at Hono.errorHandler (src/api/errors.ts:75:17)
1105
+ at Hono.#handleError (../../node_modules/hono/dist/cjs/hono-base.js:289:19)
1106
+ at ../../node_modules/hono/dist/cjs/hono-base.js:317:41
1107
+ at Object.<anonymous> (test/auth-routes.test.ts:715:29)
1108
+
1109
+ console.warn
1110
+ ⚠️ [API] GET /auth/me → 404 NOT_FOUND: User not found
1111
+
1112
+ 73 | if (error instanceof ApiError) {
1113
+ 74 | // Operational errors — log at warn level
1114
+ > 75 | console.warn(
1115
+ | ^
1116
+ 76 | `⚠️ [API] ${c.req.method} ${c.req.path} → ${error.statusCode} ${error.code}: ${error.message}`
1117
+ 77 | );
1118
+ 78 | return c.json({
1119
+
1120
+ at errorHandler (src/api/errors.ts:75:17)
1121
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:47:25)
1122
+ at dispatch (../../node_modules/hono/dist/cjs/compose.js:43:17)
1123
+ at ../../node_modules/hono/dist/cjs/hono-base.js:322:25
1124
+ at Object.<anonymous> (test/auth-routes.test.ts:744:25)
1125
+
1126
+ PASS test/ast-schema-editor.test.ts
1127
+ PASS test/password.test.ts
1128
+
1129
+ Test Suites: 1 failed, 15 passed, 16 total
1130
+ Tests: 333 passed, 333 total
1131
+ Snapshots: 0 total
1132
+ Time: 2.324 s
1133
+ Ran all test suites.