@zyacreatives/shared 1.7.8 → 1.8.0

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.
@@ -89,6 +89,41 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
89
89
  }>;
90
90
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
91
91
  }, z.core.$strip>;
92
+ export declare const GetPostOutputSchema: z.ZodObject<{
93
+ id: z.ZodCUID2;
94
+ parentId: z.ZodOptional<z.ZodCUID2>;
95
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ badge: z.ZodOptional<z.ZodString>;
97
+ userId: z.ZodCUID2;
98
+ content: z.ZodString;
99
+ title: z.ZodNullable<z.ZodString>;
100
+ postType: z.ZodEnum<{
101
+ readonly MARKETPLACE: "MARKETPLACE";
102
+ readonly PROJECT: "PROJECT";
103
+ readonly JOB_OPENING: "JOB_OPENING";
104
+ readonly DEFAULT_POST: "DEFAULT_POST";
105
+ readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
106
+ }>;
107
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
108
+ postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ id: z.ZodString;
110
+ postId: z.ZodString;
111
+ fileId: z.ZodString;
112
+ order: z.ZodNumber;
113
+ file: z.ZodObject<{
114
+ id: z.ZodCUID2;
115
+ key: z.ZodString;
116
+ mimeType: z.ZodString;
117
+ url: z.ZodOptional<z.ZodURL>;
118
+ userId: z.ZodCUID2;
119
+ createdAt: z.ZodCoercedDate<unknown>;
120
+ updatedAt: z.ZodCoercedDate<unknown>;
121
+ }, z.core.$strip>;
122
+ }, z.core.$strip>>>;
123
+ }, z.core.$strip>;
124
+ export declare const PostIdSchema: z.ZodObject<{
125
+ postId: z.ZodCUID2;
126
+ }, z.core.$strip>;
92
127
  export declare const MinimalPostSchema: z.ZodObject<{
93
128
  id: z.ZodCUID2;
94
129
  title: z.ZodNullable<z.ZodString>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostWithBookmarksEntitySchema = exports.PostWithCommentsEntitySchema = exports.PostWithLikesEntitySchema = exports.MinimalPostSchema = exports.CreatePostOutputSchema = exports.CreatePostInputSchema = exports.PostWithFilesEntitySchema = exports.PostFileEntitySchema = exports.PostEntitySchema = void 0;
3
+ exports.PostWithBookmarksEntitySchema = exports.PostWithCommentsEntitySchema = exports.PostWithLikesEntitySchema = exports.MinimalPostSchema = exports.PostIdSchema = exports.GetPostOutputSchema = exports.CreatePostOutputSchema = exports.CreatePostInputSchema = exports.PostWithFilesEntitySchema = exports.PostFileEntitySchema = exports.PostEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const file_1 = require("./file");
@@ -85,6 +85,8 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
85
85
  })),
86
86
  });
87
87
  exports.CreatePostOutputSchema = exports.PostEntitySchema;
88
+ exports.GetPostOutputSchema = exports.PostWithFilesEntitySchema;
89
+ exports.PostIdSchema = zod_openapi_1.z.object({ postId: zod_openapi_1.z.cuid2() });
88
90
  exports.MinimalPostSchema = exports.PostEntitySchema.pick({
89
91
  title: true,
90
92
  id: true,
@@ -1,5 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreatePostInputSchema, CreatePostOutputSchema, PostEntitySchema, PostFileEntitySchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema } from "../schemas/post";
2
+ import { CreatePostInputSchema, CreatePostOutputSchema, GetPostOutputSchema, PostEntitySchema, PostFileEntitySchema, PostIdSchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema } from "../schemas/post";
3
3
  export type PostEntity = z.infer<typeof PostEntitySchema>;
4
4
  export type PostFileEntity = z.infer<typeof PostFileEntitySchema>;
5
5
  export type PostWithFilesEntity = z.infer<typeof PostWithFilesEntitySchema>;
@@ -7,4 +7,6 @@ export type CreatePostInput = z.infer<typeof CreatePostInputSchema>;
7
7
  export type CreatePostOutput = z.infer<typeof CreatePostOutputSchema>;
8
8
  export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
9
9
  export type PostWithPostBookmarksEntity = z.infer<typeof PostWithBookmarksEntitySchema>;
10
+ export type PostIdInput = z.infer<typeof PostIdSchema>;
10
11
  export type PostWithPostCommentsEntity = z.infer<typeof PostWithCommentsEntitySchema>;
12
+ export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.7.8",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -91,7 +91,8 @@ export const CreatePostInputSchema = z.object({
91
91
  });
92
92
 
93
93
  export const CreatePostOutputSchema = PostEntitySchema;
94
-
94
+ export const GetPostOutputSchema = PostWithFilesEntitySchema;
95
+ export const PostIdSchema = z.object({ postId: z.cuid2() });
95
96
  export const MinimalPostSchema = PostEntitySchema.pick({
96
97
  title: true,
97
98
  id: true,
package/src/types/post.ts CHANGED
@@ -2,8 +2,10 @@ import { z } from "@hono/zod-openapi";
2
2
  import {
3
3
  CreatePostInputSchema,
4
4
  CreatePostOutputSchema,
5
+ GetPostOutputSchema,
5
6
  PostEntitySchema,
6
7
  PostFileEntitySchema,
8
+ PostIdSchema,
7
9
  PostWithBookmarksEntitySchema,
8
10
  PostWithCommentsEntitySchema,
9
11
  PostWithFilesEntitySchema,
@@ -19,6 +21,8 @@ export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
19
21
  export type PostWithPostBookmarksEntity = z.infer<
20
22
  typeof PostWithBookmarksEntitySchema
21
23
  >;
24
+ export type PostIdInput = z.infer<typeof PostIdSchema>;
22
25
  export type PostWithPostCommentsEntity = z.infer<
23
26
  typeof PostWithCommentsEntitySchema
24
27
  >;
28
+ export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;