@salla.sa/twilight 2.0.264 → 2.0.266
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 +2 -2
- 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/product.d.ts +1 -1
- package/types/api/profile.d.ts +6 -9
- package/types/event/profile.d.ts +2 -4
package/package.json
CHANGED
package/types/api/product.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export interface Category {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface GetCategoriesResponse extends SuccessResponse {
|
|
57
|
-
data: Category[];
|
|
57
|
+
data: Category | Category[]; //single category when getting subCategories by passing categoryId
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export default interface ProductApi {
|
package/types/api/profile.d.ts
CHANGED
|
@@ -9,13 +9,10 @@ export interface ProfileUpdatePayload {
|
|
|
9
9
|
avatar?: BinaryType;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export interface
|
|
13
|
-
phone
|
|
14
|
-
country_code
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export interface ProfileUpdateEmailPayload {
|
|
18
|
-
email: string;
|
|
12
|
+
export interface ProfileUpdateContactPayload {
|
|
13
|
+
phone?: string | number; //required if there is no email
|
|
14
|
+
country_code?: string | 'SA'; //required if there is phone
|
|
15
|
+
email?: string; //required if there is no phone
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
export interface UpdateProfileResponse extends SuccessResponse {
|
|
@@ -31,12 +28,12 @@ export interface UpdateProfileResponse extends SuccessResponse {
|
|
|
31
28
|
avatar: string;
|
|
32
29
|
gender?: 'male' | 'female';
|
|
33
30
|
birthday: string | '2022-02-22';
|
|
31
|
+
verification_type?: 'email' | 'mobile'; //exists when trying to update email/phone
|
|
34
32
|
};
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
export default interface ProfileApi {
|
|
38
36
|
update: (data: ProfileUpdatePayload) => Promise<UpdateProfileResponse>;
|
|
39
|
-
updateMobile: (data: ProfileUpdateMobilePayload) => Promise<UpdateProfileResponse>;
|
|
40
|
-
updateEmail: (data: ProfileUpdateEmailPayload) => Promise<UpdateProfileResponse>;
|
|
41
37
|
verify: (data: AuthRequest.verifyByMobile | AuthRequest.verifyByEmail) => Promise<SuccessResponse>;
|
|
38
|
+
updateContacts: (data: ProfileUpdateContactPayload) => Promise<UpdateProfileResponse>;//should verify after success event
|
|
42
39
|
}
|
package/types/event/profile.d.ts
CHANGED
|
@@ -3,13 +3,11 @@ import {RequestErrorEvent, SuccessResponse} from "../common";
|
|
|
3
3
|
|
|
4
4
|
export default interface ProfileEvent {
|
|
5
5
|
onUpdated: (callback: (response: UpdateProfileResponse) => void) => void;
|
|
6
|
-
onMobileUpdated: (callback: (response: UpdateProfileResponse) => void) => void;
|
|
7
|
-
onEmailUpdated: (callback: (response: UpdateProfileResponse) => void) => void;
|
|
8
6
|
onVerified: (callback: (response: SuccessResponse) => void) => void;
|
|
7
|
+
onVerificationCodeSent: (callback: (response: UpdateProfileResponse) => void) => void; //should trigger action to fill verify code, then calling salla.profile.verify(...)
|
|
9
8
|
|
|
10
9
|
//errors
|
|
11
10
|
onUpdateFailed: RequestErrorEvent;
|
|
12
|
-
onUpdateMobileFailed: RequestErrorEvent;
|
|
13
|
-
onUpdateEmailFailed: RequestErrorEvent;
|
|
14
11
|
onUnverified: RequestErrorEvent;
|
|
12
|
+
onUpdateContactsFailed: RequestErrorEvent;
|
|
15
13
|
}
|