@twreporter-academy/api-types 0.0.28 → 0.0.29
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.
package/dist/schemas/post.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const V1PostsListQuerySchema: z.ZodObject<{
|
|
3
3
|
take: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
4
|
+
isReference: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
|
|
4
5
|
}, z.core.$strip>;
|
|
5
6
|
export declare const V1HeaderPostItemSchema: z.ZodObject<{
|
|
6
7
|
title: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/schemas/post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/schemas/post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;iBAMP,CAAA;AAE5B,eAAO,MAAM,yBAAyB;;;;;;iBAIP,CAAA;AAE/B,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;iBAOP,CAAA;AAE7B,eAAO,MAAM,sBAAsB;;;iBAKP,CAAA;AAE5B,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;iBAMP,CAAA"}
|
package/dist/schemas/post.js
CHANGED
|
@@ -4,7 +4,8 @@ import { RestErrorBodySchema } from '../rest.js';
|
|
|
4
4
|
import { PhotoSchema } from './photo.js';
|
|
5
5
|
import { registry } from './registry.js';
|
|
6
6
|
export const V1PostsListQuerySchema = z.object({
|
|
7
|
-
take: z.coerce.number().int().min(1).max(10).optional()
|
|
7
|
+
take: z.coerce.number().int().min(1).max(10).optional(),
|
|
8
|
+
isReference: z.stringbool().optional()
|
|
8
9
|
});
|
|
9
10
|
export const V1HeaderPostItemSchema = z.object({
|
|
10
11
|
title: z.string(),
|
package/dist/schemas/post.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","names":["z","internalServerErrorResponse","RestErrorBodySchema","PhotoSchema","registry","V1PostsListQuerySchema","object","take","coerce","number","int","min","max","optional","V1HeaderPostItemSchema","title","string","imageUrl","nullable","href","openapi","V1PostsListResponseSchema","posts","array","V1PostsCatalogQuerySchema","tag","default","skip","V1PostCatalogItemSchema","description","link","image","V1PostCatalogTagSchema","slug","name","V1PostsCatalogResponseSchema","postsCount","nonnegative","tags","registerPath","method","path","request","query","responses","content","schema"],"sources":["../../src/schemas/post.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { PhotoSchema } from './photo.js'\nimport { registry } from './registry.js'\n\nexport const V1PostsListQuerySchema = z.object({\n take: z.coerce.number().int().min(1).max(10).optional(),\n})\n\nexport const V1HeaderPostItemSchema = z\n .object({\n title: z.string(),\n imageUrl: z.string().nullable(),\n href: z.string(),\n })\n .openapi('HeaderPostItem')\n\nexport const V1PostsListResponseSchema = z\n .object({\n posts: z.array(V1HeaderPostItemSchema),\n })\n .openapi('PostsListResponse')\n\nexport const V1PostsCatalogQuerySchema = z.object({\n tag: z.string().min(1).max(200).optional(),\n take: z.coerce.number().int().min(1).max(50).optional().default(12),\n skip: z.coerce.number().int().min(0).max(5000).optional().default(0),\n})\n\nexport const V1PostCatalogItemSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n link: z.string(),\n image: PhotoSchema.nullable(),\n })\n .openapi('PostCatalogItem')\n\nexport const V1PostCatalogTagSchema = z\n .object({\n slug: z.string(),\n name: z.string(),\n })\n .openapi('PostCatalogTag')\n\nexport const V1PostsCatalogResponseSchema = z\n .object({\n posts: z.array(V1PostCatalogItemSchema),\n postsCount: z.number().int().nonnegative(),\n tags: z.array(V1PostCatalogTagSchema),\n })\n .openapi('PostsCatalogResponse')\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/posts',\n tags: ['Posts'],\n description: 'Latest posts for header.',\n request: { query: V1PostsListQuerySchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1PostsListResponseSchema },\n },\n },\n 400: {\n description: 'Invalid request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 500: {\n description: 'Internal server error',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/posts/catalog',\n tags: ['Posts'],\n description: 'Paginated public post catalog with available tags.',\n request: { query: V1PostsCatalogQuerySchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1PostsCatalogResponseSchema },\n },\n },\n 400: {\n description: 'Invalid request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,sBAAsB,GAAGL,CAAC,CAACM,MAAM,CAAC;EAC7CC,IAAI,EAAEP,CAAC,CAACQ,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"post.js","names":["z","internalServerErrorResponse","RestErrorBodySchema","PhotoSchema","registry","V1PostsListQuerySchema","object","take","coerce","number","int","min","max","optional","isReference","stringbool","V1HeaderPostItemSchema","title","string","imageUrl","nullable","href","openapi","V1PostsListResponseSchema","posts","array","V1PostsCatalogQuerySchema","tag","default","skip","V1PostCatalogItemSchema","description","link","image","V1PostCatalogTagSchema","slug","name","V1PostsCatalogResponseSchema","postsCount","nonnegative","tags","registerPath","method","path","request","query","responses","content","schema"],"sources":["../../src/schemas/post.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { PhotoSchema } from './photo.js'\nimport { registry } from './registry.js'\n\nexport const V1PostsListQuerySchema = z.object({\n take: z.coerce.number().int().min(1).max(10).optional(),\n isReference: z.stringbool().optional(),\n})\n\nexport const V1HeaderPostItemSchema = z\n .object({\n title: z.string(),\n imageUrl: z.string().nullable(),\n href: z.string(),\n })\n .openapi('HeaderPostItem')\n\nexport const V1PostsListResponseSchema = z\n .object({\n posts: z.array(V1HeaderPostItemSchema),\n })\n .openapi('PostsListResponse')\n\nexport const V1PostsCatalogQuerySchema = z.object({\n tag: z.string().min(1).max(200).optional(),\n take: z.coerce.number().int().min(1).max(50).optional().default(12),\n skip: z.coerce.number().int().min(0).max(5000).optional().default(0),\n})\n\nexport const V1PostCatalogItemSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n link: z.string(),\n image: PhotoSchema.nullable(),\n })\n .openapi('PostCatalogItem')\n\nexport const V1PostCatalogTagSchema = z\n .object({\n slug: z.string(),\n name: z.string(),\n })\n .openapi('PostCatalogTag')\n\nexport const V1PostsCatalogResponseSchema = z\n .object({\n posts: z.array(V1PostCatalogItemSchema),\n postsCount: z.number().int().nonnegative(),\n tags: z.array(V1PostCatalogTagSchema),\n })\n .openapi('PostsCatalogResponse')\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/posts',\n tags: ['Posts'],\n description: 'Latest posts for header.',\n request: { query: V1PostsListQuerySchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1PostsListResponseSchema },\n },\n },\n 400: {\n description: 'Invalid request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 500: {\n description: 'Internal server error',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/posts/catalog',\n tags: ['Posts'],\n description: 'Paginated public post catalog with available tags.',\n request: { query: V1PostsCatalogQuerySchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1PostsCatalogResponseSchema },\n },\n },\n 400: {\n description: 'Invalid request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,sBAAsB,GAAGL,CAAC,CAACM,MAAM,CAAC;EAC7CC,IAAI,EAAEP,CAAC,CAACQ,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC;EACvDC,WAAW,EAAEd,CAAC,CAACe,UAAU,CAAC,CAAC,CAACF,QAAQ,CAAC;AACvC,CAAC,CAAC;AAEF,OAAO,MAAMG,sBAAsB,GAAGhB,CAAC,CACpCM,MAAM,CAAC;EACNW,KAAK,EAAEjB,CAAC,CAACkB,MAAM,CAAC,CAAC;EACjBC,QAAQ,EAAEnB,CAAC,CAACkB,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAC/BC,IAAI,EAAErB,CAAC,CAACkB,MAAM,CAAC;AACjB,CAAC,CAAC,CACDI,OAAO,CAAC,gBAAgB,CAA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