@temboplus/frontend-core 0.4.3 → 1.0.1-beta.0
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 +62 -173
- package/dist/coverage/coverage.types.d.ts +24 -0
- package/dist/coverage/index.d.ts +3 -0
- package/dist/coverage/tembo-coverage.d.ts +59 -0
- package/dist/domain/amount/amount.d.ts +476 -0
- package/dist/domain/amount/amount.helpers.d.ts +64 -0
- package/dist/domain/amount/amount.schema.d.ts +34 -0
- package/dist/domain/amount/index.d.ts +4 -0
- package/dist/domain/bank/bank.d.ts +59 -0
- package/dist/domain/bank/bank.helpers.d.ts +29 -0
- package/dist/domain/bank/bank.schema.d.ts +39 -0
- package/dist/domain/bank/bank.types.d.ts +9 -0
- package/dist/domain/bank/index.d.ts +4 -0
- package/dist/domain/channel/channel.d.ts +40 -0
- package/dist/domain/channel/channel.enums.d.ts +14 -0
- package/dist/domain/channel/channel.types.d.ts +12 -0
- package/dist/domain/channel/index.d.ts +3 -0
- package/dist/domain/country/country.d.ts +73 -0
- package/dist/domain/country/country.enums.d.ts +45 -0
- package/dist/domain/country/country.helpers.d.ts +6 -0
- package/dist/domain/country/country.schema.d.ts +73 -0
- package/{script/src/models/country/types.d.ts → dist/domain/country/country.types.d.ts} +18 -1
- package/dist/domain/country/index.d.ts +4 -0
- package/dist/domain/currency/currency.d.ts +62 -0
- package/dist/domain/currency/currency.helpers.d.ts +4 -0
- package/dist/domain/currency/currency.schema.d.ts +24 -0
- package/{script/src/models/currency/types.d.ts → dist/domain/currency/currency.types.d.ts} +7 -2
- package/dist/domain/currency/index.d.ts +4 -0
- package/{esm/src/models → dist/domain}/index.d.ts +3 -2
- package/dist/domain/mobile-money-provider/index.d.ts +4 -0
- package/dist/domain/mobile-money-provider/mobile-money-provider.d.ts +53 -0
- package/dist/domain/mobile-money-provider/mobile-money-provider.helpers.d.ts +5 -0
- package/dist/domain/mobile-money-provider/mobile-money-provider.schema.d.ts +22 -0
- package/dist/domain/mobile-money-provider/mobile-money-provider.types.d.ts +21 -0
- package/dist/domain/phone-number/index.d.ts +4 -0
- package/dist/domain/phone-number/phone-number.d.ts +57 -0
- package/dist/domain/phone-number/phone-number.helpers.d.ts +67 -0
- package/dist/domain/phone-number/phone-number.parser.d.ts +43 -0
- package/dist/domain/phone-number/phone-number.schema.d.ts +21 -0
- package/dist/domain/phone-number/phone-number.types.d.ts +72 -0
- package/dist/factories/amount.factory.d.ts +50 -0
- package/dist/factories/bank.factory.d.ts +47 -0
- package/dist/factories/country.factory.d.ts +40 -0
- package/dist/factories/currency.factory.d.ts +40 -0
- package/dist/factories/index.d.ts +7 -0
- package/dist/factories/mobile-money-provider.factory.d.ts +43 -0
- package/dist/factories/phone-number.factory.d.ts +31 -0
- package/dist/factories/transaction-limit.factory.d.ts +36 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/registries/bank.registry.d.ts +36 -0
- package/dist/registries/country.registry.d.ts +45 -0
- package/dist/registries/currency.registry.d.ts +33 -0
- package/dist/registries/index.d.ts +5 -0
- package/dist/registries/mobile-money-provider.registry.d.ts +48 -0
- package/dist/registries/transaction-limit.registry.d.ts +30 -0
- package/dist/repositories/bank.repository.d.ts +30 -0
- package/dist/repositories/country.repository.d.ts +31 -0
- package/dist/repositories/currency.repository.d.ts +28 -0
- package/dist/repositories/index.d.ts +5 -0
- package/dist/repositories/mobile-money-provider.repository.d.ts +53 -0
- package/dist/repositories/transaction-limit.repository.d.ts +31 -0
- package/{script/src → dist}/utils/id.d.ts +7 -3
- package/{esm/src/utils/index.js → dist/utils/index.d.ts} +1 -0
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/text.d.ts +103 -0
- package/{script/src → dist}/utils/time.d.ts +9 -4
- package/package.json +46 -23
- 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 +0 -11
- 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 +0 -7
- 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/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 +0 -21
- 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.map +0 -1
- package/esm/src/models/index.js +0 -5
- 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 +0 -146
- package/esm/src/reports/report_manager.d.ts.map +0 -1
- package/esm/src/reports/report_manager.js +0 -326
- 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 +0 -822
- 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 +0 -465
- 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.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 -146
- package/script/src/reports/report_manager.d.ts.map +0 -1
- package/script/src/reports/report_manager.js +0 -336
- 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,36 @@
|
|
|
1
|
+
import type { Bank } from "@domain/bank/bank.js";
|
|
2
|
+
import type { BankSwiftCode } from "@domain/bank/bank.types.js";
|
|
3
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Owns the canonical Bank model cache, keyed by country. Reads raw records from
|
|
6
|
+
* BankRepository, constructs Bank instances through BankFactory, and exposes
|
|
7
|
+
* lookup/search/type guard operations.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BankRegistry {
|
|
10
|
+
private static instance;
|
|
11
|
+
private readonly repository;
|
|
12
|
+
private readonly factory;
|
|
13
|
+
private readonly cache;
|
|
14
|
+
private constructor();
|
|
15
|
+
static getInstance(): BankRegistry;
|
|
16
|
+
private getCountryBanks;
|
|
17
|
+
/** Returns every Bank registered for a country. */
|
|
18
|
+
getAll(countryCode: ISO2CountryCode): Bank[];
|
|
19
|
+
/** Returns every Bank registered across every supported country. */
|
|
20
|
+
getAllSupportedBanks(): Bank[];
|
|
21
|
+
/**
|
|
22
|
+
* Resolves a Bank by BIC, scanning every supported country until a match is
|
|
23
|
+
* found. Returns undefined when the code is not a valid SWIFT format.
|
|
24
|
+
*/
|
|
25
|
+
detectBank(bic: string): Bank | undefined;
|
|
26
|
+
/** Filters banks for a country whose BIC contains the search term. */
|
|
27
|
+
searchBanks(countryCode: ISO2CountryCode, searchTerm: string, limit?: number): Bank[];
|
|
28
|
+
/** Filters banks across all supported countries by BIC search term. */
|
|
29
|
+
searchAllBanks(searchTerm: string, limit?: number): Bank[];
|
|
30
|
+
/**
|
|
31
|
+
* Resolves a Bank by BIC. When the country is provided the lookup is scoped
|
|
32
|
+
* to that country; otherwise the registry searches across every supported
|
|
33
|
+
* country.
|
|
34
|
+
*/
|
|
35
|
+
findByBIC(bic: BankSwiftCode | string, countryCode?: ISO2CountryCode): Bank | undefined;
|
|
36
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CONTINENT, SUB_REGION } from "@domain/country/country.enums.js";
|
|
2
|
+
import type { Country } from "@domain/country/country.js";
|
|
3
|
+
import type { CountryCode } from "@domain/country/country.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Owns the canonical Country model cache. Reads raw records from
|
|
6
|
+
* CountryRepository, constructs Country instances through CountryFactory, and
|
|
7
|
+
* exposes lookups, type guards, and queries.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CountryRegistry {
|
|
10
|
+
private static instance;
|
|
11
|
+
private readonly repository;
|
|
12
|
+
private readonly factory;
|
|
13
|
+
private list;
|
|
14
|
+
private byCode;
|
|
15
|
+
private byIso3;
|
|
16
|
+
private byContinent;
|
|
17
|
+
private byRegion;
|
|
18
|
+
private initialized;
|
|
19
|
+
private constructor();
|
|
20
|
+
static getInstance(): CountryRegistry;
|
|
21
|
+
private ensureInitialized;
|
|
22
|
+
/** Returns every supported Country. */
|
|
23
|
+
getAll(): Country[];
|
|
24
|
+
/** Returns every supported Country keyed by ISO-2 code. */
|
|
25
|
+
getAllAsRecord(): Record<string, Country>;
|
|
26
|
+
/** Returns every Country in a continent. */
|
|
27
|
+
getByContinent(continent: CONTINENT): Country[];
|
|
28
|
+
/** Returns every Country in a sub-region. */
|
|
29
|
+
getByRegion(region: SUB_REGION): Country[];
|
|
30
|
+
/** Returns every supported continent. */
|
|
31
|
+
getContinents(): CONTINENT[];
|
|
32
|
+
/** Returns every supported sub-region. */
|
|
33
|
+
getRegions(): SUB_REGION[];
|
|
34
|
+
/** Returns countries whose ISO-2 or ISO-3 code matches the search term. */
|
|
35
|
+
search(searchTerm: string, limit?: number): Country[];
|
|
36
|
+
/** Resolves a Country by its ISO-2 or ISO-3 code (case-insensitive). */
|
|
37
|
+
findByCode(code: CountryCode | string): Country | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves a Country from arbitrary string input by trimming, upper-casing,
|
|
40
|
+
* and validating against the ISO code list.
|
|
41
|
+
*/
|
|
42
|
+
find(input: string): Country | undefined;
|
|
43
|
+
/** Equality check based on name and ISO-2 code. */
|
|
44
|
+
compare(country1: Country, country2: Country): boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Currency } from "@domain/currency/currency.js";
|
|
2
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Owns the canonical Currency model cache. Reads raw records from
|
|
5
|
+
* CurrencyRepository, constructs Currency instances through CurrencyFactory,
|
|
6
|
+
* and exposes lookups, type guards, and queries.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CurrencyRegistry {
|
|
9
|
+
private static instance;
|
|
10
|
+
private readonly repository;
|
|
11
|
+
private readonly factory;
|
|
12
|
+
private list;
|
|
13
|
+
private byCode;
|
|
14
|
+
private initialized;
|
|
15
|
+
private constructor();
|
|
16
|
+
static getInstance(): CurrencyRegistry;
|
|
17
|
+
/** Builds the Currency cache from raw repository data; idempotent. */
|
|
18
|
+
private ensureInitialized;
|
|
19
|
+
/** Returns every supported Currency. */
|
|
20
|
+
getAll(): Currency[];
|
|
21
|
+
/** Returns every supported Currency keyed by code. */
|
|
22
|
+
getAllAsRecord(): Record<string, Currency>;
|
|
23
|
+
/** Resolves a Currency by ISO 4217 code (case-insensitive). */
|
|
24
|
+
findByCode(code: CurrencyCode | string): Currency | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Resolves a Currency from arbitrary string input by trimming, upper-casing,
|
|
27
|
+
* and validating against the ISO 4217 code list.
|
|
28
|
+
*/
|
|
29
|
+
find(input: string | CurrencyCode): Currency | undefined;
|
|
30
|
+
/** Pipe-separated regex pattern of every currency symbol (escaped). */
|
|
31
|
+
getCurrencySymbolPattern(): string;
|
|
32
|
+
private escapeRegExp;
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TransactionDirection } from "@domain/channel/channel.enums.js";
|
|
2
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
3
|
+
import type { MobileMoneyProvider } from "@domain/mobile-money-provider/mobile-money-provider.js";
|
|
4
|
+
import { PhoneNumber } from "@domain/phone-number/phone-number.js";
|
|
5
|
+
/**
|
|
6
|
+
* Owns the canonical MobileMoneyProvider cache, keyed by country. Reads raw
|
|
7
|
+
* records from MobileMoneyProviderRepository, constructs provider instances
|
|
8
|
+
* through MobileMoneyProviderFactory, and exposes queries plus prefix-based
|
|
9
|
+
* detection.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MobileMoneyProviderRegistry {
|
|
12
|
+
private static instance;
|
|
13
|
+
private readonly repository;
|
|
14
|
+
private readonly factory;
|
|
15
|
+
private readonly cache;
|
|
16
|
+
private constructor();
|
|
17
|
+
static getInstance(): MobileMoneyProviderRegistry;
|
|
18
|
+
private getCountryProviders;
|
|
19
|
+
/** Every configured mobile-money provider for a supported country. */
|
|
20
|
+
getProviders(countryCode: ISO2CountryCode): MobileMoneyProvider[];
|
|
21
|
+
/** Providers in a country filtered by transaction direction. */
|
|
22
|
+
getProvidersByDirection(countryCode: ISO2CountryCode, direction: TransactionDirection): MobileMoneyProvider[];
|
|
23
|
+
/** Looks up a provider by its stable Tembo identifier. */
|
|
24
|
+
findProvider(countryCode: ISO2CountryCode, providerId: string): MobileMoneyProvider | undefined;
|
|
25
|
+
/** Whether a provider exists, optionally constrained to a direction. */
|
|
26
|
+
isProviderSupported(countryCode: ISO2CountryCode, providerId: string, direction?: TransactionDirection): boolean;
|
|
27
|
+
/** Whether prefix-based detection is unreliable in this country. */
|
|
28
|
+
requiresExplicitProvider(countryCode: ISO2CountryCode): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Detects a provider from a parsed phone number's compact (national)
|
|
31
|
+
* representation. Returns undefined when prefix mapping is unreliable.
|
|
32
|
+
*/
|
|
33
|
+
detectProviderByCompactNumber(countryCode: ISO2CountryCode, compactNumber: string): MobileMoneyProvider | undefined;
|
|
34
|
+
/** Detects a provider from a raw phone-number string for a given country. */
|
|
35
|
+
detectProviderByPhoneNumber(countryCode: ISO2CountryCode, phoneNumber: string): MobileMoneyProvider | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Detects a provider from a phone number when prefix mapping is reliable.
|
|
38
|
+
*
|
|
39
|
+
* Kenya currently returns undefined because number portability means the
|
|
40
|
+
* provider must be supplied explicitly instead of inferred from the prefix.
|
|
41
|
+
*/
|
|
42
|
+
detectProviderFromPhoneNumber(input: string | PhoneNumber): MobileMoneyProvider | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Normalises a raw phone-number string into a national compact number for a
|
|
45
|
+
* country, stripping country-calling-code or leading-zero prefixes.
|
|
46
|
+
*/
|
|
47
|
+
private toCompactNumber;
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ChannelType, TransactionDirection } from "@domain/channel/channel.enums.js";
|
|
2
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
3
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
4
|
+
import { type TransactionLimits } from "@factories/transaction-limit.factory.js";
|
|
5
|
+
export interface TransactionLimitQuery {
|
|
6
|
+
countryCode: ISO2CountryCode;
|
|
7
|
+
currencyCode: CurrencyCode;
|
|
8
|
+
direction: TransactionDirection;
|
|
9
|
+
channelType: ChannelType;
|
|
10
|
+
providerId?: string;
|
|
11
|
+
}
|
|
12
|
+
export type { TransactionLimits };
|
|
13
|
+
/**
|
|
14
|
+
* Registry for bundled transaction-limit records.
|
|
15
|
+
*
|
|
16
|
+
* The repository provides raw numeric limits; the factory converts matching
|
|
17
|
+
* records into Amount-aware TransactionLimits objects.
|
|
18
|
+
*/
|
|
19
|
+
export declare class TransactionLimitRegistry {
|
|
20
|
+
private static instance;
|
|
21
|
+
private readonly repository;
|
|
22
|
+
private readonly factory;
|
|
23
|
+
private constructor();
|
|
24
|
+
static getInstance(): TransactionLimitRegistry;
|
|
25
|
+
/**
|
|
26
|
+
* Returns limits for an exact coverage query, preserving currency semantics
|
|
27
|
+
* by wrapping numeric min/max values in Amount instances.
|
|
28
|
+
*/
|
|
29
|
+
getLimits(query: TransactionLimitQuery): TransactionLimits | undefined;
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raw bank record as it appears in a country dataset.
|
|
4
|
+
*
|
|
5
|
+
* Older entries used `fullName` / `swiftCode`; both legacy and current shapes
|
|
6
|
+
* are accepted to remain backwards-compatible with already-published datasets.
|
|
7
|
+
*/
|
|
8
|
+
export interface RawBank {
|
|
9
|
+
officialName?: string;
|
|
10
|
+
fullName?: string;
|
|
11
|
+
shortName: string;
|
|
12
|
+
bic?: string;
|
|
13
|
+
swiftCode?: string;
|
|
14
|
+
formerNames?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Pure data layer for bank records, indexed by country. Loads bundled JSON
|
|
18
|
+
* datasets and exposes typed lookups; never constructs domain models.
|
|
19
|
+
*/
|
|
20
|
+
export declare class BankRepository {
|
|
21
|
+
private static instance;
|
|
22
|
+
private constructor();
|
|
23
|
+
static getInstance(): BankRepository;
|
|
24
|
+
/** ISO-2 codes of every country with bundled bank data. */
|
|
25
|
+
getSupportedCountryCodes(): ISO2CountryCode[];
|
|
26
|
+
/** Returns every raw bank record for a country. */
|
|
27
|
+
listRaw(countryCode: ISO2CountryCode): RawBank[];
|
|
28
|
+
/** Returns a raw bank record matched by BIC inside the given country. */
|
|
29
|
+
findRawByBIC(bic: string, countryCode?: ISO2CountryCode): RawBank | undefined;
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ISO2CountryCode, ISO3CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raw country record as it appears in the source dataset (snake_case).
|
|
4
|
+
*/
|
|
5
|
+
export interface RawCountry {
|
|
6
|
+
name: string;
|
|
7
|
+
iso_2: ISO2CountryCode;
|
|
8
|
+
name_official: string;
|
|
9
|
+
iso_3: ISO3CountryCode;
|
|
10
|
+
flag_emoji: string;
|
|
11
|
+
continent: string;
|
|
12
|
+
region: string;
|
|
13
|
+
currency_iso_code: string | null;
|
|
14
|
+
dial_code: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Pure data layer for country records. Loads the bundled JSON dataset and
|
|
18
|
+
* exposes typed lookups; never constructs domain models.
|
|
19
|
+
*/
|
|
20
|
+
export declare class CountryRepository {
|
|
21
|
+
private static instance;
|
|
22
|
+
private readonly list;
|
|
23
|
+
private readonly byIso2;
|
|
24
|
+
private readonly byIso3;
|
|
25
|
+
private constructor();
|
|
26
|
+
static getInstance(): CountryRepository;
|
|
27
|
+
/** Returns every raw country record. */
|
|
28
|
+
listRaw(): RawCountry[];
|
|
29
|
+
/** Returns a raw country record by ISO-2 or ISO-3 code, or undefined. */
|
|
30
|
+
findRawByCode(code: string): RawCountry | undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Raw currency record as it appears in the source dataset (snake_case).
|
|
4
|
+
*/
|
|
5
|
+
export interface RawCurrency {
|
|
6
|
+
symbol: string;
|
|
7
|
+
name: string;
|
|
8
|
+
symbol_native: string;
|
|
9
|
+
decimal_digits: number;
|
|
10
|
+
rounding: number;
|
|
11
|
+
code: CurrencyCode;
|
|
12
|
+
name_plural: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Pure data layer for currency records. Loads the bundled JSON dataset and
|
|
16
|
+
* exposes typed lookups; never constructs domain models.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CurrencyRepository {
|
|
19
|
+
private static instance;
|
|
20
|
+
private readonly byCode;
|
|
21
|
+
private readonly list;
|
|
22
|
+
private constructor();
|
|
23
|
+
static getInstance(): CurrencyRepository;
|
|
24
|
+
/** Returns every raw currency record. */
|
|
25
|
+
listRaw(): RawCurrency[];
|
|
26
|
+
/** Returns a raw currency record by code, or undefined if unknown. */
|
|
27
|
+
findRawByCode(code: string): RawCurrency | undefined;
|
|
28
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Raw provider record as it appears in a country dataset.
|
|
5
|
+
*/
|
|
6
|
+
export interface RawMobileMoneyProvider {
|
|
7
|
+
id: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
mobileMoneyServiceName: string;
|
|
10
|
+
directions: string[];
|
|
11
|
+
requiresExplicitProvider: boolean;
|
|
12
|
+
phonePrefixes: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Raw mobile-money dataset for a country.
|
|
16
|
+
*/
|
|
17
|
+
export interface RawMobileMoneyDataset {
|
|
18
|
+
dataset_name: string;
|
|
19
|
+
source: string;
|
|
20
|
+
version: string;
|
|
21
|
+
countryCode: ISO2CountryCode;
|
|
22
|
+
currencyCode: CurrencyCode;
|
|
23
|
+
last_updated: string;
|
|
24
|
+
providers: RawMobileMoneyProvider[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Pure data layer for mobile-money provider records, indexed by country.
|
|
28
|
+
* Loads bundled JSON datasets and exposes typed lookups; never constructs
|
|
29
|
+
* domain models.
|
|
30
|
+
*/
|
|
31
|
+
export declare class MobileMoneyProviderRepository {
|
|
32
|
+
private static instance;
|
|
33
|
+
private constructor();
|
|
34
|
+
static getInstance(): MobileMoneyProviderRepository;
|
|
35
|
+
/** ISO-2 codes of every country with bundled mobile-money data. */
|
|
36
|
+
getSupportedCountryCodes(): ISO2CountryCode[];
|
|
37
|
+
/** Returns the raw dataset for a country, or undefined if unsupported. */
|
|
38
|
+
findRawDataset(countryCode: ISO2CountryCode): RawMobileMoneyDataset | undefined;
|
|
39
|
+
/** Returns every raw provider record for a country. */
|
|
40
|
+
listRaw(countryCode: ISO2CountryCode): RawMobileMoneyProvider[];
|
|
41
|
+
/**
|
|
42
|
+
* Returns a raw provider record matched by ID.
|
|
43
|
+
* If countryCode is provided, searches only within that country.
|
|
44
|
+
* If omitted, searches across all supported countries.
|
|
45
|
+
*/
|
|
46
|
+
findRawByID(target: string, countryCode?: ISO2CountryCode): {
|
|
47
|
+
provider: RawMobileMoneyProvider;
|
|
48
|
+
meta: {
|
|
49
|
+
countryCode: ISO2CountryCode;
|
|
50
|
+
currencyCode: CurrencyCode;
|
|
51
|
+
};
|
|
52
|
+
} | undefined;
|
|
53
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ChannelType, TransactionDirection } from "@domain/channel/channel.enums.js";
|
|
2
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
3
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
4
|
+
export interface RawTransactionLimitQuery {
|
|
5
|
+
countryCode: ISO2CountryCode;
|
|
6
|
+
currencyCode: CurrencyCode;
|
|
7
|
+
direction: TransactionDirection;
|
|
8
|
+
channelType: ChannelType;
|
|
9
|
+
providerId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RawTransactionLimit extends RawTransactionLimitQuery {
|
|
12
|
+
min: number;
|
|
13
|
+
max: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reads raw transaction limit data as plain numeric values.
|
|
17
|
+
*
|
|
18
|
+
* TransactionLimitFactory wraps these results in Amount instances when callers
|
|
19
|
+
* need currency-aware semantics.
|
|
20
|
+
*/
|
|
21
|
+
export declare class TransactionLimitRepository {
|
|
22
|
+
private static instance;
|
|
23
|
+
private readonly limits;
|
|
24
|
+
private constructor();
|
|
25
|
+
static getInstance(): TransactionLimitRepository;
|
|
26
|
+
/**
|
|
27
|
+
* Finds the most specific limit matching country, currency, channel, direction,
|
|
28
|
+
* and optional provider ID.
|
|
29
|
+
*/
|
|
30
|
+
findLimit(query: RawTransactionLimitQuery): RawTransactionLimit | undefined;
|
|
31
|
+
}
|
|
@@ -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 {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capitalizes the first letter of a string and converts the rest of the string to lowercase.
|
|
3
|
+
* @param {string} str - The input string.
|
|
4
|
+
* @returns {string} - The formatted string with the first letter capitalized.
|
|
5
|
+
*/
|
|
6
|
+
declare function capitalizeFirstLetter(str: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Combines a first name and a last name into a full name.
|
|
9
|
+
* @param {string} firstName - The first name.
|
|
10
|
+
* @param {string} lastName - The last name.
|
|
11
|
+
* @returns {string} - The full name formatted as "FirstName LastName".
|
|
12
|
+
*/
|
|
13
|
+
declare function getFullName(firstName: string, lastName: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generates a URL-friendly slug from a given text.
|
|
16
|
+
* @param {string} text - The input string.
|
|
17
|
+
* @returns {string} - The generated slug with lowercase alphanumeric characters and hyphens.
|
|
18
|
+
*/
|
|
19
|
+
declare function generateSlug(text: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Abbreviates a full name into a first name and the initial of the last name.
|
|
22
|
+
* @param {string} fullName - The input full name.
|
|
23
|
+
* @returns {string} - The abbreviated name in the format "FirstName L.".
|
|
24
|
+
*/
|
|
25
|
+
declare function abbreviateName(fullName: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Extracts the initials from a full name.
|
|
28
|
+
* @param {string} fullName - The input full name.
|
|
29
|
+
* @returns {string} - The initials in uppercase format.
|
|
30
|
+
*/
|
|
31
|
+
declare function getInitialsFrom(fullName: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Validates a personal name (account holder name, wallet owner name, etc.)
|
|
34
|
+
* Used across bank accounts and mobile-money wallets for consistent validation.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} name - The name to validate
|
|
37
|
+
* @returns {boolean} True if the name meets all validation criteria, false otherwise
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Returns true
|
|
41
|
+
* validatePersonalName("John Smith");
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Returns false (too short)
|
|
45
|
+
* validatePersonalName("Jo");
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Returns false (invalid characters)
|
|
49
|
+
* validatePersonalName("User123");
|
|
50
|
+
*/
|
|
51
|
+
declare function validatePersonalName(name: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Validates a business name (company, organization, etc.)
|
|
54
|
+
* More lenient than personal name validation.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} name - The business name to validate
|
|
57
|
+
* @returns {boolean} True if the name meets business name criteria, false otherwise
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Returns true
|
|
61
|
+
* validateBusinessName("ABC Corporation Ltd");
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Returns true
|
|
65
|
+
* validateBusinessName("Smith & Sons Inc.");
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* // Returns true
|
|
69
|
+
* validateBusinessName("M-Pesa");
|
|
70
|
+
*/
|
|
71
|
+
declare function validateBusinessName(name: string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Validates any name (personal or business) with automatic detection.
|
|
74
|
+
* First tries to detect if it's a business name, then validates accordingly.
|
|
75
|
+
* If detection fails, tries both validation methods.
|
|
76
|
+
*
|
|
77
|
+
* @param {string} name - The name to validate (personal or business)
|
|
78
|
+
* @returns {boolean} True if the name is valid as either personal or business name
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Returns true (personal name)
|
|
82
|
+
* validateName("John Smith");
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* // Returns true (business name)
|
|
86
|
+
* validateName("CRDB Bank PLC");
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* // Returns true (could be either)
|
|
90
|
+
* validateName("Smith Solutions");
|
|
91
|
+
*/
|
|
92
|
+
declare function validateName(name: string): boolean;
|
|
93
|
+
export declare const TextUtils: {
|
|
94
|
+
capitalizeFirstLetter: typeof capitalizeFirstLetter;
|
|
95
|
+
getFullName: typeof getFullName;
|
|
96
|
+
generateSlug: typeof generateSlug;
|
|
97
|
+
abbreviateName: typeof abbreviateName;
|
|
98
|
+
getInitialsFrom: typeof getInitialsFrom;
|
|
99
|
+
validatePersonalName: typeof validatePersonalName;
|
|
100
|
+
validateBusinessName: typeof validateBusinessName;
|
|
101
|
+
validateName: typeof validateName;
|
|
102
|
+
};
|
|
103
|
+
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 {};
|
package/package.json
CHANGED
|
@@ -1,36 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temboplus/frontend-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1-beta.0",
|
|
4
4
|
"description": "A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.",
|
|
5
|
-
"
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/TemboPlus-Frontend/frontend-core-js.git"
|
|
8
|
-
},
|
|
5
|
+
"author": "Okello Gerald",
|
|
9
6
|
"license": "MIT",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
7
|
+
"keywords": [
|
|
8
|
+
"temboplus",
|
|
9
|
+
"frontend-core"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs.js",
|
|
13
|
+
"module": "./dist/index.esm.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"require": "./dist/index.cjs.js"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
21
25
|
"scripts": {
|
|
22
|
-
"
|
|
26
|
+
"build": "node ./node_modules/rollup/dist/bin/rollup -c rollup.config.js",
|
|
27
|
+
"prepare": "npm run build",
|
|
28
|
+
"dev": "npm run build -- --watch",
|
|
29
|
+
"test": "node ./node_modules/vitest/vitest.mjs"
|
|
23
30
|
},
|
|
24
|
-
"
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/TemboPlus-Frontend/frontend-core-js.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/TemboPlus-Frontend/frontend-core-js/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/TemboPlus-Frontend/frontend-core-js#readme",
|
|
25
39
|
"dependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
40
|
+
"libphonenumber-js": "^1.12.6",
|
|
41
|
+
"pino": "^9.13.1",
|
|
42
|
+
"tslib": "^2.8.1",
|
|
43
|
+
"uuid": "^11.1.0",
|
|
44
|
+
"zod": "^3.24.2"
|
|
29
45
|
},
|
|
30
46
|
"devDependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"
|
|
33
|
-
"@
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
48
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
49
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
50
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
51
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
52
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
53
|
+
"pino-pretty": "^13.1.1",
|
|
54
|
+
"rollup": "^4.39.0",
|
|
55
|
+
"ts-node": "^10.9.2",
|
|
56
|
+
"typescript": "^5.9.3",
|
|
57
|
+
"vitest": "^3.2.4"
|
|
58
|
+
}
|
|
59
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2025 TemboPlus Inc.
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
-
|
|
5
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.test_shims.d.ts","sourceRoot":"","sources":["../src/_dnt.test_shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.217.0/assert/_constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_diff.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.217.0/assert/_diff.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,QAAQ,CAAC;AAE7C,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;CAChC;AA4BD;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CA+L5D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAqI3C;AAwCD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAC7C,EAAE,UAAkB,EAAE;;CAAK,GAC1B,MAAM,EAAE,CAwBV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_format.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.217.0/assert/_format.ts"],"names":[],"mappings":"AAYA,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAezC"}
|