@zyacreatives/shared 1.7.8 → 1.7.9

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,9 @@ 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 PostIdSchema: z.ZodObject<{
93
+ postId: z.ZodCUID2;
94
+ }, z.core.$strip>;
92
95
  export declare const MinimalPostSchema: z.ZodObject<{
93
96
  id: z.ZodCUID2;
94
97
  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.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,7 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
85
85
  })),
86
86
  });
87
87
  exports.CreatePostOutputSchema = exports.PostEntitySchema;
88
+ exports.PostIdSchema = zod_openapi_1.z.object({ postId: zod_openapi_1.z.cuid2() });
88
89
  exports.MinimalPostSchema = exports.PostEntitySchema.pick({
89
90
  title: true,
90
91
  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, 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,5 @@ 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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -91,7 +91,7 @@ export const CreatePostInputSchema = z.object({
91
91
  });
92
92
 
93
93
  export const CreatePostOutputSchema = PostEntitySchema;
94
-
94
+ export const PostIdSchema = z.object({ postId: z.cuid2() });
95
95
  export const MinimalPostSchema = PostEntitySchema.pick({
96
96
  title: true,
97
97
  id: true,
package/src/types/post.ts CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  CreatePostOutputSchema,
5
5
  PostEntitySchema,
6
6
  PostFileEntitySchema,
7
+ PostIdSchema,
7
8
  PostWithBookmarksEntitySchema,
8
9
  PostWithCommentsEntitySchema,
9
10
  PostWithFilesEntitySchema,
@@ -19,6 +20,7 @@ export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
19
20
  export type PostWithPostBookmarksEntity = z.infer<
20
21
  typeof PostWithBookmarksEntitySchema
21
22
  >;
23
+ export type PostIdInput = z.infer<typeof PostIdSchema>;
22
24
  export type PostWithPostCommentsEntity = z.infer<
23
25
  typeof PostWithCommentsEntitySchema
24
26
  >;