@myrjfa/state 2.1.7 → 2.1.8
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.
|
@@ -4,10 +4,6 @@ export declare function signIn(formData: {
|
|
|
4
4
|
role: string;
|
|
5
5
|
}): Promise<{
|
|
6
6
|
user: {
|
|
7
|
-
country: string;
|
|
8
|
-
rating: number;
|
|
9
|
-
ratingCount: number;
|
|
10
|
-
reviewCount: number;
|
|
11
7
|
username: string;
|
|
12
8
|
firstName: string;
|
|
13
9
|
lastName: string;
|
|
@@ -15,17 +11,21 @@ export declare function signIn(formData: {
|
|
|
15
11
|
password: string;
|
|
16
12
|
phoneNumber: string;
|
|
17
13
|
countryCode: string;
|
|
14
|
+
country: string;
|
|
18
15
|
gender: "male" | "female" | "other";
|
|
16
|
+
rating: number;
|
|
17
|
+
ratingCount: number;
|
|
18
|
+
reviewCount: number;
|
|
19
19
|
joinedDate: Date;
|
|
20
20
|
isActive: boolean;
|
|
21
21
|
lastActive: Date;
|
|
22
22
|
verifiedEmail: boolean;
|
|
23
23
|
verifiedMobile: boolean;
|
|
24
24
|
role: "admin" | "user" | "host" | "hr" | "sales";
|
|
25
|
-
profilePic?: string | undefined;
|
|
26
25
|
location?: string | undefined;
|
|
27
26
|
pinCode?: string | undefined;
|
|
28
27
|
dob?: Date | undefined;
|
|
28
|
+
profilePic?: string | undefined;
|
|
29
29
|
blogsCount?: number | undefined;
|
|
30
30
|
userBio?: string | undefined;
|
|
31
31
|
userIdCard?: string | undefined;
|
|
@@ -51,29 +51,31 @@ export declare function signIn(formData: {
|
|
|
51
51
|
panCard?: string | undefined;
|
|
52
52
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
53
53
|
properties?: {
|
|
54
|
-
type: string;
|
|
55
|
-
city: string;
|
|
56
|
-
state: string;
|
|
57
54
|
country: string;
|
|
55
|
+
type: string;
|
|
58
56
|
name: string;
|
|
59
57
|
address: string;
|
|
58
|
+
city: string;
|
|
59
|
+
state: string;
|
|
60
60
|
pinCode?: string | undefined;
|
|
61
61
|
registrationNumber?: string | undefined;
|
|
62
62
|
}[] | undefined;
|
|
63
63
|
businessDocument?: string | undefined;
|
|
64
64
|
businessIdType?: "PAN" | "GST" | "Udyam" | "PersonalPAN" | undefined;
|
|
65
65
|
businessIdNumber?: string | undefined;
|
|
66
|
-
businessApiVerificationStatus?: "pending" | "
|
|
66
|
+
businessApiVerificationStatus?: "pending" | "verified" | "failed" | undefined;
|
|
67
67
|
businessVerificationDenialReason?: string | undefined;
|
|
68
68
|
};
|
|
69
69
|
message: string;
|
|
70
70
|
success?: undefined;
|
|
71
71
|
status?: undefined;
|
|
72
72
|
error?: undefined;
|
|
73
|
+
data?: undefined;
|
|
73
74
|
} | {
|
|
74
75
|
success: boolean;
|
|
75
76
|
status: any;
|
|
76
77
|
error: any;
|
|
78
|
+
data: any;
|
|
77
79
|
user?: undefined;
|
|
78
80
|
message?: undefined;
|
|
79
81
|
}>;
|
|
@@ -84,10 +86,6 @@ export declare function logoutUser(role: string): Promise<{
|
|
|
84
86
|
}>;
|
|
85
87
|
export declare function verifyEmailOtp(email: string, otp: string, role: "user" | "host"): Promise<{
|
|
86
88
|
user: {
|
|
87
|
-
country: string;
|
|
88
|
-
rating: number;
|
|
89
|
-
ratingCount: number;
|
|
90
|
-
reviewCount: number;
|
|
91
89
|
username: string;
|
|
92
90
|
firstName: string;
|
|
93
91
|
lastName: string;
|
|
@@ -95,17 +93,21 @@ export declare function verifyEmailOtp(email: string, otp: string, role: "user"
|
|
|
95
93
|
password: string;
|
|
96
94
|
phoneNumber: string;
|
|
97
95
|
countryCode: string;
|
|
96
|
+
country: string;
|
|
98
97
|
gender: "male" | "female" | "other";
|
|
98
|
+
rating: number;
|
|
99
|
+
ratingCount: number;
|
|
100
|
+
reviewCount: number;
|
|
99
101
|
joinedDate: Date;
|
|
100
102
|
isActive: boolean;
|
|
101
103
|
lastActive: Date;
|
|
102
104
|
verifiedEmail: boolean;
|
|
103
105
|
verifiedMobile: boolean;
|
|
104
106
|
role: "admin" | "user" | "host" | "hr" | "sales";
|
|
105
|
-
profilePic?: string | undefined;
|
|
106
107
|
location?: string | undefined;
|
|
107
108
|
pinCode?: string | undefined;
|
|
108
109
|
dob?: Date | undefined;
|
|
110
|
+
profilePic?: string | undefined;
|
|
109
111
|
blogsCount?: number | undefined;
|
|
110
112
|
userBio?: string | undefined;
|
|
111
113
|
userIdCard?: string | undefined;
|
|
@@ -131,19 +133,19 @@ export declare function verifyEmailOtp(email: string, otp: string, role: "user"
|
|
|
131
133
|
panCard?: string | undefined;
|
|
132
134
|
verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
|
|
133
135
|
properties?: {
|
|
134
|
-
type: string;
|
|
135
|
-
city: string;
|
|
136
|
-
state: string;
|
|
137
136
|
country: string;
|
|
137
|
+
type: string;
|
|
138
138
|
name: string;
|
|
139
139
|
address: string;
|
|
140
|
+
city: string;
|
|
141
|
+
state: string;
|
|
140
142
|
pinCode?: string | undefined;
|
|
141
143
|
registrationNumber?: string | undefined;
|
|
142
144
|
}[] | undefined;
|
|
143
145
|
businessDocument?: string | undefined;
|
|
144
146
|
businessIdType?: "PAN" | "GST" | "Udyam" | "PersonalPAN" | undefined;
|
|
145
147
|
businessIdNumber?: string | undefined;
|
|
146
|
-
businessApiVerificationStatus?: "pending" | "
|
|
148
|
+
businessApiVerificationStatus?: "pending" | "verified" | "failed" | undefined;
|
|
147
149
|
businessVerificationDenialReason?: string | undefined;
|
|
148
150
|
};
|
|
149
151
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/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
|
|
1
|
+
{"version":3,"file":"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AE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgBlJ;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAevG"}
|
package/dist/lib/actions/auth.js
CHANGED
|
@@ -13,7 +13,7 @@ export async function signIn(formData) {
|
|
|
13
13
|
}
|
|
14
14
|
catch (error) {
|
|
15
15
|
console.error(error.message);
|
|
16
|
-
return { success: false, status: error.status, error: error.message };
|
|
16
|
+
return { success: false, status: error.statusCode || error.status, error: error.message, data: error.data };
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export async function logoutUser(role) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/fetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/fetcher.ts"],"names":[],"mappings":"AAyKA,wBAAsB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,GAAE,OAAc,cAEpE;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,GAAE,OAAc,cAEhF;AAED,wBAAsB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,cAElD;AAED,wBAAsB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,cAEpD;AAED,wBAAsB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,cAEnD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getCookieHeader, getRole } from "./serverActions";
|
|
2
2
|
// Custom API error class — do NOT import from next/dist internals
|
|
3
3
|
class ApiError extends Error {
|
|
4
|
-
constructor(statusCode, message) {
|
|
4
|
+
constructor(statusCode, message, data) {
|
|
5
5
|
super(message);
|
|
6
6
|
this.statusCode = statusCode;
|
|
7
|
+
this.data = data;
|
|
7
8
|
this.name = 'ApiError';
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -78,7 +79,7 @@ async function customFetch(input, method, body, options = {}) {
|
|
|
78
79
|
error: typeof error === 'string' ? error : 'Unknown error',
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
|
-
throw new ApiError(errorBody.statusCode, errorBody.error);
|
|
82
|
+
throw new ApiError(errorBody.statusCode, errorBody.error, errorBody.data);
|
|
82
83
|
}
|
|
83
84
|
// Single in-flight refresh promise — prevents concurrent 401s from firing multiple refresh calls
|
|
84
85
|
let refreshPromise = null;
|