UNPKG

@webiny/api-headless-cms-ddb

Version:

DynamoDB storage operations plugin for Headless CMS API.

43 lines (42 loc) 1.51 kB
import { Plugin } from "@webiny/plugins"; import { Field } from "../operations/entry/filtering/types"; import { CmsModel } from "@webiny/api-headless-cms/types"; interface CmsEntryFieldSortingPluginCanUseParams { model: CmsModel; field?: Field; fieldId: string; order: "ASC" | "DESC"; /** * Combination of fieldId and sortBy * * example: id_ASC or createdBy_DESC */ sortBy: string; } interface CmsEntryFieldSortingPluginCreateSortParams { model: CmsModel; fieldId: string; order: "ASC" | "DESC"; sortBy: string; fields: Record<string, Field>; field?: Field; } interface CmsEntryFieldSortingPluginCreateSortResult { valuePath: string; reverse: boolean; fieldId: string; field: Field; } interface CmsEntryFieldSortingPluginConfig { createSort: (params: CmsEntryFieldSortingPluginCreateSortParams) => CmsEntryFieldSortingPluginCreateSortResult; canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean; } export declare class CmsEntryFieldSortingPlugin extends Plugin { static readonly type: string; private readonly config; constructor(config: CmsEntryFieldSortingPluginConfig); canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean; createSort(params: CmsEntryFieldSortingPluginCreateSortParams): CmsEntryFieldSortingPluginCreateSortResult; } export declare const createCmsEntryFieldSortingPlugin: (config: CmsEntryFieldSortingPluginConfig) => CmsEntryFieldSortingPlugin; export {};