@temboplus/frontend-core 0.2.9 → 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 -14
  197. package/esm/src/models/phone_number/format.d.ts.map +0 -1
  198. package/esm/src/models/phone_number/format.js +0 -14
  199. package/esm/src/models/phone_number/global/phone_number.d.ts +0 -161
  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 -453
  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 -135
  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 -278
  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 -14
  386. package/script/src/models/phone_number/format.d.ts.map +0 -1
  387. package/script/src/models/phone_number/format.js +0 -17
  388. package/script/src/models/phone_number/global/phone_number.d.ts +0 -161
  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 -457
  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 -135
  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 -282
  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,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PHONENUMBER_VALIDATOR = exports.TZ_PHONE_NUMBER_REGEX = void 0;
4
- const phone_number_js_1 = require("./phone_number.js");
5
- /**
6
- * Validates a Tanzanian phone number according to specified format rules.
7
- * This validator is designed for Ant Design Form components and performs the following validations:
8
- * 1. Required field validation (if specified in rules)
9
- * 2. Format validation for valid Tanzanian phone numbers using TZ_PHONE_NUMBER_REGEX
10
- *
11
- * The validator accepts phone numbers in the following formats:
12
- * Format 1: With prefix
13
- * - Starting with 255, 0, or +255
14
- * - Followed by valid operator codes:
15
- * • Vodacom: 74, 75, 76, 78, 79
16
- * • Tigo: 65, 67, 71
17
- * • Airtel: 68, 69, 77
18
- * • Halotel: 61, 62
19
- * - Followed by 7 digits
20
- *
21
- * Format 2: Without prefix
22
- * - Starting directly with operator code (listed above)
23
- * - Followed by 7 digits
24
- *
25
- * @param {RuleObject} rule - Ant Design rule object containing validation rules
26
- * @param {string | null | undefined} value - The phone number to validate
27
- * @returns {Promise<void>} Resolves if validation passes, rejects with Error if validation fails
28
- * @throws {Error} Throws an error with a descriptive message for validation failures:
29
- * - "Phone number is required." - When field is required but empty/null/undefined
30
- * - "Invalid phone number format." - When value doesn't match expected TZ phone number format
31
- *
32
- * @example
33
- * // Usage in Ant Design form rules:
34
- * const rules = [
35
- * {
36
- * required: true,
37
- * validator: PHONENUMBER_VALIDATOR
38
- * }
39
- * ];
40
- *
41
- * // Valid inputs:
42
- * // "+255742345678" -> International format with plus (Vodacom)
43
- * // "255652345678" -> International format without plus (Tigo)
44
- * // "0712345678" -> Local format with leading zero (Tigo)
45
- * // "652345678" -> Local format without prefix (Tigo)
46
- *
47
- * // Invalid inputs:
48
- * // "+255722345678" -> Invalid operator code (72)
49
- * // "652345" -> Too short
50
- * // "6523456789" -> Too long
51
- * // "abc65234567" -> Non-numeric characters
52
- * // "" -> Empty when required
53
- * // undefined -> Missing when required
54
- * // null -> Null when required
55
- *
56
- * @notes
57
- * The validator uses TZ_PHONE_NUMBER_REGEX which matches:
58
- * ^(?:255|0|\+255)(74|75|76|78|79|68|69|71|65|67|77|62|61)\d{7}$|^(?:74|75|76|78|79|68|69|71|65|67|77|62|61)\d{7}$
59
- *
60
- * This breaks down to:
61
- * ^ -> Start of string
62
- * (?:255|0|\+255) -> Country code group: 255, 0, or +255
63
- * ( -> Start operator code group
64
- * 74|75|76|78|79 -> Vodacom prefixes
65
- * |68|69|71 -> Tigo prefixes
66
- * |65|67|77 -> Airtel prefixes
67
- * |62|61 -> Halotel prefixes
68
- * ) -> End operator code group
69
- * \d{7} -> Exactly 7 digits
70
- * $ -> End of string
71
- * | -> OR
72
- * ^ -> Start of string (alternative format)
73
- * (same operator codes as above)
74
- * \d{7} -> Exactly 7 digits
75
- * $ -> End of string
76
- */
77
- exports.TZ_PHONE_NUMBER_REGEX = /^(?:255|0|\+255)(74|75|76|78|79|68|69|71|65|67|77|62|61)\d{7}$|^(?:74|75|76|78|79|68|69|71|65|67|77|62|61)\d{7}$/;
78
- const PHONENUMBER_VALIDATOR = (rule, value) => {
79
- const phoneString = value?.toString().trim();
80
- // If field is empty/undefined/null
81
- if (!phoneString) {
82
- // Only throw if the field is required
83
- if (rule.required) {
84
- return Promise.reject(new Error("Phone number is required."));
85
- }
86
- // If field is not required and empty, validation passes
87
- return Promise.resolve(undefined);
88
- }
89
- const phone = phone_number_js_1.TZPhoneNumber.from(phoneString);
90
- if (phone)
91
- return Promise.resolve(phone);
92
- return Promise.reject(new Error("Invalid phone number format."));
93
- };
94
- exports.PHONENUMBER_VALIDATOR = PHONENUMBER_VALIDATOR;
@@ -1 +0,0 @@
1
- {"version":3,"file":"antdvalidator.test.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/antdvalidator.test.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- /**
2
- * Represents available mobile network operators in Tanzania
3
- * @enum {string}
4
- */
5
- export declare enum NetworkOperator {
6
- VODACOM = "Vodacom",
7
- AIRTEL = "Airtel",
8
- TIGO = "Tigo",
9
- HALOTEL = "Halotel"
10
- }
11
- /**
12
- * Defines the structure for a mobile network operator's information
13
- */
14
- export interface NetworkOperatorInfo {
15
- /** Unique identifier for the network operator */
16
- id: NetworkOperator;
17
- /** List of mobile number prefixes assigned to this operator */
18
- mobileNumberPrefixes: string[];
19
- /** Display name of the network operator */
20
- displayName: string;
21
- /** Mobile money service name offered by the operator */
22
- mobileMoneyService: string;
23
- /** Brand color associated with the operator */
24
- brandColor: string;
25
- }
26
- /**
27
- * Comprehensive information about mobile network operators and their services
28
- */
29
- export declare const NETWORK_OPERATOR_CONFIG: Record<NetworkOperator, NetworkOperatorInfo>;
30
- //# sourceMappingURL=network_operator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"network_operator.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/network_operator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IAIjB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,EAAE,EAAE,eAAe,CAAC;IAEpB,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAE/B,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IAEpB,wDAAwD;IACxD,kBAAkB,EAAE,MAAM,CAAC;IAE3B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,eAAe,EACf,mBAAmB,CA8BpB,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NETWORK_OPERATOR_CONFIG = exports.NetworkOperator = void 0;
4
- /**
5
- * Represents available mobile network operators in Tanzania
6
- * @enum {string}
7
- */
8
- var NetworkOperator;
9
- (function (NetworkOperator) {
10
- NetworkOperator["VODACOM"] = "Vodacom";
11
- NetworkOperator["AIRTEL"] = "Airtel";
12
- // Preserve the value "Tigo" bse our backend still recognizes it for payout channel codes
13
- // It should not be seen anywhere for we have NetworkOperatorInfo.displayName & NetworkOperatorInfo.mobileMoneyService
14
- // as labels we can use on the frontend
15
- NetworkOperator["TIGO"] = "Tigo";
16
- NetworkOperator["HALOTEL"] = "Halotel";
17
- })(NetworkOperator || (exports.NetworkOperator = NetworkOperator = {}));
18
- /**
19
- * Comprehensive information about mobile network operators and their services
20
- */
21
- exports.NETWORK_OPERATOR_CONFIG = {
22
- [NetworkOperator.VODACOM]: {
23
- id: NetworkOperator.VODACOM,
24
- mobileNumberPrefixes: ["74", "75", "76"],
25
- displayName: "Vodacom",
26
- mobileMoneyService: "M-Pesa",
27
- brandColor: "red",
28
- },
29
- [NetworkOperator.AIRTEL]: {
30
- id: NetworkOperator.AIRTEL,
31
- mobileNumberPrefixes: ["78", "79", "68", "69"],
32
- displayName: "Airtel",
33
- mobileMoneyService: "Airtel Money",
34
- brandColor: "volcano",
35
- },
36
- [NetworkOperator.TIGO]: {
37
- id: NetworkOperator.TIGO,
38
- mobileNumberPrefixes: ["71", "65", "67", "77"],
39
- displayName: "Yas",
40
- mobileMoneyService: "Mixx by Yas",
41
- brandColor: "yellow",
42
- },
43
- [NetworkOperator.HALOTEL]: {
44
- id: NetworkOperator.HALOTEL,
45
- mobileNumberPrefixes: ["62", "61"],
46
- displayName: "Halotel",
47
- mobileMoneyService: "HaloPesa",
48
- brandColor: "orange",
49
- },
50
- };
@@ -1,135 +0,0 @@
1
- /**
2
- * @fileoverview
3
- *
4
- * # Tanzania Phone Number Management System
5
- *
6
- * ## Problem Statement
7
- * Tanzania's phone number system requires specific validation and formatting rules:
8
- *
9
- * 1. Phone numbers can be entered in multiple formats:
10
- * - International format: "+255712345678"
11
- * - Local format with country code: "255712345678"
12
- * - Local format with leading zero: "0712345678"
13
- * - Compact format: "712345678"
14
- *
15
- * 2. Valid numbers must:
16
- * - Have exactly 9 digits after removing prefixes
17
- * - Start with a valid network operator prefix
18
- * - Contain only numeric characters
19
- *
20
- * 3. Each network operator has specific prefixes:
21
- * - Vodacom: 71, 74, 75, etc.
22
- * - Airtel: 68, 69, etc.
23
- * - Tigo: 65, 67, etc.
24
- * - Halotel: 62, etc.
25
- *
26
- * 4. Phone numbers can be formatted in the following ways:
27
- * - International format: "+255 XXX XXX XXX"
28
- * - National format: "0XXX XXX XXX"
29
- * - Compact format: "XXXXXXXXX"
30
- * - RFC3966 format: "tel:+255XXXXXXXXX"
31
- *
32
- * ## Solution
33
- * The TZPhoneNumber class provides:
34
- * 1. Parsing and validation of different input formats
35
- * 2. Standardized storage in compact format
36
- * 3. Formatting options for display and API use
37
- * 4. Network operator identification
38
- */
39
- import { type NetworkOperatorInfo } from "./network_operator.js";
40
- import { PhoneNumberFormat } from "../format.js";
41
- /**
42
- * Represents a TZ phone number
43
- */
44
- export declare class TZPhoneNumber {
45
- /**
46
- * Stores the phone number in a compact format excluding country code and the initial '0'.
47
- */
48
- private _compactNumber;
49
- /**
50
- * Private constructor to prevent direct instantiation.
51
- * Use TZPhoneNumber.from() instead.
52
- *
53
- * @param compactNumber - The phone number in a compact format (e.g., "712345678").
54
- */
55
- private constructor();
56
- /**
57
- * Gets the compact number (national number without formatting)
58
- */
59
- get compactNumber(): string;
60
- /**
61
- * Formats the phone number according to the specified format
62
- *
63
- * @param format - The desired format from GlobalPhoneNumberFormat
64
- * @returns The formatted phone number string
65
- */
66
- getWithFormat(format: PhoneNumberFormat): string;
67
- /**
68
- * Formats the phone number in international format with spaces
69
- * Format: +255 XXX XXX XXX
70
- */
71
- private formatInternational;
72
- /**
73
- * Formats the phone number in national format with spaces
74
- * Format: 0XXX XXX XXX
75
- */
76
- private formatNational;
77
- /**
78
- * Formats the phone number according to RFC3966
79
- * Format: tel:+255XXXXXXXXX
80
- */
81
- private formatRFC3966;
82
- /**
83
- * Returns the formatted label of the phone number using the international format.
84
- *
85
- * @returns The phone number label in international format.
86
- */
87
- get label(): string;
88
- /**
89
- * Derives the network operator information associated with the phone number by checking its prefix.
90
- *
91
- * @returns The `NetworkOperatorInfo` object that matches the phone number prefix.
92
- */
93
- get networkOperator(): NetworkOperatorInfo;
94
- /**
95
- * Creates a `TZPhoneNumber` instance from a given string.
96
- *
97
- * @param s - The input phone number string in various formats (e.g., "+255712345678", "0712345678").
98
- * @returns A `TZPhoneNumber` instance if valid, otherwise `undefined`.
99
- */
100
- static from(input: string): TZPhoneNumber | undefined;
101
- /**
102
- * Checks if a string can be constructed into a valid phone number object.
103
- * @param {string | undefined} input - The string to validate as a phone number.
104
- * @returns {boolean} - Returns true if the input can be constructed into a valid phone number object,
105
- * false if the input is undefined, empty, or cannot be parsed.
106
- */
107
- static canConstruct(input?: string | null): boolean;
108
- /**
109
- * Checks if an unknown value contains valid data to construct a TZPhoneNumber instance.
110
- * Validates the structural integrity of the phone number object.
111
- *
112
- * @param {unknown} obj - The value to validate.
113
- * @returns {obj is TZPhoneNumber} Type predicate indicating if the value has a valid phone number structure.
114
- *
115
- * @example
116
- * const maybePhone = JSON.parse(someData);
117
- * if (TZPhoneNumber.is(maybePhone)) {
118
- * // maybePhone is typed as TZPhoneNumber
119
- * console.log(maybePhone.label);
120
- * }
121
- *
122
- * @remarks
123
- * Validates:
124
- * - Has required compactNumber property
125
- * - compactNumber is a 9-digit string
126
- * - Prefix matches a valid network operator
127
- */
128
- static is(obj: unknown): obj is TZPhoneNumber;
129
- /**
130
- * Checks the validity of the phone number data
131
- * @returns true if the phone number information is available and valid
132
- */
133
- validate(): boolean;
134
- }
135
- //# sourceMappingURL=phone_number.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"phone_number.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/phone_number.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,OAAO,CAAC,cAAc,CAAS;IAE/B;;;;;OAKG;IACH,OAAO;IAIP;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM;IAmBhD;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAMtB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;OAIG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;OAIG;IACH,IAAI,eAAe,IAAI,mBAAmB,CAMzC;IAED;;;;;OAKG;WACW,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAyC5D;;;;;OAKG;WACW,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAW1D;;;;;;;;;;;;;;;;;;;OAmBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,aAAa;IAYpD;;;OAGG;IACI,QAAQ,IAAI,OAAO;CAO3B"}
@@ -1,282 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview
4
- *
5
- * # Tanzania Phone Number Management System
6
- *
7
- * ## Problem Statement
8
- * Tanzania's phone number system requires specific validation and formatting rules:
9
- *
10
- * 1. Phone numbers can be entered in multiple formats:
11
- * - International format: "+255712345678"
12
- * - Local format with country code: "255712345678"
13
- * - Local format with leading zero: "0712345678"
14
- * - Compact format: "712345678"
15
- *
16
- * 2. Valid numbers must:
17
- * - Have exactly 9 digits after removing prefixes
18
- * - Start with a valid network operator prefix
19
- * - Contain only numeric characters
20
- *
21
- * 3. Each network operator has specific prefixes:
22
- * - Vodacom: 71, 74, 75, etc.
23
- * - Airtel: 68, 69, etc.
24
- * - Tigo: 65, 67, etc.
25
- * - Halotel: 62, etc.
26
- *
27
- * 4. Phone numbers can be formatted in the following ways:
28
- * - International format: "+255 XXX XXX XXX"
29
- * - National format: "0XXX XXX XXX"
30
- * - Compact format: "XXXXXXXXX"
31
- * - RFC3966 format: "tel:+255XXXXXXXXX"
32
- *
33
- * ## Solution
34
- * The TZPhoneNumber class provides:
35
- * 1. Parsing and validation of different input formats
36
- * 2. Standardized storage in compact format
37
- * 3. Formatting options for display and API use
38
- * 4. Network operator identification
39
- */
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.TZPhoneNumber = void 0;
42
- const network_operator_js_1 = require("./network_operator.js");
43
- const format_js_1 = require("../format.js");
44
- /**
45
- * Represents a TZ phone number
46
- */
47
- class TZPhoneNumber {
48
- /**
49
- * Private constructor to prevent direct instantiation.
50
- * Use TZPhoneNumber.from() instead.
51
- *
52
- * @param compactNumber - The phone number in a compact format (e.g., "712345678").
53
- */
54
- constructor(compactNumber) {
55
- /**
56
- * Stores the phone number in a compact format excluding country code and the initial '0'.
57
- */
58
- Object.defineProperty(this, "_compactNumber", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: void 0
63
- });
64
- this._compactNumber = compactNumber;
65
- }
66
- /**
67
- * Gets the compact number (national number without formatting)
68
- */
69
- get compactNumber() {
70
- return this._compactNumber;
71
- }
72
- /**
73
- * Formats the phone number according to the specified format
74
- *
75
- * @param format - The desired format from GlobalPhoneNumberFormat
76
- * @returns The formatted phone number string
77
- */
78
- getWithFormat(format) {
79
- switch (format) {
80
- case format_js_1.PhoneNumberFormat.INTERNATIONAL:
81
- // Format: +255 XXX XXX XXX
82
- return this.formatInternational();
83
- case format_js_1.PhoneNumberFormat.NATIONAL:
84
- // Format: 0XXX XXX XXX
85
- return this.formatNational();
86
- case format_js_1.PhoneNumberFormat.COMPACT:
87
- // Format: XXXXXXXXX (just the 9 digits)
88
- return this._compactNumber;
89
- case format_js_1.PhoneNumberFormat.RFC3966:
90
- // Format: tel:+255XXXXXXXXX
91
- return this.formatRFC3966();
92
- default:
93
- return `+255${this._compactNumber}`;
94
- }
95
- }
96
- /**
97
- * Formats the phone number in international format with spaces
98
- * Format: +255 XXX XXX XXX
99
- */
100
- formatInternational() {
101
- const num = this._compactNumber;
102
- // Insert spaces: +255 XXX XXX XXX
103
- return `+255 ${num.substring(0, 3)} ${num.substring(3, 6)} ${num.substring(6)}`;
104
- }
105
- /**
106
- * Formats the phone number in national format with spaces
107
- * Format: 0XXX XXX XXX
108
- */
109
- formatNational() {
110
- const num = this._compactNumber;
111
- // Insert spaces: 0XXX XXX XXX
112
- return `0${num.substring(0, 3)} ${num.substring(3, 6)} ${num.substring(6)}`;
113
- }
114
- /**
115
- * Formats the phone number according to RFC3966
116
- * Format: tel:+255XXXXXXXXX
117
- */
118
- formatRFC3966() {
119
- return `tel:+255${this._compactNumber}`;
120
- }
121
- /**
122
- * Returns the formatted label of the phone number using the international format.
123
- *
124
- * @returns The phone number label in international format.
125
- */
126
- get label() {
127
- return this.getWithFormat(format_js_1.PhoneNumberFormat.INTERNATIONAL);
128
- }
129
- /**
130
- * Derives the network operator information associated with the phone number by checking its prefix.
131
- *
132
- * @returns The `NetworkOperatorInfo` object that matches the phone number prefix.
133
- */
134
- get networkOperator() {
135
- const prefix = this._compactNumber.substring(0, 2);
136
- const result = Object.values(network_operator_js_1.NETWORK_OPERATOR_CONFIG).find((operator) => operator.mobileNumberPrefixes.includes(prefix));
137
- return result;
138
- }
139
- /**
140
- * Creates a `TZPhoneNumber` instance from a given string.
141
- *
142
- * @param s - The input phone number string in various formats (e.g., "+255712345678", "0712345678").
143
- * @returns A `TZPhoneNumber` instance if valid, otherwise `undefined`.
144
- */
145
- static from(input) {
146
- try {
147
- // Clean the input (remove all non-digits except the leading '+')
148
- const hasPlus = input.trim().startsWith("+");
149
- let number = input.replace(/\D/g, "");
150
- number = hasPlus ? `+${number}` : number;
151
- if (number.length === 0)
152
- return undefined;
153
- const isOnlyDigits = isOnlyDigitsOrPlus(number);
154
- if (!isOnlyDigits)
155
- return;
156
- let compactNumber;
157
- // Extract the compact number by removing country or local dialing prefixes.
158
- if (number.startsWith("+255")) {
159
- compactNumber = number.substring(4);
160
- }
161
- else if (number.startsWith("255")) {
162
- compactNumber = number.substring(3);
163
- }
164
- else if (number.startsWith("0")) {
165
- compactNumber = number.substring(1);
166
- }
167
- else {
168
- compactNumber = number;
169
- }
170
- // Validate that the compact number length is correct.
171
- if (compactNumber.length !== 9)
172
- return;
173
- // Check if the compact number matches any network operator prefix.
174
- const prefix = compactNumber.substring(0, 2);
175
- const operator = Object.values(network_operator_js_1.NETWORK_OPERATOR_CONFIG).find((op) => op.mobileNumberPrefixes.includes(prefix));
176
- if (!operator)
177
- return;
178
- return new TZPhoneNumber(compactNumber);
179
- }
180
- catch (_) {
181
- return;
182
- }
183
- }
184
- /**
185
- * Checks if a string can be constructed into a valid phone number object.
186
- * @param {string | undefined} input - The string to validate as a phone number.
187
- * @returns {boolean} - Returns true if the input can be constructed into a valid phone number object,
188
- * false if the input is undefined, empty, or cannot be parsed.
189
- */
190
- static canConstruct(input) {
191
- if (!input || typeof input !== "string")
192
- return false;
193
- const text = removeSpaces(input.trim());
194
- if (text.length === 0)
195
- return false;
196
- const phone = TZPhoneNumber.from(text);
197
- return phone !== undefined;
198
- }
199
- /**
200
- * Checks if an unknown value contains valid data to construct a TZPhoneNumber instance.
201
- * Validates the structural integrity of the phone number object.
202
- *
203
- * @param {unknown} obj - The value to validate.
204
- * @returns {obj is TZPhoneNumber} Type predicate indicating if the value has a valid phone number structure.
205
- *
206
- * @example
207
- * const maybePhone = JSON.parse(someData);
208
- * if (TZPhoneNumber.is(maybePhone)) {
209
- * // maybePhone is typed as TZPhoneNumber
210
- * console.log(maybePhone.label);
211
- * }
212
- *
213
- * @remarks
214
- * Validates:
215
- * - Has required compactNumber property
216
- * - compactNumber is a 9-digit string
217
- * - Prefix matches a valid network operator
218
- */
219
- static is(obj) {
220
- if (!obj || typeof obj !== "object")
221
- return false;
222
- const maybePhone = obj;
223
- // Check if _compactNumber exists and is string
224
- if (typeof maybePhone._compactNumber !== "string")
225
- return false;
226
- const compactNumber = maybePhone._compactNumber;
227
- return TZPhoneNumber.canConstruct(compactNumber);
228
- }
229
- /**
230
- * Checks the validity of the phone number data
231
- * @returns true if the phone number information is available and valid
232
- */
233
- validate() {
234
- try {
235
- return TZPhoneNumber.canConstruct(this._compactNumber);
236
- }
237
- catch (_) {
238
- return false;
239
- }
240
- }
241
- }
242
- exports.TZPhoneNumber = TZPhoneNumber;
243
- /**
244
- * Removes all whitespace characters from the given string.
245
- *
246
- * This function replaces all occurrences of spaces, tabs, and other
247
- * whitespace characters (including multiple spaces) in the input string
248
- * with an empty string, effectively removing them.
249
- *
250
- * @param {string} input - The input string from which spaces should be removed.
251
- * @returns {string} A new string with all whitespace characters removed.
252
- *
253
- * @example
254
- * removeSpaces(" Hello World "); // Returns: "HelloWorld"
255
- * removeSpaces("NoSpacesHere"); // Returns: "NoSpacesHere"
256
- * removeSpaces(" "); // Returns: ""
257
- */
258
- function removeSpaces(input) {
259
- return input.replace(/\s+/g, "");
260
- }
261
- /**
262
- * Checks if a given string contains only digits or a `+` prefix followed by digits.
263
- *
264
- * This function validates that the input string:
265
- * - Can optionally start with a `+` sign.
266
- * - Must have one or more digits after the optional `+`.
267
- * - Does not contain any other characters besides digits and the `+` prefix.
268
- *
269
- * @param {string} input - The input string to validate.
270
- * @returns {boolean} `true` if the string contains only digits or a `+` prefix followed by digits; otherwise, `false`.
271
- *
272
- * @example
273
- * isOnlyDigitsOrPlus("12345"); // Returns: true
274
- * isOnlyDigitsOrPlus("+12345"); // Returns: true
275
- * isOnlyDigitsOrPlus("123a45"); // Returns: false
276
- * isOnlyDigitsOrPlus("+"); // Returns: false
277
- * isOnlyDigitsOrPlus(""); // Returns: false
278
- */
279
- function isOnlyDigitsOrPlus(input) {
280
- const digitWithPlusRegex = /^\+?\d+$/;
281
- return digitWithPlusRegex.test(input);
282
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"phone_number.test.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/phone_number.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from "./report_manager.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/reports/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -1,17 +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("./report_manager.js"), exports);
@@ -1 +0,0 @@
1
- {"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,CAOhB;IAEF;;;;OAIG;IACU,cAAc,CAAC,IAAI,EAAE;QAChC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,UAAU,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;QAEvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmFjB;;;;;OAKG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,mBAAmB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;;;OAIG;IACH,OAAO,CAAC,qCAAqC;IA6B7C;;;;OAIG;IACH,OAAO,CAAC,SAAS,CACyB;CAC3C"}