Skip to content

Commit

Permalink
Update the web-api response types using the latest source
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed May 24, 2022
1 parent 0fb388a commit 78a5959
Show file tree
Hide file tree
Showing 12 changed files with 647 additions and 740 deletions.
156 changes: 102 additions & 54 deletions packages/web-api/src/response/ChatPostMessageResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type ChatPostMessageResponse = WebAPICallResult & {
export interface Message {
app_id?: string;
attachments?: Attachment[];
blocks?: Block[];
blocks?: MessageBlock[];
bot_id?: string;
bot_profile?: BotProfile;
icons?: MessageIcons;
Expand All @@ -51,7 +51,7 @@ export interface Attachment {
author_link?: string;
author_name?: string;
author_subname?: string;
blocks?: Block[];
blocks?: AttachmentBlock[];
bot_id?: string;
callback_id?: string;
channel_id?: string;
Expand Down Expand Up @@ -132,7 +132,7 @@ export interface SelectedOptionElement {
value?: string;
}

export interface Block {
export interface AttachmentBlock {
accessory?: Accessory;
alt_text?: string;
api_decoration_available?: boolean;
Expand All @@ -145,7 +145,7 @@ export interface Block {
external_id?: string;
fallback?: string;
fields?: Hint[];
file?: BlockFile;
file?: PurpleFile;
file_id?: string;
hint?: Hint;
image_bytes?: number;
Expand Down Expand Up @@ -286,7 +286,56 @@ export interface AppIconUrls {
image_original?: string;
}

export interface BlockFile {
export interface PurpleFile {
cc?: Cc[];
created?: number;
edit_link?: string;
external_url?: string;
has_rich_preview?: boolean;
is_starred?: boolean;
last_editor?: string;
original_attachment_count?: number;
original_w?: string;
shares?: Shares;
simplified_html?: string;
thumb_1024_w?: string;
thumb_pdf_h?: string;
thumb_pdf_w?: string;
thumb_video?: string;
thumb_video_h?: number;
user?: string;
}

export interface Cc {
address?: string;
name?: string;
original?: string;
}

export interface Shares {
private?: { [key: string]: Private[] };
public?: { [key: string]: Private[] };
}

export interface Private {
channel_name?: string;
latest_reply?: string;
reply_count?: number;
reply_users?: string[];
reply_users_count?: number;
share_user_id?: string;
team_id?: string;
thread_ts?: string;
ts?: string;
}

export interface Field {
short?: boolean;
title?: string;
value?: string;
}

export interface FileElement {
app_id?: string;
app_name?: string;
bot_id?: string;
Expand Down Expand Up @@ -409,12 +458,6 @@ export interface BlockFile {
vtt?: string;
}

export interface Cc {
address?: string;
name?: string;
original?: string;
}

export interface Headers {
date?: string;
in_reply_to?: string;
Expand All @@ -439,35 +482,62 @@ export interface Reaction {
users?: string[];
}

export interface Shares {
private?: { [key: string]: Private[] };
public?: { [key: string]: Private[] };
export interface Transcription {
locale?: string;
status?: string;
}

export interface Private {
channel_name?: string;
latest_reply?: string;
reply_count?: number;
reply_users?: string[];
reply_users_count?: number;
share_user_id?: string;
team_id?: string;
thread_ts?: string;
ts?: string;
export interface AttachmentMetadata {
extension?: string;
format?: string;
original_h?: number;
original_w?: number;
rotation?: number;
thumb_160?: boolean;
thumb_360_h?: number;
thumb_360_w?: number;
thumb_64?: boolean;
thumb_80?: boolean;
thumb_tiny?: string;
}

export interface Transcription {
locale?: string;
status?: string;
export interface Preview {
can_remove?: boolean;
icon_url?: string;
subtitle?: Hint;
title?: Hint;
type?: string;
}

export interface Field {
short?: boolean;
title?: string;
value?: string;
export interface MessageBlock {
accessory?: Accessory;
alt_text?: string;
api_decoration_available?: boolean;
block_id?: string;
call?: Call;
call_id?: string;
dispatch_action?: boolean;
element?: Accessory;
elements?: Accessory[];
external_id?: string;
fallback?: string;
fields?: Hint[];
file?: FluffyFile;
file_id?: string;
hint?: Hint;
image_bytes?: number;
image_height?: number;
image_url?: string;
image_width?: number;
label?: Hint;
optional?: boolean;
source?: string;
text?: Hint;
title?: Hint;
type?: string;
}

export interface FileElement {
export interface FluffyFile {
app_id?: string;
app_name?: string;
bot_id?: string;
Expand Down Expand Up @@ -590,28 +660,6 @@ export interface FileElement {
vtt?: string;
}

export interface AttachmentMetadata {
extension?: string;
format?: string;
original_h?: number;
original_w?: number;
rotation?: number;
thumb_160?: boolean;
thumb_360_h?: number;
thumb_360_w?: number;
thumb_64?: boolean;
thumb_80?: boolean;
thumb_tiny?: string;
}

export interface Preview {
can_remove?: boolean;
icon_url?: string;
subtitle?: Hint;
title?: Hint;
type?: string;
}

export interface BotProfile {
app_id?: string;
deleted?: boolean;
Expand Down
132 changes: 0 additions & 132 deletions packages/web-api/src/response/ChatScheduleMessageResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,126 +184,23 @@ export interface AppIconUrls {
}

export interface File {
app_id?: string;
app_name?: string;
bot_id?: string;
cc?: Cc[];
channel_actions_count?: number;
channel_actions_ts?: string;
channels?: string[];
comments_count?: number;
converted_pdf?: string;
created?: number;
deanimate?: string;
deanimate_gif?: string;
display_as_bot?: boolean;
duration_ms?: number;
edit_link?: string;
editable?: boolean;
editor?: string;
external_id?: string;
external_type?: string;
external_url?: string;
filetype?: string;
from?: Cc[];
groups?: string[];
has_more?: boolean;
has_rich_preview?: boolean;
headers?: Headers;
hls?: string;
hls_embed?: string;
id?: string;
image_exif_rotation?: number;
ims?: string[];
initial_comment?: InitialComment;
is_external?: boolean;
is_public?: boolean;
is_starred?: boolean;
last_editor?: string;
lines?: number;
lines_more?: number;
media_display_type?: string;
mimetype?: string;
mode?: string;
mp4?: string;
name?: string;
non_owner_editable?: boolean;
num_stars?: number;
original_attachment_count?: number;
original_h?: string;
original_w?: string;
permalink?: string;
permalink_public?: string;
pinned_to?: string[];
pjpeg?: string;
plain_text?: string;
pretty_type?: string;
preview?: string;
preview_highlight?: string;
preview_is_truncated?: boolean;
preview_plain_text?: string;
public_url_shared?: boolean;
reactions?: Reaction[];
sent_to_self?: boolean;
shares?: Shares;
simplified_html?: string;
size?: number;
subject?: string;
subtype?: string;
thumb_1024?: string;
thumb_1024_gif?: string;
thumb_1024_h?: string;
thumb_1024_w?: string;
thumb_160?: string;
thumb_160_gif?: string;
thumb_160_h?: string;
thumb_160_w?: string;
thumb_360?: string;
thumb_360_gif?: string;
thumb_360_h?: string;
thumb_360_w?: string;
thumb_480?: string;
thumb_480_gif?: string;
thumb_480_h?: string;
thumb_480_w?: string;
thumb_64?: string;
thumb_64_gif?: string;
thumb_64_h?: string;
thumb_64_w?: string;
thumb_720?: string;
thumb_720_gif?: string;
thumb_720_h?: string;
thumb_720_w?: string;
thumb_80?: string;
thumb_800?: string;
thumb_800_gif?: string;
thumb_800_h?: string;
thumb_800_w?: string;
thumb_80_gif?: string;
thumb_80_h?: string;
thumb_80_w?: string;
thumb_960?: string;
thumb_960_gif?: string;
thumb_960_h?: string;
thumb_960_w?: string;
thumb_gif?: string;
thumb_pdf?: string;
thumb_pdf_h?: string;
thumb_pdf_w?: string;
thumb_tiny?: string;
thumb_video?: string;
thumb_video_h?: number;
thumb_video_w?: number;
timestamp?: number;
title?: string;
to?: Cc[];
transcription?: Transcription;
updated?: number;
url_private?: string;
url_private_download?: string;
user?: string;
username?: string;
vtt?: string;
}

export interface Cc {
Expand All @@ -312,30 +209,6 @@ export interface Cc {
original?: string;
}

export interface Headers {
date?: string;
in_reply_to?: string;
message_id?: string;
reply_to?: string;
}

export interface InitialComment {
channel?: string;
comment?: string;
created?: number;
id?: string;
is_intro?: boolean;
timestamp?: number;
user?: string;
}

export interface Reaction {
count?: number;
name?: string;
url?: string;
users?: string[];
}

export interface Shares {
private?: { [key: string]: Private[] };
public?: { [key: string]: Private[] };
Expand All @@ -353,11 +226,6 @@ export interface Private {
ts?: string;
}

export interface Transcription {
locale?: string;
status?: string;
}

export interface BotProfile {
app_id?: string;
deleted?: boolean;
Expand Down
Loading

0 comments on commit 78a5959

Please sign in to comment.