Skip to content

Commit

Permalink
Merge pull request #20 from HyunsDev:develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
HyunsDev authored Mar 4, 2024
2 parents 28b38d2 + 22657f4 commit 3d7fcb1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
DeleteSection,
DeleteUserDevice,
EditBlockComment,
ExportSectionPDF,
FetchSection,
GetAdminBook,
GetBook,
Expand Down Expand Up @@ -109,6 +110,8 @@ export class ProjectBookClient extends EndpointClient {
readonly UpdateSection = this.endpointBuilder(UpdateSection);
readonly DeleteSection = this.endpointBuilder(DeleteSection);

readonly ExportSectionPDF = this.endpointBuilder(ExportSectionPDF);

readonly ListBlockComment = this.endpointBuilder(ListBlockComment);
readonly CreateBlockComment = this.endpointBuilder(CreateBlockComment);
readonly EditBlockComment = this.endpointBuilder(EditBlockComment);
Expand Down
2 changes: 2 additions & 0 deletions src/endpoint/book/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const UpdateBook: Endpoint<UpdateBookReq, UpdateBookRes> = {
"coverImage",
"notionDatabaseId",
"status",
"isExportPDFEnabled",
],
};
export type UpdateBookReqPath = {
Expand All @@ -149,6 +150,7 @@ export type UpdateBookReqBody = {
coverImage?: string;
notionDatabaseId?: string;
status?: "draft" | "pending" | "published" | "deleted";
isExportPDFEnabled?: boolean;
};
export type UpdateBookReq = UpdateBookReqPath & UpdateBookReqBody;
export type UpdateBookRes = {
Expand Down
22 changes: 22 additions & 0 deletions src/endpoint/book/section/export/endpoint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Endpoint } from "endpoint-client";

/**
* POST /books/:bookId/sections/:sectionId/export/pdf
* 색션 PDF를 생성합니다.
*/
export const ExportSectionPDF: Endpoint<
ExportSectionPDFReq,
ExportSectionPDFRes
> = {
method: "POST",
path: (e) => `/books/${e.bookId}/sections/${e.sectionId}/pdf`,
pathParams: ["bookId", "sectionId"],
};
export type ExportSectionPDFReqPath = {
bookId: number | string;
sectionId: number | string;
};
export type ExportSectionPDFReq = ExportSectionPDFReqPath;
export type ExportSectionPDFRes = {
url: string;
};
1 change: 1 addition & 0 deletions src/endpoint/book/section/export/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./endpoint";
1 change: 1 addition & 0 deletions src/endpoint/book/section/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./block-comment";
export * from "./endpoint";
export * from "./block-memo";
export * from "./export";
3 changes: 3 additions & 0 deletions src/object/adminBook.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class AdminBookObject {
role: string;
user: UserObject;
}[];
isExportPDFEnabled: boolean;
createdAt: string;
updatedAt: string;

Expand All @@ -26,6 +27,7 @@ export class AdminBookObject {
coverImage: string;
notionDatabaseId: string;
status: "draft" | "pending" | "published" | "deleted";
isExportPDFEnabled: boolean;
authorUsers: {
id: number;
role: string;
Expand All @@ -41,6 +43,7 @@ export class AdminBookObject {
this.price = data.price;
this.coverImage = data.coverImage;
this.notionDatabaseId = data.notionDatabaseId;
this.isExportPDFEnabled = data.isExportPDFEnabled;
this.status = data.status;
this.authorUsers = data.authorUsers;
this.createdAt = data.createdAt;
Expand Down

0 comments on commit 3d7fcb1

Please sign in to comment.