@kids-reporter/api-types 0.0.1 → 0.0.3
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/api-variables.d.ts +120 -0
- package/dist/api-variables.d.ts.map +1 -0
- package/dist/api-variables.js +32 -0
- package/dist/api-variables.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/rest.d.ts +0 -3
- package/dist/rest.d.ts.map +1 -1
- package/dist/rest.js.map +1 -1
- package/dist/schemas/content.d.ts +2 -3
- package/dist/schemas/content.d.ts.map +1 -1
- package/dist/schemas/content.js +9 -9
- package/dist/schemas/content.js.map +1 -1
- package/dist/schemas/extra-openapi-paths.d.ts +79 -0
- package/dist/schemas/extra-openapi-paths.d.ts.map +1 -1
- package/dist/schemas/extra-openapi-paths.js +14 -14
- package/dist/schemas/extra-openapi-paths.js.map +1 -1
- package/dist/schemas/member-essay-answers-has-liked.d.ts +5 -0
- package/dist/schemas/member-essay-answers-has-liked.d.ts.map +1 -1
- package/dist/schemas/member-essay-answers-has-liked.js +1 -1
- package/dist/schemas/member-essay-answers-has-liked.js.map +1 -1
- package/dist/schemas/qna.d.ts +6 -0
- package/dist/schemas/qna.d.ts.map +1 -1
- package/dist/schemas/qna.js +2 -2
- package/dist/schemas/qna.js.map +1 -1
- package/dist/shared-types.d.ts +17 -0
- package/dist/shared-types.d.ts.map +1 -0
- package/dist/shared-types.js +2 -0
- package/dist/shared-types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request variable types (path params, query strings, bodies, client composites).
|
|
3
|
+
* Inferred from Zod schemas — single source of truth for api/ and content-api layers.
|
|
4
|
+
*/
|
|
5
|
+
import type { z } from 'zod';
|
|
6
|
+
import { V1AuthorAvatarPathParamsSchema, V1CallBaodaozaiIntroPathParamsSchema, V1EditorPicksSettingsQuerySchema, V1MemberPostsWithAnswersQuerySchema, V1PostBySlugPathParamsSchema, V1PostBySlugQuerySchema, V1PostsEssayAnswersWithLikesQuerySchema, V1PostsQuerySchema, V1ProjectsQuerySchema, V1SitemapsQuerySchema } from './schemas/content.js';
|
|
7
|
+
import { V1AuthorBySlugPostsQuerySchema, V1CategoryBySlugMetadataQuerySchema, V1CategoryPostsQuerySchema, V1FeedSlugPathParamsSchema, V1SubSubcategoryBySlugPostsQuerySchema, V1TagBySlugPostsQuerySchema } from './schemas/content-feed-queries.js';
|
|
8
|
+
import { V1EssayAnswersHasLikedQuerySchema } from './schemas/member-essay-answers-has-liked.js';
|
|
9
|
+
import { V1AllPostEssayAnswersQuerySchema, V1CreatePostChoiceAnswerBodySchema, V1CreatePostEssayAnswerBodySchema, V1CreatePostEssayAnswerLikeBodySchema, V1MemberPostChoiceAnswersQuerySchema, V1MemberPostEssayAnswersQuerySchema, V1PatchPostChoiceAnswerBodySchema, V1PatchPostEssayAnswerBodySchema, V1PostChoiceAnswerPathIdSchema, V1PostEssayAnswerLikePathIdSchema, V1PostEssayAnswerPathIdSchema, V1PostEssayQuestionAnswersParamsSchema, V1PostEssayQuestionAnswersQuerySchema } from './schemas/qna.js';
|
|
10
|
+
import type { V1MemberProfilePatchBody } from './shared-types.js';
|
|
11
|
+
export type V1PostsQuery = z.infer<typeof V1PostsQuerySchema>;
|
|
12
|
+
export type V1PostBySlugPathParams = z.infer<typeof V1PostBySlugPathParamsSchema>;
|
|
13
|
+
export type V1PostBySlugQuery = z.infer<typeof V1PostBySlugQuerySchema>;
|
|
14
|
+
export type V1PostsEssayAnswersWithLikesQuery = z.infer<typeof V1PostsEssayAnswersWithLikesQuerySchema>;
|
|
15
|
+
export type V1SitemapsQuery = z.infer<typeof V1SitemapsQuerySchema>;
|
|
16
|
+
export type V1ProjectsQuery = z.infer<typeof V1ProjectsQuerySchema>;
|
|
17
|
+
export type V1EditorPicksSettingsQuery = z.infer<typeof V1EditorPicksSettingsQuerySchema>;
|
|
18
|
+
export type V1MemberPostsWithAnswersQuery = z.infer<typeof V1MemberPostsWithAnswersQuerySchema>;
|
|
19
|
+
export type { V1MemberProfilePatchBody };
|
|
20
|
+
export type V1AuthorAvatarPathParams = z.infer<typeof V1AuthorAvatarPathParamsSchema>;
|
|
21
|
+
export type V1CallBaodaozaiIntroPathParams = z.infer<typeof V1CallBaodaozaiIntroPathParamsSchema>;
|
|
22
|
+
export declare const V1PostBySlugRequestSchema: z.ZodObject<{
|
|
23
|
+
slug: z.ZodString;
|
|
24
|
+
take: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
25
|
+
postEssayQuestionsTake: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
26
|
+
postChoiceQuestionsTake: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type V1PostBySlugRequest = z.infer<typeof V1PostBySlugRequestSchema>;
|
|
29
|
+
export type V1PostMetaBySlugRequest = Pick<V1PostBySlugRequest, 'slug'>;
|
|
30
|
+
export type V1FeedSlugPathParams = z.infer<typeof V1FeedSlugPathParamsSchema>;
|
|
31
|
+
export type V1CategoryPostsQuery = z.infer<typeof V1CategoryPostsQuerySchema>;
|
|
32
|
+
export type V1CategoryBySlugMetadataQuery = z.infer<typeof V1CategoryBySlugMetadataQuerySchema>;
|
|
33
|
+
export type V1SubSubcategoryBySlugPostsQuery = z.infer<typeof V1SubSubcategoryBySlugPostsQuerySchema>;
|
|
34
|
+
export type V1TagBySlugPostsQuery = z.infer<typeof V1TagBySlugPostsQuerySchema>;
|
|
35
|
+
export type V1AuthorBySlugPostsQuery = z.infer<typeof V1AuthorBySlugPostsQuerySchema>;
|
|
36
|
+
export declare const V1CategoryPostsRequestSchema: z.ZodObject<{
|
|
37
|
+
slug: z.ZodString;
|
|
38
|
+
take: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
39
|
+
skip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export type V1CategoryPostsRequest = z.infer<typeof V1CategoryPostsRequestSchema>;
|
|
42
|
+
export declare const V1CategoryMetadataRequestSchema: z.ZodObject<{
|
|
43
|
+
slug: z.ZodString;
|
|
44
|
+
subcategorySlug: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type V1CategoryMetadataRequest = z.infer<typeof V1CategoryMetadataRequestSchema>;
|
|
47
|
+
export declare const V1CategorySubcategoriesThemeRequestSchema: z.ZodObject<{
|
|
48
|
+
slug: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type V1CategorySubcategoriesThemeRequest = z.infer<typeof V1CategorySubcategoriesThemeRequestSchema>;
|
|
51
|
+
export declare const V1SubcategoryPostsRequestSchema: z.ZodObject<{
|
|
52
|
+
slug: z.ZodString;
|
|
53
|
+
take: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
54
|
+
skip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type V1SubcategoryPostsRequest = z.infer<typeof V1SubcategoryPostsRequestSchema>;
|
|
57
|
+
export declare const V1SubSubcategoryPostsRequestSchema: z.ZodObject<{
|
|
58
|
+
slug: z.ZodString;
|
|
59
|
+
take: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
60
|
+
skip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
61
|
+
orderBy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
"publishedDate:desc": "publishedDate:desc";
|
|
63
|
+
}>>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type V1SubSubcategoryPostsRequest = z.infer<typeof V1SubSubcategoryPostsRequestSchema>;
|
|
66
|
+
export declare const V1TagPostsRequestSchema: z.ZodObject<{
|
|
67
|
+
slug: z.ZodString;
|
|
68
|
+
take: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
69
|
+
skip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
70
|
+
orderBy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
71
|
+
"publishedDate:desc": "publishedDate:desc";
|
|
72
|
+
}>>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export type V1TagPostsRequest = z.infer<typeof V1TagPostsRequestSchema>;
|
|
75
|
+
export declare const V1AuthorPostsRequestSchema: z.ZodObject<{
|
|
76
|
+
slug: z.ZodString;
|
|
77
|
+
take: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
78
|
+
skip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
79
|
+
orderBy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
"publishedDate:desc": "publishedDate:desc";
|
|
81
|
+
}>>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export type V1AuthorPostsRequest = z.infer<typeof V1AuthorPostsRequestSchema>;
|
|
84
|
+
export declare const V1AuthorMetaRequestSchema: z.ZodObject<{
|
|
85
|
+
slug: z.ZodString;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export type V1AuthorMetaRequest = z.infer<typeof V1AuthorMetaRequestSchema>;
|
|
88
|
+
export declare const V1TagMetaRequestSchema: z.ZodObject<{
|
|
89
|
+
slug: z.ZodString;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export type V1TagMetaRequest = z.infer<typeof V1TagMetaRequestSchema>;
|
|
92
|
+
export declare const V1ProjectBySlugRequestSchema: z.ZodObject<{
|
|
93
|
+
slug: z.ZodString;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export type V1ProjectBySlugRequest = z.infer<typeof V1ProjectBySlugRequestSchema>;
|
|
96
|
+
export type V1AllPostEssayAnswersQuery = z.infer<typeof V1AllPostEssayAnswersQuerySchema>;
|
|
97
|
+
export type V1PostEssayQuestionAnswersParams = z.infer<typeof V1PostEssayQuestionAnswersParamsSchema>;
|
|
98
|
+
export type V1PostEssayQuestionAnswersQuery = z.infer<typeof V1PostEssayQuestionAnswersQuerySchema>;
|
|
99
|
+
export declare const V1PostEssayQuestionAnswersRequestSchema: z.ZodObject<{
|
|
100
|
+
questionId: z.ZodCoercedNumber<unknown>;
|
|
101
|
+
answerTake: z.ZodCoercedNumber<unknown>;
|
|
102
|
+
answerSkip: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
103
|
+
answerOrderBy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
104
|
+
"likesCount:desc": "likesCount:desc";
|
|
105
|
+
"createdAt:desc": "createdAt:desc";
|
|
106
|
+
}>>>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type V1PostEssayQuestionAnswersRequest = z.infer<typeof V1PostEssayQuestionAnswersRequestSchema>;
|
|
109
|
+
export type V1MemberPostChoiceAnswersQuery = z.infer<typeof V1MemberPostChoiceAnswersQuerySchema>;
|
|
110
|
+
export type V1MemberPostEssayAnswersQuery = z.infer<typeof V1MemberPostEssayAnswersQuerySchema>;
|
|
111
|
+
export type V1CreatePostChoiceAnswerBody = z.infer<typeof V1CreatePostChoiceAnswerBodySchema>;
|
|
112
|
+
export type V1PatchPostChoiceAnswerBody = z.infer<typeof V1PatchPostChoiceAnswerBodySchema>;
|
|
113
|
+
export type V1CreatePostEssayAnswerBody = z.infer<typeof V1CreatePostEssayAnswerBodySchema>;
|
|
114
|
+
export type V1PatchPostEssayAnswerBody = z.infer<typeof V1PatchPostEssayAnswerBodySchema>;
|
|
115
|
+
export type V1CreatePostEssayAnswerLikeBody = z.infer<typeof V1CreatePostEssayAnswerLikeBodySchema>;
|
|
116
|
+
export type V1PostChoiceAnswerPathId = z.infer<typeof V1PostChoiceAnswerPathIdSchema>;
|
|
117
|
+
export type V1PostEssayAnswerPathId = z.infer<typeof V1PostEssayAnswerPathIdSchema>;
|
|
118
|
+
export type V1PostEssayAnswerLikePathId = z.infer<typeof V1PostEssayAnswerLikePathIdSchema>;
|
|
119
|
+
export type V1EssayAnswersHasLikedQuery = z.infer<typeof V1EssayAnswersHasLikedQuerySchema>;
|
|
120
|
+
//# sourceMappingURL=api-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-variables.d.ts","sourceRoot":"","sources":["../src/api-variables.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,EACL,8BAA8B,EAC9B,oCAAoC,EACpC,gCAAgC,EAChC,mCAAmC,EACnC,4BAA4B,EAC5B,uBAAuB,EACvB,uCAAuC,EACvC,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,EACnC,0BAA0B,EAC1B,0BAA0B,EAC1B,sCAAsC,EACtC,2BAA2B,EAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,iCAAiC,EACjC,qCAAqC,EACrC,oCAAoC,EACpC,mCAAmC,EACnC,iCAAiC,EACjC,gCAAgC,EAChC,8BAA8B,EAC9B,iCAAiC,EACjC,6BAA6B,EAC7B,sCAAsC,EACtC,qCAAqC,EACtC,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAIjE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAA;AACD,MAAM,MAAM,iBAAiB,GAAG,CAAC,C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AAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAA;AAID,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request variable types (path params, query strings, bodies, client composites).
|
|
3
|
+
* Inferred from Zod schemas — single source of truth for api/ and content-api layers.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { V1PostBySlugPathParamsSchema, V1PostBySlugQuerySchema } from './schemas/content.js';
|
|
7
|
+
import { V1AuthorBySlugPostsQuerySchema, V1CategoryBySlugMetadataQuerySchema, V1CategoryPostsQuerySchema, V1FeedSlugPathParamsSchema, V1SubSubcategoryBySlugPostsQuerySchema, V1TagBySlugPostsQuerySchema } from './schemas/content-feed-queries.js';
|
|
8
|
+
import { V1PostEssayQuestionAnswersParamsSchema, V1PostEssayQuestionAnswersQuerySchema } from './schemas/qna.js';
|
|
9
|
+
|
|
10
|
+
// --- Posts / content ---
|
|
11
|
+
|
|
12
|
+
export const V1PostBySlugRequestSchema = V1PostBySlugPathParamsSchema.merge(V1PostBySlugQuerySchema);
|
|
13
|
+
|
|
14
|
+
// --- Feeds ---
|
|
15
|
+
|
|
16
|
+
export const V1CategoryPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(V1CategoryPostsQuerySchema);
|
|
17
|
+
export const V1CategoryMetadataRequestSchema = V1FeedSlugPathParamsSchema.merge(V1CategoryBySlugMetadataQuerySchema);
|
|
18
|
+
export const V1CategorySubcategoriesThemeRequestSchema = V1FeedSlugPathParamsSchema;
|
|
19
|
+
export const V1SubcategoryPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(V1CategoryPostsQuerySchema);
|
|
20
|
+
export const V1SubSubcategoryPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(V1SubSubcategoryBySlugPostsQuerySchema);
|
|
21
|
+
export const V1TagPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(V1TagBySlugPostsQuerySchema);
|
|
22
|
+
export const V1AuthorPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(V1AuthorBySlugPostsQuerySchema);
|
|
23
|
+
export const V1AuthorMetaRequestSchema = V1FeedSlugPathParamsSchema;
|
|
24
|
+
export const V1TagMetaRequestSchema = V1FeedSlugPathParamsSchema;
|
|
25
|
+
export const V1ProjectBySlugRequestSchema = V1FeedSlugPathParamsSchema;
|
|
26
|
+
|
|
27
|
+
// --- QnA ---
|
|
28
|
+
|
|
29
|
+
export const V1PostEssayQuestionAnswersRequestSchema = V1PostEssayQuestionAnswersParamsSchema.merge(V1PostEssayQuestionAnswersQuerySchema);
|
|
30
|
+
|
|
31
|
+
// --- Member activity ---
|
|
32
|
+
//# sourceMappingURL=api-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-variables.js","names":["V1PostBySlugPathParamsSchema","V1PostBySlugQuerySchema","V1AuthorBySlugPostsQuerySchema","V1CategoryBySlugMetadataQuerySchema","V1CategoryPostsQuerySchema","V1FeedSlugPathParamsSchema","V1SubSubcategoryBySlugPostsQuerySchema","V1TagBySlugPostsQuerySchema","V1PostEssayQuestionAnswersParamsSchema","V1PostEssayQuestionAnswersQuerySchema","V1PostBySlugRequestSchema","merge","V1CategoryPostsRequestSchema","V1CategoryMetadataRequestSchema","V1CategorySubcategoriesThemeRequestSchema","V1SubcategoryPostsRequestSchema","V1SubSubcategoryPostsRequestSchema","V1TagPostsRequestSchema","V1AuthorPostsRequestSchema","V1AuthorMetaRequestSchema","V1TagMetaRequestSchema","V1ProjectBySlugRequestSchema","V1PostEssayQuestionAnswersRequestSchema"],"sources":["../src/api-variables.ts"],"sourcesContent":["/**\n * Request variable types (path params, query strings, bodies, client composites).\n * Inferred from Zod schemas — single source of truth for api/ and content-api layers.\n */\nimport type { z } from 'zod'\n\nimport {\n V1AuthorAvatarPathParamsSchema,\n V1CallBaodaozaiIntroPathParamsSchema,\n V1EditorPicksSettingsQuerySchema,\n V1MemberPostsWithAnswersQuerySchema,\n V1PostBySlugPathParamsSchema,\n V1PostBySlugQuerySchema,\n V1PostsEssayAnswersWithLikesQuerySchema,\n V1PostsQuerySchema,\n V1ProjectsQuerySchema,\n V1SitemapsQuerySchema,\n} from './schemas/content.js'\nimport {\n V1AuthorBySlugPostsQuerySchema,\n V1CategoryBySlugMetadataQuerySchema,\n V1CategoryPostsQuerySchema,\n V1FeedSlugPathParamsSchema,\n V1SubSubcategoryBySlugPostsQuerySchema,\n V1TagBySlugPostsQuerySchema,\n} from './schemas/content-feed-queries.js'\nimport { V1EssayAnswersHasLikedQuerySchema } from './schemas/member-essay-answers-has-liked.js'\nimport {\n V1AllPostEssayAnswersQuerySchema,\n V1CreatePostChoiceAnswerBodySchema,\n V1CreatePostEssayAnswerBodySchema,\n V1CreatePostEssayAnswerLikeBodySchema,\n V1MemberPostChoiceAnswersQuerySchema,\n V1MemberPostEssayAnswersQuerySchema,\n V1PatchPostChoiceAnswerBodySchema,\n V1PatchPostEssayAnswerBodySchema,\n V1PostChoiceAnswerPathIdSchema,\n V1PostEssayAnswerLikePathIdSchema,\n V1PostEssayAnswerPathIdSchema,\n V1PostEssayQuestionAnswersParamsSchema,\n V1PostEssayQuestionAnswersQuerySchema,\n} from './schemas/qna.js'\nimport type { V1MemberProfilePatchBody } from './shared-types.js'\n\n// --- Posts / content ---\n\nexport type V1PostsQuery = z.infer<typeof V1PostsQuerySchema>\nexport type V1PostBySlugPathParams = z.infer<\n typeof V1PostBySlugPathParamsSchema\n>\nexport type V1PostBySlugQuery = z.infer<typeof V1PostBySlugQuerySchema>\nexport type V1PostsEssayAnswersWithLikesQuery = z.infer<\n typeof V1PostsEssayAnswersWithLikesQuerySchema\n>\nexport type V1SitemapsQuery = z.infer<typeof V1SitemapsQuerySchema>\nexport type V1ProjectsQuery = z.infer<typeof V1ProjectsQuerySchema>\nexport type V1EditorPicksSettingsQuery = z.infer<\n typeof V1EditorPicksSettingsQuerySchema\n>\nexport type V1MemberPostsWithAnswersQuery = z.infer<\n typeof V1MemberPostsWithAnswersQuerySchema\n>\nexport type { V1MemberProfilePatchBody }\nexport type V1AuthorAvatarPathParams = z.infer<\n typeof V1AuthorAvatarPathParamsSchema\n>\nexport type V1CallBaodaozaiIntroPathParams = z.infer<\n typeof V1CallBaodaozaiIntroPathParamsSchema\n>\n\nexport const V1PostBySlugRequestSchema = V1PostBySlugPathParamsSchema.merge(\n V1PostBySlugQuerySchema\n)\nexport type V1PostBySlugRequest = z.infer<typeof V1PostBySlugRequestSchema>\n\nexport type V1PostMetaBySlugRequest = Pick<V1PostBySlugRequest, 'slug'>\n\n// --- Feeds ---\n\nexport type V1FeedSlugPathParams = z.infer<typeof V1FeedSlugPathParamsSchema>\nexport type V1CategoryPostsQuery = z.infer<typeof V1CategoryPostsQuerySchema>\nexport type V1CategoryBySlugMetadataQuery = z.infer<\n typeof V1CategoryBySlugMetadataQuerySchema\n>\nexport type V1SubSubcategoryBySlugPostsQuery = z.infer<\n typeof V1SubSubcategoryBySlugPostsQuerySchema\n>\nexport type V1TagBySlugPostsQuery = z.infer<typeof V1TagBySlugPostsQuerySchema>\nexport type V1AuthorBySlugPostsQuery = z.infer<\n typeof V1AuthorBySlugPostsQuerySchema\n>\n\nexport const V1CategoryPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(\n V1CategoryPostsQuerySchema\n)\nexport type V1CategoryPostsRequest = z.infer<\n typeof V1CategoryPostsRequestSchema\n>\n\nexport const V1CategoryMetadataRequestSchema = V1FeedSlugPathParamsSchema.merge(\n V1CategoryBySlugMetadataQuerySchema\n)\nexport type V1CategoryMetadataRequest = z.infer<\n typeof V1CategoryMetadataRequestSchema\n>\n\nexport const V1CategorySubcategoriesThemeRequestSchema =\n V1FeedSlugPathParamsSchema\nexport type V1CategorySubcategoriesThemeRequest = z.infer<\n typeof V1CategorySubcategoriesThemeRequestSchema\n>\n\nexport const V1SubcategoryPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(\n V1CategoryPostsQuerySchema\n)\nexport type V1SubcategoryPostsRequest = z.infer<\n typeof V1SubcategoryPostsRequestSchema\n>\n\nexport const V1SubSubcategoryPostsRequestSchema =\n V1FeedSlugPathParamsSchema.merge(V1SubSubcategoryBySlugPostsQuerySchema)\nexport type V1SubSubcategoryPostsRequest = z.infer<\n typeof V1SubSubcategoryPostsRequestSchema\n>\n\nexport const V1TagPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(\n V1TagBySlugPostsQuerySchema\n)\nexport type V1TagPostsRequest = z.infer<typeof V1TagPostsRequestSchema>\n\nexport const V1AuthorPostsRequestSchema = V1FeedSlugPathParamsSchema.merge(\n V1AuthorBySlugPostsQuerySchema\n)\nexport type V1AuthorPostsRequest = z.infer<typeof V1AuthorPostsRequestSchema>\n\nexport const V1AuthorMetaRequestSchema = V1FeedSlugPathParamsSchema\nexport type V1AuthorMetaRequest = z.infer<typeof V1AuthorMetaRequestSchema>\n\nexport const V1TagMetaRequestSchema = V1FeedSlugPathParamsSchema\nexport type V1TagMetaRequest = z.infer<typeof V1TagMetaRequestSchema>\n\nexport const V1ProjectBySlugRequestSchema = V1FeedSlugPathParamsSchema\nexport type V1ProjectBySlugRequest = z.infer<\n typeof V1ProjectBySlugRequestSchema\n>\n\n// --- QnA ---\n\nexport type V1AllPostEssayAnswersQuery = z.infer<\n typeof V1AllPostEssayAnswersQuerySchema\n>\nexport type V1PostEssayQuestionAnswersParams = z.infer<\n typeof V1PostEssayQuestionAnswersParamsSchema\n>\nexport type V1PostEssayQuestionAnswersQuery = z.infer<\n typeof V1PostEssayQuestionAnswersQuerySchema\n>\n\nexport const V1PostEssayQuestionAnswersRequestSchema =\n V1PostEssayQuestionAnswersParamsSchema.merge(\n V1PostEssayQuestionAnswersQuerySchema\n )\nexport type V1PostEssayQuestionAnswersRequest = z.infer<\n typeof V1PostEssayQuestionAnswersRequestSchema\n>\n\nexport type V1MemberPostChoiceAnswersQuery = z.infer<\n typeof V1MemberPostChoiceAnswersQuerySchema\n>\nexport type V1MemberPostEssayAnswersQuery = z.infer<\n typeof V1MemberPostEssayAnswersQuerySchema\n>\n\nexport type V1CreatePostChoiceAnswerBody = z.infer<\n typeof V1CreatePostChoiceAnswerBodySchema\n>\nexport type V1PatchPostChoiceAnswerBody = z.infer<\n typeof V1PatchPostChoiceAnswerBodySchema\n>\nexport type V1CreatePostEssayAnswerBody = z.infer<\n typeof V1CreatePostEssayAnswerBodySchema\n>\nexport type V1PatchPostEssayAnswerBody = z.infer<\n typeof V1PatchPostEssayAnswerBodySchema\n>\nexport type V1CreatePostEssayAnswerLikeBody = z.infer<\n typeof V1CreatePostEssayAnswerLikeBodySchema\n>\n\nexport type V1PostChoiceAnswerPathId = z.infer<\n typeof V1PostChoiceAnswerPathIdSchema\n>\nexport type V1PostEssayAnswerPathId = z.infer<\n typeof V1PostEssayAnswerPathIdSchema\n>\nexport type V1PostEssayAnswerLikePathId = z.infer<\n typeof V1PostEssayAnswerLikePathIdSchema\n>\n\n// --- Member activity ---\n\nexport type V1EssayAnswersHasLikedQuery = z.infer<\n typeof V1EssayAnswersHasLikedQuerySchema\n>\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAGA,SAKEA,4BAA4B,EAC5BC,uBAAuB,QAKlB,sBAAsB;AAC7B,SACEC,8BAA8B,EAC9BC,mCAAmC,EACnCC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,sCAAsC,EACtCC,2BAA2B,QACtB,mCAAmC;AAE1C,SAYEC,sCAAsC,EACtCC,qCAAqC,QAChC,kBAAkB;;AAGzB;;AA0BA,OAAO,MAAMC,yBAAyB,GAAGV,4BAA4B,CAACW,KAAK,CACzEV,uBACF,CAAC;;AAKD;;AAeA,OAAO,MAAMW,4BAA4B,GAAGP,0BAA0B,CAACM,KAAK,CAC1EP,0BACF,CAAC;AAKD,OAAO,MAAMS,+BAA+B,GAAGR,0BAA0B,CAACM,KAAK,CAC7ER,mCACF,CAAC;AAKD,OAAO,MAAMW,yCAAyC,GACpDT,0BAA0B;AAK5B,OAAO,MAAMU,+BAA+B,GAAGV,0BAA0B,CAACM,KAAK,CAC7EP,0BACF,CAAC;AAKD,OAAO,MAAMY,kCAAkC,GAC7CX,0BAA0B,CAACM,KAAK,CAACL,sCAAsC,CAAC;AAK1E,OAAO,MAAMW,uBAAuB,GAAGZ,0BAA0B,CAACM,KAAK,CACrEJ,2BACF,CAAC;AAGD,OAAO,MAAMW,0BAA0B,GAAGb,0BAA0B,CAACM,KAAK,CACxET,8BACF,CAAC;AAGD,OAAO,MAAMiB,yBAAyB,GAAGd,0BAA0B;AAGnE,OAAO,MAAMe,sBAAsB,GAAGf,0BAA0B;AAGhE,OAAO,MAAMgB,4BAA4B,GAAGhB,0BAA0B;;AAKtE;;AAYA,OAAO,MAAMiB,uCAAuC,GAClDd,sCAAsC,CAACG,KAAK,CAC1CF,qCACF,CAAC;;AAsCH","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './api-variables.js';
|
|
1
2
|
export * from './openapi.js';
|
|
2
3
|
export * from './rest.js';
|
|
3
4
|
export * from './schemas/content.js';
|
|
@@ -6,4 +7,5 @@ export * from './schemas/content-feed-responses.js';
|
|
|
6
7
|
export * from './schemas/extra-openapi-paths.js';
|
|
7
8
|
export * from './schemas/member-essay-answers-has-liked.js';
|
|
8
9
|
export * from './schemas/qna.js';
|
|
10
|
+
export * from './shared-types.js';
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,sBAAsB,CAAA;AACpC,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,kCAAkC,CAAA;AAChD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,sBAAsB,CAAA;AACpC,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,kCAAkC,CAAA;AAChD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './api-variables.js';
|
|
1
2
|
export * from './openapi.js';
|
|
2
3
|
export * from './rest.js';
|
|
3
4
|
export * from './schemas/content.js';
|
|
@@ -6,4 +7,5 @@ export * from './schemas/content-feed-responses.js';
|
|
|
6
7
|
export * from './schemas/extra-openapi-paths.js';
|
|
7
8
|
export * from './schemas/member-essay-answers-has-liked.js';
|
|
8
9
|
export * from './schemas/qna.js';
|
|
10
|
+
export * from './shared-types.js';
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './openapi.js'\nexport * from './rest.js'\nexport * from './schemas/content.js'\nexport * from './schemas/content-feed-queries.js'\nexport * from './schemas/content-feed-responses.js'\nexport * from './schemas/extra-openapi-paths.js'\nexport * from './schemas/member-essay-answers-has-liked.js'\nexport * from './schemas/qna.js'\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,sBAAsB;AACpC,cAAc,mCAAmC;AACjD,cAAc,qCAAqC;AACnD,cAAc,kCAAkC;AAChD,cAAc,6CAA6C;AAC3D,cAAc,kBAAkB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './api-variables.js'\nexport * from './openapi.js'\nexport * from './rest.js'\nexport * from './schemas/content.js'\nexport * from './schemas/content-feed-queries.js'\nexport * from './schemas/content-feed-responses.js'\nexport * from './schemas/extra-openapi-paths.js'\nexport * from './schemas/member-essay-answers-has-liked.js'\nexport * from './schemas/qna.js'\nexport * from './shared-types.js'\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,sBAAsB;AACpC,cAAc,mCAAmC;AACjD,cAAc,qCAAqC;AACnD,cAAc,kCAAkC;AAChD,cAAc,6CAA6C;AAC3D,cAAc,kBAAkB;AAChC,cAAc,mBAAmB","ignoreList":[]}
|
package/dist/rest.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export declare const RestErrorCodeSchema: z.ZodEnum<{
|
|
|
9
9
|
service_unavailable: "service_unavailable";
|
|
10
10
|
internal_server_error: "internal_server_error";
|
|
11
11
|
}>;
|
|
12
|
-
export type RestErrorCode = z.infer<typeof RestErrorCodeSchema>;
|
|
13
12
|
export declare const RestErrorBodySchema: z.ZodObject<{
|
|
14
13
|
error: z.ZodObject<{
|
|
15
14
|
code: z.ZodEnum<{
|
|
@@ -26,7 +25,6 @@ export declare const RestErrorBodySchema: z.ZodObject<{
|
|
|
26
25
|
details: z.ZodOptional<z.ZodUnknown>;
|
|
27
26
|
}, z.core.$strip>;
|
|
28
27
|
}, z.core.$strip>;
|
|
29
|
-
export type RestErrorBody = z.infer<typeof RestErrorBodySchema>;
|
|
30
28
|
export declare const RestOkSchema: z.ZodObject<{
|
|
31
29
|
status: z.ZodLiteral<"success">;
|
|
32
30
|
data: z.ZodUnknown;
|
|
@@ -53,5 +51,4 @@ export declare const RestEnvelopeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
53
51
|
error: z.ZodOptional<z.ZodUnknown>;
|
|
54
52
|
errors: z.ZodOptional<z.ZodUnknown>;
|
|
55
53
|
}, z.core.$strip>]>;
|
|
56
|
-
export type RestEnvelope = z.infer<typeof RestEnvelopeSchema>;
|
|
57
54
|
//# sourceMappingURL=rest.d.ts.map
|
package/dist/rest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../src/rest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB;;;;;;;;;EAS9B,CAAA;AAEF,
|
|
1
|
+
{"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../src/rest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB;;;;;;;;;EAS9B,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAO9B,CAAA;AAEF,eAAO,MAAM,YAAY;;;iBAGvB,CAAA;AAEF,eAAO,MAAM,cAAc;;;iBAGzB,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;iBAK1B,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;mBAI7B,CAAA"}
|
package/dist/rest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.js","names":["z","RestErrorCodeSchema","enum","RestErrorBodySchema","object","error","code","message","string","details","unknown","optional","RestOkSchema","status","literal","data","RestFailSchema","RestErrorSchema","errors","RestEnvelopeSchema","union"],"sources":["../src/rest.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const RestErrorCodeSchema = z.enum([\n 'invalid_request',\n 'unauthorized',\n 'forbidden',\n 'not_found',\n 'conflict',\n 'upstream_error',\n 'service_unavailable',\n 'internal_server_error',\n])\n\nexport
|
|
1
|
+
{"version":3,"file":"rest.js","names":["z","RestErrorCodeSchema","enum","RestErrorBodySchema","object","error","code","message","string","details","unknown","optional","RestOkSchema","status","literal","data","RestFailSchema","RestErrorSchema","errors","RestEnvelopeSchema","union"],"sources":["../src/rest.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const RestErrorCodeSchema = z.enum([\n 'invalid_request',\n 'unauthorized',\n 'forbidden',\n 'not_found',\n 'conflict',\n 'upstream_error',\n 'service_unavailable',\n 'internal_server_error',\n])\n\nexport const RestErrorBodySchema = z.object({\n error: z.object({\n code: RestErrorCodeSchema,\n message: z.string(),\n /** `z.json()` is recursive and breaks zod-to-openapi (stack overflow on /openapi.json). */\n details: z.unknown().optional(),\n }),\n})\n\nexport const RestOkSchema = z.object({\n status: z.literal('success'),\n data: z.unknown(),\n})\n\nexport const RestFailSchema = z.object({\n status: z.literal('fail'),\n data: z.unknown(),\n})\n\nexport const RestErrorSchema = z.object({\n status: z.literal('error'),\n message: z.string().optional(),\n error: z.unknown().optional(),\n errors: z.unknown().optional(),\n})\n\nexport const RestEnvelopeSchema = z.union([\n RestOkSchema,\n RestFailSchema,\n RestErrorSchema,\n])\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,mBAAmB,GAAGD,CAAC,CAACE,IAAI,CAAC,CACxC,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,CACxB,CAAC;AAEF,OAAO,MAAMC,mBAAmB,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC1CC,KAAK,EAAEL,CAAC,CAACI,MAAM,CAAC;IACdE,IAAI,EAAEL,mBAAmB;IACzBM,OAAO,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;IACnB;IACAC,OAAO,EAAET,CAAC,CAACU,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC;EAChC,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,MAAMC,YAAY,GAAGZ,CAAC,CAACI,MAAM,CAAC;EACnCS,MAAM,EAAEb,CAAC,CAACc,OAAO,CAAC,SAAS,CAAC;EAC5BC,IAAI,EAAEf,CAAC,CAACU,OAAO,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMM,cAAc,GAAGhB,CAAC,CAACI,MAAM,CAAC;EACrCS,MAAM,EAAEb,CAAC,CAACc,OAAO,CAAC,MAAM,CAAC;EACzBC,IAAI,EAAEf,CAAC,CAACU,OAAO,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAGjB,CAAC,CAACI,MAAM,CAAC;EACtCS,MAAM,EAAEb,CAAC,CAACc,OAAO,CAAC,OAAO,CAAC;EAC1BP,OAAO,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC;EAC9BN,KAAK,EAAEL,CAAC,CAACU,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC7BO,MAAM,EAAElB,CAAC,CAACU,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMQ,kBAAkB,GAAGnB,CAAC,CAACoB,KAAK,CAAC,CACxCR,YAAY,EACZI,cAAc,EACdC,eAAe,CAChB,CAAC","ignoreList":[]}
|
|
@@ -47,7 +47,6 @@ export declare const PostContentSchema: z.ZodObject<{
|
|
|
47
47
|
}, z.core.$strip>>>;
|
|
48
48
|
publishedDate: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
|
-
export type PostContent = z.infer<typeof PostContentSchema>;
|
|
51
50
|
export declare const SubcategoryItemSchema: z.ZodObject<{
|
|
52
51
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
53
52
|
name: z.ZodString;
|
|
@@ -329,7 +328,7 @@ export declare const V1MemberPostsWithAnswersQuerySchema: z.ZodObject<{
|
|
|
329
328
|
export declare const V1PostBySlugPathParamsSchema: z.ZodObject<{
|
|
330
329
|
slug: z.ZodString;
|
|
331
330
|
}, z.core.$strip>;
|
|
332
|
-
/** Flat query for `GET /v1/posts/
|
|
331
|
+
/** Flat query for `GET /v1/posts/{slug}` (news-reading order + related-posts filter are fixed server-side). */
|
|
333
332
|
export declare const V1PostBySlugQuerySchema: z.ZodObject<{
|
|
334
333
|
take: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
335
334
|
postEssayQuestionsTake: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -360,7 +359,7 @@ export declare const V1ProjectBySlugMetaResponseSchema: z.ZodObject<{
|
|
|
360
359
|
}, z.core.$strip>;
|
|
361
360
|
}, z.core.$strip>>;
|
|
362
361
|
}, z.core.$strip>;
|
|
363
|
-
/** Hero image payloads returned by `/v1/projects/
|
|
362
|
+
/** Hero image payloads returned by `/v1/projects/{slug}` match Prisma-mapper targets. */
|
|
364
363
|
export declare const V1ProjectDetailPhotoResizedSchema: z.ZodObject<{
|
|
365
364
|
resized: z.ZodObject<{
|
|
366
365
|
small: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/schemas/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAChB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAavB,eAAO,MAAM,QAAQ,iBAAwB,CAAA;AAE7C,eAAO,MAAM,kBAAkB;;iBAOL,CAAA;AAE1B,eAAO,MAAM,mBAAmB;;;;iBAIL,CAAA;AAE3B;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;iBAiBL,CAAA;AAEhC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;iBASL,CAAA;AAEzB,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","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,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE/C,CAAA;AA8BD,eAAO,MAAM,oBAAoB;;;iBAKP,CAAA;AAE1B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAaP,CAAA;AAE3B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;iBAAwB,CAAA;AAElE,eAAO,MAAM,8BAA8B;;;;;;kBAQX,CAAA;AAEhC,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAA;AAEF,4DAA4D;AAC5D,eAAO,MAAM,mCAAmC;;;iBAG9C,CAAA;AAqFF,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,+GAA+G;AAC/G,eAAO,MAAM,uBAAuB;;;;iBAgBlC,CAAA;AAEF,eAAO,MAAM,qBAAqB;;iBAEhC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;kBAAgC,CAAA;AACzE,eAAO,MAAM,+BAA+B;;;kBAAgC,CAAA;AAE5E,eAAO,MAAM,iCAAiC;;;;;;;;;iBAS5C,CAAA;AAEF,yFAAyF;AACzF,eAAO,MAAM,iCAAiC;;;;;;iBAM5C,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9C,CAAA;AAEF,eAAO,MAAM,wCAAwC;;iBAEnD,CAAA;AAEF,eAAO,MAAM,gCAAgC;;iBAE3C,CAAA;AAiIF,eAAO,MAAM,uCAAuC;;;;;;;;;;;iBAYlD,CAAA;AA6HF,cAAc,0BAA0B,CAAA"}
|
package/dist/schemas/content.js
CHANGED
|
@@ -126,7 +126,7 @@ export const V1AuthorAvatarResponseSchema = z.object({
|
|
|
126
126
|
}).openapi('AuthorAvatarTiny');
|
|
127
127
|
registry.registerPath({
|
|
128
128
|
method: 'get',
|
|
129
|
-
path: '/v1/authors/
|
|
129
|
+
path: '/v1/authors/{slug}/avatar',
|
|
130
130
|
tags: ['Taxonomy'],
|
|
131
131
|
description: 'Author avatar tiny image URL by slug. `tiny` is empty when the author or avatar is missing.',
|
|
132
132
|
request: {
|
|
@@ -407,7 +407,7 @@ export const V1PostBySlugPathParamsSchema = z.object({
|
|
|
407
407
|
slug: z.string().min(1)
|
|
408
408
|
});
|
|
409
409
|
|
|
410
|
-
/** Flat query for `GET /v1/posts/
|
|
410
|
+
/** Flat query for `GET /v1/posts/{slug}` (news-reading order + related-posts filter are fixed server-side). */
|
|
411
411
|
export const V1PostBySlugQuerySchema = z.object({
|
|
412
412
|
take: z.coerce.number().int().min(1).max(50).optional().default(5),
|
|
413
413
|
postEssayQuestionsTake: z.coerce.number().int().min(1).max(50).optional().default(3),
|
|
@@ -433,7 +433,7 @@ export const V1ProjectBySlugMetaResponseSchema = z.object({
|
|
|
433
433
|
}).nullable()
|
|
434
434
|
});
|
|
435
435
|
|
|
436
|
-
/** Hero image payloads returned by `/v1/projects/
|
|
436
|
+
/** Hero image payloads returned by `/v1/projects/{slug}` match Prisma-mapper targets. */
|
|
437
437
|
export const V1ProjectDetailPhotoResizedSchema = z.object({
|
|
438
438
|
resized: z.object({
|
|
439
439
|
small: z.string(),
|
|
@@ -515,7 +515,7 @@ registry.registerPath({
|
|
|
515
515
|
});
|
|
516
516
|
registry.registerPath({
|
|
517
517
|
method: 'get',
|
|
518
|
-
path: '/v1/projects/
|
|
518
|
+
path: '/v1/projects/{slug}',
|
|
519
519
|
tags: ['Projects'],
|
|
520
520
|
description: 'Published project detail for topic page (matches GraphQL `GetProject`).',
|
|
521
521
|
request: {
|
|
@@ -542,7 +542,7 @@ registry.registerPath({
|
|
|
542
542
|
});
|
|
543
543
|
registry.registerPath({
|
|
544
544
|
method: 'get',
|
|
545
|
-
path: '/v1/projects/
|
|
545
|
+
path: '/v1/projects/{slug}/meta',
|
|
546
546
|
tags: ['Projects'],
|
|
547
547
|
description: 'Published project OG metadata (matches GraphQL `GetProjectMeta`).',
|
|
548
548
|
request: {
|
|
@@ -569,7 +569,7 @@ registry.registerPath({
|
|
|
569
569
|
});
|
|
570
570
|
registry.registerPath({
|
|
571
571
|
method: 'get',
|
|
572
|
-
path: '/v1/projects/
|
|
572
|
+
path: '/v1/projects/{slug}/related-posts-count',
|
|
573
573
|
tags: ['Projects'],
|
|
574
574
|
description: 'Count of public posts linked to a published project (matches GraphQL `relatedPostsCount` on project).',
|
|
575
575
|
request: {
|
|
@@ -603,7 +603,7 @@ export const V1PostsEssayAnswersWithLikesQuerySchema = z.object({
|
|
|
603
603
|
});
|
|
604
604
|
registry.registerPath({
|
|
605
605
|
method: 'get',
|
|
606
|
-
path: '/v1/posts/
|
|
606
|
+
path: '/v1/posts/{slug}',
|
|
607
607
|
tags: ['Posts'],
|
|
608
608
|
description: 'Single post article payload (matches GraphQL `GetPost`). Flat query: `take`, `postEssayQuestionsTake`, `postChoiceQuestionsTake` (1–50 each, defaults 5/3/3). News-reading item order and nested related-posts filter are fixed server-side.',
|
|
609
609
|
request: {
|
|
@@ -639,7 +639,7 @@ registry.registerPath({
|
|
|
639
639
|
});
|
|
640
640
|
registry.registerPath({
|
|
641
641
|
method: 'get',
|
|
642
|
-
path: '/v1/posts/
|
|
642
|
+
path: '/v1/posts/{slug}/meta',
|
|
643
643
|
tags: ['Posts'],
|
|
644
644
|
description: 'Post SEO / Open Graph metadata (matches GraphQL `GetPostMeta`).',
|
|
645
645
|
request: {
|
|
@@ -666,7 +666,7 @@ registry.registerPath({
|
|
|
666
666
|
});
|
|
667
667
|
registry.registerPath({
|
|
668
668
|
method: 'get',
|
|
669
|
-
path: '/v1/posts/
|
|
669
|
+
path: '/v1/posts/{slug}/essay-questions',
|
|
670
670
|
tags: ['Posts'],
|
|
671
671
|
description: 'Post card plus essay questions (matches GraphQL `GetPostEssayQuestions`).',
|
|
672
672
|
request: {
|