Skip to content

Commit

Permalink
api: list-did-contents;feature #323
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Sep 18, 2023
1 parent c30af0c commit 613afd8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/lib/infrastructure/ioc/features/list-did-contents-feature.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import DIDGatewayOutputPort from "@/lib/core/port/secondary/did-gateway-output-port"
import {
ListDIDContentsError,
ListDIDContentsRequest,
ListDIDContentsResponse,
} from "@/lib/core/usecase-models/list-did-contents-usecase-models"
import { ListDIDContentsControllerParameters } from "@/lib/infrastructure/controller/list-did-contents-controller"
import ListDIDContentsController from "@/lib/infrastructure/controller/list-did-contents-controller"
import { DIDViewModel } from "@/lib/infrastructure/data/view-model/did"
import {
BaseStreamableFeature,
IOCSymbols,
} from "@/lib/sdk/ioc-helpers"
import GATEWAYS from "@/lib/infrastructure/ioc/ioc-symbols-gateway"
import CONTROLLERS from "@/lib/infrastructure/ioc/ioc-symbols-controllers"
import INPUT_PORT from "@/lib/infrastructure/ioc/ioc-symbols-input-port"
import USECASE_FACTORY from "@/lib/infrastructure/ioc/ioc-symbols-usecase-factory"
import { Container } from 'inversify'

import ListDIDContentsUseCase from "@/lib/core/use-case/list-did-contents-usecase"

import ListDIDContentsPresenter from "@/lib/infrastructure/presenter/list-did-contents-presenter"



export default class ListDIDContentsFeature extends BaseStreamableFeature<
ListDIDContentsControllerParameters,
ListDIDContentsRequest,
ListDIDContentsResponse,
ListDIDContentsError,
DIDViewModel
> {
constructor(appContainer: Container) {
const didGateway = appContainer.get<DIDGatewayOutputPort>(GATEWAYS.DID)

const symbols: IOCSymbols = {
CONTROLLER: CONTROLLERS.LIST_DID_CONTENTS,
USECASE_FACTORY: USECASE_FACTORY.LIST_DID_CONTENTS,
INPUT_PORT: INPUT_PORT.LIST_DID_CONTENTS,
}
const useCaseConstructorArgs = [
didGateway,

]
super(
'ListDIDContents',
ListDIDContentsController,
ListDIDContentsUseCase,
useCaseConstructorArgs,
ListDIDContentsPresenter,
false,
symbols
)
}
}
1 change: 1 addition & 0 deletions src/lib/infrastructure/ioc/ioc-symbols-controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const CONTROLLERS = {
GET_SUBSCRIPTION: Symbol.for("GetSubscriptionController"),
LOGIN_CONFIG: Symbol.for("LoginConfigController"),
LIST_DIDS: Symbol.for("ListDIDsController"),
LIST_DID_CONTENTS: Symbol.for("ListDIDContentsController"),
LIST_DID_PARENTS: Symbol.for("ListDIDParentsController"),
LIST_DID_RULES: Symbol.for("ListDIDRulesController"),
LIST_DATASET_REPLICAS: Symbol.for("ListDatasetReplicasController"),
Expand Down
1 change: 1 addition & 0 deletions src/lib/infrastructure/ioc/ioc-symbols-input-port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const INPUT_PORT = {
GET_SUBSCRIPTION: Symbol.for("GetSubscriptionInputPort"),
LOGIN_CONFIG: Symbol.for("LoginConfigInputPort"),
LIST_DIDS: Symbol.for("ListDIDsInputPort"),
LIST_DID_CONTENTS: Symbol.for("ListDIDContentsInputPort"),
LIST_DID_PARENTS: Symbol.for("ListDIDParentsInputPort"),
LIST_DID_RULES: Symbol.for("ListDIDRulesInputPort"),
LIST_DATASET_REPLICAS: Symbol.for("ListDatasetReplicasInputPort"),
Expand Down

0 comments on commit 613afd8

Please sign in to comment.