@salla.sa/twilight 2.0.272 → 2.0.274

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.0.272",
3
+ "version": "2.0.274",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,11 +1,16 @@
1
1
  import {SuccessResponse} from "../../common";
2
2
 
3
+ export type VerificationStatus = {
4
+ type: 'mobile' | 'email';
5
+ status: 'success' | 'pending' | 'failed';
6
+ }
3
7
  export namespace AuthResponse {
4
8
  export interface verify extends SuccessResponse {
5
9
  data: {
6
10
  case: 'authenticated' | 'new_customer';
7
11
  redirect_url?: string;
8
12
  token?: string;
13
+ verification?: VerificationStatus;
9
14
  }
10
15
  }
11
16
 
@@ -1,5 +1,5 @@
1
1
  import {SuccessResponse} from "../common";
2
- import {AuthRequest} from "./auth";
2
+ import {AuthRequest, VerificationStatus} from "./auth";
3
3
 
4
4
  export interface ProfileUpdatePayload {
5
5
  first_name: string;
@@ -31,13 +31,20 @@ export interface ProfileResponse extends SuccessResponse {
31
31
  avatar: string;
32
32
  gender?: 'male' | 'female';
33
33
  birthday: string | '2022-02-22';
34
- verification_type?: 'email' | 'mobile'; //exists when trying to update email/phone
34
+ verification?: VerificationStatus; //exists when trying to update email/phone
35
35
  };
36
36
  }
37
37
 
38
+ export interface VerifyContactResponse extends SuccessResponse {
39
+ data: {
40
+ message: string;
41
+ verification: VerificationStatus;
42
+ }
43
+ }
44
+
38
45
  export default interface ProfileApi {
39
46
  info: () => Promise<ProfileResponse>;
40
47
  update: (data: ProfileUpdatePayload) => Promise<ProfileResponse>;
41
- verify: (data: AuthRequest.verifyByMobile | AuthRequest.verifyByEmail) => Promise<SuccessResponse>;
42
- updateContacts: (data: ProfileUpdateContactPayload) => Promise<ProfileResponse>;//should verify after success event
48
+ verify: (data: AuthRequest.verifyByMobile | AuthRequest.verifyByEmail) => Promise<VerifyContactResponse>;
49
+ updateContacts: (data: ProfileUpdateContactPayload) => Promise<ProfileResponse>;//need to verify after success event
43
50
  }
@@ -35,6 +35,7 @@ export interface TwilightConfig {
35
35
  };
36
36
  user?: {
37
37
  type?: 'user' | 'guest';
38
+ id?: string | number;
38
39
  email?: any;
39
40
  mobile?: any;
40
41
  language_code?: string;