From f5ee4f1053a9c48b172d45b34ae453ff7c78e289 Mon Sep 17 00:00:00 2001 From: Guilhem Fanton Date: Mon, 10 Sep 2018 16:42:41 +0200 Subject: [PATCH] feat(relay): Update tmpl for relay spec (mutation, obj id) --- core/Makefile | 2 +- core/api/node/graphql/converts.go | 28 +- core/api/node/graphql/graph/graph.gen.go | 1606 ++++++++++++++++----- core/api/node/graphql/model/model.gen.go | 76 +- core/api/node/graphql/resolver.go | 163 ++- core/api/node/graphql/service.gen.graphql | 237 ++- core/api/node/service.gen.graphql.tmpl | 120 +- core/api/node/service.pb.go | 154 +- core/api/node/service.proto | 56 +- core/api/protobuf/graphql.proto | 15 + core/entity/contact.pb.go | 78 +- core/entity/contact.proto | 3 +- core/entity/conversation.pb.go | 76 +- core/entity/conversation.proto | 5 +- core/entity/device.pb.go | 66 +- core/entity/device.proto | 3 +- 16 files changed, 2006 insertions(+), 682 deletions(-) create mode 100644 core/api/protobuf/graphql.proto diff --git a/core/Makefile b/core/Makefile index a293a02faa..864562f67d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -132,5 +132,5 @@ api/p2p/kind.gen.go: $(PROTOS) goimports -w ./api/p2p api/node/graphql/service.gen.graphql: $(PROTOS) - $(PROTOC) $(PROTOC_OPTS) --gotemplate_out=debug=false,all=true,template_dir=./api/node:./api/node/graphql ./api/node/service.proto + $(PROTOC) $(PROTOC_OPTS) --gotemplate_out=debug=true,all=true,template_dir=./api/node:./api/node/graphql ./api/node/service.proto cd ./api/node/graphql && $(GQLGEN) -v gen diff --git a/core/api/node/graphql/converts.go b/core/api/node/graphql/converts.go index b452fcb80d..7546572d25 100644 --- a/core/api/node/graphql/converts.go +++ b/core/api/node/graphql/converts.go @@ -28,19 +28,19 @@ func convertContactStatus(value entity.Contact_Status) *model.BertyEntityContact return &ret } -func convertContact(contact *entity.Contact, err error) (*model.BertyEntityContact, error) { +func convertContact(contact *entity.Contact) *model.BertyEntityContact { if contact == nil { - return &model.BertyEntityContact{}, err + return &model.BertyEntityContact{} } return &model.BertyEntityContact{ - ID: &contact.ID, + ID: contact.ID, Status: convertContactStatus(contact.Status), DisplayName: &contact.DisplayName, CreatedAt: &scalar.DateTime{Value: &contact.CreatedAt}, UpdatedAt: &scalar.DateTime{Value: &contact.UpdatedAt}, DeletedAt: &scalar.DateTime{Value: contact.DeletedAt}, - }, err + } } func convertConversationMemberStatus(value entity.ConversationMember_Status) *model.BertyEntityConversationMemberStatus { @@ -64,12 +64,10 @@ func convertConversationMember(conversationMember *entity.ConversationMember) *m return &model.BertyEntityConversationMember{} } - contact, _ := convertContact(conversationMember.Contact, nil) - return &model.BertyEntityConversationMember{ - ID: &conversationMember.ID, + ID: conversationMember.ID, Status: convertConversationMemberStatus(conversationMember.Status), - Contact: contact, + Contact: convertContact(conversationMember.Contact), ConversationID: &conversationMember.ConversationID, ContactID: &conversationMember.ContactID, CreatedAt: &scalar.DateTime{Value: &conversationMember.CreatedAt}, @@ -78,9 +76,9 @@ func convertConversationMember(conversationMember *entity.ConversationMember) *m } } -func convertConversation(conversation *entity.Conversation, err error) (*model.BertyEntityConversation, error) { +func convertConversation(conversation *entity.Conversation) *model.BertyEntityConversation { if conversation == nil { - return &model.BertyEntityConversation{}, err + return &model.BertyEntityConversation{} } var members []*model.BertyEntityConversationMember @@ -94,14 +92,14 @@ func convertConversation(conversation *entity.Conversation, err error) (*model.B } return &model.BertyEntityConversation{ - ID: &conversation.ID, + ID: conversation.ID, Title: &conversation.Title, Topic: &conversation.Topic, Members: members, CreatedAt: &scalar.DateTime{Value: &conversation.CreatedAt}, UpdatedAt: &scalar.DateTime{Value: &conversation.UpdatedAt}, DeletedAt: &scalar.DateTime{Value: conversation.DeletedAt}, - }, err + } } func convertUint32(value uint32) *int { @@ -120,9 +118,9 @@ func convertBytes(value *[]byte) *string { return &encoded } -func convertEvent(event *p2p.Event, err error) (*model.BertyP2pEvent, error) { +func convertEvent(event *p2p.Event) *model.BertyP2pEvent { if event == nil { - return &model.BertyP2pEvent{}, err + return &model.BertyP2pEvent{} } return &model.BertyP2pEvent{ @@ -141,7 +139,7 @@ func convertEvent(event *p2p.Event, err error) (*model.BertyP2pEvent, error) { SentAt: &scalar.DateTime{Value: event.SentAt}, ReceivedAt: &scalar.DateTime{Value: event.ReceivedAt}, AckedAt: &scalar.DateTime{Value: event.AckedAt}, - }, err + } } func convertEventKind(value p2p.Kind) *model.BertyP2pKind { diff --git a/core/api/node/graphql/graph/graph.gen.go b/core/api/node/graphql/graph/graph.gen.go index 7cce81090b..2369fa6238 100644 --- a/core/api/node/graphql/graph/graph.gen.go +++ b/core/api/node/graphql/graph/graph.gen.go @@ -38,16 +38,17 @@ type ResolverRoot interface { type DirectiveRoot struct { } type MutationResolver interface { - ContactRequest(ctx context.Context, contactID string, introText *string) (*model.BertyEntityContact, error) - ContactRemove(ctx context.Context, contactID string) (*model.BertyEntityContact, error) - ContactUpdate(ctx context.Context, contactID string, displayName *string) (*model.BertyEntityContact, error) - ConversationCreate(ctx context.Context, contactsID []string) (*model.BertyEntityConversation, error) - ConversationInvite(ctx context.Context, conversationID string, contactsID []string) (*model.BertyEntityConversation, error) - ConversationExclude(ctx context.Context, conversationID string, contactsID []string) (*model.BertyEntityConversation, error) - ConversationAddMessage(ctx context.Context, conversationID string, message string) (*model.BertyP2pEvent, error) - GenerateFakeData(ctx context.Context) (*model.BertyNodeVoid, error) + ContactRequest(ctx context.Context, input model.ContactRequestInput) (*model.ContactRequestPayload, error) + ContactRemove(ctx context.Context, input model.ContactRemoveInput) (*model.ContactRemovePayload, error) + ContactUpdate(ctx context.Context, input model.ContactUpdateInput) (*model.ContactUpdatePayload, error) + ConversationCreate(ctx context.Context, input model.ConversationCreateInput) (*model.ConversationCreatePayload, error) + ConversationInvite(ctx context.Context, input model.ConversationInviteInput) (*model.ConversationInvitePayload, error) + ConversationExclude(ctx context.Context, input model.ConversationExcludeInput) (*model.ConversationExcludePayload, error) + ConversationAddMessage(ctx context.Context, input model.ConversationAddMessageInput) (*model.ConversationAddMessagePayload, error) + GenerateFakeData(ctx context.Context, input model.GenerateFakeDataInput) (*model.GenerateFakeDataPayload, error) } type QueryResolver interface { + Node(ctx context.Context, id string) (model.Node, error) EventList(ctx context.Context, limit *int) ([]*model.BertyP2pEvent, error) ContactList(ctx context.Context) ([]*model.BertyEntityContact, error) ConversationList(ctx context.Context) ([]*model.BertyEntityConversation, error) @@ -130,7 +131,7 @@ type executionContext struct { *executableSchema } -var bertyEntityContactImplementors = []string{"BertyEntityContact"} +var bertyEntityContactImplementors = []string{"BertyEntityContact", "Node"} // nolint: gocyclo, errcheck, gas, goconst func (ec *executionContext) _BertyEntityContact(ctx context.Context, sel ast.SelectionSet, obj *model.BertyEntityContact) graphql.Marshaler { @@ -186,11 +187,8 @@ func (ec *executionContext) _BertyEntityContact_id(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*string) - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) + res := resTmp.(string) + return graphql.MarshalID(res) } func (ec *executionContext) _BertyEntityContact_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.BertyEntityContact) graphql.Marshaler { @@ -402,7 +400,7 @@ func (ec *executionContext) _BertyEntityContact_overrideDisplayStatus(ctx contex return graphql.MarshalString(*res) } -var bertyEntityConversationImplementors = []string{"BertyEntityConversation"} +var bertyEntityConversationImplementors = []string{"BertyEntityConversation", "Node"} // nolint: gocyclo, errcheck, gas, goconst func (ec *executionContext) _BertyEntityConversation(ctx context.Context, sel ast.SelectionSet, obj *model.BertyEntityConversation) graphql.Marshaler { @@ -450,11 +448,8 @@ func (ec *executionContext) _BertyEntityConversation_id(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*string) - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) + res := resTmp.(string) + return graphql.MarshalID(res) } func (ec *executionContext) _BertyEntityConversation_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.BertyEntityConversation) graphql.Marshaler { @@ -586,7 +581,7 @@ func (ec *executionContext) _BertyEntityConversation_members(ctx context.Context return arr1 } -var bertyEntityConversationMemberImplementors = []string{"BertyEntityConversationMember"} +var bertyEntityConversationMemberImplementors = []string{"BertyEntityConversationMember", "Node"} // nolint: gocyclo, errcheck, gas, goconst func (ec *executionContext) _BertyEntityConversationMember(ctx context.Context, sel ast.SelectionSet, obj *model.BertyEntityConversationMember) graphql.Marshaler { @@ -636,11 +631,8 @@ func (ec *executionContext) _BertyEntityConversationMember_id(ctx context.Contex if resTmp == nil { return graphql.Null } - res := resTmp.(*string) - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) + res := resTmp.(string) + return graphql.MarshalID(res) } func (ec *executionContext) _BertyEntityConversationMember_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.BertyEntityConversationMember) graphql.Marshaler { @@ -783,7 +775,7 @@ func (ec *executionContext) _BertyEntityConversationMember_contactId(ctx context return graphql.MarshalString(*res) } -var bertyEntityDeviceImplementors = []string{"BertyEntityDevice"} +var bertyEntityDeviceImplementors = []string{"BertyEntityDevice", "Node"} // nolint: gocyclo, errcheck, gas, goconst func (ec *executionContext) _BertyEntityDevice(ctx context.Context, sel ast.SelectionSet, obj *model.BertyEntityDevice) graphql.Marshaler { @@ -833,11 +825,8 @@ func (ec *executionContext) _BertyEntityDevice_id(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*string) - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) + res := resTmp.(string) + return graphql.MarshalID(res) } func (ec *executionContext) _BertyEntityDevice_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.BertyEntityDevice) graphql.Marshaler { @@ -2178,11 +2167,11 @@ func (ec *executionContext) _BertyP2pSentAttrs_ids(ctx context.Context, field gr return arr1 } -var googleProtobufDescriptorProtoImplementors = []string{"GoogleProtobufDescriptorProto"} +var contactRemovePayloadImplementors = []string{"ContactRemovePayload"} // nolint: gocyclo, errcheck, gas, goconst -func (ec *executionContext) _GoogleProtobufDescriptorProto(ctx context.Context, sel ast.SelectionSet, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, googleProtobufDescriptorProtoImplementors) +func (ec *executionContext) _ContactRemovePayload(ctx context.Context, sel ast.SelectionSet, obj *model.ContactRemovePayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, contactRemovePayloadImplementors) out := graphql.NewOrderedMap(len(fields)) for i, field := range fields { @@ -2190,27 +2179,11 @@ func (ec *executionContext) _GoogleProtobufDescriptorProto(ctx context.Context, switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("GoogleProtobufDescriptorProto") - case "name": - out.Values[i] = ec._GoogleProtobufDescriptorProto_name(ctx, field, obj) - case "field": - out.Values[i] = ec._GoogleProtobufDescriptorProto_field(ctx, field, obj) - case "extension": - out.Values[i] = ec._GoogleProtobufDescriptorProto_extension(ctx, field, obj) - case "nestedType": - out.Values[i] = ec._GoogleProtobufDescriptorProto_nestedType(ctx, field, obj) - case "enumType": - out.Values[i] = ec._GoogleProtobufDescriptorProto_enumType(ctx, field, obj) - case "extensionRange": - out.Values[i] = ec._GoogleProtobufDescriptorProto_extensionRange(ctx, field, obj) - case "oneofDecl": - out.Values[i] = ec._GoogleProtobufDescriptorProto_oneofDecl(ctx, field, obj) - case "options": - out.Values[i] = ec._GoogleProtobufDescriptorProto_options(ctx, field, obj) - case "reservedRange": - out.Values[i] = ec._GoogleProtobufDescriptorProto_reservedRange(ctx, field, obj) - case "reservedName": - out.Values[i] = ec._GoogleProtobufDescriptorProto_reservedName(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ContactRemovePayload") + case "bertyEntityContact": + out.Values[i] = ec._ContactRemovePayload_bertyEntityContact(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ContactRemovePayload_clientMutationId(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -2219,244 +2192,756 @@ func (ec *executionContext) _GoogleProtobufDescriptorProto(ctx context.Context, return out } -func (ec *executionContext) _GoogleProtobufDescriptorProto_name(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ContactRemovePayload_bertyEntityContact(ctx context.Context, field graphql.CollectedField, obj *model.ContactRemovePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ContactRemovePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.Name, nil + return obj.BertyEntityContact, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.BertyEntityContact) if res == nil { return graphql.Null } - return graphql.MarshalString(*res) + return ec._BertyEntityContact(ctx, field.Selections, res) } -func (ec *executionContext) _GoogleProtobufDescriptorProto_field(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ContactRemovePayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ContactRemovePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ContactRemovePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.Field, nil + return obj.ClientMutationID, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufFieldDescriptorProto) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufFieldDescriptorProto(ctx, field.Selections, res[idx1]) - }()) + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var contactRequestPayloadImplementors = []string{"ContactRequestPayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ContactRequestPayload(ctx context.Context, sel ast.SelectionSet, obj *model.ContactRequestPayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, contactRequestPayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ContactRequestPayload") + case "bertyEntityContact": + out.Values[i] = ec._ContactRequestPayload_bertyEntityContact(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ContactRequestPayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - return arr1 + + return out } -func (ec *executionContext) _GoogleProtobufDescriptorProto_extension(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ContactRequestPayload_bertyEntityContact(ctx context.Context, field graphql.CollectedField, obj *model.ContactRequestPayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ContactRequestPayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.Extension, nil + return obj.BertyEntityContact, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufFieldDescriptorProto) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufFieldDescriptorProto(ctx, field.Selections, res[idx1]) - }()) + res := resTmp.(*model.BertyEntityContact) + if res == nil { + return graphql.Null } - return arr1 + return ec._BertyEntityContact(ctx, field.Selections, res) } -func (ec *executionContext) _GoogleProtobufDescriptorProto_nestedType(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ContactRequestPayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ContactRequestPayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ContactRequestPayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.NestedType, nil + return obj.ClientMutationID, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufDescriptorProto) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufDescriptorProto(ctx, field.Selections, res[idx1]) - }()) + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var contactUpdatePayloadImplementors = []string{"ContactUpdatePayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ContactUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *model.ContactUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, contactUpdatePayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ContactUpdatePayload") + case "bertyEntityContact": + out.Values[i] = ec._ContactUpdatePayload_bertyEntityContact(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ContactUpdatePayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - return arr1 + + return out } -func (ec *executionContext) _GoogleProtobufDescriptorProto_enumType(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ContactUpdatePayload_bertyEntityContact(ctx context.Context, field graphql.CollectedField, obj *model.ContactUpdatePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ContactUpdatePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.EnumType, nil + return obj.BertyEntityContact, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufEnumDescriptorProto) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufEnumDescriptorProto(ctx, field.Selections, res[idx1]) - }()) + res := resTmp.(*model.BertyEntityContact) + if res == nil { + return graphql.Null } - return arr1 + return ec._BertyEntityContact(ctx, field.Selections, res) } -func (ec *executionContext) _GoogleProtobufDescriptorProto_extensionRange(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ContactUpdatePayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ContactUpdatePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ContactUpdatePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.ExtensionRange, nil + return obj.ClientMutationID, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufDescriptorProtoExtensionRange) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufDescriptorProtoExtensionRange(ctx, field.Selections, res[idx1]) - }()) + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var conversationAddMessagePayloadImplementors = []string{"ConversationAddMessagePayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ConversationAddMessagePayload(ctx context.Context, sel ast.SelectionSet, obj *model.ConversationAddMessagePayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, conversationAddMessagePayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConversationAddMessagePayload") + case "bertyP2pEvent": + out.Values[i] = ec._ConversationAddMessagePayload_bertyP2pEvent(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ConversationAddMessagePayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - return arr1 + + return out } -func (ec *executionContext) _GoogleProtobufDescriptorProto_oneofDecl(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ConversationAddMessagePayload_bertyP2pEvent(ctx context.Context, field graphql.CollectedField, obj *model.ConversationAddMessagePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ConversationAddMessagePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.OneofDecl, nil + return obj.BertyP2pEvent, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufOneofDescriptorProto) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufOneofDescriptorProto(ctx, field.Selections, res[idx1]) - }()) + res := resTmp.(*model.BertyP2pEvent) + if res == nil { + return graphql.Null } - return arr1 + return ec._BertyP2pEvent(ctx, field.Selections, res) } -func (ec *executionContext) _GoogleProtobufDescriptorProto_options(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ConversationAddMessagePayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ConversationAddMessagePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ConversationAddMessagePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.Options, nil + return obj.ClientMutationID, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.GoogleProtobufMessageOptions) - if res == nil { - return graphql.Null + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var conversationCreatePayloadImplementors = []string{"ConversationCreatePayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ConversationCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *model.ConversationCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, conversationCreatePayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConversationCreatePayload") + case "bertyEntityConversation": + out.Values[i] = ec._ConversationCreatePayload_bertyEntityConversation(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ConversationCreatePayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } } - return ec._GoogleProtobufMessageOptions(ctx, field.Selections, res) + + return out } -func (ec *executionContext) _GoogleProtobufDescriptorProto_reservedRange(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { +func (ec *executionContext) _ConversationCreatePayload_bertyEntityConversation(ctx context.Context, field graphql.CollectedField, obj *model.ConversationCreatePayload) graphql.Marshaler { rctx := graphql.GetResolverContext(ctx) - rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Object = "ConversationCreatePayload" rctx.Args = nil rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return obj.ReservedRange, nil + return obj.BertyEntityConversation, nil }) if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.GoogleProtobufDescriptorProtoReservedRange) - arr1 := graphql.Array{} - for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() - if res[idx1] == nil { - return graphql.Null - } - return ec._GoogleProtobufDescriptorProtoReservedRange(ctx, field.Selections, res[idx1]) + res := resTmp.(*model.BertyEntityConversation) + if res == nil { + return graphql.Null + } + return ec._BertyEntityConversation(ctx, field.Selections, res) +} + +func (ec *executionContext) _ConversationCreatePayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ConversationCreatePayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "ConversationCreatePayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.ClientMutationID, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var conversationExcludePayloadImplementors = []string{"ConversationExcludePayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ConversationExcludePayload(ctx context.Context, sel ast.SelectionSet, obj *model.ConversationExcludePayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, conversationExcludePayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConversationExcludePayload") + case "bertyEntityConversation": + out.Values[i] = ec._ConversationExcludePayload_bertyEntityConversation(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ConversationExcludePayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + + return out +} + +func (ec *executionContext) _ConversationExcludePayload_bertyEntityConversation(ctx context.Context, field graphql.CollectedField, obj *model.ConversationExcludePayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "ConversationExcludePayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.BertyEntityConversation, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BertyEntityConversation) + if res == nil { + return graphql.Null + } + return ec._BertyEntityConversation(ctx, field.Selections, res) +} + +func (ec *executionContext) _ConversationExcludePayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ConversationExcludePayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "ConversationExcludePayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.ClientMutationID, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var conversationInvitePayloadImplementors = []string{"ConversationInvitePayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ConversationInvitePayload(ctx context.Context, sel ast.SelectionSet, obj *model.ConversationInvitePayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, conversationInvitePayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConversationInvitePayload") + case "bertyEntityConversation": + out.Values[i] = ec._ConversationInvitePayload_bertyEntityConversation(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._ConversationInvitePayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + + return out +} + +func (ec *executionContext) _ConversationInvitePayload_bertyEntityConversation(ctx context.Context, field graphql.CollectedField, obj *model.ConversationInvitePayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "ConversationInvitePayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.BertyEntityConversation, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BertyEntityConversation) + if res == nil { + return graphql.Null + } + return ec._BertyEntityConversation(ctx, field.Selections, res) +} + +func (ec *executionContext) _ConversationInvitePayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.ConversationInvitePayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "ConversationInvitePayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.ClientMutationID, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var generateFakeDataPayloadImplementors = []string{"GenerateFakeDataPayload"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _GenerateFakeDataPayload(ctx context.Context, sel ast.SelectionSet, obj *model.GenerateFakeDataPayload) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, generateFakeDataPayloadImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GenerateFakeDataPayload") + case "bertyNodeVoid": + out.Values[i] = ec._GenerateFakeDataPayload_bertyNodeVoid(ctx, field, obj) + case "clientMutationId": + out.Values[i] = ec._GenerateFakeDataPayload_clientMutationId(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + + return out +} + +func (ec *executionContext) _GenerateFakeDataPayload_bertyNodeVoid(ctx context.Context, field graphql.CollectedField, obj *model.GenerateFakeDataPayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GenerateFakeDataPayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.BertyNodeVoid, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.BertyNodeVoid) + if res == nil { + return graphql.Null + } + return ec._BertyNodeVoid(ctx, field.Selections, res) +} + +func (ec *executionContext) _GenerateFakeDataPayload_clientMutationId(ctx context.Context, field graphql.CollectedField, obj *model.GenerateFakeDataPayload) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GenerateFakeDataPayload" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.ClientMutationID, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + return graphql.MarshalString(res) +} + +var googleProtobufDescriptorProtoImplementors = []string{"GoogleProtobufDescriptorProto"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _GoogleProtobufDescriptorProto(ctx context.Context, sel ast.SelectionSet, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, googleProtobufDescriptorProtoImplementors) + + out := graphql.NewOrderedMap(len(fields)) + for i, field := range fields { + out.Keys[i] = field.Alias + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GoogleProtobufDescriptorProto") + case "name": + out.Values[i] = ec._GoogleProtobufDescriptorProto_name(ctx, field, obj) + case "field": + out.Values[i] = ec._GoogleProtobufDescriptorProto_field(ctx, field, obj) + case "extension": + out.Values[i] = ec._GoogleProtobufDescriptorProto_extension(ctx, field, obj) + case "nestedType": + out.Values[i] = ec._GoogleProtobufDescriptorProto_nestedType(ctx, field, obj) + case "enumType": + out.Values[i] = ec._GoogleProtobufDescriptorProto_enumType(ctx, field, obj) + case "extensionRange": + out.Values[i] = ec._GoogleProtobufDescriptorProto_extensionRange(ctx, field, obj) + case "oneofDecl": + out.Values[i] = ec._GoogleProtobufDescriptorProto_oneofDecl(ctx, field, obj) + case "options": + out.Values[i] = ec._GoogleProtobufDescriptorProto_options(ctx, field, obj) + case "reservedRange": + out.Values[i] = ec._GoogleProtobufDescriptorProto_reservedRange(ctx, field, obj) + case "reservedName": + out.Values[i] = ec._GoogleProtobufDescriptorProto_reservedName(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + + return out +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_name(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.Name, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_field(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.Field, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufFieldDescriptorProto) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufFieldDescriptorProto(ctx, field.Selections, res[idx1]) + }()) + } + return arr1 +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_extension(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.Extension, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufFieldDescriptorProto) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufFieldDescriptorProto(ctx, field.Selections, res[idx1]) + }()) + } + return arr1 +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_nestedType(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.NestedType, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufDescriptorProto) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufDescriptorProto(ctx, field.Selections, res[idx1]) + }()) + } + return arr1 +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_enumType(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.EnumType, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufEnumDescriptorProto) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufEnumDescriptorProto(ctx, field.Selections, res[idx1]) + }()) + } + return arr1 +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_extensionRange(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.ExtensionRange, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufDescriptorProtoExtensionRange) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufDescriptorProtoExtensionRange(ctx, field.Selections, res[idx1]) + }()) + } + return arr1 +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_oneofDecl(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.OneofDecl, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufOneofDescriptorProto) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufOneofDescriptorProto(ctx, field.Selections, res[idx1]) + }()) + } + return arr1 +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_options(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.Options, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GoogleProtobufMessageOptions) + if res == nil { + return graphql.Null + } + return ec._GoogleProtobufMessageOptions(ctx, field.Selections, res) +} + +func (ec *executionContext) _GoogleProtobufDescriptorProto_reservedRange(ctx context.Context, field graphql.CollectedField, obj *model.GoogleProtobufDescriptorProto) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.Object = "GoogleProtobufDescriptorProto" + rctx.Args = nil + rctx.Field = field + rctx.PushField(field.Alias) + defer rctx.Pop() + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return obj.ReservedRange, nil + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GoogleProtobufDescriptorProtoReservedRange) + arr1 := graphql.Array{} + for idx1 := range res { + arr1 = append(arr1, func() graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx) + rctx.PushIndex(idx1) + defer rctx.Pop() + if res[idx1] == nil { + return graphql.Null + } + return ec._GoogleProtobufDescriptorProtoReservedRange(ctx, field.Selections, res[idx1]) }()) } return arr1 @@ -5862,31 +6347,16 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) func (ec *executionContext) _Mutation_ContactRequest(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["contactID"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["contactID"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["introText"]; ok { + var arg0 model.ContactRequestInput + if tmp, ok := rawArgs["input"]; ok { var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg1 = &ptr1 - } - + arg0, err = UnmarshalContactRequestInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["introText"] = arg1 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -5894,31 +6364,31 @@ func (ec *executionContext) _Mutation_ContactRequest(ctx context.Context, field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ContactRequest(ctx, args["contactID"].(string), args["introText"].(*string)) + return ec.resolvers.Mutation().ContactRequest(ctx, args["input"].(model.ContactRequestInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyEntityContact) + res := resTmp.(*model.ContactRequestPayload) if res == nil { return graphql.Null } - return ec._BertyEntityContact(ctx, field.Selections, res) + return ec._ContactRequestPayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_ContactRemove(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["contactID"]; ok { + var arg0 model.ContactRemoveInput + if tmp, ok := rawArgs["input"]; ok { var err error - arg0, err = graphql.UnmarshalString(tmp) + arg0, err = UnmarshalContactRemoveInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["contactID"] = arg0 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -5926,46 +6396,31 @@ func (ec *executionContext) _Mutation_ContactRemove(ctx context.Context, field g rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ContactRemove(ctx, args["contactID"].(string)) + return ec.resolvers.Mutation().ContactRemove(ctx, args["input"].(model.ContactRemoveInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyEntityContact) + res := resTmp.(*model.ContactRemovePayload) if res == nil { return graphql.Null } - return ec._BertyEntityContact(ctx, field.Selections, res) + return ec._ContactRemovePayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_ContactUpdate(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["contactID"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["contactID"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["displayName"]; ok { + var arg0 model.ContactUpdateInput + if tmp, ok := rawArgs["input"]; ok { var err error - var ptr1 string - if tmp != nil { - ptr1, err = graphql.UnmarshalString(tmp) - arg1 = &ptr1 - } - + arg0, err = UnmarshalContactUpdateInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["displayName"] = arg1 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -5973,42 +6428,31 @@ func (ec *executionContext) _Mutation_ContactUpdate(ctx context.Context, field g rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ContactUpdate(ctx, args["contactID"].(string), args["displayName"].(*string)) + return ec.resolvers.Mutation().ContactUpdate(ctx, args["input"].(model.ContactUpdateInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyEntityContact) + res := resTmp.(*model.ContactUpdatePayload) if res == nil { return graphql.Null } - return ec._BertyEntityContact(ctx, field.Selections, res) + return ec._ContactUpdatePayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_ConversationCreate(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 []string - if tmp, ok := rawArgs["contactsID"]; ok { + var arg0 model.ConversationCreateInput + if tmp, ok := rawArgs["input"]; ok { var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 - } else { - rawIf1 = []interface{}{tmp} - } - } - arg0 = make([]string, len(rawIf1)) - for idx1 := range rawIf1 { - arg0[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) - } + arg0, err = UnmarshalConversationCreateInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["contactsID"] = arg0 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -6016,52 +6460,31 @@ func (ec *executionContext) _Mutation_ConversationCreate(ctx context.Context, fi rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ConversationCreate(ctx, args["contactsID"].([]string)) + return ec.resolvers.Mutation().ConversationCreate(ctx, args["input"].(model.ConversationCreateInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyEntityConversation) + res := resTmp.(*model.ConversationCreatePayload) if res == nil { return graphql.Null } - return ec._BertyEntityConversation(ctx, field.Selections, res) + return ec._ConversationCreatePayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_ConversationInvite(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["conversationID"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["conversationID"] = arg0 - var arg1 []string - if tmp, ok := rawArgs["contactsID"]; ok { + var arg0 model.ConversationInviteInput + if tmp, ok := rawArgs["input"]; ok { var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 - } else { - rawIf1 = []interface{}{tmp} - } - } - arg1 = make([]string, len(rawIf1)) - for idx1 := range rawIf1 { - arg1[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) - } + arg0, err = UnmarshalConversationInviteInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["contactsID"] = arg1 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -6069,52 +6492,31 @@ func (ec *executionContext) _Mutation_ConversationInvite(ctx context.Context, fi rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ConversationInvite(ctx, args["conversationID"].(string), args["contactsID"].([]string)) + return ec.resolvers.Mutation().ConversationInvite(ctx, args["input"].(model.ConversationInviteInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyEntityConversation) + res := resTmp.(*model.ConversationInvitePayload) if res == nil { return graphql.Null } - return ec._BertyEntityConversation(ctx, field.Selections, res) + return ec._ConversationInvitePayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_ConversationExclude(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["conversationID"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["conversationID"] = arg0 - var arg1 []string - if tmp, ok := rawArgs["contactsID"]; ok { + var arg0 model.ConversationExcludeInput + if tmp, ok := rawArgs["input"]; ok { var err error - var rawIf1 []interface{} - if tmp != nil { - if tmp1, ok := tmp.([]interface{}); ok { - rawIf1 = tmp1 - } else { - rawIf1 = []interface{}{tmp} - } - } - arg1 = make([]string, len(rawIf1)) - for idx1 := range rawIf1 { - arg1[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) - } + arg0, err = UnmarshalConversationExcludeInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["contactsID"] = arg1 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -6122,41 +6524,31 @@ func (ec *executionContext) _Mutation_ConversationExclude(ctx context.Context, f rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ConversationExclude(ctx, args["conversationID"].(string), args["contactsID"].([]string)) + return ec.resolvers.Mutation().ConversationExclude(ctx, args["input"].(model.ConversationExcludeInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyEntityConversation) + res := resTmp.(*model.ConversationExcludePayload) if res == nil { return graphql.Null } - return ec._BertyEntityConversation(ctx, field.Selections, res) + return ec._ConversationExcludePayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_ConversationAddMessage(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["conversationID"]; ok { - var err error - arg0, err = graphql.UnmarshalString(tmp) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - } - args["conversationID"] = arg0 - var arg1 string - if tmp, ok := rawArgs["message"]; ok { + var arg0 model.ConversationAddMessageInput + if tmp, ok := rawArgs["input"]; ok { var err error - arg1, err = graphql.UnmarshalString(tmp) + arg0, err = UnmarshalConversationAddMessageInput(tmp) if err != nil { ec.Error(ctx, err) return graphql.Null } } - args["message"] = arg1 + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" rctx.Args = args @@ -6164,36 +6556,48 @@ func (ec *executionContext) _Mutation_ConversationAddMessage(ctx context.Context rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().ConversationAddMessage(ctx, args["conversationID"].(string), args["message"].(string)) + return ec.resolvers.Mutation().ConversationAddMessage(ctx, args["input"].(model.ConversationAddMessageInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyP2pEvent) + res := resTmp.(*model.ConversationAddMessagePayload) if res == nil { return graphql.Null } - return ec._BertyP2pEvent(ctx, field.Selections, res) + return ec._ConversationAddMessagePayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_GenerateFakeData(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args := map[string]interface{}{} + var arg0 model.GenerateFakeDataInput + if tmp, ok := rawArgs["input"]; ok { + var err error + arg0, err = UnmarshalGenerateFakeDataInput(tmp) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + } + args["input"] = arg0 rctx := graphql.GetResolverContext(ctx) rctx.Object = "Mutation" - rctx.Args = nil + rctx.Args = args rctx.Field = field rctx.PushField(field.Alias) defer rctx.Pop() resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Mutation().GenerateFakeData(ctx) + return ec.resolvers.Mutation().GenerateFakeData(ctx, args["input"].(model.GenerateFakeDataInput)) }) if resTmp == nil { return graphql.Null } - res := resTmp.(*model.BertyNodeVoid) + res := resTmp.(*model.GenerateFakeDataPayload) if res == nil { return graphql.Null } - return ec._BertyNodeVoid(ctx, field.Selections, res) + return ec._GenerateFakeDataPayload(ctx, field.Selections, res) } var queryImplementors = []string{"Query"} @@ -6213,6 +6617,8 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Query") + case "node": + out.Values[i] = ec._Query_node(ctx, field) case "EventList": out.Values[i] = ec._Query_EventList(ctx, field) case "ContactList": @@ -6228,7 +6634,45 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } } - return out + return out +} + +func (ec *executionContext) _Query_node(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + rawArgs := field.ArgumentMap(ec.Variables) + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + var err error + arg0, err = graphql.UnmarshalID(tmp) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + } + args["id"] = arg0 + ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + Object: "Query", + Args: args, + Field: field, + }) + return graphql.Defer(func() (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + userErr := ec.Recover(ctx, r) + ec.Error(ctx, userErr) + ret = graphql.Null + } + }() + + resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { + return ec.resolvers.Query().Node(ctx, args["id"].(string)) + }) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(model.Node) + return ec._Node(ctx, field.Selections, &res) + }) } func (ec *executionContext) _Query_EventList(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { @@ -7334,11 +7778,286 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj switch obj := (*obj).(type) { case nil: return graphql.Null + case model.BertyEntityDevice: + return ec._BertyEntityDevice(ctx, sel, &obj) + case *model.BertyEntityDevice: + return ec._BertyEntityDevice(ctx, sel, obj) + case model.BertyEntityContact: + return ec._BertyEntityContact(ctx, sel, &obj) + case *model.BertyEntityContact: + return ec._BertyEntityContact(ctx, sel, obj) + case model.BertyEntityConversation: + return ec._BertyEntityConversation(ctx, sel, &obj) + case *model.BertyEntityConversation: + return ec._BertyEntityConversation(ctx, sel, obj) + case model.BertyEntityConversationMember: + return ec._BertyEntityConversationMember(ctx, sel, &obj) + case *model.BertyEntityConversationMember: + return ec._BertyEntityConversationMember(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } } +func UnmarshalContactRemoveInput(v interface{}) (model.ContactRemoveInput, error) { + var it model.ContactRemoveInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "contactID": + var err error + it.ContactID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalContactRequestInput(v interface{}) (model.ContactRequestInput, error) { + var it model.ContactRequestInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "contactID": + var err error + it.ContactID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "introText": + var err error + var ptr1 string + if v != nil { + ptr1, err = graphql.UnmarshalString(v) + it.IntroText = &ptr1 + } + + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalContactUpdateInput(v interface{}) (model.ContactUpdateInput, error) { + var it model.ContactUpdateInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "contactID": + var err error + it.ContactID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "displayName": + var err error + var ptr1 string + if v != nil { + ptr1, err = graphql.UnmarshalString(v) + it.DisplayName = &ptr1 + } + + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalConversationAddMessageInput(v interface{}) (model.ConversationAddMessageInput, error) { + var it model.ConversationAddMessageInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "conversationID": + var err error + it.ConversationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "message": + var err error + it.Message, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalConversationCreateInput(v interface{}) (model.ConversationCreateInput, error) { + var it model.ConversationCreateInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "contactsID": + var err error + var rawIf1 []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{v} + } + } + it.ContactsID = make([]string, len(rawIf1)) + for idx1 := range rawIf1 { + it.ContactsID[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) + } + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalConversationExcludeInput(v interface{}) (model.ConversationExcludeInput, error) { + var it model.ConversationExcludeInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "conversationID": + var err error + it.ConversationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "contactsID": + var err error + var rawIf1 []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{v} + } + } + it.ContactsID = make([]string, len(rawIf1)) + for idx1 := range rawIf1 { + it.ContactsID[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) + } + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalConversationInviteInput(v interface{}) (model.ConversationInviteInput, error) { + var it model.ConversationInviteInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "conversationID": + var err error + it.ConversationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + case "contactsID": + var err error + var rawIf1 []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + rawIf1 = tmp1 + } else { + rawIf1 = []interface{}{v} + } + } + it.ContactsID = make([]string, len(rawIf1)) + for idx1 := range rawIf1 { + it.ContactsID[idx1], err = graphql.UnmarshalString(rawIf1[idx1]) + } + if err != nil { + return it, err + } + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func UnmarshalGenerateFakeDataInput(v interface{}) (model.GenerateFakeDataInput, error) { + var it model.GenerateFakeDataInput + var asMap = v.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "clientMutationId": + var err error + it.ClientMutationID, err = graphql.UnmarshalString(v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) FieldMiddleware(ctx context.Context, next graphql.Resolver) interface{} { res, err := ec.ResolverMiddleware(ctx, next) if err != nil { @@ -7366,10 +8085,16 @@ interface Node { id: ID! } + + + + + type GoogleProtobufFileDescriptorSet { file: [GoogleProtobufFileDescriptorProto] } + type GoogleProtobufFileDescriptorProto { name: String package: String @@ -7395,6 +8120,7 @@ type GoogleProtobufDescriptorProtoReservedRange { start: Int end: Int } + type GoogleProtobufDescriptorProto { name: String field: [GoogleProtobufFieldDescriptorProto] @@ -7407,9 +8133,11 @@ type GoogleProtobufDescriptorProto { reservedRange: [GoogleProtobufDescriptorProtoReservedRange] reservedName: [String] } + type GoogleProtobufExtensionRangeOptions { uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufFieldDescriptorProto { name: String number: Int @@ -7422,6 +8150,7 @@ type GoogleProtobufFieldDescriptorProto { jsonName: String options: GoogleProtobufFieldOptions } + enum GoogleProtobufFieldDescriptorProtoType { TYPE_DOUBLE TYPE_FLOAT @@ -7442,11 +8171,13 @@ enum GoogleProtobufFieldDescriptorProtoType { TYPE_SINT32 TYPE_SINT64 } + enum GoogleProtobufFieldDescriptorProtoLabel { LABEL_OPTIONAL LABEL_REQUIRED LABEL_REPEATED } + type GoogleProtobufOneofDescriptorProto { name: String options: GoogleProtobufOneofOptions @@ -7456,6 +8187,7 @@ type GoogleProtobufEnumDescriptorProtoEnumReservedRange { start: Int end: Int } + type GoogleProtobufEnumDescriptorProto { name: String value: [GoogleProtobufEnumValueDescriptorProto] @@ -7463,16 +8195,19 @@ type GoogleProtobufEnumDescriptorProto { reservedRange: [GoogleProtobufEnumDescriptorProtoEnumReservedRange] reservedName: [String] } + type GoogleProtobufEnumValueDescriptorProto { name: String number: Int options: GoogleProtobufEnumValueOptions } + type GoogleProtobufServiceDescriptorProto { name: String method: [GoogleProtobufMethodDescriptorProto] options: GoogleProtobufServiceOptions } + type GoogleProtobufMethodDescriptorProto { name: String inputType: String @@ -7481,6 +8216,7 @@ type GoogleProtobufMethodDescriptorProto { clientStreaming: Boolean serverStreaming: Boolean } + type GoogleProtobufFileOptions { javaPackage: String javaOuterClassname: String @@ -7502,11 +8238,13 @@ type GoogleProtobufFileOptions { phpNamespace: String uninterpretedOption: [GoogleProtobufUninterpretedOption] } + enum GoogleProtobufFileOptionsOptimizeMode { SPEED CODE_SIZE LITE_RUNTIME } + type GoogleProtobufMessageOptions { messageSetWireFormat: Boolean noStandardDescriptorAccessor: Boolean @@ -7514,6 +8252,7 @@ type GoogleProtobufMessageOptions { mapEntry: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufFieldOptions { ctype: GoogleProtobufFieldOptionsCType packed: Boolean @@ -7523,37 +8262,45 @@ type GoogleProtobufFieldOptions { weak: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + enum GoogleProtobufFieldOptionsCType { STRING CORD STRING_PIECE } + enum GoogleProtobufFieldOptionsJSType { JS_NORMAL JS_STRING JS_NUMBER } + type GoogleProtobufOneofOptions { uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufEnumOptions { allowAlias: Boolean deprecated: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufEnumValueOptions { deprecated: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufServiceOptions { deprecated: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufMethodOptions { deprecated: Boolean idempotencyLevel: GoogleProtobufMethodOptionsIdempotencyLevel uninterpretedOption: [GoogleProtobufUninterpretedOption] } + enum GoogleProtobufMethodOptionsIdempotencyLevel { IDEMPOTENCY_UNKNOWN NO_SIDE_EFFECTS @@ -7564,6 +8311,7 @@ type GoogleProtobufUninterpretedOptionNamePart { namePart: String isExtension: Boolean } + type GoogleProtobufUninterpretedOption { name: [GoogleProtobufUninterpretedOptionNamePart] identifierValue: String @@ -7581,6 +8329,7 @@ type GoogleProtobufSourceCodeInfoLocation { trailingComments: String leadingDetachedComments: [String] } + type GoogleProtobufSourceCodeInfo { location: [GoogleProtobufSourceCodeInfoLocation] } @@ -7591,18 +8340,34 @@ type GoogleProtobufGeneratedCodeInfoAnnotation { begin: Int end: Int } + type GoogleProtobufGeneratedCodeInfo { annotation: [GoogleProtobufGeneratedCodeInfoAnnotation] } + + + + + + + + + + + type GoogleProtobufTimestamp { seconds: Int nanos: Int } - -type BertyEntityDevice { - id: String + + + + + +type BertyEntityDevice implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime @@ -7611,6 +8376,7 @@ type BertyEntityDevice { apiVersion: Int contactId: String } + enum BertyEntityDeviceStatus { Unknown Connected @@ -7618,9 +8384,13 @@ enum BertyEntityDeviceStatus { Available Myself } - -type BertyEntityContact { - id: String + + + + + +type BertyEntityContact implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime @@ -7632,6 +8402,7 @@ type BertyEntityContact { overrideDisplayName: String overrideDisplayStatus: String } + enum BertyEntityContactStatus { Unknown IsFriend @@ -7641,18 +8412,23 @@ enum BertyEntityContactStatus { IsBlocked Myself } - -type BertyEntityConversation { - id: String + + + + + +type BertyEntityConversation implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime title: String topic: String members: [BertyEntityConversationMember] -} -type BertyEntityConversationMember { - id: String +} + +type BertyEntityConversationMember implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime @@ -7661,43 +8437,60 @@ type BertyEntityConversationMember { conversationId: String contactId: String } + enum BertyEntityConversationMemberStatus { Unknown Owner Active Blocked } + + + + type BertyEntityMessage { text: String } + + + + type BertyP2pSentAttrs { ids: [String] } + type BertyP2pAckAttrs { ids: [String] ErrMsg: String } + type BertyP2pPingAttrs { # Can't make empty type T: Boolean } + type BertyP2pContactRequestAttrs { me: BertyEntityContact introText: String } + type BertyP2pContactRequestAcceptedAttrs { # Can't make empty type T: Boolean } + type BertyP2pContactShareMeAttrs { me: BertyEntityContact } + type BertyP2pContactShareAttrs { contact: BertyEntityContact } + type BertyP2pConversationInviteAttrs { conversation: BertyEntityConversation } + type BertyP2pConversationNewMessageAttrs { message: BertyEntityMessage } @@ -7714,7 +8507,11 @@ enum BertyP2pKind { ConversationInvite ConversationNewMessage } + + + + type BertyP2pEvent { id: String senderId: String @@ -7732,51 +8529,166 @@ type BertyP2pEvent { attributes: String conversationId: String } + enum BertyP2pEventDirection { UnknownDirection Incoming Outgoing } + + + + type BertyNodeContactRequestInput { contact: BertyEntityContact introText: String } + type BertyNodeConversationAddMessageInput { conversation: BertyEntityConversation message: BertyEntityMessage } + type BertyNodeEventStreamInput { filter: BertyP2pEvent } + type BertyNodeEventListInput { limit: Int filter: BertyP2pEvent } + type BertyNodeConversationManageMembersInput { conversation: BertyEntityConversation members: [BertyEntityConversationMember] } + type BertyNodeVoid { # Can't make empty type T: Boolean } -type Subscription { - EventStream: BertyP2pEvent + + + + +input ContactRequestInput { + contactID: String! + introText: String + clientMutationId: String! +} + +type ContactRequestPayload { + bertyEntityContact: BertyEntityContact + clientMutationId: String! +} + +input ContactRemoveInput { + contactID: String! + clientMutationId: String! +} + +type ContactRemovePayload { + bertyEntityContact: BertyEntityContact + clientMutationId: String! +} + +input ContactUpdateInput { + contactID: String! + displayName: String + clientMutationId: String! +} + +type ContactUpdatePayload { + bertyEntityContact: BertyEntityContact + clientMutationId: String! +} + +input ConversationCreateInput { + contactsID: [String!]! + clientMutationId: String! +} + +type ConversationCreatePayload { + bertyEntityConversation: BertyEntityConversation + clientMutationId: String! +} + +input ConversationInviteInput { + conversationID: String! + contactsID: [String!]! + clientMutationId: String! +} + +type ConversationInvitePayload { + bertyEntityConversation: BertyEntityConversation + clientMutationId: String! +} + +input ConversationExcludeInput { + conversationID: String! + contactsID: [String!]! + clientMutationId: String! +} + +type ConversationExcludePayload { + bertyEntityConversation: BertyEntityConversation + clientMutationId: String! +} + +input ConversationAddMessageInput { + conversationID: String! + message: String! + clientMutationId: String! +} + +type ConversationAddMessagePayload { + bertyP2pEvent: BertyP2pEvent + clientMutationId: String! +} + +input GenerateFakeDataInput { + clientMutationId: String! +} + +type GenerateFakeDataPayload { + bertyNodeVoid: BertyNodeVoid + clientMutationId: String! } + + + + type Mutation { - ContactRequest(contactID: String!, introText: String): BertyEntityContact - ContactRemove(contactID: String!): BertyEntityContact - ContactUpdate(contactID: String!, displayName: String): BertyEntityContact - ConversationCreate(contactsID: [String!]!): BertyEntityConversation - ConversationInvite(conversationID: String!, contactsID: [String!]!): BertyEntityConversation - ConversationExclude(conversationID: String!, contactsID: [String!]!): BertyEntityConversation - ConversationAddMessage(conversationID: String!, message: String!): BertyP2pEvent - GenerateFakeData: BertyNodeVoid + ContactRequest(input: ContactRequestInput!): ContactRequestPayload + ContactRemove(input: ContactRemoveInput!): ContactRemovePayload + ContactUpdate(input: ContactUpdateInput!): ContactUpdatePayload + ConversationCreate(input: ConversationCreateInput!): ConversationCreatePayload + ConversationInvite(input: ConversationInviteInput!): ConversationInvitePayload + ConversationExclude(input: ConversationExcludeInput!): ConversationExcludePayload + ConversationAddMessage(input: ConversationAddMessageInput!): ConversationAddMessagePayload + GenerateFakeData(input: GenerateFakeDataInput!): GenerateFakeDataPayload } + + + + type Query { + # Root field + node(id: ID!): Node + + EventList(limit: Int): [BertyP2pEvent] ContactList: [BertyEntityContact] ConversationList: [BertyEntityConversation] } + + + + +type Subscription { + + EventStream: BertyP2pEvent +} + `}, ) diff --git a/core/api/node/graphql/model/model.gen.go b/core/api/node/graphql/model/model.gen.go index 7ade6c1616..a3e33b720e 100644 --- a/core/api/node/graphql/model/model.gen.go +++ b/core/api/node/graphql/model/model.gen.go @@ -11,7 +11,7 @@ import ( ) type BertyEntityContact struct { - ID *string `json:"id"` + ID string `json:"id"` CreatedAt *scalar.DateTime `json:"createdAt"` UpdatedAt *scalar.DateTime `json:"updatedAt"` DeletedAt *scalar.DateTime `json:"deletedAt"` @@ -24,7 +24,7 @@ type BertyEntityContact struct { OverrideDisplayStatus *string `json:"overrideDisplayStatus"` } type BertyEntityConversation struct { - ID *string `json:"id"` + ID string `json:"id"` CreatedAt *scalar.DateTime `json:"createdAt"` UpdatedAt *scalar.DateTime `json:"updatedAt"` DeletedAt *scalar.DateTime `json:"deletedAt"` @@ -33,7 +33,7 @@ type BertyEntityConversation struct { Members []*BertyEntityConversationMember `json:"members"` } type BertyEntityConversationMember struct { - ID *string `json:"id"` + ID string `json:"id"` CreatedAt *scalar.DateTime `json:"createdAt"` UpdatedAt *scalar.DateTime `json:"updatedAt"` DeletedAt *scalar.DateTime `json:"deletedAt"` @@ -43,7 +43,7 @@ type BertyEntityConversationMember struct { ContactID *string `json:"contactId"` } type BertyEntityDevice struct { - ID *string `json:"id"` + ID string `json:"id"` CreatedAt *scalar.DateTime `json:"createdAt"` UpdatedAt *scalar.DateTime `json:"updatedAt"` DeletedAt *scalar.DateTime `json:"deletedAt"` @@ -123,6 +123,74 @@ type BertyP2pPingAttrs struct { type BertyP2pSentAttrs struct { Ids []*string `json:"ids"` } +type ContactRemoveInput struct { + ContactID string `json:"contactID"` + ClientMutationID string `json:"clientMutationId"` +} +type ContactRemovePayload struct { + BertyEntityContact *BertyEntityContact `json:"bertyEntityContact"` + ClientMutationID string `json:"clientMutationId"` +} +type ContactRequestInput struct { + ContactID string `json:"contactID"` + IntroText *string `json:"introText"` + ClientMutationID string `json:"clientMutationId"` +} +type ContactRequestPayload struct { + BertyEntityContact *BertyEntityContact `json:"bertyEntityContact"` + ClientMutationID string `json:"clientMutationId"` +} +type ContactUpdateInput struct { + ContactID string `json:"contactID"` + DisplayName *string `json:"displayName"` + ClientMutationID string `json:"clientMutationId"` +} +type ContactUpdatePayload struct { + BertyEntityContact *BertyEntityContact `json:"bertyEntityContact"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationAddMessageInput struct { + ConversationID string `json:"conversationID"` + Message string `json:"message"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationAddMessagePayload struct { + BertyP2pEvent *BertyP2pEvent `json:"bertyP2pEvent"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationCreateInput struct { + ContactsID []string `json:"contactsID"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationCreatePayload struct { + BertyEntityConversation *BertyEntityConversation `json:"bertyEntityConversation"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationExcludeInput struct { + ConversationID string `json:"conversationID"` + ContactsID []string `json:"contactsID"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationExcludePayload struct { + BertyEntityConversation *BertyEntityConversation `json:"bertyEntityConversation"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationInviteInput struct { + ConversationID string `json:"conversationID"` + ContactsID []string `json:"contactsID"` + ClientMutationID string `json:"clientMutationId"` +} +type ConversationInvitePayload struct { + BertyEntityConversation *BertyEntityConversation `json:"bertyEntityConversation"` + ClientMutationID string `json:"clientMutationId"` +} +type GenerateFakeDataInput struct { + ClientMutationID string `json:"clientMutationId"` +} +type GenerateFakeDataPayload struct { + BertyNodeVoid *BertyNodeVoid `json:"bertyNodeVoid"` + ClientMutationID string `json:"clientMutationId"` +} type GoogleProtobufDescriptorProto struct { Name *string `json:"name"` Field []*GoogleProtobufFieldDescriptorProto `json:"field"` diff --git a/core/api/node/graphql/resolver.go b/core/api/node/graphql/resolver.go index 6e5a63249f..34b82f0284 100644 --- a/core/api/node/graphql/resolver.go +++ b/core/api/node/graphql/resolver.go @@ -28,92 +28,173 @@ func New(client service.ServiceClient) graph.Config { func (r *Resolver) Mutation() graph.MutationResolver { return &mutationResolver{r} } + func (r *Resolver) Query() graph.QueryResolver { return &queryResolver{r} } + func (r *Resolver) Subscription() graph.SubscriptionResolver { return &subscriptionResolver{r} } type mutationResolver struct{ *Resolver } -func (r *mutationResolver) ContactRequest(ctx context.Context, contactID string, introText *string) (*model.BertyEntityContact, error) { +func (r *mutationResolver) ContactRequest(ctx context.Context, input model.ContactRequestInput) (*model.ContactRequestPayload, error) { // @TODO: Find a way to properly handle defaults values - if introText == nil { + if input.IntroText == nil { tmp := "Hi, I'd like to add you to my professional network on Berty" - introText = &tmp + input.IntroText = &tmp } req := &service.ContactRequestInput{ Contact: &entity.Contact{ - ID: contactID, + ID: input.ContactID, }, - IntroText: *introText, + IntroText: *input.IntroText, } - return convertContact(r.client.ContactRequest(ctx, req)) + contact, err := r.client.ContactRequest(ctx, req) + if err != nil { + return nil, err + } + + return &model.ContactRequestPayload{ + BertyEntityContact: convertContact(contact), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) ContactRemove(ctx context.Context, contactID string) (*model.BertyEntityContact, error) { +func (r *mutationResolver) ContactRemove(ctx context.Context, input model.ContactRemoveInput) (*model.ContactRemovePayload, error) { req := &entity.Contact{ - ID: contactID, + ID: input.ContactID, } - return convertContact(r.client.ContactRemove(ctx, req)) + contact, err := r.client.ContactRemove(ctx, req) + if err != nil { + return nil, err + } + + return &model.ContactRemovePayload{ + BertyEntityContact: convertContact(contact), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) ContactUpdate(ctx context.Context, contactID string, displayName *string) (*model.BertyEntityContact, error) { - if displayName == nil { +func (r *mutationResolver) ContactUpdate(ctx context.Context, input model.ContactUpdateInput) (*model.ContactUpdatePayload, error) { + if input.DisplayName == nil { return nil, errors.New("contact update without a displayName is not currently supported") } - contact := entity.Contact{ - ID: contactID, - DisplayName: *displayName, + req := entity.Contact{ + ID: input.ContactID, + DisplayName: *input.DisplayName, } - return convertContact(r.client.ContactUpdate(ctx, &contact)) + contact, err := r.client.ContactUpdate(ctx, &req) + if err != nil { + return nil, err + } + + return &model.ContactUpdatePayload{ + BertyEntityContact: convertContact(contact), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) ConversationCreate(ctx context.Context, contactsID []string) (*model.BertyEntityConversation, error) { - return convertConversation(r.client.ConversationCreate(ctx, &entity.Conversation{ - Members: memberSliceFromContactIds(contactsID), - })) + +func (r *mutationResolver) ConversationCreate(ctx context.Context, input model.ConversationCreateInput) (*model.ConversationCreatePayload, error) { + req := &entity.Conversation{ + Members: memberSliceFromContactIds(input.ContactsID), + } + + conversation, err := r.client.ConversationCreate(ctx, req) + if err != nil { + return nil, err + } + + return &model.ConversationCreatePayload{ + BertyEntityConversation: convertConversation(conversation), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) ConversationInvite(ctx context.Context, conversationID string, contactsID []string) (*model.BertyEntityConversation, error) { - return convertConversation(r.client.ConversationInvite(ctx, &service.ConversationManageMembersInput{ +func (r *mutationResolver) ConversationInvite(ctx context.Context, input model.ConversationInviteInput) (*model.ConversationInvitePayload, error) { + req := &service.ConversationManageMembersInput{ Conversation: &entity.Conversation{ - ID: conversationID, + ID: input.ConversationID, }, - Members: memberSliceFromContactIds(contactsID), - })) + Members: memberSliceFromContactIds(input.ContactsID), + } + + conversation, err := r.client.ConversationInvite(ctx, req) + if err != nil { + return nil, err + } + + return &model.ConversationInvitePayload{ + BertyEntityConversation: convertConversation(conversation), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) ConversationExclude(ctx context.Context, conversationID string, contactsID []string) (*model.BertyEntityConversation, error) { - return convertConversation(r.client.ConversationExclude(ctx, &service.ConversationManageMembersInput{ + +func (r *mutationResolver) ConversationExclude(ctx context.Context, input model.ConversationExcludeInput) (*model.ConversationExcludePayload, error) { + req := &service.ConversationManageMembersInput{ Conversation: &entity.Conversation{ - ID: conversationID, + ID: input.ConversationID, }, - Members: memberSliceFromContactIds(contactsID), - })) + Members: memberSliceFromContactIds(input.ContactsID), + } + + conversation, err := r.client.ConversationExclude(ctx, req) + if err != nil { + return nil, err + } + + return &model.ConversationExcludePayload{ + BertyEntityConversation: convertConversation(conversation), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) ConversationAddMessage(ctx context.Context, conversationID string, message string) (*model.BertyP2pEvent, error) { - return convertEvent(r.client.ConversationAddMessage(ctx, &service.ConversationAddMessageInput{ + +func (r *mutationResolver) ConversationAddMessage(ctx context.Context, input model.ConversationAddMessageInput) (*model.ConversationAddMessagePayload, error) { + req := &service.ConversationAddMessageInput{ Conversation: &entity.Conversation{ - ID: conversationID, + ID: input.ConversationID, }, Message: &entity.Message{ - Text: message, + Text: input.Message, }, - })) + } + + event, err := r.client.ConversationAddMessage(ctx, req) + if err != nil { + return nil, err + } + + return &model.ConversationAddMessagePayload{ + BertyP2pEvent: convertEvent(event), + ClientMutationID: input.ClientMutationID, + }, nil } -func (r *mutationResolver) GenerateFakeData(ctx context.Context) (*model.BertyNodeVoid, error) { - _, err := r.client.GenerateFakeData(ctx, &service.Void{}) - return &model.BertyNodeVoid{}, err +func (r *mutationResolver) GenerateFakeData(ctx context.Context, input model.GenerateFakeDataInput) (*model.GenerateFakeDataPayload, error) { + req := &service.Void{} + + _, err := r.client.GenerateFakeData(ctx, req) + if err != nil { + return nil, err + } + return &model.GenerateFakeDataPayload{ + BertyNodeVoid: &model.BertyNodeVoid{}, + ClientMutationID: input.ClientMutationID, + }, err } type queryResolver struct{ *Resolver } +func (r *queryResolver) Node(ctx context.Context, id string) (model.Node, error) { + panic("not implemented") +} + func (r *queryResolver) EventList(ctx context.Context, limit *int) ([]*model.BertyP2pEvent, error) { req := &service.EventListInput{} if limit != nil { @@ -136,12 +217,13 @@ func (r *queryResolver) EventList(ctx context.Context, limit *int) ([]*model.Ber return nil, err } - c, _ := convertEvent(entry, nil) + c := convertEvent(entry) entries = append(entries, c) } return entries, nil } + func (r *queryResolver) ContactList(ctx context.Context) ([]*model.BertyEntityContact, error) { req := &service.Void{} stream, err := r.client.ContactList(ctx, req) @@ -160,12 +242,13 @@ func (r *queryResolver) ContactList(ctx context.Context) ([]*model.BertyEntityCo return nil, err } - c, _ := convertContact(entry, nil) + c := convertContact(entry) entries = append(entries, c) } return entries, nil } + func (r *queryResolver) ConversationList(ctx context.Context) ([]*model.BertyEntityConversation, error) { req := &service.Void{} stream, err := r.client.ConversationList(ctx, req) @@ -184,7 +267,7 @@ func (r *queryResolver) ConversationList(ctx context.Context) ([]*model.BertyEnt return nil, err } - c, _ := convertConversation(entry, nil) + c := convertConversation(entry) entries = append(entries, c) } diff --git a/core/api/node/graphql/service.gen.graphql b/core/api/node/graphql/service.gen.graphql index ba04d0f3ec..0f75944715 100644 --- a/core/api/node/graphql/service.gen.graphql +++ b/core/api/node/graphql/service.gen.graphql @@ -7,10 +7,16 @@ interface Node { id: ID! } + + + + + type GoogleProtobufFileDescriptorSet { file: [GoogleProtobufFileDescriptorProto] } + type GoogleProtobufFileDescriptorProto { name: String package: String @@ -36,6 +42,7 @@ type GoogleProtobufDescriptorProtoReservedRange { start: Int end: Int } + type GoogleProtobufDescriptorProto { name: String field: [GoogleProtobufFieldDescriptorProto] @@ -48,9 +55,11 @@ type GoogleProtobufDescriptorProto { reservedRange: [GoogleProtobufDescriptorProtoReservedRange] reservedName: [String] } + type GoogleProtobufExtensionRangeOptions { uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufFieldDescriptorProto { name: String number: Int @@ -63,6 +72,7 @@ type GoogleProtobufFieldDescriptorProto { jsonName: String options: GoogleProtobufFieldOptions } + enum GoogleProtobufFieldDescriptorProtoType { TYPE_DOUBLE TYPE_FLOAT @@ -83,11 +93,13 @@ enum GoogleProtobufFieldDescriptorProtoType { TYPE_SINT32 TYPE_SINT64 } + enum GoogleProtobufFieldDescriptorProtoLabel { LABEL_OPTIONAL LABEL_REQUIRED LABEL_REPEATED } + type GoogleProtobufOneofDescriptorProto { name: String options: GoogleProtobufOneofOptions @@ -97,6 +109,7 @@ type GoogleProtobufEnumDescriptorProtoEnumReservedRange { start: Int end: Int } + type GoogleProtobufEnumDescriptorProto { name: String value: [GoogleProtobufEnumValueDescriptorProto] @@ -104,16 +117,19 @@ type GoogleProtobufEnumDescriptorProto { reservedRange: [GoogleProtobufEnumDescriptorProtoEnumReservedRange] reservedName: [String] } + type GoogleProtobufEnumValueDescriptorProto { name: String number: Int options: GoogleProtobufEnumValueOptions } + type GoogleProtobufServiceDescriptorProto { name: String method: [GoogleProtobufMethodDescriptorProto] options: GoogleProtobufServiceOptions } + type GoogleProtobufMethodDescriptorProto { name: String inputType: String @@ -122,6 +138,7 @@ type GoogleProtobufMethodDescriptorProto { clientStreaming: Boolean serverStreaming: Boolean } + type GoogleProtobufFileOptions { javaPackage: String javaOuterClassname: String @@ -143,11 +160,13 @@ type GoogleProtobufFileOptions { phpNamespace: String uninterpretedOption: [GoogleProtobufUninterpretedOption] } + enum GoogleProtobufFileOptionsOptimizeMode { SPEED CODE_SIZE LITE_RUNTIME } + type GoogleProtobufMessageOptions { messageSetWireFormat: Boolean noStandardDescriptorAccessor: Boolean @@ -155,6 +174,7 @@ type GoogleProtobufMessageOptions { mapEntry: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufFieldOptions { ctype: GoogleProtobufFieldOptionsCType packed: Boolean @@ -164,37 +184,45 @@ type GoogleProtobufFieldOptions { weak: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + enum GoogleProtobufFieldOptionsCType { STRING CORD STRING_PIECE } + enum GoogleProtobufFieldOptionsJSType { JS_NORMAL JS_STRING JS_NUMBER } + type GoogleProtobufOneofOptions { uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufEnumOptions { allowAlias: Boolean deprecated: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufEnumValueOptions { deprecated: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufServiceOptions { deprecated: Boolean uninterpretedOption: [GoogleProtobufUninterpretedOption] } + type GoogleProtobufMethodOptions { deprecated: Boolean idempotencyLevel: GoogleProtobufMethodOptionsIdempotencyLevel uninterpretedOption: [GoogleProtobufUninterpretedOption] } + enum GoogleProtobufMethodOptionsIdempotencyLevel { IDEMPOTENCY_UNKNOWN NO_SIDE_EFFECTS @@ -205,6 +233,7 @@ type GoogleProtobufUninterpretedOptionNamePart { namePart: String isExtension: Boolean } + type GoogleProtobufUninterpretedOption { name: [GoogleProtobufUninterpretedOptionNamePart] identifierValue: String @@ -222,6 +251,7 @@ type GoogleProtobufSourceCodeInfoLocation { trailingComments: String leadingDetachedComments: [String] } + type GoogleProtobufSourceCodeInfo { location: [GoogleProtobufSourceCodeInfoLocation] } @@ -232,18 +262,34 @@ type GoogleProtobufGeneratedCodeInfoAnnotation { begin: Int end: Int } + type GoogleProtobufGeneratedCodeInfo { annotation: [GoogleProtobufGeneratedCodeInfoAnnotation] } + + + + + + + + + + + type GoogleProtobufTimestamp { seconds: Int nanos: Int } - -type BertyEntityDevice { - id: String + + + + + +type BertyEntityDevice implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime @@ -252,6 +298,7 @@ type BertyEntityDevice { apiVersion: Int contactId: String } + enum BertyEntityDeviceStatus { Unknown Connected @@ -259,9 +306,13 @@ enum BertyEntityDeviceStatus { Available Myself } - -type BertyEntityContact { - id: String + + + + + +type BertyEntityContact implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime @@ -273,6 +324,7 @@ type BertyEntityContact { overrideDisplayName: String overrideDisplayStatus: String } + enum BertyEntityContactStatus { Unknown IsFriend @@ -282,18 +334,23 @@ enum BertyEntityContactStatus { IsBlocked Myself } - -type BertyEntityConversation { - id: String + + + + + +type BertyEntityConversation implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime title: String topic: String members: [BertyEntityConversationMember] -} -type BertyEntityConversationMember { - id: String +} + +type BertyEntityConversationMember implements Node { + id: ID! createdAt: DateTime updatedAt: DateTime deletedAt: DateTime @@ -302,43 +359,60 @@ type BertyEntityConversationMember { conversationId: String contactId: String } + enum BertyEntityConversationMemberStatus { Unknown Owner Active Blocked } + + + + type BertyEntityMessage { text: String } + + + + type BertyP2pSentAttrs { ids: [String] } + type BertyP2pAckAttrs { ids: [String] ErrMsg: String } + type BertyP2pPingAttrs { # Can't make empty type T: Boolean } + type BertyP2pContactRequestAttrs { me: BertyEntityContact introText: String } + type BertyP2pContactRequestAcceptedAttrs { # Can't make empty type T: Boolean } + type BertyP2pContactShareMeAttrs { me: BertyEntityContact } + type BertyP2pContactShareAttrs { contact: BertyEntityContact } + type BertyP2pConversationInviteAttrs { conversation: BertyEntityConversation } + type BertyP2pConversationNewMessageAttrs { message: BertyEntityMessage } @@ -355,7 +429,11 @@ enum BertyP2pKind { ConversationInvite ConversationNewMessage } + + + + type BertyP2pEvent { id: String senderId: String @@ -373,49 +451,164 @@ type BertyP2pEvent { attributes: String conversationId: String } + enum BertyP2pEventDirection { UnknownDirection Incoming Outgoing } + + + + type BertyNodeContactRequestInput { contact: BertyEntityContact introText: String } + type BertyNodeConversationAddMessageInput { conversation: BertyEntityConversation message: BertyEntityMessage } + type BertyNodeEventStreamInput { filter: BertyP2pEvent } + type BertyNodeEventListInput { limit: Int filter: BertyP2pEvent } + type BertyNodeConversationManageMembersInput { conversation: BertyEntityConversation members: [BertyEntityConversationMember] } + type BertyNodeVoid { # Can't make empty type T: Boolean } -type Subscription { - EventStream: BertyP2pEvent + + + + +input ContactRequestInput { + contactID: String! + introText: String + clientMutationId: String! +} + +type ContactRequestPayload { + bertyEntityContact: BertyEntityContact + clientMutationId: String! +} + +input ContactRemoveInput { + contactID: String! + clientMutationId: String! +} + +type ContactRemovePayload { + bertyEntityContact: BertyEntityContact + clientMutationId: String! +} + +input ContactUpdateInput { + contactID: String! + displayName: String + clientMutationId: String! +} + +type ContactUpdatePayload { + bertyEntityContact: BertyEntityContact + clientMutationId: String! } + +input ConversationCreateInput { + contactsID: [String!]! + clientMutationId: String! +} + +type ConversationCreatePayload { + bertyEntityConversation: BertyEntityConversation + clientMutationId: String! +} + +input ConversationInviteInput { + conversationID: String! + contactsID: [String!]! + clientMutationId: String! +} + +type ConversationInvitePayload { + bertyEntityConversation: BertyEntityConversation + clientMutationId: String! +} + +input ConversationExcludeInput { + conversationID: String! + contactsID: [String!]! + clientMutationId: String! +} + +type ConversationExcludePayload { + bertyEntityConversation: BertyEntityConversation + clientMutationId: String! +} + +input ConversationAddMessageInput { + conversationID: String! + message: String! + clientMutationId: String! +} + +type ConversationAddMessagePayload { + bertyP2pEvent: BertyP2pEvent + clientMutationId: String! +} + +input GenerateFakeDataInput { + clientMutationId: String! +} + +type GenerateFakeDataPayload { + bertyNodeVoid: BertyNodeVoid + clientMutationId: String! +} + + + + type Mutation { - ContactRequest(contactID: String!, introText: String): BertyEntityContact - ContactRemove(contactID: String!): BertyEntityContact - ContactUpdate(contactID: String!, displayName: String): BertyEntityContact - ConversationCreate(contactsID: [String!]!): BertyEntityConversation - ConversationInvite(conversationID: String!, contactsID: [String!]!): BertyEntityConversation - ConversationExclude(conversationID: String!, contactsID: [String!]!): BertyEntityConversation - ConversationAddMessage(conversationID: String!, message: String!): BertyP2pEvent - GenerateFakeData: BertyNodeVoid + ContactRequest(input: ContactRequestInput!): ContactRequestPayload + ContactRemove(input: ContactRemoveInput!): ContactRemovePayload + ContactUpdate(input: ContactUpdateInput!): ContactUpdatePayload + ConversationCreate(input: ConversationCreateInput!): ConversationCreatePayload + ConversationInvite(input: ConversationInviteInput!): ConversationInvitePayload + ConversationExclude(input: ConversationExcludeInput!): ConversationExcludePayload + ConversationAddMessage(input: ConversationAddMessageInput!): ConversationAddMessagePayload + GenerateFakeData(input: GenerateFakeDataInput!): GenerateFakeDataPayload } + + + + type Query { + # Root field + node(id: ID!): Node + + EventList(limit: Int): [BertyP2pEvent] ContactList: [BertyEntityContact] ConversationList: [BertyEntityConversation] } + + + + +type Subscription { + + EventStream: BertyP2pEvent +} + diff --git a/core/api/node/service.gen.graphql.tmpl b/core/api/node/service.gen.graphql.tmpl index 6dcc15837b..028db24912 100644 --- a/core/api/node/service.gen.graphql.tmpl +++ b/core/api/node/service.gen.graphql.tmpl @@ -6,10 +6,10 @@ scalar DateTime interface Node { id: ID! } + {{setStore "headerSet" true}} {{end}} - {{- $Package := .File.Package}} {{- $PackageName := .File.Package | replace "." "_" | camelCase}} @@ -17,9 +17,14 @@ interface Node { {{- setStore "namespace" ""}} {{- setStore "packageName" $PackageName}} + +{{/* BLOCK TYPE */}} + {{- define "type"}} {{- setStore "type" "" -}} -{{- if (eq (.Type | string) "TYPE_DOUBLE") }} {{ setStore "type" "Float" }} +{{- $isID := boolFieldExtension 53004 . -}} +{{- if $isID }} {{ setStore "type" "ID!"}} +{{- else if (eq (.Type | string) "TYPE_DOUBLE") }} {{ setStore "type" "Float" }} {{- else if (eq (.Type | string) "TYPE_FLOAT") }} {{ setStore "type" "Float" }} {{- else if (eq (.Type | string) "TYPE_INT64") }} {{ setStore "type" "Int" }} {{- else if (eq (.Type | string) "TYPE_UINT64") }} {{ setStore "type" "Int" }} @@ -38,10 +43,13 @@ interface Node { {{- else if (eq (.Type | string) "TYPE_SINT32") }} {{ setStore "type" "Int" }} {{- else if (eq (.Type | string) "TYPE_SINT64") }} {{ setStore "type" "Int" }} {{- end -}} -{{- if isFieldRepeated . -}} {{- printf "[%s]" (getStore "type") -}} +{{- if (and (isFieldRepeated .) (not $isID)) -}} {{- printf "[%s]" (getStore "type") -}} {{- else -}} {{- getStore "type" -}} {{- end -}} {{- end -}} + +{{/* BLOCK NESTED MESSAGE */}} + {{- define "nestedType"}} {{/* @args: NestedType */}} {{- $PackageName := getStore "packageName"}} {{- range .}} @@ -84,6 +92,9 @@ enum {{concat $PackageName $backupName .Name}} = { {{- setStore "namespace" $backupName -}} {{- end}}{{end -}} + +{{/* BLOCK MESSAGE */}} + {{- block "messageType" .File.MessageType}} {{/* @args: messageType */}} {{- $PackageName := getStore "packageName"}} {{- $FileName := getStore "fileName" | camelCase}} @@ -92,8 +103,22 @@ enum {{concat $PackageName $backupName .Name}} = { {{- with .NestedType}}{{template "nestedType" .}}{{end}} {{- $MessageName := .Name}} +{{- setStore "isNode" false -}} +{{range .Field}} +{{- $isID := boolFieldExtension 53004 . -}} +{{- if $isID }} {{ setStore "isNode" true}} {{end -}} +{{- end -}} + +{{- $isNode := getStore "isNode" -}} {{- if .Field}} + +{{- if $isNode }} + +type {{concat $PackageName .Name}} implements Node { +{{- else}} + type {{concat $PackageName .Name}} { +{{- end -}} {{- range .Field}} {{- if (or (eq (.Type | string) "TYPE_MESSAGE") (eq (.Type | string) "TYPE_ENUM"))}} {{$type := .TypeName | replace "." "_" | camelCase | replace "_" "" -}} @@ -110,13 +135,15 @@ type {{concat $PackageName .Name}} { {{- end}}{{- end}} } {{- else}} + type {{concat $PackageName .Name}} { # Can't make empty type T: Boolean } -{{- end}} +{{- end -}} {{- if .EnumType}} {{- range .EnumType}} + enum {{concat $PackageName $MessageName .Name}} { {{- range .Value}} {{.Name}} @@ -137,31 +164,92 @@ enum {{$PackageName}}{{.Name}} { {{- end -}} {{- end -}} + +{{/* SERVICE BLOCK */}} + {{- block "service" .File.Service}} {{/* @args: service */}} {{- $PackageName := getStore "packageName"}} {{- range .}} {{- $name := .Name}} + +{{/* CREATE MUTATION TYPE */}} + +{{- range .Method}} +{{- $type := stringMethodOptionsExtension 53002 . -}} +{{- if (eq $type "Mutation") }} +{{- $fields := stringMethodOptionsExtension 53001 .}} + +input {{ .Name }}Input { + {{- range ($fields | splitArray "," )}} + {{. | trimstr " "}} + {{- end}} + clientMutationId: String! +} + +type {{ .Name }}Payload { + {{- $response := .OutputType | replace "." "_" | camelCase | replace "_" "" }} + {{ $response | lowerCamelCase }}: {{ $response}} + clientMutationId: String! +} +{{- end -}} +{{- end -}} + {{- $methods := .Method }} -{{- range ("Subscription,Mutation,Query" | splitArray ",")}} -type {{.}} { - {{- $typeName := . }} - {{- range $methods }} - {{- $type := stringMethodOptionsExtension 53003 . -}} - {{ if eq $type $typeName }} + + +{{/* CREATE MUTATION SERVICE */}} + +type Mutation { + {{- range .Method -}} + {{- $type := stringMethodOptionsExtension 53002 . -}} + + {{- if (eq $type "Mutation") -}} {{- $fields := stringMethodOptionsExtension 53001 . -}} - {{- $id := stringMethodOptionsExtension 53002 . -}} + {{- if (eq $fields "")}}{{setStore "args" "" -}} + {{- else}}{{setStore "args" (concat "(" $fields ")")}}{{end}} + {{.Name}}(input: {{.Name}}Input!): {{.Name}}Payload + {{- end -}} + {{- end }} +} + +{{/* CREATE QUERY SERVICE */}} + +type Query { + # Root field + node(id: ID!): Node + + {{ range .Method -}} + {{- $type := stringMethodOptionsExtension 53002 . -}} + {{- if (eq $type "Query") -}} + {{- $fields := stringMethodOptionsExtension 53001 . -}} {{- if (eq $fields "")}}{{setStore "args" "" -}} {{- else}}{{setStore "args" (concat "(" $fields ")")}}{{end}} - {{- if (and (ne $typeName "Subscription" ) .ServerStreaming) }} + {{- if .ServerStreaming }} {{.Name}}{{getStore "args"}}: [{{ .OutputType | replace "." "_" | camelCase | replace "_" "" }}] {{- else }} {{.Name}}{{getStore "args"}}: {{ .OutputType | replace "." "_" | camelCase | replace "_" "" }} - {{- end -}}{{- end -}} -{{- end}} + {{- end -}} + + {{- end -}} + {{- end }} } -{{- end -}}{{- end -}} -{{end}} + + +{{/* CREATE SUBSCRIPTION SERVICE */}} + +type Subscription { + {{ range .Method -}} + {{- $type := stringMethodOptionsExtension 53002 . -}} + {{- if (eq $type "Subscription") -}} + {{- $fields := stringMethodOptionsExtension 53001 . -}} + {{- if (eq $fields "")}}{{setStore "args" "" -}} + {{- else}}{{setStore "args" (concat "(" $fields ")")}}{{end}} + {{.Name}}{{getStore "args"}}: {{ .OutputType | replace "." "_" | camelCase | replace "_" "" }} + {{- end -}} + {{- end }} +} +{{end}}{{end}} diff --git a/core/api/node/service.pb.go b/core/api/node/service.pb.go index e9975ddc5e..8894440b56 100644 --- a/core/api/node/service.pb.go +++ b/core/api/node/service.pb.go @@ -6,9 +6,9 @@ package node // import "berty.tech/core/api/node" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "api/protobuf" import p2p "berty.tech/core/api/p2p" import entity "berty.tech/core/entity" -import descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" import ( context "golang.org/x/net/context" @@ -40,7 +40,7 @@ func (m *ContactRequestInput) Reset() { *m = ContactRequestInput{} } func (m *ContactRequestInput) String() string { return proto.CompactTextString(m) } func (*ContactRequestInput) ProtoMessage() {} func (*ContactRequestInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_89e5f96062ead180, []int{0} + return fileDescriptor_service_73a36b07ab633531, []int{0} } func (m *ContactRequestInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -95,7 +95,7 @@ func (m *ConversationAddMessageInput) Reset() { *m = ConversationAddMess func (m *ConversationAddMessageInput) String() string { return proto.CompactTextString(m) } func (*ConversationAddMessageInput) ProtoMessage() {} func (*ConversationAddMessageInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_89e5f96062ead180, []int{1} + return fileDescriptor_service_73a36b07ab633531, []int{1} } func (m *ConversationAddMessageInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -149,7 +149,7 @@ func (m *EventStreamInput) Reset() { *m = EventStreamInput{} } func (m *EventStreamInput) String() string { return proto.CompactTextString(m) } func (*EventStreamInput) ProtoMessage() {} func (*EventStreamInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_89e5f96062ead180, []int{2} + return fileDescriptor_service_73a36b07ab633531, []int{2} } func (m *EventStreamInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -197,7 +197,7 @@ func (m *EventListInput) Reset() { *m = EventListInput{} } func (m *EventListInput) String() string { return proto.CompactTextString(m) } func (*EventListInput) ProtoMessage() {} func (*EventListInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_89e5f96062ead180, []int{3} + return fileDescriptor_service_73a36b07ab633531, []int{3} } func (m *EventListInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -252,7 +252,7 @@ func (m *ConversationManageMembersInput) Reset() { *m = ConversationMana func (m *ConversationManageMembersInput) String() string { return proto.CompactTextString(m) } func (*ConversationManageMembersInput) ProtoMessage() {} func (*ConversationManageMembersInput) Descriptor() ([]byte, []int) { - return fileDescriptor_service_89e5f96062ead180, []int{4} + return fileDescriptor_service_73a36b07ab633531, []int{4} } func (m *ConversationManageMembersInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +305,7 @@ func (m *Void) Reset() { *m = Void{} } func (m *Void) String() string { return proto.CompactTextString(m) } func (*Void) ProtoMessage() {} func (*Void) Descriptor() ([]byte, []int) { - return fileDescriptor_service_89e5f96062ead180, []int{5} + return fileDescriptor_service_73a36b07ab633531, []int{5} } func (m *Void) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -334,33 +334,6 @@ func (m *Void) XXX_DiscardUnknown() { var xxx_messageInfo_Void proto.InternalMessageInfo -var E_GraphqlFields = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*string)(nil), - Field: 53001, - Name: "berty.node.graphql_fields", - Tag: "bytes,53001,opt,name=graphql_fields,json=graphqlFields", - Filename: "api/node/service.proto", -} - -var E_GraphqlId = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*string)(nil), - Field: 53002, - Name: "berty.node.graphql_id", - Tag: "bytes,53002,opt,name=graphql_id,json=graphqlId", - Filename: "api/node/service.proto", -} - -var E_GraphqlType = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*string)(nil), - Field: 53003, - Name: "berty.node.graphql_type", - Tag: "bytes,53003,opt,name=graphql_type,json=graphqlType", - Filename: "api/node/service.proto", -} - func init() { proto.RegisterType((*ContactRequestInput)(nil), "berty.node.ContactRequestInput") proto.RegisterType((*ConversationAddMessageInput)(nil), "berty.node.ConversationAddMessageInput") @@ -368,9 +341,6 @@ func init() { proto.RegisterType((*EventListInput)(nil), "berty.node.EventListInput") proto.RegisterType((*ConversationManageMembersInput)(nil), "berty.node.ConversationManageMembersInput") proto.RegisterType((*Void)(nil), "berty.node.Void") - proto.RegisterExtension(E_GraphqlFields) - proto.RegisterExtension(E_GraphqlId) - proto.RegisterExtension(E_GraphqlType) } // Reference imports to suppress errors if they are not otherwise used. @@ -2001,62 +1971,56 @@ var ( ErrIntOverflowService = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("api/node/service.proto", fileDescriptor_service_89e5f96062ead180) } - -var fileDescriptor_service_89e5f96062ead180 = []byte{ - // 852 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4d, 0x6f, 0xe3, 0x44, - 0x18, 0x5e, 0x77, 0xd9, 0x2e, 0x99, 0xa4, 0x55, 0x34, 0x5b, 0x4a, 0x6c, 0x20, 0x18, 0x4b, 0xb0, - 0x61, 0x85, 0xec, 0x55, 0x56, 0x08, 0x11, 0x21, 0x56, 0x4b, 0xfa, 0x41, 0x24, 0x02, 0x34, 0x29, - 0x1c, 0x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0x90, 0x9f, 0x04, 0x48, 0x49, 0xcc, 0x74, 0xac, 0x56, - 0x1b, 0x55, 0x12, 0x00, 0x3e, 0xf3, 0xe0, 0x56, 0x88, 0x9f, 0x05, 0x44, 0x59, 0x4c, 0x1d, 0xcf, - 0x3c, 0xf8, 0xe4, 0xc9, 0xef, 0xd7, 0x75, 0xe9, 0xcf, 0xeb, 0xba, 0xf4, 0xd7, 0x75, 0x5d, 0xfa, - 0xe5, 0xef, 0xfa, 0xbd, 0x6f, 0x6a, 0xb1, 0x7f, 0x0e, 0xe6, 0xc8, 0x30, 0x5d, 0x06, 0x46, 0xf2, - 0x4d, 0x36, 0xd8, 0x8c, 0x80, 0x9f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xbe, 0xc2, 0xc5, - 0xa6, 0x09, 0x00, 0x00, +func init() { proto.RegisterFile("api/node/service.proto", fileDescriptor_service_73a36b07ab633531) } + +var fileDescriptor_service_73a36b07ab633531 = []byte{ + // 766 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xad, 0xfb, 0x5e, 0x5b, 0x32, 0x69, 0xab, 0x68, 0x5a, 0x4a, 0x6c, 0x20, 0x04, 0x4b, 0xd0, + 0x50, 0xa1, 0xb8, 0x4a, 0x85, 0x10, 0x15, 0x02, 0x95, 0xb4, 0x40, 0x24, 0x82, 0x68, 0x52, 0x58, + 0x80, 0x10, 0x9a, 0xd8, 0xb7, 0xa9, 0x45, 0x62, 0xbb, 0xe3, 0x49, 0xd4, 0xac, 0xf8, 0x83, 0xae, + 0x59, 0x00, 0xdf, 0x83, 0xb2, 0x01, 0xf5, 0x0b, 0x50, 0xf9, 0x01, 0x7f, 0x02, 0xb2, 0x3d, 0x76, + 0xed, 0xd8, 0x09, 0x20, 0x75, 0xc1, 0x32, 0x77, 0xee, 0x3d,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x04, 0xef, 0x52, + 0x09, 0xe7, 0x77, 0x8e, 0xd4, 0x4e, 0x4f, 0xfb, 0x87, 0x04, 0x1e, 0x0b, 0x68, 0x25, 0xfd, 0x36, + 0xc2, 0xab, 0xe3, 0x34, 0x8e, 0xdc, 0x58, 0x29, 0x6f, 0xa0, 0x7b, 0x43, 0x47, 0xbc, 0x35, 0x56, + 0x16, 0xbf, 0x78, 0xd2, 0x9f, 0xa9, 0x0d, 0x94, 0x7d, 0x4a, 0x0c, 0xad, 0x03, 0x1e, 0x12, 0x4e, + 0x60, 0x4b, 0x89, 0xb4, 0xc8, 0x53, 0x78, 0x1b, 0xe5, 0x9e, 0x80, 0x01, 0x94, 0x30, 0x78, 0x4c, + 0xde, 0xc3, 0x36, 0x61, 0x24, 0x25, 0x55, 0xc9, 0xc9, 0xf9, 0x28, 0xf5, 0xa3, 0xb5, 0xaf, 0xa7, + 0x05, 0xe1, 0xfb, 0x69, 0x41, 0xf8, 0x71, 0x5a, 0x10, 0x3e, 0xfe, 0x2c, 0x4c, 0xbd, 0xce, 0xfb, + 0x03, 0x0c, 0xd4, 0x03, 0x45, 0x35, 0x29, 0x28, 0xc1, 0xe7, 0x4b, 0x6b, 0xd6, 0xfb, 0x66, 0xd8, + 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff, 0x17, 0x42, 0xb4, 0xf2, 0xd1, 0x08, 0x00, 0x00, } diff --git a/core/api/node/service.proto b/core/api/node/service.proto index e78735d8c8..9e86bf4344 100644 --- a/core/api/node/service.proto +++ b/core/api/node/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package berty.node; -import "google/protobuf/descriptor.proto"; +import "api/protobuf/graphql.proto"; import "api/p2p/event.proto"; import "entity/contact.proto"; import "entity/conversation.proto"; @@ -10,12 +10,6 @@ import "entity/message.proto"; option go_package = "berty.tech/core/api/node"; -extend google.protobuf.MethodOptions { - string graphql_fields = 53001; - string graphql_id = 53002; - string graphql_type = 53003; -} - service Service { // @@ -24,12 +18,12 @@ service Service { // yield new events in real-time rpc EventStream(EventStreamInput) returns (stream berty.p2p.Event) { - option (graphql_type) = "Subscription"; + option (protobuf.gql.graphql_type) = "Subscription"; }; // list old events rpc EventList(EventListInput) returns (stream berty.p2p.Event) { - option (graphql_fields) = "limit: Int"; - option (graphql_type) = "Query"; + option (protobuf.gql.graphql_fields) = "limit: Int"; + option (protobuf.gql.graphql_type) = "Query"; }; // @@ -37,23 +31,23 @@ service Service { // rpc ContactRequest(ContactRequestInput) returns (berty.entity.Contact) { - option (graphql_fields) = "contactID: String!, introText: String"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "contactID: String!, introText: String"; + option (protobuf.gql.graphql_type) = "Mutation"; }; rpc ContactAcceptRequest(berty.entity.Contact) returns (berty.entity.Contact) { - option (graphql_fields) = "contactID: String!"; - option (graphql_type) = "mutation"; + option (protobuf.gql.graphql_fields) = "contactID: String!"; + option (protobuf.gql.graphql_type) = "mutation"; }; rpc ContactRemove(berty.entity.Contact) returns (berty.entity.Contact) { - option (graphql_fields) = "contactID: String!"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "contactID: String!"; + option (protobuf.gql.graphql_type) = "Mutation"; }; rpc ContactUpdate(berty.entity.Contact) returns (berty.entity.Contact) { - option (graphql_fields) = "contactID: String!, displayName: String"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "contactID: String!, displayName: String"; + option (protobuf.gql.graphql_type) = "Mutation"; }; rpc ContactList(Void) returns (stream berty.entity.Contact) { - option (graphql_type) = "Query"; + option (protobuf.gql.graphql_type) = "Query"; }; @@ -62,23 +56,23 @@ service Service { // rpc ConversationCreate(berty.entity.Conversation) returns (berty.entity.Conversation) { - option (graphql_fields) = "contactsID: [String!]!"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "contactsID: [String!]!"; + option (protobuf.gql.graphql_type) = "Mutation"; }; rpc ConversationList(Void) returns (stream berty.entity.Conversation) { - option (graphql_type) = "Query"; + option (protobuf.gql.graphql_type) = "Query"; }; rpc ConversationInvite(ConversationManageMembersInput) returns (berty.entity.Conversation) { - option (graphql_fields) = "conversationID: String!, contactsID: [String!]!"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "conversationID: String!, contactsID: [String!]!"; + option (protobuf.gql.graphql_type) = "Mutation"; }; rpc ConversationExclude(ConversationManageMembersInput) returns (berty.entity.Conversation) { - option (graphql_fields) = "conversationID: String!, contactsID: [String!]!"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "conversationID: String!, contactsID: [String!]!"; + option (protobuf.gql.graphql_type) = "Mutation"; }; rpc ConversationAddMessage(ConversationAddMessageInput) returns (berty.p2p.Event) { - option (graphql_fields) = "conversationID: String!, message: String!"; - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_fields) = "conversationID: String!, message: String!"; + option (protobuf.gql.graphql_type) = "Mutation"; }; //rpc ConversationLeave(berty.entity.Conversation) returns (berty.entity.Conversation); @@ -94,7 +88,7 @@ service Service { rpc HandleEvent(berty.p2p.Event) returns (Void) {}; rpc GenerateFakeData(Void) returns (Void) { - option (graphql_type) = "Mutation"; + option (protobuf.gql.graphql_type) = "Mutation"; }; } @@ -118,8 +112,8 @@ message EventListInput { } message ConversationManageMembersInput { - berty.entity.Conversation conversation = 1; - repeated berty.entity.ConversationMember members = 2; + berty.entity.Conversation conversation = 1; + repeated berty.entity.ConversationMember members = 2; } message Void {} diff --git a/core/api/protobuf/graphql.proto b/core/api/protobuf/graphql.proto new file mode 100644 index 0000000000..27247fefcc --- /dev/null +++ b/core/api/protobuf/graphql.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package protobuf.gql; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MethodOptions { + string graphql_fields = 53001; + string graphql_type = 53002; + string graphql_interface = 53003; +} + +extend google.protobuf.FieldOptions { + bool graphql_id = 53004; +} diff --git a/core/entity/contact.pb.go b/core/entity/contact.pb.go index 9b0e4339cf..a15d1daf0d 100644 --- a/core/entity/contact.pb.go +++ b/core/entity/contact.pb.go @@ -6,6 +6,7 @@ package entity // import "berty.tech/core/entity" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "api/protobuf" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/golang/protobuf/ptypes/timestamp" @@ -62,7 +63,7 @@ func (x Contact_Status) String() string { return proto.EnumName(Contact_Status_name, int32(x)) } func (Contact_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_contact_d975e55a379fe55e, []int{0, 0} + return fileDescriptor_contact_8af1dc1e2c371dde, []int{0, 0} } type Contact struct { @@ -86,7 +87,7 @@ func (m *Contact) Reset() { *m = Contact{} } func (m *Contact) String() string { return proto.CompactTextString(m) } func (*Contact) ProtoMessage() {} func (*Contact) Descriptor() ([]byte, []int) { - return fileDescriptor_contact_d975e55a379fe55e, []int{0} + return fileDescriptor_contact_8af1dc1e2c371dde, []int{0} } func (m *Contact) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -845,40 +846,41 @@ var ( ErrIntOverflowContact = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("entity/contact.proto", fileDescriptor_contact_d975e55a379fe55e) } - -var fileDescriptor_contact_d975e55a379fe55e = []byte{ - // 512 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xcd, 0x6e, 0xd3, 0x4e, - 0x14, 0xc5, 0xe3, 0x24, 0xcd, 0xc7, 0x75, 0x3e, 0xac, 0x49, 0xfa, 0xff, 0x5b, 0x51, 0x95, 0x84, - 0x48, 0x48, 0x16, 0x42, 0xb6, 0x14, 0x10, 0x0b, 0x36, 0x28, 0x69, 0x84, 0x94, 0x45, 0x59, 0x98, - 0xb2, 0x61, 0x13, 0x39, 0xf6, 0xad, 0x6b, 0x25, 0xf6, 0x84, 0x99, 0x71, 0x91, 0x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 0x2e, 0xe8, 0x4b, 0xee, 0xe2, 0x87, - 0x14, 0x8f, 0xb2, 0x51, 0x39, 0x0a, 0x77, 0xdf, 0x0b, 0x34, 0xaa, 0xa4, 0x0d, 0xcd, 0x25, 0x9f, - 0x6f, 0xa9, 0xbf, 0xc1, 0xc0, 0x38, 0x21, 0x00, 0xb5, 0x8b, 0x8c, 0xe3, 0xf6, 0xca, 0x78, 0x32, - 0xb7, 0x6e, 0x0f, 0x43, 0xed, 0xeb, 0x61, 0xa8, 0x7d, 0x3f, 0x0c, 0xb5, 0xcf, 0x3f, 0x86, 0xa5, - 0xf7, 0xff, 0xc9, 0xe5, 0x0a, 0xf4, 0xaf, 0x1d, 0x9f, 0x32, 0x74, 0xe4, 0x9a, 0xd7, 0xb5, 0xfc, - 0xfa, 0xcf, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x89, 0x70, 0x1a, 0x9f, 0x56, 0x03, 0x00, 0x00, +func init() { proto.RegisterFile("entity/contact.proto", fileDescriptor_contact_8af1dc1e2c371dde) } + +var fileDescriptor_contact_8af1dc1e2c371dde = []byte{ + // 528 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x51, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xad, 0xd3, 0x36, 0x6d, 0xc6, 0xf9, 0xb1, 0x26, 0xe9, 0xf7, 0x99, 0x08, 0x25, 0x26, 0x12, + 0x92, 0xc5, 0xc2, 0x46, 0x01, 0xb1, 0x60, 0x83, 0x92, 0x46, 0x48, 0x59, 0x94, 0x85, 0x29, 0x1b, + 0x36, 0xd1, 0xc4, 0xbe, 0x75, 0x46, 0xb1, 0x3d, 0xee, 0xcc, 0xb8, 0xc8, 0x6f, 0xc1, 0x92, 0x17, + 0xe1, 0x1d, 0xba, 0xe4, 0x09, 0x42, 0x15, 0x5e, 0x00, 0xf1, 0x04, 0x28, 0xf6, 0xb8, 0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0x5c, 0x78, 0x70, 0x99, + 0xc1, 0x0e, 0x36, 0xf6, 0x77, 0xc0, 0xed, 0xf7, 0x0c, 0x8c, 0x03, 0xdc, 0x42, 0x8d, 0xb9, 0x98, + 0x46, 0xcc, 0x5f, 0x43, 0x60, 0x1c, 0x62, 0x84, 0xea, 0x67, 0xb9, 0x80, 0xe8, 0xc2, 0x78, 0x32, + 0xb5, 0xaf, 0xb7, 0x03, 0xed, 0xcb, 0x76, 0xa0, 0xdd, 0x6c, 0x07, 0xda, 0xa7, 0x6f, 0x83, 0xbd, + 0xf7, 0xff, 0x95, 0xe5, 0x4a, 0xf0, 0x57, 0xae, 0xcf, 0x38, 0xb8, 0x65, 0xcd, 0xcb, 0x7a, 0x71, + 0xfd, 0x67, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x32, 0xb8, 0xad, 0x76, 0x03, 0x00, 0x00, } diff --git a/core/entity/contact.proto b/core/entity/contact.proto index ce8374bad9..9e0dc127ec 100644 --- a/core/entity/contact.proto +++ b/core/entity/contact.proto @@ -4,6 +4,7 @@ package berty.entity; option go_package = "berty.tech/core/entity"; +import "api/protobuf/graphql.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "entity/device.proto"; @@ -23,7 +24,7 @@ message Contact { // gorm fields // - string id = 1 [(gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; + string id = 1 [(protobuf.gql.graphql_id) = true, (gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; google.protobuf.Timestamp created_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp updated_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp deleted_at = 4 [(gogoproto.stdtime) = true]; diff --git a/core/entity/conversation.pb.go b/core/entity/conversation.pb.go index 2be7da0056..983faf5920 100644 --- a/core/entity/conversation.pb.go +++ b/core/entity/conversation.pb.go @@ -6,6 +6,7 @@ package entity // import "berty.tech/core/entity" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "api/protobuf" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/golang/protobuf/ptypes/timestamp" @@ -53,7 +54,7 @@ func (x ConversationMember_Status) String() string { return proto.EnumName(ConversationMember_Status_name, int32(x)) } func (ConversationMember_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_conversation_2945bb469f639ac6, []int{1, 0} + return fileDescriptor_conversation_324d95e4224ee3f5, []int{1, 0} } type Conversation struct { @@ -73,7 +74,7 @@ func (m *Conversation) Reset() { *m = Conversation{} } func (m *Conversation) String() string { return proto.CompactTextString(m) } func (*Conversation) ProtoMessage() {} func (*Conversation) Descriptor() ([]byte, []int) { - return fileDescriptor_conversation_2945bb469f639ac6, []int{0} + return fileDescriptor_conversation_324d95e4224ee3f5, []int{0} } func (m *Conversation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -169,7 +170,7 @@ func (m *ConversationMember) Reset() { *m = ConversationMember{} } func (m *ConversationMember) String() string { return proto.CompactTextString(m) } func (*ConversationMember) ProtoMessage() {} func (*ConversationMember) Descriptor() ([]byte, []int) { - return fileDescriptor_conversation_2945bb469f639ac6, []int{1} + return fileDescriptor_conversation_324d95e4224ee3f5, []int{1} } func (m *ConversationMember) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1172,40 +1173,41 @@ var ( ) func init() { - proto.RegisterFile("entity/conversation.proto", fileDescriptor_conversation_2945bb469f639ac6) + proto.RegisterFile("entity/conversation.proto", fileDescriptor_conversation_324d95e4224ee3f5) } -var fileDescriptor_conversation_2945bb469f639ac6 = []byte{ - // 487 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x93, 0xcf, 0x8e, 0x93, 0x50, - 0x14, 0xc6, 0x0b, 0xed, 0xb4, 0xf6, 0x74, 0xac, 0xcd, 0x4d, 0xc7, 0x60, 0x63, 0x4a, 0xd3, 0x8d, - 0x2c, 0x26, 0x90, 0xd4, 0x95, 0xe3, 0x62, 0xd2, 0x4e, 0x37, 0x2c, 0x8c, 0x09, 0xea, 0xc6, 0x4d, - 0x43, 0xb9, 0x77, 0xf0, 0xa6, 0x85, 0x4b, 0x2e, 0xa7, 0x33, 0xe9, 0x5b, 0xb8, 0xf4, 0x05, 0x7c, - 0x97, 0x59, 0xfa, 0x04, 0x68, 0xf0, 0x01, 0x4c, 0x7c, 0x02, 0x03, 0x5c, 0x22, 0xc9, 0x2c, 0x26, - 0xae, 0xdd, 0x71, 0xce, 0xf9, 0xbe, 0xdf, 0xf9, 0x03, 0xc0, 0x33, 0x16, 0x23, 0xc7, 0xa3, 0x13, - 0x88, 0xf8, 0x86, 0xc9, 0xd4, 0x47, 0x2e, 0x62, 0x3b, 0x91, 0x02, 0x05, 0x39, 0xdd, 0x32, 0x89, - 0x47, 0xbb, 0x12, 0x4c, 0xc6, 0xa1, 0x08, 0x45, 0x59, 0x70, 0x8a, 0xa7, 0x4a, 0x33, 0x31, 0x43, - 0x21, 0xc2, 0x3d, 0x73, 0xca, 0x68, 0x7b, 0xb8, 0x76, 0x90, 0x47, 0x2c, 0x45, 0x3f, 0x4a, 0x94, - 0x60, 0xfc, 0x97, 0x8f, 0x7e, 0x80, 0x55, 0x76, 0xfe, 0x4b, 0x87, 0xd3, 0xab, 0x46, 0x47, 0x72, - 0x0e, 0x3a, 0xa7, 0x86, 0x36, 0xd3, 0xac, 0xfe, 0xea, 0x79, 0x9e, 0x99, 0xba, 0xbb, 0xfe, 0x9d, - 0x99, 0x24, 0x14, 0x32, 0xba, 0x98, 0x27, 0x92, 0x47, 0xbe, 0x3c, 0x6e, 0x76, 0xec, 0x38, 0xf7, - 0x74, 0x4e, 0xc9, 0x15, 0x40, 0x20, 0x99, 0x8f, 0x8c, 0x6e, 0x7c, 0x34, 0xf4, 0x99, 0x66, 0x0d, - 0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xbb, 0xf6, 0xfa, 0x4a, 0xe0, 0xd2, 0xf9, 0x2b, 0xe8, - 0x56, 0xd3, 0x92, 0x01, 0xf4, 0x3e, 0xc4, 0xbb, 0x58, 0xdc, 0xc6, 0xa3, 0x16, 0xe9, 0xc3, 0xc9, - 0xdb, 0xdb, 0x98, 0xc9, 0x91, 0x46, 0x00, 0xba, 0xcb, 0x00, 0xf9, 0x0d, 0x1b, 0xe9, 0x85, 0x66, - 0xb5, 0x17, 0xc1, 0x8e, 0xd1, 0x51, 0x7b, 0x65, 0xdd, 0xe5, 0x53, 0xed, 0x5b, 0x3e, 0xd5, 0x7e, - 0xe4, 0x53, 0xed, 0xcb, 0xcf, 0x69, 0xeb, 0xe3, 0xd3, 0x6a, 0x2d, 0x64, 0xc1, 0x27, 0x27, 0x10, - 0x92, 0x39, 0xd5, 0x82, 0xdb, 0x6e, 0x79, 0xe6, 0x97, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x23, - 0xc0, 0xdc, 0x19, 0x42, 0x04, 0x00, 0x00, +var fileDescriptor_conversation_324d95e4224ee3f5 = []byte{ + // 504 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xcd, 0x38, 0x69, 0xf2, 0x72, 0xd3, 0x17, 0xa2, 0x51, 0x8a, 0xdc, 0x2c, 0x62, 0x2b, 0x1b, + 0xb2, 0x40, 0x36, 0x0a, 0x2b, 0xca, 0xa2, 0x4a, 0x9a, 0x4d, 0x16, 0x08, 0xc9, 0xc0, 0x86, 0x4d, + 0xe4, 0x78, 0xa6, 0xee, 0x28, 0xb1, 0xc7, 0x4c, 0x6e, 0x5a, 0xe5, 0x2f, 0x58, 0xf2, 0x0b, 0xfc, + 0x49, 0x97, 0x7c, 0x41, 0xa8, 0xcc, 0x0f, 0x20, 0xf8, 0x01, 0x64, 0x7b, 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, 0x80, 0xe6, 0x34, 0x40, 0x71, 0xcd, 0x7b, 0x46, + 0x86, 0x99, 0x6d, 0x64, 0xb0, 0xe6, 0xac, 0x57, 0x9f, 0x8d, 0x6f, 0xd3, 0x21, 0xf9, 0x96, 0x0e, + 0xc9, 0x5d, 0x3a, 0x24, 0x5f, 0x7e, 0x0c, 0x6b, 0x1f, 0x9f, 0x16, 0x6b, 0x21, 0x0f, 0xae, 0xdc, + 0x40, 0x2a, 0xee, 0x16, 0x0b, 0xae, 0x9a, 0x79, 0xcc, 0x2f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x11, 0x7d, 0x1a, 0xc5, 0x66, 0x04, 0x00, 0x00, } diff --git a/core/entity/conversation.proto b/core/entity/conversation.proto index f447f79976..794401ee41 100644 --- a/core/entity/conversation.proto +++ b/core/entity/conversation.proto @@ -4,6 +4,7 @@ package berty.entity; option go_package = "berty.tech/core/entity"; +import "api/protobuf/graphql.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "entity/contact.proto"; @@ -13,7 +14,7 @@ message Conversation { // gorm fields // - string id = 1 [(gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; + string id = 1 [(protobuf.gql.graphql_id) = true, (gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; google.protobuf.Timestamp created_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp updated_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp deleted_at = 4 [(gogoproto.stdtime) = true]; @@ -37,7 +38,7 @@ message ConversationMember { // gorm fields // - string id = 1 [(gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; + string id = 1 [(protobuf.gql.graphql_id) = true, (gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; google.protobuf.Timestamp created_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp updated_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp deleted_at = 4 [(gogoproto.stdtime) = true]; diff --git a/core/entity/device.pb.go b/core/entity/device.pb.go index 5bc6dcc076..b70c7aa3be 100644 --- a/core/entity/device.pb.go +++ b/core/entity/device.pb.go @@ -6,6 +6,7 @@ package entity // import "berty.tech/core/entity" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "api/protobuf" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/golang/protobuf/ptypes/timestamp" @@ -56,7 +57,7 @@ func (x Device_Status) String() string { return proto.EnumName(Device_Status_name, int32(x)) } func (Device_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_device_64994f5cae8d1b31, []int{0, 0} + return fileDescriptor_device_0b63a92776f6f59c, []int{0, 0} } type Device struct { @@ -77,7 +78,7 @@ func (m *Device) Reset() { *m = Device{} } func (m *Device) String() string { return proto.CompactTextString(m) } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { - return fileDescriptor_device_64994f5cae8d1b31, []int{0} + return fileDescriptor_device_0b63a92776f6f59c, []int{0} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -672,35 +673,36 @@ var ( ErrIntOverflowDevice = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("entity/device.proto", fileDescriptor_device_64994f5cae8d1b31) } +func init() { proto.RegisterFile("entity/device.proto", fileDescriptor_device_0b63a92776f6f59c) } -var fileDescriptor_device_64994f5cae8d1b31 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xbf, 0x8e, 0xd3, 0x40, - 0x10, 0x87, 0xb3, 0x49, 0x30, 0x64, 0x92, 0x20, 0x6b, 0x41, 0xc8, 0x0a, 0x28, 0x8e, 0x52, 0x59, - 0x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45, 0x18, 0x7d, 0x0c, 0x22, - 0x5d, 0x60, 0x60, 0x2e, 0xdc, 0x5b, 0x6d, 0x72, 0x57, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x56, - 0x6e, 0xa8, 0xa9, 0x7b, 0x02, 0x00, 0x00, +var fileDescriptor_device_0b63a92776f6f59c = []byte{ + // 440 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xbd, 0x8e, 0xd3, 0x40, + 0x14, 0x85, 0x33, 0x4e, 0x30, 0xe4, 0x26, 0x41, 0xd6, 0x80, 0x90, 0x09, 0x52, 0x6c, 0xa5, 0xb2, + 0x10, 0xb2, 0xd1, 0x6e, 0x47, 0x83, 0x92, 0x4d, 0x93, 0x82, 0x02, 0xf3, 0x53, 0xd0, 0x44, 0x13, + 0xfb, 0xae, 0x77, 0xb4, 0xb6, 0xc7, 0x8c, 0x27, 0x41, 0x7e, 0x0b, 0x4a, 0x1e, 0x69, 0x4b, 0x9e, + 0x20, 0xac, 0xcc, 0x0b, 0x44, 0x3c, 0x01, 0xb2, 0xc7, 0x01, 0x3a, 0xb4, 0xdd, 0xd5, 0x99, 0xef, + 0x9c, 0xa3, 0x7b, 0x07, 0x1e, 0x61, 0xae, 0xb8, 0xaa, 0x82, 0x18, 0xf7, 0x3c, 0x42, 0xbf, 0x90, + 0x42, 0x09, 0x3a, 0xde, 0xa2, 0x54, 0x95, 0xaf, 0x9f, 0xa6, 0x53, 0x56, 0xf0, 0xa0, 0x7d, 0xd8, + 0xee, 0x2e, 0x83, 0x44, 0xb2, 0xe2, 0xea, 0x73, 0xaa, 0xc9, 0xe9, 0xe3, 0x44, 0x24, 0xa2, 0x1d, + 0x83, 0x66, 0xea, 0x54, 0x27, 0x11, 0x22, 0x49, 0xf1, 0xaf, 0x49, 0xf1, 0x0c, 0x4b, 0xc5, 0xb2, + 0x42, 0x03, 0xf3, 0x63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 0xa4, 0x3e, 0x38, 0xc3, 0x0b, 0xad, 0xae, + 0x57, 0xe1, 0xb0, 0x03, 0xd6, 0xf1, 0xfc, 0x2d, 0x98, 0xba, 0x80, 0x8e, 0xe0, 0xfe, 0x87, 0xfc, + 0x3a, 0x17, 0x5f, 0x72, 0xab, 0x47, 0x27, 0xd0, 0xe0, 0x39, 0x46, 0x0a, 0x63, 0x8b, 0x50, 0x0b, + 0xc6, 0x2b, 0x5e, 0x46, 0x7f, 0x14, 0xa3, 0x01, 0x16, 0x7b, 0xc6, 0x53, 0xb6, 0x4d, 0xd1, 0xea, + 0x53, 0x00, 0xf3, 0x4d, 0x55, 0x62, 0x7a, 0x69, 0x3d, 0x5f, 0x7a, 0x37, 0xf5, 0x8c, 0x7c, 0xaf, + 0x67, 0xe4, 0xb6, 0x9e, 0x91, 0x6f, 0x3f, 0x67, 0xbd, 0x4f, 0x4f, 0xf4, 0x5e, 0x0a, 0xa3, 0xab, + 0x20, 0x12, 0x12, 0x03, 0xbd, 0xe1, 0xd6, 0x6c, 0x2f, 0x77, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, + 0xac, 0xf9, 0xfd, 0xcf, 0x9b, 0x02, 0x00, 0x00, } diff --git a/core/entity/device.proto b/core/entity/device.proto index 3f44b92aa0..74022b9994 100644 --- a/core/entity/device.proto +++ b/core/entity/device.proto @@ -4,6 +4,7 @@ package berty.entity; option go_package = "berty.tech/core/entity"; +import "api/protobuf/graphql.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -20,7 +21,7 @@ message Device { // gorm fields // - string id = 1 [(gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; + string id = 1 [(protobuf.gql.graphql_id) = true, (gogoproto.moretags) = "gorm:\"primary_key\"", (gogoproto.customname) = "ID"]; google.protobuf.Timestamp created_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp updated_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp deleted_at = 4 [(gogoproto.stdtime) = true];