@temboplus/frontend-core 0.2.20-beta.8 → 0.2.22

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 (424) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +1 -1
  3. package/esm/_dnt.test_shims.d.ts.map +1 -0
  4. package/esm/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +1 -0
  5. package/esm/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +1 -0
  6. package/esm/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +1 -0
  7. package/esm/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +1 -0
  8. package/esm/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +1 -0
  9. package/esm/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +1 -0
  10. package/esm/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +1 -0
  11. package/esm/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +1 -0
  12. package/esm/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +1 -0
  13. package/esm/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +1 -0
  14. package/esm/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +1 -0
  15. package/esm/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +1 -0
  16. package/esm/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +1 -0
  17. package/esm/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +1 -0
  18. package/esm/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +1 -0
  19. package/esm/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +1 -0
  20. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +1 -0
  21. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +1 -0
  22. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +1 -0
  23. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +1 -0
  24. package/esm/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +1 -0
  25. package/esm/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +1 -0
  26. package/esm/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +1 -0
  27. package/esm/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +1 -0
  28. package/esm/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +1 -0
  29. package/esm/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +1 -0
  30. package/esm/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +1 -0
  31. package/esm/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +1 -0
  32. package/esm/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +1 -0
  33. package/esm/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +1 -0
  34. package/esm/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +1 -0
  35. package/esm/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  38. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  40. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  41. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  43. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  44. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  46. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  47. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  49. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  50. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  52. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  53. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  55. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  56. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  58. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  59. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  61. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  62. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  64. package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
  65. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  66. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  67. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  68. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  69. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  70. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  71. package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
  73. package/esm/mod.d.ts +5 -0
  74. package/esm/mod.d.ts.map +1 -0
  75. package/esm/mod.js +4 -0
  76. package/esm/package.json +3 -0
  77. package/{dist/services/config.d.ts → esm/src/config/config_service.d.ts} +5 -6
  78. package/esm/src/config/config_service.d.ts.map +1 -0
  79. package/esm/src/config/config_service.js +19 -0
  80. package/esm/src/config/index.d.ts +2 -0
  81. package/esm/src/config/index.d.ts.map +1 -0
  82. package/esm/src/config/index.js +1 -0
  83. package/esm/src/data/banks_tz.d.ts +7 -0
  84. package/esm/src/data/banks_tz.d.ts.map +1 -0
  85. package/esm/src/data/banks_tz.js +197 -0
  86. package/esm/src/data/countries.d.ts +39 -0
  87. package/esm/src/data/countries.d.ts.map +1 -0
  88. package/esm/src/data/countries.js +2475 -0
  89. package/esm/src/data/currencies.d.ts +1901 -0
  90. package/esm/src/data/currencies.d.ts.map +1 -0
  91. package/esm/src/data/currencies.js +1073 -0
  92. package/esm/src/data/phone_patterns.d.ts +3809 -0
  93. package/esm/src/data/phone_patterns.d.ts.map +1 -0
  94. package/esm/src/data/phone_patterns.js +2325 -0
  95. package/esm/src/models/amount/amount.d.ts +53 -0
  96. package/esm/src/models/amount/amount.d.ts.map +1 -0
  97. package/esm/src/models/amount/amount.js +190 -0
  98. package/esm/src/models/amount/amount.test.d.ts.map +1 -0
  99. package/esm/src/models/amount/antd_validator.d.ts +40 -0
  100. package/esm/src/models/amount/antd_validator.d.ts.map +1 -0
  101. package/esm/src/models/amount/antd_validator.js +58 -0
  102. package/esm/src/models/amount/antd_validator.test.d.ts.map +1 -0
  103. package/esm/src/models/amount/index.d.ts +3 -0
  104. package/esm/src/models/amount/index.d.ts.map +1 -0
  105. package/esm/src/models/amount/index.js +2 -0
  106. package/esm/src/models/bank/antd_validator.d.ts +11 -0
  107. package/esm/src/models/bank/antd_validator.d.ts.map +1 -0
  108. package/esm/src/models/bank/antd_validator.js +26 -0
  109. package/esm/src/models/bank/antd_validator.test.d.ts.map +1 -0
  110. package/esm/src/models/bank/bank.d.ts +257 -0
  111. package/esm/src/models/bank/bank.d.ts.map +1 -0
  112. package/esm/src/models/bank/bank.js +450 -0
  113. package/esm/src/models/bank/bank.test.d.ts.map +1 -0
  114. package/esm/src/models/bank/index.d.ts +5 -0
  115. package/esm/src/models/bank/index.d.ts.map +1 -0
  116. package/esm/src/models/bank/index.js +4 -0
  117. package/{dist/models/bank/bank.types.d.ts → esm/src/models/bank/types.d.ts} +6 -4
  118. package/esm/src/models/bank/types.d.ts.map +1 -0
  119. package/esm/src/models/bank/types.js +45 -0
  120. package/esm/src/models/bank/utils.d.ts +8 -0
  121. package/esm/src/models/bank/utils.d.ts.map +1 -0
  122. package/esm/src/models/bank/utils.js +9 -0
  123. package/{dist → esm/src}/models/country/country.d.ts +5 -37
  124. package/esm/src/models/country/country.d.ts.map +1 -0
  125. package/esm/src/models/country/country.js +737 -0
  126. package/esm/src/models/country/country.test.d.ts.map +1 -0
  127. package/esm/src/models/country/index.d.ts +4 -0
  128. package/esm/src/models/country/index.d.ts.map +1 -0
  129. package/esm/src/models/country/index.js +3 -0
  130. package/{dist/models/country/country.types.d.ts → esm/src/models/country/types.d.ts} +1 -0
  131. package/esm/src/models/country/types.d.ts.map +1 -0
  132. package/esm/src/models/country/types.js +105 -0
  133. package/{dist/models/country/country.validation.d.ts → esm/src/models/country/utils.d.ts} +6 -10
  134. package/esm/src/models/country/utils.d.ts.map +1 -0
  135. package/esm/src/models/country/utils.js +25 -0
  136. package/{dist → esm/src}/models/currency/currency.d.ts +3 -28
  137. package/esm/src/models/currency/currency.d.ts.map +1 -0
  138. package/esm/src/models/currency/currency.js +471 -0
  139. package/esm/src/models/currency/currency.test.d.ts.map +1 -0
  140. package/esm/src/models/currency/index.d.ts +4 -0
  141. package/esm/src/models/currency/index.d.ts.map +1 -0
  142. package/esm/src/models/currency/index.js +3 -0
  143. package/{dist/models/currency/currency.types.d.ts → esm/src/models/currency/types.d.ts} +2 -1
  144. package/esm/src/models/currency/types.d.ts.map +1 -0
  145. package/esm/src/models/currency/types.js +28 -0
  146. package/esm/src/models/currency/utils.d.ts +8 -0
  147. package/esm/src/models/currency/utils.d.ts.map +1 -0
  148. package/esm/src/models/currency/utils.js +9 -0
  149. package/esm/src/models/index.d.ts +6 -0
  150. package/esm/src/models/index.d.ts.map +1 -0
  151. package/{dist/models/index.d.ts → esm/src/models/index.js} +1 -1
  152. package/esm/src/models/phone_number/format.d.ts +13 -0
  153. package/esm/src/models/phone_number/format.d.ts.map +1 -0
  154. package/esm/src/models/phone_number/format.js +13 -0
  155. package/esm/src/models/phone_number/global/phone_number.d.ts +162 -0
  156. package/esm/src/models/phone_number/global/phone_number.d.ts.map +1 -0
  157. package/esm/src/models/phone_number/global/phone_number.js +459 -0
  158. package/esm/src/models/phone_number/global/phone_number.test.d.ts.map +1 -0
  159. package/esm/src/models/phone_number/global/service.d.ts +267 -0
  160. package/esm/src/models/phone_number/global/service.d.ts.map +1 -0
  161. package/esm/src/models/phone_number/global/service.js +498 -0
  162. package/esm/src/models/phone_number/global/service.test.d.ts.map +1 -0
  163. package/esm/src/models/phone_number/index.d.ts +6 -0
  164. package/esm/src/models/phone_number/index.d.ts.map +1 -0
  165. package/esm/src/models/phone_number/index.js +5 -0
  166. package/esm/src/models/phone_number/tz/antd_validator.d.ts +77 -0
  167. package/esm/src/models/phone_number/tz/antd_validator.d.ts.map +1 -0
  168. package/esm/src/models/phone_number/tz/antd_validator.js +90 -0
  169. package/esm/src/models/phone_number/tz/antdvalidator.test.d.ts.map +1 -0
  170. package/esm/src/models/phone_number/tz/network_operator.d.ts +30 -0
  171. package/esm/src/models/phone_number/tz/network_operator.d.ts.map +1 -0
  172. package/esm/src/models/phone_number/tz/network_operator.js +47 -0
  173. package/esm/src/models/phone_number/tz/phone_number.d.ts +141 -0
  174. package/esm/src/models/phone_number/tz/phone_number.d.ts.map +1 -0
  175. package/esm/src/models/phone_number/tz/phone_number.js +290 -0
  176. package/esm/src/models/phone_number/tz/phone_number.test.d.ts.map +1 -0
  177. package/esm/src/reports/index.d.ts +2 -0
  178. package/esm/src/reports/index.d.ts.map +1 -0
  179. package/esm/src/reports/index.js +1 -0
  180. package/{dist/reports/report-manager.d.ts → esm/src/reports/report_manager.d.ts} +4 -27
  181. package/esm/src/reports/report_manager.d.ts.map +1 -0
  182. package/esm/src/reports/report_manager.js +318 -0
  183. package/{dist → esm/src}/utils/id.d.ts +3 -7
  184. package/esm/src/utils/id.d.ts.map +1 -0
  185. package/esm/src/utils/id.js +19 -0
  186. package/esm/src/utils/index.d.ts +4 -0
  187. package/esm/src/utils/index.d.ts.map +1 -0
  188. package/esm/src/utils/text.d.ts +32 -0
  189. package/esm/src/utils/text.d.ts.map +1 -0
  190. package/esm/src/utils/text.js +68 -0
  191. package/esm/src/utils/text.test.d.ts.map +1 -0
  192. package/{dist → esm/src}/utils/time.d.ts +4 -9
  193. package/esm/src/utils/time.d.ts.map +1 -0
  194. package/esm/src/utils/time.js +34 -0
  195. package/package.json +22 -47
  196. package/script/_dnt.test_shims.d.ts.map +1 -0
  197. package/script/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +1 -0
  198. package/script/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +1 -0
  199. package/script/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +1 -0
  200. package/script/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +1 -0
  201. package/script/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +1 -0
  202. package/script/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +1 -0
  203. package/script/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +1 -0
  204. package/script/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +1 -0
  205. package/script/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +1 -0
  206. package/script/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +1 -0
  207. package/script/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +1 -0
  208. package/script/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +1 -0
  209. package/script/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +1 -0
  210. package/script/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +1 -0
  211. package/script/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +1 -0
  212. package/script/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +1 -0
  213. package/script/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +1 -0
  214. package/script/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +1 -0
  215. package/script/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +1 -0
  216. package/script/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +1 -0
  217. package/script/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +1 -0
  218. package/script/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +1 -0
  219. package/script/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +1 -0
  220. package/script/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +1 -0
  221. package/script/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +1 -0
  222. package/script/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +1 -0
  223. package/script/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +1 -0
  224. package/script/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +1 -0
  225. package/script/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +1 -0
  226. package/script/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +1 -0
  227. package/script/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +1 -0
  228. package/script/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +1 -0
  229. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  230. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  231. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  232. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  233. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  234. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  235. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  236. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  237. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  238. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  239. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  240. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  241. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  242. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  243. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  244. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  245. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  246. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  247. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  248. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  249. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  250. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  251. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  252. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  253. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  254. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  255. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  256. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  257. package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
  258. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  259. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  260. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  261. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  262. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  263. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  264. package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
  265. package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
  266. package/script/mod.d.ts +5 -0
  267. package/script/mod.d.ts.map +1 -0
  268. package/script/mod.js +20 -0
  269. package/script/package.json +3 -0
  270. package/script/src/config/config_service.d.ts +11 -0
  271. package/script/src/config/config_service.d.ts.map +1 -0
  272. package/script/src/config/config_service.js +23 -0
  273. package/script/src/config/index.d.ts +2 -0
  274. package/script/src/config/index.d.ts.map +1 -0
  275. package/script/src/config/index.js +17 -0
  276. package/script/src/data/banks_tz.d.ts +7 -0
  277. package/script/src/data/banks_tz.d.ts.map +1 -0
  278. package/script/src/data/banks_tz.js +199 -0
  279. package/script/src/data/countries.d.ts +39 -0
  280. package/script/src/data/countries.d.ts.map +1 -0
  281. package/script/src/data/countries.js +2477 -0
  282. package/script/src/data/currencies.d.ts +1901 -0
  283. package/script/src/data/currencies.d.ts.map +1 -0
  284. package/script/src/data/currencies.js +1075 -0
  285. package/script/src/data/phone_patterns.d.ts +3809 -0
  286. package/script/src/data/phone_patterns.d.ts.map +1 -0
  287. package/script/src/data/phone_patterns.js +2327 -0
  288. package/script/src/models/amount/amount.d.ts +53 -0
  289. package/script/src/models/amount/amount.d.ts.map +1 -0
  290. package/script/src/models/amount/amount.js +194 -0
  291. package/script/src/models/amount/amount.test.d.ts.map +1 -0
  292. package/script/src/models/amount/antd_validator.d.ts +40 -0
  293. package/script/src/models/amount/antd_validator.d.ts.map +1 -0
  294. package/script/src/models/amount/antd_validator.js +62 -0
  295. package/script/src/models/amount/antd_validator.test.d.ts.map +1 -0
  296. package/script/src/models/amount/index.d.ts +3 -0
  297. package/script/src/models/amount/index.d.ts.map +1 -0
  298. package/script/src/models/amount/index.js +18 -0
  299. package/script/src/models/bank/antd_validator.d.ts +11 -0
  300. package/script/src/models/bank/antd_validator.d.ts.map +1 -0
  301. package/script/src/models/bank/antd_validator.js +30 -0
  302. package/script/src/models/bank/antd_validator.test.d.ts.map +1 -0
  303. package/script/src/models/bank/bank.d.ts +257 -0
  304. package/script/src/models/bank/bank.d.ts.map +1 -0
  305. package/script/src/models/bank/bank.js +458 -0
  306. package/script/src/models/bank/bank.test.d.ts.map +1 -0
  307. package/script/src/models/bank/index.d.ts +5 -0
  308. package/script/src/models/bank/index.d.ts.map +1 -0
  309. package/script/src/models/bank/index.js +20 -0
  310. package/script/src/models/bank/types.d.ts +7 -0
  311. package/script/src/models/bank/types.d.ts.map +1 -0
  312. package/script/src/models/bank/types.js +48 -0
  313. package/script/src/models/bank/utils.d.ts +8 -0
  314. package/script/src/models/bank/utils.d.ts.map +1 -0
  315. package/script/src/models/bank/utils.js +12 -0
  316. package/script/src/models/country/country.d.ts +822 -0
  317. package/script/src/models/country/country.d.ts.map +1 -0
  318. package/script/src/models/country/country.js +745 -0
  319. package/script/src/models/country/country.test.d.ts.map +1 -0
  320. package/script/src/models/country/index.d.ts +4 -0
  321. package/script/src/models/country/index.d.ts.map +1 -0
  322. package/script/src/models/country/index.js +19 -0
  323. package/script/src/models/country/types.d.ts +63 -0
  324. package/script/src/models/country/types.d.ts.map +1 -0
  325. package/script/src/models/country/types.js +108 -0
  326. package/script/src/models/country/utils.d.ts +21 -0
  327. package/script/src/models/country/utils.d.ts.map +1 -0
  328. package/script/src/models/country/utils.js +30 -0
  329. package/script/src/models/currency/currency.d.ts +465 -0
  330. package/script/src/models/currency/currency.d.ts.map +1 -0
  331. package/script/src/models/currency/currency.js +479 -0
  332. package/script/src/models/currency/currency.test.d.ts.map +1 -0
  333. package/script/src/models/currency/index.d.ts +4 -0
  334. package/script/src/models/currency/index.d.ts.map +1 -0
  335. package/script/src/models/currency/index.js +19 -0
  336. package/script/src/models/currency/types.d.ts +21 -0
  337. package/script/src/models/currency/types.d.ts.map +1 -0
  338. package/script/src/models/currency/types.js +31 -0
  339. package/script/src/models/currency/utils.d.ts +8 -0
  340. package/script/src/models/currency/utils.d.ts.map +1 -0
  341. package/script/src/models/currency/utils.js +12 -0
  342. package/script/src/models/index.d.ts +6 -0
  343. package/script/src/models/index.d.ts.map +1 -0
  344. package/script/src/models/index.js +21 -0
  345. package/script/src/models/phone_number/format.d.ts +13 -0
  346. package/script/src/models/phone_number/format.d.ts.map +1 -0
  347. package/script/src/models/phone_number/format.js +16 -0
  348. package/script/src/models/phone_number/global/phone_number.d.ts +162 -0
  349. package/script/src/models/phone_number/global/phone_number.d.ts.map +1 -0
  350. package/script/src/models/phone_number/global/phone_number.js +463 -0
  351. package/script/src/models/phone_number/global/phone_number.test.d.ts.map +1 -0
  352. package/script/src/models/phone_number/global/service.d.ts +267 -0
  353. package/script/src/models/phone_number/global/service.d.ts.map +1 -0
  354. package/script/src/models/phone_number/global/service.js +506 -0
  355. package/script/src/models/phone_number/global/service.test.d.ts.map +1 -0
  356. package/script/src/models/phone_number/index.d.ts +6 -0
  357. package/script/src/models/phone_number/index.d.ts.map +1 -0
  358. package/script/src/models/phone_number/index.js +21 -0
  359. package/script/src/models/phone_number/tz/antd_validator.d.ts +77 -0
  360. package/script/src/models/phone_number/tz/antd_validator.d.ts.map +1 -0
  361. package/script/src/models/phone_number/tz/antd_validator.js +94 -0
  362. package/script/src/models/phone_number/tz/antdvalidator.test.d.ts.map +1 -0
  363. package/script/src/models/phone_number/tz/network_operator.d.ts +30 -0
  364. package/script/src/models/phone_number/tz/network_operator.d.ts.map +1 -0
  365. package/script/src/models/phone_number/tz/network_operator.js +50 -0
  366. package/script/src/models/phone_number/tz/phone_number.d.ts +141 -0
  367. package/script/src/models/phone_number/tz/phone_number.d.ts.map +1 -0
  368. package/script/src/models/phone_number/tz/phone_number.js +294 -0
  369. package/script/src/models/phone_number/tz/phone_number.test.d.ts.map +1 -0
  370. package/script/src/reports/index.d.ts +2 -0
  371. package/script/src/reports/index.d.ts.map +1 -0
  372. package/script/src/reports/index.js +17 -0
  373. package/script/src/reports/report_manager.d.ts +144 -0
  374. package/script/src/reports/report_manager.d.ts.map +1 -0
  375. package/script/src/reports/report_manager.js +328 -0
  376. package/script/src/utils/id.d.ts +12 -0
  377. package/script/src/utils/id.d.ts.map +1 -0
  378. package/script/src/utils/id.js +23 -0
  379. package/script/src/utils/index.d.ts +4 -0
  380. package/script/src/utils/index.d.ts.map +1 -0
  381. package/script/src/utils/index.js +19 -0
  382. package/script/src/utils/text.d.ts +32 -0
  383. package/script/src/utils/text.d.ts.map +1 -0
  384. package/script/src/utils/text.js +75 -0
  385. package/script/src/utils/text.test.d.ts.map +1 -0
  386. package/script/src/utils/time.d.ts +21 -0
  387. package/script/src/utils/time.d.ts.map +1 -0
  388. package/script/src/utils/time.js +39 -0
  389. package/dist/constants/index.d.ts +0 -1
  390. package/dist/constants/payout-countries.d.ts +0 -2
  391. package/dist/index.cjs.js +0 -8
  392. package/dist/index.cjs.js.map +0 -1
  393. package/dist/index.d.ts +0 -5
  394. package/dist/index.esm.js +0 -5
  395. package/dist/index.esm.js.map +0 -1
  396. package/dist/models/amount/amount.d.ts +0 -761
  397. package/dist/models/amount/index.d.ts +0 -1
  398. package/dist/models/bank/bank.d.ts +0 -193
  399. package/dist/models/bank/bank.schema.d.ts +0 -23
  400. package/dist/models/bank/bank.validation.d.ts +0 -80
  401. package/dist/models/bank/index.d.ts +0 -4
  402. package/dist/models/country/country.schema.d.ts +0 -73
  403. package/dist/models/country/index.d.ts +0 -4
  404. package/dist/models/currency/currency.schema.d.ts +0 -24
  405. package/dist/models/currency/currency.validation.d.ts +0 -11
  406. package/dist/models/currency/index.d.ts +0 -4
  407. package/dist/models/phone-number/index.d.ts +0 -6
  408. package/dist/models/phone-number/mno/index.d.ts +0 -6
  409. package/dist/models/phone-number/mno/ke/mobile-number.ke-mnos.d.ts +0 -22
  410. package/dist/models/phone-number/mno/ke/mobile-number.ke.d.ts +0 -45
  411. package/dist/models/phone-number/mno/mno.types.d.ts +0 -63
  412. package/dist/models/phone-number/mno/mno.utils.d.ts +0 -40
  413. package/dist/models/phone-number/mno/tz/mobile-number.tz-mnos.d.ts +0 -48
  414. package/dist/models/phone-number/mno/tz/mobile-number.tz.d.ts +0 -44
  415. package/dist/models/phone-number/phone-number.d.ts +0 -135
  416. package/dist/models/phone-number/phone-number.factory.d.ts +0 -52
  417. package/dist/models/phone-number/phone-number.service.d.ts +0 -36
  418. package/dist/models/phone-number/phone-number.types.d.ts +0 -115
  419. package/dist/models/phone-number/phone-number.utils.d.ts +0 -67
  420. package/dist/reports/index.d.ts +0 -1
  421. package/dist/services/index.d.ts +0 -2
  422. package/dist/services/logger.d.ts +0 -2
  423. package/dist/utils/text.d.ts +0 -103
  424. /package/{dist/utils/index.d.ts → esm/src/utils/index.js} +0 -0
@@ -0,0 +1 @@
1
+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4B;IAC/C,OAAO,CAAC,gBAAgB,CAA4B;IAGpD,OAAO,CAAC,gBAAgB,CAAgC;IAExD,OAAO;IAEP;;;;;OAKG;IACH,MAAM,CAAC,WAAW,IAAI,WAAW;IAQjC;;;OAGG;IACH,OAAO,CAAC,UAAU;IA0ClB;;;OAGG;IACH,MAAM,IAAI,IAAI,EAAE;IAIhB;;;OAGG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;IAItC;;;OAGG;IACH,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;IAIxC;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAKlD;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAqChD;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAKpD;;;;OAIG;IACH,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAKlD;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,IAAI,EAAE;IAetD;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO;IAQ1C;;;OAGG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;;;OAIG;IACH,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIlD;;;;;OAKG;IACH,iBAAiB,eAAgB,MAAM,KAAG,OAAO,CAQ/C;CACH"}
@@ -0,0 +1,450 @@
1
+ /**
2
+ * @fileoverview This file contains both the Bank class and BankService class.
3
+ *
4
+ * ARCHITECTURE NOTE: Bank and BankService Classes
5
+ * ===============================================
6
+ *
7
+ * These two classes have been intentionally placed in the same file to follow
8
+ * the established domain model pattern used with Country and Currency classes.
9
+ *
10
+ * - Bank class: Defines bank properties and static accessors
11
+ * - BankService class: Loads bank data and provides instance methods
12
+ *
13
+ * Benefits of this approach:
14
+ * 1. Prevents circular dependencies between the classes
15
+ * 2. Ensures static properties are immediately available on import
16
+ * 3. Maintains a consistent architectural pattern across domain models
17
+ * 4. Encapsulates all bank-related functionality in a single module
18
+ *
19
+ * This implementation follows the "Smart Models, Dumb Services" pattern where
20
+ * the Bank class provides a rich public API through static methods that delegate
21
+ * to the internal BankService. Meanwhile, BankService handles data loading and
22
+ * indexing without being directly exposed to external code.
23
+ */
24
+ import file from "../../data/banks_tz.js";
25
+ const BankToken = Symbol("BankToken");
26
+ /**
27
+ * Represents a bank with essential details.
28
+ * @class Bank
29
+ */
30
+ export class Bank {
31
+ /**
32
+ * Creates a new Bank instance. Private constructor - only BankService can create instances.
33
+ * Clients should use static methods like Bank.from() or Bank.CRDB instead.
34
+ *
35
+ * @param {string} _fullName - The full name of the bank
36
+ * @param {string} _shortName - The short name or abbreviated name of the bank
37
+ * @param {string} _swiftCode - The SWIFT code associated with the bank
38
+ */
39
+ constructor(token, _fullName, _shortName, _swiftCode) {
40
+ Object.defineProperty(this, "_fullName", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: _fullName
45
+ });
46
+ Object.defineProperty(this, "_shortName", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: _shortName
51
+ });
52
+ Object.defineProperty(this, "_swiftCode", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: _swiftCode
57
+ });
58
+ if (token !== BankToken) {
59
+ throw new Error("Bank can only be instantiated by BankService.");
60
+ }
61
+ }
62
+ /**
63
+ * Gets the full name of the bank.
64
+ * @returns {string} The full name of the bank
65
+ */
66
+ get fullName() {
67
+ return this._fullName;
68
+ }
69
+ /**
70
+ * Gets the short name of the bank.
71
+ * @returns {string} The short name of the bank
72
+ */
73
+ get shortName() {
74
+ return this._shortName;
75
+ }
76
+ /**
77
+ * Gets the SWIFT code of the bank.
78
+ * @returns {string} The SWIFT code of the bank
79
+ */
80
+ get swiftCode() {
81
+ return this._swiftCode;
82
+ }
83
+ /**
84
+ * Creates a string representation of the bank.
85
+ * @returns {string} String representation of the bank
86
+ */
87
+ toString() {
88
+ return `${this.fullName} (${this.shortName}) - SWIFT: ${this.swiftCode}`;
89
+ }
90
+ /**
91
+ * Retrieves a bank by its SWIFT code.
92
+ * @param {string} swiftCode The SWIFT code of the bank.
93
+ * @returns {Bank | undefined} The bank corresponding to the SWIFT code or `undefined` if not found.
94
+ */
95
+ static fromSWIFTCode(swiftCode) {
96
+ return BankService.getInstance().fromSWIFTCode(swiftCode);
97
+ }
98
+ /**
99
+ * Retrieves a bank by its short or full name.
100
+ * @param {string} bankName The full name of the bank.
101
+ * @returns {Bank | undefined} The bank corresponding to the full name or `undefined` if not found.
102
+ */
103
+ static fromBankName(bankName) {
104
+ return BankService.getInstance().fromBankName(bankName);
105
+ }
106
+ /**
107
+ * Returns all available banks.
108
+ * @returns {Bank[]} Array of all banks
109
+ */
110
+ static getAll() {
111
+ return BankService.getInstance().getAll();
112
+ }
113
+ /**
114
+ * Validates if a given SWIFT/BIC (Bank Identifier Code) is valid
115
+ * @param swiftCode The SWIFT/BIC code to validate
116
+ * @returns True if the SWIFT code is valid
117
+ */
118
+ static isValidSwiftCode(swiftCode) {
119
+ if (!swiftCode)
120
+ return false;
121
+ const bank = Bank.fromSWIFTCode(swiftCode);
122
+ return !!bank;
123
+ }
124
+ /**
125
+ * Validates if a given bank name is valid
126
+ * @param bankName The bank name to validate
127
+ * @returns True if the bank name is valid
128
+ */
129
+ static isValidBankName(bankName) {
130
+ if (!bankName)
131
+ return false;
132
+ const bank = Bank.fromBankName(bankName);
133
+ return !!bank;
134
+ }
135
+ /**
136
+ * Checks the validity of the bank data
137
+ * @returns true if the bank information is available and valid
138
+ */
139
+ validate() {
140
+ try {
141
+ return (Bank.fromBankName(this._fullName) !== undefined ||
142
+ Bank.fromBankName(this._shortName) !== undefined ||
143
+ Bank.fromSWIFTCode(this._swiftCode) !== undefined);
144
+ }
145
+ catch (_) {
146
+ return false;
147
+ }
148
+ }
149
+ /**
150
+ * Attempts to create a Bank instance from a bank name or SWIFT code
151
+ * @param input The bank name or SWIFT code
152
+ * @returns A Bank instance if valid input, undefined otherwise
153
+ */
154
+ static from(input) {
155
+ if (Bank.canConstruct(input)) {
156
+ const bank1 = Bank.fromBankName(input);
157
+ if (bank1)
158
+ return bank1;
159
+ const bank2 = Bank.fromSWIFTCode(input);
160
+ if (bank2)
161
+ return bank2;
162
+ }
163
+ return undefined;
164
+ }
165
+ /**
166
+ * Validates if the input can be used to construct a valid Bank instance
167
+ * @param input The bank name or SWIFT code to validate
168
+ * @returns True if input can construct a valid bank, false otherwise
169
+ */
170
+ static canConstruct(input) {
171
+ if (!input || typeof input !== "string")
172
+ return false;
173
+ const text = input.trim();
174
+ if (text.length === 0)
175
+ return false;
176
+ const bankFromSwift = Bank.fromSWIFTCode(text);
177
+ const bankFromName = Bank.fromBankName(text);
178
+ return bankFromSwift !== undefined || bankFromName !== undefined;
179
+ }
180
+ /**
181
+ * Checks if an unknown value is a Bank instance
182
+ * @param obj The value to validate
183
+ * @returns Type predicate indicating if the value is a valid Bank
184
+ */
185
+ static is(obj) {
186
+ if (!obj || typeof obj !== "object")
187
+ return false;
188
+ const maybeBank = obj;
189
+ // Check private properties exist with correct types
190
+ if (typeof maybeBank._fullName !== "string")
191
+ return false;
192
+ if (typeof maybeBank._shortName !== "string")
193
+ return false;
194
+ if (typeof maybeBank._swiftCode !== "string")
195
+ return false;
196
+ // Validate against known banks
197
+ const bankFromSwift = Bank.fromSWIFTCode(maybeBank._swiftCode);
198
+ return Boolean(bankFromSwift);
199
+ }
200
+ }
201
+ /**
202
+ * Regex pattern to validate SWIFT codes.
203
+ * The SWIFT code must follow the format: XXXX XX XX XXX (optional last part for branches).
204
+ * @constant {RegExp}
205
+ */
206
+ export const SWIFT_CODE_REGEX = /^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$/;
207
+ /**
208
+ * Service for managing bank data.
209
+ * @class BankService
210
+ */
211
+ export class BankService {
212
+ constructor() {
213
+ Object.defineProperty(this, "bankList", {
214
+ enumerable: true,
215
+ configurable: true,
216
+ writable: true,
217
+ value: []
218
+ });
219
+ Object.defineProperty(this, "bankRecord", {
220
+ enumerable: true,
221
+ configurable: true,
222
+ writable: true,
223
+ value: {}
224
+ });
225
+ Object.defineProperty(this, "banksByName", {
226
+ enumerable: true,
227
+ configurable: true,
228
+ writable: true,
229
+ value: {}
230
+ });
231
+ Object.defineProperty(this, "banksByShortName", {
232
+ enumerable: true,
233
+ configurable: true,
234
+ writable: true,
235
+ value: {}
236
+ });
237
+ // Static references for direct access through Bank class
238
+ Object.defineProperty(this, "staticReferences", {
239
+ enumerable: true,
240
+ configurable: true,
241
+ writable: true,
242
+ value: new Map()
243
+ });
244
+ /**
245
+ * Validates whether a given SWIFT code is correct.
246
+ * It checks both the SWIFT code format and if the SWIFT code exists in the list of valid codes.
247
+ * @param {string} [swiftCode] The SWIFT code to validate.
248
+ * @returns {boolean} `true` if valid, otherwise `false`.
249
+ */
250
+ Object.defineProperty(this, "validateSWIFTCode", {
251
+ enumerable: true,
252
+ configurable: true,
253
+ writable: true,
254
+ value: (swiftCode) => {
255
+ if (!swiftCode)
256
+ return false;
257
+ const normalizedCode = swiftCode.trim().toUpperCase();
258
+ return (this.isValidSwiftCodeFormat(normalizedCode) &&
259
+ this.getAllSwiftCodes().includes(normalizedCode));
260
+ }
261
+ });
262
+ }
263
+ /**
264
+ * Gets the singleton instance of BankService.
265
+ * Creates the instance if it doesn't exist.
266
+ * @static
267
+ * @returns {BankService} The singleton instance
268
+ */
269
+ static getInstance() {
270
+ if (!BankService.instance) {
271
+ BankService.instance = new BankService();
272
+ BankService.instance.initialize();
273
+ }
274
+ return BankService.instance;
275
+ }
276
+ /**
277
+ * Initializes the service with bank data.
278
+ * Should be called once when your application starts.
279
+ */
280
+ initialize() {
281
+ try {
282
+ const data = JSON.parse(JSON.stringify(file));
283
+ const banks = Object.values(data).map((b) => new Bank(BankToken, b.fullName, b.shortName, b.swiftCode));
284
+ const swiftCodeRecord = {};
285
+ const nameRecord = {};
286
+ const shortNameRecord = {};
287
+ banks.forEach((bank) => {
288
+ // Populate records
289
+ swiftCodeRecord[bank.swiftCode.toUpperCase()] = bank;
290
+ nameRecord[bank.fullName.toUpperCase()] = bank;
291
+ shortNameRecord[bank.shortName.toUpperCase()] = bank;
292
+ // Add to static references with uppercase short name
293
+ const shortName = bank.shortName.toUpperCase();
294
+ this.staticReferences.set(shortName, bank);
295
+ // Handle bank names with spaces (like "GT BANK")
296
+ if (shortName.includes(" ")) {
297
+ const noSpaceName = shortName.replace(/\s+/g, "_");
298
+ this.staticReferences.set(noSpaceName, bank);
299
+ }
300
+ });
301
+ this.bankRecord = swiftCodeRecord;
302
+ this.banksByName = nameRecord;
303
+ this.banksByShortName = shortNameRecord;
304
+ this.bankList = banks;
305
+ }
306
+ catch (error) {
307
+ console.error("Failed to initialize BankService:", error);
308
+ }
309
+ }
310
+ /**
311
+ * Gets all banks.
312
+ * @returns {Bank[]} Array of all banks
313
+ */
314
+ getAll() {
315
+ return this.bankList;
316
+ }
317
+ /**
318
+ * Gets all banks as a record.
319
+ * @returns {Record<string, Bank>} Record of bank SWIFT codes and bank objects
320
+ */
321
+ getAllAsRecord() {
322
+ return this.bankRecord;
323
+ }
324
+ /**
325
+ * Gets static bank references to be used by the Bank class.
326
+ * @returns {Map<string, Bank>} Map of static references
327
+ */
328
+ getStaticReferences() {
329
+ return this.staticReferences;
330
+ }
331
+ /**
332
+ * Retrieves a bank by its SWIFT code.
333
+ * @param {string} swiftCode The SWIFT code of the bank.
334
+ * @returns {Bank | undefined} The bank corresponding to the SWIFT code or `undefined` if not found.
335
+ */
336
+ fromSWIFTCode(swiftCode) {
337
+ if (!swiftCode || typeof swiftCode !== "string")
338
+ return;
339
+ return this.bankRecord[swiftCode.toUpperCase()];
340
+ }
341
+ /**
342
+ * Retrieves a bank by its name.
343
+ * @param {string} bankName The name of the bank.
344
+ * @returns {Bank | undefined} The bank corresponding to the name or `undefined` if not found.
345
+ */
346
+ fromBankName(bankName) {
347
+ if (!bankName || typeof bankName !== "string")
348
+ return;
349
+ // First try shortname exact match
350
+ const bankByShortName = this.banksByShortName[bankName.toUpperCase()];
351
+ if (bankByShortName)
352
+ return bankByShortName;
353
+ // Next try fullname exact match
354
+ const bankByName = this.banksByName[bankName.toUpperCase()];
355
+ if (bankByName)
356
+ return bankByName;
357
+ // If not found, try more lenient matching on full name
358
+ for (const [name, bankObj] of Object.entries(this.banksByName)) {
359
+ if (bankName.toUpperCase() === name.toUpperCase()) {
360
+ return bankObj;
361
+ }
362
+ }
363
+ // Try lenient matching on short name
364
+ for (const [shortName, bankObj] of Object.entries(this.banksByShortName)) {
365
+ if (bankName.toUpperCase() === shortName.toUpperCase()) {
366
+ return bankObj;
367
+ }
368
+ }
369
+ // Legacy fallback - case insensitive exact match
370
+ return this.bankList.find((bank) => bank.fullName.toLowerCase() === bankName.toLowerCase() ||
371
+ bankName.toLowerCase() === bank.shortName.toLowerCase());
372
+ }
373
+ /**
374
+ * Validates if a given SWIFT/BIC (Bank Identifier Code) is valid.
375
+ * @param {string | null | undefined} swiftCode - The SWIFT/BIC code to validate.
376
+ * @returns {boolean} Returns true if the SWIFT code is valid, false otherwise.
377
+ */
378
+ isValidSwiftCode(swiftCode) {
379
+ if (!swiftCode)
380
+ return false;
381
+ return !!this.fromSWIFTCode(swiftCode);
382
+ }
383
+ /**
384
+ * Validates if a given bank name is valid.
385
+ * @param {string | null | undefined} bankName - The bank name to validate.
386
+ * @returns {boolean} Returns true if the bank name is valid, false otherwise.
387
+ */
388
+ isValidBankName(bankName) {
389
+ if (!bankName)
390
+ return false;
391
+ return !!this.fromBankName(bankName);
392
+ }
393
+ /**
394
+ * Searches for banks that match the given search term.
395
+ * @param {string} searchTerm - The partial name or SWIFT code to search for.
396
+ * @param {number} [limit=10] - Maximum number of results to return.
397
+ * @returns {Bank[]} Array of matching banks, limited to specified count.
398
+ */
399
+ search(searchTerm, limit = 10) {
400
+ if (!searchTerm || typeof searchTerm !== "string")
401
+ return [];
402
+ const term = searchTerm.toLowerCase().trim();
403
+ if (term.length === 0)
404
+ return [];
405
+ const results = this.bankList.filter((bank) => bank.fullName.toLowerCase().includes(term) ||
406
+ bank.shortName.toLowerCase().includes(term) ||
407
+ bank.swiftCode.toLowerCase().includes(term));
408
+ return results.slice(0, limit);
409
+ }
410
+ /**
411
+ * Compares two Bank instances for equality by checking their full name, short name, and SWIFT code
412
+ *
413
+ * @param {Bank} bank1 - First bank to compare
414
+ * @param {Bank} bank2 - Second bank to compare
415
+ * @returns {boolean} True if banks are equal, false otherwise
416
+ * @private
417
+ */
418
+ compare(bank1, bank2) {
419
+ return (bank1.fullName === bank2.fullName &&
420
+ bank1.shortName === bank2.shortName &&
421
+ bank1.swiftCode === bank2.swiftCode);
422
+ }
423
+ /**
424
+ * Retrieves all SWIFT codes from the TZ_BANKS list.
425
+ * @returns {string[]} A list of all SWIFT codes in uppercase.
426
+ */
427
+ getAllSwiftCodes() {
428
+ return this.bankList.map((bank) => bank.swiftCode.toUpperCase());
429
+ }
430
+ /**
431
+ * Checks whether a given SWIFT code is in the correct format.
432
+ * @param {string} swiftCode The SWIFT code to check.
433
+ * @returns {boolean} `true` if the SWIFT code matches the expected format; `false` otherwise.
434
+ */
435
+ isValidSwiftCodeFormat(swiftCode) {
436
+ return SWIFT_CODE_REGEX.test(swiftCode);
437
+ }
438
+ }
439
+ (function setupStaticReferences() {
440
+ try {
441
+ const staticRefs = BankService.getInstance().getStaticReferences();
442
+ staticRefs.forEach((bank, key) => {
443
+ // deno-lint-ignore no-explicit-any
444
+ Bank[key] = bank;
445
+ });
446
+ }
447
+ catch (error) {
448
+ console.error("Failed to initialize Bank static properties:", error);
449
+ }
450
+ })();
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank.test.d.ts","sourceRoot":"","sources":["../../../../src/src/models/bank/bank.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from "./bank.js";
2
+ export * from "./antd_validator.js";
3
+ export * from "./types.js";
4
+ export * from "./utils.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/models/bank/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./bank.js";
2
+ export * from "./antd_validator.js";
3
+ export * from "./types.js";
4
+ export * from "./utils.js";
@@ -1,5 +1,7 @@
1
- export declare const KEBankSwiftCodesSet: Set<string>;
2
- export declare const TZBankSwiftCodesSet: Set<string>;
3
- export type KEBankSwiftCode = "KCBLKENX" | "EQBLKENX" | "KCOOKENX" | "SCBLKENX" | "BARCKENX" | "CBAFKENX" | "DTKEKENX" | "FABLKENA" | "CITIKENA" | "HFCOKENX" | "SBICKENX" | "NBKEKENX" | "AFRIKENX" | "GTBOKENX" | "IMBLKENX" | "ECOCKENX" | "BARBKENX" | "BKIDKENX" | "UNAFKENX" | "SGKENX";
4
1
  export type TZBankSwiftCode = "CORUTZTZ" | "PBZATZTZ" | "SCBLTZTX" | "SBICTZTX" | "CITITZTZ" | "EUAFTZTZ" | "DTKETZTZ" | "AKCOTZTZ" | "EXTNTZTZ" | "KLMJTZTZ" | "NLCBTZTX" | "NMIBTZTZ" | "KCBLTZTZ" | "HABLTZTZ" | "BKMYTZTZ" | "BARCTZTZ" | "IMBLTZTZ" | "CBAFTZTZ" | "DASUTZTZ" | "BARBTZTZ" | "AZANTZTZ" | "UCCTTZTZ" | "FMBZTZTX" | "ACTZTZTZ" | "BKIDTZTZ" | "UNAFTZTZ" | "MKCBTZTZ" | "ECOCTZTZ" | "MWCBTZTZ" | "FIRNTZTX" | "AMNNTZTZ" | "EQBLTZTZ" | "TAPBTZTZ" | "MBTLTZTZ" | "CNRBTZTZ" | "MWCOTZTZ" | "GTBITZTZ" | "YETMTZTZ" | "CDSHTZTZ";
5
- export type BankSwiftCode = KEBankSwiftCode | TZBankSwiftCode;
2
+ /**
3
+ * A Set containing all SWIFT codes from the provided list.
4
+ * Useful for quick lookups (e.g., checking if a string is a valid SWIFT code from this list).
5
+ */
6
+ export declare const TZBankSwiftCodesSet: Set<TZBankSwiftCode>;
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/models/bank/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf;;;GAGG;AACH,eAAO,MAAM,mBAAmB,sBAwC9B,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A Set containing all SWIFT codes from the provided list.
3
+ * Useful for quick lookups (e.g., checking if a string is a valid SWIFT code from this list).
4
+ */
5
+ export const TZBankSwiftCodesSet = new Set([
6
+ "CORUTZTZ",
7
+ "PBZATZTZ",
8
+ "SCBLTZTX",
9
+ "SBICTZTX",
10
+ "CITITZTZ",
11
+ "EUAFTZTZ",
12
+ "DTKETZTZ",
13
+ "AKCOTZTZ",
14
+ "EXTNTZTZ",
15
+ "KLMJTZTZ",
16
+ "NLCBTZTX",
17
+ "NMIBTZTZ",
18
+ "KCBLTZTZ",
19
+ "HABLTZTZ",
20
+ "BKMYTZTZ",
21
+ "BARCTZTZ",
22
+ "IMBLTZTZ",
23
+ "CBAFTZTZ",
24
+ "DASUTZTZ",
25
+ "BARBTZTZ",
26
+ "AZANTZTZ",
27
+ "UCCTTZTZ",
28
+ "FMBZTZTX",
29
+ "ACTZTZTZ",
30
+ "BKIDTZTZ",
31
+ "UNAFTZTZ",
32
+ "MKCBTZTZ",
33
+ "ECOCTZTZ",
34
+ "MWCBTZTZ",
35
+ "FIRNTZTX",
36
+ "AMNNTZTZ",
37
+ "EQBLTZTZ",
38
+ "TAPBTZTZ",
39
+ "MBTLTZTZ",
40
+ "CNRBTZTZ",
41
+ "MWCOTZTZ",
42
+ "GTBITZTZ",
43
+ "YETMTZTZ",
44
+ "CDSHTZTZ",
45
+ ]);
@@ -0,0 +1,8 @@
1
+ import { type TZBankSwiftCode } from "./types.js";
2
+ /**
3
+ * Type guard to check if a string is a valid TZBankSwiftCode.
4
+ * @param code The string to check.
5
+ * @returns True if the string is a member of the TZBankSwiftCode union type, false otherwise.
6
+ */
7
+ export declare function isValidTZBankSwiftCode(code: string): code is TZBankSwiftCode;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/src/models/bank/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,eAAe,CAE5E"}
@@ -0,0 +1,9 @@
1
+ import { TZBankSwiftCodesSet, } from "./types.js";
2
+ /**
3
+ * Type guard to check if a string is a valid TZBankSwiftCode.
4
+ * @param code The string to check.
5
+ * @returns True if the string is a member of the TZBankSwiftCode union type, false otherwise.
6
+ */
7
+ export function isValidTZBankSwiftCode(code) {
8
+ return TZBankSwiftCodesSet.has(code);
9
+ }
@@ -24,15 +24,9 @@
24
24
  * The addition of currency support through the getCurrency() method leverages
25
25
  * the Currency model while maintaining a clean separation of concerns.
26
26
  */
27
- import { Currency } from "@models/currency/currency.js";
28
- import { CurrencyCode } from "@models/currency/currency.types.js";
29
- import { ISO2CountryCode, ISO3CountryCode, CountryCode } from "./country.types.js";
30
- import { z } from "zod";
31
- import { CountryJSONSchema } from "./country.schema.js";
32
- /**
33
- * Infer the CountryJSON type from the schema
34
- */
35
- export type CountryJSON = z.infer<typeof CountryJSONSchema>;
27
+ import { Currency } from "../currency/currency.js";
28
+ import type { CurrencyCode } from "../currency/index.js";
29
+ import type { CountryCode, ISO2CountryCode, ISO3CountryCode } from "./types.js";
36
30
  /**
37
31
  * Enum for continents
38
32
  */
@@ -84,7 +78,6 @@ export declare class Country {
84
78
  private readonly _continent;
85
79
  private readonly _region;
86
80
  private readonly _currencyCode;
87
- private readonly _dialCode;
88
81
  static readonly AF: Country;
89
82
  static readonly AX: Country;
90
83
  static readonly AL: Country;
@@ -585,9 +578,8 @@ export declare class Country {
585
578
  * @param {CONTINENT} _continent - The continent where the country is located
586
579
  * @param {SUB_REGION} _region - The region within the continent where the country is located
587
580
  * @param {string | null} _currencyCode - The ISO currency code used in the country
588
- * @param {number} _dialCode - The dial code used in the country
589
581
  */
590
- constructor(token: symbol, _name: string, _iso2: ISO2CountryCode, _nameOfficial: string | undefined, _iso3: ISO3CountryCode, _flagEmoji: string | undefined, _continent: CONTINENT | undefined, _region: SUB_REGION | undefined, _currencyCode: (CurrencyCode | null) | undefined, _dialCode: number);
582
+ constructor(_name: string, _iso2: ISO2CountryCode, _nameOfficial: string, _iso3: ISO3CountryCode, _flagEmoji?: string, _continent?: CONTINENT, _region?: SUB_REGION, _currencyCode?: CurrencyCode | null);
591
583
  /**
592
584
  * Gets the common name of the country.
593
585
  * @returns {string} The common name of the country
@@ -628,11 +620,6 @@ export declare class Country {
628
620
  * @returns {string | null} The ISO currency code of the country, or null if not available
629
621
  */
630
622
  get currencyCode(): CurrencyCode | null;
631
- /**
632
- * Gets the dial code used in the country.
633
- * @returns {number} The dial code of the country
634
- */
635
- get dialCode(): number;
636
623
  /**
637
624
  * Gets the Currency instance for this country.
638
625
  * @returns {Currency | undefined} The Currency instance or undefined if no currency is assigned
@@ -722,26 +709,6 @@ export declare class Country {
722
709
  * @returns Type predicate indicating if the value is a valid Country
723
710
  */
724
711
  static is(obj: unknown): obj is Country;
725
- /**
726
- * Serializes the Country instance to a JSON-compatible object
727
- */
728
- toJSON(): CountryJSON;
729
- /**
730
- * Serializes the Country instance to a JSON string
731
- */
732
- toJSONString(): string;
733
- /**
734
- * Creates a Country instance from a JSON-compatible object or string
735
- */
736
- static fromJSON(json: CountryJSON | string): Country | undefined;
737
- /**
738
- * Creates a Country instance from a JSON string
739
- */
740
- static fromJSONString(jsonString: string): Country | undefined;
741
- /**
742
- * Type guard to check if an object is a valid CountryJSON using Zod validation
743
- */
744
- static isCountryJSON(obj: unknown): obj is CountryJSON;
745
712
  }
746
713
  /**
747
714
  * Service for managing country data.
@@ -852,3 +819,4 @@ export declare class CountryService {
852
819
  */
853
820
  compare(country1: Country, country2: Country): boolean;
854
821
  }
822
+ //# sourceMappingURL=country.d.ts.map