Skip to content

DataSourceDelegate

@firecms/core


@firecms/core / DataSourceDelegate

Defined in: types/datasource.ts:252

cmsToDelegateModel: (data) => any

Defined in: types/datasource.ts:396

any

any


optional currentTime: () => any

Defined in: types/datasource.ts:392

Get the object to generate the current time in the datasource

any


delegateToCMSModel: (data) => any

Defined in: types/datasource.ts:394

any

any


optional initialised: boolean

Defined in: types/datasource.ts:262

If the data source has been initialised


optional initTextSearch: (props) => Promise<boolean>

Defined in: types/datasource.ts:400

EntityCollection

FireCMSContext

string

string[]

string

Promise<boolean>


key: string

Defined in: types/datasource.ts:257

Key that identifies this data source delegate


setDateToMidnight: (input?) => any

Defined in: types/datasource.ts:398

any

any

checkUniqueField(path, name, value, entityId?, collection?): Promise<boolean>

Defined in: types/datasource.ts:369

Check if the given property is unique in the given collection

string

Collection path

string

of the property

any

string

EntityCollection<any, any>

Promise<boolean>

true if there are no other fields besides the given entity


optional countEntities<M>(props): Promise<number>

Defined in: types/datasource.ts:379

Count the number of entities in a collection

M extends Record<string, any> = any

FetchCollectionDelegateProps<M>

Promise<number>


deleteEntity<M>(entity): Promise<void>

Defined in: types/datasource.ts:358

Delete an entity

M extends Record<string, any> = any

DeleteEntityProps<M>

Promise<void>

was the whole deletion flow successful


fetchCollection<M>(path): Promise<Entity<M>[]>

Defined in: types/datasource.ts:276

Fetch data from a collection

M extends Record<string, any> = any

FetchCollectionDelegateProps<M>

Promise<Entity<M>[]>

Function to cancel subscription

useCollectionFetch if you need this functionality implemented as a hook


fetchEntity<M>(path): Promise<Entity<M> | undefined>

Defined in: types/datasource.ts:318

Retrieve an entity given a path and a collection

M extends Record<string, any> = any

FetchEntityProps<M>

Promise<Entity<M> | undefined>


generateEntityId(path, collection?): string

Defined in: types/datasource.ts:374

Generate an id for a new entity

string

EntityCollection<any, any>

string


optional isFilterCombinationValid(props): boolean

Defined in: types/datasource.ts:385

Check if the given filter combination is valid

Omit<FilterCombinationValidProps, "collection"> & object

boolean


optional listenCollection<M>(path): () => void

Defined in: types/datasource.ts:301

Listen to a collection in a given path. If you don’t implement this method fetchCollection will be used instead, with no real time updates.

M extends Record<string, any> = any

ListenCollectionDelegateProps<M>

Function to cancel subscription

(): void

void

useCollectionFetch if you need this functionality implemented as a hook


optional listenEntity<M>(path): () => void

Defined in: types/datasource.ts:332

Get realtime updates on one entity.

M extends Record<string, any> = any

ListenEntityProps<M>

Function to cancel subscription

(): void

void


saveEntity<M>(path): Promise<Entity<M>>

Defined in: types/datasource.ts:346

Save entity to the specified path

M extends Record<string, any> = any

SaveEntityDelegateProps<M>

Promise<Entity<M>>