From 05911f5a96d846ba0fb6ce5b71f99e5bbba6f2f4 Mon Sep 17 00:00:00 2001 From: Jesko Plitt Date: Tue, 7 Feb 2023 14:13:41 +0100 Subject: [PATCH] Add DataOrder to GetProjectionDataRequest --- CHANGELOG.md | 4 + delivery/get_projection_data.proto | 6 + go/deliverypb/get_projection_data.pb.go | 246 ++++++++++++++------- nodejs/src/delivery/get_projection_data.ts | 78 +++++++ nodejs/src/index.ts | 1 + 5 files changed, 254 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f5730b..c3d880a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.0.0-alpha.12 + +- (feature) Add `DataOrder` to `GetProjectionDataRequest` + # v1.0.0-alpha.11 - (bug) Fix `DataFilter` diff --git a/delivery/get_projection_data.proto b/delivery/get_projection_data.proto index c898d93..2d46b4d 100644 --- a/delivery/get_projection_data.proto +++ b/delivery/get_projection_data.proto @@ -9,6 +9,12 @@ message GetProjectionDataRequest { int32 page = 5; bool returnEmptyDataIfNotFound = 6; DataFilter filter = 7; + repeated DataOrder order = 8; +} + +message DataOrder { + string field = 1; + bool descending = 2; } message DataFilter { diff --git a/go/deliverypb/get_projection_data.pb.go b/go/deliverypb/get_projection_data.pb.go index 85e3ff3..0979cf3 100644 --- a/go/deliverypb/get_projection_data.pb.go +++ b/go/deliverypb/get_projection_data.pb.go @@ -25,13 +25,14 @@ type GetProjectionDataRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Projection string `protobuf:"bytes,1,opt,name=projection,proto3" json:"projection,omitempty"` - TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - DataId string `protobuf:"bytes,3,opt,name=data_id,json=dataId,proto3" json:"data_id,omitempty"` - Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - Page int32 `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"` - ReturnEmptyDataIfNotFound bool `protobuf:"varint,6,opt,name=returnEmptyDataIfNotFound,proto3" json:"returnEmptyDataIfNotFound,omitempty"` - Filter *DataFilter `protobuf:"bytes,7,opt,name=filter,proto3" json:"filter,omitempty"` + Projection string `protobuf:"bytes,1,opt,name=projection,proto3" json:"projection,omitempty"` + TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + DataId string `protobuf:"bytes,3,opt,name=data_id,json=dataId,proto3" json:"data_id,omitempty"` + Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + Page int32 `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"` + ReturnEmptyDataIfNotFound bool `protobuf:"varint,6,opt,name=returnEmptyDataIfNotFound,proto3" json:"returnEmptyDataIfNotFound,omitempty"` + Filter *DataFilter `protobuf:"bytes,7,opt,name=filter,proto3" json:"filter,omitempty"` + Order []*DataOrder `protobuf:"bytes,8,rep,name=order,proto3" json:"order,omitempty"` } func (x *GetProjectionDataRequest) Reset() { @@ -115,6 +116,68 @@ func (x *GetProjectionDataRequest) GetFilter() *DataFilter { return nil } +func (x *GetProjectionDataRequest) GetOrder() []*DataOrder { + if x != nil { + return x.Order + } + return nil +} + +type DataOrder struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + Descending bool `protobuf:"varint,2,opt,name=descending,proto3" json:"descending,omitempty"` +} + +func (x *DataOrder) Reset() { + *x = DataOrder{} + if protoimpl.UnsafeEnabled { + mi := &file_delivery_get_projection_data_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataOrder) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataOrder) ProtoMessage() {} + +func (x *DataOrder) ProtoReflect() protoreflect.Message { + mi := &file_delivery_get_projection_data_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 DataOrder.ProtoReflect.Descriptor instead. +func (*DataOrder) Descriptor() ([]byte, []int) { + return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{1} +} + +func (x *DataOrder) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +func (x *DataOrder) GetDescending() bool { + if x != nil { + return x.Descending + } + return false +} + type DataFilter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -128,7 +191,7 @@ type DataFilter struct { func (x *DataFilter) Reset() { *x = DataFilter{} if protoimpl.UnsafeEnabled { - mi := &file_delivery_get_projection_data_proto_msgTypes[1] + mi := &file_delivery_get_projection_data_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -141,7 +204,7 @@ func (x *DataFilter) String() string { func (*DataFilter) ProtoMessage() {} func (x *DataFilter) ProtoReflect() protoreflect.Message { - mi := &file_delivery_get_projection_data_proto_msgTypes[1] + mi := &file_delivery_get_projection_data_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -154,7 +217,7 @@ func (x *DataFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use DataFilter.ProtoReflect.Descriptor instead. func (*DataFilter) Descriptor() ([]byte, []int) { - return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{1} + return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{2} } func (x *DataFilter) GetFields() map[string]*DataFieldFilter { @@ -191,7 +254,7 @@ type DataFieldFilter struct { func (x *DataFieldFilter) Reset() { *x = DataFieldFilter{} if protoimpl.UnsafeEnabled { - mi := &file_delivery_get_projection_data_proto_msgTypes[2] + mi := &file_delivery_get_projection_data_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -204,7 +267,7 @@ func (x *DataFieldFilter) String() string { func (*DataFieldFilter) ProtoMessage() {} func (x *DataFieldFilter) ProtoReflect() protoreflect.Message { - mi := &file_delivery_get_projection_data_proto_msgTypes[2] + mi := &file_delivery_get_projection_data_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -217,7 +280,7 @@ func (x *DataFieldFilter) ProtoReflect() protoreflect.Message { // Deprecated: Use DataFieldFilter.ProtoReflect.Descriptor instead. func (*DataFieldFilter) Descriptor() ([]byte, []int) { - return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{2} + return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{3} } func (x *DataFieldFilter) GetType() string { @@ -252,7 +315,7 @@ type ProjectionData struct { func (x *ProjectionData) Reset() { *x = ProjectionData{} if protoimpl.UnsafeEnabled { - mi := &file_delivery_get_projection_data_proto_msgTypes[3] + mi := &file_delivery_get_projection_data_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -265,7 +328,7 @@ func (x *ProjectionData) String() string { func (*ProjectionData) ProtoMessage() {} func (x *ProjectionData) ProtoReflect() protoreflect.Message { - mi := &file_delivery_get_projection_data_proto_msgTypes[3] + mi := &file_delivery_get_projection_data_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -278,7 +341,7 @@ func (x *ProjectionData) ProtoReflect() protoreflect.Message { // Deprecated: Use ProjectionData.ProtoReflect.Descriptor instead. func (*ProjectionData) Descriptor() ([]byte, []int) { - return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{3} + return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{4} } func (x *ProjectionData) GetData() map[string]string { @@ -301,7 +364,7 @@ type GetProjectionDataResponse struct { func (x *GetProjectionDataResponse) Reset() { *x = GetProjectionDataResponse{} if protoimpl.UnsafeEnabled { - mi := &file_delivery_get_projection_data_proto_msgTypes[4] + mi := &file_delivery_get_projection_data_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -314,7 +377,7 @@ func (x *GetProjectionDataResponse) String() string { func (*GetProjectionDataResponse) ProtoMessage() {} func (x *GetProjectionDataResponse) ProtoReflect() protoreflect.Message { - mi := &file_delivery_get_projection_data_proto_msgTypes[4] + mi := &file_delivery_get_projection_data_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -327,7 +390,7 @@ func (x *GetProjectionDataResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetProjectionDataResponse.ProtoReflect.Descriptor instead. func (*GetProjectionDataResponse) Descriptor() ([]byte, []int) { - return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{4} + return file_delivery_get_projection_data_proto_rawDescGZIP(), []int{5} } func (x *GetProjectionDataResponse) GetResult() []*ProjectionData { @@ -356,7 +419,7 @@ var File_delivery_get_projection_data_proto protoreflect.FileDescriptor var file_delivery_get_projection_data_proto_rawDesc = []byte{ 0x0a, 0x22, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x22, 0x86, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x22, 0xb1, 0x02, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, @@ -373,44 +436,51 @@ var file_delivery_get_projection_data_proto_rawDesc = []byte{ 0x66, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xea, 0x01, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, - 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, - 0x12, 0x26, 0x0a, 0x03, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x52, 0x03, 0x61, 0x6e, 0x64, 0x12, 0x24, 0x0a, 0x02, 0x6f, 0x72, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, - 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x02, 0x6f, 0x72, 0x1a, 0x54, - 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x59, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x81, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x36, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, - 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x22, 0x41, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x63, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x22, 0xea, 0x01, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x26, + 0x0a, 0x03, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x65, + 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x03, 0x61, 0x6e, 0x64, 0x12, 0x24, 0x0a, 0x02, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x02, 0x6f, 0x72, 0x1a, 0x54, 0x0a, 0x0b, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, + 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x59, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x81, 0x01, + 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x36, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x77, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -425,29 +495,31 @@ func file_delivery_get_projection_data_proto_rawDescGZIP() []byte { return file_delivery_get_projection_data_proto_rawDescData } -var file_delivery_get_projection_data_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_delivery_get_projection_data_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_delivery_get_projection_data_proto_goTypes = []interface{}{ (*GetProjectionDataRequest)(nil), // 0: delivery.GetProjectionDataRequest - (*DataFilter)(nil), // 1: delivery.DataFilter - (*DataFieldFilter)(nil), // 2: delivery.DataFieldFilter - (*ProjectionData)(nil), // 3: delivery.ProjectionData - (*GetProjectionDataResponse)(nil), // 4: delivery.GetProjectionDataResponse - nil, // 5: delivery.DataFilter.FieldsEntry - nil, // 6: delivery.ProjectionData.DataEntry + (*DataOrder)(nil), // 1: delivery.DataOrder + (*DataFilter)(nil), // 2: delivery.DataFilter + (*DataFieldFilter)(nil), // 3: delivery.DataFieldFilter + (*ProjectionData)(nil), // 4: delivery.ProjectionData + (*GetProjectionDataResponse)(nil), // 5: delivery.GetProjectionDataResponse + nil, // 6: delivery.DataFilter.FieldsEntry + nil, // 7: delivery.ProjectionData.DataEntry } var file_delivery_get_projection_data_proto_depIdxs = []int32{ - 1, // 0: delivery.GetProjectionDataRequest.filter:type_name -> delivery.DataFilter - 5, // 1: delivery.DataFilter.fields:type_name -> delivery.DataFilter.FieldsEntry - 1, // 2: delivery.DataFilter.and:type_name -> delivery.DataFilter - 1, // 3: delivery.DataFilter.or:type_name -> delivery.DataFilter - 6, // 4: delivery.ProjectionData.data:type_name -> delivery.ProjectionData.DataEntry - 3, // 5: delivery.GetProjectionDataResponse.result:type_name -> delivery.ProjectionData - 2, // 6: delivery.DataFilter.FieldsEntry.value:type_name -> delivery.DataFieldFilter - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 2, // 0: delivery.GetProjectionDataRequest.filter:type_name -> delivery.DataFilter + 1, // 1: delivery.GetProjectionDataRequest.order:type_name -> delivery.DataOrder + 6, // 2: delivery.DataFilter.fields:type_name -> delivery.DataFilter.FieldsEntry + 2, // 3: delivery.DataFilter.and:type_name -> delivery.DataFilter + 2, // 4: delivery.DataFilter.or:type_name -> delivery.DataFilter + 7, // 5: delivery.ProjectionData.data:type_name -> delivery.ProjectionData.DataEntry + 4, // 6: delivery.GetProjectionDataResponse.result:type_name -> delivery.ProjectionData + 3, // 7: delivery.DataFilter.FieldsEntry.value:type_name -> delivery.DataFieldFilter + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_delivery_get_projection_data_proto_init() } @@ -469,7 +541,7 @@ func file_delivery_get_projection_data_proto_init() { } } file_delivery_get_projection_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataFilter); i { + switch v := v.(*DataOrder); i { case 0: return &v.state case 1: @@ -481,7 +553,7 @@ func file_delivery_get_projection_data_proto_init() { } } file_delivery_get_projection_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataFieldFilter); i { + switch v := v.(*DataFilter); i { case 0: return &v.state case 1: @@ -493,7 +565,7 @@ func file_delivery_get_projection_data_proto_init() { } } file_delivery_get_projection_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProjectionData); i { + switch v := v.(*DataFieldFilter); i { case 0: return &v.state case 1: @@ -505,6 +577,18 @@ func file_delivery_get_projection_data_proto_init() { } } file_delivery_get_projection_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectionData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_delivery_get_projection_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetProjectionDataResponse); i { case 0: return &v.state @@ -523,7 +607,7 @@ func file_delivery_get_projection_data_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_delivery_get_projection_data_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/nodejs/src/delivery/get_projection_data.ts b/nodejs/src/delivery/get_projection_data.ts index 5f05437..0dc8cd1 100644 --- a/nodejs/src/delivery/get_projection_data.ts +++ b/nodejs/src/delivery/get_projection_data.ts @@ -11,6 +11,12 @@ export interface GetProjectionDataRequest { page: number; returnEmptyDataIfNotFound: boolean; filter: DataFilter | undefined; + order: DataOrder[]; +} + +export interface DataOrder { + field: string; + descending: boolean; } export interface DataFilter { @@ -54,6 +60,7 @@ function createBaseGetProjectionDataRequest(): GetProjectionDataRequest { page: 0, returnEmptyDataIfNotFound: false, filter: undefined, + order: [], }; } @@ -80,6 +87,9 @@ export const GetProjectionDataRequest = { if (message.filter !== undefined) { DataFilter.encode(message.filter, writer.uint32(58).fork()).ldelim(); } + for (const v of message.order) { + DataOrder.encode(v!, writer.uint32(66).fork()).ldelim(); + } return writer; }, @@ -111,6 +121,9 @@ export const GetProjectionDataRequest = { case 7: message.filter = DataFilter.decode(reader, reader.uint32()); break; + case 8: + message.order.push(DataOrder.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -130,6 +143,7 @@ export const GetProjectionDataRequest = { ? Boolean(object.returnEmptyDataIfNotFound) : false, filter: isSet(object.filter) ? DataFilter.fromJSON(object.filter) : undefined, + order: Array.isArray(object?.order) ? object.order.map((e: any) => DataOrder.fromJSON(e)) : [], }; }, @@ -143,6 +157,11 @@ export const GetProjectionDataRequest = { message.returnEmptyDataIfNotFound !== undefined && (obj.returnEmptyDataIfNotFound = message.returnEmptyDataIfNotFound); message.filter !== undefined && (obj.filter = message.filter ? DataFilter.toJSON(message.filter) : undefined); + if (message.order) { + obj.order = message.order.map((e) => e ? DataOrder.toJSON(e) : undefined); + } else { + obj.order = []; + } return obj; }, @@ -157,6 +176,65 @@ export const GetProjectionDataRequest = { message.filter = (object.filter !== undefined && object.filter !== null) ? DataFilter.fromPartial(object.filter) : undefined; + message.order = object.order?.map((e) => DataOrder.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDataOrder(): DataOrder { + return { field: "", descending: false }; +} + +export const DataOrder = { + encode(message: DataOrder, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.field !== "") { + writer.uint32(10).string(message.field); + } + if (message.descending === true) { + writer.uint32(16).bool(message.descending); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DataOrder { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = reader.string(); + break; + case 2: + message.descending = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DataOrder { + return { + field: isSet(object.field) ? String(object.field) : "", + descending: isSet(object.descending) ? Boolean(object.descending) : false, + }; + }, + + toJSON(message: DataOrder): unknown { + const obj: any = {}; + message.field !== undefined && (obj.field = message.field); + message.descending !== undefined && (obj.descending = message.descending); + return obj; + }, + + fromPartial(object: DeepPartial): DataOrder { + const message = createBaseDataOrder(); + message.field = object.field ?? ""; + message.descending = object.descending ?? false; return message; }, }; diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index 3795013..e1582a4 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -13,6 +13,7 @@ export { DataFilter, DataFilter_FieldsEntry, DataFieldFilter, + DataOrder, } from "./delivery/get_projection_data"; export {