@mrxsys/mrx-core 2.11.0-2-and-276-20251029 → 2.11.0-2-and-277-20251030

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 +51 -0
  99. package/dist/modules/elysia/error/index.js +76 -0
  100. package/dist/modules/elysia/microservice/enums/index.js +7 -0
  101. package/dist/modules/elysia/microservice/index.js +100 -0
  102. package/dist/modules/elysia/rate-limit/enums/index.js +7 -0
  103. package/dist/modules/elysia/rate-limit/index.js +81 -0
  104. package/dist/modules/elysia/rate-limit/rate-limit.d.ts +1 -1
  105. package/dist/modules/elysia/rate-limit/types/index.js +1 -0
  106. package/dist/modules/jwt/enums/index.js +11 -0
  107. package/dist/modules/jwt/index.js +51 -0
  108. package/dist/modules/jwt/utils/index.js +9 -0
  109. package/dist/modules/kv-store/bun-redis/bun-redis-store.d.ts +1 -1
  110. package/dist/modules/kv-store/bun-redis/index.js +84 -0
  111. package/dist/modules/kv-store/enums/index.js +7 -0
  112. package/dist/modules/kv-store/ioredis/index.js +86 -0
  113. package/dist/modules/kv-store/ioredis/ioredis-store.d.ts +1 -1
  114. package/dist/modules/kv-store/memory/index.js +9 -0
  115. package/dist/modules/kv-store/memory/memory-store.d.ts +1 -1
  116. package/dist/modules/kv-store/types/index.js +1 -0
  117. package/dist/modules/logger/enums/index.js +7 -0
  118. package/dist/modules/logger/events/index.js +1 -0
  119. package/dist/modules/logger/events/logger-events.d.ts +1 -1
  120. package/dist/modules/logger/index.js +282 -0
  121. package/dist/modules/logger/logger.d.ts +1 -1
  122. package/dist/modules/logger/sinks/console-logger.d.ts +2 -2
  123. package/dist/modules/logger/sinks/devnull-logger.d.ts +1 -1
  124. package/dist/modules/logger/sinks/file-logger/file-logger.d.ts +2 -2
  125. package/dist/modules/logger/sinks/index.js +66 -0
  126. package/dist/modules/logger/types/index.js +1 -0
  127. package/dist/modules/logger/worker-logger.d.ts +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
@@ -0,0 +1,76 @@
1
+ // @bun
2
+ import {
3
+ createCounterBuffer,
4
+ dynamicTruncation,
5
+ generateHmac
6
+ } from "../../../chunk-m3grz32t.js";
7
+ import {
8
+ TOTP_ERROR_KEYS
9
+ } from "../../../chunk-9r5anep5.js";
10
+ import {
11
+ BaseError
12
+ } from "../../../chunk-9cgzhc50.js";
13
+
14
+ // source/modules/totp/utils/base32.ts
15
+ var BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
16
+ var base32Encode = (input, withPadding = true) => {
17
+ let result = "";
18
+ let bits = 0;
19
+ let value = 0;
20
+ const bytes = input instanceof Uint8Array ? input : new TextEncoder().encode(input);
21
+ for (const byte of bytes) {
22
+ value = value << 8 | byte;
23
+ bits += 8;
24
+ while (bits >= 5) {
25
+ result += BASE32_ALPHABET[value >>> bits - 5 & 31];
26
+ bits -= 5;
27
+ }
28
+ }
29
+ if (bits > 0)
30
+ result += BASE32_ALPHABET[value << 5 - bits & 31];
31
+ if (withPadding)
32
+ while (result.length % 8 !== 0)
33
+ result += "=";
34
+ return result;
35
+ };
36
+ var base32Decode = (base32) => {
37
+ const cleanBase32 = base32.replace(/=+$/, "");
38
+ if (cleanBase32.length === 0)
39
+ return new Uint8Array(0);
40
+ const result = [];
41
+ let bits = 0;
42
+ let value = 0;
43
+ for (const char of cleanBase32) {
44
+ const charValue = BASE32_ALPHABET.indexOf(char);
45
+ if (charValue === -1)
46
+ throw new BaseError(TOTP_ERROR_KEYS.INVALID_BASE32_CHARACTER, `Invalid Base32 character: ${char}`);
47
+ value = value << 5 | charValue;
48
+ bits += 5;
49
+ if (bits >= 8) {
50
+ result.push(value >>> bits - 8 & 255);
51
+ bits -= 8;
52
+ }
53
+ }
54
+ return new Uint8Array(result);
55
+ };
56
+ // source/modules/totp/utils/generate-secret-bytes.ts
57
+ import { getRandomValues } from "crypto";
58
+ var generateSecretBytes = (length = 20) => {
59
+ if (length <= 0)
60
+ throw new BaseError(TOTP_ERROR_KEYS.INVALID_SECRET_LENGTH);
61
+ return getRandomValues(new Uint8Array(length));
62
+ };
63
+ // source/modules/totp/utils/time-remaining.ts
64
+ var timeRemaining = (period = 30, now = Date.now()) => {
65
+ const elapsed = Math.floor(now / 1000) % period;
66
+ return period - elapsed;
67
+ };
68
+ export {
69
+ timeRemaining,
70
+ generateSecretBytes,
71
+ generateHmac,
72
+ dynamicTruncation,
73
+ createCounterBuffer,
74
+ base32Encode,
75
+ base32Decode
76
+ };
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import {
3
+ TypedEventEmitter
4
+ } from "../../chunk-mvrxngm7.js";
5
+ export {
6
+ TypedEventEmitter
7
+ };
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import {
3
+ UTILS_ERROR_KEYS
4
+ } from "../../chunk-n0n14mf8.js";
5
+ export {
6
+ UTILS_ERROR_KEYS
7
+ };
@@ -0,0 +1 @@
1
+ // @bun
@@ -1,3 +1,3 @@
1
1
  import type { TSchema } from '@sinclair/typebox/type';
2
- import type { TFlatten } from '#/shared/types/tflatten';
2
+ import type { TFlatten } from '../../shared/types/tflatten';
3
3
  export declare const flatten: <Type extends TSchema>(type: Type) => TFlatten<Type>;
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ import {
3
+ UTILS_ERROR_KEYS
4
+ } from "../../chunk-n0n14mf8.js";
5
+ import {
6
+ flatten
7
+ } from "../../chunk-9dzsj7f2.js";
8
+ import {
9
+ isDateString,
10
+ makeStreamAsyncIterable
11
+ } from "../../chunk-grfyngq0.js";
12
+ import {
13
+ BaseError
14
+ } from "../../chunk-9cgzhc50.js";
15
+
16
+ // source/shared/utils/env.ts
17
+ import { Value } from "@sinclair/typebox/value";
18
+ var validateEnv = (schema, env = process.env) => {
19
+ try {
20
+ Value.Assert(schema, Value.Parse(schema, env));
21
+ } catch (error) {
22
+ throw new BaseError(UTILS_ERROR_KEYS.INVALID_ENVIRONMENT, error);
23
+ }
24
+ };
25
+ export {
26
+ validateEnv,
27
+ makeStreamAsyncIterable,
28
+ isDateString,
29
+ flatten
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrxsys/mrx-core",
3
- "version": "2.11.0-2-and-276-20251029",
3
+ "version": "2.11.0-2-and-277-20251030",
4
4
  "author": "Ruby",
5
5
  "devDependencies": {
6
6
  "@eslint/js": "^9.38.0",