From f2360f2f9587945f00443afbcc1a169960e91bdd Mon Sep 17 00:00:00 2001 From: Elizabeth Worstell Date: Mon, 8 Jul 2024 10:59:17 -0700 Subject: [PATCH] feat: support external types with type widening fixes #1296 --- .gitignore | 2 +- .../xyz/block/ftl/v1/schema/schema.pb.go | 1021 +++++++++-------- .../xyz/block/ftl/v1/schema/schema.proto | 8 + backend/schema/data.go | 4 +- backend/schema/metadatatypemap.go | 34 + backend/schema/parser.go | 2 +- backend/schema/protobuf_dec.go | 7 + backend/schema/protobuf_enc.go | 3 + backend/schema/schema_test.go | 33 + backend/schema/typealias.go | 22 +- buildengine/build.go | 4 + buildengine/testdata/another/types.ftl.go | 17 - examples/go/echo/go.mod | 1 + examples/go/echo/go.sum | 2 + .../xyz/block/ftl/v1/schema/schema_pb.ts | 62 + .../.ftl.tmpl/go/main/main.go.tmpl | 14 +- .../compile/build-template/types.ftl.go.tmpl | 16 +- go-runtime/compile/build.go | 75 +- go-runtime/compile/parser.go | 23 +- go-runtime/compile/schema_test.go | 16 +- go-runtime/compile/testdata/failing/go.mod | 1 + go-runtime/compile/testdata/failing/go.sum | 2 + go-runtime/compile/testdata/lib.go | 6 + go-runtime/compile/testdata/one/go.mod | 1 + go-runtime/compile/testdata/one/go.sum | 2 + go-runtime/compile/testdata/one/types.ftl.go | 24 - go-runtime/compile/testdata/parent/go.mod | 1 + go-runtime/compile/testdata/parent/go.sum | 2 + .../compile/testdata/parent/types.ftl.go | 3 - go-runtime/compile/testdata/pubsub/go.mod | 1 + go-runtime/compile/testdata/pubsub/go.sum | 2 + .../compile/testdata/pubsub/types.ftl.go | 3 - go-runtime/compile/testdata/subscriber/go.mod | 1 + go-runtime/compile/testdata/subscriber/go.sum | 2 + .../compile/testdata/subscriber/types.ftl.go | 3 - go-runtime/compile/testdata/two/go.mod | 1 + go-runtime/compile/testdata/two/go.sum | 2 + go-runtime/compile/testdata/two/two.go | 10 + go-runtime/compile/testdata/two/types.ftl.go | 8 +- go-runtime/compile/testdata/validation/go.mod | 1 + go-runtime/compile/testdata/validation/go.sum | 2 + go-runtime/encoding/encoding.go | 8 + .../encoding/encoding_integration_test.go | 14 + .../encoding/testdata/go/external/external.go | 20 + .../encoding/testdata/go/external/ftl.toml | 2 + .../encoding/testdata/go/external/go.mod | 45 + .../encoding/testdata/go/external/go.sum | 144 +++ go-runtime/encoding/testdata/lib.go | 7 + go-runtime/ftl/reflection/singleton.go | 4 + go-runtime/ftl/reflection/type_registry.go | 18 +- go-runtime/schema/common/common.go | 41 +- go-runtime/schema/common/directive.go | 27 +- go-runtime/schema/common/error.go | 4 + go-runtime/schema/common/fact.go | 8 +- go-runtime/schema/extract.go | 35 +- go-runtime/schema/metadata/analyzer.go | 12 +- go-runtime/schema/transitive/analyzer.go | 23 +- go-runtime/schema/typealias/analyzer.go | 72 +- lsp/logger.go | 7 +- 59 files changed, 1378 insertions(+), 557 deletions(-) create mode 100644 backend/schema/metadatatypemap.go delete mode 100644 buildengine/testdata/another/types.ftl.go delete mode 100644 go-runtime/compile/testdata/one/types.ftl.go delete mode 100644 go-runtime/compile/testdata/parent/types.ftl.go delete mode 100644 go-runtime/compile/testdata/pubsub/types.ftl.go delete mode 100644 go-runtime/compile/testdata/subscriber/types.ftl.go create mode 100644 go-runtime/encoding/testdata/go/external/external.go create mode 100644 go-runtime/encoding/testdata/go/external/ftl.toml create mode 100644 go-runtime/encoding/testdata/go/external/go.mod create mode 100644 go-runtime/encoding/testdata/go/external/go.sum create mode 100644 go-runtime/encoding/testdata/lib.go diff --git a/.gitignore b/.gitignore index 31dcf44481..fe884d1d63 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ testdata/**/go.work.sum # Leaving old _ftl for now to avoid old stuff getting checked in **/testdata/**/_ftl **/examples/**/_ftl -**/examples/**/types.ftl.go +**/types.ftl.go **/testdata/**/.ftl **/examples/**/.ftl /.ftl diff --git a/backend/protos/xyz/block/ftl/v1/schema/schema.pb.go b/backend/protos/xyz/block/ftl/v1/schema/schema.pb.go index 0ae5f2adea..8465d6b6f6 100644 --- a/backend/protos/xyz/block/ftl/v1/schema/schema.pb.go +++ b/backend/protos/xyz/block/ftl/v1/schema/schema.pb.go @@ -1627,6 +1627,7 @@ type Metadata struct { // *Metadata_Alias // *Metadata_Retry // *Metadata_Subscriber + // *Metadata_TypeMap Value isMetadata_Value `protobuf_oneof:"value"` } @@ -1718,6 +1719,13 @@ func (x *Metadata) GetSubscriber() *MetadataSubscriber { return nil } +func (x *Metadata) GetTypeMap() *MetadataTypeMap { + if x, ok := x.GetValue().(*Metadata_TypeMap); ok { + return x.TypeMap + } + return nil +} + type isMetadata_Value interface { isMetadata_Value() } @@ -1750,6 +1758,10 @@ type Metadata_Subscriber struct { Subscriber *MetadataSubscriber `protobuf:"bytes,7,opt,name=subscriber,proto3,oneof"` } +type Metadata_TypeMap struct { + TypeMap *MetadataTypeMap `protobuf:"bytes,8,opt,name=typeMap,proto3,oneof"` +} + func (*Metadata_Calls) isMetadata_Value() {} func (*Metadata_Ingress) isMetadata_Value() {} @@ -1764,6 +1776,8 @@ func (*Metadata_Retry) isMetadata_Value() {} func (*Metadata_Subscriber) isMetadata_Value() {} +func (*Metadata_TypeMap) isMetadata_Value() {} + type MetadataAlias struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2189,6 +2203,69 @@ func (x *MetadataSubscriber) GetName() string { return "" } +type MetadataTypeMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pos *Position `protobuf:"bytes,1,opt,name=pos,proto3,oneof" json:"pos,omitempty"` + Runtime string `protobuf:"bytes,2,opt,name=runtime,proto3" json:"runtime,omitempty"` + NativeName string `protobuf:"bytes,3,opt,name=nativeName,proto3" json:"nativeName,omitempty"` +} + +func (x *MetadataTypeMap) Reset() { + *x = MetadataTypeMap{} + if protoimpl.UnsafeEnabled { + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetadataTypeMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetadataTypeMap) ProtoMessage() {} + +func (x *MetadataTypeMap) ProtoReflect() protoreflect.Message { + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[30] + 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 MetadataTypeMap.ProtoReflect.Descriptor instead. +func (*MetadataTypeMap) Descriptor() ([]byte, []int) { + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{30} +} + +func (x *MetadataTypeMap) GetPos() *Position { + if x != nil { + return x.Pos + } + return nil +} + +func (x *MetadataTypeMap) GetRuntime() string { + if x != nil { + return x.Runtime + } + return "" +} + +func (x *MetadataTypeMap) GetNativeName() string { + if x != nil { + return x.NativeName + } + return "" +} + type Module struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2205,7 +2282,7 @@ type Module struct { func (x *Module) Reset() { *x = Module{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[30] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2218,7 +2295,7 @@ func (x *Module) String() string { func (*Module) ProtoMessage() {} func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[30] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2231,7 +2308,7 @@ func (x *Module) ProtoReflect() protoreflect.Message { // Deprecated: Use Module.ProtoReflect.Descriptor instead. func (*Module) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{30} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{31} } func (x *Module) GetRuntime() *ModuleRuntime { @@ -2288,7 +2365,7 @@ type Optional struct { func (x *Optional) Reset() { *x = Optional{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[31] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2301,7 +2378,7 @@ func (x *Optional) String() string { func (*Optional) ProtoMessage() {} func (x *Optional) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[31] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2314,7 +2391,7 @@ func (x *Optional) ProtoReflect() protoreflect.Message { // Deprecated: Use Optional.ProtoReflect.Descriptor instead. func (*Optional) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{31} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{32} } func (x *Optional) GetPos() *Position { @@ -2344,7 +2421,7 @@ type Position struct { func (x *Position) Reset() { *x = Position{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[32] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2357,7 +2434,7 @@ func (x *Position) String() string { func (*Position) ProtoMessage() {} func (x *Position) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[32] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2370,7 +2447,7 @@ func (x *Position) ProtoReflect() protoreflect.Message { // Deprecated: Use Position.ProtoReflect.Descriptor instead. func (*Position) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{32} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{33} } func (x *Position) GetFilename() string { @@ -2408,7 +2485,7 @@ type Ref struct { func (x *Ref) Reset() { *x = Ref{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[33] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2421,7 +2498,7 @@ func (x *Ref) String() string { func (*Ref) ProtoMessage() {} func (x *Ref) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[33] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2434,7 +2511,7 @@ func (x *Ref) ProtoReflect() protoreflect.Message { // Deprecated: Use Ref.ProtoReflect.Descriptor instead. func (*Ref) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{33} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{34} } func (x *Ref) GetPos() *Position { @@ -2477,7 +2554,7 @@ type Schema struct { func (x *Schema) Reset() { *x = Schema{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[34] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2490,7 +2567,7 @@ func (x *Schema) String() string { func (*Schema) ProtoMessage() {} func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[34] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2503,7 +2580,7 @@ func (x *Schema) ProtoReflect() protoreflect.Message { // Deprecated: Use Schema.ProtoReflect.Descriptor instead. func (*Schema) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{34} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{35} } func (x *Schema) GetPos() *Position { @@ -2534,7 +2611,7 @@ type Secret struct { func (x *Secret) Reset() { *x = Secret{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[35] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2547,7 +2624,7 @@ func (x *Secret) String() string { func (*Secret) ProtoMessage() {} func (x *Secret) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[35] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2560,7 +2637,7 @@ func (x *Secret) ProtoReflect() protoreflect.Message { // Deprecated: Use Secret.ProtoReflect.Descriptor instead. func (*Secret) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{35} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{36} } func (x *Secret) GetPos() *Position { @@ -2602,7 +2679,7 @@ type String struct { func (x *String) Reset() { *x = String{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[36] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2615,7 +2692,7 @@ func (x *String) String() string { func (*String) ProtoMessage() {} func (x *String) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[36] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2628,7 +2705,7 @@ func (x *String) ProtoReflect() protoreflect.Message { // Deprecated: Use String.ProtoReflect.Descriptor instead. func (*String) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{36} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{37} } func (x *String) GetPos() *Position { @@ -2650,7 +2727,7 @@ type StringValue struct { func (x *StringValue) Reset() { *x = StringValue{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[37] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2663,7 +2740,7 @@ func (x *StringValue) String() string { func (*StringValue) ProtoMessage() {} func (x *StringValue) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[37] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2676,7 +2753,7 @@ func (x *StringValue) ProtoReflect() protoreflect.Message { // Deprecated: Use StringValue.ProtoReflect.Descriptor instead. func (*StringValue) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{37} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{38} } func (x *StringValue) GetPos() *Position { @@ -2707,7 +2784,7 @@ type Subscription struct { func (x *Subscription) Reset() { *x = Subscription{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[38] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2720,7 +2797,7 @@ func (x *Subscription) String() string { func (*Subscription) ProtoMessage() {} func (x *Subscription) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[38] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2733,7 +2810,7 @@ func (x *Subscription) ProtoReflect() protoreflect.Message { // Deprecated: Use Subscription.ProtoReflect.Descriptor instead. func (*Subscription) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{38} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{39} } func (x *Subscription) GetPos() *Position { @@ -2775,7 +2852,7 @@ type Time struct { func (x *Time) Reset() { *x = Time{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[39] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2788,7 +2865,7 @@ func (x *Time) String() string { func (*Time) ProtoMessage() {} func (x *Time) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[39] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2801,7 +2878,7 @@ func (x *Time) ProtoReflect() protoreflect.Message { // Deprecated: Use Time.ProtoReflect.Descriptor instead. func (*Time) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{39} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{40} } func (x *Time) GetPos() *Position { @@ -2826,7 +2903,7 @@ type Topic struct { func (x *Topic) Reset() { *x = Topic{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[40] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2839,7 +2916,7 @@ func (x *Topic) String() string { func (*Topic) ProtoMessage() {} func (x *Topic) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[40] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2852,7 +2929,7 @@ func (x *Topic) ProtoReflect() protoreflect.Message { // Deprecated: Use Topic.ProtoReflect.Descriptor instead. func (*Topic) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{40} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{41} } func (x *Topic) GetPos() *Position { @@ -2915,7 +2992,7 @@ type Type struct { func (x *Type) Reset() { *x = Type{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2928,7 +3005,7 @@ func (x *Type) String() string { func (*Type) ProtoMessage() {} func (x *Type) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2941,7 +3018,7 @@ func (x *Type) ProtoReflect() protoreflect.Message { // Deprecated: Use Type.ProtoReflect.Descriptor instead. func (*Type) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{41} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{42} } func (m *Type) GetValue() isType_Value { @@ -3116,17 +3193,18 @@ type TypeAlias struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Pos *Position `protobuf:"bytes,1,opt,name=pos,proto3,oneof" json:"pos,omitempty"` - Comments []string `protobuf:"bytes,2,rep,name=comments,proto3" json:"comments,omitempty"` - Export bool `protobuf:"varint,3,opt,name=export,proto3" json:"export,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type *Type `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Pos *Position `protobuf:"bytes,1,opt,name=pos,proto3,oneof" json:"pos,omitempty"` + Comments []string `protobuf:"bytes,2,rep,name=comments,proto3" json:"comments,omitempty"` + Export bool `protobuf:"varint,3,opt,name=export,proto3" json:"export,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Type *Type `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Metadata []*Metadata `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty"` } func (x *TypeAlias) Reset() { *x = TypeAlias{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3139,7 +3217,7 @@ func (x *TypeAlias) String() string { func (*TypeAlias) ProtoMessage() {} func (x *TypeAlias) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3152,7 +3230,7 @@ func (x *TypeAlias) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeAlias.ProtoReflect.Descriptor instead. func (*TypeAlias) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{42} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{43} } func (x *TypeAlias) GetPos() *Position { @@ -3190,6 +3268,13 @@ func (x *TypeAlias) GetType() *Type { return nil } +func (x *TypeAlias) GetMetadata() []*Metadata { + if x != nil { + return x.Metadata + } + return nil +} + type TypeParameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3202,7 +3287,7 @@ type TypeParameter struct { func (x *TypeParameter) Reset() { *x = TypeParameter{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[43] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3215,7 +3300,7 @@ func (x *TypeParameter) String() string { func (*TypeParameter) ProtoMessage() {} func (x *TypeParameter) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[43] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3228,7 +3313,7 @@ func (x *TypeParameter) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeParameter.ProtoReflect.Descriptor instead. func (*TypeParameter) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{43} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{44} } func (x *TypeParameter) GetPos() *Position { @@ -3257,7 +3342,7 @@ type TypeValue struct { func (x *TypeValue) Reset() { *x = TypeValue{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[44] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3270,7 +3355,7 @@ func (x *TypeValue) String() string { func (*TypeValue) ProtoMessage() {} func (x *TypeValue) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[44] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3283,7 +3368,7 @@ func (x *TypeValue) ProtoReflect() protoreflect.Message { // Deprecated: Use TypeValue.ProtoReflect.Descriptor instead. func (*TypeValue) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{44} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{45} } func (x *TypeValue) GetPos() *Position { @@ -3311,7 +3396,7 @@ type Unit struct { func (x *Unit) Reset() { *x = Unit{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[45] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3324,7 +3409,7 @@ func (x *Unit) String() string { func (*Unit) ProtoMessage() {} func (x *Unit) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[45] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3337,7 +3422,7 @@ func (x *Unit) ProtoReflect() protoreflect.Message { // Deprecated: Use Unit.ProtoReflect.Descriptor instead. func (*Unit) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{45} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{46} } func (x *Unit) GetPos() *Position { @@ -3363,7 +3448,7 @@ type Value struct { func (x *Value) Reset() { *x = Value{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3376,7 +3461,7 @@ func (x *Value) String() string { func (*Value) ProtoMessage() {} func (x *Value) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3389,7 +3474,7 @@ func (x *Value) ProtoReflect() protoreflect.Message { // Deprecated: Use Value.ProtoReflect.Descriptor instead. func (*Value) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{46} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{47} } func (m *Value) GetValue() isValue_Value { @@ -3460,7 +3545,7 @@ type Verb struct { func (x *Verb) Reset() { *x = Verb{} if protoimpl.UnsafeEnabled { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3473,7 +3558,7 @@ func (x *Verb) String() string { func (*Verb) ProtoMessage() {} func (x *Verb) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47] + mi := &file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3486,7 +3571,7 @@ func (x *Verb) ProtoReflect() protoreflect.Message { // Deprecated: Use Verb.ProtoReflect.Descriptor instead. func (*Verb) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{47} + return file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP(), []int{48} } func (x *Verb) GetRuntime() *VerbRuntime { @@ -3806,7 +3891,7 @@ var file_xyz_block_ftl_v1_schema_schema_proto_rawDesc = []byte{ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, - 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xfa, 0x03, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xc0, 0x04, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, @@ -3837,161 +3922,229 @@ var file_xyz_block_ftl_v1_schema_schema_proto_rawDesc = []byte{ 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x7b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x41, 0x6c, 0x69, - 0x61, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x85, - 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x43, 0x61, 0x6c, 0x6c, 0x73, - 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, 0x05, 0x63, 0x61, - 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x07, 0x74, 0x79, 0x70, 0x65, + 0x4d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x42, 0x06, - 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x67, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, - 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, - 0x89, 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, - 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, + 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x42, 0x07, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x7b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x42, 0x06, 0x0a, 0x04, + 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, + 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, + 0x12, 0x32, 0x0a, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x05, 0x63, + 0x61, 0x6c, 0x6c, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x67, 0x0a, 0x0f, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x43, 0x72, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, + 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, + 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x72, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x42, 0x06, 0x0a, + 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, + 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, + 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, + 0x65, 0x66, 0x52, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, + 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, - 0x32, 0x0a, 0x05, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x05, 0x63, 0x61, - 0x6c, 0x6c, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x0f, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x41, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x2e, 0x49, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x61, 0x74, 0x68, 0x43, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x06, + 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x01, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, + 0x0a, 0x6d, 0x69, 0x6e, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x1e, 0x0a, + 0x0a, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x42, 0x06, 0x0a, + 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x6a, 0x0a, 0x12, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x0f, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x41, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x49, 0x6e, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, - 0x22, 0xb6, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, - 0x72, 0x79, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x42, 0x61, - 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x69, 0x6e, - 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x42, 0x61, - 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x78, - 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x42, - 0x08, 0x0a, 0x06, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x12, + 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x9e, 0x02, 0x0a, 0x06, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x92, 0xf7, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x48, 0x00, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x06, 0x0a, - 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x9e, 0x02, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x12, 0x47, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x92, 0xf7, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x07, 0x72, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, + 0x01, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x64, 0x65, 0x63, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x44, 0x65, 0x63, + 0x6c, 0x52, 0x05, 0x64, 0x65, 0x63, 0x6c, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x8d, 0x01, 0x0a, + 0x08, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x03, 0x70, 0x6f, 0x73, - 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, - 0x05, 0x64, 0x65, 0x63, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, + 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, + 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x48, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, + 0x70, 0x6f, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x52, 0x0a, 0x08, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x22, 0xba, 0x01, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x45, + 0x0a, 0x0e, 0x74, 0x79, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x74, 0x79, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x85, 0x01, + 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x39, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, + 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x06, 0x0a, + 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x06, 0x0a, + 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, + 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x52, 0x05, 0x64, 0x65, 0x63, - 0x6c, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, - 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x08, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, - 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x48, 0x01, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x42, 0x07, 0x0a, - 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x52, 0x0a, 0x08, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x69, - 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xba, 0x01, 0x0a, 0x03, 0x52, - 0x65, 0x66, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x74, 0x79, 0x70, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x0e, 0x74, 0x79, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x07, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, + 0x73, 0x22, 0x65, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, - 0xad, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, - 0x73, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, - 0x4a, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, - 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x65, 0x0a, 0x0b, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, - 0x73, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, - 0x6f, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, + 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, + 0x48, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, + 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x05, 0x54, 0x6f, + 0x70, 0x69, 0x63, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, - 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, + 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, + 0x6f, 0x73, 0x22, 0x9a, 0x05, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x03, 0x69, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x69, 0x6e, 0x74, 0x12, 0x36, 0x0a, + 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, - 0x63, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x48, 0x0a, 0x04, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, - 0x70, 0x6f, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x38, 0x0a, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x48, 0x00, 0x52, 0x05, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x12, 0x36, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x48, + 0x00, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x33, 0x0a, + 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, + 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x41, 0x72, 0x72, 0x61, + 0x79, 0x48, 0x00, 0x52, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x30, 0x0a, 0x03, 0x6d, 0x61, + 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x30, 0x0a, 0x03, + 0x61, 0x6e, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6e, 0x79, 0x12, 0x33, + 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, + 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, + 0x6e, 0x69, 0x74, 0x12, 0x30, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, 0x48, 0x00, + 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x08, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x87, 0x02, 0x0a, 0x09, 0x54, 0x79, 0x70, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, @@ -4000,129 +4153,79 @@ var file_xyz_block_ftl_v1_schema_schema_proto_rawDesc = []byte{ 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x33, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x9a, 0x05, 0x0a, - 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x03, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x49, 0x6e, 0x74, - 0x48, 0x00, 0x52, 0x03, 0x69, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x48, 0x00, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, - 0x39, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x05, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x05, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x48, - 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x05, - 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x79, + 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x65, 0x0a, 0x0d, 0x54, 0x79, 0x70, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, + 0x73, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, + 0x22, 0x82, 0x01, 0x0a, 0x09, 0x54, 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, + 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x05, 0x61, - 0x72, 0x72, 0x61, 0x79, 0x12, 0x30, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x61, 0x70, 0x48, - 0x00, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x30, 0x0a, 0x03, 0x61, 0x6e, 0x79, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x41, 0x6e, - 0x79, 0x48, 0x00, 0x52, 0x03, 0x61, 0x6e, 0x79, 0x12, 0x33, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x55, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x30, 0x0a, - 0x03, 0x72, 0x65, 0x66, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x79, 0x7a, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x66, 0x48, 0x00, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, - 0x3f, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x09, 0x54, 0x79, - 0x70, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, - 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x06, 0x0a, 0x04, - 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x65, 0x0a, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x09, - 0x54, 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, - 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, - 0x22, 0x48, 0x0a, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, + 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0x48, 0x0a, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x38, 0x0a, + 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, + 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, + 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, + 0xdf, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, - 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x22, 0xdf, 0x01, 0x0a, 0x05, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x79, 0x7a, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, - 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, - 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x49, 0x6e, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x42, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x74, 0x79, 0x70, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x96, 0x03, 0x0a, - 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x45, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x92, 0xf7, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x00, - 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x03, - 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x03, - 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, - 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, + 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x74, + 0x79, 0x70, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x96, 0x03, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x45, 0x0a, 0x07, 0x72, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x92, 0xf7, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x38, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x01, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x0a, - 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x42, 0x4e, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x42, 0x44, 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, - 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, - 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x3b, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x70, 0x6f, 0x73, 0x42, 0x4e, 0x50, 0x01, 0x5a, 0x4a, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x42, 0x44, 0x35, 0x34, + 0x35, 0x36, 0x36, 0x39, 0x37, 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x3b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -4138,7 +4241,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_rawDescGZIP() []byte { } var file_xyz_block_ftl_v1_schema_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_xyz_block_ftl_v1_schema_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_xyz_block_ftl_v1_schema_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 49) var file_xyz_block_ftl_v1_schema_schema_proto_goTypes = []any{ (Error_ErrorLevel)(0), // 0: xyz.block.ftl.v1.schema.Error.ErrorLevel (*Any)(nil), // 1: xyz.block.ftl.v1.schema.Any @@ -4171,78 +4274,79 @@ var file_xyz_block_ftl_v1_schema_schema_proto_goTypes = []any{ (*MetadataIngress)(nil), // 28: xyz.block.ftl.v1.schema.MetadataIngress (*MetadataRetry)(nil), // 29: xyz.block.ftl.v1.schema.MetadataRetry (*MetadataSubscriber)(nil), // 30: xyz.block.ftl.v1.schema.MetadataSubscriber - (*Module)(nil), // 31: xyz.block.ftl.v1.schema.Module - (*Optional)(nil), // 32: xyz.block.ftl.v1.schema.Optional - (*Position)(nil), // 33: xyz.block.ftl.v1.schema.Position - (*Ref)(nil), // 34: xyz.block.ftl.v1.schema.Ref - (*Schema)(nil), // 35: xyz.block.ftl.v1.schema.Schema - (*Secret)(nil), // 36: xyz.block.ftl.v1.schema.Secret - (*String)(nil), // 37: xyz.block.ftl.v1.schema.String - (*StringValue)(nil), // 38: xyz.block.ftl.v1.schema.StringValue - (*Subscription)(nil), // 39: xyz.block.ftl.v1.schema.Subscription - (*Time)(nil), // 40: xyz.block.ftl.v1.schema.Time - (*Topic)(nil), // 41: xyz.block.ftl.v1.schema.Topic - (*Type)(nil), // 42: xyz.block.ftl.v1.schema.Type - (*TypeAlias)(nil), // 43: xyz.block.ftl.v1.schema.TypeAlias - (*TypeParameter)(nil), // 44: xyz.block.ftl.v1.schema.TypeParameter - (*TypeValue)(nil), // 45: xyz.block.ftl.v1.schema.TypeValue - (*Unit)(nil), // 46: xyz.block.ftl.v1.schema.Unit - (*Value)(nil), // 47: xyz.block.ftl.v1.schema.Value - (*Verb)(nil), // 48: xyz.block.ftl.v1.schema.Verb - (*ModuleRuntime)(nil), // 49: xyz.block.ftl.v1.schema.ModuleRuntime - (*VerbRuntime)(nil), // 50: xyz.block.ftl.v1.schema.VerbRuntime + (*MetadataTypeMap)(nil), // 31: xyz.block.ftl.v1.schema.MetadataTypeMap + (*Module)(nil), // 32: xyz.block.ftl.v1.schema.Module + (*Optional)(nil), // 33: xyz.block.ftl.v1.schema.Optional + (*Position)(nil), // 34: xyz.block.ftl.v1.schema.Position + (*Ref)(nil), // 35: xyz.block.ftl.v1.schema.Ref + (*Schema)(nil), // 36: xyz.block.ftl.v1.schema.Schema + (*Secret)(nil), // 37: xyz.block.ftl.v1.schema.Secret + (*String)(nil), // 38: xyz.block.ftl.v1.schema.String + (*StringValue)(nil), // 39: xyz.block.ftl.v1.schema.StringValue + (*Subscription)(nil), // 40: xyz.block.ftl.v1.schema.Subscription + (*Time)(nil), // 41: xyz.block.ftl.v1.schema.Time + (*Topic)(nil), // 42: xyz.block.ftl.v1.schema.Topic + (*Type)(nil), // 43: xyz.block.ftl.v1.schema.Type + (*TypeAlias)(nil), // 44: xyz.block.ftl.v1.schema.TypeAlias + (*TypeParameter)(nil), // 45: xyz.block.ftl.v1.schema.TypeParameter + (*TypeValue)(nil), // 46: xyz.block.ftl.v1.schema.TypeValue + (*Unit)(nil), // 47: xyz.block.ftl.v1.schema.Unit + (*Value)(nil), // 48: xyz.block.ftl.v1.schema.Value + (*Verb)(nil), // 49: xyz.block.ftl.v1.schema.Verb + (*ModuleRuntime)(nil), // 50: xyz.block.ftl.v1.schema.ModuleRuntime + (*VerbRuntime)(nil), // 51: xyz.block.ftl.v1.schema.VerbRuntime } var file_xyz_block_ftl_v1_schema_schema_proto_depIdxs = []int32{ - 33, // 0: xyz.block.ftl.v1.schema.Any.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 1: xyz.block.ftl.v1.schema.Array.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 2: xyz.block.ftl.v1.schema.Array.element:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 3: xyz.block.ftl.v1.schema.Bool.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 4: xyz.block.ftl.v1.schema.Bytes.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 5: xyz.block.ftl.v1.schema.Config.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 6: xyz.block.ftl.v1.schema.Config.type:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 7: xyz.block.ftl.v1.schema.Data.pos:type_name -> xyz.block.ftl.v1.schema.Position - 44, // 8: xyz.block.ftl.v1.schema.Data.typeParameters:type_name -> xyz.block.ftl.v1.schema.TypeParameter + 34, // 0: xyz.block.ftl.v1.schema.Any.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 1: xyz.block.ftl.v1.schema.Array.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 2: xyz.block.ftl.v1.schema.Array.element:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 3: xyz.block.ftl.v1.schema.Bool.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 4: xyz.block.ftl.v1.schema.Bytes.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 5: xyz.block.ftl.v1.schema.Config.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 6: xyz.block.ftl.v1.schema.Config.type:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 7: xyz.block.ftl.v1.schema.Data.pos:type_name -> xyz.block.ftl.v1.schema.Position + 45, // 8: xyz.block.ftl.v1.schema.Data.typeParameters:type_name -> xyz.block.ftl.v1.schema.TypeParameter 15, // 9: xyz.block.ftl.v1.schema.Data.fields:type_name -> xyz.block.ftl.v1.schema.Field 23, // 10: xyz.block.ftl.v1.schema.Data.metadata:type_name -> xyz.block.ftl.v1.schema.Metadata - 33, // 11: xyz.block.ftl.v1.schema.Database.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 11: xyz.block.ftl.v1.schema.Database.pos:type_name -> xyz.block.ftl.v1.schema.Position 6, // 12: xyz.block.ftl.v1.schema.Decl.data:type_name -> xyz.block.ftl.v1.schema.Data - 48, // 13: xyz.block.ftl.v1.schema.Decl.verb:type_name -> xyz.block.ftl.v1.schema.Verb + 49, // 13: xyz.block.ftl.v1.schema.Decl.verb:type_name -> xyz.block.ftl.v1.schema.Verb 7, // 14: xyz.block.ftl.v1.schema.Decl.database:type_name -> xyz.block.ftl.v1.schema.Database 9, // 15: xyz.block.ftl.v1.schema.Decl.enum:type_name -> xyz.block.ftl.v1.schema.Enum - 43, // 16: xyz.block.ftl.v1.schema.Decl.typeAlias:type_name -> xyz.block.ftl.v1.schema.TypeAlias + 44, // 16: xyz.block.ftl.v1.schema.Decl.typeAlias:type_name -> xyz.block.ftl.v1.schema.TypeAlias 5, // 17: xyz.block.ftl.v1.schema.Decl.config:type_name -> xyz.block.ftl.v1.schema.Config - 36, // 18: xyz.block.ftl.v1.schema.Decl.secret:type_name -> xyz.block.ftl.v1.schema.Secret + 37, // 18: xyz.block.ftl.v1.schema.Decl.secret:type_name -> xyz.block.ftl.v1.schema.Secret 13, // 19: xyz.block.ftl.v1.schema.Decl.fsm:type_name -> xyz.block.ftl.v1.schema.FSM - 41, // 20: xyz.block.ftl.v1.schema.Decl.topic:type_name -> xyz.block.ftl.v1.schema.Topic - 39, // 21: xyz.block.ftl.v1.schema.Decl.subscription:type_name -> xyz.block.ftl.v1.schema.Subscription - 33, // 22: xyz.block.ftl.v1.schema.Enum.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 23: xyz.block.ftl.v1.schema.Enum.type:type_name -> xyz.block.ftl.v1.schema.Type + 42, // 20: xyz.block.ftl.v1.schema.Decl.topic:type_name -> xyz.block.ftl.v1.schema.Topic + 40, // 21: xyz.block.ftl.v1.schema.Decl.subscription:type_name -> xyz.block.ftl.v1.schema.Subscription + 34, // 22: xyz.block.ftl.v1.schema.Enum.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 23: xyz.block.ftl.v1.schema.Enum.type:type_name -> xyz.block.ftl.v1.schema.Type 10, // 24: xyz.block.ftl.v1.schema.Enum.variants:type_name -> xyz.block.ftl.v1.schema.EnumVariant - 33, // 25: xyz.block.ftl.v1.schema.EnumVariant.pos:type_name -> xyz.block.ftl.v1.schema.Position - 47, // 26: xyz.block.ftl.v1.schema.EnumVariant.value:type_name -> xyz.block.ftl.v1.schema.Value - 33, // 27: xyz.block.ftl.v1.schema.Error.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 25: xyz.block.ftl.v1.schema.EnumVariant.pos:type_name -> xyz.block.ftl.v1.schema.Position + 48, // 26: xyz.block.ftl.v1.schema.EnumVariant.value:type_name -> xyz.block.ftl.v1.schema.Value + 34, // 27: xyz.block.ftl.v1.schema.Error.pos:type_name -> xyz.block.ftl.v1.schema.Position 0, // 28: xyz.block.ftl.v1.schema.Error.level:type_name -> xyz.block.ftl.v1.schema.Error.ErrorLevel 11, // 29: xyz.block.ftl.v1.schema.ErrorList.errors:type_name -> xyz.block.ftl.v1.schema.Error - 33, // 30: xyz.block.ftl.v1.schema.FSM.pos:type_name -> xyz.block.ftl.v1.schema.Position - 34, // 31: xyz.block.ftl.v1.schema.FSM.start:type_name -> xyz.block.ftl.v1.schema.Ref + 34, // 30: xyz.block.ftl.v1.schema.FSM.pos:type_name -> xyz.block.ftl.v1.schema.Position + 35, // 31: xyz.block.ftl.v1.schema.FSM.start:type_name -> xyz.block.ftl.v1.schema.Ref 14, // 32: xyz.block.ftl.v1.schema.FSM.transitions:type_name -> xyz.block.ftl.v1.schema.FSMTransition 23, // 33: xyz.block.ftl.v1.schema.FSM.metadata:type_name -> xyz.block.ftl.v1.schema.Metadata - 33, // 34: xyz.block.ftl.v1.schema.FSMTransition.pos:type_name -> xyz.block.ftl.v1.schema.Position - 34, // 35: xyz.block.ftl.v1.schema.FSMTransition.from:type_name -> xyz.block.ftl.v1.schema.Ref - 34, // 36: xyz.block.ftl.v1.schema.FSMTransition.to:type_name -> xyz.block.ftl.v1.schema.Ref - 33, // 37: xyz.block.ftl.v1.schema.Field.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 38: xyz.block.ftl.v1.schema.Field.type:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 34: xyz.block.ftl.v1.schema.FSMTransition.pos:type_name -> xyz.block.ftl.v1.schema.Position + 35, // 35: xyz.block.ftl.v1.schema.FSMTransition.from:type_name -> xyz.block.ftl.v1.schema.Ref + 35, // 36: xyz.block.ftl.v1.schema.FSMTransition.to:type_name -> xyz.block.ftl.v1.schema.Ref + 34, // 37: xyz.block.ftl.v1.schema.Field.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 38: xyz.block.ftl.v1.schema.Field.type:type_name -> xyz.block.ftl.v1.schema.Type 23, // 39: xyz.block.ftl.v1.schema.Field.metadata:type_name -> xyz.block.ftl.v1.schema.Metadata - 33, // 40: xyz.block.ftl.v1.schema.Float.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 40: xyz.block.ftl.v1.schema.Float.pos:type_name -> xyz.block.ftl.v1.schema.Position 18, // 41: xyz.block.ftl.v1.schema.IngressPathComponent.ingressPathLiteral:type_name -> xyz.block.ftl.v1.schema.IngressPathLiteral 19, // 42: xyz.block.ftl.v1.schema.IngressPathComponent.ingressPathParameter:type_name -> xyz.block.ftl.v1.schema.IngressPathParameter - 33, // 43: xyz.block.ftl.v1.schema.IngressPathLiteral.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 44: xyz.block.ftl.v1.schema.IngressPathParameter.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 45: xyz.block.ftl.v1.schema.Int.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 46: xyz.block.ftl.v1.schema.IntValue.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 47: xyz.block.ftl.v1.schema.Map.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 48: xyz.block.ftl.v1.schema.Map.key:type_name -> xyz.block.ftl.v1.schema.Type - 42, // 49: xyz.block.ftl.v1.schema.Map.value:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 43: xyz.block.ftl.v1.schema.IngressPathLiteral.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 44: xyz.block.ftl.v1.schema.IngressPathParameter.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 45: xyz.block.ftl.v1.schema.Int.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 46: xyz.block.ftl.v1.schema.IntValue.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 47: xyz.block.ftl.v1.schema.Map.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 48: xyz.block.ftl.v1.schema.Map.key:type_name -> xyz.block.ftl.v1.schema.Type + 43, // 49: xyz.block.ftl.v1.schema.Map.value:type_name -> xyz.block.ftl.v1.schema.Type 25, // 50: xyz.block.ftl.v1.schema.Metadata.calls:type_name -> xyz.block.ftl.v1.schema.MetadataCalls 28, // 51: xyz.block.ftl.v1.schema.Metadata.ingress:type_name -> xyz.block.ftl.v1.schema.MetadataIngress 26, // 52: xyz.block.ftl.v1.schema.Metadata.cronJob:type_name -> xyz.block.ftl.v1.schema.MetadataCronJob @@ -4250,65 +4354,68 @@ var file_xyz_block_ftl_v1_schema_schema_proto_depIdxs = []int32{ 24, // 54: xyz.block.ftl.v1.schema.Metadata.alias:type_name -> xyz.block.ftl.v1.schema.MetadataAlias 29, // 55: xyz.block.ftl.v1.schema.Metadata.retry:type_name -> xyz.block.ftl.v1.schema.MetadataRetry 30, // 56: xyz.block.ftl.v1.schema.Metadata.subscriber:type_name -> xyz.block.ftl.v1.schema.MetadataSubscriber - 33, // 57: xyz.block.ftl.v1.schema.MetadataAlias.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 58: xyz.block.ftl.v1.schema.MetadataCalls.pos:type_name -> xyz.block.ftl.v1.schema.Position - 34, // 59: xyz.block.ftl.v1.schema.MetadataCalls.calls:type_name -> xyz.block.ftl.v1.schema.Ref - 33, // 60: xyz.block.ftl.v1.schema.MetadataCronJob.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 61: xyz.block.ftl.v1.schema.MetadataDatabases.pos:type_name -> xyz.block.ftl.v1.schema.Position - 34, // 62: xyz.block.ftl.v1.schema.MetadataDatabases.calls:type_name -> xyz.block.ftl.v1.schema.Ref - 33, // 63: xyz.block.ftl.v1.schema.MetadataIngress.pos:type_name -> xyz.block.ftl.v1.schema.Position - 17, // 64: xyz.block.ftl.v1.schema.MetadataIngress.path:type_name -> xyz.block.ftl.v1.schema.IngressPathComponent - 33, // 65: xyz.block.ftl.v1.schema.MetadataRetry.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 66: xyz.block.ftl.v1.schema.MetadataSubscriber.pos:type_name -> xyz.block.ftl.v1.schema.Position - 49, // 67: xyz.block.ftl.v1.schema.Module.runtime:type_name -> xyz.block.ftl.v1.schema.ModuleRuntime - 33, // 68: xyz.block.ftl.v1.schema.Module.pos:type_name -> xyz.block.ftl.v1.schema.Position - 8, // 69: xyz.block.ftl.v1.schema.Module.decls:type_name -> xyz.block.ftl.v1.schema.Decl - 33, // 70: xyz.block.ftl.v1.schema.Optional.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 71: xyz.block.ftl.v1.schema.Optional.type:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 72: xyz.block.ftl.v1.schema.Ref.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 73: xyz.block.ftl.v1.schema.Ref.typeParameters:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 74: xyz.block.ftl.v1.schema.Schema.pos:type_name -> xyz.block.ftl.v1.schema.Position - 31, // 75: xyz.block.ftl.v1.schema.Schema.modules:type_name -> xyz.block.ftl.v1.schema.Module - 33, // 76: xyz.block.ftl.v1.schema.Secret.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 77: xyz.block.ftl.v1.schema.Secret.type:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 78: xyz.block.ftl.v1.schema.String.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 79: xyz.block.ftl.v1.schema.StringValue.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 80: xyz.block.ftl.v1.schema.Subscription.pos:type_name -> xyz.block.ftl.v1.schema.Position - 34, // 81: xyz.block.ftl.v1.schema.Subscription.topic:type_name -> xyz.block.ftl.v1.schema.Ref - 33, // 82: xyz.block.ftl.v1.schema.Time.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 83: xyz.block.ftl.v1.schema.Topic.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 84: xyz.block.ftl.v1.schema.Topic.event:type_name -> xyz.block.ftl.v1.schema.Type - 20, // 85: xyz.block.ftl.v1.schema.Type.int:type_name -> xyz.block.ftl.v1.schema.Int - 16, // 86: xyz.block.ftl.v1.schema.Type.float:type_name -> xyz.block.ftl.v1.schema.Float - 37, // 87: xyz.block.ftl.v1.schema.Type.string:type_name -> xyz.block.ftl.v1.schema.String - 4, // 88: xyz.block.ftl.v1.schema.Type.bytes:type_name -> xyz.block.ftl.v1.schema.Bytes - 3, // 89: xyz.block.ftl.v1.schema.Type.bool:type_name -> xyz.block.ftl.v1.schema.Bool - 40, // 90: xyz.block.ftl.v1.schema.Type.time:type_name -> xyz.block.ftl.v1.schema.Time - 2, // 91: xyz.block.ftl.v1.schema.Type.array:type_name -> xyz.block.ftl.v1.schema.Array - 22, // 92: xyz.block.ftl.v1.schema.Type.map:type_name -> xyz.block.ftl.v1.schema.Map - 1, // 93: xyz.block.ftl.v1.schema.Type.any:type_name -> xyz.block.ftl.v1.schema.Any - 46, // 94: xyz.block.ftl.v1.schema.Type.unit:type_name -> xyz.block.ftl.v1.schema.Unit - 34, // 95: xyz.block.ftl.v1.schema.Type.ref:type_name -> xyz.block.ftl.v1.schema.Ref - 32, // 96: xyz.block.ftl.v1.schema.Type.optional:type_name -> xyz.block.ftl.v1.schema.Optional - 33, // 97: xyz.block.ftl.v1.schema.TypeAlias.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 98: xyz.block.ftl.v1.schema.TypeAlias.type:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 99: xyz.block.ftl.v1.schema.TypeParameter.pos:type_name -> xyz.block.ftl.v1.schema.Position - 33, // 100: xyz.block.ftl.v1.schema.TypeValue.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 101: xyz.block.ftl.v1.schema.TypeValue.value:type_name -> xyz.block.ftl.v1.schema.Type - 33, // 102: xyz.block.ftl.v1.schema.Unit.pos:type_name -> xyz.block.ftl.v1.schema.Position - 38, // 103: xyz.block.ftl.v1.schema.Value.stringValue:type_name -> xyz.block.ftl.v1.schema.StringValue - 21, // 104: xyz.block.ftl.v1.schema.Value.intValue:type_name -> xyz.block.ftl.v1.schema.IntValue - 45, // 105: xyz.block.ftl.v1.schema.Value.typeValue:type_name -> xyz.block.ftl.v1.schema.TypeValue - 50, // 106: xyz.block.ftl.v1.schema.Verb.runtime:type_name -> xyz.block.ftl.v1.schema.VerbRuntime - 33, // 107: xyz.block.ftl.v1.schema.Verb.pos:type_name -> xyz.block.ftl.v1.schema.Position - 42, // 108: xyz.block.ftl.v1.schema.Verb.request:type_name -> xyz.block.ftl.v1.schema.Type - 42, // 109: xyz.block.ftl.v1.schema.Verb.response:type_name -> xyz.block.ftl.v1.schema.Type - 23, // 110: xyz.block.ftl.v1.schema.Verb.metadata:type_name -> xyz.block.ftl.v1.schema.Metadata - 111, // [111:111] is the sub-list for method output_type - 111, // [111:111] is the sub-list for method input_type - 111, // [111:111] is the sub-list for extension type_name - 111, // [111:111] is the sub-list for extension extendee - 0, // [0:111] is the sub-list for field type_name + 31, // 57: xyz.block.ftl.v1.schema.Metadata.typeMap:type_name -> xyz.block.ftl.v1.schema.MetadataTypeMap + 34, // 58: xyz.block.ftl.v1.schema.MetadataAlias.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 59: xyz.block.ftl.v1.schema.MetadataCalls.pos:type_name -> xyz.block.ftl.v1.schema.Position + 35, // 60: xyz.block.ftl.v1.schema.MetadataCalls.calls:type_name -> xyz.block.ftl.v1.schema.Ref + 34, // 61: xyz.block.ftl.v1.schema.MetadataCronJob.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 62: xyz.block.ftl.v1.schema.MetadataDatabases.pos:type_name -> xyz.block.ftl.v1.schema.Position + 35, // 63: xyz.block.ftl.v1.schema.MetadataDatabases.calls:type_name -> xyz.block.ftl.v1.schema.Ref + 34, // 64: xyz.block.ftl.v1.schema.MetadataIngress.pos:type_name -> xyz.block.ftl.v1.schema.Position + 17, // 65: xyz.block.ftl.v1.schema.MetadataIngress.path:type_name -> xyz.block.ftl.v1.schema.IngressPathComponent + 34, // 66: xyz.block.ftl.v1.schema.MetadataRetry.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 67: xyz.block.ftl.v1.schema.MetadataSubscriber.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 68: xyz.block.ftl.v1.schema.MetadataTypeMap.pos:type_name -> xyz.block.ftl.v1.schema.Position + 50, // 69: xyz.block.ftl.v1.schema.Module.runtime:type_name -> xyz.block.ftl.v1.schema.ModuleRuntime + 34, // 70: xyz.block.ftl.v1.schema.Module.pos:type_name -> xyz.block.ftl.v1.schema.Position + 8, // 71: xyz.block.ftl.v1.schema.Module.decls:type_name -> xyz.block.ftl.v1.schema.Decl + 34, // 72: xyz.block.ftl.v1.schema.Optional.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 73: xyz.block.ftl.v1.schema.Optional.type:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 74: xyz.block.ftl.v1.schema.Ref.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 75: xyz.block.ftl.v1.schema.Ref.typeParameters:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 76: xyz.block.ftl.v1.schema.Schema.pos:type_name -> xyz.block.ftl.v1.schema.Position + 32, // 77: xyz.block.ftl.v1.schema.Schema.modules:type_name -> xyz.block.ftl.v1.schema.Module + 34, // 78: xyz.block.ftl.v1.schema.Secret.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 79: xyz.block.ftl.v1.schema.Secret.type:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 80: xyz.block.ftl.v1.schema.String.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 81: xyz.block.ftl.v1.schema.StringValue.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 82: xyz.block.ftl.v1.schema.Subscription.pos:type_name -> xyz.block.ftl.v1.schema.Position + 35, // 83: xyz.block.ftl.v1.schema.Subscription.topic:type_name -> xyz.block.ftl.v1.schema.Ref + 34, // 84: xyz.block.ftl.v1.schema.Time.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 85: xyz.block.ftl.v1.schema.Topic.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 86: xyz.block.ftl.v1.schema.Topic.event:type_name -> xyz.block.ftl.v1.schema.Type + 20, // 87: xyz.block.ftl.v1.schema.Type.int:type_name -> xyz.block.ftl.v1.schema.Int + 16, // 88: xyz.block.ftl.v1.schema.Type.float:type_name -> xyz.block.ftl.v1.schema.Float + 38, // 89: xyz.block.ftl.v1.schema.Type.string:type_name -> xyz.block.ftl.v1.schema.String + 4, // 90: xyz.block.ftl.v1.schema.Type.bytes:type_name -> xyz.block.ftl.v1.schema.Bytes + 3, // 91: xyz.block.ftl.v1.schema.Type.bool:type_name -> xyz.block.ftl.v1.schema.Bool + 41, // 92: xyz.block.ftl.v1.schema.Type.time:type_name -> xyz.block.ftl.v1.schema.Time + 2, // 93: xyz.block.ftl.v1.schema.Type.array:type_name -> xyz.block.ftl.v1.schema.Array + 22, // 94: xyz.block.ftl.v1.schema.Type.map:type_name -> xyz.block.ftl.v1.schema.Map + 1, // 95: xyz.block.ftl.v1.schema.Type.any:type_name -> xyz.block.ftl.v1.schema.Any + 47, // 96: xyz.block.ftl.v1.schema.Type.unit:type_name -> xyz.block.ftl.v1.schema.Unit + 35, // 97: xyz.block.ftl.v1.schema.Type.ref:type_name -> xyz.block.ftl.v1.schema.Ref + 33, // 98: xyz.block.ftl.v1.schema.Type.optional:type_name -> xyz.block.ftl.v1.schema.Optional + 34, // 99: xyz.block.ftl.v1.schema.TypeAlias.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 100: xyz.block.ftl.v1.schema.TypeAlias.type:type_name -> xyz.block.ftl.v1.schema.Type + 23, // 101: xyz.block.ftl.v1.schema.TypeAlias.metadata:type_name -> xyz.block.ftl.v1.schema.Metadata + 34, // 102: xyz.block.ftl.v1.schema.TypeParameter.pos:type_name -> xyz.block.ftl.v1.schema.Position + 34, // 103: xyz.block.ftl.v1.schema.TypeValue.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 104: xyz.block.ftl.v1.schema.TypeValue.value:type_name -> xyz.block.ftl.v1.schema.Type + 34, // 105: xyz.block.ftl.v1.schema.Unit.pos:type_name -> xyz.block.ftl.v1.schema.Position + 39, // 106: xyz.block.ftl.v1.schema.Value.stringValue:type_name -> xyz.block.ftl.v1.schema.StringValue + 21, // 107: xyz.block.ftl.v1.schema.Value.intValue:type_name -> xyz.block.ftl.v1.schema.IntValue + 46, // 108: xyz.block.ftl.v1.schema.Value.typeValue:type_name -> xyz.block.ftl.v1.schema.TypeValue + 51, // 109: xyz.block.ftl.v1.schema.Verb.runtime:type_name -> xyz.block.ftl.v1.schema.VerbRuntime + 34, // 110: xyz.block.ftl.v1.schema.Verb.pos:type_name -> xyz.block.ftl.v1.schema.Position + 43, // 111: xyz.block.ftl.v1.schema.Verb.request:type_name -> xyz.block.ftl.v1.schema.Type + 43, // 112: xyz.block.ftl.v1.schema.Verb.response:type_name -> xyz.block.ftl.v1.schema.Type + 23, // 113: xyz.block.ftl.v1.schema.Verb.metadata:type_name -> xyz.block.ftl.v1.schema.Metadata + 114, // [114:114] is the sub-list for method output_type + 114, // [114:114] is the sub-list for method input_type + 114, // [114:114] is the sub-list for extension type_name + 114, // [114:114] is the sub-list for extension extendee + 0, // [0:114] is the sub-list for field type_name } func init() { file_xyz_block_ftl_v1_schema_schema_proto_init() } @@ -4679,7 +4786,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*Module); i { + switch v := v.(*MetadataTypeMap); i { case 0: return &v.state case 1: @@ -4691,7 +4798,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*Optional); i { + switch v := v.(*Module); i { case 0: return &v.state case 1: @@ -4703,7 +4810,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*Position); i { + switch v := v.(*Optional); i { case 0: return &v.state case 1: @@ -4715,7 +4822,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[33].Exporter = func(v any, i int) any { - switch v := v.(*Ref); i { + switch v := v.(*Position); i { case 0: return &v.state case 1: @@ -4727,7 +4834,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[34].Exporter = func(v any, i int) any { - switch v := v.(*Schema); i { + switch v := v.(*Ref); i { case 0: return &v.state case 1: @@ -4739,7 +4846,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[35].Exporter = func(v any, i int) any { - switch v := v.(*Secret); i { + switch v := v.(*Schema); i { case 0: return &v.state case 1: @@ -4751,7 +4858,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[36].Exporter = func(v any, i int) any { - switch v := v.(*String); i { + switch v := v.(*Secret); i { case 0: return &v.state case 1: @@ -4763,7 +4870,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[37].Exporter = func(v any, i int) any { - switch v := v.(*StringValue); i { + switch v := v.(*String); i { case 0: return &v.state case 1: @@ -4775,7 +4882,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[38].Exporter = func(v any, i int) any { - switch v := v.(*Subscription); i { + switch v := v.(*StringValue); i { case 0: return &v.state case 1: @@ -4787,7 +4894,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[39].Exporter = func(v any, i int) any { - switch v := v.(*Time); i { + switch v := v.(*Subscription); i { case 0: return &v.state case 1: @@ -4799,7 +4906,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[40].Exporter = func(v any, i int) any { - switch v := v.(*Topic); i { + switch v := v.(*Time); i { case 0: return &v.state case 1: @@ -4811,7 +4918,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41].Exporter = func(v any, i int) any { - switch v := v.(*Type); i { + switch v := v.(*Topic); i { case 0: return &v.state case 1: @@ -4823,7 +4930,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42].Exporter = func(v any, i int) any { - switch v := v.(*TypeAlias); i { + switch v := v.(*Type); i { case 0: return &v.state case 1: @@ -4835,7 +4942,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[43].Exporter = func(v any, i int) any { - switch v := v.(*TypeParameter); i { + switch v := v.(*TypeAlias); i { case 0: return &v.state case 1: @@ -4847,7 +4954,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[44].Exporter = func(v any, i int) any { - switch v := v.(*TypeValue); i { + switch v := v.(*TypeParameter); i { case 0: return &v.state case 1: @@ -4859,7 +4966,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[45].Exporter = func(v any, i int) any { - switch v := v.(*Unit); i { + switch v := v.(*TypeValue); i { case 0: return &v.state case 1: @@ -4871,7 +4978,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46].Exporter = func(v any, i int) any { - switch v := v.(*Value); i { + switch v := v.(*Unit); i { case 0: return &v.state case 1: @@ -4883,6 +4990,18 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { } } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47].Exporter = func(v any, i int) any { + switch v := v.(*Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[48].Exporter = func(v any, i int) any { switch v := v.(*Verb); i { case 0: return &v.state @@ -4937,6 +5056,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { (*Metadata_Alias)(nil), (*Metadata_Retry)(nil), (*Metadata_Subscriber)(nil), + (*Metadata_TypeMap)(nil), } file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[23].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[24].OneofWrappers = []any{} @@ -4947,7 +5067,7 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[29].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[30].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[31].OneofWrappers = []any{} - file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[33].OneofWrappers = []any{} + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[32].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[34].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[35].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[36].OneofWrappers = []any{} @@ -4955,7 +5075,8 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[38].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[39].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[40].OneofWrappers = []any{} - file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41].OneofWrappers = []any{ + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[41].OneofWrappers = []any{} + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42].OneofWrappers = []any{ (*Type_Int)(nil), (*Type_Float)(nil), (*Type_String_)(nil), @@ -4969,23 +5090,23 @@ func file_xyz_block_ftl_v1_schema_schema_proto_init() { (*Type_Ref)(nil), (*Type_Optional)(nil), } - file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[42].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[43].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[44].OneofWrappers = []any{} file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[45].OneofWrappers = []any{} - file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46].OneofWrappers = []any{ + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[46].OneofWrappers = []any{} + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47].OneofWrappers = []any{ (*Value_StringValue)(nil), (*Value_IntValue)(nil), (*Value_TypeValue)(nil), } - file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[47].OneofWrappers = []any{} + file_xyz_block_ftl_v1_schema_schema_proto_msgTypes[48].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_xyz_block_ftl_v1_schema_schema_proto_rawDesc, NumEnums: 1, - NumMessages: 48, + NumMessages: 49, NumExtensions: 0, NumServices: 0, }, diff --git a/backend/protos/xyz/block/ftl/v1/schema/schema.proto b/backend/protos/xyz/block/ftl/v1/schema/schema.proto index bdc786070c..053ce39113 100644 --- a/backend/protos/xyz/block/ftl/v1/schema/schema.proto +++ b/backend/protos/xyz/block/ftl/v1/schema/schema.proto @@ -166,6 +166,7 @@ message Metadata { MetadataAlias alias = 5; MetadataRetry retry = 6; MetadataSubscriber subscriber = 7; + MetadataTypeMap typeMap = 8; } } @@ -209,6 +210,12 @@ message MetadataSubscriber { string name = 2; } +message MetadataTypeMap { + optional Position pos = 1; + string runtime = 2; + string nativeName = 3; +} + message Module { optional ModuleRuntime runtime = 31634; @@ -300,6 +307,7 @@ message TypeAlias { bool export = 3; string name = 4; Type type = 5; + repeated Metadata metadata = 6; } message TypeParameter { diff --git a/backend/schema/data.go b/backend/schema/data.go index bd07e2ba91..6b442df20c 100644 --- a/backend/schema/data.go +++ b/backend/schema/data.go @@ -137,7 +137,7 @@ func (d *Data) Position() Position { return d.Pos } func (*Data) schemaDecl() {} func (*Data) schemaSymbol() {} func (d *Data) schemaChildren() []Node { - children := make([]Node, 0, len(d.Fields)+len(d.Metadata)) + children := make([]Node, 0, len(d.Fields)+len(d.Metadata)+len(d.TypeParameters)) for _, t := range d.TypeParameters { children = append(children, t) } @@ -188,6 +188,7 @@ func (d *Data) ToProto() proto.Message { TypeParameters: nodeListToProto[*schemapb.TypeParameter](d.TypeParameters), Fields: nodeListToProto[*schemapb.Field](d.Fields), Comments: d.Comments, + Metadata: metadataListToProto(d.Metadata), } } @@ -200,6 +201,7 @@ func DataFromProto(s *schemapb.Data) *Data { TypeParameters: typeParametersToSchema(s.TypeParameters), Fields: fieldListToSchema(s.Fields), Comments: s.Comments, + Metadata: metadataListToSchema(s.Metadata), } } diff --git a/backend/schema/metadatatypemap.go b/backend/schema/metadatatypemap.go new file mode 100644 index 0000000000..a91e25110c --- /dev/null +++ b/backend/schema/metadatatypemap.go @@ -0,0 +1,34 @@ +package schema + +import ( + "fmt" + + schemapb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/schema" + "google.golang.org/protobuf/reflect/protoreflect" +) + +type MetadataTypeMap struct { + Pos Position `parser:"" protobuf:"1,optional"` + + Runtime string `parser:"'+' 'typemap' @('go' | 'kotlin')" protobuf:"2"` + NativeName string `parser:"@String" protobuf:"3"` +} + +var _ Metadata = (*MetadataTypeMap)(nil) + +func (m *MetadataTypeMap) Position() Position { return m.Pos } + +func (m *MetadataTypeMap) String() string { + return fmt.Sprintf("+typemap %s %q", m.Runtime, m.NativeName) +} + +func (m *MetadataTypeMap) ToProto() protoreflect.ProtoMessage { + return &schemapb.MetadataTypeMap{ + Pos: posToProto(m.Pos), + Runtime: m.Runtime, + NativeName: m.NativeName, + } +} + +func (m *MetadataTypeMap) schemaChildren() []Node { return nil } +func (m *MetadataTypeMap) schemaMetadata() {} diff --git a/backend/schema/parser.go b/backend/schema/parser.go index c3e7289a35..6059cde4ce 100644 --- a/backend/schema/parser.go +++ b/backend/schema/parser.go @@ -21,7 +21,7 @@ var ( &Ref{}, } typeUnion = append(nonOptionalTypeUnion, &Optional{}) - metadataUnion = []Metadata{&MetadataCalls{}, &MetadataIngress{}, &MetadataCronJob{}, &MetadataDatabases{}, &MetadataAlias{}, &MetadataRetry{}, &MetadataSubscriber{}} + metadataUnion = []Metadata{&MetadataCalls{}, &MetadataIngress{}, &MetadataCronJob{}, &MetadataDatabases{}, &MetadataAlias{}, &MetadataRetry{}, &MetadataSubscriber{}, &MetadataTypeMap{}} ingressUnion = []IngressPathComponent{&IngressPathLiteral{}, &IngressPathParameter{}} valueUnion = []Value{&StringValue{}, &IntValue{}, &TypeValue{}} diff --git a/backend/schema/protobuf_dec.go b/backend/schema/protobuf_dec.go index ce73448a41..842e17687c 100644 --- a/backend/schema/protobuf_dec.go +++ b/backend/schema/protobuf_dec.go @@ -171,6 +171,13 @@ func metadataToSchema(s *schemapb.Metadata) Metadata { Name: s.Subscriber.Name, } + case *schemapb.Metadata_TypeMap: + return &MetadataTypeMap{ + Pos: posFromProto(s.TypeMap.Pos), + Runtime: s.TypeMap.Runtime, + NativeName: s.TypeMap.NativeName, + } + default: panic(fmt.Sprintf("unhandled metadata type: %T", s)) } diff --git a/backend/schema/protobuf_enc.go b/backend/schema/protobuf_enc.go index 552bf93430..09baf3525a 100644 --- a/backend/schema/protobuf_enc.go +++ b/backend/schema/protobuf_enc.go @@ -99,6 +99,9 @@ func metadataListToProto(nodes []Metadata) []*schemapb.Metadata { case *MetadataSubscriber: v = &schemapb.Metadata_Subscriber{Subscriber: n.ToProto().(*schemapb.MetadataSubscriber)} + case *MetadataTypeMap: + v = &schemapb.Metadata_TypeMap{TypeMap: n.ToProto().(*schemapb.MetadataTypeMap)} + default: panic(fmt.Sprintf("unhandled metadata type %T", n)) } diff --git a/backend/schema/schema_test.go b/backend/schema/schema_test.go index 1ff32252cb..3394e51765 100644 --- a/backend/schema/schema_test.go +++ b/backend/schema/schema_test.go @@ -121,6 +121,12 @@ module payments { verb paid(payments.OnlinePaymentPaid) Unit } + +module typealias { + typealias NonFtlType Any + +typemap go "github.com/foo/bar.Type" + +typemap kotlin "com.foo.bar.Type" +} ` assert.Equal(t, normaliseString(expected), normaliseString(testSchema.String())) } @@ -1012,6 +1018,19 @@ var testSchema = MustValidate(&Schema{ }, }, }, + { + Name: "typealias", + Decls: []Decl{ + &TypeAlias{ + Name: "NonFtlType", + Type: &Any{}, + Metadata: []Metadata{ + &MetadataTypeMap{Runtime: "go", NativeName: "github.com/foo/bar.Type"}, + &MetadataTypeMap{Runtime: "kotlin", NativeName: "com.foo.bar.Type"}, + }, + }, + }, + }, }, }) @@ -1031,3 +1050,17 @@ func TestRetryParsing(t *testing.T) { assert.Equal(t, time.Second*time.Duration(tt.seconds), duration) } } + +func TestParseTypeMap(t *testing.T) { + input := ` + module typealias { + typealias NonFtlType Any + +typemap go "github.com/foo/bar.Type" + +typemap kotlin "com.foo.bar.Type" + } + ` + actual, err := ParseModuleString("", input) + assert.NoError(t, err) + actual = Normalise(actual) + assert.Equal(t, testSchema.Modules[4], actual, assert.Exclude[Position]()) +} diff --git a/backend/schema/typealias.go b/backend/schema/typealias.go index 3fc8786591..38d95c102e 100644 --- a/backend/schema/typealias.go +++ b/backend/schema/typealias.go @@ -12,10 +12,11 @@ import ( type TypeAlias struct { Pos Position `parser:"" protobuf:"1,optional"` - Comments []string `parser:"@Comment*" protobuf:"2"` - Export bool `parser:"@'export'?" protobuf:"3"` - Name string `parser:"'typealias' @Ident" protobuf:"4"` - Type Type `parser:"@@" protobuf:"5"` + Comments []string `parser:"@Comment*" protobuf:"2"` + Export bool `parser:"@'export'?" protobuf:"3"` + Name string `parser:"'typealias' @Ident" protobuf:"4"` + Type Type `parser:"@@" protobuf:"5"` + Metadata []Metadata `parser:"@@*" protobuf:"6"` } var _ Decl = (*TypeAlias)(nil) @@ -30,17 +31,20 @@ func (t *TypeAlias) String() string { fmt.Fprint(w, "export ") } fmt.Fprintf(w, "typealias %s %s", t.Name, t.Type) + fmt.Fprint(w, indent(encodeMetadata(t.Metadata))) return w.String() } func (*TypeAlias) schemaDecl() {} func (*TypeAlias) schemaSymbol() {} func (t *TypeAlias) schemaChildren() []Node { - if t.Type == nil { - return []Node{} + children := make([]Node, 0, len(t.Metadata)+1) + for _, m := range t.Metadata { + children = append(children, m) } - return []Node{ - t.Type, + if t.Type != nil { + children = append(children, t.Type) } + return children } func (t *TypeAlias) ToProto() proto.Message { return &schemapb.TypeAlias{ @@ -49,6 +53,7 @@ func (t *TypeAlias) ToProto() proto.Message { Name: t.Name, Export: t.Export, Type: TypeToProto(t.Type), + Metadata: metadataListToProto(t.Metadata), } } @@ -62,5 +67,6 @@ func TypeAliasFromProto(s *schemapb.TypeAlias) *TypeAlias { Export: s.Export, Comments: s.Comments, Type: TypeFromProto(s.Type), + Metadata: metadataListToSchema(s.Metadata), } } diff --git a/buildengine/build.go b/buildengine/build.go index 3a50e0522e..a2a32a43df 100644 --- a/buildengine/build.go +++ b/buildengine/build.go @@ -66,6 +66,10 @@ func buildModule(ctx context.Context, projectRootDir string, sch *schema.Schema, } schema.SortErrorsByPosition(errorList.Errors) for _, e := range errorList.Errors { + if e.Level == schema.WARN { + logger.Log(log.Entry{Level: log.Warn, Message: e.Error(), Error: e}) + continue + } errs = append(errs, e) } diff --git a/buildengine/testdata/another/types.ftl.go b/buildengine/testdata/another/types.ftl.go deleted file mode 100644 index cc9fc61e01..0000000000 --- a/buildengine/testdata/another/types.ftl.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by FTL. DO NOT EDIT. -package another - -import "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" - -func init() { - reflection.Register( - reflection.SumType[SecondTypeEnum]( - *new(One), - *new(Two), - ), - reflection.SumType[TypeEnum]( - *new(A), - *new(B), - ), - ) -} diff --git a/examples/go/echo/go.mod b/examples/go/echo/go.mod index 3488ae4843..daef2a2ee1 100644 --- a/examples/go/echo/go.mod +++ b/examples/go/echo/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/examples/go/echo/go.sum b/examples/go/echo/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/examples/go/echo/go.sum +++ b/examples/go/echo/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/frontend/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts b/frontend/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts index fa512831bf..7539c2a42f 100644 --- a/frontend/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts +++ b/frontend/src/protos/xyz/block/ftl/v1/schema/schema_pb.ts @@ -1226,6 +1226,12 @@ export class Metadata extends Message { */ value: MetadataSubscriber; case: "subscriber"; + } | { + /** + * @generated from field: xyz.block.ftl.v1.schema.MetadataTypeMap typeMap = 8; + */ + value: MetadataTypeMap; + case: "typeMap"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -1243,6 +1249,7 @@ export class Metadata extends Message { { no: 5, name: "alias", kind: "message", T: MetadataAlias, oneof: "value" }, { no: 6, name: "retry", kind: "message", T: MetadataRetry, oneof: "value" }, { no: 7, name: "subscriber", kind: "message", T: MetadataSubscriber, oneof: "value" }, + { no: 8, name: "typeMap", kind: "message", T: MetadataTypeMap, oneof: "value" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Metadata { @@ -1593,6 +1600,55 @@ export class MetadataSubscriber extends Message { } } +/** + * @generated from message xyz.block.ftl.v1.schema.MetadataTypeMap + */ +export class MetadataTypeMap extends Message { + /** + * @generated from field: optional xyz.block.ftl.v1.schema.Position pos = 1; + */ + pos?: Position; + + /** + * @generated from field: string runtime = 2; + */ + runtime = ""; + + /** + * @generated from field: string nativeName = 3; + */ + nativeName = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "xyz.block.ftl.v1.schema.MetadataTypeMap"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pos", kind: "message", T: Position, opt: true }, + { no: 2, name: "runtime", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "nativeName", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MetadataTypeMap { + return new MetadataTypeMap().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MetadataTypeMap { + return new MetadataTypeMap().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MetadataTypeMap { + return new MetadataTypeMap().fromJsonString(jsonString, options); + } + + static equals(a: MetadataTypeMap | PlainMessage | undefined, b: MetadataTypeMap | PlainMessage | undefined): boolean { + return proto3.util.equals(MetadataTypeMap, a, b); + } +} + /** * @generated from message xyz.block.ftl.v1.schema.Module */ @@ -2287,6 +2343,11 @@ export class TypeAlias extends Message { */ type?: Type; + /** + * @generated from field: repeated xyz.block.ftl.v1.schema.Metadata metadata = 6; + */ + metadata: Metadata[] = []; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2300,6 +2361,7 @@ export class TypeAlias extends Message { { no: 3, name: "export", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "type", kind: "message", T: Type }, + { no: 6, name: "metadata", kind: "message", T: Metadata, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TypeAlias { diff --git a/go-runtime/compile/build-template/.ftl.tmpl/go/main/main.go.tmpl b/go-runtime/compile/build-template/.ftl.tmpl/go/main/main.go.tmpl index f61d399600..b28fb7a8fa 100644 --- a/go-runtime/compile/build-template/.ftl.tmpl/go/main/main.go.tmpl +++ b/go-runtime/compile/build-template/.ftl.tmpl/go/main/main.go.tmpl @@ -4,9 +4,14 @@ package main import ( "context" +{{- range .ExternalGoTypes }} + + {{.Import}} +{{- end}} + "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect" "github.com/TBD54566975/ftl/common/plugin" -{{- if .SumTypes }} +{{- if or .SumTypes .ExternalGoTypes }} "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" {{- end }} "github.com/TBD54566975/ftl/go-runtime/server" @@ -14,7 +19,7 @@ import ( "ftl/{{.}}" {{- end}} ) -{{- if .SumTypes}} +{{- if or .SumTypes .ExternalGoTypes }} func init() { reflection.Register( @@ -24,6 +29,11 @@ func init() { *new({{.Type}}), {{- end}} ), +{{- end}} +{{- range .ExternalGoTypes}} + {{- range .Types}} + reflection.ExternalType(*new({{.}})), + {{- end}} {{- end}} ) } diff --git a/go-runtime/compile/build-template/types.ftl.go.tmpl b/go-runtime/compile/build-template/types.ftl.go.tmpl index 2b45c2fd05..c474a4c967 100644 --- a/go-runtime/compile/build-template/types.ftl.go.tmpl +++ b/go-runtime/compile/build-template/types.ftl.go.tmpl @@ -1,7 +1,14 @@ // Code generated by FTL. DO NOT EDIT. package {{.Name}} -{{if .LocalSumTypes }} -import "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" + +{{- if or .LocalSumTypes .ExternalGoTypes }} + +import ( +{{- range .ExternalGoTypes }} + {{.Import}} +{{end}} + "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" +) func init() { reflection.Register( @@ -11,6 +18,11 @@ func init() { *new({{.Name}}), {{- end}} ), +{{- end}} +{{- range .ExternalGoTypes}} + {{- range .Types}} + reflection.ExternalType(*new({{.}})), + {{- end}} {{- end}} ) } diff --git a/go-runtime/compile/build.go b/go-runtime/compile/build.go index d0276905e4..2d9fcb5ec2 100644 --- a/go-runtime/compile/build.go +++ b/go-runtime/compile/build.go @@ -64,6 +64,7 @@ type mainModuleContext struct { Replacements []*modfile.Replace SumTypes []goSumType LocalSumTypes []goSumType + ExternalGoTypes []goExternalType } type goSumType struct { @@ -77,6 +78,11 @@ type goSumTypeVariant struct { SchemaType schema.Type } +type goExternalType struct { + Import string + Types []string +} + type ModifyFilesTransaction interface { Begin() error ModifiedFiles(paths ...string) error @@ -186,6 +192,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, sch *schema.Sc } goVerbs = append(goVerbs, goverb) } + sumTypes, goExternalTypes := getRegisteredTypes(result.Module, sch, result.NativeNames) if err := internal.ScaffoldZip(buildTemplateFiles(), moduleDir, mainModuleContext{ GoVersion: goModVersion, FTLVersion: ftlVersion, @@ -193,8 +200,9 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, sch *schema.Sc SharedModulesPaths: sharedModulesPaths, Verbs: goVerbs, Replacements: replacements, - SumTypes: getSumTypes(result.Module, sch, result.NativeNames), + SumTypes: sumTypes, LocalSumTypes: getLocalSumTypes(result.Module), + ExternalGoTypes: goExternalTypes, }, scaffolder.Exclude("^go.mod$"), scaffolder.Functions(funcs)); err != nil { return err } @@ -631,12 +639,17 @@ func getLocalSumTypes(module *schema.Module) []goSumType { return out } -func getSumTypes(module *schema.Module, sch *schema.Schema, nativeNames NativeNames) []goSumType { +func getRegisteredTypes(module *schema.Module, sch *schema.Schema, nativeNames NativeNames) ([]goSumType, []goExternalType) { sumTypes := make(map[string]goSumType) + goExternalTypes := make(map[string][]string) for _, d := range module.Decls { - if e, ok := d.(*schema.Enum); ok && !e.IsValueEnum() { - variants := make([]goSumTypeVariant, 0, len(e.Variants)) - for _, v := range e.Variants { + switch d := d.(type) { + case *schema.Enum: + if d.IsValueEnum() { + continue + } + variants := make([]goSumTypeVariant, 0, len(d.Variants)) + for _, v := range d.Variants { variants = append(variants, goSumTypeVariant{ //nolint:forcetypeassert Name: v.Name, Type: nativeNames[v], @@ -648,6 +661,22 @@ func getSumTypes(module *schema.Module, sch *schema.Schema, nativeNames NativeNa Discriminator: nativeNames[d], Variants: variants, } + case *schema.TypeAlias: + var fqName string + for _, m := range d.Metadata { + if m, ok := m.(*schema.MetadataTypeMap); ok && m.Runtime == "go" { + fqName = m.NativeName + } + } + if fqName == "" { + continue + } + im, typ := getGoExternalType(fqName) + if _, ok := goExternalTypes[im]; !ok { + goExternalTypes[im] = []string{} + } + goExternalTypes[im] = append(goExternalTypes[im], typ) + default: } } @@ -671,7 +700,41 @@ func getSumTypes(module *schema.Module, sch *schema.Schema, nativeNames NativeNa slices.SortFunc(out, func(a, b goSumType) int { return strings.Compare(a.Discriminator, b.Discriminator) }) - return out + + var externalTypes []goExternalType + for im, types := range goExternalTypes { + externalTypes = append(externalTypes, goExternalType{ + Import: im, + Types: types, + }) + } + return out, externalTypes +} + +func getGoExternalType(fqName string) (_import string, _type string) { + parts := strings.Split(fqName, "/") + pkgParts := strings.Split(parts[len(parts)-1], ".") + // expect 2 parts when package and directory path are the same, e.g. "github.com/foo/bar.A" + // expect 3 parts when package and directory path differ, e.g. "github.com/foo/bar.baz.A" + if l := len(pkgParts); !(l == 2 || l == 3) { + panic("unexpected Go qualified name format: " + fqName) + } + + // last part is the type name + name := pkgParts[len(pkgParts)-1] + // second to last part is the package name (in both cases) + pkg := pkgParts[len(pkgParts)-2] + // translate the fqName to a valid import; removing the type name (and package name if different from directory) + im := fmt.Sprintf("%q", strings.TrimSuffix(fqName, parts[len(parts)-1])+pkgParts[0]) + if len(pkgParts) == 3 { + // this means pkg and directory path differ, e.g. "github.com/foo/bar.baz.A" where the directory is "bar" + // and the package is "baz". + // + // in this case, import has an alias with the real package name: `import baz "github.com/foo/bar"` + im = fmt.Sprintf("%s %s", pkg, im) + } + + return im, fmt.Sprintf("%s.%s", pkg, name) } type externalEnum struct { diff --git a/go-runtime/compile/parser.go b/go-runtime/compile/parser.go index 3d782eb64a..a72f241a89 100644 --- a/go-runtime/compile/parser.go +++ b/go-runtime/compile/parser.go @@ -263,13 +263,34 @@ func (d *directiveExport) String() string { return "ftl:export" } +// DirectiveTypeMap is used to declare a native type to deserialize to in a given runtime. +type directiveTypeMap struct { + Pos schema.Position + + Runtime string `parser:"'typemap' @('go' | 'kotlin')"` + NativeName string `parser:"@String"` +} + +func (*directiveTypeMap) directive() {} + +func (d *directiveTypeMap) String() string { + return fmt.Sprintf("typemap %s %q", d.Runtime, d.NativeName) +} +func (d *directiveTypeMap) SetPosition(pos schema.Position) { + d.Pos = pos +} +func (d *directiveTypeMap) GetPosition() schema.Position { + return d.Pos +} + var directiveParser = participle.MustBuild[directiveWrapper]( participle.Lexer(schema.Lexer), participle.Elide("Whitespace"), participle.Unquote(), participle.UseLookahead(2), participle.Union[directive](&directiveVerb{}, &directiveData{}, &directiveEnum{}, &directiveTypeAlias{}, - &directiveIngress{}, &directiveCronJob{}, &directiveRetry{}, &directiveSubscriber{}, &directiveExport{}), + &directiveIngress{}, &directiveCronJob{}, &directiveRetry{}, &directiveSubscriber{}, &directiveExport{}, + &directiveTypeMap{}), participle.Union[schema.IngressPathComponent](&schema.IngressPathLiteral{}, &schema.IngressPathParameter{}), ) diff --git a/go-runtime/compile/schema_test.go b/go-runtime/compile/schema_test.go index 15316157c4..983979c2c9 100644 --- a/go-runtime/compile/schema_test.go +++ b/go-runtime/compile/schema_test.go @@ -188,9 +188,19 @@ func TestExtractModuleSchemaTwo(t *testing.T) { r, err := ExtractModuleSchema("testdata/two", &schema.Schema{}) assert.NoError(t, err) - assert.Equal(t, r.Errors, nil) + for _, e := range r.Errors { + // only warns + assert.True(t, e.Level == schema.WARN) + } actual := schema.Normalise(r.Module) expected := `module two { + typealias ExternalAlias Any + +typemap kotlin "com.foo.bar.AnotherNonFTLType" + +typemap go "github.com/TBD54566975/ftl/go-runtime/compile/testdata.lib.AnotherNonFTLType" + + typealias NonFtlType Any + +typemap go "github.com/TBD54566975/ftl/go-runtime/compile/testdata.lib.NonFTLType" + export enum TwoEnum: String { Red = "Red" Blue = "Blue" @@ -207,6 +217,10 @@ func TestExtractModuleSchemaTwo(t *testing.T) { export data Exported { } + data NonFtlField { + field two.NonFtlType + } + export data Payload { body T } diff --git a/go-runtime/compile/testdata/failing/go.mod b/go-runtime/compile/testdata/failing/go.mod index 7ad67df636..ecf14b65f6 100644 --- a/go-runtime/compile/testdata/failing/go.mod +++ b/go-runtime/compile/testdata/failing/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/failing/go.sum b/go-runtime/compile/testdata/failing/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/failing/go.sum +++ b/go-runtime/compile/testdata/failing/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/compile/testdata/lib.go b/go-runtime/compile/testdata/lib.go index 6032f8278f..23287c316a 100644 --- a/go-runtime/compile/testdata/lib.go +++ b/go-runtime/compile/testdata/lib.go @@ -11,3 +11,9 @@ type Response struct { func OtherFunc(ctx context.Context, req Request) (Response, error) { return Response{}, nil } + +type NonFTLType struct { + Message string +} + +type AnotherNonFTLType struct{} diff --git a/go-runtime/compile/testdata/one/go.mod b/go-runtime/compile/testdata/one/go.mod index 0bfce4765a..4f5aae28ab 100644 --- a/go-runtime/compile/testdata/one/go.mod +++ b/go-runtime/compile/testdata/one/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/one/go.sum b/go-runtime/compile/testdata/one/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/one/go.sum +++ b/go-runtime/compile/testdata/one/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/compile/testdata/one/types.ftl.go b/go-runtime/compile/testdata/one/types.ftl.go deleted file mode 100644 index e1c3e825de..0000000000 --- a/go-runtime/compile/testdata/one/types.ftl.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by FTL. DO NOT EDIT. -package one - -import "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" - -func init() { - reflection.Register( - reflection.SumType[BlobOrList]( - *new(Blob), - *new(List), - ), - reflection.SumType[PrivateEnum]( - *new(ExportedStruct), - *new(PrivateStruct), - *new(WithoutDirectiveStruct), - ), - reflection.SumType[TypeEnum]( - *new(Option), - *new(InlineStruct), - *new(AliasedStruct), - *new(ValueEnum), - ), - ) -} diff --git a/go-runtime/compile/testdata/parent/go.mod b/go-runtime/compile/testdata/parent/go.mod index 8168824965..1e1b91a9fd 100644 --- a/go-runtime/compile/testdata/parent/go.mod +++ b/go-runtime/compile/testdata/parent/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/parent/go.sum b/go-runtime/compile/testdata/parent/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/parent/go.sum +++ b/go-runtime/compile/testdata/parent/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/compile/testdata/parent/types.ftl.go b/go-runtime/compile/testdata/parent/types.ftl.go deleted file mode 100644 index ab06f98540..0000000000 --- a/go-runtime/compile/testdata/parent/types.ftl.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by FTL. DO NOT EDIT. -package parent - diff --git a/go-runtime/compile/testdata/pubsub/go.mod b/go-runtime/compile/testdata/pubsub/go.mod index b02c87d3a9..12015f64a4 100644 --- a/go-runtime/compile/testdata/pubsub/go.mod +++ b/go-runtime/compile/testdata/pubsub/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/pubsub/go.sum b/go-runtime/compile/testdata/pubsub/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/pubsub/go.sum +++ b/go-runtime/compile/testdata/pubsub/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/compile/testdata/pubsub/types.ftl.go b/go-runtime/compile/testdata/pubsub/types.ftl.go deleted file mode 100644 index d8ff9262c3..0000000000 --- a/go-runtime/compile/testdata/pubsub/types.ftl.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by FTL. DO NOT EDIT. -package pubsub - diff --git a/go-runtime/compile/testdata/subscriber/go.mod b/go-runtime/compile/testdata/subscriber/go.mod index ef40f0f77a..93489abdb4 100644 --- a/go-runtime/compile/testdata/subscriber/go.mod +++ b/go-runtime/compile/testdata/subscriber/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/subscriber/go.sum b/go-runtime/compile/testdata/subscriber/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/subscriber/go.sum +++ b/go-runtime/compile/testdata/subscriber/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/compile/testdata/subscriber/types.ftl.go b/go-runtime/compile/testdata/subscriber/types.ftl.go deleted file mode 100644 index 532a6f47ce..0000000000 --- a/go-runtime/compile/testdata/subscriber/types.ftl.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by FTL. DO NOT EDIT. -package subscriber - diff --git a/go-runtime/compile/testdata/two/go.mod b/go-runtime/compile/testdata/two/go.mod index 4d067ca5fb..5e740690b7 100644 --- a/go-runtime/compile/testdata/two/go.mod +++ b/go-runtime/compile/testdata/two/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/two/go.sum b/go-runtime/compile/testdata/two/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/two/go.sum +++ b/go-runtime/compile/testdata/two/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/compile/testdata/two/two.go b/go-runtime/compile/testdata/two/two.go index bc2d0579f3..9ef910dafe 100644 --- a/go-runtime/compile/testdata/two/two.go +++ b/go-runtime/compile/testdata/two/two.go @@ -3,6 +3,7 @@ package two import ( "context" + lib "github.com/TBD54566975/ftl/go-runtime/compile/testdata" "github.com/TBD54566975/ftl/go-runtime/ftl" ) @@ -66,3 +67,12 @@ func ReturnsUser(ctx context.Context) (UserResponse, error) { }, }, nil } + +//ftl:data +type NonFTLField struct { + Field lib.NonFTLType +} + +//ftl:typealias +//ftl:typemap kotlin "com.foo.bar.AnotherNonFTLType" +type ExternalAlias lib.AnotherNonFTLType diff --git a/go-runtime/compile/testdata/two/types.ftl.go b/go-runtime/compile/testdata/two/types.ftl.go index 78b9faf11a..1a3ff397fa 100644 --- a/go-runtime/compile/testdata/two/types.ftl.go +++ b/go-runtime/compile/testdata/two/types.ftl.go @@ -1,7 +1,11 @@ // Code generated by FTL. DO NOT EDIT. package two -import "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" +import ( + lib "github.com/TBD54566975/ftl/go-runtime/compile/testdata" + + "github.com/TBD54566975/ftl/go-runtime/ftl/reflection" +) func init() { reflection.Register( @@ -11,5 +15,7 @@ func init() { *new(Exported), *new(WithoutDirective), ), + reflection.ExternalType(*new(lib.AnotherNonFTLType)), + reflection.ExternalType(*new(lib.NonFTLType)), ) } diff --git a/go-runtime/compile/testdata/validation/go.mod b/go-runtime/compile/testdata/validation/go.mod index 3dc7b66874..3143b3b847 100644 --- a/go-runtime/compile/testdata/validation/go.mod +++ b/go-runtime/compile/testdata/validation/go.mod @@ -16,6 +16,7 @@ require ( github.com/alecthomas/types v0.16.0 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect diff --git a/go-runtime/compile/testdata/validation/go.sum b/go-runtime/compile/testdata/validation/go.sum index 1e8d4689ef..fe1ccb2da5 100644 --- a/go-runtime/compile/testdata/validation/go.sum +++ b/go-runtime/compile/testdata/validation/go.sum @@ -29,6 +29,8 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go-runtime/encoding/encoding.go b/go-runtime/encoding/encoding.go index 1989bb3783..f35098b008 100644 --- a/go-runtime/encoding/encoding.go +++ b/go-runtime/encoding/encoding.go @@ -47,6 +47,10 @@ func encodeValue(v reflect.Value, w *bytes.Buffer) error { t := v.Type() // Special-cased types switch { + case reflection.IsKnownExternalType(t): + // external types use the stdlib JSON encoding + fallthrough + case t == reflect.TypeFor[time.Time](): data, err := json.Marshal(v.Interface()) if err != nil { @@ -245,6 +249,10 @@ func decodeValue(d *json.Decoder, v reflect.Value) error { t := v.Type() // Special-case types switch { + case reflection.IsKnownExternalType(t): + // external types use the stdlib JSON decoding + fallthrough + case t == reflect.TypeFor[time.Time](): return d.Decode(v.Addr().Interface()) diff --git a/go-runtime/encoding/encoding_integration_test.go b/go-runtime/encoding/encoding_integration_test.go index b3dea04d91..e8a8c19c63 100644 --- a/go-runtime/encoding/encoding_integration_test.go +++ b/go-runtime/encoding/encoding_integration_test.go @@ -23,3 +23,17 @@ func TestHttpEncodeOmitempty(t *testing.T) { }), ) } + +func TestNonFTLTypes(t *testing.T) { + in.Run(t, "", + in.CopyModule("external"), + in.Deploy("external"), + in.Call("external", "echo", in.Obj{"external": in.Obj{"message": "hello"}}, func(t testing.TB, response in.Obj) { + if resp, ok := response["external"].(map[string]any); ok { + assert.Equal(t, "hello", resp["Message"]) + return + } + t.Fatalf("unexpected response: %v", response) + }), + ) +} diff --git a/go-runtime/encoding/testdata/go/external/external.go b/go-runtime/encoding/testdata/go/external/external.go new file mode 100644 index 0000000000..bac154a59a --- /dev/null +++ b/go-runtime/encoding/testdata/go/external/external.go @@ -0,0 +1,20 @@ +package external + +import ( + "context" + + lib "github.com/TBD54566975/ftl/go-runtime/encoding/testdata" +) + +type Request struct { + External lib.NonFTLType +} + +type Response struct { + External lib.NonFTLType +} + +//ftl:verb +func Echo(ctx context.Context, req Request) (Response, error) { + return Response{External: req.External}, nil +} diff --git a/go-runtime/encoding/testdata/go/external/ftl.toml b/go-runtime/encoding/testdata/go/external/ftl.toml new file mode 100644 index 0000000000..8dacc44933 --- /dev/null +++ b/go-runtime/encoding/testdata/go/external/ftl.toml @@ -0,0 +1,2 @@ +module = "external" +language = "go" diff --git a/go-runtime/encoding/testdata/go/external/go.mod b/go-runtime/encoding/testdata/go/external/go.mod new file mode 100644 index 0000000000..3a6acbbdd1 --- /dev/null +++ b/go-runtime/encoding/testdata/go/external/go.mod @@ -0,0 +1,45 @@ +module ftl/external + +go 1.22.2 + +require github.com/TBD54566975/ftl v0.206.1 + +require ( + connectrpc.com/connect v1.16.1 // indirect + connectrpc.com/grpcreflect v1.2.0 // indirect + connectrpc.com/otelconnect v0.7.0 // indirect + github.com/alecthomas/atomic v0.1.0-alpha2 // indirect + github.com/alecthomas/concurrency v0.0.2 // indirect + github.com/alecthomas/participle/v2 v2.1.1 // indirect + github.com/alecthomas/types v0.16.0 // indirect + github.com/alessio/shellescape v1.4.2 // indirect + github.com/danieljoos/wincred v1.2.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/godbus/dbus/v5 v5.1.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v5 v5.6.0 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect + github.com/jpillora/backoff v1.0.0 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect + github.com/puzpuzpuz/xsync/v3 v3.2.0 // indirect + github.com/swaggest/jsonschema-go v0.3.72 // indirect + github.com/swaggest/refl v1.3.0 // indirect + github.com/zalando/go-keyring v0.2.5 // indirect + go.opentelemetry.io/otel v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/trace v1.27.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect +) + +replace github.com/TBD54566975/ftl => ./../../../../.. diff --git a/go-runtime/encoding/testdata/go/external/go.sum b/go-runtime/encoding/testdata/go/external/go.sum new file mode 100644 index 0000000000..1e8d4689ef --- /dev/null +++ b/go-runtime/encoding/testdata/go/external/go.sum @@ -0,0 +1,144 @@ +connectrpc.com/connect v1.16.1 h1:rOdrK/RTI/7TVnn3JsVxt3n028MlTRwmK5Q4heSpjis= +connectrpc.com/connect v1.16.1/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw= +connectrpc.com/grpcreflect v1.2.0 h1:Q6og1S7HinmtbEuBvARLNwYmTbhEGRpHDhqrPNlmK+U= +connectrpc.com/grpcreflect v1.2.0/go.mod h1:nwSOKmE8nU5u/CidgHtPYk1PFI3U9ignz7iDMxOYkSY= +connectrpc.com/otelconnect v0.7.0 h1:ZH55ZZtcJOTKWWLy3qmL4Pam4RzRWBJFOqTPyAqCXkY= +connectrpc.com/otelconnect v0.7.0/go.mod h1:Bt2ivBymHZHqxvo4HkJ0EwHuUzQN6k2l0oH+mp/8nwc= +github.com/TBD54566975/scaffolder v1.0.0 h1:QUFSy2wVzumLDg7IHcKC6AP+IYyqWe9Wxiu72nZn5qU= +github.com/TBD54566975/scaffolder v1.0.0/go.mod h1:auVpczIbOAdIhYDVSruIw41DanxOKB9bSvjf6MEl7Fs= +github.com/alecthomas/assert/v2 v2.10.0 h1:jjRCHsj6hBJhkmhznrCzoNpbA3zqy0fYiUcYZP/GkPY= +github.com/alecthomas/assert/v2 v2.10.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8= +github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI= +github.com/alecthomas/concurrency v0.0.2 h1:Q3kGPtLbleMbH9lHX5OBFvJygfyFw29bXZKBg+IEVuo= +github.com/alecthomas/concurrency v0.0.2/go.mod h1:GmuQb/iHX7mbNtPlC/WDzEFxDMB0HYFer2Qda9QTs7w= +github.com/alecthomas/participle/v2 v2.1.1 h1:hrjKESvSqGHzRb4yW1ciisFJ4p3MGYih6icjJvbsmV8= +github.com/alecthomas/participle/v2 v2.1.1/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/types v0.16.0 h1:o9+JSwCRB6DDaWDeR/Mg7v/zh3R+MlknM6DrnDyY7U0= +github.com/alecthomas/types v0.16.0/go.mod h1:Tswm0qQpjpVq8rn70OquRsUtFxbQKub/8TMyYYGI0+k= +github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= +github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/bool64/dev v0.2.35 h1:M17TLsO/pV2J7PYI/gpe3Ua26ETkzZGb+dC06eoMqlk= +github.com/bool64/dev v0.2.35/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg= +github.com/bool64/shared v0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E= +github.com/bool64/shared v0.1.5/go.mod h1:081yz68YC9jeFB3+Bbmno2RFWvGKv1lPKkMP6MHJlPs= +github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= +github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/puzpuzpuz/xsync/v3 v3.2.0 h1:9AzuUeF88YC5bK8u2vEG1Fpvu4wgpM1wfPIExfaaDxQ= +github.com/puzpuzpuz/xsync/v3 v3.2.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ= +github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU= +github.com/swaggest/jsonschema-go v0.3.72 h1:IHaGlR1bdBUBPfhe4tfacN2TGAPKENEGiNyNzvnVHv4= +github.com/swaggest/jsonschema-go v0.3.72/go.mod h1:OrGyEoVqpfSFJ4Am4V/FQcQ3mlEC1vVeleA+5ggbVW4= +github.com/swaggest/refl v1.3.0 h1:PEUWIku+ZznYfsoyheF97ypSduvMApYyGkYF3nabS0I= +github.com/swaggest/refl v1.3.0/go.mod h1:3Ujvbmh1pfSbDYjC6JGG7nMgPvpG0ehQL4iNonnLNbg= +github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= +github.com/zalando/go-keyring v0.2.5 h1:Bc2HHpjALryKD62ppdEzaFG6VxL6Bc+5v0LYpN8Lba8= +github.com/zalando/go-keyring v0.2.5/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 h1:LoYXNGAShUG3m/ehNk4iFctuhGX/+R1ZpfJ4/ia80JM= +golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.52.1 h1:uau0VoiT5hnR+SpoWekCKbLqm7v6dhRL3hI+NQhgN3M= +modernc.org/libc v1.52.1/go.mod h1:HR4nVzFDSDizP620zcMCgjb1/8xk2lg5p/8yjfGv1IQ= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/sqlite v1.30.1 h1:YFhPVfu2iIgUf9kuA1CR7iiHdcEEsI2i+yjRYHscyxk= +modernc.org/sqlite v1.30.1/go.mod h1:DUmsiWQDaAvU4abhc/N+djlom/L2o8f7gZ95RCvyoLU= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/go-runtime/encoding/testdata/lib.go b/go-runtime/encoding/testdata/lib.go new file mode 100644 index 0000000000..0d4a34e1df --- /dev/null +++ b/go-runtime/encoding/testdata/lib.go @@ -0,0 +1,7 @@ +package lib + +type NonFTLType struct { + Message string +} + +type AnotherNonFTLType struct{} diff --git a/go-runtime/ftl/reflection/singleton.go b/go-runtime/ftl/reflection/singleton.go index bc2f060dd1..e990f197fc 100644 --- a/go-runtime/ftl/reflection/singleton.go +++ b/go-runtime/ftl/reflection/singleton.go @@ -48,3 +48,7 @@ func GetDiscriminatorByVariant(variant reflect.Type) optional.Option[reflect.Typ func IsSumTypeDiscriminator(discriminator reflect.Type) bool { return singletonTypeRegistry.isSumTypeDiscriminator(discriminator) } + +func IsKnownExternalType(t reflect.Type) bool { + return singletonTypeRegistry.externalTypes.Contains(t) +} diff --git a/go-runtime/ftl/reflection/type_registry.go b/go-runtime/ftl/reflection/type_registry.go index 8c603a2e86..371b634408 100644 --- a/go-runtime/ftl/reflection/type_registry.go +++ b/go-runtime/ftl/reflection/type_registry.go @@ -4,6 +4,7 @@ import ( "reflect" "github.com/alecthomas/types/optional" + sets "github.com/deckarep/golang-set/v2" "github.com/TBD54566975/ftl/backend/schema" ) @@ -16,6 +17,7 @@ type TypeRegistry struct { sumTypes map[reflect.Type][]sumTypeVariant variantsToDiscriminators map[reflect.Type]reflect.Type fsm map[string]ReflectedFSM + externalTypes sets.Set[reflect.Type] } type sumTypeVariant struct { @@ -54,6 +56,14 @@ func FSM(name string, transitions ...Transition) Registree { return func(t *TypeRegistry) { t.registerFSM(name, transitions) } } +// ExternalType adds a non-FTL type to the type registry. +func ExternalType(goType any) Registree { + return func(t *TypeRegistry) { + typ := reflect.TypeOf(goType) + t.externalTypes.Add(typ) + } +} + // newTypeRegistry creates a new [TypeRegistry] for instantiating types by their qualified // name at runtime. func newTypeRegistry(options ...Registree) *TypeRegistry { @@ -61,6 +71,7 @@ func newTypeRegistry(options ...Registree) *TypeRegistry { sumTypes: map[reflect.Type][]sumTypeVariant{}, variantsToDiscriminators: map[reflect.Type]reflect.Type{}, fsm: map[string]ReflectedFSM{}, + externalTypes: sets.NewSet[reflect.Type](), } for _, o := range options { o(t) @@ -140,10 +151,5 @@ func (t *TypeRegistry) getVariantByType(discriminator reflect.Type, variantType } func (t *TypeRegistry) getSumTypeVariants(discriminator reflect.Type) optional.Option[[]sumTypeVariant] { - variants, ok := t.sumTypes[discriminator] - if !ok { - return optional.None[[]sumTypeVariant]() - } - - return optional.Some(variants) + return optional.Zero(t.sumTypes[discriminator]) } diff --git a/go-runtime/schema/common/common.go b/go-runtime/schema/common/common.go index 07d159c875..ee260f3cac 100644 --- a/go-runtime/schema/common/common.go +++ b/go-runtime/schema/common/common.go @@ -260,7 +260,7 @@ func GetObjectForNode(typesInfo *types.Info, node ast.Node) optional.Option[type return optional.Some(obj) } -func GetTypeForNode(node ast.Node, info *types.Info) types.Type { +func GetTypeInfoForNode(node ast.Node, info *types.Info) types.Type { switch n := node.(type) { case *ast.Ident: if obj := info.ObjectOf(n); obj != nil { @@ -290,7 +290,7 @@ func GetTypeForNode(node ast.Node, info *types.Info) types.Type { } case *ast.GenDecl: for _, spec := range n.Specs { - if t := GetTypeForNode(spec, info); t != nil { + if t := GetTypeInfoForNode(spec, info); t != nil { return t } } @@ -307,8 +307,17 @@ func extractRef(pass *analysis.Pass, pos token.Pos, named *types.Named) optional nodePath := named.Obj().Pkg().Path() if !IsPathInPkg(pass.Pkg, nodePath) && !strings.HasPrefix(named.Obj().Pkg().Path(), "ftl/") { - NoEndColumnErrorf(pass, pos, "unsupported external type %q", named.Obj().Pkg().Path()+"."+named.Obj().Name()) - return optional.None[schema.Type]() + mainModuleName, err := FtlModuleFromGoPackage(pass.Pkg.Path()) + if err != nil { + noEndColumnWrapf(pass, pos, err, "") + return optional.None[schema.Type]() + } + markNeedsExtraction(pass, named.Obj()) + return optional.Some[schema.Type](&schema.Ref{ + Pos: GoPosToSchemaPos(pass.Fset, pos), + Module: mainModuleName, + Name: strcase.ToUpperCamel(named.Obj().Name()), + }) } moduleName, err := FtlModuleFromGoPackage(nodePath) @@ -322,6 +331,7 @@ func extractRef(pass *analysis.Pass, pos token.Pos, named *types.Named) optional Module: moduleName, Name: strcase.ToUpperCamel(named.Obj().Name()), } + for i := range named.TypeArgs().Len() { typeArg, ok := ExtractType(pass, pos, named.TypeArgs().At(i)).Get() if !ok { @@ -404,7 +414,20 @@ func ExtractTypeForNode(pass *analysis.Pass, obj types.Object, node ast.Node, in } return ExtractType(pass, node.Pos(), index) default: // Data ref - externalModuleName, err := FtlModuleFromGoPackage(im.Path()) + if strings.HasPrefix(im.Path(), pass.Pkg.Path()) { + // subpackage + return ExtractType(pass, node.Pos(), pass.TypesInfo.TypeOf(typ.Sel)) + } + + var modulePath string + if !IsPathInPkg(pass.Pkg, im.Path()) && !strings.HasPrefix(im.Path(), "ftl/") { + // Non-FTL + modulePath = pass.Pkg.Path() + } else { + // FTL + modulePath = im.Path() + } + externalModuleName, err := FtlModuleFromGoPackage(modulePath) if err != nil { return optional.None[schema.Type]() } @@ -422,7 +445,7 @@ func ExtractTypeForNode(pass *analysis.Pass, obj types.Object, node ast.Node, in } default: - variantNode := GetTypeForNode(node, pass.TypesInfo) + variantNode := GetTypeInfoForNode(node, pass.TypesInfo) if _, ok := variantNode.(*types.Struct); ok { variantNode = obj.Type() } @@ -453,5 +476,9 @@ func isLocalRef(pass *analysis.Pass, ref *schema.Ref) bool { } func GetNativeName(obj types.Object) string { - return obj.Pkg().Path() + "." + obj.Name() + fqName := obj.Pkg().Path() + if parts := strings.Split(obj.Pkg().Path(), "/"); parts[len(parts)-1] != obj.Pkg().Name() { + fqName = fqName + "." + obj.Pkg().Name() + } + return fqName + "." + obj.Name() } diff --git a/go-runtime/schema/common/directive.go b/go-runtime/schema/common/directive.go index 47c68fd442..76fb2f9993 100644 --- a/go-runtime/schema/common/directive.go +++ b/go-runtime/schema/common/directive.go @@ -275,13 +275,38 @@ func (d *DirectiveExport) GetPosition() token.Pos { } func (*DirectiveExport) MustAnnotate() []ast.Node { return []ast.Node{&ast.GenDecl{}} } +// DirectiveTypeMap is used to declare a native type to deserialize to in a given runtime. +type DirectiveTypeMap struct { + Pos token.Pos + + Runtime string `parser:"'typemap' @('go' | 'kotlin')"` + NativeName string `parser:"@String"` +} + +func (*DirectiveTypeMap) directive() {} + +func (d *DirectiveTypeMap) String() string { + return fmt.Sprintf("typemap %s %q", d.Runtime, d.NativeName) +} +func (*DirectiveTypeMap) GetTypeName() string { return "typemap" } +func (d *DirectiveTypeMap) SetPosition(pos token.Pos) { + d.Pos = pos +} +func (d *DirectiveTypeMap) GetPosition() token.Pos { + return d.Pos +} +func (*DirectiveTypeMap) MustAnnotate() []ast.Node { + return []ast.Node{&ast.GenDecl{}} +} + var directiveParser = participle.MustBuild[directiveWrapper]( participle.Lexer(schema.Lexer), participle.Elide("Whitespace"), participle.Unquote(), participle.UseLookahead(2), participle.Union[Directive](&DirectiveVerb{}, &DirectiveData{}, &DirectiveEnum{}, &DirectiveTypeAlias{}, - &DirectiveIngress{}, &DirectiveCronJob{}, &DirectiveRetry{}, &DirectiveSubscriber{}, &DirectiveExport{}), + &DirectiveIngress{}, &DirectiveCronJob{}, &DirectiveRetry{}, &DirectiveSubscriber{}, &DirectiveExport{}, + &DirectiveTypeMap{}), participle.Union[schema.IngressPathComponent](&schema.IngressPathLiteral{}, &schema.IngressPathParameter{}), ) diff --git a/go-runtime/schema/common/error.go b/go-runtime/schema/common/error.go index a475600b7a..f7d1649f99 100644 --- a/go-runtime/schema/common/error.go +++ b/go-runtime/schema/common/error.go @@ -31,6 +31,10 @@ func (e DiagnosticCategory) ToErrorLevel() schema.ErrorLevel { } } +func NoEndColumnWarnf(pass *analysis.Pass, pos token.Pos, format string, args ...interface{}) { + pass.Report(analysis.Diagnostic{Pos: pos, End: pos, Message: fmt.Sprintf(format, args...), Category: string(Warn)}) +} + func Errorf(pass *analysis.Pass, node ast.Node, format string, args ...interface{}) { errorfAtPos(pass, node.Pos(), node.End(), format, args...) } diff --git a/go-runtime/schema/common/fact.go b/go-runtime/schema/common/fact.go index 2b47232e22..3e8cd91892 100644 --- a/go-runtime/schema/common/fact.go +++ b/go-runtime/schema/common/fact.go @@ -5,7 +5,6 @@ import ( "reflect" "github.com/alecthomas/types/optional" - sets "github.com/deckarep/golang-set/v2" "github.com/TBD54566975/ftl/backend/schema" "github.com/TBD54566975/golang-tools/go/analysis" @@ -41,11 +40,6 @@ type SchemaFactValue interface { // ExtractedDecl is a fact for associating an object with an extracted schema decl. type ExtractedDecl struct { Decl schema.Decl - // ShouldInclude is true if the object should be included in the schema. - // We extract all objects by default, but some objects may not actually be referenced in the schema. - ShouldInclude bool - // Refs is a list of objects that the object references. - Refs sets.Set[types.Object] } func (*ExtractedDecl) schemaFactValue() {} @@ -73,7 +67,7 @@ func (*FailedExtraction) schemaFactValue() {} // MarkSchemaDecl marks the given object as having been extracted to the given schema node. func MarkSchemaDecl(pass *analysis.Pass, obj types.Object, decl schema.Decl) { fact := newFact(pass) - fact.Set(&ExtractedDecl{Decl: decl, Refs: sets.NewSet[types.Object]()}) + fact.Set(&ExtractedDecl{Decl: decl}) pass.ExportObjectFact(obj, fact) } diff --git a/go-runtime/schema/extract.go b/go-runtime/schema/extract.go index bb75038e96..27e6e1f7bf 100644 --- a/go-runtime/schema/extract.go +++ b/go-runtime/schema/extract.go @@ -123,11 +123,21 @@ func combineAllPackageResults(results map[*analysis.Analyzer][]any, diagnostics maps.Copy(extractedDecls, fr.Extracted) } + widenedRefs := make(map[schema.RefKey]string) combined.Module.AddDecls(maps.Keys(extractedDecls)) for decl, obj := range extractedDecls { + if ta, ok := decl.(*schema.TypeAlias); ok && len(ta.Metadata) > 0 { + fqName, err := goQualifiedNameForWidenedType(obj, ta.Metadata) + if err != nil { + combined.Errors = append(combined.Errors, &schema.Error{Pos: ta.Position(), EndColumn: ta.Pos.Column, + Msg: err.Error(), Level: schema.ERROR}) + continue + } + widenedRefs[schema.RefKey{Module: combined.Module.Name, Name: ta.Name}] = fqName + } combined.NativeNames[decl] = common.GetNativeName(obj) } - combined.Errors = append(combined.Errors, propagateTypeErrors(combined.Module, failedRefs)...) + combined.Errors = append(combined.Errors, propagateTypeErrors(combined.Module, failedRefs, widenedRefs)...) schema.SortErrorsByPosition(combined.Errors) updateVisibility(combined.Module) // TODO: validate schema once we have the full schema here @@ -182,7 +192,7 @@ func updateTransitiveVisibility(d schema.Decl, module *schema.Module) { // propagateTypeErrors propagates type errors to referencing nodes. This improves error messaging for the LSP client by // surfacing errors all the way up the schema chain. -func propagateTypeErrors(module *schema.Module, failedRefs map[schema.RefKey]types.Object) []*schema.Error { +func propagateTypeErrors(module *schema.Module, failedRefs map[schema.RefKey]types.Object, widenedRefs map[schema.RefKey]string) []*schema.Error { var errs []*schema.Error _ = schema.VisitWithParent(module, nil, func(n schema.Node, p schema.Node, next func() error) error { //nolint:errcheck if p == nil { @@ -211,7 +221,14 @@ func propagateTypeErrors(module *schema.Module, failedRefs map[schema.RefKey]typ errs = append(errs, schema.Errorf(p.Position(), p.Position().Column, "unsupported type %q", refNativeName)) } + return next() } + + if goNativeName, ok := widenedRefs[ref.ToRefKey()]; ok { + errs = append(errs, schema.Warnf(p.Position(), p.Position().Column, "external type %q will be "+ + "widened to Any", goNativeName)) + } + return next() }) return errs @@ -249,3 +266,17 @@ func simplePosToSchemaPos(pos analysis.SimplePosition) schema.Position { Column: pos.Column, } } + +func goQualifiedNameForWidenedType(obj types.Object, metadata []schema.Metadata) (string, error) { + var nativeName string + for _, m := range metadata { + if m, ok := m.(*schema.MetadataTypeMap); ok && m.Runtime == "go" { + nativeName = m.NativeName + } + } + if nativeName == "" { + return "", fmt.Errorf("missing Go native name in typemapped alias for %q", + common.GetNativeName(obj)) + } + return nativeName, nil +} diff --git a/go-runtime/schema/metadata/analyzer.go b/go-runtime/schema/metadata/analyzer.go index cb0334cda6..6d90de62c3 100644 --- a/go-runtime/schema/metadata/analyzer.go +++ b/go-runtime/schema/metadata/analyzer.go @@ -125,6 +125,13 @@ func extractMetadata(pass *analysis.Pass, node ast.Node, doc *ast.CommentGroup) Pos: common.GoPosToSchemaPos(pass.Fset, dt.Pos), Name: dt.Name, }) + case *common.DirectiveTypeMap: + newSchType = &schema.TypeAlias{} + metadata = append(metadata, &schema.MetadataTypeMap{ + Pos: common.GoPosToSchemaPos(pass.Fset, dt.GetPosition()), + Runtime: dt.Runtime, + NativeName: dt.NativeName, + }) case *common.DirectiveVerb: newSchType = &schema.Verb{} case *common.DirectiveData: @@ -133,11 +140,10 @@ func extractMetadata(pass *analysis.Pass, node ast.Node, doc *ast.CommentGroup) case *common.DirectiveEnum: requireOnlyDirective(pass, node, directives, dt.GetTypeName()) newSchType = &schema.Enum{} - case *common.DirectiveTypeAlias: - requireOnlyDirective(pass, node, directives, dt.GetTypeName()) - newSchType = &schema.TypeAlias{} case *common.DirectiveExport: requireOnlyDirective(pass, node, directives, dt.GetTypeName()) + case *common.DirectiveTypeAlias: + newSchType = &schema.TypeAlias{} } declType = updateDeclType(pass, node.Pos(), declType, newSchType) } diff --git a/go-runtime/schema/transitive/analyzer.go b/go-runtime/schema/transitive/analyzer.go index c7b44d0d0b..3e30aecb02 100644 --- a/go-runtime/schema/transitive/analyzer.go +++ b/go-runtime/schema/transitive/analyzer.go @@ -3,7 +3,9 @@ package transitive import ( "go/ast" "go/types" + "strings" + "github.com/TBD54566975/ftl/backend/schema/strcase" "github.com/alecthomas/types/optional" sets "github.com/deckarep/golang-set/v2" @@ -49,7 +51,7 @@ func refreshNeedsExtraction(pass *analysis.Pass) sets.Set[types.Object] { if !ok { continue } - if _, ok := f.Get().(*common.NeedsExtraction); ok && fact.Object.Pkg().Path() == pass.Pkg.Path() { + if _, ok := f.Get().(*common.NeedsExtraction); ok { facts.Add(fact.Object) } } @@ -88,6 +90,25 @@ func extractTransitive(pass *analysis.Pass, needsExtraction sets.Set[types.Objec common.MarkFailedExtraction(pass, obj) } }) + + // widen external types to an alias of schema.Any + for _, obj := range needsExtraction.ToSlice() { + if obj.Pkg().Path() != pass.Pkg.Path() && !strings.HasPrefix(obj.Pkg().Path(), "ftl/") { + externalTypeAlias := &schema.TypeAlias{ + Pos: common.GoPosToSchemaPos(pass.Fset, obj.Pos()), + Name: strcase.ToUpperCamel(obj.Name()), + Type: &schema.Any{}, + Metadata: []schema.Metadata{ + &schema.MetadataTypeMap{ + Pos: common.GoPosToSchemaPos(pass.Fset, obj.Pos()), + Runtime: "go", + NativeName: common.GetNativeName(obj), + }, + }, + } + common.MarkSchemaDecl(pass, obj, externalTypeAlias) + } + } } func inferDeclType(pass *analysis.Pass, node ast.Node, obj types.Object) optional.Option[schema.Decl] { diff --git a/go-runtime/schema/typealias/analyzer.go b/go-runtime/schema/typealias/analyzer.go index 36c6103cf1..90d092b4aa 100644 --- a/go-runtime/schema/typealias/analyzer.go +++ b/go-runtime/schema/typealias/analyzer.go @@ -3,6 +3,7 @@ package typealias import ( "go/ast" "go/types" + "strings" "github.com/alecthomas/types/optional" @@ -16,14 +17,11 @@ import ( var Extractor = common.NewDeclExtractor[*schema.TypeAlias, *ast.TypeSpec]("typealias", Extract) func Extract(pass *analysis.Pass, node *ast.TypeSpec, obj types.Object) optional.Option[*schema.TypeAlias] { - schType, ok := common.ExtractTypeForNode(pass, obj, node, nil).Get() + schType, ok := common.ExtractTypeForNode(pass, obj, node.Type, nil).Get() if !ok { return optional.None[*schema.TypeAlias]() } - // type aliases must have an underlying type, and the type cannot be a reference to the alias itself. - if common.IsSelfReference(pass, obj, schType) { - return optional.None[*schema.TypeAlias]() - } + alias := &schema.TypeAlias{ Pos: common.GoPosToSchemaPos(pass.Fset, node.Pos()), Name: strcase.ToUpperCamel(obj.Name()), @@ -32,6 +30,70 @@ func Extract(pass *analysis.Pass, node *ast.TypeSpec, obj types.Object) optional if md, ok := common.GetFactForObject[*common.ExtractedMetadata](pass, obj).Get(); ok { alias.Comments = md.Comments alias.Export = md.IsExported + alias.Metadata = md.Metadata + + if len(md.Metadata) >= 0 { + hasGoTypeMap := false + nativeName := qualifiedNameFromSelectorExpr(pass, node.Type) + if nativeName == "" { + return optional.None[*schema.TypeAlias]() + } + for _, m := range md.Metadata { + if mt, ok := m.(*schema.MetadataTypeMap); ok { + if mt.Runtime != "go" { + continue + } + if nativeName != mt.NativeName { + common.Errorf(pass, node, "declared type %s in typemap does not match native type %s", + mt.NativeName, nativeName) + return optional.None[*schema.TypeAlias]() + } + hasGoTypeMap = true + } else { + common.Errorf(pass, node, "unexpected directive on typealias %s", m) + } + } + + // if this alias contains any type mappings, implicitly add a Go type mapping if not already present + if !hasGoTypeMap { + alias.Metadata = append(alias.Metadata, &schema.MetadataTypeMap{ + Pos: common.GoPosToSchemaPos(pass.Fset, obj.Pos()), + Runtime: "go", + NativeName: nativeName, + }) + } + alias.Type = &schema.Any{} + return optional.Some(alias) + } + } + + // type aliases must have an underlying type, and the type cannot be a reference to the alias itself. + if common.IsSelfReference(pass, obj, schType) { + return optional.None[*schema.TypeAlias]() } + return optional.Some(alias) } + +func qualifiedNameFromSelectorExpr(pass *analysis.Pass, node ast.Node) string { + se, ok := node.(*ast.SelectorExpr) + if !ok { + return "" + } + ident, ok := se.X.(*ast.Ident) + if !ok { + return "" + } + for _, im := range pass.Pkg.Imports() { + if im.Name() != ident.Name { + continue + } + fqName := im.Path() + if parts := strings.Split(im.Path(), "/"); parts[len(parts)-1] != ident.Name { + // if package differs from the directory name, add the package name to the fqName + fqName = fqName + "." + ident.Name + } + return fqName + "." + se.Sel.Name + } + return "" +} diff --git a/lsp/logger.go b/lsp/logger.go index 1c696735b3..3a506fceb0 100644 --- a/lsp/logger.go +++ b/lsp/logger.go @@ -15,8 +15,13 @@ func NewLogSink(server *Server) *LogSink { } func (l *LogSink) Log(entry log.Entry) error { - if entry.Level == log.Error { + switch entry.Level { + case log.Error: l.server.post(entry.Error) + case log.Warn: + if entry.Error != nil { + l.server.post(entry.Error) + } } return nil }