-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hold #1016 for a while, because it needs a lot of change in
typia
.
- Loading branch information
Showing
14 changed files
with
156 additions
and
1 deletion.
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
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"; |
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 { Resolved } from "@nestia/fetcher"; |
47 changes: 47 additions & 0 deletions
47
test/features/clone-type-create-duplicate/sdk/functional/auth/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,47 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional.auth | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
import type { IConnection } from "@nestia/fetcher"; | ||
import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; | ||
|
||
import type { IAuth } from "../../structures/IAuth"; | ||
|
||
/** | ||
* 계정 프로필 정보 불러오기 | ||
* | ||
* @summary get account profile | ||
* @tag auth | ||
* @throws 401 | ||
* | ||
* @controller AuthController.account | ||
* @path GET /auth/account | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
export async function account( | ||
connection: IConnection, | ||
): Promise<account.Output> { | ||
return PlainFetcher.fetch(connection, { | ||
...account.METADATA, | ||
template: account.METADATA.path, | ||
path: account.path(), | ||
}); | ||
} | ||
export namespace account { | ||
export type Output = IAuth.IAccount; | ||
|
||
export const METADATA = { | ||
method: "GET", | ||
path: "/auth/account", | ||
request: null, | ||
response: { | ||
type: "application/json", | ||
encrypted: false, | ||
}, | ||
status: 200, | ||
} as const; | ||
|
||
export const path = () => "/auth/account"; | ||
} |
8 changes: 8 additions & 0 deletions
8
test/features/clone-type-create-duplicate/sdk/functional/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,8 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
export * as auth from "./auth"; | ||
export * as user from "./user"; |
49 changes: 49 additions & 0 deletions
49
test/features/clone-type-create-duplicate/sdk/functional/user/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,49 @@ | ||
/** | ||
* @packageDocumentation | ||
* @module api.functional.user | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
//================================================================ | ||
import type { IConnection } from "@nestia/fetcher"; | ||
import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; | ||
|
||
import type { IUser } from "../../structures/IUser"; | ||
|
||
/** | ||
* get authorized user's profile | ||
* | ||
* @summary get user's profile | ||
* @tag user | ||
* @security bearer | ||
* @return user profile | ||
* @throws 401 | ||
* | ||
* @controller UserController.profile | ||
* @path GET /user/profile | ||
* @nestia Generated by Nestia - https://github.com/samchon/nestia | ||
*/ | ||
export async function profile( | ||
connection: IConnection, | ||
): Promise<profile.Output> { | ||
return PlainFetcher.fetch(connection, { | ||
...profile.METADATA, | ||
template: profile.METADATA.path, | ||
path: profile.path(), | ||
}); | ||
} | ||
export namespace profile { | ||
export type Output = IUser.IProfile.o1; | ||
|
||
export const METADATA = { | ||
method: "GET", | ||
path: "/user/profile", | ||
request: null, | ||
response: { | ||
type: "application/json", | ||
encrypted: false, | ||
}, | ||
status: 200, | ||
} as const; | ||
|
||
export const path = () => "/user/profile"; | ||
} |
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,6 @@ | ||
export type * from "./IConnection"; | ||
export type * from "./Primitive"; | ||
export type * from "./Resolved"; | ||
export * from "./HttpError"; | ||
|
||
export * as functional from "./functional"; |
12 changes: 12 additions & 0 deletions
12
test/features/clone-type-create-duplicate/sdk/structures/Exception.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,12 @@ | ||
export namespace Exception { | ||
export type Unauthorized = { | ||
code: "UNAUTHORIZED"; | ||
message: string; | ||
}; | ||
export namespace Unauthorized { | ||
export type o1 = { | ||
code: "UNAUTHORIZED"; | ||
message: string; | ||
}; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
test/features/clone-type-create-duplicate/sdk/structures/IAuth.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,8 @@ | ||
import type { IUser } from "./IUser"; | ||
|
||
export namespace IAuth { | ||
export type IAccount = { | ||
user: IUser.IProfile; | ||
account_id: string; | ||
}; | ||
} |
16 changes: 16 additions & 0 deletions
16
test/features/clone-type-create-duplicate/sdk/structures/IUser.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,16 @@ | ||
import type { Format } from "typia/lib/tags/Format"; | ||
|
||
export namespace IUser { | ||
export type IProfile = { | ||
id: string & Format<"uuid">; | ||
name: string; | ||
created_at: string & Format<"date-time">; | ||
}; | ||
export namespace IProfile { | ||
export type o1 = { | ||
id: string & Format<"uuid">; | ||
name: string; | ||
created_at: string & Format<"date-time">; | ||
}; | ||
} | ||
} |
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 @@ | ||
{"openapi":"3.0.0","servers":[{"url":"http://localhost:4000","description":"Local Server"}],"info":{"title":"nestia test template","description":"클론모드에서 발생하는 타입 중복 생성 문제 테스트","version":"3.13.0-dev.2024910","license":{"name":"MIT"}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"IAuth.IAccount":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/IUser.IProfile"},"account_id":{"type":"string"}},"required":["user","account_id"]},"IUser.IProfile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at"]},"Exception.Unauthorized":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]},"IUser.IProfile.o1":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at"]},"Exception.Unauthorized.o1":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/auth/account":{"get":{"summary":"get account profile","description":"계정 프로필 정보 불러오기","tags":["auth"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAuth.IAccount"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exception.Unauthorized"}}}}}}},"/user/profile":{"get":{"summary":"get user's profile","description":"get authorized user's profile","tags":["user"],"parameters":[],"responses":{"200":{"description":"user profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IUser.IProfile.o1"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exception.Unauthorized.o1"}}}}},"security":[{"bearer":[]}]}}},"tags":[{"name":"auth"},{"name":"user"}]} |