mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2025-02-05 16:34:43 +00:00
Auto-generating swagger / OpenAPI docs.
This commit is contained in:
parent
4243e6df77
commit
6f9eee4e90
7 changed files with 1959 additions and 418 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ dist
|
||||||
package
|
package
|
||||||
node_modules
|
node_modules
|
||||||
docs
|
docs
|
||||||
|
tsoa_build
|
||||||
|
|
|
@ -21,6 +21,7 @@ export default [
|
||||||
"@typescript-eslint/ban-ts-comment": 0,
|
"@typescript-eslint/ban-ts-comment": 0,
|
||||||
"@typescript-eslint/no-explicit-any": 0,
|
"@typescript-eslint/no-explicit-any": 0,
|
||||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||||
|
"@typescript-eslint/no-empty-object-type": 0,
|
||||||
"arrow-body-style": 0,
|
"arrow-body-style": 0,
|
||||||
curly: 0,
|
curly: 0,
|
||||||
"eol-last": 0,
|
"eol-last": 0,
|
||||||
|
|
|
@ -12,13 +12,15 @@
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"docs": "typedoc src/index.ts",
|
"docs": "typedoc src/index.ts",
|
||||||
"lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check src",
|
"lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check src",
|
||||||
"prepare": "pnpm run build && husky"
|
"prepare": "pnpm run build && husky",
|
||||||
|
"tsoa": "tsoa spec-and-routes && tsc"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
|
"url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/joi": "^17.2.3",
|
||||||
"@types/node": "^22.7.4",
|
"@types/node": "^22.7.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
||||||
"@typescript-eslint/parser": "^8.7.0",
|
"@typescript-eslint/parser": "^8.7.0",
|
||||||
|
@ -31,6 +33,7 @@
|
||||||
"prettier-plugin-organize-imports": "^4.0.0",
|
"prettier-plugin-organize-imports": "^4.0.0",
|
||||||
"prettier-plugin-packagejson": "^2.5.1",
|
"prettier-plugin-packagejson": "^2.5.1",
|
||||||
"sortpack": "^2.4.0",
|
"sortpack": "^2.4.0",
|
||||||
|
"tsoa": "^6.6.0",
|
||||||
"typedoc": "^0.27.0",
|
"typedoc": "^0.27.0",
|
||||||
"typescript": "^5.5.4",
|
"typescript": "^5.5.4",
|
||||||
"typescript-eslint": "^8.7.0"
|
"typescript-eslint": "^8.7.0"
|
||||||
|
|
1349
pnpm-lock.yaml
1349
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
949
src/http.ts
949
src/http.ts
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,65 @@
|
||||||
|
import { GetComment } from "./types/GetComment";
|
||||||
|
import { GetComments } from "./types/GetComments";
|
||||||
|
import { GetCommunity } from "./types/GetCommunity";
|
||||||
|
import { GetCommunityPendingFollowsCount } from "./types/GetCommunityPendingFollowsCount";
|
||||||
|
import { GetModlog } from "./types/GetModlog";
|
||||||
|
import { GetPersonDetails } from "./types/GetPersonDetails";
|
||||||
|
import { GetPost } from "./types/GetPost";
|
||||||
|
import { GetPosts } from "./types/GetPosts";
|
||||||
|
import { GetRandomCommunity } from "./types/GetRandomCommunity";
|
||||||
|
import { GetRegistrationApplication } from "./types/GetRegistrationApplication";
|
||||||
|
import { GetReportCount } from "./types/GetReportCount";
|
||||||
|
import { GetSiteMetadata } from "./types/GetSiteMetadata";
|
||||||
|
import { ListCommentLikes } from "./types/ListCommentLikes";
|
||||||
|
import { ListCommunities } from "./types/ListCommunities";
|
||||||
|
import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
|
||||||
|
import { ListCustomEmojis } from "./types/ListCustomEmojis";
|
||||||
|
import { ListInbox } from "./types/ListInbox";
|
||||||
|
import { ListMedia } from "./types/ListMedia";
|
||||||
|
import { ListPersonContent } from "./types/ListPersonContent";
|
||||||
|
import { ListPersonSaved } from "./types/ListPersonSaved";
|
||||||
|
import { ListPostLikes } from "./types/ListPostLikes";
|
||||||
|
import { ListRegistrationApplications } from "./types/ListRegistrationApplications";
|
||||||
|
import { ListReports } from "./types/ListReports";
|
||||||
|
import { ListTaglines } from "./types/ListTaglines";
|
||||||
|
import { ResolveObject } from "./types/ResolveObject";
|
||||||
|
import { Search } from "./types/Search";
|
||||||
|
|
||||||
export const VERSION = "v4";
|
export const VERSION = "v4";
|
||||||
|
|
||||||
export interface UploadImage {
|
export interface UploadImage {
|
||||||
image: File | Buffer;
|
image: File | Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tsoa doesn't currently support types in GET queries, so these need to be extended.
|
||||||
|
// https://github.com/lukeautry/tsoa/issues/1743
|
||||||
|
export interface ListMediaI extends ListMedia {}
|
||||||
|
export interface GetModlogI extends GetModlog {}
|
||||||
|
export interface SearchI extends Search {}
|
||||||
|
export interface ResolveObjectI extends ResolveObject {}
|
||||||
|
export interface GetCommunityI extends GetCommunity {}
|
||||||
|
export interface ListCommunitiesI extends ListCommunities {}
|
||||||
|
export interface GetCommunityPendingFollowsCountI
|
||||||
|
extends GetCommunityPendingFollowsCount {}
|
||||||
|
export interface ListCommunityPendingFollowsI
|
||||||
|
extends ListCommunityPendingFollows {}
|
||||||
|
export interface GetRandomCommunityI extends GetRandomCommunity {}
|
||||||
|
export interface GetPostI extends GetPost {}
|
||||||
|
export interface GetPostsI extends GetPosts {}
|
||||||
|
export interface ListPostLikesI extends ListPostLikes {}
|
||||||
|
export interface GetSiteMetadataI extends GetSiteMetadata {}
|
||||||
|
export interface ListCommentLikesI extends ListCommentLikes {}
|
||||||
|
export interface GetCommentsI extends GetComments {}
|
||||||
|
export interface GetCommentI extends GetComment {}
|
||||||
|
export interface GetPersonDetailsI extends GetPersonDetails {}
|
||||||
|
export interface ListPersonContentI extends ListPersonContent {}
|
||||||
|
export interface GetReportCountI extends GetReportCount {}
|
||||||
|
export interface ListInboxI extends ListInbox {}
|
||||||
|
export interface ListPersonSavedI extends ListPersonSaved {}
|
||||||
|
export interface ListRegistrationApplicationsI
|
||||||
|
extends ListRegistrationApplications {}
|
||||||
|
export interface GetRegistrationApplicationI
|
||||||
|
extends GetRegistrationApplication {}
|
||||||
|
export interface ListCustomEmojisI extends ListCustomEmojis {}
|
||||||
|
export interface ListTaglinesI extends ListTaglines {}
|
||||||
|
export interface ListReportsI extends ListReports {}
|
||||||
|
|
12
tsoa.json
Normal file
12
tsoa.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"entryFile": "src/http.ts",
|
||||||
|
"noImplicitAdditionalProperties": "throw-on-extras",
|
||||||
|
"controllerPathGlobs": ["src/http.ts"],
|
||||||
|
"spec": {
|
||||||
|
"outputDirectory": "tsoa_build",
|
||||||
|
"specVersion": 3
|
||||||
|
},
|
||||||
|
"routes": {
|
||||||
|
"routesDir": "tsoa_build"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue