-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If you want to exclude a controller method from SDK library, write `@ignore` comment on the target controller method, then SDK generator will ignore it.
- Loading branch information
Showing
33 changed files
with
1,520 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { INestiaConfig } from "@nestia/sdk"; | ||
|
||
export const NESTIA_CONFIG: INestiaConfig = { | ||
input: ["src/controllers"], | ||
output: "src/api", | ||
swagger: { | ||
output: "swagger.json", | ||
security: { | ||
bearer: { | ||
type: "apiKey", | ||
}, | ||
}, | ||
}, | ||
}; | ||
export default NESTIA_CONFIG; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import core from "@nestia/core"; | ||
import { INestApplication } from "@nestjs/common"; | ||
import { NestFactory } from "@nestjs/core"; | ||
import { Singleton } from "tstl"; | ||
|
||
export class Backend { | ||
public readonly application: Singleton<Promise<INestApplication>> = | ||
new Singleton(async () => | ||
NestFactory.create( | ||
await core.EncryptedModule.dynamic(__dirname + "/controllers", { | ||
key: "A".repeat(32), | ||
iv: "B".repeat(16), | ||
}), | ||
{ logger: false }, | ||
), | ||
); | ||
|
||
public async open(): Promise<void> { | ||
return (await this.application.get()).listen(37_000); | ||
} | ||
|
||
public async close(): Promise<void> { | ||
return (await this.application.get()).close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { HttpError } from "@nestia/fetcher"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { IConnection } from "@nestia/fetcher"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { Primitive } from "@nestia/fetcher"; |
114 changes: 114 additions & 0 deletions
114
test/features/ignore/src/api/functional/bbs/articles/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional.bbs.articles | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
import type { IConnection, Primitive } from "@nestia/fetcher"; | ||
import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; | ||
import type { Format } from "typia/lib/tags/Format"; | ||
|
||
import type { IBbsArticle } from "../../../structures/IBbsArticle"; | ||
|
||
/** | ||
* Store an article. | ||
* | ||
* @param input Content to store | ||
* @returns Newly archived article | ||
* @deprecated | ||
* | ||
* @controller BbsArticlesController.store | ||
* @path POST /bbs/articles | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
export async function store( | ||
connection: IConnection, | ||
input: store.Input, | ||
): Promise<store.Output> { | ||
return PlainFetcher.fetch( | ||
{ | ||
...connection, | ||
headers: { | ||
...(connection.headers ?? {}), | ||
"Content-Type": "application/json", | ||
}, | ||
}, | ||
{ | ||
...store.METADATA, | ||
path: store.path(), | ||
} as const, | ||
input, | ||
); | ||
} | ||
export namespace store { | ||
export type Input = Primitive<IBbsArticle.IStore>; | ||
export type Output = Primitive<IBbsArticle>; | ||
|
||
export const METADATA = { | ||
method: "POST", | ||
path: "/bbs/articles", | ||
request: { | ||
type: "application/json", | ||
encrypted: false | ||
}, | ||
response: { | ||
type: "application/json", | ||
encrypted: false, | ||
}, | ||
status: null, | ||
} as const; | ||
|
||
export const path = (): string => { | ||
return `/bbs/articles`; | ||
} | ||
} | ||
|
||
/** | ||
* | ||
* @internal | ||
* | ||
* @controller BbsArticlesController.update | ||
* @path PUT /bbs/articles/:id | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
export async function update( | ||
connection: IConnection, | ||
id: string & Format<"uuid">, | ||
input: update.Input, | ||
): Promise<void> { | ||
return PlainFetcher.fetch( | ||
{ | ||
...connection, | ||
headers: { | ||
...(connection.headers ?? {}), | ||
"Content-Type": "application/json", | ||
}, | ||
}, | ||
{ | ||
...update.METADATA, | ||
path: update.path(id), | ||
} as const, | ||
input, | ||
); | ||
} | ||
export namespace update { | ||
export type Input = Primitive<Partial<IBbsArticle.IStore>>; | ||
|
||
export const METADATA = { | ||
method: "PUT", | ||
path: "/bbs/articles/:id", | ||
request: { | ||
type: "application/json", | ||
encrypted: false | ||
}, | ||
response: { | ||
type: "application/json", | ||
encrypted: false, | ||
}, | ||
status: null, | ||
} as const; | ||
|
||
export const path = (id: string & Format<"uuid">): string => { | ||
return `/bbs/articles/${encodeURIComponent(id ?? "null")}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional.bbs | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
export * as articles from "./articles"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional.health | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
import type { IConnection } from "@nestia/fetcher"; | ||
import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; | ||
|
||
/** | ||
* @controller HealthController.get | ||
* @path GET /health | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
export async function get( | ||
connection: IConnection, | ||
): Promise<void> { | ||
return PlainFetcher.fetch( | ||
connection, | ||
{ | ||
...get.METADATA, | ||
path: get.path(), | ||
} as const, | ||
); | ||
} | ||
export namespace get { | ||
|
||
export const METADATA = { | ||
method: "GET", | ||
path: "/health", | ||
request: null, | ||
response: { | ||
type: "application/json", | ||
encrypted: false, | ||
}, | ||
status: null, | ||
} as const; | ||
|
||
export const path = (): string => { | ||
return `/health`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
export * as bbs from "./bbs"; | ||
export * as health from "./health"; | ||
export * as performance from "./performance"; |
45 changes: 45 additions & 0 deletions
45
test/features/ignore/src/api/functional/performance/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional.performance | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
import type { IConnection, Primitive } from "@nestia/fetcher"; | ||
import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; | ||
|
||
import type { IPerformance } from "../../structures/IPerformance"; | ||
|
||
/** | ||
* @controller PerformanceController.get | ||
* @path GET /performance | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
export async function get( | ||
connection: IConnection, | ||
): Promise<get.Output> { | ||
return PlainFetcher.fetch( | ||
connection, | ||
{ | ||
...get.METADATA, | ||
path: get.path(), | ||
} as const, | ||
); | ||
} | ||
export namespace get { | ||
export type Output = Primitive<IPerformance>; | ||
|
||
export const METADATA = { | ||
method: "GET", | ||
path: "/performance", | ||
request: null, | ||
response: { | ||
type: "application/json", | ||
encrypted: false, | ||
}, | ||
status: null, | ||
} as const; | ||
|
||
export const path = (): string => { | ||
return `/performance`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as api from "./module"; | ||
|
||
export * from "./module"; | ||
export default api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type * from "./IConnection"; | ||
export type * from "./Primitive"; | ||
export * from "./HttpError"; | ||
|
||
export * as functional from "./functional"; |
Oops, something went wrong.