@guren/server 1.0.0-rc.9 → 1.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 (68) hide show
  1. package/dist/{Application-DtWDHXr1.d.ts → Application-BnsyCKXY.d.ts} +79 -8
  2. package/dist/AuthManager-SfhCNkAU.d.ts +79 -0
  3. package/dist/{BroadcastManager-AkIWUGJo.d.ts → BroadcastManager-CGWl9rUO.d.ts} +5 -0
  4. package/dist/{ConsoleKernel-CqCVrdZs.d.ts → ConsoleKernel-BDtBETjm.d.ts} +1 -1
  5. package/dist/{Gate-CNkBYf8m.d.ts → Gate-CynjZCtS.d.ts} +5 -0
  6. package/dist/{I18nManager-Dtgzsf5n.d.ts → I18nManager-BiSoczfV.d.ts} +6 -1
  7. package/dist/McpServiceProvider-JW6PDVMD.js +7 -0
  8. package/dist/api-token-BSSCLlFW.d.ts +541 -0
  9. package/dist/auth/index.d.ts +9 -327
  10. package/dist/auth/index.js +59 -6684
  11. package/dist/authorization/index.d.ts +2 -2
  12. package/dist/authorization/index.js +19 -604
  13. package/dist/broadcasting/index.d.ts +2 -2
  14. package/dist/broadcasting/index.js +12 -895
  15. package/dist/cache/index.js +8 -809
  16. package/dist/chunk-2T6JN4VR.js +1563 -0
  17. package/dist/chunk-44F7JQ7I.js +950 -0
  18. package/dist/chunk-74HTZG3V.js +331 -0
  19. package/dist/chunk-A3ISJVEV.js +598 -0
  20. package/dist/chunk-CSDKWLFD.js +652 -0
  21. package/dist/chunk-CSRQTEQA.js +839 -0
  22. package/dist/chunk-DAQKYKLH.js +182 -0
  23. package/dist/chunk-EDRGAM6G.js +647 -0
  24. package/dist/chunk-EGU5KB7V.js +818 -0
  25. package/dist/chunk-H32L2NE3.js +372 -0
  26. package/dist/chunk-HKQSAFSN.js +837 -0
  27. package/dist/chunk-IOTWFHZU.js +558 -0
  28. package/dist/chunk-ONSDE37A.js +125 -0
  29. package/dist/chunk-QQKTH5KX.js +114 -0
  30. package/dist/chunk-R2TCP7D7.js +409 -0
  31. package/dist/chunk-SIP34GBE.js +380 -0
  32. package/dist/chunk-THSX7OOR.js +454 -0
  33. package/dist/chunk-UY3AZSYL.js +14 -0
  34. package/dist/chunk-VT5KRDPH.js +134 -0
  35. package/dist/chunk-VXXZIXAP.js +255 -0
  36. package/dist/chunk-WJJ5CTNI.js +907 -0
  37. package/dist/chunk-WVY45EIW.js +359 -0
  38. package/dist/chunk-ZRBLZY3M.js +462 -0
  39. package/dist/client-CKXJLsTe.d.ts +232 -0
  40. package/dist/email-verification-CAeArjui.d.ts +327 -0
  41. package/dist/encryption/index.js +48 -556
  42. package/dist/errors-JOOPDDQ6.js +34 -0
  43. package/dist/events/index.js +14 -316
  44. package/dist/health/index.js +12 -367
  45. package/dist/i18n/index.d.ts +2 -2
  46. package/dist/i18n/index.js +14 -583
  47. package/dist/index.d.ts +37 -239
  48. package/dist/index.js +2873 -19166
  49. package/dist/lambda/index.d.ts +9 -7
  50. package/dist/lambda/index.js +4 -9
  51. package/dist/logging/index.js +12 -545
  52. package/dist/mail/index.d.ts +29 -1
  53. package/dist/mail/index.js +15 -684
  54. package/dist/mcp/index.d.ts +7 -5
  55. package/dist/mcp/index.js +5 -378
  56. package/dist/notifications/index.d.ts +8 -6
  57. package/dist/notifications/index.js +13 -730
  58. package/dist/queue/index.d.ts +37 -7
  59. package/dist/queue/index.js +22 -940
  60. package/dist/redis/index.d.ts +366 -0
  61. package/dist/redis/index.js +597 -0
  62. package/dist/runtime/index.d.ts +8 -6
  63. package/dist/runtime/index.js +26 -244
  64. package/dist/scheduling/index.js +14 -822
  65. package/dist/storage/index.d.ts +1 -0
  66. package/dist/storage/index.js +6 -824
  67. package/package.json +15 -7
  68. package/dist/api-token-JOif2CtG.d.ts +0 -1792
@@ -0,0 +1,182 @@
1
+ // src/errors/HttpException.ts
2
+ var HttpException = class _HttpException extends Error {
3
+ /**
4
+ * HTTP status code.
5
+ */
6
+ statusCode;
7
+ /**
8
+ * Validation or field-specific errors.
9
+ */
10
+ errors;
11
+ /**
12
+ * Additional error data.
13
+ */
14
+ data;
15
+ constructor(statusCode, message, errors, data) {
16
+ super(message);
17
+ this.name = this.constructor.name;
18
+ this.statusCode = statusCode;
19
+ this.errors = errors;
20
+ this.data = data;
21
+ if (Error.captureStackTrace) {
22
+ Error.captureStackTrace(this, this.constructor);
23
+ }
24
+ }
25
+ /**
26
+ * Convert to response format.
27
+ */
28
+ toResponse(debug = false) {
29
+ const body = {
30
+ message: this.message
31
+ };
32
+ if (this.errors) {
33
+ body.errors = this.errors;
34
+ }
35
+ if (debug) {
36
+ body.exception = this.name;
37
+ body.stack = this.stack;
38
+ }
39
+ return {
40
+ status: this.statusCode,
41
+ body
42
+ };
43
+ }
44
+ /**
45
+ * Convert to JSON.
46
+ */
47
+ toJSON() {
48
+ return {
49
+ name: this.name,
50
+ message: this.message,
51
+ statusCode: this.statusCode,
52
+ errors: this.errors,
53
+ data: this.data
54
+ };
55
+ }
56
+ // Factory methods
57
+ /**
58
+ * Create a 400 Bad Request exception.
59
+ */
60
+ static badRequest(message = "Bad Request") {
61
+ return new _HttpException(400, message);
62
+ }
63
+ /**
64
+ * Create a 401 Unauthorized exception.
65
+ */
66
+ static unauthorized(message = "Unauthorized") {
67
+ return new _HttpException(401, message);
68
+ }
69
+ /**
70
+ * Create a 403 Forbidden exception.
71
+ */
72
+ static forbidden(message = "Forbidden") {
73
+ return new _HttpException(403, message);
74
+ }
75
+ /**
76
+ * Create a 404 Not Found exception.
77
+ */
78
+ static notFound(message = "Not Found") {
79
+ return new _HttpException(404, message);
80
+ }
81
+ /**
82
+ * Create a 405 Method Not Allowed exception.
83
+ */
84
+ static methodNotAllowed(message = "Method Not Allowed") {
85
+ return new _HttpException(405, message);
86
+ }
87
+ /**
88
+ * Create a 409 Conflict exception.
89
+ */
90
+ static conflict(message = "Conflict") {
91
+ return new _HttpException(409, message);
92
+ }
93
+ /**
94
+ * Create a 410 Gone exception.
95
+ */
96
+ static gone(message = "Gone") {
97
+ return new _HttpException(410, message);
98
+ }
99
+ /**
100
+ * Create a 422 Unprocessable Entity exception.
101
+ */
102
+ static unprocessable(message = "Unprocessable Entity", errors) {
103
+ return new _HttpException(422, message, errors);
104
+ }
105
+ /**
106
+ * Create a 429 Too Many Requests exception.
107
+ */
108
+ static tooManyRequests(message = "Too Many Requests") {
109
+ return new _HttpException(429, message);
110
+ }
111
+ /**
112
+ * Create a 500 Internal Server Error exception.
113
+ */
114
+ static internal(message = "Internal Server Error") {
115
+ return new _HttpException(500, message);
116
+ }
117
+ /**
118
+ * Create a 501 Not Implemented exception.
119
+ */
120
+ static notImplemented(message = "Not Implemented") {
121
+ return new _HttpException(501, message);
122
+ }
123
+ /**
124
+ * Create a 502 Bad Gateway exception.
125
+ */
126
+ static badGateway(message = "Bad Gateway") {
127
+ return new _HttpException(502, message);
128
+ }
129
+ /**
130
+ * Create a 503 Service Unavailable exception.
131
+ */
132
+ static serviceUnavailable(message = "Service Unavailable") {
133
+ return new _HttpException(503, message);
134
+ }
135
+ /**
136
+ * Create a 504 Gateway Timeout exception.
137
+ */
138
+ static gatewayTimeout(message = "Gateway Timeout") {
139
+ return new _HttpException(504, message);
140
+ }
141
+ /**
142
+ * Check if an error is an HTTP exception.
143
+ */
144
+ static isHttpException(error) {
145
+ return error instanceof _HttpException || typeof error === "object" && error !== null && "statusCode" in error && typeof error.statusCode === "number" && "toResponse" in error && typeof error.toResponse === "function";
146
+ }
147
+ };
148
+
149
+ // src/errors/exceptions/AuthenticationException.ts
150
+ var AuthenticationException = class _AuthenticationException extends HttpException {
151
+ /**
152
+ * The guard that threw the exception.
153
+ */
154
+ guard;
155
+ /**
156
+ * URL to redirect to for authentication.
157
+ */
158
+ redirectTo;
159
+ constructor(message = "Unauthenticated.", guard, redirectTo) {
160
+ super(401, message);
161
+ this.name = "AuthenticationException";
162
+ this.guard = guard;
163
+ this.redirectTo = redirectTo;
164
+ }
165
+ /**
166
+ * Create exception with redirect URL.
167
+ */
168
+ static withRedirect(redirectTo, message) {
169
+ return new _AuthenticationException(message, void 0, redirectTo);
170
+ }
171
+ /**
172
+ * Create exception for a specific guard.
173
+ */
174
+ static forGuard(guard, message) {
175
+ return new _AuthenticationException(message, guard);
176
+ }
177
+ };
178
+
179
+ export {
180
+ HttpException,
181
+ AuthenticationException
182
+ };