@zyacreatives/shared 2.3.0 → 2.3.2
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/constants.d.ts +1 -0
- package/dist/constants.js +7 -1
- package/dist/schemas/product.d.ts +4 -0
- package/dist/schemas/user.d.ts +67 -0
- package/dist/schemas/user.js +6 -1
- package/package.json +1 -1
- package/src/constants.ts +7 -1
- package/src/schemas/user.ts +10 -0
package/dist/constants.d.ts
CHANGED
|
@@ -193,6 +193,7 @@ export declare const JOB_STATUS: {
|
|
|
193
193
|
};
|
|
194
194
|
export declare const PRODUCT_STATUS: {
|
|
195
195
|
readonly ACTIVE: "ACTIVE";
|
|
196
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
196
197
|
readonly DRAFT: "DRAFT";
|
|
197
198
|
readonly ARCHIVED: "ARCHIVED";
|
|
198
199
|
readonly DELETED: "DELETED";
|
package/dist/constants.js
CHANGED
|
@@ -189,7 +189,13 @@ exports.JOB_STATUS = {
|
|
|
189
189
|
ARCHIVED: "ARCHIVED",
|
|
190
190
|
DELETED: "DELETED",
|
|
191
191
|
};
|
|
192
|
-
exports.PRODUCT_STATUS =
|
|
192
|
+
exports.PRODUCT_STATUS = {
|
|
193
|
+
ACTIVE: "ACTIVE",
|
|
194
|
+
UNDER_REVIEW: "UNDER_REVIEW",
|
|
195
|
+
DRAFT: "DRAFT",
|
|
196
|
+
ARCHIVED: "ARCHIVED",
|
|
197
|
+
DELETED: "DELETED",
|
|
198
|
+
};
|
|
193
199
|
exports.MESSAGE_REQUEST_STATUS = {
|
|
194
200
|
PENDING: "PENDING",
|
|
195
201
|
ACCEPTED: "ACCEPTED",
|
|
@@ -40,6 +40,7 @@ export declare const BaseProductSchema: z.ZodObject<{
|
|
|
40
40
|
deletedAt: z.ZodNullable<z.ZodDate>;
|
|
41
41
|
status: z.ZodDefault<z.ZodEnum<{
|
|
42
42
|
readonly ACTIVE: "ACTIVE";
|
|
43
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
43
44
|
readonly DRAFT: "DRAFT";
|
|
44
45
|
readonly ARCHIVED: "ARCHIVED";
|
|
45
46
|
readonly DELETED: "DELETED";
|
|
@@ -93,6 +94,7 @@ export declare const CreateProductInputSchema: z.ZodObject<{
|
|
|
93
94
|
keyFeatures: z.ZodString;
|
|
94
95
|
status: z.ZodDefault<z.ZodEnum<{
|
|
95
96
|
readonly ACTIVE: "ACTIVE";
|
|
97
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
96
98
|
readonly DRAFT: "DRAFT";
|
|
97
99
|
readonly ARCHIVED: "ARCHIVED";
|
|
98
100
|
readonly DELETED: "DELETED";
|
|
@@ -159,6 +161,7 @@ export declare const UpdateProductInputSchema: z.ZodObject<{
|
|
|
159
161
|
keyFeatures: z.ZodOptional<z.ZodString>;
|
|
160
162
|
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
161
163
|
readonly ACTIVE: "ACTIVE";
|
|
164
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
162
165
|
readonly DRAFT: "DRAFT";
|
|
163
166
|
readonly ARCHIVED: "ARCHIVED";
|
|
164
167
|
readonly DELETED: "DELETED";
|
|
@@ -228,6 +231,7 @@ export declare const ProductEntitySchema: z.ZodObject<{
|
|
|
228
231
|
keyFeatures: z.ZodString;
|
|
229
232
|
status: z.ZodDefault<z.ZodEnum<{
|
|
230
233
|
readonly ACTIVE: "ACTIVE";
|
|
234
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
231
235
|
readonly DRAFT: "DRAFT";
|
|
232
236
|
readonly ARCHIVED: "ARCHIVED";
|
|
233
237
|
readonly DELETED: "DELETED";
|
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>>;
|
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.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,6 +158,10 @@ 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({
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -217,7 +217,13 @@ export const JOB_STATUS = {
|
|
|
217
217
|
DELETED: "DELETED",
|
|
218
218
|
} as const;
|
|
219
219
|
|
|
220
|
-
export const PRODUCT_STATUS =
|
|
220
|
+
export const PRODUCT_STATUS = {
|
|
221
|
+
ACTIVE: "ACTIVE",
|
|
222
|
+
UNDER_REVIEW: "UNDER_REVIEW",
|
|
223
|
+
DRAFT: "DRAFT",
|
|
224
|
+
ARCHIVED: "ARCHIVED",
|
|
225
|
+
DELETED: "DELETED",
|
|
226
|
+
} as const;
|
|
221
227
|
|
|
222
228
|
export const MESSAGE_REQUEST_STATUS = {
|
|
223
229
|
PENDING: "PENDING",
|
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 =
|