hono-ban 0.3.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/{LICENSE.md → LICENSE} +1 -1
  3. package/README.md +307 -472
  4. package/dist/ban-error-CPoKZS7g.js +102 -0
  5. package/dist/ban-error-CPoKZS7g.js.map +1 -0
  6. package/dist/constants-rUzQOaX_.js +66 -0
  7. package/dist/constants-rUzQOaX_.js.map +1 -0
  8. package/dist/definition-CDmfpcHf.js +263 -0
  9. package/dist/definition-CDmfpcHf.js.map +1 -0
  10. package/dist/formats/google-api.d.ts +115 -0
  11. package/dist/formats/google-api.d.ts.map +1 -0
  12. package/dist/formats/google-api.js +356 -0
  13. package/dist/formats/google-api.js.map +1 -0
  14. package/dist/formats/json-api.d.ts +51 -0
  15. package/dist/formats/json-api.d.ts.map +1 -0
  16. package/dist/formats/json-api.js +148 -0
  17. package/dist/formats/json-api.js.map +1 -0
  18. package/dist/formats/plain.d.ts +20 -0
  19. package/dist/formats/plain.d.ts.map +1 -0
  20. package/dist/formats/plain.js +77 -0
  21. package/dist/formats/plain.js.map +1 -0
  22. package/dist/formats/problem-details.d.ts +34 -0
  23. package/dist/formats/problem-details.d.ts.map +1 -0
  24. package/dist/formats/problem-details.js +2 -0
  25. package/dist/formats/stripe.d.ts +52 -0
  26. package/dist/formats/stripe.d.ts.map +1 -0
  27. package/dist/formats/stripe.js +118 -0
  28. package/dist/formats/stripe.js.map +1 -0
  29. package/dist/hook-DM38dR1V.js +23 -0
  30. package/dist/hook-DM38dR1V.js.map +1 -0
  31. package/dist/hook-TWCLnCmZ.d.ts +15 -0
  32. package/dist/hook-TWCLnCmZ.d.ts.map +1 -0
  33. package/dist/index.d.ts +129 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +606 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/issue-B-7iyCBE.js +41 -0
  38. package/dist/issue-B-7iyCBE.js.map +1 -0
  39. package/dist/json-Bjfm-jxl.js +17 -0
  40. package/dist/json-Bjfm-jxl.js.map +1 -0
  41. package/dist/openapi.d.ts +40 -0
  42. package/dist/openapi.d.ts.map +1 -0
  43. package/dist/openapi.js +75 -0
  44. package/dist/openapi.js.map +1 -0
  45. package/dist/otel.d.ts +29 -0
  46. package/dist/otel.d.ts.map +1 -0
  47. package/dist/otel.js +23 -0
  48. package/dist/otel.js.map +1 -0
  49. package/dist/problem-details-BlPlC-mV.js +158 -0
  50. package/dist/problem-details-BlPlC-mV.js.map +1 -0
  51. package/dist/schema-helpers-B4HL9TmU.js +9 -0
  52. package/dist/schema-helpers-B4HL9TmU.js.map +1 -0
  53. package/dist/standard-schema-types-Aa3pYPY1.d.ts +43 -0
  54. package/dist/standard-schema-types-Aa3pYPY1.d.ts.map +1 -0
  55. package/dist/standard-schema.d.ts +15 -0
  56. package/dist/standard-schema.d.ts.map +1 -0
  57. package/dist/standard-schema.js +23 -0
  58. package/dist/standard-schema.js.map +1 -0
  59. package/dist/testing.d.ts +26 -0
  60. package/dist/testing.d.ts.map +1 -0
  61. package/dist/testing.js +137 -0
  62. package/dist/testing.js.map +1 -0
  63. package/dist/types-DYr4CtCC.d.ts +337 -0
  64. package/dist/types-DYr4CtCC.d.ts.map +1 -0
  65. package/dist/types-WuQ-karh.d.ts +179 -0
  66. package/dist/types-WuQ-karh.d.ts.map +1 -0
  67. package/dist/valibot.d.ts +26 -0
  68. package/dist/valibot.d.ts.map +1 -0
  69. package/dist/valibot.js +31 -0
  70. package/dist/valibot.js.map +1 -0
  71. package/dist/validation-entries-9R5RK-AZ.js +53 -0
  72. package/dist/validation-entries-9R5RK-AZ.js.map +1 -0
  73. package/dist/validation-entries-nUGoBPKm.d.ts +17 -0
  74. package/dist/validation-entries-nUGoBPKm.d.ts.map +1 -0
  75. package/dist/zod.d.ts +27 -0
  76. package/dist/zod.d.ts.map +1 -0
  77. package/dist/zod.js +30 -0
  78. package/dist/zod.js.map +1 -0
  79. package/package.json +98 -66
  80. package/dist/esm/formatters/index.js +0 -1
  81. package/dist/esm/index.js +0 -1
  82. package/dist/types/constants/index.d.ts +0 -5
  83. package/dist/types/constants/status-codes.d.ts +0 -9
  84. package/dist/types/core/convert-error.d.ts +0 -17
  85. package/dist/types/core/create-error.d.ts +0 -23
  86. package/dist/types/core/format-error.d.ts +0 -18
  87. package/dist/types/core/index.d.ts +0 -7
  88. package/dist/types/factories/client-errors.d.ts +0 -179
  89. package/dist/types/factories/index.d.ts +0 -6
  90. package/dist/types/factories/server-errors.d.ts +0 -77
  91. package/dist/types/formatters/default/index.d.ts +0 -19
  92. package/dist/types/formatters/index.d.ts +0 -7
  93. package/dist/types/formatters/interfaces.d.ts +0 -5
  94. package/dist/types/formatters/rfc7807/formatter.d.ts +0 -40
  95. package/dist/types/formatters/rfc7807/hooks.d.ts +0 -40
  96. package/dist/types/formatters/rfc7807/index.d.ts +0 -7
  97. package/dist/types/formatters/rfc7807/schemas.d.ts +0 -162
  98. package/dist/types/index.d.ts +0 -11
  99. package/dist/types/middleware/ban-middleware.d.ts +0 -23
  100. package/dist/types/middleware/index.d.ts +0 -5
  101. package/dist/types/types/common.d.ts +0 -12
  102. package/dist/types/types/error.d.ts +0 -39
  103. package/dist/types/types/formatter.d.ts +0 -43
  104. package/dist/types/types/index.d.ts +0 -9
  105. package/dist/types/types/options.d.ts +0 -54
  106. package/dist/types/types/rfc7807.d.ts +0 -77
  107. package/dist/types/utils/index.d.ts +0 -6
  108. package/dist/types/utils/sanitize.d.ts +0 -10
  109. package/dist/types/utils/validate.d.ts +0 -10
package/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # hono-ban
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`efcb0b6`](https://github.com/ali-issa/hono-ban/commit/efcb0b6bd24a598bf0e8868bff9942ec248a7868) Thanks [@ali-issa](https://github.com/ali-issa)! - First 1.0 release. `createBan()` builds a typed error catalog with a factory per IANA status and per
8
+ custom entry, `ban.onError()` renders every thrown value once through a pluggable format (RFC 9457
9
+ Problem Details by default; JSON:API, Google API (AIP-193), Stripe, and plain built in;
10
+ `defineFormat()` for your own), validator hooks for Zod, Valibot, and Standard Schema throw into the
11
+ handler, `hono-ban/openapi` derives response schemas from the active format, and `hono-ban/otel`
12
+ adds trace ids. Error responses carry `Cache-Control: no-store` unless you set one, and
13
+ `bearerChallenge()` builds RFC 6750 and RFC 9728 `WWW-Authenticate` values. `hono` is the only peer
14
+ dependency.
15
+
16
+ ## 1.0.0-alpha.1
17
+
18
+ ### Major Changes
19
+
20
+ - First 1.0 release. `createBan()` builds a typed error catalog with a factory per IANA status and per
21
+ custom entry, `ban.onError()` renders every thrown value once through a pluggable format (RFC 9457
22
+ Problem Details by default; JSON:API, Google API (AIP-193), Stripe, and plain built in;
23
+ `defineFormat()` for your own), validator hooks for Zod, Valibot, and Standard Schema throw into the
24
+ handler, `hono-ban/openapi` derives response schemas from the active format, and `hono-ban/otel`
25
+ adds trace ids. Error responses carry `Cache-Control: no-store` unless you set one, and
26
+ `bearerChallenge()` builds RFC 6750 and RFC 9728 `WWW-Authenticate` values. `hono` is the only peer
27
+ dependency.
28
+
29
+ Release notes are generated by [Changesets](https://github.com/changesets/changesets) from the
30
+ entries in `.changeset/` when a version PR is merged.
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Ali Issa
3
+ Copyright (c) 2025-2026 Ali Issa
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal