@bufbuild/cel-spec
Version:
CEL definitions and test data
311 lines (310 loc) • 10.7 kB
TypeScript
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import type { Decl } from "../checked_pb.js";
import type { FileDescriptorSet, Value } from "@bufbuild/protobuf/wkt";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file cel/expr/conformance/env_config.proto.
*/
export declare const file_cel_expr_conformance_env_config: GenFile;
/**
* Representation of a CEL Environment, defining what features and extensions
* are available for conformance testing.
*
* @generated from message cel.expr.conformance.Environment
*/
export type Environment = Message<"cel.expr.conformance.Environment"> & {
/**
* Name of the environment
*
* @generated from field: string name = 1;
*/
name: string;
/**
* Description for the current environment
*
* @generated from field: string description = 2;
*/
description: string;
/**
* Sets the namespace (container) for the expression.
* This is used to simplify resolution.
* For example with container
* `google.rpc.context`
* an identifier of `google.rpc.context.AttributeContext` could be referred
* to simply as `AttributeContext` in the CEL expression.
*
* @generated from field: string container = 3;
*/
container: string;
/**
* List of abbreviations to be added to the CEL environment
*
* @generated from field: repeated cel.expr.conformance.Environment.Import imports = 4;
*/
imports: Environment_Import[];
/**
* Set of options to subset a subsettable library
*
* @generated from field: cel.expr.conformance.LibrarySubset stdlib = 5;
*/
stdlib?: LibrarySubset;
/**
* List of extensions to enable in the CEL environment.
*
* @generated from field: repeated cel.expr.conformance.Extension extensions = 6;
*/
extensions: Extension[];
/**
* If set, adds a context declaration from a proto message.
*
* Context messages have all of their top-level fields available as variables
* in the type checker.
*
* @generated from field: cel.expr.conformance.Environment.ContextVariable context_variable = 7;
*/
contextVariable?: Environment_ContextVariable;
/**
* List of declarations to be configured in the CEL environment.
*
* Note: The CEL environment can be configured with either the
* context_variable or a set of ident_decls provided as part of declarations.
* Providing both will result in an error.
*
* @generated from field: repeated cel.expr.Decl declarations = 8;
*/
declarations: Decl[];
/**
* List of validators for validating the parsed ast.
*
* @generated from field: repeated cel.expr.conformance.Validator validators = 9;
*/
validators: Validator[];
/**
* List of feature flags to be enabled or disabled.
*
* @generated from field: repeated cel.expr.conformance.Feature features = 10;
*/
features: Feature[];
/**
* Disables including the declarations from the standard CEL environment.
*
* NOTE: Do not disable the standard CEL declarations unless you are aware of
* the implications and have discussed your use case on cel-discuss@
* or with the members of the cel-governance-team@
*
* Deprecated: Use LibrarySubset to disable standard cel declarations instead:
* stdlib = LibrarySubset{ disable: true }
*
* @generated from field: bool disable_standard_cel_declarations = 11;
*/
disableStandardCelDeclarations: boolean;
/**
* If provided, uses the provided FileDescriptorSet to extend types available
* the CEL expression. All "well-known" protobuf messages (google.protobuf.*)
* are known to the CEL compiler, but all others must be provided for type
* checking.
*
* @generated from field: google.protobuf.FileDescriptorSet message_type_extension = 12;
*/
messageTypeExtension?: FileDescriptorSet;
/**
* When macro call tracking is enabled, the resulting SourceInfo in the
* CheckedExpr will contain a collection of expressions representing the
* function calls which were replaced by macros.
*
* Deprecated: Use Feature to enable macro call tracking
* Feature{ name: "cel.feature.macro_call_tracking", enabled: true }
*
* @generated from field: bool enable_macro_call_tracking = 13;
*/
enableMacroCallTracking: boolean;
};
/**
* Describes the message cel.expr.conformance.Environment.
* Use `create(EnvironmentSchema)` to create a new message.
*/
export declare const EnvironmentSchema: GenMessage<Environment>;
/**
* Import represents a type name that will be abbreviated by its simple name
* making it easier to reference simple type names from packages other than
* the expression container.
* For ex:
* Import{name: 'google.rpc.Status'}
* The above import will ensure that `google.rpc.Status` is available by the
* simple name `Status` within CEL expressions.
*
* @generated from message cel.expr.conformance.Environment.Import
*/
export type Environment_Import = Message<"cel.expr.conformance.Environment.Import"> & {
/**
* Qualified type name which will be abbreviated
*
* @generated from field: string name = 1;
*/
name: string;
};
/**
* Describes the message cel.expr.conformance.Environment.Import.
* Use `create(Environment_ImportSchema)` to create a new message.
*/
export declare const Environment_ImportSchema: GenMessage<Environment_Import>;
/**
* ContextVariable represents a message type to be made available as a
* context variable to the CEL environment.
*
* @generated from message cel.expr.conformance.Environment.ContextVariable
*/
export type Environment_ContextVariable = Message<"cel.expr.conformance.Environment.ContextVariable"> & {
/**
* Fully qualified type name of the context proto.
*
* @generated from field: string type_name = 1;
*/
typeName: string;
};
/**
* Describes the message cel.expr.conformance.Environment.ContextVariable.
* Use `create(Environment_ContextVariableSchema)` to create a new message.
*/
export declare const Environment_ContextVariableSchema: GenMessage<Environment_ContextVariable>;
/**
* Represents a named validator with an optional map-based configuration object.
* Naming convention followed by validators:
* <domain>.validator.<validator_name>
* For ex:
* `cel.validator.timestamp`
*
* Note: the map-keys must directly correspond to the internal representation of
* the original validator, and should only use primitive scalar types as values
* at this time.
*
* @generated from message cel.expr.conformance.Validator
*/
export type Validator = Message<"cel.expr.conformance.Validator"> & {
/**
* @generated from field: string name = 1;
*/
name: string;
/**
* Additional configurations to be included as part of the validation
*
* @generated from field: map<string, google.protobuf.Value> config = 2;
*/
config: {
[key: string]: Value;
};
};
/**
* Describes the message cel.expr.conformance.Validator.
* Use `create(ValidatorSchema)` to create a new message.
*/
export declare const ValidatorSchema: GenMessage<Validator>;
/**
* Represents a named boolean feature flag supported by CEL.
* Naming convention followed by features:
* <domain>.feature.<feature_name>
* For ex:
* `cel.feature.cross_type_numeric_comparisons`
*
* @generated from message cel.expr.conformance.Feature
*/
export type Feature = Message<"cel.expr.conformance.Feature"> & {
/**
* Name of the feature flag.
*
* @generated from field: string name = 1;
*/
name: string;
/**
* State of the feature flab.
*
* @generated from field: bool enabled = 2;
*/
enabled: boolean;
};
/**
* Describes the message cel.expr.conformance.Feature.
* Use `create(FeatureSchema)` to create a new message.
*/
export declare const FeatureSchema: GenMessage<Feature>;
/**
* Extension represents a versioned extension library reference to enable in the
* CEL environment.
*
* @generated from message cel.expr.conformance.Extension
*/
export type Extension = Message<"cel.expr.conformance.Extension"> & {
/**
* Name of the extension library.
*
* @generated from field: string name = 1;
*/
name: string;
/**
* Version of the extension library.
*
* @generated from field: string version = 2;
*/
version: string;
};
/**
* Describes the message cel.expr.conformance.Extension.
* Use `create(ExtensionSchema)` to create a new message.
*/
export declare const ExtensionSchema: GenMessage<Extension>;
/**
* LibrarySubset indicates a subset of the macros and functions supported by a
* subsettable library.
*
* @generated from message cel.expr.conformance.LibrarySubset
*/
export type LibrarySubset = Message<"cel.expr.conformance.LibrarySubset"> & {
/**
* Indicates whether the library has been disabled, typically only
* used for default-enabled libraries like stdlib.
*
* @generated from field: bool disabled = 1;
*/
disabled: boolean;
/**
* Disables macros for the given library.
*
* @generated from field: bool disable_macros = 2;
*/
disableMacros: boolean;
/**
* Specifies a set of macro function names to include in the subset.
*
* @generated from field: repeated string include_macros = 3;
*/
includeMacros: string[];
/**
* Specifies a set of macro function names to exclude from the subset.
* Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored.
*
* @generated from field: repeated string exclude_macros = 4;
*/
excludeMacros: string[];
/**
* Specifies a set of functions to include in the subset.
*
* Note: the overloads specified in the subset need only specify their ID.
* Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored.
*
* @generated from field: repeated cel.expr.Decl include_functions = 5;
*/
includeFunctions: Decl[];
/**
* Specifies the set of functions to exclude from the subset.
*
* Note: the overloads specified in the subset need only specify their ID.
*
* @generated from field: repeated cel.expr.Decl exclude_functions = 6;
*/
excludeFunctions: Decl[];
};
/**
* Describes the message cel.expr.conformance.LibrarySubset.
* Use `create(LibrarySubsetSchema)` to create a new message.
*/
export declare const LibrarySubsetSchema: GenMessage<LibrarySubset>;