Skip to content

@sourceloop/core / Exports / HasManyRestResolver

Class: HasManyRestResolver<T, S>

Type parameters

Name Type
T extends Entity
S extends Entity

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new HasManyRestResolver<T, S>(context)

Type parameters

Name Type
T extends Entity<T>
S extends Entity<S>

Parameters

Name Type
context Context

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:30

Properties

context

Private context: Context

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:32


type

type: RelationType = RelationType.hasMany

Implementation of

IRestResolver.type

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:34

Methods

_resolveHasManyOnly

Private _resolveHasManyOnly(«destructured»): Promise<Map<S[keyof S] | T[keyof T], S[]>>

Parameters

Name Type
«destructured» RestResolverParams<T, S> & { relationMetadata: HasManyDefinition }

Returns

Promise<Map<S[keyof S] | T[keyof T], S[]>>

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:128


_resolveHasManyThrough

Private _resolveHasManyThrough(«destructured»): Promise<Map<S[keyof S] | T[keyof T], S[]>>

Parameters

Name Type
«destructured» RestResolverParams<T, S> & { relationMetadata: HasManyDefinition }

Returns

Promise<Map<S[keyof S] | T[keyof T], S[]>>

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:63


addConditionToScope

Private addConditionToScope(ids, field, scope?): Promise<{ where: Where<AnyObject> }>

Parameters

Name Type
ids T[keyof T][]
field string
scope? Filter<S>

Returns

Promise<{ where: Where<AnyObject> }>

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:179


findRelatedData

Private findRelatedData(service, filter, token?, config?): Promise<S[]>

Parameters

Name Type
service ModifiedRestService<S>
filter Filter<S>
token? string
config? RestRelationConfig

Returns

Promise<S[]>

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:197


getService

Private getService(config): Promise<ModifiedRestService<S>>

Parameters

Name Type
config RestRelationConfig

Returns

Promise<ModifiedRestService<S>>

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:214


link(params): Promise<T>

Parameters

Name Type
params RestLinkerParams<T, S> & { relationMetadata: HasManyDefinition }

Returns

Promise<T>

Implementation of

IRestResolver.link

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:165


resolve

resolve(«destructured»): Promise<ResolvedMap<T, S>>

Parameters

Name Type
«destructured» RestResolverParams<T, S> & { relationMetadata: HasManyDefinition }

Returns

Promise<ResolvedMap<T, S>>

Implementation of

IRestResolver.resolve

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:35


toPascalCase

Private toPascalCase(str): string

Parameters

Name Type
str string

Returns

string

Defined in

packages/core/src/components/proxy-builder/services/rest-resolvers/has-many-resolver.service.ts:206