@celo/utils
Advanced tools
Comparing version 1.3.3 to 1.4.0
@@ -5,2 +5,5 @@ import countryData from 'country-data'; | ||
} | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export interface LocalizedCountry extends Omit<countryData.Country, 'countryCallingCodes'> { | ||
@@ -16,2 +19,5 @@ displayName: string; | ||
} | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare class Countries { | ||
@@ -18,0 +24,0 @@ language: string; |
@@ -35,2 +35,5 @@ "use strict"; | ||
}; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
var Countries = /** @class */ (function () { | ||
@@ -37,0 +40,0 @@ function Countries(language) { |
@@ -5,2 +5,5 @@ import * as t from 'io-ts'; | ||
export declare const JSONStringType: t.Type<string, string, unknown>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare const E164PhoneNumberType: t.Type<string, string, unknown>; | ||
@@ -11,2 +14,5 @@ export declare const AddressType: t.Type<string, string, unknown>; | ||
export declare const SaltType: t.StringC; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare const AttestationServiceStatusResponseType: t.TypeC<{ | ||
@@ -28,2 +34,5 @@ status: t.LiteralC<"ok">; | ||
}>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare const AttestationServiceTestRequestType: t.TypeC<{ | ||
@@ -35,6 +44,15 @@ phoneNumber: t.Type<string, string, unknown>; | ||
}>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare type AttestationServiceTestRequest = t.TypeOf<typeof AttestationServiceTestRequestType>; | ||
export declare type Signature = t.TypeOf<typeof SignatureType>; | ||
export declare type Address = t.TypeOf<typeof AddressType>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare type E164Number = t.TypeOf<typeof E164PhoneNumberType>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare const AttestationRequestType: t.TypeC<{ | ||
@@ -49,3 +67,9 @@ phoneNumber: t.Type<string, string, unknown>; | ||
}>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare type AttestationRequest = t.TypeOf<typeof AttestationRequestType>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare const GetAttestationRequestType: t.TypeC<{ | ||
@@ -58,2 +82,5 @@ phoneNumber: t.Type<string, string, unknown>; | ||
}>; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare type GetAttestationRequest = t.TypeOf<typeof GetAttestationRequestType>; | ||
@@ -60,0 +87,0 @@ export declare const AttestationResponseType: t.TypeC<{ |
@@ -52,2 +52,5 @@ "use strict"; | ||
}, String); | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
exports.E164PhoneNumberType = new t.Type('E164Number', t.string.is, function (input, context) { | ||
@@ -76,2 +79,5 @@ return Either_1.either.chain(t.string.validate(input, context), function (stringValue) { | ||
exports.SaltType = t.string; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
exports.AttestationServiceStatusResponseType = t.type({ | ||
@@ -93,2 +99,5 @@ status: t.literal('ok'), | ||
}); | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
exports.AttestationServiceTestRequestType = t.type({ | ||
@@ -100,2 +109,5 @@ phoneNumber: exports.E164PhoneNumberType, | ||
}); | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
exports.AttestationRequestType = t.type({ | ||
@@ -112,2 +124,5 @@ phoneNumber: exports.E164PhoneNumberType, | ||
}); | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
exports.GetAttestationRequestType = t.type({ | ||
@@ -114,0 +129,0 @@ phoneNumber: exports.E164PhoneNumberType, |
import { isE164Number, ParsedPhoneNumber } from '@celo/base/lib/phoneNumbers'; | ||
export { anonymizedPhone, isE164Number, ParsedPhoneNumber } from '@celo/base/lib/phoneNumbers'; | ||
export declare const getPhoneHash: (phoneNumber: string, salt?: string | undefined) => string; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getCountryEmoji(e164PhoneNumber: string, countryCodePossible?: number, regionCodePossible?: string): string; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getCountryCode(e164PhoneNumber: string): number | null | undefined; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getRegionCode(e164PhoneNumber: string): string | null | undefined; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getRegionCodeFromCountryCode(countryCode: string): string | null; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getDisplayPhoneNumber(phoneNumber: string, defaultCountryCode: string): string; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getDisplayNumberInternational(e164PhoneNumber: string): string; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getE164DisplayNumber(e164PhoneNumber: string): string; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getE164Number(phoneNumber: string, defaultCountryCode: string): string | null; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function isE164NumberStrict(phoneNumber: string): boolean; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function parsePhoneNumber(phoneNumberRaw: string, defaultCountryCode?: string): ParsedPhoneNumber | null; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
export declare function getExampleNumber(regionCode: string, useOnlyZeroes?: boolean, isInternational?: boolean): string | undefined; | ||
@@ -15,0 +48,0 @@ export declare const PhoneNumberUtils: { |
@@ -23,2 +23,5 @@ "use strict"; | ||
var MIN_PHONE_LENGTH = 4; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getCountryEmoji(e164PhoneNumber, countryCodePossible, regionCodePossible) { | ||
@@ -40,2 +43,5 @@ // The country code and region code can both be passed in, or it can be inferred from the e164PhoneNumber | ||
exports.getCountryEmoji = getCountryEmoji; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getCountryCode(e164PhoneNumber) { | ||
@@ -54,2 +60,5 @@ if (!e164PhoneNumber) { | ||
exports.getCountryCode = getCountryCode; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getRegionCode(e164PhoneNumber) { | ||
@@ -68,2 +77,5 @@ if (!e164PhoneNumber) { | ||
exports.getRegionCode = getRegionCode; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getRegionCodeFromCountryCode(countryCode) { | ||
@@ -82,2 +94,5 @@ if (!countryCode) { | ||
exports.getRegionCodeFromCountryCode = getRegionCodeFromCountryCode; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getDisplayPhoneNumber(phoneNumber, defaultCountryCode) { | ||
@@ -94,2 +109,5 @@ var phoneDetails = parsePhoneNumber(phoneNumber, defaultCountryCode); | ||
exports.getDisplayPhoneNumber = getDisplayPhoneNumber; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getDisplayNumberInternational(e164PhoneNumber) { | ||
@@ -107,2 +125,5 @@ var countryCode = getCountryCode(e164PhoneNumber); | ||
exports.getDisplayNumberInternational = getDisplayNumberInternational; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getE164DisplayNumber(e164PhoneNumber) { | ||
@@ -113,2 +134,5 @@ var countryCode = getCountryCode(e164PhoneNumber); | ||
exports.getE164DisplayNumber = getE164DisplayNumber; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getE164Number(phoneNumber, defaultCountryCode) { | ||
@@ -125,2 +149,5 @@ var phoneDetails = parsePhoneNumber(phoneNumber, defaultCountryCode); | ||
// Actually runs through the parsing instead of using a regex | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function isE164NumberStrict(phoneNumber) { | ||
@@ -139,2 +166,5 @@ try { | ||
exports.isE164NumberStrict = isE164NumberStrict; | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function parsePhoneNumber(phoneNumberRaw, defaultCountryCode) { | ||
@@ -188,2 +218,5 @@ try { | ||
// display e164 everywhere to ensure users knows exactly who their sending money to | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function handleSpecialCasesForDisplay(parsedNumber, countryCode) { | ||
@@ -209,2 +242,5 @@ switch (countryCode) { | ||
*/ | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function prependToFormMobilePhoneNumber(parsedNumber, regionCode, prefix) { | ||
@@ -226,2 +262,5 @@ if (phoneUtil.getNumberType(parsedNumber) === google_libphonenumber_1.PhoneNumberType.MOBILE) { | ||
} | ||
/** | ||
* @deprecated moved to @celo/phone-utils will be removed in next major version | ||
*/ | ||
function getExampleNumber(regionCode, useOnlyZeroes, isInternational) { | ||
@@ -228,0 +267,0 @@ if (useOnlyZeroes === void 0) { useOnlyZeroes = true; } |
{ | ||
"name": "@celo/utils", | ||
"version": "1.3.3", | ||
"version": "1.4.0", | ||
"description": "Celo common utils", | ||
@@ -22,3 +22,3 @@ "author": "Celo", | ||
"dependencies": { | ||
"@celo/base": "1.3.3", | ||
"@celo/base": "1.4.0", | ||
"@types/country-data": "^0.0.0", | ||
@@ -25,0 +25,0 @@ "@types/elliptic": "^6.4.9", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
485311
6601
1
+ Added@celo/base@1.4.0(transitive)
- Removed@celo/base@1.3.3(transitive)
Updated@celo/base@1.4.0