@temboplus/frontend-core 0.2.22 → 0.3.0-beta.1
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 +761 -0
- package/dist/models/amount/index.d.ts +1 -0
- package/dist/models/bank/bank.d.ts +193 -0
- package/dist/models/bank/bank.schema.d.ts +23 -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 +37 -5
- package/dist/models/country/country.schema.d.ts +73 -0
- package/{script/src/models/country/types.d.ts → dist/models/country/country.types.d.ts} +0 -1
- package/{esm/src/models/country/utils.d.ts → dist/models/country/country.validation.d.ts} +10 -6
- package/dist/models/country/index.d.ts +4 -0
- package/{script/src → dist}/models/currency/currency.d.ts +28 -3
- package/dist/models/currency/currency.schema.d.ts +24 -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/{esm/src/models/index.js → dist/models/index.d.ts} +1 -1
- 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 +135 -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/{esm/src/reports/report_manager.d.ts → dist/reports/report-manager.d.ts} +33 -4
- 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 +2 -0
- package/{script/src → dist}/utils/id.d.ts +7 -3
- package/dist/utils/text.d.ts +103 -0
- package/{script/src → dist}/utils/time.d.ts +9 -4
- package/package.json +47 -22
- 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.map +0 -1
- package/esm/src/models/country/utils.js +0 -25
- 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/phone_number/format.d.ts +0 -13
- package/esm/src/models/phone_number/format.d.ts.map +0 -1
- package/esm/src/models/phone_number/format.js +0 -13
- package/esm/src/models/phone_number/global/phone_number.d.ts +0 -162
- 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 -459
- 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 -141
- 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 -290
- 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.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/text.d.ts +0 -32
- 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 -13
- package/script/src/models/phone_number/format.d.ts.map +0 -1
- package/script/src/models/phone_number/format.js +0 -16
- package/script/src/models/phone_number/global/phone_number.d.ts +0 -162
- 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 -463
- 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 -141
- 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 -294
- 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 +0 -144
- 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
- /package/{esm/src/utils/index.js → dist/utils/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./amount.js";
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { ISO2CountryCode } from "../country/country.types.js";
|
|
2
|
+
import type { BankSwiftCode, KEBankSwiftCode, TZBankSwiftCode } from "./bank.types.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { BankJSONSchema } from "./bank.schema.js";
|
|
5
|
+
/**
|
|
6
|
+
* Infer the BankJSON type from the schema
|
|
7
|
+
*/
|
|
8
|
+
export type BankJSON = z.infer<typeof BankJSONSchema>;
|
|
9
|
+
export declare class Bank {
|
|
10
|
+
/**
|
|
11
|
+
* The full registered name of the bank.
|
|
12
|
+
*/
|
|
13
|
+
readonly fullName: string;
|
|
14
|
+
/**
|
|
15
|
+
* The commonly used short name or abbreviation for the bank.
|
|
16
|
+
*/
|
|
17
|
+
readonly shortName: string;
|
|
18
|
+
/**
|
|
19
|
+
* The SWIFT/BIC code for the bank's head office.
|
|
20
|
+
*/
|
|
21
|
+
readonly swiftCode: TZBankSwiftCode | KEBankSwiftCode;
|
|
22
|
+
/**
|
|
23
|
+
* The ISO 3166-1 alpha-2 country code (e.g., 'TZ', 'KE').
|
|
24
|
+
*/
|
|
25
|
+
readonly countryCode: ISO2CountryCode;
|
|
26
|
+
/**
|
|
27
|
+
* Optional list of former names the bank was known by.
|
|
28
|
+
* Useful for historical reference and search functionality.
|
|
29
|
+
*/
|
|
30
|
+
readonly formerNames?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new Bank instance.
|
|
33
|
+
*
|
|
34
|
+
* @param fullName The full registered name of the bank
|
|
35
|
+
* @param shortName The commonly used short name or abbreviation for the bank
|
|
36
|
+
* @param swiftCode The SWIFT/BIC code for the bank's head office
|
|
37
|
+
* @param countryCode The ISO 3166-1 alpha-2 country code
|
|
38
|
+
* @param formerNames Optional list of former names the bank was known by
|
|
39
|
+
*/
|
|
40
|
+
constructor(fullName: string, shortName: string, swiftCode: TZBankSwiftCode | KEBankSwiftCode, countryCode: ISO2CountryCode, formerNames?: string[]);
|
|
41
|
+
/**
|
|
42
|
+
* Checks if this bank has any former names recorded.
|
|
43
|
+
* @returns True if the bank has at least one former name, false otherwise.
|
|
44
|
+
*/
|
|
45
|
+
hasFormerNames(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Gets a display string showing the current name with former names in parentheses.
|
|
48
|
+
* @returns A formatted string, e.g., "Access Bank Tanzania Limited (formerly BancABC)"
|
|
49
|
+
*/
|
|
50
|
+
getDisplayNameWithHistory(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a string representation of the bank.
|
|
53
|
+
* @returns A formatted string, e.g., "CRDB BANK PLC (CRDB) - SWIFT: CORUTZTZ [TZ]"
|
|
54
|
+
*/
|
|
55
|
+
toString(): string;
|
|
56
|
+
static from(swiftCode: BankSwiftCode, countryCode: ISO2CountryCode): Bank;
|
|
57
|
+
/**
|
|
58
|
+
* Converts the Bank instance to a plain JavaScript object.
|
|
59
|
+
* Suitable for serialization or data transfer.
|
|
60
|
+
*
|
|
61
|
+
* @returns {Object} Plain object representation of the bank
|
|
62
|
+
* @returns {string} returns.fullName - The full registered name of the bank
|
|
63
|
+
* @returns {string} returns.shortName - The commonly used short name
|
|
64
|
+
* @returns {string} returns.swiftCode - The SWIFT/BIC code
|
|
65
|
+
* @returns {ISO2CountryCode} returns.countryCode - The ISO 3166-1 alpha-2 country code
|
|
66
|
+
* @returns {string[] | undefined} returns.formerNames - Optional list of former names
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const bank = Bank.from("FMBZTZTX", "TZ");
|
|
71
|
+
* const obj = bank.toObject();
|
|
72
|
+
* console.log(obj);
|
|
73
|
+
* // {
|
|
74
|
+
* // fullName: "Access Bank Tanzania Limited",
|
|
75
|
+
* // shortName: "ABT",
|
|
76
|
+
* // swiftCode: "FMBZTZTX",
|
|
77
|
+
* // countryCode: "TZ",
|
|
78
|
+
* // formerNames: ["BancABC"]
|
|
79
|
+
* // }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
toObject(): {
|
|
83
|
+
fullName: string;
|
|
84
|
+
shortName: string;
|
|
85
|
+
swiftCode: TZBankSwiftCode | KEBankSwiftCode;
|
|
86
|
+
countryCode: ISO2CountryCode;
|
|
87
|
+
formerNames?: string[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Static method to determine if an unknown object is a valid Bank object.
|
|
91
|
+
*
|
|
92
|
+
* This method performs a series of checks to validate if the provided object conforms
|
|
93
|
+
* to the Bank interface and contains valid data.
|
|
94
|
+
*
|
|
95
|
+
* @param {unknown} obj - The object to validate.
|
|
96
|
+
* @returns {obj is Bank} - Returns true if the object is a valid Bank, false otherwise.
|
|
97
|
+
*/
|
|
98
|
+
static is(obj: unknown): obj is Bank;
|
|
99
|
+
/**
|
|
100
|
+
* Serializes the Bank instance to a JSON-compatible object
|
|
101
|
+
*/
|
|
102
|
+
toJSON(): BankJSON;
|
|
103
|
+
/**
|
|
104
|
+
* Serializes the Bank instance to a JSON string
|
|
105
|
+
*/
|
|
106
|
+
toJSONString(): string;
|
|
107
|
+
/**
|
|
108
|
+
* Creates a Bank instance from a JSON-compatible object or string
|
|
109
|
+
*/
|
|
110
|
+
static fromJSON(json: BankJSON | string): Bank | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Creates a Bank instance from a JSON string
|
|
113
|
+
*/
|
|
114
|
+
static fromJSONString(jsonString: string): Bank | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Type guard to check if an object is a valid BankJSON using Zod validation
|
|
117
|
+
*/
|
|
118
|
+
static isBankJSON(obj: unknown): obj is BankJSON;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Service for managing bank data, validation, and instance creation
|
|
122
|
+
* across multiple countries. Acts as the central Facade and Factory.
|
|
123
|
+
* @class BankService
|
|
124
|
+
*/
|
|
125
|
+
export declare class BankService {
|
|
126
|
+
private static instance;
|
|
127
|
+
private loadedData;
|
|
128
|
+
private constructor();
|
|
129
|
+
/**
|
|
130
|
+
* Gets the singleton instance of BankService.
|
|
131
|
+
* Initializes known countries synchronously on first call.
|
|
132
|
+
* Consider async initialization if data loading becomes async.
|
|
133
|
+
*/
|
|
134
|
+
static getInstance(): BankService;
|
|
135
|
+
/**
|
|
136
|
+
* Initializes bank data for a specific country synchronously.
|
|
137
|
+
* @param countryCode The ISO country code (e.g., 'TZ', 'KE').
|
|
138
|
+
* @returns True if successful or already loaded, false on failure.
|
|
139
|
+
*/
|
|
140
|
+
initializeCountry(countryCode: ISO2CountryCode): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Retrieves the loaded data structure for a given country.
|
|
143
|
+
* Ensures country is initialized.
|
|
144
|
+
* @param countryCode The ISO country code.
|
|
145
|
+
* @returns The CountryBankData structure or undefined.
|
|
146
|
+
*/
|
|
147
|
+
private getCountryData;
|
|
148
|
+
/**
|
|
149
|
+
* Retrieves a Bank instance by its SWIFT code for a specific country.
|
|
150
|
+
* Performs validation before returning.
|
|
151
|
+
* @param countryCode The ISO country code.
|
|
152
|
+
* @param swiftCode The SWIFT code.
|
|
153
|
+
* @returns The Bank instance or undefined if SWIFT is invalid or not found.
|
|
154
|
+
*/
|
|
155
|
+
getBankBySwiftCode(countryCode: ISO2CountryCode, swiftCode: BankSwiftCode): Bank | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Retrieves all banks for a specific country.
|
|
158
|
+
* @param countryCode The ISO country code.
|
|
159
|
+
* @returns An array of Bank instances, or empty array.
|
|
160
|
+
*/
|
|
161
|
+
getAllBanks(countryCode: ISO2CountryCode): Bank[];
|
|
162
|
+
/**
|
|
163
|
+
* Retrieves all banks for all supported countries.
|
|
164
|
+
* @returns An array of Bank instances, or empty array.
|
|
165
|
+
*/
|
|
166
|
+
getAllSupportedBanks(): Bank[];
|
|
167
|
+
/**
|
|
168
|
+
* Searches all supported banks for a bank with the provided swift code
|
|
169
|
+
*/
|
|
170
|
+
detectBank(swiftCode: string): Bank | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Searches for banks within a specific country by name, SWIFT code, or former names.
|
|
173
|
+
* @param countryCode The ISO country code.
|
|
174
|
+
* @param searchTerm The term to search for (case-insensitive).
|
|
175
|
+
* @param limit Max number of results.
|
|
176
|
+
* @returns An array of matching Bank instances.
|
|
177
|
+
*/
|
|
178
|
+
searchBanks(countryCode: ISO2CountryCode, searchTerm: string, limit?: number): Bank[];
|
|
179
|
+
/**
|
|
180
|
+
* Searches for banks across all supported countries by name, SWIFT code, or former names.
|
|
181
|
+
* @param searchTerm The term to search for (case-insensitive).
|
|
182
|
+
* @param limit Max number of results.
|
|
183
|
+
* @returns An array of matching Bank instances from all supported countries.
|
|
184
|
+
*/
|
|
185
|
+
searchAllBanks(searchTerm: string, limit?: number): Bank[];
|
|
186
|
+
/**
|
|
187
|
+
* Finds banks that were formerly known by a specific name.
|
|
188
|
+
* @param formerName The former name to search for (case-insensitive).
|
|
189
|
+
* @param countryCode Optional country code to limit the search.
|
|
190
|
+
* @returns An array of Bank instances that match the former name.
|
|
191
|
+
*/
|
|
192
|
+
findByFormerName(formerName: string, countryCode?: ISO2CountryCode): Bank[];
|
|
193
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TZBankSWIFTCodeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
3
|
+
export declare const KEBankSWIFTCodeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
4
|
+
/**
|
|
5
|
+
* Zod schema for Bank JSON serialization
|
|
6
|
+
* This schema validates the JSON representation of a Bank instance
|
|
7
|
+
*/
|
|
8
|
+
export declare const BankJSONSchema: z.ZodObject<{
|
|
9
|
+
/** The SWIFT/BIC code for the bank's head office */
|
|
10
|
+
swiftCode: z.ZodString;
|
|
11
|
+
/** The ISO 3166-1 alpha-2 country code */
|
|
12
|
+
countryCode: z.ZodString;
|
|
13
|
+
/** Version for future compatibility */
|
|
14
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
version: string;
|
|
17
|
+
swiftCode: string;
|
|
18
|
+
countryCode: string;
|
|
19
|
+
}, {
|
|
20
|
+
swiftCode: string;
|
|
21
|
+
countryCode: string;
|
|
22
|
+
version?: string | undefined;
|
|
23
|
+
}>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
export declare const KEBankSwiftCodesSet: Set<string>;
|
|
2
|
+
export declare const TZBankSwiftCodesSet: Set<string>;
|
|
3
|
+
export type KEBankSwiftCode = "KCBLKENX" | "EQBLKENX" | "KCOOKENX" | "SCBLKENX" | "BARCKENX" | "CBAFKENX" | "DTKEKENX" | "FABLKENA" | "CITIKENA" | "HFCOKENX" | "SBICKENX" | "NBKEKENX" | "AFRIKENX" | "GTBOKENX" | "IMBLKENX" | "ECOCKENX" | "BARBKENX" | "BKIDKENX" | "UNAFKENX" | "SGKENX";
|
|
1
4
|
export type TZBankSwiftCode = "CORUTZTZ" | "PBZATZTZ" | "SCBLTZTX" | "SBICTZTX" | "CITITZTZ" | "EUAFTZTZ" | "DTKETZTZ" | "AKCOTZTZ" | "EXTNTZTZ" | "KLMJTZTZ" | "NLCBTZTX" | "NMIBTZTZ" | "KCBLTZTZ" | "HABLTZTZ" | "BKMYTZTZ" | "BARCTZTZ" | "IMBLTZTZ" | "CBAFTZTZ" | "DASUTZTZ" | "BARBTZTZ" | "AZANTZTZ" | "UCCTTZTZ" | "FMBZTZTX" | "ACTZTZTZ" | "BKIDTZTZ" | "UNAFTZTZ" | "MKCBTZTZ" | "ECOCTZTZ" | "MWCBTZTZ" | "FIRNTZTX" | "AMNNTZTZ" | "EQBLTZTZ" | "TAPBTZTZ" | "MBTLTZTZ" | "CNRBTZTZ" | "MWCOTZTZ" | "GTBITZTZ" | "YETMTZTZ" | "CDSHTZTZ";
|
|
2
|
-
|
|
3
|
-
* A Set containing all SWIFT codes from the provided list.
|
|
4
|
-
* Useful for quick lookups (e.g., checking if a string is a valid SWIFT code from this list).
|
|
5
|
-
*/
|
|
6
|
-
export declare const TZBankSwiftCodesSet: Set<TZBankSwiftCode>;
|
|
7
|
-
//# sourceMappingURL=types.d.ts.map
|
|
5
|
+
export type BankSwiftCode = KEBankSwiftCode | TZBankSwiftCode;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ISO2CountryCode } from "@models/country/country.types.js";
|
|
2
|
+
import { BankSwiftCode } from "./bank.types.js";
|
|
3
|
+
export declare const BankValidation: {
|
|
4
|
+
/**
|
|
5
|
+
* Validates a bank account number format for a specific country.
|
|
6
|
+
* @param accountNumber The account number string.
|
|
7
|
+
* @param countryCode The ISO2 country code.
|
|
8
|
+
* @returns True if the format is valid, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
validateAccountNumber: (accountNumber: string, countryCode: ISO2CountryCode) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Validates a bank account number format for any supported country.
|
|
13
|
+
* @param accountNumber The account number string.
|
|
14
|
+
* @returns True if the format is valid for any supported country, false otherwise.
|
|
15
|
+
*/
|
|
16
|
+
validateAccountNumberForAnyCountry: (accountNumber: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Validates a SWIFT/BIC code for a specific country.
|
|
19
|
+
* @param swiftCode The SWIFT code string.
|
|
20
|
+
* @param countryCode The ISO2 country code.
|
|
21
|
+
* @returns True if the format is valid, false otherwise.
|
|
22
|
+
*/
|
|
23
|
+
validateSwiftCode: (swiftCode: string, countryCode: ISO2CountryCode) => swiftCode is BankSwiftCode;
|
|
24
|
+
/**
|
|
25
|
+
* Validates a SWIFT/BIC code for any supported country.
|
|
26
|
+
* @param swiftCode The SWIFT code string.
|
|
27
|
+
* @returns True if the SWIFT code is valid for any supported country, false otherwise.
|
|
28
|
+
*/
|
|
29
|
+
validateSwiftCodeForAnyCountry: (swiftCode: string) => swiftCode is BankSwiftCode;
|
|
30
|
+
/**
|
|
31
|
+
* Validates an account name based on various criteria.
|
|
32
|
+
* This validation is country-agnostic as account name rules are generally similar.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} accountName - The account name to validate
|
|
35
|
+
* @returns {boolean} True if the account name meets all validation criteria, false otherwise
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // Returns true
|
|
39
|
+
* validateAccountName("John Smith");
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // Returns false (too short)
|
|
43
|
+
* validateAccountName("Jo");
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // Returns false (invalid characters)
|
|
47
|
+
* validateAccountName("User123");
|
|
48
|
+
*/
|
|
49
|
+
validateAccountName: (accountName: string) => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Validates an account name for any supported country.
|
|
52
|
+
* Since account name validation is generally country-agnostic, this is an alias to validateAccountName.
|
|
53
|
+
* @param accountName The account name to validate.
|
|
54
|
+
* @returns True if the account name is valid, false otherwise.
|
|
55
|
+
*/
|
|
56
|
+
validateAccountNameForAnyCountry: (accountName: string) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Validates all bank details (account number, SWIFT code, and account name) for a specific country.
|
|
59
|
+
* @param accountNumber The account number string.
|
|
60
|
+
* @param swiftCode The SWIFT code string.
|
|
61
|
+
* @param accountName The account name string.
|
|
62
|
+
* @param countryCode The ISO2 country code.
|
|
63
|
+
* @returns True if all details are valid for the specified country, false otherwise.
|
|
64
|
+
*/
|
|
65
|
+
validateAllBankDetails: (accountNumber: string, swiftCode: string, accountName: string, countryCode: ISO2CountryCode) => boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Validates all bank details (account number, SWIFT code, and account name) for any supported country.
|
|
68
|
+
* @param accountNumber The account number string.
|
|
69
|
+
* @param swiftCode The SWIFT code string.
|
|
70
|
+
* @param accountName The account name string.
|
|
71
|
+
* @returns True if all details are valid for any supported country, false otherwise.
|
|
72
|
+
*/
|
|
73
|
+
validateAllBankDetailsForAnyCountry: (accountNumber: string, swiftCode: string, accountName: string) => boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Determines which country a SWIFT code belongs to.
|
|
76
|
+
* @param swiftCode The SWIFT code string.
|
|
77
|
+
* @returns The ISO2 country code if found, undefined otherwise.
|
|
78
|
+
*/
|
|
79
|
+
getCountryFromSwiftCode: (swiftCode: string) => ISO2CountryCode | undefined;
|
|
80
|
+
};
|
|
@@ -24,9 +24,15 @@
|
|
|
24
24
|
* The addition of currency support through the getCurrency() method leverages
|
|
25
25
|
* the Currency model while maintaining a clean separation of concerns.
|
|
26
26
|
*/
|
|
27
|
-
import { Currency } from "
|
|
28
|
-
import
|
|
29
|
-
import
|
|
27
|
+
import { Currency } from "@models/currency/currency.js";
|
|
28
|
+
import { CurrencyCode } from "@models/currency/currency.types.js";
|
|
29
|
+
import { ISO2CountryCode, ISO3CountryCode, CountryCode } from "./country.types.js";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
import { CountryJSONSchema } from "./country.schema.js";
|
|
32
|
+
/**
|
|
33
|
+
* Infer the CountryJSON type from the schema
|
|
34
|
+
*/
|
|
35
|
+
export type CountryJSON = z.infer<typeof CountryJSONSchema>;
|
|
30
36
|
/**
|
|
31
37
|
* Enum for continents
|
|
32
38
|
*/
|
|
@@ -78,6 +84,7 @@ export declare class Country {
|
|
|
78
84
|
private readonly _continent;
|
|
79
85
|
private readonly _region;
|
|
80
86
|
private readonly _currencyCode;
|
|
87
|
+
private readonly _dialCode;
|
|
81
88
|
static readonly AF: Country;
|
|
82
89
|
static readonly AX: Country;
|
|
83
90
|
static readonly AL: Country;
|
|
@@ -578,8 +585,9 @@ export declare class Country {
|
|
|
578
585
|
* @param {CONTINENT} _continent - The continent where the country is located
|
|
579
586
|
* @param {SUB_REGION} _region - The region within the continent where the country is located
|
|
580
587
|
* @param {string | null} _currencyCode - The ISO currency code used in the country
|
|
588
|
+
* @param {number} _dialCode - The dial code used in the country
|
|
581
589
|
*/
|
|
582
|
-
constructor(_name: string, _iso2: ISO2CountryCode, _nameOfficial: string, _iso3: ISO3CountryCode, _flagEmoji
|
|
590
|
+
constructor(token: symbol, _name: string, _iso2: ISO2CountryCode, _nameOfficial: string | undefined, _iso3: ISO3CountryCode, _flagEmoji: string | undefined, _continent: CONTINENT | undefined, _region: SUB_REGION | undefined, _currencyCode: (CurrencyCode | null) | undefined, _dialCode: number);
|
|
583
591
|
/**
|
|
584
592
|
* Gets the common name of the country.
|
|
585
593
|
* @returns {string} The common name of the country
|
|
@@ -620,6 +628,11 @@ export declare class Country {
|
|
|
620
628
|
* @returns {string | null} The ISO currency code of the country, or null if not available
|
|
621
629
|
*/
|
|
622
630
|
get currencyCode(): CurrencyCode | null;
|
|
631
|
+
/**
|
|
632
|
+
* Gets the dial code used in the country.
|
|
633
|
+
* @returns {number} The dial code of the country
|
|
634
|
+
*/
|
|
635
|
+
get dialCode(): number;
|
|
623
636
|
/**
|
|
624
637
|
* Gets the Currency instance for this country.
|
|
625
638
|
* @returns {Currency | undefined} The Currency instance or undefined if no currency is assigned
|
|
@@ -709,6 +722,26 @@ export declare class Country {
|
|
|
709
722
|
* @returns Type predicate indicating if the value is a valid Country
|
|
710
723
|
*/
|
|
711
724
|
static is(obj: unknown): obj is Country;
|
|
725
|
+
/**
|
|
726
|
+
* Serializes the Country instance to a JSON-compatible object
|
|
727
|
+
*/
|
|
728
|
+
toJSON(): CountryJSON;
|
|
729
|
+
/**
|
|
730
|
+
* Serializes the Country instance to a JSON string
|
|
731
|
+
*/
|
|
732
|
+
toJSONString(): string;
|
|
733
|
+
/**
|
|
734
|
+
* Creates a Country instance from a JSON-compatible object or string
|
|
735
|
+
*/
|
|
736
|
+
static fromJSON(json: CountryJSON | string): Country | undefined;
|
|
737
|
+
/**
|
|
738
|
+
* Creates a Country instance from a JSON string
|
|
739
|
+
*/
|
|
740
|
+
static fromJSONString(jsonString: string): Country | undefined;
|
|
741
|
+
/**
|
|
742
|
+
* Type guard to check if an object is a valid CountryJSON using Zod validation
|
|
743
|
+
*/
|
|
744
|
+
static isCountryJSON(obj: unknown): obj is CountryJSON;
|
|
712
745
|
}
|
|
713
746
|
/**
|
|
714
747
|
* Service for managing country data.
|
|
@@ -819,4 +852,3 @@ export declare class CountryService {
|
|
|
819
852
|
*/
|
|
820
853
|
compare(country1: Country, country2: Country): boolean;
|
|
821
854
|
}
|
|
822
|
-
//# sourceMappingURL=country.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for Country JSON serialization
|
|
4
|
+
* This schema validates the JSON representation of a Country instance
|
|
5
|
+
*/
|
|
6
|
+
export declare const CountryJSONSchema: z.ZodObject<{
|
|
7
|
+
/** The ISO 3166-1 alpha-2 country code */
|
|
8
|
+
code: z.ZodString;
|
|
9
|
+
/** Version for future compatibility */
|
|
10
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
code: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}, {
|
|
15
|
+
code: string;
|
|
16
|
+
version?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Zod schema for validating ISO 3166-1 alpha-2 country codes.
|
|
20
|
+
*
|
|
21
|
+
* This schema checks if a given string is a valid ISO 3166-1 alpha-2 country code
|
|
22
|
+
* by checking against the predefined set of valid codes.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const result = iso2CountryCodeSchema.safeParse("US");
|
|
26
|
+
* if (result.success) {
|
|
27
|
+
* console.log("Valid ISO2 country code");
|
|
28
|
+
* } else {
|
|
29
|
+
* console.error("Invalid ISO2 country code");
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
export declare const ISO2CountryCodeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Zod schema for validating ISO 3166-1 alpha-3 country codes.
|
|
35
|
+
*
|
|
36
|
+
* This schema checks if a given string is a valid ISO 3166-1 alpha-3 country code
|
|
37
|
+
* by checking against the predefined set of valid codes.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const result = iso3CountryCodeSchema.safeParse("USA");
|
|
41
|
+
* if (result.success) {
|
|
42
|
+
* console.log("Valid ISO3 country code");
|
|
43
|
+
* } else {
|
|
44
|
+
* console.error("Invalid ISO3 country code");
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
export declare const ISO3CountryCodeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
48
|
+
/**
|
|
49
|
+
* Zod schema for validating either ISO 3166-1 alpha-2 or alpha-3 country codes.
|
|
50
|
+
*
|
|
51
|
+
* This schema allows for flexibility in accepting both two-letter and three-letter
|
|
52
|
+
* country codes, making it useful for functions that need to handle both formats.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* const result = countryCodeSchema.safeParse("US");
|
|
56
|
+
* if (result.success) {
|
|
57
|
+
* console.log("Valid country code");
|
|
58
|
+
* } else {
|
|
59
|
+
* console.error("Invalid country code");
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
export declare const CountryCodeSchema: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>, z.ZodObject<{
|
|
63
|
+
/** The ISO 3166-1 alpha-2 country code */
|
|
64
|
+
code: z.ZodString;
|
|
65
|
+
/** Version for future compatibility */
|
|
66
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
code: string;
|
|
69
|
+
version: string;
|
|
70
|
+
}, {
|
|
71
|
+
code: string;
|
|
72
|
+
version?: string | undefined;
|
|
73
|
+
}>]>;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ISO2CountryCode, ISO3CountryCode, CountryCode } from "./country.types.js";
|
|
2
|
+
export declare const CountryValidation: {
|
|
3
|
+
isISO2CountryCode: typeof isISO2CountryCode;
|
|
4
|
+
isISO3CountryCode: typeof isISO3CountryCode;
|
|
5
|
+
isCountryCode: typeof isCountryCode;
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* Type guard to check if a string is a valid ISO2CountryCode.
|
|
5
9
|
* @param code The string to check.
|
|
6
10
|
* @returns True if the string is a member of the ISO2CountryCode union type, false otherwise.
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
declare function isISO2CountryCode(code: string): code is ISO2CountryCode;
|
|
9
13
|
/**
|
|
10
14
|
* Type guard to check if a string is a valid isISO3CountryCode.
|
|
11
15
|
* @param code The string to check.
|
|
12
16
|
* @returns True if the string is a member of the isISO3CountryCode union type, false otherwise.
|
|
13
17
|
*/
|
|
14
|
-
|
|
18
|
+
declare function isISO3CountryCode(code: string): code is ISO3CountryCode;
|
|
15
19
|
/**
|
|
16
20
|
* Type guard to check if a string is a valid CountryCode.
|
|
17
21
|
* @param code The string to check
|
|
18
22
|
* @returns True if the string is a valid ISO-2 or ISO-3 country code
|
|
19
23
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
declare function isCountryCode(code: string): code is CountryCode;
|
|
25
|
+
export {};
|
|
@@ -26,7 +26,13 @@
|
|
|
26
26
|
* This approach follows the principle that closely related classes with circular
|
|
27
27
|
* dependencies are best managed in a unified module.
|
|
28
28
|
*/
|
|
29
|
-
import type { CurrencyCode } from "./types.js";
|
|
29
|
+
import type { CurrencyCode } from "./currency.types.js";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
import { CurrencyJSONSchema } from "./currency.schema.js";
|
|
32
|
+
/**
|
|
33
|
+
* Infer the CurrencyJSON type from the schema
|
|
34
|
+
*/
|
|
35
|
+
export type CurrencyJSON = z.infer<typeof CurrencyJSONSchema>;
|
|
30
36
|
/**
|
|
31
37
|
* Represents a currency with essential details.
|
|
32
38
|
* @class Currency
|
|
@@ -284,7 +290,7 @@ export declare class Currency {
|
|
|
284
290
|
* @param {CurrencyCode} _code - The ISO 4217 currency code
|
|
285
291
|
* @param {string} _namePlural - The plural form of the currency name
|
|
286
292
|
*/
|
|
287
|
-
constructor(_symbol: string, _name: string, _symbolNative: string, _decimalDigits: number, _rounding: number, _code: CurrencyCode, _namePlural: string);
|
|
293
|
+
constructor(token: symbol, _symbol: string, _name: string, _symbolNative: string, _decimalDigits: number, _rounding: number, _code: CurrencyCode, _namePlural: string);
|
|
288
294
|
/**
|
|
289
295
|
* Gets the international symbol of the currency.
|
|
290
296
|
* @returns {string} The international symbol of the currency
|
|
@@ -367,6 +373,26 @@ export declare class Currency {
|
|
|
367
373
|
* @returns Type predicate indicating if the value is a valid Currency
|
|
368
374
|
*/
|
|
369
375
|
static is(obj: unknown): obj is Currency;
|
|
376
|
+
/**
|
|
377
|
+
* Serializes the Currency instance to a JSON-compatible object
|
|
378
|
+
*/
|
|
379
|
+
toJSON(): CurrencyJSON;
|
|
380
|
+
/**
|
|
381
|
+
* Serializes the Currency instance to a JSON string
|
|
382
|
+
*/
|
|
383
|
+
toJSONString(): string;
|
|
384
|
+
/**
|
|
385
|
+
* Creates a Currency instance from a JSON-compatible object or string
|
|
386
|
+
*/
|
|
387
|
+
static fromJSON(json: CurrencyJSON | string): Currency | undefined;
|
|
388
|
+
/**
|
|
389
|
+
* Creates a Currency instance from a JSON string
|
|
390
|
+
*/
|
|
391
|
+
static fromJSONString(jsonString: string): Currency | undefined;
|
|
392
|
+
/**
|
|
393
|
+
* Type guard to check if an object is a valid CurrencyJSON using Zod validation
|
|
394
|
+
*/
|
|
395
|
+
static isCurrencyJSON(obj: unknown): obj is CurrencyJSON;
|
|
370
396
|
}
|
|
371
397
|
/**
|
|
372
398
|
* Service for managing currency data.
|
|
@@ -462,4 +488,3 @@ export declare class CurrencyService {
|
|
|
462
488
|
*/
|
|
463
489
|
private escapeRegExp;
|
|
464
490
|
}
|
|
465
|
-
//# sourceMappingURL=currency.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for validating ISO 4217 currency codes
|
|
4
|
+
*
|
|
5
|
+
* This schema checks if the provided string is a valid ISO 4217 currency code.
|
|
6
|
+
* If the validation fails, it returns an error message.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CurrencyCodeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Zod schema for Currency JSON serialization
|
|
11
|
+
* This schema validates the JSON representation of a Currency instance
|
|
12
|
+
*/
|
|
13
|
+
export declare const CurrencyJSONSchema: z.ZodObject<{
|
|
14
|
+
/** The ISO 4217 currency code */
|
|
15
|
+
code: z.ZodString;
|
|
16
|
+
/** Version for future compatibility */
|
|
17
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
code: string;
|
|
20
|
+
version: string;
|
|
21
|
+
}, {
|
|
22
|
+
code: string;
|
|
23
|
+
version?: string | undefined;
|
|
24
|
+
}>;
|
|
@@ -17,5 +17,4 @@
|
|
|
17
17
|
* Example: "USD" for US Dollar, "EUR" for Euro, "JPY" for Japanese Yen
|
|
18
18
|
*/
|
|
19
19
|
export type CurrencyCode = "USD" | "CAD" | "EUR" | "AED" | "AFN" | "ALL" | "AMD" | "ARS" | "AUD" | "AZN" | "BAM" | "BDT" | "BGN" | "BHD" | "BIF" | "BND" | "BOB" | "BRL" | "BWP" | "BYN" | "BZD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "GBP" | "GEL" | "GHS" | "GNF" | "GTQ" | "HKD" | "HNL" | "HRK" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KHR" | "KMF" | "KRW" | "KWD" | "KZT" | "LBP" | "LKR" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MOP" | "MUR" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SDG" | "SEK" | "SGD" | "SOS" | "SSP" | "SYP" | "THB" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "UYU" | "UZS" | "VES" | "VND" | "XAF" | "XOF" | "YER" | "ZAR" | "ZMW" | "STN" | "MRU" | "ZWG";
|
|
20
|
-
export declare const
|
|
21
|
-
//# sourceMappingURL=types.d.ts.map
|
|
20
|
+
export declare const CurrencyCodesSet: Set<CurrencyCode>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CurrencyCode } from "./currency.types.js";
|
|
2
|
+
export declare const CurrencyValidation: {
|
|
3
|
+
isCurrencyCode: typeof isCurrencyCode;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Type guard to check if a string is a valid CurrencyCode.
|
|
7
|
+
* @param code The string to check.
|
|
8
|
+
* @returns True if the string is a member of the CurrencyCode union type, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
declare function isCurrencyCode(code: string): code is CurrencyCode;
|
|
11
|
+
export {};
|