Skip to content

Commit bf32855

Browse files
docs: translate comments to English in rest/project.ts and improve API endpoint documentation
1 parent 4fd92ba commit bf32855

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

rest/project.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,27 @@ import type { FetchError } from "./robustFetch.ts";
2121
import { type BaseOptions, setDefaults } from "./options.ts";
2222

2323
export interface GetProject {
24-
/** /api/project/:project の要求を組み立てる
24+
/** Constructs a request for the /api/project/:project endpoint
2525
*
26-
* @param project project name to get
27-
* @param init connect.sid etc.
28-
* @return request
26+
* This endpoint retrieves detailed information about a specific project,
27+
* which can be either a MemberProject or NotMemberProject depending on the user's access level.
28+
*
29+
* @param project The project name to retrieve information for
30+
* @param init Options including connect.sid (session ID) and other configuration
31+
* @return The constructed request object
2932
*/
3033
toRequest: (
3134
project: string,
3235
options?: BaseOptions,
3336
) => Request;
3437

35-
/** 帰ってきた応答からprojectのJSONデータを取得する
38+
/** Extracts project JSON data from the API response
39+
*
40+
* Processes the API response and extracts the project information.
41+
* Handles various error cases including NotFoundError, NotMemberError, and NotLoggedInError.
3642
*
37-
* @param res 応答
38-
* @return projectのJSONデータ
43+
* @param res The API response object
44+
* @return A Result containing either project data or an error
3945
*/
4046
fromResponse: (
4147
res: Response,
@@ -104,21 +110,27 @@ export const getProject: GetProject = /* @__PURE__ */ (() => {
104110
})();
105111

106112
export interface ListProjects {
107-
/** /api/project の要求を組み立てる
113+
/** Constructs a request for the /api/projects endpoint
108114
*
109-
* @param projectIds project ids. This must have more than 1 id
110-
* @param init connect.sid etc.
111-
* @return request
115+
* This endpoint retrieves information for multiple projects in a single request.
116+
* The endpoint requires at least one project ID to be provided.
117+
*
118+
* @param projectIds Array of project IDs to retrieve information for (must contain at least one ID)
119+
* @param init Options including connect.sid (session ID) and other configuration
120+
* @return The constructed request object
112121
*/
113122
toRequest: (
114123
projectIds: ProjectId[],
115124
init?: BaseOptions,
116125
) => Request;
117126

118-
/** 帰ってきた応答からprojectのJSONデータを取得する
127+
/** Extracts projects JSON data from the API response
128+
*
129+
* Processes the API response and extracts information for multiple projects.
130+
* Handles authentication errors (NotLoggedInError) and other HTTP errors.
119131
*
120-
* @param res 応答
121-
* @return projectのJSONデータ
132+
* @param res The API response object
133+
* @return A Result containing either project data or an error
122134
*/
123135
fromResponse: (
124136
res: Response,

0 commit comments

Comments
 (0)