@zyacreatives/shared 1.7.6 → 1.7.8

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.
@@ -38,7 +38,7 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
38
38
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
39
39
  }>;
40
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
- projectFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
42
  id: z.ZodString;
43
43
  postId: z.ZodString;
44
44
  fileId: z.ZodString;
@@ -72,6 +72,23 @@ export declare const CreatePostInputSchema: z.ZodObject<{
72
72
  order: z.ZodDefault<z.ZodInt>;
73
73
  }, z.core.$strip>>;
74
74
  }, z.core.$strip>;
75
+ export declare const CreatePostOutputSchema: z.ZodObject<{
76
+ id: z.ZodCUID2;
77
+ parentId: z.ZodOptional<z.ZodCUID2>;
78
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
+ badge: z.ZodOptional<z.ZodString>;
80
+ userId: z.ZodCUID2;
81
+ content: z.ZodString;
82
+ title: z.ZodNullable<z.ZodString>;
83
+ postType: z.ZodEnum<{
84
+ readonly MARKETPLACE: "MARKETPLACE";
85
+ readonly PROJECT: "PROJECT";
86
+ readonly JOB_OPENING: "JOB_OPENING";
87
+ readonly DEFAULT_POST: "DEFAULT_POST";
88
+ readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
89
+ }>;
90
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
91
+ }, z.core.$strip>;
75
92
  export declare const MinimalPostSchema: z.ZodObject<{
76
93
  id: z.ZodCUID2;
77
94
  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.CreatePostInputSchema = exports.PostWithFilesEntitySchema = exports.PostFileEntitySchema = exports.PostEntitySchema = void 0;
3
+ exports.PostWithBookmarksEntitySchema = exports.PostWithCommentsEntitySchema = exports.PostWithLikesEntitySchema = exports.MinimalPostSchema = 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");
@@ -52,7 +52,7 @@ exports.PostFileEntitySchema = zod_openapi_1.z
52
52
  description: "Schema representing a file associated with a project.",
53
53
  });
54
54
  exports.PostWithFilesEntitySchema = exports.PostEntitySchema.extend({
55
- projectFiles: zod_openapi_1.z
55
+ postFiles: zod_openapi_1.z
56
56
  .array(exports.PostFileEntitySchema.extend({
57
57
  file: file_1.FileEntitySchema,
58
58
  }))
@@ -84,6 +84,7 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
84
84
  order: zod_openapi_1.z.int().default(1),
85
85
  })),
86
86
  });
87
+ exports.CreatePostOutputSchema = exports.PostEntitySchema;
87
88
  exports.MinimalPostSchema = exports.PostEntitySchema.pick({
88
89
  title: true,
89
90
  id: true,
@@ -1,9 +1,10 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreatePostInputSchema, PostEntitySchema, PostFileEntitySchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema } from "../schemas/post";
2
+ import { CreatePostInputSchema, CreatePostOutputSchema, PostEntitySchema, PostFileEntitySchema, 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>;
6
6
  export type CreatePostInput = z.infer<typeof CreatePostInputSchema>;
7
+ export type CreatePostOutput = z.infer<typeof CreatePostOutputSchema>;
7
8
  export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
8
9
  export type PostWithPostBookmarksEntity = z.infer<typeof PostWithBookmarksEntitySchema>;
9
10
  export type PostWithPostCommentsEntity = z.infer<typeof PostWithCommentsEntitySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -52,7 +52,7 @@ export const PostFileEntitySchema = z
52
52
  });
53
53
 
54
54
  export const PostWithFilesEntitySchema = PostEntitySchema.extend({
55
- projectFiles: z
55
+ postFiles: z
56
56
  .array(
57
57
  PostFileEntitySchema.extend({
58
58
  file: FileEntitySchema,
@@ -90,6 +90,8 @@ export const CreatePostInputSchema = z.object({
90
90
  ),
91
91
  });
92
92
 
93
+ export const CreatePostOutputSchema = PostEntitySchema;
94
+
93
95
  export const MinimalPostSchema = PostEntitySchema.pick({
94
96
  title: true,
95
97
  id: true,
package/src/types/post.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import {
3
3
  CreatePostInputSchema,
4
+ CreatePostOutputSchema,
4
5
  PostEntitySchema,
5
6
  PostFileEntitySchema,
6
7
  PostWithBookmarksEntitySchema,
@@ -13,6 +14,7 @@ export type PostEntity = z.infer<typeof PostEntitySchema>;
13
14
  export type PostFileEntity = z.infer<typeof PostFileEntitySchema>;
14
15
  export type PostWithFilesEntity = z.infer<typeof PostWithFilesEntitySchema>;
15
16
  export type CreatePostInput = z.infer<typeof CreatePostInputSchema>;
17
+ export type CreatePostOutput = z.infer<typeof CreatePostOutputSchema>;
16
18
  export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
17
19
  export type PostWithPostBookmarksEntity = z.infer<
18
20
  typeof PostWithBookmarksEntitySchema