@zyacreatives/shared 2.0.19 → 2.0.20

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.
@@ -210,3 +210,12 @@ export declare const PostWithBookmarksEntitySchema: z.ZodObject<{
210
210
  }>;
211
211
  }, z.core.$strip>>;
212
212
  }, z.core.$strip>;
213
+ export declare const LinkPreviewInputSchema: z.ZodObject<{
214
+ url: z.ZodString;
215
+ }, z.core.$strip>;
216
+ export declare const LinkPreviewOutputSchema: z.ZodObject<{
217
+ title: z.ZodString;
218
+ description: z.ZodOptional<z.ZodString>;
219
+ image: z.ZodOptional<z.ZodString>;
220
+ url: z.ZodOptional<z.ZodString>;
221
+ }, z.core.$strip>;
@@ -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.PostIdSchema = exports.GetPostOutputSchema = exports.CreatePostOutputSchema = exports.CreatePostInputSchema = exports.PostWithFilesEntitySchema = exports.PostFileEntitySchema = exports.PostEntitySchema = void 0;
3
+ exports.LinkPreviewOutputSchema = exports.LinkPreviewInputSchema = 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");
@@ -129,3 +129,12 @@ exports.PostWithBookmarksEntitySchema = exports.MinimalPostSchema.extend({
129
129
  }).openapi({
130
130
  title: "PostWithPostBookmarksEntity",
131
131
  });
132
+ exports.LinkPreviewInputSchema = zod_openapi_1.z.object({
133
+ url: zod_openapi_1.z.string(),
134
+ });
135
+ exports.LinkPreviewOutputSchema = zod_openapi_1.z.object({
136
+ title: zod_openapi_1.z.string(),
137
+ description: zod_openapi_1.z.string().optional(),
138
+ image: zod_openapi_1.z.string().optional(),
139
+ url: zod_openapi_1.z.string().optional(),
140
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreatePostInputSchema, CreatePostOutputSchema, GetPostOutputSchema, PostEntitySchema, PostFileEntitySchema, PostIdSchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema } from "../schemas/post";
2
+ import { CreatePostInputSchema, CreatePostOutputSchema, GetPostOutputSchema, LinkPreviewInputSchema, LinkPreviewOutputSchema, 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>;
@@ -10,3 +10,5 @@ export type PostWithPostBookmarksEntity = z.infer<typeof PostWithBookmarksEntity
10
10
  export type PostIdInput = z.infer<typeof PostIdSchema>;
11
11
  export type PostWithPostCommentsEntity = z.infer<typeof PostWithCommentsEntitySchema>;
12
12
  export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;
13
+ export type LinkPreviewInput = z.infer<typeof LinkPreviewInputSchema>;
14
+ export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.19",
3
+ "version": "2.0.20",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -147,3 +147,14 @@ export const PostWithBookmarksEntitySchema = MinimalPostSchema.extend({
147
147
  }).openapi({
148
148
  title: "PostWithPostBookmarksEntity",
149
149
  });
150
+
151
+ export const LinkPreviewInputSchema = z.object({
152
+ url: z.string(),
153
+ });
154
+
155
+ export const LinkPreviewOutputSchema = z.object({
156
+ title: z.string(),
157
+ description: z.string().optional(),
158
+ image: z.string().optional(),
159
+ url: z.string().optional(),
160
+ });
package/src/types/post.ts CHANGED
@@ -3,6 +3,8 @@ import {
3
3
  CreatePostInputSchema,
4
4
  CreatePostOutputSchema,
5
5
  GetPostOutputSchema,
6
+ LinkPreviewInputSchema,
7
+ LinkPreviewOutputSchema,
6
8
  PostEntitySchema,
7
9
  PostFileEntitySchema,
8
10
  PostIdSchema,
@@ -26,3 +28,5 @@ export type PostWithPostCommentsEntity = z.infer<
26
28
  typeof PostWithCommentsEntitySchema
27
29
  >;
28
30
  export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;
31
+ export type LinkPreviewInput = z.infer<typeof LinkPreviewInputSchema>;
32
+ export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;