@plyaz/types 1.7.7 → 1.7.9

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 (121) hide show
  1. package/dist/api/index.cjs +4 -0
  2. package/dist/api/index.cjs.map +1 -0
  3. package/dist/api/index.js +3 -0
  4. package/dist/api/index.js.map +1 -0
  5. package/dist/auth/index.cjs +45 -0
  6. package/dist/auth/index.cjs.map +1 -0
  7. package/dist/auth/index.js +41 -0
  8. package/dist/auth/index.js.map +1 -0
  9. package/dist/common/index.cjs +4 -0
  10. package/dist/common/index.cjs.map +1 -0
  11. package/dist/common/index.js +3 -0
  12. package/dist/common/index.js.map +1 -0
  13. package/dist/entities/index.cjs +4 -0
  14. package/dist/entities/index.cjs.map +1 -0
  15. package/dist/entities/index.js +3 -0
  16. package/dist/entities/index.js.map +1 -0
  17. package/dist/errors/constants/errors-codes.d.ts +58 -0
  18. package/dist/errors/index.cjs +47 -0
  19. package/dist/errors/index.cjs.map +1 -0
  20. package/dist/errors/index.js +43 -0
  21. package/dist/errors/index.js.map +1 -0
  22. package/dist/errors/types.d.ts +3 -0
  23. package/dist/events/index.cjs +37 -0
  24. package/dist/events/index.cjs.map +1 -0
  25. package/dist/events/index.js +33 -0
  26. package/dist/events/index.js.map +1 -0
  27. package/dist/features/cache/index.cjs +4 -0
  28. package/dist/features/cache/index.cjs.map +1 -0
  29. package/dist/features/cache/index.js +3 -0
  30. package/dist/features/cache/index.js.map +1 -0
  31. package/dist/features/community/blog/index.cjs +4 -0
  32. package/dist/features/community/blog/index.cjs.map +1 -0
  33. package/dist/features/community/blog/index.js +3 -0
  34. package/dist/features/community/blog/index.js.map +1 -0
  35. package/dist/features/community/blog/providers/index.cjs +4 -0
  36. package/dist/features/community/blog/providers/index.cjs.map +1 -0
  37. package/dist/features/community/blog/providers/index.js +3 -0
  38. package/dist/features/community/blog/providers/index.js.map +1 -0
  39. package/dist/features/community/blog/providers/wordpress/index.cjs +4 -0
  40. package/dist/features/community/blog/providers/wordpress/index.cjs.map +1 -0
  41. package/dist/features/community/blog/providers/wordpress/index.js +3 -0
  42. package/dist/features/community/blog/providers/wordpress/index.js.map +1 -0
  43. package/dist/features/community/index.cjs +4 -0
  44. package/dist/features/community/index.cjs.map +1 -0
  45. package/dist/features/community/index.js +3 -0
  46. package/dist/features/community/index.js.map +1 -0
  47. package/dist/features/feature-flag/index.cjs +4 -0
  48. package/dist/features/feature-flag/index.cjs.map +1 -0
  49. package/dist/features/feature-flag/index.js +3 -0
  50. package/dist/features/feature-flag/index.js.map +1 -0
  51. package/dist/features/index.cjs +4 -0
  52. package/dist/features/index.cjs.map +1 -0
  53. package/dist/features/index.js +3 -0
  54. package/dist/features/index.js.map +1 -0
  55. package/dist/index.cjs +142 -0
  56. package/dist/index.cjs.map +1 -0
  57. package/dist/lib/index.cjs +4 -0
  58. package/dist/lib/index.cjs.map +1 -0
  59. package/dist/lib/index.js +3 -0
  60. package/dist/lib/index.js.map +1 -0
  61. package/dist/store/index.cjs +4 -0
  62. package/dist/store/index.cjs.map +1 -0
  63. package/dist/store/index.js +3 -0
  64. package/dist/store/index.js.map +1 -0
  65. package/dist/testing/common/assertions/index.cjs +4 -0
  66. package/dist/testing/common/assertions/index.cjs.map +1 -0
  67. package/dist/testing/common/assertions/index.js +3 -0
  68. package/dist/testing/common/assertions/index.js.map +1 -0
  69. package/dist/testing/common/factories/index.cjs +4 -0
  70. package/dist/testing/common/factories/index.cjs.map +1 -0
  71. package/dist/testing/common/factories/index.js +3 -0
  72. package/dist/testing/common/factories/index.js.map +1 -0
  73. package/dist/testing/common/index.cjs +4 -0
  74. package/dist/testing/common/index.cjs.map +1 -0
  75. package/dist/testing/common/index.js +3 -0
  76. package/dist/testing/common/index.js.map +1 -0
  77. package/dist/testing/common/mocks/index.cjs +4 -0
  78. package/dist/testing/common/mocks/index.cjs.map +1 -0
  79. package/dist/testing/common/mocks/index.js +3 -0
  80. package/dist/testing/common/mocks/index.js.map +1 -0
  81. package/dist/testing/common/patterns/index.cjs +4 -0
  82. package/dist/testing/common/patterns/index.cjs.map +1 -0
  83. package/dist/testing/common/patterns/index.js +3 -0
  84. package/dist/testing/common/patterns/index.js.map +1 -0
  85. package/dist/testing/common/utils/index.cjs +4 -0
  86. package/dist/testing/common/utils/index.cjs.map +1 -0
  87. package/dist/testing/common/utils/index.js +3 -0
  88. package/dist/testing/common/utils/index.js.map +1 -0
  89. package/dist/testing/common/wrappers/index.cjs +4 -0
  90. package/dist/testing/common/wrappers/index.cjs.map +1 -0
  91. package/dist/testing/common/wrappers/index.js +3 -0
  92. package/dist/testing/common/wrappers/index.js.map +1 -0
  93. package/dist/testing/features/cache/index.cjs +4 -0
  94. package/dist/testing/features/cache/index.cjs.map +1 -0
  95. package/dist/testing/features/cache/index.js +3 -0
  96. package/dist/testing/features/cache/index.js.map +1 -0
  97. package/dist/testing/features/feature-flags/index.cjs +4 -0
  98. package/dist/testing/features/feature-flags/index.cjs.map +1 -0
  99. package/dist/testing/features/feature-flags/index.js +3 -0
  100. package/dist/testing/features/feature-flags/index.js.map +1 -0
  101. package/dist/testing/features/index.cjs +4 -0
  102. package/dist/testing/features/index.cjs.map +1 -0
  103. package/dist/testing/features/index.js +3 -0
  104. package/dist/testing/features/index.js.map +1 -0
  105. package/dist/testing/index.cjs +4 -0
  106. package/dist/testing/index.cjs.map +1 -0
  107. package/dist/testing/index.js +3 -0
  108. package/dist/testing/index.js.map +1 -0
  109. package/dist/translations/index.cjs +4 -0
  110. package/dist/translations/index.cjs.map +1 -0
  111. package/dist/translations/index.js +3 -0
  112. package/dist/translations/index.js.map +1 -0
  113. package/dist/ui/index.cjs +4 -0
  114. package/dist/ui/index.cjs.map +1 -0
  115. package/dist/ui/index.js +3 -0
  116. package/dist/ui/index.js.map +1 -0
  117. package/dist/web3/index.cjs +31 -0
  118. package/dist/web3/index.cjs.map +1 -0
  119. package/dist/web3/index.js +29 -0
  120. package/dist/web3/index.js.map +1 -0
  121. package/package.json +151 -12
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ // @plyaz package - Built with tsup
4
+
5
+ // src/auth/enums.ts
6
+ var USER_ROLE = {
7
+ /** A user who is an athlete and participates in sports activities. */
8
+ Athlete: "athlete",
9
+ /** A user who scouts and discovers talent. */
10
+ Scout: "scout",
11
+ /** A user who acts as an agent representing athletes or clubs. */
12
+ Agent: "agent",
13
+ /** A user representing a sports club or organization. */
14
+ Club: "club",
15
+ /** A fan or supporter of athletes or clubs. */
16
+ Fan: "fan",
17
+ /** A system administrator with access to management tools. */
18
+ Admin: "admin",
19
+ /** A super admin with the highest level of access and control. */
20
+ SuperAdmin: "super.admin"
21
+ };
22
+ var USER_STATUS = {
23
+ /** Active user with full access. */
24
+ Active: "active",
25
+ /** Inactive user, typically not currently using the platform. */
26
+ Inactive: "inactive",
27
+ /** User account is awaiting approval or completion of setup. */
28
+ Pending: "pending",
29
+ /** User has been temporarily suspended due to policy violations or manual review. */
30
+ Suspended: "suspended",
31
+ /** User has been permanently banned from the platform. */
32
+ Banned: "banned"
33
+ };
34
+ var AUTH_PROVIDER = {
35
+ /** Authentication via email and password. */
36
+ Email: "email",
37
+ /** Authentication via connected blockchain wallet. */
38
+ Wallet: "wallet"
39
+ };
40
+
41
+ exports.AUTH_PROVIDER = AUTH_PROVIDER;
42
+ exports.USER_ROLE = USER_ROLE;
43
+ exports.USER_STATUS = USER_STATUS;
44
+ //# sourceMappingURL=index.cjs.map
45
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/auth/enums.ts"],"names":[],"mappings":";;;;;AAYO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAcO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ;AACV;AAcO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,MAAA,EAAQ;AACV","file":"index.cjs","sourcesContent":["/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n/**\n * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n *\n * @example\n * ```typescript\n * import { AUTH_PROVIDER } from '@plyaz/types';\n *\n * const provider = AUTH_PROVIDER.Wallet; // 'wallet'\n * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;\n * ```\n */\nexport const AUTH_PROVIDER = {\n /** Authentication via email and password. */\n Email: 'email',\n\n /** Authentication via connected blockchain wallet. */\n Wallet: 'wallet',\n} as const;\n"]}
@@ -0,0 +1,41 @@
1
+ // @plyaz package - Built with tsup
2
+
3
+ // src/auth/enums.ts
4
+ var USER_ROLE = {
5
+ /** A user who is an athlete and participates in sports activities. */
6
+ Athlete: "athlete",
7
+ /** A user who scouts and discovers talent. */
8
+ Scout: "scout",
9
+ /** A user who acts as an agent representing athletes or clubs. */
10
+ Agent: "agent",
11
+ /** A user representing a sports club or organization. */
12
+ Club: "club",
13
+ /** A fan or supporter of athletes or clubs. */
14
+ Fan: "fan",
15
+ /** A system administrator with access to management tools. */
16
+ Admin: "admin",
17
+ /** A super admin with the highest level of access and control. */
18
+ SuperAdmin: "super.admin"
19
+ };
20
+ var USER_STATUS = {
21
+ /** Active user with full access. */
22
+ Active: "active",
23
+ /** Inactive user, typically not currently using the platform. */
24
+ Inactive: "inactive",
25
+ /** User account is awaiting approval or completion of setup. */
26
+ Pending: "pending",
27
+ /** User has been temporarily suspended due to policy violations or manual review. */
28
+ Suspended: "suspended",
29
+ /** User has been permanently banned from the platform. */
30
+ Banned: "banned"
31
+ };
32
+ var AUTH_PROVIDER = {
33
+ /** Authentication via email and password. */
34
+ Email: "email",
35
+ /** Authentication via connected blockchain wallet. */
36
+ Wallet: "wallet"
37
+ };
38
+
39
+ export { AUTH_PROVIDER, USER_ROLE, USER_STATUS };
40
+ //# sourceMappingURL=index.js.map
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/auth/enums.ts"],"names":[],"mappings":";;;AAYO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAcO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ;AACV;AAcO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,MAAA,EAAQ;AACV","file":"index.js","sourcesContent":["/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n *\n * @example\n * ```typescript\n * import { USER_ROLE } from '@plyaz/types';\n *\n * const userRole = USER_ROLE.Athlete; // 'athlete'\n * const isAdmin = userRole === USER_ROLE.Admin || userRole === USER_ROLE.SuperAdmin;\n * ```\n */\nexport const USER_ROLE = {\n /** A user who is an athlete and participates in sports activities. */\n Athlete: 'athlete',\n\n /** A user who scouts and discovers talent. */\n Scout: 'scout',\n\n /** A user who acts as an agent representing athletes or clubs. */\n Agent: 'agent',\n\n /** A user representing a sports club or organization. */\n Club: 'club',\n\n /** A fan or supporter of athletes or clubs. */\n Fan: 'fan',\n\n /** A system administrator with access to management tools. */\n Admin: 'admin',\n\n /** A super admin with the highest level of access and control. */\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n *\n * @example\n * ```typescript\n * import { USER_STATUS } from '@plyaz/types';\n *\n * const isAccessible = status === USER_STATUS.Active;\n * const needsReview = status === USER_STATUS.Pending;\n * ```\n */\nexport const USER_STATUS = {\n /** Active user with full access. */\n Active: 'active',\n\n /** Inactive user, typically not currently using the platform. */\n Inactive: 'inactive',\n\n /** User account is awaiting approval or completion of setup. */\n Pending: 'pending',\n\n /** User has been temporarily suspended due to policy violations or manual review. */\n Suspended: 'suspended',\n\n /** User has been permanently banned from the platform. */\n Banned: 'banned',\n} as const;\n\n/**\n * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n *\n * @example\n * ```typescript\n * import { AUTH_PROVIDER } from '@plyaz/types';\n *\n * const provider = AUTH_PROVIDER.Wallet; // 'wallet'\n * const isWeb3Auth = provider === AUTH_PROVIDER.Wallet;\n * ```\n */\nexport const AUTH_PROVIDER = {\n /** Authentication via email and password. */\n Email: 'email',\n\n /** Authentication via connected blockchain wallet. */\n Wallet: 'wallet',\n} as const;\n"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,58 @@
1
+ export declare const ERRORS_CODES: {
2
+ readonly validation_error: {
3
+ readonly status: 400;
4
+ readonly message: "errors.validation.error";
5
+ };
6
+ readonly unauthorized: {
7
+ readonly status: 401;
8
+ readonly message: "errors.auth.unauthorized";
9
+ };
10
+ readonly payment_failed: {
11
+ readonly status: 402;
12
+ readonly message: "errors.payment.failed";
13
+ };
14
+ readonly forbidden: {
15
+ readonly status: 403;
16
+ readonly message: "errors.auth.forbidden";
17
+ };
18
+ readonly not_found: {
19
+ readonly status: 404;
20
+ readonly message: "errors.common.notFound";
21
+ };
22
+ readonly method_not_allowed: {
23
+ readonly status: 405;
24
+ readonly message: "errors.common.methodNotAllowed";
25
+ };
26
+ readonly user_already_exists: {
27
+ readonly status: 409;
28
+ readonly message: "errors.user.alreadyExists";
29
+ };
30
+ readonly unprocessable_entity: {
31
+ readonly status: 422;
32
+ readonly message: "errors.validation.unprocessable";
33
+ };
34
+ readonly too_many_requests: {
35
+ readonly status: 429;
36
+ readonly message: "errors.rateLimit.tooManyRequests";
37
+ };
38
+ readonly internal_server_error: {
39
+ readonly status: 500;
40
+ readonly message: "errors.server.internal";
41
+ };
42
+ readonly not_implemented: {
43
+ readonly status: 501;
44
+ readonly message: "errors.server.notImplemented";
45
+ };
46
+ readonly bad_gateway: {
47
+ readonly status: 502;
48
+ readonly message: "errors.server.badGateway";
49
+ };
50
+ readonly service_unavailable: {
51
+ readonly status: 503;
52
+ readonly message: "errors.server.serviceUnavailable";
53
+ };
54
+ readonly gateway_timeout: {
55
+ readonly status: 504;
56
+ readonly message: "errors.server.gatewayTimeout";
57
+ };
58
+ };
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ // @plyaz package - Built with tsup
4
+
5
+ // src/errors/enums.ts
6
+ var ERROR_TYPE = {
7
+ /** A general validation error (e.g., form or input errors). */
8
+ ValidationError: "validation.error",
9
+ /** Error related to schema validation, such as JSON schema or API payload checks. */
10
+ SchemaValidationError: "validation.schema.error",
11
+ /** Unhandled or unexpected system error. */
12
+ InternalError: "system.internal.error",
13
+ /** System dependency is currently unavailable (e.g., database or external API). */
14
+ ServiceUnavailable: "system.service.unavailable",
15
+ /** The request took too long and timed out. */
16
+ TimeoutError: "system.timeout",
17
+ /** Too many requests made in a short period of time. */
18
+ RateLimitExceeded: "system.rate.limit.exceeded"
19
+ };
20
+ var ERROR_SEVERITY = {
21
+ /** Low severity - does not impact functionality significantly. */
22
+ Low: "low",
23
+ /** Medium severity - minor disruption or warning. */
24
+ Medium: "medium",
25
+ /** High severity - major issue requiring attention. */
26
+ High: "high",
27
+ /** Critical severity - blocking or crashing issue. */
28
+ Critical: "critical"
29
+ };
30
+ var ERROR_CATEGORY = {
31
+ /** Client-side error (e.g., invalid request). */
32
+ Client: "client",
33
+ /** Server-side error (e.g., logic failure or exception). */
34
+ Server: "server",
35
+ /** Network-related error (e.g., unreachable endpoint). */
36
+ Network: "network",
37
+ /** Blockchain-related error (e.g., transaction failure, gas limit). */
38
+ Blockchain: "blockchain",
39
+ // Validation-specific error (e.g., failed constraints or field errors).
40
+ Validation: "validation"
41
+ };
42
+
43
+ exports.ERROR_CATEGORY = ERROR_CATEGORY;
44
+ exports.ERROR_SEVERITY = ERROR_SEVERITY;
45
+ exports.ERROR_TYPE = ERROR_TYPE;
46
+ //# sourceMappingURL=index.cjs.map
47
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/errors/enums.ts"],"names":[],"mappings":";;;;;AAgBO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,eAAA,EAAiB,kBAAA;AAAA;AAAA,EAGjB,qBAAA,EAAuB,yBAAA;AAAA;AAAA,EAGvB,aAAA,EAAe,uBAAA;AAAA;AAAA,EAGf,kBAAA,EAAoB,4BAAA;AAAA;AAAA,EAGpB,YAAA,EAAc,gBAAA;AAAA;AAAA,EAGd,iBAAA,EAAmB;AACrB;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,QAAA,EAAU;AACZ;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,UAAA,EAAY,YAAA;AAAA;AAAA,EAGZ,UAAA,EAAY;AACd","file":"index.cjs","sourcesContent":["/**\n * Enum representing standardized error types used across the application.\n * @description These error types help classify different categories of errors such as validation issues and system-level failures.\n *\n * @example\n * ```typescript\n * import { ERROR_TYPE } from '@plyaz/types';\n *\n * const errorType = ERROR_TYPE.ValidationError; // 'validation.error'\n *\n * // Error handling example\n * if (error.type === ERROR_TYPE.RateLimitExceeded) {\n * // Handle rate limiting\n * }\n * ```\n */\nexport const ERROR_TYPE = {\n /** A general validation error (e.g., form or input errors). */\n ValidationError: 'validation.error',\n\n /** Error related to schema validation, such as JSON schema or API payload checks. */\n SchemaValidationError: 'validation.schema.error',\n\n /** Unhandled or unexpected system error. */\n InternalError: 'system.internal.error',\n\n /** System dependency is currently unavailable (e.g., database or external API). */\n ServiceUnavailable: 'system.service.unavailable',\n\n /** The request took too long and timed out. */\n TimeoutError: 'system.timeout',\n\n /** Too many requests made in a short period of time. */\n RateLimitExceeded: 'system.rate.limit.exceeded',\n} as const;\n\n/**\n * Enum representing the severity level of an error.\n * @description This allows categorization of errors by their potential impact on the system or user.\n *\n * @example\n * ```typescript\n * import { ERROR_SEVERITY } from '@plyaz/types';\n *\n * const severity = ERROR_SEVERITY.Critical; // 'critical'\n * const shouldAlert = severity === ERROR_SEVERITY.High || severity === ERROR_SEVERITY.Critical;\n * ```\n */\nexport const ERROR_SEVERITY = {\n /** Low severity - does not impact functionality significantly. */\n Low: 'low',\n\n /** Medium severity - minor disruption or warning. */\n Medium: 'medium',\n\n /** High severity - major issue requiring attention. */\n High: 'high',\n\n /** Critical severity - blocking or crashing issue. */\n Critical: 'critical',\n} as const;\n\n/**\n * Enum representing the category or origin of an error.\n * @description Useful for filtering or logging errors based on their source or nature.\n *\n * @example\n * ```typescript\n * import { ERROR_CATEGORY } from '@plyaz/types';\n *\n * const category = ERROR_CATEGORY.Blockchain; // 'blockchain'\n * const isClientError = category === ERROR_CATEGORY.Client;\n * ```\n */\nexport const ERROR_CATEGORY = {\n /** Client-side error (e.g., invalid request). */\n Client: 'client',\n\n /** Server-side error (e.g., logic failure or exception). */\n Server: 'server',\n\n /** Network-related error (e.g., unreachable endpoint). */\n Network: 'network',\n\n /** Blockchain-related error (e.g., transaction failure, gas limit). */\n Blockchain: 'blockchain',\n\n // Validation-specific error (e.g., failed constraints or field errors).\n Validation: 'validation',\n} as const;\n"]}
@@ -0,0 +1,43 @@
1
+ // @plyaz package - Built with tsup
2
+
3
+ // src/errors/enums.ts
4
+ var ERROR_TYPE = {
5
+ /** A general validation error (e.g., form or input errors). */
6
+ ValidationError: "validation.error",
7
+ /** Error related to schema validation, such as JSON schema or API payload checks. */
8
+ SchemaValidationError: "validation.schema.error",
9
+ /** Unhandled or unexpected system error. */
10
+ InternalError: "system.internal.error",
11
+ /** System dependency is currently unavailable (e.g., database or external API). */
12
+ ServiceUnavailable: "system.service.unavailable",
13
+ /** The request took too long and timed out. */
14
+ TimeoutError: "system.timeout",
15
+ /** Too many requests made in a short period of time. */
16
+ RateLimitExceeded: "system.rate.limit.exceeded"
17
+ };
18
+ var ERROR_SEVERITY = {
19
+ /** Low severity - does not impact functionality significantly. */
20
+ Low: "low",
21
+ /** Medium severity - minor disruption or warning. */
22
+ Medium: "medium",
23
+ /** High severity - major issue requiring attention. */
24
+ High: "high",
25
+ /** Critical severity - blocking or crashing issue. */
26
+ Critical: "critical"
27
+ };
28
+ var ERROR_CATEGORY = {
29
+ /** Client-side error (e.g., invalid request). */
30
+ Client: "client",
31
+ /** Server-side error (e.g., logic failure or exception). */
32
+ Server: "server",
33
+ /** Network-related error (e.g., unreachable endpoint). */
34
+ Network: "network",
35
+ /** Blockchain-related error (e.g., transaction failure, gas limit). */
36
+ Blockchain: "blockchain",
37
+ // Validation-specific error (e.g., failed constraints or field errors).
38
+ Validation: "validation"
39
+ };
40
+
41
+ export { ERROR_CATEGORY, ERROR_SEVERITY, ERROR_TYPE };
42
+ //# sourceMappingURL=index.js.map
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/errors/enums.ts"],"names":[],"mappings":";;;AAgBO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,eAAA,EAAiB,kBAAA;AAAA;AAAA,EAGjB,qBAAA,EAAuB,yBAAA;AAAA;AAAA,EAGvB,aAAA,EAAe,uBAAA;AAAA;AAAA,EAGf,kBAAA,EAAoB,4BAAA;AAAA;AAAA,EAGpB,YAAA,EAAc,gBAAA;AAAA;AAAA,EAGd,iBAAA,EAAmB;AACrB;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,QAAA,EAAU;AACZ;AAcO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,UAAA,EAAY,YAAA;AAAA;AAAA,EAGZ,UAAA,EAAY;AACd","file":"index.js","sourcesContent":["/**\n * Enum representing standardized error types used across the application.\n * @description These error types help classify different categories of errors such as validation issues and system-level failures.\n *\n * @example\n * ```typescript\n * import { ERROR_TYPE } from '@plyaz/types';\n *\n * const errorType = ERROR_TYPE.ValidationError; // 'validation.error'\n *\n * // Error handling example\n * if (error.type === ERROR_TYPE.RateLimitExceeded) {\n * // Handle rate limiting\n * }\n * ```\n */\nexport const ERROR_TYPE = {\n /** A general validation error (e.g., form or input errors). */\n ValidationError: 'validation.error',\n\n /** Error related to schema validation, such as JSON schema or API payload checks. */\n SchemaValidationError: 'validation.schema.error',\n\n /** Unhandled or unexpected system error. */\n InternalError: 'system.internal.error',\n\n /** System dependency is currently unavailable (e.g., database or external API). */\n ServiceUnavailable: 'system.service.unavailable',\n\n /** The request took too long and timed out. */\n TimeoutError: 'system.timeout',\n\n /** Too many requests made in a short period of time. */\n RateLimitExceeded: 'system.rate.limit.exceeded',\n} as const;\n\n/**\n * Enum representing the severity level of an error.\n * @description This allows categorization of errors by their potential impact on the system or user.\n *\n * @example\n * ```typescript\n * import { ERROR_SEVERITY } from '@plyaz/types';\n *\n * const severity = ERROR_SEVERITY.Critical; // 'critical'\n * const shouldAlert = severity === ERROR_SEVERITY.High || severity === ERROR_SEVERITY.Critical;\n * ```\n */\nexport const ERROR_SEVERITY = {\n /** Low severity - does not impact functionality significantly. */\n Low: 'low',\n\n /** Medium severity - minor disruption or warning. */\n Medium: 'medium',\n\n /** High severity - major issue requiring attention. */\n High: 'high',\n\n /** Critical severity - blocking or crashing issue. */\n Critical: 'critical',\n} as const;\n\n/**\n * Enum representing the category or origin of an error.\n * @description Useful for filtering or logging errors based on their source or nature.\n *\n * @example\n * ```typescript\n * import { ERROR_CATEGORY } from '@plyaz/types';\n *\n * const category = ERROR_CATEGORY.Blockchain; // 'blockchain'\n * const isClientError = category === ERROR_CATEGORY.Client;\n * ```\n */\nexport const ERROR_CATEGORY = {\n /** Client-side error (e.g., invalid request). */\n Client: 'client',\n\n /** Server-side error (e.g., logic failure or exception). */\n Server: 'server',\n\n /** Network-related error (e.g., unreachable endpoint). */\n Network: 'network',\n\n /** Blockchain-related error (e.g., transaction failure, gas limit). */\n Blockchain: 'blockchain',\n\n // Validation-specific error (e.g., failed constraints or field errors).\n Validation: 'validation',\n} as const;\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { WithStatusCode, WithErrorCode, WithMessage, WithCorrelationId, WithTimestamp, WithValidationError } from '../common/types';
2
+ import type { ERRORS_CODES } from './constants/errors-codes';
2
3
  /**
3
4
  * Represents the structure of an error response returned by the application.
4
5
  * @template ErrorDetails - The type of the `errors` array, defaults to `ErrorDetailsList`.
@@ -42,3 +43,5 @@ export type ErrorDetail<ValueGiven, AllowedValues, Constraints> = WithValidation
42
43
  * @description A flexible list of error details that can contain string, number, or boolean values along with structured allowed values and constraints.
43
44
  */
44
45
  export type ErrorDetailsList = readonly ErrorDetail<string | number | boolean, Record<string, string>, Record<string, string>>[];
46
+ export type ErrorCodeKey = keyof typeof ERRORS_CODES;
47
+ export type ErrorCodeValue = typeof ERRORS_CODES[ErrorCodeKey];
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ // @plyaz package - Built with tsup
4
+
5
+ // src/events/enums.ts
6
+ var EVENT_TYPE = {
7
+ /** Application initialization event. */
8
+ AppInit: "app.init"
9
+ };
10
+ var EVENT_PRIORITY = {
11
+ /** Low priority event. */
12
+ Low: "low",
13
+ /** Normal priority event. */
14
+ Normal: "normal",
15
+ /** High priority event. */
16
+ High: "high",
17
+ /** Critical priority event. */
18
+ Critical: "critical"
19
+ };
20
+ var EVENT_STATUS = {
21
+ /** Event is pending and has not started processing. */
22
+ Pending: "pending",
23
+ /** Event is currently being processed. */
24
+ Processing: "processing",
25
+ /** Event has been completed successfully. */
26
+ Completed: "completed",
27
+ /** Event processing failed. */
28
+ Failed: "failed",
29
+ /** Event is being retried after a failure. */
30
+ Retrying: "retrying"
31
+ };
32
+
33
+ exports.EVENT_PRIORITY = EVENT_PRIORITY;
34
+ exports.EVENT_STATUS = EVENT_STATUS;
35
+ exports.EVENT_TYPE = EVENT_TYPE;
36
+ //# sourceMappingURL=index.cjs.map
37
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/events/enums.ts"],"names":[],"mappings":";;;;;AAWO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,OAAA,EAAS;AACX;AAaO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAEL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,IAAA,EAAM,MAAA;AAAA;AAAA,EAEN,QAAA,EAAU;AACZ;AAkBO,IAAM,YAAA,GAAe;AAAA;AAAA,EAE1B,OAAA,EAAS,SAAA;AAAA;AAAA,EAET,UAAA,EAAY,YAAA;AAAA;AAAA,EAEZ,SAAA,EAAW,WAAA;AAAA;AAAA,EAEX,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,QAAA,EAAU;AACZ","file":"index.cjs","sourcesContent":["/**\n * Enum representing the types of events in the application.\n * Uses dot notation for event naming convention.\n *\n * @example\n * ```typescript\n * import { EVENT_TYPE } from '@plyaz/types';\n *\n * const eventType = EVENT_TYPE.AppInit; // 'app.init'\n * ```\n */\nexport const EVENT_TYPE = {\n /** Application initialization event. */\n AppInit: 'app.init',\n} as const;\n\n/**\n * Const representing the priority levels for events.\n * Used to determine processing order and resource allocation.\n *\n * @example\n * ```typescript\n * import { EVENT_PRIORITY } from '@plyaz/types';\n *\n * const priority = EVENT_PRIORITY.High; // 'high'\n * ```\n */\nexport const EVENT_PRIORITY = {\n /** Low priority event. */\n Low: 'low',\n /** Normal priority event. */\n Normal: 'normal',\n /** High priority event. */\n High: 'high',\n /** Critical priority event. */\n Critical: 'critical',\n} as const;\n\n/**\n * Const representing the status of an event.\n * Tracks the lifecycle of event processing from creation to completion.\n *\n * @example\n * ```typescript\n * import { EVENT_STATUS } from '@plyaz/types';\n *\n * const status = EVENT_STATUS.Processing; // 'processing'\n *\n * // Typical event lifecycle:\n * // Pending -> Processing -> Completed\n * // or\n * // Pending -> Processing -> Failed -> Retrying -> Processing -> Completed\n * ```\n */\nexport const EVENT_STATUS = {\n /** Event is pending and has not started processing. */\n Pending: 'pending',\n /** Event is currently being processed. */\n Processing: 'processing',\n /** Event has been completed successfully. */\n Completed: 'completed',\n /** Event processing failed. */\n Failed: 'failed',\n /** Event is being retried after a failure. */\n Retrying: 'retrying',\n} as const;\n"]}
@@ -0,0 +1,33 @@
1
+ // @plyaz package - Built with tsup
2
+
3
+ // src/events/enums.ts
4
+ var EVENT_TYPE = {
5
+ /** Application initialization event. */
6
+ AppInit: "app.init"
7
+ };
8
+ var EVENT_PRIORITY = {
9
+ /** Low priority event. */
10
+ Low: "low",
11
+ /** Normal priority event. */
12
+ Normal: "normal",
13
+ /** High priority event. */
14
+ High: "high",
15
+ /** Critical priority event. */
16
+ Critical: "critical"
17
+ };
18
+ var EVENT_STATUS = {
19
+ /** Event is pending and has not started processing. */
20
+ Pending: "pending",
21
+ /** Event is currently being processed. */
22
+ Processing: "processing",
23
+ /** Event has been completed successfully. */
24
+ Completed: "completed",
25
+ /** Event processing failed. */
26
+ Failed: "failed",
27
+ /** Event is being retried after a failure. */
28
+ Retrying: "retrying"
29
+ };
30
+
31
+ export { EVENT_PRIORITY, EVENT_STATUS, EVENT_TYPE };
32
+ //# sourceMappingURL=index.js.map
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/events/enums.ts"],"names":[],"mappings":";;;AAWO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,OAAA,EAAS;AACX;AAaO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAEL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,IAAA,EAAM,MAAA;AAAA;AAAA,EAEN,QAAA,EAAU;AACZ;AAkBO,IAAM,YAAA,GAAe;AAAA;AAAA,EAE1B,OAAA,EAAS,SAAA;AAAA;AAAA,EAET,UAAA,EAAY,YAAA;AAAA;AAAA,EAEZ,SAAA,EAAW,WAAA;AAAA;AAAA,EAEX,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,QAAA,EAAU;AACZ","file":"index.js","sourcesContent":["/**\n * Enum representing the types of events in the application.\n * Uses dot notation for event naming convention.\n *\n * @example\n * ```typescript\n * import { EVENT_TYPE } from '@plyaz/types';\n *\n * const eventType = EVENT_TYPE.AppInit; // 'app.init'\n * ```\n */\nexport const EVENT_TYPE = {\n /** Application initialization event. */\n AppInit: 'app.init',\n} as const;\n\n/**\n * Const representing the priority levels for events.\n * Used to determine processing order and resource allocation.\n *\n * @example\n * ```typescript\n * import { EVENT_PRIORITY } from '@plyaz/types';\n *\n * const priority = EVENT_PRIORITY.High; // 'high'\n * ```\n */\nexport const EVENT_PRIORITY = {\n /** Low priority event. */\n Low: 'low',\n /** Normal priority event. */\n Normal: 'normal',\n /** High priority event. */\n High: 'high',\n /** Critical priority event. */\n Critical: 'critical',\n} as const;\n\n/**\n * Const representing the status of an event.\n * Tracks the lifecycle of event processing from creation to completion.\n *\n * @example\n * ```typescript\n * import { EVENT_STATUS } from '@plyaz/types';\n *\n * const status = EVENT_STATUS.Processing; // 'processing'\n *\n * // Typical event lifecycle:\n * // Pending -> Processing -> Completed\n * // or\n * // Pending -> Processing -> Failed -> Retrying -> Processing -> Completed\n * ```\n */\nexport const EVENT_STATUS = {\n /** Event is pending and has not started processing. */\n Pending: 'pending',\n /** Event is currently being processed. */\n Processing: 'processing',\n /** Event has been completed successfully. */\n Completed: 'completed',\n /** Event processing failed. */\n Failed: 'failed',\n /** Event is being retried after a failure. */\n Retrying: 'retrying',\n} as const;\n"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}