@temboplus/frontend-core 0.2.10 → 0.2.11

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 (425) hide show
  1. package/README.md +1 -1
  2. package/dist/constants/index.d.ts +1 -0
  3. package/dist/constants/payout-countries.d.ts +2 -0
  4. package/dist/index.cjs.js +8 -0
  5. package/dist/index.cjs.js.map +1 -0
  6. package/dist/index.d.ts +5 -0
  7. package/dist/index.esm.js +5 -0
  8. package/dist/index.esm.js.map +1 -0
  9. package/dist/models/amount/amount.d.ts +733 -0
  10. package/dist/models/amount/index.d.ts +1 -0
  11. package/dist/models/bank/bank.d.ts +106 -0
  12. package/dist/models/bank/bank.schema.d.ts +3 -0
  13. package/{esm/src/models/bank/types.d.ts → dist/models/bank/bank.types.d.ts} +4 -6
  14. package/dist/models/bank/bank.validation.d.ts +80 -0
  15. package/dist/models/bank/index.d.ts +4 -0
  16. package/{script/src → dist}/models/country/country.d.ts +11 -5
  17. package/dist/models/country/country.schema.d.ts +46 -0
  18. package/{script/src/models/country/types.d.ts → dist/models/country/country.types.d.ts} +0 -1
  19. package/{esm/src/models/country/utils.js → dist/models/country/country.validation.d.ts} +11 -10
  20. package/dist/models/country/index.d.ts +4 -0
  21. package/{script/src → dist}/models/currency/currency.d.ts +2 -3
  22. package/dist/models/currency/currency.schema.d.ts +8 -0
  23. package/{esm/src/models/currency/types.d.ts → dist/models/currency/currency.types.d.ts} +1 -2
  24. package/dist/models/currency/currency.validation.d.ts +11 -0
  25. package/dist/models/currency/index.d.ts +4 -0
  26. package/dist/models/index.d.ts +5 -0
  27. package/dist/models/phone-number/index.d.ts +6 -0
  28. package/dist/models/phone-number/mno/index.d.ts +6 -0
  29. package/dist/models/phone-number/mno/ke/mobile-number.ke-mnos.d.ts +22 -0
  30. package/dist/models/phone-number/mno/ke/mobile-number.ke.d.ts +45 -0
  31. package/dist/models/phone-number/mno/mno.types.d.ts +63 -0
  32. package/dist/models/phone-number/mno/mno.utils.d.ts +40 -0
  33. package/dist/models/phone-number/mno/tz/mobile-number.tz-mnos.d.ts +48 -0
  34. package/dist/models/phone-number/mno/tz/mobile-number.tz.d.ts +44 -0
  35. package/dist/models/phone-number/phone-number.d.ts +78 -0
  36. package/dist/models/phone-number/phone-number.factory.d.ts +52 -0
  37. package/dist/models/phone-number/phone-number.service.d.ts +36 -0
  38. package/dist/models/phone-number/phone-number.types.d.ts +115 -0
  39. package/dist/models/phone-number/phone-number.utils.d.ts +67 -0
  40. package/dist/reports/index.d.ts +1 -0
  41. package/{script/src/reports/report_manager.d.ts → dist/reports/report-manager.d.ts} +0 -1
  42. package/{esm/src/config/config_service.d.ts → dist/services/config.d.ts} +6 -5
  43. package/dist/services/index.d.ts +2 -0
  44. package/dist/services/logger.d.ts +1 -0
  45. package/{script/src → dist}/utils/id.d.ts +7 -3
  46. package/dist/utils/index.d.ts +3 -0
  47. package/{esm/src → dist}/utils/text.d.ts +13 -6
  48. package/{script/src → dist}/utils/time.d.ts +9 -4
  49. package/package.json +55 -21
  50. package/LICENSE +0 -7
  51. package/esm/_dnt.test_shims.d.ts.map +0 -1
  52. package/esm/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +0 -1
  53. package/esm/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +0 -1
  54. package/esm/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +0 -1
  55. package/esm/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +0 -1
  56. package/esm/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +0 -1
  57. package/esm/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +0 -1
  58. package/esm/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +0 -1
  59. package/esm/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +0 -1
  60. package/esm/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +0 -1
  61. package/esm/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +0 -1
  62. package/esm/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +0 -1
  63. package/esm/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +0 -1
  64. package/esm/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +0 -1
  65. package/esm/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +0 -1
  66. package/esm/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +0 -1
  67. package/esm/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +0 -1
  68. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +0 -1
  69. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +0 -1
  70. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +0 -1
  71. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +0 -1
  72. package/esm/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +0 -1
  73. package/esm/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +0 -1
  74. package/esm/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +0 -1
  75. package/esm/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +0 -1
  76. package/esm/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +0 -1
  77. package/esm/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +0 -1
  78. package/esm/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +0 -1
  79. package/esm/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +0 -1
  80. package/esm/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +0 -1
  81. package/esm/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +0 -1
  82. package/esm/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +0 -1
  83. package/esm/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +0 -1
  84. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  85. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  86. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  87. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  88. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  89. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  90. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  91. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  92. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  93. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  94. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  95. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  96. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  97. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  98. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  99. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  100. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  101. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  102. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  103. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  104. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  105. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  106. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  107. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  108. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  109. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  110. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  111. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  112. package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
  113. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  114. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  115. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  116. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  117. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  118. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  119. package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
  120. package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
  121. package/esm/mod.d.ts +0 -5
  122. package/esm/mod.d.ts.map +0 -1
  123. package/esm/mod.js +0 -4
  124. package/esm/package.json +0 -3
  125. package/esm/src/config/config_service.d.ts.map +0 -1
  126. package/esm/src/config/config_service.js +0 -19
  127. package/esm/src/config/index.d.ts +0 -2
  128. package/esm/src/config/index.d.ts.map +0 -1
  129. package/esm/src/config/index.js +0 -1
  130. package/esm/src/data/banks_tz.d.ts +0 -7
  131. package/esm/src/data/banks_tz.d.ts.map +0 -1
  132. package/esm/src/data/banks_tz.js +0 -197
  133. package/esm/src/data/countries.d.ts +0 -39
  134. package/esm/src/data/countries.d.ts.map +0 -1
  135. package/esm/src/data/countries.js +0 -2475
  136. package/esm/src/data/currencies.d.ts +0 -1901
  137. package/esm/src/data/currencies.d.ts.map +0 -1
  138. package/esm/src/data/currencies.js +0 -1073
  139. package/esm/src/data/phone_patterns.d.ts +0 -3809
  140. package/esm/src/data/phone_patterns.d.ts.map +0 -1
  141. package/esm/src/data/phone_patterns.js +0 -2325
  142. package/esm/src/models/amount/amount.d.ts +0 -53
  143. package/esm/src/models/amount/amount.d.ts.map +0 -1
  144. package/esm/src/models/amount/amount.js +0 -190
  145. package/esm/src/models/amount/amount.test.d.ts.map +0 -1
  146. package/esm/src/models/amount/antd_validator.d.ts +0 -40
  147. package/esm/src/models/amount/antd_validator.d.ts.map +0 -1
  148. package/esm/src/models/amount/antd_validator.js +0 -58
  149. package/esm/src/models/amount/antd_validator.test.d.ts.map +0 -1
  150. package/esm/src/models/amount/index.d.ts +0 -3
  151. package/esm/src/models/amount/index.d.ts.map +0 -1
  152. package/esm/src/models/amount/index.js +0 -2
  153. package/esm/src/models/bank/antd_validator.d.ts +0 -11
  154. package/esm/src/models/bank/antd_validator.d.ts.map +0 -1
  155. package/esm/src/models/bank/antd_validator.js +0 -26
  156. package/esm/src/models/bank/antd_validator.test.d.ts.map +0 -1
  157. package/esm/src/models/bank/bank.d.ts +0 -257
  158. package/esm/src/models/bank/bank.d.ts.map +0 -1
  159. package/esm/src/models/bank/bank.js +0 -450
  160. package/esm/src/models/bank/bank.test.d.ts.map +0 -1
  161. package/esm/src/models/bank/index.d.ts +0 -5
  162. package/esm/src/models/bank/index.d.ts.map +0 -1
  163. package/esm/src/models/bank/index.js +0 -4
  164. package/esm/src/models/bank/types.d.ts.map +0 -1
  165. package/esm/src/models/bank/types.js +0 -45
  166. package/esm/src/models/bank/utils.d.ts +0 -8
  167. package/esm/src/models/bank/utils.d.ts.map +0 -1
  168. package/esm/src/models/bank/utils.js +0 -9
  169. package/esm/src/models/country/country.d.ts +0 -822
  170. package/esm/src/models/country/country.d.ts.map +0 -1
  171. package/esm/src/models/country/country.js +0 -737
  172. package/esm/src/models/country/country.test.d.ts.map +0 -1
  173. package/esm/src/models/country/index.d.ts +0 -4
  174. package/esm/src/models/country/index.d.ts.map +0 -1
  175. package/esm/src/models/country/index.js +0 -3
  176. package/esm/src/models/country/types.d.ts +0 -63
  177. package/esm/src/models/country/types.d.ts.map +0 -1
  178. package/esm/src/models/country/types.js +0 -105
  179. package/esm/src/models/country/utils.d.ts +0 -21
  180. package/esm/src/models/country/utils.d.ts.map +0 -1
  181. package/esm/src/models/currency/currency.d.ts +0 -465
  182. package/esm/src/models/currency/currency.d.ts.map +0 -1
  183. package/esm/src/models/currency/currency.js +0 -471
  184. package/esm/src/models/currency/currency.test.d.ts.map +0 -1
  185. package/esm/src/models/currency/index.d.ts +0 -4
  186. package/esm/src/models/currency/index.d.ts.map +0 -1
  187. package/esm/src/models/currency/index.js +0 -3
  188. package/esm/src/models/currency/types.d.ts.map +0 -1
  189. package/esm/src/models/currency/types.js +0 -28
  190. package/esm/src/models/currency/utils.d.ts +0 -8
  191. package/esm/src/models/currency/utils.d.ts.map +0 -1
  192. package/esm/src/models/currency/utils.js +0 -9
  193. package/esm/src/models/index.d.ts +0 -6
  194. package/esm/src/models/index.d.ts.map +0 -1
  195. package/esm/src/models/index.js +0 -5
  196. package/esm/src/models/phone_number/format.d.ts +0 -13
  197. package/esm/src/models/phone_number/format.d.ts.map +0 -1
  198. package/esm/src/models/phone_number/format.js +0 -13
  199. package/esm/src/models/phone_number/global/phone_number.d.ts +0 -162
  200. package/esm/src/models/phone_number/global/phone_number.d.ts.map +0 -1
  201. package/esm/src/models/phone_number/global/phone_number.js +0 -459
  202. package/esm/src/models/phone_number/global/phone_number.test.d.ts.map +0 -1
  203. package/esm/src/models/phone_number/global/service.d.ts +0 -267
  204. package/esm/src/models/phone_number/global/service.d.ts.map +0 -1
  205. package/esm/src/models/phone_number/global/service.js +0 -498
  206. package/esm/src/models/phone_number/global/service.test.d.ts.map +0 -1
  207. package/esm/src/models/phone_number/index.d.ts +0 -6
  208. package/esm/src/models/phone_number/index.d.ts.map +0 -1
  209. package/esm/src/models/phone_number/index.js +0 -5
  210. package/esm/src/models/phone_number/tz/antd_validator.d.ts +0 -77
  211. package/esm/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
  212. package/esm/src/models/phone_number/tz/antd_validator.js +0 -90
  213. package/esm/src/models/phone_number/tz/antdvalidator.test.d.ts.map +0 -1
  214. package/esm/src/models/phone_number/tz/network_operator.d.ts +0 -30
  215. package/esm/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
  216. package/esm/src/models/phone_number/tz/network_operator.js +0 -47
  217. package/esm/src/models/phone_number/tz/phone_number.d.ts +0 -141
  218. package/esm/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
  219. package/esm/src/models/phone_number/tz/phone_number.js +0 -290
  220. package/esm/src/models/phone_number/tz/phone_number.test.d.ts.map +0 -1
  221. package/esm/src/reports/index.d.ts +0 -2
  222. package/esm/src/reports/index.d.ts.map +0 -1
  223. package/esm/src/reports/index.js +0 -1
  224. package/esm/src/reports/report_manager.d.ts +0 -144
  225. package/esm/src/reports/report_manager.d.ts.map +0 -1
  226. package/esm/src/reports/report_manager.js +0 -318
  227. package/esm/src/utils/id.d.ts +0 -12
  228. package/esm/src/utils/id.d.ts.map +0 -1
  229. package/esm/src/utils/id.js +0 -19
  230. package/esm/src/utils/index.d.ts +0 -4
  231. package/esm/src/utils/index.d.ts.map +0 -1
  232. package/esm/src/utils/index.js +0 -3
  233. package/esm/src/utils/text.d.ts.map +0 -1
  234. package/esm/src/utils/text.js +0 -68
  235. package/esm/src/utils/text.test.d.ts.map +0 -1
  236. package/esm/src/utils/time.d.ts +0 -21
  237. package/esm/src/utils/time.d.ts.map +0 -1
  238. package/esm/src/utils/time.js +0 -34
  239. package/script/_dnt.test_shims.d.ts.map +0 -1
  240. package/script/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +0 -1
  241. package/script/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +0 -1
  242. package/script/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +0 -1
  243. package/script/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +0 -1
  244. package/script/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +0 -1
  245. package/script/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +0 -1
  246. package/script/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +0 -1
  247. package/script/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +0 -1
  248. package/script/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +0 -1
  249. package/script/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +0 -1
  250. package/script/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +0 -1
  251. package/script/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +0 -1
  252. package/script/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +0 -1
  253. package/script/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +0 -1
  254. package/script/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +0 -1
  255. package/script/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +0 -1
  256. package/script/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +0 -1
  257. package/script/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +0 -1
  258. package/script/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +0 -1
  259. package/script/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +0 -1
  260. package/script/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +0 -1
  261. package/script/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +0 -1
  262. package/script/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +0 -1
  263. package/script/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +0 -1
  264. package/script/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +0 -1
  265. package/script/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +0 -1
  266. package/script/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +0 -1
  267. package/script/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +0 -1
  268. package/script/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +0 -1
  269. package/script/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +0 -1
  270. package/script/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +0 -1
  271. package/script/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +0 -1
  272. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  273. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  274. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  275. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  276. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  277. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  278. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  279. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  280. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  281. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  282. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  283. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  284. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  285. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  286. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  287. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  288. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  289. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  290. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  291. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  292. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  293. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  294. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  295. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  296. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  297. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  298. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  299. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  300. package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
  301. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  302. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  303. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  304. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  305. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  306. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  307. package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
  308. package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
  309. package/script/mod.d.ts +0 -5
  310. package/script/mod.d.ts.map +0 -1
  311. package/script/mod.js +0 -20
  312. package/script/package.json +0 -3
  313. package/script/src/config/config_service.d.ts +0 -11
  314. package/script/src/config/config_service.d.ts.map +0 -1
  315. package/script/src/config/config_service.js +0 -23
  316. package/script/src/config/index.d.ts +0 -2
  317. package/script/src/config/index.d.ts.map +0 -1
  318. package/script/src/config/index.js +0 -17
  319. package/script/src/data/banks_tz.d.ts +0 -7
  320. package/script/src/data/banks_tz.d.ts.map +0 -1
  321. package/script/src/data/banks_tz.js +0 -199
  322. package/script/src/data/countries.d.ts +0 -39
  323. package/script/src/data/countries.d.ts.map +0 -1
  324. package/script/src/data/countries.js +0 -2477
  325. package/script/src/data/currencies.d.ts +0 -1901
  326. package/script/src/data/currencies.d.ts.map +0 -1
  327. package/script/src/data/currencies.js +0 -1075
  328. package/script/src/data/phone_patterns.d.ts +0 -3809
  329. package/script/src/data/phone_patterns.d.ts.map +0 -1
  330. package/script/src/data/phone_patterns.js +0 -2327
  331. package/script/src/models/amount/amount.d.ts +0 -53
  332. package/script/src/models/amount/amount.d.ts.map +0 -1
  333. package/script/src/models/amount/amount.js +0 -194
  334. package/script/src/models/amount/amount.test.d.ts.map +0 -1
  335. package/script/src/models/amount/antd_validator.d.ts +0 -40
  336. package/script/src/models/amount/antd_validator.d.ts.map +0 -1
  337. package/script/src/models/amount/antd_validator.js +0 -62
  338. package/script/src/models/amount/antd_validator.test.d.ts.map +0 -1
  339. package/script/src/models/amount/index.d.ts +0 -3
  340. package/script/src/models/amount/index.d.ts.map +0 -1
  341. package/script/src/models/amount/index.js +0 -18
  342. package/script/src/models/bank/antd_validator.d.ts +0 -11
  343. package/script/src/models/bank/antd_validator.d.ts.map +0 -1
  344. package/script/src/models/bank/antd_validator.js +0 -30
  345. package/script/src/models/bank/antd_validator.test.d.ts.map +0 -1
  346. package/script/src/models/bank/bank.d.ts +0 -257
  347. package/script/src/models/bank/bank.d.ts.map +0 -1
  348. package/script/src/models/bank/bank.js +0 -458
  349. package/script/src/models/bank/bank.test.d.ts.map +0 -1
  350. package/script/src/models/bank/index.d.ts +0 -5
  351. package/script/src/models/bank/index.d.ts.map +0 -1
  352. package/script/src/models/bank/index.js +0 -20
  353. package/script/src/models/bank/types.d.ts +0 -7
  354. package/script/src/models/bank/types.d.ts.map +0 -1
  355. package/script/src/models/bank/types.js +0 -48
  356. package/script/src/models/bank/utils.d.ts +0 -8
  357. package/script/src/models/bank/utils.d.ts.map +0 -1
  358. package/script/src/models/bank/utils.js +0 -12
  359. package/script/src/models/country/country.d.ts.map +0 -1
  360. package/script/src/models/country/country.js +0 -745
  361. package/script/src/models/country/country.test.d.ts.map +0 -1
  362. package/script/src/models/country/index.d.ts +0 -4
  363. package/script/src/models/country/index.d.ts.map +0 -1
  364. package/script/src/models/country/index.js +0 -19
  365. package/script/src/models/country/types.d.ts.map +0 -1
  366. package/script/src/models/country/types.js +0 -108
  367. package/script/src/models/country/utils.d.ts +0 -21
  368. package/script/src/models/country/utils.d.ts.map +0 -1
  369. package/script/src/models/country/utils.js +0 -30
  370. package/script/src/models/currency/currency.d.ts.map +0 -1
  371. package/script/src/models/currency/currency.js +0 -479
  372. package/script/src/models/currency/currency.test.d.ts.map +0 -1
  373. package/script/src/models/currency/index.d.ts +0 -4
  374. package/script/src/models/currency/index.d.ts.map +0 -1
  375. package/script/src/models/currency/index.js +0 -19
  376. package/script/src/models/currency/types.d.ts +0 -21
  377. package/script/src/models/currency/types.d.ts.map +0 -1
  378. package/script/src/models/currency/types.js +0 -31
  379. package/script/src/models/currency/utils.d.ts +0 -8
  380. package/script/src/models/currency/utils.d.ts.map +0 -1
  381. package/script/src/models/currency/utils.js +0 -12
  382. package/script/src/models/index.d.ts +0 -6
  383. package/script/src/models/index.d.ts.map +0 -1
  384. package/script/src/models/index.js +0 -21
  385. package/script/src/models/phone_number/format.d.ts +0 -13
  386. package/script/src/models/phone_number/format.d.ts.map +0 -1
  387. package/script/src/models/phone_number/format.js +0 -16
  388. package/script/src/models/phone_number/global/phone_number.d.ts +0 -162
  389. package/script/src/models/phone_number/global/phone_number.d.ts.map +0 -1
  390. package/script/src/models/phone_number/global/phone_number.js +0 -463
  391. package/script/src/models/phone_number/global/phone_number.test.d.ts.map +0 -1
  392. package/script/src/models/phone_number/global/service.d.ts +0 -267
  393. package/script/src/models/phone_number/global/service.d.ts.map +0 -1
  394. package/script/src/models/phone_number/global/service.js +0 -506
  395. package/script/src/models/phone_number/global/service.test.d.ts.map +0 -1
  396. package/script/src/models/phone_number/index.d.ts +0 -6
  397. package/script/src/models/phone_number/index.d.ts.map +0 -1
  398. package/script/src/models/phone_number/index.js +0 -21
  399. package/script/src/models/phone_number/tz/antd_validator.d.ts +0 -77
  400. package/script/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
  401. package/script/src/models/phone_number/tz/antd_validator.js +0 -94
  402. package/script/src/models/phone_number/tz/antdvalidator.test.d.ts.map +0 -1
  403. package/script/src/models/phone_number/tz/network_operator.d.ts +0 -30
  404. package/script/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
  405. package/script/src/models/phone_number/tz/network_operator.js +0 -50
  406. package/script/src/models/phone_number/tz/phone_number.d.ts +0 -141
  407. package/script/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
  408. package/script/src/models/phone_number/tz/phone_number.js +0 -294
  409. package/script/src/models/phone_number/tz/phone_number.test.d.ts.map +0 -1
  410. package/script/src/reports/index.d.ts +0 -2
  411. package/script/src/reports/index.d.ts.map +0 -1
  412. package/script/src/reports/index.js +0 -17
  413. package/script/src/reports/report_manager.d.ts.map +0 -1
  414. package/script/src/reports/report_manager.js +0 -328
  415. package/script/src/utils/id.d.ts.map +0 -1
  416. package/script/src/utils/id.js +0 -23
  417. package/script/src/utils/index.d.ts +0 -4
  418. package/script/src/utils/index.d.ts.map +0 -1
  419. package/script/src/utils/index.js +0 -19
  420. package/script/src/utils/text.d.ts +0 -32
  421. package/script/src/utils/text.d.ts.map +0 -1
  422. package/script/src/utils/text.js +0 -75
  423. package/script/src/utils/text.test.d.ts.map +0 -1
  424. package/script/src/utils/time.d.ts.map +0 -1
  425. package/script/src/utils/time.js +0 -39
@@ -1,328 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ReportManager = exports.REPORTS = exports.ReportType = exports.ProjectType = exports.FileFormat = void 0;
7
- exports.getReportsByProject = getReportsByProject;
8
- exports.getReportByType = getReportByType;
9
- exports.isReportAvailableForProject = isReportAvailableForProject;
10
- const file_saver_1 = __importDefault(require("file-saver"));
11
- const index_js_1 = require("../config/index.js");
12
- /**
13
- * Available file formats for reports
14
- */
15
- var FileFormat;
16
- (function (FileFormat) {
17
- /** PDF file format */
18
- FileFormat["PDF"] = "pdf";
19
- /** Excel file format */
20
- FileFormat["EXCEL"] = "excel";
21
- })(FileFormat || (exports.FileFormat = FileFormat = {}));
22
- /**
23
- * Available project types
24
- */
25
- var ProjectType;
26
- (function (ProjectType) {
27
- /** Tembo Dashboard project */
28
- ProjectType["DASHBOARD"] = "dashboard";
29
- /** Afloat project */
30
- ProjectType["AFLOAT"] = "afloat";
31
- /** VertoX project */
32
- ProjectType["VERTO_X"] = "verto_x";
33
- })(ProjectType || (exports.ProjectType = ProjectType = {}));
34
- /**
35
- * Available report types with improved naming
36
- */
37
- var ReportType;
38
- (function (ReportType) {
39
- /** Merchant payout statement (Dashboard) */
40
- ReportType["MERCHANT_DISBURSEMENT_REPORT"] = "merchant_disbursement_report";
41
- /** Transaction revenue summary (Dashboard) */
42
- ReportType["TRANSACTION_REVENUE_SUMMARY"] = "transaction_revenue_summary";
43
- /** Customer wallet activity (Afloat) */
44
- ReportType["CUSTOMER_WALLET_ACTIVITY"] = "customer_wallet_activity";
45
- /** Customer profile information (Afloat) */
46
- ReportType["CUSTOMER_PROFILE_SNAPSHOT"] = "customer_profile_snapshot";
47
- /** Gateway transaction log (VertoX) */
48
- ReportType["GATEWAY_TRANSACTION_LOG"] = "gateway_transaction_log";
49
- })(ReportType || (exports.ReportType = ReportType = {}));
50
- /**
51
- * Registry of all available reports
52
- */
53
- exports.REPORTS = {
54
- // Dashboard Reports
55
- [ReportType.MERCHANT_DISBURSEMENT_REPORT]: {
56
- id: "merchant_disbursement_report",
57
- displayName: "Merchant Disbursement Report",
58
- endpoint: "/dashboard/merchant_disbursements",
59
- availableFormats: [FileFormat.PDF, FileFormat.EXCEL],
60
- projectType: ProjectType.DASHBOARD,
61
- reportType: ReportType.MERCHANT_DISBURSEMENT_REPORT,
62
- description: "Detailed breakdown of payments made to merchants",
63
- },
64
- [ReportType.TRANSACTION_REVENUE_SUMMARY]: {
65
- id: "transaction_revenue_summary",
66
- displayName: "Transaction Revenue Summary",
67
- endpoint: "/dashboard/revenue_summary",
68
- availableFormats: [FileFormat.PDF, FileFormat.EXCEL],
69
- projectType: ProjectType.DASHBOARD,
70
- reportType: ReportType.TRANSACTION_REVENUE_SUMMARY,
71
- description: "Summary of all revenue transactions by period",
72
- },
73
- // Afloat Reports
74
- [ReportType.CUSTOMER_WALLET_ACTIVITY]: {
75
- id: "customer_wallet_activity",
76
- displayName: "Customer Wallet Activity",
77
- endpoint: "/afloat/wallet_activity",
78
- availableFormats: [FileFormat.PDF, FileFormat.EXCEL],
79
- projectType: ProjectType.AFLOAT,
80
- reportType: ReportType.CUSTOMER_WALLET_ACTIVITY,
81
- description: "Detailed record of all customer wallet transactions",
82
- },
83
- [ReportType.CUSTOMER_PROFILE_SNAPSHOT]: {
84
- id: "customer_profile_snapshot",
85
- displayName: "Customer Profile Snapshot",
86
- endpoint: "/afloat/profile_snapshot",
87
- availableFormats: [FileFormat.PDF],
88
- projectType: ProjectType.AFLOAT,
89
- reportType: ReportType.CUSTOMER_PROFILE_SNAPSHOT,
90
- description: "Current account information and status",
91
- },
92
- // VertoX Reports
93
- [ReportType.GATEWAY_TRANSACTION_LOG]: {
94
- id: "gateway_transaction_log",
95
- displayName: "Gateway Transaction Log",
96
- endpoint: "/vertox/gateway_transactions",
97
- availableFormats: [FileFormat.EXCEL],
98
- projectType: ProjectType.VERTO_X,
99
- reportType: ReportType.GATEWAY_TRANSACTION_LOG,
100
- description: "Log of all payment gateway API transactions",
101
- },
102
- };
103
- /**
104
- * Get all reports for a specific project
105
- * @param projectType The project type to filter by
106
- * @returns Array of report definitions for the project
107
- */
108
- function getReportsByProject(projectType) {
109
- return Object.values(exports.REPORTS).filter((report) => report.projectType === projectType);
110
- }
111
- /**
112
- * Get a report by its type
113
- * @param reportType The report type to retrieve
114
- * @returns The report definition or undefined if not found
115
- */
116
- function getReportByType(reportType) {
117
- return exports.REPORTS[reportType];
118
- }
119
- /**
120
- * Validates if a report type is available for a project
121
- * @param projectType The project type
122
- * @param reportType The report type
123
- * @returns True if the report is available for the project, false otherwise
124
- */
125
- function isReportAvailableForProject(projectType, reportType) {
126
- const report = exports.REPORTS[reportType];
127
- return report !== undefined && report.projectType === projectType;
128
- }
129
- /**
130
- * Report Manager class for handling report downloads
131
- */
132
- class ReportManager {
133
- constructor() {
134
- /**
135
- * Get the base URL for the report API
136
- * @returns The base URL
137
- */
138
- Object.defineProperty(this, "getBaseURL", {
139
- enumerable: true,
140
- configurable: true,
141
- writable: true,
142
- value: () => {
143
- let url = index_js_1.ConfigService.instance.pdfMakerBaseUrl;
144
- if (url.trim().length === 0) {
145
- url = "https://api.afloat.money/pdf-maker";
146
- }
147
- if (url.endsWith("/"))
148
- return url.slice(0, -1);
149
- return url;
150
- }
151
- });
152
- /**
153
- * Converts a base64 string to a Blob
154
- * @param base64 The base64 string
155
- * @returns A Blob
156
- */
157
- Object.defineProperty(this, "b64toBlob", {
158
- enumerable: true,
159
- configurable: true,
160
- writable: true,
161
- value: (base64) => fetch(base64).then((res) => res.blob())
162
- });
163
- }
164
- /**
165
- * Get the singleton instance of ReportManager
166
- */
167
- static get instance() {
168
- return this._instance || (this._instance = new this());
169
- }
170
- /**
171
- * Downloads a report based on project type and report type
172
- * @param args Arguments for the report download
173
- * @returns Promise that resolves when download is complete
174
- */
175
- async downloadReport(args) {
176
- try {
177
- // Get the report from the registry
178
- const report = exports.REPORTS[args.reportType];
179
- if (!report) {
180
- throw new Error(`Report type ${args.reportType} not configured`);
181
- }
182
- // Validate that the report belongs to the specified project
183
- if (report.projectType !== args.projectType) {
184
- throw new Error(`Report type ${args.reportType} does not belong to project ${args.projectType}`);
185
- }
186
- // Check if requested format is supported
187
- if (!report.availableFormats.includes(args.fileFormat)) {
188
- throw new Error(`File format ${args.fileFormat} not supported for ${report.displayName}`);
189
- }
190
- // Build URL using the report's endpoint
191
- let url = `${this.getBaseURL()}${report.endpoint}`;
192
- // Create a properly typed query parameters object
193
- // deno-lint-ignore no-explicit-any
194
- const queryParams = {
195
- ...(args.query || {}),
196
- fileFormat: args.fileFormat,
197
- };
198
- // Build the query string
199
- const searchParams = new URLSearchParams();
200
- for (const key in queryParams) {
201
- if (Object.prototype.hasOwnProperty.call(queryParams, key)) {
202
- const value = queryParams[key];
203
- if (value !== undefined && value !== null) {
204
- if (Array.isArray(value)) {
205
- value.forEach((item) => {
206
- searchParams.append(key + "[]", String(item));
207
- });
208
- }
209
- else {
210
- searchParams.append(key, String(value));
211
- }
212
- }
213
- }
214
- }
215
- const queryString = searchParams.toString();
216
- if (queryString) {
217
- url += `?${queryString}`;
218
- }
219
- // Make the request
220
- const response = await fetch(url, {
221
- method: "GET",
222
- headers: {
223
- "Accept": "*/*",
224
- "Content-Type": "application/json",
225
- "Authorization": `Bearer ${args.token}`,
226
- },
227
- });
228
- if (response.status !== 200) {
229
- await this.handleErrorResponse(response);
230
- }
231
- // Process the download
232
- await this.processDownload(response, report, args.fileFormat);
233
- }
234
- catch (error) {
235
- console.error("Report download failed:", error);
236
- throw error;
237
- }
238
- }
239
- /**
240
- * Process the download
241
- * @param response The response from the API
242
- * @param report The report definition
243
- * @param fileFormat The requested file format
244
- */
245
- async processDownload(response, report, fileFormat) {
246
- const contentDisposition = response.headers.get("Content-Disposition");
247
- // Get default filename based on report and file format
248
- const defaultFilename = this.getDefaultFilename(report, fileFormat);
249
- // Try to get filename from Content-Disposition, fall back to default
250
- const fileName = this.extractFilenameFromContentDisposition(contentDisposition) ||
251
- defaultFilename;
252
- // Handle the response based on content type
253
- // deno-lint-ignore no-explicit-any
254
- const blob = await this.b64toBlob(await response.text());
255
- file_saver_1.default.saveAs(blob, fileName);
256
- }
257
- /**
258
- * Handle error responses from the API
259
- * @param response The response from the API
260
- * @throws Error with appropriate message
261
- */
262
- async handleErrorResponse(response) {
263
- let errorMessage = "Encountered an error while generating report";
264
- try {
265
- // Try to parse as JSON first
266
- const contentType = response.headers.get("Content-Type");
267
- if (contentType && contentType.includes("application/json")) {
268
- const errorData = await response.json();
269
- errorMessage = errorData.message || errorData.error ||
270
- errorMessage;
271
- }
272
- else {
273
- // Try to get error as text
274
- const textError = await response.text();
275
- if (textError) {
276
- errorMessage = textError;
277
- }
278
- }
279
- }
280
- catch (parseError) {
281
- console.error("Error parsing error response:", parseError);
282
- }
283
- throw new Error(errorMessage);
284
- }
285
- /**
286
- * Generates a default filename based on report and file format
287
- * @param report The report definition
288
- * @param fileFormat The requested file format
289
- * @returns A suitable default filename with proper extension
290
- */
291
- getDefaultFilename(report, fileFormat) {
292
- const date = new Date().toISOString().slice(0, 10); // YYYY-MM-DD format
293
- // Build the filename with project, report type, and date
294
- const baseFilename = `${report.id}_${date}`;
295
- // Add the extension based on the file format
296
- return fileFormat === FileFormat.PDF
297
- ? `${baseFilename}.pdf`
298
- : `${baseFilename}.xlsx`;
299
- }
300
- /**
301
- * Extracts the filename from the Content-Disposition header
302
- * @param contentDisposition The Content-Disposition header value
303
- * @returns The extracted filename or null if not found
304
- */
305
- extractFilenameFromContentDisposition(contentDisposition) {
306
- // Check if the header exists
307
- if (!contentDisposition) {
308
- return null;
309
- }
310
- // Try to match the filename pattern
311
- const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
312
- const matches = filenameRegex.exec(contentDisposition);
313
- if (matches && matches[1]) {
314
- // Clean up the filename by removing quotes if present
315
- let filename = matches[1].trim();
316
- // Remove surrounding quotes if they exist
317
- if (filename.startsWith('"') && filename.endsWith('"')) {
318
- filename = filename.substring(1, filename.length - 1);
319
- }
320
- else if (filename.startsWith("'") && filename.endsWith("'")) {
321
- filename = filename.substring(1, filename.length - 1);
322
- }
323
- return filename;
324
- }
325
- return null;
326
- }
327
- }
328
- exports.ReportManager = ReportManager;
@@ -1 +0,0 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/src/utils/id.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAKD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateUniqueUUID = generateUniqueUUID;
4
- exports.generateUuidBasedOn = generateUuidBasedOn;
5
- const uuid_1 = require("uuid");
6
- const uuid_2 = require("uuid");
7
- /**
8
- * Generates a unique UUID (version 4).
9
- * @returns {string} - A randomly generated UUID string.
10
- */
11
- function generateUniqueUUID() {
12
- return (0, uuid_1.v4)();
13
- }
14
- // Predefined namespace
15
- const NAMESPACE = uuid_2.v5.DNS;
16
- /**
17
- * Generates a UUID (version 5) based on the input string and a predefined namespace.
18
- * @param {string} data - The input string to generate the UUID from.
19
- * @returns {string} - A UUID string generated from the input string.
20
- */
21
- function generateUuidBasedOn(data) {
22
- return (0, uuid_2.v5)(data, NAMESPACE);
23
- }
@@ -1,4 +0,0 @@
1
- export * from "./id.js";
2
- export * from "./time.js";
3
- export * from "./text.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./id.js"), exports);
18
- __exportStar(require("./time.js"), exports);
19
- __exportStar(require("./text.js"), exports);
@@ -1,32 +0,0 @@
1
- /**
2
- * Capitalizes the first letter of a string and converts the rest of the string to lowercase.
3
- * @param {string} str - The input string.
4
- * @returns {string} - The formatted string with the first letter capitalized.
5
- */
6
- export declare function capitalizeFirstLetter(str: string): string;
7
- /**
8
- * Combines a first name and a last name into a full name.
9
- * @param {string} firstName - The first name.
10
- * @param {string} lastName - The last name.
11
- * @returns {string} - The full name formatted as "FirstName LastName".
12
- */
13
- export declare function getFullName(firstName: string, lastName: string): string;
14
- /**
15
- * Generates a URL-friendly slug from a given text.
16
- * @param {string} text - The input string.
17
- * @returns {string} - The generated slug with lowercase alphanumeric characters and hyphens.
18
- */
19
- export declare function generateSlug(text: string): string;
20
- /**
21
- * Abbreviates a full name into a first name and the initial of the last name.
22
- * @param {string} fullName - The input full name.
23
- * @returns {string} - The abbreviated name in the format "FirstName L.".
24
- */
25
- export declare function abbreviateName(fullName: string): string;
26
- /**
27
- * Extracts the initials from a full name.
28
- * @param {string} fullName - The input full name.
29
- * @returns {string} - The initials in uppercase format.
30
- */
31
- export declare function getInitialsFrom(fullName: string): string;
32
- //# sourceMappingURL=text.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/src/utils/text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASzD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAYvD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAcxD"}
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.capitalizeFirstLetter = capitalizeFirstLetter;
4
- exports.getFullName = getFullName;
5
- exports.generateSlug = generateSlug;
6
- exports.abbreviateName = abbreviateName;
7
- exports.getInitialsFrom = getInitialsFrom;
8
- /**
9
- * Capitalizes the first letter of a string and converts the rest of the string to lowercase.
10
- * @param {string} str - The input string.
11
- * @returns {string} - The formatted string with the first letter capitalized.
12
- */
13
- function capitalizeFirstLetter(str) {
14
- if (str.length === 0) {
15
- return str; // Return an empty string if input is empty
16
- }
17
- const firstLetter = str.charAt(0).toUpperCase();
18
- const restOfString = str.slice(1).toLowerCase();
19
- return firstLetter + restOfString;
20
- }
21
- /**
22
- * Combines a first name and a last name into a full name.
23
- * @param {string} firstName - The first name.
24
- * @param {string} lastName - The last name.
25
- * @returns {string} - The full name formatted as "FirstName LastName".
26
- */
27
- function getFullName(firstName, lastName) {
28
- return `${firstName} ${lastName}`;
29
- }
30
- /**
31
- * Generates a URL-friendly slug from a given text.
32
- * @param {string} text - The input string.
33
- * @returns {string} - The generated slug with lowercase alphanumeric characters and hyphens.
34
- */
35
- function generateSlug(text) {
36
- return text
37
- .toLowerCase() // Convert to lowercase
38
- .replace(/[^\w\s-]/g, "") // Remove non-alphanumeric characters except spaces and hyphens
39
- .trim() // Trim leading/trailing spaces
40
- .replace(/\s+/g, "-") // Replace spaces with hyphens
41
- .replace(/-+/g, "-"); // Replace multiple hyphens with a single hyphen
42
- }
43
- /**
44
- * Abbreviates a full name into a first name and the initial of the last name.
45
- * @param {string} fullName - The input full name.
46
- * @returns {string} - The abbreviated name in the format "FirstName L.".
47
- */
48
- function abbreviateName(fullName) {
49
- const nameParts = fullName.trim().split(" ");
50
- if (nameParts.length === 1) {
51
- // If there's only one word in the name, return it as is.
52
- return fullName;
53
- }
54
- const firstName = nameParts[0];
55
- const lastNameInitial = nameParts[nameParts.length - 1].charAt(0);
56
- return `${firstName} ${lastNameInitial}.`;
57
- }
58
- /**
59
- * Extracts the initials from a full name.
60
- * @param {string} fullName - The input full name.
61
- * @returns {string} - The initials in uppercase format.
62
- */
63
- function getInitialsFrom(fullName) {
64
- let label = "";
65
- const names = (fullName ?? "").trim().split(" ");
66
- if (names.length === 0)
67
- return "";
68
- const firstName = names[0];
69
- label = firstName.charAt(0);
70
- if (names.length > 1) {
71
- const lastName = names[names.length - 1];
72
- label = `${firstName.charAt(0)}${lastName.charAt(0)}`;
73
- }
74
- return label.toUpperCase();
75
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.test.d.ts","sourceRoot":"","sources":["../../../src/src/utils/text.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/src/utils/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAMtD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzD"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compareDates = compareDates;
4
- exports.sortDates = sortDates;
5
- exports.delay = delay;
6
- /**
7
- * Compares two dates (years, months, and days only) without considering the time.
8
- * @param {Date} a - The first Date object.
9
- * @param {Date} b - The second Date object.
10
- * @returns {boolean} - Returns true if the dates are equal in terms of year, month, and day; otherwise, false.
11
- */
12
- function compareDates(a, b) {
13
- const d1 = new Date(a);
14
- const d2 = new Date(b);
15
- return d1.getFullYear() === d2.getFullYear() &&
16
- d1.getMonth() === d2.getMonth() &&
17
- d1.getDate() === d2.getDate();
18
- }
19
- /**
20
- * Sorts two dates in descending order (latest date first).
21
- * @param {Date} a - The first Date object.
22
- * @param {Date} b - The second Date object.
23
- * @returns {number} - Returns a positive value if `b` is after `a`, a negative value if `a` is after `b`, and 0 if they are equal.
24
- */
25
- function sortDates(a, b) {
26
- return new Date(b).getTime() - new Date(a).getTime();
27
- }
28
- /**
29
- * Creates a delay for a given number of milliseconds.
30
- * @param {number} milliseconds - The delay duration in milliseconds.
31
- * @returns {Promise<void>} - A promise that resolves after the specified delay.
32
- */
33
- function delay(milliseconds) {
34
- return new Promise((resolve) => {
35
- setTimeout(() => {
36
- resolve();
37
- }, milliseconds);
38
- });
39
- }