Skip to content

@sourceloop/search-service / Exports

@sourceloop/search-service

Table of contents

Namespaces

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

ColumnMap

Ƭ ColumnMap<T>: { [key in ModelProperties<T>]?: string }

Type parameters

Name Type
T extends Model

Defined in

services/search-service/src/types.ts:64


Condition

Ƭ Condition<MT>: { [P in keyof MT]?: PredicateComparison<MT[P]> | MT[P] & ShortHandEqualType }

Type parameters

Name Type
MT extends object

Defined in

services/search-service/src/types.ts:83


ModelProperties

Ƭ ModelProperties<T>: keyof Partial<Omit<T, "toJSON" | "toObject" | "getId" | "getIdObject">>

Type parameters

Name Type
T extends Model

Defined in

services/search-service/src/types.ts:36


PredicateComparison

Ƭ PredicateComparison<PT>: Object

Type parameters

Name
PT

Type declaration

Name Type
between? [PT, PT]
eq? PT
gt? PT
gte? PT
inq? PT[]
lt? PT
lte? PT
neq? PT
nin? PT[]

Defined in

services/search-service/src/types.ts:87


PredicateValueType

Ƭ PredicateValueType<PT>: PT | PT[] | [PT, PT]

Type parameters

Name
PT

Defined in

services/search-service/src/types.ts:99


Queries

Ƭ Queries: (Query | Queries)[]

Defined in

services/search-service/src/types.ts:108


Query

Ƭ Query: Object

Type declaration

Name Type
params ShortHandEqualType[]
sql string

Defined in

services/search-service/src/types.ts:103


RecentSearchWithRelations

Ƭ RecentSearchWithRelations: RecentSearch

Defined in

services/search-service/src/models/recent-search.model.ts:36


SearchControllerConfig

Ƭ SearchControllerConfig: Object

Type declaration

Name Type
authenticate? boolean
authorizations? string[]
basePath string
name? string
recentCount? number
recents? boolean

Defined in

services/search-service/src/types.ts:40


SearchFilter

Ƭ SearchFilter: (query: SearchQuery, user: IAuthUserWithPermissions) => Promise<SearchWhereFilterMap | undefined>

Type declaration

▸ (query, user): Promise<SearchWhereFilterMap | undefined>

Parameters
Name Type
query SearchQuery
user IAuthUserWithPermissions
Returns

Promise<SearchWhereFilterMap | undefined>

Defined in

services/search-service/src/services/search-filter.provider.ts:9


SearchFunctionType

Ƭ SearchFunctionType<T>: (query: SearchQuery) => Promise<T[]>

Type parameters

Name
T

Type declaration

▸ (query): Promise<T[]>

Parameters
Name Type
query SearchQuery
Returns

Promise<T[]>

Defined in

services/search-service/src/types.ts:10


SearchQueryWithRelations

Ƭ SearchQueryWithRelations: SearchQuery

Defined in

services/search-service/src/models/search-query.model.ts:69


SearchResultBaseWithRelations

Ƭ SearchResultBaseWithRelations: SearchResultBase

Defined in

services/search-service/src/models/search-result-base.model.ts:23


SearchResultWithRelations

Ƭ SearchResultWithRelations: SearchResult

Defined in

services/search-service/src/models/search-result.model.ts:23


SearchWhereFilter

Ƭ SearchWhereFilter<MT>: Condition<MT> | AndClause<MT> | OrClause<MT>

Type parameters

Name Type
MT extends object = AnyObject

Defined in

services/search-service/src/types.ts:72


SearchWhereFilterMap

Ƭ SearchWhereFilterMap: Object

Index signature

▪ [key: string]: SearchWhereFilter

Defined in

services/search-service/src/types.ts:68


SearchableModelsList

Ƭ SearchableModelsList<T>: (SearchableModel<T> | typeof Model)[]

Type parameters

Name Type
T extends Model

Defined in

services/search-service/src/types.ts:23


SearchableModelsService

Ƭ SearchableModelsService: Object

Type declaration

Name Type
add (model: typeof Model) => Promise<void>
delete (model: typeof Model) => Promise<void>
get () => Promise<typeof Model[]>

Defined in

services/search-service/src/types.ts:12


ShortHandEqualType

Ƭ ShortHandEqualType: string | number | boolean | Date

Defined in

services/search-service/src/types.ts:101

Variables

IGNORED_COLUMN

Const IGNORED_COLUMN: "-"

Defined in

services/search-service/src/keys.ts:28

Functions

authenticateOnCondition

authenticateOnCondition(condition?): MethodDecorator

Parameters

Name Type Default value
condition boolean false

Returns

MethodDecorator

Defined in

services/search-service/src/decorators/authentication-conditional.decorator.ts:6


defineSearchController

defineSearchController<T>(modelCtor, options?): SearchControllerCtor<T>

Type parameters

Name Type
T extends Model<T>

Parameters

Name Type
modelCtor typeof Model
options? SearchControllerConfig

Returns

SearchControllerCtor<T>

Defined in

services/search-service/src/controllers/search.controller.ts:33


getOnCondition

getOnCondition(condition, path, spec?): MethodDecorator

Parameters

Name Type
condition boolean
path string
spec? OperationObject

Returns

MethodDecorator

Defined in

services/search-service/src/decorators/get-conditional.decorator.ts:7


isSearchableModel

isSearchableModel<T>(arg): arg is SearchableModel<T, typeof Model>

Type parameters

Name Type
T extends Model<T>

Parameters

Name Type
arg typeof Model | SearchableModel<T, typeof Model>

Returns

arg is SearchableModel<T, typeof Model>

Defined in

services/search-service/src/types.ts:58