-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CF SDK: Subscriber for conversation API (#956)
* Subscriber for conversation API * fix git diff * expect unused var * setup conversation worker * refactor get conversations api * converstation messages fetch and post request * worker folders merged * import links fix * hanlde events via worker * refactor subsribe callbacks * include changeset * unit tests for conversation api * create generic pagination utility * fix tests * funcation renamed * address api usage fix * do not expose create message method * integrate messages and conversation messages api * rename ts type * include more test cases --------- Co-authored-by: Joao Santos <[email protected]>
- Loading branch information
1 parent
45dbb9d
commit e16ec47
Showing
22 changed files
with
699 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@signalwire/core': minor | ||
'@signalwire/js': minor | ||
--- | ||
|
||
Introduce Conversation API with Conversation Subscriber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { SwEvent } from '..' | ||
|
||
export type ConversationMessageEventName = 'conversation.message' | ||
|
||
export interface ConversationMessageEventParams { | ||
conversation_id: string | ||
conversation_name: string | ||
details: Record<string, unknown> | ||
hidden: boolean | ||
id: string | ||
kind: string | ||
metadata: Record<string, unknown> | ||
subtype: string | ||
text?: string | ||
ts: number | ||
type: string | ||
user_id: string | ||
user_name: string | ||
} | ||
|
||
export interface ConversationMessageEvent extends SwEvent { | ||
event_type: ConversationMessageEventName | ||
params: ConversationMessageEventParams | ||
} | ||
|
||
export type ConversationEvent = ConversationMessageEvent | ||
|
||
export type ConversationEventParams = ConversationMessageEventParams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.