@zyacreatives/shared 2.3.1 → 2.3.3
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 +137 -0
- package/dist/schemas/user.js +10 -1
- package/package.json +1 -1
- package/src/schemas/user.ts +19 -0
package/dist/schemas/user.d.ts
CHANGED
|
@@ -629,6 +629,73 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
629
629
|
}, z.core.$strip>;
|
|
630
630
|
}, z.core.$strip>>;
|
|
631
631
|
}, z.core.$strip>;
|
|
632
|
+
export declare const UserWithProductsEntitySchema: z.ZodObject<{
|
|
633
|
+
userId: z.ZodCUID2;
|
|
634
|
+
products: z.ZodArray<z.ZodObject<{
|
|
635
|
+
id: z.ZodCUID2;
|
|
636
|
+
sellerId: z.ZodCUID2;
|
|
637
|
+
sellerUsername: z.ZodString;
|
|
638
|
+
sellerName: z.ZodString;
|
|
639
|
+
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
640
|
+
title: z.ZodString;
|
|
641
|
+
description: z.ZodString;
|
|
642
|
+
keyFeatures: z.ZodString;
|
|
643
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
644
|
+
readonly ACTIVE: "ACTIVE";
|
|
645
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
646
|
+
readonly DRAFT: "DRAFT";
|
|
647
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
648
|
+
readonly DELETED: "DELETED";
|
|
649
|
+
}>>;
|
|
650
|
+
category: z.ZodString;
|
|
651
|
+
subcategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
652
|
+
tags: z.ZodArray<z.ZodString>;
|
|
653
|
+
coverImages: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
654
|
+
fileId: z.ZodCUID2;
|
|
655
|
+
isThumbnail: z.ZodDefault<z.ZodBoolean>;
|
|
656
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
657
|
+
}, z.core.$strip>>>;
|
|
658
|
+
productFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
659
|
+
fileId: z.ZodCUID2;
|
|
660
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
661
|
+
}, z.core.$strip>>>;
|
|
662
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodURL>>;
|
|
663
|
+
pricingModel: z.ZodEnum<{
|
|
664
|
+
readonly FREE: "Free";
|
|
665
|
+
readonly FIXED: "Fixed";
|
|
666
|
+
readonly PWYW: "Pay What You Want";
|
|
667
|
+
}>;
|
|
668
|
+
currency: z.ZodEnum<{
|
|
669
|
+
readonly USD: "USD (United States Dollar)";
|
|
670
|
+
readonly EUR: "EUR (Euro)";
|
|
671
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
672
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
673
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
674
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
675
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
676
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
677
|
+
readonly INR: "INR (Indian Rupee)";
|
|
678
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
679
|
+
}>;
|
|
680
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
681
|
+
suggestedPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
682
|
+
discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
683
|
+
discountType: z.ZodEnum<{
|
|
684
|
+
readonly FIXED_AMOUNT: "Fixed Amount";
|
|
685
|
+
readonly PERCENTAGE: "Percentage";
|
|
686
|
+
}>;
|
|
687
|
+
amount: z.ZodNumber;
|
|
688
|
+
discountCode: z.ZodOptional<z.ZodString>;
|
|
689
|
+
expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
690
|
+
}, z.core.$strip>>>;
|
|
691
|
+
supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
|
|
692
|
+
supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
693
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
694
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
695
|
+
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
696
|
+
}, z.core.$strip>>;
|
|
697
|
+
}, z.core.$strip>;
|
|
698
|
+
export type UserWithProductsEntity = z.infer<typeof UserWithProductsEntitySchema>;
|
|
632
699
|
export declare const GetUserWithProjectBookmarksInputSchema: z.ZodObject<{
|
|
633
700
|
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
634
701
|
limit: z.ZodNullable<z.ZodOptional<z.ZodInt>>;
|
|
@@ -710,6 +777,76 @@ export declare const GetUserWithProjectBookmarksOutputSchema: z.ZodObject<{
|
|
|
710
777
|
}, z.core.$strip>;
|
|
711
778
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
712
779
|
}, z.core.$strip>;
|
|
780
|
+
export declare const GetUserWithProductsOutputSchema: z.ZodObject<{
|
|
781
|
+
products: z.ZodObject<{
|
|
782
|
+
userId: z.ZodCUID2;
|
|
783
|
+
products: z.ZodArray<z.ZodObject<{
|
|
784
|
+
id: z.ZodCUID2;
|
|
785
|
+
sellerId: z.ZodCUID2;
|
|
786
|
+
sellerUsername: z.ZodString;
|
|
787
|
+
sellerName: z.ZodString;
|
|
788
|
+
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
789
|
+
title: z.ZodString;
|
|
790
|
+
description: z.ZodString;
|
|
791
|
+
keyFeatures: z.ZodString;
|
|
792
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
793
|
+
readonly ACTIVE: "ACTIVE";
|
|
794
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
795
|
+
readonly DRAFT: "DRAFT";
|
|
796
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
797
|
+
readonly DELETED: "DELETED";
|
|
798
|
+
}>>;
|
|
799
|
+
category: z.ZodString;
|
|
800
|
+
subcategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
801
|
+
tags: z.ZodArray<z.ZodString>;
|
|
802
|
+
coverImages: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
803
|
+
fileId: z.ZodCUID2;
|
|
804
|
+
isThumbnail: z.ZodDefault<z.ZodBoolean>;
|
|
805
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
806
|
+
}, z.core.$strip>>>;
|
|
807
|
+
productFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
808
|
+
fileId: z.ZodCUID2;
|
|
809
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
810
|
+
}, z.core.$strip>>>;
|
|
811
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodURL>>;
|
|
812
|
+
pricingModel: z.ZodEnum<{
|
|
813
|
+
readonly FREE: "Free";
|
|
814
|
+
readonly FIXED: "Fixed";
|
|
815
|
+
readonly PWYW: "Pay What You Want";
|
|
816
|
+
}>;
|
|
817
|
+
currency: z.ZodEnum<{
|
|
818
|
+
readonly USD: "USD (United States Dollar)";
|
|
819
|
+
readonly EUR: "EUR (Euro)";
|
|
820
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
821
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
822
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
823
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
824
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
825
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
826
|
+
readonly INR: "INR (Indian Rupee)";
|
|
827
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
828
|
+
}>;
|
|
829
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
830
|
+
suggestedPrice: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
831
|
+
discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
832
|
+
discountType: z.ZodEnum<{
|
|
833
|
+
readonly FIXED_AMOUNT: "Fixed Amount";
|
|
834
|
+
readonly PERCENTAGE: "Percentage";
|
|
835
|
+
}>;
|
|
836
|
+
amount: z.ZodNumber;
|
|
837
|
+
discountCode: z.ZodOptional<z.ZodString>;
|
|
838
|
+
expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
839
|
+
}, z.core.$strip>>>;
|
|
840
|
+
supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
|
|
841
|
+
supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
842
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
843
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
844
|
+
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
845
|
+
}, z.core.$strip>>;
|
|
846
|
+
}, z.core.$strip>;
|
|
847
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
848
|
+
}, z.core.$strip>;
|
|
849
|
+
export type UserWithProductsOutput = z.infer<typeof GetUserWithProductsOutputSchema>;
|
|
713
850
|
export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
714
851
|
bookmarks: z.ZodArray<z.ZodObject<{
|
|
715
852
|
id: z.ZodCUID2;
|
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.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;
|
|
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.GetUserWithProductsOutputSchema = exports.GetUserWithProjectBookmarksOutputSchema = exports.GetUserWithPostBookmarksInputSchema = exports.GetUserWithProjectBookmarksInputSchema = exports.UserWithProductsEntitySchema = 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,7 @@ 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
|
+
const product_1 = require("./product");
|
|
14
15
|
// ==========================================
|
|
15
16
|
// 1. CORE USER ENTITIES
|
|
16
17
|
// ==========================================
|
|
@@ -157,12 +158,20 @@ exports.UserWithPostBookmarksEntitySchema = zod_openapi_1.z.object({
|
|
|
157
158
|
post: post_1.PostWithFilesEntitySchema,
|
|
158
159
|
})),
|
|
159
160
|
});
|
|
161
|
+
exports.UserWithProductsEntitySchema = zod_openapi_1.z.object({
|
|
162
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
163
|
+
products: zod_openapi_1.z.array(product_1.ProductEntitySchema),
|
|
164
|
+
});
|
|
160
165
|
exports.GetUserWithProjectBookmarksInputSchema = exports.UserWithJobBookmarksInputSchema;
|
|
161
166
|
exports.GetUserWithPostBookmarksInputSchema = exports.UserWithJobBookmarksInputSchema;
|
|
162
167
|
exports.GetUserWithProjectBookmarksOutputSchema = zod_openapi_1.z.object({
|
|
163
168
|
bookmarks: exports.UserWithProjectBookmarksEntitySchema,
|
|
164
169
|
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
165
170
|
});
|
|
171
|
+
exports.GetUserWithProductsOutputSchema = zod_openapi_1.z.object({
|
|
172
|
+
products: exports.UserWithProductsEntitySchema,
|
|
173
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
174
|
+
});
|
|
166
175
|
exports.GetUserWithPostBookmarksOutputSchema = zod_openapi_1.z.object({
|
|
167
176
|
bookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
|
|
168
177
|
post: post_1.FeedPostEntitySchema,
|
package/package.json
CHANGED
package/src/schemas/user.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
PostWithFilesEntitySchema,
|
|
27
27
|
} from "./post";
|
|
28
28
|
import { JobEntitySchema, JobSearchDocumentSchema } from "./job";
|
|
29
|
+
import { ProductEntitySchema } from "./product";
|
|
29
30
|
|
|
30
31
|
// ==========================================
|
|
31
32
|
// 1. CORE USER ENTITIES
|
|
@@ -205,6 +206,15 @@ export const UserWithPostBookmarksEntitySchema = z.object({
|
|
|
205
206
|
),
|
|
206
207
|
});
|
|
207
208
|
|
|
209
|
+
export const UserWithProductsEntitySchema = z.object({
|
|
210
|
+
userId: z.cuid2(),
|
|
211
|
+
products: z.array(ProductEntitySchema),
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
export type UserWithProductsEntity = z.infer<
|
|
215
|
+
typeof UserWithProductsEntitySchema
|
|
216
|
+
>;
|
|
217
|
+
|
|
208
218
|
export const GetUserWithProjectBookmarksInputSchema =
|
|
209
219
|
UserWithJobBookmarksInputSchema;
|
|
210
220
|
export const GetUserWithPostBookmarksInputSchema =
|
|
@@ -215,6 +225,15 @@ export const GetUserWithProjectBookmarksOutputSchema = z.object({
|
|
|
215
225
|
nextCursor: z.string().nullable(),
|
|
216
226
|
});
|
|
217
227
|
|
|
228
|
+
export const GetUserWithProductsOutputSchema = z.object({
|
|
229
|
+
products: UserWithProductsEntitySchema,
|
|
230
|
+
nextCursor: z.string().nullable(),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export type UserWithProductsOutput = z.infer<
|
|
234
|
+
typeof GetUserWithProductsOutputSchema
|
|
235
|
+
>;
|
|
236
|
+
|
|
218
237
|
export const GetUserWithPostBookmarksOutputSchema = z.object({
|
|
219
238
|
bookmarks: z.array(
|
|
220
239
|
BookmarkEntitySchema.extend({
|