@myrjfa/state 1.0.3 → 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.
- package/dist/lib/actions.d.ts +2 -2
- package/dist/lib/actions.js +1 -1
- package/dist/lib/auth.d.ts +4 -0
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +2 -2
- package/dist/lib/data/countryStates.d.ts +19 -0
- package/dist/lib/data/countryStates.d.ts.map +1 -0
- package/dist/lib/data/countryStates.js +6834 -0
- package/dist/lib/fetcher.d.ts +1 -1
- package/dist/lib/fetcher.d.ts.map +1 -1
- package/dist/lib/fetcher.js +36 -30
- package/dist/lib/models/blog.d.ts +64 -64
- package/dist/lib/models/portfolio.d.ts +42 -42
- package/dist/lib/models/props.d.ts +0 -7
- package/dist/lib/models/props.d.ts.map +1 -1
- package/dist/lib/models/props.js +0 -126
- package/dist/lib/models/review.d.ts +2 -2
- package/dist/lib/models/user.d.ts +6 -0
- package/dist/lib/models/user.d.ts.map +1 -1
- package/dist/lib/models/user.js +4 -0
- package/dist/lib/models/volunteerJob.d.ts +397 -379
- package/dist/lib/models/volunteerJob.d.ts.map +1 -1
- package/dist/lib/models/volunteerJob.js +2 -0
- package/dist/lib/userAtom.d.ts +12 -4
- package/dist/lib/userAtom.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/lib/fetcher.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type FetchMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
2
2
|
export declare function refreshToken<T>(input: string, method: FetchMethod, body?: any): Promise<T>;
|
|
3
|
-
export declare function get<T>(url: string): Promise<T>;
|
|
3
|
+
export declare function get<T>(url: string, includeAuth?: boolean): Promise<T>;
|
|
4
4
|
export declare function post<T>(url: string, body: any): Promise<T>;
|
|
5
5
|
export declare function put<T>(url: string, body: any): Promise<T>;
|
|
6
6
|
export declare function patch<T>(url: string, body: any): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/lib/fetcher.ts"],"names":[],"mappings":"AAKA,KAAK,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/lib/fetcher.ts"],"names":[],"mappings":"AAKA,KAAK,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;AAsE/D,wBAAsB,YAAY,CAAC,CAAC,EAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,WAAW,EACnB,IAAI,CAAC,EAAE,GAAG,GACX,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAID,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,cAEnD;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"}
|
package/dist/lib/fetcher.js
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
import { ApiError } from "next/dist/server/api-utils";
|
|
2
2
|
import { getCookieHeader, getRole } from "./severActions";
|
|
3
3
|
const baseURL = process.env.NEXT_PUBLIC_API_URL;
|
|
4
|
-
async function customFetch(input, method, body,
|
|
4
|
+
async function customFetch(input, method, body, options = {}) {
|
|
5
|
+
const { includeAuth = false, retry = true } = options;
|
|
5
6
|
const url = `${baseURL}${input}`;
|
|
6
7
|
const isFormData = typeof FormData !== 'undefined' && body instanceof FormData;
|
|
7
|
-
|
|
8
|
+
let headers = isFormData
|
|
9
|
+
? { Accept: 'application/json' }
|
|
10
|
+
: { 'Content-Type': 'application/json', Accept: 'application/json' };
|
|
11
|
+
if (includeAuth) {
|
|
12
|
+
try {
|
|
13
|
+
const cookieHeader = await getCookieHeader();
|
|
14
|
+
headers = { ...headers, Cookie: cookieHeader };
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
// If we can't get cookies (CSR context), credentials: 'include' will handle it
|
|
18
|
+
console.warn('Could not get cookies for auth header:', error);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
8
21
|
const init = {
|
|
9
22
|
method,
|
|
10
23
|
credentials: 'include',
|
|
11
|
-
headers
|
|
12
|
-
? {
|
|
13
|
-
Accept: 'application/json',
|
|
14
|
-
Cookie: cookieHeader,
|
|
15
|
-
} // Let browser set correct Content-Type for FormData
|
|
16
|
-
: {
|
|
17
|
-
'Content-Type': 'application/json',
|
|
18
|
-
Accept: 'application/json',
|
|
19
|
-
Cookie: cookieHeader,
|
|
20
|
-
},
|
|
24
|
+
headers,
|
|
21
25
|
...(body ? { body: isFormData ? body : JSON.stringify(body) } : {}),
|
|
22
26
|
};
|
|
23
27
|
const response = await fetch(url, init);
|
|
24
28
|
if (response.ok) {
|
|
25
29
|
return response.status !== 204 ? (await response.json()) : {};
|
|
26
30
|
}
|
|
27
|
-
// Token refresh logic on 401
|
|
28
|
-
if (response.status === 401 && retry && !input.includes('/login')) {
|
|
29
|
-
return refreshToken(input, method, body);
|
|
31
|
+
// Token refresh logic on 401 (only for authenticated requests)
|
|
32
|
+
if (response.status === 401 && retry && includeAuth && !input.includes('/login')) {
|
|
33
|
+
return await refreshToken(input, method, body);
|
|
30
34
|
}
|
|
35
|
+
// Error handling
|
|
31
36
|
let errorBody;
|
|
32
37
|
try {
|
|
33
38
|
errorBody = (await response.json());
|
|
@@ -40,39 +45,40 @@ async function customFetch(input, method, body, retry = true) {
|
|
|
40
45
|
}
|
|
41
46
|
throw new ApiError(errorBody.statusCode, errorBody.error);
|
|
42
47
|
}
|
|
48
|
+
// Token refresh function
|
|
43
49
|
export async function refreshToken(input, method, body) {
|
|
44
50
|
const role = await getRole();
|
|
45
51
|
try {
|
|
46
|
-
const
|
|
52
|
+
const roleForEndpoint = role == "admin" ? "user" : role;
|
|
53
|
+
const response = await fetch(`${baseURL}/${roleForEndpoint}s/refresh-token`, {
|
|
47
54
|
method: 'POST',
|
|
48
55
|
credentials: 'include',
|
|
49
56
|
});
|
|
50
57
|
const data = await response.json();
|
|
51
|
-
if (response.ok)
|
|
52
|
-
return customFetch(input, method, body, false);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
+
if (response.ok) {
|
|
59
|
+
return customFetch(input, method, body, { includeAuth: true, retry: false });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
throw { statusCode: 401, error: data.error };
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
catch (error) {
|
|
60
66
|
throw new ApiError(error.statusCode ?? 500, error.error);
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
|
-
//
|
|
64
|
-
export async function get(url) {
|
|
65
|
-
return customFetch(url, 'GET');
|
|
69
|
+
// ✅ Sever-safe exported functions
|
|
70
|
+
export async function get(url, includeAuth = true) {
|
|
71
|
+
return customFetch(url, 'GET', undefined, { includeAuth });
|
|
66
72
|
}
|
|
67
73
|
export async function post(url, body) {
|
|
68
|
-
return customFetch(url, 'POST', body);
|
|
74
|
+
return customFetch(url, 'POST', body, { includeAuth: true });
|
|
69
75
|
}
|
|
70
76
|
export async function put(url, body) {
|
|
71
|
-
return customFetch(url, 'PUT', body);
|
|
77
|
+
return customFetch(url, 'PUT', body, { includeAuth: true });
|
|
72
78
|
}
|
|
73
79
|
export async function patch(url, body) {
|
|
74
|
-
return customFetch(url, 'PATCH', body);
|
|
80
|
+
return customFetch(url, 'PATCH', body, { includeAuth: true });
|
|
75
81
|
}
|
|
76
82
|
export async function del(url, body) {
|
|
77
|
-
return customFetch(url, 'DELETE', body);
|
|
83
|
+
return customFetch(url, 'DELETE', body, { includeAuth: true });
|
|
78
84
|
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const BlogStatusSchema: z.ZodEnum<["draft", "posted", "archived", "pending", "denied"]>;
|
|
3
|
-
export type BlogStatus = z.infer<typeof BlogStatusSchema>;
|
|
4
|
-
export declare const BlogSchema: z.ZodObject<{
|
|
5
|
-
slug: z.ZodString;
|
|
6
|
-
title: z.ZodString;
|
|
7
|
-
overview: z.ZodString;
|
|
8
|
-
hashtags: z.ZodOptional<z.ZodString>;
|
|
9
|
-
content: z.ZodString;
|
|
10
|
-
blogImages: z.ZodArray<z.ZodString, "many">;
|
|
11
|
-
status: z.ZodEnum<["draft", "posted", "archived", "pending", "denied"]>;
|
|
12
|
-
views: z.ZodNumber;
|
|
13
|
-
likes: z.ZodNumber;
|
|
14
|
-
comments: z.ZodNumber;
|
|
15
|
-
shares: z.ZodNumber;
|
|
16
|
-
createdAt: z.ZodDate;
|
|
17
|
-
updatedAt: z.ZodDate;
|
|
18
|
-
author: z.ZodString;
|
|
19
|
-
authorImage: z.ZodString;
|
|
20
|
-
authorRole: z.ZodEnum<["host", "admin", "user"]>;
|
|
21
|
-
}, "strict", z.ZodTypeAny, {
|
|
22
|
-
status: "draft" | "posted" | "archived" | "pending" | "denied";
|
|
23
|
-
title: string;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
updatedAt: Date;
|
|
26
|
-
slug: string;
|
|
27
|
-
overview: string;
|
|
28
|
-
content: string;
|
|
29
|
-
blogImages: string[];
|
|
30
|
-
views: number;
|
|
31
|
-
likes: number;
|
|
32
|
-
comments: number;
|
|
33
|
-
shares: number;
|
|
34
|
-
author: string;
|
|
35
|
-
authorImage: string;
|
|
36
|
-
authorRole: "host" | "user" | "admin";
|
|
37
|
-
hashtags?: string | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
status: "draft" | "posted" | "archived" | "pending" | "denied";
|
|
40
|
-
title: string;
|
|
41
|
-
createdAt: Date;
|
|
42
|
-
updatedAt: Date;
|
|
43
|
-
slug: string;
|
|
44
|
-
overview: string;
|
|
45
|
-
content: string;
|
|
46
|
-
blogImages: string[];
|
|
47
|
-
views: number;
|
|
48
|
-
likes: number;
|
|
49
|
-
comments: number;
|
|
50
|
-
shares: number;
|
|
51
|
-
author: string;
|
|
52
|
-
authorImage: string;
|
|
53
|
-
authorRole: "host" | "user" | "admin";
|
|
54
|
-
hashtags?: string | undefined;
|
|
55
|
-
}>;
|
|
56
|
-
export type Blog = z.infer<typeof BlogSchema>;
|
|
57
|
-
export type BlogMetaData = {
|
|
58
|
-
image: string;
|
|
59
|
-
title: string;
|
|
60
|
-
overview: string;
|
|
61
|
-
};
|
|
62
|
-
export declare const hashTagOptions: {
|
|
63
|
-
title: string;
|
|
64
|
-
}[];
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BlogStatusSchema: z.ZodEnum<["draft", "posted", "archived", "pending", "denied"]>;
|
|
3
|
+
export type BlogStatus = z.infer<typeof BlogStatusSchema>;
|
|
4
|
+
export declare const BlogSchema: z.ZodObject<{
|
|
5
|
+
slug: z.ZodString;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
overview: z.ZodString;
|
|
8
|
+
hashtags: z.ZodOptional<z.ZodString>;
|
|
9
|
+
content: z.ZodString;
|
|
10
|
+
blogImages: z.ZodArray<z.ZodString, "many">;
|
|
11
|
+
status: z.ZodEnum<["draft", "posted", "archived", "pending", "denied"]>;
|
|
12
|
+
views: z.ZodNumber;
|
|
13
|
+
likes: z.ZodNumber;
|
|
14
|
+
comments: z.ZodNumber;
|
|
15
|
+
shares: z.ZodNumber;
|
|
16
|
+
createdAt: z.ZodDate;
|
|
17
|
+
updatedAt: z.ZodDate;
|
|
18
|
+
author: z.ZodString;
|
|
19
|
+
authorImage: z.ZodString;
|
|
20
|
+
authorRole: z.ZodEnum<["host", "admin", "user"]>;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
status: "draft" | "posted" | "archived" | "pending" | "denied";
|
|
23
|
+
title: string;
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
slug: string;
|
|
27
|
+
overview: string;
|
|
28
|
+
content: string;
|
|
29
|
+
blogImages: string[];
|
|
30
|
+
views: number;
|
|
31
|
+
likes: number;
|
|
32
|
+
comments: number;
|
|
33
|
+
shares: number;
|
|
34
|
+
author: string;
|
|
35
|
+
authorImage: string;
|
|
36
|
+
authorRole: "host" | "user" | "admin";
|
|
37
|
+
hashtags?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
status: "draft" | "posted" | "archived" | "pending" | "denied";
|
|
40
|
+
title: string;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
slug: string;
|
|
44
|
+
overview: string;
|
|
45
|
+
content: string;
|
|
46
|
+
blogImages: string[];
|
|
47
|
+
views: number;
|
|
48
|
+
likes: number;
|
|
49
|
+
comments: number;
|
|
50
|
+
shares: number;
|
|
51
|
+
author: string;
|
|
52
|
+
authorImage: string;
|
|
53
|
+
authorRole: "host" | "user" | "admin";
|
|
54
|
+
hashtags?: string | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
export type Blog = z.infer<typeof BlogSchema>;
|
|
57
|
+
export type BlogMetaData = {
|
|
58
|
+
image: string;
|
|
59
|
+
title: string;
|
|
60
|
+
overview: string;
|
|
61
|
+
};
|
|
62
|
+
export declare const hashTagOptions: {
|
|
63
|
+
title: string;
|
|
64
|
+
}[];
|
|
65
65
|
//# sourceMappingURL=blog.d.ts.map
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const PortfolioItemSchema: z.ZodObject<{
|
|
3
|
-
_id: z.ZodString;
|
|
4
|
-
user: z.ZodString;
|
|
5
|
-
mediaType: z.ZodEnum<["image", "video"]>;
|
|
6
|
-
url: z.ZodString;
|
|
7
|
-
mainUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
-
caption: z.ZodString;
|
|
9
|
-
views: z.ZodNumber;
|
|
10
|
-
likes: z.ZodNumber;
|
|
11
|
-
comments: z.ZodNumber;
|
|
12
|
-
shares: z.ZodNumber;
|
|
13
|
-
createdAt: z.ZodDate;
|
|
14
|
-
updatedAt: z.ZodDate;
|
|
15
|
-
}, "strict", z.ZodTypeAny, {
|
|
16
|
-
user: string;
|
|
17
|
-
url: string;
|
|
18
|
-
_id: string;
|
|
19
|
-
createdAt: Date;
|
|
20
|
-
updatedAt: Date;
|
|
21
|
-
views: number;
|
|
22
|
-
likes: number;
|
|
23
|
-
comments: number;
|
|
24
|
-
shares: number;
|
|
25
|
-
mediaType: "image" | "video";
|
|
26
|
-
caption: string;
|
|
27
|
-
mainUrl?: string | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
user: string;
|
|
30
|
-
url: string;
|
|
31
|
-
_id: string;
|
|
32
|
-
createdAt: Date;
|
|
33
|
-
updatedAt: Date;
|
|
34
|
-
views: number;
|
|
35
|
-
likes: number;
|
|
36
|
-
comments: number;
|
|
37
|
-
shares: number;
|
|
38
|
-
mediaType: "image" | "video";
|
|
39
|
-
caption: string;
|
|
40
|
-
mainUrl?: string | undefined;
|
|
41
|
-
}>;
|
|
42
|
-
export type PortfolioItem = z.infer<typeof PortfolioItemSchema>;
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PortfolioItemSchema: z.ZodObject<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
user: z.ZodString;
|
|
5
|
+
mediaType: z.ZodEnum<["image", "video"]>;
|
|
6
|
+
url: z.ZodString;
|
|
7
|
+
mainUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
+
caption: z.ZodString;
|
|
9
|
+
views: z.ZodNumber;
|
|
10
|
+
likes: z.ZodNumber;
|
|
11
|
+
comments: z.ZodNumber;
|
|
12
|
+
shares: z.ZodNumber;
|
|
13
|
+
createdAt: z.ZodDate;
|
|
14
|
+
updatedAt: z.ZodDate;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
user: string;
|
|
17
|
+
url: string;
|
|
18
|
+
_id: string;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
views: number;
|
|
22
|
+
likes: number;
|
|
23
|
+
comments: number;
|
|
24
|
+
shares: number;
|
|
25
|
+
mediaType: "image" | "video";
|
|
26
|
+
caption: string;
|
|
27
|
+
mainUrl?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
user: string;
|
|
30
|
+
url: string;
|
|
31
|
+
_id: string;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
views: number;
|
|
35
|
+
likes: number;
|
|
36
|
+
comments: number;
|
|
37
|
+
shares: number;
|
|
38
|
+
mediaType: "image" | "video";
|
|
39
|
+
caption: string;
|
|
40
|
+
mainUrl?: string | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export type PortfolioItem = z.infer<typeof PortfolioItemSchema>;
|
|
43
43
|
//# sourceMappingURL=portfolio.d.ts.map
|
|
@@ -29,11 +29,4 @@ export interface DisplayItem {
|
|
|
29
29
|
title: string;
|
|
30
30
|
}
|
|
31
31
|
export declare const fallBackIcon = "/images/icons/miscellaneous.webp";
|
|
32
|
-
export declare const statesOptions: {
|
|
33
|
-
india: string[];
|
|
34
|
-
pakistan: string[];
|
|
35
|
-
"united states": string[];
|
|
36
|
-
canada: string[];
|
|
37
|
-
australia: string[];
|
|
38
|
-
};
|
|
39
32
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/lib/models/props.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;;;;EAGhB,CAAC;AAEZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,eAAO,MAAM,UAAU;;;GA8BtB,CAAC;AAEF,eAAO,MAAM,aAAa;;GA+FzB,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,qCAAqC,CAAA
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/lib/models/props.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;;;;EAGhB,CAAC;AAEZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,eAAO,MAAM,UAAU;;;GA8BtB,CAAC;AAEF,eAAO,MAAM,aAAa;;GA+FzB,CAAC;AAEF,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,qCAAqC,CAAA"}
|
package/dist/lib/models/props.js
CHANGED
|
@@ -132,129 +132,3 @@ export const skillsOptions = [
|
|
|
132
132
|
{ title: "Decoration" },
|
|
133
133
|
];
|
|
134
134
|
export const fallBackIcon = "/images/icons/miscellaneous.webp";
|
|
135
|
-
export const statesOptions = {
|
|
136
|
-
"india": [
|
|
137
|
-
"Andhra Pradesh",
|
|
138
|
-
"Arunachal Pradesh",
|
|
139
|
-
"Assam",
|
|
140
|
-
"Bihar",
|
|
141
|
-
"Chhattisgarh",
|
|
142
|
-
"Goa",
|
|
143
|
-
"Gujarat",
|
|
144
|
-
"Haryana",
|
|
145
|
-
"Himachal Pradesh",
|
|
146
|
-
"Jharkhand",
|
|
147
|
-
"Karnataka",
|
|
148
|
-
"Kerala",
|
|
149
|
-
"Madhya Pradesh",
|
|
150
|
-
"Maharashtra",
|
|
151
|
-
"Manipur",
|
|
152
|
-
"Meghalaya",
|
|
153
|
-
"Mizoram",
|
|
154
|
-
"Nagaland",
|
|
155
|
-
"Odisha",
|
|
156
|
-
"Punjab",
|
|
157
|
-
"Rajasthan",
|
|
158
|
-
"Sikkim",
|
|
159
|
-
"Tamil Nadu",
|
|
160
|
-
"Telangana",
|
|
161
|
-
"Tripura",
|
|
162
|
-
"Uttar Pradesh",
|
|
163
|
-
"Uttarakhand",
|
|
164
|
-
"West Bengal",
|
|
165
|
-
"Andaman and Nicobar Islands",
|
|
166
|
-
"Chandigarh",
|
|
167
|
-
"Dadra and Nagar Haveli and Daman and Diu",
|
|
168
|
-
"Delhi",
|
|
169
|
-
"Jammu and Kashmir",
|
|
170
|
-
"Ladakh",
|
|
171
|
-
"Lakshadweep",
|
|
172
|
-
"Puducherry"
|
|
173
|
-
],
|
|
174
|
-
"pakistan": [
|
|
175
|
-
"Azad Jammu and Kashmir",
|
|
176
|
-
"Balochistan",
|
|
177
|
-
"Gilgit-Baltistan",
|
|
178
|
-
"Islamabad Capital Territory",
|
|
179
|
-
"Khyber Pakhtunkhwa",
|
|
180
|
-
"Punjab",
|
|
181
|
-
"Sindh"
|
|
182
|
-
],
|
|
183
|
-
"united states": [
|
|
184
|
-
"Alabama",
|
|
185
|
-
"Alaska",
|
|
186
|
-
"Arizona",
|
|
187
|
-
"Arkansas",
|
|
188
|
-
"California",
|
|
189
|
-
"Colorado",
|
|
190
|
-
"Connecticut",
|
|
191
|
-
"Delaware",
|
|
192
|
-
"Florida",
|
|
193
|
-
"Georgia",
|
|
194
|
-
"Hawaii",
|
|
195
|
-
"Idaho",
|
|
196
|
-
"Illinois",
|
|
197
|
-
"Indiana",
|
|
198
|
-
"Iowa",
|
|
199
|
-
"Kansas",
|
|
200
|
-
"Kentucky",
|
|
201
|
-
"Louisiana",
|
|
202
|
-
"Maine",
|
|
203
|
-
"Maryland",
|
|
204
|
-
"Massachusetts",
|
|
205
|
-
"Michigan",
|
|
206
|
-
"Minnesota",
|
|
207
|
-
"Mississippi",
|
|
208
|
-
"Missouri",
|
|
209
|
-
"Montana",
|
|
210
|
-
"Nebraska",
|
|
211
|
-
"Nevada",
|
|
212
|
-
"New Hampshire",
|
|
213
|
-
"New Jersey",
|
|
214
|
-
"New Mexico",
|
|
215
|
-
"New York",
|
|
216
|
-
"North Carolina",
|
|
217
|
-
"North Dakota",
|
|
218
|
-
"Ohio",
|
|
219
|
-
"Oklahoma",
|
|
220
|
-
"Oregon",
|
|
221
|
-
"Pennsylvania",
|
|
222
|
-
"Rhode Island",
|
|
223
|
-
"South Carolina",
|
|
224
|
-
"South Dakota",
|
|
225
|
-
"Tennessee",
|
|
226
|
-
"Texas",
|
|
227
|
-
"Utah",
|
|
228
|
-
"Vermont",
|
|
229
|
-
"Virginia",
|
|
230
|
-
"Washington",
|
|
231
|
-
"West Virginia",
|
|
232
|
-
"Wisconsin",
|
|
233
|
-
"Wyoming"
|
|
234
|
-
],
|
|
235
|
-
"canada": [
|
|
236
|
-
"Alberta",
|
|
237
|
-
"British Columbia",
|
|
238
|
-
"Manitoba",
|
|
239
|
-
"New Brunswick",
|
|
240
|
-
"Newfoundland and Labrador",
|
|
241
|
-
"Nova Scotia",
|
|
242
|
-
"Ontario",
|
|
243
|
-
"Prince Edward Island",
|
|
244
|
-
"Quebec",
|
|
245
|
-
"Saskatchewan",
|
|
246
|
-
"Northwest Territories",
|
|
247
|
-
"Nunavut",
|
|
248
|
-
"Yukon"
|
|
249
|
-
],
|
|
250
|
-
"australia": [
|
|
251
|
-
"New South Wales",
|
|
252
|
-
"Victoria",
|
|
253
|
-
"Queensland",
|
|
254
|
-
"Western Australia",
|
|
255
|
-
"South Australia",
|
|
256
|
-
"Tasmania",
|
|
257
|
-
"Australian Capital Territory",
|
|
258
|
-
"Northern Territory"
|
|
259
|
-
]
|
|
260
|
-
};
|
|
@@ -8,18 +8,18 @@ export declare const ReviewSchema: z.ZodObject<{
|
|
|
8
8
|
createdAt: z.ZodDate;
|
|
9
9
|
updatedAt: z.ZodDate;
|
|
10
10
|
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
rating: number;
|
|
11
12
|
_id: string;
|
|
12
13
|
reviewerPic: string;
|
|
13
14
|
reviewerUsername: string;
|
|
14
|
-
rating: number;
|
|
15
15
|
comment: string;
|
|
16
16
|
createdAt: Date;
|
|
17
17
|
updatedAt: Date;
|
|
18
18
|
}, {
|
|
19
|
+
rating: number;
|
|
19
20
|
_id: string;
|
|
20
21
|
reviewerPic: string;
|
|
21
22
|
reviewerUsername: string;
|
|
22
|
-
rating: number;
|
|
23
23
|
comment: string;
|
|
24
24
|
createdAt: Date;
|
|
25
25
|
updatedAt: Date;
|
|
@@ -8,6 +8,8 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
8
8
|
email: z.ZodString;
|
|
9
9
|
password: z.ZodString;
|
|
10
10
|
phoneNumber: z.ZodString;
|
|
11
|
+
countryCode: z.ZodString;
|
|
12
|
+
country: z.ZodString;
|
|
11
13
|
location: z.ZodOptional<z.ZodString>;
|
|
12
14
|
pinCode: z.ZodOptional<z.ZodString>;
|
|
13
15
|
dob: z.ZodOptional<z.ZodDate>;
|
|
@@ -59,6 +61,8 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
59
61
|
email: string;
|
|
60
62
|
password: string;
|
|
61
63
|
phoneNumber: string;
|
|
64
|
+
countryCode: string;
|
|
65
|
+
country: string;
|
|
62
66
|
gender: "male" | "female" | "other";
|
|
63
67
|
rating: number;
|
|
64
68
|
ratingCount: number;
|
|
@@ -104,6 +108,8 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
104
108
|
email: string;
|
|
105
109
|
password: string;
|
|
106
110
|
phoneNumber: string;
|
|
111
|
+
countryCode: string;
|
|
112
|
+
country: string;
|
|
107
113
|
gender: "male" | "female" | "other";
|
|
108
114
|
rating: number;
|
|
109
115
|
ratingCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/lib/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,EAA6D,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AAE/G,eAAO,MAAM,MAAM,qDAAmD,CAAC;AAEvE,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/lib/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,EAA6D,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AAE/G,eAAO,MAAM,MAAM,qDAAmD,CAAC;AAEvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDZ,CAAC;AAEZ,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,UAAU,EAAE,IAmCxB,CAAC"}
|
package/dist/lib/models/user.js
CHANGED
|
@@ -8,6 +8,8 @@ export const UserSchema = z.object({
|
|
|
8
8
|
email: z.string().email(),
|
|
9
9
|
password: z.string(),
|
|
10
10
|
phoneNumber: z.string(),
|
|
11
|
+
countryCode: z.string(),
|
|
12
|
+
country: z.string(),
|
|
11
13
|
location: z.string().optional(),
|
|
12
14
|
pinCode: z.string().optional(),
|
|
13
15
|
dob: z.date().optional(),
|
|
@@ -57,6 +59,8 @@ export const sampleUser = {
|
|
|
57
59
|
email: "ravi.kumar@example.com",
|
|
58
60
|
password: "hashedPassword",
|
|
59
61
|
phoneNumber: "9876543210",
|
|
62
|
+
countryCode: "91",
|
|
63
|
+
country: "India",
|
|
60
64
|
isActive: true,
|
|
61
65
|
lastActive: new Date(2025, 2, 15), // March 15, 2025
|
|
62
66
|
profilePic: "/images/profile_placeholder.webp",
|