Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: backend for batch CELs (#8475)
Danny Xua697f87475d6
diff --git a/backend/api/v1/cel_service.go b/backend/api/v1/cel_service.goindex b56465e83a..256169a2f7 100644--- a/backend/api/v1/cel_service.go+++ b/backend/api/v1/cel_service.go@@ -41,6 +41,27 @@ func (*CelService) Parse(_ context.Context, request *v1pb.ParseRequest) (*v1pb.P}, nil}+// Parse parses a CEL expression.+func (*CelService) BatchParse(_ context.Context, request *v1pb.BatchParseRequest) (*v1pb.BatchParseResponse, error) {+ e, err := cel.NewEnv(common.QueryExportPolicyCELAttributes...)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to create CEL environment: %v", err)+ }+ resp := &v1pb.BatchParseResponse{}+ for _, expression := range request.Expressions {+ ast, issues := e.Parse(expression)+ if issues != nil && issues.Err() != nil {+ return nil, status.Errorf(codes.InvalidArgument, "failed to parse expression: %v", issues.Err())+ }+ expr, err := cel.AstToParsedExpr(ast)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to convert ast to parsed expression: %v", err)+ }+ resp.Expressions = append(resp.Expressions, expr)+ }+ return resp, nil+}+// Deparse deparses a parsed CEL expression.func (*CelService) Deparse(_ context.Context, request *v1pb.DeparseRequest) (*v1pb.DeparseResponse, error) {ast := cel.ParsedExprToAst(request.Expression)@@ -52,3 +73,17 @@ func (*CelService) Deparse(_ context.Context, request *v1pb.DeparseRequest) (*v1Expression: expressionStr,}, nil}++// Deparse deparses a parsed CEL expression.+func (*CelService) BatchDeparse(_ context.Context, request *v1pb.BatchDeparseRequest) (*v1pb.BatchDeparseResponse, error) {+ resp := &v1pb.BatchDeparseResponse{}+ for _, expression := range request.Expressions {+ ast := cel.ParsedExprToAst(expression)+ expressionStr, err := cel.AstToString(ast)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, "failed to deparse expression: %v", err)+ }+ resp.Expressions = append(resp.Expressions, expressionStr)+ }+ return resp, nil+}diff --git a/frontend/src/types/proto/v1/cel_service.ts b/frontend/src/types/proto/v1/cel_service.tsindex bc3edfb922..bf65fefdc7 100644--- a/frontend/src/types/proto/v1/cel_service.ts+++ b/frontend/src/types/proto/v1/cel_service.ts@@ -8,18 +8,34 @@ export interface ParseRequest {expression: string;}+export interface BatchParseRequest {+ expressions: string[];+}+export interface ParseResponse {expression: ParsedExpr | undefined;}+export interface BatchParseResponse {+ expressions: ParsedExpr[];+}+export interface DeparseRequest {expression: ParsedExpr | undefined;}+export interface BatchDeparseRequest {+ expressions: ParsedExpr[];+}+export interface DeparseResponse {expression: string;}+export interface BatchDeparseResponse {+ expressions: string[];+}+function createBaseParseRequest(): ParseRequest {return { expression: "" };}@@ -76,6 +92,66 @@ export const ParseRequest = {},};+function createBaseBatchParseRequest(): BatchParseRequest {+ return { expressions: [] };+}++export const BatchParseRequest = {+ encode(message: BatchParseRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.expressions) {+ writer.uint32(10).string(v!);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): BatchParseRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseBatchParseRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.expressions.push(reader.string());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): BatchParseRequest {+ return { expressions: Array.isArray(object?.expressions) ? object.expressions.map((e: any) => String(e)) : [] };+ },++ toJSON(message: BatchParseRequest): unknown {+ const obj: any = {};+ if (message.expressions) {+ obj.expressions = message.expressions.map((e) => e);+ } else {+ obj.expressions = [];+ }+ return obj;+ },++ create(base?: DeepPartial<BatchParseRequest>): BatchParseRequest {+ return BatchParseRequest.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<BatchParseRequest>): BatchParseRequest {+ const message = createBaseBatchParseRequest();+ message.expressions = object.expressions?.map((e) => e) || [];+ return message;+ },+};+function createBaseParseResponse(): ParseResponse {return { expression: undefined };}@@ -135,6 +211,68 @@ export const ParseResponse = {},};+function createBaseBatchParseResponse(): BatchParseResponse {+ return { expressions: [] };+}++export const BatchParseResponse = {+ encode(message: BatchParseResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.expressions) {+ ParsedExpr.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): BatchParseResponse {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseBatchParseResponse();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.expressions.push(ParsedExpr.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): BatchParseResponse {+ return {+ expressions: Array.isArray(object?.expressions) ? object.expressions.map((e: any) => ParsedExpr.fromJSON(e)) : [],+ };+ },++ toJSON(message: BatchParseResponse): unknown {+ const obj: any = {};+ if (message.expressions) {+ obj.expressions = message.expressions.map((e) => e ? ParsedExpr.toJSON(e) : undefined);+ } else {+ obj.expressions = [];+ }+ return obj;+ },++ create(base?: DeepPartial<BatchParseResponse>): BatchParseResponse {+ return BatchParseResponse.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<BatchParseResponse>): BatchParseResponse {+ const message = createBaseBatchParseResponse();+ message.expressions = object.expressions?.map((e) => ParsedExpr.fromPartial(e)) || [];+ return message;+ },+};+function createBaseDeparseRequest(): DeparseRequest {return { expression: undefined };}@@ -194,6 +332,68 @@ export const DeparseRequest = {},};+function createBaseBatchDeparseRequest(): BatchDeparseRequest {+ return { expressions: [] };+}++export const BatchDeparseRequest = {+ encode(message: BatchDeparseRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.expressions) {+ ParsedExpr.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): BatchDeparseRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseBatchDeparseRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.expressions.push(ParsedExpr.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): BatchDeparseRequest {+ return {+ expressions: Array.isArray(object?.expressions) ? object.expressions.map((e: any) => ParsedExpr.fromJSON(e)) : [],+ };+ },++ toJSON(message: BatchDeparseRequest): unknown {+ const obj: any = {};+ if (message.expressions) {+ obj.expressions = message.expressions.map((e) => e ? ParsedExpr.toJSON(e) : undefined);+ } else {+ obj.expressions = [];+ }+ return obj;+ },++ create(base?: DeepPartial<BatchDeparseRequest>): BatchDeparseRequest {+ return BatchDeparseRequest.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<BatchDeparseRequest>): BatchDeparseRequest {+ const message = createBaseBatchDeparseRequest();+ message.expressions = object.expressions?.map((e) => ParsedExpr.fromPartial(e)) || [];+ return message;+ },+};+function createBaseDeparseResponse(): DeparseResponse {return { expression: "" };}@@ -250,6 +450,66 @@ export const DeparseResponse = {},};+function createBaseBatchDeparseResponse(): BatchDeparseResponse {+ return { expressions: [] };+}++export const BatchDeparseResponse = {+ encode(message: BatchDeparseResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.expressions) {+ writer.uint32(10).string(v!);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): BatchDeparseResponse {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseBatchDeparseResponse();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.expressions.push(reader.string());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): BatchDeparseResponse {+ return { expressions: Array.isArray(object?.expressions) ? object.expressions.map((e: any) => String(e)) : [] };+ },++ toJSON(message: BatchDeparseResponse): unknown {+ const obj: any = {};+ if (message.expressions) {+ obj.expressions = message.expressions.map((e) => e);+ } else {+ obj.expressions = [];+ }+ return obj;+ },++ create(base?: DeepPartial<BatchDeparseResponse>): BatchDeparseResponse {+ return BatchDeparseResponse.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<BatchDeparseResponse>): BatchDeparseResponse {+ const message = createBaseBatchDeparseResponse();+ message.expressions = object.expressions?.map((e) => e) || [];+ return message;+ },+};+export type CelServiceDefinition = typeof CelServiceDefinition;export const CelServiceDefinition = {name: "CelService",@@ -269,22 +529,22 @@ export const CelServiceDefinition = {},},},- deparse: {- name: "Deparse",- requestType: DeparseRequest,+ batchParse: {+ name: "BatchParse",+ requestType: BatchParseRequest,requestStream: false,- responseType: DeparseResponse,+ responseType: BatchParseResponse,responseStream: false,options: {_unknownFields: {578365826: [new Uint8Array([- 20,+ 23,58,1,42,34,- 15,+ 18,47,118,49,@@ -293,7 +553,51 @@ export const CelServiceDefinition = {101,108,47,- 100,+ 98,+ 97,+ 116,+ 99,+ 104,+ 80,+ 97,+ 114,+ 115,+ 101,+ ]),+ ],+ },+ },+ },+ batchDeparse: {+ name: "BatchDeparse",+ requestType: BatchDeparseRequest,+ requestStream: false,+ responseType: BatchDeparseResponse,+ responseStream: false,+ options: {+ _unknownFields: {+ 578365826: [+ new Uint8Array([+ 25,+ 58,+ 1,+ 42,+ 34,+ 20,+ 47,+ 118,+ 49,+ 47,+ 99,+ 101,+ 108,+ 47,+ 98,+ 97,+ 116,+ 99,+ 104,+ 68,101,112,97,diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 858856b521..2823d0c58e 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -105,6 +105,10 @@- [BookmarkService](#bytebase-v1-BookmarkService)- [v1/cel_service.proto](#v1_cel_service-proto)+ - [BatchDeparseRequest](#bytebase-v1-BatchDeparseRequest)+ - [BatchDeparseResponse](#bytebase-v1-BatchDeparseResponse)+ - [BatchParseRequest](#bytebase-v1-BatchParseRequest)+ - [BatchParseResponse](#bytebase-v1-BatchParseResponse)- [DeparseRequest](#bytebase-v1-DeparseRequest)- [DeparseResponse](#bytebase-v1-DeparseResponse)- [ParseRequest](#bytebase-v1-ParseRequest)@@ -2032,6 +2036,66 @@ When paginating, all other parameters provided to `ListBookmarks` must match the+<a name="bytebase-v1-BatchDeparseRequest"></a>++### BatchDeparseRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| expressions | [google.api.expr.v1alpha1.ParsedExpr](#google-api-expr-v1alpha1-ParsedExpr) | repeated | |+++++++<a name="bytebase-v1-BatchDeparseResponse"></a>++### BatchDeparseResponse++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| expressions | [string](#string) | repeated | |+++++++<a name="bytebase-v1-BatchParseRequest"></a>++### BatchParseRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| expressions | [string](#string) | repeated | |+++++++<a name="bytebase-v1-BatchParseResponse"></a>++### BatchParseResponse++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| expressions | [google.api.expr.v1alpha1.ParsedExpr](#google-api-expr-v1alpha1-ParsedExpr) | repeated | |++++++<a name="bytebase-v1-DeparseRequest"></a>### DeparseRequest@@ -2106,7 +2170,8 @@ When paginating, all other parameters provided to `ListBookmarks` must match the| Method Name | Request Type | Response Type | Description || ----------- | ------------ | ------------- | ------------|| Parse | [ParseRequest](#bytebase-v1-ParseRequest) | [ParseResponse](#bytebase-v1-ParseResponse) | |-| Deparse | [DeparseRequest](#bytebase-v1-DeparseRequest) | [DeparseResponse](#bytebase-v1-DeparseResponse) | |+| BatchParse | [BatchParseRequest](#bytebase-v1-BatchParseRequest) | [BatchParseResponse](#bytebase-v1-BatchParseResponse) | |+| BatchDeparse | [BatchDeparseRequest](#bytebase-v1-BatchDeparseRequest) | [BatchDeparseResponse](#bytebase-v1-BatchDeparseResponse) | |diff --git a/proto/generated-go/v1/cel_service.pb.go b/proto/generated-go/v1/cel_service.pb.goindex d615f4c0cc..a84016fbd7 100644--- a/proto/generated-go/v1/cel_service.pb.go+++ b/proto/generated-go/v1/cel_service.pb.go@@ -69,6 +69,53 @@ func (x *ParseRequest) GetExpression() string {return ""}+type BatchParseRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Expressions []string `protobuf:"bytes,1,rep,name=expressions,proto3" json:"expressions,omitempty"`+}++func (x *BatchParseRequest) Reset() {+ *x = BatchParseRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_cel_service_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *BatchParseRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*BatchParseRequest) ProtoMessage() {}++func (x *BatchParseRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_cel_service_proto_msgTypes[1]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use BatchParseRequest.ProtoReflect.Descriptor instead.+func (*BatchParseRequest) Descriptor() ([]byte, []int) {+ return file_v1_cel_service_proto_rawDescGZIP(), []int{1}+}++func (x *BatchParseRequest) GetExpressions() []string {+ if x != nil {+ return x.Expressions+ }+ return nil+}+type ParseResponse struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -80,7 +127,7 @@ type ParseResponse struct {func (x *ParseResponse) Reset() {*x = ParseResponse{}if protoimpl.UnsafeEnabled {- mi := &file_v1_cel_service_proto_msgTypes[1]+ mi := &file_v1_cel_service_proto_msgTypes[2]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -93,7 +140,7 @@ func (x *ParseResponse) String() string {func (*ParseResponse) ProtoMessage() {}func (x *ParseResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_cel_service_proto_msgTypes[1]+ mi := &file_v1_cel_service_proto_msgTypes[2]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -106,7 +153,7 @@ func (x *ParseResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use ParseResponse.ProtoReflect.Descriptor instead.func (*ParseResponse) Descriptor() ([]byte, []int) {- return file_v1_cel_service_proto_rawDescGZIP(), []int{1}+ return file_v1_cel_service_proto_rawDescGZIP(), []int{2}}func (x *ParseResponse) GetExpression() *v1alpha1.ParsedExpr {@@ -116,6 +163,53 @@ func (x *ParseResponse) GetExpression() *v1alpha1.ParsedExpr {return nil}+type BatchParseResponse struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Expressions []*v1alpha1.ParsedExpr `protobuf:"bytes,1,rep,name=expressions,proto3" json:"expressions,omitempty"`+}++func (x *BatchParseResponse) Reset() {+ *x = BatchParseResponse{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_cel_service_proto_msgTypes[3]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *BatchParseResponse) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*BatchParseResponse) ProtoMessage() {}++func (x *BatchParseResponse) ProtoReflect() protoreflect.Message {+ mi := &file_v1_cel_service_proto_msgTypes[3]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use BatchParseResponse.ProtoReflect.Descriptor instead.+func (*BatchParseResponse) Descriptor() ([]byte, []int) {+ return file_v1_cel_service_proto_rawDescGZIP(), []int{3}+}++func (x *BatchParseResponse) GetExpressions() []*v1alpha1.ParsedExpr {+ if x != nil {+ return x.Expressions+ }+ return nil+}+type DeparseRequest struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -127,7 +221,7 @@ type DeparseRequest struct {func (x *DeparseRequest) Reset() {*x = DeparseRequest{}if protoimpl.UnsafeEnabled {- mi := &file_v1_cel_service_proto_msgTypes[2]+ mi := &file_v1_cel_service_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -140,7 +234,7 @@ func (x *DeparseRequest) String() string {func (*DeparseRequest) ProtoMessage() {}func (x *DeparseRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_cel_service_proto_msgTypes[2]+ mi := &file_v1_cel_service_proto_msgTypes[4]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -153,7 +247,7 @@ func (x *DeparseRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use DeparseRequest.ProtoReflect.Descriptor instead.func (*DeparseRequest) Descriptor() ([]byte, []int) {- return file_v1_cel_service_proto_rawDescGZIP(), []int{2}+ return file_v1_cel_service_proto_rawDescGZIP(), []int{4}}func (x *DeparseRequest) GetExpression() *v1alpha1.ParsedExpr {@@ -163,6 +257,53 @@ func (x *DeparseRequest) GetExpression() *v1alpha1.ParsedExpr {return nil}+type BatchDeparseRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Expressions []*v1alpha1.ParsedExpr `protobuf:"bytes,1,rep,name=expressions,proto3" json:"expressions,omitempty"`+}++func (x *BatchDeparseRequest) Reset() {+ *x = BatchDeparseRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_cel_service_proto_msgTypes[5]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *BatchDeparseRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*BatchDeparseRequest) ProtoMessage() {}++func (x *BatchDeparseRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_cel_service_proto_msgTypes[5]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use BatchDeparseRequest.ProtoReflect.Descriptor instead.+func (*BatchDeparseRequest) Descriptor() ([]byte, []int) {+ return file_v1_cel_service_proto_rawDescGZIP(), []int{5}+}++func (x *BatchDeparseRequest) GetExpressions() []*v1alpha1.ParsedExpr {+ if x != nil {+ return x.Expressions+ }+ return nil+}+type DeparseResponse struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -174,7 +315,7 @@ type DeparseResponse struct {func (x *DeparseResponse) Reset() {*x = DeparseResponse{}if protoimpl.UnsafeEnabled {- mi := &file_v1_cel_service_proto_msgTypes[3]+ mi := &file_v1_cel_service_proto_msgTypes[6]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -187,7 +328,7 @@ func (x *DeparseResponse) String() string {func (*DeparseResponse) ProtoMessage() {}func (x *DeparseResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_cel_service_proto_msgTypes[3]+ mi := &file_v1_cel_service_proto_msgTypes[6]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -200,7 +341,7 @@ func (x *DeparseResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use DeparseResponse.ProtoReflect.Descriptor instead.func (*DeparseResponse) Descriptor() ([]byte, []int) {- return file_v1_cel_service_proto_rawDescGZIP(), []int{3}+ return file_v1_cel_service_proto_rawDescGZIP(), []int{6}}func (x *DeparseResponse) GetExpression() string {@@ -210,6 +351,53 @@ func (x *DeparseResponse) GetExpression() string {return ""}+type BatchDeparseResponse struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Expressions []string `protobuf:"bytes,1,rep,name=expressions,proto3" json:"expressions,omitempty"`+}++func (x *BatchDeparseResponse) Reset() {+ *x = BatchDeparseResponse{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_cel_service_proto_msgTypes[7]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *BatchDeparseResponse) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*BatchDeparseResponse) ProtoMessage() {}++func (x *BatchDeparseResponse) ProtoReflect() protoreflect.Message {+ mi := &file_v1_cel_service_proto_msgTypes[7]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use BatchDeparseResponse.ProtoReflect.Descriptor instead.+func (*BatchDeparseResponse) Descriptor() ([]byte, []int) {+ return file_v1_cel_service_proto_rawDescGZIP(), []int{7}+}++func (x *BatchDeparseResponse) GetExpressions() []string {+ if x != nil {+ return x.Expressions+ }+ return nil+}+var File_v1_cel_service_proto protoreflect.FileDescriptorvar file_v1_cel_service_proto_rawDesc = []byte{@@ -222,33 +410,60 @@ var file_v1_cel_service_proto_rawDesc = []byte{0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x73,0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72,0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78,- 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73,- 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x78, 0x70,- 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,- 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45,- 0x78, 0x70, 0x72, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22,- 0x56, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,- 0x74, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18,- 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,- 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,- 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0a, 0x65, 0x78, 0x70,- 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x31, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x61, 0x72,- 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78,- 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,- 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0xc8, 0x01, 0x0a, 0x0a, 0x43,- 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x05, 0x50, 0x61, 0x72,- 0x73, 0x65, 0x12, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,- 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73,- 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02,- 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x65, 0x6c, 0x2f, 0x70, 0x61,- 0x72, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x12, 0x1b,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70,- 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x79,- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73,- 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02,- 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x65, 0x6c, 0x2f, 0x64, 0x65,+ 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63,+ 0x68, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a,+ 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03,+ 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22,+ 0x55, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,+ 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70,+ 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e,+ 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72,+ 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x63, 0x68, 0x50,+ 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b,+ 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,+ 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65,+ 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72,+ 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73,+ 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x56, 0x0a, 0x0e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73,+ 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f,+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61,+ 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72,+ 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x13,+ 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75,+ 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f,+ 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,+ 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70,+ 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0b,+ 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x31, 0x0a, 0x0f, 0x44,+ 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e,+ 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x38,+ 0x0a, 0x14, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65,+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73,+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70,+ 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xca, 0x02, 0x0a, 0x0a, 0x43, 0x65, 0x6c,+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65,+ 0x12, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50,+ 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52,+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a,+ 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x65, 0x6c, 0x2f, 0x70, 0x61, 0x72, 0x73,+ 0x65, 0x12, 0x6c, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12,+ 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61,+ 0x74, 0x63, 0x68, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,+ 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61,+ 0x74, 0x63, 0x68, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,+ 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31,+ 0x2f, 0x63, 0x65, 0x6c, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12,+ 0x74, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x12,+ 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61,+ 0x74, 0x63, 0x68, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,+ 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,+ 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70,+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22,+ 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x65, 0x6c, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65,0x70, 0x61, 0x72, 0x73, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,}@@ -265,26 +480,34 @@ func file_v1_cel_service_proto_rawDescGZIP() []byte {return file_v1_cel_service_proto_rawDescData}-var file_v1_cel_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)+var file_v1_cel_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)var file_v1_cel_service_proto_goTypes = []interface{}{- (*ParseRequest)(nil), // 0: bytebase.v1.ParseRequest- (*ParseResponse)(nil), // 1: bytebase.v1.ParseResponse- (*DeparseRequest)(nil), // 2: bytebase.v1.DeparseRequest- (*DeparseResponse)(nil), // 3: bytebase.v1.DeparseResponse- (*v1alpha1.ParsedExpr)(nil), // 4: google.api.expr.v1alpha1.ParsedExpr+ (*ParseRequest)(nil), // 0: bytebase.v1.ParseRequest+ (*BatchParseRequest)(nil), // 1: bytebase.v1.BatchParseRequest+ (*ParseResponse)(nil), // 2: bytebase.v1.ParseResponse+ (*BatchParseResponse)(nil), // 3: bytebase.v1.BatchParseResponse+ (*DeparseRequest)(nil), // 4: bytebase.v1.DeparseRequest+ (*BatchDeparseRequest)(nil), // 5: bytebase.v1.BatchDeparseRequest+ (*DeparseResponse)(nil), // 6: bytebase.v1.DeparseResponse+ (*BatchDeparseResponse)(nil), // 7: bytebase.v1.BatchDeparseResponse+ (*v1alpha1.ParsedExpr)(nil), // 8: google.api.expr.v1alpha1.ParsedExpr}var file_v1_cel_service_proto_depIdxs = []int32{- 4, // 0: bytebase.v1.ParseResponse.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr- 4, // 1: bytebase.v1.DeparseRequest.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr- 0, // 2: bytebase.v1.CelService.Parse:input_type -> bytebase.v1.ParseRequest- 2, // 3: bytebase.v1.CelService.Deparse:input_type -> bytebase.v1.DeparseRequest- 1, // 4: bytebase.v1.CelService.Parse:output_type -> bytebase.v1.ParseResponse- 3, // 5: bytebase.v1.CelService.Deparse:output_type -> bytebase.v1.DeparseResponse- 4, // [4:6] is the sub-list for method output_type- 2, // [2:4] is the sub-list for method input_type- 2, // [2:2] is the sub-list for extension type_name- 2, // [2:2] is the sub-list for extension extendee- 0, // [0:2] is the sub-list for field type_name+ 8, // 0: bytebase.v1.ParseResponse.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 8, // 1: bytebase.v1.BatchParseResponse.expressions:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 8, // 2: bytebase.v1.DeparseRequest.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 8, // 3: bytebase.v1.BatchDeparseRequest.expressions:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 0, // 4: bytebase.v1.CelService.Parse:input_type -> bytebase.v1.ParseRequest+ 1, // 5: bytebase.v1.CelService.BatchParse:input_type -> bytebase.v1.BatchParseRequest+ 5, // 6: bytebase.v1.CelService.BatchDeparse:input_type -> bytebase.v1.BatchDeparseRequest+ 2, // 7: bytebase.v1.CelService.Parse:output_type -> bytebase.v1.ParseResponse+ 3, // 8: bytebase.v1.CelService.BatchParse:output_type -> bytebase.v1.BatchParseResponse+ 7, // 9: bytebase.v1.CelService.BatchDeparse:output_type -> bytebase.v1.BatchDeparseResponse+ 7, // [7:10] is the sub-list for method output_type+ 4, // [4:7] is the sub-list for method input_type+ 4, // [4:4] is the sub-list for extension type_name+ 4, // [4:4] is the sub-list for extension extendee+ 0, // [0:4] is the sub-list for field type_name}func init() { file_v1_cel_service_proto_init() }@@ -306,7 +529,7 @@ func file_v1_cel_service_proto_init() {}}file_v1_cel_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*ParseResponse); i {+ switch v := v.(*BatchParseRequest); i {case 0:return &v.statecase 1:@@ -318,7 +541,7 @@ func file_v1_cel_service_proto_init() {}}file_v1_cel_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*DeparseRequest); i {+ switch v := v.(*ParseResponse); i {case 0:return &v.statecase 1:@@ -330,6 +553,42 @@ func file_v1_cel_service_proto_init() {}}file_v1_cel_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*BatchParseResponse); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_cel_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*DeparseRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_cel_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*BatchDeparseRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_cel_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*DeparseResponse); i {case 0:return &v.state@@ -341,6 +600,18 @@ func file_v1_cel_service_proto_init() {return nil}}+ file_v1_cel_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*BatchDeparseResponse); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }}type x struct{}out := protoimpl.TypeBuilder{@@ -348,7 +619,7 @@ func file_v1_cel_service_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_v1_cel_service_proto_rawDesc,NumEnums: 0,- NumMessages: 4,+ NumMessages: 8,NumExtensions: 0,NumServices: 1,},diff --git a/proto/generated-go/v1/cel_service.pb.gw.go b/proto/generated-go/v1/cel_service.pb.gw.goindex 5a4ef6b948..ca4fb47ea9 100644--- a/proto/generated-go/v1/cel_service.pb.gw.go+++ b/proto/generated-go/v1/cel_service.pb.gw.go@@ -65,8 +65,8 @@ func local_request_CelService_Parse_0(ctx context.Context, marshaler runtime.Mar}-func request_CelService_Deparse_0(ctx context.Context, marshaler runtime.Marshaler, client CelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq DeparseRequest+func request_CelService_BatchParse_0(ctx context.Context, marshaler runtime.Marshaler, client CelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq BatchParseRequestvar metadata runtime.ServerMetadatanewReader, berr := utilities.IOReaderFactory(req.Body)@@ -77,13 +77,13 @@ func request_CelService_Deparse_0(ctx context.Context, marshaler runtime.Marshalreturn nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)}- msg, err := client.Deparse(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ msg, err := client.BatchParse(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))return msg, metadata, err}-func local_request_CelService_Deparse_0(ctx context.Context, marshaler runtime.Marshaler, server CelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {- var protoReq DeparseRequest+func local_request_CelService_BatchParse_0(ctx context.Context, marshaler runtime.Marshaler, server CelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq BatchParseRequestvar metadata runtime.ServerMetadatanewReader, berr := utilities.IOReaderFactory(req.Body)@@ -94,7 +94,41 @@ func local_request_CelService_Deparse_0(ctx context.Context, marshaler runtime.Mreturn nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)}- msg, err := server.Deparse(ctx, &protoReq)+ msg, err := server.BatchParse(ctx, &protoReq)+ return msg, metadata, err++}++func request_CelService_BatchDeparse_0(ctx context.Context, marshaler runtime.Marshaler, client CelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq BatchDeparseRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.BatchDeparse(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_CelService_BatchDeparse_0(ctx context.Context, marshaler runtime.Marshaler, server CelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq BatchDeparseRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.BatchDeparse(ctx, &protoReq)return msg, metadata, err}@@ -130,7 +164,7 @@ func RegisterCelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,})- mux.Handle("POST", pattern_CelService_Deparse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ mux.Handle("POST", pattern_CelService_BatchParse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()var stream runtime.ServerTransportStream@@ -138,12 +172,12 @@ func RegisterCelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)var err errorvar annotatedContext context.Context- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.CelService/Deparse", runtime.WithHTTPPathPattern("/v1/cel/deparse"))+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.CelService/BatchParse", runtime.WithHTTPPathPattern("/v1/cel/batchParse"))if err != nil {runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)return}- resp, md, err := local_request_CelService_Deparse_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ resp, md, err := local_request_CelService_BatchParse_0(annotatedContext, inboundMarshaler, server, req, pathParams)md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)if err != nil {@@ -151,7 +185,32 @@ func RegisterCelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,return}- forward_CelService_Deparse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)+ forward_CelService_BatchParse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("POST", pattern_CelService_BatchDeparse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.CelService/BatchDeparse", runtime.WithHTTPPathPattern("/v1/cel/batchDeparse"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_CelService_BatchDeparse_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_CelService_BatchDeparse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)})@@ -218,25 +277,47 @@ func RegisterCelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,})- mux.Handle("POST", pattern_CelService_Deparse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ mux.Handle("POST", pattern_CelService_BatchParse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.CelService/BatchParse", runtime.WithHTTPPathPattern("/v1/cel/batchParse"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_CelService_BatchParse_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_CelService_BatchParse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("POST", pattern_CelService_BatchDeparse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)var err errorvar annotatedContext context.Context- annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.CelService/Deparse", runtime.WithHTTPPathPattern("/v1/cel/deparse"))+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.CelService/BatchDeparse", runtime.WithHTTPPathPattern("/v1/cel/batchDeparse"))if err != nil {runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)return}- resp, md, err := request_CelService_Deparse_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ resp, md, err := request_CelService_BatchDeparse_0(annotatedContext, inboundMarshaler, client, req, pathParams)annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)if err != nil {runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)return}- forward_CelService_Deparse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)+ forward_CelService_BatchDeparse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)})@@ -246,11 +327,15 @@ func RegisterCelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,var (pattern_CelService_Parse_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "cel", "parse"}, ""))- pattern_CelService_Deparse_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "cel", "deparse"}, ""))+ pattern_CelService_BatchParse_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "cel", "batchParse"}, ""))++ pattern_CelService_BatchDeparse_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "cel", "batchDeparse"}, "")))var (forward_CelService_Parse_0 = runtime.ForwardResponseMessage- forward_CelService_Deparse_0 = runtime.ForwardResponseMessage+ forward_CelService_BatchParse_0 = runtime.ForwardResponseMessage++ forward_CelService_BatchDeparse_0 = runtime.ForwardResponseMessage)diff --git a/proto/generated-go/v1/cel_service_grpc.pb.go b/proto/generated-go/v1/cel_service_grpc.pb.goindex 5e66657b90..3f9b608a7e 100644--- a/proto/generated-go/v1/cel_service_grpc.pb.go+++ b/proto/generated-go/v1/cel_service_grpc.pb.go@@ -19,8 +19,9 @@ import (const _ = grpc.SupportPackageIsVersion7const (- CelService_Parse_FullMethodName = "/bytebase.v1.CelService/Parse"- CelService_Deparse_FullMethodName = "/bytebase.v1.CelService/Deparse"+ CelService_Parse_FullMethodName = "/bytebase.v1.CelService/Parse"+ CelService_BatchParse_FullMethodName = "/bytebase.v1.CelService/BatchParse"+ CelService_BatchDeparse_FullMethodName = "/bytebase.v1.CelService/BatchDeparse")// CelServiceClient is the client API for CelService service.@@ -28,7 +29,8 @@ const (// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.type CelServiceClient interface {Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)- Deparse(ctx context.Context, in *DeparseRequest, opts ...grpc.CallOption) (*DeparseResponse, error)+ BatchParse(ctx context.Context, in *BatchParseRequest, opts ...grpc.CallOption) (*BatchParseResponse, error)+ BatchDeparse(ctx context.Context, in *BatchDeparseRequest, opts ...grpc.CallOption) (*BatchDeparseResponse, error)}type celServiceClient struct {@@ -48,9 +50,18 @@ func (c *celServiceClient) Parse(ctx context.Context, in *ParseRequest, opts ...return out, nil}-func (c *celServiceClient) Deparse(ctx context.Context, in *DeparseRequest, opts ...grpc.CallOption) (*DeparseResponse, error) {- out := new(DeparseResponse)- err := c.cc.Invoke(ctx, CelService_Deparse_FullMethodName, in, out, opts...)+func (c *celServiceClient) BatchParse(ctx context.Context, in *BatchParseRequest, opts ...grpc.CallOption) (*BatchParseResponse, error) {+ out := new(BatchParseResponse)+ err := c.cc.Invoke(ctx, CelService_BatchParse_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *celServiceClient) BatchDeparse(ctx context.Context, in *BatchDeparseRequest, opts ...grpc.CallOption) (*BatchDeparseResponse, error) {+ out := new(BatchDeparseResponse)+ err := c.cc.Invoke(ctx, CelService_BatchDeparse_FullMethodName, in, out, opts...)if err != nil {return nil, err}@@ -62,7 +73,8 @@ func (c *celServiceClient) Deparse(ctx context.Context, in *DeparseRequest, opts// for forward compatibilitytype CelServiceServer interface {Parse(context.Context, *ParseRequest) (*ParseResponse, error)- Deparse(context.Context, *DeparseRequest) (*DeparseResponse, error)+ BatchParse(context.Context, *BatchParseRequest) (*BatchParseResponse, error)+ BatchDeparse(context.Context, *BatchDeparseRequest) (*BatchDeparseResponse, error)mustEmbedUnimplementedCelServiceServer()}@@ -73,8 +85,11 @@ type UnimplementedCelServiceServer struct {func (UnimplementedCelServiceServer) Parse(context.Context, *ParseRequest) (*ParseResponse, error) {return nil, status.Errorf(codes.Unimplemented, "method Parse not implemented")}-func (UnimplementedCelServiceServer) Deparse(context.Context, *DeparseRequest) (*DeparseResponse, error) {- return nil, status.Errorf(codes.Unimplemented, "method Deparse not implemented")+func (UnimplementedCelServiceServer) BatchParse(context.Context, *BatchParseRequest) (*BatchParseResponse, error) {+ return nil, status.Errorf(codes.Unimplemented, "method BatchParse not implemented")+}+func (UnimplementedCelServiceServer) BatchDeparse(context.Context, *BatchDeparseRequest) (*BatchDeparseResponse, error) {+ return nil, status.Errorf(codes.Unimplemented, "method BatchDeparse not implemented")}func (UnimplementedCelServiceServer) mustEmbedUnimplementedCelServiceServer() {}@@ -107,20 +122,38 @@ func _CelService_Parse_Handler(srv interface{}, ctx context.Context, dec func(inreturn interceptor(ctx, in, info, handler)}-func _CelService_Deparse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {- in := new(DeparseRequest)+func _CelService_BatchParse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(BatchParseRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(CelServiceServer).BatchParse(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: CelService_BatchParse_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(CelServiceServer).BatchParse(ctx, req.(*BatchParseRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _CelService_BatchDeparse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(BatchDeparseRequest)if err := dec(in); err != nil {return nil, err}if interceptor == nil {- return srv.(CelServiceServer).Deparse(ctx, in)+ return srv.(CelServiceServer).BatchDeparse(ctx, in)}info := &grpc.UnaryServerInfo{Server: srv,- FullMethod: CelService_Deparse_FullMethodName,+ FullMethod: CelService_BatchDeparse_FullMethodName,}handler := func(ctx context.Context, req interface{}) (interface{}, error) {- return srv.(CelServiceServer).Deparse(ctx, req.(*DeparseRequest))+ return srv.(CelServiceServer).BatchDeparse(ctx, req.(*BatchDeparseRequest))}return interceptor(ctx, in, info, handler)}@@ -137,8 +170,12 @@ var CelService_ServiceDesc = grpc.ServiceDesc{Handler: _CelService_Parse_Handler,},{- MethodName: "Deparse",- Handler: _CelService_Deparse_Handler,+ MethodName: "BatchParse",+ Handler: _CelService_BatchParse_Handler,+ },+ {+ MethodName: "BatchDeparse",+ Handler: _CelService_BatchDeparse_Handler,},},Streams: []grpc.StreamDesc{},diff --git a/proto/v1/cel_service.proto b/proto/v1/cel_service.protoindex fa9041cdcf..4555eccdfe 100644--- a/proto/v1/cel_service.proto+++ b/proto/v1/cel_service.proto@@ -14,9 +14,15 @@ service CelService {body: "*"};}- rpc Deparse(DeparseRequest) returns (DeparseResponse) {+ rpc BatchParse(BatchParseRequest) returns (BatchParseResponse) {option (google.api.http) = {- post: "/v1/cel/deparse"+ post: "/v1/cel/batchParse"+ body: "*"+ };+ }+ rpc BatchDeparse(BatchDeparseRequest) returns (BatchDeparseResponse) {+ option (google.api.http) = {+ post: "/v1/cel/batchDeparse"body: "*"};}@@ -26,14 +32,30 @@ message ParseRequest {string expression = 1;}+message BatchParseRequest {+ repeated string expressions = 1;+}+message ParseResponse {google.api.expr.v1alpha1.ParsedExpr expression = 1;}+message BatchParseResponse {+ repeated google.api.expr.v1alpha1.ParsedExpr expressions = 1;+}+message DeparseRequest {google.api.expr.v1alpha1.ParsedExpr expression = 1;}+message BatchDeparseRequest {+ repeated google.api.expr.v1alpha1.ParsedExpr expressions = 1;+}+message DeparseResponse {string expression = 1;}++message BatchDeparseResponse {+ repeated string expressions = 1;+}