@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.
- package/README.md +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/payout-countries.d.ts +2 -0
- package/dist/index.cjs.js +8 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +5 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/models/amount/amount.d.ts +733 -0
- package/dist/models/amount/index.d.ts +1 -0
- package/dist/models/bank/bank.d.ts +106 -0
- package/dist/models/bank/bank.schema.d.ts +3 -0
- package/{esm/src/models/bank/types.d.ts → dist/models/bank/bank.types.d.ts} +4 -6
- package/dist/models/bank/bank.validation.d.ts +80 -0
- package/dist/models/bank/index.d.ts +4 -0
- package/{script/src → dist}/models/country/country.d.ts +11 -5
- package/dist/models/country/country.schema.d.ts +46 -0
- package/{script/src/models/country/types.d.ts → dist/models/country/country.types.d.ts} +0 -1
- package/{esm/src/models/country/utils.js → dist/models/country/country.validation.d.ts} +11 -10
- package/dist/models/country/index.d.ts +4 -0
- package/{script/src → dist}/models/currency/currency.d.ts +2 -3
- package/dist/models/currency/currency.schema.d.ts +8 -0
- package/{esm/src/models/currency/types.d.ts → dist/models/currency/currency.types.d.ts} +1 -2
- package/dist/models/currency/currency.validation.d.ts +11 -0
- package/dist/models/currency/index.d.ts +4 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/phone-number/index.d.ts +6 -0
- package/dist/models/phone-number/mno/index.d.ts +6 -0
- package/dist/models/phone-number/mno/ke/mobile-number.ke-mnos.d.ts +22 -0
- package/dist/models/phone-number/mno/ke/mobile-number.ke.d.ts +45 -0
- package/dist/models/phone-number/mno/mno.types.d.ts +63 -0
- package/dist/models/phone-number/mno/mno.utils.d.ts +40 -0
- package/dist/models/phone-number/mno/tz/mobile-number.tz-mnos.d.ts +48 -0
- package/dist/models/phone-number/mno/tz/mobile-number.tz.d.ts +44 -0
- package/dist/models/phone-number/phone-number.d.ts +78 -0
- package/dist/models/phone-number/phone-number.factory.d.ts +52 -0
- package/dist/models/phone-number/phone-number.service.d.ts +36 -0
- package/dist/models/phone-number/phone-number.types.d.ts +115 -0
- package/dist/models/phone-number/phone-number.utils.d.ts +67 -0
- package/dist/reports/index.d.ts +1 -0
- package/{script/src/reports/report_manager.d.ts → dist/reports/report-manager.d.ts} +0 -1
- package/{esm/src/config/config_service.d.ts → dist/services/config.d.ts} +6 -5
- package/dist/services/index.d.ts +2 -0
- package/dist/services/logger.d.ts +1 -0
- package/{script/src → dist}/utils/id.d.ts +7 -3
- package/dist/utils/index.d.ts +3 -0
- package/{esm/src → dist}/utils/text.d.ts +13 -6
- package/{script/src → dist}/utils/time.d.ts +9 -4
- package/package.json +55 -21
- package/LICENSE +0 -7
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +0 -1
- package/esm/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/esm/mod.d.ts +0 -5
- package/esm/mod.d.ts.map +0 -1
- package/esm/mod.js +0 -4
- package/esm/package.json +0 -3
- package/esm/src/config/config_service.d.ts.map +0 -1
- package/esm/src/config/config_service.js +0 -19
- package/esm/src/config/index.d.ts +0 -2
- package/esm/src/config/index.d.ts.map +0 -1
- package/esm/src/config/index.js +0 -1
- package/esm/src/data/banks_tz.d.ts +0 -7
- package/esm/src/data/banks_tz.d.ts.map +0 -1
- package/esm/src/data/banks_tz.js +0 -197
- package/esm/src/data/countries.d.ts +0 -39
- package/esm/src/data/countries.d.ts.map +0 -1
- package/esm/src/data/countries.js +0 -2475
- package/esm/src/data/currencies.d.ts +0 -1901
- package/esm/src/data/currencies.d.ts.map +0 -1
- package/esm/src/data/currencies.js +0 -1073
- package/esm/src/data/phone_patterns.d.ts +0 -3809
- package/esm/src/data/phone_patterns.d.ts.map +0 -1
- package/esm/src/data/phone_patterns.js +0 -2325
- package/esm/src/models/amount/amount.d.ts +0 -53
- package/esm/src/models/amount/amount.d.ts.map +0 -1
- package/esm/src/models/amount/amount.js +0 -190
- package/esm/src/models/amount/amount.test.d.ts.map +0 -1
- package/esm/src/models/amount/antd_validator.d.ts +0 -40
- package/esm/src/models/amount/antd_validator.d.ts.map +0 -1
- package/esm/src/models/amount/antd_validator.js +0 -58
- package/esm/src/models/amount/antd_validator.test.d.ts.map +0 -1
- package/esm/src/models/amount/index.d.ts +0 -3
- package/esm/src/models/amount/index.d.ts.map +0 -1
- package/esm/src/models/amount/index.js +0 -2
- package/esm/src/models/bank/antd_validator.d.ts +0 -11
- package/esm/src/models/bank/antd_validator.d.ts.map +0 -1
- package/esm/src/models/bank/antd_validator.js +0 -26
- package/esm/src/models/bank/antd_validator.test.d.ts.map +0 -1
- package/esm/src/models/bank/bank.d.ts +0 -257
- package/esm/src/models/bank/bank.d.ts.map +0 -1
- package/esm/src/models/bank/bank.js +0 -450
- package/esm/src/models/bank/bank.test.d.ts.map +0 -1
- package/esm/src/models/bank/index.d.ts +0 -5
- package/esm/src/models/bank/index.d.ts.map +0 -1
- package/esm/src/models/bank/index.js +0 -4
- package/esm/src/models/bank/types.d.ts.map +0 -1
- package/esm/src/models/bank/types.js +0 -45
- package/esm/src/models/bank/utils.d.ts +0 -8
- package/esm/src/models/bank/utils.d.ts.map +0 -1
- package/esm/src/models/bank/utils.js +0 -9
- package/esm/src/models/country/country.d.ts +0 -822
- package/esm/src/models/country/country.d.ts.map +0 -1
- package/esm/src/models/country/country.js +0 -737
- package/esm/src/models/country/country.test.d.ts.map +0 -1
- package/esm/src/models/country/index.d.ts +0 -4
- package/esm/src/models/country/index.d.ts.map +0 -1
- package/esm/src/models/country/index.js +0 -3
- package/esm/src/models/country/types.d.ts +0 -63
- package/esm/src/models/country/types.d.ts.map +0 -1
- package/esm/src/models/country/types.js +0 -105
- package/esm/src/models/country/utils.d.ts +0 -21
- package/esm/src/models/country/utils.d.ts.map +0 -1
- package/esm/src/models/currency/currency.d.ts +0 -465
- package/esm/src/models/currency/currency.d.ts.map +0 -1
- package/esm/src/models/currency/currency.js +0 -471
- package/esm/src/models/currency/currency.test.d.ts.map +0 -1
- package/esm/src/models/currency/index.d.ts +0 -4
- package/esm/src/models/currency/index.d.ts.map +0 -1
- package/esm/src/models/currency/index.js +0 -3
- package/esm/src/models/currency/types.d.ts.map +0 -1
- package/esm/src/models/currency/types.js +0 -28
- package/esm/src/models/currency/utils.d.ts +0 -8
- package/esm/src/models/currency/utils.d.ts.map +0 -1
- package/esm/src/models/currency/utils.js +0 -9
- package/esm/src/models/index.d.ts +0 -6
- package/esm/src/models/index.d.ts.map +0 -1
- package/esm/src/models/index.js +0 -5
- package/esm/src/models/phone_number/format.d.ts +0 -14
- package/esm/src/models/phone_number/format.d.ts.map +0 -1
- package/esm/src/models/phone_number/format.js +0 -14
- package/esm/src/models/phone_number/global/phone_number.d.ts +0 -161
- package/esm/src/models/phone_number/global/phone_number.d.ts.map +0 -1
- package/esm/src/models/phone_number/global/phone_number.js +0 -453
- package/esm/src/models/phone_number/global/phone_number.test.d.ts.map +0 -1
- package/esm/src/models/phone_number/global/service.d.ts +0 -267
- package/esm/src/models/phone_number/global/service.d.ts.map +0 -1
- package/esm/src/models/phone_number/global/service.js +0 -498
- package/esm/src/models/phone_number/global/service.test.d.ts.map +0 -1
- package/esm/src/models/phone_number/index.d.ts +0 -6
- package/esm/src/models/phone_number/index.d.ts.map +0 -1
- package/esm/src/models/phone_number/index.js +0 -5
- package/esm/src/models/phone_number/tz/antd_validator.d.ts +0 -77
- package/esm/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
- package/esm/src/models/phone_number/tz/antd_validator.js +0 -90
- package/esm/src/models/phone_number/tz/antdvalidator.test.d.ts.map +0 -1
- package/esm/src/models/phone_number/tz/network_operator.d.ts +0 -30
- package/esm/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
- package/esm/src/models/phone_number/tz/network_operator.js +0 -47
- package/esm/src/models/phone_number/tz/phone_number.d.ts +0 -135
- package/esm/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
- package/esm/src/models/phone_number/tz/phone_number.js +0 -278
- package/esm/src/models/phone_number/tz/phone_number.test.d.ts.map +0 -1
- package/esm/src/reports/index.d.ts +0 -2
- package/esm/src/reports/index.d.ts.map +0 -1
- package/esm/src/reports/index.js +0 -1
- package/esm/src/reports/report_manager.d.ts +0 -144
- package/esm/src/reports/report_manager.d.ts.map +0 -1
- package/esm/src/reports/report_manager.js +0 -318
- package/esm/src/utils/id.d.ts +0 -12
- package/esm/src/utils/id.d.ts.map +0 -1
- package/esm/src/utils/id.js +0 -19
- package/esm/src/utils/index.d.ts +0 -4
- package/esm/src/utils/index.d.ts.map +0 -1
- package/esm/src/utils/index.js +0 -3
- package/esm/src/utils/text.d.ts.map +0 -1
- package/esm/src/utils/text.js +0 -68
- package/esm/src/utils/text.test.d.ts.map +0 -1
- package/esm/src/utils/time.d.ts +0 -21
- package/esm/src/utils/time.d.ts.map +0 -1
- package/esm/src/utils/time.js +0 -34
- package/script/_dnt.test_shims.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +0 -1
- package/script/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
- package/script/mod.d.ts +0 -5
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -20
- package/script/package.json +0 -3
- package/script/src/config/config_service.d.ts +0 -11
- package/script/src/config/config_service.d.ts.map +0 -1
- package/script/src/config/config_service.js +0 -23
- package/script/src/config/index.d.ts +0 -2
- package/script/src/config/index.d.ts.map +0 -1
- package/script/src/config/index.js +0 -17
- package/script/src/data/banks_tz.d.ts +0 -7
- package/script/src/data/banks_tz.d.ts.map +0 -1
- package/script/src/data/banks_tz.js +0 -199
- package/script/src/data/countries.d.ts +0 -39
- package/script/src/data/countries.d.ts.map +0 -1
- package/script/src/data/countries.js +0 -2477
- package/script/src/data/currencies.d.ts +0 -1901
- package/script/src/data/currencies.d.ts.map +0 -1
- package/script/src/data/currencies.js +0 -1075
- package/script/src/data/phone_patterns.d.ts +0 -3809
- package/script/src/data/phone_patterns.d.ts.map +0 -1
- package/script/src/data/phone_patterns.js +0 -2327
- package/script/src/models/amount/amount.d.ts +0 -53
- package/script/src/models/amount/amount.d.ts.map +0 -1
- package/script/src/models/amount/amount.js +0 -194
- package/script/src/models/amount/amount.test.d.ts.map +0 -1
- package/script/src/models/amount/antd_validator.d.ts +0 -40
- package/script/src/models/amount/antd_validator.d.ts.map +0 -1
- package/script/src/models/amount/antd_validator.js +0 -62
- package/script/src/models/amount/antd_validator.test.d.ts.map +0 -1
- package/script/src/models/amount/index.d.ts +0 -3
- package/script/src/models/amount/index.d.ts.map +0 -1
- package/script/src/models/amount/index.js +0 -18
- package/script/src/models/bank/antd_validator.d.ts +0 -11
- package/script/src/models/bank/antd_validator.d.ts.map +0 -1
- package/script/src/models/bank/antd_validator.js +0 -30
- package/script/src/models/bank/antd_validator.test.d.ts.map +0 -1
- package/script/src/models/bank/bank.d.ts +0 -257
- package/script/src/models/bank/bank.d.ts.map +0 -1
- package/script/src/models/bank/bank.js +0 -458
- package/script/src/models/bank/bank.test.d.ts.map +0 -1
- package/script/src/models/bank/index.d.ts +0 -5
- package/script/src/models/bank/index.d.ts.map +0 -1
- package/script/src/models/bank/index.js +0 -20
- package/script/src/models/bank/types.d.ts +0 -7
- package/script/src/models/bank/types.d.ts.map +0 -1
- package/script/src/models/bank/types.js +0 -48
- package/script/src/models/bank/utils.d.ts +0 -8
- package/script/src/models/bank/utils.d.ts.map +0 -1
- package/script/src/models/bank/utils.js +0 -12
- package/script/src/models/country/country.d.ts.map +0 -1
- package/script/src/models/country/country.js +0 -745
- package/script/src/models/country/country.test.d.ts.map +0 -1
- package/script/src/models/country/index.d.ts +0 -4
- package/script/src/models/country/index.d.ts.map +0 -1
- package/script/src/models/country/index.js +0 -19
- package/script/src/models/country/types.d.ts.map +0 -1
- package/script/src/models/country/types.js +0 -108
- package/script/src/models/country/utils.d.ts +0 -21
- package/script/src/models/country/utils.d.ts.map +0 -1
- package/script/src/models/country/utils.js +0 -30
- package/script/src/models/currency/currency.d.ts.map +0 -1
- package/script/src/models/currency/currency.js +0 -479
- package/script/src/models/currency/currency.test.d.ts.map +0 -1
- package/script/src/models/currency/index.d.ts +0 -4
- package/script/src/models/currency/index.d.ts.map +0 -1
- package/script/src/models/currency/index.js +0 -19
- package/script/src/models/currency/types.d.ts +0 -21
- package/script/src/models/currency/types.d.ts.map +0 -1
- package/script/src/models/currency/types.js +0 -31
- package/script/src/models/currency/utils.d.ts +0 -8
- package/script/src/models/currency/utils.d.ts.map +0 -1
- package/script/src/models/currency/utils.js +0 -12
- package/script/src/models/index.d.ts +0 -6
- package/script/src/models/index.d.ts.map +0 -1
- package/script/src/models/index.js +0 -21
- package/script/src/models/phone_number/format.d.ts +0 -14
- package/script/src/models/phone_number/format.d.ts.map +0 -1
- package/script/src/models/phone_number/format.js +0 -17
- package/script/src/models/phone_number/global/phone_number.d.ts +0 -161
- package/script/src/models/phone_number/global/phone_number.d.ts.map +0 -1
- package/script/src/models/phone_number/global/phone_number.js +0 -457
- package/script/src/models/phone_number/global/phone_number.test.d.ts.map +0 -1
- package/script/src/models/phone_number/global/service.d.ts +0 -267
- package/script/src/models/phone_number/global/service.d.ts.map +0 -1
- package/script/src/models/phone_number/global/service.js +0 -506
- package/script/src/models/phone_number/global/service.test.d.ts.map +0 -1
- package/script/src/models/phone_number/index.d.ts +0 -6
- package/script/src/models/phone_number/index.d.ts.map +0 -1
- package/script/src/models/phone_number/index.js +0 -21
- package/script/src/models/phone_number/tz/antd_validator.d.ts +0 -77
- package/script/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
- package/script/src/models/phone_number/tz/antd_validator.js +0 -94
- package/script/src/models/phone_number/tz/antdvalidator.test.d.ts.map +0 -1
- package/script/src/models/phone_number/tz/network_operator.d.ts +0 -30
- package/script/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
- package/script/src/models/phone_number/tz/network_operator.js +0 -50
- package/script/src/models/phone_number/tz/phone_number.d.ts +0 -135
- package/script/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
- package/script/src/models/phone_number/tz/phone_number.js +0 -282
- package/script/src/models/phone_number/tz/phone_number.test.d.ts.map +0 -1
- package/script/src/reports/index.d.ts +0 -2
- package/script/src/reports/index.d.ts.map +0 -1
- package/script/src/reports/index.js +0 -17
- package/script/src/reports/report_manager.d.ts.map +0 -1
- package/script/src/reports/report_manager.js +0 -328
- package/script/src/utils/id.d.ts.map +0 -1
- package/script/src/utils/id.js +0 -23
- package/script/src/utils/index.d.ts +0 -4
- package/script/src/utils/index.d.ts.map +0 -1
- package/script/src/utils/index.js +0 -19
- package/script/src/utils/text.d.ts +0 -32
- package/script/src/utils/text.d.ts.map +0 -1
- package/script/src/utils/text.js +0 -75
- package/script/src/utils/text.test.d.ts.map +0 -1
- package/script/src/utils/time.d.ts.map +0 -1
- package/script/src/utils/time.js +0 -39
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ISO2CountryCode } from "../../../country";
|
|
2
|
+
import { CountryMNOImplementation, MNOInfo, TZMNOId } from "../mno.types";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration object for Tanzanian mobile network operators.
|
|
5
|
+
* Conforms to the generic NetworkOperatorInfo interface.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TZ_MNO_CONFIG: Record<TZMNOId, MNOInfo>;
|
|
8
|
+
/**
|
|
9
|
+
* Tanzania MNO Implementation
|
|
10
|
+
* Handles all TZ-specific MNO logic including prefix validation
|
|
11
|
+
*/
|
|
12
|
+
export declare class TZMNOImplementation implements CountryMNOImplementation {
|
|
13
|
+
private static instance;
|
|
14
|
+
private constructor();
|
|
15
|
+
static getInstance(): TZMNOImplementation;
|
|
16
|
+
getAllMNOs(): MNOInfo[];
|
|
17
|
+
isValidMNOId(id: string): boolean;
|
|
18
|
+
getMNOById(id: string): MNOInfo | undefined;
|
|
19
|
+
requiresExplicitMNO(): boolean;
|
|
20
|
+
getCountryCode(): ISO2CountryCode;
|
|
21
|
+
/**
|
|
22
|
+
* Validate MNO against phone number prefix (TZ-specific logic)
|
|
23
|
+
*/
|
|
24
|
+
validateMNOForPhoneNumber(phoneNumber: string, mnoId: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get MNO by phone number prefix (TZ-specific)
|
|
27
|
+
*/
|
|
28
|
+
getMNOByPhonePrefix(phoneNumber: string): MNOInfo | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Get prefixes for a specific MNO (TZ-specific utility)
|
|
31
|
+
*/
|
|
32
|
+
getPrefixesForMNO(mnoId: TZMNOId): string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use TZMNOImplementation.getInstance().getPrefixesForMNO() instead
|
|
36
|
+
* Helper function within the TZ context to get prefixes for an operator ID.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getTZPrefixesForOperator(operatorId: TZMNOId): string[] | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use TZMNOImplementation.getInstance().getMNOByPhonePrefix() instead
|
|
41
|
+
* Helper function within the TZ context to find operator config by prefix.
|
|
42
|
+
*/
|
|
43
|
+
export declare function findTZOperatorByPrefix(prefix: string): MNOInfo | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use TZMNOImplementation.getInstance().getAllMNOs() instead
|
|
46
|
+
* Gets all available Tanzanian MNO configurations.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAllTZMNOs(): MNOInfo[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PhoneNumber } from "../../phone-number";
|
|
2
|
+
import { type ParsedPhoneNumber, PhoneNumberService } from "../../phone-number.service";
|
|
3
|
+
import { type PhoneNumberContract, type PhoneNumberParseOptions, PhoneNumberType } from "../../phone-number.types";
|
|
4
|
+
import { ISO2CountryCode } from "../../../country";
|
|
5
|
+
import { MNOInfo } from "../mno.types";
|
|
6
|
+
/**
|
|
7
|
+
* Represents a validated Tanzanian (TZ) **mobile** phone number.
|
|
8
|
+
* Extends the generic PhoneNumber class and provides TZ-specific behavior.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TZMobileNumber extends PhoneNumber implements PhoneNumberContract {
|
|
11
|
+
readonly countryCode: ISO2CountryCode;
|
|
12
|
+
/**
|
|
13
|
+
* Protected constructor. Use static `from` method for instantiation.
|
|
14
|
+
* Calls the base class constructor.
|
|
15
|
+
*/
|
|
16
|
+
protected constructor(parsedInfo: ParsedPhoneNumber, service: PhoneNumberService);
|
|
17
|
+
/**
|
|
18
|
+
* Validates the structure for a Tanzanian **mobile** phone number.
|
|
19
|
+
* Checks base validity AND ensures the prefix belongs to a known TZ MNO.
|
|
20
|
+
* @returns {boolean} True if the number is a valid TZ mobile number.
|
|
21
|
+
*/
|
|
22
|
+
validate(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Gets associated Tanzanian mobile operator information based on the number's prefix.
|
|
25
|
+
* Overrides the base implementation.
|
|
26
|
+
* @returns {MNOInfo | undefined} Operator details or undefined.
|
|
27
|
+
*/
|
|
28
|
+
getOperatorInfo(): MNOInfo | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the specific type for this class, overriding the base method.
|
|
31
|
+
* @returns {PhoneNumberType} Always returns MOBILE.
|
|
32
|
+
*/
|
|
33
|
+
getNumberType(): PhoneNumberType;
|
|
34
|
+
/**
|
|
35
|
+
* Attempts to create a `TZMobileNumber` instance from a given string input.
|
|
36
|
+
* Performs TZ-specific parsing and validation FIRST, then uses the core
|
|
37
|
+
* service for final validation and object creation.
|
|
38
|
+
*
|
|
39
|
+
* @param input - The input phone number string.
|
|
40
|
+
* @param options - Parsing options (optional).
|
|
41
|
+
* @returns {TZMobileNumber | undefined} An instance if valid, otherwise undefined.
|
|
42
|
+
*/
|
|
43
|
+
static from(input: string | null | undefined, options?: PhoneNumberParseOptions): TZMobileNumber | undefined;
|
|
44
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type ParsedPhoneNumber, PhoneNumberService } from "./phone-number.service";
|
|
2
|
+
import { PhoneNumberContract, PhoneNumberFormat, PhoneNumberParseOptions, PhoneNumberType } from "./phone-number.types";
|
|
3
|
+
import type { ISO2CountryCode } from "../country/country.types";
|
|
4
|
+
import type { PhoneNumber as LibPhoneNumberInstance } from "libphonenumber-js";
|
|
5
|
+
import { MNOInfo } from "./mno";
|
|
6
|
+
/**
|
|
7
|
+
* Represents a generic international phone number, validated using libphonenumber-js
|
|
8
|
+
* via the PhoneNumberService. Implements the common PhoneNumberContract interface.
|
|
9
|
+
* This class is intended to be extended by country-specific classes.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PhoneNumber implements PhoneNumberContract {
|
|
12
|
+
readonly countryCode: ISO2CountryCode;
|
|
13
|
+
readonly compactNumber: string;
|
|
14
|
+
readonly e164Format: string;
|
|
15
|
+
protected readonly _service: PhoneNumberService;
|
|
16
|
+
protected readonly _parsedInfo: ParsedPhoneNumber;
|
|
17
|
+
/**
|
|
18
|
+
* Protected constructor. Should be called by subclasses via super()
|
|
19
|
+
* or by static factory methods (`from`).
|
|
20
|
+
* @param parsedInfo - The result from PhoneNumberService.parse().
|
|
21
|
+
* @param service - An instance of PhoneNumberService.
|
|
22
|
+
*/
|
|
23
|
+
protected constructor(parsedInfo: ParsedPhoneNumber, service: PhoneNumberService);
|
|
24
|
+
/**
|
|
25
|
+
* Validates the phone number using the underlying library via the service.
|
|
26
|
+
* Subclasses can override this to add more specific validation.
|
|
27
|
+
* @returns {boolean} True if the number is considered valid by the core library.
|
|
28
|
+
*/
|
|
29
|
+
validate(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Formats the phone number according to the specified format using the service.
|
|
32
|
+
* Subclasses can override this if country-specific formatting differs from the library's output.
|
|
33
|
+
* @param {PhoneNumberFormat} format - The desired output format.
|
|
34
|
+
* @returns {string} The formatted phone number string.
|
|
35
|
+
*/
|
|
36
|
+
getWithFormat(format: PhoneNumberFormat): string;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the type of the phone number (e.g., MOBILE, FIXED_LINE) using the service.
|
|
39
|
+
* Subclasses might override this for specific known types (e.g., always MOBILE).
|
|
40
|
+
* @returns {PhoneNumberType | undefined} The determined type or undefined.
|
|
41
|
+
*/
|
|
42
|
+
getNumberType(): PhoneNumberType | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Gets associated mobile operator information.
|
|
45
|
+
* Base implementation returns undefined. Subclasses override this for specific countries.
|
|
46
|
+
* @returns {MNOInfo | undefined} Always returns undefined in the base class.
|
|
47
|
+
*/
|
|
48
|
+
getOperatorInfo(): MNOInfo | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Gets a human-readable label, typically the international format.
|
|
51
|
+
* @returns {string} A display label for the phone number.
|
|
52
|
+
*/
|
|
53
|
+
get label(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Underlying instance from libphonenumber-js, exposed for potential advanced use.
|
|
56
|
+
* Use with caution, prefer methods defined in PhoneNumberContract.
|
|
57
|
+
*/
|
|
58
|
+
get underlyingInstance(): LibPhoneNumberInstance;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a generic PhoneNumber instance from an input string.
|
|
61
|
+
* Uses PhoneNumberService for parsing and validation.
|
|
62
|
+
* Use PhoneNumberFactory.create() for potentially getting country-specific instances.
|
|
63
|
+
*
|
|
64
|
+
* @param input - Phone number string.
|
|
65
|
+
* @param options - Parsing options like defaultCountry.
|
|
66
|
+
* @returns {PhoneNumber | undefined} Instance if valid and parsable, undefined otherwise.
|
|
67
|
+
*/
|
|
68
|
+
static from(input: string, options?: PhoneNumberParseOptions): PhoneNumber | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Checks if a string can potentially be parsed and validated as a phone number
|
|
71
|
+
* using the generic 'from' method.
|
|
72
|
+
*/
|
|
73
|
+
static canConstruct(input?: string | null, options?: PhoneNumberParseOptions): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Robust type guard checking structure and validatability.
|
|
76
|
+
*/
|
|
77
|
+
static is(obj: unknown): obj is PhoneNumberContract;
|
|
78
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type PhoneNumberContract, type PhoneNumberParseOptions } from "./phone-number.types";
|
|
2
|
+
import { MNOInfo } from "./mno";
|
|
3
|
+
/**
|
|
4
|
+
* Factory class for creating phone number objects that conform to PhoneNumberContract.
|
|
5
|
+
* It attempts to use country-specific implementations (like TZMobileNumber, KEMobileNumber)
|
|
6
|
+
* when available and appropriate, otherwise falls back to the generic PhoneNumber class.
|
|
7
|
+
*
|
|
8
|
+
* Also provides validation methods related to specific use cases like payouts.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PhoneNumberFactory {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an appropriate phone number instance (generic or country-specific)
|
|
13
|
+
* based on the input string and options.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} numberToParse The raw phone number string.
|
|
16
|
+
* @param {PhoneNumberParseOptions} [options] Optional parsing options (e.g., defaultCountry).
|
|
17
|
+
* @returns {PhoneNumberContract | undefined} An instance conforming to PhoneNumberContract
|
|
18
|
+
* if the input is valid, otherwise undefined.
|
|
19
|
+
*/
|
|
20
|
+
static create(numberToParse: string, options?: PhoneNumberParseOptions): PhoneNumberContract | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Convenience method to check if an input string can be constructed into
|
|
23
|
+
* ANY valid phone number object via the factory.
|
|
24
|
+
* @param {string | null | undefined} input The raw phone number string.
|
|
25
|
+
* @param {PhoneNumberParseOptions} [options] Optional parsing options.
|
|
26
|
+
* @returns {boolean} True if a valid phone number object can be created.
|
|
27
|
+
*/
|
|
28
|
+
static canCreate(input: string | null | undefined, options?: PhoneNumberParseOptions): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Checks if a phone number (provided as a string or a PhoneNumberContract object)
|
|
31
|
+
* represents a valid number that can be successfully processed by the specific
|
|
32
|
+
* country implementation (TZMobileNumber or KEMobileNumber) required for payouts,
|
|
33
|
+
* and is of type MOBILE.
|
|
34
|
+
*
|
|
35
|
+
* @param input The raw phone number string OR an existing PhoneNumberContract object.
|
|
36
|
+
* @returns True if the number is valid for payout, false otherwise.
|
|
37
|
+
*/
|
|
38
|
+
static checkPayoutEligibility(input: string | PhoneNumberContract): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the Mobile Network Operator (MNO) information for a given phone number.
|
|
41
|
+
* This function first checks if the number is eligible for payout (i.e., a valid
|
|
42
|
+
* mobile number in a supported country). If it is, and the country is Tanzania (TZ),
|
|
43
|
+
* it attempts to parse the number using the Tanzania-specific number class
|
|
44
|
+
* (`TZMobileNumber`) to extract operator details. For other supported countries
|
|
45
|
+
* or if the parsing fails for Tanzania, it returns undefined.
|
|
46
|
+
*
|
|
47
|
+
* @param {string | PhoneNumberContract} input The raw phone number string OR an existing PhoneNumberContract object.
|
|
48
|
+
* @returns {MNOInfo | undefined} An object containing MNO information if the number
|
|
49
|
+
* is a valid Tanzanian mobile number and the operator can be identified; otherwise, undefined.
|
|
50
|
+
*/
|
|
51
|
+
static getMNO(input: string | PhoneNumberContract): MNOInfo | undefined;
|
|
52
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type NumberType, type PhoneNumber as LibPhoneNumber } from "libphonenumber-js/max";
|
|
2
|
+
import type { ISO2CountryCode } from "../country";
|
|
3
|
+
import { PhoneNumberFormat } from "./phone-number.types";
|
|
4
|
+
export interface ParsedPhoneNumber {
|
|
5
|
+
libInstance: LibPhoneNumber;
|
|
6
|
+
countryCode: ISO2CountryCode | undefined;
|
|
7
|
+
compactNumber: string;
|
|
8
|
+
e164Format: string;
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
numberType: NumberType | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare class PhoneNumberService {
|
|
13
|
+
private static instance;
|
|
14
|
+
private constructor();
|
|
15
|
+
static getInstance(): PhoneNumberService;
|
|
16
|
+
/**
|
|
17
|
+
* Parses a phone number string using libphonenumber-js.
|
|
18
|
+
* @param numberToParse The raw phone number string.
|
|
19
|
+
* @param defaultCountry Optional default country code.
|
|
20
|
+
* @returns A ParsedPhoneNumber object if successful, otherwise undefined.
|
|
21
|
+
*/
|
|
22
|
+
parse(numberToParse: string, defaultCountry?: ISO2CountryCode): ParsedPhoneNumber | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Validates a previously parsed LibPhoneNumber instance.
|
|
25
|
+
* @param libInstance The LibPhoneNumber instance from libphonenumber-js.
|
|
26
|
+
* @returns True if the number is considered valid by the library.
|
|
27
|
+
*/
|
|
28
|
+
isValid(libInstance: LibPhoneNumber | undefined): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Formats a previously parsed LibPhoneNumber instance.
|
|
31
|
+
* @param libInstance The LibPhoneNumber instance from libphonenumber-js.
|
|
32
|
+
* @param formatType Our local PhoneNumberFormat enum value.
|
|
33
|
+
* @returns The formatted string, or the E.164 format as fallback.
|
|
34
|
+
*/
|
|
35
|
+
format(libInstance: LibPhoneNumber | undefined, formatType: PhoneNumberFormat): string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ISO2CountryCode } from "../country";
|
|
2
|
+
import { MNOInfo } from "./mno/mno.types";
|
|
3
|
+
/**
|
|
4
|
+
* Enumeration for various phone number formats used for display and processing.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PhoneNumberFormat {
|
|
7
|
+
/**
|
|
8
|
+
* International format, typically used for display.
|
|
9
|
+
* Includes '+' and country code, may include spacing for readability.
|
|
10
|
+
* (e.g., +1 202 555 0123)
|
|
11
|
+
* Note: Exact spacing might vary based on library implementation or locale.
|
|
12
|
+
*/
|
|
13
|
+
INTERNATIONAL = "INTERNATIONAL",
|
|
14
|
+
/**
|
|
15
|
+
* National format, typically including national prefix (like '0') and local spacing.
|
|
16
|
+
* Formatting varies significantly by country.
|
|
17
|
+
* (e.g., 0712 345 678 for TZ, (213) 373-4253 for US)
|
|
18
|
+
*/
|
|
19
|
+
NATIONAL = "NATIONAL",
|
|
20
|
+
/**
|
|
21
|
+
* Compact national format (National Significant Number).
|
|
22
|
+
* Typically digits only, without country code or national prefix '0'.
|
|
23
|
+
* (e.g., 712345678 for TZ, 2133734253 for US)
|
|
24
|
+
*/
|
|
25
|
+
COMPACT = "COMPACT",
|
|
26
|
+
/**
|
|
27
|
+
* RFC3966 URI format for telephone numbers.
|
|
28
|
+
* (e.g., tel:+1-202-555-0123 or tel:+255712345678)
|
|
29
|
+
*/
|
|
30
|
+
RFC3966 = "RFC3966",
|
|
31
|
+
/**
|
|
32
|
+
* Strict E.164 format. Includes '+' and country code, followed only by digits
|
|
33
|
+
* with no spacing or formatting characters. Globally unique.
|
|
34
|
+
* (e.g., +12025550123, +255712345678)
|
|
35
|
+
*/
|
|
36
|
+
E164 = "E164",
|
|
37
|
+
/**
|
|
38
|
+
* International numeric format without the '+' prefix.
|
|
39
|
+
* Includes country code followed by the National Significant Number (NSN),
|
|
40
|
+
* digits only, with no formatting characters or separators.
|
|
41
|
+
* Commonly used in storage, logging, or systems where '+' is unnecessary or undesirable.
|
|
42
|
+
* (e.g., 12025550123, 255712345678)
|
|
43
|
+
*/
|
|
44
|
+
INTERNATIONAL_NUMERIC = "INTERNATIONAL_NUMERIC"
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Represents the type of a phone number, mimicking the classification
|
|
48
|
+
* used by the underlying libphonenumber-js library.
|
|
49
|
+
*/
|
|
50
|
+
export declare enum PhoneNumberType {
|
|
51
|
+
FIXED_LINE = "FIXED_LINE",
|
|
52
|
+
MOBILE = "MOBILE",
|
|
53
|
+
FIXED_LINE_OR_MOBILE = "FIXED_LINE_OR_MOBILE",// Indicates ambiguity between fixed line and mobile
|
|
54
|
+
TOLL_FREE = "TOLL_FREE",
|
|
55
|
+
PREMIUM_RATE = "PREMIUM_RATE",
|
|
56
|
+
SHARED_COST = "SHARED_COST",
|
|
57
|
+
VOIP = "VOIP",// Voice over IP
|
|
58
|
+
PERSONAL_NUMBER = "PERSONAL_NUMBER",
|
|
59
|
+
PAGER = "PAGER",
|
|
60
|
+
UAN = "UAN",// Universal Access Number
|
|
61
|
+
VOICEMAIL = "VOICEMAIL",
|
|
62
|
+
UNKNOWN = "UNKNOWN"
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Options for parsing phone numbers
|
|
66
|
+
*/
|
|
67
|
+
export interface PhoneNumberParseOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Default country ISO code to use when parsing a non-international number,
|
|
70
|
+
* or when a dial code is shared by multiple countries.
|
|
71
|
+
*/
|
|
72
|
+
defaultCountry?: ISO2CountryCode;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Interface defining the common contract for all phone number objects
|
|
76
|
+
* within the system (e.g., used by TemboPlus).
|
|
77
|
+
*/
|
|
78
|
+
export interface PhoneNumberContract {
|
|
79
|
+
/** The phone number in E.164 format (e.g., +255712345678) */
|
|
80
|
+
readonly e164Format: string;
|
|
81
|
+
/** The national significant number (e.g., 712345678 for TZ) */
|
|
82
|
+
readonly compactNumber: string;
|
|
83
|
+
/** The ISO 3166-1 alpha-2 country code (e.g., "TZ", "KE") */
|
|
84
|
+
readonly countryCode: ISO2CountryCode;
|
|
85
|
+
/**
|
|
86
|
+
* Validates the phone number structure against rules for its country
|
|
87
|
+
* using the underlying phone number library.
|
|
88
|
+
* @returns {boolean} True if the number structure is valid for the country.
|
|
89
|
+
*/
|
|
90
|
+
validate(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Formats the number into different standard styles using the underlying library.
|
|
93
|
+
* @param {PhoneNumberFormat} format - The desired output format.
|
|
94
|
+
* @returns {string} The formatted phone number string.
|
|
95
|
+
*/
|
|
96
|
+
getWithFormat(format: PhoneNumberFormat): string;
|
|
97
|
+
/**
|
|
98
|
+
* Gets associated mobile operator information, if available and implemented
|
|
99
|
+
* for the specific country. Returns undefined if not applicable or not found.
|
|
100
|
+
* @returns {MNOInfo | undefined} Operator details or undefined.
|
|
101
|
+
*/
|
|
102
|
+
getOperatorInfo(): MNOInfo | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Gets a human-readable label, typically the international format.
|
|
105
|
+
* @returns {string} A display label for the phone number.
|
|
106
|
+
*/
|
|
107
|
+
get label(): string;
|
|
108
|
+
/**
|
|
109
|
+
* Gets the type of the phone number (e.g., MOBILE, FIXED_LINE) as determined
|
|
110
|
+
* by the underlying phone number library.
|
|
111
|
+
* Requires library metadata that includes number types (e.g., libphonenumber-js/max).
|
|
112
|
+
* @returns {PhoneNumberType | undefined} The determined type or undefined if unknown/invalid.
|
|
113
|
+
*/
|
|
114
|
+
getNumberType(): PhoneNumberType | undefined;
|
|
115
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CountryCode } from "../country";
|
|
2
|
+
export declare const phoneLogger: import("pino").default.Logger<never, boolean>;
|
|
3
|
+
export declare const PhoneNumberUtils: {
|
|
4
|
+
/**
|
|
5
|
+
* Removes all whitespace characters from the given string.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} input - The input string.
|
|
8
|
+
* @returns {string} String with whitespace removed.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* removeSpaces(" 0712 345 678 ") // "0712345678"
|
|
12
|
+
* removeSpaces(" +255 712 345 678") // "+255712345678"
|
|
13
|
+
*/
|
|
14
|
+
removeSpaces: (input: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Strips all formatting characters used to enhance readability in phone numbers.
|
|
17
|
+
* Preserves only digits and an optional leading '+' if present.
|
|
18
|
+
*
|
|
19
|
+
* Characters removed include:
|
|
20
|
+
* - Whitespace: space, tab, non-breaking space
|
|
21
|
+
* - Hyphens, dots, slashes: `-`, `.`, `/`
|
|
22
|
+
* - Brackets: `(`, `)`
|
|
23
|
+
* - URI prefix: `tel:`
|
|
24
|
+
* - Extensions like `ext.`, `x`, or `#` and following digits
|
|
25
|
+
*
|
|
26
|
+
* @param {string} input - The phone number string to strip.
|
|
27
|
+
* @returns {string} A cleaned string with only digits and optional '+' prefix.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* stripFormattingCharacters("tel:+255 (712) 345-678") // "+255712345678"
|
|
31
|
+
* stripFormattingCharacters("0712-345-678 x99") // "0712345678"
|
|
32
|
+
* stripFormattingCharacters("(+255) 712/345.678 ext. 9") // "+255712345678"
|
|
33
|
+
* stripFormattingCharacters("712abc345678") // "712abc345678"
|
|
34
|
+
*/
|
|
35
|
+
stripFormattingCharacters: (input: string) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Normalizes a phone number string by:
|
|
38
|
+
* - Removing all special characters and spaces
|
|
39
|
+
* - Preserving only digits and a leading '+'
|
|
40
|
+
* - Ensuring the result starts with a '+' wherever appropriate
|
|
41
|
+
* - Handling national numbers when default country is provided
|
|
42
|
+
* - Removing leading '0' when it's a national number prefix
|
|
43
|
+
*
|
|
44
|
+
* @param {string} input - The phone number string to normalize
|
|
45
|
+
* @param {CountryCode} [defaultCountry] - Optional default country code
|
|
46
|
+
* @returns {string} The normalized phone number string
|
|
47
|
+
* @throws {Error} If invalid country code provided
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* normalizePhoneNumber("+255 (712) 345-678") // "+255712345678"
|
|
51
|
+
* normalizePhoneNumber("0712 345 678", "TZ") // "+255712345678"
|
|
52
|
+
* normalizePhoneNumber("255712345678") // "255712345678"
|
|
53
|
+
*/
|
|
54
|
+
normalizePhoneNumber: (input: string, defaultCountry?: CountryCode) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if a string contains only digits or a `+` prefix followed by digits.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} input - The input string.
|
|
59
|
+
* @returns {boolean} True if valid format, false otherwise.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* isOnlyDigitsOrPlus("+255712345678") // true
|
|
63
|
+
* isOnlyDigitsOrPlus("0712345678") // true
|
|
64
|
+
* isOnlyDigitsOrPlus("+255-712-345-678") // false
|
|
65
|
+
*/
|
|
66
|
+
isOnlyDigitsOrPlus: (input: string) => boolean;
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./report-manager";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
export interface AppConfig {
|
|
2
|
+
pdfMakerBaseUrl: string;
|
|
3
|
+
}
|
|
1
4
|
export declare class ConfigService {
|
|
2
5
|
private static _instance;
|
|
3
|
-
private
|
|
6
|
+
private _config;
|
|
4
7
|
private constructor();
|
|
5
8
|
static get instance(): ConfigService;
|
|
6
|
-
initialize(config:
|
|
7
|
-
pdfMakerBaseUrl: string;
|
|
8
|
-
}): void;
|
|
9
|
+
initialize(config: AppConfig): void;
|
|
9
10
|
get pdfMakerBaseUrl(): string;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
export declare const configService: ConfigService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const logger: import("pino").Logger<never, boolean>;
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
* Generates a unique UUID (version 4).
|
|
3
3
|
* @returns {string} - A randomly generated UUID string.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
declare function generateUniqueUUID(): string;
|
|
6
6
|
/**
|
|
7
7
|
* Generates a UUID (version 5) based on the input string and a predefined namespace.
|
|
8
8
|
* @param {string} data - The input string to generate the UUID from.
|
|
9
9
|
* @returns {string} - A UUID string generated from the input string.
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
declare function generateUuidBasedOn(data: string): string;
|
|
12
|
+
export declare const IdUtils: {
|
|
13
|
+
generateUniqueUUID: typeof generateUniqueUUID;
|
|
14
|
+
generateUuidBasedOn: typeof generateUuidBasedOn;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -3,30 +3,37 @@
|
|
|
3
3
|
* @param {string} str - The input string.
|
|
4
4
|
* @returns {string} - The formatted string with the first letter capitalized.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
declare function capitalizeFirstLetter(str: string): string;
|
|
7
7
|
/**
|
|
8
8
|
* Combines a first name and a last name into a full name.
|
|
9
9
|
* @param {string} firstName - The first name.
|
|
10
10
|
* @param {string} lastName - The last name.
|
|
11
11
|
* @returns {string} - The full name formatted as "FirstName LastName".
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
declare function getFullName(firstName: string, lastName: string): string;
|
|
14
14
|
/**
|
|
15
15
|
* Generates a URL-friendly slug from a given text.
|
|
16
16
|
* @param {string} text - The input string.
|
|
17
17
|
* @returns {string} - The generated slug with lowercase alphanumeric characters and hyphens.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
declare function generateSlug(text: string): string;
|
|
20
20
|
/**
|
|
21
21
|
* Abbreviates a full name into a first name and the initial of the last name.
|
|
22
22
|
* @param {string} fullName - The input full name.
|
|
23
23
|
* @returns {string} - The abbreviated name in the format "FirstName L.".
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
declare function abbreviateName(fullName: string): string;
|
|
26
26
|
/**
|
|
27
27
|
* Extracts the initials from a full name.
|
|
28
28
|
* @param {string} fullName - The input full name.
|
|
29
29
|
* @returns {string} - The initials in uppercase format.
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
declare function getInitialsFrom(fullName: string): string;
|
|
32
|
+
export declare const TextUtils: {
|
|
33
|
+
capitalizeFirstLetter: typeof capitalizeFirstLetter;
|
|
34
|
+
getFullName: typeof getFullName;
|
|
35
|
+
generateSlug: typeof generateSlug;
|
|
36
|
+
abbreviateName: typeof abbreviateName;
|
|
37
|
+
getInitialsFrom: typeof getInitialsFrom;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -4,18 +4,23 @@
|
|
|
4
4
|
* @param {Date} b - The second Date object.
|
|
5
5
|
* @returns {boolean} - Returns true if the dates are equal in terms of year, month, and day; otherwise, false.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
declare function compareDates(a: Date, b: Date): boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Sorts two dates in descending order (latest date first).
|
|
10
10
|
* @param {Date} a - The first Date object.
|
|
11
11
|
* @param {Date} b - The second Date object.
|
|
12
12
|
* @returns {number} - Returns a positive value if `b` is after `a`, a negative value if `a` is after `b`, and 0 if they are equal.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
declare function sortDates(a: Date, b: Date): number;
|
|
15
15
|
/**
|
|
16
16
|
* Creates a delay for a given number of milliseconds.
|
|
17
17
|
* @param {number} milliseconds - The delay duration in milliseconds.
|
|
18
18
|
* @returns {Promise<void>} - A promise that resolves after the specified delay.
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
declare function delay(milliseconds: number): Promise<void>;
|
|
21
|
+
export declare const TimeUtils: {
|
|
22
|
+
compareDates: typeof compareDates;
|
|
23
|
+
sortDates: typeof sortDates;
|
|
24
|
+
delay: typeof delay;
|
|
25
|
+
};
|
|
26
|
+
export {};
|