tiny-essentials 1.3.0 → 1.3.2

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 (127) hide show
  1. package/dist/TinyBasicsEs.js +3 -3
  2. package/dist/TinyBasicsEs.min.js +1 -1
  3. package/dist/TinyEssentials.js +26 -18
  4. package/dist/TinyEssentials.min.js +1 -1
  5. package/dist/TinyLevelUp.js +23 -15
  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 +23 -15
  107. package/dist/legacy/libs/userLevel.d.mts +41 -19
  108. package/dist/legacy/libs/userLevel.mjs +21 -15
  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/basics/clock.cjs +1 -1
  122. package/dist/v1/basics/clock.d.mts +1 -1
  123. package/dist/v1/basics/clock.mjs +1 -1
  124. package/dist/v1/basics/simpleMath.cjs +2 -2
  125. package/dist/v1/basics/simpleMath.d.mts +2 -2
  126. package/dist/v1/basics/simpleMath.mjs +2 -2
  127. package/package.json +1 -1
@@ -28,7 +28,7 @@ if (!('toJSON' in Error.prototype)) {
28
28
  *
29
29
  * @param {string} where - The location or context where the log is coming from.
30
30
  * @param {string} type - The type of log (log, error, info, or warn).
31
- * @param {Array} args - The arguments to log (can include strings, numbers, objects, arrays, or errors).
31
+ * @param {Array<*>} args - The arguments to log (can include strings, numbers, objects, arrays, or errors).
32
32
  * @returns {Promise<void>} Resolves once the log is stored in the database.
33
33
  */
34
34
  const tinyAction = async function (where, type, args) {
@@ -111,7 +111,7 @@ const checkLastTime = function (value) {
111
111
  * Each log type is stored in the database with a timestamp and arguments.
112
112
  *
113
113
  * @param {string} where - The location or context where the log is coming from.
114
- * @returns {Object} The logger object with methods for logging (log, error, info, warn).
114
+ * @returns {Record<string, any>} The logger object with methods for logging (log, error, info, warn).
115
115
  */
116
116
  const loggerGenerator = function (where) {
117
117
  // Done
@@ -149,9 +149,9 @@ const databaseLogger = {
149
149
  /**
150
150
  * Starts the logger with a new database instance and initializes cache values.
151
151
  *
152
- * @param {Object} newDB - The new database instance to use for storing logs.
152
+ * @param {Record<string, any>} newDB - The new database instance to use for storing logs.
153
153
  * @param {string} where - The context or location where the logger will be used.
154
- * @returns {Promise<Object>} The logger instance with methods for logging.
154
+ * @returns {Promise<Record<string, any>>} The logger instance with methods for logging.
155
155
  */
156
156
  start: async function (newDB, where) {
157
157
  // Prepare
@@ -207,7 +207,7 @@ const databaseLogger = {
207
207
  * Retrieves the logger instance for a given context.
208
208
  *
209
209
  * @param {string} where - The context or location where the logger will be used.
210
- * @returns {Object} The logger instance with methods for logging.
210
+ * @returns {Record<string, any>} The logger instance with methods for logging.
211
211
  */
212
212
  get: function (where) {
213
213
  return loggerGenerator(where);
@@ -21,9 +21,9 @@ var errorValidator = require('../get/errorValidator.cjs');
21
21
  * @param {boolean} [data.mute=false] - Whether the user should be server-muted.
22
22
  * @param {boolean} [data.deaf=false] - Whether the user should be server-deafened.
23
23
  *
24
- * @returns {Promise<Object>} Resolves with the user object if successful, or rejects with an error object.
24
+ * @returns {Promise<Record<string, any>>} Resolves with the user object if successful, or rejects with an error object.
25
25
  *
26
- * @throws {Object} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
26
+ * @throws {Record<string, any>} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
27
27
  *
28
28
  * @example
29
29
  * const result = await addGuildMember('your_bot_token', {
@@ -12,9 +12,9 @@
12
12
  * @param {boolean} [data.mute=false] - Whether the user should be server-muted.
13
13
  * @param {boolean} [data.deaf=false] - Whether the user should be server-deafened.
14
14
  *
15
- * @returns {Promise<Object>} Resolves with the user object if successful, or rejects with an error object.
15
+ * @returns {Promise<Record<string, any>>} Resolves with the user object if successful, or rejects with an error object.
16
16
  *
17
- * @throws {Object} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
17
+ * @throws {Record<string, any>} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
18
18
  *
19
19
  * @example
20
20
  * const result = await addGuildMember('your_bot_token', {
@@ -35,4 +35,4 @@ export default function addGuildMember(bot_token: string, data: {
35
35
  nickname?: string | undefined;
36
36
  mute?: boolean | undefined;
37
37
  deaf?: boolean | undefined;
38
- }): Promise<Object>;
38
+ }): Promise<Record<string, any>>;
@@ -16,9 +16,9 @@ import errorValidator from '../get/errorValidator.mjs';
16
16
  * @param {boolean} [data.mute=false] - Whether the user should be server-muted.
17
17
  * @param {boolean} [data.deaf=false] - Whether the user should be server-deafened.
18
18
  *
19
- * @returns {Promise<Object>} Resolves with the user object if successful, or rejects with an error object.
19
+ * @returns {Promise<Record<string, any>>} Resolves with the user object if successful, or rejects with an error object.
20
20
  *
21
- * @throws {Object} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
21
+ * @throws {Record<string, any>} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
22
22
  *
23
23
  * @example
24
24
  * const result = await addGuildMember('your_bot_token', {
@@ -14,9 +14,9 @@ var errorValidator = require('../get/errorValidator.cjs');
14
14
  *
15
15
  * @param {string} guildID - The ID of the guild whose widget is to be fetched.
16
16
  *
17
- * @returns {Promise<Object>} Resolves with the guild widget data if successful.
17
+ * @returns {Promise<Record<string, any>>} Resolves with the guild widget data if successful.
18
18
  *
19
- * @throws {Object} If the request fails or the widget is disabled, rejects with an object containing a `code` and `message`.
19
+ * @throws {Record<string, any>} If the request fails or the widget is disabled, rejects with an object containing a `code` and `message`.
20
20
  *
21
21
  * @example
22
22
  * getGuildWidget('123456789012345678')
@@ -5,13 +5,13 @@
5
5
  *
6
6
  * @param {string} guildID - The ID of the guild whose widget is to be fetched.
7
7
  *
8
- * @returns {Promise<Object>} Resolves with the guild widget data if successful.
8
+ * @returns {Promise<Record<string, any>>} Resolves with the guild widget data if successful.
9
9
  *
10
- * @throws {Object} If the request fails or the widget is disabled, rejects with an object containing a `code` and `message`.
10
+ * @throws {Record<string, any>} If the request fails or the widget is disabled, rejects with an object containing a `code` and `message`.
11
11
  *
12
12
  * @example
13
13
  * getGuildWidget('123456789012345678')
14
14
  * .then((data) => console.log(data))
15
15
  * .catch((err) => console.error('Widget error:', err));
16
16
  */
17
- export default function getGuildWidget(guildID: string): Promise<Object>;
17
+ export default function getGuildWidget(guildID: string): Promise<Record<string, any>>;
@@ -9,9 +9,9 @@ import errorValidator from '../get/errorValidator.mjs';
9
9
  *
10
10
  * @param {string} guildID - The ID of the guild whose widget is to be fetched.
11
11
  *
12
- * @returns {Promise<Object>} Resolves with the guild widget data if successful.
12
+ * @returns {Promise<Record<string, any>>} Resolves with the guild widget data if successful.
13
13
  *
14
- * @throws {Object} If the request fails or the widget is disabled, rejects with an object containing a `code` and `message`.
14
+ * @throws {Record<string, any>} If the request fails or the widget is disabled, rejects with an object containing a `code` and `message`.
15
15
  *
16
16
  * @example
17
17
  * getGuildWidget('123456789012345678')
@@ -20,9 +20,9 @@ var errorValidator = require('../get/errorValidator.cjs');
20
20
  * @param {string} dsData.redirect_uri - The redirect URI used during the authorization.
21
21
  * @param {string} [dsData.scope] - The OAuth2 scopes being requested (optional but recommended).
22
22
  *
23
- * @returns {Promise<Object>} Resolves with the access token data (access_token, token_type, expires_in, refresh_token, scope).
23
+ * @returns {Promise<Record<string, any>>} Resolves with the access token data (access_token, token_type, expires_in, refresh_token, scope).
24
24
  *
25
- * @throws {Object} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
25
+ * @throws {Record<string, any>} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
26
26
  *
27
27
  * @example
28
28
  * getToken({
@@ -11,9 +11,9 @@
11
11
  * @param {string} dsData.redirect_uri - The redirect URI used during the authorization.
12
12
  * @param {string} [dsData.scope] - The OAuth2 scopes being requested (optional but recommended).
13
13
  *
14
- * @returns {Promise<Object>} Resolves with the access token data (access_token, token_type, expires_in, refresh_token, scope).
14
+ * @returns {Promise<Record<string, any>>} Resolves with the access token data (access_token, token_type, expires_in, refresh_token, scope).
15
15
  *
16
- * @throws {Object} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
16
+ * @throws {Record<string, any>} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
17
17
  *
18
18
  * @example
19
19
  * getToken({
@@ -32,4 +32,4 @@ export default function getToken(dsData: {
32
32
  code: string;
33
33
  redirect_uri: string;
34
34
  scope?: string | undefined;
35
- }): Promise<Object>;
35
+ }): Promise<Record<string, any>>;
@@ -15,9 +15,9 @@ import errorValidator from '../get/errorValidator.mjs';
15
15
  * @param {string} dsData.redirect_uri - The redirect URI used during the authorization.
16
16
  * @param {string} [dsData.scope] - The OAuth2 scopes being requested (optional but recommended).
17
17
  *
18
- * @returns {Promise<Object>} Resolves with the access token data (access_token, token_type, expires_in, refresh_token, scope).
18
+ * @returns {Promise<Record<string, any>>} Resolves with the access token data (access_token, token_type, expires_in, refresh_token, scope).
19
19
  *
20
- * @throws {Object} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
20
+ * @throws {Record<string, any>} If the request fails or Discord returns an error, rejects with an object containing a `code` and `message`.
21
21
  *
22
22
  * @example
23
23
  * getToken({
@@ -18,9 +18,9 @@ var errorValidator = require('../get/errorValidator.cjs');
18
18
  * @param {string} [user='@me'] - The user ID to fetch. Use '@me' to get the authenticated user's profile.
19
19
  * @param {string} [version=''] - Optional API version prefix (e.g., 'v10/') if needed by your API setup.
20
20
  *
21
- * @returns {Promise<Object>} Resolves with the user's profile data returned by Discord.
21
+ * @returns {Promise<Record<string, any>>} Resolves with the user's profile data returned by Discord.
22
22
  *
23
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
23
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
24
24
  *
25
25
  * @example
26
26
  * getUser('access_token_here')
@@ -9,9 +9,9 @@
9
9
  * @param {string} [user='@me'] - The user ID to fetch. Use '@me' to get the authenticated user's profile.
10
10
  * @param {string} [version=''] - Optional API version prefix (e.g., 'v10/') if needed by your API setup.
11
11
  *
12
- * @returns {Promise<Object>} Resolves with the user's profile data returned by Discord.
12
+ * @returns {Promise<Record<string, any>>} Resolves with the user's profile data returned by Discord.
13
13
  *
14
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
14
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
15
15
  *
16
16
  * @example
17
17
  * getUser('access_token_here')
@@ -24,4 +24,4 @@
24
24
  * .then(user => console.log('User info:', user))
25
25
  * .catch(err => console.error('Error:', err));
26
26
  */
27
- export default function getUser(access_token: string, type?: string, user?: string, version?: string): Promise<Object>;
27
+ export default function getUser(access_token: string, type?: string, user?: string, version?: string): Promise<Record<string, any>>;
@@ -13,9 +13,9 @@ import errorValidator from '../get/errorValidator.mjs';
13
13
  * @param {string} [user='@me'] - The user ID to fetch. Use '@me' to get the authenticated user's profile.
14
14
  * @param {string} [version=''] - Optional API version prefix (e.g., 'v10/') if needed by your API setup.
15
15
  *
16
- * @returns {Promise<Object>} Resolves with the user's profile data returned by Discord.
16
+ * @returns {Promise<Record<string, any>>} Resolves with the user's profile data returned by Discord.
17
17
  *
18
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
18
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
19
19
  *
20
20
  * @example
21
21
  * getUser('access_token_here')
@@ -17,9 +17,9 @@ var errorValidator = require('../get/errorValidator.cjs');
17
17
  *
18
18
  * @param {string} access_token - The OAuth2 access token used to authenticate the user.
19
19
  *
20
- * @returns {Promise<Array<Object>>} Resolves with an array of connection objects.
20
+ * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of connection objects.
21
21
  *
22
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
22
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
23
23
  *
24
24
  * @see {@link https://discord.com/developers/docs/resources/user#get-user-connections} Discord API Reference
25
25
  *
@@ -8,9 +8,9 @@
8
8
  *
9
9
  * @param {string} access_token - The OAuth2 access token used to authenticate the user.
10
10
  *
11
- * @returns {Promise<Array<Object>>} Resolves with an array of connection objects.
11
+ * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of connection objects.
12
12
  *
13
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
13
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
14
14
  *
15
15
  * @see {@link https://discord.com/developers/docs/resources/user#get-user-connections} Discord API Reference
16
16
  *
@@ -23,4 +23,4 @@
23
23
  * })
24
24
  * .catch(err => console.error('Failed to get connections:', err));
25
25
  */
26
- export default function getUserConnections(access_token: string): Promise<Array<Object>>;
26
+ export default function getUserConnections(access_token: string): Promise<Array<Record<string, any>>>;
@@ -12,9 +12,9 @@ import errorValidator from '../get/errorValidator.mjs';
12
12
  *
13
13
  * @param {string} access_token - The OAuth2 access token used to authenticate the user.
14
14
  *
15
- * @returns {Promise<Array<Object>>} Resolves with an array of connection objects.
15
+ * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of connection objects.
16
16
  *
17
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
17
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
18
18
  *
19
19
  * @see {@link https://discord.com/developers/docs/resources/user#get-user-connections} Discord API Reference
20
20
  *
@@ -18,9 +18,9 @@ var errorValidator = require('../get/errorValidator.cjs');
18
18
  *
19
19
  * @param {string} access_token - The OAuth2 access token used to authenticate the user.
20
20
  *
21
- * @returns {Promise<Array<Object>>} Resolves with an array of guild objects the user is in.
21
+ * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of guild objects the user is in.
22
22
  *
23
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
23
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
24
24
  *
25
25
  * @example
26
26
  * getUserGuilds('your_access_token')
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * @param {string} access_token - The OAuth2 access token used to authenticate the user.
11
11
  *
12
- * @returns {Promise<Array<Object>>} Resolves with an array of guild objects the user is in.
12
+ * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of guild objects the user is in.
13
13
  *
14
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
14
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
15
15
  *
16
16
  * @example
17
17
  * getUserGuilds('your_access_token')
@@ -22,4 +22,4 @@
22
22
  * })
23
23
  * .catch(err => console.error('Failed to get guilds:', err));
24
24
  */
25
- export default function getUserGuilds(access_token: string): Promise<Array<Object>>;
25
+ export default function getUserGuilds(access_token: string): Promise<Array<Record<string, any>>>;
@@ -13,9 +13,9 @@ import errorValidator from '../get/errorValidator.mjs';
13
13
  *
14
14
  * @param {string} access_token - The OAuth2 access token used to authenticate the user.
15
15
  *
16
- * @returns {Promise<Array<Object>>} Resolves with an array of guild objects the user is in.
16
+ * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of guild objects the user is in.
17
17
  *
18
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
18
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
19
19
  *
20
20
  * @example
21
21
  * getUserGuilds('your_access_token')
@@ -21,7 +21,7 @@ var errorValidator = require('../get/errorValidator.cjs');
21
21
  * @param {string} dsData.redirect_uri - The redirect URI used in the original OAuth2 flow.
22
22
  * @param {string} dsData.scope - The scope(s) to request (e.g., 'identify guilds').
23
23
  *
24
- * @returns {Promise<Object>} Resolves with a new token object from the Discord API:
24
+ * @returns {Promise<Record<string, any>>} Resolves with a new token object from the Discord API:
25
25
  * {
26
26
  * access_token: string,
27
27
  * token_type: string,
@@ -30,7 +30,7 @@ var errorValidator = require('../get/errorValidator.cjs');
30
30
  * scope: string
31
31
  * }
32
32
  *
33
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
33
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
34
34
  *
35
35
  * @example
36
36
  * refreshToken({
@@ -12,7 +12,7 @@
12
12
  * @param {string} dsData.redirect_uri - The redirect URI used in the original OAuth2 flow.
13
13
  * @param {string} dsData.scope - The scope(s) to request (e.g., 'identify guilds').
14
14
  *
15
- * @returns {Promise<Object>} Resolves with a new token object from the Discord API:
15
+ * @returns {Promise<Record<string, any>>} Resolves with a new token object from the Discord API:
16
16
  * {
17
17
  * access_token: string,
18
18
  * token_type: string,
@@ -21,7 +21,7 @@
21
21
  * scope: string
22
22
  * }
23
23
  *
24
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
24
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
25
25
  *
26
26
  * @example
27
27
  * refreshToken({
@@ -42,4 +42,4 @@ export default function refreshToken(dsData: {
42
42
  refresh_token: string;
43
43
  redirect_uri: string;
44
44
  scope: string;
45
- }): Promise<Object>;
45
+ }): Promise<Record<string, any>>;
@@ -16,7 +16,7 @@ import errorValidator from '../get/errorValidator.mjs';
16
16
  * @param {string} dsData.redirect_uri - The redirect URI used in the original OAuth2 flow.
17
17
  * @param {string} dsData.scope - The scope(s) to request (e.g., 'identify guilds').
18
18
  *
19
- * @returns {Promise<Object>} Resolves with a new token object from the Discord API:
19
+ * @returns {Promise<Record<string, any>>} Resolves with a new token object from the Discord API:
20
20
  * {
21
21
  * access_token: string,
22
22
  * token_type: string,
@@ -25,7 +25,7 @@ import errorValidator from '../get/errorValidator.mjs';
25
25
  * scope: string
26
26
  * }
27
27
  *
28
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
28
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
29
29
  *
30
30
  * @example
31
31
  * refreshToken({
@@ -19,10 +19,10 @@ var errorValidator = require('../get/errorValidator.cjs');
19
19
  * @param {string} tinyAuth.client_id - The Discord application client ID.
20
20
  * @param {string} tinyAuth.client_secret - The Discord application client secret.
21
21
  *
22
- * @returns {Promise<Object>} Resolves when the token is successfully revoked.
22
+ * @returns {Promise<Record<string, any>>} Resolves when the token is successfully revoked.
23
23
  * The response may not contain any body if successful, so `result.data` may be empty.
24
24
  *
25
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
25
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
26
26
  *
27
27
  * @example
28
28
  * revokeToken('user-access-token', {
@@ -10,10 +10,10 @@
10
10
  * @param {string} tinyAuth.client_id - The Discord application client ID.
11
11
  * @param {string} tinyAuth.client_secret - The Discord application client secret.
12
12
  *
13
- * @returns {Promise<Object>} Resolves when the token is successfully revoked.
13
+ * @returns {Promise<Record<string, any>>} Resolves when the token is successfully revoked.
14
14
  * The response may not contain any body if successful, so `result.data` may be empty.
15
15
  *
16
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
16
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
17
17
  *
18
18
  * @example
19
19
  * revokeToken('user-access-token', {
@@ -26,4 +26,4 @@
26
26
  export default function revokeToken(access_token: string, tinyAuth: {
27
27
  client_id: string;
28
28
  client_secret: string;
29
- }): Promise<Object>;
29
+ }): Promise<Record<string, any>>;
@@ -15,10 +15,10 @@ import errorValidator from '../get/errorValidator.mjs';
15
15
  * @param {string} tinyAuth.client_id - The Discord application client ID.
16
16
  * @param {string} tinyAuth.client_secret - The Discord application client secret.
17
17
  *
18
- * @returns {Promise<Object>} Resolves when the token is successfully revoked.
18
+ * @returns {Promise<Record<string, any>>} Resolves when the token is successfully revoked.
19
19
  * The response may not contain any body if successful, so `result.data` may be empty.
20
20
  *
21
- * @throws {Object} If the request fails, rejects with an error object containing `code` and `message`.
21
+ * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`.
22
22
  *
23
23
  * @example
24
24
  * revokeToken('user-access-token', {
@@ -12,9 +12,9 @@ var config = require('../config.cjs');
12
12
  * authentication flows, such as logging in or connecting a webhook.
13
13
  *
14
14
  * @function
15
- * @param {Object} tinyCfg - The configuration object containing the app's OAuth2 settings.
16
- * @param {Object} jsonState - The state object to be encrypted and passed in the authorization URL.
17
- * @param {Object} tinyCrypto - The crypto object used to encrypt the state.
15
+ * @param {Record<string, any>} tinyCfg - The configuration object containing the app's OAuth2 settings.
16
+ * @param {Record<string, any>} jsonState - The state object to be encrypted and passed in the authorization URL.
17
+ * @param {Record<string, any>} tinyCrypto - The crypto object used to encrypt the state.
18
18
  * @param {string} type - The type of the request, which determines the URL generation process.
19
19
  * Can be `'login'`, `'login_command'`, or `'webhook'`.
20
20
  *
@@ -4,9 +4,9 @@
4
4
  * authentication flows, such as logging in or connecting a webhook.
5
5
  *
6
6
  * @function
7
- * @param {Object} tinyCfg - The configuration object containing the app's OAuth2 settings.
8
- * @param {Object} jsonState - The state object to be encrypted and passed in the authorization URL.
9
- * @param {Object} tinyCrypto - The crypto object used to encrypt the state.
7
+ * @param {Record<string, any>} tinyCfg - The configuration object containing the app's OAuth2 settings.
8
+ * @param {Record<string, any>} jsonState - The state object to be encrypted and passed in the authorization URL.
9
+ * @param {Record<string, any>} tinyCrypto - The crypto object used to encrypt the state.
10
10
  * @param {string} type - The type of the request, which determines the URL generation process.
11
11
  * Can be `'login'`, `'login_command'`, or `'webhook'`.
12
12
  *
@@ -20,4 +20,4 @@
20
20
  * const webhookAuthUrl = authURLGenerator(tinyCfg, jsonState, tinyCrypto, 'webhook');
21
21
  * console.log(webhookAuthUrl);
22
22
  */
23
- export default function authURLGenerator(tinyCfg: Object, jsonState: Object, tinyCrypto: Object, type: string): string;
23
+ export default function authURLGenerator(tinyCfg: Record<string, any>, jsonState: Record<string, any>, tinyCrypto: Record<string, any>, type: string): string;
@@ -7,9 +7,9 @@ import config from '../config.mjs';
7
7
  * authentication flows, such as logging in or connecting a webhook.
8
8
  *
9
9
  * @function
10
- * @param {Object} tinyCfg - The configuration object containing the app's OAuth2 settings.
11
- * @param {Object} jsonState - The state object to be encrypted and passed in the authorization URL.
12
- * @param {Object} tinyCrypto - The crypto object used to encrypt the state.
10
+ * @param {Record<string, any>} tinyCfg - The configuration object containing the app's OAuth2 settings.
11
+ * @param {Record<string, any>} jsonState - The state object to be encrypted and passed in the authorization URL.
12
+ * @param {Record<string, any>} tinyCrypto - The crypto object used to encrypt the state.
13
13
  * @param {string} type - The type of the request, which determines the URL generation process.
14
14
  * Can be `'login'`, `'login_command'`, or `'webhook'`.
15
15
  *
@@ -11,7 +11,7 @@ var objType = require('../../../get/objType.cjs');
11
11
  * the value is returned. Otherwise, `null` is returned.
12
12
  *
13
13
  * @function
14
- * @param {Object} req - The request object, which contains the session data.
14
+ * @param {Record<string, any>} req - The request object, which contains the session data.
15
15
  * @param {string} where - The key for which the session value is being retrieved.
16
16
  *
17
17
  * @returns {string|null} The session value associated with the provided key, or `null` if it doesn't exist or isn't valid.
@@ -4,7 +4,7 @@
4
4
  * the value is returned. Otherwise, `null` is returned.
5
5
  *
6
6
  * @function
7
- * @param {Object} req - The request object, which contains the session data.
7
+ * @param {Record<string, any>} req - The request object, which contains the session data.
8
8
  * @param {string} where - The key for which the session value is being retrieved.
9
9
  *
10
10
  * @returns {string|null} The session value associated with the provided key, or `null` if it doesn't exist or isn't valid.
@@ -17,4 +17,4 @@
17
17
  * console.log('No valid token in session');
18
18
  * }
19
19
  */
20
- export default function cookieSession(req: Object, where: string): string | null;
20
+ export default function cookieSession(req: Record<string, any>, where: string): string | null;
@@ -6,7 +6,7 @@ import objType from '../../../get/objType.mjs';
6
6
  * the value is returned. Otherwise, `null` is returned.
7
7
  *
8
8
  * @function
9
- * @param {Object} req - The request object, which contains the session data.
9
+ * @param {Record<string, any>} req - The request object, which contains the session data.
10
10
  * @param {string} where - The key for which the session value is being retrieved.
11
11
  *
12
12
  * @returns {string|null} The session value associated with the provided key, or `null` if it doesn't exist or isn't valid.
@@ -13,7 +13,7 @@ var objType = require('../../../get/objType.cjs');
13
13
  * @function
14
14
  * @param {Object|Array} data - The response data to validate. This can be either an object or an array.
15
15
  *
16
- * @returns {Object} The result object containing:
16
+ * @returns {Record<string, any>} The result object containing:
17
17
  * - `data` (Object|null): The validated data if no error occurred or null if an error was found.
18
18
  * - `error` (Object|null): The error object if there was an issue, or null if no error was found.
19
19
  *
@@ -6,7 +6,7 @@
6
6
  * @function
7
7
  * @param {Object|Array} data - The response data to validate. This can be either an object or an array.
8
8
  *
9
- * @returns {Object} The result object containing:
9
+ * @returns {Record<string, any>} The result object containing:
10
10
  * - `data` (Object|null): The validated data if no error occurred or null if an error was found.
11
11
  * - `error` (Object|null): The error object if there was an issue, or null if no error was found.
12
12
  *
@@ -25,4 +25,4 @@
25
25
  * const result = errorValidator(response);
26
26
  * console.log(result); // { data: null, error: { code: 500, message: 'Invalid HTTP Result!' } }
27
27
  */
28
- export default function errorValidator(data: Object | any[]): Object;
28
+ export default function errorValidator(data: Object | any[]): Record<string, any>;
@@ -8,7 +8,7 @@ import objType from '../../../get/objType.mjs';
8
8
  * @function
9
9
  * @param {Object|Array} data - The response data to validate. This can be either an object or an array.
10
10
  *
11
- * @returns {Object} The result object containing:
11
+ * @returns {Record<string, any>} The result object containing:
12
12
  * - `data` (Object|null): The validated data if no error occurred or null if an error was found.
13
13
  * - `error` (Object|null): The error object if there was an issue, or null if no error was found.
14
14
  *
@@ -15,9 +15,9 @@ var authURLGenerator = require('../get/authURLGenerator.cjs');
15
15
  * Depending on the configuration type, it handles various authentication methods like login, login_command, and webhook.
16
16
  *
17
17
  * @function
18
- * @param {Object} req - The request object, typically provided by the web framework (e.g., Express).
19
- * @param {Object} res - The response object, typically provided by the web framework (e.g., Express).
20
- * @param {Object} cfg - The configuration object that includes various settings for the login process.
18
+ * @param {Record<string, any>} req - The request object, typically provided by the web framework (e.g., Express).
19
+ * @param {Record<string, any>} res - The response object, typically provided by the web framework (e.g., Express).
20
+ * @param {Record<string, any>} cfg - The configuration object that includes various settings for the login process.
21
21
  * @param {boolean} existSession - A flag indicating whether the user already has an active session.
22
22
  *
23
23
  * @returns {void} This function does not return anything. It sends a redirect response to the user based on the configuration.
@@ -3,9 +3,9 @@
3
3
  * Depending on the configuration type, it handles various authentication methods like login, login_command, and webhook.
4
4
  *
5
5
  * @function
6
- * @param {Object} req - The request object, typically provided by the web framework (e.g., Express).
7
- * @param {Object} res - The response object, typically provided by the web framework (e.g., Express).
8
- * @param {Object} cfg - The configuration object that includes various settings for the login process.
6
+ * @param {Record<string, any>} req - The request object, typically provided by the web framework (e.g., Express).
7
+ * @param {Record<string, any>} res - The response object, typically provided by the web framework (e.g., Express).
8
+ * @param {Record<string, any>} cfg - The configuration object that includes various settings for the login process.
9
9
  * @param {boolean} existSession - A flag indicating whether the user already has an active session.
10
10
  *
11
11
  * @returns {void} This function does not return anything. It sends a redirect response to the user based on the configuration.
@@ -18,4 +18,4 @@
18
18
  * login(req, res, config, sessionExists);
19
19
  * });
20
20
  */
21
- export default function login(req: Object, res: Object, cfg: Object, existSession: boolean): void;
21
+ export default function login(req: Record<string, any>, res: Record<string, any>, cfg: Record<string, any>, existSession: boolean): void;
@@ -10,9 +10,9 @@ import authURLGenerator from '../get/authURLGenerator.mjs';
10
10
  * Depending on the configuration type, it handles various authentication methods like login, login_command, and webhook.
11
11
  *
12
12
  * @function
13
- * @param {Object} req - The request object, typically provided by the web framework (e.g., Express).
14
- * @param {Object} res - The response object, typically provided by the web framework (e.g., Express).
15
- * @param {Object} cfg - The configuration object that includes various settings for the login process.
13
+ * @param {Record<string, any>} req - The request object, typically provided by the web framework (e.g., Express).
14
+ * @param {Record<string, any>} res - The response object, typically provided by the web framework (e.g., Express).
15
+ * @param {Record<string, any>} cfg - The configuration object that includes various settings for the login process.
16
16
  * @param {boolean} existSession - A flag indicating whether the user already has an active session.
17
17
  *
18
18
  * @returns {void} This function does not return anything. It sends a redirect response to the user based on the configuration.
@@ -11,14 +11,14 @@ var getUser = require('../api/getUser.cjs');
11
11
  /**
12
12
  * Handles the logout process for the user by revoking the token and redirecting.
13
13
  *
14
- * @param {Object} req - The HTTP request object.
14
+ * @param {Record<string, any>} req - The HTTP request object.
15
15
  * @param {string|number} access_token - The access token of the user to be revoked.
16
- * @param {Object} cfg - Configuration object containing settings for the logout process.
16
+ * @param {Record<string, any>} cfg - Configuration object containing settings for the logout process.
17
17
  * @param {boolean} existSession - A flag indicating whether a session exists.
18
18
  *
19
- * @returns {Promise<Object>} Resolves with a result object or rejects with an error.
19
+ * @returns {Promise<Record<string, any>>} Resolves with a result object or rejects with an error.
20
20
  *
21
- * @throws {Object} Rejects with an error if configuration or token values are invalid.
21
+ * @throws {Record<string, any>} Rejects with an error if configuration or token values are invalid.
22
22
  *
23
23
  * @example
24
24
  * logout(req, 'userAccessToken', cfg, true)