UNPKG

@restorecommerce/chassis-srv

Version:
78 lines (77 loc) 3.3 kB
import { Filters as GraphFilters, Options_Direction as Direction } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/graph'; /** * toTraversalFilterObject takes input contained in the proto structure defined in resource_base proto * and converts it into Object understandable by the underlying DB implementation in chassis-srv * @param {*} input Original filter input object * @param {*} obj converted filter objected passed recursively * @param {*} operatorList operatorlist updated and passed recursively */ export declare const toTraversalFilterObject: (input: any, obj?: any, operatorList?: string[]) => any; /** * Auto-casting reference value by using native function of arangoDB * * @param {string} key * @param {object} value - raw value optional * @return {object} interpreted value */ export declare const autoCastKey: (key: any, value?: any) => any; /** * Auto-casting raw data * * @param {object} value - raw value * @returns {any} interpreted value */ export declare const autoCastValue: (value: any) => any; /** * Links children of filter together via a comparision operator. * @param {any} filter * @param {string} op comparision operator * @return {any} query template string and bind variables */ export declare const buildComparison: (filter: any, op: string, root?: boolean) => any; /** * Auto-casting reference value by using native function of arangoDB * * @param {string} key * @param {object} value - raw value optional * @return {object} interpreted value */ export declare const autoCastRootKey: (key: any, value?: any) => any; /** * Creates a filter key, value. * When the value is a string, boolean, number or date a equal comparision is created. * Otherwise if the key corresponds to a known operator, the operator is constructed. * @param {string} key * @param {string|boolean|number|date|object} value * @return {String} query template string */ export declare const buildGraphField: (key: any, value: any, root?: boolean) => string; /** * Build ArangoDB query based on filter. * @param {Object} filter key, value tree object * @return {any} query template string and bind variables */ export declare const buildGraphFilter: (filter: any, root?: boolean) => any; /** * Find's the list of entities from edge definition config depending on the direction * recursively * @param collection - root collection / start vertex * @param edgeDefConfig - edge definition cofnig * @param direction - direction OUTBOUND / INBOUND * @param entitiesList - result of entities in the graph of edge definition config */ export declare const recursiveFindEntities: (collection: any, edgeDefConfig: any, direction: any, entitiesList: any) => any; /** * Build limit and offset filters. * @param {limit} limit * @param {offset} offset * @return {String} string limit filter */ export declare const buildGraphLimiter: (limit?: number, offset?: number) => string; /** * Build sort filter. * @param {Object} sort sort options * @return {any} template sort string */ export declare const buildGraphSorter: (sortList: any) => any; export declare const createGraphsAssociationFilter: (filters: GraphFilters[], direction: Direction, traversalCollectionName: string, edgeDefConfig: any, filter: string) => any;