@puq/error 0.3.1 → 0.3.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/common/base-error.d.ts +2 -2
- package/dist/lib/common/base-error.d.ts.map +1 -1
- package/dist/lib/common/base-error.js +5 -15
- package/dist/lib/common/base-error.js.map +1 -1
- package/dist/lib/common/create-thrower.d.ts +1 -1
- package/dist/lib/common/create-thrower.d.ts.map +1 -1
- package/dist/lib/common/create-thrower.js +5 -10
- package/dist/lib/common/create-thrower.js.map +1 -1
- package/dist/lib/common/create-throwers.d.ts +1 -1
- package/dist/lib/common/create-throwers.d.ts.map +1 -1
- package/dist/lib/common/create-throwers.js +7 -13
- package/dist/lib/common/create-throwers.js.map +1 -1
- package/dist/lib/common/error-code.js +2 -137
- package/dist/lib/common/error-code.js.map +1 -1
- package/dist/lib/common/error-metadata.js +1 -3
- package/dist/lib/common/error-metadata.js.map +1 -1
- package/dist/lib/common/error-thrower.d.ts +1 -1
- package/dist/lib/common/error-thrower.d.ts.map +1 -1
- package/dist/lib/common/error-thrower.js +1 -3
- package/dist/lib/common/error-thrower.js.map +1 -1
- package/dist/lib/throwers-map.js +2 -4
- package/dist/lib/throwers-map.js.map +1 -1
- package/dist/package.json +84 -0
- package/package.json +5 -5
- package/dist/lib/common/index.d.ts +0 -6
- package/dist/lib/common/index.d.ts.map +0 -1
- package/dist/lib/common/index.js +0 -8
- package/dist/lib/common/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
@@ -3,5 +3,6 @@ export * from './lib/common/create-thrower.js';
|
|
3
3
|
export * from './lib/common/create-throwers.js';
|
4
4
|
export * from './lib/common/error-code.js';
|
5
5
|
export * from './lib/common/error-metadata.js';
|
6
|
+
export * from './lib/common/error-thrower.js';
|
6
7
|
export * from './lib/throwers-map.js';
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)
|
2
1
|
export * from './lib/common/base-error.js';
|
3
2
|
export * from './lib/common/create-thrower.js';
|
4
3
|
export * from './lib/common/create-throwers.js';
|
5
4
|
export * from './lib/common/error-code.js';
|
6
5
|
export * from './lib/common/error-metadata.js';
|
6
|
+
export * from './lib/common/error-thrower.js';
|
7
7
|
export * from './lib/throwers-map.js';
|
8
8
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)\nexport * from './lib/common/base-error.js';\nexport * from './lib/common/create-thrower.js';\nexport * from './lib/common/create-throwers.js';\nexport * from './lib/common/error-code.js';\nexport * from './lib/common/error-metadata.js';\nexport * from './lib/throwers-map.js';\n"],"names":[],"
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)\nexport * from './lib/common/base-error.js';\nexport * from './lib/common/create-thrower.js';\nexport * from './lib/common/create-throwers.js';\nexport * from './lib/common/error-code.js';\nexport * from './lib/common/error-metadata.js';\nexport * from './lib/common/error-thrower.js';\nexport * from './lib/throwers-map.js';\n"],"names":[],"mappings":"AACA,cAAc,6BAA6B;AAC3C,cAAc,iCAAiC;AAC/C,cAAc,kCAAkC;AAChD,cAAc,6BAA6B;AAC3C,cAAc,iCAAiC;AAC/C,cAAc,gCAAgC;AAC9C,cAAc,wBAAwB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base-error.d.ts","sourceRoot":"","sources":["../../../src/lib/common/base-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"base-error.d.ts","sourceRoot":"","sources":["../../../src/lib/common/base-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAClC;;OAEG;IACH,SAAgB,IAAI,EAAE,SAAS,CAAC;IAEhC;;OAEG;IACH,SAAgB,QAAQ,CAAC,EAAE,aAAa,CAAC;gBAE7B,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa;CAcvE"}
|
@@ -1,18 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
super(message);
|
7
|
-
this.code = code;
|
8
|
-
this.metadata = metadata;
|
9
|
-
this.cause = (_this_metadata = this.metadata) == null ? void 0 : _this_metadata.cause;
|
10
|
-
// Fix prototype chain for proper instanceof checks
|
11
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
12
|
-
// Capture the stack trace (Node.js and Chrome V8 engines)
|
13
|
-
if (Error.captureStackTrace) {
|
14
|
-
Error.captureStackTrace(this, this.constructor);
|
15
|
-
}
|
1
|
+
import { _ as t } from "@swc/helpers/_/_define_property";
|
2
|
+
export class BaseError extends Error {
|
3
|
+
constructor(r, e, a){
|
4
|
+
var o;
|
5
|
+
super(e), t(this, "code", void 0), t(this, "metadata", void 0), this.code = r, this.metadata = a, this.cause = null === (o = this.metadata) || void 0 === o ? void 0 : o.cause, Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
16
6
|
}
|
17
7
|
}
|
18
8
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/base-error.ts"],"sourcesContent":["import { ErrorCode } from './error-code.js';\r\nimport { ErrorMetadata } from './error-metadata.js';\r\n\r\n/**\r\n * Error class to create errors\r\n */\r\nexport class BaseError extends Error {\r\n /**\r\n * Unique error code to identify the cause of the error\r\n */\r\n public readonly code: ErrorCode;\r\n\r\n /**\r\n * Metadata to clearify the cuase\r\n */\r\n public readonly metadata?: ErrorMetadata;\r\n\r\n constructor(code: ErrorCode, message: string, metadata?: ErrorMetadata) {\r\n super(message);\r\n this.code = code;\r\n this.metadata = metadata;\r\n this.cause = this.metadata?.cause;\r\n\r\n // Fix prototype chain for proper instanceof checks\r\n Object.setPrototypeOf(this, new.target.prototype);\r\n\r\n // Capture the stack trace (Node.js and Chrome V8 engines)\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, this.constructor);\r\n }\r\n }\r\n}\r\n"],"names":["BaseError","Error","constructor","code","message","metadata","cause","Object","setPrototypeOf","prototype","captureStackTrace"],"
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/base-error.ts"],"sourcesContent":["import type { ErrorCode } from './error-code.js';\r\nimport type { ErrorMetadata } from './error-metadata.js';\r\n\r\n/**\r\n * Error class to create errors\r\n */\r\nexport class BaseError extends Error {\r\n /**\r\n * Unique error code to identify the cause of the error\r\n */\r\n public readonly code: ErrorCode;\r\n\r\n /**\r\n * Metadata to clearify the cuase\r\n */\r\n public readonly metadata?: ErrorMetadata;\r\n\r\n constructor(code: ErrorCode, message: string, metadata?: ErrorMetadata) {\r\n super(message);\r\n this.code = code;\r\n this.metadata = metadata;\r\n this.cause = this.metadata?.cause;\r\n\r\n // Fix prototype chain for proper instanceof checks\r\n Object.setPrototypeOf(this, new.target.prototype);\r\n\r\n // Capture the stack trace (Node.js and Chrome V8 engines)\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, this.constructor);\r\n }\r\n }\r\n}\r\n"],"names":["BaseError","Error","constructor","code","message","metadata","cause","Object","setPrototypeOf","prototype","captureStackTrace"],"mappings":";AAMA,OAAO,MAAMA,kBAAkBC;IAW7BC,YAAYC,CAAe,EAAEC,CAAe,EAAEC,CAAwB,CAAE;YAIzD;QAHb,KAAK,CAACD,IARR,QAAgBD,QAAhB,KAAA,IAKA,QAAgBE,YAAhB,KAAA,IAIE,IAAI,CAACF,IAAI,GAAGA,GACZ,IAAI,CAACE,QAAQ,GAAGA,GAChB,IAAI,CAACC,KAAK,aAAG,IAAA,IAAI,CAACD,QAAQ,gBAAb,aAAA,EAAeC,KAAK,EAGjCC,OAAOC,cAAc,CAAC,IAAI,EAAE,WAAWC,SAAS,GAG5CR,MAAMS,iBAAiB,IACzBT,MAAMS,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAACR,WAAW;IAElD;AACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-thrower.d.ts","sourceRoot":"","sources":["../../../src/lib/common/create-thrower.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"create-thrower.d.ts","sourceRoot":"","sources":["../../../src/lib/common/create-thrower.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,OAAO,SAAkB,GACxB,YAAY,CAOd"}
|
@@ -1,13 +1,8 @@
|
|
1
|
-
import { BaseError } from './base-error.js';
|
2
|
-
import { ErrorCode } from './error-code.js';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
* @param message
|
7
|
-
* @returns
|
8
|
-
*/ export function createThrower(code, message = ErrorCode[code]) {
|
9
|
-
return function throwError(errorMessage = message, metadata) {
|
10
|
-
throw new BaseError(code, errorMessage, metadata);
|
1
|
+
import { BaseError as r } from './base-error.js';
|
2
|
+
import { ErrorCode as o } from './error-code.js';
|
3
|
+
export function createThrower(e, t = o[e]) {
|
4
|
+
return function(o = t, n) {
|
5
|
+
throw new r(e, o, n);
|
11
6
|
};
|
12
7
|
}
|
13
8
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/create-thrower.ts"],"sourcesContent":["import { BaseError } from './base-error.js';\r\nimport { ErrorCode } from './error-code.js';\r\nimport { ErrorMetadata } from './error-metadata.js';\r\nimport { ErrorThrower } from './error-thrower.js';\r\n\r\n/**\r\n * Create a function that always throws the desired error code and error message\r\n * @param code\r\n * @param message\r\n * @returns\r\n */\r\nexport function createThrower(\r\n code: ErrorCode,\r\n message = ErrorCode[code]
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/create-thrower.ts"],"sourcesContent":["import { BaseError } from './base-error.js';\r\nimport { ErrorCode } from './error-code.js';\r\nimport type { ErrorMetadata } from './error-metadata.js';\r\nimport type { ErrorThrower } from './error-thrower.js';\r\n\r\n/**\r\n * Create a function that always throws the desired error code and error message\r\n * @param code\r\n * @param message\r\n * @returns\r\n */\r\nexport function createThrower(\r\n code: ErrorCode,\r\n message = ErrorCode[code],\r\n): ErrorThrower {\r\n return function throwError(\r\n errorMessage = message,\r\n metadata?: ErrorMetadata,\r\n ): never {\r\n throw new BaseError(code, errorMessage, metadata);\r\n };\r\n}\r\n"],"names":["BaseError","ErrorCode","createThrower","code","message","errorMessage","metadata"],"mappings":"AAAA,SAASA,aAAAA,CAAS,QAAQ,kBAAkB;AAC5C,SAASC,aAAAA,CAAS,QAAQ,kBAAkB;AAU5C,OAAO,SAASC,cACdC,CAAe,EACfC,IAAUH,CAAS,CAACE,EAAK;IAEzB,OAAO,SACLE,IAAeD,CAAO,EACtBE,CAAwB;QAExB,MAAM,IAAIN,EAAUG,GAAME,GAAcC;IAC1C;AACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-throwers.d.ts","sourceRoot":"","sources":["../../../src/lib/common/create-throwers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"create-throwers.d.ts","sourceRoot":"","sources":["../../../src/lib/common/create-throwers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAa7D"}
|
@@ -1,16 +1,10 @@
|
|
1
|
-
import { _ as
|
2
|
-
import { createThrower } from './create-thrower.js';
|
3
|
-
import { ErrorCode } from './error-code.js';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
return Object.values(ErrorCode).filter((e)=>typeof e === 'string').map((e)=>{
|
9
|
-
return {
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
11
|
-
[e]: createThrower(ErrorCode[e])
|
12
|
-
};
|
13
|
-
}).reduce((p, c)=>_extends({}, p, c), {});
|
1
|
+
import { _ as r } from "@swc/helpers/_/_object_spread";
|
2
|
+
import { createThrower as e } from './create-thrower.js';
|
3
|
+
import { ErrorCode as o } from './error-code.js';
|
4
|
+
export function createThrowers() {
|
5
|
+
return Object.values(o).filter((r)=>'string' == typeof r).map((r)=>({
|
6
|
+
[r]: e(o[r])
|
7
|
+
})).reduce((e, o)=>r({}, e, o), {});
|
14
8
|
}
|
15
9
|
|
16
10
|
//# sourceMappingURL=create-throwers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/create-throwers.ts"],"sourcesContent":["import { createThrower } from './create-thrower.js';\r\nimport { ErrorCode } from './error-code.js';\r\nimport { ErrorThrower } from './error-thrower.js';\r\n\r\n/**\r\n * Create {@link ErrorThrower}s and map them by corresponding key.\r\n * @returns\r\n */\r\nexport function createThrowers(): Record<string, ErrorThrower> {\r\n return Object.values(ErrorCode)\r\n .filter((e) => typeof e === 'string')\r\n .map((e: string) => {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n [e]: createThrower((ErrorCode as any)[e]),\r\n };\r\n })\r\n .reduce((p, c) => ({ ...p, ...c }), {}) as unknown as Record<\r\n string,\r\n ErrorThrower\r\n > as Record<string, ErrorThrower>;\r\n}\r\n"],"names":["createThrower","ErrorCode","createThrowers","Object","values","filter","e","map","reduce","p","c"],"
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/create-throwers.ts"],"sourcesContent":["import { createThrower } from './create-thrower.js';\r\nimport { ErrorCode } from './error-code.js';\r\nimport type { ErrorThrower } from './error-thrower.js';\r\n\r\n/**\r\n * Create {@link ErrorThrower}s and map them by corresponding key.\r\n * @returns\r\n */\r\nexport function createThrowers(): Record<string, ErrorThrower> {\r\n return Object.values(ErrorCode)\r\n .filter((e) => typeof e === 'string')\r\n .map((e: string) => {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n [e]: createThrower((ErrorCode as any)[e]),\r\n };\r\n })\r\n .reduce((p, c) => ({ ...p, ...c }), {}) as unknown as Record<\r\n string,\r\n ErrorThrower\r\n > as Record<string, ErrorThrower>;\r\n}\r\n"],"names":["createThrower","ErrorCode","createThrowers","Object","values","filter","e","map","reduce","p","c"],"mappings":";AAAA,SAASA,iBAAAA,CAAa,QAAQ,sBAAsB;AACpD,SAASC,aAAAA,CAAS,QAAQ,kBAAkB;AAO5C,OAAO,SAASC;IACd,OAAOC,OAAOC,MAAM,CAACH,GAClBI,MAAM,CAAC,CAACC,IAAM,AAAa,YAAb,OAAOA,GACrBC,GAAG,CAAC,CAACD,IACG,CAAA;YAEL,CAACA,EAAE,EAAEN,EAAc,AAACC,CAAiB,CAACK,EAAE;QAC1C,CAAA,GAEDE,MAAM,CAAC,CAACC,GAAGC,IAAO,MAAKD,GAAMC,IAAM,CAAC;AAIzC"}
|
@@ -1,139 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
*/ export var ErrorCode;
|
4
|
-
(function(ErrorCode) {
|
5
|
-
/**
|
6
|
-
* Unauthorized access attempt
|
7
|
-
*/ ErrorCode[ErrorCode["Unauthorized"] = 1000] = "Unauthorized";
|
8
|
-
/**
|
9
|
-
* Session does not exist or expired
|
10
|
-
*/ ErrorCode[ErrorCode["SessionNotFound"] = 1001] = "SessionNotFound";
|
11
|
-
/**
|
12
|
-
* Invalid token provided
|
13
|
-
*/ ErrorCode[ErrorCode["InvalidToken"] = 1002] = "InvalidToken";
|
14
|
-
/**
|
15
|
-
* Token has expired
|
16
|
-
*/ ErrorCode[ErrorCode["ExpiredToken"] = 1003] = "ExpiredToken";
|
17
|
-
/**
|
18
|
-
* File could not be found
|
19
|
-
*/ ErrorCode[ErrorCode["FileNotFound"] = 1100] = "FileNotFound";
|
20
|
-
/**
|
21
|
-
* Directory does not exist
|
22
|
-
*/ ErrorCode[ErrorCode["DirectoryNotFound"] = 1101] = "DirectoryNotFound";
|
23
|
-
/**
|
24
|
-
* Attempted operation is out of allowable scope
|
25
|
-
*/ ErrorCode[ErrorCode["OutOfScope"] = 1102] = "OutOfScope";
|
26
|
-
/**
|
27
|
-
* System is offline or unreachable
|
28
|
-
*/ ErrorCode[ErrorCode["SystemOffline"] = 3000] = "SystemOffline";
|
29
|
-
/**
|
30
|
-
* System is experiencing low latency issues
|
31
|
-
*/ ErrorCode[ErrorCode["LowLatency"] = 3001] = "LowLatency";
|
32
|
-
/**
|
33
|
-
* A required field is missing
|
34
|
-
*/ ErrorCode[ErrorCode["RequiredFieldMissing"] = 5000] = "RequiredFieldMissing";
|
35
|
-
/**
|
36
|
-
* Invalid string value provided
|
37
|
-
*/ ErrorCode[ErrorCode["InvalidString"] = 5001] = "InvalidString";
|
38
|
-
/**
|
39
|
-
* Invalid number provided
|
40
|
-
*/ ErrorCode[ErrorCode["InvalidNumber"] = 5002] = "InvalidNumber";
|
41
|
-
/**
|
42
|
-
* Invalid integer value provided
|
43
|
-
*/ ErrorCode[ErrorCode["InvalidInteger"] = 5003] = "InvalidInteger";
|
44
|
-
/**
|
45
|
-
* Invalid boolean value provided
|
46
|
-
*/ ErrorCode[ErrorCode["InvalidBoolean"] = 5004] = "InvalidBoolean";
|
47
|
-
/**
|
48
|
-
* Invalid object provided
|
49
|
-
*/ ErrorCode[ErrorCode["InvalidObject"] = 5005] = "InvalidObject";
|
50
|
-
/**
|
51
|
-
* Invalid array provided
|
52
|
-
*/ ErrorCode[ErrorCode["InvalidArray"] = 5006] = "InvalidArray";
|
53
|
-
/**
|
54
|
-
* Invalid array of strings
|
55
|
-
*/ ErrorCode[ErrorCode["InvalidArrayString"] = 5007] = "InvalidArrayString";
|
56
|
-
/**
|
57
|
-
* Invalid array of numbers
|
58
|
-
*/ ErrorCode[ErrorCode["InvalidArrayNumber"] = 5008] = "InvalidArrayNumber";
|
59
|
-
/**
|
60
|
-
* Invalid array of integers
|
61
|
-
*/ ErrorCode[ErrorCode["InvalidArrayInteger"] = 5009] = "InvalidArrayInteger";
|
62
|
-
/**
|
63
|
-
* Invalid array of booleans
|
64
|
-
*/ ErrorCode[ErrorCode["InvalidArrayBoolean"] = 5010] = "InvalidArrayBoolean";
|
65
|
-
/**
|
66
|
-
* Invalid array of objects
|
67
|
-
*/ ErrorCode[ErrorCode["InvalidArrayObject"] = 5011] = "InvalidArrayObject";
|
68
|
-
/**
|
69
|
-
* Missing required string field
|
70
|
-
*/ ErrorCode[ErrorCode["RequiredString"] = 5012] = "RequiredString";
|
71
|
-
/**
|
72
|
-
* Missing required number field
|
73
|
-
*/ ErrorCode[ErrorCode["RequiredNumber"] = 5013] = "RequiredNumber";
|
74
|
-
/**
|
75
|
-
* Missing required integer field
|
76
|
-
*/ ErrorCode[ErrorCode["RequiredInteger"] = 5014] = "RequiredInteger";
|
77
|
-
/**
|
78
|
-
* Missing required boolean field
|
79
|
-
*/ ErrorCode[ErrorCode["RequiredBoolean"] = 5015] = "RequiredBoolean";
|
80
|
-
/**
|
81
|
-
* Missing required object field
|
82
|
-
*/ ErrorCode[ErrorCode["RequiredObject"] = 5016] = "RequiredObject";
|
83
|
-
/**
|
84
|
-
* Missing required array field
|
85
|
-
*/ ErrorCode[ErrorCode["RequiredArray"] = 5017] = "RequiredArray";
|
86
|
-
/**
|
87
|
-
* Field cannot be empty
|
88
|
-
*/ ErrorCode[ErrorCode["EmptyField"] = 5100] = "EmptyField";
|
89
|
-
/**
|
90
|
-
* String field is empty
|
91
|
-
*/ ErrorCode[ErrorCode["EmptyString"] = 5101] = "EmptyString";
|
92
|
-
/**
|
93
|
-
* Number field is empty
|
94
|
-
*/ ErrorCode[ErrorCode["EmptyNumber"] = 5102] = "EmptyNumber";
|
95
|
-
/**
|
96
|
-
* Integer field is empty
|
97
|
-
*/ ErrorCode[ErrorCode["EmptyInteger"] = 5103] = "EmptyInteger";
|
98
|
-
/**
|
99
|
-
* Boolean field is empty
|
100
|
-
*/ ErrorCode[ErrorCode["EmptyBoolean"] = 5104] = "EmptyBoolean";
|
101
|
-
/**
|
102
|
-
* Object field is empty
|
103
|
-
*/ ErrorCode[ErrorCode["EmptyObject"] = 5105] = "EmptyObject";
|
104
|
-
/**
|
105
|
-
* Array field is empty
|
106
|
-
*/ ErrorCode[ErrorCode["EmptyArray"] = 5106] = "EmptyArray";
|
107
|
-
/**
|
108
|
-
* Field value is invalid
|
109
|
-
*/ ErrorCode[ErrorCode["InvalidField"] = 5200] = "InvalidField";
|
110
|
-
/**
|
111
|
-
* Value is shorter than minimum length
|
112
|
-
*/ ErrorCode[ErrorCode["MinLength"] = 5201] = "MinLength";
|
113
|
-
/**
|
114
|
-
* Value exceeds maximum length
|
115
|
-
*/ ErrorCode[ErrorCode["MaxLength"] = 5202] = "MaxLength";
|
116
|
-
/**
|
117
|
-
* Number is less than the minimum
|
118
|
-
*/ ErrorCode[ErrorCode["MinNumber"] = 5203] = "MinNumber";
|
119
|
-
/**
|
120
|
-
* Number exceeds the maximum
|
121
|
-
*/ ErrorCode[ErrorCode["MaxNumber"] = 5204] = "MaxNumber";
|
122
|
-
/**
|
123
|
-
* Array has fewer items than the minimum
|
124
|
-
*/ ErrorCode[ErrorCode["MinArraySize"] = 5205] = "MinArraySize";
|
125
|
-
/**
|
126
|
-
* Array exceeds the maximum size
|
127
|
-
*/ ErrorCode[ErrorCode["MaxArraySize"] = 5206] = "MaxArraySize";
|
128
|
-
/**
|
129
|
-
* Missing required property in object
|
130
|
-
*/ ErrorCode[ErrorCode["MissingProperty"] = 5207] = "MissingProperty";
|
131
|
-
/**
|
132
|
-
* Object has fewer properties than the minimum
|
133
|
-
*/ ErrorCode[ErrorCode["MinProperties"] = 5208] = "MinProperties";
|
134
|
-
/**
|
135
|
-
* Object exceeds the maximum number of properties
|
136
|
-
*/ ErrorCode[ErrorCode["MaxProperties"] = 5209] = "MaxProperties";
|
137
|
-
})(ErrorCode || (ErrorCode = {}));
|
1
|
+
var e;
|
2
|
+
export var ErrorCode = ((e = {})[e.Unauthorized = 1000] = "Unauthorized", e[e.SessionNotFound = 1001] = "SessionNotFound", e[e.InvalidToken = 1002] = "InvalidToken", e[e.ExpiredToken = 1003] = "ExpiredToken", e[e.FileNotFound = 1100] = "FileNotFound", e[e.DirectoryNotFound = 1101] = "DirectoryNotFound", e[e.OutOfScope = 1102] = "OutOfScope", e[e.SystemOffline = 3000] = "SystemOffline", e[e.LowLatency = 3001] = "LowLatency", e[e.RequiredFieldMissing = 5000] = "RequiredFieldMissing", e[e.InvalidString = 5001] = "InvalidString", e[e.InvalidNumber = 5002] = "InvalidNumber", e[e.InvalidInteger = 5003] = "InvalidInteger", e[e.InvalidBoolean = 5004] = "InvalidBoolean", e[e.InvalidObject = 5005] = "InvalidObject", e[e.InvalidArray = 5006] = "InvalidArray", e[e.InvalidArrayString = 5007] = "InvalidArrayString", e[e.InvalidArrayNumber = 5008] = "InvalidArrayNumber", e[e.InvalidArrayInteger = 5009] = "InvalidArrayInteger", e[e.InvalidArrayBoolean = 5010] = "InvalidArrayBoolean", e[e.InvalidArrayObject = 5011] = "InvalidArrayObject", e[e.RequiredString = 5012] = "RequiredString", e[e.RequiredNumber = 5013] = "RequiredNumber", e[e.RequiredInteger = 5014] = "RequiredInteger", e[e.RequiredBoolean = 5015] = "RequiredBoolean", e[e.RequiredObject = 5016] = "RequiredObject", e[e.RequiredArray = 5017] = "RequiredArray", e[e.EmptyField = 5100] = "EmptyField", e[e.EmptyString = 5101] = "EmptyString", e[e.EmptyNumber = 5102] = "EmptyNumber", e[e.EmptyInteger = 5103] = "EmptyInteger", e[e.EmptyBoolean = 5104] = "EmptyBoolean", e[e.EmptyObject = 5105] = "EmptyObject", e[e.EmptyArray = 5106] = "EmptyArray", e[e.InvalidField = 5200] = "InvalidField", e[e.MinLength = 5201] = "MinLength", e[e.MaxLength = 5202] = "MaxLength", e[e.MinNumber = 5203] = "MinNumber", e[e.MaxNumber = 5204] = "MaxNumber", e[e.MinArraySize = 5205] = "MinArraySize", e[e.MaxArraySize = 5206] = "MaxArraySize", e[e.MissingProperty = 5207] = "MissingProperty", e[e.MinProperties = 5208] = "MinProperties", e[e.MaxProperties = 5209] = "MaxProperties", e);
|
138
3
|
|
139
4
|
//# sourceMappingURL=error-code.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/error-code.ts"],"sourcesContent":["/**\r\n * Error codes\r\n */\r\nexport enum ErrorCode {\r\n /**\r\n * Unauthorized access attempt\r\n */\r\n Unauthorized = 1000,\r\n\r\n /**\r\n * Session does not exist or expired\r\n */\r\n SessionNotFound,\r\n\r\n /**\r\n * Invalid token provided\r\n */\r\n InvalidToken,\r\n\r\n /**\r\n * Token has expired\r\n */\r\n ExpiredToken,\r\n\r\n /**\r\n * File could not be found\r\n */\r\n FileNotFound = 1100,\r\n\r\n /**\r\n * Directory does not exist\r\n */\r\n DirectoryNotFound,\r\n\r\n /**\r\n * Attempted operation is out of allowable scope\r\n */\r\n OutOfScope,\r\n\r\n /**\r\n * System is offline or unreachable\r\n */\r\n SystemOffline = 3000,\r\n\r\n /**\r\n * System is experiencing low latency issues\r\n */\r\n LowLatency,\r\n\r\n /**\r\n * A required field is missing\r\n */\r\n RequiredFieldMissing = 5000,\r\n\r\n /**\r\n * Invalid string value provided\r\n */\r\n InvalidString,\r\n\r\n /**\r\n * Invalid number provided\r\n */\r\n InvalidNumber,\r\n\r\n /**\r\n * Invalid integer value provided\r\n */\r\n InvalidInteger,\r\n\r\n /**\r\n * Invalid boolean value provided\r\n */\r\n InvalidBoolean,\r\n\r\n /**\r\n * Invalid object provided\r\n */\r\n InvalidObject,\r\n\r\n /**\r\n * Invalid array provided\r\n */\r\n InvalidArray,\r\n\r\n /**\r\n * Invalid array of strings\r\n */\r\n InvalidArrayString,\r\n\r\n /**\r\n * Invalid array of numbers\r\n */\r\n InvalidArrayNumber,\r\n\r\n /**\r\n * Invalid array of integers\r\n */\r\n InvalidArrayInteger,\r\n\r\n /**\r\n * Invalid array of booleans\r\n */\r\n InvalidArrayBoolean,\r\n\r\n /**\r\n * Invalid array of objects\r\n */\r\n InvalidArrayObject,\r\n\r\n /**\r\n * Missing required string field\r\n */\r\n RequiredString,\r\n\r\n /**\r\n * Missing required number field\r\n */\r\n RequiredNumber,\r\n\r\n /**\r\n * Missing required integer field\r\n */\r\n RequiredInteger,\r\n\r\n /**\r\n * Missing required boolean field\r\n */\r\n RequiredBoolean,\r\n\r\n /**\r\n * Missing required object field\r\n */\r\n RequiredObject,\r\n\r\n /**\r\n * Missing required array field\r\n */\r\n RequiredArray,\r\n\r\n /**\r\n * Field cannot be empty\r\n */\r\n EmptyField = 5100,\r\n\r\n /**\r\n * String field is empty\r\n */\r\n EmptyString,\r\n\r\n /**\r\n * Number field is empty\r\n */\r\n EmptyNumber,\r\n\r\n /**\r\n * Integer field is empty\r\n */\r\n EmptyInteger,\r\n\r\n /**\r\n * Boolean field is empty\r\n */\r\n EmptyBoolean,\r\n\r\n /**\r\n * Object field is empty\r\n */\r\n EmptyObject,\r\n\r\n /**\r\n * Array field is empty\r\n */\r\n EmptyArray,\r\n\r\n /**\r\n * Field value is invalid\r\n */\r\n InvalidField = 5200,\r\n\r\n /**\r\n * Value is shorter than minimum length\r\n */\r\n MinLength,\r\n\r\n /**\r\n * Value exceeds maximum length\r\n */\r\n MaxLength,\r\n\r\n /**\r\n * Number is less than the minimum\r\n */\r\n MinNumber,\r\n\r\n /**\r\n * Number exceeds the maximum\r\n */\r\n MaxNumber,\r\n\r\n /**\r\n * Array has fewer items than the minimum\r\n */\r\n MinArraySize,\r\n\r\n /**\r\n * Array exceeds the maximum size\r\n */\r\n MaxArraySize,\r\n\r\n /**\r\n * Missing required property in object\r\n */\r\n MissingProperty,\r\n\r\n /**\r\n * Object has fewer properties than the minimum\r\n */\r\n MinProperties,\r\n\r\n /**\r\n * Object exceeds the maximum number of properties\r\n */\r\n MaxProperties,\r\n}\r\n"],"names":["ErrorCode"],"
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/error-code.ts"],"sourcesContent":["/**\r\n * Error codes\r\n */\r\nexport enum ErrorCode {\r\n /**\r\n * Unauthorized access attempt\r\n */\r\n Unauthorized = 1000,\r\n\r\n /**\r\n * Session does not exist or expired\r\n */\r\n SessionNotFound,\r\n\r\n /**\r\n * Invalid token provided\r\n */\r\n InvalidToken,\r\n\r\n /**\r\n * Token has expired\r\n */\r\n ExpiredToken,\r\n\r\n /**\r\n * File could not be found\r\n */\r\n FileNotFound = 1100,\r\n\r\n /**\r\n * Directory does not exist\r\n */\r\n DirectoryNotFound,\r\n\r\n /**\r\n * Attempted operation is out of allowable scope\r\n */\r\n OutOfScope,\r\n\r\n /**\r\n * System is offline or unreachable\r\n */\r\n SystemOffline = 3000,\r\n\r\n /**\r\n * System is experiencing low latency issues\r\n */\r\n LowLatency,\r\n\r\n /**\r\n * A required field is missing\r\n */\r\n RequiredFieldMissing = 5000,\r\n\r\n /**\r\n * Invalid string value provided\r\n */\r\n InvalidString,\r\n\r\n /**\r\n * Invalid number provided\r\n */\r\n InvalidNumber,\r\n\r\n /**\r\n * Invalid integer value provided\r\n */\r\n InvalidInteger,\r\n\r\n /**\r\n * Invalid boolean value provided\r\n */\r\n InvalidBoolean,\r\n\r\n /**\r\n * Invalid object provided\r\n */\r\n InvalidObject,\r\n\r\n /**\r\n * Invalid array provided\r\n */\r\n InvalidArray,\r\n\r\n /**\r\n * Invalid array of strings\r\n */\r\n InvalidArrayString,\r\n\r\n /**\r\n * Invalid array of numbers\r\n */\r\n InvalidArrayNumber,\r\n\r\n /**\r\n * Invalid array of integers\r\n */\r\n InvalidArrayInteger,\r\n\r\n /**\r\n * Invalid array of booleans\r\n */\r\n InvalidArrayBoolean,\r\n\r\n /**\r\n * Invalid array of objects\r\n */\r\n InvalidArrayObject,\r\n\r\n /**\r\n * Missing required string field\r\n */\r\n RequiredString,\r\n\r\n /**\r\n * Missing required number field\r\n */\r\n RequiredNumber,\r\n\r\n /**\r\n * Missing required integer field\r\n */\r\n RequiredInteger,\r\n\r\n /**\r\n * Missing required boolean field\r\n */\r\n RequiredBoolean,\r\n\r\n /**\r\n * Missing required object field\r\n */\r\n RequiredObject,\r\n\r\n /**\r\n * Missing required array field\r\n */\r\n RequiredArray,\r\n\r\n /**\r\n * Field cannot be empty\r\n */\r\n EmptyField = 5100,\r\n\r\n /**\r\n * String field is empty\r\n */\r\n EmptyString,\r\n\r\n /**\r\n * Number field is empty\r\n */\r\n EmptyNumber,\r\n\r\n /**\r\n * Integer field is empty\r\n */\r\n EmptyInteger,\r\n\r\n /**\r\n * Boolean field is empty\r\n */\r\n EmptyBoolean,\r\n\r\n /**\r\n * Object field is empty\r\n */\r\n EmptyObject,\r\n\r\n /**\r\n * Array field is empty\r\n */\r\n EmptyArray,\r\n\r\n /**\r\n * Field value is invalid\r\n */\r\n InvalidField = 5200,\r\n\r\n /**\r\n * Value is shorter than minimum length\r\n */\r\n MinLength,\r\n\r\n /**\r\n * Value exceeds maximum length\r\n */\r\n MaxLength,\r\n\r\n /**\r\n * Number is less than the minimum\r\n */\r\n MinNumber,\r\n\r\n /**\r\n * Number exceeds the maximum\r\n */\r\n MaxNumber,\r\n\r\n /**\r\n * Array has fewer items than the minimum\r\n */\r\n MinArraySize,\r\n\r\n /**\r\n * Array exceeds the maximum size\r\n */\r\n MaxArraySize,\r\n\r\n /**\r\n * Missing required property in object\r\n */\r\n MissingProperty,\r\n\r\n /**\r\n * Object has fewer properties than the minimum\r\n */\r\n MinProperties,\r\n\r\n /**\r\n * Object exceeds the maximum number of properties\r\n */\r\n MaxProperties,\r\n}\r\n"],"names":["ErrorCode"],"mappings":"IAGYA;AAAZ,OAAO,IAAA,AAAKA,cAAAA,g9DAAAA,GA4NX"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/error-metadata.ts"],"
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/error-metadata.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"error-thrower.d.ts","sourceRoot":"","sources":["../../../src/lib/common/error-thrower.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
1
|
+
{"version":3,"file":"error-thrower.d.ts","sourceRoot":"","sources":["../../../src/lib/common/error-thrower.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,aAAa,KACrB,KAAK,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/error-thrower.ts"],"
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/error-thrower.ts"],"names":[],"mappings":""}
|
package/dist/lib/throwers-map.js
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
import { createThrowers } from './common/
|
2
|
-
|
3
|
-
* Mapped throwers
|
4
|
-
*/ export const { Unauthorized: throwUnauthorizedError, SessionNotFound: throwSessionNotFoundError, InvalidToken: throwInvalidTokenError, ExpiredToken: throwExpiredTokenError, FileNotFound: throwFileNotFoundError, DirectoryNotFound: throwDirectoryNotFoundError, OutOfScope: throwOutOfScopeError, SystemOffline: throwSystemOfflineError, LowLatency: throwLowLatencyError, RequiredFieldMissing: throwRequiredFieldMissingError, InvalidString: throwInvalidStringError, InvalidNumber: throwInvalidNumberError, InvalidInteger: throwInvalidIntegerError, InvalidBoolean: throwInvalidBooleanError, InvalidObject: throwInvalidObjectError, InvalidArray: throwInvalidArrayError, InvalidArrayString: throwInvalidArrayStringError, InvalidArrayNumber: throwInvalidArrayNumberError, InvalidArrayInteger: throwInvalidArrayIntegerError, InvalidArrayBoolean: throwInvalidArrayBooleanError, InvalidArrayObject: throwInvalidArrayObjectError, RequiredString: throwRequiredStringError, RequiredNumber: throwRequiredNumberError, RequiredInteger: throwRequiredIntegerError, RequiredBoolean: throwRequiredBooleanError, RequiredObject: throwRequiredObjectError, RequiredArray: throwRequiredArrayError, EmptyField: throwEmptyFieldError, EmptyString: throwEmptyStringError, EmptyNumber: throwEmptyNumberError, EmptyInteger: throwEmptyIntegerError, EmptyBoolean: throwEmptyBooleanError, EmptyObject: throwEmptyObjectError, EmptyArray: throwEmptyArrayError, InvalidField: throwInvalidFieldError, MinLength: throwMinLengthError, MaxLength: throwMaxLengthError, MinNumber: throwMinNumberError, MaxNumber: throwMaxNumberError, MinArraySize: throwMinArraySizeError, MaxArraySize: throwMaxArraySizeError, MissingProperty: throwMissingPropertyError, MinProperties: throwMinPropertiesError, MaxProperties: throwMaxPropertiesError } = createThrowers();
|
1
|
+
import { createThrowers as r } from './common/create-throwers.js';
|
2
|
+
export const { Unauthorized: throwUnauthorizedError, SessionNotFound: throwSessionNotFoundError, InvalidToken: throwInvalidTokenError, ExpiredToken: throwExpiredTokenError, FileNotFound: throwFileNotFoundError, DirectoryNotFound: throwDirectoryNotFoundError, OutOfScope: throwOutOfScopeError, SystemOffline: throwSystemOfflineError, LowLatency: throwLowLatencyError, RequiredFieldMissing: throwRequiredFieldMissingError, InvalidString: throwInvalidStringError, InvalidNumber: throwInvalidNumberError, InvalidInteger: throwInvalidIntegerError, InvalidBoolean: throwInvalidBooleanError, InvalidObject: throwInvalidObjectError, InvalidArray: throwInvalidArrayError, InvalidArrayString: throwInvalidArrayStringError, InvalidArrayNumber: throwInvalidArrayNumberError, InvalidArrayInteger: throwInvalidArrayIntegerError, InvalidArrayBoolean: throwInvalidArrayBooleanError, InvalidArrayObject: throwInvalidArrayObjectError, RequiredString: throwRequiredStringError, RequiredNumber: throwRequiredNumberError, RequiredInteger: throwRequiredIntegerError, RequiredBoolean: throwRequiredBooleanError, RequiredObject: throwRequiredObjectError, RequiredArray: throwRequiredArrayError, EmptyField: throwEmptyFieldError, EmptyString: throwEmptyStringError, EmptyNumber: throwEmptyNumberError, EmptyInteger: throwEmptyIntegerError, EmptyBoolean: throwEmptyBooleanError, EmptyObject: throwEmptyObjectError, EmptyArray: throwEmptyArrayError, InvalidField: throwInvalidFieldError, MinLength: throwMinLengthError, MaxLength: throwMaxLengthError, MinNumber: throwMinNumberError, MaxNumber: throwMaxNumberError, MinArraySize: throwMinArraySizeError, MaxArraySize: throwMaxArraySizeError, MissingProperty: throwMissingPropertyError, MinProperties: throwMinPropertiesError, MaxProperties: throwMaxPropertiesError } = r();
|
5
3
|
|
6
4
|
//# sourceMappingURL=throwers-map.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/lib/throwers-map.ts"],"sourcesContent":["import { createThrowers } from './common/
|
1
|
+
{"version":3,"sources":["../../src/lib/throwers-map.ts"],"sourcesContent":["import { createThrowers } from './common/create-throwers.js';\r\n\r\n/**\r\n * Mapped throwers\r\n */\r\nexport const {\r\n Unauthorized: throwUnauthorizedError,\r\n SessionNotFound: throwSessionNotFoundError,\r\n InvalidToken: throwInvalidTokenError,\r\n ExpiredToken: throwExpiredTokenError,\r\n FileNotFound: throwFileNotFoundError,\r\n DirectoryNotFound: throwDirectoryNotFoundError,\r\n OutOfScope: throwOutOfScopeError,\r\n SystemOffline: throwSystemOfflineError,\r\n LowLatency: throwLowLatencyError,\r\n RequiredFieldMissing: throwRequiredFieldMissingError,\r\n InvalidString: throwInvalidStringError,\r\n InvalidNumber: throwInvalidNumberError,\r\n InvalidInteger: throwInvalidIntegerError,\r\n InvalidBoolean: throwInvalidBooleanError,\r\n InvalidObject: throwInvalidObjectError,\r\n InvalidArray: throwInvalidArrayError,\r\n InvalidArrayString: throwInvalidArrayStringError,\r\n InvalidArrayNumber: throwInvalidArrayNumberError,\r\n InvalidArrayInteger: throwInvalidArrayIntegerError,\r\n InvalidArrayBoolean: throwInvalidArrayBooleanError,\r\n InvalidArrayObject: throwInvalidArrayObjectError,\r\n RequiredString: throwRequiredStringError,\r\n RequiredNumber: throwRequiredNumberError,\r\n RequiredInteger: throwRequiredIntegerError,\r\n RequiredBoolean: throwRequiredBooleanError,\r\n RequiredObject: throwRequiredObjectError,\r\n RequiredArray: throwRequiredArrayError,\r\n EmptyField: throwEmptyFieldError,\r\n EmptyString: throwEmptyStringError,\r\n EmptyNumber: throwEmptyNumberError,\r\n EmptyInteger: throwEmptyIntegerError,\r\n EmptyBoolean: throwEmptyBooleanError,\r\n EmptyObject: throwEmptyObjectError,\r\n EmptyArray: throwEmptyArrayError,\r\n InvalidField: throwInvalidFieldError,\r\n MinLength: throwMinLengthError,\r\n MaxLength: throwMaxLengthError,\r\n MinNumber: throwMinNumberError,\r\n MaxNumber: throwMaxNumberError,\r\n MinArraySize: throwMinArraySizeError,\r\n MaxArraySize: throwMaxArraySizeError,\r\n MissingProperty: throwMissingPropertyError,\r\n MinProperties: throwMinPropertiesError,\r\n MaxProperties: throwMaxPropertiesError,\r\n} = createThrowers();\r\n"],"names":["createThrowers","Unauthorized","throwUnauthorizedError","SessionNotFound","throwSessionNotFoundError","InvalidToken","throwInvalidTokenError","ExpiredToken","throwExpiredTokenError","FileNotFound","throwFileNotFoundError","DirectoryNotFound","throwDirectoryNotFoundError","OutOfScope","throwOutOfScopeError","SystemOffline","throwSystemOfflineError","LowLatency","throwLowLatencyError","RequiredFieldMissing","throwRequiredFieldMissingError","InvalidString","throwInvalidStringError","InvalidNumber","throwInvalidNumberError","InvalidInteger","throwInvalidIntegerError","InvalidBoolean","throwInvalidBooleanError","InvalidObject","throwInvalidObjectError","InvalidArray","throwInvalidArrayError","InvalidArrayString","throwInvalidArrayStringError","InvalidArrayNumber","throwInvalidArrayNumberError","InvalidArrayInteger","throwInvalidArrayIntegerError","InvalidArrayBoolean","throwInvalidArrayBooleanError","InvalidArrayObject","throwInvalidArrayObjectError","RequiredString","throwRequiredStringError","RequiredNumber","throwRequiredNumberError","RequiredInteger","throwRequiredIntegerError","RequiredBoolean","throwRequiredBooleanError","RequiredObject","throwRequiredObjectError","RequiredArray","throwRequiredArrayError","EmptyField","throwEmptyFieldError","EmptyString","throwEmptyStringError","EmptyNumber","throwEmptyNumberError","EmptyInteger","throwEmptyIntegerError","EmptyBoolean","throwEmptyBooleanError","EmptyObject","throwEmptyObjectError","EmptyArray","throwEmptyArrayError","InvalidField","throwInvalidFieldError","MinLength","throwMinLengthError","MaxLength","throwMaxLengthError","MinNumber","throwMinNumberError","MaxNumber","throwMaxNumberError","MinArraySize","throwMinArraySizeError","MaxArraySize","throwMaxArraySizeError","MissingProperty","throwMissingPropertyError","MinProperties","throwMinPropertiesError","MaxProperties","throwMaxPropertiesError"],"mappings":"AAAA,SAASA,kBAAAA,CAAc,QAAQ,8BAA8B;AAK7D,OAAO,MAAM,EACXC,cAAcC,sBAAsB,EACpCC,iBAAiBC,yBAAyB,EAC1CC,cAAcC,sBAAsB,EACpCC,cAAcC,sBAAsB,EACpCC,cAAcC,sBAAsB,EACpCC,mBAAmBC,2BAA2B,EAC9CC,YAAYC,oBAAoB,EAChCC,eAAeC,uBAAuB,EACtCC,YAAYC,oBAAoB,EAChCC,sBAAsBC,8BAA8B,EACpDC,eAAeC,uBAAuB,EACtCC,eAAeC,uBAAuB,EACtCC,gBAAgBC,wBAAwB,EACxCC,gBAAgBC,wBAAwB,EACxCC,eAAeC,uBAAuB,EACtCC,cAAcC,sBAAsB,EACpCC,oBAAoBC,4BAA4B,EAChDC,oBAAoBC,4BAA4B,EAChDC,qBAAqBC,6BAA6B,EAClDC,qBAAqBC,6BAA6B,EAClDC,oBAAoBC,4BAA4B,EAChDC,gBAAgBC,wBAAwB,EACxCC,gBAAgBC,wBAAwB,EACxCC,iBAAiBC,yBAAyB,EAC1CC,iBAAiBC,yBAAyB,EAC1CC,gBAAgBC,wBAAwB,EACxCC,eAAeC,uBAAuB,EACtCC,YAAYC,oBAAoB,EAChCC,aAAaC,qBAAqB,EAClCC,aAAaC,qBAAqB,EAClCC,cAAcC,sBAAsB,EACpCC,cAAcC,sBAAsB,EACpCC,aAAaC,qBAAqB,EAClCC,YAAYC,oBAAoB,EAChCC,cAAcC,sBAAsB,EACpCC,WAAWC,mBAAmB,EAC9BC,WAAWC,mBAAmB,EAC9BC,WAAWC,mBAAmB,EAC9BC,WAAWC,mBAAmB,EAC9BC,cAAcC,sBAAsB,EACpCC,cAAcC,sBAAsB,EACpCC,iBAAiBC,yBAAyB,EAC1CC,eAAeC,uBAAuB,EACtCC,eAAeC,uBAAuB,EACvC,GAAGxF,IAAiB"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
{
|
2
|
+
"name": "@puq/error",
|
3
|
+
"license": "MIT",
|
4
|
+
"version": "0.3.2",
|
5
|
+
"publishConfig": {
|
6
|
+
"access": "public",
|
7
|
+
"tag": "latest"
|
8
|
+
},
|
9
|
+
"description": "This library provides a structured collection of error functions for handling various error types in your application. Each error function includes a unique error code, a message, and optional metadata, allowing for efficient error tracking and debugging.",
|
10
|
+
"author": {
|
11
|
+
"email": "robert.brightline@gmail.com",
|
12
|
+
"name": "Robert Brightline",
|
13
|
+
"url": "https://rbrightline.github.io"
|
14
|
+
},
|
15
|
+
"keywords": [
|
16
|
+
"puq",
|
17
|
+
"error"
|
18
|
+
],
|
19
|
+
"repository": {
|
20
|
+
"directory": "libs/error",
|
21
|
+
"url": "https://github.com/rbrightline/puq/tree/main",
|
22
|
+
"type": "github"
|
23
|
+
},
|
24
|
+
"homepage": "https://rbrightline.github.io/puq/error",
|
25
|
+
"bugs": {
|
26
|
+
"email": "robert.brightline@gmail.com",
|
27
|
+
"url": "https://rbrightline.github.io"
|
28
|
+
},
|
29
|
+
"categories": [
|
30
|
+
"Other"
|
31
|
+
],
|
32
|
+
"contributors": [
|
33
|
+
{
|
34
|
+
"email": "robert.brightline@gmail.com",
|
35
|
+
"name": "Robert Brightline",
|
36
|
+
"url": "https://rbrightline.github.io"
|
37
|
+
}
|
38
|
+
],
|
39
|
+
"funding": [
|
40
|
+
"https://cash.app/$puqlib"
|
41
|
+
],
|
42
|
+
"icon": "https://raw.githubusercontent.com/rbrightline/puq/refs/heads/main/libs/error/favicon.png",
|
43
|
+
"type": "module",
|
44
|
+
"main": "./dist/index.js",
|
45
|
+
"module": "./dist/index.js",
|
46
|
+
"types": "./dist/index.d.ts",
|
47
|
+
"exports": {
|
48
|
+
"./package.json": "./package.json",
|
49
|
+
".": {
|
50
|
+
"types": "./dist/index.d.ts",
|
51
|
+
"import": "./dist/index.js",
|
52
|
+
"default": "./dist/index.js"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"files": [
|
56
|
+
"dist",
|
57
|
+
"!**/*.tsbuildinfo"
|
58
|
+
],
|
59
|
+
"nx": {
|
60
|
+
"sourceRoot": "libs/error/src",
|
61
|
+
"targets": {
|
62
|
+
"build": {
|
63
|
+
"executor": "@nx/js:swc",
|
64
|
+
"outputs": [
|
65
|
+
"{options.outputPath}"
|
66
|
+
],
|
67
|
+
"options": {
|
68
|
+
"outputPath": "libs/error/dist",
|
69
|
+
"main": "libs/error/src/index.ts",
|
70
|
+
"tsConfig": "libs/error/tsconfig.lib.json",
|
71
|
+
"skipTypeCheck": false,
|
72
|
+
"stripLeadingPaths": true
|
73
|
+
},
|
74
|
+
"dependsOn": [
|
75
|
+
"lint"
|
76
|
+
]
|
77
|
+
},
|
78
|
+
"doc": {
|
79
|
+
"command": "cd libs/error && npx compodoc -d ../../public/error -p tsconfig.lib.json -n error"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
"dependencies": {}
|
84
|
+
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@puq/error",
|
3
3
|
"license": "MIT",
|
4
|
-
"version": "0.3.
|
4
|
+
"version": "0.3.3",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public",
|
7
7
|
"tag": "latest"
|
@@ -70,14 +70,14 @@
|
|
70
70
|
"tsConfig": "libs/error/tsconfig.lib.json",
|
71
71
|
"skipTypeCheck": false,
|
72
72
|
"stripLeadingPaths": true
|
73
|
-
}
|
73
|
+
},
|
74
|
+
"dependsOn": [
|
75
|
+
"lint"
|
76
|
+
]
|
74
77
|
},
|
75
78
|
"doc": {
|
76
79
|
"command": "cd libs/error && npx compodoc -d ../../public/error -p tsconfig.lib.json -n error"
|
77
80
|
}
|
78
81
|
}
|
79
|
-
},
|
80
|
-
"devDependencies": {
|
81
|
-
"@swc/helpers": "~0.5.11"
|
82
82
|
}
|
83
83
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/lib/common/index.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)
|
2
|
-
export * from './base-error.js';
|
3
|
-
export * from './create-thrower.js';
|
4
|
-
export * from './create-throwers.js';
|
5
|
-
export * from './error-code.js';
|
6
|
-
export * from './error-metadata.js';
|
7
|
-
|
8
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/common/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)\r\nexport * from './base-error.js';\r\nexport * from './create-thrower.js';\r\nexport * from './create-throwers.js';\r\nexport * from './error-code.js';\r\nexport * from './error-metadata.js';\r\n"],"names":[],"rangeMappings":";;;;;","mappings":"AAAA,wGAAwG;AACxG,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,uBAAuB;AACrC,cAAc,kBAAkB;AAChC,cAAc,sBAAsB"}
|