@lssm/lib.error 1.11.1 → 1.41.1

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/README.md CHANGED
@@ -59,6 +59,11 @@ try {
59
59
 
60
60
 
61
61
 
62
+
63
+
64
+
65
+
66
+
62
67
 
63
68
 
64
69
 
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@lssm/lib.error",
3
- "version": "1.11.1",
3
+ "version": "1.41.1",
4
4
  "scripts": {
5
5
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
6
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
6
7
  "build": "bun build:bundle && bun build:types",
7
8
  "build:bundle": "tsdown",
8
9
  "build:types": "tsc --noEmit",
@@ -13,15 +14,15 @@
13
14
  "lint:check": "eslint src"
14
15
  },
15
16
  "devDependencies": {
16
- "@lssm/tool.typescript": "0.11.1",
17
- "tsdown": "^0.16.6",
17
+ "@lssm/tool.typescript": "1.41.1",
18
+ "tsdown": "^0.17.4",
18
19
  "typescript": "^5.9.3"
19
20
  },
20
21
  "dependencies": {},
21
22
  "peerDependencies": {
22
- "elysia": "^1.4.11",
23
- "express": "^5.1.0",
24
- "next": "16.0.5"
23
+ "elysia": "^1.4.19",
24
+ "express": "^5.2.1",
25
+ "next": "16.0.10"
25
26
  },
26
27
  "type": "module",
27
28
  "main": "./dist/index.js",
@@ -32,10 +33,10 @@
32
33
  "README.md"
33
34
  ],
34
35
  "exports": {
35
- ".": "./dist/index.js",
36
- "./appError": "./dist/appError.js",
37
- "./codes": "./dist/codes.js",
38
- "./http": "./dist/http.js",
36
+ ".": "./src/index.ts",
37
+ "./appError": "./src/appError.ts",
38
+ "./codes": "./src/codes.ts",
39
+ "./http": "./src/http.ts",
39
40
  "./*": "./*"
40
41
  },
41
42
  "publishConfig": {
@@ -1,16 +0,0 @@
1
- import { ErrorCode } from "./codes.js";
2
-
3
- //#region src/appError.d.ts
4
-
5
- /**
6
- * Generic application error with code and optional details.
7
- */
8
- declare class AppError extends Error {
9
- code: ErrorCode;
10
- details?: Record<string, unknown> | undefined;
11
- constructor(code: ErrorCode, message: string, details?: Record<string, unknown> | undefined);
12
- }
13
- /** Type guard to detect AppError */
14
- declare function isAppError(err: unknown): err is AppError;
15
- //#endregion
16
- export { AppError, isAppError };
package/dist/codes.d.ts DELETED
@@ -1,18 +0,0 @@
1
- //#region src/codes.d.ts
2
- /**
3
- * Centralised error codes used across services.
4
- * Extend this enum to add more domain-specific codes.
5
- */
6
- declare enum ErrorCode {
7
- UNAUTHENTICATED = "UNAUTHENTICATED",
8
- FORBIDDEN = "FORBIDDEN",
9
- NOT_FOUND = "NOT_FOUND",
10
- INVALID_INPUT = "INVALID_INPUT",
11
- CONFLICT = "CONFLICT",
12
- RATE_LIMITED = "RATE_LIMITED",
13
- SERVER_ERROR = "SERVER_ERROR",
14
- POLICY_DENIED = "POLICY_DENIED",
15
- }
16
- declare function isKnownErrorCode(code: string): code is ErrorCode;
17
- //#endregion
18
- export { ErrorCode, isKnownErrorCode };
package/dist/http.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { ErrorCode } from "./codes.js";
2
-
3
- //#region src/http.d.ts
4
-
5
- /**
6
- * Map known error codes to HTTP status codes.
7
- */
8
- declare function httpStatus(code: ErrorCode): number;
9
- //#endregion
10
- export { httpStatus };
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { ErrorCode, isKnownErrorCode } from "./codes.js";
2
- import { AppError, isAppError } from "./appError.js";
3
- import { httpStatus } from "./http.js";
4
- export { AppError, ErrorCode, httpStatus, isAppError, isKnownErrorCode };