@twreporter-academy/api-types 0.0.1

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.
@@ -0,0 +1,14 @@
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 { V1TagSlugPathParamsSchema } from './schemas/tag.js';
7
+ export declare const V1TagCoursesRequestSchema: z.ZodObject<{
8
+ slug: z.ZodString;
9
+ take: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
10
+ skip: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
11
+ }, z.core.$strip>;
12
+ export type V1TagCoursesRequest = z.infer<typeof V1TagCoursesRequestSchema>;
13
+ export type V1TagMetaRequest = z.infer<typeof V1TagSlugPathParamsSchema>;
14
+ //# 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,EAEL,yBAAyB,EAC1B,MAAM,kBAAkB,CAAA;AAEzB,eAAO,MAAM,yBAAyB;;;;iBAErC,CAAA;AACD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
@@ -0,0 +1,8 @@
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 { V1TagBySlugCoursesQuerySchema, V1TagSlugPathParamsSchema } from './schemas/tag.js';
7
+ export const V1TagCoursesRequestSchema = V1TagSlugPathParamsSchema.merge(V1TagBySlugCoursesQuerySchema);
8
+ //# sourceMappingURL=api-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-variables.js","names":["V1TagBySlugCoursesQuerySchema","V1TagSlugPathParamsSchema","V1TagCoursesRequestSchema","merge"],"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 V1TagBySlugCoursesQuerySchema,\n V1TagSlugPathParamsSchema,\n} from './schemas/tag.js'\n\nexport const V1TagCoursesRequestSchema = V1TagSlugPathParamsSchema.merge(\n V1TagBySlugCoursesQuerySchema\n)\nexport type V1TagCoursesRequest = z.infer<typeof V1TagCoursesRequestSchema>\n\nexport type V1TagMetaRequest = z.infer<typeof V1TagSlugPathParamsSchema>\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAGA,SACEA,6BAA6B,EAC7BC,yBAAyB,QACpB,kBAAkB;AAEzB,OAAO,MAAMC,yBAAyB,GAAGD,yBAAyB,CAACE,KAAK,CACtEH,6BACF,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export * from './api-variables.js';
2
+ export * from './openapi.js';
3
+ export * from './rest.js';
4
+ export * from './schemas/tag.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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,kBAAkB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './api-variables.js';
2
+ export * from './openapi.js';
3
+ export * from './rest.js';
4
+ export * from './schemas/tag.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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/tag.js'\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,kBAAkB","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ export declare function getOpenApiDocument(): {
2
+ tags: {
3
+ readonly name: "Tags";
4
+ readonly description: "Tag metadata and course feeds by slug.";
5
+ }[];
6
+ openapi: string;
7
+ info: import("openapi3-ts/oas30").InfoObject;
8
+ servers?: import("openapi3-ts/oas30").ServerObject[];
9
+ paths: import("openapi3-ts/oas30").PathsObject;
10
+ components?: import("openapi3-ts/oas30").ComponentsObject;
11
+ security?: import("openapi3-ts/oas30").SecurityRequirementObject[];
12
+ externalDocs?: import("openapi3-ts/oas30").ExternalDocumentationObject;
13
+ };
14
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAQA,wBAAgB,kBAAkB;;;;;;;;;;;;EAcjC"}
@@ -0,0 +1,21 @@
1
+ import { OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi';
2
+ import { registry } from './schemas/tag.js';
3
+ const openApiRootTags = [{
4
+ name: 'Tags',
5
+ description: 'Tag metadata and course feeds by slug.'
6
+ }];
7
+ export function getOpenApiDocument() {
8
+ const generator = new OpenApiGeneratorV3(registry.definitions);
9
+ return {
10
+ ...generator.generateDocument({
11
+ openapi: '3.0.3',
12
+ info: {
13
+ title: 'TWReporter Academy API',
14
+ version: '0.0.1',
15
+ description: 'Academy content API. Serves tag metadata and course feeds.'
16
+ }
17
+ }),
18
+ tags: [...openApiRootTags]
19
+ };
20
+ }
21
+ //# sourceMappingURL=openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.js","names":["OpenApiGeneratorV3","registry","openApiRootTags","name","description","getOpenApiDocument","generator","definitions","generateDocument","openapi","info","title","version","tags"],"sources":["../src/openapi.ts"],"sourcesContent":["import { OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi'\n\nimport { registry } from './schemas/tag.js'\n\nconst openApiRootTags = [\n { name: 'Tags', description: 'Tag metadata and course feeds by slug.' },\n] as const\n\nexport function getOpenApiDocument() {\n const generator = new OpenApiGeneratorV3(registry.definitions)\n return {\n ...generator.generateDocument({\n openapi: '3.0.3',\n info: {\n title: 'TWReporter Academy API',\n version: '0.0.1',\n description:\n 'Academy content API. Serves tag metadata and course feeds.',\n },\n }),\n tags: [...openApiRootTags],\n }\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,SAASC,QAAQ,QAAQ,kBAAkB;AAE3C,MAAMC,eAAe,GAAG,CACtB;EAAEC,IAAI,EAAE,MAAM;EAAEC,WAAW,EAAE;AAAyC,CAAC,CAC/D;AAEV,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,MAAMC,SAAS,GAAG,IAAIN,kBAAkB,CAACC,QAAQ,CAACM,WAAW,CAAC;EAC9D,OAAO;IACL,GAAGD,SAAS,CAACE,gBAAgB,CAAC;MAC5BC,OAAO,EAAE,OAAO;MAChBC,IAAI,EAAE;QACJC,KAAK,EAAE,wBAAwB;QAC/BC,OAAO,EAAE,OAAO;QAChBR,WAAW,EACT;MACJ;IACF,CAAC,CAAC;IACFS,IAAI,EAAE,CAAC,GAAGX,eAAe;EAC3B,CAAC;AACH","ignoreList":[]}
package/dist/rest.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ export declare const RestErrorCodeSchema: z.ZodEnum<{
3
+ invalid_request: "invalid_request";
4
+ unauthorized: "unauthorized";
5
+ forbidden: "forbidden";
6
+ not_found: "not_found";
7
+ conflict: "conflict";
8
+ upstream_error: "upstream_error";
9
+ service_unavailable: "service_unavailable";
10
+ internal_server_error: "internal_server_error";
11
+ }>;
12
+ export declare const RestErrorBodySchema: z.ZodObject<{
13
+ error: z.ZodObject<{
14
+ code: z.ZodEnum<{
15
+ invalid_request: "invalid_request";
16
+ unauthorized: "unauthorized";
17
+ forbidden: "forbidden";
18
+ not_found: "not_found";
19
+ conflict: "conflict";
20
+ upstream_error: "upstream_error";
21
+ service_unavailable: "service_unavailable";
22
+ internal_server_error: "internal_server_error";
23
+ }>;
24
+ message: z.ZodString;
25
+ details: z.ZodOptional<z.ZodUnknown>;
26
+ }, z.core.$strip>;
27
+ }, z.core.$strip>;
28
+ //# sourceMappingURL=rest.d.ts.map
@@ -0,0 +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,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAM9B,CAAA"}
package/dist/rest.js ADDED
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export const RestErrorCodeSchema = z.enum(['invalid_request', 'unauthorized', 'forbidden', 'not_found', 'conflict', 'upstream_error', 'service_unavailable', 'internal_server_error']);
3
+ export const RestErrorBodySchema = z.object({
4
+ error: z.object({
5
+ code: RestErrorCodeSchema,
6
+ message: z.string(),
7
+ details: z.unknown().optional()
8
+ })
9
+ });
10
+ //# sourceMappingURL=rest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest.js","names":["z","RestErrorCodeSchema","enum","RestErrorBodySchema","object","error","code","message","string","details","unknown","optional"],"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 details: z.unknown().optional(),\n }),\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;IACnBC,OAAO,EAAET,CAAC,CAACU,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC;EAChC,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ import { OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
2
+ import { z } from 'zod';
3
+ export declare const registry: OpenAPIRegistry;
4
+ export declare const V1TagSlugPathParamsSchema: z.ZodObject<{
5
+ slug: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare const PhotoResizedSchema: z.ZodObject<{
8
+ small: z.ZodDefault<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export declare const CourseThumbnailSchema: z.ZodObject<{
11
+ resized: z.ZodObject<{
12
+ small: z.ZodDefault<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>;
15
+ export declare const V1TagBySlugMetaResponseSchema: z.ZodObject<{
16
+ ogTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ ogDescription: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ ogImage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
19
+ resized: z.ZodObject<{
20
+ small: z.ZodDefault<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>>>;
23
+ }, z.core.$strip>;
24
+ export declare const V1TagBySlugCoursesQuerySchema: z.ZodObject<{
25
+ take: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
26
+ skip: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
27
+ }, z.core.$strip>;
28
+ export declare const CourseCardSchema: z.ZodObject<{
29
+ slug: z.ZodString;
30
+ title: z.ZodString;
31
+ subtitle: z.ZodString;
32
+ summary: z.ZodString;
33
+ thumbnail: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ resized: z.ZodObject<{
35
+ small: z.ZodDefault<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ }, z.core.$strip>>>;
38
+ }, z.core.$strip>;
39
+ export declare const V1TagBySlugCoursesResponseSchema: z.ZodObject<{
40
+ name: z.ZodString;
41
+ coursesCount: z.ZodNumber;
42
+ courses: z.ZodArray<z.ZodObject<{
43
+ slug: z.ZodString;
44
+ title: z.ZodString;
45
+ subtitle: z.ZodString;
46
+ summary: z.ZodString;
47
+ thumbnail: z.ZodOptional<z.ZodNullable<z.ZodObject<{
48
+ resized: z.ZodObject<{
49
+ small: z.ZodDefault<z.ZodString>;
50
+ }, z.core.$strip>;
51
+ }, z.core.$strip>>>;
52
+ }, z.core.$strip>>;
53
+ }, z.core.$strip>;
54
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/schemas/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAChB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,QAAQ,iBAAwB,CAAA;AAI7C,eAAO,MAAM,yBAAyB;;iBAEpC,CAAA;AAEF,eAAO,MAAM,kBAAkB;;iBAIL,CAAA;AAE1B,eAAO,MAAM,qBAAqB;;;;iBAIL,CAAA;AAI7B,eAAO,MAAM,6BAA6B;;;;;;;;iBAIxC,CAAA;AAIF,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAQL,CAAA;AAExB,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;iBAI3C,CAAA"}
@@ -0,0 +1,123 @@
1
+ import { extendZodWithOpenApi, OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
2
+ import { z } from 'zod';
3
+ import { RestErrorBodySchema } from '../rest.js';
4
+ extendZodWithOpenApi(z);
5
+ export const registry = new OpenAPIRegistry();
6
+
7
+ // --- Shared path params ---
8
+
9
+ export const V1TagSlugPathParamsSchema = z.object({
10
+ slug: z.string().min(1).max(200)
11
+ });
12
+ export const PhotoResizedSchema = z.object({
13
+ small: z.string().default('')
14
+ }).openapi('ResizedPhoto');
15
+ export const CourseThumbnailSchema = z.object({
16
+ resized: PhotoResizedSchema
17
+ }).openapi('CourseThumbnail');
18
+
19
+ // --- Tag meta response ---
20
+
21
+ export const V1TagBySlugMetaResponseSchema = z.object({
22
+ ogTitle: z.string().nullable().optional(),
23
+ ogDescription: z.string().nullable().optional(),
24
+ ogImage: CourseThumbnailSchema.nullable().optional()
25
+ });
26
+
27
+ // --- Tag courses query & response ---
28
+
29
+ export const V1TagBySlugCoursesQuerySchema = z.object({
30
+ take: z.coerce.number().int().min(1).max(50).optional().default(12),
31
+ skip: z.coerce.number().int().min(0).max(5000).optional().default(0)
32
+ });
33
+ export const CourseCardSchema = z.object({
34
+ slug: z.string(),
35
+ title: z.string(),
36
+ subtitle: z.string(),
37
+ summary: z.string(),
38
+ thumbnail: CourseThumbnailSchema.nullable().optional()
39
+ }).openapi('CourseCard');
40
+ export const V1TagBySlugCoursesResponseSchema = z.object({
41
+ name: z.string(),
42
+ coursesCount: z.number().int().min(0),
43
+ courses: z.array(CourseCardSchema)
44
+ });
45
+
46
+ // --- OpenAPI path registration ---
47
+
48
+ const internalServerErrorResponse = {
49
+ 500: {
50
+ description: 'Internal server error',
51
+ content: {
52
+ 'application/json': {
53
+ schema: RestErrorBodySchema
54
+ }
55
+ }
56
+ }
57
+ };
58
+ registry.registerPath({
59
+ method: 'get',
60
+ path: '/v1/tags/{slug}/meta',
61
+ tags: ['Tags'],
62
+ description: 'OG metadata for a tag page.',
63
+ request: {
64
+ params: V1TagSlugPathParamsSchema
65
+ },
66
+ responses: {
67
+ 200: {
68
+ description: 'Success',
69
+ content: {
70
+ 'application/json': {
71
+ schema: V1TagBySlugMetaResponseSchema
72
+ }
73
+ }
74
+ },
75
+ 404: {
76
+ description: 'Tag not found',
77
+ content: {
78
+ 'application/json': {
79
+ schema: RestErrorBodySchema
80
+ }
81
+ }
82
+ },
83
+ ...internalServerErrorResponse
84
+ }
85
+ });
86
+ registry.registerPath({
87
+ method: 'get',
88
+ path: '/v1/tags/{slug}/courses',
89
+ tags: ['Tags'],
90
+ description: 'Courses for a tag (with count).',
91
+ request: {
92
+ params: V1TagSlugPathParamsSchema,
93
+ query: V1TagBySlugCoursesQuerySchema
94
+ },
95
+ responses: {
96
+ 200: {
97
+ description: 'Success',
98
+ content: {
99
+ 'application/json': {
100
+ schema: V1TagBySlugCoursesResponseSchema
101
+ }
102
+ }
103
+ },
104
+ 404: {
105
+ description: 'Tag not found',
106
+ content: {
107
+ 'application/json': {
108
+ schema: RestErrorBodySchema
109
+ }
110
+ }
111
+ },
112
+ 400: {
113
+ description: 'Bad request',
114
+ content: {
115
+ 'application/json': {
116
+ schema: RestErrorBodySchema
117
+ }
118
+ }
119
+ },
120
+ ...internalServerErrorResponse
121
+ }
122
+ });
123
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.js","names":["extendZodWithOpenApi","OpenAPIRegistry","z","RestErrorBodySchema","registry","V1TagSlugPathParamsSchema","object","slug","string","min","max","PhotoResizedSchema","small","default","openapi","CourseThumbnailSchema","resized","V1TagBySlugMetaResponseSchema","ogTitle","nullable","optional","ogDescription","ogImage","V1TagBySlugCoursesQuerySchema","take","coerce","number","int","skip","CourseCardSchema","title","subtitle","summary","thumbnail","V1TagBySlugCoursesResponseSchema","name","coursesCount","courses","array","internalServerErrorResponse","description","content","schema","registerPath","method","path","tags","request","params","responses","query"],"sources":["../../src/schemas/tag.ts"],"sourcesContent":["import {\n extendZodWithOpenApi,\n OpenAPIRegistry,\n} from '@asteasolutions/zod-to-openapi'\nimport { z } from 'zod'\n\nimport { RestErrorBodySchema } from '../rest.js'\n\nextendZodWithOpenApi(z)\n\nexport const registry = new OpenAPIRegistry()\n\n// --- Shared path params ---\n\nexport const V1TagSlugPathParamsSchema = z.object({\n slug: z.string().min(1).max(200),\n})\n\nexport const PhotoResizedSchema = z\n .object({\n small: z.string().default(''),\n })\n .openapi('ResizedPhoto')\n\nexport const CourseThumbnailSchema = z\n .object({\n resized: PhotoResizedSchema,\n })\n .openapi('CourseThumbnail')\n\n// --- Tag meta response ---\n\nexport const V1TagBySlugMetaResponseSchema = z.object({\n ogTitle: z.string().nullable().optional(),\n ogDescription: z.string().nullable().optional(),\n ogImage: CourseThumbnailSchema.nullable().optional(),\n})\n\n// --- Tag courses query & response ---\n\nexport const V1TagBySlugCoursesQuerySchema = z.object({\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 CourseCardSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n thumbnail: CourseThumbnailSchema.nullable().optional(),\n })\n .openapi('CourseCard')\n\nexport const V1TagBySlugCoursesResponseSchema = z.object({\n name: z.string(),\n coursesCount: z.number().int().min(0),\n courses: z.array(CourseCardSchema),\n})\n\n// --- OpenAPI path registration ---\n\nconst internalServerErrorResponse = {\n 500: {\n description: 'Internal server error',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n} as const\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/tags/{slug}/meta',\n tags: ['Tags'],\n description: 'OG metadata for a tag page.',\n request: { params: V1TagSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1TagBySlugMetaResponseSchema },\n },\n },\n 404: {\n description: 'Tag not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/tags/{slug}/courses',\n tags: ['Tags'],\n description: 'Courses for a tag (with count).',\n request: {\n params: V1TagSlugPathParamsSchema,\n query: V1TagBySlugCoursesQuerySchema,\n },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1TagBySlugCoursesResponseSchema },\n },\n },\n 404: {\n description: 'Tag not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SACEA,oBAAoB,EACpBC,eAAe,QACV,gCAAgC;AACvC,SAASC,CAAC,QAAQ,KAAK;AAEvB,SAASC,mBAAmB,QAAQ,YAAY;AAEhDH,oBAAoB,CAACE,CAAC,CAAC;AAEvB,OAAO,MAAME,QAAQ,GAAG,IAAIH,eAAe,CAAC,CAAC;;AAE7C;;AAEA,OAAO,MAAMI,yBAAyB,GAAGH,CAAC,CAACI,MAAM,CAAC;EAChDC,IAAI,EAAEL,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,GAAG;AACjC,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,GAAGT,CAAC,CAChCI,MAAM,CAAC;EACNM,KAAK,EAAEV,CAAC,CAACM,MAAM,CAAC,CAAC,CAACK,OAAO,CAAC,EAAE;AAC9B,CAAC,CAAC,CACDC,OAAO,CAAC,cAAc,CAAC;AAE1B,OAAO,MAAMC,qBAAqB,GAAGb,CAAC,CACnCI,MAAM,CAAC;EACNU,OAAO,EAAEL;AACX,CAAC,CAAC,CACDG,OAAO,CAAC,iBAAiB,CAAC;;AAE7B;;AAEA,OAAO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AAS,EAAE;IACT,GAAG,EAAE;MACHT,WAAW,EAAE,SAAS;MACtBC,OAAO,EAAE;QACP,kBAAkB,EAAE;UAAEC,MAAM,EAAER;QAAiC;MACjE;IACF,CAAC;IACD,GAAG,EAAE;MACHM,WAAW,EAAE,eAAe;MAC5BC,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAEvC;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG,EAAE;MACHqC,WAAW,EAAE,aAAa;MAC1BC,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAEvC;QAAoB;MAAE;IACjE,CAAC;IACD,GAAGoC;EACL;AACF,CAAC,CAAC","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@twreporter-academy/api-types",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "default": "./dist/index.js"
16
+ }
17
+ },
18
+ "scripts": {
19
+ "build": "./scripts/build.sh",
20
+ "type-check": "tsc --noEmit -p tsconfig.json",
21
+ "lint:check": "eslint src --ext .ts",
22
+ "lint:fix": "eslint src --ext .ts --fix",
23
+ "prepack": "yarn build"
24
+ },
25
+ "dependencies": {
26
+ "@asteasolutions/zod-to-openapi": "^8.1.0",
27
+ "@babel/runtime": "^7.18.5",
28
+ "zod": "^4.1.12"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/twreporter/academy-private-monorepo.git",
36
+ "directory": "packages/api-types"
37
+ },
38
+ "devDependencies": {
39
+ "@babel/cli": "^7.18.5",
40
+ "@babel/core": "^7.18.5",
41
+ "@babel/plugin-transform-runtime": "^7.18.5",
42
+ "@babel/preset-env": "^7.18.2",
43
+ "@babel/preset-typescript": "^7.17.12",
44
+ "typescript": "5.9.2"
45
+ }
46
+ }