@venizia/ignis-helpers 0.0.1-2 → 0.0.1-4

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 (150) hide show
  1. package/LICENSE.md +102 -0
  2. package/README.md +43 -0
  3. package/dist/common/constants/app.d.ts +1 -1
  4. package/dist/common/constants/app.js +8 -8
  5. package/dist/common/constants/http.d.ts +1 -1
  6. package/dist/common/constants/http.js +13 -13
  7. package/dist/common/constants/index.d.ts +3 -3
  8. package/dist/common/constants/mime.d.ts +1 -1
  9. package/dist/common/constants/mime.js +4 -4
  10. package/dist/common/index.d.ts +2 -2
  11. package/dist/common/types.d.ts +13 -13
  12. package/dist/common/types.js +2 -2
  13. package/dist/helpers/base.d.ts +1 -1
  14. package/dist/helpers/base.js +3 -3
  15. package/dist/helpers/cron/cron.helper.d.ts +2 -2
  16. package/dist/helpers/cron/cron.helper.js +2 -2
  17. package/dist/helpers/cron/index.d.ts +1 -1
  18. package/dist/helpers/crypto/algorithms/aes.algorithm.d.ts +3 -3
  19. package/dist/helpers/crypto/algorithms/aes.algorithm.js +10 -10
  20. package/dist/helpers/crypto/algorithms/base.algorithm.d.ts +2 -2
  21. package/dist/helpers/crypto/algorithms/base.algorithm.js +1 -1
  22. package/dist/helpers/crypto/algorithms/index.d.ts +3 -3
  23. package/dist/helpers/crypto/algorithms/rsa.algorithm.d.ts +3 -3
  24. package/dist/helpers/crypto/algorithms/rsa.algorithm.js +10 -10
  25. package/dist/helpers/crypto/common/index.d.ts +2 -2
  26. package/dist/helpers/crypto/index.d.ts +2 -2
  27. package/dist/helpers/env/app-env.d.ts +1 -1
  28. package/dist/helpers/env/app-env.js +9 -9
  29. package/dist/helpers/env/index.d.ts +2 -2
  30. package/dist/helpers/error/app-error.d.ts +1 -1
  31. package/dist/helpers/error/index.d.ts +2 -2
  32. package/dist/helpers/error/types.d.ts +1 -1
  33. package/dist/helpers/error/types.js +5 -5
  34. package/dist/helpers/index.d.ts +14 -14
  35. package/dist/helpers/inversion/common/index.d.ts +2 -2
  36. package/dist/helpers/inversion/common/keys.js +6 -6
  37. package/dist/helpers/inversion/common/types.d.ts +4 -4
  38. package/dist/helpers/inversion/container.d.ts +2 -2
  39. package/dist/helpers/inversion/index.d.ts +4 -4
  40. package/dist/helpers/inversion/registry.d.ts +2 -2
  41. package/dist/helpers/logger/application-logger.d.ts +2 -2
  42. package/dist/helpers/logger/application-logger.js +8 -8
  43. package/dist/helpers/logger/default-logger.d.ts +3 -3
  44. package/dist/helpers/logger/default-logger.js +23 -23
  45. package/dist/helpers/logger/factory.d.ts +1 -1
  46. package/dist/helpers/logger/factory.js +1 -1
  47. package/dist/helpers/logger/index.d.ts +5 -5
  48. package/dist/helpers/logger/transports/dgram.transport.d.ts +2 -2
  49. package/dist/helpers/logger/transports/dgram.transport.js +5 -5
  50. package/dist/helpers/logger/transports/index.d.ts +1 -1
  51. package/dist/helpers/logger/types.d.ts +1 -1
  52. package/dist/helpers/logger/types.js +9 -9
  53. package/dist/helpers/network/http-request/base-network-request.helper.d.ts +12 -12
  54. package/dist/helpers/network/http-request/base-network-request.helper.js +10 -10
  55. package/dist/helpers/network/http-request/fetcher/axios-fetcher.d.ts +5 -5
  56. package/dist/helpers/network/http-request/fetcher/axios-fetcher.js +5 -5
  57. package/dist/helpers/network/http-request/fetcher/base-fetcher.d.ts +1 -1
  58. package/dist/helpers/network/http-request/fetcher/base-fetcher.js +8 -8
  59. package/dist/helpers/network/http-request/fetcher/index.d.ts +3 -3
  60. package/dist/helpers/network/http-request/fetcher/node-fetcher.d.ts +2 -2
  61. package/dist/helpers/network/http-request/fetcher/node-fetcher.js +6 -6
  62. package/dist/helpers/network/http-request/index.d.ts +2 -2
  63. package/dist/helpers/network/http-request/types.d.ts +4 -4
  64. package/dist/helpers/network/index.d.ts +3 -3
  65. package/dist/helpers/network/tcp-socket/base-tcp-client.helper.d.ts +4 -4
  66. package/dist/helpers/network/tcp-socket/base-tcp-client.helper.js +17 -17
  67. package/dist/helpers/network/tcp-socket/base-tcp-server.helper.d.ts +6 -6
  68. package/dist/helpers/network/tcp-socket/base-tcp-server.helper.js +18 -18
  69. package/dist/helpers/network/tcp-socket/index.d.ts +6 -6
  70. package/dist/helpers/network/tcp-socket/network-tcp-client.helper.d.ts +4 -4
  71. package/dist/helpers/network/tcp-socket/network-tcp-server.helper.d.ts +4 -4
  72. package/dist/helpers/network/tcp-socket/network-tls-tcp-client.helper.d.ts +4 -4
  73. package/dist/helpers/network/tcp-socket/network-tls-tcp-server.helper.d.ts +4 -4
  74. package/dist/helpers/network/udp-socket/index.d.ts +1 -1
  75. package/dist/helpers/network/udp-socket/network-udp-client.helper.d.ts +3 -3
  76. package/dist/helpers/network/udp-socket/network-udp-client.helper.js +14 -14
  77. package/dist/helpers/queue/bullmq/helper.d.ts +4 -4
  78. package/dist/helpers/queue/bullmq/helper.js +10 -10
  79. package/dist/helpers/queue/bullmq/index.d.ts +1 -1
  80. package/dist/helpers/queue/common/index.d.ts +1 -1
  81. package/dist/helpers/queue/common/types.d.ts +1 -1
  82. package/dist/helpers/queue/index.d.ts +4 -4
  83. package/dist/helpers/queue/internal/helper.d.ts +3 -3
  84. package/dist/helpers/queue/internal/helper.js +11 -11
  85. package/dist/helpers/queue/internal/index.d.ts +1 -1
  86. package/dist/helpers/queue/mqtt/helper.d.ts +2 -2
  87. package/dist/helpers/queue/mqtt/helper.js +8 -8
  88. package/dist/helpers/queue/mqtt/index.d.ts +1 -1
  89. package/dist/helpers/redis/cluster.helper.d.ts +3 -3
  90. package/dist/helpers/redis/default.helper.d.ts +3 -3
  91. package/dist/helpers/redis/default.helper.js +40 -40
  92. package/dist/helpers/redis/index.d.ts +4 -4
  93. package/dist/helpers/redis/single.helper.d.ts +3 -3
  94. package/dist/helpers/redis/types.d.ts +3 -3
  95. package/dist/helpers/socket-io/client/helper.d.ts +3 -3
  96. package/dist/helpers/socket-io/client/helper.js +8 -8
  97. package/dist/helpers/socket-io/client/index.d.ts +1 -1
  98. package/dist/helpers/socket-io/common/constants.js +10 -10
  99. package/dist/helpers/socket-io/common/index.d.ts +2 -2
  100. package/dist/helpers/socket-io/common/types.d.ts +6 -6
  101. package/dist/helpers/socket-io/index.d.ts +3 -3
  102. package/dist/helpers/socket-io/server/helper.d.ts +3 -3
  103. package/dist/helpers/socket-io/server/helper.js +41 -41
  104. package/dist/helpers/socket-io/server/index.d.ts +1 -1
  105. package/dist/helpers/storage/in-memory/helper.d.ts +2 -2
  106. package/dist/helpers/storage/in-memory/index.d.ts +1 -1
  107. package/dist/helpers/storage/index.d.ts +2 -2
  108. package/dist/helpers/storage/minio/helper.d.ts +3 -3
  109. package/dist/helpers/storage/minio/helper.js +7 -7
  110. package/dist/helpers/storage/minio/index.d.ts +1 -1
  111. package/dist/helpers/testing/base-test-plan.d.ts +2 -2
  112. package/dist/helpers/testing/base-test-plan.js +4 -4
  113. package/dist/helpers/testing/common/constants.d.ts +1 -1
  114. package/dist/helpers/testing/common/constants.js +3 -3
  115. package/dist/helpers/testing/common/index.d.ts +2 -2
  116. package/dist/helpers/testing/common/types.d.ts +3 -3
  117. package/dist/helpers/testing/describe.d.ts +2 -2
  118. package/dist/helpers/testing/describe.js +5 -5
  119. package/dist/helpers/testing/index.d.ts +6 -6
  120. package/dist/helpers/testing/test-case.d.ts +3 -3
  121. package/dist/helpers/testing/test-case.js +1 -1
  122. package/dist/helpers/testing/test-handler.d.ts +3 -3
  123. package/dist/helpers/testing/test-handler.js +2 -2
  124. package/dist/helpers/testing/test-plan.d.ts +2 -2
  125. package/dist/helpers/worker-thread/base.d.ts +6 -6
  126. package/dist/helpers/worker-thread/base.js +15 -15
  127. package/dist/helpers/worker-thread/base.js.map +1 -1
  128. package/dist/helpers/worker-thread/index.d.ts +4 -4
  129. package/dist/helpers/worker-thread/types.d.ts +2 -2
  130. package/dist/helpers/worker-thread/worker-bus.d.ts +4 -4
  131. package/dist/helpers/worker-thread/worker-bus.d.ts.map +1 -1
  132. package/dist/helpers/worker-thread/worker-bus.js +14 -9
  133. package/dist/helpers/worker-thread/worker-bus.js.map +1 -1
  134. package/dist/helpers/worker-thread/worker-pool.d.ts +2 -2
  135. package/dist/helpers/worker-thread/worker-pool.js +6 -6
  136. package/dist/index.d.ts +4 -4
  137. package/dist/utilities/crypto.utility.d.ts +1 -1
  138. package/dist/utilities/crypto.utility.js +2 -2
  139. package/dist/utilities/date.utility.d.ts +1 -1
  140. package/dist/utilities/date.utility.js +6 -6
  141. package/dist/utilities/index.d.ts +7 -7
  142. package/dist/utilities/module.utility.js +2 -2
  143. package/dist/utilities/parse.utility.js +18 -18
  144. package/dist/utilities/performance.utility.d.ts +1 -1
  145. package/dist/utilities/performance.utility.js +5 -5
  146. package/dist/utilities/promise.utility.d.ts +1 -1
  147. package/dist/utilities/promise.utility.js +3 -3
  148. package/dist/utilities/request.utility.d.ts +1 -1
  149. package/dist/utilities/request.utility.js +7 -7
  150. package/package.json +23 -29
@@ -8,14 +8,14 @@ const error_1 = require("../helpers/error");
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
10
  const parseMultipartBody = async (opts) => {
11
- const { storage = "memory", uploadDir = "./uploads", context } = opts;
12
- if (storage === "disk" && !node_fs_1.default.existsSync(uploadDir)) {
11
+ const { storage = 'memory', uploadDir = './uploads', context } = opts;
12
+ if (storage === 'disk' && !node_fs_1.default.existsSync(uploadDir)) {
13
13
  node_fs_1.default.mkdirSync(uploadDir, { recursive: true });
14
14
  }
15
15
  const formData = await context.req.formData();
16
16
  const files = [];
17
17
  for (const [fieldname, value] of formData.entries()) {
18
- if (typeof value === "string") {
18
+ if (typeof value === 'string') {
19
19
  continue;
20
20
  }
21
21
  const file = value;
@@ -24,21 +24,21 @@ const parseMultipartBody = async (opts) => {
24
24
  const parsedFile = {
25
25
  fieldname,
26
26
  originalname: file.name,
27
- encoding: "utf8", // Default encoding
27
+ encoding: 'utf8', // Default encoding
28
28
  mimetype: file.type,
29
29
  size: file.size,
30
30
  };
31
31
  switch (storage) {
32
- case "memory": {
32
+ case 'memory': {
33
33
  parsedFile.buffer = buffer;
34
34
  break;
35
35
  }
36
- case "disk": {
36
+ case 'disk': {
37
37
  // Store on disk (like multer.diskStorage())
38
38
  const timestamp = Date.now();
39
39
  const randomString = Math.random().toString(36).substring(7);
40
40
  // Sanitize filename to prevent path traversal
41
- const sanitizedName = node_path_1.default.basename(file.name).replace(/[^a-zA-Z0-9._-]/g, "_");
41
+ const sanitizedName = node_path_1.default.basename(file.name).replace(/[^a-zA-Z0-9._-]/g, '_');
42
42
  const filename = `${timestamp}-${randomString}-${sanitizedName}`;
43
43
  const filepath = node_path_1.default.join(uploadDir, filename);
44
44
  node_fs_1.default.writeFileSync(filepath, buffer);
package/package.json CHANGED
@@ -1,29 +1,27 @@
1
1
  {
2
2
  "name": "@venizia/ignis-helpers",
3
- "version": "0.0.1-2",
4
- "description": "JS/TS Helpers",
3
+ "version": "0.0.1-4",
4
+ "description": "Utility helpers for the Ignis Framework - logging, cron, Redis, queues, storage, and more",
5
5
  "keywords": [
6
- "web",
7
- "restful",
8
- "rest",
9
- "api",
10
- "hono",
11
- "auth",
12
- "security",
13
- "backend",
14
- "infrastructure",
6
+ "helpers",
7
+ "utilities",
8
+ "logging",
9
+ "winston",
10
+ "cron",
11
+ "redis",
12
+ "ioredis",
13
+ "queue",
14
+ "bullmq",
15
+ "storage",
16
+ "minio",
17
+ "s3",
18
+ "mqtt",
19
+ "socket.io",
15
20
  "venizia",
16
- "vez",
17
- "infra",
21
+ "ignis",
18
22
  "bun",
19
23
  "nodejs",
20
- "decorator",
21
- "class-based",
22
- "framework",
23
- "dependency injection",
24
- "backend framework",
25
- "nodejs framework",
26
- "web framework"
24
+ "typescript"
27
25
  ],
28
26
  "exports": {
29
27
  ".": {
@@ -34,7 +32,7 @@
34
32
  },
35
33
  "files": [
36
34
  "README.md",
37
- "LICENSE",
35
+ "LICENSE.md",
38
36
  "dist",
39
37
  "!/**/tests",
40
38
  "!/**/dist/tests",
@@ -55,17 +53,12 @@
55
53
  "prettier:cli": "prettier \"**/*.{js,ts}\" -l",
56
54
  "prettier:fix": "bun run prettier:cli --write",
57
55
  "rebuild": "sh ./scripts/rebuild.sh no-version",
58
- "rebuild:major": "sh ./scripts/rebuild.sh major",
59
- "rebuild:minor": "sh ./scripts/rebuild.sh minor",
60
- "rebuild:patch": "sh ./scripts/rebuild.sh patch",
61
- "rebuild:premajor": "sh ./scripts/rebuild.sh premajor",
62
- "rebuild:preminor": "sh ./scripts/rebuild.sh preminor",
63
- "rebuild:prepatch": "sh ./scripts/rebuild.sh prepatch",
64
- "rebuild:prerelease": "sh ./scripts/rebuild.sh prerelease"
56
+ "prepublishOnly": "bun run rebuild"
65
57
  },
66
58
  "repository": {
67
59
  "type": "git",
68
- "url": "git+https://github.com/VENIZIA-AI/ignis.git"
60
+ "url": "git+https://github.com/VENIZIA-AI/ignis.git",
61
+ "directory": "packages/helpers"
69
62
  },
70
63
  "author": {
71
64
  "name": "VENIZIA AI Developer",
@@ -115,6 +108,7 @@
115
108
  "@hono/zod-openapi": "^1.1.5",
116
109
  "@types/bun": "^1.3.4",
117
110
  "@types/lodash": "^4.17.20",
111
+ "@types/node": "^25.0.0",
118
112
  "@venizia/dev-configs": "latest",
119
113
  "eslint": "^9.36.0",
120
114
  "prettier": "^3.6.2",