Skip to content

Commit 529fc59

Browse files
fix: sync SubmitActionOptions type with backend submit_action endpoint (#1704)
## Summary - Synced `SubmitActionOptions` type with the backend `SubmitActionRequest` struct from the chat repo - Added 13 missing action payloads: `block`, `custom`, `delete_activity`, `delete_comment`, `delete_reaction`, `end_call`, `escalate`, `flag`, `kick_user`, `mark_reviewed`, `reject_appeal`, `shadow_block`, `unblock` - Added missing fields on existing payloads (`ban`, `delete_message`, `delete_user`, `restore`, `unban`) - Added top-level `appeal_id` field ## Linear ticket https://linear.app/stream/issue/MOD2-708/update-chat-js-sdk-to-support-the-updated-types-in-submit-action ## Test plan - [x] TypeScript compiles cleanly (`tsc --noEmit`) - [ ] Verify no downstream consumers break with the expanded type 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 56101a1 commit 529fc59

1 file changed

Lines changed: 75 additions & 4 deletions

File tree

src/types.ts

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,23 +3721,94 @@ export type DeleteMessageOptions = {
37213721
};
37223722

37233723
export type SubmitActionOptions = {
3724+
appeal_id?: string;
37243725
ban?: {
3725-
channel_ban_only?: boolean;
3726+
target_user_id?: string;
3727+
shadow?: boolean;
37263728
reason?: string;
3727-
timeout?: number;
3729+
channel_ban_only?: boolean;
3730+
channel_cid?: string;
3731+
ip_ban?: boolean;
37283732
delete_messages?: MessageDeletionStrategy;
3733+
timeout?: number;
3734+
};
3735+
block?: {
3736+
reason?: string;
3737+
};
3738+
custom?: {
3739+
id: string;
3740+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3741+
options?: Record<string, any>;
3742+
};
3743+
delete_activity?: {
3744+
hard_delete?: boolean;
3745+
reason?: string;
3746+
entity_id?: string;
3747+
entity_type?: string;
3748+
};
3749+
delete_comment?: {
3750+
hard_delete?: boolean;
3751+
reason?: string;
3752+
entity_id?: string;
3753+
entity_type?: string;
37293754
};
37303755
delete_message?: {
37313756
hard_delete?: boolean;
3757+
reason?: string;
3758+
entity_id?: string;
3759+
entity_type?: string;
3760+
};
3761+
delete_reaction?: {
3762+
hard_delete?: boolean;
3763+
reason?: string;
3764+
entity_id?: string;
3765+
entity_type?: string;
37323766
};
37333767
delete_user?: {
3734-
delete_conversation_channels?: boolean;
37353768
hard_delete?: boolean;
3769+
reason?: string;
37363770
mark_messages_deleted?: boolean;
3771+
delete_conversation_channels?: boolean;
3772+
delete_feeds_content?: boolean;
3773+
entity_id?: string;
3774+
entity_type?: string;
3775+
};
3776+
end_call?: Record<string, never>;
3777+
escalate?: {
3778+
reason: string;
3779+
category: string;
3780+
priority: string;
3781+
};
3782+
flag?: {
3783+
entity_type: string;
3784+
entity_id: string;
3785+
entity_creator_id?: string;
3786+
reason?: string;
3787+
moderation_payload?: ModerationPayload;
3788+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3789+
custom?: Record<string, any>;
3790+
};
3791+
kick_user?: Record<string, never>;
3792+
mark_reviewed?: {
3793+
disable_marking_content_as_reviewed?: boolean;
3794+
content_to_mark_as_reviewed_limit?: number;
3795+
decision_reason?: string;
3796+
};
3797+
reject_appeal?: {
3798+
decision_reason: string;
3799+
};
3800+
restore?: {
3801+
decision_reason?: string;
3802+
};
3803+
shadow_block?: {
3804+
reason?: string;
37373805
};
3738-
restore?: {};
37393806
unban?: {
37403807
channel_cid?: string;
3808+
decision_reason?: string;
3809+
};
3810+
unblock?: {
3811+
decision_reason?: string;
37413812
};
37423813
user_id?: string;
37433814
};

0 commit comments

Comments
 (0)