tiny-essentials 1.2.1 → 1.3.1

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 (145) hide show
  1. package/README.md +3 -3
  2. package/dist/TinyEssentials.js +2375 -77105
  3. package/dist/TinyEssentials.min.js +1 -1
  4. package/dist/TinyEssentials.min.js.LICENSE.txt +0 -2
  5. package/dist/TinyLevelUp.js +16 -8
  6. package/dist/legacy/firebase/cookieSession.cjs +1 -1
  7. package/dist/legacy/firebase/cookieSession.d.mts +2 -2
  8. package/dist/legacy/firebase/cookieSession.mjs +1 -1
  9. package/dist/legacy/firebase/databaseLogger.cjs +5 -5
  10. package/dist/legacy/firebase/databaseLogger.d.mts +2 -2
  11. package/dist/legacy/firebase/databaseLogger.mjs +5 -5
  12. package/dist/legacy/firebase/discord/api/addGuildMember.cjs +2 -2
  13. package/dist/legacy/firebase/discord/api/addGuildMember.d.mts +3 -3
  14. package/dist/legacy/firebase/discord/api/addGuildMember.mjs +2 -2
  15. package/dist/legacy/firebase/discord/api/getGuildWidget.cjs +2 -2
  16. package/dist/legacy/firebase/discord/api/getGuildWidget.d.mts +3 -3
  17. package/dist/legacy/firebase/discord/api/getGuildWidget.mjs +2 -2
  18. package/dist/legacy/firebase/discord/api/getToken.cjs +2 -2
  19. package/dist/legacy/firebase/discord/api/getToken.d.mts +3 -3
  20. package/dist/legacy/firebase/discord/api/getToken.mjs +2 -2
  21. package/dist/legacy/firebase/discord/api/getUser.cjs +2 -2
  22. package/dist/legacy/firebase/discord/api/getUser.d.mts +3 -3
  23. package/dist/legacy/firebase/discord/api/getUser.mjs +2 -2
  24. package/dist/legacy/firebase/discord/api/getUserConnections.cjs +2 -2
  25. package/dist/legacy/firebase/discord/api/getUserConnections.d.mts +3 -3
  26. package/dist/legacy/firebase/discord/api/getUserConnections.mjs +2 -2
  27. package/dist/legacy/firebase/discord/api/getUserGuilds.cjs +2 -2
  28. package/dist/legacy/firebase/discord/api/getUserGuilds.d.mts +3 -3
  29. package/dist/legacy/firebase/discord/api/getUserGuilds.mjs +2 -2
  30. package/dist/legacy/firebase/discord/api/refreshToken.cjs +2 -2
  31. package/dist/legacy/firebase/discord/api/refreshToken.d.mts +3 -3
  32. package/dist/legacy/firebase/discord/api/refreshToken.mjs +2 -2
  33. package/dist/legacy/firebase/discord/api/revokeToken.cjs +2 -2
  34. package/dist/legacy/firebase/discord/api/revokeToken.d.mts +3 -3
  35. package/dist/legacy/firebase/discord/api/revokeToken.mjs +2 -2
  36. package/dist/legacy/firebase/discord/get/authURLGenerator.cjs +3 -3
  37. package/dist/legacy/firebase/discord/get/authURLGenerator.d.mts +4 -4
  38. package/dist/legacy/firebase/discord/get/authURLGenerator.mjs +3 -3
  39. package/dist/legacy/firebase/discord/get/cookie-session.cjs +1 -1
  40. package/dist/legacy/firebase/discord/get/cookie-session.d.mts +2 -2
  41. package/dist/legacy/firebase/discord/get/cookie-session.mjs +1 -1
  42. package/dist/legacy/firebase/discord/get/errorValidator.cjs +1 -1
  43. package/dist/legacy/firebase/discord/get/errorValidator.d.mts +2 -2
  44. package/dist/legacy/firebase/discord/get/errorValidator.mjs +1 -1
  45. package/dist/legacy/firebase/discord/http/login.cjs +3 -3
  46. package/dist/legacy/firebase/discord/http/login.d.mts +4 -4
  47. package/dist/legacy/firebase/discord/http/login.mjs +3 -3
  48. package/dist/legacy/firebase/discord/http/logout.cjs +4 -4
  49. package/dist/legacy/firebase/discord/http/logout.d.mts +5 -5
  50. package/dist/legacy/firebase/discord/http/logout.mjs +4 -4
  51. package/dist/legacy/firebase/discord/http/redirect.cjs +4 -4
  52. package/dist/legacy/firebase/discord/http/redirect.d.mts +5 -5
  53. package/dist/legacy/firebase/discord/http/redirect.mjs +4 -4
  54. package/dist/legacy/firebase/discord/http/refreshToken.cjs +4 -4
  55. package/dist/legacy/firebase/discord/http/refreshToken.d.mts +5 -5
  56. package/dist/legacy/firebase/discord/http/refreshToken.mjs +4 -4
  57. package/dist/legacy/firebase/discord/template/cookie-session.cjs +2 -2
  58. package/dist/legacy/firebase/discord/template/cookie-session.d.mts +5 -5
  59. package/dist/legacy/firebase/discord/template/cookie-session.mjs +2 -2
  60. package/dist/legacy/firebase/escape.cjs +1 -1
  61. package/dist/legacy/firebase/escape.d.mts +2 -2
  62. package/dist/legacy/firebase/escape.mjs +1 -1
  63. package/dist/legacy/firebase/index.cjs +6 -6
  64. package/dist/legacy/firebase/index.d.mts +7 -7
  65. package/dist/legacy/firebase/index.mjs +6 -6
  66. package/dist/legacy/firebase/logger.cjs +5 -5
  67. package/dist/legacy/firebase/logger.d.mts +4 -4
  68. package/dist/legacy/firebase/logger.mjs +5 -5
  69. package/dist/legacy/firebase/mySQL.cjs +2 -2
  70. package/dist/legacy/firebase/mySQL.d.mts +3 -3
  71. package/dist/legacy/firebase/mySQL.mjs +2 -2
  72. package/dist/legacy/firebase/mysqlConnector/create.cjs +4 -4
  73. package/dist/legacy/firebase/mysqlConnector/create.d.mts +5 -5
  74. package/dist/legacy/firebase/mysqlConnector/create.mjs +4 -4
  75. package/dist/legacy/firebase/mysqlConnector/nextPrev.cjs +2 -2
  76. package/dist/legacy/firebase/mysqlConnector/nextPrev.d.mts +4 -4
  77. package/dist/legacy/firebase/mysqlConnector/nextPrev.mjs +2 -2
  78. package/dist/legacy/firebase/mysqlConnector/pagination.cjs +4 -4
  79. package/dist/legacy/firebase/mysqlConnector/pagination.d.mts +6 -6
  80. package/dist/legacy/firebase/mysqlConnector/pagination.mjs +4 -4
  81. package/dist/legacy/firebase/transactionDBAsync.cjs +1 -1
  82. package/dist/legacy/firebase/transactionDBAsync.d.mts +2 -2
  83. package/dist/legacy/firebase/transactionDBAsync.mjs +1 -1
  84. package/dist/legacy/get/pagination.cjs +1 -1
  85. package/dist/legacy/get/pagination.d.mts +2 -2
  86. package/dist/legacy/get/pagination.mjs +1 -1
  87. package/dist/legacy/get/versionCheck.cjs +1 -1
  88. package/dist/legacy/get/versionCheck.d.mts +2 -2
  89. package/dist/legacy/get/versionCheck.mjs +1 -1
  90. package/dist/legacy/http/check_domain.cjs +2 -2
  91. package/dist/legacy/http/check_domain.d.mts +2 -2
  92. package/dist/legacy/http/check_domain.mjs +2 -2
  93. package/dist/legacy/http/csrfTokenAnalyze.cjs +2 -2
  94. package/dist/legacy/http/csrfTokenAnalyze.d.mts +3 -3
  95. package/dist/legacy/http/csrfTokenAnalyze.mjs +2 -2
  96. package/dist/legacy/http/domainValidator.cjs +3 -3
  97. package/dist/legacy/http/domainValidator.d.mts +4 -4
  98. package/dist/legacy/http/domainValidator.mjs +3 -3
  99. package/dist/legacy/http/userIP.cjs +1 -1
  100. package/dist/legacy/http/userIP.d.mts +2 -4
  101. package/dist/legacy/http/userIP.mjs +1 -1
  102. package/dist/legacy/index.d.mts +4 -4
  103. package/dist/legacy/libs/custom_module_loader.cjs +2 -2
  104. package/dist/legacy/libs/custom_module_loader.d.mts +2 -2
  105. package/dist/legacy/libs/custom_module_loader.mjs +2 -2
  106. package/dist/legacy/libs/userLevel.cjs +16 -8
  107. package/dist/legacy/libs/userLevel.d.mts +34 -12
  108. package/dist/legacy/libs/userLevel.mjs +14 -8
  109. package/dist/legacy/socket.io/antiFlood/install.cjs +3 -3
  110. package/dist/legacy/socket.io/antiFlood/install.d.mts +4 -6
  111. package/dist/legacy/socket.io/antiFlood/install.mjs +3 -3
  112. package/dist/legacy/socket.io/antiFlood/verify.cjs +4 -4
  113. package/dist/legacy/socket.io/antiFlood/verify.d.mts +5 -7
  114. package/dist/legacy/socket.io/antiFlood/verify.mjs +4 -4
  115. package/dist/legacy/socket.io/cookie-session.cjs +2 -2
  116. package/dist/legacy/socket.io/cookie-session.d.mts +3 -3
  117. package/dist/legacy/socket.io/cookie-session.mjs +2 -2
  118. package/dist/legacy/socket.io/discord.cjs +3 -3
  119. package/dist/legacy/socket.io/discord.d.mts +4 -4
  120. package/dist/legacy/socket.io/discord.mjs +3 -3
  121. package/dist/v1/index.cjs +0 -4
  122. package/dist/v1/index.d.mts +1 -3
  123. package/dist/v1/index.mjs +1 -3
  124. package/docs/README.md +1 -11
  125. package/package.json +2 -5
  126. package/dist/TinyCertCrypto.js +0 -31364
  127. package/dist/TinyCertCrypto.min.js +0 -2
  128. package/dist/TinyCertCrypto.min.js.LICENSE.txt +0 -8
  129. package/dist/TinyCrypto.js +0 -48138
  130. package/dist/TinyCrypto.min.js +0 -2
  131. package/dist/TinyCrypto.min.js.LICENSE.txt +0 -10
  132. package/dist/v1/build/TinyCertCrypto.cjs +0 -7
  133. package/dist/v1/build/TinyCertCrypto.d.mts +0 -2
  134. package/dist/v1/build/TinyCertCrypto.mjs +0 -2
  135. package/dist/v1/build/TinyCrypto.cjs +0 -7
  136. package/dist/v1/build/TinyCrypto.d.mts +0 -2
  137. package/dist/v1/build/TinyCrypto.mjs +0 -2
  138. package/dist/v1/libs/TinyCertCrypto.cjs +0 -573
  139. package/dist/v1/libs/TinyCertCrypto.d.mts +0 -193
  140. package/dist/v1/libs/TinyCertCrypto.mjs +0 -481
  141. package/dist/v1/libs/TinyCrypto.cjs +0 -640
  142. package/dist/v1/libs/TinyCrypto.d.mts +0 -306
  143. package/dist/v1/libs/TinyCrypto.mjs +0 -597
  144. package/docs/libs/TinyCertCrypto.md +0 -202
  145. package/docs/libs/TinyCrypto.md +0 -177
@@ -8,7 +8,7 @@ import objType from '../get/objType.mjs';
8
8
  const custom_module_manager = {
9
9
  /**
10
10
  * Validates if the given object has valid custom or default module arrays.
11
- * @param {Object} custom_modules - The object containing module definitions.
11
+ * @param {Record<string, any>} custom_modules - The object containing module definitions.
12
12
  * @param {string} type - The specific type of module to validate.
13
13
  * @returns {boolean} Whether the module is valid.
14
14
  *
@@ -30,7 +30,7 @@ const custom_module_manager = {
30
30
  * @param {Object|Function[]} custom_modules - The modules or functions to run.
31
31
  * @param {*} db_prepare - A value to pass to each module when called.
32
32
  * @param {string} hookType - A string representing the hook (e.g., 'before', 'after').
33
- * @param {Object} [options] - Optional. Object with keys matching types in `custom_modules`.
33
+ * @param {Record<string, any>} [options] - Optional. Object with keys matching types in `custom_modules`.
34
34
  *
35
35
  * @returns {Promise<void>}
36
36
  *
@@ -14,10 +14,18 @@ class TinyLevelUp {
14
14
  this.expLevel = expLevel;
15
15
  }
16
16
 
17
+ /**
18
+ * @typedef {{ exp: number, level: number, totalExp: number }} UserResult
19
+ */
20
+
21
+ /**
22
+ * @typedef {{ exp: number, level: number, totalExp: any }} UserEditor
23
+ */
24
+
17
25
  /**
18
26
  * Validates and adjusts the user's level based on their current experience.
19
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object containing experience and level properties.
20
- * @returns {Object} The updated user object.
27
+ * @param {UserEditor} user - The user object containing experience and level properties.
28
+ * @returns {UserResult} The updated user object.
21
29
  */
22
30
  expValidator(user) {
23
31
  let extraValue = 0;
@@ -85,9 +93,9 @@ class TinyLevelUp {
85
93
 
86
94
  /**
87
95
  * Sets the experience value for the user, adjusting their level if necessary.
88
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
96
+ * @param {UserEditor} user - The user object.
89
97
  * @param {number} value - The new experience value to set.
90
- * @returns {Object} The updated user object.
98
+ * @returns {UserResult} The updated user object.
91
99
  */
92
100
  set(user, value) {
93
101
  user.exp = value;
@@ -98,11 +106,11 @@ class TinyLevelUp {
98
106
 
99
107
  /**
100
108
  * Adds experience to the user, adjusting their level if necessary.
101
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
109
+ * @param {UserEditor} user - The user object.
102
110
  * @param {number} extraExp - Additional experience to be added.
103
111
  * @param {'add' | 'extra'} type - Type of addition ('add' or 'extra').
104
112
  * @param {number} multi - Multiplier for experience generation.
105
- * @returns {Object} The updated user object.
113
+ * @returns {UserResult} The updated user object.
106
114
  */
107
115
  give(user, extraExp = 0, type = 'add', multi = 1) {
108
116
  if (type === 'add') user.exp += this.expGenerator(multi) + extraExp;
@@ -115,11 +123,11 @@ class TinyLevelUp {
115
123
 
116
124
  /**
117
125
  * Removes experience from the user, adjusting their level if necessary.
118
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
126
+ * @param {UserEditor} user - The user object.
119
127
  * @param {number} extraExp - Experience to remove.
120
128
  * @param {'add' | 'extra'} type - Type of removal ('add' or 'extra').
121
129
  * @param {number} multi - Multiplier for experience generation.
122
- * @returns {Object} The updated user object.
130
+ * @returns {UserResult} The updated user object.
123
131
  */
124
132
  remove(user, extraExp = 0, type = 'add', multi = 1) {
125
133
  if (type === 'add') user.exp -= this.expGenerator(multi) + extraExp;
@@ -11,16 +11,26 @@ declare class TinyLevelUp {
11
11
  constructor(giveExp: number, expLevel: number);
12
12
  giveExp: number;
13
13
  expLevel: number;
14
+ /**
15
+ * @typedef {{ exp: number, level: number, totalExp: number }} UserResult
16
+ */
17
+ /**
18
+ * @typedef {{ exp: number, level: number, totalExp: any }} UserEditor
19
+ */
14
20
  /**
15
21
  * Validates and adjusts the user's level based on their current experience.
16
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object containing experience and level properties.
17
- * @returns {Object} The updated user object.
22
+ * @param {UserEditor} user - The user object containing experience and level properties.
23
+ * @returns {UserResult} The updated user object.
18
24
  */
19
25
  expValidator(user: {
20
26
  exp: number;
21
27
  level: number;
22
28
  totalExp: any;
23
- }): Object;
29
+ }): {
30
+ exp: number;
31
+ level: number;
32
+ totalExp: number;
33
+ };
24
34
  /**
25
35
  * Calculates the total experience based on the user's level.
26
36
  * @param {{ exp: number, level: number }} user - The user object containing experience and level properties.
@@ -54,39 +64,51 @@ declare class TinyLevelUp {
54
64
  }): number;
55
65
  /**
56
66
  * Sets the experience value for the user, adjusting their level if necessary.
57
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
67
+ * @param {UserEditor} user - The user object.
58
68
  * @param {number} value - The new experience value to set.
59
- * @returns {Object} The updated user object.
69
+ * @returns {UserResult} The updated user object.
60
70
  */
61
71
  set(user: {
62
72
  exp: number;
63
73
  level: number;
64
74
  totalExp: any;
65
- }, value: number): Object;
75
+ }, value: number): {
76
+ exp: number;
77
+ level: number;
78
+ totalExp: number;
79
+ };
66
80
  /**
67
81
  * Adds experience to the user, adjusting their level if necessary.
68
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
82
+ * @param {UserEditor} user - The user object.
69
83
  * @param {number} extraExp - Additional experience to be added.
70
84
  * @param {'add' | 'extra'} type - Type of addition ('add' or 'extra').
71
85
  * @param {number} multi - Multiplier for experience generation.
72
- * @returns {Object} The updated user object.
86
+ * @returns {UserResult} The updated user object.
73
87
  */
74
88
  give(user: {
75
89
  exp: number;
76
90
  level: number;
77
91
  totalExp: any;
78
- }, extraExp?: number, type?: "add" | "extra", multi?: number): Object;
92
+ }, extraExp?: number, type?: "add" | "extra", multi?: number): {
93
+ exp: number;
94
+ level: number;
95
+ totalExp: number;
96
+ };
79
97
  /**
80
98
  * Removes experience from the user, adjusting their level if necessary.
81
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
99
+ * @param {UserEditor} user - The user object.
82
100
  * @param {number} extraExp - Experience to remove.
83
101
  * @param {'add' | 'extra'} type - Type of removal ('add' or 'extra').
84
102
  * @param {number} multi - Multiplier for experience generation.
85
- * @returns {Object} The updated user object.
103
+ * @returns {UserResult} The updated user object.
86
104
  */
87
105
  remove(user: {
88
106
  exp: number;
89
107
  level: number;
90
108
  totalExp: any;
91
- }, extraExp?: number, type?: "add" | "extra", multi?: number): Object;
109
+ }, extraExp?: number, type?: "add" | "extra", multi?: number): {
110
+ exp: number;
111
+ level: number;
112
+ totalExp: number;
113
+ };
92
114
  }
@@ -11,10 +11,16 @@ class TinyLevelUp {
11
11
  this.giveExp = giveExp;
12
12
  this.expLevel = expLevel;
13
13
  }
14
+ /**
15
+ * @typedef {{ exp: number, level: number, totalExp: number }} UserResult
16
+ */
17
+ /**
18
+ * @typedef {{ exp: number, level: number, totalExp: any }} UserEditor
19
+ */
14
20
  /**
15
21
  * Validates and adjusts the user's level based on their current experience.
16
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object containing experience and level properties.
17
- * @returns {Object} The updated user object.
22
+ * @param {UserEditor} user - The user object containing experience and level properties.
23
+ * @returns {UserResult} The updated user object.
18
24
  */
19
25
  expValidator(user) {
20
26
  let extraValue = 0;
@@ -75,9 +81,9 @@ class TinyLevelUp {
75
81
  }
76
82
  /**
77
83
  * Sets the experience value for the user, adjusting their level if necessary.
78
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
84
+ * @param {UserEditor} user - The user object.
79
85
  * @param {number} value - The new experience value to set.
80
- * @returns {Object} The updated user object.
86
+ * @returns {UserResult} The updated user object.
81
87
  */
82
88
  set(user, value) {
83
89
  user.exp = value;
@@ -87,11 +93,11 @@ class TinyLevelUp {
87
93
  }
88
94
  /**
89
95
  * Adds experience to the user, adjusting their level if necessary.
90
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
96
+ * @param {UserEditor} user - The user object.
91
97
  * @param {number} extraExp - Additional experience to be added.
92
98
  * @param {'add' | 'extra'} type - Type of addition ('add' or 'extra').
93
99
  * @param {number} multi - Multiplier for experience generation.
94
- * @returns {Object} The updated user object.
100
+ * @returns {UserResult} The updated user object.
95
101
  */
96
102
  give(user, extraExp = 0, type = 'add', multi = 1) {
97
103
  if (type === 'add')
@@ -104,11 +110,11 @@ class TinyLevelUp {
104
110
  }
105
111
  /**
106
112
  * Removes experience from the user, adjusting their level if necessary.
107
- * @param {{ exp: number, level: number, totalExp: any }} user - The user object.
113
+ * @param {UserEditor} user - The user object.
108
114
  * @param {number} extraExp - Experience to remove.
109
115
  * @param {'add' | 'extra'} type - Type of removal ('add' or 'extra').
110
116
  * @param {number} multi - Multiplier for experience generation.
111
- * @returns {Object} The updated user object.
117
+ * @returns {UserResult} The updated user object.
112
118
  */
113
119
  remove(user, extraExp = 0, type = 'add', multi = 1) {
114
120
  if (type === 'add')
@@ -11,9 +11,9 @@ var userIP = require('../../http/userIP.cjs');
11
11
  * This middleware checks the user's IP address and allows or denies the socket connection based on whether
12
12
  * the IP is in the block list or not.
13
13
  *
14
- * @param {Object} io - The Socket.IO server instance.
15
- * @param {Object} ioCache - The cache object containing blocked IPs.
16
- * @param {Array} ioCache.blocklick - The list of blocked IP addresses.
14
+ * @param {Record<string, any>} io - The Socket.IO server instance.
15
+ * @param {Record<string, any>} ioCache - The cache object containing blocked IPs.
16
+ * @param {Array<*>} ioCache.blocklick - The list of blocked IP addresses.
17
17
  * @returns {void} This function does not return a value, it just sets the authorization logic for socket connections.
18
18
  */
19
19
  function install(io, ioCache) {
@@ -4,11 +4,9 @@
4
4
  * This middleware checks the user's IP address and allows or denies the socket connection based on whether
5
5
  * the IP is in the block list or not.
6
6
  *
7
- * @param {Object} io - The Socket.IO server instance.
8
- * @param {Object} ioCache - The cache object containing blocked IPs.
9
- * @param {Array} ioCache.blocklick - The list of blocked IP addresses.
7
+ * @param {Record<string, any>} io - The Socket.IO server instance.
8
+ * @param {Record<string, any>} ioCache - The cache object containing blocked IPs.
9
+ * @param {Array<*>} ioCache.blocklick - The list of blocked IP addresses.
10
10
  * @returns {void} This function does not return a value, it just sets the authorization logic for socket connections.
11
11
  */
12
- export default function install(io: Object, ioCache: {
13
- blocklick: any[];
14
- }): void;
12
+ export default function install(io: Record<string, any>, ioCache: Record<string, any>): void;
@@ -6,9 +6,9 @@ import userIp from '../../http/userIP.mjs';
6
6
  * This middleware checks the user's IP address and allows or denies the socket connection based on whether
7
7
  * the IP is in the block list or not.
8
8
  *
9
- * @param {Object} io - The Socket.IO server instance.
10
- * @param {Object} ioCache - The cache object containing blocked IPs.
11
- * @param {Array} ioCache.blocklick - The list of blocked IP addresses.
9
+ * @param {Record<string, any>} io - The Socket.IO server instance.
10
+ * @param {Record<string, any>} ioCache - The cache object containing blocked IPs.
11
+ * @param {Array<*>} ioCache.blocklick - The list of blocked IP addresses.
12
12
  * @returns {void} This function does not return a value, it just sets the authorization logic for socket connections.
13
13
  */
14
14
  export default function install(io, ioCache) {
@@ -26,10 +26,10 @@ setInterval(function () {
26
26
  * This function checks how many times an IP has attempted to interact with the socket.
27
27
  * If the attempts exceed a threshold, the IP is temporarily banned and disconnected.
28
28
  *
29
- * @param {Object} socket - The socket object representing the connection.
30
- * @param {Object} ioCache - The cache object that holds the blocklist and flood panel data.
31
- * @param {Array} ioCache.blocklick - The list of blocked IPs.
32
- * @param {Object} floodPanel - The object tracking flooding attempts and timeouts for each IP.
29
+ * @param {Record<string, any>} socket - The socket object representing the connection.
30
+ * @param {Record<string, any>} ioCache - The cache object that holds the blocklist and flood panel data.
31
+ * @param {Array<*>} ioCache.blocklick - The list of blocked IPs.
32
+ * @param {Record<string, any>} floodPanel - The object tracking flooding attempts and timeouts for each IP.
33
33
  * @returns {void} This function does not return anything, it modifies the floodPanel and blocklist.
34
34
  */
35
35
  function verify(socket, ioCache) {
@@ -4,12 +4,10 @@
4
4
  * This function checks how many times an IP has attempted to interact with the socket.
5
5
  * If the attempts exceed a threshold, the IP is temporarily banned and disconnected.
6
6
  *
7
- * @param {Object} socket - The socket object representing the connection.
8
- * @param {Object} ioCache - The cache object that holds the blocklist and flood panel data.
9
- * @param {Array} ioCache.blocklick - The list of blocked IPs.
10
- * @param {Object} floodPanel - The object tracking flooding attempts and timeouts for each IP.
7
+ * @param {Record<string, any>} socket - The socket object representing the connection.
8
+ * @param {Record<string, any>} ioCache - The cache object that holds the blocklist and flood panel data.
9
+ * @param {Array<*>} ioCache.blocklick - The list of blocked IPs.
10
+ * @param {Record<string, any>} floodPanel - The object tracking flooding attempts and timeouts for each IP.
11
11
  * @returns {void} This function does not return anything, it modifies the floodPanel and blocklist.
12
12
  */
13
- export default function verify(socket: Object, ioCache: {
14
- blocklick: any[];
15
- }): void;
13
+ export default function verify(socket: Record<string, any>, ioCache: Record<string, any>): void;
@@ -20,10 +20,10 @@ setInterval(function () {
20
20
  * This function checks how many times an IP has attempted to interact with the socket.
21
21
  * If the attempts exceed a threshold, the IP is temporarily banned and disconnected.
22
22
  *
23
- * @param {Object} socket - The socket object representing the connection.
24
- * @param {Object} ioCache - The cache object that holds the blocklist and flood panel data.
25
- * @param {Array} ioCache.blocklick - The list of blocked IPs.
26
- * @param {Object} floodPanel - The object tracking flooding attempts and timeouts for each IP.
23
+ * @param {Record<string, any>} socket - The socket object representing the connection.
24
+ * @param {Record<string, any>} ioCache - The cache object that holds the blocklist and flood panel data.
25
+ * @param {Array<*>} ioCache.blocklick - The list of blocked IPs.
26
+ * @param {Record<string, any>} floodPanel - The object tracking flooding attempts and timeouts for each IP.
27
27
  * @returns {void} This function does not return anything, it modifies the floodPanel and blocklist.
28
28
  */
29
29
  export default function verify(socket, ioCache) {
@@ -6,9 +6,9 @@
6
6
  * Handles the cookie session for a socket connection by simulating an Express request and response.
7
7
  * This function uses the provided session module to manage session data for the socket connection.
8
8
  *
9
- * @param {Object} socket - The socket object representing the connection.
9
+ * @param {Record<string, any>} socket - The socket object representing the connection.
10
10
  * @param {Function} sessionModule - The session module function, typically used with Express, that handles session logic.
11
- * @returns {Promise<Object>} A promise that resolves with the session object once the session is processed.
11
+ * @returns {Promise<Record<string, any>>} A promise that resolves with the session object once the session is processed.
12
12
  */
13
13
  function cookieSession(socket, sessionModule) {
14
14
  return new Promise((resolve) => {
@@ -2,8 +2,8 @@
2
2
  * Handles the cookie session for a socket connection by simulating an Express request and response.
3
3
  * This function uses the provided session module to manage session data for the socket connection.
4
4
  *
5
- * @param {Object} socket - The socket object representing the connection.
5
+ * @param {Record<string, any>} socket - The socket object representing the connection.
6
6
  * @param {Function} sessionModule - The session module function, typically used with Express, that handles session logic.
7
- * @returns {Promise<Object>} A promise that resolves with the session object once the session is processed.
7
+ * @returns {Promise<Record<string, any>>} A promise that resolves with the session object once the session is processed.
8
8
  */
9
- export default function cookieSession(socket: Object, sessionModule: Function): Promise<Object>;
9
+ export default function cookieSession(socket: Record<string, any>, sessionModule: Function): Promise<Record<string, any>>;
@@ -3,9 +3,9 @@
3
3
  * Handles the cookie session for a socket connection by simulating an Express request and response.
4
4
  * This function uses the provided session module to manage session data for the socket connection.
5
5
  *
6
- * @param {Object} socket - The socket object representing the connection.
6
+ * @param {Record<string, any>} socket - The socket object representing the connection.
7
7
  * @param {Function} sessionModule - The session module function, typically used with Express, that handles session logic.
8
- * @returns {Promise<Object>} A promise that resolves with the session object once the session is processed.
8
+ * @returns {Promise<Record<string, any>>} A promise that resolves with the session object once the session is processed.
9
9
  */
10
10
  export default function cookieSession(socket, sessionModule) {
11
11
  return new Promise((resolve) => {
@@ -9,10 +9,10 @@ var getUser = require('../firebase/discord/api/getUser.cjs');
9
9
  * Handles the Discord OAuth2 authentication for a user, stores user data in an in-memory cache,
10
10
  * and manages the user's socket connection and disconnection events.
11
11
  *
12
- * @param {Object} socket - The socket object representing the user's connection.
13
- * @param {Object} ioCache - The shared cache that stores user data and connections.
12
+ * @param {Record<string, any>} socket - The socket object representing the user's connection.
13
+ * @param {Record<string, any>} ioCache - The shared cache that stores user data and connections.
14
14
  * @param {string} token - The OAuth2 token used to fetch user data from Discord.
15
- * @returns {Promise<Object>} A promise that resolves with the user data and updates the cache.
15
+ * @returns {Promise<Record<string, any>>} A promise that resolves with the user data and updates the cache.
16
16
  */
17
17
  function discord(socket, ioCache, token) {
18
18
  return new Promise((resolve, reject) => {
@@ -2,9 +2,9 @@
2
2
  * Handles the Discord OAuth2 authentication for a user, stores user data in an in-memory cache,
3
3
  * and manages the user's socket connection and disconnection events.
4
4
  *
5
- * @param {Object} socket - The socket object representing the user's connection.
6
- * @param {Object} ioCache - The shared cache that stores user data and connections.
5
+ * @param {Record<string, any>} socket - The socket object representing the user's connection.
6
+ * @param {Record<string, any>} ioCache - The shared cache that stores user data and connections.
7
7
  * @param {string} token - The OAuth2 token used to fetch user data from Discord.
8
- * @returns {Promise<Object>} A promise that resolves with the user data and updates the cache.
8
+ * @returns {Promise<Record<string, any>>} A promise that resolves with the user data and updates the cache.
9
9
  */
10
- export default function discord(socket: Object, ioCache: Object, token: string): Promise<Object>;
10
+ export default function discord(socket: Record<string, any>, ioCache: Record<string, any>, token: string): Promise<Record<string, any>>;
@@ -4,10 +4,10 @@ import getUser from '../firebase/discord/api/getUser.mjs';
4
4
  * Handles the Discord OAuth2 authentication for a user, stores user data in an in-memory cache,
5
5
  * and manages the user's socket connection and disconnection events.
6
6
  *
7
- * @param {Object} socket - The socket object representing the user's connection.
8
- * @param {Object} ioCache - The shared cache that stores user data and connections.
7
+ * @param {Record<string, any>} socket - The socket object representing the user's connection.
8
+ * @param {Record<string, any>} ioCache - The shared cache that stores user data and connections.
9
9
  * @param {string} token - The OAuth2 token used to fetch user data from Discord.
10
- * @returns {Promise<Object>} A promise that resolves with the user data and updates the cache.
10
+ * @returns {Promise<Record<string, any>>} A promise that resolves with the user data and updates the cache.
11
11
  */
12
12
  export default function discord(socket, ioCache, token) {
13
13
  return new Promise((resolve, reject) => {
package/dist/v1/index.cjs CHANGED
@@ -7,8 +7,6 @@ var clock = require('./basics/clock.cjs');
7
7
  var objFilter = require('./basics/objFilter.cjs');
8
8
  var simpleMath = require('./basics/simpleMath.cjs');
9
9
  var text = require('./basics/text.cjs');
10
- var TinyCrypto = require('./libs/TinyCrypto.cjs');
11
- var TinyCertCrypto = require('./libs/TinyCertCrypto.cjs');
12
10
 
13
11
 
14
12
 
@@ -29,5 +27,3 @@ exports.getSimplePerc = simpleMath.getSimplePerc;
29
27
  exports.ruleOfThree = simpleMath.ruleOfThree;
30
28
  exports.toTitleCase = text.toTitleCase;
31
29
  exports.toTitleCaseLowerFirst = text.toTitleCaseLowerFirst;
32
- exports.TinyCrypto = TinyCrypto;
33
- exports.TinyCertCrypto = TinyCertCrypto;
@@ -1,5 +1,3 @@
1
- import TinyCrypto from './libs/TinyCrypto.mjs';
2
- import TinyCertCrypto from './libs/TinyCertCrypto.mjs';
3
1
  import TinyLevelUp from '../legacy/libs/userLevel.mjs';
4
2
  import { extendObjType } from './basics/objFilter.mjs';
5
3
  import { reorderObjTypeOrder } from './basics/objFilter.mjs';
@@ -17,4 +15,4 @@ import { getTimeDuration } from './basics/clock.mjs';
17
15
  import { shuffleArray } from './basics/array.mjs';
18
16
  import { toTitleCase } from './basics/text.mjs';
19
17
  import { toTitleCaseLowerFirst } from './basics/text.mjs';
20
- export { TinyCrypto, TinyCertCrypto, TinyLevelUp, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
18
+ export { TinyLevelUp, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
package/dist/v1/index.mjs CHANGED
@@ -5,6 +5,4 @@ import { formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, } from
5
5
  import { countObj, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, objType, } from './basics/objFilter.mjs';
6
6
  import { getAge, getSimplePerc, ruleOfThree } from './basics/simpleMath.mjs';
7
7
  import { toTitleCase, toTitleCaseLowerFirst } from './basics/text.mjs';
8
- import TinyCrypto from './libs/TinyCrypto.mjs';
9
- import TinyCertCrypto from './libs/TinyCertCrypto.mjs';
10
- export { TinyCrypto, TinyCertCrypto, TinyLevelUp, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
8
+ export { TinyLevelUp, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
package/docs/README.md CHANGED
@@ -8,17 +8,7 @@ Here, you can navigate through different sections of the project. Below are the
8
8
 
9
9
  ## 📚 Main Directories
10
10
 
11
- ### 1. **`libs/`**
12
-
13
- This folder contains external libraries and utility modules that are designed to help with various tasks and features in the project.
14
-
15
- - 🔐 **[TinyCrypto.md](./libs/TinyCrypto.md)** — A flexible and browser-compatible AES-256-GCM encryption utility with support for complex JavaScript types like `Date`, `RegExp`, `Buffer`, and even DOM elements (in the browser).
16
-
17
- - 📄 **[TinyCertCrypto.md](./libs/TinyCertCrypto.md)** — A lightweight tool for managing RSA key pairs and X.509 certificates with support for generation, PEM parsing, encryption/decryption of JSON, and certificate metadata extraction. Works in both Node.js and browser environments (with limitations in browser).
18
-
19
- ---
20
-
21
- ### 2. **`basics/`**
11
+ ### 1. **`basics/`**
22
12
 
23
13
  This folder contains the core scripts we have worked on so far. Each file is a module focused on specific functionality.
24
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-essentials",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
5
5
  "scripts": {
6
6
  "test": "npm run test:mjs && npm run test:cjs && npm run test:js",
@@ -16,7 +16,6 @@
16
16
  "build": "tsc -p tsconfig.json && rollup -c && webpack --mode production",
17
17
  "build-clean": "npm run clean && npm run build",
18
18
  "build-dist": "npm run build",
19
- "build-browserify": "npx browserify build/browserify.js -p esmify > dist/TinyAiApi.web.js",
20
19
  "clean": "rm -rf dist",
21
20
  "prepublishOnly": "npm run build"
22
21
  },
@@ -45,8 +44,7 @@
45
44
  "text",
46
45
  "lib",
47
46
  "time",
48
- "shuffle-array",
49
- "cryptography"
47
+ "shuffle-array"
50
48
  ],
51
49
  "author": "Yasmin Seidel (Jasmin Dreasond)",
52
50
  "license": "GPL-3.0-only",
@@ -75,7 +73,6 @@
75
73
  "moment-timezone": "^0.5.48",
76
74
  "mysql": "^2.18.1",
77
75
  "node-fetch": "2.7.0",
78
- "node-forge": "^1.3.1",
79
76
  "node-polyfill-webpack-plugin": "^4.1.0",
80
77
  "object-hash": "^3.0.0",
81
78
  "prettier": "3.5.3",