@mrxsys/mrx-core 2.11.1-1-and-275-20251023 → 2.12.0-2-and-288-20251203
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 +0 -0
- package/dist/{chunk-0d0zd2yg.js → chunk-037vwvd4.js} +2 -2
- package/dist/{chunk-jksb9ers.js → chunk-10w8mg8e.js} +1 -1
- package/dist/{chunk-dre2fgj0.js → chunk-2z8amjqt.js} +1 -1
- package/dist/{chunk-afyz8rg5.js → chunk-47yta3gd.js} +34 -22
- package/dist/chunk-4t7sy5qt.js +10 -0
- package/dist/chunk-642xajvx.js +59 -0
- package/dist/chunk-6hs00zfd.js +13 -0
- package/dist/chunk-8pw0syzf.js +9 -0
- package/dist/{chunk-eeb7yskp.js → chunk-awphtyzp.js} +4 -4
- package/dist/{chunk-8tffnbpn.js → chunk-ayyrgqyv.js} +1 -1
- package/dist/{chunk-12qzn7jw.js → chunk-dmsev7vs.js} +1 -1
- package/dist/{chunk-afd82epa.js → chunk-hnds0krm.js} +13 -13
- package/dist/{chunk-gtn1kn0z.js → chunk-hv6g22kf.js} +4 -4
- package/dist/chunk-hwfebx4x.js +11 -0
- package/dist/chunk-j7dyc5ks.js +101 -0
- package/dist/chunk-jz3wd472.js +23 -0
- package/dist/{chunk-fs3wm3p4.js → chunk-r7yr9p57.js} +6 -6
- package/dist/chunk-txazb0xn.js +27 -0
- package/dist/chunk-y5dtkmnp.js +8 -0
- package/dist/chunk-yrt0ffvf.js +9 -0
- package/dist/chunk-zn2nm5gg.js +9 -0
- package/dist/{chunk-7t524zqh.js → chunk-zv4ta4fb.js} +3 -3
- package/dist/errors/{base-error.d.ts → app-error.d.ts} +2 -1
- package/dist/errors/http-error.d.ts +2 -2
- package/dist/errors/index.d.ts +2 -1
- package/dist/errors/index.js +6 -4
- package/dist/errors/internal-error.d.ts +4 -0
- package/dist/modules/data/data.d.ts +5 -5
- package/dist/modules/data/enums/data-error-keys.d.ts +1 -1
- package/dist/modules/data/enums/index.js +1 -1
- package/dist/modules/data/index.js +3 -3
- package/dist/modules/database/enums/database-error-keys.d.ts +26 -26
- package/dist/modules/database/enums/index.js +1 -1
- package/dist/modules/database/enums/mssql-error-code.d.ts +23 -23
- package/dist/modules/database/index.js +5 -5
- package/dist/modules/database/mssql.d.ts +9 -9
- package/dist/modules/elysia/cache/cache.d.ts +1 -1
- package/dist/modules/elysia/cache/index.js +3 -3
- package/dist/modules/elysia/db-resolver/enums/db-resolver-error-keys.d.ts +1 -1
- package/dist/modules/elysia/db-resolver/enums/index.js +1 -1
- package/dist/modules/elysia/db-resolver/index.js +53 -10
- package/dist/modules/elysia/error/enums/error.keys.d.ts +4 -4
- package/dist/modules/elysia/error/enums/index.js +1 -1
- package/dist/modules/elysia/error/error.d.ts +5 -5
- package/dist/modules/elysia/error/index.js +14 -14
- package/dist/modules/elysia/microservice/enums/index.js +1 -1
- package/dist/modules/elysia/microservice/enums/microservice-success-keys.d.ts +2 -2
- package/dist/modules/elysia/microservice/index.js +1 -1
- package/dist/modules/elysia/rate-limit/enums/index.js +1 -1
- package/dist/modules/elysia/rate-limit/enums/rate-limit-error-keys.d.ts +1 -1
- package/dist/modules/elysia/rate-limit/index.js +7 -6
- package/dist/modules/elysia/rate-limit/rate-limit.d.ts +1 -1
- package/dist/modules/jwt/enums/index.js +2 -2
- package/dist/modules/jwt/enums/jwt-error-keys.d.ts +3 -3
- package/dist/modules/jwt/enums/parse-human-time-to-seconds-error-keys.d.ts +1 -1
- package/dist/modules/jwt/index.js +10 -12
- package/dist/modules/jwt/utils/index.js +3 -3
- package/dist/modules/jwt/utils/parse-human-time-to-seconds.d.ts +1 -1
- package/dist/modules/kv-store/bun-redis/index.js +25 -17
- package/dist/modules/kv-store/enums/index.js +1 -1
- package/dist/modules/kv-store/enums/kv-store-error-keys.d.ts +3 -3
- package/dist/modules/kv-store/ioredis/index.js +17 -17
- package/dist/modules/kv-store/memory/index.js +4 -98
- package/dist/modules/logger/enums/index.js +1 -1
- package/dist/modules/logger/enums/logger-error-keys.d.ts +7 -7
- package/dist/modules/logger/events/logger-events.d.ts +4 -4
- package/dist/modules/logger/index.js +91 -20
- package/dist/modules/logger/logger.d.ts +2 -2
- package/dist/modules/logger/sinks/console-logger.d.ts +1 -1
- package/dist/modules/logger/sinks/file-logger/enums/file-logger-error-keys.d.ts +1 -1
- package/dist/modules/logger/sinks/file-logger/file-logger.d.ts +3 -3
- package/dist/modules/logger/sinks/index.js +10 -11
- package/dist/modules/logger/types/logger-options.d.ts +1 -1
- package/dist/modules/logger/types/logger-sink.d.ts +1 -1
- package/dist/modules/logger/worker-logger.d.ts +1 -0
- package/dist/modules/mailer/enums/index.js +1 -1
- package/dist/modules/mailer/enums/mailer-error-keys.d.ts +3 -3
- package/dist/modules/mailer/index.js +6 -6
- package/dist/modules/mailer/smtp.d.ts +4 -4
- package/dist/modules/repository/index.js +4 -4
- package/dist/modules/repository/repository.d.ts +29 -13
- package/dist/modules/repository/types/filter.d.ts +2 -5
- package/dist/modules/repository/types/global-search.d.ts +12 -0
- package/dist/modules/repository/types/index.d.ts +2 -1
- package/dist/modules/repository/types/{order-by-item.d.ts → order-by.d.ts} +3 -3
- package/dist/modules/repository/types/query-options.d.ts +4 -5
- package/dist/modules/schema-builder/build-adaptive-where-clause-schema.d.ts +17 -0
- package/dist/modules/schema-builder/build-count-schema.d.ts +12 -0
- package/dist/modules/{elysia/crud/utils/create-delete-schema.d.ts → schema-builder/build-delete-schema.d.ts} +3 -3
- package/dist/modules/schema-builder/build-filters-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-find-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-global-search-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-insert-schema.d.ts +3 -0
- package/dist/modules/schema-builder/build-order-by-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-selected-fields.d.ts +12 -0
- package/dist/modules/schema-builder/build-update-one-schema.d.ts +12 -0
- package/dist/modules/schema-builder/build-update-schema.d.ts +12 -0
- package/dist/modules/schema-builder/clean-schema.d.ts +2 -0
- package/dist/modules/schema-builder/index.d.ts +12 -0
- package/dist/modules/schema-builder/index.js +230 -0
- package/dist/modules/{elysia/crud → schema-builder}/types/count-schema.d.ts +3 -3
- package/dist/modules/schema-builder/types/delete-schema.d.ts +12 -0
- package/dist/modules/schema-builder/types/filter-schema.d.ts +12 -0
- package/dist/modules/schema-builder/types/find-schema.d.ts +16 -0
- package/dist/modules/{elysia/crud/types/q-schema.d.ts → schema-builder/types/global-search-schema.d.ts} +1 -1
- package/dist/modules/schema-builder/types/index.d.ts +12 -0
- package/dist/modules/{elysia/crud → schema-builder}/types/insert-schema.d.ts +1 -1
- package/dist/modules/schema-builder/types/order-by-schema.d.ts +5 -0
- package/dist/modules/{elysia/crud → schema-builder}/types/update-schema.d.ts +4 -4
- package/dist/{shared → modules/schema-builder}/utils/flatten.d.ts +1 -1
- package/dist/modules/schema-builder/utils/index.d.ts +2 -0
- package/dist/modules/schema-builder/utils/index.js +9 -0
- package/dist/modules/singleton-manager/enums/index.js +1 -1
- package/dist/modules/singleton-manager/enums/singleton-manager-error-keys.d.ts +2 -2
- package/dist/modules/singleton-manager/index.js +3 -3
- package/dist/modules/singleton-manager/singleton-manager.d.ts +3 -3
- package/dist/modules/totp/enums/index.js +1 -1
- package/dist/modules/totp/enums/totp-error-keys.d.ts +5 -5
- package/dist/modules/totp/index.js +6 -6
- package/dist/modules/totp/otp-auth-uri.d.ts +1 -1
- package/dist/modules/totp/utils/base32.d.ts +1 -1
- package/dist/modules/totp/utils/generate-secret-bytes.d.ts +1 -1
- package/dist/modules/totp/utils/index.js +5 -5
- package/dist/shared/types/index.d.ts +0 -1
- package/dist/shared/utils/env.d.ts +1 -1
- package/dist/shared/utils/index.d.ts +0 -1
- package/dist/shared/utils/index.js +4 -8
- package/package.json +19 -22
- package/dist/chunk-441xs5k1.js +0 -53
- package/dist/chunk-4v86f7gp.js +0 -59
- package/dist/chunk-6w9ja96e.js +0 -9
- package/dist/chunk-9cgzhc50.js +0 -15
- package/dist/chunk-9d3zvgp6.js +0 -9
- package/dist/chunk-9dzsj7f2.js +0 -23
- package/dist/chunk-9r5anep5.js +0 -11
- package/dist/chunk-p14h6jfs.js +0 -365
- package/dist/chunk-pjv1ekwr.js +0 -284
- package/dist/chunk-rz5p4j3p.js +0 -13
- package/dist/chunk-spnh9dzk.js +0 -10
- package/dist/chunk-w7h898m3.js +0 -14
- package/dist/chunk-xhhj1gvj.js +0 -9
- package/dist/chunk-z0ct35ft.js +0 -8
- package/dist/errors/utils/index.d.ts +0 -1
- package/dist/errors/utils/index.js +0 -16
- package/dist/errors/utils/is-nowarajs-error.ts.d.ts +0 -4
- package/dist/modules/elysia/crud/crud-schema.d.ts +0 -18
- package/dist/modules/elysia/crud/crud.d.ts +0 -38
- package/dist/modules/elysia/crud/enums/crud-success-keys.d.ts +0 -10
- package/dist/modules/elysia/crud/enums/index.d.ts +0 -1
- package/dist/modules/elysia/crud/enums/index.js +0 -7
- package/dist/modules/elysia/crud/index.d.ts +0 -2
- package/dist/modules/elysia/crud/index.js +0 -153
- package/dist/modules/elysia/crud/operations/count.d.ts +0 -258
- package/dist/modules/elysia/crud/operations/delete.d.ts +0 -258
- package/dist/modules/elysia/crud/operations/deleteOne.d.ts +0 -258
- package/dist/modules/elysia/crud/operations/find.d.ts +0 -258
- package/dist/modules/elysia/crud/operations/findOne.d.ts +0 -258
- package/dist/modules/elysia/crud/operations/index.d.ts +0 -8
- package/dist/modules/elysia/crud/operations/index.js +0 -34
- package/dist/modules/elysia/crud/operations/insert.d.ts +0 -258
- package/dist/modules/elysia/crud/operations/update.d.ts +0 -268
- package/dist/modules/elysia/crud/operations/updateOne.d.ts +0 -268
- package/dist/modules/elysia/crud/operations/utils/get-db-injection.d.ts +0 -8
- package/dist/modules/elysia/crud/types/count-response-200-schema.d.ts +0 -5
- package/dist/modules/elysia/crud/types/crud-operation-base.d.ts +0 -4
- package/dist/modules/elysia/crud/types/crud-operation-count.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-delete-one.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-delete.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-find-one.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-find.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-insert.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operation-update-one.d.ts +0 -16
- package/dist/modules/elysia/crud/types/crud-operation-update.d.ts +0 -14
- package/dist/modules/elysia/crud/types/crud-operations.d.ts +0 -19
- package/dist/modules/elysia/crud/types/crud-options.d.ts +0 -44
- package/dist/modules/elysia/crud/types/crud-schema-models-type.d.ts +0 -12
- package/dist/modules/elysia/crud/types/crud-schema-operations.d.ts +0 -10
- package/dist/modules/elysia/crud/types/crud-schema-options.d.ts +0 -13
- package/dist/modules/elysia/crud/types/delete-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/types/filter-schema.d.ts +0 -9
- package/dist/modules/elysia/crud/types/find-schema.d.ts +0 -16
- package/dist/modules/elysia/crud/types/id-param-schema.d.ts +0 -4
- package/dist/modules/elysia/crud/types/index.d.ts +0 -29
- package/dist/modules/elysia/crud/types/order-schema.d.ts +0 -11
- package/dist/modules/elysia/crud/types/properties-schema.d.ts +0 -9
- package/dist/modules/elysia/crud/types/response-200-schema.d.ts +0 -11
- package/dist/modules/elysia/crud/utils/create-adaptive-where-clause-schema.d.ts +0 -17
- package/dist/modules/elysia/crud/utils/create-count-response-200-schema.d.ts +0 -8
- package/dist/modules/elysia/crud/utils/create-count-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-filters-schema.d.ts +0 -14
- package/dist/modules/elysia/crud/utils/create-find-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-id-param-schema.d.ts +0 -2
- package/dist/modules/elysia/crud/utils/create-insert-schema.d.ts +0 -8
- package/dist/modules/elysia/crud/utils/create-order-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-properties-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-q-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-response-200-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/create-selected-fields-schema.d.ts +0 -12
- package/dist/modules/elysia/crud/utils/create-update-one-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/create-update-schema.d.ts +0 -3
- package/dist/modules/elysia/crud/utils/index.d.ts +0 -16
- package/dist/modules/elysia/crud/utils/index.js +0 -41
- /package/dist/modules/{elysia/crud → schema-builder}/types/adaptive-where-clause-schema.d.ts +0 -0
- /package/dist/modules/{elysia/crud → schema-builder}/types/index.js +0 -0
- /package/dist/modules/{elysia/crud/types/selected-field-schema.d.ts → schema-builder/types/selected-fields-schema.d.ts} +0 -0
- /package/dist/{shared → modules/schema-builder}/types/tflatten.d.ts +0 -0
- /package/dist/modules/{elysia/crud → schema-builder}/types/update-one-schema.d.ts +0 -0
- /package/dist/modules/{elysia/crud → schema-builder}/utils/is-date-from-elysia-typebox.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class AppError<const TCause = unknown> extends Error {
|
|
2
2
|
readonly cause: TCause | undefined;
|
|
3
3
|
readonly date: Date;
|
|
4
|
+
readonly uuid: string;
|
|
4
5
|
constructor(message: string, cause?: TCause);
|
|
5
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppError } from './app-error';
|
|
2
2
|
import { HTTP_STATUS_CODES } from './enums/http-status-codes';
|
|
3
3
|
export type HttpStatusKey = keyof typeof HTTP_STATUS_CODES;
|
|
4
4
|
export type HttpStatusCode = typeof HTTP_STATUS_CODES[HttpStatusKey];
|
|
5
|
-
export declare class HttpError<const TCause = unknown> extends
|
|
5
|
+
export declare class HttpError<const TCause = unknown> extends AppError<TCause> {
|
|
6
6
|
readonly httpStatusCode: number;
|
|
7
7
|
constructor(message: string, cause?: TCause);
|
|
8
8
|
constructor(message: string, httpStatusCode: HttpStatusKey | HttpStatusCode, cause?: TCause);
|
package/dist/errors/index.d.ts
CHANGED
package/dist/errors/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
HttpError
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-zv4ta4fb.js";
|
|
5
5
|
import"../chunk-sqts8vyk.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
AppError,
|
|
8
|
+
InternalError
|
|
9
|
+
} from "../chunk-jz3wd472.js";
|
|
9
10
|
export {
|
|
11
|
+
InternalError,
|
|
10
12
|
HttpError,
|
|
11
|
-
|
|
13
|
+
AppError
|
|
12
14
|
};
|
|
@@ -11,7 +11,7 @@ import type { TransformObjectKeys } from './types/transform-object-keys';
|
|
|
11
11
|
* @param keys - The array of keys to exclude from the data object. (Can be empty)
|
|
12
12
|
* @param excludeNullUndefined - Flag to determine if properties with null or undefined values should be excluded.
|
|
13
13
|
*
|
|
14
|
-
* @throws ({@link
|
|
14
|
+
* @throws ({@link InternalError}) - Throws an error if the data is null or undefined.
|
|
15
15
|
*
|
|
16
16
|
* @returns The filtered data object with the specified keys excluded.
|
|
17
17
|
*
|
|
@@ -40,7 +40,7 @@ export declare const filterByKeyExclusion: <TObject extends Readonly<object>, TE
|
|
|
40
40
|
* @param keys - The array of keys to exclude from the data object and all nested objects. (Can be empty)
|
|
41
41
|
* @param excludeNullUndefined - Flag to determine if properties with null or undefined values should be excluded. Default is false.
|
|
42
42
|
*
|
|
43
|
-
* @throws ({@link
|
|
43
|
+
* @throws ({@link InternalError}) - Throws an error if the data is null or undefined and throwIfDataIsNull is true.
|
|
44
44
|
*
|
|
45
45
|
* @returns A new object with the specified keys excluded recursively.
|
|
46
46
|
*
|
|
@@ -62,7 +62,7 @@ export declare const filterByKeyExclusionRecursive: <TObject extends Readonly<ob
|
|
|
62
62
|
* @param keys - The array of keys to include in the resulting data object. (Can be empty)
|
|
63
63
|
* @param excludeNullUndefined - Flag to determine if properties with null or undefined values should be excluded.
|
|
64
64
|
*
|
|
65
|
-
* @throws ({@link
|
|
65
|
+
* @throws ({@link InternalError}) - Throws an error if the data is null or undefined.
|
|
66
66
|
*
|
|
67
67
|
* @returns The filtered data object with only the specified keys included.
|
|
68
68
|
*
|
|
@@ -83,7 +83,7 @@ export declare const filterByKeyInclusion: <TObject extends Readonly<object>, TI
|
|
|
83
83
|
* @param predicate - The predicate function to apply to the values.
|
|
84
84
|
* @param excludeNullUndefined - Flag to determine if properties with null or undefined values should be excluded. Default is false.
|
|
85
85
|
*
|
|
86
|
-
* @throws ({@link
|
|
86
|
+
* @throws ({@link InternalError}) - Throws an error if the data is null or undefined.
|
|
87
87
|
*
|
|
88
88
|
* @returns The filtered data object with properties satisfying the predicate.
|
|
89
89
|
*
|
|
@@ -103,7 +103,7 @@ export declare const filterByValue: <TObject extends Readonly<object>>(data: Rea
|
|
|
103
103
|
* @param data - The object whose keys are to be transformed.
|
|
104
104
|
* @param transformer - The key transformation strategy to use.
|
|
105
105
|
*
|
|
106
|
-
* @throws ({@link
|
|
106
|
+
* @throws ({@link InternalError}) - If the provided data object is null or undefined.
|
|
107
107
|
*
|
|
108
108
|
* @returns A new object with transformed keys.
|
|
109
109
|
*
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
filterByKeyInclusion,
|
|
6
6
|
filterByValue,
|
|
7
7
|
transformKeys
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import"../../chunk-
|
|
10
|
-
import"../../chunk-
|
|
8
|
+
} from "../../chunk-hv6g22kf.js";
|
|
9
|
+
import"../../chunk-10w8mg8e.js";
|
|
10
|
+
import"../../chunk-jz3wd472.js";
|
|
11
11
|
export {
|
|
12
12
|
transformKeys,
|
|
13
13
|
filterByValue,
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
export declare const DATABASE_ERROR_KEYS: {
|
|
2
|
-
readonly MSSQL_CONNECTION_ERROR: "mrx-core.mssql.error.database.connection_error";
|
|
3
|
-
readonly MSSQL_DATABASE_ACCESS_DENIED: "mrx-core.mssql.error.database.access_denied";
|
|
4
|
-
readonly MSSQL_DATABASE_AMBIGUOUS_COLUMN: "mrx-core.mssql.error.database.ambiguous_column";
|
|
5
|
-
readonly MSSQL_DATABASE_AUTHORIZATION_FAILED: "mrx-core.mssql.error.database.authorization_failed";
|
|
6
|
-
readonly MSSQL_DATABASE_COLUMN_NOT_FOUND: "mrx-core.mssql.error.database.column_not_found";
|
|
7
|
-
readonly MSSQL_DATABASE_CONVERSION_FAILED: "mrx-core.mssql.error.database.conversion_failed";
|
|
8
|
-
readonly MSSQL_DATABASE_DATA_TOO_LARGE: "mrx-core.mssql.error.database.data_too_large";
|
|
9
|
-
readonly MSSQL_DATABASE_DEADLOCK_DETECTED: "mrx-core.mssql.error.database.deadlock_detected";
|
|
10
|
-
readonly MSSQL_DATABASE_DUPLICATE_KEY: "mrx-core.mssql.error.database.duplicate_key";
|
|
11
|
-
readonly MSSQL_DATABASE_FOREIGN_KEY_VIOLATION: "mrx-core.mssql.error.database.foreign_key_violation";
|
|
12
|
-
readonly MSSQL_DATABASE_IDENTITY_INSERT_NOT_ALLOWED: "mrx-core.mssql.error.database.identity_insert_not_allowed";
|
|
13
|
-
readonly MSSQL_DATABASE_INSUFFICIENT_MEMORY: "mrx-core.mssql.error.database.insufficient_memory";
|
|
14
|
-
readonly MSSQL_DATABASE_INSUFFICIENT_STORAGE: "mrx-core.mssql.error.database.insufficient_storage";
|
|
15
|
-
readonly MSSQL_DATABASE_PERMISSION_DENIED: "mrx-core.mssql.error.database.permission_denied";
|
|
16
|
-
readonly MSSQL_DATABASE_QUERY_TIMEOUT: "mrx-core.mssql.error.database.query_timeout";
|
|
17
|
-
readonly MSSQL_DATABASE_RESOURCE_LOCKED: "mrx-core.mssql.error.database.resource_locked";
|
|
18
|
-
readonly MSSQL_DATABASE_SYNTAX_ERROR: "mrx-core.mssql.error.database.syntax_error";
|
|
19
|
-
readonly MSSQL_DATABASE_TRANSACTION_ABORTED: "mrx-core.mssql.error.database.transaction_aborted";
|
|
20
|
-
readonly MSSQL_DATABASE_TRANSACTION_LOG_FULL: "mrx-core.mssql.error.database.transaction_log_full";
|
|
21
|
-
readonly MSSQL_DATABASE_UNIQUE_CONSTRAINT_VIOLATION: "mrx-core.mssql.error.database.unique_constraint_violation";
|
|
22
|
-
readonly MSSQL_DATABASE_CANNOT_UPDATE_IDENTITY_COLUMN: "mrx-core.mssql.error.database.cannot_update_identity_column";
|
|
23
|
-
readonly MSSQL_DISCONNECT_ERROR: "mrx-core.mssql.error.database.disconnect_error";
|
|
24
|
-
readonly MSSQL_NO_RESULT: "mrx-core.mssql.error.database.no_result";
|
|
25
|
-
readonly MSSQL_NOT_CONNECTED: "mrx-core.mssql.error.database.not_connected";
|
|
26
|
-
readonly MSSQL_QUERY_ERROR: "mrx-core.mssql.error.database.query_error";
|
|
27
|
-
readonly MSSQL_TABLE_NOT_FOUND: "mrx-core.mssql.error.database.table_not_found";
|
|
2
|
+
readonly MSSQL_CONNECTION_ERROR: "mrx.mrx-core.mssql.error.database.connection_error";
|
|
3
|
+
readonly MSSQL_DATABASE_ACCESS_DENIED: "mrx.mrx-core.mssql.error.database.access_denied";
|
|
4
|
+
readonly MSSQL_DATABASE_AMBIGUOUS_COLUMN: "mrx.mrx-core.mssql.error.database.ambiguous_column";
|
|
5
|
+
readonly MSSQL_DATABASE_AUTHORIZATION_FAILED: "mrx.mrx-core.mssql.error.database.authorization_failed";
|
|
6
|
+
readonly MSSQL_DATABASE_COLUMN_NOT_FOUND: "mrx.mrx-core.mssql.error.database.column_not_found";
|
|
7
|
+
readonly MSSQL_DATABASE_CONVERSION_FAILED: "mrx.mrx-core.mssql.error.database.conversion_failed";
|
|
8
|
+
readonly MSSQL_DATABASE_DATA_TOO_LARGE: "mrx.mrx-core.mssql.error.database.data_too_large";
|
|
9
|
+
readonly MSSQL_DATABASE_DEADLOCK_DETECTED: "mrx.mrx-core.mssql.error.database.deadlock_detected";
|
|
10
|
+
readonly MSSQL_DATABASE_DUPLICATE_KEY: "mrx.mrx-core.mssql.error.database.duplicate_key";
|
|
11
|
+
readonly MSSQL_DATABASE_FOREIGN_KEY_VIOLATION: "mrx.mrx-core.mssql.error.database.foreign_key_violation";
|
|
12
|
+
readonly MSSQL_DATABASE_IDENTITY_INSERT_NOT_ALLOWED: "mrx.mrx-core.mssql.error.database.identity_insert_not_allowed";
|
|
13
|
+
readonly MSSQL_DATABASE_INSUFFICIENT_MEMORY: "mrx.mrx-core.mssql.error.database.insufficient_memory";
|
|
14
|
+
readonly MSSQL_DATABASE_INSUFFICIENT_STORAGE: "mrx.mrx-core.mssql.error.database.insufficient_storage";
|
|
15
|
+
readonly MSSQL_DATABASE_PERMISSION_DENIED: "mrx.mrx-core.mssql.error.database.permission_denied";
|
|
16
|
+
readonly MSSQL_DATABASE_QUERY_TIMEOUT: "mrx.mrx-core.mssql.error.database.query_timeout";
|
|
17
|
+
readonly MSSQL_DATABASE_RESOURCE_LOCKED: "mrx.mrx-core.mssql.error.database.resource_locked";
|
|
18
|
+
readonly MSSQL_DATABASE_SYNTAX_ERROR: "mrx.mrx-core.mssql.error.database.syntax_error";
|
|
19
|
+
readonly MSSQL_DATABASE_TRANSACTION_ABORTED: "mrx.mrx-core.mssql.error.database.transaction_aborted";
|
|
20
|
+
readonly MSSQL_DATABASE_TRANSACTION_LOG_FULL: "mrx.mrx-core.mssql.error.database.transaction_log_full";
|
|
21
|
+
readonly MSSQL_DATABASE_UNIQUE_CONSTRAINT_VIOLATION: "mrx.mrx-core.mssql.error.database.unique_constraint_violation";
|
|
22
|
+
readonly MSSQL_DATABASE_CANNOT_UPDATE_IDENTITY_COLUMN: "mrx.mrx-core.mssql.error.database.cannot_update_identity_column";
|
|
23
|
+
readonly MSSQL_DISCONNECT_ERROR: "mrx.mrx-core.mssql.error.database.disconnect_error";
|
|
24
|
+
readonly MSSQL_NO_RESULT: "mrx.mrx-core.mssql.error.database.no_result";
|
|
25
|
+
readonly MSSQL_NOT_CONNECTED: "mrx.mrx-core.mssql.error.database.not_connected";
|
|
26
|
+
readonly MSSQL_QUERY_ERROR: "mrx.mrx-core.mssql.error.database.query_error";
|
|
27
|
+
readonly MSSQL_TABLE_NOT_FOUND: "mrx.mrx-core.mssql.error.database.table_not_found";
|
|
28
28
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export declare const MSSQL_ERROR_CODE: {
|
|
2
|
-
readonly 0: "mrx-core.mssql.error.database.query_error";
|
|
3
|
-
readonly 102: "mrx-core.mssql.error.database.syntax_error";
|
|
4
|
-
readonly 1105: "mrx-core.mssql.error.database.insufficient_storage";
|
|
5
|
-
readonly 1205: "mrx-core.mssql.error.database.deadlock_detected";
|
|
6
|
-
readonly 1222: "mrx-core.mssql.error.database.resource_locked";
|
|
7
|
-
readonly 18452: "mrx-core.mssql.error.database.authorization_failed";
|
|
8
|
-
readonly 18456: "mrx-core.mssql.error.database.authorization_failed";
|
|
9
|
-
readonly 207: "mrx-core.mssql.error.database.column_not_found";
|
|
10
|
-
readonly 208: "mrx-core.mssql.error.database.table_not_found";
|
|
11
|
-
readonly 209: "mrx-core.mssql.error.database.ambiguous_column";
|
|
12
|
-
readonly 229: "mrx-core.mssql.error.database.permission_denied";
|
|
13
|
-
readonly 2601: "mrx-core.mssql.error.database.unique_constraint_violation";
|
|
14
|
-
readonly 2627: "mrx-core.mssql.error.database.duplicate_key";
|
|
15
|
-
readonly 3928: "mrx-core.mssql.error.database.transaction_aborted";
|
|
16
|
-
readonly 4060: "mrx-core.mssql.error.database.access_denied";
|
|
17
|
-
readonly 544: "mrx-core.mssql.error.database.identity_insert_not_allowed";
|
|
18
|
-
readonly 547: "mrx-core.mssql.error.database.foreign_key_violation";
|
|
19
|
-
readonly 701: "mrx-core.mssql.error.database.insufficient_memory";
|
|
20
|
-
readonly 8102: "mrx-core.mssql.error.database.cannot_update_identity_column";
|
|
21
|
-
readonly 8152: "mrx-core.mssql.error.database.data_too_large";
|
|
22
|
-
readonly 8169: "mrx-core.mssql.error.database.conversion_failed";
|
|
23
|
-
readonly 8645: "mrx-core.mssql.error.database.query_timeout";
|
|
24
|
-
readonly 9002: "mrx-core.mssql.error.database.transaction_log_full";
|
|
2
|
+
readonly 0: "mrx.mrx-core.mssql.error.database.query_error";
|
|
3
|
+
readonly 102: "mrx.mrx-core.mssql.error.database.syntax_error";
|
|
4
|
+
readonly 1105: "mrx.mrx-core.mssql.error.database.insufficient_storage";
|
|
5
|
+
readonly 1205: "mrx.mrx-core.mssql.error.database.deadlock_detected";
|
|
6
|
+
readonly 1222: "mrx.mrx-core.mssql.error.database.resource_locked";
|
|
7
|
+
readonly 18452: "mrx.mrx-core.mssql.error.database.authorization_failed";
|
|
8
|
+
readonly 18456: "mrx.mrx-core.mssql.error.database.authorization_failed";
|
|
9
|
+
readonly 207: "mrx.mrx-core.mssql.error.database.column_not_found";
|
|
10
|
+
readonly 208: "mrx.mrx-core.mssql.error.database.table_not_found";
|
|
11
|
+
readonly 209: "mrx.mrx-core.mssql.error.database.ambiguous_column";
|
|
12
|
+
readonly 229: "mrx.mrx-core.mssql.error.database.permission_denied";
|
|
13
|
+
readonly 2601: "mrx.mrx-core.mssql.error.database.unique_constraint_violation";
|
|
14
|
+
readonly 2627: "mrx.mrx-core.mssql.error.database.duplicate_key";
|
|
15
|
+
readonly 3928: "mrx.mrx-core.mssql.error.database.transaction_aborted";
|
|
16
|
+
readonly 4060: "mrx.mrx-core.mssql.error.database.access_denied";
|
|
17
|
+
readonly 544: "mrx.mrx-core.mssql.error.database.identity_insert_not_allowed";
|
|
18
|
+
readonly 547: "mrx.mrx-core.mssql.error.database.foreign_key_violation";
|
|
19
|
+
readonly 701: "mrx.mrx-core.mssql.error.database.insufficient_memory";
|
|
20
|
+
readonly 8102: "mrx.mrx-core.mssql.error.database.cannot_update_identity_column";
|
|
21
|
+
readonly 8152: "mrx.mrx-core.mssql.error.database.data_too_large";
|
|
22
|
+
readonly 8169: "mrx.mrx-core.mssql.error.database.conversion_failed";
|
|
23
|
+
readonly 8645: "mrx.mrx-core.mssql.error.database.query_timeout";
|
|
24
|
+
readonly 9002: "mrx.mrx-core.mssql.error.database.transaction_log_full";
|
|
25
25
|
};
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
MSSQL,
|
|
4
4
|
Table
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import"../../chunk-
|
|
5
|
+
} from "../../chunk-hnds0krm.js";
|
|
6
|
+
import"../../chunk-47yta3gd.js";
|
|
7
7
|
import"../../chunk-grfyngq0.js";
|
|
8
8
|
import"../../chunk-mvrxngm7.js";
|
|
9
|
-
import"../../chunk-
|
|
10
|
-
import"../../chunk-7t524zqh.js";
|
|
9
|
+
import"../../chunk-zv4ta4fb.js";
|
|
11
10
|
import"../../chunk-sqts8vyk.js";
|
|
12
|
-
import"../../chunk-
|
|
11
|
+
import"../../chunk-jz3wd472.js";
|
|
12
|
+
import"../../chunk-642xajvx.js";
|
|
13
13
|
export {
|
|
14
14
|
Table,
|
|
15
15
|
MSSQL
|
|
@@ -57,14 +57,14 @@ export declare class MSSQL extends TypedEventEmitter<MssqlEventMap> {
|
|
|
57
57
|
* If the connection is successful, introspection is performed to retrieve information about tables, columns(fields), and primary keys.
|
|
58
58
|
* This information is used to create instances of {@link Table} and {@link Repository} for each table in the database.
|
|
59
59
|
*
|
|
60
|
-
* @throws ({@link
|
|
60
|
+
* @throws ({@link InternalError}) Thrown if an error occurs during the connection process.
|
|
61
61
|
*/
|
|
62
62
|
connect(): Promise<void>;
|
|
63
63
|
/**
|
|
64
64
|
* Closes the connection to the MSSQL database.
|
|
65
65
|
*
|
|
66
|
-
* @throws ({@link
|
|
67
|
-
* @throws ({@link
|
|
66
|
+
* @throws ({@link InternalError}) Thrown if the database is not connected.
|
|
67
|
+
* @throws ({@link InternalError}) Thrown if an error occurs during the disconnection process.
|
|
68
68
|
*/
|
|
69
69
|
disconnect(): Promise<void>;
|
|
70
70
|
/**
|
|
@@ -76,20 +76,20 @@ export declare class MSSQL extends TypedEventEmitter<MssqlEventMap> {
|
|
|
76
76
|
* @param tableName - The name of the table to retrieve the repository for.
|
|
77
77
|
* @param customRepository - Optional custom repository class to use for the table.
|
|
78
78
|
*
|
|
79
|
-
* @throws ({@link
|
|
80
|
-
* @throws ({@link
|
|
79
|
+
* @throws ({@link InternalError}) Thrown if the database is not connected.
|
|
80
|
+
* @throws ({@link InternalError}) Thrown if the specified table is not found.
|
|
81
81
|
*
|
|
82
82
|
* @returns The {@link Repository} for the specified table.
|
|
83
83
|
*/
|
|
84
84
|
getRepository<TModel, TRepo extends Repository<TModel>>(tableName: string, customRepository: new (knex: Knex, table: Table) => TRepo): TRepo;
|
|
85
|
-
getRepository<TModel = unknown
|
|
85
|
+
getRepository<TModel = Record<string, unknown>>(tableName: string): Repository<TModel>;
|
|
86
86
|
/**
|
|
87
87
|
* Retrieves a table by name.
|
|
88
88
|
*
|
|
89
89
|
* @param tableName - The name of the table to retrieve.
|
|
90
90
|
*
|
|
91
|
-
* @throws ({@link
|
|
92
|
-
* @throws ({@link
|
|
91
|
+
* @throws ({@link InternalError}) Thrown if the database is not connected.
|
|
92
|
+
* @throws ({@link InternalError}) Thrown if the specified table is not found.
|
|
93
93
|
*
|
|
94
94
|
* @returns The {@link Table} object for the specified table.
|
|
95
95
|
*/
|
|
@@ -121,7 +121,7 @@ export declare class MSSQL extends TypedEventEmitter<MssqlEventMap> {
|
|
|
121
121
|
/**
|
|
122
122
|
* Retrieves the Knex instance for the database connection.
|
|
123
123
|
*
|
|
124
|
-
* @throws ({@link
|
|
124
|
+
* @throws ({@link InternalError}) Thrown if the database is not connected.
|
|
125
125
|
*
|
|
126
126
|
* @returns The {@link Knex} instance for the database connection.
|
|
127
127
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import type { KvStore } from '../../../modules/kv-store/types';
|
|
2
|
+
import type { KvStore } from '../../../modules/kv-store/types/kv-store';
|
|
3
3
|
import type { CacheOptions } from './types/cache-options';
|
|
4
4
|
export declare const cache: (store?: KvStore) => Elysia<"", {
|
|
5
5
|
decorator: {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
MemoryStore
|
|
4
|
-
} from "
|
|
5
|
-
import"../../../chunk-
|
|
6
|
-
import"../../../chunk-
|
|
4
|
+
} from "../../../chunk-j7dyc5ks.js";
|
|
5
|
+
import"../../../chunk-8pw0syzf.js";
|
|
6
|
+
import"../../../chunk-jz3wd472.js";
|
|
7
7
|
|
|
8
8
|
// source/modules/elysia/cache/cache.ts
|
|
9
9
|
import { Elysia } from "elysia";
|
|
@@ -1,18 +1,61 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import"../../../chunk-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
3
|
+
SingletonManager
|
|
4
|
+
} from "../../../chunk-r7yr9p57.js";
|
|
5
|
+
import"../../../chunk-y5dtkmnp.js";
|
|
6
|
+
import {
|
|
7
|
+
DB_RESOLVER_ERROR_KEYS
|
|
8
|
+
} from "../../../chunk-ayyrgqyv.js";
|
|
9
|
+
import {
|
|
10
|
+
MSSQL
|
|
11
|
+
} from "../../../chunk-hnds0krm.js";
|
|
12
|
+
import"../../../chunk-47yta3gd.js";
|
|
10
13
|
import"../../../chunk-grfyngq0.js";
|
|
11
14
|
import"../../../chunk-mvrxngm7.js";
|
|
12
|
-
import"../../../chunk-
|
|
13
|
-
import"../../../chunk-7t524zqh.js";
|
|
15
|
+
import"../../../chunk-zv4ta4fb.js";
|
|
14
16
|
import"../../../chunk-sqts8vyk.js";
|
|
15
|
-
import
|
|
17
|
+
import {
|
|
18
|
+
InternalError
|
|
19
|
+
} from "../../../chunk-jz3wd472.js";
|
|
20
|
+
import"../../../chunk-642xajvx.js";
|
|
21
|
+
|
|
22
|
+
// source/modules/elysia/db-resolver/db-resolver.ts
|
|
23
|
+
import { Elysia, t } from "elysia";
|
|
24
|
+
var dbResolver = (prefixDatabaseName = "") => new Elysia().model({
|
|
25
|
+
dbResolverHeader: t.Object({
|
|
26
|
+
"database-using": t.String()
|
|
27
|
+
})
|
|
28
|
+
}).macro({
|
|
29
|
+
injectDynamicDB(config) {
|
|
30
|
+
return {
|
|
31
|
+
headers: "dbResolverHeader",
|
|
32
|
+
async resolve({ headers }) {
|
|
33
|
+
const databaseName = headers["database-using"];
|
|
34
|
+
if (!SingletonManager.has(`${prefixDatabaseName}${databaseName}`)) {
|
|
35
|
+
SingletonManager.register(`${prefixDatabaseName}${databaseName}`, new MSSQL({
|
|
36
|
+
...config,
|
|
37
|
+
databaseName
|
|
38
|
+
}));
|
|
39
|
+
await SingletonManager.get(`${prefixDatabaseName}${databaseName}`).connect();
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
dynamicDB: SingletonManager.get(`${prefixDatabaseName}${databaseName}`)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
injectStaticDB(databaseName) {
|
|
48
|
+
return {
|
|
49
|
+
resolve() {
|
|
50
|
+
if (!SingletonManager.has(`${prefixDatabaseName}${databaseName}`))
|
|
51
|
+
throw new InternalError(DB_RESOLVER_ERROR_KEYS.DB_RESOLVER_STATIC_DB_NOT_FOUND, `${prefixDatabaseName}${databaseName}`);
|
|
52
|
+
return {
|
|
53
|
+
staticDB: SingletonManager.get(`${prefixDatabaseName}${databaseName}`)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
16
59
|
export {
|
|
17
60
|
dbResolver
|
|
18
61
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const ERROR_KEYS: {
|
|
2
|
-
readonly
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
2
|
+
readonly VALIDATION: "mrx.mrx-core.error.validation";
|
|
3
|
+
readonly NOT_FOUND: "mrx.mrx-core.error.not_found";
|
|
4
|
+
readonly PARSE: "mrx.mrx-core.error.parse";
|
|
5
|
+
readonly INTERNAL_SERVER_ERROR: "mrx.mrx-core.error.internal_server_error";
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import {
|
|
2
|
+
import { InternalError } from '../../../errors/internal-error';
|
|
3
3
|
import { HttpError } from '../../../errors/http-error';
|
|
4
4
|
/**
|
|
5
5
|
* The `errorPlugin` provides an error handling system for Elysia applications.
|
|
@@ -12,7 +12,7 @@ export declare const error: Elysia<"", {
|
|
|
12
12
|
}, {
|
|
13
13
|
typebox: {};
|
|
14
14
|
error: {
|
|
15
|
-
readonly
|
|
15
|
+
readonly InternalError: InternalError<any>;
|
|
16
16
|
readonly HttpError: HttpError<any>;
|
|
17
17
|
};
|
|
18
18
|
}, {
|
|
@@ -26,13 +26,13 @@ export declare const error: Elysia<"", {
|
|
|
26
26
|
message: string;
|
|
27
27
|
content: any;
|
|
28
28
|
} | {
|
|
29
|
-
message: "mrx-core.error.not_found";
|
|
29
|
+
message: "mrx.mrx-core.error.not_found";
|
|
30
30
|
content?: never;
|
|
31
31
|
} | {
|
|
32
|
-
message: "mrx-core.error.parse";
|
|
32
|
+
message: "mrx.mrx-core.error.parse";
|
|
33
33
|
content?: never;
|
|
34
34
|
} | {
|
|
35
|
-
message: "mrx-core.error.internal_server_error";
|
|
35
|
+
message: "mrx.mrx-core.error.internal_server_error";
|
|
36
36
|
content?: never;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ERROR_KEYS
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-4t7sy5qt.js";
|
|
5
5
|
import {
|
|
6
6
|
filterByKeyExclusion
|
|
7
|
-
} from "../../../chunk-
|
|
8
|
-
import"../../../chunk-
|
|
7
|
+
} from "../../../chunk-hv6g22kf.js";
|
|
8
|
+
import"../../../chunk-10w8mg8e.js";
|
|
9
9
|
import {
|
|
10
10
|
HttpError
|
|
11
|
-
} from "../../../chunk-
|
|
11
|
+
} from "../../../chunk-zv4ta4fb.js";
|
|
12
12
|
import"../../../chunk-sqts8vyk.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "../../../chunk-
|
|
14
|
+
InternalError
|
|
15
|
+
} from "../../../chunk-jz3wd472.js";
|
|
16
16
|
|
|
17
17
|
// source/modules/elysia/error/error.ts
|
|
18
18
|
import { Elysia } from "elysia";
|
|
19
19
|
var error = new Elysia({
|
|
20
20
|
name: "errorPlugin"
|
|
21
21
|
}).error({
|
|
22
|
-
|
|
22
|
+
InternalError,
|
|
23
23
|
HttpError
|
|
24
24
|
}).onError(({ code, error: error2, set }) => {
|
|
25
25
|
set.headers["content-type"] = "application/json; charset=utf-8";
|
|
@@ -30,16 +30,16 @@ var error = new Elysia({
|
|
|
30
30
|
message: error2.message,
|
|
31
31
|
content: error2.cause
|
|
32
32
|
};
|
|
33
|
-
case "
|
|
33
|
+
case "InternalError":
|
|
34
34
|
set.status = 500;
|
|
35
35
|
return {
|
|
36
|
-
message:
|
|
37
|
-
content: error2.
|
|
36
|
+
message: ERROR_KEYS.INTERNAL_SERVER_ERROR,
|
|
37
|
+
content: error2.uuid
|
|
38
38
|
};
|
|
39
39
|
case "VALIDATION": {
|
|
40
40
|
set.status = 422;
|
|
41
41
|
return {
|
|
42
|
-
message: ERROR_KEYS.
|
|
42
|
+
message: ERROR_KEYS.VALIDATION,
|
|
43
43
|
content: {
|
|
44
44
|
on: error2.type,
|
|
45
45
|
errors: error2.all.map((e) => ({
|
|
@@ -55,19 +55,19 @@ var error = new Elysia({
|
|
|
55
55
|
case "NOT_FOUND":
|
|
56
56
|
set.status = 404;
|
|
57
57
|
return {
|
|
58
|
-
message: ERROR_KEYS.
|
|
58
|
+
message: ERROR_KEYS.NOT_FOUND
|
|
59
59
|
};
|
|
60
60
|
case "PARSE":
|
|
61
61
|
set.status = 400;
|
|
62
62
|
return {
|
|
63
|
-
message: ERROR_KEYS.
|
|
63
|
+
message: ERROR_KEYS.PARSE
|
|
64
64
|
};
|
|
65
65
|
case "INTERNAL_SERVER_ERROR":
|
|
66
66
|
case "UNKNOWN":
|
|
67
67
|
default:
|
|
68
68
|
set.status = 500;
|
|
69
69
|
return {
|
|
70
|
-
message: ERROR_KEYS.
|
|
70
|
+
message: ERROR_KEYS.INTERNAL_SERVER_ERROR
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
}).as("global");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const MICROSERVICE_SUCCESS_KEYS: {
|
|
2
|
-
readonly PING_RESPONSE: "mrx-core.microservice.success.ping_response";
|
|
3
|
-
readonly INFO_RETRIEVED: "mrx-core.microservice.success.info_retrieved";
|
|
2
|
+
readonly PING_RESPONSE: "mrx.mrx-core.microservice.success.ping_response";
|
|
3
|
+
readonly INFO_RETRIEVED: "mrx.mrx-core.microservice.success.info_retrieved";
|
|
4
4
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
RATE_LIMIT_ERROR_KEYS
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-2z8amjqt.js";
|
|
5
5
|
import {
|
|
6
6
|
MemoryStore
|
|
7
|
-
} from "
|
|
8
|
-
import"../../../chunk-
|
|
7
|
+
} from "../../../chunk-j7dyc5ks.js";
|
|
8
|
+
import"../../../chunk-8pw0syzf.js";
|
|
9
9
|
import {
|
|
10
10
|
HttpError
|
|
11
|
-
} from "../../../chunk-
|
|
11
|
+
} from "../../../chunk-zv4ta4fb.js";
|
|
12
12
|
import"../../../chunk-sqts8vyk.js";
|
|
13
|
-
import"../../../chunk-
|
|
13
|
+
import"../../../chunk-jz3wd472.js";
|
|
14
14
|
|
|
15
15
|
// source/modules/elysia/rate-limit/rate-limit.ts
|
|
16
16
|
import { Elysia } from "elysia";
|
|
17
|
-
var rateLimit = (store
|
|
17
|
+
var rateLimit = (store) => {
|
|
18
18
|
const restrictedRoutes = new Map;
|
|
19
|
+
store = store || new MemoryStore;
|
|
19
20
|
const rateLimitCheck = async (key, limit, window, set) => {
|
|
20
21
|
if (set.headers["X-RateLimit-Limit"])
|
|
21
22
|
return;
|