@zyacreatives/shared 2.2.78 → 2.2.80
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/schemas/user.d.ts +415 -128
- package/dist/schemas/user.js +70 -54
- package/dist/types/user.d.ts +15 -11
- package/package.json +1 -1
- package/src/schemas/user.ts +93 -60
- package/src/types/user.ts +81 -35
package/dist/schemas/user.d.ts
CHANGED
|
@@ -46,11 +46,6 @@ export declare const MinimalUserSchema: z.ZodObject<{
|
|
|
46
46
|
ADMIN: "ADMIN";
|
|
47
47
|
}>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
|
-
export declare const UserStatsEntitySchema: z.ZodObject<{
|
|
50
|
-
followerCount: z.ZodInt;
|
|
51
|
-
followingCount: z.ZodInt;
|
|
52
|
-
followingIds: z.ZodArray<z.ZodCUID2>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
49
|
export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
55
50
|
id: z.ZodCUID2;
|
|
56
51
|
email: z.ZodEmail;
|
|
@@ -223,6 +218,11 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
|
223
218
|
version: z.ZodInt;
|
|
224
219
|
}, z.core.$strip>;
|
|
225
220
|
}, z.core.$strip>;
|
|
221
|
+
export declare const UserStatsEntitySchema: z.ZodObject<{
|
|
222
|
+
followerCount: z.ZodInt;
|
|
223
|
+
followingCount: z.ZodInt;
|
|
224
|
+
followingIds: z.ZodArray<z.ZodCUID2>;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
226
|
export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
227
227
|
userId: z.ZodCUID2;
|
|
228
228
|
projects: z.ZodArray<z.ZodObject<{
|
|
@@ -287,35 +287,66 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
|
287
287
|
version: z.ZodNumber;
|
|
288
288
|
}, z.core.$strip>>;
|
|
289
289
|
}, z.core.$strip>;
|
|
290
|
-
export declare const
|
|
290
|
+
export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
291
291
|
userId: z.ZodCUID2;
|
|
292
|
-
|
|
292
|
+
posts: z.ZodArray<z.ZodObject<{
|
|
293
293
|
id: z.ZodCUID2;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
parentId: z.ZodCUID2;
|
|
297
|
-
parentType: z.ZodEnum<{
|
|
294
|
+
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
295
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
298
296
|
readonly PROJECT: "PROJECT";
|
|
299
297
|
readonly USER: "USER";
|
|
300
298
|
readonly JOB: "JOB";
|
|
301
299
|
readonly POST: "POST";
|
|
302
300
|
readonly COMMENT: "COMMENT";
|
|
303
301
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
302
|
+
}>>;
|
|
303
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
304
|
+
name: z.ZodString;
|
|
305
|
+
id: z.ZodInt;
|
|
306
|
+
}, z.core.$strip>>>;
|
|
307
|
+
badge: z.ZodOptional<z.ZodEnum<{
|
|
308
|
+
readonly NETWORKING: "Networking";
|
|
309
|
+
readonly FUNDING: "Funding";
|
|
310
|
+
readonly COLLABORATION: "Collaboration";
|
|
311
|
+
readonly OPPORTUNITIES: "Opportunities";
|
|
312
|
+
readonly SHOWCASE: "Showcase";
|
|
313
|
+
readonly LEARNING: "Learning";
|
|
314
|
+
readonly DISCUSSION: "Discussion";
|
|
315
|
+
readonly MENTORSHIP: "Mentorship";
|
|
316
|
+
}>>;
|
|
317
|
+
userId: z.ZodCUID2;
|
|
318
|
+
creatorUsername: z.ZodOptional<z.ZodString>;
|
|
319
|
+
creatorFullName: z.ZodOptional<z.ZodString>;
|
|
320
|
+
creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
|
|
321
|
+
content: z.ZodOptional<z.ZodString>;
|
|
322
|
+
postType: z.ZodEnum<{
|
|
323
|
+
readonly MARKETPLACE: "MARKETPLACE";
|
|
324
|
+
readonly PROJECT: "PROJECT";
|
|
325
|
+
readonly JOB_OPENING: "JOB_OPENING";
|
|
326
|
+
readonly DEFAULT_POST: "DEFAULT_POST";
|
|
327
|
+
readonly POST_WITH_LINKS: "POST_WITH_LINKS";
|
|
328
|
+
readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
|
|
329
|
+
readonly POST_WITH_MEDIA_AND_LINKS: "POST_WITH_MEDIA_AND_LINKS";
|
|
304
330
|
}>;
|
|
305
|
-
|
|
306
|
-
|
|
331
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
332
|
+
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
333
|
+
url: z.ZodURL;
|
|
334
|
+
title: z.ZodOptional<z.ZodString>;
|
|
307
335
|
description: z.ZodOptional<z.ZodString>;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
336
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
338
|
+
postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
339
|
+
id: z.ZodCUID2;
|
|
340
|
+
postId: z.ZodCUID2;
|
|
341
|
+
fileId: z.ZodCUID2;
|
|
342
|
+
order: z.ZodNumber;
|
|
343
|
+
url: z.ZodURL;
|
|
344
|
+
}, z.core.$strip>>>;
|
|
314
345
|
}, z.core.$strip>>;
|
|
315
346
|
}, z.core.$strip>;
|
|
316
|
-
export declare const
|
|
347
|
+
export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
317
348
|
userId: z.ZodCUID2;
|
|
318
|
-
|
|
349
|
+
projectLikes: z.ZodArray<z.ZodObject<{
|
|
319
350
|
id: z.ZodCUID2;
|
|
320
351
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
321
352
|
userId: z.ZodCUID2;
|
|
@@ -328,21 +359,20 @@ export declare const UserWithPostLikesEntitySchema: z.ZodObject<{
|
|
|
328
359
|
readonly COMMENT: "COMMENT";
|
|
329
360
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
330
361
|
}>;
|
|
331
|
-
|
|
362
|
+
project: z.ZodObject<{
|
|
332
363
|
id: z.ZodCUID2;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}, z.core.$strip>>>;
|
|
364
|
+
description: z.ZodOptional<z.ZodString>;
|
|
365
|
+
title: z.ZodString;
|
|
366
|
+
imagePlaceholderUrl: z.ZodURL;
|
|
367
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
368
|
+
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
369
|
+
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
340
370
|
}, z.core.$strip>;
|
|
341
371
|
}, z.core.$strip>>;
|
|
342
372
|
}, z.core.$strip>;
|
|
343
|
-
export declare const
|
|
373
|
+
export declare const UserWithPostLikesEntitySchema: z.ZodObject<{
|
|
344
374
|
userId: z.ZodCUID2;
|
|
345
|
-
|
|
375
|
+
postLikes: z.ZodArray<z.ZodObject<{
|
|
346
376
|
id: z.ZodCUID2;
|
|
347
377
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
348
378
|
userId: z.ZodCUID2;
|
|
@@ -474,23 +504,285 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
474
504
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
475
505
|
}>;
|
|
476
506
|
project: z.ZodObject<{
|
|
477
|
-
id: z.
|
|
478
|
-
|
|
507
|
+
id: z.ZodString;
|
|
508
|
+
userId: z.ZodString;
|
|
479
509
|
title: z.ZodString;
|
|
480
510
|
imagePlaceholderUrl: z.ZodURL;
|
|
511
|
+
projectCreatorType: z.ZodEnum<{
|
|
512
|
+
readonly CREATIVE: "CREATIVE";
|
|
513
|
+
readonly BRAND: "BRAND";
|
|
514
|
+
readonly INVESTOR: "INVESTOR";
|
|
515
|
+
readonly ADMIN: "ADMIN";
|
|
516
|
+
}>;
|
|
517
|
+
createdAt: z.ZodNumber;
|
|
518
|
+
updatedAt: z.ZodNumber;
|
|
519
|
+
description: z.ZodOptional<z.ZodString>;
|
|
520
|
+
capitalLookingToRaise: z.ZodOptional<z.ZodString>;
|
|
521
|
+
capitalLookingToRaiseCurrency: z.ZodOptional<z.ZodEnum<{
|
|
522
|
+
readonly USD: "USD (United States Dollar)";
|
|
523
|
+
readonly EUR: "EUR (Euro)";
|
|
524
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
525
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
526
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
527
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
528
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
529
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
530
|
+
readonly INR: "INR (Indian Rupee)";
|
|
531
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
532
|
+
}>>;
|
|
533
|
+
ventureStage: z.ZodOptional<z.ZodEnum<{
|
|
534
|
+
readonly IDEA: "Idea";
|
|
535
|
+
readonly PRE_SEED: "Pre Seed";
|
|
536
|
+
readonly MVP: "MVP";
|
|
537
|
+
readonly SEED: "Seed";
|
|
538
|
+
readonly SERIES_A: "Series A";
|
|
539
|
+
readonly SERIES_B: "Series B";
|
|
540
|
+
readonly SERIES_C: "Series C";
|
|
541
|
+
readonly GROWTH: "Growth";
|
|
542
|
+
readonly EXIT: "Exit";
|
|
543
|
+
}>>;
|
|
544
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
481
545
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
482
|
-
|
|
483
|
-
|
|
546
|
+
creatorUsername: z.ZodString;
|
|
547
|
+
creatorImageUrl: z.ZodString;
|
|
548
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
549
|
+
clientType: z.ZodOptional<z.ZodEnum<{
|
|
550
|
+
readonly CREATIVE: "CREATIVE";
|
|
551
|
+
readonly BRAND: "BRAND";
|
|
552
|
+
readonly NONE: "NONE";
|
|
553
|
+
}>>;
|
|
554
|
+
clientName: z.ZodOptional<z.ZodString>;
|
|
555
|
+
isFeatured: z.ZodOptional<z.ZodBoolean>;
|
|
556
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
557
|
+
endDate: z.ZodOptional<z.ZodNumber>;
|
|
484
558
|
}, z.core.$strip>;
|
|
485
559
|
}, z.core.$strip>>;
|
|
486
560
|
}, z.core.$strip>;
|
|
487
|
-
export declare const
|
|
488
|
-
|
|
489
|
-
|
|
561
|
+
export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
562
|
+
userId: z.ZodCUID2;
|
|
563
|
+
postBookmarks: z.ZodArray<z.ZodObject<{
|
|
564
|
+
id: z.ZodCUID2;
|
|
565
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
566
|
+
userId: z.ZodCUID2;
|
|
567
|
+
parentId: z.ZodCUID2;
|
|
568
|
+
parentType: z.ZodEnum<{
|
|
569
|
+
readonly PROJECT: "PROJECT";
|
|
570
|
+
readonly USER: "USER";
|
|
571
|
+
readonly JOB: "JOB";
|
|
572
|
+
readonly POST: "POST";
|
|
573
|
+
readonly COMMENT: "COMMENT";
|
|
574
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
575
|
+
}>;
|
|
576
|
+
post: z.ZodObject<{
|
|
577
|
+
id: z.ZodCUID2;
|
|
578
|
+
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
579
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
580
|
+
readonly PROJECT: "PROJECT";
|
|
581
|
+
readonly USER: "USER";
|
|
582
|
+
readonly JOB: "JOB";
|
|
583
|
+
readonly POST: "POST";
|
|
584
|
+
readonly COMMENT: "COMMENT";
|
|
585
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
586
|
+
}>>;
|
|
587
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
588
|
+
name: z.ZodString;
|
|
589
|
+
id: z.ZodInt;
|
|
590
|
+
}, z.core.$strip>>>;
|
|
591
|
+
badge: z.ZodOptional<z.ZodEnum<{
|
|
592
|
+
readonly NETWORKING: "Networking";
|
|
593
|
+
readonly FUNDING: "Funding";
|
|
594
|
+
readonly COLLABORATION: "Collaboration";
|
|
595
|
+
readonly OPPORTUNITIES: "Opportunities";
|
|
596
|
+
readonly SHOWCASE: "Showcase";
|
|
597
|
+
readonly LEARNING: "Learning";
|
|
598
|
+
readonly DISCUSSION: "Discussion";
|
|
599
|
+
readonly MENTORSHIP: "Mentorship";
|
|
600
|
+
}>>;
|
|
601
|
+
userId: z.ZodCUID2;
|
|
602
|
+
creatorUsername: z.ZodOptional<z.ZodString>;
|
|
603
|
+
creatorFullName: z.ZodOptional<z.ZodString>;
|
|
604
|
+
creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
|
|
605
|
+
content: z.ZodOptional<z.ZodString>;
|
|
606
|
+
postType: z.ZodEnum<{
|
|
607
|
+
readonly MARKETPLACE: "MARKETPLACE";
|
|
608
|
+
readonly PROJECT: "PROJECT";
|
|
609
|
+
readonly JOB_OPENING: "JOB_OPENING";
|
|
610
|
+
readonly DEFAULT_POST: "DEFAULT_POST";
|
|
611
|
+
readonly POST_WITH_LINKS: "POST_WITH_LINKS";
|
|
612
|
+
readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
|
|
613
|
+
readonly POST_WITH_MEDIA_AND_LINKS: "POST_WITH_MEDIA_AND_LINKS";
|
|
614
|
+
}>;
|
|
615
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
616
|
+
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
617
|
+
url: z.ZodURL;
|
|
618
|
+
title: z.ZodOptional<z.ZodString>;
|
|
619
|
+
description: z.ZodOptional<z.ZodString>;
|
|
620
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
621
|
+
}, z.core.$strip>>;
|
|
622
|
+
postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
623
|
+
id: z.ZodCUID2;
|
|
624
|
+
postId: z.ZodCUID2;
|
|
625
|
+
fileId: z.ZodCUID2;
|
|
626
|
+
order: z.ZodNumber;
|
|
627
|
+
url: z.ZodURL;
|
|
628
|
+
}, z.core.$strip>>>;
|
|
629
|
+
}, z.core.$strip>;
|
|
630
|
+
}, z.core.$strip>>;
|
|
490
631
|
}, z.core.$strip>;
|
|
491
|
-
export declare const
|
|
492
|
-
|
|
493
|
-
|
|
632
|
+
export declare const GetUserWithProjectBookmarksInputSchema: z.ZodObject<{
|
|
633
|
+
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
634
|
+
limit: z.ZodNullable<z.ZodOptional<z.ZodInt>>;
|
|
635
|
+
}, z.core.$strip>;
|
|
636
|
+
export declare const GetUserWithPostBookmarksInputSchema: z.ZodObject<{
|
|
637
|
+
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
638
|
+
limit: z.ZodNullable<z.ZodOptional<z.ZodInt>>;
|
|
639
|
+
}, z.core.$strip>;
|
|
640
|
+
export declare const GetUserWithProjectBookmarksOutputSchema: z.ZodObject<{
|
|
641
|
+
bookmarks: z.ZodObject<{
|
|
642
|
+
userId: z.ZodCUID2;
|
|
643
|
+
projectBookmarks: z.ZodArray<z.ZodObject<{
|
|
644
|
+
id: z.ZodCUID2;
|
|
645
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
646
|
+
userId: z.ZodCUID2;
|
|
647
|
+
parentId: z.ZodCUID2;
|
|
648
|
+
parentType: z.ZodEnum<{
|
|
649
|
+
readonly PROJECT: "PROJECT";
|
|
650
|
+
readonly USER: "USER";
|
|
651
|
+
readonly JOB: "JOB";
|
|
652
|
+
readonly POST: "POST";
|
|
653
|
+
readonly COMMENT: "COMMENT";
|
|
654
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
655
|
+
}>;
|
|
656
|
+
project: z.ZodObject<{
|
|
657
|
+
id: z.ZodString;
|
|
658
|
+
userId: z.ZodString;
|
|
659
|
+
title: z.ZodString;
|
|
660
|
+
imagePlaceholderUrl: z.ZodURL;
|
|
661
|
+
projectCreatorType: z.ZodEnum<{
|
|
662
|
+
readonly CREATIVE: "CREATIVE";
|
|
663
|
+
readonly BRAND: "BRAND";
|
|
664
|
+
readonly INVESTOR: "INVESTOR";
|
|
665
|
+
readonly ADMIN: "ADMIN";
|
|
666
|
+
}>;
|
|
667
|
+
createdAt: z.ZodNumber;
|
|
668
|
+
updatedAt: z.ZodNumber;
|
|
669
|
+
description: z.ZodOptional<z.ZodString>;
|
|
670
|
+
capitalLookingToRaise: z.ZodOptional<z.ZodString>;
|
|
671
|
+
capitalLookingToRaiseCurrency: z.ZodOptional<z.ZodEnum<{
|
|
672
|
+
readonly USD: "USD (United States Dollar)";
|
|
673
|
+
readonly EUR: "EUR (Euro)";
|
|
674
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
675
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
676
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
677
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
678
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
679
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
680
|
+
readonly INR: "INR (Indian Rupee)";
|
|
681
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
682
|
+
}>>;
|
|
683
|
+
ventureStage: z.ZodOptional<z.ZodEnum<{
|
|
684
|
+
readonly IDEA: "Idea";
|
|
685
|
+
readonly PRE_SEED: "Pre Seed";
|
|
686
|
+
readonly MVP: "MVP";
|
|
687
|
+
readonly SEED: "Seed";
|
|
688
|
+
readonly SERIES_A: "Series A";
|
|
689
|
+
readonly SERIES_B: "Series B";
|
|
690
|
+
readonly SERIES_C: "Series C";
|
|
691
|
+
readonly GROWTH: "Growth";
|
|
692
|
+
readonly EXIT: "Exit";
|
|
693
|
+
}>>;
|
|
694
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
695
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
696
|
+
creatorUsername: z.ZodString;
|
|
697
|
+
creatorImageUrl: z.ZodString;
|
|
698
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
699
|
+
clientType: z.ZodOptional<z.ZodEnum<{
|
|
700
|
+
readonly CREATIVE: "CREATIVE";
|
|
701
|
+
readonly BRAND: "BRAND";
|
|
702
|
+
readonly NONE: "NONE";
|
|
703
|
+
}>>;
|
|
704
|
+
clientName: z.ZodOptional<z.ZodString>;
|
|
705
|
+
isFeatured: z.ZodOptional<z.ZodBoolean>;
|
|
706
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
707
|
+
endDate: z.ZodOptional<z.ZodNumber>;
|
|
708
|
+
}, z.core.$strip>;
|
|
709
|
+
}, z.core.$strip>>;
|
|
710
|
+
}, z.core.$strip>;
|
|
711
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
712
|
+
}, z.core.$strip>;
|
|
713
|
+
export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
714
|
+
bookmarks: z.ZodObject<{
|
|
715
|
+
userId: z.ZodCUID2;
|
|
716
|
+
postBookmarks: z.ZodArray<z.ZodObject<{
|
|
717
|
+
id: z.ZodCUID2;
|
|
718
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
719
|
+
userId: z.ZodCUID2;
|
|
720
|
+
parentId: z.ZodCUID2;
|
|
721
|
+
parentType: z.ZodEnum<{
|
|
722
|
+
readonly PROJECT: "PROJECT";
|
|
723
|
+
readonly USER: "USER";
|
|
724
|
+
readonly JOB: "JOB";
|
|
725
|
+
readonly POST: "POST";
|
|
726
|
+
readonly COMMENT: "COMMENT";
|
|
727
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
728
|
+
}>;
|
|
729
|
+
post: z.ZodObject<{
|
|
730
|
+
id: z.ZodCUID2;
|
|
731
|
+
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
732
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
733
|
+
readonly PROJECT: "PROJECT";
|
|
734
|
+
readonly USER: "USER";
|
|
735
|
+
readonly JOB: "JOB";
|
|
736
|
+
readonly POST: "POST";
|
|
737
|
+
readonly COMMENT: "COMMENT";
|
|
738
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
739
|
+
}>>;
|
|
740
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
741
|
+
name: z.ZodString;
|
|
742
|
+
id: z.ZodInt;
|
|
743
|
+
}, z.core.$strip>>>;
|
|
744
|
+
badge: z.ZodOptional<z.ZodEnum<{
|
|
745
|
+
readonly NETWORKING: "Networking";
|
|
746
|
+
readonly FUNDING: "Funding";
|
|
747
|
+
readonly COLLABORATION: "Collaboration";
|
|
748
|
+
readonly OPPORTUNITIES: "Opportunities";
|
|
749
|
+
readonly SHOWCASE: "Showcase";
|
|
750
|
+
readonly LEARNING: "Learning";
|
|
751
|
+
readonly DISCUSSION: "Discussion";
|
|
752
|
+
readonly MENTORSHIP: "Mentorship";
|
|
753
|
+
}>>;
|
|
754
|
+
userId: z.ZodCUID2;
|
|
755
|
+
creatorUsername: z.ZodOptional<z.ZodString>;
|
|
756
|
+
creatorFullName: z.ZodOptional<z.ZodString>;
|
|
757
|
+
creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
|
|
758
|
+
content: z.ZodOptional<z.ZodString>;
|
|
759
|
+
postType: z.ZodEnum<{
|
|
760
|
+
readonly MARKETPLACE: "MARKETPLACE";
|
|
761
|
+
readonly PROJECT: "PROJECT";
|
|
762
|
+
readonly JOB_OPENING: "JOB_OPENING";
|
|
763
|
+
readonly DEFAULT_POST: "DEFAULT_POST";
|
|
764
|
+
readonly POST_WITH_LINKS: "POST_WITH_LINKS";
|
|
765
|
+
readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
|
|
766
|
+
readonly POST_WITH_MEDIA_AND_LINKS: "POST_WITH_MEDIA_AND_LINKS";
|
|
767
|
+
}>;
|
|
768
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
769
|
+
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
770
|
+
url: z.ZodURL;
|
|
771
|
+
title: z.ZodOptional<z.ZodString>;
|
|
772
|
+
description: z.ZodOptional<z.ZodString>;
|
|
773
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
774
|
+
}, z.core.$strip>>;
|
|
775
|
+
postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
776
|
+
id: z.ZodCUID2;
|
|
777
|
+
postId: z.ZodCUID2;
|
|
778
|
+
fileId: z.ZodCUID2;
|
|
779
|
+
order: z.ZodNumber;
|
|
780
|
+
url: z.ZodURL;
|
|
781
|
+
}, z.core.$strip>>>;
|
|
782
|
+
}, z.core.$strip>;
|
|
783
|
+
}, z.core.$strip>>;
|
|
784
|
+
}, z.core.$strip>;
|
|
785
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
494
786
|
}, z.core.$strip>;
|
|
495
787
|
export declare const UserWithFollowingEntitySchema: z.ZodObject<{
|
|
496
788
|
email: z.ZodEmail;
|
|
@@ -548,9 +840,17 @@ export declare const UserWithFollowersEntitySchema: z.ZodObject<{
|
|
|
548
840
|
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
549
841
|
}, z.core.$strip>>;
|
|
550
842
|
}, z.core.$strip>;
|
|
551
|
-
export declare const
|
|
843
|
+
export declare const GetUserFollowingInputSchema: z.ZodObject<{
|
|
844
|
+
searchQuery: z.ZodOptional<z.ZodString>;
|
|
845
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
846
|
+
}, z.core.$strip>;
|
|
847
|
+
export declare const GetUserFollowersInputSchema: z.ZodObject<{
|
|
848
|
+
searchQuery: z.ZodOptional<z.ZodString>;
|
|
849
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
850
|
+
}, z.core.$strip>;
|
|
851
|
+
export declare const GetUserFollowingOutputSchema: z.ZodObject<{
|
|
552
852
|
nextCursor: z.ZodString;
|
|
553
|
-
|
|
853
|
+
following: z.ZodArray<z.ZodObject<{
|
|
554
854
|
email: z.ZodEmail;
|
|
555
855
|
username: z.ZodOptional<z.ZodString>;
|
|
556
856
|
id: z.ZodCUID2;
|
|
@@ -566,9 +866,9 @@ export declare const GetUserFollowersOutputSchema: z.ZodObject<{
|
|
|
566
866
|
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
567
867
|
}, z.core.$strip>>;
|
|
568
868
|
}, z.core.$strip>;
|
|
569
|
-
export declare const
|
|
869
|
+
export declare const GetUserFollowersOutputSchema: z.ZodObject<{
|
|
570
870
|
nextCursor: z.ZodString;
|
|
571
|
-
|
|
871
|
+
followers: z.ZodArray<z.ZodObject<{
|
|
572
872
|
email: z.ZodEmail;
|
|
573
873
|
username: z.ZodOptional<z.ZodString>;
|
|
574
874
|
id: z.ZodCUID2;
|
|
@@ -584,63 +884,6 @@ export declare const GetUserFollowingOutputSchema: z.ZodObject<{
|
|
|
584
884
|
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
585
885
|
}, z.core.$strip>>;
|
|
586
886
|
}, z.core.$strip>;
|
|
587
|
-
export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
588
|
-
userId: z.ZodCUID2;
|
|
589
|
-
posts: z.ZodArray<z.ZodObject<{
|
|
590
|
-
id: z.ZodCUID2;
|
|
591
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
592
|
-
parentType: z.ZodDefault<z.ZodEnum<{
|
|
593
|
-
readonly PROJECT: "PROJECT";
|
|
594
|
-
readonly USER: "USER";
|
|
595
|
-
readonly JOB: "JOB";
|
|
596
|
-
readonly POST: "POST";
|
|
597
|
-
readonly COMMENT: "COMMENT";
|
|
598
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
599
|
-
}>>;
|
|
600
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
601
|
-
name: z.ZodString;
|
|
602
|
-
id: z.ZodInt;
|
|
603
|
-
}, z.core.$strip>>>;
|
|
604
|
-
badge: z.ZodOptional<z.ZodEnum<{
|
|
605
|
-
readonly NETWORKING: "Networking";
|
|
606
|
-
readonly FUNDING: "Funding";
|
|
607
|
-
readonly COLLABORATION: "Collaboration";
|
|
608
|
-
readonly OPPORTUNITIES: "Opportunities";
|
|
609
|
-
readonly SHOWCASE: "Showcase";
|
|
610
|
-
readonly LEARNING: "Learning";
|
|
611
|
-
readonly DISCUSSION: "Discussion";
|
|
612
|
-
readonly MENTORSHIP: "Mentorship";
|
|
613
|
-
}>>;
|
|
614
|
-
userId: z.ZodCUID2;
|
|
615
|
-
creatorUsername: z.ZodOptional<z.ZodString>;
|
|
616
|
-
creatorFullName: z.ZodOptional<z.ZodString>;
|
|
617
|
-
creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
|
|
618
|
-
content: z.ZodOptional<z.ZodString>;
|
|
619
|
-
postType: z.ZodEnum<{
|
|
620
|
-
readonly MARKETPLACE: "MARKETPLACE";
|
|
621
|
-
readonly PROJECT: "PROJECT";
|
|
622
|
-
readonly JOB_OPENING: "JOB_OPENING";
|
|
623
|
-
readonly DEFAULT_POST: "DEFAULT_POST";
|
|
624
|
-
readonly POST_WITH_LINKS: "POST_WITH_LINKS";
|
|
625
|
-
readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
|
|
626
|
-
readonly POST_WITH_MEDIA_AND_LINKS: "POST_WITH_MEDIA_AND_LINKS";
|
|
627
|
-
}>;
|
|
628
|
-
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
629
|
-
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
630
|
-
url: z.ZodURL;
|
|
631
|
-
title: z.ZodOptional<z.ZodString>;
|
|
632
|
-
description: z.ZodOptional<z.ZodString>;
|
|
633
|
-
image: z.ZodOptional<z.ZodURL>;
|
|
634
|
-
}, z.core.$strip>>;
|
|
635
|
-
postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
636
|
-
id: z.ZodCUID2;
|
|
637
|
-
postId: z.ZodCUID2;
|
|
638
|
-
fileId: z.ZodCUID2;
|
|
639
|
-
order: z.ZodNumber;
|
|
640
|
-
url: z.ZodURL;
|
|
641
|
-
}, z.core.$strip>>>;
|
|
642
|
-
}, z.core.$strip>>;
|
|
643
|
-
}, z.core.$strip>;
|
|
644
887
|
export declare const GetAuthenticatedUserOutputSchema: z.ZodObject<{
|
|
645
888
|
id: z.ZodCUID2;
|
|
646
889
|
email: z.ZodEmail;
|
|
@@ -914,6 +1157,76 @@ export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
|
|
|
914
1157
|
export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.ZodObject<{
|
|
915
1158
|
userId: z.ZodCUID2;
|
|
916
1159
|
projectBookmarks: z.ZodArray<z.ZodObject<{
|
|
1160
|
+
id: z.ZodCUID2;
|
|
1161
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
1162
|
+
userId: z.ZodCUID2;
|
|
1163
|
+
parentId: z.ZodCUID2;
|
|
1164
|
+
parentType: z.ZodEnum<{
|
|
1165
|
+
readonly PROJECT: "PROJECT";
|
|
1166
|
+
readonly USER: "USER";
|
|
1167
|
+
readonly JOB: "JOB";
|
|
1168
|
+
readonly POST: "POST";
|
|
1169
|
+
readonly COMMENT: "COMMENT";
|
|
1170
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
1171
|
+
}>;
|
|
1172
|
+
project: z.ZodObject<{
|
|
1173
|
+
id: z.ZodString;
|
|
1174
|
+
userId: z.ZodString;
|
|
1175
|
+
title: z.ZodString;
|
|
1176
|
+
imagePlaceholderUrl: z.ZodURL;
|
|
1177
|
+
projectCreatorType: z.ZodEnum<{
|
|
1178
|
+
readonly CREATIVE: "CREATIVE";
|
|
1179
|
+
readonly BRAND: "BRAND";
|
|
1180
|
+
readonly INVESTOR: "INVESTOR";
|
|
1181
|
+
readonly ADMIN: "ADMIN";
|
|
1182
|
+
}>;
|
|
1183
|
+
createdAt: z.ZodNumber;
|
|
1184
|
+
updatedAt: z.ZodNumber;
|
|
1185
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1186
|
+
capitalLookingToRaise: z.ZodOptional<z.ZodString>;
|
|
1187
|
+
capitalLookingToRaiseCurrency: z.ZodOptional<z.ZodEnum<{
|
|
1188
|
+
readonly USD: "USD (United States Dollar)";
|
|
1189
|
+
readonly EUR: "EUR (Euro)";
|
|
1190
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
1191
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
1192
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
1193
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
1194
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
1195
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
1196
|
+
readonly INR: "INR (Indian Rupee)";
|
|
1197
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
1198
|
+
}>>;
|
|
1199
|
+
ventureStage: z.ZodOptional<z.ZodEnum<{
|
|
1200
|
+
readonly IDEA: "Idea";
|
|
1201
|
+
readonly PRE_SEED: "Pre Seed";
|
|
1202
|
+
readonly MVP: "MVP";
|
|
1203
|
+
readonly SEED: "Seed";
|
|
1204
|
+
readonly SERIES_A: "Series A";
|
|
1205
|
+
readonly SERIES_B: "Series B";
|
|
1206
|
+
readonly SERIES_C: "Series C";
|
|
1207
|
+
readonly GROWTH: "Growth";
|
|
1208
|
+
readonly EXIT: "Exit";
|
|
1209
|
+
}>>;
|
|
1210
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1211
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1212
|
+
creatorUsername: z.ZodString;
|
|
1213
|
+
creatorImageUrl: z.ZodString;
|
|
1214
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
1215
|
+
clientType: z.ZodOptional<z.ZodEnum<{
|
|
1216
|
+
readonly CREATIVE: "CREATIVE";
|
|
1217
|
+
readonly BRAND: "BRAND";
|
|
1218
|
+
readonly NONE: "NONE";
|
|
1219
|
+
}>>;
|
|
1220
|
+
clientName: z.ZodOptional<z.ZodString>;
|
|
1221
|
+
isFeatured: z.ZodOptional<z.ZodBoolean>;
|
|
1222
|
+
startDate: z.ZodOptional<z.ZodNumber>;
|
|
1223
|
+
endDate: z.ZodOptional<z.ZodNumber>;
|
|
1224
|
+
}, z.core.$strip>;
|
|
1225
|
+
}, z.core.$strip>>;
|
|
1226
|
+
}, z.core.$strip>;
|
|
1227
|
+
export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObject<{
|
|
1228
|
+
userId: z.ZodCUID2;
|
|
1229
|
+
projectLikes: z.ZodArray<z.ZodObject<{
|
|
917
1230
|
id: z.ZodCUID2;
|
|
918
1231
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
919
1232
|
userId: z.ZodCUID2;
|
|
@@ -993,32 +1306,6 @@ export declare const GetAuthenticatedUserWithUserFollowersOutputSchema: z.ZodObj
|
|
|
993
1306
|
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
994
1307
|
}, z.core.$strip>>;
|
|
995
1308
|
}, z.core.$strip>;
|
|
996
|
-
export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObject<{
|
|
997
|
-
userId: z.ZodCUID2;
|
|
998
|
-
projectLikes: z.ZodArray<z.ZodObject<{
|
|
999
|
-
id: z.ZodCUID2;
|
|
1000
|
-
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
1001
|
-
userId: z.ZodCUID2;
|
|
1002
|
-
parentId: z.ZodCUID2;
|
|
1003
|
-
parentType: z.ZodEnum<{
|
|
1004
|
-
readonly PROJECT: "PROJECT";
|
|
1005
|
-
readonly USER: "USER";
|
|
1006
|
-
readonly JOB: "JOB";
|
|
1007
|
-
readonly POST: "POST";
|
|
1008
|
-
readonly COMMENT: "COMMENT";
|
|
1009
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
1010
|
-
}>;
|
|
1011
|
-
project: z.ZodObject<{
|
|
1012
|
-
id: z.ZodCUID2;
|
|
1013
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1014
|
-
title: z.ZodString;
|
|
1015
|
-
imagePlaceholderUrl: z.ZodURL;
|
|
1016
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1017
|
-
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
1018
|
-
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
1019
|
-
}, z.core.$strip>;
|
|
1020
|
-
}, z.core.$strip>>;
|
|
1021
|
-
}, z.core.$strip>;
|
|
1022
1309
|
export declare const GetUserActivityInputSchema: z.ZodObject<{
|
|
1023
1310
|
activityType: z.ZodEnum<{
|
|
1024
1311
|
LIKE: "LIKE";
|
package/dist/schemas/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserSearchDocumentSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.
|
|
3
|
+
exports.UserSearchDocumentSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.GetAuthenticatedUserProfileOutputSchema = exports.GetAuthenticatedUserOutputSchema = exports.GetUserFollowersOutputSchema = exports.GetUserFollowingOutputSchema = exports.GetUserFollowersInputSchema = exports.GetUserFollowingInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.GetUserWithPostBookmarksOutputSchema = exports.GetUserWithProjectBookmarksOutputSchema = exports.GetUserWithPostBookmarksInputSchema = exports.GetUserWithProjectBookmarksInputSchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithJobBookmarksOutputSchema = exports.UserWithJobBookmarksInputSchema = exports.UserWithJobBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithPostsEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserStatsEntitySchema = exports.UserProfileEntitySchema = exports.MinimalUserSchema = exports.UserEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const project_1 = require("./project");
|
|
@@ -11,6 +11,9 @@ const creative_1 = require("./creative");
|
|
|
11
11
|
const investor_1 = require("./investor");
|
|
12
12
|
const post_1 = require("./post");
|
|
13
13
|
const job_1 = require("./job");
|
|
14
|
+
// ==========================================
|
|
15
|
+
// 1. CORE USER ENTITIES
|
|
16
|
+
// ==========================================
|
|
14
17
|
exports.UserEntitySchema = zod_openapi_1.z
|
|
15
18
|
.object({
|
|
16
19
|
id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -49,13 +52,6 @@ exports.MinimalUserSchema = exports.UserEntitySchema.pick({
|
|
|
49
52
|
username: true,
|
|
50
53
|
role: true,
|
|
51
54
|
}).openapi("MinimalUser");
|
|
52
|
-
exports.UserStatsEntitySchema = zod_openapi_1.z.object({
|
|
53
|
-
followerCount: zod_openapi_1.z.int().openapi({ example: 1540 }),
|
|
54
|
-
followingCount: zod_openapi_1.z.int().openapi({ example: 234 }),
|
|
55
|
-
followingIds: zod_openapi_1.z
|
|
56
|
-
.array(zod_openapi_1.z.cuid2())
|
|
57
|
-
.openapi({ example: ["cksd0v6q0000s9a5y8z7p3x9", "clm1a2b3c0000abc"] }),
|
|
58
|
-
});
|
|
59
55
|
exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
|
|
60
56
|
profileType: zod_openapi_1.z
|
|
61
57
|
.enum(["creative", "brand", "investor"])
|
|
@@ -65,6 +61,16 @@ exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
|
|
|
65
61
|
creative: creative_1.CreativeEntitySchema,
|
|
66
62
|
investor: investor_1.InvestorEntitySchema,
|
|
67
63
|
}).openapi("UserProfileEntity");
|
|
64
|
+
exports.UserStatsEntitySchema = zod_openapi_1.z.object({
|
|
65
|
+
followerCount: zod_openapi_1.z.int().openapi({ example: 1540 }),
|
|
66
|
+
followingCount: zod_openapi_1.z.int().openapi({ example: 234 }),
|
|
67
|
+
followingIds: zod_openapi_1.z
|
|
68
|
+
.array(zod_openapi_1.z.cuid2())
|
|
69
|
+
.openapi({ example: ["cksd0v6q0000s9a5y8z7p3x9", "clm1a2b3c0000abc"] }),
|
|
70
|
+
});
|
|
71
|
+
// ==========================================
|
|
72
|
+
// 2. CONTENT ASSOCIATIONS (Projects, Posts)
|
|
73
|
+
// ==========================================
|
|
68
74
|
exports.UserWithProjectsEntitySchema = zod_openapi_1.z
|
|
69
75
|
.object({
|
|
70
76
|
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -73,6 +79,15 @@ exports.UserWithProjectsEntitySchema = zod_openapi_1.z
|
|
|
73
79
|
.openapi({ example: [] }),
|
|
74
80
|
})
|
|
75
81
|
.openapi("UserWithProjectsEntity");
|
|
82
|
+
exports.UserWithPostsEntitySchema = zod_openapi_1.z
|
|
83
|
+
.object({
|
|
84
|
+
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
85
|
+
posts: zod_openapi_1.z.array(post_1.PostWithFilesEntitySchema).openapi({ example: [] }),
|
|
86
|
+
})
|
|
87
|
+
.openapi("UserWithPostsEntity");
|
|
88
|
+
// ==========================================
|
|
89
|
+
// 3. LIKES
|
|
90
|
+
// ==========================================
|
|
76
91
|
exports.UserWithProjectLikesEntitySchema = zod_openapi_1.z.object({
|
|
77
92
|
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
78
93
|
projectLikes: zod_openapi_1.z
|
|
@@ -93,22 +108,6 @@ exports.UserWithPostLikesEntitySchema = zod_openapi_1.z.object({
|
|
|
93
108
|
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
94
109
|
postLikes: zod_openapi_1.z
|
|
95
110
|
.array(like_1.LikeEntitySchema.extend({
|
|
96
|
-
post: post_1.PostEntitySchema.pick({
|
|
97
|
-
id: true,
|
|
98
|
-
parentId: true,
|
|
99
|
-
title: true, // Note: Make sure 'title' exists on PostEntitySchema in your post.ts!
|
|
100
|
-
content: true,
|
|
101
|
-
tags: true,
|
|
102
|
-
createdAt: true,
|
|
103
|
-
updatedAt: true, // Note: Make sure 'updatedAt' exists on PostEntitySchema as well!
|
|
104
|
-
}),
|
|
105
|
-
}))
|
|
106
|
-
.openapi({ example: [] }),
|
|
107
|
-
});
|
|
108
|
-
exports.UserWithPostBookmarksEntitySchema = zod_openapi_1.z.object({
|
|
109
|
-
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
110
|
-
postBookmarks: zod_openapi_1.z
|
|
111
|
-
.array(bookmark_1.BookmarkEntitySchema.extend({
|
|
112
111
|
post: post_1.PostEntitySchema.pick({
|
|
113
112
|
id: true,
|
|
114
113
|
parentId: true,
|
|
@@ -121,6 +120,9 @@ exports.UserWithPostBookmarksEntitySchema = zod_openapi_1.z.object({
|
|
|
121
120
|
}))
|
|
122
121
|
.openapi({ example: [] }),
|
|
123
122
|
});
|
|
123
|
+
// ==========================================
|
|
124
|
+
// 4. BOOKMARKS
|
|
125
|
+
// ==========================================
|
|
124
126
|
exports.UserWithJobBookmarksEntitySchema = zod_openapi_1.z.object({
|
|
125
127
|
userId: zod_openapi_1.z.cuid2().openapi({ example: "afoaifaofi" }),
|
|
126
128
|
jobBookmarks: zod_openapi_1.z
|
|
@@ -144,27 +146,30 @@ exports.UserWithProjectBookmarksEntitySchema = zod_openapi_1.z
|
|
|
144
146
|
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
145
147
|
projectBookmarks: zod_openapi_1.z
|
|
146
148
|
.array(bookmark_1.BookmarkEntitySchema.extend({
|
|
147
|
-
project: project_1.
|
|
148
|
-
id: true,
|
|
149
|
-
title: true,
|
|
150
|
-
description: true,
|
|
151
|
-
tags: true,
|
|
152
|
-
startDate: true,
|
|
153
|
-
endDate: true,
|
|
154
|
-
imagePlaceholderUrl: true,
|
|
155
|
-
}),
|
|
149
|
+
project: project_1.ProjectSearchDocumentSchema,
|
|
156
150
|
}))
|
|
157
151
|
.openapi({ example: [] }),
|
|
158
152
|
})
|
|
159
153
|
.openapi("UserWithProjectBookmarksEntity");
|
|
160
|
-
exports.
|
|
161
|
-
|
|
162
|
-
|
|
154
|
+
exports.UserWithPostBookmarksEntitySchema = zod_openapi_1.z.object({
|
|
155
|
+
userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
156
|
+
postBookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
|
|
157
|
+
post: post_1.PostWithFilesEntitySchema,
|
|
158
|
+
})),
|
|
163
159
|
});
|
|
164
|
-
exports.
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
exports.GetUserWithProjectBookmarksInputSchema = exports.UserWithJobBookmarksInputSchema;
|
|
161
|
+
exports.GetUserWithPostBookmarksInputSchema = exports.UserWithJobBookmarksInputSchema;
|
|
162
|
+
exports.GetUserWithProjectBookmarksOutputSchema = zod_openapi_1.z.object({
|
|
163
|
+
bookmarks: exports.UserWithProjectBookmarksEntitySchema,
|
|
164
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
167
165
|
});
|
|
166
|
+
exports.GetUserWithPostBookmarksOutputSchema = zod_openapi_1.z.object({
|
|
167
|
+
bookmarks: exports.UserWithPostBookmarksEntitySchema,
|
|
168
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
169
|
+
});
|
|
170
|
+
// ==========================================
|
|
171
|
+
// 5. FOLLOWERS & FOLLOWING
|
|
172
|
+
// ==========================================
|
|
168
173
|
exports.UserWithFollowingEntitySchema = exports.MinimalUserSchema.extend({
|
|
169
174
|
following: zod_openapi_1.z
|
|
170
175
|
.array(exports.MinimalUserSchema.extend({
|
|
@@ -187,14 +192,13 @@ exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
|
|
|
187
192
|
example: [],
|
|
188
193
|
}),
|
|
189
194
|
}).openapi("UserWithFollowersEntity");
|
|
190
|
-
exports.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
})
|
|
197
|
-
.openapi({ example: [] }),
|
|
195
|
+
exports.GetUserFollowingInputSchema = zod_openapi_1.z.object({
|
|
196
|
+
searchQuery: zod_openapi_1.z.string().optional().openapi({ example: "design systems" }),
|
|
197
|
+
offset: zod_openapi_1.z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
198
|
+
});
|
|
199
|
+
exports.GetUserFollowersInputSchema = zod_openapi_1.z.object({
|
|
200
|
+
searchQuery: zod_openapi_1.z.string().optional().openapi({ example: "design systems" }),
|
|
201
|
+
offset: zod_openapi_1.z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
198
202
|
});
|
|
199
203
|
exports.GetUserFollowingOutputSchema = zod_openapi_1.z.object({
|
|
200
204
|
nextCursor: zod_openapi_1.z.string().openapi({ example: "cksd0v6q0000nxtcur" }),
|
|
@@ -205,19 +209,28 @@ exports.GetUserFollowingOutputSchema = zod_openapi_1.z.object({
|
|
|
205
209
|
}))
|
|
206
210
|
.openapi({ example: [] }),
|
|
207
211
|
});
|
|
208
|
-
exports.
|
|
209
|
-
.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
})
|
|
213
|
-
|
|
212
|
+
exports.GetUserFollowersOutputSchema = zod_openapi_1.z.object({
|
|
213
|
+
nextCursor: zod_openapi_1.z.string().openapi({ example: "cksd0v6q0000nxtcur" }),
|
|
214
|
+
followers: zod_openapi_1.z
|
|
215
|
+
.array(exports.MinimalUserSchema.extend({
|
|
216
|
+
isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
|
|
217
|
+
followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
|
|
218
|
+
}))
|
|
219
|
+
.openapi({ example: [] }),
|
|
220
|
+
});
|
|
221
|
+
// ==========================================
|
|
222
|
+
// 6. AUTHENTICATED USER OUTPUTS
|
|
223
|
+
// ==========================================
|
|
214
224
|
exports.GetAuthenticatedUserOutputSchema = exports.UserEntitySchema;
|
|
215
225
|
exports.GetAuthenticatedUserProfileOutputSchema = exports.UserProfileEntitySchema;
|
|
216
226
|
exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.UserWithProjectsEntitySchema;
|
|
217
227
|
exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.UserWithProjectBookmarksEntitySchema;
|
|
228
|
+
exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.UserWithProjectLikesEntitySchema;
|
|
218
229
|
exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.UserWithFollowingEntitySchema;
|
|
219
230
|
exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.UserWithFollowersEntitySchema;
|
|
220
|
-
|
|
231
|
+
// ==========================================
|
|
232
|
+
// 7. ACTIVITY
|
|
233
|
+
// ==========================================
|
|
221
234
|
exports.GetUserActivityInputSchema = zod_openapi_1.z.object({
|
|
222
235
|
activityType: zod_openapi_1.z
|
|
223
236
|
.enum(Object.values(constants_1.ACTIVITY_TYPES))
|
|
@@ -231,6 +244,9 @@ exports.GetUserActivityOutputSchema = zod_openapi_1.z
|
|
|
231
244
|
.openapi({ example: "POST" }),
|
|
232
245
|
}))
|
|
233
246
|
.openapi({ example: [] });
|
|
247
|
+
// ==========================================
|
|
248
|
+
// 8. SEARCH
|
|
249
|
+
// ==========================================
|
|
234
250
|
exports.SearchUsersInputSchema = zod_openapi_1.z.object({
|
|
235
251
|
query: zod_openapi_1.z.string().default("").openapi({
|
|
236
252
|
example: "john",
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, SearchUsersInputSchema, UserWithProjectLikesEntitySchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, UserStatsEntitySchema, UserWithPostsEntitySchema, SearchUsersOutputSchema, UserWithPostBookmarksEntitySchema, UserWithPostLikesEntitySchema, UserSearchDocumentSchema, UserWithJobBookmarksEntitySchema, UserWithJobBookmarksInputSchema, UserWithJobBookmarksOutputSchema } from "../schemas/user";
|
|
2
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { UserEntitySchema, MinimalUserSchema, UserProfileEntitySchema, UserStatsEntitySchema, UserWithProjectsEntitySchema, UserWithPostsEntitySchema, UserWithProjectLikesEntitySchema, UserWithPostLikesEntitySchema, UserWithJobBookmarksEntitySchema, UserWithJobBookmarksInputSchema, UserWithJobBookmarksOutputSchema, UserWithProjectBookmarksEntitySchema, UserWithPostBookmarksEntitySchema, GetUserWithProjectBookmarksInputSchema, GetUserWithPostBookmarksInputSchema, GetUserWithProjectBookmarksOutputSchema, GetUserWithPostBookmarksOutputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, SearchUsersInputSchema, SearchUsersOutputSchema, UserSearchDocumentSchema } from "../schemas/user";
|
|
3
3
|
export type BaseUserEntity = z.infer<typeof UserEntitySchema>;
|
|
4
|
-
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
5
4
|
export type UserEntity = z.infer<typeof UserEntitySchema>;
|
|
5
|
+
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
6
6
|
export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
|
|
7
|
+
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
7
8
|
export type UserWithProjectsEntity = z.infer<typeof UserWithProjectsEntitySchema>;
|
|
8
|
-
export type
|
|
9
|
+
export type UserWithUserPostsEntity = z.infer<typeof UserWithPostsEntitySchema>;
|
|
9
10
|
export type UserWithProjectLikesEntity = z.infer<typeof UserWithProjectLikesEntitySchema>;
|
|
10
|
-
export type UserWithPostBookmarksEntity = z.infer<typeof UserWithPostBookmarksEntitySchema>;
|
|
11
11
|
export type UserWithPostLikesEntity = z.infer<typeof UserWithPostLikesEntitySchema>;
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
12
|
+
export type UserWithJobBookmarksEntity = z.infer<typeof UserWithJobBookmarksEntitySchema>;
|
|
13
|
+
export type UserWithJobBookmarksInput = z.infer<typeof UserWithJobBookmarksInputSchema>;
|
|
14
|
+
export type UserWithJobBookmarksOutput = z.infer<typeof UserWithJobBookmarksOutputSchema>;
|
|
15
|
+
export type UserWithProjectBookmarksEntity = z.infer<typeof UserWithProjectBookmarksEntitySchema>;
|
|
16
|
+
export type UserWithPostBookmarksEntity = z.infer<typeof UserWithPostBookmarksEntitySchema>;
|
|
17
|
+
export type GetUserWithProjectBookmarksInput = z.infer<typeof GetUserWithProjectBookmarksInputSchema>;
|
|
18
|
+
export type GetUserWithPostBookmarksInput = z.infer<typeof GetUserWithPostBookmarksInputSchema>;
|
|
19
|
+
export type GetUserWithProjectBookmarksOutput = z.infer<typeof GetUserWithProjectBookmarksOutputSchema>;
|
|
20
|
+
export type GetUserWithPostBookmarksOutput = z.infer<typeof GetUserWithPostBookmarksOutputSchema>;
|
|
15
21
|
export type UserWithFollowingEntity = z.infer<typeof UserWithFollowingEntitySchema>;
|
|
16
22
|
export type UserWithFollowersEntity = z.infer<typeof UserWithFollowersEntitySchema>;
|
|
23
|
+
export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
|
|
24
|
+
export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
|
|
17
25
|
export type GetUserFollowingOutput = z.infer<typeof GetUserFollowingOutputSchema>;
|
|
18
26
|
export type GetUserFollowersOutput = z.infer<typeof GetUserFollowersOutputSchema>;
|
|
19
27
|
export type GetAuthenticatedUserOutput = z.infer<typeof GetAuthenticatedUserOutputSchema>;
|
|
@@ -25,10 +33,6 @@ export type GetAuthenticatedUserWithUserFollowingOutput = z.infer<typeof GetAuth
|
|
|
25
33
|
export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<typeof GetAuthenticatedUserWithUserFollowersOutputSchema>;
|
|
26
34
|
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
27
35
|
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
28
|
-
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
29
36
|
export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
|
|
30
37
|
export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
|
|
31
38
|
export type UserSearchDocument = z.infer<typeof UserSearchDocumentSchema>;
|
|
32
|
-
export type UserWithJobBookmarksEntity = z.infer<typeof UserWithJobBookmarksEntitySchema>;
|
|
33
|
-
export type UserWithJobBookmarksInput = z.infer<typeof UserWithJobBookmarksInputSchema>;
|
|
34
|
-
export type UserWithJobBookmarksOutput = z.infer<typeof UserWithJobBookmarksOutputSchema>;
|
package/package.json
CHANGED
package/src/schemas/user.ts
CHANGED
|
@@ -14,15 +14,23 @@ import type {
|
|
|
14
14
|
ActivityType,
|
|
15
15
|
ActivityParentType,
|
|
16
16
|
} from "../constants";
|
|
17
|
-
import { ProjectEntitySchema } from "./project";
|
|
17
|
+
import { ProjectEntitySchema, ProjectSearchDocumentSchema } from "./project";
|
|
18
18
|
import { BookmarkEntitySchema } from "./bookmark";
|
|
19
19
|
import { LikeEntitySchema } from "./like";
|
|
20
20
|
import { BrandEntitySchema } from "./brand";
|
|
21
21
|
import { CreativeEntitySchema } from "./creative";
|
|
22
22
|
import { InvestorEntitySchema } from "./investor";
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
FeedPostEntitySchema,
|
|
25
|
+
PostEntitySchema,
|
|
26
|
+
PostWithFilesEntitySchema,
|
|
27
|
+
} from "./post";
|
|
24
28
|
import { JobEntitySchema, JobSearchDocumentSchema } from "./job";
|
|
25
29
|
|
|
30
|
+
// ==========================================
|
|
31
|
+
// 1. CORE USER ENTITIES
|
|
32
|
+
// ==========================================
|
|
33
|
+
|
|
26
34
|
export const UserEntitySchema = z
|
|
27
35
|
.object({
|
|
28
36
|
id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -68,14 +76,6 @@ export const MinimalUserSchema = UserEntitySchema.pick({
|
|
|
68
76
|
role: true,
|
|
69
77
|
}).openapi("MinimalUser");
|
|
70
78
|
|
|
71
|
-
export const UserStatsEntitySchema = z.object({
|
|
72
|
-
followerCount: z.int().openapi({ example: 1540 }),
|
|
73
|
-
followingCount: z.int().openapi({ example: 234 }),
|
|
74
|
-
followingIds: z
|
|
75
|
-
.array(z.cuid2())
|
|
76
|
-
.openapi({ example: ["cksd0v6q0000s9a5y8z7p3x9", "clm1a2b3c0000abc"] }),
|
|
77
|
-
});
|
|
78
|
-
|
|
79
79
|
export const UserProfileEntitySchema = UserEntitySchema.extend({
|
|
80
80
|
profileType: z
|
|
81
81
|
.enum(["creative", "brand", "investor"])
|
|
@@ -86,6 +86,18 @@ export const UserProfileEntitySchema = UserEntitySchema.extend({
|
|
|
86
86
|
investor: InvestorEntitySchema,
|
|
87
87
|
}).openapi("UserProfileEntity");
|
|
88
88
|
|
|
89
|
+
export const UserStatsEntitySchema = z.object({
|
|
90
|
+
followerCount: z.int().openapi({ example: 1540 }),
|
|
91
|
+
followingCount: z.int().openapi({ example: 234 }),
|
|
92
|
+
followingIds: z
|
|
93
|
+
.array(z.cuid2())
|
|
94
|
+
.openapi({ example: ["cksd0v6q0000s9a5y8z7p3x9", "clm1a2b3c0000abc"] }),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// ==========================================
|
|
98
|
+
// 2. CONTENT ASSOCIATIONS (Projects, Posts)
|
|
99
|
+
// ==========================================
|
|
100
|
+
|
|
89
101
|
export const UserWithProjectsEntitySchema = z
|
|
90
102
|
.object({
|
|
91
103
|
userId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -95,6 +107,17 @@ export const UserWithProjectsEntitySchema = z
|
|
|
95
107
|
})
|
|
96
108
|
.openapi("UserWithProjectsEntity");
|
|
97
109
|
|
|
110
|
+
export const UserWithPostsEntitySchema = z
|
|
111
|
+
.object({
|
|
112
|
+
userId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
113
|
+
posts: z.array(PostWithFilesEntitySchema).openapi({ example: [] }),
|
|
114
|
+
})
|
|
115
|
+
.openapi("UserWithPostsEntity");
|
|
116
|
+
|
|
117
|
+
// ==========================================
|
|
118
|
+
// 3. LIKES
|
|
119
|
+
// ==========================================
|
|
120
|
+
|
|
98
121
|
export const UserWithProjectLikesEntitySchema = z.object({
|
|
99
122
|
userId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
100
123
|
projectLikes: z
|
|
@@ -119,25 +142,6 @@ export const UserWithPostLikesEntitySchema = z.object({
|
|
|
119
142
|
postLikes: z
|
|
120
143
|
.array(
|
|
121
144
|
LikeEntitySchema.extend({
|
|
122
|
-
post: PostEntitySchema.pick({
|
|
123
|
-
id: true,
|
|
124
|
-
parentId: true,
|
|
125
|
-
title: true, // Note: Make sure 'title' exists on PostEntitySchema in your post.ts!
|
|
126
|
-
content: true,
|
|
127
|
-
tags: true,
|
|
128
|
-
createdAt: true,
|
|
129
|
-
updatedAt: true, // Note: Make sure 'updatedAt' exists on PostEntitySchema as well!
|
|
130
|
-
}),
|
|
131
|
-
}),
|
|
132
|
-
)
|
|
133
|
-
.openapi({ example: [] }),
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
export const UserWithPostBookmarksEntitySchema = z.object({
|
|
137
|
-
userId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
138
|
-
postBookmarks: z
|
|
139
|
-
.array(
|
|
140
|
-
BookmarkEntitySchema.extend({
|
|
141
145
|
post: PostEntitySchema.pick({
|
|
142
146
|
id: true,
|
|
143
147
|
parentId: true,
|
|
@@ -152,6 +156,10 @@ export const UserWithPostBookmarksEntitySchema = z.object({
|
|
|
152
156
|
.openapi({ example: [] }),
|
|
153
157
|
});
|
|
154
158
|
|
|
159
|
+
// ==========================================
|
|
160
|
+
// 4. BOOKMARKS
|
|
161
|
+
// ==========================================
|
|
162
|
+
|
|
155
163
|
export const UserWithJobBookmarksEntitySchema = z.object({
|
|
156
164
|
userId: z.cuid2().openapi({ example: "afoaifaofi" }),
|
|
157
165
|
jobBookmarks: z
|
|
@@ -181,31 +189,41 @@ export const UserWithProjectBookmarksEntitySchema = z
|
|
|
181
189
|
projectBookmarks: z
|
|
182
190
|
.array(
|
|
183
191
|
BookmarkEntitySchema.extend({
|
|
184
|
-
project:
|
|
185
|
-
id: true,
|
|
186
|
-
title: true,
|
|
187
|
-
description: true,
|
|
188
|
-
tags: true,
|
|
189
|
-
startDate: true,
|
|
190
|
-
endDate: true,
|
|
191
|
-
imagePlaceholderUrl: true,
|
|
192
|
-
}),
|
|
192
|
+
project: ProjectSearchDocumentSchema,
|
|
193
193
|
}),
|
|
194
194
|
)
|
|
195
195
|
.openapi({ example: [] }),
|
|
196
196
|
})
|
|
197
197
|
.openapi("UserWithProjectBookmarksEntity");
|
|
198
198
|
|
|
199
|
-
export const
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
export const UserWithPostBookmarksEntitySchema = z.object({
|
|
200
|
+
userId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
201
|
+
postBookmarks: z.array(
|
|
202
|
+
BookmarkEntitySchema.extend({
|
|
203
|
+
post: PostWithFilesEntitySchema,
|
|
204
|
+
}),
|
|
205
|
+
),
|
|
202
206
|
});
|
|
203
207
|
|
|
204
|
-
export const
|
|
205
|
-
|
|
206
|
-
|
|
208
|
+
export const GetUserWithProjectBookmarksInputSchema =
|
|
209
|
+
UserWithJobBookmarksInputSchema;
|
|
210
|
+
export const GetUserWithPostBookmarksInputSchema =
|
|
211
|
+
UserWithJobBookmarksInputSchema;
|
|
212
|
+
|
|
213
|
+
export const GetUserWithProjectBookmarksOutputSchema = z.object({
|
|
214
|
+
bookmarks: UserWithProjectBookmarksEntitySchema,
|
|
215
|
+
nextCursor: z.string().nullable(),
|
|
207
216
|
});
|
|
208
217
|
|
|
218
|
+
export const GetUserWithPostBookmarksOutputSchema = z.object({
|
|
219
|
+
bookmarks: UserWithPostBookmarksEntitySchema,
|
|
220
|
+
nextCursor: z.string().nullable(),
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// ==========================================
|
|
224
|
+
// 5. FOLLOWERS & FOLLOWING
|
|
225
|
+
// ==========================================
|
|
226
|
+
|
|
209
227
|
export const UserWithFollowingEntitySchema = MinimalUserSchema.extend({
|
|
210
228
|
following: z
|
|
211
229
|
.array(
|
|
@@ -234,36 +252,43 @@ export const UserWithFollowersEntitySchema = MinimalUserSchema.extend({
|
|
|
234
252
|
}),
|
|
235
253
|
}).openapi("UserWithFollowersEntity");
|
|
236
254
|
|
|
237
|
-
export const
|
|
255
|
+
export const GetUserFollowingInputSchema = z.object({
|
|
256
|
+
searchQuery: z.string().optional().openapi({ example: "design systems" }),
|
|
257
|
+
offset: z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
export const GetUserFollowersInputSchema = z.object({
|
|
261
|
+
searchQuery: z.string().optional().openapi({ example: "design systems" }),
|
|
262
|
+
offset: z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export const GetUserFollowingOutputSchema = z.object({
|
|
238
266
|
nextCursor: z.string().openapi({ example: "cksd0v6q0000nxtcur" }),
|
|
239
|
-
|
|
267
|
+
following: z
|
|
240
268
|
.array(
|
|
241
269
|
MinimalUserSchema.extend({
|
|
242
|
-
isFollowing: z.boolean().optional().openapi({ example:
|
|
243
|
-
followsYou: z.boolean().optional().openapi({ example:
|
|
270
|
+
isFollowing: z.boolean().optional().openapi({ example: true }),
|
|
271
|
+
followsYou: z.boolean().optional().openapi({ example: false }),
|
|
244
272
|
}),
|
|
245
273
|
)
|
|
246
274
|
.openapi({ example: [] }),
|
|
247
275
|
});
|
|
248
276
|
|
|
249
|
-
export const
|
|
277
|
+
export const GetUserFollowersOutputSchema = z.object({
|
|
250
278
|
nextCursor: z.string().openapi({ example: "cksd0v6q0000nxtcur" }),
|
|
251
|
-
|
|
279
|
+
followers: z
|
|
252
280
|
.array(
|
|
253
281
|
MinimalUserSchema.extend({
|
|
254
|
-
isFollowing: z.boolean().optional().openapi({ example:
|
|
255
|
-
followsYou: z.boolean().optional().openapi({ example:
|
|
282
|
+
isFollowing: z.boolean().optional().openapi({ example: false }),
|
|
283
|
+
followsYou: z.boolean().optional().openapi({ example: true }),
|
|
256
284
|
}),
|
|
257
285
|
)
|
|
258
286
|
.openapi({ example: [] }),
|
|
259
287
|
});
|
|
260
288
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
posts: z.array(PostWithFilesEntitySchema).openapi({ example: [] }),
|
|
265
|
-
})
|
|
266
|
-
.openapi("UserWithPostsEntity");
|
|
289
|
+
// ==========================================
|
|
290
|
+
// 6. AUTHENTICATED USER OUTPUTS
|
|
291
|
+
// ==========================================
|
|
267
292
|
|
|
268
293
|
export const GetAuthenticatedUserOutputSchema = UserEntitySchema;
|
|
269
294
|
export const GetAuthenticatedUserProfileOutputSchema = UserProfileEntitySchema;
|
|
@@ -271,12 +296,16 @@ export const GetAuthenticatedUserWithProjectsOutputSchema =
|
|
|
271
296
|
UserWithProjectsEntitySchema;
|
|
272
297
|
export const GetAuthenticatedUserWithProjectBookmarksOutputSchema =
|
|
273
298
|
UserWithProjectBookmarksEntitySchema;
|
|
299
|
+
export const GetAuthenticatedUserWithProjectLikesOutputSchema =
|
|
300
|
+
UserWithProjectLikesEntitySchema;
|
|
274
301
|
export const GetAuthenticatedUserWithUserFollowingOutputSchema =
|
|
275
302
|
UserWithFollowingEntitySchema;
|
|
276
303
|
export const GetAuthenticatedUserWithUserFollowersOutputSchema =
|
|
277
304
|
UserWithFollowersEntitySchema;
|
|
278
|
-
|
|
279
|
-
|
|
305
|
+
|
|
306
|
+
// ==========================================
|
|
307
|
+
// 7. ACTIVITY
|
|
308
|
+
// ==========================================
|
|
280
309
|
|
|
281
310
|
export const GetUserActivityInputSchema = z.object({
|
|
282
311
|
activityType: z
|
|
@@ -300,6 +329,10 @@ export const GetUserActivityOutputSchema = z
|
|
|
300
329
|
)
|
|
301
330
|
.openapi({ example: [] });
|
|
302
331
|
|
|
332
|
+
// ==========================================
|
|
333
|
+
// 8. SEARCH
|
|
334
|
+
// ==========================================
|
|
335
|
+
|
|
303
336
|
export const SearchUsersInputSchema = z.object({
|
|
304
337
|
query: z.string().default("").openapi({
|
|
305
338
|
example: "john",
|
package/src/types/user.ts
CHANGED
|
@@ -1,75 +1,126 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
|
-
MinimalUserSchema,
|
|
3
4
|
UserEntitySchema,
|
|
5
|
+
MinimalUserSchema,
|
|
4
6
|
UserProfileEntitySchema,
|
|
7
|
+
UserStatsEntitySchema,
|
|
5
8
|
UserWithProjectsEntitySchema,
|
|
9
|
+
UserWithPostsEntitySchema,
|
|
10
|
+
UserWithProjectLikesEntitySchema,
|
|
11
|
+
UserWithPostLikesEntitySchema,
|
|
12
|
+
UserWithJobBookmarksEntitySchema,
|
|
13
|
+
UserWithJobBookmarksInputSchema,
|
|
14
|
+
UserWithJobBookmarksOutputSchema,
|
|
6
15
|
UserWithProjectBookmarksEntitySchema,
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
UserWithPostBookmarksEntitySchema,
|
|
17
|
+
GetUserWithProjectBookmarksInputSchema,
|
|
18
|
+
GetUserWithPostBookmarksInputSchema,
|
|
19
|
+
GetUserWithProjectBookmarksOutputSchema,
|
|
20
|
+
GetUserWithPostBookmarksOutputSchema,
|
|
9
21
|
UserWithFollowingEntitySchema,
|
|
10
22
|
UserWithFollowersEntitySchema,
|
|
23
|
+
GetUserFollowingInputSchema,
|
|
24
|
+
GetUserFollowersInputSchema,
|
|
11
25
|
GetUserFollowingOutputSchema,
|
|
12
26
|
GetUserFollowersOutputSchema,
|
|
13
27
|
GetAuthenticatedUserOutputSchema,
|
|
14
28
|
GetAuthenticatedUserProfileOutputSchema,
|
|
15
29
|
GetAuthenticatedUserWithProjectsOutputSchema,
|
|
16
30
|
GetAuthenticatedUserWithProjectBookmarksOutputSchema,
|
|
31
|
+
GetAuthenticatedUserWithProjectLikesOutputSchema,
|
|
17
32
|
GetAuthenticatedUserWithUserFollowingOutputSchema,
|
|
18
33
|
GetAuthenticatedUserWithUserFollowersOutputSchema,
|
|
19
|
-
SearchUsersInputSchema,
|
|
20
|
-
UserWithProjectLikesEntitySchema,
|
|
21
|
-
GetAuthenticatedUserWithProjectLikesOutputSchema,
|
|
22
34
|
GetUserActivityInputSchema,
|
|
23
35
|
GetUserActivityOutputSchema,
|
|
24
|
-
|
|
25
|
-
UserWithPostsEntitySchema,
|
|
36
|
+
SearchUsersInputSchema,
|
|
26
37
|
SearchUsersOutputSchema,
|
|
27
|
-
UserWithPostBookmarksEntitySchema,
|
|
28
|
-
UserWithPostLikesEntitySchema,
|
|
29
38
|
UserSearchDocumentSchema,
|
|
30
|
-
UserWithJobBookmarksEntitySchema,
|
|
31
|
-
UserWithJobBookmarksInputSchema,
|
|
32
|
-
UserWithJobBookmarksOutputSchema,
|
|
33
39
|
} from "../schemas/user";
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
// ==========================================
|
|
42
|
+
// 1. CORE USER ENTITIES
|
|
43
|
+
// ==========================================
|
|
37
44
|
export type BaseUserEntity = z.infer<typeof UserEntitySchema>;
|
|
38
|
-
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
39
45
|
export type UserEntity = z.infer<typeof UserEntitySchema>;
|
|
46
|
+
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
40
47
|
export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
|
|
48
|
+
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
49
|
+
|
|
50
|
+
// ==========================================
|
|
51
|
+
// 2. CONTENT ASSOCIATIONS (Projects, Posts)
|
|
52
|
+
// ==========================================
|
|
41
53
|
export type UserWithProjectsEntity = z.infer<
|
|
42
54
|
typeof UserWithProjectsEntitySchema
|
|
43
55
|
>;
|
|
44
|
-
export type
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
export type UserWithUserPostsEntity = z.infer<typeof UserWithPostsEntitySchema>;
|
|
57
|
+
|
|
58
|
+
// ==========================================
|
|
59
|
+
// 3. LIKES
|
|
60
|
+
// ==========================================
|
|
47
61
|
export type UserWithProjectLikesEntity = z.infer<
|
|
48
62
|
typeof UserWithProjectLikesEntitySchema
|
|
49
63
|
>;
|
|
64
|
+
export type UserWithPostLikesEntity = z.infer<
|
|
65
|
+
typeof UserWithPostLikesEntitySchema
|
|
66
|
+
>;
|
|
67
|
+
|
|
68
|
+
// ==========================================
|
|
69
|
+
// 4. BOOKMARKS
|
|
70
|
+
// ==========================================
|
|
71
|
+
export type UserWithJobBookmarksEntity = z.infer<
|
|
72
|
+
typeof UserWithJobBookmarksEntitySchema
|
|
73
|
+
>;
|
|
74
|
+
export type UserWithJobBookmarksInput = z.infer<
|
|
75
|
+
typeof UserWithJobBookmarksInputSchema
|
|
76
|
+
>;
|
|
77
|
+
export type UserWithJobBookmarksOutput = z.infer<
|
|
78
|
+
typeof UserWithJobBookmarksOutputSchema
|
|
79
|
+
>;
|
|
50
80
|
|
|
81
|
+
export type UserWithProjectBookmarksEntity = z.infer<
|
|
82
|
+
typeof UserWithProjectBookmarksEntitySchema
|
|
83
|
+
>;
|
|
51
84
|
export type UserWithPostBookmarksEntity = z.infer<
|
|
52
85
|
typeof UserWithPostBookmarksEntitySchema
|
|
53
86
|
>;
|
|
54
|
-
|
|
55
|
-
|
|
87
|
+
|
|
88
|
+
export type GetUserWithProjectBookmarksInput = z.infer<
|
|
89
|
+
typeof GetUserWithProjectBookmarksInputSchema
|
|
90
|
+
>;
|
|
91
|
+
export type GetUserWithPostBookmarksInput = z.infer<
|
|
92
|
+
typeof GetUserWithPostBookmarksInputSchema
|
|
93
|
+
>;
|
|
94
|
+
export type GetUserWithProjectBookmarksOutput = z.infer<
|
|
95
|
+
typeof GetUserWithProjectBookmarksOutputSchema
|
|
96
|
+
>;
|
|
97
|
+
export type GetUserWithPostBookmarksOutput = z.infer<
|
|
98
|
+
typeof GetUserWithPostBookmarksOutputSchema
|
|
56
99
|
>;
|
|
57
100
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
101
|
+
// ==========================================
|
|
102
|
+
// 5. FOLLOWERS & FOLLOWING
|
|
103
|
+
// ==========================================
|
|
61
104
|
export type UserWithFollowingEntity = z.infer<
|
|
62
105
|
typeof UserWithFollowingEntitySchema
|
|
63
106
|
>;
|
|
64
107
|
export type UserWithFollowersEntity = z.infer<
|
|
65
108
|
typeof UserWithFollowersEntitySchema
|
|
66
109
|
>;
|
|
110
|
+
|
|
111
|
+
export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
|
|
112
|
+
export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
|
|
113
|
+
|
|
67
114
|
export type GetUserFollowingOutput = z.infer<
|
|
68
115
|
typeof GetUserFollowingOutputSchema
|
|
69
116
|
>;
|
|
70
117
|
export type GetUserFollowersOutput = z.infer<
|
|
71
118
|
typeof GetUserFollowersOutputSchema
|
|
72
119
|
>;
|
|
120
|
+
|
|
121
|
+
// ==========================================
|
|
122
|
+
// 6. AUTHENTICATED USER OUTPUTS
|
|
123
|
+
// ==========================================
|
|
73
124
|
export type GetAuthenticatedUserOutput = z.infer<
|
|
74
125
|
typeof GetAuthenticatedUserOutputSchema
|
|
75
126
|
>;
|
|
@@ -92,20 +143,15 @@ export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<
|
|
|
92
143
|
typeof GetAuthenticatedUserWithUserFollowersOutputSchema
|
|
93
144
|
>;
|
|
94
145
|
|
|
146
|
+
// ==========================================
|
|
147
|
+
// 7. ACTIVITY
|
|
148
|
+
// ==========================================
|
|
95
149
|
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
96
150
|
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
97
|
-
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
98
151
|
|
|
152
|
+
// ==========================================
|
|
153
|
+
// 8. SEARCH
|
|
154
|
+
// ==========================================
|
|
99
155
|
export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
|
|
100
156
|
export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
|
|
101
157
|
export type UserSearchDocument = z.infer<typeof UserSearchDocumentSchema>;
|
|
102
|
-
|
|
103
|
-
export type UserWithJobBookmarksEntity = z.infer<
|
|
104
|
-
typeof UserWithJobBookmarksEntitySchema
|
|
105
|
-
>;
|
|
106
|
-
export type UserWithJobBookmarksInput = z.infer<
|
|
107
|
-
typeof UserWithJobBookmarksInputSchema
|
|
108
|
-
>;
|
|
109
|
-
export type UserWithJobBookmarksOutput = z.infer<
|
|
110
|
-
typeof UserWithJobBookmarksOutputSchema
|
|
111
|
-
>;
|