@zyacreatives/shared 2.1.28 → 2.1.31
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 +12 -4
- package/dist/constants.js +16 -6
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/job.d.ts +9 -0
- package/dist/schemas/job.js +13 -3
- package/dist/schemas/notification.d.ts +106 -0
- package/dist/schemas/notification.js +57 -0
- package/dist/schemas/user.d.ts +0 -16
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/notification.d.ts +9 -0
- package/dist/types/notification.js +2 -0
- package/package.json +1 -1
- package/src/constants.ts +330 -316
- package/src/schemas/index.ts +1 -0
- package/src/schemas/job.ts +298 -256
- package/src/schemas/notification.ts +61 -0
- package/src/types/index.ts +1 -0
- package/src/types/notification.ts +34 -0
- package/dist/types/enums.d.ts +0 -97
- package/dist/types/enums.js +0 -110
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { ACTIVITY_PARENT_TYPES, NOTIFICATION_TYPES } from "../constants";
|
|
3
|
+
|
|
4
|
+
export const NotificationEntitySchema = z
|
|
5
|
+
.object({
|
|
6
|
+
id: z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
7
|
+
recipientId: z.cuid2().openapi({ example: "user_recipient_123" }),
|
|
8
|
+
actorId: z.cuid2().openapi({ example: "user_actor_456" }),
|
|
9
|
+
type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
|
|
10
|
+
parentId: z.cuid2().optional().nullable(),
|
|
11
|
+
parentType: z
|
|
12
|
+
.enum(Object.values(ACTIVITY_PARENT_TYPES) as [string, ...string[]])
|
|
13
|
+
.optional()
|
|
14
|
+
.nullable(),
|
|
15
|
+
isRead: z.boolean().default(false).openapi({ example: false }),
|
|
16
|
+
createdAt: z.coerce
|
|
17
|
+
.date()
|
|
18
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
19
|
+
deletedAt: z.coerce.date().optional().nullable(),
|
|
20
|
+
})
|
|
21
|
+
.openapi("NotificationEntity");
|
|
22
|
+
|
|
23
|
+
export const MinimalNotificationEntitySchema = z.object({
|
|
24
|
+
id: z.cuid2(),
|
|
25
|
+
recipientId: z.cuid2(),
|
|
26
|
+
actorId: z.cuid2(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const NotificationDetailsEntitySchema = NotificationEntitySchema.extend({
|
|
30
|
+
itemTitle: z.string().optional(),
|
|
31
|
+
itemContent: z.string().optional(),
|
|
32
|
+
itemImgUrl: z.string().optional(),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const ListNotificationsInputSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
type: z
|
|
38
|
+
.enum(NOTIFICATION_TYPES)
|
|
39
|
+
.openapi({ example: "LIKE" })
|
|
40
|
+
.optional(),
|
|
41
|
+
cursor: z.string().optional(),
|
|
42
|
+
unreadOnly: z
|
|
43
|
+
.preprocess((val) => val === "true" || val === true, z.boolean())
|
|
44
|
+
.optional()
|
|
45
|
+
.default(false),
|
|
46
|
+
})
|
|
47
|
+
.openapi("ListNotificationsInput");
|
|
48
|
+
|
|
49
|
+
export const ListNotificationsOutputSchema = z.object({
|
|
50
|
+
notifications: z.array(NotificationDetailsEntitySchema),
|
|
51
|
+
nextCursor: z.string().optional().nullable(),
|
|
52
|
+
unreadCount: z.number().int().openapi({ example: 5 }),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const MarkReadInputSchema = z.object({
|
|
56
|
+
notificationIds: z.array(z.cuid2()).min(1),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const NotificationCountOutputSchema = z.object({
|
|
60
|
+
unreadCount: z.number().int().openapi({ example: 12 }),
|
|
61
|
+
});
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import type {
|
|
3
|
+
NotificationEntitySchema,
|
|
4
|
+
MinimalNotificationEntitySchema,
|
|
5
|
+
NotificationDetailsEntitySchema,
|
|
6
|
+
ListNotificationsInputSchema,
|
|
7
|
+
ListNotificationsOutputSchema,
|
|
8
|
+
MarkReadInputSchema,
|
|
9
|
+
NotificationCountOutputSchema,
|
|
10
|
+
} from "../schemas/notification";
|
|
11
|
+
|
|
12
|
+
export type NotificationEntity = z.infer<typeof NotificationEntitySchema>;
|
|
13
|
+
|
|
14
|
+
export type MinimalNotificationEntity = z.infer<
|
|
15
|
+
typeof MinimalNotificationEntitySchema
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type NotificationDetailsEntity = z.infer<
|
|
19
|
+
typeof NotificationDetailsEntitySchema
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type ListNotificationsInput = z.infer<
|
|
23
|
+
typeof ListNotificationsInputSchema
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type ListNotificationsOutput = z.infer<
|
|
27
|
+
typeof ListNotificationsOutputSchema
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export type MarkReadInput = z.infer<typeof MarkReadInputSchema>;
|
|
31
|
+
|
|
32
|
+
export type NotificationCountOutput = z.infer<
|
|
33
|
+
typeof NotificationCountOutputSchema
|
|
34
|
+
>;
|
package/dist/types/enums.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
export declare enum RoleEnum {
|
|
2
|
-
CREATIVE = "CREATIVE",
|
|
3
|
-
BRAND = "BRAND",
|
|
4
|
-
INVESTOR = "INVESTOR",
|
|
5
|
-
ADMIN = "ADMIN"
|
|
6
|
-
}
|
|
7
|
-
export declare enum UserStatusEnum {
|
|
8
|
-
ACTIVE = "ACTIVE",
|
|
9
|
-
SUSPENDED = "SUSPENDED",
|
|
10
|
-
DELETED = "DELETED"
|
|
11
|
-
}
|
|
12
|
-
export declare enum ClientTypeEnum {
|
|
13
|
-
CREATIVE = "CREATIVE",
|
|
14
|
-
BRAND = "BRAND",
|
|
15
|
-
NONE = "NONE"
|
|
16
|
-
}
|
|
17
|
-
export declare enum ExperienceLevelEnum {
|
|
18
|
-
YEAR_0_1 = "0-1 year",
|
|
19
|
-
YEAR_1_3 = "1-3 years",
|
|
20
|
-
YEAR_3_5 = "3-5 years",
|
|
21
|
-
YEAR_5_PLUS = "5+ years"
|
|
22
|
-
}
|
|
23
|
-
export declare enum OnboardingPageEnum {
|
|
24
|
-
ACCOUNT_TYPE_SELECTION = "ACCOUNT_TYPE_SELECTION",
|
|
25
|
-
USERNAME_SELECTION = "USERNAME_SELECTION",
|
|
26
|
-
CREATIVE_PROFILE_DETAILS = "CREATIVE_PROFILE_DETAILS",
|
|
27
|
-
CREATIVE_PROFILE_CUSTOMIZE_FEED = "CREATIVE_PROFILE_CUSTOMIZE_FEED",
|
|
28
|
-
CREATIVE_PROFILE_PORTFOLIO = "CREATIVE_PROFILE_PORTFOLIO",
|
|
29
|
-
BRAND_PROFILE_DETAILS = "BRAND_PROFILE_DETAILS",
|
|
30
|
-
BRAND_PROFILE_CUSTOMIZE_FEED = "BRAND_PROFILE_CUSTOMIZE_FEED",
|
|
31
|
-
BRAND_PROFILE_PORTFOLIO = "BRAND_PROFILE_PORTFOLIO",
|
|
32
|
-
INVESTOR_PROFILE_DETAILS = "INVESTOR_PROFILE_DETAILS",
|
|
33
|
-
INVESTOR_INVESTMENT_FOCUS = "INVESTOR_INVESTMENT_FOCUS",
|
|
34
|
-
INVESTOR_VERIFICATION = "INVESTOR_VERIFICATION",
|
|
35
|
-
DONE = "DONE"
|
|
36
|
-
}
|
|
37
|
-
export declare enum FileVisibilityEnum {
|
|
38
|
-
PUBLIC = "PUBLIC",
|
|
39
|
-
PRIVATE = "PRIVATE"
|
|
40
|
-
}
|
|
41
|
-
export declare enum FileContentTypeEnum {
|
|
42
|
-
IMAGE = "IMAGE",
|
|
43
|
-
VIDEO = "VIDEO",
|
|
44
|
-
DOCUMENT = "DOCUMENT",
|
|
45
|
-
AUDIO = "AUDIO",
|
|
46
|
-
OTHER = "OTHER"
|
|
47
|
-
}
|
|
48
|
-
export declare enum InvestorTypeEnum {
|
|
49
|
-
ANGEL_INVESTOR = "Angel Investor",
|
|
50
|
-
VENTURE_CAPITALIST = "Venture Capitalist",
|
|
51
|
-
PRIVATE_EQUITY_FIRM = "Private Equity Firm",
|
|
52
|
-
VENTURE_DEBT_PROVIDER = "Venture Debt Provider",
|
|
53
|
-
BANK = "Bank",
|
|
54
|
-
CONVERTIBLE_NOTE_INVESTOR = "Convertible Note Investor",
|
|
55
|
-
REVENUE_BASED_FINANCING_INVESTOR = "Revenue Based Financing Investor",
|
|
56
|
-
CORPORATE_VENTURE_CAPITALIST = "Corporate Venture Capitalist",
|
|
57
|
-
GOVERNMENT = "Government",
|
|
58
|
-
SOCIAL_IMPACT_INVESTOR = "Social Impact Investor"
|
|
59
|
-
}
|
|
60
|
-
export declare enum InvestmentSizeEnum {
|
|
61
|
-
UNDER_5K = "Under 5k USD",
|
|
62
|
-
BETWEEN_5K_25K = "5k - 25k USD",
|
|
63
|
-
BETWEEN_25K_100K = "25k - 100k USD",
|
|
64
|
-
BETWEEN_100K_500K = "100k - 500k USD",
|
|
65
|
-
BETWEEN_500K_1M = "500k - 1M USD",
|
|
66
|
-
OVER_1M = "1M+ USD"
|
|
67
|
-
}
|
|
68
|
-
export declare enum GeographicFocusEnum {
|
|
69
|
-
AFRICA = "Africa",
|
|
70
|
-
ASIA = "Asia",
|
|
71
|
-
EUROPE = "Europe",
|
|
72
|
-
NORTH_AMERICA = "North America",
|
|
73
|
-
SOUTH_AMERICA = "South America",
|
|
74
|
-
MIDDLE_EAST = "Middle East",
|
|
75
|
-
OCEANIA = "Oceania",
|
|
76
|
-
UK = "United Kingdom (UK)",
|
|
77
|
-
US = "United States (US)",
|
|
78
|
-
GLOBAL = "Global",
|
|
79
|
-
OTHER = "Other"
|
|
80
|
-
}
|
|
81
|
-
export declare enum InvestorVerificationDocumentStatusEnum {
|
|
82
|
-
PENDING = "PENDING",
|
|
83
|
-
APPROVED = "APPROVED",
|
|
84
|
-
REJECTED = "REJECTED"
|
|
85
|
-
}
|
|
86
|
-
export declare enum InvestorVerificationDocumentTypeEnum {
|
|
87
|
-
ID_PROOF = "ID_PROOF",
|
|
88
|
-
BANK_STATEMENT = "BANK_STATEMENT",
|
|
89
|
-
TAX_DOCUMENT = "TAX_DOCUMENT",
|
|
90
|
-
BUSINESS_REGISTRATION = "BUSINESS_REGISTRATION",
|
|
91
|
-
OTHER_CERTIFICATE = "OTHER_CERTIFICATE"
|
|
92
|
-
}
|
|
93
|
-
export declare enum CommentStatusEnum {
|
|
94
|
-
ACTIVE = "ACTIVE",
|
|
95
|
-
HIDDEN = "HIDDEN",
|
|
96
|
-
DELETED = "DELETED"
|
|
97
|
-
}
|
package/dist/types/enums.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
export var RoleEnum;
|
|
2
|
-
(function (RoleEnum) {
|
|
3
|
-
RoleEnum["CREATIVE"] = "CREATIVE";
|
|
4
|
-
RoleEnum["BRAND"] = "BRAND";
|
|
5
|
-
RoleEnum["INVESTOR"] = "INVESTOR";
|
|
6
|
-
RoleEnum["ADMIN"] = "ADMIN";
|
|
7
|
-
})(RoleEnum || (RoleEnum = {}));
|
|
8
|
-
export var UserStatusEnum;
|
|
9
|
-
(function (UserStatusEnum) {
|
|
10
|
-
UserStatusEnum["ACTIVE"] = "ACTIVE";
|
|
11
|
-
UserStatusEnum["SUSPENDED"] = "SUSPENDED";
|
|
12
|
-
UserStatusEnum["DELETED"] = "DELETED";
|
|
13
|
-
})(UserStatusEnum || (UserStatusEnum = {}));
|
|
14
|
-
export var ClientTypeEnum;
|
|
15
|
-
(function (ClientTypeEnum) {
|
|
16
|
-
ClientTypeEnum["CREATIVE"] = "CREATIVE";
|
|
17
|
-
ClientTypeEnum["BRAND"] = "BRAND";
|
|
18
|
-
ClientTypeEnum["NONE"] = "NONE";
|
|
19
|
-
})(ClientTypeEnum || (ClientTypeEnum = {}));
|
|
20
|
-
export var ExperienceLevelEnum;
|
|
21
|
-
(function (ExperienceLevelEnum) {
|
|
22
|
-
ExperienceLevelEnum["YEAR_0_1"] = "0-1 year";
|
|
23
|
-
ExperienceLevelEnum["YEAR_1_3"] = "1-3 years";
|
|
24
|
-
ExperienceLevelEnum["YEAR_3_5"] = "3-5 years";
|
|
25
|
-
ExperienceLevelEnum["YEAR_5_PLUS"] = "5+ years";
|
|
26
|
-
})(ExperienceLevelEnum || (ExperienceLevelEnum = {}));
|
|
27
|
-
export var OnboardingPageEnum;
|
|
28
|
-
(function (OnboardingPageEnum) {
|
|
29
|
-
OnboardingPageEnum["ACCOUNT_TYPE_SELECTION"] = "ACCOUNT_TYPE_SELECTION";
|
|
30
|
-
OnboardingPageEnum["USERNAME_SELECTION"] = "USERNAME_SELECTION";
|
|
31
|
-
OnboardingPageEnum["CREATIVE_PROFILE_DETAILS"] = "CREATIVE_PROFILE_DETAILS";
|
|
32
|
-
OnboardingPageEnum["CREATIVE_PROFILE_CUSTOMIZE_FEED"] = "CREATIVE_PROFILE_CUSTOMIZE_FEED";
|
|
33
|
-
OnboardingPageEnum["CREATIVE_PROFILE_PORTFOLIO"] = "CREATIVE_PROFILE_PORTFOLIO";
|
|
34
|
-
OnboardingPageEnum["BRAND_PROFILE_DETAILS"] = "BRAND_PROFILE_DETAILS";
|
|
35
|
-
OnboardingPageEnum["BRAND_PROFILE_CUSTOMIZE_FEED"] = "BRAND_PROFILE_CUSTOMIZE_FEED";
|
|
36
|
-
OnboardingPageEnum["BRAND_PROFILE_PORTFOLIO"] = "BRAND_PROFILE_PORTFOLIO";
|
|
37
|
-
OnboardingPageEnum["INVESTOR_PROFILE_DETAILS"] = "INVESTOR_PROFILE_DETAILS";
|
|
38
|
-
OnboardingPageEnum["INVESTOR_INVESTMENT_FOCUS"] = "INVESTOR_INVESTMENT_FOCUS";
|
|
39
|
-
OnboardingPageEnum["INVESTOR_VERIFICATION"] = "INVESTOR_VERIFICATION";
|
|
40
|
-
OnboardingPageEnum["DONE"] = "DONE";
|
|
41
|
-
})(OnboardingPageEnum || (OnboardingPageEnum = {}));
|
|
42
|
-
export var FileVisibilityEnum;
|
|
43
|
-
(function (FileVisibilityEnum) {
|
|
44
|
-
FileVisibilityEnum["PUBLIC"] = "PUBLIC";
|
|
45
|
-
FileVisibilityEnum["PRIVATE"] = "PRIVATE";
|
|
46
|
-
})(FileVisibilityEnum || (FileVisibilityEnum = {}));
|
|
47
|
-
export var FileContentTypeEnum;
|
|
48
|
-
(function (FileContentTypeEnum) {
|
|
49
|
-
FileContentTypeEnum["IMAGE"] = "IMAGE";
|
|
50
|
-
FileContentTypeEnum["VIDEO"] = "VIDEO";
|
|
51
|
-
FileContentTypeEnum["DOCUMENT"] = "DOCUMENT";
|
|
52
|
-
FileContentTypeEnum["AUDIO"] = "AUDIO";
|
|
53
|
-
FileContentTypeEnum["OTHER"] = "OTHER";
|
|
54
|
-
})(FileContentTypeEnum || (FileContentTypeEnum = {}));
|
|
55
|
-
export var InvestorTypeEnum;
|
|
56
|
-
(function (InvestorTypeEnum) {
|
|
57
|
-
InvestorTypeEnum["ANGEL_INVESTOR"] = "Angel Investor";
|
|
58
|
-
InvestorTypeEnum["VENTURE_CAPITALIST"] = "Venture Capitalist";
|
|
59
|
-
InvestorTypeEnum["PRIVATE_EQUITY_FIRM"] = "Private Equity Firm";
|
|
60
|
-
InvestorTypeEnum["VENTURE_DEBT_PROVIDER"] = "Venture Debt Provider";
|
|
61
|
-
InvestorTypeEnum["BANK"] = "Bank";
|
|
62
|
-
InvestorTypeEnum["CONVERTIBLE_NOTE_INVESTOR"] = "Convertible Note Investor";
|
|
63
|
-
InvestorTypeEnum["REVENUE_BASED_FINANCING_INVESTOR"] = "Revenue Based Financing Investor";
|
|
64
|
-
InvestorTypeEnum["CORPORATE_VENTURE_CAPITALIST"] = "Corporate Venture Capitalist";
|
|
65
|
-
InvestorTypeEnum["GOVERNMENT"] = "Government";
|
|
66
|
-
InvestorTypeEnum["SOCIAL_IMPACT_INVESTOR"] = "Social Impact Investor";
|
|
67
|
-
})(InvestorTypeEnum || (InvestorTypeEnum = {}));
|
|
68
|
-
export var InvestmentSizeEnum;
|
|
69
|
-
(function (InvestmentSizeEnum) {
|
|
70
|
-
InvestmentSizeEnum["UNDER_5K"] = "Under 5k USD";
|
|
71
|
-
InvestmentSizeEnum["BETWEEN_5K_25K"] = "5k - 25k USD";
|
|
72
|
-
InvestmentSizeEnum["BETWEEN_25K_100K"] = "25k - 100k USD";
|
|
73
|
-
InvestmentSizeEnum["BETWEEN_100K_500K"] = "100k - 500k USD";
|
|
74
|
-
InvestmentSizeEnum["BETWEEN_500K_1M"] = "500k - 1M USD";
|
|
75
|
-
InvestmentSizeEnum["OVER_1M"] = "1M+ USD";
|
|
76
|
-
})(InvestmentSizeEnum || (InvestmentSizeEnum = {}));
|
|
77
|
-
export var GeographicFocusEnum;
|
|
78
|
-
(function (GeographicFocusEnum) {
|
|
79
|
-
GeographicFocusEnum["AFRICA"] = "Africa";
|
|
80
|
-
GeographicFocusEnum["ASIA"] = "Asia";
|
|
81
|
-
GeographicFocusEnum["EUROPE"] = "Europe";
|
|
82
|
-
GeographicFocusEnum["NORTH_AMERICA"] = "North America";
|
|
83
|
-
GeographicFocusEnum["SOUTH_AMERICA"] = "South America";
|
|
84
|
-
GeographicFocusEnum["MIDDLE_EAST"] = "Middle East";
|
|
85
|
-
GeographicFocusEnum["OCEANIA"] = "Oceania";
|
|
86
|
-
GeographicFocusEnum["UK"] = "United Kingdom (UK)";
|
|
87
|
-
GeographicFocusEnum["US"] = "United States (US)";
|
|
88
|
-
GeographicFocusEnum["GLOBAL"] = "Global";
|
|
89
|
-
GeographicFocusEnum["OTHER"] = "Other";
|
|
90
|
-
})(GeographicFocusEnum || (GeographicFocusEnum = {}));
|
|
91
|
-
export var InvestorVerificationDocumentStatusEnum;
|
|
92
|
-
(function (InvestorVerificationDocumentStatusEnum) {
|
|
93
|
-
InvestorVerificationDocumentStatusEnum["PENDING"] = "PENDING";
|
|
94
|
-
InvestorVerificationDocumentStatusEnum["APPROVED"] = "APPROVED";
|
|
95
|
-
InvestorVerificationDocumentStatusEnum["REJECTED"] = "REJECTED";
|
|
96
|
-
})(InvestorVerificationDocumentStatusEnum || (InvestorVerificationDocumentStatusEnum = {}));
|
|
97
|
-
export var InvestorVerificationDocumentTypeEnum;
|
|
98
|
-
(function (InvestorVerificationDocumentTypeEnum) {
|
|
99
|
-
InvestorVerificationDocumentTypeEnum["ID_PROOF"] = "ID_PROOF";
|
|
100
|
-
InvestorVerificationDocumentTypeEnum["BANK_STATEMENT"] = "BANK_STATEMENT";
|
|
101
|
-
InvestorVerificationDocumentTypeEnum["TAX_DOCUMENT"] = "TAX_DOCUMENT";
|
|
102
|
-
InvestorVerificationDocumentTypeEnum["BUSINESS_REGISTRATION"] = "BUSINESS_REGISTRATION";
|
|
103
|
-
InvestorVerificationDocumentTypeEnum["OTHER_CERTIFICATE"] = "OTHER_CERTIFICATE";
|
|
104
|
-
})(InvestorVerificationDocumentTypeEnum || (InvestorVerificationDocumentTypeEnum = {}));
|
|
105
|
-
export var CommentStatusEnum;
|
|
106
|
-
(function (CommentStatusEnum) {
|
|
107
|
-
CommentStatusEnum["ACTIVE"] = "ACTIVE";
|
|
108
|
-
CommentStatusEnum["HIDDEN"] = "HIDDEN";
|
|
109
|
-
CommentStatusEnum["DELETED"] = "DELETED";
|
|
110
|
-
})(CommentStatusEnum || (CommentStatusEnum = {}));
|