@futdevpro/fsm-dynamo 1.14.10 → 1.14.12

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 (276) hide show
  1. package/.vscode/settings.json +11 -0
  2. package/build/_collections/constants/data-sizes.const.d.ts +3 -3
  3. package/build/_collections/constants/data-sizes.const.d.ts.map +1 -1
  4. package/build/_collections/constants/data-sizes.const.js +4 -3
  5. package/build/_collections/constants/data-sizes.const.js.map +1 -1
  6. package/build/_collections/utils/array.util.d.ts +189 -0
  7. package/build/_collections/utils/array.util.d.ts.map +1 -1
  8. package/build/_collections/utils/array.util.js +189 -0
  9. package/build/_collections/utils/array.util.js.map +1 -1
  10. package/build/_collections/utils/async.util.d.ts +29 -0
  11. package/build/_collections/utils/async.util.d.ts.map +1 -1
  12. package/build/_collections/utils/async.util.js +45 -3
  13. package/build/_collections/utils/async.util.js.map +1 -1
  14. package/build/_collections/utils/json-error-helper.util.d.ts +38 -0
  15. package/build/_collections/utils/json-error-helper.util.d.ts.map +1 -1
  16. package/build/_collections/utils/json-error-helper.util.js +38 -0
  17. package/build/_collections/utils/json-error-helper.util.js.map +1 -1
  18. package/build/_collections/utils/log.util.d.ts +195 -5
  19. package/build/_collections/utils/log.util.d.ts.map +1 -1
  20. package/build/_collections/utils/log.util.js +245 -53
  21. package/build/_collections/utils/log.util.js.map +1 -1
  22. package/build/_collections/utils/math/box-bounds.util.d.ts +36 -0
  23. package/build/_collections/utils/math/box-bounds.util.d.ts.map +1 -1
  24. package/build/_collections/utils/math/box-bounds.util.js +38 -6
  25. package/build/_collections/utils/math/box-bounds.util.js.map +1 -1
  26. package/build/_collections/utils/math/math.util.d.ts +48 -12
  27. package/build/_collections/utils/math/math.util.d.ts.map +1 -1
  28. package/build/_collections/utils/math/math.util.js +51 -15
  29. package/build/_collections/utils/math/math.util.js.map +1 -1
  30. package/build/_collections/utils/math/math.util.spec.js +0 -9
  31. package/build/_collections/utils/math/math.util.spec.js.map +1 -1
  32. package/build/_collections/utils/math/random.util.d.ts +30 -0
  33. package/build/_collections/utils/math/random.util.d.ts.map +1 -1
  34. package/build/_collections/utils/math/random.util.js +30 -0
  35. package/build/_collections/utils/math/random.util.js.map +1 -1
  36. package/build/_collections/utils/math/trigonometry.util.d.ts +30 -0
  37. package/build/_collections/utils/math/trigonometry.util.d.ts.map +1 -1
  38. package/build/_collections/utils/math/trigonometry.util.js +30 -0
  39. package/build/_collections/utils/math/trigonometry.util.js.map +1 -1
  40. package/build/_collections/utils/math/vector2.util.d.ts +247 -17
  41. package/build/_collections/utils/math/vector2.util.d.ts.map +1 -1
  42. package/build/_collections/utils/math/vector2.util.js +309 -79
  43. package/build/_collections/utils/math/vector2.util.js.map +1 -1
  44. package/build/_collections/utils/object.util.js +9 -7
  45. package/build/_collections/utils/object.util.js.map +1 -1
  46. package/build/_collections/utils/regex/password-regex.util.d.ts +12 -0
  47. package/build/_collections/utils/regex/password-regex.util.d.ts.map +1 -1
  48. package/build/_collections/utils/regex/password-regex.util.js +12 -0
  49. package/build/_collections/utils/regex/password-regex.util.js.map +1 -1
  50. package/build/_collections/utils/round-list.util.d.ts +39 -0
  51. package/build/_collections/utils/round-list.util.d.ts.map +1 -1
  52. package/build/_collections/utils/round-list.util.js +39 -0
  53. package/build/_collections/utils/round-list.util.js.map +1 -1
  54. package/build/_collections/utils/stack.util.d.ts +19 -0
  55. package/build/_collections/utils/stack.util.d.ts.map +1 -1
  56. package/build/_collections/utils/stack.util.js +22 -2
  57. package/build/_collections/utils/stack.util.js.map +1 -1
  58. package/build/_collections/utils/stack.util.spec.js +0 -13
  59. package/build/_collections/utils/stack.util.spec.js.map +1 -1
  60. package/build/_collections/utils/string.util.d.ts +17 -0
  61. package/build/_collections/utils/string.util.d.ts.map +1 -1
  62. package/build/_collections/utils/string.util.js +17 -0
  63. package/build/_collections/utils/string.util.js.map +1 -1
  64. package/build/_collections/utils/time.util.d.ts +136 -0
  65. package/build/_collections/utils/time.util.d.ts.map +1 -1
  66. package/build/_collections/utils/time.util.js +164 -28
  67. package/build/_collections/utils/time.util.js.map +1 -1
  68. package/build/_collections/utils/utilities.util.d.ts +17 -1
  69. package/build/_collections/utils/utilities.util.d.ts.map +1 -1
  70. package/build/_collections/utils/utilities.util.js +17 -1
  71. package/build/_collections/utils/utilities.util.js.map +1 -1
  72. package/build/_collections/utils/uuid.util.d.ts +6 -0
  73. package/build/_collections/utils/uuid.util.d.ts.map +1 -1
  74. package/build/_collections/utils/uuid.util.js +6 -0
  75. package/build/_collections/utils/uuid.util.js.map +1 -1
  76. package/build/_enums/data-model-type.enum.d.ts +6 -0
  77. package/build/_enums/data-model-type.enum.d.ts.map +1 -1
  78. package/build/_enums/data-model-type.enum.js +6 -0
  79. package/build/_enums/data-model-type.enum.js.map +1 -1
  80. package/build/_enums/http/http-call-type.enum.d.ts +8 -0
  81. package/build/_enums/http/http-call-type.enum.d.ts.map +1 -1
  82. package/build/_enums/http/http-call-type.enum.js +8 -0
  83. package/build/_enums/http/http-call-type.enum.js.map +1 -1
  84. package/build/_enums/http/http-event-type.enum.d.ts +5 -0
  85. package/build/_enums/http/http-event-type.enum.d.ts.map +1 -1
  86. package/build/_enums/http/http-event-type.enum.js +5 -0
  87. package/build/_enums/http/http-event-type.enum.js.map +1 -1
  88. package/build/_enums/time/day-of-week.enum.d.ts +14 -1
  89. package/build/_enums/time/day-of-week.enum.d.ts.map +1 -1
  90. package/build/_enums/time/day-of-week.enum.js +14 -1
  91. package/build/_enums/time/day-of-week.enum.js.map +1 -1
  92. package/build/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
  93. package/build/_models/control-models/data-model-params.control-model.js +11 -22
  94. package/build/_models/control-models/data-model-params.control-model.js.map +1 -1
  95. package/build/_models/control-models/data-property-params.control-model.d.ts +8 -0
  96. package/build/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
  97. package/build/_models/control-models/data-property-params.control-model.js +11 -59
  98. package/build/_models/control-models/data-property-params.control-model.js.map +1 -1
  99. package/build/_models/control-models/error.control-model.js +8 -25
  100. package/build/_models/control-models/error.control-model.js.map +1 -1
  101. package/build/_models/control-models/http/http-error-response.control-model.d.ts +25 -0
  102. package/build/_models/control-models/http/http-error-response.control-model.d.ts.map +1 -1
  103. package/build/_models/control-models/http/http-error-response.control-model.js +30 -7
  104. package/build/_models/control-models/http/http-error-response.control-model.js.map +1 -1
  105. package/build/_models/control-models/http/http-headers.control-model.d.ts +8 -0
  106. package/build/_models/control-models/http/http-headers.control-model.d.ts.map +1 -1
  107. package/build/_models/control-models/http/http-headers.control-model.js +12 -17
  108. package/build/_models/control-models/http/http-headers.control-model.js.map +1 -1
  109. package/build/_models/control-models/http/http-response.model-base.d.ts +9 -0
  110. package/build/_models/control-models/http/http-response.model-base.d.ts.map +1 -1
  111. package/build/_models/control-models/http/http-response.model-base.js +23 -26
  112. package/build/_models/control-models/http/http-response.model-base.js.map +1 -1
  113. package/build/_models/control-models/poll.control-model.d.ts +18 -0
  114. package/build/_models/control-models/poll.control-model.d.ts.map +1 -1
  115. package/build/_models/control-models/poll.control-model.js +22 -26
  116. package/build/_models/control-models/poll.control-model.js.map +1 -1
  117. package/build/_models/control-models/range-value.control-model.d.ts +141 -0
  118. package/build/_models/control-models/range-value.control-model.d.ts.map +1 -1
  119. package/build/_models/control-models/range-value.control-model.js +143 -4
  120. package/build/_models/control-models/range-value.control-model.js.map +1 -1
  121. package/build/_models/control-models/server-status.control-model.d.ts +10 -0
  122. package/build/_models/control-models/server-status.control-model.d.ts.map +1 -1
  123. package/build/_models/control-models/server-status.control-model.js +10 -12
  124. package/build/_models/control-models/server-status.control-model.js.map +1 -1
  125. package/build/_models/control-models/service-endpoint-settings-base.control-model.d.ts +34 -1
  126. package/build/_models/control-models/service-endpoint-settings-base.control-model.d.ts.map +1 -1
  127. package/build/_models/control-models/service-endpoint-settings-base.control-model.js +26 -5
  128. package/build/_models/control-models/service-endpoint-settings-base.control-model.js.map +1 -1
  129. package/build/_models/data-models/errors.data-model.d.ts +10 -0
  130. package/build/_models/data-models/errors.data-model.d.ts.map +1 -1
  131. package/build/_models/data-models/errors.data-model.js +13 -18
  132. package/build/_models/data-models/errors.data-model.js.map +1 -1
  133. package/build/_models/data-models/metadata.data-model.d.ts +26 -0
  134. package/build/_models/data-models/metadata.data-model.d.ts.map +1 -1
  135. package/build/_models/data-models/metadata.data-model.js +26 -12
  136. package/build/_models/data-models/metadata.data-model.js.map +1 -1
  137. package/build/_modules/ai/_models/ai-call-settings.interface.js +46 -49
  138. package/build/_modules/ai/_models/ai-call-settings.interface.js.map +1 -1
  139. package/build/_modules/ai/_models/ai-settings.interface.js +0 -3
  140. package/build/_modules/ai/_models/ai-settings.interface.js.map +1 -1
  141. package/build/_modules/ai/_modules/anthropic/_models/aai-call-settings.control-model.js +2 -2
  142. package/build/_modules/ai/_modules/anthropic/_models/aai-call-settings.control-model.js.map +1 -1
  143. package/build/_modules/ai/_modules/anthropic/_models/aai-settings.control-model.js +3 -3
  144. package/build/_modules/ai/_modules/anthropic/_models/aai-settings.control-model.js.map +1 -1
  145. package/build/_modules/ai/_modules/google-ai/_models/gai-call-settings.control-model.js +2 -2
  146. package/build/_modules/ai/_modules/google-ai/_models/gai-call-settings.control-model.js.map +1 -1
  147. package/build/_modules/ai/_modules/google-ai/_models/gai-settings.control-model.js +3 -3
  148. package/build/_modules/ai/_modules/google-ai/_models/gai-settings.control-model.js.map +1 -1
  149. package/build/_modules/ai/_modules/local-ai/_models/lai-call-settings.control-model.js +1 -1
  150. package/build/_modules/ai/_modules/local-ai/_models/lai-call-settings.control-model.js.map +1 -1
  151. package/build/_modules/ai/_modules/local-ai/_models/lai-settings.control-model.js +3 -3
  152. package/build/_modules/ai/_modules/local-ai/_models/lai-settings.control-model.js.map +1 -1
  153. package/build/_modules/ai/_modules/open-ai/_models/oai-call-settings.control-model.js +2 -2
  154. package/build/_modules/ai/_modules/open-ai/_models/oai-call-settings.control-model.js.map +1 -1
  155. package/build/_modules/ai/_modules/open-ai/_models/oai-settings.control-model.js +3 -3
  156. package/build/_modules/ai/_modules/open-ai/_models/oai-settings.control-model.js.map +1 -1
  157. package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
  158. package/build/_modules/ai/_modules/open-ai/index.js +7 -7
  159. package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
  160. package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.d.ts +23 -0
  161. package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.d.ts.map +1 -1
  162. package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.js +24 -12
  163. package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.js.map +1 -1
  164. package/build/_modules/crypto/_collections/crypto-2-non-stable.util.js +2 -2
  165. package/build/_modules/crypto/_collections/crypto-2-non-stable.util.js.map +1 -1
  166. package/build/_modules/crypto/_collections/crypto-old.util.d.ts.map +1 -1
  167. package/build/_modules/crypto/_collections/crypto-old.util.js +16 -16
  168. package/build/_modules/crypto/_collections/crypto-old.util.js.map +1 -1
  169. package/build/_modules/crypto/_collections/crypto.util.js +9 -9
  170. package/build/_modules/crypto/_collections/crypto.util.js.map +1 -1
  171. package/build/_modules/custom-data/_models/cud.data-model.d.ts +7 -0
  172. package/build/_modules/custom-data/_models/cud.data-model.d.ts.map +1 -1
  173. package/build/_modules/custom-data/_models/cud.data-model.js +7 -1
  174. package/build/_modules/custom-data/_models/cud.data-model.js.map +1 -1
  175. package/build/_modules/data-handler/_models/data-handler-settings.control-model.d.ts +73 -0
  176. package/build/_modules/data-handler/_models/data-handler-settings.control-model.d.ts.map +1 -0
  177. package/build/_modules/data-handler/_models/data-handler-settings.control-model.js +41 -0
  178. package/build/_modules/data-handler/_models/data-handler-settings.control-model.js.map +1 -0
  179. package/build/_modules/data-handler/_models/data-handler.control-model.d.ts +136 -0
  180. package/build/_modules/data-handler/_models/data-handler.control-model.d.ts.map +1 -0
  181. package/build/_modules/data-handler/_models/data-handler.control-model.js +293 -0
  182. package/build/_modules/data-handler/_models/data-handler.control-model.js.map +1 -0
  183. package/build/_modules/data-handler/_models/data-list-handler.control-model.d.ts +111 -0
  184. package/build/_modules/data-handler/_models/data-list-handler.control-model.d.ts.map +1 -0
  185. package/build/_modules/data-handler/_models/data-list-handler.control-model.js +197 -0
  186. package/build/_modules/data-handler/_models/data-list-handler.control-model.js.map +1 -0
  187. package/build/_modules/data-handler/_models/data-search-handler.control-model.d.ts +172 -0
  188. package/build/_modules/data-handler/_models/data-search-handler.control-model.d.ts.map +1 -0
  189. package/build/_modules/data-handler/_models/data-search-handler.control-model.js +319 -0
  190. package/build/_modules/data-handler/_models/data-search-handler.control-model.js.map +1 -0
  191. package/build/_modules/data-handler/_models/list-collector-data-handler.control-model.d.ts +116 -0
  192. package/build/_modules/data-handler/_models/list-collector-data-handler.control-model.d.ts.map +1 -0
  193. package/build/_modules/data-handler/_models/list-collector-data-handler.control-model.js +220 -0
  194. package/build/_modules/data-handler/_models/list-collector-data-handler.control-model.js.map +1 -0
  195. package/build/_modules/data-handler/index.d.ts +6 -0
  196. package/build/_modules/data-handler/index.d.ts.map +1 -0
  197. package/build/_modules/data-handler/index.js +10 -0
  198. package/build/_modules/data-handler/index.js.map +1 -0
  199. package/build/_modules/location/_collections/loc-regions.util.d.ts +33 -0
  200. package/build/_modules/location/_collections/loc-regions.util.d.ts.map +1 -1
  201. package/build/_modules/location/_collections/loc-regions.util.js +37 -4
  202. package/build/_modules/location/_collections/loc-regions.util.js.map +1 -1
  203. package/build/_modules/location/_collections/loc.util.d.ts +10 -0
  204. package/build/_modules/location/_collections/loc.util.d.ts.map +1 -1
  205. package/build/_modules/location/_collections/loc.util.js +10 -0
  206. package/build/_modules/location/_collections/loc.util.js.map +1 -1
  207. package/build/_modules/messaging/_models/msg-conversation.data-model.js +0 -23
  208. package/build/_modules/messaging/_models/msg-conversation.data-model.js.map +1 -1
  209. package/build/_modules/messaging/_models/msg-message.data-model.js +0 -34
  210. package/build/_modules/messaging/_models/msg-message.data-model.js.map +1 -1
  211. package/build/_modules/socket/_models/sck-client-params.control-model.js +2 -7
  212. package/build/_modules/socket/_models/sck-client-params.control-model.js.map +1 -1
  213. package/build/_modules/socket/_models/sck-socket-event.control-model.js +0 -8
  214. package/build/_modules/socket/_models/sck-socket-event.control-model.js.map +1 -1
  215. package/build/_modules/socket/_services/sck-client.service-base.js +69 -72
  216. package/build/_modules/socket/_services/sck-client.service-base.js.map +1 -1
  217. package/build/_modules/usage/_models/usg-action.control-model.js +0 -4
  218. package/build/_modules/usage/_models/usg-action.control-model.js.map +1 -1
  219. package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js +10 -12
  220. package/build/_modules/usage/_models/usg-daily-usage-data.control-model.js.map +1 -1
  221. package/build/_modules/usage/_models/usg-data.control-model.js +2 -8
  222. package/build/_modules/usage/_models/usg-data.control-model.js.map +1 -1
  223. package/build/_modules/usage/_models/usg-session.data-model.js +2 -18
  224. package/build/_modules/usage/_models/usg-session.data-model.js.map +1 -1
  225. package/eslint.config.js +4 -0
  226. package/futdevpro-fsm-dynamo-01.14.12.tgz +0 -0
  227. package/package.json +22 -3
  228. package/src/_collections/constants/data-sizes.const.ts +4 -4
  229. package/src/_collections/utils/array.util.ts +189 -0
  230. package/src/_collections/utils/async.util.ts +40 -0
  231. package/src/_collections/utils/json-error-helper.util.ts +43 -3
  232. package/src/_collections/utils/log.util.ts +194 -4
  233. package/src/_collections/utils/math/box-bounds.util.ts +36 -0
  234. package/src/_collections/utils/math/math.util.spec.ts +0 -10
  235. package/src/_collections/utils/math/math.util.ts +48 -16
  236. package/src/_collections/utils/math/random.util.ts +30 -0
  237. package/src/_collections/utils/math/trigonometry.util.ts +30 -0
  238. package/src/_collections/utils/math/vector2.util.ts +254 -24
  239. package/src/_collections/utils/regex/password-regex.util.ts +12 -0
  240. package/src/_collections/utils/round-list.util.ts +39 -0
  241. package/src/_collections/utils/stack.util.ts +27 -4
  242. package/src/_collections/utils/string.util.ts +17 -0
  243. package/src/_collections/utils/time.util.ts +136 -0
  244. package/src/_collections/utils/utilities.util.ts +17 -1
  245. package/src/_collections/utils/uuid.util.ts +6 -0
  246. package/src/_enums/data-model-type.enum.ts +6 -0
  247. package/src/_enums/http/http-call-type.enum.ts +8 -0
  248. package/src/_enums/http/http-event-type.enum.ts +5 -0
  249. package/src/_enums/time/day-of-week.enum.ts +14 -1
  250. package/src/_models/control-models/data-model-params.control-model.ts +11 -1
  251. package/src/_models/control-models/data-property-params.control-model.ts +8 -0
  252. package/src/_models/control-models/http/http-error-response.control-model.ts +25 -0
  253. package/src/_models/control-models/http/http-headers.control-model.ts +8 -0
  254. package/src/_models/control-models/http/http-response.model-base.ts +9 -0
  255. package/src/_models/control-models/poll.control-model.ts +18 -0
  256. package/src/_models/control-models/range-value.control-model.ts +141 -0
  257. package/src/_models/control-models/server-status.control-model.ts +10 -0
  258. package/src/_models/control-models/service-endpoint-settings-base.control-model.ts +53 -4
  259. package/src/_models/data-models/errors.data-model.ts +10 -0
  260. package/src/_models/data-models/metadata.data-model.ts +27 -0
  261. package/src/_modules/ai/_modules/open-ai/index.ts +4 -3
  262. package/src/_modules/ci-tools/_models/cit-ci-result-info.data-models.ts +23 -0
  263. package/src/_modules/crypto/_collections/crypto-old.util.ts +17 -9
  264. package/src/_modules/custom-data/_models/cud.data-model.ts +7 -0
  265. package/src/_modules/data-handler/_models/data-handler-settings.control-model.ts +110 -0
  266. package/src/_modules/data-handler/_models/data-handler.control-model.ts +459 -0
  267. package/src/_modules/data-handler/_models/data-list-handler.control-model.ts +245 -0
  268. package/src/_modules/data-handler/_models/data-search-handler.control-model.ts +390 -0
  269. package/src/_modules/data-handler/_models/list-collector-data-handler.control-model.ts +274 -0
  270. package/src/_modules/data-handler/index.ts +6 -0
  271. package/src/_modules/location/_collections/loc-regions.util.ts +34 -1
  272. package/src/_modules/location/_collections/loc.util.ts +10 -0
  273. package/src/_modules/usage/_collections/usg-module-settings.const.ts +1 -1
  274. package/tsconfig.json +2 -2
  275. package/.eslintrc.json +0 -155
  276. package/futdevpro-fsm-dynamo-01.14.10.tgz +0 -0
@@ -16,6 +16,14 @@ export class DyFM_Array {
16
16
  * @param list - The array to iterate over.
17
17
  * @param func - The function to apply to each element.
18
18
  * @returns A promise that resolves when all elements have been processed.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const list: number[] = [ 1, 2, 3 ];
23
+ * await DyFM_Array.asyncForEach(list, async (element: number, index?: number, array?: number[]): Promise<void> => {
24
+ * console.log(element, index, array);
25
+ * });
26
+ * ```
19
27
  */
20
28
  static async asyncForEach<T>(
21
29
  list: T[],
@@ -32,6 +40,14 @@ export class DyFM_Array {
32
40
  * @param list - The array to iterate over.
33
41
  * @param func - The function to apply to each element.
34
42
  * @returns A promise that resolves to the final result.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const list: number[] = [ 1, 2, 3 ];
47
+ * const result = await DyFM_Array.asyncForEachReturnToOne(0, list, async (element: number, dataCurrent: number, index?: number, array?: number[]): Promise<number> => {
48
+ * return dataCurrent + element;
49
+ * });
50
+ * ```
35
51
  */
36
52
  static async asyncForEachReturnToOne<T, K>(
37
53
  startData: K,
@@ -52,6 +68,14 @@ export class DyFM_Array {
52
68
  * @param list - The array to iterate over.
53
69
  * @param func - The function to apply to each element.
54
70
  * @returns A promise that resolves to an array of results.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const list: number[] = [ 1, 2, 3 ];
75
+ * const result = await DyFM_Array.asyncForEachReturnToAll(list, async (element: number, index?: number, array?: number[]): Promise<number> => {
76
+ * return element * 2;
77
+ * });
78
+ * ```
55
79
  */
56
80
  static async asyncForEachReturnToAll<T, K>(
57
81
  list: T[],
@@ -71,6 +95,15 @@ export class DyFM_Array {
71
95
  * @param list - The array to iterate over.
72
96
  * @param func - The function to apply to each element.
73
97
  * @returns A promise that resolves to an array of results.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const list: number[] = [ 1, 2, 3 ];
102
+ * const result = await DyFM_Array.asyncForEachAllAtOnce(list, async (element: number, index?: number, array?: number[]): Promise<number> => {
103
+ * return [ element * 2, element * 3 ];
104
+ * });
105
+ * console.log(result); // [ [ 2, 3 ], [ 4, 6 ], [ 6, 9 ] ]
106
+ * ```
74
107
  */
75
108
  static async asyncForEachAllAtOnce<T, R>(
76
109
  list: T[],
@@ -84,6 +117,15 @@ export class DyFM_Array {
84
117
  * @param list - The array to filter.
85
118
  * @param filterFunc - The function to apply to each element.
86
119
  * @returns A promise that resolves to an array of results.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * const list: number[] = [ 1, 2, 3 ];
124
+ * const result = await DyFM_Array.asyncFilter(list, async (element: number, index?: number, array?: number[]): Promise<boolean> => {
125
+ * return element % 2 === 0;
126
+ * });
127
+ * console.log(result); // [ 2 ]
128
+ * ```
87
129
  */
88
130
  static async asyncFilter<T>(
89
131
  list: T[],
@@ -105,6 +147,15 @@ export class DyFM_Array {
105
147
  * @param list - The array to map.
106
148
  * @param mapFunc - The function to apply to each element.
107
149
  * @returns A promise that resolves to an array of results.
150
+ *
151
+ * @example
152
+ * ```ts
153
+ * const list: number[] = [ 1, 2, 3 ];
154
+ * const result = await DyFM_Array.asyncMap(list, async (element: number, index?: number, array?: number[]): Promise<number> => {
155
+ * return element * 2;
156
+ * });
157
+ * console.log(result); // [ 2, 4, 6 ]
158
+ * ```
108
159
  */
109
160
  static async asyncMap<T, R>(
110
161
  list: T[],
@@ -123,6 +174,13 @@ export class DyFM_Array {
123
174
  * Returns the last element of an array.
124
175
  * @param array - The array to get the last element from.
125
176
  * @returns The last element of the array, or null if the array is empty.
177
+ *
178
+ * @example
179
+ * ```ts
180
+ * const list: number[] = [ 1, 2, 3 ];
181
+ * const result = DyFM_Array.last(list);
182
+ * console.log(result); // 3
183
+ * ```
126
184
  */
127
185
  static last<T>(array: T[]): T | null {
128
186
  return array?.length ? array[array.length - 1] : null;
@@ -133,6 +191,13 @@ export class DyFM_Array {
133
191
  * @param string - The string to check.
134
192
  * @param array - The array to check.
135
193
  * @returns True if the string is the last element of the array, false otherwise.
194
+ *
195
+ * @example
196
+ * ```ts
197
+ * const list: number[] = [ 1, 2, 3 ];
198
+ * const result = DyFM_Array.isLast(3, list);
199
+ * console.log(result); // true
200
+ * ```
136
201
  */
137
202
  static isLast<T>(element: T, array: T[]): boolean {
138
203
  return array.indexOf(element) === array.length - 1;
@@ -143,6 +208,13 @@ export class DyFM_Array {
143
208
  * @param string - The string to check.
144
209
  * @param array - The array to check.
145
210
  * @returns True if the string is the last element of the array, false otherwise.
211
+ *
212
+ * @example
213
+ * ```ts
214
+ * const list: number[] = [ 1, 2, 3 ];
215
+ * const result = DyFM_Array.isLastIndex(2, list);
216
+ * console.log(result); // true
217
+ * ```
146
218
  */
147
219
  static isLastIndex<T>(index: number, array: T[]): boolean {
148
220
  return index === array.length - 1;
@@ -153,6 +225,13 @@ export class DyFM_Array {
153
225
  * @param string - The string to check.
154
226
  * @param array - The array to check.
155
227
  * @returns True if the string is the first element of the array, false otherwise.
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * const list: number[] = [ 1, 2, 3 ];
232
+ * const result = DyFM_Array.isFirst(1, list);
233
+ * console.log(result); // true
234
+ * ```
156
235
  */
157
236
  static isFirst<T>(element: T, array: T[]): boolean {
158
237
  return array.indexOf(element) === 0;
@@ -162,6 +241,13 @@ export class DyFM_Array {
162
241
  * Returns the last character of a string.
163
242
  * @param string - The string to get the last character from.
164
243
  * @returns The last character of the string, or null if the string is empty.
244
+ *
245
+ * @example
246
+ * ```ts
247
+ * const string = 'hello';
248
+ * const result = DyFM_Array.lastCharacter(string);
249
+ * console.log(result); // 'o'
250
+ * ```
165
251
  */
166
252
  static lastCharacter(string: string): string | null {
167
253
  return string?.length ? string[string.length - 1] : null;
@@ -171,6 +257,13 @@ export class DyFM_Array {
171
257
  * Returns the first element of an array.
172
258
  * @param array - The array to get the first element from.
173
259
  * @returns The first element of the array, or null if the array is empty.
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * const list: number[] = [ 1, 2, 3 ];
264
+ * const result = DyFM_Array.first(list);
265
+ * console.log(result); // 1
266
+ * ```
174
267
  */
175
268
  static first<T>(array: T[]): T | null {
176
269
  return array?.length ? array[0] : null;
@@ -181,6 +274,13 @@ export class DyFM_Array {
181
274
  * @param array - The array to remove the element from.
182
275
  * @param element - The element to remove from the array.
183
276
  * @returns The array with the element removed.
277
+ *
278
+ * @example
279
+ * ```ts
280
+ * const list: number[] = [ 1, 2, 3 ];
281
+ * const result = DyFM_Array.remove(list, 2);
282
+ * console.log(result); // [ 1, 3 ]
283
+ * ```
184
284
  */
185
285
  static remove<T>(array: T[], element: T): T[] {
186
286
  const index = array.indexOf(element);
@@ -197,6 +297,15 @@ export class DyFM_Array {
197
297
  * @param array - The array to find and remove the element from.
198
298
  * @param func - The function to apply to each element.
199
299
  * @returns The array with the element removed.
300
+ *
301
+ * @example
302
+ * ```ts
303
+ * const list: number[] = [ 1, 2, 3 ];
304
+ * const result = DyFM_Array.findNRemove(list, (element: number, index?: number, array?: number[]): boolean => {
305
+ * return element === 2;
306
+ * });
307
+ * console.log(result); // [ 1, 3 ]
308
+ * ```
200
309
  */
201
310
  static findNRemove<T>(
202
311
  array: T[],
@@ -215,6 +324,13 @@ export class DyFM_Array {
215
324
  * Shuffles an array.
216
325
  * @param array - The array to shuffle.
217
326
  * @returns The shuffled array.
327
+ *
328
+ * @example
329
+ * ```ts
330
+ * const list: number[] = [ 1, 2, 3 ];
331
+ * const result = DyFM_Array.shuffle(list);
332
+ * console.log(result); // [ 3, 1, 2 ]
333
+ * ```
218
334
  */
219
335
  static shuffle<T>(array: T[]): T[] {
220
336
  let currentIndex = array.length;
@@ -236,6 +352,13 @@ export class DyFM_Array {
236
352
  * @param pageIndex - The index of the page to return.
237
353
  * @param pageSize - The size of the page.
238
354
  * @returns The page of the array.
355
+ *
356
+ * @example
357
+ * ```ts
358
+ * const list: number[] = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
359
+ * const result = DyFM_Array.page(list, 0, 2);
360
+ * console.log(result); // [ 1, 2 ]
361
+ * ```
239
362
  */
240
363
  static page<T>(array: T[], pageIndex: number, pageSize: number): T[] {
241
364
  return array.slice(pageIndex * pageSize, (pageIndex + 1) * pageSize);
@@ -247,6 +370,13 @@ export class DyFM_Array {
247
370
  * @param pageIndex - The index of the page to return.
248
371
  * @param pageSize - The size of the page.
249
372
  * @returns The page of the array.
373
+ *
374
+ * @example
375
+ * ```ts
376
+ * const list: number[] = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
377
+ * const result = DyFM_Array.paged(list, 0, 2);
378
+ * console.log(result); // { pageIndex: 0, pageSize: 2, total: 8, totalPageCount: 4, items: [ 1, 2 ] }
379
+ * ```
250
380
  */
251
381
  static paged<T>(array: T[], pageIndex: number, pageSize: number): DyFM_Paged<T> {
252
382
  return {
@@ -264,6 +394,13 @@ export class DyFM_Array {
264
394
  * @param indexA - The index of the first element to swap.
265
395
  * @param indexB - The index of the second element to swap.
266
396
  * @returns The array with the elements swapped.
397
+ *
398
+ * @example
399
+ * ```ts
400
+ * const list: number[] = [ 1, 2, 3 ];
401
+ * const result = DyFM_Array.swap(list, 0, 2);
402
+ * console.log(result); // [ 3, 2, 1 ]
403
+ * ```
267
404
  */
268
405
  static swap<T>(array: T[], indexA: number, indexB: number): T[] {
269
406
  [ array[indexA], array[indexB] ] = [ array[indexB], array[indexA] ];
@@ -275,6 +412,13 @@ export class DyFM_Array {
275
412
  * Checks if a string list has multiplications.
276
413
  * @param stringList - The string list to check.
277
414
  * @returns True if the string list has multiplications, false otherwise.
415
+ *
416
+ * @example
417
+ * ```ts
418
+ * const list: string[] = [ 'a', 'b', 'c', 'a' ];
419
+ * const result = DyFM_Array.stringListHasMultiplications(list);
420
+ * console.log(result); // true
421
+ * ```
278
422
  */
279
423
  static stringListHasMultiplications(stringList: string[]): boolean {
280
424
  return stringList.some((str: string, index: number): boolean => {
@@ -286,6 +430,13 @@ export class DyFM_Array {
286
430
  * Filters a string list to remove multiplications.
287
431
  * @param stringList - The string list to filter.
288
432
  * @returns The filtered string list.
433
+ *
434
+ * @example
435
+ * ```ts
436
+ * const list: string[] = [ 'a', 'b', 'c', 'a' ];
437
+ * const result = DyFM_Array.filterStringMultiplications(list);
438
+ * console.log(result); // [ 'a', 'b', 'c' ]
439
+ * ```
289
440
  */
290
441
  static filterStringMultiplications(stringList: string[]): string[] {
291
442
  return stringList.filter((str: string, index: number): boolean => {
@@ -297,6 +448,13 @@ export class DyFM_Array {
297
448
  * Gathers multiplications from a string list.
298
449
  * @param stringList - The string list to gather multiplications from.
299
450
  * @returns The gathered multiplications.
451
+ *
452
+ * @example
453
+ * ```ts
454
+ * const list: string[] = [ 'a', 'b', 'c', 'a' ];
455
+ * const result = DyFM_Array.gatherStringMultiplications(list);
456
+ * console.log(result); // [ [ 'a', 'a' ] ]
457
+ * ```
300
458
  */
301
459
  static gatherStringMultiplications(stringList: string[]): string[][] {
302
460
  const multiplications: string[][] = [];
@@ -323,6 +481,13 @@ export class DyFM_Array {
323
481
  * @param dataList - The data list to check.
324
482
  * @param byKey - The key to check for multiplications.
325
483
  * @returns True if the data list has multiplications, false otherwise.
484
+ *
485
+ * @example
486
+ * ```ts
487
+ * const list: { _id: number, name: string }[] = [ { _id: 1, name: 'John' }, { _id: 2, name: 'Jane' }, { _id: 1, name: 'Bob' } ];
488
+ * const result = DyFM_Array.haveMultiplications(list, '_id');
489
+ * console.log(result); // true
490
+ * ```
326
491
  */
327
492
  static haveMultiplications<T extends object>(dataList: T[], byKey: keyof T = '_id' as keyof T): boolean {
328
493
  return dataList.some((data: T, index: number): boolean => {
@@ -337,6 +502,13 @@ export class DyFM_Array {
337
502
  * @param dataList - The data list to filter.
338
503
  * @param byKey - The key to filter for multiplications.
339
504
  * @returns The filtered data list.
505
+ *
506
+ * @example
507
+ * ```ts
508
+ * const list: { _id: number, name: string }[] = [ { _id: 1, name: 'John' }, { _id: 2, name: 'Jane' }, { _id: 1, name: 'Bob' } ];
509
+ * const result = DyFM_Array.filterMultiplications(list, '_id');
510
+ * console.log(result); // [ { _id: 1, name: 'John' } , { _id: 2, name: 'Jane' } ]
511
+ * ```
340
512
  */
341
513
  static filterMultiplications<T extends object>(dataList: T[], byKey: keyof T = '_id' as keyof T): T[] {
342
514
  return dataList.filter((data: T, index: number): boolean => {
@@ -351,6 +523,13 @@ export class DyFM_Array {
351
523
  * @param dataList - The data list to gather multiplications from.
352
524
  * @param byKey - The key to gather multiplications from.
353
525
  * @returns The gathered multiplications.
526
+ *
527
+ * @example
528
+ * ```ts
529
+ * const list: { _id: number, name: string }[] = [ { _id: 1, name: 'John' }, { _id: 2, name: 'Jane' }, { _id: 1, name: 'Bob' } ];
530
+ * const result = DyFM_Array.gatherMultiplications(list, '_id');
531
+ * console.log(result); // [ [ { _id: 1, name: 'John' }, { _id: 1, name: 'Bob' } ] ]
532
+ * ```
354
533
  */
355
534
  static gatherMultiplications<T extends object>(dataList: T[], byKey: keyof T = '_id' as keyof T): T[][] {
356
535
  const multiplications: T[][] = [];
@@ -375,6 +554,15 @@ export class DyFM_Array {
375
554
  * @param array - The array to find the element in.
376
555
  * @param func - The function to apply to each element.
377
556
  * @returns The element found, or null if no element is found.
557
+ *
558
+ * @example
559
+ * ```ts
560
+ * const list: number[] = [ 1, 2, 3 ];
561
+ * const result = DyFM_Array.findFromEnd(list, (element: number, index?: number, array?: number[]): boolean => {
562
+ * return element === 2;
563
+ * });
564
+ * console.log(result); // 2
565
+ * ```
378
566
  */
379
567
  static findFromEnd<T>(
380
568
  array: T[],
@@ -395,6 +583,7 @@ export class DyFM_Array {
395
583
  * sorts so that the objects that have the value true for the checkFor function are at the beginning of the array
396
584
  * @param checkFor
397
585
  * @returns
586
+ *
398
587
  */
399
588
  static getSortForTrueFn<T>(
400
589
  checkFor: (a: T) => boolean
@@ -10,6 +10,11 @@ export class DyFM_Async {
10
10
  * delays the execution of a function
11
11
  * @param ms
12
12
  * @returns
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * await DyFM_Async.wait(1000);
17
+ * ```
13
18
  */
14
19
  static wait(ms: number): Promise<void> {
15
20
  return new Promise((resolve): any => setTimeout(resolve, ms));
@@ -20,6 +25,11 @@ export class DyFM_Async {
20
25
  /**
21
26
  * WARNING: This function is recommended to use ONLY for limited instances,
22
27
  * because it can cause performance issues.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * await DyFM_Async.waitUntil(() => check(), 100, 10000);
32
+ * ```
23
33
  */
24
34
  static waitUntil(
25
35
  check: () => boolean,
@@ -80,6 +90,14 @@ export class DyFM_Async {
80
90
 
81
91
  /**
82
92
  * Creates a promise that resolves when the observable emits a value that passes the check function
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const observable = new Observable<number>(observer => {
97
+ * setInterval(() => observer.next(Math.random()), 100);
98
+ * });
99
+ * const result = await DyFM_Async.takeUntil(observable, (value?: number) => value && value > 0.5);
100
+ * ```
83
101
  */
84
102
  static takeUntil<T>(
85
103
  observable: Observable<T>,
@@ -97,6 +115,17 @@ export class DyFM_Async {
97
115
  });
98
116
  }
99
117
 
118
+ /**
119
+ * Waits for a given amount of time and logs the remaining time.
120
+ * @param totalWaitTimeMs - The total amount of time to wait.
121
+ * @param context - The context of the countdown.
122
+ * @returns A promise that resolves when the countdown is complete.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * await DyFM_Async.waitWithCountdownLogging(1000, 'Countdown');
127
+ * ```
128
+ */
100
129
  static async waitWithCountdownLogging(
101
130
  totalWaitTimeMs: number,
102
131
  context: string = 'Countdown'
@@ -105,6 +134,17 @@ export class DyFM_Async {
105
134
  const endTime = startTime + totalWaitTimeMs;
106
135
 
107
136
  // Define logging intervals based on total duration
137
+ /**
138
+ * Gets the logging interval based on the total duration.
139
+ * @param totalMs - The total duration in milliseconds.
140
+ * @returns The logging interval in milliseconds.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const logInterval = getLogInterval(1000);
145
+ * console.log(logInterval); // 1000
146
+ * ```
147
+ */
108
148
  const getLogInterval = (totalMs: number): number => {
109
149
  const totalSeconds = totalMs / second;
110
150
  const totalMinutes = totalSeconds / 60;
@@ -32,6 +32,12 @@ export class DyFM_JsonErrorHelper {
32
32
  * @param jsonInput - The original JSON input string
33
33
  * @param contextLines - Number of context lines to show before and after the error (default: 5)
34
34
  * @returns Object containing line number, context lines, and character position, or null if parsing fails
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const lineInfo = DyFM_JsonErrorHelper.extractLineInfoFromJsonError('Expected property name or "}" in JSON at position 10', '{"name": "John", "age": 30}', 5);
39
+ * console.log(lineInfo); // { lineNumber: 1, contextLines: [ '{"name": "John", "age": 30}' ], characterPosition: 10 }
40
+ * ```
35
41
  */
36
42
  static extractLineInfoFromJsonError(
37
43
  errorMessage: string,
@@ -86,6 +92,16 @@ export class DyFM_JsonErrorHelper {
86
92
 
87
93
  /**
88
94
  * Helper method to create line info from a character position
95
+ * @param jsonInput - The original JSON input string
96
+ * @param position - The character position where the error occurred
97
+ * @param contextLines - Number of context lines to show before and after the error (default: 5)
98
+ * @returns Object containing line number, context lines, and character position
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const lineInfo = DyFM_JsonErrorHelper.createLineInfoFromPosition('{"name": "John", "age": 30}', 10, 5);
103
+ * console.log(lineInfo); // { lineNumber: 1, contextLines: [ '{"name": "John", "age": 30}' ], characterPosition: 10 }
104
+ * ```
89
105
  */
90
106
  private static createLineInfoFromPosition(
91
107
  jsonInput: string,
@@ -152,6 +168,12 @@ export class DyFM_JsonErrorHelper {
152
168
  * @param lineInfo - The line information extracted from the error
153
169
  * @param errorMessage - The original error message
154
170
  * @returns Formatted error string for logging
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * const logLines = DyFM_JsonErrorHelper.formatJsonErrorForLogging({ lineNumber: 1, contextLines: [ '{"name": "John", "age": 30}' ], characterPosition: 10 }, 'Expected property name or "}" in JSON at position 10');
175
+ * console.log(logLines); // [ 'JSON parsing failed: Expected property name or "}" in JSON at position 10', 'Error at line 1, character 10:', 'Context (1 lines):', ' 1: {"name": "John", "age": 30}' ]
176
+ * ```
155
177
  */
156
178
  static formatJsonErrorForLogging(
157
179
  lineInfo: JsonErrorLineInfo,
@@ -185,6 +207,13 @@ export class DyFM_JsonErrorHelper {
185
207
  * @param contextLines - Number of context lines to show in error (default: 5)
186
208
  * @returns Parsed JSON object
187
209
  * @throws Error with detailed line information if parsing fails
210
+ *
211
+ * @example
212
+ * ```ts
213
+ * const json = '{"name": "John", "age": 30}';
214
+ * const result = DyFM_JsonErrorHelper.parseJsonWithEnhancedError(json);
215
+ * console.log(result); // { name: 'John', age: 30 }
216
+ * ```
188
217
  */
189
218
  static parseJsonWithEnhancedError(
190
219
  jsonString: string,
@@ -225,6 +254,7 @@ export class DyFM_JsonErrorHelper {
225
254
 
226
255
  if (lineInfo) {
227
256
  const formattedError = this.formatJsonErrorForLogging(lineInfo, errorMessage);
257
+
228
258
  throw new Error(`JSON parsing failed:\n${formattedError.join('\n')}`);
229
259
  } else {
230
260
  // Fallback to simple error if we can't extract line info
@@ -235,6 +265,15 @@ export class DyFM_JsonErrorHelper {
235
265
 
236
266
  /**
237
267
  * Formats single-line JSON with line breaks for better error reporting
268
+ * @param jsonString - The JSON string to format
269
+ * @returns The formatted JSON string
270
+ *
271
+ * @example
272
+ * ```ts
273
+ * const json = '{"name": "John", "age": 30, "city": "New York"}';
274
+ * const result = DyFM_JsonErrorHelper.formatJsonForBetterErrors(json);
275
+ * console.log(result); // '{\n "name": "John",\n "age": 30,\n "city": "New York"\n}'
276
+ * ```
238
277
  */
239
278
  private static formatJsonForBetterErrors(jsonString: string): string {
240
279
  if (!jsonString || typeof jsonString !== 'string') {
@@ -248,14 +287,15 @@ export class DyFM_JsonErrorHelper {
248
287
  .replace(/\[/g, '[\n ')
249
288
  .replace(/\]/g, '\n]')
250
289
  .replace(/\n\s*\n/g, '\n') // Remove double newlines
251
- .replace(/^\s+|\s+$/gm, function(match, offset, string) {
290
+ .replace(/^\s+|\s+$/gm, function(match: string, offset: number, string: string): string {
252
291
  // Trim but preserve indentation structure
253
292
  if (!string || typeof string !== 'string') {
254
293
  return match;
255
294
  }
256
- const lines = string.slice(0, offset).split('\n');
257
- const depth = (string.slice(0, offset).match(/{|\[/g) || []).length -
295
+ const lines: string[] = string.slice(0, offset).split('\n');
296
+ const depth: number = (string.slice(0, offset).match(/{|\[/g) || []).length -
258
297
  (string.slice(0, offset).match(/}|\]/g) || []).length;
298
+
259
299
  return ' '.repeat(Math.max(0, depth));
260
300
  });
261
301
  }