feat: 기능 추가 과정중
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import type { ApiFailure } from "../../../contracts/errors.js";
|
||||
import type { Result } from "../../../application/result.ts";
|
||||
import type {} from "../../../application/ports/in/application-api.ts";
|
||||
import {
|
||||
toReferenceView,
|
||||
type ReferenceResourceView,
|
||||
} from "../contracts/reference-mapper.js";
|
||||
import type { ReferenceResource } from "../domain/reference-resource.js";
|
||||
} from "../contracts/reference-mapper.ts";
|
||||
import type { ReferenceResource } from "../domain/reference-resource.ts";
|
||||
|
||||
export type ReferenceListFilters = Readonly<{
|
||||
cursor?: string;
|
||||
@@ -11,9 +12,12 @@ export type ReferenceListFilters = Readonly<{
|
||||
tags?: readonly string[];
|
||||
}>;
|
||||
|
||||
export type ReferenceResult<Value> =
|
||||
| Readonly<{ ok: true; value: Value }>
|
||||
| Readonly<{ ok: false; error: ApiFailure }>;
|
||||
export type ReferenceResult<Value> = Result<Value>;
|
||||
|
||||
export type ReferenceCreateCommand = Readonly<{
|
||||
name: string;
|
||||
note?: string;
|
||||
}>;
|
||||
|
||||
export type ReferenceFeatureInput = Readonly<{
|
||||
listResources(
|
||||
@@ -21,7 +25,7 @@ export type ReferenceFeatureInput = Readonly<{
|
||||
context?: Readonly<{ signal?: AbortSignal }>,
|
||||
): Promise<ReferenceResult<readonly ReferenceResourceView[]>>;
|
||||
createResource(
|
||||
command: Readonly<{ name: string; note?: string }>,
|
||||
command: ReferenceCreateCommand,
|
||||
): Promise<ReferenceResult<ReferenceResourceView>>;
|
||||
getResource(
|
||||
resourceId: string,
|
||||
@@ -29,13 +33,19 @@ export type ReferenceFeatureInput = Readonly<{
|
||||
): Promise<ReferenceResult<ReferenceResourceView>>;
|
||||
}>;
|
||||
|
||||
declare module "../../../application/ports/in/application-api.ts" {
|
||||
interface ApplicationFeatureInputs {
|
||||
"reference-feature": ReferenceFeatureInput;
|
||||
}
|
||||
}
|
||||
|
||||
export type ReferenceGateway = Readonly<{
|
||||
list(
|
||||
filters: ReferenceListFilters,
|
||||
context?: Readonly<{ signal?: AbortSignal }>,
|
||||
): Promise<ReferenceResult<readonly ReferenceResource[]>>;
|
||||
create(
|
||||
command: Readonly<{ name: string; note?: string }>,
|
||||
command: ReferenceCreateCommand,
|
||||
): Promise<ReferenceResult<ReferenceResource>>;
|
||||
get(
|
||||
resourceId: string,
|
||||
|
||||
Reference in New Issue
Block a user