@temboplus/afloat 0.1.78 → 0.1.79
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/esm/src/features/admin/contract.d.ts +46 -46
- package/esm/src/features/contact/contract.d.ts +1 -1
- package/esm/src/features/payout/contract.d.ts +2 -2
- package/esm/src/features/wallet/contract.d.ts +5 -5
- package/esm/src/models/contact/derivatives/contact.js +1 -1
- package/esm/src/models/contact/derivatives/contact_info.d.ts +1 -1
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -1
- package/esm/src/models/contact/derivatives/contact_info.js +1 -1
- package/esm/src/models/payout/channel.d.ts +1 -1
- package/esm/src/models/payout/channel.d.ts.map +1 -1
- package/esm/src/models/payout/channel.js +1 -1
- package/esm/src/models/payout/derivatives/payout.d.ts +1 -1
- package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -1
- package/esm/src/models/payout/derivatives/payout.js +1 -1
- package/esm/src/models/payout/narration.js +1 -1
- package/esm/src/models/user/profile.d.ts +1 -1
- package/esm/src/models/user/profile.d.ts.map +1 -1
- package/esm/src/models/user/profile.js +1 -1
- package/esm/src/models/wallet/schemas.d.ts +3 -3
- package/esm/src/models/wallet/schemas.js +1 -1
- package/esm/src/models/wallet/wallet.d.ts +2 -2
- package/esm/src/models/wallet/wallet.d.ts.map +1 -1
- package/esm/src/models/wallet/wallet.js +1 -1
- package/package.json +3 -4
- package/script/npm/src/src/features/admin/contract.d.ts +46 -46
- package/script/npm/src/src/features/contact/contract.d.ts +1 -1
- package/script/npm/src/src/features/payout/contract.d.ts +2 -2
- package/script/npm/src/src/features/wallet/contract.d.ts +5 -5
- package/script/npm/src/src/models/contact/derivatives/contact.js +3 -3
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +1 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.js +6 -6
- package/script/npm/src/src/models/payout/channel.d.ts +1 -1
- package/script/npm/src/src/models/payout/channel.d.ts.map +1 -1
- package/script/npm/src/src/models/payout/channel.js +3 -3
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts +1 -1
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -1
- package/script/npm/src/src/models/payout/derivatives/payout.js +4 -4
- package/script/npm/src/src/models/payout/narration.js +5 -5
- package/script/npm/src/src/models/user/profile.d.ts +1 -1
- package/script/npm/src/src/models/user/profile.d.ts.map +1 -1
- package/script/npm/src/src/models/user/profile.js +3 -3
- package/script/npm/src/src/models/wallet/schemas.d.ts +3 -3
- package/script/npm/src/src/models/wallet/schemas.js +4 -4
- package/script/npm/src/src/models/wallet/wallet.d.ts +2 -2
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -1
- package/script/npm/src/src/models/wallet/wallet.js +6 -6
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/mod.d.ts +0 -5
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/mod.js +0 -4
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/config_service.d.ts +0 -11
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/config_service.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/config_service.js +0 -19
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/index.d.ts +0 -2
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/index.js +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/banks_tz.d.ts +0 -7
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/banks_tz.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/banks_tz.js +0 -197
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/countries.d.ts +0 -39
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/countries.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/countries.js +0 -2475
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/currencies.d.ts +0 -1901
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/currencies.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/currencies.js +0 -1073
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/phone_patterns.d.ts +0 -3809
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/phone_patterns.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/phone_patterns.js +0 -2325
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/amount.d.ts +0 -53
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/amount.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/amount.js +0 -190
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/antd_validator.d.ts +0 -40
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/antd_validator.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/antd_validator.js +0 -58
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/index.d.ts +0 -3
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/index.js +0 -2
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/antd_validator.d.ts +0 -11
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/antd_validator.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/antd_validator.js +0 -26
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/bank.d.ts +0 -257
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/bank.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/bank.js +0 -450
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/index.d.ts +0 -5
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/index.js +0 -4
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/types.d.ts +0 -7
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/types.js +0 -45
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/utils.d.ts +0 -8
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/utils.js +0 -9
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/country.d.ts +0 -822
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/country.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/country.js +0 -737
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/index.d.ts +0 -4
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/index.js +0 -3
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/types.d.ts +0 -63
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/types.js +0 -105
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/utils.d.ts +0 -21
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/utils.js +0 -25
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/currency.d.ts +0 -465
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/currency.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/currency.js +0 -471
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/index.d.ts +0 -4
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/index.js +0 -3
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/types.d.ts +0 -21
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/types.js +0 -28
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/utils.d.ts +0 -8
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/utils.js +0 -9
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/index.d.ts +0 -6
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/index.js +0 -5
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/format.d.ts +0 -13
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/format.js +0 -13
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.d.ts +0 -162
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.js +0 -459
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/service.d.ts +0 -267
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/service.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/service.js +0 -498
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/index.d.ts +0 -6
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/index.js +0 -5
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/antd_validator.d.ts +0 -77
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/antd_validator.js +0 -90
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/network_operator.d.ts +0 -30
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/network_operator.js +0 -47
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/phone_number.d.ts +0 -141
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/phone_number.js +0 -290
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/index.d.ts +0 -2
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/index.js +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/report_manager.d.ts +0 -144
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/report_manager.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/report_manager.js +0 -318
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/id.d.ts +0 -12
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/id.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/id.js +0 -19
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/index.d.ts +0 -4
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/index.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/index.js +0 -3
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/text.d.ts +0 -32
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/text.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/text.js +0 -68
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/time.d.ts +0 -21
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/time.d.ts.map +0 -1
- package/esm/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/time.js +0 -34
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/mod.d.ts +0 -5
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/mod.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/mod.js +0 -20
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/config_service.d.ts +0 -11
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/config_service.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/config_service.js +0 -23
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/index.d.ts +0 -2
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/config/index.js +0 -17
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/banks_tz.d.ts +0 -7
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/banks_tz.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/banks_tz.js +0 -199
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/countries.d.ts +0 -39
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/countries.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/countries.js +0 -2477
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/currencies.d.ts +0 -1901
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/currencies.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/currencies.js +0 -1075
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/phone_patterns.d.ts +0 -3809
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/phone_patterns.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/data/phone_patterns.js +0 -2327
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/amount.d.ts +0 -53
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/amount.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/amount.js +0 -194
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/antd_validator.d.ts +0 -40
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/antd_validator.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/antd_validator.js +0 -62
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/index.d.ts +0 -3
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/amount/index.js +0 -18
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/antd_validator.d.ts +0 -11
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/antd_validator.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/antd_validator.js +0 -30
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/bank.d.ts +0 -257
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/bank.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/bank.js +0 -458
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/index.d.ts +0 -5
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/index.js +0 -20
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/types.d.ts +0 -7
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/types.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/types.js +0 -48
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/utils.d.ts +0 -8
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/utils.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/bank/utils.js +0 -12
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/country.d.ts +0 -822
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/country.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/country.js +0 -745
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/index.d.ts +0 -4
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/index.js +0 -19
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/types.d.ts +0 -63
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/types.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/types.js +0 -108
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/utils.d.ts +0 -21
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/utils.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/country/utils.js +0 -30
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/currency.d.ts +0 -465
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/currency.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/currency.js +0 -479
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/index.d.ts +0 -4
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/index.js +0 -19
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/types.d.ts +0 -21
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/types.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/types.js +0 -31
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/utils.d.ts +0 -8
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/utils.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/currency/utils.js +0 -12
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/index.d.ts +0 -6
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/index.js +0 -21
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/format.d.ts +0 -13
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/format.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/format.js +0 -16
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.d.ts +0 -162
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.js +0 -463
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/service.d.ts +0 -267
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/service.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/service.js +0 -506
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/index.d.ts +0 -6
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/index.js +0 -21
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/antd_validator.d.ts +0 -77
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/antd_validator.js +0 -94
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/network_operator.d.ts +0 -30
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/network_operator.js +0 -50
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/phone_number.d.ts +0 -141
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/tz/phone_number.js +0 -294
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/index.d.ts +0 -2
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/index.js +0 -17
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/report_manager.d.ts +0 -144
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/report_manager.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/reports/report_manager.js +0 -328
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/id.d.ts +0 -12
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/id.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/id.js +0 -23
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/index.d.ts +0 -4
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/index.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/index.js +0 -19
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/text.d.ts +0 -32
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/text.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/text.js +0 -75
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/time.d.ts +0 -21
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/time.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/utils/time.js +0 -39
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
*
|
|
4
|
-
* # Global Phone Number Management System
|
|
5
|
-
*
|
|
6
|
-
* ## Features
|
|
7
|
-
* 1. Parsing and validation of international format phone numbers
|
|
8
|
-
* 2. Support for phone numbers across countries using standardized metadata
|
|
9
|
-
* 3. Standardized storage in E.164 format
|
|
10
|
-
* 4. Formatting options for display and API use:
|
|
11
|
-
* - INTERNATIONAL: "+{dial_code}{compactNumber}" - Returns the number with a plus and country code
|
|
12
|
-
* - COMPACT: Just the compactNumber without formatting
|
|
13
|
-
* - NATIONAL: Not fully implemented for global numbers, returns the compact number
|
|
14
|
-
* - RFC3966: "tel:+{dial_code}{compactNumber}" - Returns the number in URI format
|
|
15
|
-
* 5. Integration with Country class for country data
|
|
16
|
-
*/
|
|
17
|
-
import { Country } from "../../country/country.js";
|
|
18
|
-
import { PhoneNumberFormat } from "../format.js";
|
|
19
|
-
import type { CountryCode, ISO2CountryCode } from "../../country/types.js";
|
|
20
|
-
/**
|
|
21
|
-
* Options for parsing phone numbers
|
|
22
|
-
*/
|
|
23
|
-
export interface PhoneNumberParseOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Default country to use when a dial code is shared by multiple countries
|
|
26
|
-
* This can be either a Country object or an ISO country code string
|
|
27
|
-
*/
|
|
28
|
-
defaultCountry?: Country | CountryCode;
|
|
29
|
-
/**
|
|
30
|
-
* Whether to throw an error when encountering an ambiguous phone number
|
|
31
|
-
* with a shared dial code
|
|
32
|
-
*/
|
|
33
|
-
throwOnAmbiguous?: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Represents a global phone number
|
|
37
|
-
*/
|
|
38
|
-
export declare class PhoneNumber {
|
|
39
|
-
/** The associated country object */
|
|
40
|
-
private _country;
|
|
41
|
-
/** The national number without country code or leading zeros */
|
|
42
|
-
private _compactNumber;
|
|
43
|
-
/**
|
|
44
|
-
* Private constructor to prevent direct instantiation.
|
|
45
|
-
* Use PhoneNumber.from() or PhoneNumber.fromWithCountry() instead.
|
|
46
|
-
*
|
|
47
|
-
* @param country - The Country object representing the phone number's country
|
|
48
|
-
* @param compactNumber - The phone number in compact format without country code
|
|
49
|
-
*/
|
|
50
|
-
private constructor();
|
|
51
|
-
/**
|
|
52
|
-
* Gets the Country object associated with this phone number
|
|
53
|
-
*/
|
|
54
|
-
get country(): Country;
|
|
55
|
-
/**
|
|
56
|
-
* Gets the country code (ISO) of the phone number
|
|
57
|
-
*/
|
|
58
|
-
get countryCode(): ISO2CountryCode;
|
|
59
|
-
/**
|
|
60
|
-
* Gets the dial code (numeric) of the phone number
|
|
61
|
-
*/
|
|
62
|
-
get dialCode(): number;
|
|
63
|
-
/**
|
|
64
|
-
* Gets the compact number (national number without formatting)
|
|
65
|
-
*/
|
|
66
|
-
get compactNumber(): string;
|
|
67
|
-
/**
|
|
68
|
-
* Gets the full E.164 formatted number (e.g., +12025550123)
|
|
69
|
-
*/
|
|
70
|
-
get formattedNumber(): string;
|
|
71
|
-
/**
|
|
72
|
-
* Gets a human-readable label for this phone number
|
|
73
|
-
* Uses international format with spaces for readability
|
|
74
|
-
*/
|
|
75
|
-
get label(): string;
|
|
76
|
-
/**
|
|
77
|
-
* Formats the phone number according to the specified format
|
|
78
|
-
*
|
|
79
|
-
* @param format - The desired format
|
|
80
|
-
* @returns The formatted phone number string
|
|
81
|
-
*/
|
|
82
|
-
getWithFormat(format: PhoneNumberFormat): string;
|
|
83
|
-
private formatE164;
|
|
84
|
-
/**
|
|
85
|
-
* Formats the phone number in international format
|
|
86
|
-
* Returns +{dial_code}{compactNumber} format
|
|
87
|
-
*/
|
|
88
|
-
private formatInternational;
|
|
89
|
-
/**
|
|
90
|
-
* Formats the phone number according to RFC3966
|
|
91
|
-
* Returns tel:+{dial_code}{compactNumber} format
|
|
92
|
-
*/
|
|
93
|
-
private formatRFC3966;
|
|
94
|
-
/**
|
|
95
|
-
* Validates that this phone number meets the requirements for its country
|
|
96
|
-
* Relies entirely on pattern validation
|
|
97
|
-
*
|
|
98
|
-
* @returns True if the phone number is valid, false otherwise
|
|
99
|
-
*/
|
|
100
|
-
validate(): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Creates a PhoneNumber from an international format string.
|
|
103
|
-
* Only accepts the international format with a leading '+'.
|
|
104
|
-
* Thoroughly cleans the input by removing all non-digit characters except the leading '+'.
|
|
105
|
-
*
|
|
106
|
-
* @param input - The phone number string in international format (e.g., "+1 (202) 555-0123")
|
|
107
|
-
* @param options - Options for handling parsing, including defaultCountry and throwOnAmbiguous
|
|
108
|
-
* @returns A PhoneNumber instance if parsing succeeded, undefined otherwise
|
|
109
|
-
* @throws SharedDialCodeError when a shared dial code is encountered and throwOnAmbiguous is true
|
|
110
|
-
*/
|
|
111
|
-
static from(input: string, options?: PhoneNumberParseOptions): PhoneNumber | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* Creates a PhoneNumber from various formats when a country is explicitly provided.
|
|
114
|
-
* Supports multiple input formats:
|
|
115
|
-
* - International format with plus and country code: "+{code}{number}" (e.g., "+12025550123")
|
|
116
|
-
* - Format with just country code: "{code}{number}" (e.g., "12025550123")
|
|
117
|
-
* - Local format with leading zero: "0{number}" (e.g., "02025550123")
|
|
118
|
-
* - Just the national number: "{number}" (e.g., "2025550123")
|
|
119
|
-
*
|
|
120
|
-
* Thoroughly cleans the input by removing all non-digit characters except the leading '+'.
|
|
121
|
-
*
|
|
122
|
-
* @param input - The phone number string in any format
|
|
123
|
-
* @param country - The Country object for this phone number
|
|
124
|
-
* @returns A PhoneNumber instance if parsing succeeded, undefined otherwise
|
|
125
|
-
*/
|
|
126
|
-
static fromWithCountry(input: string, country: Country): PhoneNumber | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* Checks if a string can be constructed into a valid phone number.
|
|
129
|
-
*
|
|
130
|
-
* @param input - The string to validate
|
|
131
|
-
* @param options - Options for handling parsing
|
|
132
|
-
* @returns True if the input can be parsed into a valid phone number, false otherwise
|
|
133
|
-
*/
|
|
134
|
-
static canConstruct(input?: string | null, options?: PhoneNumberParseOptions): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Checks if a string can be constructed into a valid phone number with a given country.
|
|
137
|
-
*
|
|
138
|
-
* @param input - The string to validate
|
|
139
|
-
* @param country - The Country object to use
|
|
140
|
-
* @returns True if the input can be parsed into a valid phone number, false otherwise
|
|
141
|
-
*/
|
|
142
|
-
static canConstructWithCountry(input?: string | null, country?: Country | null): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Type guard to check if an unknown object is a valid PhoneNumber instance.
|
|
145
|
-
*
|
|
146
|
-
* @param obj - The object to check
|
|
147
|
-
* @returns Type predicate indicating if the object is a valid PhoneNumber
|
|
148
|
-
*/
|
|
149
|
-
static is(obj: unknown): obj is PhoneNumber;
|
|
150
|
-
/**
|
|
151
|
-
* Attempts to extract the country from a phone number string in international format.
|
|
152
|
-
*
|
|
153
|
-
* For shared dial codes, this will return undefined unless a default country is provided.
|
|
154
|
-
*
|
|
155
|
-
* @param input - The phone number string to parse (must be in international format)
|
|
156
|
-
* @param options - Options for handling shared dial codes
|
|
157
|
-
* @returns The Country object if found, undefined if ambiguous or not found
|
|
158
|
-
* @throws SharedDialCodeError when a shared dial code is encountered and throwOnAmbiguous is true
|
|
159
|
-
*/
|
|
160
|
-
static getCountry(input: string, options?: PhoneNumberParseOptions): Country | undefined;
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=phone_number.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"phone_number.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../src/deps/jsr.io/@temboplus/frontend-core/0.2.21/src/models/phone_number/global/phone_number.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAEvC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAU;IAC1B,gEAAgE;IAChE,OAAO,CAAC,cAAc,CAAS;IAE/B;;;;;;OAMG;IACH,OAAO;IAKP;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,eAAe,CAEjC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAKrB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM;IAuBhD,OAAO,CAAC,UAAU;IAIlB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;OAGG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;;OAKG;IACH,QAAQ,IAAI,OAAO;IAuCnB;;;;;;;;;OASG;WACW,IAAI,CAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,uBAAuB,GAChC,WAAW,GAAG,SAAS;IAsG1B;;;;;;;;;;;;;OAaG;WACW,eAAe,CAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,GACf,WAAW,GAAG,SAAS;IA0D1B;;;;;;OAMG;WACW,YAAY,CACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO;IAsBV;;;;;;OAMG;WACW,uBAAuB,CACnC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GACvB,OAAO;IAaV;;;;;OAKG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW;IA2BlD;;;;;;;;;OASG;WACW,UAAU,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,GAAG,SAAS;CAwDvB"}
|
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview
|
|
4
|
-
*
|
|
5
|
-
* # Global Phone Number Management System
|
|
6
|
-
*
|
|
7
|
-
* ## Features
|
|
8
|
-
* 1. Parsing and validation of international format phone numbers
|
|
9
|
-
* 2. Support for phone numbers across countries using standardized metadata
|
|
10
|
-
* 3. Standardized storage in E.164 format
|
|
11
|
-
* 4. Formatting options for display and API use:
|
|
12
|
-
* - INTERNATIONAL: "+{dial_code}{compactNumber}" - Returns the number with a plus and country code
|
|
13
|
-
* - COMPACT: Just the compactNumber without formatting
|
|
14
|
-
* - NATIONAL: Not fully implemented for global numbers, returns the compact number
|
|
15
|
-
* - RFC3966: "tel:+{dial_code}{compactNumber}" - Returns the number in URI format
|
|
16
|
-
* 5. Integration with Country class for country data
|
|
17
|
-
*/
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PhoneNumber = void 0;
|
|
20
|
-
const country_js_1 = require("../../country/country.js");
|
|
21
|
-
const service_js_1 = require("./service.js");
|
|
22
|
-
const format_js_1 = require("../format.js");
|
|
23
|
-
/**
|
|
24
|
-
* Represents a global phone number
|
|
25
|
-
*/
|
|
26
|
-
class PhoneNumber {
|
|
27
|
-
/**
|
|
28
|
-
* Private constructor to prevent direct instantiation.
|
|
29
|
-
* Use PhoneNumber.from() or PhoneNumber.fromWithCountry() instead.
|
|
30
|
-
*
|
|
31
|
-
* @param country - The Country object representing the phone number's country
|
|
32
|
-
* @param compactNumber - The phone number in compact format without country code
|
|
33
|
-
*/
|
|
34
|
-
constructor(country, compactNumber) {
|
|
35
|
-
/** The associated country object */
|
|
36
|
-
Object.defineProperty(this, "_country", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
configurable: true,
|
|
39
|
-
writable: true,
|
|
40
|
-
value: void 0
|
|
41
|
-
});
|
|
42
|
-
/** The national number without country code or leading zeros */
|
|
43
|
-
Object.defineProperty(this, "_compactNumber", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
configurable: true,
|
|
46
|
-
writable: true,
|
|
47
|
-
value: void 0
|
|
48
|
-
});
|
|
49
|
-
this._country = country;
|
|
50
|
-
this._compactNumber = compactNumber;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Gets the Country object associated with this phone number
|
|
54
|
-
*/
|
|
55
|
-
get country() {
|
|
56
|
-
return this._country;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Gets the country code (ISO) of the phone number
|
|
60
|
-
*/
|
|
61
|
-
get countryCode() {
|
|
62
|
-
return this._country.code;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Gets the dial code (numeric) of the phone number
|
|
66
|
-
*/
|
|
67
|
-
get dialCode() {
|
|
68
|
-
const metadata = service_js_1.GlobalPhoneNumberService.getInstance().getCountryMetadata(this.countryCode);
|
|
69
|
-
return metadata?.code || 0;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Gets the compact number (national number without formatting)
|
|
73
|
-
*/
|
|
74
|
-
get compactNumber() {
|
|
75
|
-
return this._compactNumber;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Gets the full E.164 formatted number (e.g., +12025550123)
|
|
79
|
-
*/
|
|
80
|
-
get formattedNumber() {
|
|
81
|
-
return `+${this.dialCode}${this._compactNumber}`;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Gets a human-readable label for this phone number
|
|
85
|
-
* Uses international format with spaces for readability
|
|
86
|
-
*/
|
|
87
|
-
get label() {
|
|
88
|
-
return this.getWithFormat(format_js_1.PhoneNumberFormat.INTERNATIONAL);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Formats the phone number according to the specified format
|
|
92
|
-
*
|
|
93
|
-
* @param format - The desired format
|
|
94
|
-
* @returns The formatted phone number string
|
|
95
|
-
*/
|
|
96
|
-
getWithFormat(format) {
|
|
97
|
-
switch (format) {
|
|
98
|
-
case format_js_1.PhoneNumberFormat.E164:
|
|
99
|
-
// Format: +{dial_code}{compactNumber}
|
|
100
|
-
return this.formatE164();
|
|
101
|
-
case format_js_1.PhoneNumberFormat.INTERNATIONAL:
|
|
102
|
-
// Format: +{dial_code}{compactNumber}
|
|
103
|
-
return this.formatInternational();
|
|
104
|
-
case format_js_1.PhoneNumberFormat.NATIONAL:
|
|
105
|
-
// Note: NATIONAL format is not fully implemented for global numbers
|
|
106
|
-
// Currently returns only the compact number
|
|
107
|
-
return this._compactNumber;
|
|
108
|
-
case format_js_1.PhoneNumberFormat.COMPACT:
|
|
109
|
-
// Format: Just the compactNumber
|
|
110
|
-
return this._compactNumber;
|
|
111
|
-
case format_js_1.PhoneNumberFormat.RFC3966:
|
|
112
|
-
// Format: tel:+{dial_code}{compactNumber}
|
|
113
|
-
return this.formatRFC3966();
|
|
114
|
-
default:
|
|
115
|
-
return this.formattedNumber;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
formatE164() {
|
|
119
|
-
return `+${this.dialCode}${this._compactNumber}`;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Formats the phone number in international format
|
|
123
|
-
* Returns +{dial_code}{compactNumber} format
|
|
124
|
-
*/
|
|
125
|
-
formatInternational() {
|
|
126
|
-
return `+${this.dialCode}${this._compactNumber}`;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Formats the phone number according to RFC3966
|
|
130
|
-
* Returns tel:+{dial_code}{compactNumber} format
|
|
131
|
-
*/
|
|
132
|
-
formatRFC3966() {
|
|
133
|
-
return `tel:+${this.dialCode}${this._compactNumber}`;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Validates that this phone number meets the requirements for its country
|
|
137
|
-
* Relies entirely on pattern validation
|
|
138
|
-
*
|
|
139
|
-
* @returns True if the phone number is valid, false otherwise
|
|
140
|
-
*/
|
|
141
|
-
validate() {
|
|
142
|
-
try {
|
|
143
|
-
// Validate the country first
|
|
144
|
-
if (!this._country.validate()) {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
// Get the metadata for this country
|
|
148
|
-
const service = service_js_1.GlobalPhoneNumberService.getInstance();
|
|
149
|
-
const metadata = service.getCountryMetadata(this._country.code);
|
|
150
|
-
if (!metadata) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
// Clean the compact number to ensure it only contains digits
|
|
154
|
-
const compactNumber = this._compactNumber.replace(/\D/g, "");
|
|
155
|
-
// Check if the compact number contains only digits
|
|
156
|
-
const isOnlyDigits = /^\d+$/.test(compactNumber);
|
|
157
|
-
if (!isOnlyDigits)
|
|
158
|
-
return false;
|
|
159
|
-
// Verify required patterns exist
|
|
160
|
-
if (!metadata.patterns || !metadata.patterns.landline ||
|
|
161
|
-
!metadata.patterns.mobile) {
|
|
162
|
-
console.error(`Country ${this._country.code} is missing required patterns for landline or mobile`);
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
return service.validatePattern(this._country.code, compactNumber);
|
|
166
|
-
}
|
|
167
|
-
catch (e) {
|
|
168
|
-
console.log(e);
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Creates a PhoneNumber from an international format string.
|
|
174
|
-
* Only accepts the international format with a leading '+'.
|
|
175
|
-
* Thoroughly cleans the input by removing all non-digit characters except the leading '+'.
|
|
176
|
-
*
|
|
177
|
-
* @param input - The phone number string in international format (e.g., "+1 (202) 555-0123")
|
|
178
|
-
* @param options - Options for handling parsing, including defaultCountry and throwOnAmbiguous
|
|
179
|
-
* @returns A PhoneNumber instance if parsing succeeded, undefined otherwise
|
|
180
|
-
* @throws SharedDialCodeError when a shared dial code is encountered and throwOnAmbiguous is true
|
|
181
|
-
*/
|
|
182
|
-
static from(input, options) {
|
|
183
|
-
try {
|
|
184
|
-
if (!input || typeof input !== "string")
|
|
185
|
-
return undefined;
|
|
186
|
-
const service = service_js_1.GlobalPhoneNumberService.getInstance();
|
|
187
|
-
// Clean the input (remove all non-digits except the leading '+')
|
|
188
|
-
const hasPlus = input.trim().startsWith("+");
|
|
189
|
-
const digitsOnly = input.replace(/\D/g, "");
|
|
190
|
-
const cleanedInput = hasPlus ? `+${digitsOnly}` : digitsOnly;
|
|
191
|
-
if (cleanedInput.length === 0)
|
|
192
|
-
return undefined;
|
|
193
|
-
// Must start with + for international format
|
|
194
|
-
if (!cleanedInput.startsWith("+"))
|
|
195
|
-
return undefined;
|
|
196
|
-
// Extract the dial code information
|
|
197
|
-
const dialCodeInfo = service.extractDialCode(cleanedInput);
|
|
198
|
-
if (!dialCodeInfo)
|
|
199
|
-
return undefined;
|
|
200
|
-
// Check if this is a shared dial code
|
|
201
|
-
if (dialCodeInfo.isShared) {
|
|
202
|
-
// Handle shared dial code according to options
|
|
203
|
-
if (options?.defaultCountry) {
|
|
204
|
-
// Try to use the provided default country
|
|
205
|
-
const defaultCountry = typeof options.defaultCountry === "string"
|
|
206
|
-
? country_js_1.Country.fromCode(options.defaultCountry)
|
|
207
|
-
: options.defaultCountry;
|
|
208
|
-
if (defaultCountry) {
|
|
209
|
-
// Verify that the default country actually uses this dial code
|
|
210
|
-
const metadata = service.getCountryMetadata(defaultCountry.code);
|
|
211
|
-
if (metadata && metadata.code.toString() === dialCodeInfo.dialCode) {
|
|
212
|
-
// Create and validate phone number with the default country
|
|
213
|
-
const phoneNumber = new PhoneNumber(defaultCountry, dialCodeInfo.nationalNumber);
|
|
214
|
-
if (phoneNumber.validate()) {
|
|
215
|
-
return phoneNumber;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
// If we get here, either no default country was provided, or it didn't validate
|
|
221
|
-
if (options?.throwOnAmbiguous) {
|
|
222
|
-
throw new service_js_1.SharedDialCodeError(dialCodeInfo.dialCode, dialCodeInfo.possibleCountries);
|
|
223
|
-
}
|
|
224
|
-
// Try each possible country
|
|
225
|
-
for (const countryCode of dialCodeInfo.possibleCountries) {
|
|
226
|
-
const country = country_js_1.Country.fromCode(countryCode);
|
|
227
|
-
if (!country)
|
|
228
|
-
continue;
|
|
229
|
-
const phoneNumber = new PhoneNumber(country, dialCodeInfo.nationalNumber);
|
|
230
|
-
if (phoneNumber.validate()) {
|
|
231
|
-
return phoneNumber;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
// If we get here, we couldn't validate with any country
|
|
235
|
-
return undefined;
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
// For non-shared dial codes, get the country
|
|
239
|
-
const countryCode = dialCodeInfo.possibleCountries[0];
|
|
240
|
-
if (!countryCode)
|
|
241
|
-
return undefined;
|
|
242
|
-
const country = country_js_1.Country.fromCode(countryCode);
|
|
243
|
-
if (!country)
|
|
244
|
-
return undefined;
|
|
245
|
-
// Create the phone number
|
|
246
|
-
const phoneNumber = new PhoneNumber(country, dialCodeInfo.nationalNumber);
|
|
247
|
-
// Validate and return
|
|
248
|
-
if (phoneNumber.validate()) {
|
|
249
|
-
return phoneNumber;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return undefined;
|
|
253
|
-
}
|
|
254
|
-
catch (e) {
|
|
255
|
-
if (e instanceof service_js_1.SharedDialCodeError) {
|
|
256
|
-
throw e; // Re-throw the shared dial code error
|
|
257
|
-
}
|
|
258
|
-
console.log(e);
|
|
259
|
-
return undefined;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Creates a PhoneNumber from various formats when a country is explicitly provided.
|
|
264
|
-
* Supports multiple input formats:
|
|
265
|
-
* - International format with plus and country code: "+{code}{number}" (e.g., "+12025550123")
|
|
266
|
-
* - Format with just country code: "{code}{number}" (e.g., "12025550123")
|
|
267
|
-
* - Local format with leading zero: "0{number}" (e.g., "02025550123")
|
|
268
|
-
* - Just the national number: "{number}" (e.g., "2025550123")
|
|
269
|
-
*
|
|
270
|
-
* Thoroughly cleans the input by removing all non-digit characters except the leading '+'.
|
|
271
|
-
*
|
|
272
|
-
* @param input - The phone number string in any format
|
|
273
|
-
* @param country - The Country object for this phone number
|
|
274
|
-
* @returns A PhoneNumber instance if parsing succeeded, undefined otherwise
|
|
275
|
-
*/
|
|
276
|
-
static fromWithCountry(input, country) {
|
|
277
|
-
try {
|
|
278
|
-
if (!input || typeof input !== "string" || !country || !country_js_1.Country.is(country))
|
|
279
|
-
return undefined;
|
|
280
|
-
// Clean the input (remove all non-digits except the leading '+')
|
|
281
|
-
const hasPlus = input.trim().startsWith("+");
|
|
282
|
-
const digitsOnly = input.replace(/\D/g, "");
|
|
283
|
-
const cleanedInput = hasPlus ? `+${digitsOnly}` : digitsOnly;
|
|
284
|
-
if (cleanedInput.length === 0)
|
|
285
|
-
return undefined;
|
|
286
|
-
// Get the metadata for this country
|
|
287
|
-
const metadata = service_js_1.GlobalPhoneNumberService.getInstance()
|
|
288
|
-
.getCountryMetadata(country.code);
|
|
289
|
-
if (!metadata)
|
|
290
|
-
return undefined;
|
|
291
|
-
const dialCode = metadata.code.toString();
|
|
292
|
-
let nationalNumber;
|
|
293
|
-
// Handle different input formats
|
|
294
|
-
if (cleanedInput.startsWith("+")) {
|
|
295
|
-
// Check if the number actually starts with the correct dial code
|
|
296
|
-
const numberWithoutPlus = cleanedInput.substring(1);
|
|
297
|
-
if (numberWithoutPlus.startsWith(dialCode)) {
|
|
298
|
-
// International format with + and country code: +12025550123
|
|
299
|
-
nationalNumber = numberWithoutPlus.substring(dialCode.length);
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
// Has a plus but wrong dial code for the specified country
|
|
303
|
-
return undefined;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
else if (cleanedInput.startsWith(dialCode)) {
|
|
307
|
-
// Format with just country code: 12025550123
|
|
308
|
-
nationalNumber = cleanedInput.substring(dialCode.length);
|
|
309
|
-
}
|
|
310
|
-
else if (cleanedInput.startsWith("0")) {
|
|
311
|
-
// Local format with leading zero: 02025550123
|
|
312
|
-
nationalNumber = cleanedInput.substring(1);
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
// Assume it's just the national number: 2025550123
|
|
316
|
-
nationalNumber = cleanedInput;
|
|
317
|
-
}
|
|
318
|
-
// Check if we have a non-empty national number
|
|
319
|
-
if (nationalNumber.length === 0)
|
|
320
|
-
return undefined;
|
|
321
|
-
// Create and validate the phone number
|
|
322
|
-
const phoneNumber = new PhoneNumber(country, nationalNumber);
|
|
323
|
-
if (!phoneNumber.validate())
|
|
324
|
-
return undefined;
|
|
325
|
-
return phoneNumber;
|
|
326
|
-
}
|
|
327
|
-
catch (e) {
|
|
328
|
-
console.log(e);
|
|
329
|
-
return undefined;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Checks if a string can be constructed into a valid phone number.
|
|
334
|
-
*
|
|
335
|
-
* @param input - The string to validate
|
|
336
|
-
* @param options - Options for handling parsing
|
|
337
|
-
* @returns True if the input can be parsed into a valid phone number, false otherwise
|
|
338
|
-
*/
|
|
339
|
-
static canConstruct(input, options) {
|
|
340
|
-
if (!input || typeof input !== "string")
|
|
341
|
-
return false;
|
|
342
|
-
try {
|
|
343
|
-
const hasPlus = input.trim().startsWith("+");
|
|
344
|
-
const digitsOnly = input.replace(/\D/g, "");
|
|
345
|
-
const cleanedInput = hasPlus ? `+${digitsOnly}` : digitsOnly;
|
|
346
|
-
if (cleanedInput.length === 0)
|
|
347
|
-
return false;
|
|
348
|
-
const phone = PhoneNumber.from(cleanedInput, options);
|
|
349
|
-
return phone !== undefined;
|
|
350
|
-
}
|
|
351
|
-
catch (e) {
|
|
352
|
-
// If throwOnAmbiguous is true and we got a SharedDialCodeError,
|
|
353
|
-
// technically the phone number is constructible with a country
|
|
354
|
-
if (e instanceof service_js_1.SharedDialCodeError) {
|
|
355
|
-
return true;
|
|
356
|
-
}
|
|
357
|
-
return false;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Checks if a string can be constructed into a valid phone number with a given country.
|
|
362
|
-
*
|
|
363
|
-
* @param input - The string to validate
|
|
364
|
-
* @param country - The Country object to use
|
|
365
|
-
* @returns True if the input can be parsed into a valid phone number, false otherwise
|
|
366
|
-
*/
|
|
367
|
-
static canConstructWithCountry(input, country) {
|
|
368
|
-
if (!input || typeof input !== "string" || !country)
|
|
369
|
-
return false;
|
|
370
|
-
const hasPlus = input.trim().startsWith("+");
|
|
371
|
-
const digitsOnly = input.replace(/\D/g, "");
|
|
372
|
-
const cleanedInput = hasPlus ? `+${digitsOnly}` : digitsOnly;
|
|
373
|
-
if (cleanedInput.length === 0)
|
|
374
|
-
return false;
|
|
375
|
-
const phone = PhoneNumber.fromWithCountry(cleanedInput, country);
|
|
376
|
-
return phone !== undefined;
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Type guard to check if an unknown object is a valid PhoneNumber instance.
|
|
380
|
-
*
|
|
381
|
-
* @param obj - The object to check
|
|
382
|
-
* @returns Type predicate indicating if the object is a valid PhoneNumber
|
|
383
|
-
*/
|
|
384
|
-
static is(obj) {
|
|
385
|
-
if (!obj || typeof obj !== "object")
|
|
386
|
-
return false;
|
|
387
|
-
const maybePhone = obj;
|
|
388
|
-
// Check required properties
|
|
389
|
-
if (typeof maybePhone._compactNumber !== "string") {
|
|
390
|
-
return false;
|
|
391
|
-
}
|
|
392
|
-
// Validate the country
|
|
393
|
-
if (!maybePhone._country || !country_js_1.Country.is(maybePhone._country)) {
|
|
394
|
-
return false;
|
|
395
|
-
}
|
|
396
|
-
// Basic structural validation passed
|
|
397
|
-
const country = maybePhone._country;
|
|
398
|
-
const compactNumber = maybePhone._compactNumber;
|
|
399
|
-
// Verify it has the right structure - doesn't call validate()
|
|
400
|
-
return (typeof compactNumber === "string" &&
|
|
401
|
-
/^\d+$/.test(compactNumber) &&
|
|
402
|
-
country_js_1.Country.is(country));
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Attempts to extract the country from a phone number string in international format.
|
|
406
|
-
*
|
|
407
|
-
* For shared dial codes, this will return undefined unless a default country is provided.
|
|
408
|
-
*
|
|
409
|
-
* @param input - The phone number string to parse (must be in international format)
|
|
410
|
-
* @param options - Options for handling shared dial codes
|
|
411
|
-
* @returns The Country object if found, undefined if ambiguous or not found
|
|
412
|
-
* @throws SharedDialCodeError when a shared dial code is encountered and throwOnAmbiguous is true
|
|
413
|
-
*/
|
|
414
|
-
static getCountry(input, options) {
|
|
415
|
-
try {
|
|
416
|
-
// Clean the input first
|
|
417
|
-
const hasPlus = input.trim().startsWith("+");
|
|
418
|
-
const digitsOnly = input.replace(/\D/g, "");
|
|
419
|
-
const cleanedInput = hasPlus ? `+${digitsOnly}` : digitsOnly;
|
|
420
|
-
if (!cleanedInput.startsWith("+"))
|
|
421
|
-
return undefined;
|
|
422
|
-
const service = service_js_1.GlobalPhoneNumberService.getInstance();
|
|
423
|
-
const dialCodeInfo = service.extractDialCode(cleanedInput);
|
|
424
|
-
if (!dialCodeInfo)
|
|
425
|
-
return undefined;
|
|
426
|
-
// Handle shared dial codes
|
|
427
|
-
if (dialCodeInfo.isShared) {
|
|
428
|
-
// If a default country is provided, try to use it
|
|
429
|
-
if (options?.defaultCountry) {
|
|
430
|
-
const defaultCountry = typeof options.defaultCountry === "string"
|
|
431
|
-
? country_js_1.Country.fromCode(options.defaultCountry)
|
|
432
|
-
: options.defaultCountry;
|
|
433
|
-
if (defaultCountry) {
|
|
434
|
-
// Verify that the default country actually uses this dial code
|
|
435
|
-
const metadata = service.getCountryMetadata(defaultCountry.code);
|
|
436
|
-
if (metadata && metadata.code.toString() === dialCodeInfo.dialCode) {
|
|
437
|
-
return defaultCountry;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
// If we get here, either no default country was provided, or it was invalid
|
|
442
|
-
if (options?.throwOnAmbiguous) {
|
|
443
|
-
throw new service_js_1.SharedDialCodeError(dialCodeInfo.dialCode, dialCodeInfo.possibleCountries);
|
|
444
|
-
}
|
|
445
|
-
// Return undefined for ambiguous dial codes
|
|
446
|
-
return undefined;
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
// For non-shared dial codes, get the country
|
|
450
|
-
const countryCode = dialCodeInfo.possibleCountries[0];
|
|
451
|
-
return countryCode ? country_js_1.Country.fromCode(countryCode) : undefined;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
catch (e) {
|
|
455
|
-
if (e instanceof service_js_1.SharedDialCodeError) {
|
|
456
|
-
throw e; // Re-throw the shared dial code error
|
|
457
|
-
}
|
|
458
|
-
console.log(e);
|
|
459
|
-
return undefined;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
exports.PhoneNumber = PhoneNumber;
|