2021-06-24 19:16:48 +02:00
|
|
|
export enum Operation {
|
|
|
|
CREATE = "CREATE",
|
|
|
|
READ = "READ",
|
|
|
|
UPDATE = "UPDATE",
|
|
|
|
DELETE = "DELETE",
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum SortDirection {
|
|
|
|
ASCENDING = "ASCENDING",
|
|
|
|
DESCENDING = "DESCENDING",
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum QueryTypes {
|
|
|
|
SQL = "sql",
|
|
|
|
JSON = "json",
|
|
|
|
FIELDS = "fields",
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum DatasourceFieldTypes {
|
|
|
|
STRING = "string",
|
|
|
|
BOOLEAN = "boolean",
|
|
|
|
NUMBER = "number",
|
|
|
|
PASSWORD = "password",
|
|
|
|
LIST = "list",
|
|
|
|
OBJECT = "object",
|
|
|
|
JSON = "json",
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface QueryDefinition {
|
2021-06-25 19:13:11 +02:00
|
|
|
type: QueryTypes,
|
|
|
|
displayName?: string,
|
|
|
|
readable?: boolean,
|
|
|
|
customisable?: boolean,
|
|
|
|
fields?: object,
|
|
|
|
urlDisplay?: boolean,
|
2021-06-24 19:16:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Integration {
|
2021-06-25 19:13:11 +02:00
|
|
|
docs: string,
|
|
|
|
plus?: boolean,
|
|
|
|
description: string,
|
|
|
|
friendlyName: string,
|
|
|
|
datasource: {},
|
2021-06-24 19:16:48 +02:00
|
|
|
query: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: QueryDefinition,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SearchFilters {
|
2021-06-25 19:13:11 +02:00
|
|
|
allOr: boolean,
|
2021-06-24 19:16:48 +02:00
|
|
|
string?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: string,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
fuzzy?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: string,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
range?: {
|
|
|
|
[key: string]: {
|
2021-06-25 19:13:11 +02:00
|
|
|
high: number | string,
|
|
|
|
low: number | string,
|
|
|
|
},
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
equal?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: any,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
notEqual?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: any,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
empty?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: any,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
notEmpty?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: any,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RelationshipsJson {
|
|
|
|
through?: {
|
|
|
|
from: string,
|
|
|
|
to: string,
|
|
|
|
tableName: string,
|
|
|
|
},
|
|
|
|
from: string,
|
|
|
|
to: string,
|
|
|
|
tableName: string,
|
2021-06-24 19:16:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface QueryJson {
|
|
|
|
endpoint: {
|
2021-06-25 19:13:11 +02:00
|
|
|
datasourceId: string,
|
|
|
|
entityId: string,
|
|
|
|
operation: Operation,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
resource: {
|
2021-06-25 19:13:11 +02:00
|
|
|
fields: string[],
|
|
|
|
},
|
|
|
|
filters?: SearchFilters,
|
2021-06-24 19:16:48 +02:00
|
|
|
sort?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: SortDirection,
|
|
|
|
},
|
2021-06-24 19:16:48 +02:00
|
|
|
paginate?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
limit: number,
|
|
|
|
page: string | number,
|
|
|
|
},
|
|
|
|
body?: object,
|
|
|
|
extra?: {
|
|
|
|
idFilter?: SearchFilters,
|
|
|
|
},
|
|
|
|
relationships?: RelationshipsJson[],
|
2021-06-24 19:16:48 +02:00
|
|
|
}
|
|
|
|
|
2021-06-25 14:46:02 +02:00
|
|
|
export interface SqlQuery {
|
2021-06-25 19:13:11 +02:00
|
|
|
sql: string,
|
2021-06-25 14:46:02 +02:00
|
|
|
bindings?: {
|
2021-06-25 19:13:11 +02:00
|
|
|
[key: string]: any,
|
|
|
|
},
|
2021-06-25 14:46:02 +02:00
|
|
|
}
|
|
|
|
|
2021-06-24 19:16:48 +02:00
|
|
|
export interface QueryOptions {
|
2021-06-25 19:13:11 +02:00
|
|
|
disableReturning?: boolean,
|
2021-06-24 19:17:26 +02:00
|
|
|
}
|