Skip to content

chat,user: initial plumbing for pay-to-chat #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,059 changes: 1,850 additions & 2,209 deletions generated/go/chat/v2/chat_service.pb.go

Large diffs are not rendered by default.

2,875 changes: 1,295 additions & 1,580 deletions generated/go/chat/v2/chat_service.pb.validate.go

Large diffs are not rendered by default.

356 changes: 163 additions & 193 deletions generated/go/chat/v2/chat_service_grpc.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion generated/go/common/v1/model.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/go/common/v1/model.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

931 changes: 529 additions & 402 deletions generated/go/transaction/v2/transaction_service.pb.go

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions generated/go/transaction/v2/transaction_service.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

339 changes: 209 additions & 130 deletions generated/go/user/v1/identity_service.pb.go

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions generated/go/user/v1/identity_service.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/protobuf-es/badge/v1/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './badge_service_connect';
export * from './badge_service_pb';
export * from './badge_service_connect';
2 changes: 1 addition & 1 deletion generated/protobuf-es/chat/v1/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './chat_service_connect';
export * from './chat_service_pb';
export * from './chat_service_connect';
111 changes: 44 additions & 67 deletions generated/protobuf-es/chat/v2/chat_service_connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable */
// @ts-nocheck

import { AdvancePointerRequest, AdvancePointerResponse, GetChatsRequest, GetChatsResponse, GetMessagesRequest, GetMessagesResponse, NotifyIsTypingRequest, NotifyIsTypingResponse, RevealIdentityRequest, RevealIdentityResponse, SendMessageRequest, SendMessageResponse, SetMuteStateRequest, SetMuteStateResponse, SetSubscriptionStateRequest, SetSubscriptionStateResponse, StartChatRequest, StartChatResponse, StreamChatEventsRequest, StreamChatEventsResponse } from "./chat_service_pb";
import { AdvancePointerRequest, AdvancePointerResponse, GetChatsRequest, GetChatsResponse, GetMessagesRequest, GetMessagesResponse, NotifyIsTypingRequest, NotifyIsTypingResponse, SendMessageRequest, SendMessageResponse, SetMuteStateRequest, SetMuteStateResponse, StartChatRequest, StartChatResponse, StreamChatEventsRequest, StreamChatEventsResponse, StreamMessagesRequest, StreamMessagesResponse } from "./chat_service_pb";
import { MethodKind } from "@bufbuild/protobuf";

/**
Expand All @@ -12,6 +12,46 @@ import { MethodKind } from "@bufbuild/protobuf";
export const Chat = {
typeName: "code.chat.v2.Chat",
methods: {
/**
* StreamChatEvents streams all chat events for the requesting user.
*
* Chat events will include any update to a chat, including:
* 1. Metadata changes.
* 2. Membership changes.
* 3. Latest messages.
*
* The server will optionally filter out some events depending on load
* and chat type. For example, Broadcast chats will not receive latest
* messages.
*
* Clients should use GetMessages to backfill in any historical messages
* for a chat. It should be sufficient to rely on ChatEvents for some types
* of chats, but using StreamMessages provides a guarentee of message events
* for all chats.
*
* @generated from rpc code.chat.v2.Chat.StreamChatEvents
*/
streamChatEvents: {
name: "StreamChatEvents",
I: StreamChatEventsRequest,
O: StreamChatEventsResponse,
kind: MethodKind.BiDiStreaming,
},
/**
* StreamMessages streams all messages/message states for the requested chat.
*
* By default, streams will resume messages from the last acknowledged delivery
* pointer of the caller. This can be overridden by setting 'last_message',
* 'latest_only'.
*
* @generated from rpc code.chat.v2.Chat.StreamMessages
*/
streamMessages: {
name: "StreamMessages",
I: StreamMessagesRequest,
O: StreamMessagesResponse,
kind: MethodKind.BiDiStreaming,
},
/**
* GetChats gets the set of chats for an owner account using a paged API.
* This RPC is aware of all identities tied to the owner account.
Expand All @@ -35,46 +75,6 @@ export const Chat = {
O: GetMessagesResponse,
kind: MethodKind.Unary,
},
/**
* StreamChatEvents streams chat events in real-time. Chat events include
* messages, pointer updates, etc.
*
* The streaming protocol is follows:
* 1. Client initiates a stream by sending an OpenChatEventStream message.
* 2. If an error is encoutered, a ChatStreamEventError message will be
* returned by server and the stream will be closed.
* 3. Server will immediately flush initial chat state.
* 4. New chat events will be pushed to the stream in real time as they
* are received.
*
* This RPC supports a keepalive protocol as follows:
* 1. Client initiates a stream by sending an OpenChatEventStream message.
* 2. Upon stream initialization, server begins the keepalive protocol.
* 3. Server sends a ping to the client.
* 4. Client responds with a pong as fast as possible, making note of
* the delay for when to expect the next ping.
* 5. Steps 3 and 4 are repeated until the stream is explicitly terminated
* or is deemed to be unhealthy.
*
* Client notes:
* * Client should be careful to process events async, so any responses to pings are
* not delayed.
* * Clients should implement a reasonable backoff strategy upon continued timeout
* failures.
* * Clients that abuse pong messages may have their streams terminated by server.
*
* At any point in the stream, server will respond with events in real time as
* they are observed. Events sent over the stream should not affect the ping/pong
* protocol timings.
*
* @generated from rpc code.chat.v2.Chat.StreamChatEvents
*/
streamChatEvents: {
name: "StreamChatEvents",
I: StreamChatEventsRequest,
O: StreamChatEventsResponse,
kind: MethodKind.BiDiStreaming,
},
/**
* StartChat starts a chat. The RPC call is idempotent and will use existing
* chats whenever applicable within the context of message routing.
Expand All @@ -88,7 +88,7 @@ export const Chat = {
kind: MethodKind.Unary,
},
/**
* SendMessage sends a message to a chat
* SendMessage sends a message to a chat.
*
* @generated from rpc code.chat.v2.Chat.SendMessage
*/
Expand All @@ -99,7 +99,7 @@ export const Chat = {
kind: MethodKind.Unary,
},
/**
* AdvancePointer advances a pointer in message history for a chat member
* AdvancePointer advances a pointer in message history for a chat member.
*
* @generated from rpc code.chat.v2.Chat.AdvancePointer
*/
Expand All @@ -110,19 +110,7 @@ export const Chat = {
kind: MethodKind.Unary,
},
/**
* RevealIdentity reveals a chat member's identity if it is anonymous. A chat
* message will be inserted on success.
*
* @generated from rpc code.chat.v2.Chat.RevealIdentity
*/
revealIdentity: {
name: "RevealIdentity",
I: RevealIdentityRequest,
O: RevealIdentityResponse,
kind: MethodKind.Unary,
},
/**
* SetMuteState configures a chat member's mute state
* SetMuteState configures a chat member's mute state.
*
* @generated from rpc code.chat.v2.Chat.SetMuteState
*/
Expand All @@ -132,17 +120,6 @@ export const Chat = {
O: SetMuteStateResponse,
kind: MethodKind.Unary,
},
/**
* SetSubscriptionState configures a chat member's susbscription state
*
* @generated from rpc code.chat.v2.Chat.SetSubscriptionState
*/
setSubscriptionState: {
name: "SetSubscriptionState",
I: SetSubscriptionStateRequest,
O: SetSubscriptionStateResponse,
kind: MethodKind.Unary,
},
/**
* NotifyIsTypingRequest notifies a chat that the sending member is typing.
*
Expand Down
Loading