@myrjfa/state 1.0.0

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.
Files changed (60) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +4 -0
  3. package/dist/index.d.ts +13 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +12 -0
  6. package/dist/lib/QueryProvider.d.ts +4 -0
  7. package/dist/lib/QueryProvider.d.ts.map +1 -0
  8. package/dist/lib/QueryProvider.js +10 -0
  9. package/dist/lib/actions.d.ts +141 -0
  10. package/dist/lib/actions.d.ts.map +1 -0
  11. package/dist/lib/actions.js +307 -0
  12. package/dist/lib/auth.d.ts +146 -0
  13. package/dist/lib/auth.d.ts.map +1 -0
  14. package/dist/lib/auth.js +125 -0
  15. package/dist/lib/authSessionManager.d.ts +2 -0
  16. package/dist/lib/authSessionManager.d.ts.map +1 -0
  17. package/dist/lib/authSessionManager.js +34 -0
  18. package/dist/lib/fetcher.d.ts +9 -0
  19. package/dist/lib/fetcher.d.ts.map +1 -0
  20. package/dist/lib/fetcher.js +78 -0
  21. package/dist/lib/hooks/use-mobile.d.ts +2 -0
  22. package/dist/lib/hooks/use-mobile.d.ts.map +1 -0
  23. package/dist/lib/hooks/use-mobile.js +15 -0
  24. package/dist/lib/models/application.d.ts +25 -0
  25. package/dist/lib/models/application.d.ts.map +1 -0
  26. package/dist/lib/models/application.js +130 -0
  27. package/dist/lib/models/blog.d.ts +63 -0
  28. package/dist/lib/models/blog.d.ts.map +1 -0
  29. package/dist/lib/models/blog.js +190 -0
  30. package/dist/lib/models/notfications.d.ts +26 -0
  31. package/dist/lib/models/notfications.d.ts.map +1 -0
  32. package/dist/lib/models/notfications.js +46 -0
  33. package/dist/lib/models/portfolio.d.ts +32 -0
  34. package/dist/lib/models/portfolio.d.ts.map +1 -0
  35. package/dist/lib/models/portfolio.js +66 -0
  36. package/dist/lib/models/props.d.ts +39 -0
  37. package/dist/lib/models/props.d.ts.map +1 -0
  38. package/dist/lib/models/props.js +260 -0
  39. package/dist/lib/models/review.d.ts +40 -0
  40. package/dist/lib/models/review.d.ts.map +1 -0
  41. package/dist/lib/models/review.js +72 -0
  42. package/dist/lib/models/tile.d.ts +26 -0
  43. package/dist/lib/models/tile.d.ts.map +1 -0
  44. package/dist/lib/models/tile.js +1 -0
  45. package/dist/lib/models/user.d.ts +148 -0
  46. package/dist/lib/models/user.d.ts.map +1 -0
  47. package/dist/lib/models/user.js +87 -0
  48. package/dist/lib/models/volunteerJob.d.ts +377 -0
  49. package/dist/lib/models/volunteerJob.d.ts.map +1 -0
  50. package/dist/lib/models/volunteerJob.js +149 -0
  51. package/dist/lib/severActions.d.ts +3 -0
  52. package/dist/lib/severActions.d.ts.map +1 -0
  53. package/dist/lib/severActions.js +19 -0
  54. package/dist/lib/userAtom.d.ts +191 -0
  55. package/dist/lib/userAtom.d.ts.map +1 -0
  56. package/dist/lib/userAtom.js +127 -0
  57. package/dist/lib/utils.d.ts +53 -0
  58. package/dist/lib/utils.d.ts.map +1 -0
  59. package/dist/lib/utils.js +182 -0
  60. package/package.json +51 -0
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ export const socialLinkTypes = ["instagram", "linkedin", "youtube", "googleBusiness"];
3
+ export const zroles = z.enum(["host", "user", "admin", "hr", "sales"]);
4
+ export const UserSchema = z.object({
5
+ username: z.string(),
6
+ firstName: z.string(),
7
+ lastName: z.string(),
8
+ email: z.string().email(),
9
+ password: z.string(),
10
+ phoneNumber: z.string(),
11
+ location: z.string().optional(),
12
+ pinCode: z.string().optional(),
13
+ dob: z.date().optional(),
14
+ gender: z.enum(["male", "female", "other"]),
15
+ profilePic: z.string().optional(),
16
+ rating: z.number(),
17
+ ratingCount: z.number(),
18
+ reviewCount: z.number(),
19
+ blogsCount: z.number().optional(),
20
+ joinedDate: z.date(),
21
+ isActive: z.boolean(),
22
+ lastActive: z.date(),
23
+ userBio: z.string().optional(),
24
+ userIdCard: z.string().optional(),
25
+ watchHistory: z.array(z.string()).optional(),
26
+ accessToken: z.string().optional(),
27
+ refreshToken: z.string().optional(),
28
+ verifiedEmail: z.boolean(),
29
+ verifiedMobile: z.boolean(),
30
+ verifiedIdCard: z.boolean().optional(),
31
+ role: zroles,
32
+ socialLinks: z.record(z.enum(socialLinkTypes), z.string().url()).optional(),
33
+ // Vounteer specific
34
+ userResume: z.string().optional(),
35
+ skills: z.array(z.object({
36
+ skill: z.string(),
37
+ skillExpertise: z.number(),
38
+ })).optional(),
39
+ wishlist: z.array(z.string()).optional(),
40
+ favBlogs: z.array(z.string()).optional(),
41
+ favPackages: z.array(z.string()).optional(),
42
+ id: z.string().optional(),
43
+ selfie: z.string().optional(),
44
+ selfieAction: z.string().optional(),
45
+ // portfolioCount?: z.number();
46
+ // business specific
47
+ jobCount: z.number().optional(),
48
+ travelPackageCount: z.number().optional(),
49
+ gstNumber: z.string().optional(),
50
+ panCard: z.string().optional(),
51
+ verifiedBusiness: z.enum(["true", "false", "inProgress"]).optional(),
52
+ }).strict(); // 👈 .strict() blocks unknown fields
53
+ export const sampleUser = {
54
+ username: "wanderlust_volunteer",
55
+ firstName: "Ravi",
56
+ lastName: "Kumar",
57
+ email: "ravi.kumar@example.com",
58
+ password: "hashedPassword",
59
+ phoneNumber: "9876543210",
60
+ isActive: true,
61
+ lastActive: new Date(2025, 2, 15), // March 15, 2025
62
+ profilePic: "/images/profile_placeholder.webp",
63
+ userBio: "Passionate traveler and volunteer with expertise in sustainable tourism. I've worked across 15+ locations helping local communities build eco-friendly tourist infrastructure.",
64
+ skills: [
65
+ { skill: "Photography", skillExpertise: 5 },
66
+ { skill: "Content Creation", skillExpertise: 4 },
67
+ { skill: "Tour Guide", skillExpertise: 3 },
68
+ { skill: "Language Translation", skillExpertise: 7 },
69
+ { skill: "Teaching", skillExpertise: 2 }
70
+ ],
71
+ watchHistory: [],
72
+ location: "Mumbai, India",
73
+ gender: "male",
74
+ joinedDate: new Date(2023, 5, 10),
75
+ wishlist: ["elderly-care-8765", "art-therapy-4567", "women-empowerment-7890"],
76
+ userResume: "https://pdfobject.com/pdf/sample.pdf",
77
+ verifiedEmail: true,
78
+ verifiedMobile: false,
79
+ userIdCard: "6616155161",
80
+ role: "user",
81
+ verifiedIdCard: true,
82
+ rating: 4.5,
83
+ ratingCount: 100,
84
+ reviewCount: 52,
85
+ // blogsCount: 5,
86
+ // portfolioCount: 6,
87
+ };
@@ -0,0 +1,377 @@
1
+ import { z } from "zod";
2
+ import { DisplayItem } from "./props";
3
+ export declare const OpportunitySchema: z.ZodObject<{
4
+ slug: z.ZodString;
5
+ title: z.ZodString;
6
+ skills: z.ZodArray<z.ZodString, "many">;
7
+ description: z.ZodString;
8
+ images: z.ZodArray<z.ZodString, "many">;
9
+ categoryId: z.ZodOptional<z.ZodString>;
10
+ city: z.ZodString;
11
+ state: z.ZodString;
12
+ address: z.ZodOptional<z.ZodString>;
13
+ availableFrom: z.ZodDate;
14
+ minDuration: z.ZodNumber;
15
+ maxDuration: z.ZodNumber;
16
+ urgent: z.ZodBoolean;
17
+ applicationCount: z.ZodNumber;
18
+ peopleRequired: z.ZodNumber;
19
+ facilities: z.ZodArray<z.ZodString, "many">;
20
+ responsibilities: z.ZodArray<z.ZodString, "many">;
21
+ questions: z.ZodArray<z.ZodObject<{
22
+ question: z.ZodString;
23
+ answer: z.ZodString;
24
+ }, "strict", z.ZodTypeAny, {
25
+ question: string;
26
+ answer: string;
27
+ }, {
28
+ question: string;
29
+ answer: string;
30
+ }>, "many">;
31
+ rating: z.ZodNumber;
32
+ ratingCount: z.ZodNumber;
33
+ reviewCount: z.ZodNumber;
34
+ hostId: z.ZodLazy<z.ZodObject<{
35
+ username: z.ZodString;
36
+ firstName: z.ZodString;
37
+ lastName: z.ZodString;
38
+ email: z.ZodString;
39
+ password: z.ZodString;
40
+ phoneNumber: z.ZodString;
41
+ location: z.ZodOptional<z.ZodString>;
42
+ pinCode: z.ZodOptional<z.ZodString>;
43
+ dob: z.ZodOptional<z.ZodDate>;
44
+ gender: z.ZodEnum<["male", "female", "other"]>;
45
+ profilePic: z.ZodOptional<z.ZodString>;
46
+ rating: z.ZodNumber;
47
+ ratingCount: z.ZodNumber;
48
+ reviewCount: z.ZodNumber;
49
+ blogsCount: z.ZodOptional<z.ZodNumber>;
50
+ joinedDate: z.ZodDate;
51
+ isActive: z.ZodBoolean;
52
+ lastActive: z.ZodDate;
53
+ userBio: z.ZodOptional<z.ZodString>;
54
+ userIdCard: z.ZodOptional<z.ZodString>;
55
+ watchHistory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
+ accessToken: z.ZodOptional<z.ZodString>;
57
+ refreshToken: z.ZodOptional<z.ZodString>;
58
+ verifiedEmail: z.ZodBoolean;
59
+ verifiedMobile: z.ZodBoolean;
60
+ verifiedIdCard: z.ZodOptional<z.ZodBoolean>;
61
+ role: z.ZodEnum<["host", "user", "admin", "hr", "sales"]>;
62
+ socialLinks: z.ZodOptional<z.ZodRecord<z.ZodEnum<[string, ...string[]]>, z.ZodString>>;
63
+ userResume: z.ZodOptional<z.ZodString>;
64
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
65
+ skill: z.ZodString;
66
+ skillExpertise: z.ZodNumber;
67
+ }, "strip", z.ZodTypeAny, {
68
+ skill: string;
69
+ skillExpertise: number;
70
+ }, {
71
+ skill: string;
72
+ skillExpertise: number;
73
+ }>, "many">>;
74
+ wishlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
+ favBlogs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
76
+ favPackages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
77
+ id: z.ZodOptional<z.ZodString>;
78
+ selfie: z.ZodOptional<z.ZodString>;
79
+ selfieAction: z.ZodOptional<z.ZodString>;
80
+ jobCount: z.ZodOptional<z.ZodNumber>;
81
+ travelPackageCount: z.ZodOptional<z.ZodNumber>;
82
+ gstNumber: z.ZodOptional<z.ZodString>;
83
+ panCard: z.ZodOptional<z.ZodString>;
84
+ verifiedBusiness: z.ZodOptional<z.ZodEnum<["true", "false", "inProgress"]>>;
85
+ }, "strict", z.ZodTypeAny, {
86
+ role: "host" | "user" | "admin" | "hr" | "sales";
87
+ username: string;
88
+ firstName: string;
89
+ lastName: string;
90
+ email: string;
91
+ password: string;
92
+ phoneNumber: string;
93
+ gender: "male" | "female" | "other";
94
+ rating: number;
95
+ ratingCount: number;
96
+ reviewCount: number;
97
+ joinedDate: Date;
98
+ isActive: boolean;
99
+ lastActive: Date;
100
+ verifiedEmail: boolean;
101
+ verifiedMobile: boolean;
102
+ location?: string | undefined;
103
+ pinCode?: string | undefined;
104
+ dob?: Date | undefined;
105
+ profilePic?: string | undefined;
106
+ blogsCount?: number | undefined;
107
+ userBio?: string | undefined;
108
+ userIdCard?: string | undefined;
109
+ watchHistory?: string[] | undefined;
110
+ accessToken?: string | undefined;
111
+ refreshToken?: string | undefined;
112
+ verifiedIdCard?: boolean | undefined;
113
+ socialLinks?: Record<string, string> | undefined;
114
+ userResume?: string | undefined;
115
+ skills?: {
116
+ skill: string;
117
+ skillExpertise: number;
118
+ }[] | undefined;
119
+ wishlist?: string[] | undefined;
120
+ favBlogs?: string[] | undefined;
121
+ favPackages?: string[] | undefined;
122
+ id?: string | undefined;
123
+ selfie?: string | undefined;
124
+ selfieAction?: string | undefined;
125
+ jobCount?: number | undefined;
126
+ travelPackageCount?: number | undefined;
127
+ gstNumber?: string | undefined;
128
+ panCard?: string | undefined;
129
+ verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
130
+ }, {
131
+ role: "host" | "user" | "admin" | "hr" | "sales";
132
+ username: string;
133
+ firstName: string;
134
+ lastName: string;
135
+ email: string;
136
+ password: string;
137
+ phoneNumber: string;
138
+ gender: "male" | "female" | "other";
139
+ rating: number;
140
+ ratingCount: number;
141
+ reviewCount: number;
142
+ joinedDate: Date;
143
+ isActive: boolean;
144
+ lastActive: Date;
145
+ verifiedEmail: boolean;
146
+ verifiedMobile: boolean;
147
+ location?: string | undefined;
148
+ pinCode?: string | undefined;
149
+ dob?: Date | undefined;
150
+ profilePic?: string | undefined;
151
+ blogsCount?: number | undefined;
152
+ userBio?: string | undefined;
153
+ userIdCard?: string | undefined;
154
+ watchHistory?: string[] | undefined;
155
+ accessToken?: string | undefined;
156
+ refreshToken?: string | undefined;
157
+ verifiedIdCard?: boolean | undefined;
158
+ socialLinks?: Record<string, string> | undefined;
159
+ userResume?: string | undefined;
160
+ skills?: {
161
+ skill: string;
162
+ skillExpertise: number;
163
+ }[] | undefined;
164
+ wishlist?: string[] | undefined;
165
+ favBlogs?: string[] | undefined;
166
+ favPackages?: string[] | undefined;
167
+ id?: string | undefined;
168
+ selfie?: string | undefined;
169
+ selfieAction?: string | undefined;
170
+ jobCount?: number | undefined;
171
+ travelPackageCount?: number | undefined;
172
+ gstNumber?: string | undefined;
173
+ panCard?: string | undefined;
174
+ verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
175
+ }>>;
176
+ applicationObservers: z.ZodOptional<z.ZodArray<z.ZodObject<{
177
+ username: z.ZodString;
178
+ role: z.ZodEnum<["host", "user", "admin", "hr", "sales"]>;
179
+ phoneNumber: z.ZodString;
180
+ email: z.ZodString;
181
+ }, "strip", z.ZodTypeAny, {
182
+ role: "host" | "user" | "admin" | "hr" | "sales";
183
+ username: string;
184
+ email: string;
185
+ phoneNumber: string;
186
+ }, {
187
+ role: "host" | "user" | "admin" | "hr" | "sales";
188
+ username: string;
189
+ email: string;
190
+ phoneNumber: string;
191
+ }>, "many">>;
192
+ hostingType: z.ZodOptional<z.ZodString>;
193
+ views: z.ZodNumber;
194
+ status: z.ZodEnum<["draft", "archived", "pending", "open", "closed", "denied", "deleted"]>;
195
+ createdAt: z.ZodOptional<z.ZodDate>;
196
+ updatedAt: z.ZodOptional<z.ZodDate>;
197
+ adminApproval: z.ZodBoolean;
198
+ }, "strict", z.ZodTypeAny, {
199
+ title: string;
200
+ description: string;
201
+ status: "draft" | "archived" | "pending" | "denied" | "open" | "closed" | "deleted";
202
+ rating: number;
203
+ ratingCount: number;
204
+ reviewCount: number;
205
+ skills: string[];
206
+ slug: string;
207
+ views: number;
208
+ images: string[];
209
+ city: string;
210
+ state: string;
211
+ availableFrom: Date;
212
+ minDuration: number;
213
+ maxDuration: number;
214
+ urgent: boolean;
215
+ applicationCount: number;
216
+ peopleRequired: number;
217
+ facilities: string[];
218
+ responsibilities: string[];
219
+ questions: {
220
+ question: string;
221
+ answer: string;
222
+ }[];
223
+ hostId: {
224
+ role: "host" | "user" | "admin" | "hr" | "sales";
225
+ username: string;
226
+ firstName: string;
227
+ lastName: string;
228
+ email: string;
229
+ password: string;
230
+ phoneNumber: string;
231
+ gender: "male" | "female" | "other";
232
+ rating: number;
233
+ ratingCount: number;
234
+ reviewCount: number;
235
+ joinedDate: Date;
236
+ isActive: boolean;
237
+ lastActive: Date;
238
+ verifiedEmail: boolean;
239
+ verifiedMobile: boolean;
240
+ location?: string | undefined;
241
+ pinCode?: string | undefined;
242
+ dob?: Date | undefined;
243
+ profilePic?: string | undefined;
244
+ blogsCount?: number | undefined;
245
+ userBio?: string | undefined;
246
+ userIdCard?: string | undefined;
247
+ watchHistory?: string[] | undefined;
248
+ accessToken?: string | undefined;
249
+ refreshToken?: string | undefined;
250
+ verifiedIdCard?: boolean | undefined;
251
+ socialLinks?: Record<string, string> | undefined;
252
+ userResume?: string | undefined;
253
+ skills?: {
254
+ skill: string;
255
+ skillExpertise: number;
256
+ }[] | undefined;
257
+ wishlist?: string[] | undefined;
258
+ favBlogs?: string[] | undefined;
259
+ favPackages?: string[] | undefined;
260
+ id?: string | undefined;
261
+ selfie?: string | undefined;
262
+ selfieAction?: string | undefined;
263
+ jobCount?: number | undefined;
264
+ travelPackageCount?: number | undefined;
265
+ gstNumber?: string | undefined;
266
+ panCard?: string | undefined;
267
+ verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
268
+ };
269
+ adminApproval: boolean;
270
+ createdAt?: Date | undefined;
271
+ updatedAt?: Date | undefined;
272
+ categoryId?: string | undefined;
273
+ address?: string | undefined;
274
+ applicationObservers?: {
275
+ role: "host" | "user" | "admin" | "hr" | "sales";
276
+ username: string;
277
+ email: string;
278
+ phoneNumber: string;
279
+ }[] | undefined;
280
+ hostingType?: string | undefined;
281
+ }, {
282
+ title: string;
283
+ description: string;
284
+ status: "draft" | "archived" | "pending" | "denied" | "open" | "closed" | "deleted";
285
+ rating: number;
286
+ ratingCount: number;
287
+ reviewCount: number;
288
+ skills: string[];
289
+ slug: string;
290
+ views: number;
291
+ images: string[];
292
+ city: string;
293
+ state: string;
294
+ availableFrom: Date;
295
+ minDuration: number;
296
+ maxDuration: number;
297
+ urgent: boolean;
298
+ applicationCount: number;
299
+ peopleRequired: number;
300
+ facilities: string[];
301
+ responsibilities: string[];
302
+ questions: {
303
+ question: string;
304
+ answer: string;
305
+ }[];
306
+ hostId: {
307
+ role: "host" | "user" | "admin" | "hr" | "sales";
308
+ username: string;
309
+ firstName: string;
310
+ lastName: string;
311
+ email: string;
312
+ password: string;
313
+ phoneNumber: string;
314
+ gender: "male" | "female" | "other";
315
+ rating: number;
316
+ ratingCount: number;
317
+ reviewCount: number;
318
+ joinedDate: Date;
319
+ isActive: boolean;
320
+ lastActive: Date;
321
+ verifiedEmail: boolean;
322
+ verifiedMobile: boolean;
323
+ location?: string | undefined;
324
+ pinCode?: string | undefined;
325
+ dob?: Date | undefined;
326
+ profilePic?: string | undefined;
327
+ blogsCount?: number | undefined;
328
+ userBio?: string | undefined;
329
+ userIdCard?: string | undefined;
330
+ watchHistory?: string[] | undefined;
331
+ accessToken?: string | undefined;
332
+ refreshToken?: string | undefined;
333
+ verifiedIdCard?: boolean | undefined;
334
+ socialLinks?: Record<string, string> | undefined;
335
+ userResume?: string | undefined;
336
+ skills?: {
337
+ skill: string;
338
+ skillExpertise: number;
339
+ }[] | undefined;
340
+ wishlist?: string[] | undefined;
341
+ favBlogs?: string[] | undefined;
342
+ favPackages?: string[] | undefined;
343
+ id?: string | undefined;
344
+ selfie?: string | undefined;
345
+ selfieAction?: string | undefined;
346
+ jobCount?: number | undefined;
347
+ travelPackageCount?: number | undefined;
348
+ gstNumber?: string | undefined;
349
+ panCard?: string | undefined;
350
+ verifiedBusiness?: "true" | "false" | "inProgress" | undefined;
351
+ };
352
+ adminApproval: boolean;
353
+ createdAt?: Date | undefined;
354
+ updatedAt?: Date | undefined;
355
+ categoryId?: string | undefined;
356
+ address?: string | undefined;
357
+ applicationObservers?: {
358
+ role: "host" | "user" | "admin" | "hr" | "sales";
359
+ username: string;
360
+ email: string;
361
+ phoneNumber: string;
362
+ }[] | undefined;
363
+ hostingType?: string | undefined;
364
+ }>;
365
+ export type OppMetaData = {
366
+ image: string;
367
+ title: string;
368
+ location: string;
369
+ skills: string[];
370
+ hostingType: string;
371
+ };
372
+ export type Opportunity = z.infer<typeof OpportunitySchema>;
373
+ export declare const facilitiesOptions: DisplayItem[];
374
+ export declare const otherFacilitiesOptions: DisplayItem[];
375
+ export declare const responsibilitiesOptions: DisplayItem[];
376
+ export declare const otherResponsibilitiesOptions: DisplayItem[];
377
+ //# sourceMappingURL=volunteerJob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volunteerJob.d.ts","sourceRoot":"","sources":["../../../src/lib/models/volunteerJob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCnB,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAG5D,eAAO,MAAM,iBAAiB,EAuBzB,WAAW,EAAE,CAAC;AAEnB,eAAO,MAAM,sBAAsB,EAqC9B,WAAW,EAAE,CAAC;AAGnB,eAAO,MAAM,uBAAuB,EAiB/B,WAAW,EAAE,CAAC;AAEnB,eAAO,MAAM,4BAA4B,EA2BpC,WAAW,EAAE,CAAC"}
@@ -0,0 +1,149 @@
1
+ import { z } from "zod";
2
+ import { UserSchema, zroles } from "./user";
3
+ import { QuestionSchema } from "./props";
4
+ export const OpportunitySchema = z.object({
5
+ slug: z.string(),
6
+ title: z.string(),
7
+ skills: z.array(z.string()),
8
+ description: z.string(),
9
+ images: z.array(z.string()),
10
+ categoryId: z.string().optional(),
11
+ city: z.string(),
12
+ state: z.string(),
13
+ address: z.string().optional(),
14
+ availableFrom: z.date(),
15
+ minDuration: z.number(),
16
+ maxDuration: z.number(),
17
+ urgent: z.boolean(),
18
+ applicationCount: z.number(),
19
+ peopleRequired: z.number(),
20
+ facilities: z.array(z.string()),
21
+ responsibilities: z.array(z.string()),
22
+ questions: z.array(QuestionSchema), // 👈 use validated QuestionSchema
23
+ rating: z.number(),
24
+ ratingCount: z.number(),
25
+ reviewCount: z.number(),
26
+ hostId: z.lazy(() => UserSchema), // 👈 assuming user validation
27
+ applicationObservers: z.array(z.object({
28
+ username: z.string(),
29
+ role: zroles,
30
+ phoneNumber: z.string(),
31
+ email: z.string(),
32
+ })).optional(),
33
+ hostingType: z.string().optional(),
34
+ views: z.number(),
35
+ status: z.enum(['draft', 'archived', 'pending', 'open', 'closed', 'denied', 'deleted']),
36
+ createdAt: z.date().optional(),
37
+ updatedAt: z.date().optional(),
38
+ adminApproval: z.boolean(),
39
+ }).strict();
40
+ // options for what volunteers get
41
+ export const facilitiesOptions = [
42
+ { icon: "/images/facilities/room.webp", title: "Shared Room" },
43
+ { icon: "/images/facilities/room.webp", title: "Private Room" },
44
+ { icon: "/images/facilities/room.webp", title: "Dormitory" },
45
+ { icon: "/images/facilities/room.webp", title: "Accomodation" },
46
+ { icon: "/images/facilities/meal.webp", title: "1 Meal/Day" },
47
+ { icon: "/images/facilities/meal.webp", title: "2 Meals/Day" },
48
+ { icon: "/images/facilities/meal.webp", title: "3 Meals/Day" },
49
+ { icon: "/images/facilities/meal.webp", title: "Food" },
50
+ { icon: "/images/facilities/meal.webp", title: "Snacks / Tea" },
51
+ { icon: "/images/facilities/meal.webp", title: "Cooking Facilities" },
52
+ { icon: "/images/facilities/laundry.webp", title: "Free Laundry" },
53
+ { icon: "/images/facilities/laundry.webp", title: "Paid Laundry" },
54
+ { icon: "/images/facilities/internet.webp", title: "Wi-Fi" },
55
+ { icon: "/images/facilities/transport.webp", title: "Airport Pickup" },
56
+ { icon: "/images/facilities/transport.webp", title: "Local Transport" },
57
+ { icon: "/images/facilities/study.webp", title: "Study/Work Space" },
58
+ { icon: "/images/facilities/events.webp", title: "Free Events" },
59
+ { icon: "/images/facilities/events.webp", title: "Paid Events" },
60
+ { icon: "/images/facilities/fitness.webp", title: "Gym or Yoga" },
61
+ { icon: "/images/facilities/recreation.webp", title: "Recreational Activities" },
62
+ { icon: "/images/facilities/tours.webp", title: "Guided Tours" },
63
+ { icon: "/images/facilities/certificate.webp", title: "Certificate" },
64
+ ];
65
+ export const otherFacilitiesOptions = [
66
+ { icon: "/images/facilities/room.webp", title: "room" },
67
+ { icon: "/images/facilities/room.webp", title: "dorm" },
68
+ { icon: "/images/facilities/room.webp", title: "accomodation" },
69
+ { icon: "/images/facilities/meal.webp", title: "meal" },
70
+ { icon: "/images/facilities/meal.webp", title: "breakfast" },
71
+ { icon: "/images/facilities/meal.webp", title: "dinner" },
72
+ { icon: "/images/facilities/meal.webp", title: "food" },
73
+ { icon: "/images/facilities/meal.webp", title: "snack" },
74
+ { icon: "/images/facilities/meal.webp", title: "cook" },
75
+ { icon: "/images/facilities/laundry.webp", title: "laundry" },
76
+ { icon: "/images/facilities/internet.webp", title: "internet" },
77
+ { icon: "/images/facilities/transport.webp", title: "pickup" },
78
+ { icon: "/images/facilities/transport.webp", title: "transport" },
79
+ { icon: "/images/facilities/transport.webp", title: "vehicle" },
80
+ { icon: "/images/facilities/transport.webp", title: "bus" },
81
+ { icon: "/images/facilities/study.webp", title: "study" },
82
+ { icon: "/images/facilities/study.webp", title: "work" },
83
+ { icon: "/images/facilities/events.webp", title: "event" },
84
+ { icon: "/images/facilities/events.webp", title: "function" },
85
+ { icon: "/images/facilities/fitness.webp", title: "gym" },
86
+ { icon: "/images/facilities/fitness.webp", title: "yoga" },
87
+ { icon: "/images/facilities/fitness.webp", title: "fit" },
88
+ { icon: "/images/facilities/recreation.webp", title: "recreational" },
89
+ { icon: "/images/facilities/tours.webp", title: "guide" },
90
+ { icon: "/images/facilities/tours.webp", title: "tour" },
91
+ { icon: "/images/facilities/certificate.webp", title: "certificate" },
92
+ { icon: "/images/facilities/certificate.webp", title: "award" },
93
+ { icon: "/images/facilities/certificate.webp", title: "recognition" },
94
+ { icon: "/images/facilities/certificate.webp", title: "appreciation" },
95
+ { icon: "/images/facilities/certificate.webp", title: "letter" },
96
+ { icon: "/images/facilities/money.webp", title: "stipend" },
97
+ { icon: "/images/facilities/money.webp", title: "cash" },
98
+ { icon: "/images/facilities/money.webp", title: "payment" },
99
+ { icon: "/images/facilities/money.webp", title: "salary" },
100
+ { icon: "/images/facilities/money.webp", title: "compensation" },
101
+ { icon: "/images/facilities/money.webp", title: "pay" },
102
+ ];
103
+ // options for what volunteers offer
104
+ export const responsibilitiesOptions = [
105
+ { icon: "/images/responsibilities/timer.webp", title: "4 Hours/Day" },
106
+ { icon: "/images/responsibilities/timer.webp", title: "5 Hours/Day" },
107
+ { icon: "/images/responsibilities/timer.webp", title: "6 Hours/Day" },
108
+ { icon: "/images/responsibilities/timer.webp", title: "Flexible Schedule" },
109
+ { icon: "/images/responsibilities/teamwork.webp", title: "Team Work" },
110
+ { icon: "/images/responsibilities/initiative.webp", title: "Take Initiative" },
111
+ { icon: "/images/responsibilities/communication.webp", title: "Good Communication" },
112
+ { icon: "/images/responsibilities/adaptability.webp", title: "Stay Flexible" },
113
+ { icon: "/images/responsibilities/punctuality.webp", title: "Be On Time" },
114
+ { icon: "/images/responsibilities/punctuality.webp", title: "Punctuality" },
115
+ { icon: "/images/responsibilities/rules.webp", title: "Respect House Rules" },
116
+ { icon: "/images/responsibilities/learning.webp", title: "Willing to Learn" },
117
+ { icon: "/images/responsibilities/events.webp", title: "Support Events" },
118
+ { icon: "/images/responsibilities/cleanliness.webp", title: "Maintain cleanliness" },
119
+ { icon: "/images/responsibilities/mindset.webp", title: "Positive Attitude" },
120
+ { icon: "/images/responsibilities/ethics.webp", title: "Respect Culture" },
121
+ ];
122
+ export const otherResponsibilitiesOptions = [
123
+ { icon: "/images/responsibilities/timer.webp", title: "hour" },
124
+ { icon: "/images/responsibilities/timer.webp", title: "minute" },
125
+ { icon: "/images/responsibilities/timer.webp", title: "schedule" },
126
+ { icon: "/images/responsibilities/teamwork.webp", title: "team" },
127
+ { icon: "/images/responsibilities/teamwork.webp", title: "social" },
128
+ { icon: "/images/responsibilities/initiative.webp", title: "initiative" },
129
+ { icon: "/images/responsibilities/initiative.webp", title: "idea" },
130
+ { icon: "/images/responsibilities/communication.webp", title: "communication" },
131
+ { icon: "/images/responsibilities/communication.webp", title: "spoke" },
132
+ { icon: "/images/responsibilities/communication.webp", title: "speak" },
133
+ { icon: "/images/responsibilities/communication.webp", title: "talk" },
134
+ { icon: "/images/responsibilities/adaptability.webp", title: "flexible" },
135
+ { icon: "/images/responsibilities/punctuality.webp", title: "time" },
136
+ { icon: "/images/responsibilities/punctuality.webp", title: "punctual" },
137
+ { icon: "/images/responsibilities/rules.webp", title: "rule" },
138
+ { icon: "/images/responsibilities/learning.webp", title: "learn" },
139
+ { icon: "/images/responsibilities/learning.webp", title: "grow" },
140
+ { icon: "/images/responsibilities/events.webp", title: "event" },
141
+ { icon: "/images/responsibilities/cleanliness.webp", title: "clean" },
142
+ { icon: "/images/responsibilities/cleanliness.webp", title: "tidy" },
143
+ { icon: "/images/responsibilities/mindset.webp", title: "mind" },
144
+ { icon: "/images/responsibilities/mindset.webp", title: "brain" },
145
+ { icon: "/images/responsibilities/ethics.webp", title: "respect" },
146
+ { icon: "/images/responsibilities/ethics.webp", title: "culture" },
147
+ { icon: "/images/responsibilities/ethics.webp", title: "ethics" },
148
+ { icon: "/images/responsibilities/ethics.webp", title: "rules" },
149
+ ];
@@ -0,0 +1,3 @@
1
+ export declare function getCookieHeader(): Promise<string>;
2
+ export declare function getRole(): Promise<string | null>;
3
+ //# sourceMappingURL=severActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"severActions.d.ts","sourceRoot":"","sources":["../../src/lib/severActions.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAKvD;AAED,wBAAsB,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQtD"}
@@ -0,0 +1,19 @@
1
+ 'use server';
2
+ import { cookies } from 'next/headers';
3
+ import { validRoles } from './utils';
4
+ export async function getCookieHeader() {
5
+ const cookieStore = await cookies();
6
+ return Array.from(cookieStore)
7
+ .map(([name, cookie]) => `${name}=${cookie.value}`)
8
+ .join('; ');
9
+ }
10
+ export async function getRole() {
11
+ try {
12
+ const role = (await cookies()).get("role")?.value ?? null;
13
+ return (role && validRoles.includes(role)) ? role : null;
14
+ }
15
+ catch (err) {
16
+ console.error('Invalid token', err);
17
+ return null;
18
+ }
19
+ }