IHubEntityManager

Interface

Baseline CRUD+Search functions required for all Store classes

Methods

Method Returns Notes
  • create(obj: , requestOptions: IUserRequestOptions)
Promise<>

Create and Store a new Entity

  • destroy(id: string, requestOptions: IUserRequestOptions)
Promise<void>

Destroy an Entity

  • fetch(identifier: string, requestOptions: IRequestOptions)
Promise<>

Get an entity by an identifier. Implementations can handle this differently as needed. i.e. a HubProject can be fetched by item id (guid) or by a slug.

Promise<ISearchResponse<>>

Search for Entitys of type T

Note: When implementing, this should be a search for things of type T not searching "within" the T.

i.e. Searching for Teams, not searching for content shared to a team.

  • update(obj: , requestOptions: IUserRequestOptions)
Promise<>

Update an existing Entity

create

Interface Method

Create and Store a new Entity

  • create(obj: , requestOptions: IUserRequestOptions) : Promise<>

Parameters

Parameter Type Default Notes
obj Required
requestOptions Required IUserRequestOptions

Returns

Promise<>

destroy

Interface Method

Destroy an Entity

  • destroy(id: string, requestOptions: IUserRequestOptions) : Promise<void>

Parameters

Parameter Type Default Notes
id Required string
requestOptions Required IUserRequestOptions

Returns

Promise<void>

fetch

Interface Method

Get an entity by an identifier. Implementations can handle this differently as needed. i.e. a HubProject can be fetched by item id (guid) or by a slug.

  • fetch(identifier: string, requestOptions: IRequestOptions) : Promise<>

Parameters

Parameter Type Default Notes
identifier Required string
requestOptions Required IRequestOptions

Returns

Promise<>

update

Interface Method

Update an existing Entity

  • update(obj: , requestOptions: IUserRequestOptions) : Promise<>

Parameters

Parameter Type Default Notes
obj Required
requestOptions Required IUserRequestOptions

Returns

Promise<>

Interface defined in common/src/core/types/IHubEntityManager.ts:10