jsonpath-tmf-query
Version:
This library aims to provide a simple wrapper around jsonpath, to ease the implementation of TMF630 JSONPath specification as outlined by the TM Forum [here](https://projects.tmforum.org/wiki/pages/viewpage.action?spaceKey=PUB&title=TMF630+REST+API+Design
23 lines (21 loc) • 713 B
TypeScript
interface BaseOperation {
path: string;
}
interface FilterOperation extends BaseOperation {
op: 'filter';
offset?: number;
limit?: number;
}
interface FieldsOperation extends BaseOperation {
op: 'fields';
}
interface SortOperation extends BaseOperation {
op: 'sort';
order: 'asc' | 'desc';
}
type Operation = FilterOperation | FieldsOperation | SortOperation;
declare const checkValidJsonPath: (jsonpathExpression: any) => boolean;
declare class JSONPathQuery {
static query(document: any, operations: Operation[]): any;
}
export { type BaseOperation, type FieldsOperation, type FilterOperation, type Operation, type SortOperation, checkValidJsonPath, JSONPathQuery as default };