@cere/rob-cli
Version:
CLI tool for deploying and managing rafts and data sources
103 lines (102 loc) • 1.95 kB
TypeScript
/**
* Data source types
*/
export declare enum DataSourceType {
POSTGRES = "postgresql",
ELASTICSEARCH = "elasticsearch",
REDIS = "redis",
MONGODB = "mongodb"
}
/**
* Data source model
*/
export interface DataSource {
id: string;
name?: string;
type: DataSourceType;
host: string;
port: string | number;
username?: string;
password?: string;
database?: string;
dataServiceId?: string;
[]: any;
}
/**
* Data sources container for YAML file
*/
export interface DataSourcesYaml {
dataSources: DataSource[];
dataServiceId?: string;
}
/**
* Trigger condition operator types
*/
export declare enum TriggerOperator {
EQUALS = "equals",
NOT_EQUALS = "notEquals",
CONTAINS = "contains",
STARTS_WITH = "startsWith",
ENDS_WITH = "endsWith",
GREATER_THAN = "greaterThan",
LESS_THAN = "lessThan"
}
/**
* Trigger condition model
*/
export interface TriggerCondition {
field: string;
operator: TriggerOperator;
value?: string;
}
/**
* Trigger model
*/
export interface Trigger {
id?: string;
eventPattern: string;
conditions: TriggerCondition[];
enabled?: boolean;
description?: string;
}
/**
* Script model
*/
export interface Script {
id?: string;
name: string;
tsCode: string;
jsCode?: string;
scriptFile?: string;
}
/**
* Query operation model
*/
export interface QueryOperation {
id?: string;
name: string;
alias: string;
description?: string;
scriptFile?: string;
script?: Script;
}
/**
* Raft model
*/
export interface Raft {
id?: string;
name: string;
description?: string;
triggers: Trigger[];
dataSourcesIds: string[];
indexingScript: Script;
queryOperations?: QueryOperation[];
dataServiceId?: string;
}
/**
* Rafts container for YAML file
*/
export interface RaftsYaml {
rafts: Raft[];
dataServiceId: string;
}