Skip to content

Commit

Permalink
feat(web-api): generate Web API response types
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Oct 30, 2024
1 parent 1be7a9e commit 8dcdb22
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ tmp/
*.bk

.DS_Store
.nyc_output/
13 changes: 11 additions & 2 deletions packages/web-api/src/types/response/ChatPostMessageResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ export interface FileElement {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -652,6 +653,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -691,9 +693,15 @@ export interface Private {

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

export interface TranscriptionPreview {
content?: string;
has_more?: boolean;
}

export interface Attachment {
actions?: Action[];
app_id?: string;
Expand Down Expand Up @@ -745,7 +753,7 @@ export interface Attachment {
msg_subtype?: string;
original_url?: string;
pretext?: string;
preview?: Preview;
preview?: AttachmentPreview;
service_icon?: string;
service_name?: string;
service_url?: string;
Expand Down Expand Up @@ -1036,6 +1044,7 @@ export interface MessageFile {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -1265,7 +1274,7 @@ export interface AttachmentMetadata {
thumb_tiny?: string;
}

export interface Preview {
export interface AttachmentPreview {
can_remove?: boolean;
icon_url?: string;
subtitle?: DescriptionElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export interface File {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -643,6 +644,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -682,9 +684,15 @@ export interface Private {

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

export interface Preview {
content?: string;
has_more?: boolean;
}

export interface BotProfile {
app_id?: string;
deleted?: boolean;
Expand Down
8 changes: 8 additions & 0 deletions packages/web-api/src/types/response/ChatUpdateResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ export interface File {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -648,6 +649,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -687,9 +689,15 @@ export interface Private {

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

export interface Preview {
content?: string;
has_more?: boolean;
}

export interface BotProfile {
app_id?: string;
deleted?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export interface FileElement {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -668,6 +669,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -707,9 +709,15 @@ export interface Private {

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

export interface TranscriptionPreview {
content?: string;
has_more?: boolean;
}

export interface Attachment {
actions?: Action[];
app_id?: string;
Expand Down Expand Up @@ -761,7 +769,7 @@ export interface Attachment {
msg_subtype?: string;
original_url?: string;
pretext?: string;
preview?: Preview;
preview?: AttachmentPreview;
service_icon?: string;
service_name?: string;
service_url?: string;
Expand Down Expand Up @@ -1052,6 +1060,7 @@ export interface PurpleFile {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -1278,7 +1287,7 @@ export interface AttachmentMetadata {
thumb_tiny?: string;
}

export interface Preview {
export interface AttachmentPreview {
can_remove?: boolean;
icon_url?: string;
subtitle?: DescriptionElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ export interface File {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -659,6 +660,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -698,9 +700,15 @@ export interface Private {

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

export interface Preview {
content?: string;
has_more?: boolean;
}

export interface BotProfile {
app_id?: string;
deleted?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export interface FileElement {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -657,6 +658,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -696,9 +698,15 @@ export interface Private {

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

export interface TranscriptionPreview {
content?: string;
has_more?: boolean;
}

export interface Attachment {
actions?: Action[];
app_id?: string;
Expand Down Expand Up @@ -750,7 +758,7 @@ export interface Attachment {
msg_subtype?: string;
original_url?: string;
pretext?: string;
preview?: Preview;
preview?: AttachmentPreview;
service_icon?: string;
service_name?: string;
service_url?: string;
Expand Down Expand Up @@ -1041,6 +1049,7 @@ export interface PurpleFile {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -1267,7 +1276,7 @@ export interface AttachmentMetadata {
thumb_tiny?: string;
}

export interface Preview {
export interface AttachmentPreview {
can_remove?: boolean;
icon_url?: string;
subtitle?: DescriptionElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

import type { WebAPICallResult } from '../../WebClient';
export type ConversationsRequestSharedInviteListResponse = WebAPICallResult & {
error?: string;
invite_requests?: InviteRequest[];
needed?: string;
ok?: boolean;
provided?: string;
};

export interface InviteRequest {
Expand All @@ -32,8 +35,8 @@ export interface Channel {
is_im?: boolean;
is_private?: boolean;
name?: string;
pending_connections?: any[];
previous_connections?: any[];
pending_connections?: Connection[];
previous_connections?: Connection[];
}

export interface Connection {
Expand Down
8 changes: 8 additions & 0 deletions packages/web-api/src/types/response/FilesInfoResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface File {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -316,6 +317,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -547,9 +549,15 @@ export interface CustomizableInputParameter {

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

export interface Preview {
content?: string;
has_more?: boolean;
}

export interface Paging {
count?: number;
page?: number;
Expand Down
8 changes: 8 additions & 0 deletions packages/web-api/src/types/response/FilesListResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface File {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -310,6 +311,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -541,9 +543,15 @@ export interface CustomizableInputParameter {

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

export interface Preview {
content?: string;
has_more?: boolean;
}

export interface Paging {
count?: number;
page?: number;
Expand Down
8 changes: 8 additions & 0 deletions packages/web-api/src/types/response/FilesRemoteAddResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface File {
is_channel_space?: boolean;
is_external?: boolean;
is_public?: boolean;
is_restricted_sharing_enabled?: boolean;
is_starred?: boolean;
last_editor?: string;
last_read?: number;
Expand Down Expand Up @@ -309,6 +310,7 @@ export interface Column {
export interface MediaProgress {
duration_ms?: number;
max_offset_ms?: number;
media_watched?: boolean;
offset_ms?: number;
}

Expand Down Expand Up @@ -540,5 +542,11 @@ export interface CustomizableInputParameter {

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

export interface Preview {
content?: string;
has_more?: boolean;
}
Loading

0 comments on commit 8dcdb22

Please sign in to comment.