@umituz/web-hono 1.8.2 → 1.8.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/web-hono",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "API backend platform for Cloudflare Workers + Neon Postgres: createApi skeleton + error envelope layer, full-CRUD resource factory (opt-in create/remove, list params), schema→client type bridge (ClientRow), apiFetch/apiWrite client, reactive fetch-backed store (+React hooks), and db lifecycle scripts (reset / snapshot / seed)",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/errors.ts CHANGED
@@ -48,7 +48,7 @@ export class ApiError extends Error {
48
48
  * node-postgres) or nested in a driver cause-chain (neon-http). Depth-capped
49
49
  * walk so malformed causes can't loop.
50
50
  */
51
- function isUniqueViolation(err: unknown): boolean {
51
+ export function isUniqueViolation(err: unknown): boolean {
52
52
  let e: unknown = err;
53
53
  for (let depth = 0; e !== null && typeof e === 'object' && depth < 3; depth += 1) {
54
54
  if ((e as { code?: unknown }).code === '23505') return true;
package/src/index.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  export { createApi } from './api';
23
23
  export type { ApiConfig } from './api';
24
24
  export { healthRouter } from './health';
25
- export { ApiError, apiOnError } from './errors';
25
+ export { ApiError, apiOnError, isUniqueViolation } from './errors';
26
26
  export { crudRoutes, listRoutes } from './crud';
27
27
  export type { CrudSpec, CrudTable, CrudDb, CrudDbFactory, CreateSpec, ListSpec } from './crud';
28
28
  export { docStore, canTransition, epoch, WorkflowError, UnknownCollectionError } from './docstore';