@temboplus/frontend-core 0.4.4 → 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 -214
- 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,57 @@
|
|
|
1
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
import type { PhoneNumber as LibPhoneNumberInstance } from "libphonenumber-js";
|
|
3
|
+
import { type ParsedPhoneNumber, PhoneNumberParser } from "./phone-number.parser.js";
|
|
4
|
+
import type { PhoneNumberJSON } from "./phone-number.schema.js";
|
|
5
|
+
import { PhoneNumberFormat, type PhoneNumberParseOptions, type PhoneNumberType } from "./phone-number.types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Internal symbol used by PhoneNumberFactory to bypass the protected constructor.
|
|
8
|
+
* Importing this from outside the factory is unsupported.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PhoneNumberConstructorToken: unique symbol;
|
|
11
|
+
/**
|
|
12
|
+
* Plain-object representation of a PhoneNumber containing the full state.
|
|
13
|
+
*/
|
|
14
|
+
export interface PhoneNumberObject {
|
|
15
|
+
e164Format: string;
|
|
16
|
+
countryCode: ISO2CountryCode;
|
|
17
|
+
compactNumber: string;
|
|
18
|
+
numberType?: PhoneNumberType;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Pure value object representing a validated international phone number.
|
|
22
|
+
* Parsing/formatting goes through libphonenumber-js via the internal parser;
|
|
23
|
+
* factories and validation live on PhoneNumberFactory.
|
|
24
|
+
*/
|
|
25
|
+
export declare class PhoneNumber {
|
|
26
|
+
readonly countryCode: ISO2CountryCode;
|
|
27
|
+
readonly compactNumber: string;
|
|
28
|
+
readonly e164Format: string;
|
|
29
|
+
private readonly _parser;
|
|
30
|
+
private readonly _parsedInfo;
|
|
31
|
+
constructor(token: symbol, parsedInfo: ParsedPhoneNumber, parser: PhoneNumberParser);
|
|
32
|
+
/** Validates the phone number using the underlying library. */
|
|
33
|
+
validate(): boolean;
|
|
34
|
+
/** Formats the phone number using the requested style. */
|
|
35
|
+
getWithFormat(format: PhoneNumberFormat): string;
|
|
36
|
+
/** Returns the type of phone number (e.g. MOBILE, FIXED_LINE) when known. */
|
|
37
|
+
getNumberType(): PhoneNumberType | undefined;
|
|
38
|
+
/** Human-readable label, the international format. */
|
|
39
|
+
get label(): string;
|
|
40
|
+
/** Underlying instance from libphonenumber-js, exposed for advanced use. */
|
|
41
|
+
get underlyingInstance(): LibPhoneNumberInstance;
|
|
42
|
+
/** E.164 string. */
|
|
43
|
+
toString(): string;
|
|
44
|
+
/** Compact JSON identity for serialization. */
|
|
45
|
+
toJSON(): PhoneNumberJSON;
|
|
46
|
+
toJSONString(): string;
|
|
47
|
+
/** Full plain-object dump of all current state. */
|
|
48
|
+
toObject(): PhoneNumberObject;
|
|
49
|
+
/** Parses a phone number string into a validated PhoneNumber. */
|
|
50
|
+
static from(input: string, options?: PhoneNumberParseOptions): PhoneNumber | undefined;
|
|
51
|
+
/** Re-resolves a PhoneNumber from its compact JSON identity. */
|
|
52
|
+
static fromJSON(json: PhoneNumberJSON | string): PhoneNumber | undefined;
|
|
53
|
+
/** Re-resolves a PhoneNumber from a JSON string. */
|
|
54
|
+
static fromJSONString(jsonString: string): PhoneNumber | undefined;
|
|
55
|
+
/** Type guard delegating to PhoneNumberFactory.isPhoneNumber. */
|
|
56
|
+
static is(obj: unknown): obj is PhoneNumber;
|
|
57
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
export declare const phoneLogger: import("pino").Logger<never, boolean>;
|
|
3
|
+
export declare const PhoneNumberHelpers: {
|
|
4
|
+
/**
|
|
5
|
+
* Removes all whitespace characters from the given string.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} input - The input string.
|
|
8
|
+
* @returns {string} String with whitespace removed.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* removeSpaces(" 0712 345 678 ") // "0712345678"
|
|
12
|
+
* removeSpaces(" +255 712 345 678") // "+255712345678"
|
|
13
|
+
*/
|
|
14
|
+
removeSpaces: (input: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Strips all formatting characters used to enhance readability in phone numbers.
|
|
17
|
+
* Preserves only digits and an optional leading '+' if present.
|
|
18
|
+
*
|
|
19
|
+
* Characters removed include:
|
|
20
|
+
* - Whitespace: space, tab, non-breaking space
|
|
21
|
+
* - Hyphens, dots, slashes: `-`, `.`, `/`
|
|
22
|
+
* - Brackets: `(`, `)`
|
|
23
|
+
* - URI prefix: `tel:`
|
|
24
|
+
* - Extensions like `ext.`, `x`, or `#` and following digits
|
|
25
|
+
*
|
|
26
|
+
* @param {string} input - The phone number string to strip.
|
|
27
|
+
* @returns {string} A cleaned string with only digits and optional '+' prefix.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* stripFormattingCharacters("tel:+255 (712) 345-678") // "+255712345678"
|
|
31
|
+
* stripFormattingCharacters("0712-345-678 x99") // "0712345678"
|
|
32
|
+
* stripFormattingCharacters("(+255) 712/345.678 ext. 9") // "+255712345678"
|
|
33
|
+
* stripFormattingCharacters("712abc345678") // "712abc345678"
|
|
34
|
+
*/
|
|
35
|
+
stripFormattingCharacters: (input: string) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Normalizes a phone number string by:
|
|
38
|
+
* - Removing all special characters and spaces
|
|
39
|
+
* - Preserving only digits and a leading '+'
|
|
40
|
+
* - Ensuring the result starts with a '+' wherever appropriate
|
|
41
|
+
* - Handling national numbers when default country is provided
|
|
42
|
+
* - Removing leading '0' when it's a national number prefix
|
|
43
|
+
*
|
|
44
|
+
* @param {string} input - The phone number string to normalize
|
|
45
|
+
* @param {CountryCode} [defaultCountry] - Optional default country code
|
|
46
|
+
* @returns {string} The normalized phone number string
|
|
47
|
+
* @throws {Error} If invalid country code provided
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* normalizePhoneNumber("+255 (712) 345-678") // "+255712345678"
|
|
51
|
+
* normalizePhoneNumber("0712 345 678", "TZ") // "+255712345678"
|
|
52
|
+
* normalizePhoneNumber("255712345678") // "255712345678"
|
|
53
|
+
*/
|
|
54
|
+
normalizePhoneNumber: (input: string, defaultCountry?: CountryCode) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if a string contains only digits or a `+` prefix followed by digits.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} input - The input string.
|
|
59
|
+
* @returns {boolean} True if valid format, false otherwise.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* isOnlyDigitsOrPlus("+255712345678") // true
|
|
63
|
+
* isOnlyDigitsOrPlus("0712345678") // true
|
|
64
|
+
* isOnlyDigitsOrPlus("+255-712-345-678") // false
|
|
65
|
+
*/
|
|
66
|
+
isOnlyDigitsOrPlus: (input: string) => boolean;
|
|
67
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type NumberType, type PhoneNumber as LibPhoneNumber } from "libphonenumber-js/max";
|
|
2
|
+
import { PhoneNumberFormat } from "./phone-number.types.js";
|
|
3
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
4
|
+
export interface ParsedPhoneNumber {
|
|
5
|
+
libInstance: LibPhoneNumber;
|
|
6
|
+
countryCode: ISO2CountryCode | undefined;
|
|
7
|
+
compactNumber: string;
|
|
8
|
+
e164Format: string;
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
numberType: NumberType | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Internal adapter around libphonenumber-js.
|
|
14
|
+
*
|
|
15
|
+
* This parser is intentionally not exported as a public domain service. The
|
|
16
|
+
* PhoneNumber model uses it to keep library-specific parsing and formatting
|
|
17
|
+
* details outside the value object.
|
|
18
|
+
*/
|
|
19
|
+
export declare class PhoneNumberParser {
|
|
20
|
+
private static instance;
|
|
21
|
+
private constructor();
|
|
22
|
+
static getInstance(): PhoneNumberParser;
|
|
23
|
+
/**
|
|
24
|
+
* Parses a phone number string using libphonenumber-js.
|
|
25
|
+
* @param numberToParse The raw phone number string.
|
|
26
|
+
* @param defaultCountry Optional default country code.
|
|
27
|
+
* @returns A ParsedPhoneNumber object if successful, otherwise undefined.
|
|
28
|
+
*/
|
|
29
|
+
parse(numberToParse: string, defaultCountry?: ISO2CountryCode): ParsedPhoneNumber | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Validates a previously parsed LibPhoneNumber instance.
|
|
32
|
+
* @param libInstance The LibPhoneNumber instance from libphonenumber-js.
|
|
33
|
+
* @returns True if the number is considered valid by the library.
|
|
34
|
+
*/
|
|
35
|
+
isValid(libInstance: LibPhoneNumber | undefined): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Formats a previously parsed LibPhoneNumber instance.
|
|
38
|
+
* @param libInstance The LibPhoneNumber instance from libphonenumber-js.
|
|
39
|
+
* @param formatType Our local PhoneNumberFormat enum value.
|
|
40
|
+
* @returns The formatted string, or the E.164 format as fallback.
|
|
41
|
+
*/
|
|
42
|
+
format(libInstance: LibPhoneNumber | undefined, formatType: PhoneNumberFormat): string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Compact JSON identity for a PhoneNumber, sufficient to re-resolve the value
|
|
4
|
+
* via PhoneNumberFactory.
|
|
5
|
+
*
|
|
6
|
+
* E.164 validation rules:
|
|
7
|
+
* - Starts with '+'
|
|
8
|
+
* - Followed by country code (1-3 digits, first digit 1-9)
|
|
9
|
+
* - Total length 8-16 characters including '+'
|
|
10
|
+
*/
|
|
11
|
+
export declare const PhoneNumberJSONSchema: z.ZodObject<{
|
|
12
|
+
e164Format: z.ZodString;
|
|
13
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
version: string;
|
|
16
|
+
e164Format: string;
|
|
17
|
+
}, {
|
|
18
|
+
e164Format: string;
|
|
19
|
+
version?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type PhoneNumberJSON = z.infer<typeof PhoneNumberJSONSchema>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Enumeration for various phone number formats used for display and processing.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum PhoneNumberFormat {
|
|
6
|
+
/**
|
|
7
|
+
* International format, typically used for display.
|
|
8
|
+
* Includes '+' and country code, may include spacing for readability.
|
|
9
|
+
* (e.g., +1 202 555 0123)
|
|
10
|
+
* Note: Exact spacing might vary based on library implementation or locale.
|
|
11
|
+
*/
|
|
12
|
+
INTERNATIONAL = "INTERNATIONAL",
|
|
13
|
+
/**
|
|
14
|
+
* National format, typically including national prefix (like '0') and local spacing.
|
|
15
|
+
* Formatting varies significantly by country.
|
|
16
|
+
* (e.g., 0712 345 678 for TZ, (213) 373-4253 for US)
|
|
17
|
+
*/
|
|
18
|
+
NATIONAL = "NATIONAL",
|
|
19
|
+
/**
|
|
20
|
+
* Compact national format (National Significant Number).
|
|
21
|
+
* Typically digits only, without country code or national prefix '0'.
|
|
22
|
+
* (e.g., 712345678 for TZ, 2133734253 for US)
|
|
23
|
+
*/
|
|
24
|
+
COMPACT = "COMPACT",
|
|
25
|
+
/**
|
|
26
|
+
* RFC3966 URI format for telephone numbers.
|
|
27
|
+
* (e.g., tel:+1-202-555-0123 or tel:+255712345678)
|
|
28
|
+
*/
|
|
29
|
+
RFC3966 = "RFC3966",
|
|
30
|
+
/**
|
|
31
|
+
* Strict E.164 format. Includes '+' and country code, followed only by digits
|
|
32
|
+
* with no spacing or formatting characters. Globally unique.
|
|
33
|
+
* (e.g., +12025550123, +255712345678)
|
|
34
|
+
*/
|
|
35
|
+
E164 = "E164",
|
|
36
|
+
/**
|
|
37
|
+
* International numeric format without the '+' prefix.
|
|
38
|
+
* Includes country code followed by the National Significant Number (NSN),
|
|
39
|
+
* digits only, with no formatting characters or separators.
|
|
40
|
+
* Commonly used in storage, logging, or systems where '+' is unnecessary or undesirable.
|
|
41
|
+
* (e.g., 12025550123, 255712345678)
|
|
42
|
+
*/
|
|
43
|
+
INTERNATIONAL_NUMERIC = "INTERNATIONAL_NUMERIC"
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents the type of a phone number, mimicking the classification
|
|
47
|
+
* used by the underlying libphonenumber-js library.
|
|
48
|
+
*/
|
|
49
|
+
export declare enum PhoneNumberType {
|
|
50
|
+
FIXED_LINE = "FIXED_LINE",
|
|
51
|
+
MOBILE = "MOBILE",
|
|
52
|
+
FIXED_LINE_OR_MOBILE = "FIXED_LINE_OR_MOBILE",// Indicates ambiguity between fixed line and mobile
|
|
53
|
+
TOLL_FREE = "TOLL_FREE",
|
|
54
|
+
PREMIUM_RATE = "PREMIUM_RATE",
|
|
55
|
+
SHARED_COST = "SHARED_COST",
|
|
56
|
+
VOIP = "VOIP",// Voice over IP
|
|
57
|
+
PERSONAL_NUMBER = "PERSONAL_NUMBER",
|
|
58
|
+
PAGER = "PAGER",
|
|
59
|
+
UAN = "UAN",// Universal Access Number
|
|
60
|
+
VOICEMAIL = "VOICEMAIL",
|
|
61
|
+
UNKNOWN = "UNKNOWN"
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Options for parsing phone numbers
|
|
65
|
+
*/
|
|
66
|
+
export interface PhoneNumberParseOptions {
|
|
67
|
+
/**
|
|
68
|
+
* Default country ISO code to use when parsing a non-international number,
|
|
69
|
+
* or when a dial code is shared by multiple countries.
|
|
70
|
+
*/
|
|
71
|
+
defaultCountry?: ISO2CountryCode;
|
|
72
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Amount } from "@domain/amount/amount.js";
|
|
2
|
+
import { type AmountJSON } from "@domain/amount/amount.schema.js";
|
|
3
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Owns Amount construction, parsing, validation, and aggregate operations.
|
|
6
|
+
* Resolves currencies through CurrencyRegistry; never owns currency data itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AmountFactory {
|
|
9
|
+
private static instance;
|
|
10
|
+
private readonly currencyRegistry;
|
|
11
|
+
private constructor();
|
|
12
|
+
static getInstance(): AmountFactory;
|
|
13
|
+
/**
|
|
14
|
+
* Parses arbitrary input into a validated Amount. Accepts numeric values or
|
|
15
|
+
* strings (including currency-prefixed strings like "TZS1000").
|
|
16
|
+
*/
|
|
17
|
+
create(input: string | number, currencyCode?: CurrencyCode | null): Amount | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Builds an Amount from a numeric value and currency code, rounding to the
|
|
20
|
+
* currency's native decimal precision.
|
|
21
|
+
*/
|
|
22
|
+
createFromNumber(value: number, currencyCode: CurrencyCode): Amount | undefined;
|
|
23
|
+
/** Re-resolves an Amount from its compact JSON identity. */
|
|
24
|
+
createFromJSON(json: AmountJSON | string): Amount | undefined;
|
|
25
|
+
/** Re-resolves an Amount from a JSON string. */
|
|
26
|
+
createFromJSONString(jsonString: string): Amount | undefined;
|
|
27
|
+
/** Whether the input can be resolved to a valid Amount. */
|
|
28
|
+
canCreate(input?: string | number | null, currencyCode?: CurrencyCode): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Type guard that an unknown value is a valid Amount instance whose
|
|
31
|
+
* (value, currency) round-trips through `create`.
|
|
32
|
+
*/
|
|
33
|
+
isAmount(obj: unknown): obj is Amount;
|
|
34
|
+
/** Type guard for the compact AmountJSON shape. */
|
|
35
|
+
isAmountJSON(obj: unknown): obj is AmountJSON;
|
|
36
|
+
/** Verifies that an Amount instance can still be reconstructed cleanly. */
|
|
37
|
+
validate(amount: Amount): boolean;
|
|
38
|
+
/** Sum of every Amount, requiring matching currencies. */
|
|
39
|
+
sum(amounts: Amount[]): Amount;
|
|
40
|
+
/** Mean of every Amount, requiring matching currencies and non-empty array. */
|
|
41
|
+
average(amounts: Amount[]): Amount;
|
|
42
|
+
/** Smallest Amount in the array (most negative wins). */
|
|
43
|
+
min(amounts: Amount[]): Amount;
|
|
44
|
+
/** Largest Amount in the array. */
|
|
45
|
+
max(amounts: Amount[]): Amount;
|
|
46
|
+
/** Builds an Amount by validating a numeric string and currency code. */
|
|
47
|
+
private createFromString;
|
|
48
|
+
/** Resolves a (possibly mixed-case) currency code to its canonical form. */
|
|
49
|
+
private normalizeCurrencyCode;
|
|
50
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Bank, type BankJSON } 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
|
+
import { type RawBank } from "@repositories/bank.repository.js";
|
|
5
|
+
/**
|
|
6
|
+
* Constructs Bank model instances from raw bank records.
|
|
7
|
+
*
|
|
8
|
+
* Registries own lookup/caching; this factory is the only layer that should
|
|
9
|
+
* call the Bank constructor.
|
|
10
|
+
*/
|
|
11
|
+
export declare class BankFactory {
|
|
12
|
+
private readonly repository;
|
|
13
|
+
private static instance;
|
|
14
|
+
private constructor();
|
|
15
|
+
static getInstance(): BankFactory;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a Bank by BIC. When `countryCode` is provided the lookup is
|
|
18
|
+
* scoped to that country; otherwise the repository searches across every
|
|
19
|
+
* supported country (and falls back to inferring the country from the BIC).
|
|
20
|
+
*/
|
|
21
|
+
create(bic: BankSwiftCode | string, countryCode?: ISO2CountryCode): Bank | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Builds a Bank directly from a raw bank record. Returns undefined if the
|
|
24
|
+
* record is missing required fields (officialName / shortName / bic).
|
|
25
|
+
*/
|
|
26
|
+
createFromRaw(raw: RawBank, countryCode: ISO2CountryCode): Bank | undefined;
|
|
27
|
+
/** Re-resolves a Bank from its compact JSON identity. */
|
|
28
|
+
createFromJSON(json: BankJSON | string): Bank | undefined;
|
|
29
|
+
/** Re-resolves a Bank from a JSON string. */
|
|
30
|
+
createFromJSONString(jsonString: string): Bank | undefined;
|
|
31
|
+
/** Whether the input BIC can be resolved to a known Bank. */
|
|
32
|
+
canCreate(bic?: string | null, countryCode?: ISO2CountryCode): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Type guard that an unknown value is a known Bank instance whose
|
|
35
|
+
* (bic, countryCode) round-trips through the repository.
|
|
36
|
+
*/
|
|
37
|
+
isBank(obj: unknown): obj is Bank;
|
|
38
|
+
/** Type guard for the compact BankJSON shape. */
|
|
39
|
+
isBankJSON(obj: unknown): obj is BankJSON;
|
|
40
|
+
/** Parses a JSON value or string into a validated BankJSON. */
|
|
41
|
+
private parseJSON;
|
|
42
|
+
/**
|
|
43
|
+
* SWIFT codes encode the country in characters 5-6. This is used as a fallback
|
|
44
|
+
* when the caller didn't supply `countryCode` to `create`.
|
|
45
|
+
*/
|
|
46
|
+
private getCountryCodeFromBIC;
|
|
47
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Country, type CountryJSON } from "@domain/country/country.js";
|
|
2
|
+
import { CountryCode } from "@domain/country/country.types.js";
|
|
3
|
+
import { type RawCountry } from "@repositories/country.repository.js";
|
|
4
|
+
/**
|
|
5
|
+
* Constructs Country model instances from raw country records.
|
|
6
|
+
*
|
|
7
|
+
* Registries own lookup/caching; this factory is the only layer that should
|
|
8
|
+
* call the Country constructor.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CountryFactory {
|
|
11
|
+
private readonly repository;
|
|
12
|
+
private static instance;
|
|
13
|
+
private constructor();
|
|
14
|
+
static getInstance(): CountryFactory;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves a Country by ISO-2 or ISO-3 code (case-insensitive). Returns
|
|
17
|
+
* undefined when the code is not in the dataset.
|
|
18
|
+
*/
|
|
19
|
+
create(countryCode: CountryCode | string): Country | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Builds a Country directly from a raw country record. The continent and
|
|
22
|
+
* sub-region strings are normalised to their enum equivalents.
|
|
23
|
+
*/
|
|
24
|
+
createFromRaw(raw: RawCountry): Country;
|
|
25
|
+
/** Re-resolves a Country from its compact JSON identity. */
|
|
26
|
+
createFromJSON(json: CountryJSON | string): Country | undefined;
|
|
27
|
+
/** Re-resolves a Country from a JSON string. */
|
|
28
|
+
createFromJSONString(jsonString: string): Country | undefined;
|
|
29
|
+
/** Whether the input string can be resolved to a known Country. */
|
|
30
|
+
canCreate(input?: string | null): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Type guard that an unknown value is a known Country instance whose
|
|
33
|
+
* private name/iso2/iso3 fields match the canonical record.
|
|
34
|
+
*/
|
|
35
|
+
isCountry(obj: unknown): obj is Country;
|
|
36
|
+
/** Type guard for the compact CountryJSON shape. */
|
|
37
|
+
isCountryJSON(obj: unknown): obj is CountryJSON;
|
|
38
|
+
/** Parses a JSON value or string into a validated CountryJSON. */
|
|
39
|
+
private parseJSON;
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Currency, type CurrencyJSON } from "@domain/currency/currency.js";
|
|
2
|
+
import { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
3
|
+
import { type RawCurrency } from "@repositories/currency.repository.js";
|
|
4
|
+
/**
|
|
5
|
+
* Constructs Currency model instances from validated raw records.
|
|
6
|
+
*
|
|
7
|
+
* Registries own lookup/caching; this factory is the only layer that should
|
|
8
|
+
* call the Currency constructor.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CurrencyFactory {
|
|
11
|
+
private readonly repository;
|
|
12
|
+
private static instance;
|
|
13
|
+
private constructor();
|
|
14
|
+
static getInstance(): CurrencyFactory;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves a Currency by ISO 4217 code (case-insensitive). Returns
|
|
17
|
+
* undefined when the code is not in the dataset.
|
|
18
|
+
*/
|
|
19
|
+
create(code: CurrencyCode | string): Currency | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Builds a Currency directly from a raw currency record. Returns undefined
|
|
22
|
+
* if the record's code isn't a valid ISO 4217 code.
|
|
23
|
+
*/
|
|
24
|
+
createFromRaw(raw: RawCurrency): Currency | undefined;
|
|
25
|
+
/** Re-resolves a Currency from its compact JSON identity. */
|
|
26
|
+
createFromJSON(json: CurrencyJSON | string): Currency | undefined;
|
|
27
|
+
/** Re-resolves a Currency from a JSON string. */
|
|
28
|
+
createFromJSONString(jsonString: string): Currency | undefined;
|
|
29
|
+
/** Whether the input string can be resolved to a known Currency. */
|
|
30
|
+
canCreate(input?: string | null): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Type guard that an unknown value is a known Currency instance whose
|
|
33
|
+
* private fields match the dataset.
|
|
34
|
+
*/
|
|
35
|
+
isCurrency(obj: unknown): obj is Currency;
|
|
36
|
+
/** Type guard for the compact CurrencyJSON shape. */
|
|
37
|
+
isCurrencyJSON(obj: unknown): obj is CurrencyJSON;
|
|
38
|
+
/** Parses a JSON value or string into a validated CurrencyJSON. */
|
|
39
|
+
private parseJSON;
|
|
40
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./amount.factory.js";
|
|
2
|
+
export * from "./bank.factory.js";
|
|
3
|
+
export * from "./country.factory.js";
|
|
4
|
+
export * from "./currency.factory.js";
|
|
5
|
+
export * from "./mobile-money-provider.factory.js";
|
|
6
|
+
export * from "./phone-number.factory.js";
|
|
7
|
+
export * from "./transaction-limit.factory.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ISO2CountryCode } from "@domain/country/country.types.js";
|
|
2
|
+
import type { CurrencyCode } from "@domain/currency/currency.types.js";
|
|
3
|
+
import { MobileMoneyProvider } from "@domain/mobile-money-provider/mobile-money-provider.js";
|
|
4
|
+
import { type MobileMoneyProviderJSON } from "@domain/mobile-money-provider/mobile-money-provider.schema.js";
|
|
5
|
+
import { type RawMobileMoneyProvider } from "@repositories/mobile-money-provider.repository.js";
|
|
6
|
+
/**
|
|
7
|
+
* Constructs MobileMoneyProvider model instances from raw provider records.
|
|
8
|
+
*
|
|
9
|
+
* Registries own lookup/caching; this factory is the only layer that should
|
|
10
|
+
* call the MobileMoneyProvider constructor.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MobileMoneyProviderFactory {
|
|
13
|
+
private readonly repository;
|
|
14
|
+
private static instance;
|
|
15
|
+
private constructor();
|
|
16
|
+
static getInstance(): MobileMoneyProviderFactory;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves a MobileMoneyProvider by ID. When `countryCode` is provided the
|
|
19
|
+
* lookup is scoped to that country; otherwise the repository searches across
|
|
20
|
+
* every supported country.
|
|
21
|
+
*/
|
|
22
|
+
create(id: string, countryCode?: ISO2CountryCode): MobileMoneyProvider | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Builds a MobileMoneyProvider directly from a raw provider record plus the
|
|
25
|
+
* country/currency context (typically supplied by the repository or registry).
|
|
26
|
+
*/
|
|
27
|
+
createFromRaw(raw: RawMobileMoneyProvider, countryCode: ISO2CountryCode, currencyCode: CurrencyCode): MobileMoneyProvider;
|
|
28
|
+
/** Re-resolves a MobileMoneyProvider from its compact JSON identity. */
|
|
29
|
+
createFromJSON(json: MobileMoneyProviderJSON | string): MobileMoneyProvider | undefined;
|
|
30
|
+
/** Re-resolves a MobileMoneyProvider from a JSON string. */
|
|
31
|
+
createFromJSONString(jsonString: string): MobileMoneyProvider | undefined;
|
|
32
|
+
/** Whether the input ID can be resolved to a known MobileMoneyProvider. */
|
|
33
|
+
canCreate(input?: string | null, countryCode?: ISO2CountryCode): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Type guard that an unknown value is a known MobileMoneyProvider instance
|
|
36
|
+
* whose (id, countryCode) round-trips through `create`.
|
|
37
|
+
*/
|
|
38
|
+
isMobileMoneyProvider(obj: unknown): obj is MobileMoneyProvider;
|
|
39
|
+
/** Type guard for the compact MobileMoneyProviderJSON shape. */
|
|
40
|
+
isMobileMoneyProviderJSON(obj: unknown): obj is MobileMoneyProviderJSON;
|
|
41
|
+
/** Parses a JSON value or string into a validated MobileMoneyProviderJSON. */
|
|
42
|
+
private parseJSON;
|
|
43
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PhoneNumber } from "@domain/phone-number/phone-number.js";
|
|
2
|
+
import { type PhoneNumberJSON } from "@domain/phone-number/phone-number.schema.js";
|
|
3
|
+
import type { PhoneNumberParseOptions } from "@domain/phone-number/phone-number.types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Owns PhoneNumber construction and validation. The model has no dataset, so
|
|
6
|
+
* there is no PhoneNumberRepository; the factory composes the parser directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PhoneNumberFactory {
|
|
9
|
+
private static instance;
|
|
10
|
+
private readonly parser;
|
|
11
|
+
private constructor();
|
|
12
|
+
static getInstance(): PhoneNumberFactory;
|
|
13
|
+
/**
|
|
14
|
+
* Parses arbitrary input into a validated PhoneNumber. Returns undefined when
|
|
15
|
+
* the input cannot be parsed or fails country-aware validation.
|
|
16
|
+
*/
|
|
17
|
+
create(input: string, options?: PhoneNumberParseOptions): PhoneNumber | undefined;
|
|
18
|
+
/** Re-resolves a PhoneNumber from its compact JSON identity. */
|
|
19
|
+
createFromJSON(json: PhoneNumberJSON | string): PhoneNumber | undefined;
|
|
20
|
+
/** Re-resolves a PhoneNumber from a JSON string. */
|
|
21
|
+
createFromJSONString(jsonString: string): PhoneNumber | undefined;
|
|
22
|
+
/** Whether the input string can be parsed and validated as a phone number. */
|
|
23
|
+
canCreate(input?: string | null, options?: PhoneNumberParseOptions): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Type guard that an unknown value is a valid PhoneNumber instance whose
|
|
26
|
+
* E.164 representation re-parses successfully.
|
|
27
|
+
*/
|
|
28
|
+
isPhoneNumber(obj: unknown): obj is PhoneNumber;
|
|
29
|
+
/** Type guard for the compact PhoneNumberJSON shape. */
|
|
30
|
+
isPhoneNumberJSON(obj: unknown): obj is PhoneNumberJSON;
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { Amount } from "@domain/amount/amount.js";
|
|
5
|
+
import type { RawTransactionLimit } from "@repositories/transaction-limit.repository.js";
|
|
6
|
+
/**
|
|
7
|
+
* Amount-aware result returned to callers. Wraps the numeric repository values
|
|
8
|
+
* in `Amount` instances so consumers get currency-correct comparisons and
|
|
9
|
+
* formatting out of the box.
|
|
10
|
+
*/
|
|
11
|
+
export interface TransactionLimits {
|
|
12
|
+
countryCode: ISO2CountryCode;
|
|
13
|
+
currencyCode: CurrencyCode;
|
|
14
|
+
direction: TransactionDirection;
|
|
15
|
+
channelType: ChannelType;
|
|
16
|
+
providerId?: string;
|
|
17
|
+
min: Amount;
|
|
18
|
+
max: Amount;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Converts raw numeric transaction-limit records into amount-aware domain
|
|
22
|
+
* objects. The repository returns numbers; this factory turns them into
|
|
23
|
+
* `Amount` instances by way of `AmountFactory`.
|
|
24
|
+
*/
|
|
25
|
+
export declare class TransactionLimitFactory {
|
|
26
|
+
private static instance;
|
|
27
|
+
private readonly amountFactory;
|
|
28
|
+
private constructor();
|
|
29
|
+
static getInstance(): TransactionLimitFactory;
|
|
30
|
+
/**
|
|
31
|
+
* Wraps a raw transaction-limit record (numeric min/max) in a
|
|
32
|
+
* `TransactionLimits` object whose min/max are `Amount` instances. Returns
|
|
33
|
+
* undefined when either bound cannot be constructed (e.g. unknown currency).
|
|
34
|
+
*/
|
|
35
|
+
createFromRaw(raw: RawTransactionLimit): TransactionLimits | undefined;
|
|
36
|
+
}
|