@mrxsys/mrx-core 2.11.0-2-and-276-20251029 → 2.11.0-4-and-276-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.
Files changed (147) hide show
  1. package/dist/chunk-0d0zd2yg.js +8 -0
  2. package/dist/chunk-12qzn7jw.js +7 -0
  3. package/dist/chunk-441xs5k1.js +53 -0
  4. package/dist/chunk-4v86f7gp.js +59 -0
  5. package/dist/chunk-6w9ja96e.js +9 -0
  6. package/dist/chunk-7t524zqh.js +26 -0
  7. package/dist/chunk-8tffnbpn.js +7 -0
  8. package/dist/chunk-9cgzhc50.js +15 -0
  9. package/dist/chunk-9d3zvgp6.js +9 -0
  10. package/dist/chunk-9dzsj7f2.js +23 -0
  11. package/dist/chunk-9r5anep5.js +11 -0
  12. package/dist/chunk-afd82epa.js +201 -0
  13. package/dist/chunk-afyz8rg5.js +209 -0
  14. package/dist/chunk-dre2fgj0.js +7 -0
  15. package/dist/chunk-e30paw8a.js +101 -0
  16. package/dist/chunk-eeb7yskp.js +61 -0
  17. package/dist/chunk-fs3wm3p4.js +32 -0
  18. package/dist/chunk-grfyngq0.js +39 -0
  19. package/dist/chunk-gtn1kn0z.js +79 -0
  20. package/dist/chunk-jksb9ers.js +7 -0
  21. package/dist/chunk-m3grz32t.js +27 -0
  22. package/dist/chunk-mvrxngm7.js +41 -0
  23. package/dist/chunk-n0n14mf8.js +7 -0
  24. package/dist/chunk-p14h6jfs.js +365 -0
  25. package/dist/chunk-pjv1ekwr.js +284 -0
  26. package/dist/chunk-rz5p4j3p.js +13 -0
  27. package/dist/chunk-spnh9dzk.js +10 -0
  28. package/dist/chunk-sqts8vyk.js +60 -0
  29. package/dist/chunk-w7h898m3.js +14 -0
  30. package/dist/chunk-xhhj1gvj.js +9 -0
  31. package/dist/chunk-z0ct35ft.js +8 -0
  32. package/dist/errors/enums/index.js +7 -0
  33. package/dist/errors/index.js +12 -0
  34. package/dist/errors/utils/index.js +16 -0
  35. package/dist/errors/utils/is-nowarajs-error.ts.d.ts +2 -2
  36. package/dist/modules/data/enums/index.js +7 -0
  37. package/dist/modules/data/index.js +17 -0
  38. package/dist/modules/data/transformers/camel-case.d.ts +2 -2
  39. package/dist/modules/data/transformers/index.js +32 -0
  40. package/dist/modules/data/transformers/kebab-case.d.ts +2 -2
  41. package/dist/modules/data/transformers/pascal-case.d.ts +2 -2
  42. package/dist/modules/data/transformers/snake-case.d.ts +2 -2
  43. package/dist/modules/data/types/index.js +1 -0
  44. package/dist/modules/data/types/transform-object-keys.d.ts +4 -4
  45. package/dist/modules/database/enums/index.js +9 -0
  46. package/dist/modules/database/events/index.js +1 -0
  47. package/dist/modules/database/events/mssql-event-map.d.ts +1 -1
  48. package/dist/modules/database/events/table-event-map.d.ts +1 -1
  49. package/dist/modules/database/index.js +16 -0
  50. package/dist/modules/database/mssql.d.ts +2 -2
  51. package/dist/modules/database/table.d.ts +2 -2
  52. package/dist/modules/database/types/index.js +1 -0
  53. package/dist/modules/elysia/cache/cache.d.ts +1 -1
  54. package/dist/modules/elysia/cache/index.js +90 -0
  55. package/dist/modules/elysia/cache/types/index.js +1 -0
  56. package/dist/modules/elysia/crud/crud.d.ts +2 -2
  57. package/dist/modules/elysia/crud/enums/index.js +7 -0
  58. package/dist/modules/elysia/crud/index.js +153 -0
  59. package/dist/modules/elysia/crud/operations/count.d.ts +3 -3
  60. package/dist/modules/elysia/crud/operations/delete.d.ts +3 -3
  61. package/dist/modules/elysia/crud/operations/deleteOne.d.ts +3 -3
  62. package/dist/modules/elysia/crud/operations/find.d.ts +3 -3
  63. package/dist/modules/elysia/crud/operations/findOne.d.ts +3 -3
  64. package/dist/modules/elysia/crud/operations/index.js +34 -0
  65. package/dist/modules/elysia/crud/operations/insert.d.ts +3 -3
  66. package/dist/modules/elysia/crud/operations/update.d.ts +3 -3
  67. package/dist/modules/elysia/crud/operations/updateOne.d.ts +3 -3
  68. package/dist/modules/elysia/crud/operations/utils/get-db-injection.d.ts +1 -1
  69. package/dist/modules/elysia/crud/types/crud-options.d.ts +1 -1
  70. package/dist/modules/elysia/crud/types/crud-schema-models-type.d.ts +9 -9
  71. package/dist/modules/elysia/crud/types/delete-schema.d.ts +2 -2
  72. package/dist/modules/elysia/crud/types/find-schema.d.ts +3 -3
  73. package/dist/modules/elysia/crud/types/index.js +1 -0
  74. package/dist/modules/elysia/crud/types/insert-schema.d.ts +1 -1
  75. package/dist/modules/elysia/crud/types/properties-schema.d.ts +1 -1
  76. package/dist/modules/elysia/crud/types/response-200-schema.d.ts +1 -1
  77. package/dist/modules/elysia/crud/types/update-schema.d.ts +2 -2
  78. package/dist/modules/elysia/crud/utils/create-adaptive-where-clause-schema.d.ts +1 -1
  79. package/dist/modules/elysia/crud/utils/create-count-response-200-schema.d.ts +1 -1
  80. package/dist/modules/elysia/crud/utils/create-count-schema.d.ts +1 -1
  81. package/dist/modules/elysia/crud/utils/create-delete-schema.d.ts +1 -1
  82. package/dist/modules/elysia/crud/utils/create-filters-schema.d.ts +1 -1
  83. package/dist/modules/elysia/crud/utils/create-find-schema.d.ts +1 -1
  84. package/dist/modules/elysia/crud/utils/create-id-param-schema.d.ts +1 -1
  85. package/dist/modules/elysia/crud/utils/create-insert-schema.d.ts +1 -1
  86. package/dist/modules/elysia/crud/utils/create-order-schema.d.ts +1 -1
  87. package/dist/modules/elysia/crud/utils/create-properties-schema.d.ts +1 -1
  88. package/dist/modules/elysia/crud/utils/create-q-schema.d.ts +1 -1
  89. package/dist/modules/elysia/crud/utils/create-response-200-schema.d.ts +1 -1
  90. package/dist/modules/elysia/crud/utils/create-selected-fields-schema.d.ts +1 -1
  91. package/dist/modules/elysia/crud/utils/create-update-one-schema.d.ts +1 -1
  92. package/dist/modules/elysia/crud/utils/create-update-schema.d.ts +1 -1
  93. package/dist/modules/elysia/crud/utils/index.js +41 -0
  94. package/dist/modules/elysia/db-resolver/db-resolver.d.ts +2 -2
  95. package/dist/modules/elysia/db-resolver/enums/index.js +7 -0
  96. package/dist/modules/elysia/db-resolver/index.js +18 -0
  97. package/dist/modules/elysia/error/enums/index.js +7 -0
  98. package/dist/modules/elysia/error/error.d.ts +5 -0
  99. package/dist/modules/elysia/error/index.d.ts +1 -1
  100. package/dist/modules/elysia/error/index.js +67 -0
  101. package/dist/modules/elysia/microservice/enums/index.js +7 -0
  102. package/dist/modules/elysia/microservice/index.js +100 -0
  103. package/dist/modules/elysia/rate-limit/enums/index.js +7 -0
  104. package/dist/modules/elysia/rate-limit/index.js +81 -0
  105. package/dist/modules/elysia/rate-limit/rate-limit.d.ts +1 -1
  106. package/dist/modules/elysia/rate-limit/types/index.js +1 -0
  107. package/dist/modules/jwt/enums/index.js +11 -0
  108. package/dist/modules/jwt/index.js +51 -0
  109. package/dist/modules/jwt/utils/index.js +9 -0
  110. package/dist/modules/kv-store/bun-redis/bun-redis-store.d.ts +1 -1
  111. package/dist/modules/kv-store/bun-redis/index.js +84 -0
  112. package/dist/modules/kv-store/enums/index.js +7 -0
  113. package/dist/modules/kv-store/ioredis/index.js +86 -0
  114. package/dist/modules/kv-store/ioredis/ioredis-store.d.ts +1 -1
  115. package/dist/modules/kv-store/memory/index.js +9 -0
  116. package/dist/modules/kv-store/memory/memory-store.d.ts +1 -1
  117. package/dist/modules/kv-store/types/index.js +1 -0
  118. package/dist/modules/logger/enums/index.js +7 -0
  119. package/dist/modules/logger/events/index.js +1 -0
  120. package/dist/modules/logger/events/logger-events.d.ts +1 -1
  121. package/dist/modules/logger/index.js +208 -0
  122. package/dist/modules/logger/logger.d.ts +1 -1
  123. package/dist/modules/logger/sinks/console-logger.d.ts +2 -2
  124. package/dist/modules/logger/sinks/devnull-logger.d.ts +1 -1
  125. package/dist/modules/logger/sinks/file-logger/file-logger.d.ts +2 -2
  126. package/dist/modules/logger/sinks/index.js +66 -0
  127. package/dist/modules/logger/types/index.js +1 -0
  128. package/dist/modules/mailer/enums/index.js +7 -0
  129. package/dist/modules/mailer/index.js +55 -0
  130. package/dist/modules/mailer/types/index.js +1 -0
  131. package/dist/modules/repository/index.js +12 -0
  132. package/dist/modules/repository/repository.d.ts +2 -2
  133. package/dist/modules/repository/types/index.js +1 -0
  134. package/dist/modules/repository/types/query-options.d.ts +1 -1
  135. package/dist/modules/singleton-manager/enums/index.js +7 -0
  136. package/dist/modules/singleton-manager/index.js +9 -0
  137. package/dist/modules/totp/enums/index.js +7 -0
  138. package/dist/modules/totp/index.js +104 -0
  139. package/dist/modules/totp/types/index.js +1 -0
  140. package/dist/modules/totp/utils/index.js +76 -0
  141. package/dist/modules/typed-event-emitter/index.js +7 -0
  142. package/dist/modules/typed-event-emitter/types/index.js +1 -0
  143. package/dist/shared/enums/index.js +7 -0
  144. package/dist/shared/types/index.js +1 -0
  145. package/dist/shared/utils/flatten.d.ts +1 -1
  146. package/dist/shared/utils/index.js +30 -0
  147. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
2
  import { Elysia } from 'elysia';
3
- import type { MSSQL } from '#/modules/database/mssql';
4
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
5
- import type { CrudOperationFind } from '#/modules/elysia/crud/types/crud-operation-find';
3
+ import type { MSSQL } from '../../../../modules/database/mssql';
4
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
5
+ import type { CrudOperationFind } from '../../../../modules/elysia/crud/types/crud-operation-find';
6
6
  export declare const find: <const TDatabase extends Omit<MSSQLDatabaseOptions, "databaseName"> | string, const TTableName extends string, const THeaderSchema extends TObject, const TSourceFindSchema extends TObject, const TSourceResponseSchema extends TObject>(database: TDatabase, tableName: TTableName, { hook, method, path }: CrudOperationFind<THeaderSchema, TSourceFindSchema, TSourceResponseSchema>) => Elysia<"", {
7
7
  decorator: {};
8
8
  store: {};
@@ -1,8 +1,8 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
2
  import { Elysia } from 'elysia';
3
- import type { MSSQL } from '#/modules/database/mssql';
4
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
5
- import type { CrudOperationFindOne } from '#/modules/elysia/crud/types/crud-operation-find-one';
3
+ import type { MSSQL } from '../../../../modules/database/mssql';
4
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
5
+ import type { CrudOperationFindOne } from '../../../../modules/elysia/crud/types/crud-operation-find-one';
6
6
  export declare const findOne: <const TDatabase extends Omit<MSSQLDatabaseOptions, "databaseName"> | string, const TTableName extends string, const THeaderSchema extends TObject, const TSourceResponseSchema extends TObject>(database: TDatabase, tableName: TTableName, { hook, method, path }: CrudOperationFindOne<THeaderSchema, TSourceResponseSchema>) => Elysia<"", {
7
7
  decorator: {};
8
8
  store: {};
@@ -0,0 +1,34 @@
1
+ // @bun
2
+ import {
3
+ batchDelete,
4
+ count,
5
+ deleteOne,
6
+ find,
7
+ findOne,
8
+ insert,
9
+ update,
10
+ updateOne
11
+ } from "../../../../chunk-pjv1ekwr.js";
12
+ import"../../../../chunk-441xs5k1.js";
13
+ import"../../../../chunk-fs3wm3p4.js";
14
+ import"../../../../chunk-z0ct35ft.js";
15
+ import"../../../../chunk-8tffnbpn.js";
16
+ import"../../../../chunk-w7h898m3.js";
17
+ import"../../../../chunk-afd82epa.js";
18
+ import"../../../../chunk-afyz8rg5.js";
19
+ import"../../../../chunk-grfyngq0.js";
20
+ import"../../../../chunk-mvrxngm7.js";
21
+ import"../../../../chunk-4v86f7gp.js";
22
+ import"../../../../chunk-7t524zqh.js";
23
+ import"../../../../chunk-sqts8vyk.js";
24
+ import"../../../../chunk-9cgzhc50.js";
25
+ export {
26
+ updateOne,
27
+ update,
28
+ insert,
29
+ findOne,
30
+ find,
31
+ deleteOne,
32
+ count,
33
+ batchDelete
34
+ };
@@ -1,8 +1,8 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
2
  import { Elysia } from 'elysia';
3
- import type { MSSQL } from '#/modules/database/mssql';
4
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
5
- import type { CrudOperationInsert } from '#/modules/elysia/crud/types/crud-operation-insert';
3
+ import type { MSSQL } from '../../../../modules/database/mssql';
4
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
5
+ import type { CrudOperationInsert } from '../../../../modules/elysia/crud/types/crud-operation-insert';
6
6
  export declare const insert: <const TDatabase extends Omit<MSSQLDatabaseOptions, "databaseName"> | string, const TTableName extends string, const THeaderSchema extends TObject, const TSourceInsertSchema extends TObject, const TSourceResponseSchema extends TObject>(database: TDatabase, tableName: TTableName, { hook, method, path }: CrudOperationInsert<THeaderSchema, TSourceInsertSchema, TSourceResponseSchema>) => Elysia<"", {
7
7
  decorator: {};
8
8
  store: {};
@@ -1,8 +1,8 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
2
  import { Elysia } from 'elysia';
3
- import type { MSSQL } from '#/modules/database/mssql';
4
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
5
- import type { CrudOperationUpdate } from '#/modules/elysia/crud/types/crud-operation-update';
3
+ import type { MSSQL } from '../../../../modules/database/mssql';
4
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
5
+ import type { CrudOperationUpdate } from '../../../../modules/elysia/crud/types/crud-operation-update';
6
6
  export declare const update: <const TDatabase extends Omit<MSSQLDatabaseOptions, "databaseName"> | string, const TTableName extends string, const THeaderSchema extends TObject, const TSourceUpdateSchema extends TObject, const TSourceResponseSchema extends TObject>(database: TDatabase, tableName: TTableName, { hook, method, path }: CrudOperationUpdate<THeaderSchema, TSourceUpdateSchema, TSourceResponseSchema>) => Elysia<"", {
7
7
  decorator: {};
8
8
  store: {};
@@ -1,8 +1,8 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
2
  import { Elysia } from 'elysia';
3
- import type { MSSQL } from '#/modules/database/mssql';
4
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
5
- import type { CrudOperationUpdateOne } from '#/modules/elysia/crud/types/crud-operation-update-one';
3
+ import type { MSSQL } from '../../../../modules/database/mssql';
4
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
5
+ import type { CrudOperationUpdateOne } from '../../../../modules/elysia/crud/types/crud-operation-update-one';
6
6
  export declare const updateOne: <const TDatabase extends Omit<MSSQLDatabaseOptions, "databaseName"> | string, const TTableName extends string, const THeaderSchema extends TObject, const TSourceUpdateSchema extends TObject, const TSourceResponseSchema extends TObject>(database: TDatabase, tableName: TTableName, { hook, method, path }: CrudOperationUpdateOne<THeaderSchema, TSourceUpdateSchema, TSourceResponseSchema>) => Elysia<"", {
7
7
  decorator: {};
8
8
  store: {};
@@ -1,4 +1,4 @@
1
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
1
+ import type { MSSQLDatabaseOptions } from '../../../../../modules/database/types/mssql-database-option';
2
2
  export declare const getDbInjection: (database: Omit<MSSQLDatabaseOptions, "databaseName"> | string) => {
3
3
  injectStaticDB: string;
4
4
  injectDynamicDB?: never;
@@ -1,5 +1,5 @@
1
1
  import type { TObject, TString } from '@sinclair/typebox/type';
2
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
2
+ import type { MSSQLDatabaseOptions } from '../../../../modules/database/types/mssql-database-option';
3
3
  import type { CrudOperationCount } from './crud-operation-count';
4
4
  import type { CrudOperationDelete } from './crud-operation-delete';
5
5
  import type { CrudOperationDeleteOne } from './crud-operation-delete-one';
@@ -1,12 +1,12 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { CountResponse200Schema } from '#/modules/elysia/crud/types/count-response-200-schema';
3
- import type { CountSchema } from '#/modules/elysia/crud/types/count-schema';
4
- import type { DeleteSchema } from '#/modules/elysia/crud/types/delete-schema';
5
- import type { FindSchema } from '#/modules/elysia/crud/types/find-schema';
6
- import type { IdParamSchema } from '#/modules/elysia/crud/types/id-param-schema';
7
- import type { InsertSchema } from '#/modules/elysia/crud/types/insert-schema';
8
- import type { Response200Schema } from '#/modules/elysia/crud/types/response-200-schema';
9
- import type { UpdateOneSchema } from '#/modules/elysia/crud/types/update-one-schema';
10
- import type { UpdateSchema } from '#/modules/elysia/crud/types/update-schema';
2
+ import type { CountResponse200Schema } from '../../../../modules/elysia/crud/types/count-response-200-schema';
3
+ import type { CountSchema } from '../../../../modules/elysia/crud/types/count-schema';
4
+ import type { DeleteSchema } from '../../../../modules/elysia/crud/types/delete-schema';
5
+ import type { FindSchema } from '../../../../modules/elysia/crud/types/find-schema';
6
+ import type { IdParamSchema } from '../../../../modules/elysia/crud/types/id-param-schema';
7
+ import type { InsertSchema } from '../../../../modules/elysia/crud/types/insert-schema';
8
+ import type { Response200Schema } from '../../../../modules/elysia/crud/types/response-200-schema';
9
+ import type { UpdateOneSchema } from '../../../../modules/elysia/crud/types/update-one-schema';
10
+ import type { UpdateSchema } from '../../../../modules/elysia/crud/types/update-schema';
11
11
  import type { CrudSchemaOperations } from './crud-schema-operations';
12
12
  export type CrudSchemaModelsType<TSourceSchemaName extends string, TOperations extends CrudSchemaOperations, TSourceInsertSchema extends TObject, TSourceFindSchema extends TObject, TSourceCountSchema extends TObject, TSourceUpdateSchema extends TObject, TSourceDeleteSchema extends TObject, TSourceResponseSchema extends TObject> = (TOperations['insert'] extends true ? Record<`${TSourceSchemaName}Insert`, InsertSchema<TSourceInsertSchema>> : {}) & ((TOperations['find'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}Find`, FindSchema<TSourceFindSchema>> : {}) & ((TOperations['count'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}Count`, CountSchema<TSourceCountSchema>> : {}) & (TOperations['update'] extends true ? Record<`${TSourceSchemaName}Update`, UpdateSchema<TSourceUpdateSchema>> : {}) & (TOperations['updateOne'] extends true ? Record<`${TSourceSchemaName}UpdateOne`, UpdateOneSchema<TSourceUpdateSchema>> : {}) & (TOperations['delete'] extends true ? Record<`${TSourceSchemaName}Delete`, DeleteSchema<TSourceDeleteSchema>> : {}) & (((TOperations['findOne'] extends true ? true : TOperations['updateOne'] extends true ? true : TOperations['deleteOne'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}IdParam`, IdParamSchema> : {})) & ((TOperations['find'] extends true ? true : TOperations['findOne'] extends true ? true : TOperations['insert'] extends true ? true : TOperations['update'] extends true ? true : TOperations['updateOne'] extends true ? true : TOperations['delete'] extends true ? true : TOperations['deleteOne'] extends true ? true : false) extends true ? Record<`${TSourceSchemaName}Response200`, Response200Schema<TSourceResponseSchema>> : {}) & (TOperations['count'] extends true ? Record<`${TSourceSchemaName}CountResponse200`, CountResponse200Schema> : {});
@@ -1,6 +1,6 @@
1
1
  import type { TArray, TObject, TOptional, TPartial, TUnion } from '@sinclair/typebox/type';
2
- import type { FiltersSchema } from '#/modules/elysia/crud/types/filter-schema';
3
- import type { SelectedFieldsSchema } from '#/modules/elysia/crud/types/selected-field-schema';
2
+ import type { FiltersSchema } from '../../../../modules/elysia/crud/types/filter-schema';
3
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crud/types/selected-field-schema';
4
4
  export type DeleteSchema<TSourceDeleteSchema extends TObject> = TObject<{
5
5
  queryOptions: TObject<{
6
6
  selectedFields: TOptional<SelectedFieldsSchema<TSourceDeleteSchema>>;
@@ -1,7 +1,7 @@
1
1
  import type { TArray, TNumber, TObject, TPartial, TUnion } from '@sinclair/typebox/type';
2
- import type { FiltersSchema } from '#/modules/elysia/crud/types/filter-schema';
3
- import type { OrderSchema } from '#/modules/elysia/crud/types/order-schema';
4
- import type { SelectedFieldsSchema } from '#/modules/elysia/crud/types/selected-field-schema';
2
+ import type { FiltersSchema } from '../../../../modules/elysia/crud/types/filter-schema';
3
+ import type { OrderSchema } from '../../../../modules/elysia/crud/types/order-schema';
4
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crud/types/selected-field-schema';
5
5
  export type FindSchema<TSourceFindSchema extends TObject> = TPartial<TObject<{
6
6
  queryOptions: TPartial<TObject<{
7
7
  selectedFields: SelectedFieldsSchema<TSourceFindSchema>;
@@ -0,0 +1 @@
1
+ // @bun
@@ -1,5 +1,5 @@
1
1
  import type { TArray, TObject, TOptional, TUnion } from '@sinclair/typebox/type';
2
- import type { SelectedFieldsSchema } from '#/modules/elysia/crud/types/selected-field-schema';
2
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crud/types/selected-field-schema';
3
3
  export type InsertSchema<TSourceInsertSchema extends TObject> = TObject<{
4
4
  queryOptions: TOptional<TObject<{
5
5
  selectedFields: SelectedFieldsSchema<TSourceInsertSchema>;
@@ -1,5 +1,5 @@
1
1
  import type { Static, TObject, TUnion } from '@sinclair/typebox/type';
2
- import type { TFlatten } from '#/shared/types/tflatten';
2
+ import type { TFlatten } from '../../../../shared/types/tflatten';
3
3
  import type { AdaptiveWhereClauseSchema } from './adaptive-where-clause-schema';
4
4
  export type PropertiesSchema<TSourceSchema extends TObject> = TObject<{
5
5
  [K in keyof Static<TSourceSchema>]: TFlatten<TUnion<[
@@ -1,5 +1,5 @@
1
1
  import type { Static, TArray, TNull, TObject, TPartial, TString, TUnion } from '@sinclair/typebox/type';
2
- import type { TFlatten } from '#/shared/types/tflatten';
2
+ import type { TFlatten } from '../../../../shared/types/tflatten';
3
3
  export type Response200Schema<TSourceResponseSchema extends TObject> = TObject<{
4
4
  message: TString;
5
5
  content: TArray<TPartial<TObject<{
@@ -1,6 +1,6 @@
1
1
  import type { TArray, TObject, TOptional, TPartial, TUnion } from '@sinclair/typebox/type';
2
- import type { FiltersSchema } from '#/modules/elysia/crud/types/filter-schema';
3
- import type { SelectedFieldsSchema } from '#/modules/elysia/crud/types/selected-field-schema';
2
+ import type { FiltersSchema } from '../../../../modules/elysia/crud/types/filter-schema';
3
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crud/types/selected-field-schema';
4
4
  export type UpdateSchema<TSourceUpdateSchema extends TObject> = TObject<{
5
5
  queryOptions: TObject<{
6
6
  selectedFields: TOptional<SelectedFieldsSchema<TSourceUpdateSchema>>;
@@ -1,5 +1,5 @@
1
1
  import { type TSchema } from '@sinclair/typebox/type';
2
- import type { AdaptiveWhereClauseSchema } from '#/modules/elysia/crud/types/adaptive-where-clause-schema';
2
+ import type { AdaptiveWhereClauseSchema } from '../../../../modules/elysia/crud/types/adaptive-where-clause-schema';
3
3
  /**
4
4
  * Creates an adaptive where clause schema with appropriate operators based on the field type.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { CountResponse200Schema } from '#/modules/elysia/crud/types/count-response-200-schema';
1
+ import type { CountResponse200Schema } from '../../../../modules/elysia/crud/types/count-response-200-schema';
2
2
  /**
3
3
  * Creates a schema for the response of a count operation.
4
4
  * The response will contain a message and the count as content.
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { CountSchema } from '#/modules/elysia/crud/types/count-schema';
2
+ import type { CountSchema } from '../../../../modules/elysia/crud/types/count-schema';
3
3
  /**
4
4
  * Creates a count schema for counting records with optional filtering.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { DeleteSchema } from '#/modules/elysia/crud/types/delete-schema';
2
+ import type { DeleteSchema } from '../../../../modules/elysia/crud/types/delete-schema';
3
3
  /**
4
4
  * Creates a delete schema for deleting records with optional selected fields and required filtering.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { FiltersSchema } from '#/modules/elysia/crud/types/filter-schema';
2
+ import type { FiltersSchema } from '../../../../modules/elysia/crud/types/filter-schema';
3
3
  /**
4
4
  * Creates a filters schema that combines search queries and property filters.
5
5
  * The resulting schema includes a $q property for query operations and properties
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { FindSchema } from '#/modules/elysia/crud/types/find-schema';
2
+ import type { FindSchema } from '../../../../modules/elysia/crud/types/find-schema';
3
3
  /**
4
4
  * Creates a find schema.
5
5
  *
@@ -1,2 +1,2 @@
1
- import type { IdParamSchema } from '#/modules/elysia/crud/types/id-param-schema';
1
+ import type { IdParamSchema } from '../../../../modules/elysia/crud/types/id-param-schema';
2
2
  export declare const createIdParamSchema: () => IdParamSchema;
@@ -1,5 +1,5 @@
1
1
  import type { TArray, TObject, TOptional, TUnion } from '@sinclair/typebox/type';
2
- import type { SelectedFieldsSchema } from '#/modules/elysia/crud/types/selected-field-schema';
2
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crud/types/selected-field-schema';
3
3
  export declare const createInsertSchema: <TSourceInsertSchema extends TObject>(schema: TSourceInsertSchema) => TObject<{
4
4
  queryOptions: TOptional<TObject<{
5
5
  selectedFields: SelectedFieldsSchema<TSourceInsertSchema>;
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { OrderSchema } from '#/modules/elysia/crud/types/order-schema';
2
+ import type { OrderSchema } from '../../../../modules/elysia/crud/types/order-schema';
3
3
  /**
4
4
  * Creates order schema for query options.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { PropertiesSchema } from '#/modules/elysia/crud/types/properties-schema';
2
+ import type { PropertiesSchema } from '../../../../modules/elysia/crud/types/properties-schema';
3
3
  /**
4
4
  * Creates property schemas.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { QSchema } from '#/modules/elysia/crud/types/q-schema';
2
+ import type { QSchema } from '../../../../modules/elysia/crud/types/q-schema';
3
3
  /**
4
4
  * Creates a search query schema
5
5
  *
@@ -1,3 +1,3 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { Response200Schema } from '#/modules/elysia/crud/types/response-200-schema';
2
+ import type { Response200Schema } from '../../../../modules/elysia/crud/types/response-200-schema';
3
3
  export declare const createResponse200Schema: <TSourceResponseSchema extends TObject>(schema: TSourceResponseSchema) => Response200Schema<TSourceResponseSchema>;
@@ -1,5 +1,5 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { SelectedFieldsSchema } from '#/modules/elysia/crud/types/selected-field-schema';
2
+ import type { SelectedFieldsSchema } from '../../../../modules/elysia/crud/types/selected-field-schema';
3
3
  /**
4
4
  * Creates a schema for field selection in search results.
5
5
  *
@@ -1,3 +1,3 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { UpdateOneSchema } from '#/modules/elysia/crud/types/update-one-schema';
2
+ import type { UpdateOneSchema } from '../../../../modules/elysia/crud/types/update-one-schema';
3
3
  export declare const createUpdateOneSchema: <TSourceUpdateSchema extends TObject>(schema: TSourceUpdateSchema) => UpdateOneSchema<TSourceUpdateSchema>;
@@ -1,3 +1,3 @@
1
1
  import type { TObject } from '@sinclair/typebox/type';
2
- import type { UpdateSchema } from '#/modules/elysia/crud/types/update-schema';
2
+ import type { UpdateSchema } from '../../../../modules/elysia/crud/types/update-schema';
3
3
  export declare const createUpdateSchema: <TSourceUpdateSchema extends TObject>(schema: TSourceUpdateSchema) => UpdateSchema<TSourceUpdateSchema>;
@@ -0,0 +1,41 @@
1
+ // @bun
2
+ import {
3
+ createAdaptiveWhereClauseSchema,
4
+ createCountResponse200Schema,
5
+ createCountSchema,
6
+ createDeleteSchema,
7
+ createFiltersSchema,
8
+ createFindSchema,
9
+ createIdParamSchema,
10
+ createInsertSchema,
11
+ createOrderSchema,
12
+ createPropertiesSchema,
13
+ createQSchema,
14
+ createResponse200Schema,
15
+ createSelectedFieldsSchema,
16
+ createUpdateOneSchema,
17
+ createUpdateSchema,
18
+ isDateFromElysiaTypeBox
19
+ } from "../../../../chunk-p14h6jfs.js";
20
+ import"../../../../chunk-9dzsj7f2.js";
21
+ import"../../../../chunk-gtn1kn0z.js";
22
+ import"../../../../chunk-jksb9ers.js";
23
+ import"../../../../chunk-9cgzhc50.js";
24
+ export {
25
+ isDateFromElysiaTypeBox,
26
+ createUpdateSchema,
27
+ createUpdateOneSchema,
28
+ createSelectedFieldsSchema,
29
+ createResponse200Schema,
30
+ createQSchema,
31
+ createPropertiesSchema,
32
+ createOrderSchema,
33
+ createInsertSchema,
34
+ createIdParamSchema,
35
+ createFindSchema,
36
+ createFiltersSchema,
37
+ createDeleteSchema,
38
+ createCountSchema,
39
+ createCountResponse200Schema,
40
+ createAdaptiveWhereClauseSchema
41
+ };
@@ -1,6 +1,6 @@
1
1
  import { Elysia } from 'elysia';
2
- import { MSSQL } from '#/modules/database/mssql';
3
- import type { MSSQLDatabaseOptions } from '#/modules/database/types/mssql-database-option';
2
+ import { MSSQL } from '../../../modules/database/mssql';
3
+ import type { MSSQLDatabaseOptions } from '../../../modules/database/types/mssql-database-option';
4
4
  export declare const dbResolver: (prefixDatabaseName?: string) => Elysia<"", {
5
5
  decorator: {};
6
6
  store: {};
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import {
3
+ DB_RESOLVER_ERROR_KEYS
4
+ } from "../../../../chunk-8tffnbpn.js";
5
+ export {
6
+ DB_RESOLVER_ERROR_KEYS
7
+ };
@@ -0,0 +1,18 @@
1
+ // @bun
2
+ import {
3
+ dbResolver
4
+ } from "../../../chunk-441xs5k1.js";
5
+ import"../../../chunk-fs3wm3p4.js";
6
+ import"../../../chunk-z0ct35ft.js";
7
+ import"../../../chunk-8tffnbpn.js";
8
+ import"../../../chunk-afd82epa.js";
9
+ import"../../../chunk-afyz8rg5.js";
10
+ import"../../../chunk-grfyngq0.js";
11
+ import"../../../chunk-mvrxngm7.js";
12
+ import"../../../chunk-4v86f7gp.js";
13
+ import"../../../chunk-7t524zqh.js";
14
+ import"../../../chunk-sqts8vyk.js";
15
+ import"../../../chunk-9cgzhc50.js";
16
+ export {
17
+ dbResolver
18
+ };
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import {
3
+ ERROR_KEYS
4
+ } from "../../../../chunk-spnh9dzk.js";
5
+ export {
6
+ ERROR_KEYS
7
+ };
@@ -0,0 +1,5 @@
1
+ import { Elysia } from 'elysia';
2
+ /**
3
+ * The `errorPlugin` provides an error handling system for Elysia applications.
4
+ */
5
+ export declare const errorManager: Elysia;
@@ -1 +1 @@
1
- export { error } from './error';
1
+ export { errorManager } from './error';
@@ -0,0 +1,67 @@
1
+ // @bun
2
+ import {
3
+ ERROR_KEYS
4
+ } from "../../../chunk-spnh9dzk.js";
5
+ import {
6
+ filterByKeyExclusion
7
+ } from "../../../chunk-gtn1kn0z.js";
8
+ import"../../../chunk-jksb9ers.js";
9
+ import {
10
+ HttpError
11
+ } from "../../../chunk-7t524zqh.js";
12
+ import"../../../chunk-sqts8vyk.js";
13
+ import {
14
+ BaseError
15
+ } from "../../../chunk-9cgzhc50.js";
16
+
17
+ // source/modules/elysia/error/error.ts
18
+ import { Elysia } from "elysia";
19
+ var errorManager = new Elysia({
20
+ name: "errorPlugin"
21
+ }).error({
22
+ BaseError,
23
+ HttpError
24
+ }).onError(({ code, error, set, status }) => {
25
+ set.headers["content-type"] = "application/json; charset=utf-8";
26
+ switch (code) {
27
+ case "HttpError":
28
+ return status(error.httpStatusCode, {
29
+ message: error.message,
30
+ content: error.cause
31
+ });
32
+ case "BaseError":
33
+ return status(500, {
34
+ message: ERROR_KEYS.CORE_ERROR_INTERNAL_SERVER_ERROR,
35
+ content: error.cause
36
+ });
37
+ case "VALIDATION": {
38
+ return status(422, {
39
+ on: error.type,
40
+ errors: error.all.map((e) => ({
41
+ path: e.path,
42
+ value: e.value,
43
+ summary: e.summary,
44
+ message: e.schema?.error,
45
+ schema: filterByKeyExclusion(e.schema, ["error"], true)
46
+ }))
47
+ });
48
+ }
49
+ case "NOT_FOUND":
50
+ return status(404, {
51
+ message: ERROR_KEYS.CORE_ERROR_NOT_FOUND
52
+ });
53
+ case "PARSE":
54
+ return status(400, {
55
+ message: ERROR_KEYS.CORE_ERROR_PARSE
56
+ });
57
+ case "INTERNAL_SERVER_ERROR":
58
+ case "UNKNOWN":
59
+ default:
60
+ return status(500, {
61
+ message: ERROR_KEYS.CORE_ERROR_INTERNAL_SERVER_ERROR
62
+ });
63
+ }
64
+ }).as("global");
65
+ export {
66
+ errorManager
67
+ };
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import {
3
+ MICROSERVICE_SUCCESS_KEYS
4
+ } from "../../../../chunk-0d0zd2yg.js";
5
+ export {
6
+ MICROSERVICE_SUCCESS_KEYS
7
+ };
@@ -0,0 +1,100 @@
1
+ // @bun
2
+ import {
3
+ MICROSERVICE_SUCCESS_KEYS
4
+ } from "../../../chunk-0d0zd2yg.js";
5
+
6
+ // source/modules/elysia/microservice/microservice.ts
7
+ import { Elysia } from "elysia";
8
+ import { existsSync } from "fs";
9
+ import { platform } from "os";
10
+
11
+ // source/modules/elysia/microservice/schemas/info.ts
12
+ import { t } from "elysia";
13
+ var infoResponse200Schema = t.Object({
14
+ message: t.String({
15
+ description: "Message",
16
+ example: "Microservice Information"
17
+ }),
18
+ content: t.Object({
19
+ author: t.String({
20
+ description: "Author",
21
+ example: "Ruby"
22
+ }),
23
+ name: t.String({
24
+ description: "Name",
25
+ example: "API"
26
+ }),
27
+ version: t.String({
28
+ description: "Version",
29
+ example: "1.0.0"
30
+ }),
31
+ description: t.String({
32
+ description: "Description",
33
+ example: "Is a microservice that provides a RESTful API for the application."
34
+ })
35
+ })
36
+ });
37
+
38
+ // source/modules/elysia/microservice/schemas/ping.ts
39
+ import { t as t2 } from "elysia";
40
+ var pingResponse200Schema = t2.Object({
41
+ message: t2.String({
42
+ description: "Message",
43
+ example: "pong"
44
+ })
45
+ });
46
+
47
+ // source/modules/elysia/microservice/microservice.ts
48
+ var findPackageJson = (path) => {
49
+ const isWin = platform() === "win32";
50
+ const separator = isWin ? "\\" : "/";
51
+ if (isWin && /^[A-Z]:\\$/i.test(path) || !isWin && path === "/")
52
+ return "";
53
+ const packageJsonPath = path + separator + "package.json";
54
+ if (existsSync(packageJsonPath))
55
+ return packageJsonPath;
56
+ const pathParts = path.split(separator);
57
+ if (pathParts.length <= 1)
58
+ return "";
59
+ const newPath = pathParts.slice(0, -1).join(separator);
60
+ if (newPath === "")
61
+ return "";
62
+ return findPackageJson(newPath);
63
+ };
64
+ var packageJson = await import(findPackageJson(Bun.main));
65
+ var microservice = new Elysia({
66
+ name: "microservicePlugin",
67
+ prefix: "/microservice",
68
+ detail: {
69
+ tags: ["Microservice"],
70
+ security: []
71
+ }
72
+ }).model({
73
+ infoResponse200: infoResponse200Schema,
74
+ pingResponse200: pingResponse200Schema
75
+ }).get("/ping", () => ({
76
+ message: MICROSERVICE_SUCCESS_KEYS.PING_RESPONSE
77
+ }), {
78
+ detail: {
79
+ summary: "Ping",
80
+ description: "Ping the microservice to check if it is alive"
81
+ },
82
+ response: "pingResponse200"
83
+ }).get("/info", () => ({
84
+ message: MICROSERVICE_SUCCESS_KEYS.INFO_RETRIEVED,
85
+ content: {
86
+ name: packageJson.default.name,
87
+ version: packageJson.default.version,
88
+ description: packageJson.default.description,
89
+ author: packageJson.default.author
90
+ }
91
+ }), {
92
+ detail: {
93
+ summary: "Info",
94
+ description: "Get information about the microservice"
95
+ },
96
+ response: "infoResponse200"
97
+ }).as("scoped");
98
+ export {
99
+ microservice
100
+ };
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import {
3
+ RATE_LIMIT_ERROR_KEYS
4
+ } from "../../../../chunk-dre2fgj0.js";
5
+ export {
6
+ RATE_LIMIT_ERROR_KEYS
7
+ };