@salla.sa/twilight 2.0.273 → 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/dist/@salla.sa/twilight.min.js +1 -1
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/types/api/auth/response.d.ts +5 -0
- package/types/api/profile.d.ts +11 -4
package/package.json
CHANGED
|
@@ -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
|
|
package/types/api/profile.d.ts
CHANGED
|
@@ -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
|
-
|
|
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<
|
|
42
|
-
updateContacts: (data: ProfileUpdateContactPayload) => Promise<ProfileResponse>;//
|
|
48
|
+
verify: (data: AuthRequest.verifyByMobile | AuthRequest.verifyByEmail) => Promise<VerifyContactResponse>;
|
|
49
|
+
updateContacts: (data: ProfileUpdateContactPayload) => Promise<ProfileResponse>;//need to verify after success event
|
|
43
50
|
}
|