@mrxsys/mrx-core 2.11.0-1-and-267-20250925 → 2.11.0-1-and-273-20251029
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +407 -0
- package/dist/{chunk-fp8xg6kq.js → chunk-441xs5k1.js} +1 -1
- package/dist/{chunk-bdcsh435.js → chunk-4v86f7gp.js} +5 -5
- package/dist/{chunk-00s6t4tw.js → chunk-7t524zqh.js} +4 -4
- package/dist/{chunk-d1vp74n0.js → chunk-afd82epa.js} +2 -2
- package/dist/{chunk-v9kvw5x7.js → chunk-afyz8rg5.js} +2 -2
- package/dist/{chunk-6sfnrhfs.js → chunk-pjv1ekwr.js} +33 -1
- package/dist/chunk-rz5p4j3p.js +13 -0
- package/dist/{chunk-h9t48r9q.js → chunk-sqts8vyk.js} +16 -2
- package/dist/errors/enums/http-status-codes.d.ts +15 -1
- package/dist/errors/enums/index.d.ts +1 -1
- package/dist/errors/enums/index.js +3 -3
- package/dist/errors/http-error.d.ts +3 -3
- package/dist/errors/index.js +2 -2
- package/dist/errors/utils/index.js +2 -2
- package/dist/modules/database/enums/database-error-keys.d.ts +2 -2
- package/dist/modules/database/enums/index.js +1 -1
- package/dist/modules/database/index.js +5 -5
- package/dist/modules/elysia/cache/cache.d.ts +1 -1
- package/dist/modules/elysia/crud/index.js +7 -7
- package/dist/modules/elysia/crud/operations/count.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/delete.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/deleteOne.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/find.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/findOne.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/index.js +7 -7
- package/dist/modules/elysia/crud/operations/insert.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/update.d.ts +1 -1
- package/dist/modules/elysia/crud/operations/updateOne.d.ts +1 -1
- package/dist/modules/elysia/db-resolver/db-resolver.d.ts +1 -1
- package/dist/modules/elysia/db-resolver/index.js +6 -6
- package/dist/modules/elysia/error/index.js +2 -2
- package/dist/modules/elysia/microservice/microservice.d.ts +12 -12
- package/dist/modules/elysia/rate-limit/index.js +2 -2
- package/dist/modules/jwt/index.js +2 -2
- package/dist/modules/kv-store/bun-redis/bun-redis-store.d.ts +25 -0
- package/dist/modules/kv-store/bun-redis/index.d.ts +1 -0
- package/dist/modules/kv-store/bun-redis/index.js +84 -0
- package/dist/modules/kv-store/ioredis/index.js +10 -16
- package/dist/modules/kv-store/ioredis/ioredis-store.d.ts +0 -82
- package/dist/modules/kv-store/memory/memory-store.d.ts +0 -84
- package/dist/modules/kv-store/types/kv-store.d.ts +2 -2
- package/dist/modules/logger/enums/index.js +1 -1
- package/dist/modules/logger/enums/logger-error-keys.d.ts +6 -3
- package/dist/modules/logger/events/logger-events.d.ts +12 -3
- package/dist/modules/logger/index.js +169 -81
- package/dist/modules/logger/logger.d.ts +115 -133
- package/dist/modules/logger/sinks/console-logger.d.ts +2 -16
- package/dist/modules/logger/sinks/devnull-logger.d.ts +8 -0
- package/dist/modules/logger/sinks/file-logger/enums/file-logger-error-keys.d.ts +3 -0
- package/dist/modules/logger/sinks/file-logger/file-logger.d.ts +25 -0
- package/dist/modules/logger/sinks/index.d.ts +4 -2
- package/dist/modules/logger/sinks/index.js +53 -31
- package/dist/modules/logger/types/index.d.ts +6 -6
- package/dist/modules/logger/types/log-levels.d.ts +1 -4
- package/dist/modules/logger/types/logger-options.d.ts +41 -0
- package/dist/modules/logger/types/logger-sink.d.ts +12 -3
- package/dist/modules/logger/types/sink-bodies-intersection.d.ts +2 -0
- package/dist/modules/logger/types/sink-body.d.ts +1 -1
- package/dist/modules/logger/types/sink-map.d.ts +1 -1
- package/dist/modules/repository/index.js +4 -4
- package/dist/modules/repository/types/query-options.d.ts +2 -2
- package/package.json +27 -21
- package/dist/chunk-b96fm9ph.js +0 -10
- package/dist/modules/logger/sinks/file-logger.d.ts +0 -25
- package/dist/modules/logger/types/bodies-intersection.d.ts +0 -2
- package/dist/modules/logger/types/log-stream-chunk.d.ts +0 -15
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// source/modules/logger/enums/logger-error-keys.ts
|
|
3
|
+
var LOGGER_ERROR_KEYS = {
|
|
4
|
+
BEFORE_EXIT_CLOSE_ERROR: "mrx-core.logger.error.before_exit_close_error",
|
|
5
|
+
BEFORE_EXIT_FLUSH_ERROR: "mrx-core.logger.error.before_exit_flush_error",
|
|
6
|
+
NO_SINKS_PROVIDED: "mrx-core.logger.error.no_sinks_provided",
|
|
7
|
+
REGISTER_SINK_ERROR: "mrx-core.logger.error.register_sink_error",
|
|
8
|
+
SINK_ALREADY_ADDED: "mrx-core.logger.error.sink_already_added",
|
|
9
|
+
SINK_CLOSE_ERROR: "mrx-core.logger.error.sink_close_error",
|
|
10
|
+
SINK_LOG_ERROR: "mrx-core.logger.error.sink_log_error"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { LOGGER_ERROR_KEYS };
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// source/errors/enums/http-status-codes.ts
|
|
3
|
-
var
|
|
3
|
+
var HTTP_STATUS_CODES = {
|
|
4
|
+
CONTINUE: 100,
|
|
5
|
+
SWITCHING_PROTOCOLS: 101,
|
|
6
|
+
PROCESSING: 102,
|
|
7
|
+
EARLY_HINTS: 103,
|
|
8
|
+
OK: 200,
|
|
9
|
+
CREATED: 201,
|
|
10
|
+
ACCEPTED: 202,
|
|
11
|
+
NON_AUTHORITATIVE_INFORMATION: 203,
|
|
12
|
+
NO_CONTENT: 204,
|
|
13
|
+
RESET_CONTENT: 205,
|
|
14
|
+
PARTIAL_CONTENT: 206,
|
|
15
|
+
MULTI_STATUS: 207,
|
|
16
|
+
ALREADY_REPORTED: 208,
|
|
17
|
+
IM_USED: 226,
|
|
4
18
|
BAD_REQUEST: 400,
|
|
5
19
|
UNAUTHORIZED: 401,
|
|
6
20
|
PAYMENT_REQUIRED: 402,
|
|
@@ -43,4 +57,4 @@ var HTTP_ERROR_STATUS_CODES = {
|
|
|
43
57
|
NETWORK_AUTHENTICATION_REQUIRED: 511
|
|
44
58
|
};
|
|
45
59
|
|
|
46
|
-
export {
|
|
60
|
+
export { HTTP_STATUS_CODES };
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const HTTP_STATUS_CODES: {
|
|
2
|
+
readonly CONTINUE: 100;
|
|
3
|
+
readonly SWITCHING_PROTOCOLS: 101;
|
|
4
|
+
readonly PROCESSING: 102;
|
|
5
|
+
readonly EARLY_HINTS: 103;
|
|
6
|
+
readonly OK: 200;
|
|
7
|
+
readonly CREATED: 201;
|
|
8
|
+
readonly ACCEPTED: 202;
|
|
9
|
+
readonly NON_AUTHORITATIVE_INFORMATION: 203;
|
|
10
|
+
readonly NO_CONTENT: 204;
|
|
11
|
+
readonly RESET_CONTENT: 205;
|
|
12
|
+
readonly PARTIAL_CONTENT: 206;
|
|
13
|
+
readonly MULTI_STATUS: 207;
|
|
14
|
+
readonly ALREADY_REPORTED: 208;
|
|
15
|
+
readonly IM_USED: 226;
|
|
2
16
|
readonly BAD_REQUEST: 400;
|
|
3
17
|
readonly UNAUTHORIZED: 401;
|
|
4
18
|
readonly PAYMENT_REQUIRED: 402;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HTTP_STATUS_CODES } from './http-status-codes';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseError } from './base-error';
|
|
2
|
-
import {
|
|
3
|
-
export type HttpStatusKey = keyof typeof
|
|
4
|
-
export type HttpStatusCode = typeof
|
|
2
|
+
import { HTTP_STATUS_CODES } from './enums/http-status-codes';
|
|
3
|
+
export type HttpStatusKey = keyof typeof HTTP_STATUS_CODES;
|
|
4
|
+
export type HttpStatusCode = typeof HTTP_STATUS_CODES[HttpStatusKey];
|
|
5
5
|
export declare class HttpError<const TCause = unknown> extends BaseError<TCause> {
|
|
6
6
|
readonly httpStatusCode: number;
|
|
7
7
|
constructor(message: string, cause?: TCause);
|
package/dist/errors/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export declare const DATABASE_ERROR_KEYS: {
|
|
|
2
2
|
readonly MSSQL_CONNECTION_ERROR: "mrx-core.mssql.error.database.connection_error";
|
|
3
3
|
readonly MSSQL_DATABASE_ACCESS_DENIED: "mrx-core.mssql.error.database.access_denied";
|
|
4
4
|
readonly MSSQL_DATABASE_AMBIGUOUS_COLUMN: "mrx-core.mssql.error.database.ambiguous_column";
|
|
5
|
-
readonly
|
|
5
|
+
readonly MSSQL_DATABASE_AUTHORIZATION_FAILED: "mrx-core.mssql.error.database.authorization_failed";
|
|
6
6
|
readonly MSSQL_DATABASE_COLUMN_NOT_FOUND: "mrx-core.mssql.error.database.column_not_found";
|
|
7
7
|
readonly MSSQL_DATABASE_CONVERSION_FAILED: "mrx-core.mssql.error.database.conversion_failed";
|
|
8
8
|
readonly MSSQL_DATABASE_DATA_TOO_LARGE: "mrx-core.mssql.error.database.data_too_large";
|
|
@@ -19,7 +19,7 @@ export declare const DATABASE_ERROR_KEYS: {
|
|
|
19
19
|
readonly MSSQL_DATABASE_TRANSACTION_ABORTED: "mrx-core.mssql.error.database.transaction_aborted";
|
|
20
20
|
readonly MSSQL_DATABASE_TRANSACTION_LOG_FULL: "mrx-core.mssql.error.database.transaction_log_full";
|
|
21
21
|
readonly MSSQL_DATABASE_UNIQUE_CONSTRAINT_VIOLATION: "mrx-core.mssql.error.database.unique_constraint_violation";
|
|
22
|
-
readonly
|
|
22
|
+
readonly MSSQL_DATABASE_CANNOT_UPDATE_IDENTITY_COLUMN: "mrx-core.mssql.error.database.cannot_update_identity_column";
|
|
23
23
|
readonly MSSQL_DISCONNECT_ERROR: "mrx-core.mssql.error.database.disconnect_error";
|
|
24
24
|
readonly MSSQL_NO_RESULT: "mrx-core.mssql.error.database.no_result";
|
|
25
25
|
readonly MSSQL_NOT_CONNECTED: "mrx-core.mssql.error.database.not_connected";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
MSSQL,
|
|
4
4
|
Table
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import"../../chunk-
|
|
5
|
+
} from "../../chunk-afd82epa.js";
|
|
6
|
+
import"../../chunk-afyz8rg5.js";
|
|
7
7
|
import"../../chunk-grfyngq0.js";
|
|
8
8
|
import"../../chunk-mvrxngm7.js";
|
|
9
|
-
import"../../chunk-
|
|
10
|
-
import"../../chunk-
|
|
11
|
-
import"../../chunk-
|
|
9
|
+
import"../../chunk-4v86f7gp.js";
|
|
10
|
+
import"../../chunk-7t524zqh.js";
|
|
11
|
+
import"../../chunk-sqts8vyk.js";
|
|
12
12
|
import"../../chunk-9cgzhc50.js";
|
|
13
13
|
export {
|
|
14
14
|
Table,
|
|
@@ -41,7 +41,7 @@ export declare const cache: ({ defaultTtl, prefix, store }?: CacheOptions) => El
|
|
|
41
41
|
kvStore: import("../../kv-store/types").KvStore | MemoryStore;
|
|
42
42
|
_cachedRoutes: Set<string>;
|
|
43
43
|
};
|
|
44
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
44
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
45
45
|
readonly 100: "Continue";
|
|
46
46
|
readonly 101: "Switching Protocols";
|
|
47
47
|
readonly 102: "Processing";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
insert,
|
|
9
9
|
update,
|
|
10
10
|
updateOne
|
|
11
|
-
} from "../../../chunk-
|
|
11
|
+
} from "../../../chunk-pjv1ekwr.js";
|
|
12
12
|
import {
|
|
13
13
|
createCountResponse200Schema,
|
|
14
14
|
createCountSchema,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
createUpdateSchema
|
|
22
22
|
} from "../../../chunk-p14h6jfs.js";
|
|
23
23
|
import"../../../chunk-9dzsj7f2.js";
|
|
24
|
-
import"../../../chunk-
|
|
24
|
+
import"../../../chunk-441xs5k1.js";
|
|
25
25
|
import"../../../chunk-fs3wm3p4.js";
|
|
26
26
|
import"../../../chunk-z0ct35ft.js";
|
|
27
27
|
import"../../../chunk-8tffnbpn.js";
|
|
28
28
|
import"../../../chunk-w7h898m3.js";
|
|
29
29
|
import"../../../chunk-gtn1kn0z.js";
|
|
30
30
|
import"../../../chunk-jksb9ers.js";
|
|
31
|
-
import"../../../chunk-
|
|
32
|
-
import"../../../chunk-
|
|
31
|
+
import"../../../chunk-afd82epa.js";
|
|
32
|
+
import"../../../chunk-afyz8rg5.js";
|
|
33
33
|
import"../../../chunk-grfyngq0.js";
|
|
34
34
|
import"../../../chunk-mvrxngm7.js";
|
|
35
|
-
import"../../../chunk-
|
|
36
|
-
import"../../../chunk-
|
|
37
|
-
import"../../../chunk-
|
|
35
|
+
import"../../../chunk-4v86f7gp.js";
|
|
36
|
+
import"../../../chunk-7t524zqh.js";
|
|
37
|
+
import"../../../chunk-sqts8vyk.js";
|
|
38
38
|
import"../../../chunk-9cgzhc50.js";
|
|
39
39
|
|
|
40
40
|
// source/modules/elysia/crud/crud.ts
|
|
@@ -43,7 +43,7 @@ export declare const count: <const TDatabase extends Omit<MSSQLDatabaseOptions,
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -43,7 +43,7 @@ export declare const batchDelete: <const TDatabase extends Omit<MSSQLDatabaseOpt
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -43,7 +43,7 @@ export declare const deleteOne: <const TDatabase extends Omit<MSSQLDatabaseOptio
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -43,7 +43,7 @@ export declare const find: <const TDatabase extends Omit<MSSQLDatabaseOptions, "
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -43,7 +43,7 @@ export declare const findOne: <const TDatabase extends Omit<MSSQLDatabaseOptions
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -8,19 +8,19 @@ import {
|
|
|
8
8
|
insert,
|
|
9
9
|
update,
|
|
10
10
|
updateOne
|
|
11
|
-
} from "../../../../chunk-
|
|
12
|
-
import"../../../../chunk-
|
|
11
|
+
} from "../../../../chunk-pjv1ekwr.js";
|
|
12
|
+
import"../../../../chunk-441xs5k1.js";
|
|
13
13
|
import"../../../../chunk-fs3wm3p4.js";
|
|
14
14
|
import"../../../../chunk-z0ct35ft.js";
|
|
15
15
|
import"../../../../chunk-8tffnbpn.js";
|
|
16
16
|
import"../../../../chunk-w7h898m3.js";
|
|
17
|
-
import"../../../../chunk-
|
|
18
|
-
import"../../../../chunk-
|
|
17
|
+
import"../../../../chunk-afd82epa.js";
|
|
18
|
+
import"../../../../chunk-afyz8rg5.js";
|
|
19
19
|
import"../../../../chunk-grfyngq0.js";
|
|
20
20
|
import"../../../../chunk-mvrxngm7.js";
|
|
21
|
-
import"../../../../chunk-
|
|
22
|
-
import"../../../../chunk-
|
|
23
|
-
import"../../../../chunk-
|
|
21
|
+
import"../../../../chunk-4v86f7gp.js";
|
|
22
|
+
import"../../../../chunk-7t524zqh.js";
|
|
23
|
+
import"../../../../chunk-sqts8vyk.js";
|
|
24
24
|
import"../../../../chunk-9cgzhc50.js";
|
|
25
25
|
export {
|
|
26
26
|
updateOne,
|
|
@@ -43,7 +43,7 @@ export declare const insert: <const TDatabase extends Omit<MSSQLDatabaseOptions,
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -43,7 +43,7 @@ export declare const update: <const TDatabase extends Omit<MSSQLDatabaseOptions,
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -43,7 +43,7 @@ export declare const updateOne: <const TDatabase extends Omit<MSSQLDatabaseOptio
|
|
|
43
43
|
route: string;
|
|
44
44
|
request: Request;
|
|
45
45
|
store: {};
|
|
46
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
46
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
47
47
|
readonly 100: "Continue";
|
|
48
48
|
readonly 101: "Switching Protocols";
|
|
49
49
|
readonly 102: "Processing";
|
|
@@ -41,7 +41,7 @@ export declare const dbResolver: (prefixDatabaseName?: string) => Elysia<"", {
|
|
|
41
41
|
route: string;
|
|
42
42
|
request: Request;
|
|
43
43
|
store: {};
|
|
44
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 |
|
|
44
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 420 ? {
|
|
45
45
|
readonly 100: "Continue";
|
|
46
46
|
readonly 101: "Switching Protocols";
|
|
47
47
|
readonly 102: "Processing";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
dbResolver
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-441xs5k1.js";
|
|
5
5
|
import"../../../chunk-fs3wm3p4.js";
|
|
6
6
|
import"../../../chunk-z0ct35ft.js";
|
|
7
7
|
import"../../../chunk-8tffnbpn.js";
|
|
8
|
-
import"../../../chunk-
|
|
9
|
-
import"../../../chunk-
|
|
8
|
+
import"../../../chunk-afd82epa.js";
|
|
9
|
+
import"../../../chunk-afyz8rg5.js";
|
|
10
10
|
import"../../../chunk-grfyngq0.js";
|
|
11
11
|
import"../../../chunk-mvrxngm7.js";
|
|
12
|
-
import"../../../chunk-
|
|
13
|
-
import"../../../chunk-
|
|
14
|
-
import"../../../chunk-
|
|
12
|
+
import"../../../chunk-4v86f7gp.js";
|
|
13
|
+
import"../../../chunk-7t524zqh.js";
|
|
14
|
+
import"../../../chunk-sqts8vyk.js";
|
|
15
15
|
import"../../../chunk-9cgzhc50.js";
|
|
16
16
|
export {
|
|
17
17
|
dbResolver
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import"../../../chunk-jksb9ers.js";
|
|
9
9
|
import {
|
|
10
10
|
HttpError
|
|
11
|
-
} from "../../../chunk-
|
|
12
|
-
import"../../../chunk-
|
|
11
|
+
} from "../../../chunk-7t524zqh.js";
|
|
12
|
+
import"../../../chunk-sqts8vyk.js";
|
|
13
13
|
import {
|
|
14
14
|
BaseError
|
|
15
15
|
} from "../../../chunk-9cgzhc50.js";
|
|
@@ -43,6 +43,9 @@ export declare const microservice: Elysia<"/microservice", {
|
|
|
43
43
|
query: unknown;
|
|
44
44
|
headers: unknown;
|
|
45
45
|
response: {
|
|
46
|
+
200: {
|
|
47
|
+
message: string;
|
|
48
|
+
};
|
|
46
49
|
422: {
|
|
47
50
|
type: "validation";
|
|
48
51
|
on: string;
|
|
@@ -52,9 +55,6 @@ export declare const microservice: Elysia<"/microservice", {
|
|
|
52
55
|
property?: string;
|
|
53
56
|
expected?: string;
|
|
54
57
|
};
|
|
55
|
-
200: {
|
|
56
|
-
message: string;
|
|
57
|
-
};
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
};
|
|
@@ -68,15 +68,6 @@ export declare const microservice: Elysia<"/microservice", {
|
|
|
68
68
|
query: unknown;
|
|
69
69
|
headers: unknown;
|
|
70
70
|
response: {
|
|
71
|
-
422: {
|
|
72
|
-
type: "validation";
|
|
73
|
-
on: string;
|
|
74
|
-
summary?: string;
|
|
75
|
-
message?: string;
|
|
76
|
-
found?: unknown;
|
|
77
|
-
property?: string;
|
|
78
|
-
expected?: string;
|
|
79
|
-
};
|
|
80
71
|
200: {
|
|
81
72
|
message: string;
|
|
82
73
|
content: {
|
|
@@ -86,6 +77,15 @@ export declare const microservice: Elysia<"/microservice", {
|
|
|
86
77
|
author: string;
|
|
87
78
|
};
|
|
88
79
|
};
|
|
80
|
+
422: {
|
|
81
|
+
type: "validation";
|
|
82
|
+
on: string;
|
|
83
|
+
summary?: string;
|
|
84
|
+
message?: string;
|
|
85
|
+
found?: unknown;
|
|
86
|
+
property?: string;
|
|
87
|
+
expected?: string;
|
|
88
|
+
};
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
91
|
};
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import"../../../chunk-xhhj1gvj.js";
|
|
9
9
|
import {
|
|
10
10
|
HttpError
|
|
11
|
-
} from "../../../chunk-
|
|
12
|
-
import"../../../chunk-
|
|
11
|
+
} from "../../../chunk-7t524zqh.js";
|
|
12
|
+
import"../../../chunk-sqts8vyk.js";
|
|
13
13
|
import"../../../chunk-9cgzhc50.js";
|
|
14
14
|
|
|
15
15
|
// source/modules/elysia/rate-limit/rate-limit.ts
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import"../../chunk-12qzn7jw.js";
|
|
9
9
|
import {
|
|
10
10
|
HttpError
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import"../../chunk-
|
|
11
|
+
} from "../../chunk-7t524zqh.js";
|
|
12
|
+
import"../../chunk-sqts8vyk.js";
|
|
13
13
|
import"../../chunk-9cgzhc50.js";
|
|
14
14
|
|
|
15
15
|
// source/modules/jwt/jwt.ts
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type RedisOptions } from 'bun';
|
|
2
|
+
import type { KvStore } from '../../../modules/kv-store/types/kv-store';
|
|
3
|
+
/**
|
|
4
|
+
* Redis-based key-value store implementation using Bun's Redis client.
|
|
5
|
+
*
|
|
6
|
+
* Provides a Redis-backed implementation of the KvStore interface with
|
|
7
|
+
* automatic JSON serialization/deserialization and proper error handling.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BunRedisStore implements KvStore {
|
|
10
|
+
/**
|
|
11
|
+
* Redis client instance.
|
|
12
|
+
*/
|
|
13
|
+
private readonly _client;
|
|
14
|
+
constructor(url?: string, options?: RedisOptions);
|
|
15
|
+
connect(): Promise<void>;
|
|
16
|
+
close?(): void;
|
|
17
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
18
|
+
set<T = unknown>(key: string, value: T, ttlSec?: number): Promise<void>;
|
|
19
|
+
increment(key: string, amount?: number): Promise<number>;
|
|
20
|
+
decrement(key: string, amount?: number): Promise<number>;
|
|
21
|
+
del(key: string): Promise<boolean>;
|
|
22
|
+
expire(key: string, ttlSec: number): Promise<boolean>;
|
|
23
|
+
ttl(key: string): Promise<number>;
|
|
24
|
+
clean(): Promise<number>;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BunRedisStore } from './bun-redis-store';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
KV_STORE_ERROR_KEYS
|
|
4
|
+
} from "../../../chunk-xhhj1gvj.js";
|
|
5
|
+
import {
|
|
6
|
+
BaseError
|
|
7
|
+
} from "../../../chunk-9cgzhc50.js";
|
|
8
|
+
|
|
9
|
+
// source/modules/kv-store/bun-redis/bun-redis-store.ts
|
|
10
|
+
var {RedisClient } = globalThis.Bun;
|
|
11
|
+
class BunRedisStore {
|
|
12
|
+
_client;
|
|
13
|
+
constructor(url, options) {
|
|
14
|
+
this._client = new RedisClient(url, options);
|
|
15
|
+
}
|
|
16
|
+
async connect() {
|
|
17
|
+
try {
|
|
18
|
+
await this._client.connect();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw new BaseError(KV_STORE_ERROR_KEYS.CONNECTION_FAILED, e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
close() {
|
|
24
|
+
try {
|
|
25
|
+
this._client.close();
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw new BaseError(KV_STORE_ERROR_KEYS.CLOSING_CONNECTION_FAILED, e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async get(key) {
|
|
31
|
+
const value = await this._client.get(key);
|
|
32
|
+
if (value === null)
|
|
33
|
+
return null;
|
|
34
|
+
try {
|
|
35
|
+
return JSON.parse(value);
|
|
36
|
+
} catch {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async set(key, value, ttlSec) {
|
|
41
|
+
const serialized = typeof value === "string" ? value : JSON.stringify(value);
|
|
42
|
+
if (ttlSec)
|
|
43
|
+
await this._client.set(key, serialized, "EX", ttlSec);
|
|
44
|
+
else
|
|
45
|
+
await this._client.set(key, serialized);
|
|
46
|
+
}
|
|
47
|
+
async increment(key, amount) {
|
|
48
|
+
try {
|
|
49
|
+
const number = await this._client.incrby(key, amount ?? 1);
|
|
50
|
+
return number;
|
|
51
|
+
} catch (e) {
|
|
52
|
+
throw new BaseError(KV_STORE_ERROR_KEYS.NOT_INTEGER, e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async decrement(key, amount) {
|
|
56
|
+
try {
|
|
57
|
+
const number = await this._client.decrby(key, amount ?? 1);
|
|
58
|
+
return number;
|
|
59
|
+
} catch (e) {
|
|
60
|
+
throw new BaseError(KV_STORE_ERROR_KEYS.NOT_INTEGER, e);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async del(key) {
|
|
64
|
+
const res = await this._client.del(key);
|
|
65
|
+
return res === 1;
|
|
66
|
+
}
|
|
67
|
+
async expire(key, ttlSec) {
|
|
68
|
+
const res = await this._client.expire(key, ttlSec);
|
|
69
|
+
return res === 1;
|
|
70
|
+
}
|
|
71
|
+
async ttl(key) {
|
|
72
|
+
const res = await this._client.ttl(key);
|
|
73
|
+
return res;
|
|
74
|
+
}
|
|
75
|
+
async clean() {
|
|
76
|
+
const keys = await this._client.keys("*");
|
|
77
|
+
if (keys.length === 0)
|
|
78
|
+
return 0;
|
|
79
|
+
return this._client.del(...keys);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
BunRedisStore
|
|
84
|
+
};
|
|
@@ -48,26 +48,20 @@ class IoRedisStore {
|
|
|
48
48
|
await this._client.set(key, serialized);
|
|
49
49
|
}
|
|
50
50
|
async increment(key, amount = 1) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
try {
|
|
52
|
+
const number = await this._client.incrby(key, amount);
|
|
53
|
+
return number;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
throw new BaseError(KV_STORE_ERROR_KEYS.NOT_INTEGER, e);
|
|
56
56
|
}
|
|
57
|
-
if (amount === 1)
|
|
58
|
-
return this._client.incr(key);
|
|
59
|
-
return this._client.incrby(key, amount);
|
|
60
57
|
}
|
|
61
58
|
async decrement(key, amount = 1) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
try {
|
|
60
|
+
const number = await this._client.decrby(key, amount);
|
|
61
|
+
return number;
|
|
62
|
+
} catch (e) {
|
|
63
|
+
throw new BaseError(KV_STORE_ERROR_KEYS.NOT_INTEGER, e);
|
|
67
64
|
}
|
|
68
|
-
if (amount === 1)
|
|
69
|
-
return this._client.decr(key);
|
|
70
|
-
return this._client.decrby(key, amount);
|
|
71
65
|
}
|
|
72
66
|
async del(key) {
|
|
73
67
|
const result = await this._client.del(key);
|