@twreporter-academy/api-types 0.0.13 → 0.0.14
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +4 -0
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +4 -0
- package/dist/openapi.js.map +1 -1
- package/dist/responses.d.ts +56 -0
- package/dist/responses.d.ts.map +1 -0
- package/dist/responses.js +29 -0
- package/dist/responses.js.map +1 -0
- package/dist/schemas/course.d.ts.map +1 -1
- package/dist/schemas/course.js +1 -10
- package/dist/schemas/course.js.map +1 -1
- package/dist/schemas/home.d.ts +80 -0
- package/dist/schemas/home.d.ts.map +1 -0
- package/dist/schemas/home.js +66 -0
- package/dist/schemas/home.js.map +1 -0
- package/dist/schemas/lesson-progress.d.ts.map +1 -1
- package/dist/schemas/lesson-progress.js +1 -20
- package/dist/schemas/lesson-progress.js.map +1 -1
- package/dist/schemas/member.d.ts.map +1 -1
- package/dist/schemas/member.js +1 -20
- package/dist/schemas/member.js.map +1 -1
- package/dist/schemas/tag.d.ts.map +1 -1
- package/dist/schemas/tag.js +1 -10
- package/dist/schemas/tag.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './openapi.js';
|
|
|
3
3
|
export * from './rest.js';
|
|
4
4
|
export * from './schemas/activity.js';
|
|
5
5
|
export * from './schemas/course.js';
|
|
6
|
+
export * from './schemas/home.js';
|
|
6
7
|
export * from './schemas/lesson-progress.js';
|
|
7
8
|
export * from './schemas/member.js';
|
|
8
9
|
export * from './schemas/photo.js';
|
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,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,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,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './openapi.js';
|
|
|
3
3
|
export * from './rest.js';
|
|
4
4
|
export * from './schemas/activity.js';
|
|
5
5
|
export * from './schemas/course.js';
|
|
6
|
+
export * from './schemas/home.js';
|
|
6
7
|
export * from './schemas/lesson-progress.js';
|
|
7
8
|
export * from './schemas/member.js';
|
|
8
9
|
export * from './schemas/photo.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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/activity.js'\nexport * from './schemas/course.js'\nexport * from './schemas/lesson-progress.js'\nexport * from './schemas/member.js'\nexport * from './schemas/photo.js'\nexport * from './schemas/post.js'\nexport * from './schemas/tag.js'\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,8BAA8B;AAC5C,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,mBAAmB;AACjC,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/activity.js'\nexport * from './schemas/course.js'\nexport * from './schemas/home.js'\nexport * from './schemas/lesson-progress.js'\nexport * from './schemas/member.js'\nexport * from './schemas/photo.js'\nexport * from './schemas/post.js'\nexport * from './schemas/tag.js'\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,WAAW;AACzB,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,mBAAmB;AACjC,cAAc,8BAA8B;AAC5C,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB","ignoreList":[]}
|
package/dist/openapi.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import './schemas/activity.js';
|
|
|
2
2
|
import './schemas/course.js';
|
|
3
3
|
import './schemas/member.js';
|
|
4
4
|
import './schemas/post.js';
|
|
5
|
+
import './schemas/home.js';
|
|
5
6
|
export declare function getOpenApiDocument(): {
|
|
6
7
|
tags: ({
|
|
7
8
|
readonly name: "Auth";
|
|
@@ -18,6 +19,9 @@ export declare function getOpenApiDocument(): {
|
|
|
18
19
|
} | {
|
|
19
20
|
readonly name: "Courses";
|
|
20
21
|
readonly description: "Course metadata and classroom detail.";
|
|
22
|
+
} | {
|
|
23
|
+
readonly name: "Home";
|
|
24
|
+
readonly description: "Home page data including posts, activities, and courses.";
|
|
21
25
|
})[];
|
|
22
26
|
openapi: string;
|
|
23
27
|
info: import("openapi3-ts/oas30").InfoObject;
|
package/dist/openapi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,mBAAmB,CAAA;AAC1B,OAAO,mBAAmB,CAAA;AAqB1B,wBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcjC"}
|
package/dist/openapi.js
CHANGED
|
@@ -3,6 +3,7 @@ import './schemas/activity.js';
|
|
|
3
3
|
import './schemas/course.js';
|
|
4
4
|
import './schemas/member.js';
|
|
5
5
|
import './schemas/post.js';
|
|
6
|
+
import './schemas/home.js';
|
|
6
7
|
import { OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi';
|
|
7
8
|
import { registry } from './schemas/registry.js';
|
|
8
9
|
const openApiRootTags = [{
|
|
@@ -20,6 +21,9 @@ const openApiRootTags = [{
|
|
|
20
21
|
}, {
|
|
21
22
|
name: 'Courses',
|
|
22
23
|
description: 'Course metadata and classroom detail.'
|
|
24
|
+
}, {
|
|
25
|
+
name: 'Home',
|
|
26
|
+
description: 'Home page data including posts, activities, and courses.'
|
|
23
27
|
}];
|
|
24
28
|
export function getOpenApiDocument() {
|
|
25
29
|
const generator = new OpenApiGeneratorV3(registry.definitions);
|
package/dist/openapi.js.map
CHANGED
|
@@ -1 +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":["// Side-effect imports: ensure OpenAPI paths are registered before generation.\nimport './schemas/activity.js'\nimport './schemas/course.js'\nimport './schemas/member.js'\nimport './schemas/post.js'\n\nimport { OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi'\n\nimport { registry } from './schemas/registry.js'\n\nconst openApiRootTags = [\n { name: 'Auth', description: 'Token exchange and session management.' },\n { name: 'Members', description: 'Authenticated member profile.' },\n {\n name: 'Admin',\n description: 'Privileged operations requiring GCP IAM authentication.',\n },\n { name: 'Tags', description: 'Tag metadata and course feeds by slug.' },\n { name: 'Courses', description: 'Course metadata and classroom detail.' },\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, course feeds, and classroom detail.',\n },\n }),\n tags: [...openApiRootTags],\n }\n}\n"],"mappings":"AAAA;AACA,OAAO,uBAAuB;AAC9B,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAE1B,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,SAASC,QAAQ,QAAQ,uBAAuB;AAEhD,MAAMC,eAAe,GAAG,CACtB;EAAEC,IAAI,EAAE,MAAM;EAAEC,WAAW,EAAE;AAAyC,CAAC,EACvE;EAAED,IAAI,EAAE,SAAS;EAAEC,WAAW,EAAE;AAAgC,CAAC,EACjE;EACED,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE;AACf,CAAC,EACD;EAAED,IAAI,EAAE,MAAM;EAAEC,WAAW,EAAE;AAAyC,CAAC,EACvE;EAAED,IAAI,EAAE,SAAS;EAAEC,WAAW,EAAE;AAAwC,CAAC,
|
|
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":["// Side-effect imports: ensure OpenAPI paths are registered before generation.\nimport './schemas/activity.js'\nimport './schemas/course.js'\nimport './schemas/member.js'\nimport './schemas/post.js'\nimport './schemas/home.js'\n\nimport { OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi'\n\nimport { registry } from './schemas/registry.js'\n\nconst openApiRootTags = [\n { name: 'Auth', description: 'Token exchange and session management.' },\n { name: 'Members', description: 'Authenticated member profile.' },\n {\n name: 'Admin',\n description: 'Privileged operations requiring GCP IAM authentication.',\n },\n { name: 'Tags', description: 'Tag metadata and course feeds by slug.' },\n { name: 'Courses', description: 'Course metadata and classroom detail.' },\n {\n name: 'Home',\n description: 'Home page data including posts, activities, and courses.',\n },\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, course feeds, and classroom detail.',\n },\n }),\n tags: [...openApiRootTags],\n }\n}\n"],"mappings":"AAAA;AACA,OAAO,uBAAuB;AAC9B,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAC1B,OAAO,mBAAmB;AAE1B,SAASA,kBAAkB,QAAQ,gCAAgC;AAEnE,SAASC,QAAQ,QAAQ,uBAAuB;AAEhD,MAAMC,eAAe,GAAG,CACtB;EAAEC,IAAI,EAAE,MAAM;EAAEC,WAAW,EAAE;AAAyC,CAAC,EACvE;EAAED,IAAI,EAAE,SAAS;EAAEC,WAAW,EAAE;AAAgC,CAAC,EACjE;EACED,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE;AACf,CAAC,EACD;EAAED,IAAI,EAAE,MAAM;EAAEC,WAAW,EAAE;AAAyC,CAAC,EACvE;EAAED,IAAI,EAAE,SAAS;EAAEC,WAAW,EAAE;AAAwC,CAAC,EACzE;EACED,IAAI,EAAE,MAAM;EACZC,WAAW,EAAE;AACf,CAAC,CACO;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":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared OpenAPI response definitions reused across route registrations.
|
|
3
|
+
* Keeping them here avoids duplicating the same error-response blocks in
|
|
4
|
+
* every schema file.
|
|
5
|
+
*/
|
|
6
|
+
export declare const unauthorizedResponse: {
|
|
7
|
+
readonly 401: {
|
|
8
|
+
readonly description: "Unauthorized — missing or invalid JWT";
|
|
9
|
+
readonly content: {
|
|
10
|
+
readonly 'application/json': {
|
|
11
|
+
readonly schema: import("zod").ZodObject<{
|
|
12
|
+
error: import("zod").ZodObject<{
|
|
13
|
+
code: import("zod").ZodEnum<{
|
|
14
|
+
invalid_request: "invalid_request";
|
|
15
|
+
unauthorized: "unauthorized";
|
|
16
|
+
forbidden: "forbidden";
|
|
17
|
+
not_found: "not_found";
|
|
18
|
+
conflict: "conflict";
|
|
19
|
+
upstream_error: "upstream_error";
|
|
20
|
+
service_unavailable: "service_unavailable";
|
|
21
|
+
internal_server_error: "internal_server_error";
|
|
22
|
+
}>;
|
|
23
|
+
message: import("zod").ZodString;
|
|
24
|
+
details: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
25
|
+
}, import("zod/v4/core").$strip>;
|
|
26
|
+
}, import("zod/v4/core").$strip>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const internalServerErrorResponse: {
|
|
32
|
+
readonly 500: {
|
|
33
|
+
readonly description: "Internal server error";
|
|
34
|
+
readonly content: {
|
|
35
|
+
readonly 'application/json': {
|
|
36
|
+
readonly schema: import("zod").ZodObject<{
|
|
37
|
+
error: import("zod").ZodObject<{
|
|
38
|
+
code: import("zod").ZodEnum<{
|
|
39
|
+
invalid_request: "invalid_request";
|
|
40
|
+
unauthorized: "unauthorized";
|
|
41
|
+
forbidden: "forbidden";
|
|
42
|
+
not_found: "not_found";
|
|
43
|
+
conflict: "conflict";
|
|
44
|
+
upstream_error: "upstream_error";
|
|
45
|
+
service_unavailable: "service_unavailable";
|
|
46
|
+
internal_server_error: "internal_server_error";
|
|
47
|
+
}>;
|
|
48
|
+
message: import("zod").ZodString;
|
|
49
|
+
details: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
50
|
+
}, import("zod/v4/core").$strip>;
|
|
51
|
+
}, import("zod/v4/core").$strip>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../src/responses.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;CAKvB,CAAA;AAEV,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;CAK9B,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RestErrorBodySchema } from './rest.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared OpenAPI response definitions reused across route registrations.
|
|
5
|
+
* Keeping them here avoids duplicating the same error-response blocks in
|
|
6
|
+
* every schema file.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const unauthorizedResponse = {
|
|
10
|
+
401: {
|
|
11
|
+
description: 'Unauthorized — missing or invalid JWT',
|
|
12
|
+
content: {
|
|
13
|
+
'application/json': {
|
|
14
|
+
schema: RestErrorBodySchema
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const internalServerErrorResponse = {
|
|
20
|
+
500: {
|
|
21
|
+
description: 'Internal server error',
|
|
22
|
+
content: {
|
|
23
|
+
'application/json': {
|
|
24
|
+
schema: RestErrorBodySchema
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","names":["RestErrorBodySchema","unauthorizedResponse","description","content","schema","internalServerErrorResponse"],"sources":["../src/responses.ts"],"sourcesContent":["import { RestErrorBodySchema } from './rest.js'\n\n/**\n * Shared OpenAPI response definitions reused across route registrations.\n * Keeping them here avoids duplicating the same error-response blocks in\n * every schema file.\n */\n\nexport const unauthorizedResponse = {\n 401: {\n description: 'Unauthorized — missing or invalid JWT',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n} as const\n\nexport const internalServerErrorResponse = {\n 500: {\n description: 'Internal server error',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n} as const\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,WAAW;;AAE/C;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,oBAAoB,GAAG;EAClC,GAAG,EAAE;IACHC,WAAW,EAAE,uCAAuC;IACpDC,OAAO,EAAE;MAAE,kBAAkB,EAAE;QAAEC,MAAM,EAAEJ;MAAoB;IAAE;EACjE;AACF,CAAU;AAEV,OAAO,MAAMK,2BAA2B,GAAG;EACzC,GAAG,EAAE;IACHH,WAAW,EAAE,uBAAuB;IACpCC,OAAO,EAAE;MAAE,kBAAkB,EAAE;QAAEC,MAAM,EAAEJ;MAAoB;IAAE;EACjE;AACF,CAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course.d.ts","sourceRoot":"","sources":["../../src/schemas/course.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"course.d.ts","sourceRoot":"","sources":["../../src/schemas/course.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,OAAO,EAAE,GACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE3B,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAO/C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;iBAI3C,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAcP,CAAA;AAE1B,eAAO,MAAM,wBAAwB;;;;iBAQP,CAAA;AAE9B,eAAO,MAAM,wBAAwB;;;;;;;iBASP,CAAA;AAE9B,eAAO,MAAM,sBAAsB;;;;;iBAQP,CAAA;AAE5B,eAAO,MAAM,4BAA4B;;;;;;iBAQP,CAAA;AAElC,eAAO,MAAM,oBAAoB;;;EAAuC,CAAA;AAExE,eAAO,MAAM,yBAAyB;;;EAAyB,CAAA;AAE/D,eAAO,MAAM,wBAAwB;;;;;;;;iBAOP,CAAA;AAE9B,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAIP,CAAA;AAEjC,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBf,CAAA;AAE7B,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBf,CAAA"}
|
package/dist/schemas/course.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { internalServerErrorResponse } from '../responses.js';
|
|
2
3
|
import { RestErrorBodySchema } from '../rest.js';
|
|
3
4
|
import { CloudflareStreamVideoSchema } from './cloudflare-stream.js';
|
|
4
5
|
import { V1LessonProgressSchema } from './lesson-progress.js';
|
|
@@ -106,16 +107,6 @@ export const V1CourseBySlugResponseSchema = z.object({
|
|
|
106
107
|
|
|
107
108
|
// --- OpenAPI path registration ---
|
|
108
109
|
|
|
109
|
-
const internalServerErrorResponse = {
|
|
110
|
-
500: {
|
|
111
|
-
description: 'Internal server error',
|
|
112
|
-
content: {
|
|
113
|
-
'application/json': {
|
|
114
|
-
schema: RestErrorBodySchema
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
110
|
registry.registerPath({
|
|
120
111
|
method: 'get',
|
|
121
112
|
path: '/v1/courses',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course.js","names":["z","RestErrorBodySchema","CloudflareStreamVideoSchema","V1LessonProgressSchema","PhotoSchema","registry","CourseThumbnailSchema","JsonValueSchema","union","string","number","boolean","null","array","unknown","record","V1CourseSlugPathParamsSchema","object","slug","min","max","V1CourseBySlugMetaResponseSchema","ogTitle","ogDescription","ogImage","nullable","V1CourseLessonSchema","id","order","int","title","videoId","durationSeconds","isFree","progress","optional","openapi","V1CourseLessonMetaSchema","duration","V1CourseInstructorSchema","name","bio","avatarUrl","V1CourseResourceSchema","description","downloadUrl","V1CourseFurtherReadingSchema","excerpt","thumbnailUrl","url","V1CourseStatusSchema","enum","V1HeaderCourseBadgeSchema","V1HeaderCourseItemSchema","subtitle","badge","V1CoursesListResponseSchema","courses","V1CourseTagSchema","V1ClassroomBySlugResponseSchema","summary","status","tags","previewVideoId","lessons","instructors","resources","furtherReading","V1CourseBySlugResponseSchema","launchAt","iso","datetime","trialVideos","lessonsMeta","heroImageVideo","heroImage","internalServerErrorResponse","content","schema","registerPath","method","path","responses","request","params"],"sources":["../../src/schemas/course.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { RestErrorBodySchema } from '../rest.js'\nimport { CloudflareStreamVideoSchema } from './cloudflare-stream.js'\nimport { V1LessonProgressSchema } from './lesson-progress.js'\nimport { PhotoSchema } from './photo.js'\nimport { registry } from './registry.js'\nimport { CourseThumbnailSchema } from './tag.js'\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | unknown[]\n | Record<string, unknown>\n\nexport const JsonValueSchema: z.ZodType<JsonValue> = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n])\n\nexport const V1CourseSlugPathParamsSchema = z.object({\n slug: z.string().min(1).max(200),\n})\n\nexport const V1CourseBySlugMetaResponseSchema = z.object({\n ogTitle: z.string(),\n ogDescription: z.string(),\n ogImage: CourseThumbnailSchema.nullable(),\n})\n\nexport const V1CourseLessonSchema = z\n .object({\n id: z.string(),\n order: z.number().int(),\n title: z.string(),\n /** Cloudflare stream id for this lesson; null when not yet set */\n videoId: z.string().nullable(),\n /** Video length in seconds (from CMS); null when not yet set */\n durationSeconds: z.number().int().nullable(),\n /** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */\n isFree: z.boolean(),\n /** Present when request includes a valid member JWT; null when no progress record */\n progress: V1LessonProgressSchema.nullable().optional(),\n })\n .openapi('CourseLesson')\n\nexport const V1CourseLessonMetaSchema = z\n .object({\n order: z.number().int().nullable(),\n title: z.string(),\n /** Video length in seconds (from CMS); null when not yet set */\n duration: z.number().int().nullable(),\n /** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */\n })\n .openapi('CourseLessonMeta')\n\nexport const V1CourseInstructorSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n title: z.string(),\n bio: z.string(),\n avatarUrl: z.string().nullable(),\n })\n .openapi('CourseInstructor')\n\nexport const V1CourseResourceSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n /** GCS file URL; empty when no PDF uploaded */\n downloadUrl: z.string(),\n })\n .openapi('CourseResource')\n\nexport const V1CourseFurtherReadingSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n excerpt: z.string(),\n thumbnailUrl: z.string().nullable(),\n url: z.string(),\n })\n .openapi('CourseFurtherReading')\n\nexport const V1CourseStatusSchema = z.enum(['published', 'coming_soon'])\n\nexport const V1HeaderCourseBadgeSchema = z.enum(['new', 'wip'])\n\nexport const V1HeaderCourseItemSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n badge: V1HeaderCourseBadgeSchema.optional(),\n })\n .openapi('HeaderCourseItem')\n\nexport const V1CoursesListResponseSchema = z\n .object({\n courses: z.array(V1HeaderCourseItemSchema),\n })\n .openapi('CoursesListResponse')\n\nexport const V1CourseTagSchema = z.object({\n slug: z.string(),\n name: z.string(),\n})\n\nexport const V1ClassroomBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n previewVideoId: z.string().nullable(),\n lessons: z.array(V1CourseLessonSchema),\n instructors: z.array(V1CourseInstructorSchema),\n resources: z.array(V1CourseResourceSchema),\n furtherReading: z.array(V1CourseFurtherReadingSchema),\n })\n .openapi('ClassroomDetail')\n\nexport const V1CourseBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n launchAt: z.iso.datetime().nullable(),\n description: JsonValueSchema.nullable(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n trialVideos: z.array(CloudflareStreamVideoSchema).nullable(),\n lessonsMeta: z.array(V1CourseLessonMetaSchema),\n instructors: z.array(V1CourseInstructorSchema),\n heroImageVideo: CloudflareStreamVideoSchema.nullable(),\n heroImage: PhotoSchema.nullable(),\n })\n .openapi('CourseDetail')\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/courses',\n tags: ['Courses'],\n description: 'Header course list.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CoursesListResponseSchema },\n },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}/meta',\n tags: ['Courses'],\n description: 'OG metadata for a course page.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugMetaResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}',\n tags: ['Courses'],\n description:\n 'Full course detail for the classroom page. When status is coming_soon, lessons, resources, furtherReading, and previewVideoId are empty/null while title, description, tags, and instructors remain visible.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,2BAA2B,QAAQ,wBAA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,EAAE7E;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG2E;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"course.js","names":["z","internalServerErrorResponse","RestErrorBodySchema","CloudflareStreamVideoSchema","V1LessonProgressSchema","PhotoSchema","registry","CourseThumbnailSchema","JsonValueSchema","union","string","number","boolean","null","array","unknown","record","V1CourseSlugPathParamsSchema","object","slug","min","max","V1CourseBySlugMetaResponseSchema","ogTitle","ogDescription","ogImage","nullable","V1CourseLessonSchema","id","order","int","title","videoId","durationSeconds","isFree","progress","optional","openapi","V1CourseLessonMetaSchema","duration","V1CourseInstructorSchema","name","bio","avatarUrl","V1CourseResourceSchema","description","downloadUrl","V1CourseFurtherReadingSchema","excerpt","thumbnailUrl","url","V1CourseStatusSchema","enum","V1HeaderCourseBadgeSchema","V1HeaderCourseItemSchema","subtitle","badge","V1CoursesListResponseSchema","courses","V1CourseTagSchema","V1ClassroomBySlugResponseSchema","summary","status","tags","previewVideoId","lessons","instructors","resources","furtherReading","V1CourseBySlugResponseSchema","launchAt","iso","datetime","trialVideos","lessonsMeta","heroImageVideo","heroImage","registerPath","method","path","responses","content","schema","request","params"],"sources":["../../src/schemas/course.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { CloudflareStreamVideoSchema } from './cloudflare-stream.js'\nimport { V1LessonProgressSchema } from './lesson-progress.js'\nimport { PhotoSchema } from './photo.js'\nimport { registry } from './registry.js'\nimport { CourseThumbnailSchema } from './tag.js'\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | unknown[]\n | Record<string, unknown>\n\nexport const JsonValueSchema: z.ZodType<JsonValue> = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n])\n\nexport const V1CourseSlugPathParamsSchema = z.object({\n slug: z.string().min(1).max(200),\n})\n\nexport const V1CourseBySlugMetaResponseSchema = z.object({\n ogTitle: z.string(),\n ogDescription: z.string(),\n ogImage: CourseThumbnailSchema.nullable(),\n})\n\nexport const V1CourseLessonSchema = z\n .object({\n id: z.string(),\n order: z.number().int(),\n title: z.string(),\n /** Cloudflare stream id for this lesson; null when not yet set */\n videoId: z.string().nullable(),\n /** Video length in seconds (from CMS); null when not yet set */\n durationSeconds: z.number().int().nullable(),\n /** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */\n isFree: z.boolean(),\n /** Present when request includes a valid member JWT; null when no progress record */\n progress: V1LessonProgressSchema.nullable().optional(),\n })\n .openapi('CourseLesson')\n\nexport const V1CourseLessonMetaSchema = z\n .object({\n order: z.number().int().nullable(),\n title: z.string(),\n /** Video length in seconds (from CMS); null when not yet set */\n duration: z.number().int().nullable(),\n /** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */\n })\n .openapi('CourseLessonMeta')\n\nexport const V1CourseInstructorSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n title: z.string(),\n bio: z.string(),\n avatarUrl: z.string().nullable(),\n })\n .openapi('CourseInstructor')\n\nexport const V1CourseResourceSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n /** GCS file URL; empty when no PDF uploaded */\n downloadUrl: z.string(),\n })\n .openapi('CourseResource')\n\nexport const V1CourseFurtherReadingSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n excerpt: z.string(),\n thumbnailUrl: z.string().nullable(),\n url: z.string(),\n })\n .openapi('CourseFurtherReading')\n\nexport const V1CourseStatusSchema = z.enum(['published', 'coming_soon'])\n\nexport const V1HeaderCourseBadgeSchema = z.enum(['new', 'wip'])\n\nexport const V1HeaderCourseItemSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n badge: V1HeaderCourseBadgeSchema.optional(),\n })\n .openapi('HeaderCourseItem')\n\nexport const V1CoursesListResponseSchema = z\n .object({\n courses: z.array(V1HeaderCourseItemSchema),\n })\n .openapi('CoursesListResponse')\n\nexport const V1CourseTagSchema = z.object({\n slug: z.string(),\n name: z.string(),\n})\n\nexport const V1ClassroomBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n previewVideoId: z.string().nullable(),\n lessons: z.array(V1CourseLessonSchema),\n instructors: z.array(V1CourseInstructorSchema),\n resources: z.array(V1CourseResourceSchema),\n furtherReading: z.array(V1CourseFurtherReadingSchema),\n })\n .openapi('ClassroomDetail')\n\nexport const V1CourseBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n launchAt: z.iso.datetime().nullable(),\n description: JsonValueSchema.nullable(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n trialVideos: z.array(CloudflareStreamVideoSchema).nullable(),\n lessonsMeta: z.array(V1CourseLessonMetaSchema),\n instructors: z.array(V1CourseInstructorSchema),\n heroImageVideo: CloudflareStreamVideoSchema.nullable(),\n heroImage: PhotoSchema.nullable(),\n })\n .openapi('CourseDetail')\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses',\n tags: ['Courses'],\n description: 'Header course list.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CoursesListResponseSchema },\n },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}/meta',\n tags: ['Courses'],\n description: 'OG metadata for a course page.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugMetaResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}',\n tags: ['Courses'],\n description:\n 'Full course detail for the classroom page. When status is coming_soon, lessons, resources, furtherReading, and previewVideoId are empty/null while title, description, tags, and instructors remain visible.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\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,2BAA2B,QAAQ,wBAAwB;AACpE,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,qBAAqB,QAAQ,UAAU;AAUhD,OAAO,MAAMC,eAAqC,GAAGR,CAAC,CAACS,KAAK,CAAC,CAC3DT,CAAC,CAACU,MAAM,CAAC,CAAC,EACVV,CAAC,CAACW,MAAM,CAAC,CAAC,EACVX,CAAC,CAACY,OAAO,CAAC,CAAC,EACXZ,CAAC,CAACa,IAAI,CAAC,CAAC,EACRb,CAAC,CAACc,KAAK,CAACd,CAAC,CAACe,OAAO,CAAC,CAAC,CAAC,EACpBf,CAAC,CAACgB,MAAM,CAAChB,CAAC,CAACU,MAAM,CAAC,CAAC,EAAEV,CAAC,CAACe,OAAO,CAAC,CAAC,CAAC,CAClC,CA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M,EAAE,KAAK;EACbC,IAAI,EAAE,oBAAoB;EAC1BhB,IAAI,EAAE,CAAC,SAAS,CAAC;EACjBlB,WAAW,EACT,8MAA8M;EAChNsC,OAAO,EAAE;IAAEC,MAAM,EAAEnE;EAA6B,CAAC;EACjD+D,SAAS,EAAE;IACT,GAAG,EAAE;MACHnC,WAAW,EAAE,SAAS;MACtBoC,OAAO,EAAE;QACP,kBAAkB,EAAE;UAAEC,MAAM,EAAEb;QAA6B;MAC7D;IACF,CAAC;IACD,GAAG,EAAE;MACHxB,WAAW,EAAE,aAAa;MAC1BoC,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAEhF;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG,EAAE;MACH2C,WAAW,EAAE,kBAAkB;MAC/BoC,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAEhF;QAAoB;MAAE;IACjE,CAAC;IACD,GAAGD;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const V1HomePostCardSchema: z.ZodObject<{
|
|
3
|
+
title: z.ZodString;
|
|
4
|
+
description: z.ZodString;
|
|
5
|
+
link: z.ZodString;
|
|
6
|
+
imageUrl: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const V1HomeActivityCardSchema: z.ZodObject<{
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
description: z.ZodString;
|
|
11
|
+
link: z.ZodString;
|
|
12
|
+
imageUrl: z.ZodString;
|
|
13
|
+
badgeText: z.ZodString;
|
|
14
|
+
buttonText: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const V1HomeCourseCardSchema: z.ZodObject<{
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
slug: z.ZodString;
|
|
20
|
+
imageUrl: z.ZodString;
|
|
21
|
+
instructors: z.ZodArray<z.ZodObject<{
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
25
|
+
slug: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
ogTitle: z.ZodString;
|
|
28
|
+
ogDescription: z.ZodString;
|
|
29
|
+
homePageImageXL: z.ZodString;
|
|
30
|
+
homePageImageL: z.ZodString;
|
|
31
|
+
homePageImageM: z.ZodString;
|
|
32
|
+
homePageImageS: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
status: z.ZodEnum<{
|
|
35
|
+
published: "published";
|
|
36
|
+
coming_soon: "coming_soon";
|
|
37
|
+
}>;
|
|
38
|
+
launchAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodNull]>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export declare const V1HomePageResponseSchema: z.ZodObject<{
|
|
41
|
+
posts: z.ZodArray<z.ZodObject<{
|
|
42
|
+
title: z.ZodString;
|
|
43
|
+
description: z.ZodString;
|
|
44
|
+
link: z.ZodString;
|
|
45
|
+
imageUrl: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
activities: z.ZodArray<z.ZodObject<{
|
|
48
|
+
title: z.ZodString;
|
|
49
|
+
description: z.ZodString;
|
|
50
|
+
link: z.ZodString;
|
|
51
|
+
imageUrl: z.ZodString;
|
|
52
|
+
badgeText: z.ZodString;
|
|
53
|
+
buttonText: z.ZodString;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
courses: z.ZodArray<z.ZodObject<{
|
|
56
|
+
title: z.ZodString;
|
|
57
|
+
description: z.ZodString;
|
|
58
|
+
slug: z.ZodString;
|
|
59
|
+
imageUrl: z.ZodString;
|
|
60
|
+
instructors: z.ZodArray<z.ZodObject<{
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
64
|
+
slug: z.ZodString;
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
ogTitle: z.ZodString;
|
|
67
|
+
ogDescription: z.ZodString;
|
|
68
|
+
homePageImageXL: z.ZodString;
|
|
69
|
+
homePageImageL: z.ZodString;
|
|
70
|
+
homePageImageM: z.ZodString;
|
|
71
|
+
homePageImageS: z.ZodString;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
status: z.ZodEnum<{
|
|
74
|
+
published: "published";
|
|
75
|
+
coming_soon: "coming_soon";
|
|
76
|
+
}>;
|
|
77
|
+
launchAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodNull]>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
//# sourceMappingURL=home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/schemas/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,oBAAoB;;;;;iBAOX,CAAA;AAEtB,eAAO,MAAM,wBAAwB;;;;;;;iBASX,CAAA;AAE1B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;iBAsBX,CAAA;AAExB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMP,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { internalServerErrorResponse } from '../responses.js';
|
|
3
|
+
import { V1CourseStatusSchema } from './course.js';
|
|
4
|
+
// TODO: import registry from global registry file instead of from tag.js
|
|
5
|
+
import { registry } from './registry.js';
|
|
6
|
+
export const V1HomePostCardSchema = z.object({
|
|
7
|
+
title: z.string(),
|
|
8
|
+
description: z.string(),
|
|
9
|
+
link: z.string(),
|
|
10
|
+
imageUrl: z.string()
|
|
11
|
+
}).openapi('PostCard');
|
|
12
|
+
export const V1HomeActivityCardSchema = z.object({
|
|
13
|
+
title: z.string(),
|
|
14
|
+
description: z.string(),
|
|
15
|
+
link: z.string(),
|
|
16
|
+
imageUrl: z.string(),
|
|
17
|
+
badgeText: z.string(),
|
|
18
|
+
buttonText: z.string()
|
|
19
|
+
}).openapi('ActivityCard');
|
|
20
|
+
export const V1HomeCourseCardSchema = z.object({
|
|
21
|
+
title: z.string(),
|
|
22
|
+
description: z.string(),
|
|
23
|
+
slug: z.string(),
|
|
24
|
+
imageUrl: z.string(),
|
|
25
|
+
instructors: z.array(z.object({
|
|
26
|
+
name: z.string()
|
|
27
|
+
})),
|
|
28
|
+
tags: z.array(z.object({
|
|
29
|
+
slug: z.string(),
|
|
30
|
+
name: z.string(),
|
|
31
|
+
ogTitle: z.string(),
|
|
32
|
+
ogDescription: z.string(),
|
|
33
|
+
homePageImageXL: z.string(),
|
|
34
|
+
homePageImageL: z.string(),
|
|
35
|
+
homePageImageM: z.string(),
|
|
36
|
+
homePageImageS: z.string()
|
|
37
|
+
})),
|
|
38
|
+
status: V1CourseStatusSchema,
|
|
39
|
+
launchAt: z.union([z.iso.datetime(), z.null()])
|
|
40
|
+
}).openapi('CourseCard');
|
|
41
|
+
export const V1HomePageResponseSchema = z.object({
|
|
42
|
+
posts: z.array(V1HomePostCardSchema),
|
|
43
|
+
activities: z.array(V1HomeActivityCardSchema),
|
|
44
|
+
courses: z.array(V1HomeCourseCardSchema)
|
|
45
|
+
}).openapi('HomePageResponse');
|
|
46
|
+
|
|
47
|
+
// --- OpenAPI path registration ---
|
|
48
|
+
|
|
49
|
+
registry.registerPath({
|
|
50
|
+
method: 'get',
|
|
51
|
+
path: '/v1/home',
|
|
52
|
+
tags: ['Home'],
|
|
53
|
+
description: 'Get home page data.',
|
|
54
|
+
responses: {
|
|
55
|
+
200: {
|
|
56
|
+
description: 'Success',
|
|
57
|
+
content: {
|
|
58
|
+
'application/json': {
|
|
59
|
+
schema: V1HomePageResponseSchema
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
...internalServerErrorResponse
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.js","names":["z","internalServerErrorResponse","V1CourseStatusSchema","registry","V1HomePostCardSchema","object","title","string","description","link","imageUrl","openapi","V1HomeActivityCardSchema","badgeText","buttonText","V1HomeCourseCardSchema","slug","instructors","array","name","tags","ogTitle","ogDescription","homePageImageXL","homePageImageL","homePageImageM","homePageImageS","status","launchAt","union","iso","datetime","null","V1HomePageResponseSchema","posts","activities","courses","registerPath","method","path","responses","content","schema"],"sources":["../../src/schemas/home.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { V1CourseStatusSchema } from './course.js'\n// TODO: import registry from global registry file instead of from tag.js\nimport { registry } from './registry.js'\n\nexport const V1HomePostCardSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n link: z.string(),\n imageUrl: z.string(),\n })\n .openapi('PostCard')\n\nexport const V1HomeActivityCardSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n link: z.string(),\n imageUrl: z.string(),\n badgeText: z.string(),\n buttonText: z.string(),\n })\n .openapi('ActivityCard')\n\nexport const V1HomeCourseCardSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n slug: z.string(),\n imageUrl: z.string(),\n instructors: z.array(z.object({ name: z.string() })),\n tags: z.array(\n z.object({\n slug: z.string(),\n name: z.string(),\n ogTitle: z.string(),\n ogDescription: z.string(),\n homePageImageXL: z.string(),\n homePageImageL: z.string(),\n homePageImageM: z.string(),\n homePageImageS: z.string(),\n })\n ),\n status: V1CourseStatusSchema,\n launchAt: z.union([z.iso.datetime(), z.null()]),\n })\n .openapi('CourseCard')\n\nexport const V1HomePageResponseSchema = z\n .object({\n posts: z.array(V1HomePostCardSchema),\n activities: z.array(V1HomeActivityCardSchema),\n courses: z.array(V1HomeCourseCardSchema),\n })\n .openapi('HomePageResponse')\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/home',\n tags: ['Home'],\n description: 'Get home page data.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1HomePageResponseSchema },\n },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,oBAAoB,QAAQ,aAAa;AAClD;AACA,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,oBAAoB,GAAGJ,CAAC,CAClCK,MAAM,CAAC;EACNC,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC;EACjBC,WAAW,EAAER,CAAC,CAACO,MAAM,CAAC,CAAC;EACvBE,IAAI,EAAET,CAAC,CAACO,MAAM,CAAC,CAAC;EAChBG,QAAQ,EAAEV,CAAC,CAACO,MAAM,CAAC;AACrB,CAAC,CAAC,CACDI,OAAO,CAAC,UAAU,CAAC;AAEtB,OAAO,MAAMC,wBAAwB,GAAGZ,CAAC,CACtCK,MAAM,CAAC;EACNC,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC;EACjBC,WAAW,EAAER,CAAC,CAACO,MAAM,CAAC,CAAC;EACvBE,IAAI,EAAET,CAAC,CAACO,MAAM,CAAC,CAAC;EAChBG,QAAQ,EAAEV,CAAC,CAACO,MAAM,CAAC,CAAC;EACpBM,SAAS,EAAEb,CAAC,CAACO,MAAM,CAAC,CAAC;EACrBO,UAAU,EAAEd,CAAC,CAACO,MAAM,CAAC;AACvB,CAAC,CAAC,CACDI,OAAO,CAAC,cAAc,CAAC;AAE1B,OAAO,MAAMI,sBAAsB,GAAGf,CAAC,CACpCK,MAAM,CAAC;EACNC,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC;E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O,EAAEpC,CAAC,CAACkB,KAAK,CAACH,sBAAsB;AACzC,CAAC,CAAC,CACDJ,OAAO,CAAC,kBAAkB,CAAC;;AAE9B;;AAEAR,QAAQ,CAACkC,YAAY,CAAC;EACpBC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE,UAAU;EAChBnB,IAAI,EAAE,CAAC,MAAM,CAAC;EACdZ,WAAW,EAAE,qBAAqB;EAClCgC,SAAS,EAAE;IACT,GAAG,EAAE;MACHhC,WAAW,EAAE,SAAS;MACtBiC,OAAO,EAAE;QACP,kBAAkB,EAAE;UAAEC,MAAM,EAAET;QAAyB;MACzD;IACF,CAAC;IACD,GAAGhC;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lesson-progress.d.ts","sourceRoot":"","sources":["../../src/schemas/lesson-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"lesson-progress.d.ts","sourceRoot":"","sources":["../../src/schemas/lesson-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,eAAO,MAAM,sBAAsB;;;;iBAMP,CAAA;AAE5B,eAAO,MAAM,gCAAgC;;iBAE3C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;iBAIP,CAAA;AAEtC,eAAO,MAAM,oCAAoC;;;;iBAAyB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { internalServerErrorResponse, unauthorizedResponse } from '../responses.js';
|
|
2
3
|
import { RestErrorBodySchema } from '../rest.js';
|
|
3
4
|
import { registry } from './registry.js';
|
|
4
5
|
export const V1LessonProgressSchema = z.object({
|
|
@@ -16,26 +17,6 @@ export const V1UpsertLessonProgressResponseSchema = V1LessonProgressSchema;
|
|
|
16
17
|
|
|
17
18
|
// --- OpenAPI path registration ---
|
|
18
19
|
|
|
19
|
-
const unauthorizedResponse = {
|
|
20
|
-
401: {
|
|
21
|
-
description: 'Unauthorized — missing or invalid JWT',
|
|
22
|
-
content: {
|
|
23
|
-
'application/json': {
|
|
24
|
-
schema: RestErrorBodySchema
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const internalServerErrorResponse = {
|
|
30
|
-
500: {
|
|
31
|
-
description: 'Internal server error',
|
|
32
|
-
content: {
|
|
33
|
-
'application/json': {
|
|
34
|
-
schema: RestErrorBodySchema
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
20
|
registry.registerPath({
|
|
40
21
|
method: 'put',
|
|
41
22
|
path: '/v1/members/me/lesson-progress/{lessonId}',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lesson-progress.js","names":["z","RestErrorBodySchema","registry","V1LessonProgressSchema","object","watchedSeconds","number","int","min","completedAt","iso","datetime","nullable","lastWatchedAt","optional","openapi","V1LessonProgressPathParamsSchema","lessonId","string","max","V1UpsertLessonProgressBodySchema","V1UpsertLessonProgressResponseSchema","
|
|
1
|
+
{"version":3,"file":"lesson-progress.js","names":["z","internalServerErrorResponse","unauthorizedResponse","RestErrorBodySchema","registry","V1LessonProgressSchema","object","watchedSeconds","number","int","min","completedAt","iso","datetime","nullable","lastWatchedAt","optional","openapi","V1LessonProgressPathParamsSchema","lessonId","string","max","V1UpsertLessonProgressBodySchema","V1UpsertLessonProgressResponseSchema","registerPath","method","path","tags","description","request","params","body","content","schema","responses"],"sources":["../../src/schemas/lesson-progress.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport {\n internalServerErrorResponse,\n unauthorizedResponse,\n} from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { registry } from './registry.js'\n\nexport const V1LessonProgressSchema = z\n .object({\n watchedSeconds: z.number().int().min(0),\n completedAt: z.iso.datetime().nullable(),\n lastWatchedAt: z.iso.datetime().nullable().optional(),\n })\n .openapi('LessonProgress')\n\nexport const V1LessonProgressPathParamsSchema = z.object({\n lessonId: z.string().min(1).max(50),\n})\n\nexport const V1UpsertLessonProgressBodySchema = z\n .object({\n watchedSeconds: z.number().int().min(0),\n })\n .openapi('UpsertLessonProgressBody')\n\nexport const V1UpsertLessonProgressResponseSchema = V1LessonProgressSchema\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'put',\n path: '/v1/members/me/lesson-progress/{lessonId}',\n tags: ['Members'],\n description:\n 'Upsert lesson watch progress for the authenticated member. watchedSeconds is merged monotonically (never decreases).',\n request: {\n params: V1LessonProgressPathParamsSchema,\n body: {\n content: {\n 'application/json': { schema: V1UpsertLessonProgressBodySchema },\n },\n },\n },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1UpsertLessonProgressResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 403: {\n description: 'Forbidden — lesson not accessible to member',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Member or lesson not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...unauthorizedResponse,\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SACEC,2BAA2B,EAC3BC,oBAAoB,QACf,iBAAiB;AACxB,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,sBAAsB,GAAGL,CAAC,CACpCM,MAAM,CAAC;EACNC,cAAc,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC;EACvCC,WAAW,EAAEX,CAAC,CAACY,GAAG,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACxCC,aAAa,EAAEf,CAAC,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kBAAkB,EAAE;UAAEC,MAAM,EAAE9B;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG,EAAE;MACHyB,WAAW,EAAE,4BAA4B;MACzCI,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAE9B;QAAoB;MAAE;IACjE,CAAC;IACD,GAAGD,oBAAoB;IACvB,GAAGD;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member.d.ts","sourceRoot":"","sources":["../../src/schemas/member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"member.d.ts","sourceRoot":"","sources":["../../src/schemas/member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,eAAO,MAAM,qBAAqB;;iBAYP,CAAA;AAE3B,eAAO,MAAM,qBAAqB;;;;;;;;;iBAWP,CAAA;AAE3B,eAAO,MAAM,6BAA6B;;;;;;;;;iBAAwB,CAAA;AAElE,eAAO,MAAM,2BAA2B;;;;iBAMP,CAAA;AAEjC,eAAO,MAAM,6BAA6B;;iBAIP,CAAA;AAEnC,eAAO,MAAM,gCAAgC;;;;EAI3C,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;;;iBAKP,CAAA"}
|
package/dist/schemas/member.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { internalServerErrorResponse, unauthorizedResponse } from '../responses.js';
|
|
2
3
|
import { RestErrorBodySchema } from '../rest.js';
|
|
3
4
|
import { registry } from './registry.js';
|
|
4
5
|
export const V1MemberMeQuerySchema = z.object({
|
|
@@ -37,26 +38,6 @@ export const V1RevokeMemberCacheResponseSchema = z.object({
|
|
|
37
38
|
|
|
38
39
|
// --- OpenAPI path registration ---
|
|
39
40
|
|
|
40
|
-
const unauthorizedResponse = {
|
|
41
|
-
401: {
|
|
42
|
-
description: 'Unauthorized — missing or invalid JWT',
|
|
43
|
-
content: {
|
|
44
|
-
'application/json': {
|
|
45
|
-
schema: RestErrorBodySchema
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const internalServerErrorResponse = {
|
|
51
|
-
500: {
|
|
52
|
-
description: 'Internal server error',
|
|
53
|
-
content: {
|
|
54
|
-
'application/json': {
|
|
55
|
-
schema: RestErrorBodySchema
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
41
|
registry.registerPath({
|
|
61
42
|
method: 'post',
|
|
62
43
|
path: '/auth/access-token',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member.js","names":["z","RestErrorBodySchema","registry","V1MemberMeQuerySchema","object","refreshAccess","preprocess","v","undefined","Array","isArray","boolean","optional","openapi","V1MemberProfileSchema","id","string","email","name","twreporterUserId","hasAccess","role","nullable","expiredAt","iso","datetime","createdAt","V1MemberProfileResponseSchema","V1AccessTokenResponseSchema","accessToken","expiresAt","number","V1RevokeMemberCacheBodySchema","V1RevokeMemberCacheOutcomeSchema","enum","V1RevokeMemberCacheResponseSchema","ok","literal","outcome","
|
|
1
|
+
{"version":3,"file":"member.js","names":["z","internalServerErrorResponse","unauthorizedResponse","RestErrorBodySchema","registry","V1MemberMeQuerySchema","object","refreshAccess","preprocess","v","undefined","Array","isArray","boolean","optional","openapi","V1MemberProfileSchema","id","string","email","name","twreporterUserId","hasAccess","role","nullable","expiredAt","iso","datetime","createdAt","V1MemberProfileResponseSchema","V1AccessTokenResponseSchema","accessToken","expiresAt","number","V1RevokeMemberCacheBodySchema","V1RevokeMemberCacheOutcomeSchema","enum","V1RevokeMemberCacheResponseSchema","ok","literal","outcome","registerPath","method","path","tags","description","responses","content","schema","request","query","body"],"sources":["../../src/schemas/member.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport {\n internalServerErrorResponse,\n unauthorizedResponse,\n} from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { registry } from './registry.js'\n\nexport const V1MemberMeQuerySchema = z\n .object({\n refreshAccess: z\n .preprocess((v) => {\n if (v === undefined) return undefined\n if (Array.isArray(v)) return v[0]\n if (v === true || v === 'true' || v === '1') return true\n if (v === false || v === 'false' || v === '0') return false\n return v\n }, z.boolean())\n .optional(),\n })\n .openapi('MemberMeQuery')\n\nexport const V1MemberProfileSchema = z\n .object({\n id: z.string(),\n email: z.string(),\n name: z.string(),\n twreporterUserId: z.string(),\n hasAccess: z.boolean(),\n role: z.string().nullable(),\n expiredAt: z.iso.datetime().nullable(),\n createdAt: z.iso.datetime().nullable().optional(),\n })\n .openapi('MemberProfile')\n\nexport const V1MemberProfileResponseSchema = V1MemberProfileSchema\n\nexport const V1AccessTokenResponseSchema = z\n .object({\n accessToken: z.string(),\n twreporterUserId: z.string(),\n expiresAt: z.number(),\n })\n .openapi('AccessTokenResponse')\n\nexport const V1RevokeMemberCacheBodySchema = z\n .object({\n email: z.email(),\n })\n .openapi('RevokeMemberCacheBody')\n\nexport const V1RevokeMemberCacheOutcomeSchema = z.enum([\n 'revoked',\n 'not_found',\n 'manual_grant',\n])\n\nexport const V1RevokeMemberCacheResponseSchema = z\n .object({\n ok: z.literal(true),\n outcome: V1RevokeMemberCacheOutcomeSchema,\n })\n .openapi('RevokeMemberCacheResponse')\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'post',\n path: '/auth/access-token',\n tags: ['Auth'],\n description:\n 'Exchange id_token cookie for a JWT access token. Creates the member on first login.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1AccessTokenResponseSchema },\n },\n },\n 400: {\n description: 'Bad request — missing id_token cookie',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 403: {\n description: 'Forbidden — missing, invalid, or disallowed Origin',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...unauthorizedResponse,\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/members/me',\n tags: ['Members'],\n description:\n 'Get the authenticated member profile. Set refreshAccess=true to bypass the MemberAccess cache and re-fetch roles from go-api.',\n request: {\n query: V1MemberMeQuerySchema,\n },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1MemberProfileResponseSchema },\n },\n },\n 404: {\n description: 'Member not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...unauthorizedResponse,\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'post',\n path: '/v1/admin/members/revoke-cache',\n tags: ['Admin'],\n description:\n 'Invalidate MemberAccess cache for a member by email (clear checkedAt). Requires a Google OIDC ID token from an allowlisted caller. Terminal outcomes (revoked, not_found, manual_grant) always return 200 so Pub/Sub push can acknowledge delivery.',\n request: {\n body: {\n content: {\n 'application/json': { schema: V1RevokeMemberCacheBodySchema },\n },\n },\n },\n responses: {\n 200: {\n description:\n 'Request processed. outcome is revoked, not_found, or manual_grant.',\n content: {\n 'application/json': { schema: V1RevokeMemberCacheResponseSchema },\n },\n },\n 400: {\n description: 'Invalid request body',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 401: {\n description: 'Unauthorized — missing or invalid GCP IAM token',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 403: {\n description: 'Forbidden — valid token but caller not allowlisted',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SACEC,2BAA2B,EAC3BC,oBAAoB,QACf,iBAAiB;AACxB,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,qBAAqB,GAAGL,CAAC,CACnCM,MAAM,CAAC;EACNC,aAAa,EAAEP,CAAC,CACbQ,UAAU,CAAEC,CAAC,IAAK;IACjB,IAAIA,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M,EAAE7C;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG,EAAE;MACH0C,WAAW,EAAE,oDAAoD;MACjEE,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAE7C;QAAoB;MAAE;IACjE,CAAC;IACD,GAAGF;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/schemas/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/schemas/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AASvB,eAAO,MAAM,yBAAyB;;iBAEpC,CAAA;AAEF,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"}
|
package/dist/schemas/tag.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { internalServerErrorResponse } from '../responses.js';
|
|
2
3
|
import { RestErrorBodySchema } from '../rest.js';
|
|
3
4
|
import { PhotoResizedSchema } from './photo.js';
|
|
4
5
|
import { registry } from './registry.js';
|
|
@@ -41,16 +42,6 @@ export const V1TagBySlugCoursesResponseSchema = z.object({
|
|
|
41
42
|
|
|
42
43
|
// --- OpenAPI path registration ---
|
|
43
44
|
|
|
44
|
-
const internalServerErrorResponse = {
|
|
45
|
-
500: {
|
|
46
|
-
description: 'Internal server error',
|
|
47
|
-
content: {
|
|
48
|
-
'application/json': {
|
|
49
|
-
schema: RestErrorBodySchema
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
45
|
registry.registerPath({
|
|
55
46
|
method: 'get',
|
|
56
47
|
path: '/v1/tags/{slug}/meta',
|
package/dist/schemas/tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","names":["z","RestErrorBodySchema","PhotoResizedSchema","registry","V1TagSlugPathParamsSchema","object","slug","string","min","max","CourseThumbnailSchema","resized","openapi","V1TagBySlugMetaResponseSchema","ogTitle","ogDescription","ogImage","nullable","V1TagBySlugCoursesQuerySchema","take","coerce","number","int","optional","default","skip","CourseCardSchema","title","subtitle","summary","thumbnail","V1TagBySlugCoursesResponseSchema","name","coursesCount","courses","array","
|
|
1
|
+
{"version":3,"file":"tag.js","names":["z","internalServerErrorResponse","RestErrorBodySchema","PhotoResizedSchema","registry","V1TagSlugPathParamsSchema","object","slug","string","min","max","CourseThumbnailSchema","resized","openapi","V1TagBySlugMetaResponseSchema","ogTitle","ogDescription","ogImage","nullable","V1TagBySlugCoursesQuerySchema","take","coerce","number","int","optional","default","skip","CourseCardSchema","title","subtitle","summary","thumbnail","V1TagBySlugCoursesResponseSchema","name","coursesCount","courses","array","registerPath","method","path","tags","description","request","params","responses","content","schema","query"],"sources":["../../src/schemas/tag.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { PhotoResizedSchema } from './photo.js'\nimport { registry } from './registry.js'\n\n// --- Shared path params ---\n\nexport const V1TagSlugPathParamsSchema = z.object({\n slug: z.string().min(1).max(200),\n})\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(),\n ogDescription: z.string(),\n ogImage: CourseThumbnailSchema.nullable(),\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(),\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\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,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,SAASC,QAAQ,QAAQ,eAAe;;AAExC;;AAEA,OAAO,MAAMC,yBAA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