Skip to content

Library for interaction with component api and functionalities.

Component

new(ref) : Component method

create new reference to the component by name, tag or uuid


find(payload Filters) : Pagination method

find the models inside the component using the filters


get(uuid) : Model method

get component model by uuid


update(uuid, data) : any method


create(data) : any method

create new component model with provided data


delete(uuid) : any method

delete component model by uuid


aggregate(payload) : any method

use MongoDB syntax for aggregation pipeline to get aggregated results


settings() : Settings method

get current settings of the component


saveSettings(data Settings) method

save current component settings


workflow(event, input) method

trigger custom event in the components workflow and provide custom input


Types

Pagination

{
    items: [],
    total: 0,
    pages: 0,
    page: 1
}

Filters

{
    currentPage: 1,
    perPage: 50,
    sortDesc: 1 || -1,
    filterOn: [],
    filter '',
    dateFrom: '2022-06-22',
    dateTo: '2023-06-22',
    dateField: 'created_at'
    $adv: Query
    $aggregate: Pipeline
}

Query

Pipeline