@org-quicko/core 1.1.1 → 2.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 (66) hide show
  1. package/README.md +7 -7
  2. package/dist/browser/beans/BaseObject.js.map +1 -1
  3. package/dist/browser/exceptions/BadRequestException.js.map +1 -1
  4. package/dist/browser/exceptions/BaseException.js +1 -21
  5. package/dist/browser/exceptions/BaseException.js.map +1 -1
  6. package/dist/browser/exceptions/ClientException.js.map +1 -1
  7. package/dist/browser/exceptions/ConverterException.js.map +1 -1
  8. package/dist/browser/exceptions/ForbiddenAccessException.js.map +1 -1
  9. package/dist/browser/exceptions/HTTPException.js.map +1 -1
  10. package/dist/browser/exceptions/IllegalArgumentException.js.map +1 -1
  11. package/dist/browser/exceptions/UnauthorizedException.js.map +1 -1
  12. package/dist/browser/types/JSONObject.js.map +1 -1
  13. package/dist/browser/types/LoggingLevel.js.map +1 -1
  14. package/dist/browser/types/SortOrder.js.map +1 -1
  15. package/dist/browser/utils/date/DateUtil.js +4 -46
  16. package/dist/browser/utils/date/DateUtil.js.map +1 -1
  17. package/dist/cjs/beans/BaseObject.cjs.map +1 -1
  18. package/dist/cjs/build/node/index.cjs +0 -1
  19. package/dist/cjs/build/node/index.cjs.map +1 -1
  20. package/dist/cjs/exceptions/BadRequestException.cjs.map +1 -1
  21. package/dist/cjs/exceptions/BaseException.cjs +1 -21
  22. package/dist/cjs/exceptions/BaseException.cjs.map +1 -1
  23. package/dist/cjs/exceptions/ClientException.cjs.map +1 -1
  24. package/dist/cjs/exceptions/ConverterException.cjs.map +1 -1
  25. package/dist/cjs/exceptions/ForbiddenAccessException.cjs.map +1 -1
  26. package/dist/cjs/exceptions/HTTPException.cjs.map +1 -1
  27. package/dist/cjs/exceptions/IllegalArgumentException.cjs.map +1 -1
  28. package/dist/cjs/exceptions/UnauthorizedException.cjs.map +1 -1
  29. package/dist/cjs/logger/LoggerFactory.cjs +96 -22
  30. package/dist/cjs/logger/LoggerFactory.cjs.map +1 -1
  31. package/dist/cjs/logger/format/ErrorFormat.cjs +115 -0
  32. package/dist/cjs/logger/format/ErrorFormat.cjs.map +1 -0
  33. package/dist/cjs/logger/index.cjs +0 -1
  34. package/dist/cjs/logger/index.cjs.map +1 -1
  35. package/dist/cjs/types/JSONObject.cjs.map +1 -1
  36. package/dist/cjs/types/LoggingLevel.cjs.map +1 -1
  37. package/dist/cjs/types/SortOrder.cjs.map +1 -1
  38. package/dist/cjs/utils/date/DateUtil.cjs +3 -45
  39. package/dist/cjs/utils/date/DateUtil.cjs.map +1 -1
  40. package/dist/esm/beans/BaseObject.js.map +1 -1
  41. package/dist/esm/build/node/index.js +1 -1
  42. package/dist/esm/exceptions/BadRequestException.js.map +1 -1
  43. package/dist/esm/exceptions/BaseException.js +1 -21
  44. package/dist/esm/exceptions/BaseException.js.map +1 -1
  45. package/dist/esm/exceptions/ClientException.js.map +1 -1
  46. package/dist/esm/exceptions/ConverterException.js.map +1 -1
  47. package/dist/esm/exceptions/ForbiddenAccessException.js.map +1 -1
  48. package/dist/esm/exceptions/HTTPException.js.map +1 -1
  49. package/dist/esm/exceptions/IllegalArgumentException.js.map +1 -1
  50. package/dist/esm/exceptions/UnauthorizedException.js.map +1 -1
  51. package/dist/esm/logger/LoggerFactory.js +97 -22
  52. package/dist/esm/logger/LoggerFactory.js.map +1 -1
  53. package/dist/esm/logger/format/ErrorFormat.js +113 -0
  54. package/dist/esm/logger/format/ErrorFormat.js.map +1 -0
  55. package/dist/esm/logger/index.js +1 -1
  56. package/dist/esm/types/JSONObject.js.map +1 -1
  57. package/dist/esm/types/LoggingLevel.js.map +1 -1
  58. package/dist/esm/types/SortOrder.js.map +1 -1
  59. package/dist/esm/utils/date/DateUtil.js +4 -46
  60. package/dist/esm/utils/date/DateUtil.js.map +1 -1
  61. package/dist/types/index.d.ts +1 -1
  62. package/dist/types/src/exceptions/BaseException.d.ts +0 -6
  63. package/dist/types/src/logger/LoggerFactory.d.ts +88 -10
  64. package/dist/types/src/logger/index.d.ts +1 -1
  65. package/dist/types/src/utils/date/DateUtil.d.ts +9 -60
  66. package/package.json +140 -136
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # core
2
- Foundational Node.js library built with TypeScript used across Quicko
3
-
4
- ## 📦 Installation
5
-
6
- ```bash
7
- npm install @org-quicko/core
1
+ # core
2
+ Foundational Node.js library built with TypeScript used across Quicko
3
+
4
+ ## 📦 Installation
5
+
6
+ ```bash
7
+ npm install @org-quicko/core
8
8
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"BaseObject.js","sources":["../../../src/beans/BaseObject.ts"],"sourcesContent":["import { Expose } from 'class-transformer';\r\nimport { IsNumber, IsString } from 'class-validator';\r\n\r\n/**\r\n * The `BaseObject` class serves as a base model for objects with common properties\r\n * such as `id`, `description`, `createdAt`, and `updatedAt`. It includes validation\r\n * and transformation decorators for serialization and deserialization.\r\n *\r\n * Properties:\r\n * - `id` (string | undefined): A unique identifier for the object.\r\n * - `description` (string | undefined): A brief description of the object.\r\n * - `createdAt` (number | undefined): The timestamp when the object was created.\r\n * - `updatedAt` (number | undefined): The timestamp when the object was last updated.\r\n *\r\n * Methods:\r\n * - `getId()`: Returns the `id` of the object.\r\n * - `setId(value: string | undefined)`: Sets the `id` of the object.\r\n * - `getDescription()`: Returns the `description` of the object.\r\n * - `setDescription(value: string | undefined)`: Sets the `description` of the object.\r\n * - `getCreatedAt()`: Returns the `createdAt` timestamp of the object.\r\n * - `setCreatedAt(value?: number)`: Sets the `createdAt` timestamp of the object.\r\n * - `getUpdatedAt()`: Returns the `updatedAt` timestamp of the object.\r\n * - `setUpdatedAt(value?: number)`: Sets the `updatedAt` timestamp of the object.\r\n */\r\nexport class BaseObject {\r\n\r\n @Expose({ name: 'id' })\r\n @IsString()\r\n private id?: string;\r\n\r\n @Expose({ name: 'description' })\r\n @IsString()\r\n private description?: string;\r\n\r\n @Expose({ name: 'created_at' })\r\n @IsNumber()\r\n private createdAt?: number;\r\n\r\n @Expose({ name: 'updated_at' })\r\n @IsNumber()\r\n private updatedAt?: number;\r\n\r\n getId() {\r\n return this.id;\r\n }\r\n\r\n setId(value: string | undefined) {\r\n this.id = value;\r\n }\r\n\r\n getCreatedAt() {\r\n return this.createdAt;\r\n }\r\n\r\n setCreatedAt(value?: number) {\r\n this.createdAt = value;\r\n }\r\n\r\n getUpdatedAt() {\r\n return this.updatedAt;\r\n }\r\n\r\n setUpdatedAt(value?: number) {\r\n this.updatedAt = value;\r\n }\r\n\r\n getDescription() {\r\n return this.description;\r\n }\r\n\r\n setDescription(value?: string) {\r\n this.description = value;\r\n }\r\n}"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;;;;;;;;;AAoBG;MACU,UAAU,CAAA;IAkBnB,KAAK,GAAA;QACD,OAAO,IAAI,CAAC,EAAE;;AAGlB,IAAA,KAAK,CAAC,KAAyB,EAAA;AAC3B,QAAA,IAAI,CAAC,EAAE,GAAG,KAAK;;IAGnB,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;;AAGzB,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;;IAG1B,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;;AAGzB,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;;IAG1B,cAAc,GAAA;QACV,OAAO,IAAI,CAAC,WAAW;;AAG3B,IAAA,cAAc,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;;AAE/B;AA7CW,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACtB,IAAA,QAAQ,EAAE;;AACS,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,IAAA,EAAA,MAAA,CAAA;AAIZ,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAC/B,IAAA,QAAQ,EAAE;;AACkB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAIrB,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAA,QAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAInB,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAA,QAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"BaseObject.js","sources":["../../../src/beans/BaseObject.ts"],"sourcesContent":["import { Expose } from 'class-transformer';\nimport { IsNumber, IsString } from 'class-validator';\n\n/**\n * The `BaseObject` class serves as a base model for objects with common properties\n * such as `id`, `description`, `createdAt`, and `updatedAt`. It includes validation\n * and transformation decorators for serialization and deserialization.\n *\n * Properties:\n * - `id` (string | undefined): A unique identifier for the object.\n * - `description` (string | undefined): A brief description of the object.\n * - `createdAt` (number | undefined): The timestamp when the object was created.\n * - `updatedAt` (number | undefined): The timestamp when the object was last updated.\n *\n * Methods:\n * - `getId()`: Returns the `id` of the object.\n * - `setId(value: string | undefined)`: Sets the `id` of the object.\n * - `getDescription()`: Returns the `description` of the object.\n * - `setDescription(value: string | undefined)`: Sets the `description` of the object.\n * - `getCreatedAt()`: Returns the `createdAt` timestamp of the object.\n * - `setCreatedAt(value?: number)`: Sets the `createdAt` timestamp of the object.\n * - `getUpdatedAt()`: Returns the `updatedAt` timestamp of the object.\n * - `setUpdatedAt(value?: number)`: Sets the `updatedAt` timestamp of the object.\n */\nexport class BaseObject {\n\n @Expose({ name: 'id' })\n @IsString()\n private id?: string;\n\n @Expose({ name: 'description' })\n @IsString()\n private description?: string;\n\n @Expose({ name: 'created_at' })\n @IsNumber()\n private createdAt?: number;\n\n @Expose({ name: 'updated_at' })\n @IsNumber()\n private updatedAt?: number;\n\n getId() {\n return this.id;\n }\n\n setId(value: string | undefined) {\n this.id = value;\n }\n\n getCreatedAt() {\n return this.createdAt;\n }\n\n setCreatedAt(value?: number) {\n this.createdAt = value;\n }\n\n getUpdatedAt() {\n return this.updatedAt;\n }\n\n setUpdatedAt(value?: number) {\n this.updatedAt = value;\n }\n\n getDescription() {\n return this.description;\n }\n\n setDescription(value?: string) {\n this.description = value;\n }\n}"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;;;;;;;;;AAoBG;MACU,UAAU,CAAA;IAkBnB,KAAK,GAAA;QACD,OAAO,IAAI,CAAC,EAAE;IAClB;AAEA,IAAA,KAAK,CAAC,KAAyB,EAAA;AAC3B,QAAA,IAAI,CAAC,EAAE,GAAG,KAAK;IACnB;IAEA,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;IACzB;AAEA,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;IAC1B;IAEA,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;IACzB;AAEA,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;IAC1B;IAEA,cAAc,GAAA;QACV,OAAO,IAAI,CAAC,WAAW;IAC3B;AAEA,IAAA,cAAc,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;IAC5B;AACH;AA7CW,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACtB,IAAA,QAAQ,EAAE;;AACS,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,IAAA,EAAA,MAAA,CAAA;AAIZ,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAC/B,IAAA,QAAQ,EAAE;;AACkB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAIrB,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAA,QAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAInB,UAAA,CAAA;AAFP,IAAA,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAA,QAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadRequestException.js","sources":["../../../src/exceptions/BadRequestException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown when a bad request is made to the server.\r\n * Typically used for HTTP 400 errors.\r\n */\r\nexport class BadRequestException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown, code: number = 400) {\r\n super(message, cause, code)\r\n }\r\n}\r\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,mBAAoB,SAAQ,aAAa,CAAA;AAElD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;;AAElC;;;;"}
1
+ {"version":3,"file":"BadRequestException.js","sources":["../../../src/exceptions/BadRequestException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown when a bad request is made to the server.\n * Typically used for HTTP 400 errors.\n */\nexport class BadRequestException extends HTTPException {\n\n constructor(message: string, cause?: unknown, code: number = 400) {\n super(message, cause, code)\n }\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,mBAAoB,SAAQ,aAAa,CAAA;AAElD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;IAC/B;AACH;;;;"}
@@ -5,30 +5,10 @@
5
5
  */
6
6
  class BaseException extends Error {
7
7
  constructor(message, cause, code) {
8
- super(message);
9
- this.cause = cause;
8
+ super(message, { cause });
10
9
  this.code = code;
11
10
  this.name = this.constructor.name;
12
11
  }
13
- /**
14
- * Retrieves the full stack trace of the exception, including causes.
15
- * @returns A string representation of the stack trace.
16
- */
17
- getStackTrace() {
18
- let stackTrace = `[${this.code}] ${this.stack}\n`;
19
- let currentCause = this.cause;
20
- while (currentCause) {
21
- if (currentCause instanceof Error) {
22
- stackTrace += `Caused by: ${currentCause.stack || currentCause.message || String(currentCause)}\n`;
23
- currentCause = currentCause.cause;
24
- }
25
- else {
26
- stackTrace += `Caused by: ${String(currentCause)}\n`;
27
- currentCause = undefined;
28
- }
29
- }
30
- return stackTrace;
31
- }
32
12
  }
33
13
 
34
14
  export { BaseException };
@@ -1 +1 @@
1
- {"version":3,"file":"BaseException.js","sources":["../../../src/exceptions/BaseException.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/**\r\n * Base class for all custom exceptions in the application.\r\n * Provides support for error codes and chained exceptions.\r\n */\r\nexport class BaseException extends Error {\r\n code?: number;\r\n cause?: unknown;\r\n\r\n constructor(message: string, cause?: unknown, code?: number) {\r\n super(message);\r\n this.cause = cause;\r\n this.code = code;\r\n this.name = this.constructor.name;\r\n }\r\n\r\n /**\r\n * Retrieves the full stack trace of the exception, including causes.\r\n * @returns A string representation of the stack trace.\r\n */\r\n getStackTrace() {\r\n let stackTrace = `[${this.code}] ${this.stack}\\n`;\r\n let currentCause: unknown = this.cause;\r\n while (currentCause) {\r\n if (currentCause instanceof Error) {\r\n stackTrace += `Caused by: ${currentCause.stack || currentCause.message || String(currentCause)}\\n`;\r\n currentCause = (currentCause as any).cause;\r\n } else {\r\n stackTrace += `Caused by: ${String(currentCause)}\\n`;\r\n currentCause = undefined;\r\n }\r\n }\r\n return stackTrace;\r\n }\r\n}"],"names":[],"mappings":"AAAA;AACA;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AAIpC,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,IAAa,EAAA;QACvD,KAAK,CAAC,OAAO,CAAC;AACd,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI;;AAGrC;;;AAGG;IACH,aAAa,GAAA;QACT,IAAI,UAAU,GAAG,CAAA,CAAA,EAAI,IAAI,CAAC,IAAI,CAAA,EAAA,EAAK,IAAI,CAAC,KAAK,CAAA,EAAA,CAAI;AACjD,QAAA,IAAI,YAAY,GAAY,IAAI,CAAC,KAAK;QACtC,OAAO,YAAY,EAAE;AACjB,YAAA,IAAI,YAAY,YAAY,KAAK,EAAE;AAC/B,gBAAA,UAAU,IAAI,CAAA,WAAA,EAAc,YAAY,CAAC,KAAK,IAAI,YAAY,CAAC,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI;AAClG,gBAAA,YAAY,GAAI,YAAoB,CAAC,KAAK;;iBACvC;AACH,gBAAA,UAAU,IAAI,CAAc,WAAA,EAAA,MAAM,CAAC,YAAY,CAAC,IAAI;gBACpD,YAAY,GAAG,SAAS;;;AAGhC,QAAA,OAAO,UAAU;;AAExB;;;;"}
1
+ {"version":3,"file":"BaseException.js","sources":["../../../src/exceptions/BaseException.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Base class for all custom exceptions in the application.\n * Provides support for error codes and chained exceptions.\n */\nexport class BaseException extends Error {\n code?: number;\n\n constructor(message: string, cause?: unknown, code?: number) {\n super(message,{ cause });\n this.code = code;\n this.name = this.constructor.name;\n }\n}"],"names":[],"mappings":"AAAA;AACA;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AAGpC,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,IAAa,EAAA;AACvD,QAAA,KAAK,CAAC,OAAO,EAAC,EAAE,KAAK,EAAE,CAAC;AACxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI;IACrC;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ClientException.js","sources":["../../../src/exceptions/ClientException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown for client-side errors.\r\n * Typically used for HTTP 4xx errors.\r\n */\r\nexport class ClientException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown, code: number = 500) {\r\n super(message, cause, code);\r\n }\r\n}\r\n\r\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,eAAgB,SAAQ,aAAa,CAAA;AAE9C,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;;AAElC;;;;"}
1
+ {"version":3,"file":"ClientException.js","sources":["../../../src/exceptions/ClientException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown for client-side errors.\n * Typically used for HTTP 4xx errors.\n */\nexport class ClientException extends HTTPException {\n\n constructor(message: string, cause?: unknown, code: number = 500) {\n super(message, cause, code);\n }\n}\n\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,eAAgB,SAAQ,aAAa,CAAA;AAE9C,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;IAC/B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConverterException.js","sources":["../../../src/exceptions/ConverterException.ts"],"sourcesContent":["import { BaseException } from \"./BaseException\";\r\n\r\n/**\r\n * Exception thrown when a conversion operation fails.\r\n */\r\nexport class ConverterException extends BaseException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 500);\r\n }\r\n}\r\n\r\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,MAAO,kBAAmB,SAAQ,aAAa,CAAA;IAEjD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"ConverterException.js","sources":["../../../src/exceptions/ConverterException.ts"],"sourcesContent":["import { BaseException } from \"./BaseException\";\n\n/**\n * Exception thrown when a conversion operation fails.\n */\nexport class ConverterException extends BaseException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 500);\n }\n}\n\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,MAAO,kBAAmB,SAAQ,aAAa,CAAA;IAEjD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ForbiddenAccessException.js","sources":["../../../src/exceptions/ForbiddenAccessException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown when access to a resource is forbidden.\r\n * Typically used for HTTP 403 errors.\r\n */\r\nexport class ForbiddenAccessException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 403);\r\n }\r\n}\r\n\r\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,wBAAyB,SAAQ,aAAa,CAAA;IAEvD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"ForbiddenAccessException.js","sources":["../../../src/exceptions/ForbiddenAccessException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown when access to a resource is forbidden.\n * Typically used for HTTP 403 errors.\n */\nexport class ForbiddenAccessException extends HTTPException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 403);\n }\n}\n\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,wBAAyB,SAAQ,aAAa,CAAA;IAEvD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HTTPException.js","sources":["../../../src/exceptions/HTTPException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\r\n\r\n/**\r\n * Base class for HTTP-related exceptions.\r\n * Provides support for HTTP status codes.\r\n */\r\nexport abstract class HTTPException extends BaseException {\r\n\r\n constructor(message: string, cause?: unknown, code: number = 500) {\r\n super(message, cause, code);\r\n }\r\n\r\n}"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAgB,aAAc,SAAQ,aAAa,CAAA;AAErD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;;AAGlC;;;;"}
1
+ {"version":3,"file":"HTTPException.js","sources":["../../../src/exceptions/HTTPException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\n\n/**\n * Base class for HTTP-related exceptions.\n * Provides support for HTTP status codes.\n */\nexport abstract class HTTPException extends BaseException {\n\n constructor(message: string, cause?: unknown, code: number = 500) {\n super(message, cause, code);\n }\n\n}"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAgB,aAAc,SAAQ,aAAa,CAAA;AAErD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;IAC/B;AAEH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IllegalArgumentException.js","sources":["../../../src/exceptions/IllegalArgumentException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\r\n\r\n/**\r\n * Exception thrown when an illegal or inappropriate argument is passed.\r\n */\r\nexport class IllegalArgumentException extends BaseException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 500);\r\n }\r\n}\r\n\r\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,MAAO,wBAAyB,SAAQ,aAAa,CAAA;IAEvD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"IllegalArgumentException.js","sources":["../../../src/exceptions/IllegalArgumentException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\n\n/**\n * Exception thrown when an illegal or inappropriate argument is passed.\n */\nexport class IllegalArgumentException extends BaseException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 500);\n }\n}\n\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,MAAO,wBAAyB,SAAQ,aAAa,CAAA;IAEvD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnauthorizedException.js","sources":["../../../src/exceptions/UnauthorizedException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown when a request is unauthorized.\r\n * Typically used for HTTP 401 errors.\r\n */\r\nexport class UnauthorizedException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 401);\r\n }\r\n}\r\n\r\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,qBAAsB,SAAQ,aAAa,CAAA;IAEpD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"UnauthorizedException.js","sources":["../../../src/exceptions/UnauthorizedException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown when a request is unauthorized.\n * Typically used for HTTP 401 errors.\n */\nexport class UnauthorizedException extends HTTPException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 401);\n }\n}\n\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,MAAO,qBAAsB,SAAQ,aAAa,CAAA;IAEpD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"JSONObject.js","sources":["../../../src/types/JSONObject.ts"],"sourcesContent":["import { BaseException, IllegalArgumentException } from '../exceptions';\r\n\r\nexport type JSONValue =\r\n | string\r\n | number\r\n | boolean\r\n | null\r\n | undefined\r\n // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\r\n | Object\r\n\r\nexport class JSONObject extends Map<string, JSONValue> {\r\n\r\n\r\n constructor(object?: { [x: string]: JSONValue }) {\r\n super()\r\n if (object) {\r\n for (const [key, value] of Object.entries(object)) {\r\n if (value === null || value === undefined) {\r\n // ignore\r\n } else if (value.constructor == Object) {\r\n this.set(key, new JSONObject(value as { [x: string]: JSONValue }));\r\n } else if (value.constructor == Array) {\r\n this.set(key, new JSONArray(value));\r\n } else {\r\n this.set(key, value)\r\n }\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n getJSONObject(key: string): JSONObject {\r\n if (super.has(key)) {\r\n if (super.get(key) instanceof JSONObject) {\r\n return super.get(key) as JSONObject\r\n } else {\r\n throw new IllegalArgumentException('Value cannot be converted to JSONObject')\r\n }\r\n }\r\n\r\n throw new BaseException(`Value for Key: '${key}' not found`);\r\n }\r\n\r\n getString(key: string): string {\r\n if (super.has(key)) {\r\n try {\r\n if (typeof super.get(key) === 'string') {\r\n return super.get(key) as string;\r\n }\r\n\r\n throw new IllegalArgumentException('Value cannot be converted to string')\r\n } catch (e) {\r\n throw new IllegalArgumentException('Value cannot be converted to string', e)\r\n }\r\n }\r\n throw new BaseException(`Value for Key: '${key}' not found`);\r\n }\r\n\r\n getNumber(key: string): number {\r\n if (super.has(key)) {\r\n const number = Number(super.get(key));\r\n if (!isNaN(number)) {\r\n return number;\r\n }\r\n throw new IllegalArgumentException('Value cannot be converted to number')\r\n }\r\n throw new BaseException(`Value for Key: '${key}' not found`);\r\n }\r\n\r\n getBoolean(key: string): boolean {\r\n if (super.has(key)) {\r\n if (typeof super.get(key) === 'boolean') {\r\n return super.get(key) as boolean;\r\n } else if (super.get(key) === 'true' || super.get(key) === 'false') {\r\n return Boolean(super.get(key));\r\n }\r\n throw new IllegalArgumentException('Value cannot be converted to boolean')\r\n }\r\n throw new BaseException(`Value for Key: '${key}' not found`);\r\n }\r\n\r\n getArray(key: string): JSONArray {\r\n if (super.has(key)) {\r\n if (super.get(key) instanceof JSONArray) {\r\n return super.get(key) as JSONArray;\r\n }\r\n else if (super.get(key) instanceof Array) {\r\n return new JSONArray(super.get(key) as Array<JSONValue>);\r\n }\r\n throw new IllegalArgumentException('Value cannot be converted to array')\r\n }\r\n throw new BaseException(`Value for Key: '${key}' not found`);\r\n }\r\n\r\n public toJSON(): { [x: string]: JSONValue } {\r\n const obj: { [x: string]: JSONValue } = {};\r\n for (const [key, value] of this.entries()) {\r\n if (value == null) {\r\n obj[key] = value;\r\n } else if (value instanceof JSONObject || value instanceof JSONArray) {\r\n obj[key] = value.toJSON();\r\n } else {\r\n obj[key] = value\r\n }\r\n }\r\n return obj;\r\n }\r\n}\r\n\r\n\r\nexport class JSONArray extends Array<JSONValue> {\r\n\r\n constructor(array?: Array<JSONValue>) {\r\n super();\r\n if (array) {\r\n for (let item of Object.values(array)) {\r\n item = JSON.parse(JSON.stringify(item))\r\n\r\n if (item == null) {\r\n this.push(item);\r\n }\r\n else if (item.constructor == Object) {\r\n this.push(new JSONObject(item as { [x: string]: JSONValue }));\r\n }\r\n else if (item.constructor == Array) {\r\n this.push(new JSONArray(item));\r\n }\r\n else {\r\n this.push(item)\r\n }\r\n }\r\n }\r\n }\r\n\r\n public toJSON(): Array<JSONValue> {\r\n const arr: Array<JSONValue> = [];\r\n for (const value of this) {\r\n if (value == null) {\r\n arr.push(value);\r\n } else if (value instanceof JSONObject || value instanceof JSONArray) {\r\n arr.push(value.toJSON());\r\n } else {\r\n arr.push(value)\r\n }\r\n }\r\n return arr;\r\n }\r\n}"],"names":[],"mappings":";;;AAWM,MAAO,UAAW,SAAQ,GAAsB,CAAA;AAGlD,IAAA,WAAA,CAAY,MAAmC,EAAA;AAC3C,QAAA,KAAK,EAAE;QACP,IAAI,MAAM,EAAE;AACR,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBAC/C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AAEpC,qBAAA,IAAI,KAAK,CAAC,WAAW,IAAI,MAAM,EAAE;oBACpC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,UAAU,CAAC,KAAmC,CAAC,CAAC;;AAC/D,qBAAA,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,EAAE;oBACnC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;;qBAChC;AACH,oBAAA,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;;;;;AAQpC,IAAA,aAAa,CAAC,GAAW,EAAA;AACrB,QAAA,IAAI,KAAK,CA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,CAAC,KAAK,CAAC;;;AAGvB,QAAA,OAAO,GAAG;;AAEjB;;;;"}
1
+ {"version":3,"file":"JSONObject.js","sources":["../../../src/types/JSONObject.ts"],"sourcesContent":["import { BaseException, IllegalArgumentException } from '../exceptions';\n\nexport type JSONValue =\n | string\n | number\n | boolean\n | null\n | undefined\n // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\n | Object\n\nexport class JSONObject extends Map<string, JSONValue> {\n\n\n constructor(object?: { [x: string]: JSONValue }) {\n super()\n if (object) {\n for (const [key, value] of Object.entries(object)) {\n if (value === null || value === undefined) {\n // ignore\n } else if (value.constructor == Object) {\n this.set(key, new JSONObject(value as { [x: string]: JSONValue }));\n } else if (value.constructor == Array) {\n this.set(key, new JSONArray(value));\n } else {\n this.set(key, value)\n }\n }\n }\n\n\n }\n\n getJSONObject(key: string): JSONObject {\n if (super.has(key)) {\n if (super.get(key) instanceof JSONObject) {\n return super.get(key) as JSONObject\n } else {\n throw new IllegalArgumentException('Value cannot be converted to JSONObject')\n }\n }\n\n throw new BaseException(`Value for Key: '${key}' not found`);\n }\n\n getString(key: string): string {\n if (super.has(key)) {\n try {\n if (typeof super.get(key) === 'string') {\n return super.get(key) as string;\n }\n\n throw new IllegalArgumentException('Value cannot be converted to string')\n } catch (e) {\n throw new IllegalArgumentException('Value cannot be converted to string', e)\n }\n }\n throw new BaseException(`Value for Key: '${key}' not found`);\n }\n\n getNumber(key: string): number {\n if (super.has(key)) {\n const number = Number(super.get(key));\n if (!isNaN(number)) {\n return number;\n }\n throw new IllegalArgumentException('Value cannot be converted to number')\n }\n throw new BaseException(`Value for Key: '${key}' not found`);\n }\n\n getBoolean(key: string): boolean {\n if (super.has(key)) {\n if (typeof super.get(key) === 'boolean') {\n return super.get(key) as boolean;\n } else if (super.get(key) === 'true' || super.get(key) === 'false') {\n return Boolean(super.get(key));\n }\n throw new IllegalArgumentException('Value cannot be converted to boolean')\n }\n throw new BaseException(`Value for Key: '${key}' not found`);\n }\n\n getArray(key: string): JSONArray {\n if (super.has(key)) {\n if (super.get(key) instanceof JSONArray) {\n return super.get(key) as JSONArray;\n }\n else if (super.get(key) instanceof Array) {\n return new JSONArray(super.get(key) as Array<JSONValue>);\n }\n throw new IllegalArgumentException('Value cannot be converted to array')\n }\n throw new BaseException(`Value for Key: '${key}' not found`);\n }\n\n public toJSON(): { [x: string]: JSONValue } {\n const obj: { [x: string]: JSONValue } = {};\n for (const [key, value] of this.entries()) {\n if (value == null) {\n obj[key] = value;\n } else if (value instanceof JSONObject || value instanceof JSONArray) {\n obj[key] = value.toJSON();\n } else {\n obj[key] = value\n }\n }\n return obj;\n }\n}\n\n\nexport class JSONArray extends Array<JSONValue> {\n\n constructor(array?: Array<JSONValue>) {\n super();\n if (array) {\n for (let item of Object.values(array)) {\n item = JSON.parse(JSON.stringify(item))\n\n if (item == null) {\n this.push(item);\n }\n else if (item.constructor == Object) {\n this.push(new JSONObject(item as { [x: string]: JSONValue }));\n }\n else if (item.constructor == Array) {\n this.push(new JSONArray(item));\n }\n else {\n this.push(item)\n }\n }\n }\n }\n\n public toJSON(): Array<JSONValue> {\n const arr: Array<JSONValue> = [];\n for (const value of this) {\n if (value == null) {\n arr.push(value);\n } else if (value instanceof JSONObject || value instanceof JSONArray) {\n arr.push(value.toJSON());\n } else {\n arr.push(value)\n }\n }\n return arr;\n }\n}"],"names":[],"mappings":";;;AAWM,MAAO,UAAW,SAAQ,GAAsB,CAAA;AAGlD,IAAA,WAAA,CAAY,MAAmC,EAAA;AAC3C,QAAA,KAAK,EAAE;QACP,IAAI,MAAM,EAAE;AACR,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBAC/C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AAEpC,qBAAA,IAAI,KAAK,CAAC,WAAW,IAAI,MAAM,EAAE;oBACpC,IAAI,CAAC,GAAG,CAAC,G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AI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;gBAClC;qBACK;AACD,oBAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBACnB;YACJ;QACJ;IACJ;IAEO,MAAM,GAAA;QACT,MAAM,GAAG,GAAqB,EAAE;AAChC,QAAA,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;AACtB,YAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACf,gBAAA,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;YACnB;iBAAO,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,SAAS,EAAE;gBAClE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC5B;iBAAO;AACH,gBAAA,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;YACnB;QACJ;AACA,QAAA,OAAO,GAAG;IACd;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoggingLevel.js","sources":["../../../src/types/LoggingLevel.ts"],"sourcesContent":["export enum LoggingLevel {\r\n silly = 'silly',\r\n debug = 'debug',\r\n verbose = 'verbose',\r\n info = 'info',\r\n warn = 'warn',\r\n error = 'error',\r\n}"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,YAAY,EAAA;AACpB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACnB,CAAC,EAPW,YAAY,KAAZ,YAAY,GAOvB,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"LoggingLevel.js","sources":["../../../src/types/LoggingLevel.ts"],"sourcesContent":["export enum LoggingLevel {\n silly = 'silly',\n debug = 'debug',\n verbose = 'verbose',\n info = 'info',\n warn = 'warn',\n error = 'error',\n}"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,YAAY,EAAA;AACpB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACnB,CAAC,EAPW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SortOrder.js","sources":["../../../src/types/SortOrder.ts"],"sourcesContent":["/**\r\n * @export\r\n * @enum {number}\r\n */\r\nexport enum SortOrder {\r\n ASC = 'asc',\r\n DESC = 'desc'\r\n}"],"names":[],"mappings":"AAAA;;;AAGG;IACS;AAAZ,CAAA,UAAY,SAAS,EAAA;AACjB,IAAA,SAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EAHW,SAAS,KAAT,SAAS,GAGpB,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"SortOrder.js","sources":["../../../src/types/SortOrder.ts"],"sourcesContent":["/**\n * @export\n * @enum {number}\n */\nexport enum SortOrder {\n ASC = 'asc',\n DESC = 'desc'\n}"],"names":[],"mappings":"AAAA;;;AAGG;IACS;AAAZ,CAAA,UAAY,SAAS,EAAA;AACjB,IAAA,SAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EAHW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -1,12 +1,12 @@
1
1
  import { TZDate } from '@date-fns/tz';
2
- import { parse, isValid, format, startOfDay, endOfDay, differenceInCalendarDays, differenceInCalendarMonths, differenceInYears, differenceInCalendarYears, compareAsc, add, isLeapYear } from 'date-fns';
2
+ import { parse, isValid, format, startOfDay, endOfDay, differenceInCalendarDays, differenceInCalendarMonths, differenceInCalendarYears, compareAsc, add, isLeapYear } from 'date-fns';
3
3
  import { IllegalArgumentException } from '../../exceptions/IllegalArgumentException.js';
4
4
 
5
5
  /**
6
6
  * Utility class for date and time operations. Provides methods for parsing,
7
7
  * formatting, and performing calculations with dates and times.
8
8
  */
9
- class BaseDateUtil {
9
+ class DateUtil {
10
10
  static { this.ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"; }
11
11
  /**
12
12
  * Gets the current date and time in the specified time zone.
@@ -58,7 +58,7 @@ class BaseDateUtil {
58
58
  */
59
59
  static isValidDate(dateString, dateFormat) {
60
60
  try {
61
- DateUtil.readDate(dateString, dateFormat);
61
+ DateUtil.readDate(dateString, dateFormat, "UTC");
62
62
  return true;
63
63
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
64
64
  }
@@ -76,11 +76,6 @@ class BaseDateUtil {
76
76
  const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;
77
77
  return Math.abs(differenceInCalendarMonths(first, second));
78
78
  }
79
- static anniversaryYearsInBetween(firstDate, secondDate) {
80
- const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;
81
- const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;
82
- return Math.abs(differenceInYears(first, second));
83
- }
84
79
  static yearsInBetween(firstDate, secondDate) {
85
80
  const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;
86
81
  const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;
@@ -101,7 +96,7 @@ class BaseDateUtil {
101
96
  * @returns `true` if the year is a leap year, otherwise `false`.
102
97
  */
103
98
  static isLeapYear(year) {
104
- return isLeapYear(DateUtil.readDate(year.toString(), 'yyyy'));
99
+ return isLeapYear(DateUtil.readDate(year.toString(), 'yyyy', "UTC"));
105
100
  }
106
101
  /**
107
102
  * Converts a timestamp (in milliseconds) to a Date object.
@@ -120,43 +115,6 @@ class BaseDateUtil {
120
115
  return date.getTime();
121
116
  }
122
117
  }
123
- /**
124
- * Utility class for handling date operations in a fixed time zone.
125
- * Extends BaseDateUtil with default settings for the 'Asia/Kolkata' time zone.
126
- */
127
- class DateUtil extends BaseDateUtil {
128
- /** Default time zone used for all date operations. */
129
- static { this.TIMEZONE = 'Asia/Kolkata'; }
130
- /**
131
- * Gets the current date and time in the default time zone.
132
- * @returns Current date and time as a Date object.
133
- */
134
- static now() {
135
- return BaseDateUtil.now(this.TIMEZONE);
136
- }
137
- /**
138
- * Parses a date string into a Date object using the default time zone.
139
- * @param dateString The date string to parse.
140
- * @param dateFormat Optional format of the date string (default: ISO_8601_FORMAT).
141
- * @throws {IllegalArgumentException} If the date string is invalid.
142
- * @returns Parsed Date object.
143
- */
144
- static readDate(dateString, dateFormat) {
145
- return BaseDateUtil.readDate(dateString, dateFormat || DateUtil.ISO_8601_FORMAT, this.TIMEZONE);
146
- }
147
- static printDate(date, dateFormat = DateUtil.ISO_8601_FORMAT) {
148
- const normalizedDate = typeof date === 'number' ? new Date(date) : date;
149
- return BaseDateUtil.printDate(normalizedDate, this.TIMEZONE, dateFormat);
150
- }
151
- static getStartOfDay(date) {
152
- const normalizedDate = typeof date === 'number' ? new Date(date) : date;
153
- return BaseDateUtil.getStartOfDay(normalizedDate, this.TIMEZONE);
154
- }
155
- static getEndOfDay(date) {
156
- const normalizedDate = typeof date === 'number' ? new Date(date) : date;
157
- return BaseDateUtil.getEndOfDay(normalizedDate, this.TIMEZONE);
158
- }
159
- }
160
118
 
161
119
  export { DateUtil };
162
120
  //# sourceMappingURL=DateUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateUtil.js","sources":["../../../../src/utils/date/DateUtil.ts"],"sourcesContent":["import { TZDate } from '@date-fns/tz';\r\nimport { add, compareAsc, differenceInCalendarDays, differenceInCalendarMonths, differenceInCalendarYears, differenceInYears, Duration, endOfDay, format, isLeapYear, isValid, parse, startOfDay } from 'date-fns';\r\nimport { IllegalArgumentException } from '../../exceptions';\r\n\r\n/**\r\n * Utility class for date and time operations. Provides methods for parsing,\r\n * formatting, and performing calculations with dates and times.\r\n */\r\nclass BaseDateUtil {\r\n\r\n static readonly ISO_8601_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\"\r\n\r\n /**\r\n * Gets the current date and time in the specified time zone.\r\n * @param timeZone The IANA time zone identifier.\r\n * @returns Current date and time in the specified time zone.\r\n */\r\n protected static now(timeZone: string): Date {\r\n return new TZDate(new Date(), timeZone);\r\n }\r\n\r\n /**\r\n * Gets the current time in milliseconds since the Unix epoch.\r\n * @returns Current time in milliseconds.\r\n */\r\n static nowInMillis(): number {\r\n return Date.now();\r\n }\r\n\r\n /**\r\n * Parses a date string into a Date object.\r\n * @param dateString The date string to parse.\r\n * @param dateFormat The format of the date string (default: ISO_8601_FORMAT).\r\n * @param timeZone The IANA time zone identifier.\r\n * @throws {IllegalArgumentException} If the date string is invalid.\r\n * @returns Parsed Date object.\r\n */\r\n protected static readDate(dateString: string, dateFormat = this.ISO_8601_FORMAT, timeZone: string): Date {\r\n const date = parse(dateString, dateFormat, TZDate.tz(timeZone));\r\n if (!isValid(date)) {\r\n throw new IllegalArgumentException('Invalid date string or date format');\r\n }\r\n return date;\r\n }\r\n\r\n /**\r\n * Formats a Date or timestamp into a string.\r\n * @param date The date or timestamp to format.\r\n * @param timeZone The IANA time zone identifier.\r\n * @param dateFormat The desired output format (default: ISO_8601_FORMAT).\r\n * @returns Formatted date string.\r\n */\r\n protected static printDate(date: Date, timeZone: string, dateFormat?: string): string;\r\n protected static printDate(date: number, timeZone: string, dateFormat?: string): string;\r\n protected static printDate(date: Date | number, timeZone: string, dateFormat: string = this.ISO_8601_FORMAT): string {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return format(new TZDate(normalizedDate, timeZone), dateFormat);\r\n }\r\n\r\n /**\r\n * Gets the start of the day for a given date or timestamp.\r\n * @param date The date or timestamp to calculate from.\r\n * @param timeZone The IANA time zone identifier.\r\n * @returns The start of the day as a Date object.\r\n */\r\n protected static getStartOfDay(date: Date, timeZone: string): Date;\r\n protected static getStartOfDay(date: number, timeZone: string): Date;\r\n protected static getStartOfDay(date: Date | number, timeZone: string): Date {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return startOfDay(new TZDate(normalizedDate, timeZone));\r\n }\r\n\r\n /**\r\n * Gets the end of the day for a given date or timestamp.\r\n * @param date The date or timestamp to calculate from.\r\n * @param timeZone The IANA time zone identifier.\r\n * @returns The end of the day as a Date object.\r\n */\r\n protected static getEndOfDay(date: Date, timeZone: string): Date;\r\n protected static getEndOfDay(date: number, timeZone: string): Date;\r\n protected static getEndOfDay(date: Date | number, timeZone: string): Date {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return endOfDay(new TZDate(normalizedDate, timeZone));\r\n }\r\n\r\n /**\r\n * Checks if a date string is valid according to the specified format.\r\n * @param dateString The date string to validate.\r\n * @param dateFormat Optional date format (default: ISO_8601_FORMAT).\r\n * @returns True if the date is valid, false otherwise.\r\n */\r\n static isValidDate(dateString: string, dateFormat?: string): boolean {\r\n try {\r\n DateUtil.readDate(dateString, dateFormat);\r\n return true;\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n } catch (error) {\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Calculates the absolute number of days between two dates or timestamps.\r\n * @param firstDate The first date or timestamp.\r\n * @param secondDate The second date or timestamp.\r\n * @returns Number of days between the two dates.\r\n */\r\n static daysInBetween(firstDate: Date, secondDate: Date): number;\r\n static daysInBetween(firstDate: number, secondDate: number): number;\r\n static daysInBetween(firstDate: Date | number, secondDate: Date | number): number {\r\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\r\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\r\n return Math.abs(differenceInCalendarDays(first, second));\r\n }\r\n\r\n /**\r\n * Calculates the absolute number of months between two dates or timestamps.\r\n * @param firstDate The first date or timestamp.\r\n * @param secondDate The second date or timestamp.\r\n * @returns The number of months between the two dates.\r\n */\r\n static monthsInBetween(firstDate: Date, secondDate: Date): number;\r\n static monthsInBetween(firstDate: number, secondDate: number): number;\r\n static monthsInBetween(firstDate: Date | number, secondDate: Date | number): number {\r\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\r\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\r\n return Math.abs(differenceInCalendarMonths(first, second));\r\n }\r\n\r\n /**\r\n * Calculates the absolute number of years between two dates or timestamps.\r\n * @param firstDate The first date or timestamp.\r\n * @param secondDate The second date or timestamp.\r\n * @returns The number of years between the two dates.\r\n */\r\n static anniversaryYearsInBetween(firstDate: Date, secondDate: Date): number;\r\n static anniversaryYearsInBetween(firstDate: number, secondDate: number): number;\r\n static anniversaryYearsInBetween(firstDate: Date | number, secondDate: Date | number): number {\r\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\r\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\r\n return Math.abs(differenceInYears(first, second));\r\n }\r\n\r\n /**\r\n * Calculates the absolute number of years between two dates or timestamps.\r\n * @param firstDate The first date or timestamp.\r\n * @param secondDate The second date or timestamp.\r\n * @returns The number of years between the two dates.\r\n */\r\n static yearsInBetween(firstDate: Date, secondDate: Date): number;\r\n static yearsInBetween(firstDate: number, secondDate: number): number;\r\n static yearsInBetween(firstDate: Date | number, secondDate: Date | number): number {\r\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\r\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\r\n return Math.abs(differenceInCalendarYears(first, second));\r\n }\r\n\r\n /**\r\n * Compares two dates or timestamps.\r\n * @param firstDate The first date or timestamp.\r\n * @param secondDate The second date or timestamp.\r\n * @returns `-1` if the first date is earlier, `1` if it is later, or `0` if the two dates are equal.\r\n */\r\n static compareDates(firstDate: Date, secondDate: Date): -1 | 0 | 1;\r\n static compareDates(firstDate: number, secondDate: number): -1 | 0 | 1;\r\n static compareDates(firstDate: Date | number, secondDate: Date | number): -1 | 0 | 1 {\r\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\r\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\r\n\r\n return compareAsc(first, second) as -1 | 0 | 1;\r\n }\r\n\r\n /**\r\n * Adds a duration (e.g., days, months, years) to a given date or timestamp.\r\n * @param date The base date or timestamp to which the duration will be added.\r\n * @param duration An object specifying the duration (e.g., `{ days: 1, months: 2 }`).\r\n * @returns A new Date object with the duration added.\r\n */\r\n static addDuration(date: Date, duration: Duration): Date;\r\n static addDuration(date: number, duration: Duration): Date;\r\n static addDuration(date: Date | number, duration: Duration): Date {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return add(normalizedDate, duration);\r\n }\r\n\r\n /**\r\n * Determines whether a given year is a leap year.\r\n * @param year The year to check.\r\n * @returns `true` if the year is a leap year, otherwise `false`.\r\n */\r\n static isLeapYear(year: number): boolean {\r\n return isLeapYear(DateUtil.readDate(year.toString(), 'yyyy'));\r\n }\r\n\r\n\r\n /**\r\n * Converts a timestamp (in milliseconds) to a Date object.\r\n * @param milliseconds The timestamp in milliseconds since the Unix epoch.\r\n * @returns A Date object representing the provided timestamp.\r\n */\r\n static fromMillis(milliseconds: number): Date {\r\n return new Date(milliseconds);\r\n }\r\n\r\n /**\r\n * Converts a Date object to a timestamp (in milliseconds).\r\n * @param date The Date object to convert.\r\n * @returns The timestamp in milliseconds since the Unix epoch.\r\n */\r\n static toMillis(date: Date): number {\r\n return date.getTime();\r\n }\r\n}\r\n\r\n/**\r\n * Utility class for handling date operations in a fixed time zone.\r\n * Extends BaseDateUtil with default settings for the 'Asia/Kolkata' time zone.\r\n */\r\nexport class DateUtil extends BaseDateUtil {\r\n /** Default time zone used for all date operations. */\r\n static readonly TIMEZONE = 'Asia/Kolkata';\r\n /**\r\n * Gets the current date and time in the default time zone.\r\n * @returns Current date and time as a Date object.\r\n */\r\n static override now(): Date {\r\n return BaseDateUtil.now(this.TIMEZONE);\r\n }\r\n\r\n /**\r\n * Parses a date string into a Date object using the default time zone.\r\n * @param dateString The date string to parse.\r\n * @param dateFormat Optional format of the date string (default: ISO_8601_FORMAT).\r\n * @throws {IllegalArgumentException} If the date string is invalid.\r\n * @returns Parsed Date object.\r\n */\r\n static override readDate(dateString: string, dateFormat?: string): Date {\r\n return BaseDateUtil.readDate(dateString, dateFormat || DateUtil.ISO_8601_FORMAT, this.TIMEZONE);\r\n }\r\n\r\n /**\r\n * Formats a Date or timestamp into a string using the default time zone.\r\n * @param date The date or timestamp to format.\r\n * @param dateFormat Optional desired output format (default: ISO_8601_FORMAT).\r\n * @returns Formatted date string.\r\n */\r\n static override printDate(date: Date, dateFormat?: string): string;\r\n static override printDate(date: number, dateFormat?: string): string;\r\n static override printDate(date: Date | number, dateFormat = DateUtil.ISO_8601_FORMAT): string {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return BaseDateUtil.printDate(normalizedDate, this.TIMEZONE, dateFormat);\r\n }\r\n\r\n /**\r\n * Gets the start of the day for a given date or timestamp using the default time zone.\r\n * @param date The date or timestamp to calculate from.\r\n * @returns A Date object representing the start of the day.\r\n */\r\n static override getStartOfDay(date: Date): Date;\r\n static override getStartOfDay(date: number): Date;\r\n static override getStartOfDay(date: Date | number): Date {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return BaseDateUtil.getStartOfDay(normalizedDate, this.TIMEZONE);\r\n }\r\n\r\n /**\r\n * Gets the end of the day for a given date or timestamp using the default time zone.\r\n * @param date The date or timestamp to calculate from.\r\n * @returns A Date object representing the end of the day.\r\n */\r\n static override getEndOfDay(date: Date): Date;\r\n static override getEndOfDay(date: number): Date;\r\n static override getEndOfDay(date: Date | number): Date {\r\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\r\n return BaseDateUtil.getEndOfDay(normalizedDate, this.TIMEZONE);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;AAIA;;;AAGG;AACH,MAAM,YAAY,CAAA;aAEE,IAAe,CAAA,eAAA,GAAG,8BAA8B,CAAA;AAEhE;;;;AAIG;IACO,OAAO,GAAG,CAAC,QAAgB,EAAA;QACjC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,CAAC;;AAG3C;;;AAGG;AACH,IAAA,OAAO,WAAW,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,GAAG,EAAE;;AAGrB;;;;;;;AAOG;IACO,OAAO,QAAQ,CAAC,UAAkB,EAAE,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,QAAgB,EAAA;AAC7F,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC/D,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAChB,YAAA,MAAM,IAAI,wBAAwB,CAAC,oCAAoC,CAAC;;AAE5E,QAAA,OAAO,IAAI;;IAYL,OAAO,SAAS,CAAC,IAAmB,EAAE,QAAgB,EAAE,UAAA,GAAqB,IAAI,CAAC,eAAe,EAAA;AACvG,QAAA,MAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;AACvE,QAAA,OAAO,MAAM,CAAC,IAAI,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,UAAU,CAAC;;AAWzD,IAAA,OAAO,aAAa,CAAC,IAAmB,EAAE,QAAgB,EAAA;AAChE,QAAA,MAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,IAAI,C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YAAY,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC;;IAUpE,OAAgB,WAAW,CAAC,IAAmB,EAAA;AAC3C,QAAA,MAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;QACvE,OAAO,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC;;;;;;"}
1
+ {"version":3,"file":"DateUtil.js","sources":["../../../../src/utils/date/DateUtil.ts"],"sourcesContent":["import { TZDate } from '@date-fns/tz';\nimport { add, compareAsc, differenceInCalendarDays, differenceInCalendarMonths, differenceInCalendarYears, Duration, endOfDay, format, isLeapYear, isValid, parse, startOfDay } from 'date-fns';\nimport { IllegalArgumentException } from '../../exceptions';\n\n/**\n * Utility class for date and time operations. Provides methods for parsing,\n * formatting, and performing calculations with dates and times.\n */\nexport class DateUtil {\n\n static readonly ISO_8601_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\"\n\n /**\n * Gets the current date and time in the specified time zone.\n * @param timeZone The IANA time zone identifier.\n * @returns Current date and time in the specified time zone.\n */\n static now(timeZone: string): Date {\n return new TZDate(new Date(), timeZone);\n }\n\n /**\n * Gets the current time in milliseconds since the Unix epoch.\n * @returns Current time in milliseconds.\n */\n static nowInMillis(): number {\n return Date.now();\n }\n\n /**\n * Parses a date string into a Date object.\n * @param dateString The date string to parse.\n * @param dateFormat The format of the date string (default: ISO_8601_FORMAT).\n * @param timeZone The IANA time zone identifier.\n * @throws {IllegalArgumentException} If the date string is invalid.\n * @returns Parsed Date object.\n */\n static readDate(dateString: string, dateFormat = this.ISO_8601_FORMAT, timeZone: string): Date {\n const date = parse(dateString, dateFormat, TZDate.tz(timeZone));\n if (!isValid(date)) {\n throw new IllegalArgumentException('Invalid date string or date format');\n }\n return date;\n }\n\n /**\n * Formats a Date or timestamp into a string.\n * @param date The date or timestamp to format.\n * @param timeZone The IANA time zone identifier.\n * @param dateFormat The desired output format (default: ISO_8601_FORMAT).\n * @returns Formatted date string.\n */\n static printDate(date: Date, timeZone: string, dateFormat?: string): string;\n static printDate(date: number, timeZone: string, dateFormat?: string): string;\n static printDate(date: Date | number, timeZone: string, dateFormat: string = this.ISO_8601_FORMAT): string {\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\n return format(new TZDate(normalizedDate, timeZone), dateFormat);\n }\n\n /**\n * Gets the start of the day for a given date or timestamp.\n * @param date The date or timestamp to calculate from.\n * @param timeZone The IANA time zone identifier.\n * @returns The start of the day as a Date object.\n */\n static getStartOfDay(date: Date, timeZone: string): Date;\n static getStartOfDay(date: number, timeZone: string): Date;\n static getStartOfDay(date: Date | number, timeZone: string): Date {\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\n return startOfDay(new TZDate(normalizedDate, timeZone));\n }\n\n /**\n * Gets the end of the day for a given date or timestamp.\n * @param date The date or timestamp to calculate from.\n * @param timeZone The IANA time zone identifier.\n * @returns The end of the day as a Date object.\n */\n static getEndOfDay(date: Date, timeZone: string): Date;\n static getEndOfDay(date: number, timeZone: string): Date;\n static getEndOfDay(date: Date | number, timeZone: string): Date {\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\n return endOfDay(new TZDate(normalizedDate, timeZone));\n }\n\n /**\n * Checks if a date string is valid according to the specified format.\n * @param dateString The date string to validate.\n * @param dateFormat Optional date format (default: ISO_8601_FORMAT).\n * @returns True if the date is valid, false otherwise.\n */\n static isValidDate(dateString: string, dateFormat?: string): boolean {\n try {\n DateUtil.readDate(dateString, dateFormat, \"UTC\");\n return true;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Calculates the absolute number of days between two dates or timestamps.\n * @param firstDate The first date or timestamp.\n * @param secondDate The second date or timestamp.\n * @returns Number of days between the two dates.\n */\n static daysInBetween(firstDate: Date, secondDate: Date): number;\n static daysInBetween(firstDate: number, secondDate: number): number;\n static daysInBetween(firstDate: Date | number, secondDate: Date | number): number {\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\n return Math.abs(differenceInCalendarDays(first, second));\n }\n\n /**\n * Calculates the absolute number of months between two dates or timestamps.\n * @param firstDate The first date or timestamp.\n * @param secondDate The second date or timestamp.\n * @returns The number of months between the two dates.\n */\n static monthsInBetween(firstDate: Date, secondDate: Date): number;\n static monthsInBetween(firstDate: number, secondDate: number): number;\n static monthsInBetween(firstDate: Date | number, secondDate: Date | number): number {\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\n return Math.abs(differenceInCalendarMonths(first, second));\n }\n\n /**\n * Calculates the absolute number of years between two dates or timestamps.\n * @param firstDate The first date or timestamp.\n * @param secondDate The second date or timestamp.\n * @returns The number of years between the two dates.\n */\n static yearsInBetween(firstDate: Date, secondDate: Date): number;\n static yearsInBetween(firstDate: number, secondDate: number): number;\n static yearsInBetween(firstDate: Date | number, secondDate: Date | number): number {\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\n return Math.abs(differenceInCalendarYears(first, second));\n }\n\n /**\n * Compares two dates or timestamps.\n * @param firstDate The first date or timestamp.\n * @param secondDate The second date or timestamp.\n * @returns `-1` if the first date is earlier, `1` if it is later, or `0` if the two dates are equal.\n */\n static compareDates(firstDate: Date, secondDate: Date): -1 | 0 | 1;\n static compareDates(firstDate: number, secondDate: number): -1 | 0 | 1;\n static compareDates(firstDate: Date | number, secondDate: Date | number): -1 | 0 | 1 {\n const first = typeof firstDate === 'number' ? new Date(firstDate) : firstDate;\n const second = typeof secondDate === 'number' ? new Date(secondDate) : secondDate;\n\n return compareAsc(first, second) as -1 | 0 | 1;\n }\n\n /**\n * Adds a duration (e.g., days, months, years) to a given date or timestamp.\n * @param date The base date or timestamp to which the duration will be added.\n * @param duration An object specifying the duration (e.g., `{ days: 1, months: 2 }`).\n * @returns A new Date object with the duration added.\n */\n static addDuration(date: Date, duration: Duration): Date;\n static addDuration(date: number, duration: Duration): Date;\n static addDuration(date: Date | number, duration: Duration): Date {\n const normalizedDate = typeof date === 'number' ? new Date(date) : date;\n return add(normalizedDate, duration);\n }\n\n /**\n * Determines whether a given year is a leap year.\n * @param year The year to check.\n * @returns `true` if the year is a leap year, otherwise `false`.\n */\n static isLeapYear(year: number): boolean {\n return isLeapYear(DateUtil.readDate(year.toString(), 'yyyy', \"UTC\"));\n }\n\n\n /**\n * Converts a timestamp (in milliseconds) to a Date object.\n * @param milliseconds The timestamp in milliseconds since the Unix epoch.\n * @returns A Date object representing the provided timestamp.\n */\n static fromMillis(milliseconds: number): Date {\n return new Date(milliseconds);\n }\n\n /**\n * Converts a Date object to a timestamp (in milliseconds).\n * @param date The Date object to convert.\n * @returns The timestamp in milliseconds since the Unix epoch.\n */\n static toMillis(date: Date): number {\n return date.getTime();\n }\n}\n"],"names":[],"mappings":";;;;AAIA;;;AAGG;MACU,QAAQ,CAAA;aAED,IAAA,CAAA,eAAe,GAAG,8BAA8B,CAAA;AAEhE;;;;AAIG;IACH,OAAO,GAAG,CAAC,QAAgB,EAAA;QACvB,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,CAAC;IAC3C;AAEA;;;AAGG;AACH,IAAA,OAAO,WAAW,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,GAAG,EAAE;IACrB;AAEA;;;;;;;AAOG;IACH,OAAO,QAAQ,CAAC,UAAkB,EAAE,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,QAAgB,EAAA;AACnF,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC/D,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAChB,YA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,MAAM,CAAe;IAClD;AAUA,IAAA,OAAO,WAAW,CAAC,IAAmB,EAAE,QAAkB,EAAA;AACtD,QAAA,MAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;AACvE,QAAA,OAAO,GAAG,CAAC,cAAc,EAAE,QAAQ,CAAC;IACxC;AAEA;;;;AAIG;IACH,OAAO,UAAU,CAAC,IAAY,EAAA;AAC1B,QAAA,OAAO,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACxE;AAGA;;;;AAIG;IACH,OAAO,UAAU,CAAC,YAAoB,EAAA;AAClC,QAAA,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC;IACjC;AAEA;;;;AAIG;IACH,OAAO,QAAQ,CAAC,IAAU,EAAA;AACtB,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACzB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseObject.cjs","sources":["../../../src/beans/BaseObject.ts"],"sourcesContent":["import { Expose } from 'class-transformer';\r\nimport { IsNumber, IsString } from 'class-validator';\r\n\r\n/**\r\n * The `BaseObject` class serves as a base model for objects with common properties\r\n * such as `id`, `description`, `createdAt`, and `updatedAt`. It includes validation\r\n * and transformation decorators for serialization and deserialization.\r\n *\r\n * Properties:\r\n * - `id` (string | undefined): A unique identifier for the object.\r\n * - `description` (string | undefined): A brief description of the object.\r\n * - `createdAt` (number | undefined): The timestamp when the object was created.\r\n * - `updatedAt` (number | undefined): The timestamp when the object was last updated.\r\n *\r\n * Methods:\r\n * - `getId()`: Returns the `id` of the object.\r\n * - `setId(value: string | undefined)`: Sets the `id` of the object.\r\n * - `getDescription()`: Returns the `description` of the object.\r\n * - `setDescription(value: string | undefined)`: Sets the `description` of the object.\r\n * - `getCreatedAt()`: Returns the `createdAt` timestamp of the object.\r\n * - `setCreatedAt(value?: number)`: Sets the `createdAt` timestamp of the object.\r\n * - `getUpdatedAt()`: Returns the `updatedAt` timestamp of the object.\r\n * - `setUpdatedAt(value?: number)`: Sets the `updatedAt` timestamp of the object.\r\n */\r\nexport class BaseObject {\r\n\r\n @Expose({ name: 'id' })\r\n @IsString()\r\n private id?: string;\r\n\r\n @Expose({ name: 'description' })\r\n @IsString()\r\n private description?: string;\r\n\r\n @Expose({ name: 'created_at' })\r\n @IsNumber()\r\n private createdAt?: number;\r\n\r\n @Expose({ name: 'updated_at' })\r\n @IsNumber()\r\n private updatedAt?: number;\r\n\r\n getId() {\r\n return this.id;\r\n }\r\n\r\n setId(value: string | undefined) {\r\n this.id = value;\r\n }\r\n\r\n getCreatedAt() {\r\n return this.createdAt;\r\n }\r\n\r\n setCreatedAt(value?: number) {\r\n this.createdAt = value;\r\n }\r\n\r\n getUpdatedAt() {\r\n return this.updatedAt;\r\n }\r\n\r\n setUpdatedAt(value?: number) {\r\n this.updatedAt = value;\r\n }\r\n\r\n getDescription() {\r\n return this.description;\r\n }\r\n\r\n setDescription(value?: string) {\r\n this.description = value;\r\n }\r\n}"],"names":["__decorate","Expose","IsString","IsNumber"],"mappings":";;;;;;AAGA;;;;;;;;;;;;;;;;;;;;AAoBG;MACU,UAAU,CAAA;IAkBnB,KAAK,GAAA;QACD,OAAO,IAAI,CAAC,EAAE;;AAGlB,IAAA,KAAK,CAAC,KAAyB,EAAA;AAC3B,QAAA,IAAI,CAAC,EAAE,GAAG,KAAK;;IAGnB,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;;AAGzB,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;;IAG1B,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;;AAGzB,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;;IAG1B,cAAc,GAAA;QACV,OAAO,IAAI,CAAC,WAAW;;AAG3B,IAAA,cAAc,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;;AAE/B;AA7CWA,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACtB,IAAAC,uBAAQ,EAAE;;AACS,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,IAAA,EAAA,MAAA,CAAA;AAIZF,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAC/B,IAAAC,uBAAQ,EAAE;;AACkB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAIrBF,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAAE,uBAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAInBH,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAAE,uBAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"BaseObject.cjs","sources":["../../../src/beans/BaseObject.ts"],"sourcesContent":["import { Expose } from 'class-transformer';\nimport { IsNumber, IsString } from 'class-validator';\n\n/**\n * The `BaseObject` class serves as a base model for objects with common properties\n * such as `id`, `description`, `createdAt`, and `updatedAt`. It includes validation\n * and transformation decorators for serialization and deserialization.\n *\n * Properties:\n * - `id` (string | undefined): A unique identifier for the object.\n * - `description` (string | undefined): A brief description of the object.\n * - `createdAt` (number | undefined): The timestamp when the object was created.\n * - `updatedAt` (number | undefined): The timestamp when the object was last updated.\n *\n * Methods:\n * - `getId()`: Returns the `id` of the object.\n * - `setId(value: string | undefined)`: Sets the `id` of the object.\n * - `getDescription()`: Returns the `description` of the object.\n * - `setDescription(value: string | undefined)`: Sets the `description` of the object.\n * - `getCreatedAt()`: Returns the `createdAt` timestamp of the object.\n * - `setCreatedAt(value?: number)`: Sets the `createdAt` timestamp of the object.\n * - `getUpdatedAt()`: Returns the `updatedAt` timestamp of the object.\n * - `setUpdatedAt(value?: number)`: Sets the `updatedAt` timestamp of the object.\n */\nexport class BaseObject {\n\n @Expose({ name: 'id' })\n @IsString()\n private id?: string;\n\n @Expose({ name: 'description' })\n @IsString()\n private description?: string;\n\n @Expose({ name: 'created_at' })\n @IsNumber()\n private createdAt?: number;\n\n @Expose({ name: 'updated_at' })\n @IsNumber()\n private updatedAt?: number;\n\n getId() {\n return this.id;\n }\n\n setId(value: string | undefined) {\n this.id = value;\n }\n\n getCreatedAt() {\n return this.createdAt;\n }\n\n setCreatedAt(value?: number) {\n this.createdAt = value;\n }\n\n getUpdatedAt() {\n return this.updatedAt;\n }\n\n setUpdatedAt(value?: number) {\n this.updatedAt = value;\n }\n\n getDescription() {\n return this.description;\n }\n\n setDescription(value?: string) {\n this.description = value;\n }\n}"],"names":["__decorate","Expose","IsString","IsNumber"],"mappings":";;;;;;AAGA;;;;;;;;;;;;;;;;;;;;AAoBG;MACU,UAAU,CAAA;IAkBnB,KAAK,GAAA;QACD,OAAO,IAAI,CAAC,EAAE;IAClB;AAEA,IAAA,KAAK,CAAC,KAAyB,EAAA;AAC3B,QAAA,IAAI,CAAC,EAAE,GAAG,KAAK;IACnB;IAEA,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;IACzB;AAEA,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;IAC1B;IAEA,YAAY,GAAA;QACR,OAAO,IAAI,CAAC,SAAS;IACzB;AAEA,IAAA,YAAY,CAAC,KAAc,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;IAC1B;IAEA,cAAc,GAAA;QACV,OAAO,IAAI,CAAC,WAAW;IAC3B;AAEA,IAAA,cAAc,CAAC,KAAc,EAAA;AACzB,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK;IAC5B;AACH;AA7CWA,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACtB,IAAAC,uBAAQ,EAAE;;AACS,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,IAAA,EAAA,MAAA,CAAA;AAIZF,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAC/B,IAAAC,uBAAQ,EAAE;;AACkB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAIrBF,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAAE,uBAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAInBH,gBAAA,CAAA;AAFP,IAAAC,uBAAM,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,IAAAE,uBAAQ,EAAE;;AACgB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;;;;"}
@@ -27,7 +27,6 @@ exports.IllegalArgumentException = IllegalArgumentException.IllegalArgumentExcep
27
27
  exports.UnauthorizedException = UnauthorizedException.UnauthorizedException;
28
28
  exports.ConverterException = ConverterException.ConverterException;
29
29
  exports.LoggerFactory = LoggerFactory.LoggerFactory;
30
- exports.loggers = LoggerFactory.loggers;
31
30
  exports.JSONArray = JSONObject.JSONArray;
32
31
  exports.JSONObject = JSONObject.JSONObject;
33
32
  Object.defineProperty(exports, "LoggingLevel", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadRequestException.cjs","sources":["../../../src/exceptions/BadRequestException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown when a bad request is made to the server.\r\n * Typically used for HTTP 400 errors.\r\n */\r\nexport class BadRequestException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown, code: number = 400) {\r\n super(message, cause, code)\r\n }\r\n}\r\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,mBAAoB,SAAQA,2BAAa,CAAA;AAElD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;;AAElC;;;;"}
1
+ {"version":3,"file":"BadRequestException.cjs","sources":["../../../src/exceptions/BadRequestException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown when a bad request is made to the server.\n * Typically used for HTTP 400 errors.\n */\nexport class BadRequestException extends HTTPException {\n\n constructor(message: string, cause?: unknown, code: number = 400) {\n super(message, cause, code)\n }\n}\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,mBAAoB,SAAQA,2BAAa,CAAA;AAElD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;IAC/B;AACH;;;;"}
@@ -7,30 +7,10 @@
7
7
  */
8
8
  class BaseException extends Error {
9
9
  constructor(message, cause, code) {
10
- super(message);
11
- this.cause = cause;
10
+ super(message, { cause });
12
11
  this.code = code;
13
12
  this.name = this.constructor.name;
14
13
  }
15
- /**
16
- * Retrieves the full stack trace of the exception, including causes.
17
- * @returns A string representation of the stack trace.
18
- */
19
- getStackTrace() {
20
- let stackTrace = `[${this.code}] ${this.stack}\n`;
21
- let currentCause = this.cause;
22
- while (currentCause) {
23
- if (currentCause instanceof Error) {
24
- stackTrace += `Caused by: ${currentCause.stack || currentCause.message || String(currentCause)}\n`;
25
- currentCause = currentCause.cause;
26
- }
27
- else {
28
- stackTrace += `Caused by: ${String(currentCause)}\n`;
29
- currentCause = undefined;
30
- }
31
- }
32
- return stackTrace;
33
- }
34
14
  }
35
15
 
36
16
  exports.BaseException = BaseException;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseException.cjs","sources":["../../../src/exceptions/BaseException.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\n/**\r\n * Base class for all custom exceptions in the application.\r\n * Provides support for error codes and chained exceptions.\r\n */\r\nexport class BaseException extends Error {\r\n code?: number;\r\n cause?: unknown;\r\n\r\n constructor(message: string, cause?: unknown, code?: number) {\r\n super(message);\r\n this.cause = cause;\r\n this.code = code;\r\n this.name = this.constructor.name;\r\n }\r\n\r\n /**\r\n * Retrieves the full stack trace of the exception, including causes.\r\n * @returns A string representation of the stack trace.\r\n */\r\n getStackTrace() {\r\n let stackTrace = `[${this.code}] ${this.stack}\\n`;\r\n let currentCause: unknown = this.cause;\r\n while (currentCause) {\r\n if (currentCause instanceof Error) {\r\n stackTrace += `Caused by: ${currentCause.stack || currentCause.message || String(currentCause)}\\n`;\r\n currentCause = (currentCause as any).cause;\r\n } else {\r\n stackTrace += `Caused by: ${String(currentCause)}\\n`;\r\n currentCause = undefined;\r\n }\r\n }\r\n return stackTrace;\r\n }\r\n}"],"names":[],"mappings":";;AAAA;AACA;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AAIpC,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,IAAa,EAAA;QACvD,KAAK,CAAC,OAAO,CAAC;AACd,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI;;AAGrC;;;AAGG;IACH,aAAa,GAAA;QACT,IAAI,UAAU,GAAG,CAAA,CAAA,EAAI,IAAI,CAAC,IAAI,CAAA,EAAA,EAAK,IAAI,CAAC,KAAK,CAAA,EAAA,CAAI;AACjD,QAAA,IAAI,YAAY,GAAY,IAAI,CAAC,KAAK;QACtC,OAAO,YAAY,EAAE;AACjB,YAAA,IAAI,YAAY,YAAY,KAAK,EAAE;AAC/B,gBAAA,UAAU,IAAI,CAAA,WAAA,EAAc,YAAY,CAAC,KAAK,IAAI,YAAY,CAAC,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI;AAClG,gBAAA,YAAY,GAAI,YAAoB,CAAC,KAAK;;iBACvC;AACH,gBAAA,UAAU,IAAI,CAAc,WAAA,EAAA,MAAM,CAAC,YAAY,CAAC,IAAI;gBACpD,YAAY,GAAG,SAAS;;;AAGhC,QAAA,OAAO,UAAU;;AAExB;;;;"}
1
+ {"version":3,"file":"BaseException.cjs","sources":["../../../src/exceptions/BaseException.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Base class for all custom exceptions in the application.\n * Provides support for error codes and chained exceptions.\n */\nexport class BaseException extends Error {\n code?: number;\n\n constructor(message: string, cause?: unknown, code?: number) {\n super(message,{ cause });\n this.code = code;\n this.name = this.constructor.name;\n }\n}"],"names":[],"mappings":";;AAAA;AACA;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AAGpC,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,IAAa,EAAA;AACvD,QAAA,KAAK,CAAC,OAAO,EAAC,EAAE,KAAK,EAAE,CAAC;AACxB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI;IACrC;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ClientException.cjs","sources":["../../../src/exceptions/ClientException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown for client-side errors.\r\n * Typically used for HTTP 4xx errors.\r\n */\r\nexport class ClientException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown, code: number = 500) {\r\n super(message, cause, code);\r\n }\r\n}\r\n\r\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,eAAgB,SAAQA,2BAAa,CAAA;AAE9C,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;;AAElC;;;;"}
1
+ {"version":3,"file":"ClientException.cjs","sources":["../../../src/exceptions/ClientException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown for client-side errors.\n * Typically used for HTTP 4xx errors.\n */\nexport class ClientException extends HTTPException {\n\n constructor(message: string, cause?: unknown, code: number = 500) {\n super(message, cause, code);\n }\n}\n\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,eAAgB,SAAQA,2BAAa,CAAA;AAE9C,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;IAC/B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConverterException.cjs","sources":["../../../src/exceptions/ConverterException.ts"],"sourcesContent":["import { BaseException } from \"./BaseException\";\r\n\r\n/**\r\n * Exception thrown when a conversion operation fails.\r\n */\r\nexport class ConverterException extends BaseException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 500);\r\n }\r\n}\r\n\r\n"],"names":["BaseException"],"mappings":";;;;AAEA;;AAEG;AACG,MAAO,kBAAmB,SAAQA,2BAAa,CAAA;IAEjD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"ConverterException.cjs","sources":["../../../src/exceptions/ConverterException.ts"],"sourcesContent":["import { BaseException } from \"./BaseException\";\n\n/**\n * Exception thrown when a conversion operation fails.\n */\nexport class ConverterException extends BaseException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 500);\n }\n}\n\n"],"names":["BaseException"],"mappings":";;;;AAEA;;AAEG;AACG,MAAO,kBAAmB,SAAQA,2BAAa,CAAA;IAEjD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ForbiddenAccessException.cjs","sources":["../../../src/exceptions/ForbiddenAccessException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown when access to a resource is forbidden.\r\n * Typically used for HTTP 403 errors.\r\n */\r\nexport class ForbiddenAccessException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 403);\r\n }\r\n}\r\n\r\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,wBAAyB,SAAQA,2BAAa,CAAA;IAEvD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"ForbiddenAccessException.cjs","sources":["../../../src/exceptions/ForbiddenAccessException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown when access to a resource is forbidden.\n * Typically used for HTTP 403 errors.\n */\nexport class ForbiddenAccessException extends HTTPException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 403);\n }\n}\n\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,wBAAyB,SAAQA,2BAAa,CAAA;IAEvD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HTTPException.cjs","sources":["../../../src/exceptions/HTTPException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\r\n\r\n/**\r\n * Base class for HTTP-related exceptions.\r\n * Provides support for HTTP status codes.\r\n */\r\nexport abstract class HTTPException extends BaseException {\r\n\r\n constructor(message: string, cause?: unknown, code: number = 500) {\r\n super(message, cause, code);\r\n }\r\n\r\n}"],"names":["BaseException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAgB,aAAc,SAAQA,2BAAa,CAAA;AAErD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;;AAGlC;;;;"}
1
+ {"version":3,"file":"HTTPException.cjs","sources":["../../../src/exceptions/HTTPException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\n\n/**\n * Base class for HTTP-related exceptions.\n * Provides support for HTTP status codes.\n */\nexport abstract class HTTPException extends BaseException {\n\n constructor(message: string, cause?: unknown, code: number = 500) {\n super(message, cause, code);\n }\n\n}"],"names":["BaseException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAgB,aAAc,SAAQA,2BAAa,CAAA;AAErD,IAAA,WAAA,CAAY,OAAe,EAAE,KAAe,EAAE,OAAe,GAAG,EAAA;AAC5D,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC;IAC/B;AAEH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IllegalArgumentException.cjs","sources":["../../../src/exceptions/IllegalArgumentException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\r\n\r\n/**\r\n * Exception thrown when an illegal or inappropriate argument is passed.\r\n */\r\nexport class IllegalArgumentException extends BaseException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 500);\r\n }\r\n}\r\n\r\n"],"names":["BaseException"],"mappings":";;;;AAEA;;AAEG;AACG,MAAO,wBAAyB,SAAQA,2BAAa,CAAA;IAEvD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"IllegalArgumentException.cjs","sources":["../../../src/exceptions/IllegalArgumentException.ts"],"sourcesContent":["import { BaseException } from './BaseException';\n\n/**\n * Exception thrown when an illegal or inappropriate argument is passed.\n */\nexport class IllegalArgumentException extends BaseException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 500);\n }\n}\n\n"],"names":["BaseException"],"mappings":";;;;AAEA;;AAEG;AACG,MAAO,wBAAyB,SAAQA,2BAAa,CAAA;IAEvD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnauthorizedException.cjs","sources":["../../../src/exceptions/UnauthorizedException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\r\n\r\n/**\r\n * Exception thrown when a request is unauthorized.\r\n * Typically used for HTTP 401 errors.\r\n */\r\nexport class UnauthorizedException extends HTTPException {\r\n\r\n constructor(message: string, cause?: unknown) {\r\n super(message, cause, 401);\r\n }\r\n}\r\n\r\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,qBAAsB,SAAQA,2BAAa,CAAA;IAEpD,WAAY,CAAA,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;;AAEjC;;;;"}
1
+ {"version":3,"file":"UnauthorizedException.cjs","sources":["../../../src/exceptions/UnauthorizedException.ts"],"sourcesContent":["import { HTTPException } from './HTTPException';\n\n/**\n * Exception thrown when a request is unauthorized.\n * Typically used for HTTP 401 errors.\n */\nexport class UnauthorizedException extends HTTPException {\n\n constructor(message: string, cause?: unknown) {\n super(message, cause, 401);\n }\n}\n\n"],"names":["HTTPException"],"mappings":";;;;AAEA;;;AAGG;AACG,MAAO,qBAAsB,SAAQA,2BAAa,CAAA;IAEpD,WAAA,CAAY,OAAe,EAAE,KAAe,EAAA;AACxC,QAAA,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC;IAC9B;AACH;;;;"}