@bufbuild/cel-spec
Version:
CEL definitions and test data
364 lines (363 loc) • 11.6 kB
TypeScript
import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import type { CheckedExpr, Decl } from "../checked_pb.js";
import type { ExprValue } from "../eval_pb.js";
import type { ParsedExpr } from "../syntax_pb.js";
import type { Status } from "../../../google/rpc/status_pb.js";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file cel/expr/conformance/conformance_service.proto.
*/
export declare const file_cel_expr_conformance_conformance_service: GenFile;
/**
* Request message for the Parse method.
*
* @generated from message cel.expr.conformance.ParseRequest
*/
export type ParseRequest = Message<"cel.expr.conformance.ParseRequest"> & {
/**
* Required. Source text in CEL syntax.
*
* @generated from field: string cel_source = 1;
*/
celSource: string;
/**
* Tag for version of CEL syntax, for future use.
*
* @generated from field: string syntax_version = 2;
*/
syntaxVersion: string;
/**
* File or resource for source text, used in [SourceInfo][google.api.SourceInfo].
*
* @generated from field: string source_location = 3;
*/
sourceLocation: string;
/**
* Prevent macro expansion. See "Macros" in Language Defiinition.
*
* @generated from field: bool disable_macros = 4;
*/
disableMacros: boolean;
};
/**
* Describes the message cel.expr.conformance.ParseRequest.
* Use `create(ParseRequestSchema)` to create a new message.
*/
export declare const ParseRequestSchema: GenMessage<ParseRequest>;
/**
* Response message for the Parse method.
*
* @generated from message cel.expr.conformance.ParseResponse
*/
export type ParseResponse = Message<"cel.expr.conformance.ParseResponse"> & {
/**
* The parsed representation, or unset if parsing failed.
*
* @generated from field: cel.expr.ParsedExpr parsed_expr = 1;
*/
parsedExpr?: ParsedExpr;
/**
* Any number of issues with [StatusDetails][] as the details.
*
* @generated from field: repeated google.rpc.Status issues = 2;
*/
issues: Status[];
};
/**
* Describes the message cel.expr.conformance.ParseResponse.
* Use `create(ParseResponseSchema)` to create a new message.
*/
export declare const ParseResponseSchema: GenMessage<ParseResponse>;
/**
* Request message for the Check method.
*
* @generated from message cel.expr.conformance.CheckRequest
*/
export type CheckRequest = Message<"cel.expr.conformance.CheckRequest"> & {
/**
* Required. The parsed representation of the CEL program.
*
* @generated from field: cel.expr.ParsedExpr parsed_expr = 1;
*/
parsedExpr?: ParsedExpr;
/**
* Declarations of types for external variables and functions.
* Required if program uses external variables or functions
* not in the default environment.
*
* @generated from field: repeated cel.expr.Decl type_env = 2;
*/
typeEnv: Decl[];
/**
* The protocol buffer context. See "Name Resolution" in the
* Language Definition.
*
* @generated from field: string container = 3;
*/
container: string;
/**
* If true, use only the declarations in [type_env][google.api.expr.conformance.v1alpha1.CheckRequest.type_env]. If false (default),
* add declarations for the standard definitions to the type environment. See
* "Standard Definitions" in the Language Definition.
*
* @generated from field: bool no_std_env = 4;
*/
noStdEnv: boolean;
};
/**
* Describes the message cel.expr.conformance.CheckRequest.
* Use `create(CheckRequestSchema)` to create a new message.
*/
export declare const CheckRequestSchema: GenMessage<CheckRequest>;
/**
* Response message for the Check method.
*
* @generated from message cel.expr.conformance.CheckResponse
*/
export type CheckResponse = Message<"cel.expr.conformance.CheckResponse"> & {
/**
* The annotated representation, or unset if checking failed.
*
* @generated from field: cel.expr.CheckedExpr checked_expr = 1;
*/
checkedExpr?: CheckedExpr;
/**
* Any number of issues with [StatusDetails][] as the details.
*
* @generated from field: repeated google.rpc.Status issues = 2;
*/
issues: Status[];
};
/**
* Describes the message cel.expr.conformance.CheckResponse.
* Use `create(CheckResponseSchema)` to create a new message.
*/
export declare const CheckResponseSchema: GenMessage<CheckResponse>;
/**
* Request message for the Eval method.
*
* @generated from message cel.expr.conformance.EvalRequest
*/
export type EvalRequest = Message<"cel.expr.conformance.EvalRequest"> & {
/**
* Required. Either the parsed or annotated representation of the CEL program.
*
* @generated from oneof cel.expr.conformance.EvalRequest.expr_kind
*/
exprKind: {
/**
* Evaluate based on the parsed representation.
*
* @generated from field: cel.expr.ParsedExpr parsed_expr = 1;
*/
value: ParsedExpr;
case: "parsedExpr";
} | {
/**
* Evaluate based on the checked representation.
*
* @generated from field: cel.expr.CheckedExpr checked_expr = 2;
*/
value: CheckedExpr;
case: "checkedExpr";
} | {
case: undefined;
value?: undefined;
};
/**
* Bindings for the external variables. The types SHOULD be compatible
* with the type environment in [CheckRequest][google.api.expr.conformance.v1alpha1.CheckRequest], if checked.
*
* @generated from field: map<string, cel.expr.ExprValue> bindings = 3;
*/
bindings: {
[key: string]: ExprValue;
};
/**
* SHOULD be the same container as used in [CheckRequest][google.api.expr.conformance.v1alpha1.CheckRequest], if checked.
*
* @generated from field: string container = 4;
*/
container: string;
};
/**
* Describes the message cel.expr.conformance.EvalRequest.
* Use `create(EvalRequestSchema)` to create a new message.
*/
export declare const EvalRequestSchema: GenMessage<EvalRequest>;
/**
* Response message for the Eval method.
*
* @generated from message cel.expr.conformance.EvalResponse
*/
export type EvalResponse = Message<"cel.expr.conformance.EvalResponse"> & {
/**
* The execution result, or unset if execution couldn't start.
*
* @generated from field: cel.expr.ExprValue result = 1;
*/
result?: ExprValue;
/**
* Any number of issues with [StatusDetails][] as the details.
* Note that CEL execution errors are reified into [ExprValue][].
* Nevertheless, we'll allow out-of-band issues to be raised,
* which also makes the replies more regular.
*
* @generated from field: repeated google.rpc.Status issues = 2;
*/
issues: Status[];
};
/**
* Describes the message cel.expr.conformance.EvalResponse.
* Use `create(EvalResponseSchema)` to create a new message.
*/
export declare const EvalResponseSchema: GenMessage<EvalResponse>;
/**
* A specific position in source.
*
* @generated from message cel.expr.conformance.SourcePosition
*/
export type SourcePosition = Message<"cel.expr.conformance.SourcePosition"> & {
/**
* The source location name (e.g. file name).
*
* @generated from field: string location = 1;
*/
location: string;
/**
* The UTF-8 code unit offset.
*
* @generated from field: int32 offset = 2;
*/
offset: number;
/**
* The 1-based index of the starting line in the source text
* where the issue occurs, or 0 if unknown.
*
* @generated from field: int32 line = 3;
*/
line: number;
/**
* The 0-based index of the starting position within the line of source text
* where the issue occurs. Only meaningful if line is nonzero.
*
* @generated from field: int32 column = 4;
*/
column: number;
};
/**
* Describes the message cel.expr.conformance.SourcePosition.
* Use `create(SourcePositionSchema)` to create a new message.
*/
export declare const SourcePositionSchema: GenMessage<SourcePosition>;
/**
* Warnings or errors in service execution are represented by
* [google.rpc.Status][google.rpc.Status] messages, with the following message
* in the details field.
*
* @generated from message cel.expr.conformance.IssueDetails
*/
export type IssueDetails = Message<"cel.expr.conformance.IssueDetails"> & {
/**
* The severity of the issue.
*
* @generated from field: cel.expr.conformance.IssueDetails.Severity severity = 1;
*/
severity: IssueDetails_Severity;
/**
* Position in the source, if known.
*
* @generated from field: cel.expr.conformance.SourcePosition position = 2;
*/
position?: SourcePosition;
/**
* Expression ID from [Expr][], 0 if unknown.
*
* @generated from field: int64 id = 3;
*/
id: bigint;
};
/**
* Describes the message cel.expr.conformance.IssueDetails.
* Use `create(IssueDetailsSchema)` to create a new message.
*/
export declare const IssueDetailsSchema: GenMessage<IssueDetails>;
/**
* Severities of issues.
*
* @generated from enum cel.expr.conformance.IssueDetails.Severity
*/
export declare enum IssueDetails_Severity {
/**
* An unspecified severity.
*
* @generated from enum value: SEVERITY_UNSPECIFIED = 0;
*/
SEVERITY_UNSPECIFIED = 0,
/**
* Deprecation issue for statements and method that may no longer be
* supported or maintained.
*
* @generated from enum value: DEPRECATION = 1;
*/
DEPRECATION = 1,
/**
* Warnings such as: unused variables.
*
* @generated from enum value: WARNING = 2;
*/
WARNING = 2,
/**
* Errors such as: unmatched curly braces or variable redefinition.
*
* @generated from enum value: ERROR = 3;
*/
ERROR = 3
}
/**
* Describes the enum cel.expr.conformance.IssueDetails.Severity.
*/
export declare const IssueDetails_SeveritySchema: GenEnum<IssueDetails_Severity>;
/**
* Access a CEL implementation from another process or machine.
* A CEL implementation is decomposed as a parser, a static checker,
* and an evaluator. Every CEL implementation is expected to provide
* a server for this API. The API will be used for conformance testing
* and other utilities.
*
* @generated from service cel.expr.conformance.ConformanceService
*/
export declare const ConformanceService: GenService<{
/**
* Transforms CEL source text into a parsed representation.
*
* @generated from rpc cel.expr.conformance.ConformanceService.Parse
*/
parse: {
methodKind: "unary";
input: typeof ParseRequestSchema;
output: typeof ParseResponseSchema;
};
/**
* Runs static checks on a parsed CEL representation and return
* an annotated representation, or a set of issues.
*
* @generated from rpc cel.expr.conformance.ConformanceService.Check
*/
check: {
methodKind: "unary";
input: typeof CheckRequestSchema;
output: typeof CheckResponseSchema;
};
/**
* Evaluates a parsed or annotation CEL representation given
* values of external bindings.
*
* @generated from rpc cel.expr.conformance.ConformanceService.Eval
*/
eval: {
methodKind: "unary";
input: typeof EvalRequestSchema;
output: typeof EvalResponseSchema;
};
}>;