Commit 8fae8c02 by 五更

release: v1.0.3

parent 10127a3a
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -20,7 +20,11 @@ type __VLS_Props = { ...@@ -20,7 +20,11 @@ type __VLS_Props = {
renderDefaultDashboard?: boolean; renderDefaultDashboard?: boolean;
presets?: PresetItem[]; presets?: PresetItem[];
}; };
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { declare var __VLS_10: string | number, __VLS_11: any;
type __VLS_Slots = {} & {
[K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
};
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
save: (json: string) => any; save: (json: string) => any;
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
onSave?: ((json: string) => any) | undefined; onSave?: ((json: string) => any) | undefined;
...@@ -33,4 +37,10 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, { ...@@ -33,4 +37,10 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
initialEditingPanelId: string | null; initialEditingPanelId: string | null;
datasourceConfig: DataSourceConfig[] | null; datasourceConfig: DataSourceConfig[] | null;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
export default _default; export default _default;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};
/** /**
* Argus QueryBuilder 客户端 * Argus QueryBuilder 客户端
* POST {url}/api/v5/query_range * POST {url}/api/v5/query_range
* GET {url}/api/v5/metrics * GET {url}/api/v2/metrics
* GET {url}/api/v5/attribute_keys * GET {url}/api/v5/attribute_keys
*/ */
import type { ArgusField, ArgusQueryItem } from '../types/dashboard'; import type { ArgusField, ArgusQueryItem } from '../types/dashboard';
...@@ -23,7 +23,32 @@ export interface ArgusMetricsListResponse { ...@@ -23,7 +23,32 @@ export interface ArgusMetricsListResponse {
metrics: ArgusMetricMeta[]; metrics: ArgusMetricMeta[];
}; };
} }
export interface ArgusMetricItem {
metricName: string;
type: string;
unit: string;
description: string;
}
export type ArgusSuggestionSignal = 'logs' | 'traces' | 'metrics';
export interface ArgusKeySuggestion {
name: string;
type?: string;
fieldDataType?: string;
}
export interface ArgusValueSuggestions {
stringValues: string[];
numberValues: number[];
}
export declare function getMetrics(cfg: ArgusClientConfig): Promise<ArgusMetricMeta[]>; export declare function getMetrics(cfg: ArgusClientConfig): Promise<ArgusMetricMeta[]>;
/**
* GET /api/v2/metrics — metric dropdown search used by the query builder.
* Mirrors the SigNoz searchMetrics API and normalizes the response to the UI shape.
*/
export declare function searchMetrics(cfg: ArgusClientConfig, params: {
searchText?: string;
source?: 'meter' | '';
limit?: number;
}): Promise<ArgusMetricItem[]>;
export interface ArgusAttributeKeysResponse { export interface ArgusAttributeKeysResponse {
data: { data: {
attributeKeys: ArgusField[]; attributeKeys: ArgusField[];
...@@ -38,6 +63,31 @@ export declare function getAttributeKeys(cfg: ArgusClientConfig, params: { ...@@ -38,6 +63,31 @@ export declare function getAttributeKeys(cfg: ArgusClientConfig, params: {
metricName?: string; metricName?: string;
search?: string; search?: string;
}): Promise<ArgusField[]>; }): Promise<ArgusField[]>;
/**
* GET /api/v1/fields/keys — attribute-key suggestions for smart filter and
* aggregation editors. Falls back to /api/v3/autocomplete/attribute_keys when
* the richer fields endpoint is unavailable.
*/
export declare function getKeySuggestions(cfg: ArgusClientConfig, params: {
signal: ArgusSuggestionSignal;
searchText?: string;
metricName?: string;
signalSource?: 'meter' | '';
fieldDataType?: string;
fieldContext?: string;
}): Promise<ArgusKeySuggestion[]>;
/**
* GET /api/v1/fields/values — value suggestions for a selected key.
* Falls back to /api/v3/autocomplete/attribute_values when /fields/* is unavailable.
*/
export declare function getValueSuggestions(cfg: ArgusClientConfig, params: {
key: string;
signal: ArgusSuggestionSignal;
tagType?: string;
searchText?: string;
metricName?: string;
signalSource?: 'meter' | '';
}): Promise<ArgusValueSuggestions>;
export interface ArgusTimeSeriesValue { export interface ArgusTimeSeriesValue {
timestamp: number; timestamp: number;
value: number; value: number;
......
...@@ -34,10 +34,10 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {} ...@@ -34,10 +34,10 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
width: string | number; width: string | number;
mode: "modal" | "drawer"; mode: "modal" | "drawer";
footer: boolean; footer: boolean;
mask: boolean;
headerBorder: boolean; headerBorder: boolean;
footerBorder: boolean; footerBorder: boolean;
destroyOnClose: boolean; destroyOnClose: boolean;
mask: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>; declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
export default _default; export default _default;
......
export declare function getMaxZIndex(options?: {
exclude?: Element | null;
}): number;
import type { ArgusFormulaSpec } from '../../_core';
type __VLS_Props = {
spec: ArgusFormulaSpec;
canDelete: boolean;
queryNames?: string[];
};
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
delete: () => any;
change: (spec: ArgusFormulaSpec) => any;
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
onDelete?: (() => any) | undefined;
onChange?: ((spec: ArgusFormulaSpec) => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
export default _default;
import type { ArgusClientConfig } from '../../_core';
type __VLS_Props = {
modelValue: string;
cfg: ArgusClientConfig | null;
placeholder?: string;
signal?: 'logs' | 'traces' | 'metrics';
/** When set, use these keys instead of the /fields/keys API (mirrors SigNoz hardcodedAttributeKeys) */
hardcodedAttributeKeys?: Array<{
name: string;
fieldDataType?: string;
}>;
/** When metricName changes, re-fetch key suggestions scoped to that metric */
metricName?: string;
};
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
"update:modelValue": (value: string) => any;
run: (value: string) => any;
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
onRun?: ((value: string) => any) | undefined;
}>, {
signal: "logs" | "traces" | "metrics";
metricName: string;
placeholder: string;
hardcodedAttributeKeys: Array<{
name: string;
fieldDataType?: string;
}>;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
export default _default;
import type { ArgusClientConfig } from '../../_core';
type __VLS_Props = {
modelValue: string;
cfg: ArgusClientConfig | null;
/** Determines which field keys to suggest inside function arguments */
signal?: 'traces' | 'logs' | 'metrics';
/** Whether to show the "every N seconds" interval control */
showInterval?: boolean;
/** Current step interval in seconds (null = Auto) */
stepInterval?: number | null;
};
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
"update:modelValue": (value: string) => any;
"update:stepInterval": (value: number | null) => any;
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
"onUpdate:stepInterval"?: ((value: number | null) => any) | undefined;
}>, {
signal: "traces" | "logs" | "metrics";
stepInterval: number | null;
showInterval: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
export default _default;
...@@ -4,15 +4,18 @@ type __VLS_Props = { ...@@ -4,15 +4,18 @@ type __VLS_Props = {
cfg: ArgusClientConfig | null; cfg: ArgusClientConfig | null;
collapsed: boolean; collapsed: boolean;
canDelete: boolean; canDelete: boolean;
queryNames: string[];
}; };
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
delete: () => any; delete: () => any;
change: (item: ArgusQueryItem) => any; change: (item: ArgusQueryItem) => any;
clone: () => any;
toggleCollapse: () => any; toggleCollapse: () => any;
toggleDisabled: () => any; toggleDisabled: () => any;
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
onDelete?: (() => any) | undefined; onDelete?: (() => any) | undefined;
onChange?: ((item: ArgusQueryItem) => any) | undefined; onChange?: ((item: ArgusQueryItem) => any) | undefined;
onClone?: (() => any) | undefined;
onToggleCollapse?: (() => any) | undefined; onToggleCollapse?: (() => any) | undefined;
onToggleDisabled?: (() => any) | undefined; onToggleDisabled?: (() => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>; }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
......
export declare const OPERATORS: {
IN: string;
LIKE: string;
ILIKE: string;
REGEXP: string;
EXISTS: string;
CONTAINS: string;
BETWEEN: string;
NOT: string;
'=': string;
'!=': string;
'>=': string;
'>': string;
'<=': string;
'<': string;
};
export declare const TRACE_OPERATOR_OPERATORS: {
AND: string;
OR: string;
NOT: string;
DIRECT_DESCENDENT: string;
INDIRECT_DESCENDENT: string;
};
export declare const TRACE_OPERATOR_OPERATORS_WITH_PRIORITY: {
[TRACE_OPERATOR_OPERATORS.DIRECT_DESCENDENT]: number;
[TRACE_OPERATOR_OPERATORS.AND]: number;
[TRACE_OPERATOR_OPERATORS.OR]: number;
[TRACE_OPERATOR_OPERATORS.NOT]: number;
[TRACE_OPERATOR_OPERATORS.INDIRECT_DESCENDENT]: number;
};
export declare const TRACE_OPERATOR_OPERATORS_LABELS: {
[TRACE_OPERATOR_OPERATORS.DIRECT_DESCENDENT]: string;
[TRACE_OPERATOR_OPERATORS.INDIRECT_DESCENDENT]: string;
};
export declare const QUERY_BUILDER_FUNCTIONS: {
HAS: string;
HASANY: string;
HASALL: string;
HASTOKEN: string;
};
export declare function negateOperator(operatorOrFunction: string): string;
export declare enum DEPRECATED_OPERATORS {
REGEX = "regex",
NIN = "nin",
NREGEX = "nregex",
NLIKE = "nlike",
NILIKE = "nilike",
NEXTISTS = "nexists",
NCONTAINS = "ncontains",
NHAS = "nhas",
NHASANY = "nhasany",
NHASALL = "nhasall"
}
export declare const DEPRECATED_OPERATORS_MAP: {
regex: string;
nin: string;
nregex: string;
nlike: string;
nilike: string;
nexists: string;
ncontains: string;
nhas: string;
nhasany: string;
nhasall: string;
};
export declare const NON_VALUE_OPERATORS: string[];
export declare enum QUERY_BUILDER_KEY_TYPES {
STRING = "string",
NUMBER = "number",
BOOLEAN = "boolean"
}
export declare const QUERY_BUILDER_OPERATORS_BY_KEY_TYPE: {
string: string[];
number: string[];
boolean: string[];
};
export declare const negationQueryOperatorSuggestions: {
label: string;
type: string;
info: string;
}[];
export declare const queryOperatorSuggestions: {
label: string;
type: string;
info: string;
}[];
import type { ATN, CharStream } from 'antlr4';
import { DFA, Lexer } from 'antlr4';
export default class FilterQueryLexer extends Lexer {
static readonly LPAREN = 1;
static readonly RPAREN = 2;
static readonly LBRACK = 3;
static readonly RBRACK = 4;
static readonly COMMA = 5;
static readonly EQUALS = 6;
static readonly NOT_EQUALS = 7;
static readonly NEQ = 8;
static readonly LT = 9;
static readonly LE = 10;
static readonly GT = 11;
static readonly GE = 12;
static readonly LIKE = 13;
static readonly ILIKE = 14;
static readonly BETWEEN = 15;
static readonly EXISTS = 16;
static readonly REGEXP = 17;
static readonly CONTAINS = 18;
static readonly IN = 19;
static readonly NOT = 20;
static readonly AND = 21;
static readonly OR = 22;
static readonly HASTOKEN = 23;
static readonly HAS = 24;
static readonly HASANY = 25;
static readonly HASALL = 26;
static readonly BOOL = 27;
static readonly NUMBER = 28;
static readonly QUOTED_TEXT = 29;
static readonly KEY = 30;
static readonly WS = 31;
static readonly FREETEXT = 32;
static readonly EOF: number;
static readonly channelNames: string[];
static readonly literalNames: (string | null)[];
static readonly symbolicNames: (string | null)[];
static readonly modeNames: string[];
static readonly ruleNames: string[];
constructor(input: CharStream);
get grammarFileName(): string;
get literalNames(): (string | null)[];
get symbolicNames(): (string | null)[];
get ruleNames(): string[];
get serializedATN(): number[];
get channelNames(): string[];
get modeNames(): string[];
static readonly _serializedATN: number[];
private static __ATN;
static get _ATN(): ATN;
static DecisionsToDFA: DFA[];
}
import type { AndExpressionContext, ArrayContext, ComparisonContext, ExpressionContext, FullTextContext, FunctionCallContext, FunctionParamContext, FunctionParamListContext, InClauseContext, KeyContext, NotInClauseContext, OrExpressionContext, PrimaryContext, QueryContext, UnaryExpressionContext, ValueContext, ValueListContext } from './FilterQueryParser';
import { ParseTreeListener } from 'antlr4';
/**
* This interface defines a complete listener for a parse tree produced by
* `FilterQueryParser`.
*/
export default class FilterQueryListener extends ParseTreeListener {
/**
* Enter a parse tree produced by `FilterQueryParser.query`.
* @param ctx the parse tree
*/
enterQuery?: (ctx: QueryContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.query`.
* @param ctx the parse tree
*/
exitQuery?: (ctx: QueryContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.expression`.
* @param ctx the parse tree
*/
enterExpression?: (ctx: ExpressionContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.expression`.
* @param ctx the parse tree
*/
exitExpression?: (ctx: ExpressionContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.orExpression`.
* @param ctx the parse tree
*/
enterOrExpression?: (ctx: OrExpressionContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.orExpression`.
* @param ctx the parse tree
*/
exitOrExpression?: (ctx: OrExpressionContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.andExpression`.
* @param ctx the parse tree
*/
enterAndExpression?: (ctx: AndExpressionContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.andExpression`.
* @param ctx the parse tree
*/
exitAndExpression?: (ctx: AndExpressionContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.unaryExpression`.
* @param ctx the parse tree
*/
enterUnaryExpression?: (ctx: UnaryExpressionContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.unaryExpression`.
* @param ctx the parse tree
*/
exitUnaryExpression?: (ctx: UnaryExpressionContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.primary`.
* @param ctx the parse tree
*/
enterPrimary?: (ctx: PrimaryContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.primary`.
* @param ctx the parse tree
*/
exitPrimary?: (ctx: PrimaryContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.comparison`.
* @param ctx the parse tree
*/
enterComparison?: (ctx: ComparisonContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.comparison`.
* @param ctx the parse tree
*/
exitComparison?: (ctx: ComparisonContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.inClause`.
* @param ctx the parse tree
*/
enterInClause?: (ctx: InClauseContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.inClause`.
* @param ctx the parse tree
*/
exitInClause?: (ctx: InClauseContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.notInClause`.
* @param ctx the parse tree
*/
enterNotInClause?: (ctx: NotInClauseContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.notInClause`.
* @param ctx the parse tree
*/
exitNotInClause?: (ctx: NotInClauseContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.valueList`.
* @param ctx the parse tree
*/
enterValueList?: (ctx: ValueListContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.valueList`.
* @param ctx the parse tree
*/
exitValueList?: (ctx: ValueListContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.fullText`.
* @param ctx the parse tree
*/
enterFullText?: (ctx: FullTextContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.fullText`.
* @param ctx the parse tree
*/
exitFullText?: (ctx: FullTextContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.functionCall`.
* @param ctx the parse tree
*/
enterFunctionCall?: (ctx: FunctionCallContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.functionCall`.
* @param ctx the parse tree
*/
exitFunctionCall?: (ctx: FunctionCallContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.functionParamList`.
* @param ctx the parse tree
*/
enterFunctionParamList?: (ctx: FunctionParamListContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.functionParamList`.
* @param ctx the parse tree
*/
exitFunctionParamList?: (ctx: FunctionParamListContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.functionParam`.
* @param ctx the parse tree
*/
enterFunctionParam?: (ctx: FunctionParamContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.functionParam`.
* @param ctx the parse tree
*/
exitFunctionParam?: (ctx: FunctionParamContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.array`.
* @param ctx the parse tree
*/
enterArray?: (ctx: ArrayContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.array`.
* @param ctx the parse tree
*/
exitArray?: (ctx: ArrayContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.value`.
* @param ctx the parse tree
*/
enterValue?: (ctx: ValueContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.value`.
* @param ctx the parse tree
*/
exitValue?: (ctx: ValueContext) => void;
/**
* Enter a parse tree produced by `FilterQueryParser.key`.
* @param ctx the parse tree
*/
enterKey?: (ctx: KeyContext) => void;
/**
* Exit a parse tree produced by `FilterQueryParser.key`.
* @param ctx the parse tree
*/
exitKey?: (ctx: KeyContext) => void;
}
import type { ATN, TerminalNode, TokenStream } from 'antlr4';
import type FilterQueryListener from './FilterQueryListener';
import type FilterQueryVisitor from './FilterQueryVisitor';
import { DFA, FailedPredicateException, Parser, ParserRuleContext } from 'antlr4';
export default class FilterQueryParser extends Parser {
static readonly LPAREN = 1;
static readonly RPAREN = 2;
static readonly LBRACK = 3;
static readonly RBRACK = 4;
static readonly COMMA = 5;
static readonly EQUALS = 6;
static readonly NOT_EQUALS = 7;
static readonly NEQ = 8;
static readonly LT = 9;
static readonly LE = 10;
static readonly GT = 11;
static readonly GE = 12;
static readonly LIKE = 13;
static readonly ILIKE = 14;
static readonly BETWEEN = 15;
static readonly EXISTS = 16;
static readonly REGEXP = 17;
static readonly CONTAINS = 18;
static readonly IN = 19;
static readonly NOT = 20;
static readonly AND = 21;
static readonly OR = 22;
static readonly HASTOKEN = 23;
static readonly HAS = 24;
static readonly HASANY = 25;
static readonly HASALL = 26;
static readonly BOOL = 27;
static readonly NUMBER = 28;
static readonly QUOTED_TEXT = 29;
static readonly KEY = 30;
static readonly WS = 31;
static readonly FREETEXT = 32;
static readonly EOF: number;
static readonly RULE_query = 0;
static readonly RULE_expression = 1;
static readonly RULE_orExpression = 2;
static readonly RULE_andExpression = 3;
static readonly RULE_unaryExpression = 4;
static readonly RULE_primary = 5;
static readonly RULE_comparison = 6;
static readonly RULE_inClause = 7;
static readonly RULE_notInClause = 8;
static readonly RULE_valueList = 9;
static readonly RULE_fullText = 10;
static readonly RULE_functionCall = 11;
static readonly RULE_functionParamList = 12;
static readonly RULE_functionParam = 13;
static readonly RULE_array = 14;
static readonly RULE_value = 15;
static readonly RULE_key = 16;
static readonly literalNames: (string | null)[];
static readonly symbolicNames: (string | null)[];
static readonly ruleNames: string[];
get grammarFileName(): string;
get literalNames(): (string | null)[];
get symbolicNames(): (string | null)[];
get ruleNames(): string[];
get serializedATN(): number[];
protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException;
constructor(input: TokenStream);
query(): QueryContext;
expression(): ExpressionContext;
orExpression(): OrExpressionContext;
andExpression(): AndExpressionContext;
unaryExpression(): UnaryExpressionContext;
primary(): PrimaryContext;
comparison(): ComparisonContext;
inClause(): InClauseContext;
notInClause(): NotInClauseContext;
valueList(): ValueListContext;
fullText(): FullTextContext;
functionCall(): FunctionCallContext;
functionParamList(): FunctionParamListContext;
functionParam(): FunctionParamContext;
array(): ArrayContext;
value(): ValueContext;
key(): KeyContext;
static readonly _serializedATN: number[];
private static __ATN;
static get _ATN(): ATN;
static DecisionsToDFA: DFA[];
}
export declare class QueryContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
expression(): ExpressionContext;
EOF(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class ExpressionContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
orExpression(): OrExpressionContext;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class OrExpressionContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
andExpression_list(): AndExpressionContext[];
andExpression(i: number): AndExpressionContext;
OR_list(): TerminalNode[];
OR(i: number): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class AndExpressionContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
unaryExpression_list(): UnaryExpressionContext[];
unaryExpression(i: number): UnaryExpressionContext;
AND_list(): TerminalNode[];
AND(i: number): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class UnaryExpressionContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
primary(): PrimaryContext;
NOT(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class PrimaryContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
LPAREN(): TerminalNode;
orExpression(): OrExpressionContext;
RPAREN(): TerminalNode;
comparison(): ComparisonContext;
functionCall(): FunctionCallContext;
fullText(): FullTextContext;
key(): KeyContext;
value(): ValueContext;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class ComparisonContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
key(): KeyContext;
EQUALS(): TerminalNode;
value_list(): ValueContext[];
value(i: number): ValueContext;
NOT_EQUALS(): TerminalNode;
NEQ(): TerminalNode;
LT(): TerminalNode;
LE(): TerminalNode;
GT(): TerminalNode;
GE(): TerminalNode;
LIKE(): TerminalNode;
ILIKE(): TerminalNode;
NOT(): TerminalNode;
BETWEEN(): TerminalNode;
AND(): TerminalNode;
inClause(): InClauseContext;
notInClause(): NotInClauseContext;
EXISTS(): TerminalNode;
REGEXP(): TerminalNode;
CONTAINS(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class InClauseContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
IN(): TerminalNode;
LPAREN(): TerminalNode;
valueList(): ValueListContext;
RPAREN(): TerminalNode;
LBRACK(): TerminalNode;
RBRACK(): TerminalNode;
value(): ValueContext;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class NotInClauseContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
NOT(): TerminalNode;
IN(): TerminalNode;
LPAREN(): TerminalNode;
valueList(): ValueListContext;
RPAREN(): TerminalNode;
LBRACK(): TerminalNode;
RBRACK(): TerminalNode;
value(): ValueContext;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class ValueListContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
value_list(): ValueContext[];
value(i: number): ValueContext;
COMMA_list(): TerminalNode[];
COMMA(i: number): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class FullTextContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
QUOTED_TEXT(): TerminalNode;
FREETEXT(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class FunctionCallContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
LPAREN(): TerminalNode;
functionParamList(): FunctionParamListContext;
RPAREN(): TerminalNode;
HASTOKEN(): TerminalNode;
HAS(): TerminalNode;
HASANY(): TerminalNode;
HASALL(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class FunctionParamListContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
functionParam_list(): FunctionParamContext[];
functionParam(i: number): FunctionParamContext;
COMMA_list(): TerminalNode[];
COMMA(i: number): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class FunctionParamContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
key(): KeyContext;
value(): ValueContext;
array(): ArrayContext;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class ArrayContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
LBRACK(): TerminalNode;
valueList(): ValueListContext;
RBRACK(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class ValueContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
QUOTED_TEXT(): TerminalNode;
NUMBER(): TerminalNode;
BOOL(): TerminalNode;
KEY(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
export declare class KeyContext extends ParserRuleContext {
constructor(parser?: FilterQueryParser, parent?: ParserRuleContext, invokingState?: number);
KEY(): TerminalNode;
get ruleIndex(): number;
enterRule(listener: FilterQueryListener): void;
exitRule(listener: FilterQueryListener): void;
accept<Result>(visitor: FilterQueryVisitor<Result>): Result;
}
import type { AndExpressionContext, ArrayContext, ComparisonContext, ExpressionContext, FullTextContext, FunctionCallContext, FunctionParamContext, FunctionParamListContext, InClauseContext, KeyContext, NotInClauseContext, OrExpressionContext, PrimaryContext, QueryContext, UnaryExpressionContext, ValueContext, ValueListContext } from './FilterQueryParser';
import { ParseTreeVisitor } from 'antlr4';
/**
* This interface defines a complete generic visitor for a parse tree produced
* by `FilterQueryParser`.
*
* @param <Result> The return type of the visit operation. Use `void` for
* operations with no return type.
*/
export default class FilterQueryVisitor<Result> extends ParseTreeVisitor<Result> {
/**
* Visit a parse tree produced by `FilterQueryParser.query`.
* @param ctx the parse tree
* @return the visitor result
*/
visitQuery?: (ctx: QueryContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.expression`.
* @param ctx the parse tree
* @return the visitor result
*/
visitExpression?: (ctx: ExpressionContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.orExpression`.
* @param ctx the parse tree
* @return the visitor result
*/
visitOrExpression?: (ctx: OrExpressionContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.andExpression`.
* @param ctx the parse tree
* @return the visitor result
*/
visitAndExpression?: (ctx: AndExpressionContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.unaryExpression`.
* @param ctx the parse tree
* @return the visitor result
*/
visitUnaryExpression?: (ctx: UnaryExpressionContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.primary`.
* @param ctx the parse tree
* @return the visitor result
*/
visitPrimary?: (ctx: PrimaryContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.comparison`.
* @param ctx the parse tree
* @return the visitor result
*/
visitComparison?: (ctx: ComparisonContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.inClause`.
* @param ctx the parse tree
* @return the visitor result
*/
visitInClause?: (ctx: InClauseContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.notInClause`.
* @param ctx the parse tree
* @return the visitor result
*/
visitNotInClause?: (ctx: NotInClauseContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.valueList`.
* @param ctx the parse tree
* @return the visitor result
*/
visitValueList?: (ctx: ValueListContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.fullText`.
* @param ctx the parse tree
* @return the visitor result
*/
visitFullText?: (ctx: FullTextContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.functionCall`.
* @param ctx the parse tree
* @return the visitor result
*/
visitFunctionCall?: (ctx: FunctionCallContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.functionParamList`.
* @param ctx the parse tree
* @return the visitor result
*/
visitFunctionParamList?: (ctx: FunctionParamListContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.functionParam`.
* @param ctx the parse tree
* @return the visitor result
*/
visitFunctionParam?: (ctx: FunctionParamContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.array`.
* @param ctx the parse tree
* @return the visitor result
*/
visitArray?: (ctx: ArrayContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.value`.
* @param ctx the parse tree
* @return the visitor result
*/
visitValue?: (ctx: ValueContext) => Result;
/**
* Visit a parse tree produced by `FilterQueryParser.key`.
* @param ctx the parse tree
* @return the visitor result
*/
visitKey?: (ctx: KeyContext) => Result;
}
import type { IToken } from '../types/antlrQueryTypes';
type TokenClassification = 'Key' | 'Value' | 'Operator';
interface TokenInfo {
text: string;
startIndex: number;
stopIndex: number;
type: TokenClassification;
}
export declare function analyzeQuery(input: string, lastToken: IToken): TokenInfo | undefined;
export {};
export interface IValidationResult {
isValid: boolean;
message: string;
errors: IDetailedError[];
}
export interface IToken {
type: number;
text: string;
start: number;
stop: number;
channel?: number;
}
export interface IQueryPair {
key: string;
operator: string;
value?: string;
valueList?: string[];
hasNegation?: boolean;
isMultiValue?: boolean;
position: {
keyStart: number;
keyEnd: number;
operatorStart: number;
operatorEnd: number;
valueStart?: number;
valueEnd?: number;
negationStart?: number;
negationEnd?: number;
};
valuesPosition?: {
start?: number;
end?: number;
}[];
isComplete: boolean;
}
export interface IQueryContext {
tokenType: number;
text: string;
start: number;
stop: number;
currentToken: string;
isInValue: boolean;
isInKey: boolean;
isInNegation: boolean;
isInOperator: boolean;
isInFunction: boolean;
isInConjunction?: boolean;
isInParenthesis?: boolean;
isInBracketList?: boolean;
keyToken?: string;
operatorToken?: string;
valueToken?: string;
queryPairs?: IQueryPair[];
currentPair?: IQueryPair | null;
}
export interface IDetailedError {
message: string;
line: number;
column: number;
offendingSymbol?: string;
expectedTokens?: string[];
}
export interface ASTNode {
type: string;
value?: string;
children?: ASTNode[];
}
import type { Token } from 'antlr4';
import type { IQueryContext, IQueryPair } from '../types/antlrQueryTypes';
export declare function createContext(token: Token, isInKey: boolean, isInNegation: boolean, isInOperator: boolean, isInValue: boolean, keyToken?: string, operatorToken?: string, valueToken?: string, queryPairs?: IQueryPair[], currentPair?: IQueryPair | null): IQueryContext;
export declare function getCurrentValueIndexAtCursor(valuesPosition: {
start?: number;
end?: number;
}[], cursorIndex: number): number | null;
/**
* Gets the current query context at the cursor position
* This is useful for determining what kind of suggestions to show
*
* The function now includes full query pair information:
* - queryPairs: All key-operator-value triplets in the query
* - currentPair: The pair at or before the current cursor position
*
* This enables more intelligent context-aware suggestions based on
* the current key, operator, and surrounding query structure.
*
* @param query The query string
* @param cursorIndex The position of the cursor in the query
* @returns The query context at the cursor position
*/
export declare function getQueryContextAtCursor(query: string, cursorIndex: number): IQueryContext;
/**
* Extracts all key-operator-value triplets from a query string
* This is useful for getting value suggestions based on the current key and operator
*
* @param query The query string to parse
* @returns An array of IQueryPair objects representing the key-operator-value triplets
*/
export declare function extractQueryPairs(query: string): IQueryPair[];
/**
* Gets the current query pair at the cursor position
* This is useful for getting suggestions based on the current context
* The function finds the rightmost complete pair that ends before or at the cursor position
*
* @param queryPairs An array of IQueryPair objects representing the key-operator-value triplets
* @param query The full query string
* @param cursorIndex The position of the cursor in the query
* @returns The query pair at the cursor position, or null if not found
*/
export declare function getCurrentQueryPair(queryPairs: IQueryPair[], query: string, cursorIndex: number): IQueryPair | null;
/**
* Usage example for query context with pairs:
*
* ```typescript
* // Get context at cursor position
* const context = getQueryContextAtCursor(query, cursorPosition);
*
* // Access all query pairs
* const allPairs = context.queryPairs || [];
* console.log(`Query contains ${allPairs.length} key-operator-value triplets`);
*
* // Access the current pair at cursor
* if (context.currentPair) {
* // Use the current triplet to provide relevant suggestions
* const { key, operator, value } = context.currentPair;
* console.log(`Current context: ${key} ${operator} ${value || ''}`);
*
* // Check if this is a complete triplet
* if (context.currentPair.isComplete) {
* // All parts (key, operator, value) are present
* } else {
* // Incomplete - might be missing operator or value
* }
* } else {
* // No current pair, likely at the start of a new condition
* }
* ```
*/
import type { IValidationResult } from '../types/antlrQueryTypes';
export declare function validateQuery(query: string): IValidationResult;
export declare function unquote(str: string): string;
export declare function isQuoted(str: string): boolean;
import type { IQueryPair } from '../types/antlrQueryTypes';
export declare function isKeyToken(tokenType: number): boolean;
export declare function isOperatorToken(tokenType: number): boolean;
export declare function isNonValueOperatorToken(tokenType: number): boolean;
export declare function isValueToken(tokenType: number): boolean;
export declare function isConjunctionToken(tokenType: number): boolean;
export declare function isBracketToken(tokenType: number): boolean;
export declare function isMultiValueOperator(operatorToken?: string): boolean;
export declare function isFunctionToken(tokenType: number): boolean;
export declare function isWrappedUnderQuotes(token: string): boolean;
export declare function isFunctionOperator(operator: string): boolean;
export declare function isNonValueOperator(operator: string): boolean;
export declare function isQueryPairComplete(queryPair: Partial<IQueryPair>): boolean;
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; declare var __VLS_1: {};
type __VLS_Slots = {} & {
title?: (props: typeof __VLS_1) => any;
};
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
export default _default; export default _default;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};
{ {
"name": "argus-board", "name": "argus-board",
"version": "1.0.2", "version": "1.0.3",
"type": "module", "type": "module",
"main": "./dist/argus-board.js", "main": "./dist/argus-board.js",
"module": "./dist/argus-board.es.js", "module": "./dist/argus-board.es.js",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment