@myrjfa/state 1.0.4 → 1.0.5

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.
@@ -5,7 +5,7 @@ export async function getCurrentUser() {
5
5
  try {
6
6
  const endpoint = `/users/me`;
7
7
  const data = await get(endpoint);
8
- console.log(data.message);
8
+ // console.log(data.message);
9
9
  return data?.data;
10
10
  }
11
11
  catch (error) {
@@ -10,6 +10,8 @@ export declare function signIn(formData: {
10
10
  email: string;
11
11
  password: string;
12
12
  phoneNumber: string;
13
+ countryCode: string;
14
+ country: string;
13
15
  gender: "male" | "female" | "other";
14
16
  rating: number;
15
17
  ratingCount: number;
@@ -73,6 +75,8 @@ export declare function verifyEmailOtp(email: string, otp: string, role: "user"
73
75
  email: string;
74
76
  password: string;
75
77
  phoneNumber: string;
78
+ countryCode: string;
79
+ country: string;
76
80
  gender: "male" | "female" | "other";
77
81
  rating: number;
78
82
  ratingCount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAGA,wBAAsB,MAAM,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAeA;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAa9G;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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oint, formData);
8
- console.log('Response:', data);
8
+ // console.log('Response:', data);
9
9
  return {
10
10
  user: data.data.user,
11
11
  message: data.message,
@@ -38,7 +38,7 @@ export async function verifyEmailOtp(email, otp, role) {
38
38
  if (role === 'host')
39
39
  endpoint = `/hosts/verify-otp`;
40
40
  const data = await post(endpoint, { email: email, emailOtp: otp });
41
- console.log('Response:', data);
41
+ // console.log('Response:', data);
42
42
  return {
43
43
  user: data.data.user,
44
44
  message: data.message,
@@ -0,0 +1,19 @@
1
+ export interface Country {
2
+ name: string;
3
+ phoneCode: string;
4
+ iso: string;
5
+ states: string[];
6
+ }
7
+ export declare const COUNTRIES: Country[];
8
+ export declare const COUNTRIES_BY_CODE: Record<string, Country>;
9
+ export declare const STATES_BY_COUNTRY: Record<string, string[]>;
10
+ export declare function getCountries(): Country[];
11
+ export declare function getCountryNames(): string[];
12
+ export declare function getStates(countryName: string): string[];
13
+ export declare function getCountryByCode(code: string): Country | undefined;
14
+ export declare function getCountryPhoneCodes(): string[];
15
+ export declare function getCountriesWithPhoneCodes(): string[];
16
+ export declare function getCountryByName(name: string): Country | undefined;
17
+ export declare function searchCountries(query: string): Country[];
18
+ export declare function searchStatesOfCountry(countryName: string, query: string): string[];
19
+ //# sourceMappingURL=countryStates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countryStates.d.ts","sourceRoot":"","sources":["../../../src/lib/data/countryStates.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,OAAO,EA0oN9B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAGrB,CAAC;AAElC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAGrB,CAAC;AAGnC,wBAAgB,YAAY,IAAI,OAAO,EAAE,CAExC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAElE;AAED,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED,wBAAgB,0BAA0B,IAAI,MAAM,EAAE,CAErD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAElE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAKxD;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAMlF"}