UNPKG

@webiny/api-headless-cms-ddb-es

Version:

DynamoDB and Elasticsearch storage operations plugin for Headless CMS API.

36 lines (35 loc) 1.35 kB
import type { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types/index.js"; import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js"; export interface ToIndexParams { model: CmsModel; field: CmsModelField; fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface; value: any; rawValue: any; getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex; } export interface ToIndexValue { value?: any; rawValue?: any; } export interface FromIndexParams { model: CmsModel; field: CmsModelField; fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface; value: any; rawValue: any; getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex; } export interface ICmsEntryOpenSearchFieldIndex { readonly fieldType: string; unmappedType?(field: Pick<CmsModelField, "fieldId" | "type">): string; toIndex(params: ToIndexParams): ToIndexValue; fromIndex(params: FromIndexParams): any; } export declare const CmsEntryOpenSearchFieldIndex: import("@webiny/di").Abstraction<ICmsEntryOpenSearchFieldIndex>; export declare namespace CmsEntryOpenSearchFieldIndex { type Interface = ICmsEntryOpenSearchFieldIndex; type ToIndex = ToIndexParams; type ToValue = ToIndexValue; type FromIndex = FromIndexParams; }