@zyacreatives/shared 2.1.85 → 2.1.87

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.
Files changed (56) hide show
  1. package/README.md +1 -1
  2. package/dist/constants.d.ts +5 -2
  3. package/dist/constants.js +5 -2
  4. package/package.json +1 -1
  5. package/src/constants.ts +487 -483
  6. package/src/index.ts +4 -4
  7. package/src/schemas/activity.ts +14 -14
  8. package/src/schemas/auth.ts +43 -43
  9. package/src/schemas/bookmark.ts +38 -38
  10. package/src/schemas/brand.ts +146 -146
  11. package/src/schemas/chat.ts +31 -31
  12. package/src/schemas/comment.ts +60 -60
  13. package/src/schemas/common.ts +22 -22
  14. package/src/schemas/creative.ts +222 -222
  15. package/src/schemas/discipline.ts +88 -88
  16. package/src/schemas/entity-stats.ts +43 -43
  17. package/src/schemas/feed.ts +11 -11
  18. package/src/schemas/file.ts +61 -61
  19. package/src/schemas/index.ts +21 -21
  20. package/src/schemas/investor.ts +211 -211
  21. package/src/schemas/job-application.ts +257 -257
  22. package/src/schemas/job.ts +364 -364
  23. package/src/schemas/like.ts +38 -38
  24. package/src/schemas/message.ts +112 -112
  25. package/src/schemas/notification.ts +71 -71
  26. package/src/schemas/post.ts +279 -279
  27. package/src/schemas/project.ts +298 -298
  28. package/src/schemas/user-strike.ts +21 -21
  29. package/src/schemas/user.ts +283 -283
  30. package/src/schemas/username.ts +11 -11
  31. package/src/schemas/view.ts +50 -50
  32. package/src/types/auth.ts +5 -5
  33. package/src/types/bookmark.ts +4 -4
  34. package/src/types/brand.ts +37 -37
  35. package/src/types/chat.ts +21 -21
  36. package/src/types/comment.ts +12 -12
  37. package/src/types/common.ts +9 -9
  38. package/src/types/creative.ts +33 -33
  39. package/src/types/discipline.ts +32 -32
  40. package/src/types/entity-stats.ts +4 -4
  41. package/src/types/feed.ts +5 -5
  42. package/src/types/file.ts +39 -39
  43. package/src/types/index.ts +22 -22
  44. package/src/types/investor.ts +34 -34
  45. package/src/types/job-application.ts +41 -41
  46. package/src/types/job.ts +71 -71
  47. package/src/types/like.ts +3 -3
  48. package/src/types/message.ts +23 -23
  49. package/src/types/notification.ts +34 -34
  50. package/src/types/post.ts +63 -63
  51. package/src/types/project.ts +65 -65
  52. package/src/types/user-strike.ts +10 -10
  53. package/src/types/user.ts +96 -96
  54. package/src/types/username.ts +4 -4
  55. package/src/utils/slugify.ts +10 -10
  56. package/tsconfig.json +13 -13
@@ -1,88 +1,88 @@
1
- import { z } from "@hono/zod-openapi";
2
-
3
- export const BaseDisciplineEntitySchema = z.object({
4
- slug: z.string().openapi({ example: "digital-art" }),
5
- name: z.string().openapi({ example: "Digital Art" }),
6
- });
7
-
8
- export const TagEntitySchema = z.object({
9
- id: z.int(),
10
- name: z.string(),
11
- disciplineSlug: z.string().optional(),
12
- });
13
-
14
- export const DisciplineEntitySchema = BaseDisciplineEntitySchema.extend({
15
- tags: z
16
- .array(z.string().openapi({ example: "illustration" }))
17
- .optional()
18
- .openapi({ example: ["illustration", "concept-art"] }),
19
- }).openapi({ title: "DisciplineEntity" });
20
-
21
- export const DisciplineUpdateOutputSchema = z
22
- .object({
23
- slug: z.string().openapi({ example: "digital-art" }),
24
- })
25
- .openapi({ title: "DisciplineUpdateOutput" });
26
-
27
- export const CreateDisciplinesInputSchema = z
28
- .object({
29
- disciplines: z
30
- .array(
31
- z.object({
32
- name: z.string().max(128).openapi({ example: "Mathematics" }),
33
- tags: z
34
- .array(z.string().openapi({ example: "algebra" }))
35
- .default([])
36
- .openapi({ example: ["algebra", "geometry"] }),
37
- })
38
- )
39
- .openapi({
40
- description: "Array of disciplines to upsert.",
41
- example: [
42
- { name: "Mathematics", tags: ["algebra", "geometry"] },
43
- { name: "Physics", tags: ["mechanics", "optics"] },
44
- ],
45
- }),
46
- })
47
- .openapi({ title: "CreateDisciplinesInput" });
48
-
49
- export const CreateDisciplinesOutputSchema = z
50
- .object({
51
- disciplines: z.array(z.string()),
52
- })
53
- .openapi({ title: "CreateDisciplinesOutput" });
54
-
55
- export const GetDisciplinesInputSchema = z
56
- .object({
57
- withTags: z
58
- .union([z.literal("true"), z.literal("false")])
59
- .optional()
60
- .openapi({
61
- description: "Whether to include tags in the response.",
62
- example: "true",
63
- }),
64
- getDefault: z
65
- .union([z.literal("true"), z.literal("false")])
66
- .optional()
67
- .openapi({
68
- description:
69
- "Fetch the default list of disciplines (non user-added disciplines).",
70
- }),
71
- slugs: z.string().optional().openapi({
72
- description: "Comma-separated list of discipline slugs to filter by.",
73
- example: "mathematics,physics",
74
- }),
75
- })
76
- .openapi({ title: "GetDisciplinesInput" });
77
-
78
- export const GetDisciplinesOutputSchema = z
79
- .object({
80
- disciplines: z.array(DisciplineEntitySchema),
81
- })
82
- .openapi({ title: "GetDisciplinesOutput" });
83
-
84
- export const SlugInputSchema = z
85
- .object({
86
- slug: z.string().max(128).openapi({ example: "mathematics" }),
87
- })
88
- .openapi({ title: "SlugInput" });
1
+ import { z } from "@hono/zod-openapi";
2
+
3
+ export const BaseDisciplineEntitySchema = z.object({
4
+ slug: z.string().openapi({ example: "digital-art" }),
5
+ name: z.string().openapi({ example: "Digital Art" }),
6
+ });
7
+
8
+ export const TagEntitySchema = z.object({
9
+ id: z.int(),
10
+ name: z.string(),
11
+ disciplineSlug: z.string().optional(),
12
+ });
13
+
14
+ export const DisciplineEntitySchema = BaseDisciplineEntitySchema.extend({
15
+ tags: z
16
+ .array(z.string().openapi({ example: "illustration" }))
17
+ .optional()
18
+ .openapi({ example: ["illustration", "concept-art"] }),
19
+ }).openapi({ title: "DisciplineEntity" });
20
+
21
+ export const DisciplineUpdateOutputSchema = z
22
+ .object({
23
+ slug: z.string().openapi({ example: "digital-art" }),
24
+ })
25
+ .openapi({ title: "DisciplineUpdateOutput" });
26
+
27
+ export const CreateDisciplinesInputSchema = z
28
+ .object({
29
+ disciplines: z
30
+ .array(
31
+ z.object({
32
+ name: z.string().max(128).openapi({ example: "Mathematics" }),
33
+ tags: z
34
+ .array(z.string().openapi({ example: "algebra" }))
35
+ .default([])
36
+ .openapi({ example: ["algebra", "geometry"] }),
37
+ })
38
+ )
39
+ .openapi({
40
+ description: "Array of disciplines to upsert.",
41
+ example: [
42
+ { name: "Mathematics", tags: ["algebra", "geometry"] },
43
+ { name: "Physics", tags: ["mechanics", "optics"] },
44
+ ],
45
+ }),
46
+ })
47
+ .openapi({ title: "CreateDisciplinesInput" });
48
+
49
+ export const CreateDisciplinesOutputSchema = z
50
+ .object({
51
+ disciplines: z.array(z.string()),
52
+ })
53
+ .openapi({ title: "CreateDisciplinesOutput" });
54
+
55
+ export const GetDisciplinesInputSchema = z
56
+ .object({
57
+ withTags: z
58
+ .union([z.literal("true"), z.literal("false")])
59
+ .optional()
60
+ .openapi({
61
+ description: "Whether to include tags in the response.",
62
+ example: "true",
63
+ }),
64
+ getDefault: z
65
+ .union([z.literal("true"), z.literal("false")])
66
+ .optional()
67
+ .openapi({
68
+ description:
69
+ "Fetch the default list of disciplines (non user-added disciplines).",
70
+ }),
71
+ slugs: z.string().optional().openapi({
72
+ description: "Comma-separated list of discipline slugs to filter by.",
73
+ example: "mathematics,physics",
74
+ }),
75
+ })
76
+ .openapi({ title: "GetDisciplinesInput" });
77
+
78
+ export const GetDisciplinesOutputSchema = z
79
+ .object({
80
+ disciplines: z.array(DisciplineEntitySchema),
81
+ })
82
+ .openapi({ title: "GetDisciplinesOutput" });
83
+
84
+ export const SlugInputSchema = z
85
+ .object({
86
+ slug: z.string().max(128).openapi({ example: "mathematics" }),
87
+ })
88
+ .openapi({ title: "SlugInput" });
@@ -1,43 +1,43 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { ACTIVITY_PARENT_TYPES } from "../constants";
3
-
4
- export const EntityStatsSchema = z
5
- .object({
6
- updatedAt: z.coerce.date().optional().openapi({
7
- description: "Timestamp of the last update to the entity statistics.",
8
- title: "Updated At",
9
- }),
10
- createdAt: z.coerce.date().optional().openapi({
11
- description: "Timestamp of the creationn to the entity statistics.",
12
- title: "Updated At",
13
- }),
14
- parentId: z.cuid2().openapi({
15
- description:
16
- "Unique identifier of the parent entity (e.g., project, post, etc.).",
17
- title: "Parent ID",
18
- }),
19
- parentType: z.enum(ACTIVITY_PARENT_TYPES).openapi({
20
- description: "Type of the parent entity this statistic belongs to.",
21
- title: "Parent Type",
22
- }),
23
- likesCount: z.number().openapi({
24
- description: "Total number of likes associated with the entity.",
25
- title: "Likes Count",
26
- }),
27
- bookmarksCount: z.number().openapi({
28
- description: "Total number of bookmarks associated with the entity.",
29
- title: "Bookmarks Count",
30
- }),
31
- viewsCount: z.number().openapi({
32
- description: "Total number of views recorded for the entity.",
33
- title: "Views Count",
34
- }),
35
- commentsCount: z.number().openapi({
36
- description: "Total number of comments linked to the entity.",
37
- title: "Comments Count",
38
- }),
39
- })
40
- .openapi({
41
- description: "Represents engagement statistics for a specific entity.",
42
- title: "EntityStats",
43
- });
1
+ import { z } from "@hono/zod-openapi";
2
+ import { ACTIVITY_PARENT_TYPES } from "../constants";
3
+
4
+ export const EntityStatsSchema = z
5
+ .object({
6
+ updatedAt: z.coerce.date().optional().openapi({
7
+ description: "Timestamp of the last update to the entity statistics.",
8
+ title: "Updated At",
9
+ }),
10
+ createdAt: z.coerce.date().optional().openapi({
11
+ description: "Timestamp of the creationn to the entity statistics.",
12
+ title: "Updated At",
13
+ }),
14
+ parentId: z.cuid2().openapi({
15
+ description:
16
+ "Unique identifier of the parent entity (e.g., project, post, etc.).",
17
+ title: "Parent ID",
18
+ }),
19
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).openapi({
20
+ description: "Type of the parent entity this statistic belongs to.",
21
+ title: "Parent Type",
22
+ }),
23
+ likesCount: z.number().openapi({
24
+ description: "Total number of likes associated with the entity.",
25
+ title: "Likes Count",
26
+ }),
27
+ bookmarksCount: z.number().openapi({
28
+ description: "Total number of bookmarks associated with the entity.",
29
+ title: "Bookmarks Count",
30
+ }),
31
+ viewsCount: z.number().openapi({
32
+ description: "Total number of views recorded for the entity.",
33
+ title: "Views Count",
34
+ }),
35
+ commentsCount: z.number().openapi({
36
+ description: "Total number of comments linked to the entity.",
37
+ title: "Comments Count",
38
+ }),
39
+ })
40
+ .openapi({
41
+ description: "Represents engagement statistics for a specific entity.",
42
+ title: "EntityStats",
43
+ });
@@ -1,11 +1,11 @@
1
- import { z } from "@hono/zod-openapi";
2
-
3
- export const FeedTagsSchema = z.object({
4
- userId: z.cuid2(),
5
- tags: z.array(z.string()),
6
- });
7
-
8
- export const FeedTagsInputSchema = z.object({
9
- tags: z.array(z.string()),
10
- });
11
-
1
+ import { z } from "@hono/zod-openapi";
2
+
3
+ export const FeedTagsSchema = z.object({
4
+ userId: z.cuid2(),
5
+ tags: z.array(z.string()),
6
+ });
7
+
8
+ export const FeedTagsInputSchema = z.object({
9
+ tags: z.array(z.string()),
10
+ });
11
+
@@ -1,61 +1,61 @@
1
- import { z } from "@hono/zod-openapi";
2
-
3
- export const FileEntitySchema = z
4
- .object({
5
- id: z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
6
- key: z.string().openapi({ example: "profile-pic-12345" }),
7
- mimeType: z.string().openapi({ example: "image/jpeg" }),
8
- url: z
9
- .url()
10
- .optional()
11
- .openapi({ example: "https://example.com/file.jpg" }),
12
- userId: z
13
- .cuid2()
14
- .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
15
- createdAt: z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
16
- updatedAt: z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
17
- })
18
- .openapi({ title: "FileEntity" });
19
-
20
- export const FileUpdateInputSchema = z
21
- .object({
22
- id: z
23
- .string()
24
- .openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
25
- })
26
- .openapi({ title: "FileUpdateInput" });
27
-
28
- export const CreateFileInputSchema = z.object({
29
- key: z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
30
- mimeType: z.string().openapi({ example: "audio/mpeg" }),
31
- });
32
-
33
- export const CreateFileOutputSchema = FileEntitySchema;
34
-
35
- export const DeleteFileInputSchema = z.object({
36
- fileId: z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
37
- key: z.cuid2().optional(),
38
- });
39
-
40
- export const DeleteFileOutputSchema = z.object({
41
- id: z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
42
- });
43
-
44
- export const GetPresignedUploadUrlInputSchema = z.object({
45
- key: z.string().openapi({ example: "/users/123/pfp" }),
46
- });
47
-
48
- export const GetPresignedUploadUrlOutputSchema = z.object({
49
- url: z.url().openapi({ example: "https://www.cloudflare.img" }),
50
- });
51
-
52
- export const GetPresignedDownloadUrlInputSchema = z.object({
53
- fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
54
- });
55
-
56
- export const GetPresignedDownloadUrlOutputSchema =
57
- GetPresignedUploadUrlOutputSchema;
58
-
59
- export const FileKeySchema = z.object({
60
- key: z.string().max(400, {error: "Key should not be longner than 400 characters"}),
61
- });
1
+ import { z } from "@hono/zod-openapi";
2
+
3
+ export const FileEntitySchema = z
4
+ .object({
5
+ id: z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
6
+ key: z.string().openapi({ example: "profile-pic-12345" }),
7
+ mimeType: z.string().openapi({ example: "image/jpeg" }),
8
+ url: z
9
+ .url()
10
+ .optional()
11
+ .openapi({ example: "https://example.com/file.jpg" }),
12
+ userId: z
13
+ .cuid2()
14
+ .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
15
+ createdAt: z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
16
+ updatedAt: z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
17
+ })
18
+ .openapi({ title: "FileEntity" });
19
+
20
+ export const FileUpdateInputSchema = z
21
+ .object({
22
+ id: z
23
+ .string()
24
+ .openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
25
+ })
26
+ .openapi({ title: "FileUpdateInput" });
27
+
28
+ export const CreateFileInputSchema = z.object({
29
+ key: z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
30
+ mimeType: z.string().openapi({ example: "audio/mpeg" }),
31
+ });
32
+
33
+ export const CreateFileOutputSchema = FileEntitySchema;
34
+
35
+ export const DeleteFileInputSchema = z.object({
36
+ fileId: z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
37
+ key: z.cuid2().optional(),
38
+ });
39
+
40
+ export const DeleteFileOutputSchema = z.object({
41
+ id: z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
42
+ });
43
+
44
+ export const GetPresignedUploadUrlInputSchema = z.object({
45
+ key: z.string().openapi({ example: "/users/123/pfp" }),
46
+ });
47
+
48
+ export const GetPresignedUploadUrlOutputSchema = z.object({
49
+ url: z.url().openapi({ example: "https://www.cloudflare.img" }),
50
+ });
51
+
52
+ export const GetPresignedDownloadUrlInputSchema = z.object({
53
+ fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
54
+ });
55
+
56
+ export const GetPresignedDownloadUrlOutputSchema =
57
+ GetPresignedUploadUrlOutputSchema;
58
+
59
+ export const FileKeySchema = z.object({
60
+ key: z.string().max(400, {error: "Key should not be longner than 400 characters"}),
61
+ });
@@ -1,21 +1,21 @@
1
- export * from "./auth";
2
- export * from "./brand";
3
- export * from "./common";
4
- export * from "./creative";
5
- export * from "./user";
6
- export * from "./project";
7
- export * from "./investor";
8
- export * from "./discipline";
9
- export * from "./file";
10
- export * from "./username";
11
- export * from "./post";
12
- export * from "./entity-stats";
13
- export * from "./message";
14
- export * from "./chat";
15
- export * from "./job";
16
- export * from "./job-application";
17
- export * from "./user-strike";
18
- export * from "./notification";
19
- export * from "./feed";
20
- export * from "./bookmark";
21
- export * from "./like";
1
+ export * from "./auth";
2
+ export * from "./brand";
3
+ export * from "./common";
4
+ export * from "./creative";
5
+ export * from "./user";
6
+ export * from "./project";
7
+ export * from "./investor";
8
+ export * from "./discipline";
9
+ export * from "./file";
10
+ export * from "./username";
11
+ export * from "./post";
12
+ export * from "./entity-stats";
13
+ export * from "./message";
14
+ export * from "./chat";
15
+ export * from "./job";
16
+ export * from "./job-application";
17
+ export * from "./user-strike";
18
+ export * from "./notification";
19
+ export * from "./feed";
20
+ export * from "./bookmark";
21
+ export * from "./like";