@zyacreatives/shared 2.5.51 → 2.5.52
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 +171 -89
- package/dist/schemas/user.js +7 -11
- package/package.json +1 -1
- package/src/schemas/user.ts +46 -13
package/dist/schemas/user.d.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
/**
|
|
3
|
+
* --------------------------------
|
|
4
|
+
* SHAPE
|
|
5
|
+
* --------------------------------
|
|
6
|
+
*/
|
|
7
|
+
declare const UserShape: z.ZodObject<{
|
|
8
|
+
email: z.ZodEmail;
|
|
9
|
+
emailVerified: z.ZodBoolean;
|
|
10
|
+
name: z.ZodDefault<z.ZodString>;
|
|
11
|
+
image: z.ZodDefault<z.ZodString>;
|
|
12
|
+
username: z.ZodDefault<z.ZodString>;
|
|
13
|
+
displayUsername: z.ZodDefault<z.ZodString>;
|
|
14
|
+
role: z.ZodEnum<{
|
|
15
|
+
CREATIVE: "CREATIVE";
|
|
16
|
+
BRAND: "BRAND";
|
|
17
|
+
INVESTOR: "INVESTOR";
|
|
18
|
+
ADMIN: "ADMIN";
|
|
19
|
+
}>;
|
|
20
|
+
status: z.ZodEnum<{
|
|
21
|
+
ACTIVE: "ACTIVE";
|
|
22
|
+
SUSPENDED: "SUSPENDED";
|
|
23
|
+
DELETED: "DELETED";
|
|
24
|
+
}>;
|
|
25
|
+
onboardingPage: z.ZodEnum<{
|
|
26
|
+
EMAIL_VERIFICATION: "EMAIL_VERIFICATION";
|
|
27
|
+
USERNAME_SELECTION: "USERNAME_SELECTION";
|
|
28
|
+
ACCOUNT_TYPE_SELECTION: "ACCOUNT_TYPE_SELECTION";
|
|
29
|
+
CREATIVE_PROFILE_DETAILS: "CREATIVE_PROFILE_DETAILS";
|
|
30
|
+
BRAND_PROFILE_DETAILS: "BRAND_PROFILE_DETAILS";
|
|
31
|
+
INVESTOR_PROFILE_DETAILS: "INVESTOR_PROFILE_DETAILS";
|
|
32
|
+
INVESTOR_INVESTMENT_FOCUS: "INVESTOR_INVESTMENT_FOCUS";
|
|
33
|
+
INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
|
|
34
|
+
DONE: "DONE";
|
|
35
|
+
}>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type UserShapeType = z.infer<typeof UserShape>;
|
|
2
38
|
/**
|
|
3
39
|
* --------------------------------
|
|
4
40
|
* BASE ENTITY
|
|
@@ -237,6 +273,16 @@ export declare const UserStatsEntitySchema: z.ZodObject<{
|
|
|
237
273
|
followingCount: z.ZodInt;
|
|
238
274
|
followingIds: z.ZodArray<z.ZodCUID2>;
|
|
239
275
|
}, z.core.$strip>;
|
|
276
|
+
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
277
|
+
/**
|
|
278
|
+
* --------------------------------
|
|
279
|
+
* COMPOSED ENTITIES
|
|
280
|
+
* --------------------------------
|
|
281
|
+
*/
|
|
282
|
+
declare const UserWithId: z.ZodObject<{
|
|
283
|
+
userId: z.ZodCUID2;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
export type UserWithIdType = z.infer<typeof UserWithId>;
|
|
240
286
|
export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
241
287
|
userId: z.ZodCUID2;
|
|
242
288
|
projects: z.ZodArray<z.ZodObject<{
|
|
@@ -301,6 +347,7 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
|
301
347
|
version: z.ZodNumber;
|
|
302
348
|
}, z.core.$strip>>;
|
|
303
349
|
}, z.core.$strip>;
|
|
350
|
+
export type UserWithProjectsEntity = z.infer<typeof UserWithProjectsEntitySchema>;
|
|
304
351
|
export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
305
352
|
userId: z.ZodCUID2;
|
|
306
353
|
posts: z.ZodArray<z.ZodObject<{
|
|
@@ -380,94 +427,7 @@ export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
|
380
427
|
}, z.core.$strip>>>;
|
|
381
428
|
}, z.core.$strip>>;
|
|
382
429
|
}, z.core.$strip>;
|
|
383
|
-
export
|
|
384
|
-
userId: z.ZodCUID2;
|
|
385
|
-
products: z.ZodArray<z.ZodObject<{
|
|
386
|
-
id: z.ZodCUID2;
|
|
387
|
-
sellerId: z.ZodCUID2;
|
|
388
|
-
sellerUsername: z.ZodString;
|
|
389
|
-
sellerName: z.ZodString;
|
|
390
|
-
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
391
|
-
title: z.ZodString;
|
|
392
|
-
description: z.ZodString;
|
|
393
|
-
keyFeatures: z.ZodString;
|
|
394
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
395
|
-
readonly ACTIVE: "ACTIVE";
|
|
396
|
-
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
397
|
-
readonly DRAFT: "DRAFT";
|
|
398
|
-
readonly ARCHIVED: "ARCHIVED";
|
|
399
|
-
readonly DELETED: "DELETED";
|
|
400
|
-
}>>;
|
|
401
|
-
category: z.ZodString;
|
|
402
|
-
subcategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
403
|
-
tags: z.ZodArray<z.ZodString>;
|
|
404
|
-
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
405
|
-
id: z.ZodCUID2;
|
|
406
|
-
key: z.ZodString;
|
|
407
|
-
mimeType: z.ZodString;
|
|
408
|
-
url: z.ZodURL;
|
|
409
|
-
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
410
|
-
parentType: z.ZodNullable<z.ZodEnum<{
|
|
411
|
-
readonly PROJECT: "PROJECT";
|
|
412
|
-
readonly USER: "USER";
|
|
413
|
-
readonly JOB: "JOB";
|
|
414
|
-
readonly POST: "POST";
|
|
415
|
-
readonly PRODUCT: "PRODUCT";
|
|
416
|
-
readonly SIGNAL: "SIGNAL";
|
|
417
|
-
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
418
|
-
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
419
|
-
readonly COMMENT: "COMMENT";
|
|
420
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
421
|
-
}>>;
|
|
422
|
-
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
423
|
-
order: z.ZodNumber;
|
|
424
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
425
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
426
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
427
|
-
}, z.core.$strip>>>;
|
|
428
|
-
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
429
|
-
title: z.ZodNullable<z.ZodString>;
|
|
430
|
-
url: z.ZodString;
|
|
431
|
-
}, z.core.$strip>>>;
|
|
432
|
-
pricingModel: z.ZodEnum<{
|
|
433
|
-
readonly FREE: "Free";
|
|
434
|
-
readonly FIXED: "Fixed";
|
|
435
|
-
readonly PWYW: "Pay What You Want";
|
|
436
|
-
}>;
|
|
437
|
-
currency: z.ZodEnum<{
|
|
438
|
-
readonly USD: "USD (United States Dollar)";
|
|
439
|
-
readonly EUR: "EUR (Euro)";
|
|
440
|
-
readonly GBP: "GBP (British Pound Sterling)";
|
|
441
|
-
readonly NGN: "NGN (Nigerian Naira)";
|
|
442
|
-
readonly CAD: "CAD (Canadian Dollar)";
|
|
443
|
-
readonly AUD: "AUD (Australian Dollar)";
|
|
444
|
-
readonly JPY: "JPY (Japanese Yen)";
|
|
445
|
-
readonly CHF: "CHF (Swiss Franc)";
|
|
446
|
-
readonly INR: "INR (Indian Rupee)";
|
|
447
|
-
readonly ZAR: "ZAR (South African Rand)";
|
|
448
|
-
}>;
|
|
449
|
-
price: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
450
|
-
suggestedPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
451
|
-
discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
452
|
-
discountType: z.ZodEnum<{
|
|
453
|
-
readonly FIXED_AMOUNT: "Fixed Amount";
|
|
454
|
-
readonly PERCENTAGE: "Percentage";
|
|
455
|
-
}>;
|
|
456
|
-
amount: z.ZodNumber;
|
|
457
|
-
discountCode: z.ZodOptional<z.ZodString>;
|
|
458
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
459
|
-
}, z.core.$strip>>>;
|
|
460
|
-
ownsRights: z.ZodBoolean;
|
|
461
|
-
noHarmfulContent: z.ZodBoolean;
|
|
462
|
-
providesSupport: z.ZodBoolean;
|
|
463
|
-
agreesToTerms: z.ZodBoolean;
|
|
464
|
-
supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
|
|
465
|
-
supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
466
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
467
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
468
|
-
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
469
|
-
}, z.core.$strip>>;
|
|
470
|
-
}, z.core.$strip>;
|
|
430
|
+
export type UserWithPostsEntity = z.infer<typeof UserWithPostsEntitySchema>;
|
|
471
431
|
export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
472
432
|
userId: z.ZodCUID2;
|
|
473
433
|
projectLikes: z.ZodArray<z.ZodObject<{
|
|
@@ -498,6 +458,7 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
498
458
|
}, z.core.$strip>;
|
|
499
459
|
}, z.core.$strip>>;
|
|
500
460
|
}, z.core.$strip>;
|
|
461
|
+
export type UserWithProjectLikesEntity = z.infer<typeof UserWithProjectLikesEntitySchema>;
|
|
501
462
|
export declare const UserWithPostLikesEntitySchema: z.ZodObject<{
|
|
502
463
|
userId: z.ZodCUID2;
|
|
503
464
|
postLikes: z.ZodArray<z.ZodObject<{
|
|
@@ -529,6 +490,7 @@ export declare const UserWithPostLikesEntitySchema: z.ZodObject<{
|
|
|
529
490
|
}, z.core.$strip>;
|
|
530
491
|
}, z.core.$strip>>;
|
|
531
492
|
}, z.core.$strip>;
|
|
493
|
+
export type UserWithPostLikesEntity = z.infer<typeof UserWithPostLikesEntitySchema>;
|
|
532
494
|
/**
|
|
533
495
|
* --------------------------------
|
|
534
496
|
* BOOKMARKS
|
|
@@ -581,6 +543,7 @@ export declare const UserWithJobBookmarksEntitySchema: z.ZodObject<{
|
|
|
581
543
|
}, z.core.$strip>;
|
|
582
544
|
}, z.core.$strip>>;
|
|
583
545
|
}, z.core.$strip>;
|
|
546
|
+
export type UserWithJobBookmarksEntity = z.infer<typeof UserWithJobBookmarksEntitySchema>;
|
|
584
547
|
export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
585
548
|
userId: z.ZodCUID2;
|
|
586
549
|
projectBookmarks: z.ZodArray<z.ZodObject<{
|
|
@@ -681,6 +644,7 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
681
644
|
}, z.core.$strip>;
|
|
682
645
|
}, z.core.$strip>>;
|
|
683
646
|
}, z.core.$strip>;
|
|
647
|
+
export type UserWithProjectBookmarksEntity = z.infer<typeof UserWithProjectBookmarksEntitySchema>;
|
|
684
648
|
export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
685
649
|
userId: z.ZodCUID2;
|
|
686
650
|
postBookmarks: z.ZodArray<z.ZodObject<{
|
|
@@ -778,6 +742,106 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
778
742
|
}, z.core.$strip>;
|
|
779
743
|
}, z.core.$strip>>;
|
|
780
744
|
}, z.core.$strip>;
|
|
745
|
+
export type UserWithPostBookmarksEntity = z.infer<typeof UserWithPostBookmarksEntitySchema>;
|
|
746
|
+
export declare const UserWithProductsEntitySchema: z.ZodObject<{
|
|
747
|
+
userId: z.ZodCUID2;
|
|
748
|
+
products: z.ZodArray<z.ZodObject<{
|
|
749
|
+
id: z.ZodCUID2;
|
|
750
|
+
sellerId: z.ZodCUID2;
|
|
751
|
+
sellerUsername: z.ZodString;
|
|
752
|
+
sellerName: z.ZodString;
|
|
753
|
+
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
754
|
+
title: z.ZodString;
|
|
755
|
+
description: z.ZodString;
|
|
756
|
+
keyFeatures: z.ZodString;
|
|
757
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
758
|
+
readonly ACTIVE: "ACTIVE";
|
|
759
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
760
|
+
readonly DRAFT: "DRAFT";
|
|
761
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
762
|
+
readonly DELETED: "DELETED";
|
|
763
|
+
}>>;
|
|
764
|
+
category: z.ZodString;
|
|
765
|
+
subcategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
766
|
+
tags: z.ZodArray<z.ZodString>;
|
|
767
|
+
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
768
|
+
id: z.ZodCUID2;
|
|
769
|
+
key: z.ZodString;
|
|
770
|
+
mimeType: z.ZodString;
|
|
771
|
+
url: z.ZodURL;
|
|
772
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
773
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
774
|
+
readonly PROJECT: "PROJECT";
|
|
775
|
+
readonly USER: "USER";
|
|
776
|
+
readonly JOB: "JOB";
|
|
777
|
+
readonly POST: "POST";
|
|
778
|
+
readonly PRODUCT: "PRODUCT";
|
|
779
|
+
readonly SIGNAL: "SIGNAL";
|
|
780
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
781
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
782
|
+
readonly COMMENT: "COMMENT";
|
|
783
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
784
|
+
}>>;
|
|
785
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
786
|
+
order: z.ZodNumber;
|
|
787
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
788
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
789
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
790
|
+
}, z.core.$strip>>>;
|
|
791
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
792
|
+
title: z.ZodNullable<z.ZodString>;
|
|
793
|
+
url: z.ZodString;
|
|
794
|
+
}, z.core.$strip>>>;
|
|
795
|
+
pricingModel: z.ZodEnum<{
|
|
796
|
+
readonly FREE: "Free";
|
|
797
|
+
readonly FIXED: "Fixed";
|
|
798
|
+
readonly PWYW: "Pay What You Want";
|
|
799
|
+
}>;
|
|
800
|
+
currency: z.ZodEnum<{
|
|
801
|
+
readonly USD: "USD (United States Dollar)";
|
|
802
|
+
readonly EUR: "EUR (Euro)";
|
|
803
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
804
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
805
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
806
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
807
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
808
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
809
|
+
readonly INR: "INR (Indian Rupee)";
|
|
810
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
811
|
+
}>;
|
|
812
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
813
|
+
suggestedPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
814
|
+
discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
815
|
+
discountType: z.ZodEnum<{
|
|
816
|
+
readonly FIXED_AMOUNT: "Fixed Amount";
|
|
817
|
+
readonly PERCENTAGE: "Percentage";
|
|
818
|
+
}>;
|
|
819
|
+
amount: z.ZodNumber;
|
|
820
|
+
discountCode: z.ZodOptional<z.ZodString>;
|
|
821
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
822
|
+
}, z.core.$strip>>>;
|
|
823
|
+
ownsRights: z.ZodBoolean;
|
|
824
|
+
noHarmfulContent: z.ZodBoolean;
|
|
825
|
+
providesSupport: z.ZodBoolean;
|
|
826
|
+
agreesToTerms: z.ZodBoolean;
|
|
827
|
+
supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
|
|
828
|
+
supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
829
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
830
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
831
|
+
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
832
|
+
}, z.core.$strip>>;
|
|
833
|
+
}, z.core.$strip>;
|
|
834
|
+
export type UserWithProductsEntity = z.infer<typeof UserWithProductsEntitySchema>;
|
|
835
|
+
/**
|
|
836
|
+
* --------------------------------
|
|
837
|
+
* FOLLOW SYSTEM
|
|
838
|
+
* --------------------------------
|
|
839
|
+
*/
|
|
840
|
+
declare const FollowMeta: z.ZodObject<{
|
|
841
|
+
isFollowing: z.ZodBoolean;
|
|
842
|
+
followsYou: z.ZodBoolean;
|
|
843
|
+
}, z.core.$strip>;
|
|
844
|
+
export type FollowMeta = z.infer<typeof FollowMeta>;
|
|
781
845
|
export declare const UserWithFollowingEntitySchema: z.ZodObject<{
|
|
782
846
|
email: z.ZodEmail;
|
|
783
847
|
username: z.ZodDefault<z.ZodString>;
|
|
@@ -806,6 +870,7 @@ export declare const UserWithFollowingEntitySchema: z.ZodObject<{
|
|
|
806
870
|
followsYou: z.ZodBoolean;
|
|
807
871
|
}, z.core.$strip>>;
|
|
808
872
|
}, z.core.$strip>;
|
|
873
|
+
export type UserWithFollowingEntity = z.infer<typeof UserWithFollowingEntitySchema>;
|
|
809
874
|
export declare const UserWithFollowersEntitySchema: z.ZodObject<{
|
|
810
875
|
email: z.ZodEmail;
|
|
811
876
|
username: z.ZodDefault<z.ZodString>;
|
|
@@ -834,6 +899,17 @@ export declare const UserWithFollowersEntitySchema: z.ZodObject<{
|
|
|
834
899
|
followsYou: z.ZodBoolean;
|
|
835
900
|
}, z.core.$strip>>;
|
|
836
901
|
}, z.core.$strip>;
|
|
902
|
+
export type UserWithFollowersEntity = z.infer<typeof UserWithFollowersEntitySchema>;
|
|
903
|
+
/**
|
|
904
|
+
* --------------------------------
|
|
905
|
+
* SEARCH USERS
|
|
906
|
+
* --------------------------------
|
|
907
|
+
*/
|
|
908
|
+
declare const CursorPaginationInput: z.ZodObject<{
|
|
909
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
910
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
911
|
+
}, z.core.$strip>;
|
|
912
|
+
export type CursorPaginationInput = z.infer<typeof CursorPaginationInput>;
|
|
837
913
|
export declare const SearchUsersInputSchema: z.ZodObject<{
|
|
838
914
|
cursor: z.ZodOptional<z.ZodString>;
|
|
839
915
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -847,6 +923,7 @@ export declare const SearchUsersInputSchema: z.ZodObject<{
|
|
|
847
923
|
disciplines: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodString>>>;
|
|
848
924
|
locations: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodString>>>;
|
|
849
925
|
}, z.core.$strip>;
|
|
926
|
+
export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
|
|
850
927
|
export declare const SearchUsersOutputSchema: z.ZodObject<{
|
|
851
928
|
users: z.ZodArray<z.ZodObject<{
|
|
852
929
|
email: z.ZodEmail;
|
|
@@ -867,6 +944,7 @@ export declare const SearchUsersOutputSchema: z.ZodObject<{
|
|
|
867
944
|
}, z.core.$strip>>;
|
|
868
945
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
869
946
|
}, z.core.$strip>;
|
|
947
|
+
export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
|
|
870
948
|
/**
|
|
871
949
|
* --------------------------------
|
|
872
950
|
* ACTIVITY
|
|
@@ -881,6 +959,7 @@ export declare const GetUserActivityInputSchema: z.ZodObject<{
|
|
|
881
959
|
VIEW: "VIEW";
|
|
882
960
|
}>;
|
|
883
961
|
}, z.core.$strip>;
|
|
962
|
+
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
884
963
|
export declare const GetUserActivityOutputSchema: z.ZodArray<z.ZodObject<{
|
|
885
964
|
parentId: z.ZodCUID2;
|
|
886
965
|
parentType: z.ZodEnum<{
|
|
@@ -896,9 +975,10 @@ export declare const GetUserActivityOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
896
975
|
JOB_APPLICATION: "JOB_APPLICATION";
|
|
897
976
|
}>;
|
|
898
977
|
}, z.core.$strip>>;
|
|
978
|
+
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
899
979
|
/**
|
|
900
980
|
* --------------------------------
|
|
901
|
-
* SEARCH DOCUMENT
|
|
981
|
+
* SEARCH DOCUMENT
|
|
902
982
|
* --------------------------------
|
|
903
983
|
*/
|
|
904
984
|
export declare const UserSearchDocumentSchema: z.ZodObject<{
|
|
@@ -918,3 +998,5 @@ export declare const UserSearchDocumentSchema: z.ZodObject<{
|
|
|
918
998
|
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
919
999
|
createdAt: z.ZodNullable<z.ZodISODateTime>;
|
|
920
1000
|
}, z.core.$strip>;
|
|
1001
|
+
export type UserSearchDocument = z.infer<typeof UserSearchDocumentSchema>;
|
|
1002
|
+
export {};
|
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.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithJobBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.
|
|
3
|
+
exports.UserSearchDocumentSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithProductsEntitySchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = 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");
|
|
@@ -78,9 +78,6 @@ exports.UserWithProjectsEntitySchema = UserWithId.extend({
|
|
|
78
78
|
exports.UserWithPostsEntitySchema = UserWithId.extend({
|
|
79
79
|
posts: zod_openapi_1.z.array(post_1.PostWithFilesEntitySchema),
|
|
80
80
|
});
|
|
81
|
-
exports.UserWithProductsEntitySchema = UserWithId.extend({
|
|
82
|
-
products: zod_openapi_1.z.array(product_1.ProductEntitySchema),
|
|
83
|
-
});
|
|
84
81
|
exports.UserWithProjectLikesEntitySchema = UserWithId.extend({
|
|
85
82
|
projectLikes: zod_openapi_1.z.array(like_1.LikeEntitySchema.extend({
|
|
86
83
|
project: project_1.ProjectEntitySchema.pick({
|
|
@@ -129,6 +126,10 @@ exports.UserWithPostBookmarksEntitySchema = UserWithId.extend({
|
|
|
129
126
|
post: post_1.PostWithFilesEntitySchema,
|
|
130
127
|
})),
|
|
131
128
|
});
|
|
129
|
+
exports.UserWithProductsEntitySchema = zod_openapi_1.z.object({
|
|
130
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
131
|
+
products: zod_openapi_1.z.array(product_1.ProductEntitySchema),
|
|
132
|
+
});
|
|
132
133
|
/**
|
|
133
134
|
* --------------------------------
|
|
134
135
|
* FOLLOW SYSTEM
|
|
@@ -146,18 +147,13 @@ exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
|
|
|
146
147
|
});
|
|
147
148
|
/**
|
|
148
149
|
* --------------------------------
|
|
149
|
-
*
|
|
150
|
+
* SEARCH USERS
|
|
150
151
|
* --------------------------------
|
|
151
152
|
*/
|
|
152
153
|
const CursorPaginationInput = zod_openapi_1.z.object({
|
|
153
154
|
cursor: zod_openapi_1.z.string().optional(),
|
|
154
155
|
limit: zod_openapi_1.z.coerce.number().int().min(1).max(100).default(20),
|
|
155
156
|
});
|
|
156
|
-
/**
|
|
157
|
-
* --------------------------------
|
|
158
|
-
* SEARCH USERS
|
|
159
|
-
* --------------------------------
|
|
160
|
-
*/
|
|
161
157
|
const coerceArray = (val) => {
|
|
162
158
|
if (typeof val === "string")
|
|
163
159
|
return val === "" ? [] : val.split(",");
|
|
@@ -195,7 +191,7 @@ exports.GetUserActivityOutputSchema = zod_openapi_1.z.array(zod_openapi_1.z.obje
|
|
|
195
191
|
}));
|
|
196
192
|
/**
|
|
197
193
|
* --------------------------------
|
|
198
|
-
* SEARCH DOCUMENT
|
|
194
|
+
* SEARCH DOCUMENT
|
|
199
195
|
* --------------------------------
|
|
200
196
|
*/
|
|
201
197
|
exports.UserSearchDocumentSchema = zod_openapi_1.z.object({
|
package/package.json
CHANGED
package/src/schemas/user.ts
CHANGED
|
@@ -50,7 +50,7 @@ const UserShape = z.object({
|
|
|
50
50
|
),
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
type UserShapeType = z.infer<typeof UserShape>;
|
|
53
|
+
export type UserShapeType = z.infer<typeof UserShape>;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* --------------------------------
|
|
@@ -102,6 +102,8 @@ export const UserStatsEntitySchema = z.object({
|
|
|
102
102
|
followingIds: z.array(z.cuid2()),
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
+
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
106
|
+
|
|
105
107
|
/**
|
|
106
108
|
* --------------------------------
|
|
107
109
|
* COMPOSED ENTITIES
|
|
@@ -109,18 +111,19 @@ export const UserStatsEntitySchema = z.object({
|
|
|
109
111
|
*/
|
|
110
112
|
|
|
111
113
|
const UserWithId = z.object({ userId: z.cuid2() });
|
|
114
|
+
export type UserWithIdType = z.infer<typeof UserWithId>;
|
|
112
115
|
|
|
113
116
|
export const UserWithProjectsEntitySchema = UserWithId.extend({
|
|
114
117
|
projects: z.array(ProjectEntitySchema.omit({ overview: true })),
|
|
115
118
|
});
|
|
119
|
+
export type UserWithProjectsEntity = z.infer<
|
|
120
|
+
typeof UserWithProjectsEntitySchema
|
|
121
|
+
>;
|
|
116
122
|
|
|
117
123
|
export const UserWithPostsEntitySchema = UserWithId.extend({
|
|
118
124
|
posts: z.array(PostWithFilesEntitySchema),
|
|
119
125
|
});
|
|
120
|
-
|
|
121
|
-
export const UserWithProductsEntitySchema = UserWithId.extend({
|
|
122
|
-
products: z.array(ProductEntitySchema),
|
|
123
|
-
});
|
|
126
|
+
export type UserWithPostsEntity = z.infer<typeof UserWithPostsEntitySchema>;
|
|
124
127
|
|
|
125
128
|
export const UserWithProjectLikesEntitySchema = UserWithId.extend({
|
|
126
129
|
projectLikes: z.array(
|
|
@@ -137,6 +140,9 @@ export const UserWithProjectLikesEntitySchema = UserWithId.extend({
|
|
|
137
140
|
}),
|
|
138
141
|
),
|
|
139
142
|
});
|
|
143
|
+
export type UserWithProjectLikesEntity = z.infer<
|
|
144
|
+
typeof UserWithProjectLikesEntitySchema
|
|
145
|
+
>;
|
|
140
146
|
|
|
141
147
|
export const UserWithPostLikesEntitySchema = UserWithId.extend({
|
|
142
148
|
postLikes: z.array(
|
|
@@ -153,6 +159,9 @@ export const UserWithPostLikesEntitySchema = UserWithId.extend({
|
|
|
153
159
|
}),
|
|
154
160
|
),
|
|
155
161
|
});
|
|
162
|
+
export type UserWithPostLikesEntity = z.infer<
|
|
163
|
+
typeof UserWithPostLikesEntitySchema
|
|
164
|
+
>;
|
|
156
165
|
|
|
157
166
|
/**
|
|
158
167
|
* --------------------------------
|
|
@@ -169,6 +178,9 @@ export const UserWithJobBookmarksEntitySchema = UserWithId.extend({
|
|
|
169
178
|
}),
|
|
170
179
|
),
|
|
171
180
|
});
|
|
181
|
+
export type UserWithJobBookmarksEntity = z.infer<
|
|
182
|
+
typeof UserWithJobBookmarksEntitySchema
|
|
183
|
+
>;
|
|
172
184
|
|
|
173
185
|
export const UserWithProjectBookmarksEntitySchema = UserWithId.extend({
|
|
174
186
|
projectBookmarks: z.array(
|
|
@@ -177,6 +189,9 @@ export const UserWithProjectBookmarksEntitySchema = UserWithId.extend({
|
|
|
177
189
|
}),
|
|
178
190
|
),
|
|
179
191
|
});
|
|
192
|
+
export type UserWithProjectBookmarksEntity = z.infer<
|
|
193
|
+
typeof UserWithProjectBookmarksEntitySchema
|
|
194
|
+
>;
|
|
180
195
|
|
|
181
196
|
export const UserWithPostBookmarksEntitySchema = UserWithId.extend({
|
|
182
197
|
postBookmarks: z.array(
|
|
@@ -185,6 +200,17 @@ export const UserWithPostBookmarksEntitySchema = UserWithId.extend({
|
|
|
185
200
|
}),
|
|
186
201
|
),
|
|
187
202
|
});
|
|
203
|
+
export type UserWithPostBookmarksEntity = z.infer<
|
|
204
|
+
typeof UserWithPostBookmarksEntitySchema
|
|
205
|
+
>;
|
|
206
|
+
|
|
207
|
+
export const UserWithProductsEntitySchema = z.object({
|
|
208
|
+
userId: z.cuid2(),
|
|
209
|
+
products: z.array(ProductEntitySchema),
|
|
210
|
+
});
|
|
211
|
+
export type UserWithProductsEntity = z.infer<
|
|
212
|
+
typeof UserWithProductsEntitySchema
|
|
213
|
+
>;
|
|
188
214
|
|
|
189
215
|
/**
|
|
190
216
|
* --------------------------------
|
|
@@ -196,18 +222,25 @@ const FollowMeta = z.object({
|
|
|
196
222
|
isFollowing: z.boolean(),
|
|
197
223
|
followsYou: z.boolean(),
|
|
198
224
|
});
|
|
225
|
+
export type FollowMeta = z.infer<typeof FollowMeta>;
|
|
199
226
|
|
|
200
227
|
export const UserWithFollowingEntitySchema = MinimalUserSchema.extend({
|
|
201
228
|
following: z.array(MinimalUserSchema.extend(FollowMeta.shape)),
|
|
202
229
|
});
|
|
230
|
+
export type UserWithFollowingEntity = z.infer<
|
|
231
|
+
typeof UserWithFollowingEntitySchema
|
|
232
|
+
>;
|
|
203
233
|
|
|
204
234
|
export const UserWithFollowersEntitySchema = MinimalUserSchema.extend({
|
|
205
235
|
followers: z.array(MinimalUserSchema.extend(FollowMeta.shape)),
|
|
206
236
|
});
|
|
237
|
+
export type UserWithFollowersEntity = z.infer<
|
|
238
|
+
typeof UserWithFollowersEntitySchema
|
|
239
|
+
>;
|
|
207
240
|
|
|
208
241
|
/**
|
|
209
242
|
* --------------------------------
|
|
210
|
-
*
|
|
243
|
+
* SEARCH USERS
|
|
211
244
|
* --------------------------------
|
|
212
245
|
*/
|
|
213
246
|
|
|
@@ -215,12 +248,7 @@ const CursorPaginationInput = z.object({
|
|
|
215
248
|
cursor: z.string().optional(),
|
|
216
249
|
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
217
250
|
});
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* --------------------------------
|
|
221
|
-
* SEARCH USERS
|
|
222
|
-
* --------------------------------
|
|
223
|
-
*/
|
|
251
|
+
export type CursorPaginationInput = z.infer<typeof CursorPaginationInput>;
|
|
224
252
|
|
|
225
253
|
const coerceArray = (val: unknown) => {
|
|
226
254
|
if (typeof val === "string") return val === "" ? [] : val.split(",");
|
|
@@ -239,6 +267,7 @@ export const SearchUsersInputSchema = z.object({
|
|
|
239
267
|
locations: z.preprocess(coerceArray, z.array(z.string())).optional(),
|
|
240
268
|
...CursorPaginationInput.shape,
|
|
241
269
|
});
|
|
270
|
+
export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
|
|
242
271
|
|
|
243
272
|
export const SearchUsersOutputSchema = z.object({
|
|
244
273
|
users: z.array(
|
|
@@ -251,6 +280,7 @@ export const SearchUsersOutputSchema = z.object({
|
|
|
251
280
|
),
|
|
252
281
|
nextCursor: z.string().optional(),
|
|
253
282
|
});
|
|
283
|
+
export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
|
|
254
284
|
|
|
255
285
|
/**
|
|
256
286
|
* --------------------------------
|
|
@@ -263,6 +293,7 @@ export const GetUserActivityInputSchema = z.object({
|
|
|
263
293
|
Object.values(ACTIVITY_TYPES) as [ActivityType, ...ActivityType[]],
|
|
264
294
|
),
|
|
265
295
|
});
|
|
296
|
+
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
266
297
|
|
|
267
298
|
export const GetUserActivityOutputSchema = z.array(
|
|
268
299
|
z.object({
|
|
@@ -275,10 +306,11 @@ export const GetUserActivityOutputSchema = z.array(
|
|
|
275
306
|
),
|
|
276
307
|
}),
|
|
277
308
|
);
|
|
309
|
+
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
278
310
|
|
|
279
311
|
/**
|
|
280
312
|
* --------------------------------
|
|
281
|
-
* SEARCH DOCUMENT
|
|
313
|
+
* SEARCH DOCUMENT
|
|
282
314
|
* --------------------------------
|
|
283
315
|
*/
|
|
284
316
|
|
|
@@ -294,3 +326,4 @@ export const UserSearchDocumentSchema = z.object({
|
|
|
294
326
|
updatedAt: z.iso.datetime().nullable(),
|
|
295
327
|
createdAt: z.iso.datetime().nullable(),
|
|
296
328
|
});
|
|
329
|
+
export type UserSearchDocument = z.infer<typeof UserSearchDocumentSchema>;
|