From 77581a154448630e14aacab327679b12b6c84497 Mon Sep 17 00:00:00 2001 From: Alissa Renz Date: Wed, 6 Dec 2023 16:18:53 -0800 Subject: [PATCH] Add support for functions.* (complete) methods (#1702) --- packages/web-api/src/methods.ts | 23 ++ .../response/AdminFunctionsListResponse.ts | 1 + .../response/AppsManifestExportResponse.ts | 32 +- .../response/AppsManifestValidateResponse.ts | 7 +- .../web-api/src/response/AuthTestResponse.ts | 1 + .../src/response/ChatPostMessageResponse.ts | 4 + .../response/ChatScheduleMessageResponse.ts | 1 + .../src/response/ChatUpdateResponse.ts | 4 + .../response/ConversationsHistoryResponse.ts | 4 + .../src/response/ConversationsOpenResponse.ts | 1 + .../response/ConversationsRepliesResponse.ts | 4 + .../FilesCompleteUploadExternalResponse.ts | 13 + .../src/response/FilesRemoteAddResponse.ts | 3 + .../src/response/FilesRemoteInfoResponse.ts | 3 + .../src/response/FilesRemoteShareResponse.ts | 3 + .../src/response/FilesRemoteUpdateResponse.ts | 3 + .../response/FilesRevokePublicURLResponse.ts | 3 + .../response/FilesSharedPublicURLResponse.ts | 3 + .../src/response/FilesUploadResponse.ts | 3 + .../FunctionsCompleteErrorResponse.ts | 17 + .../FunctionsCompleteSuccessResponse.ts | 17 + .../web-api/src/response/PinsListResponse.ts | 3 + .../src/response/ReactionsGetResponse.ts | 1 + .../src/response/ReactionsListResponse.ts | 4 + .../web-api/src/response/RtmStartResponse.ts | 4 + .../web-api/src/response/SearchAllResponse.ts | 292 ++++++++-------- .../src/response/SearchFilesResponse.ts | 324 ++++++++++++------ .../src/response/SearchMessagesResponse.ts | 4 + .../src/response/TeamBillableInfoResponse.ts | 15 +- .../src/response/TeamProfileGetResponse.ts | 1 + packages/web-api/src/response/index.ts | 2 + 31 files changed, 546 insertions(+), 254 deletions(-) create mode 100644 packages/web-api/src/response/FunctionsCompleteErrorResponse.ts create mode 100644 packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts diff --git a/packages/web-api/src/methods.ts b/packages/web-api/src/methods.ts index fdb7bf7bd..1ac6b5844 100644 --- a/packages/web-api/src/methods.ts +++ b/packages/web-api/src/methods.ts @@ -155,6 +155,8 @@ import { FilesRevokePublicURLResponse, FilesSharedPublicURLResponse, FilesUploadResponse, + FunctionsCompleteErrorResponse, + FunctionsCompleteSuccessResponse, MigrationExchangeResponse, OauthAccessResponse, OauthV2AccessResponse, @@ -701,6 +703,14 @@ export abstract class Methods extends EventEmitter { }, }; + public readonly functions = { + completeError: bindApiCall(this, 'functions.completeError'), + completeSuccess: bindApiCall( + this, + 'functions.completeSuccess', + ), + }; + public readonly migration = { exchange: bindApiCall(this, 'migration.exchange'), }; @@ -2020,6 +2030,19 @@ export interface FilesRemoteShareArguments extends WebAPICallOptions, TokenOverr external_id?: string; } +/* + * `functions.*` + */ +export interface FunctionsCompleteErrorArguments extends WebAPICallOptions, TokenOverridable { + function_execution_id: string; + error: string; +} + +export interface FunctionsCompleteSuccessArguments extends WebAPICallOptions, TokenOverridable { + function_execution_id: string; + outputs: Record; +} + /* * `groups.*` */ diff --git a/packages/web-api/src/response/AdminFunctionsListResponse.ts b/packages/web-api/src/response/AdminFunctionsListResponse.ts index 7f4186738..13dfcd56d 100644 --- a/packages/web-api/src/response/AdminFunctionsListResponse.ts +++ b/packages/web-api/src/response/AdminFunctionsListResponse.ts @@ -25,6 +25,7 @@ export interface Function { date_deleted?: number; date_updated?: number; description?: string; + form_enabled?: boolean; id?: string; input_parameters?: PutParameter[]; output_parameters?: PutParameter[]; diff --git a/packages/web-api/src/response/AppsManifestExportResponse.ts b/packages/web-api/src/response/AppsManifestExportResponse.ts index b7b005eda..bfee78b49 100644 --- a/packages/web-api/src/response/AppsManifestExportResponse.ts +++ b/packages/web-api/src/response/AppsManifestExportResponse.ts @@ -21,13 +21,14 @@ export interface Manifest { _metadata?: Metadata; display_information?: DisplayInformation; features?: Features; + functions?: { [key: string]: Function }; oauth_config?: OauthConfig; settings?: Settings; } export interface Metadata { - major_version?: string; - minor_version?: string; + major_version?: number; + minor_version?: number; } export interface DisplayInformation { @@ -71,9 +72,30 @@ export interface SlashCommand { usage_hint?: string; } +export interface Function { + description?: string; + input_parameters?: { [key: string]: PutParameter }; + output_parameters?: { [key: string]: PutParameter }; + title?: string; +} + +export interface PutParameter { + description?: string; + hint?: string; + is_required?: boolean; + maxLength?: number; + maximum?: number; + minLength?: number; + minimum?: number; + name?: string; + title?: string; + type?: string; +} + export interface OauthConfig { - redirect_urls?: string[]; - scopes?: Scopes; + redirect_urls?: string[]; + scopes?: Scopes; + token_management_enabled?: boolean; } export interface Scopes { @@ -86,6 +108,8 @@ export interface Settings { background_color?: string; description?: string; event_subscriptions?: EventSubscriptions; + function_runtime?: string; + hermes_app_type?: string; interactivity?: Interactivity; long_description?: string; org_deploy_enabled?: boolean; diff --git a/packages/web-api/src/response/AppsManifestValidateResponse.ts b/packages/web-api/src/response/AppsManifestValidateResponse.ts index fb955dc86..287c19e46 100644 --- a/packages/web-api/src/response/AppsManifestValidateResponse.ts +++ b/packages/web-api/src/response/AppsManifestValidateResponse.ts @@ -19,9 +19,10 @@ export type AppsManifestValidateResponse = WebAPICallResult & { }; export interface Error { - code?: string; - message?: string; - pointer?: string; + code?: string; + message?: string; + pointer?: string; + related_component?: string; } export interface ResponseMetadata { diff --git a/packages/web-api/src/response/AuthTestResponse.ts b/packages/web-api/src/response/AuthTestResponse.ts index 0c0365bed..c50744e6d 100644 --- a/packages/web-api/src/response/AuthTestResponse.ts +++ b/packages/web-api/src/response/AuthTestResponse.ts @@ -15,6 +15,7 @@ export type AuthTestResponse = WebAPICallResult & { bot_id?: string; enterprise_id?: string; error?: string; + expires_in?: number; is_enterprise_install?: boolean; needed?: string; ok?: boolean; diff --git a/packages/web-api/src/response/ChatPostMessageResponse.ts b/packages/web-api/src/response/ChatPostMessageResponse.ts index 259ea5ef4..491fe6e50 100644 --- a/packages/web-api/src/response/ChatPostMessageResponse.ts +++ b/packages/web-api/src/response/ChatPostMessageResponse.ts @@ -426,6 +426,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -548,11 +549,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -768,6 +771,7 @@ export interface MessageFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/ChatScheduleMessageResponse.ts b/packages/web-api/src/response/ChatScheduleMessageResponse.ts index ce02c7ccc..3879b7de0 100644 --- a/packages/web-api/src/response/ChatScheduleMessageResponse.ts +++ b/packages/web-api/src/response/ChatScheduleMessageResponse.ts @@ -358,6 +358,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/ChatUpdateResponse.ts b/packages/web-api/src/response/ChatUpdateResponse.ts index a95163029..9c816c3e4 100644 --- a/packages/web-api/src/response/ChatUpdateResponse.ts +++ b/packages/web-api/src/response/ChatUpdateResponse.ts @@ -370,6 +370,7 @@ export interface BlockFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -580,6 +581,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -672,11 +674,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/ConversationsHistoryResponse.ts b/packages/web-api/src/response/ConversationsHistoryResponse.ts index dcc684409..fa3330470 100644 --- a/packages/web-api/src/response/ConversationsHistoryResponse.ts +++ b/packages/web-api/src/response/ConversationsHistoryResponse.ts @@ -442,6 +442,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -564,11 +565,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -784,6 +787,7 @@ export interface BlockFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/ConversationsOpenResponse.ts b/packages/web-api/src/response/ConversationsOpenResponse.ts index 37da5dcfb..48cc35b23 100644 --- a/packages/web-api/src/response/ConversationsOpenResponse.ts +++ b/packages/web-api/src/response/ConversationsOpenResponse.ts @@ -374,6 +374,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/ConversationsRepliesResponse.ts b/packages/web-api/src/response/ConversationsRepliesResponse.ts index 5279c3446..dc7f13fe5 100644 --- a/packages/web-api/src/response/ConversationsRepliesResponse.ts +++ b/packages/web-api/src/response/ConversationsRepliesResponse.ts @@ -431,6 +431,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -553,11 +554,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -773,6 +776,7 @@ export interface BlockFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts b/packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts index 497ced64b..316db36a3 100644 --- a/packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts +++ b/packages/web-api/src/response/FilesCompleteUploadExternalResponse.ts @@ -18,6 +18,7 @@ export type FilesCompleteUploadExternalResponse = WebAPICallResult & { }; export interface File { + alt_txt?: string; channels?: string[]; comments_count?: number; created?: number; @@ -41,6 +42,8 @@ export interface File { mimetype?: string; mode?: string; name?: string; + original_h?: number; + original_w?: number; permalink?: string; permalink_public?: string; pretty_type?: string; @@ -50,6 +53,13 @@ export interface File { public_url_shared?: boolean; shares?: Shares; size?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_64?: string; + thumb_80?: string; + thumb_tiny?: string; timestamp?: number; title?: string; url_private?: string; @@ -65,10 +75,13 @@ export interface Shares { export interface Public { channel_name?: string; + latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; + thread_ts?: string; ts?: string; } diff --git a/packages/web-api/src/response/FilesRemoteAddResponse.ts b/packages/web-api/src/response/FilesRemoteAddResponse.ts index c8356c00f..77ffe2c92 100644 --- a/packages/web-api/src/response/FilesRemoteAddResponse.ts +++ b/packages/web-api/src/response/FilesRemoteAddResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FilesRemoteInfoResponse.ts b/packages/web-api/src/response/FilesRemoteInfoResponse.ts index d98749879..f9b0aefb5 100644 --- a/packages/web-api/src/response/FilesRemoteInfoResponse.ts +++ b/packages/web-api/src/response/FilesRemoteInfoResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FilesRemoteShareResponse.ts b/packages/web-api/src/response/FilesRemoteShareResponse.ts index a18f5c587..b3cbb60d2 100644 --- a/packages/web-api/src/response/FilesRemoteShareResponse.ts +++ b/packages/web-api/src/response/FilesRemoteShareResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FilesRemoteUpdateResponse.ts b/packages/web-api/src/response/FilesRemoteUpdateResponse.ts index e9742f4b6..453a490af 100644 --- a/packages/web-api/src/response/FilesRemoteUpdateResponse.ts +++ b/packages/web-api/src/response/FilesRemoteUpdateResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FilesRevokePublicURLResponse.ts b/packages/web-api/src/response/FilesRevokePublicURLResponse.ts index eb38decb3..79ad43204 100644 --- a/packages/web-api/src/response/FilesRevokePublicURLResponse.ts +++ b/packages/web-api/src/response/FilesRevokePublicURLResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FilesSharedPublicURLResponse.ts b/packages/web-api/src/response/FilesSharedPublicURLResponse.ts index fcab2354a..32d5f14aa 100644 --- a/packages/web-api/src/response/FilesSharedPublicURLResponse.ts +++ b/packages/web-api/src/response/FilesSharedPublicURLResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FilesUploadResponse.ts b/packages/web-api/src/response/FilesUploadResponse.ts index 6a9644af0..71047cb65 100644 --- a/packages/web-api/src/response/FilesUploadResponse.ts +++ b/packages/web-api/src/response/FilesUploadResponse.ts @@ -102,6 +102,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -224,11 +225,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/FunctionsCompleteErrorResponse.ts b/packages/web-api/src/response/FunctionsCompleteErrorResponse.ts new file mode 100644 index 000000000..0cf44f406 --- /dev/null +++ b/packages/web-api/src/response/FunctionsCompleteErrorResponse.ts @@ -0,0 +1,17 @@ +/* eslint-disable */ +///////////////////////////////////////////////////////////////////////////////////////// +// // +// !!! DO NOT EDIT THIS FILE !!! // +// // +// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // +// Please refer to the script code to learn how to update the source data. // +// // +///////////////////////////////////////////////////////////////////////////////////////// + +import { WebAPICallResult } from '../WebClient'; +export type FunctionsCompleteErrorResponse = WebAPICallResult & { + error?: string; + needed?: string; + ok?: boolean; + provided?: string; +}; diff --git a/packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts b/packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts new file mode 100644 index 000000000..e81792d51 --- /dev/null +++ b/packages/web-api/src/response/FunctionsCompleteSuccessResponse.ts @@ -0,0 +1,17 @@ +/* eslint-disable */ +///////////////////////////////////////////////////////////////////////////////////////// +// // +// !!! DO NOT EDIT THIS FILE !!! // +// // +// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // +// Please refer to the script code to learn how to update the source data. // +// // +///////////////////////////////////////////////////////////////////////////////////////// + +import { WebAPICallResult } from '../WebClient'; +export type FunctionsCompleteSuccessResponse = WebAPICallResult & { + error?: string; + needed?: string; + ok?: boolean; + provided?: string; +}; diff --git a/packages/web-api/src/response/PinsListResponse.ts b/packages/web-api/src/response/PinsListResponse.ts index 0eb228977..1cb28b34e 100644 --- a/packages/web-api/src/response/PinsListResponse.ts +++ b/packages/web-api/src/response/PinsListResponse.ts @@ -110,6 +110,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -232,11 +233,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; diff --git a/packages/web-api/src/response/ReactionsGetResponse.ts b/packages/web-api/src/response/ReactionsGetResponse.ts index b8eace75d..28ae8343b 100644 --- a/packages/web-api/src/response/ReactionsGetResponse.ts +++ b/packages/web-api/src/response/ReactionsGetResponse.ts @@ -358,6 +358,7 @@ export interface File { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/ReactionsListResponse.ts b/packages/web-api/src/response/ReactionsListResponse.ts index 4619974ac..e62fb413f 100644 --- a/packages/web-api/src/response/ReactionsListResponse.ts +++ b/packages/web-api/src/response/ReactionsListResponse.ts @@ -443,6 +443,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -565,11 +566,13 @@ export interface Shares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -785,6 +788,7 @@ export interface BlockFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/RtmStartResponse.ts b/packages/web-api/src/response/RtmStartResponse.ts index 081bab1d2..c95acfd7c 100644 --- a/packages/web-api/src/response/RtmStartResponse.ts +++ b/packages/web-api/src/response/RtmStartResponse.ts @@ -537,6 +537,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -659,11 +660,13 @@ export interface PurpleShares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -863,6 +866,7 @@ export interface MessageFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/SearchAllResponse.ts b/packages/web-api/src/response/SearchAllResponse.ts index 978a7b82b..1d7ab00b6 100644 --- a/packages/web-api/src/response/SearchAllResponse.ts +++ b/packages/web-api/src/response/SearchAllResponse.ts @@ -28,93 +28,106 @@ export interface Files { } export interface FilesMatch { - attachments?: Attachment[]; - bot_id?: string; - cc?: Cc[]; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: MatchHeaders; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - 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; - name?: string; - non_owner_editable?: boolean; - original_attachment_count?: number; - original_h?: number; - original_w?: number; - permalink?: string; - permalink_public?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; - public_url_shared?: boolean; - sent_to_self?: boolean; - shares?: MatchShares; - size?: number; - subject?: string; - thumb_1024?: string; - thumb_1024_h?: number; - thumb_1024_w?: number; - thumb_160?: string; - thumb_360?: string; - thumb_360_h?: number; - thumb_360_w?: number; - thumb_480?: string; - thumb_480_h?: number; - thumb_480_w?: number; - thumb_64?: string; - thumb_720?: string; - thumb_720_h?: number; - thumb_720_w?: number; - thumb_80?: string; - thumb_800?: string; - thumb_800_h?: number; - thumb_800_w?: number; - thumb_960?: string; - thumb_960_h?: number; - thumb_960_w?: number; - thumb_pdf?: string; - thumb_pdf_h?: number; - thumb_pdf_w?: number; - thumb_tiny?: string; - thumb_video?: string; - timestamp?: number; - title?: string; - to?: Cc[]; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + access?: string; + attachments?: Attachment[]; + bot_id?: string; + cc?: Cc[]; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + edit_link?: string; + editable?: boolean; + editors?: string[]; + editors_count?: number; + external_id?: string; + external_type?: string; + external_url?: string; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: MatchHeaders; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + non_owner_editable?: boolean; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: number; + original_w?: number; + permalink?: string; + permalink_public?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; + private_channels_with_file_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + sent_to_self?: boolean; + shares?: MatchShares; + size?: number; + subject?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: string[]; + thumb_1024?: string; + thumb_1024_h?: number; + thumb_1024_w?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_480?: string; + thumb_480_h?: number; + thumb_480_w?: number; + thumb_64?: string; + thumb_720?: string; + thumb_720_h?: number; + thumb_720_w?: number; + thumb_80?: string; + thumb_800?: string; + thumb_800_h?: number; + thumb_800_w?: number; + thumb_960?: string; + thumb_960_h?: number; + thumb_960_w?: number; + thumb_pdf?: string; + thumb_pdf_h?: number; + thumb_pdf_w?: number; + thumb_tiny?: string; + thumb_video?: string; + timestamp?: number; + title?: string; + title_blocks?: MatchTitleBlock[]; + to?: Cc[]; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; } export interface Attachment { @@ -126,7 +139,7 @@ export interface Attachment { author_link?: string; author_name?: string; author_subname?: string; - blocks?: TitleBlockElement[]; + blocks?: AttachmentBlock[]; bot_id?: string; callback_id?: string; channel_id?: string; @@ -237,7 +250,7 @@ export enum ActionType { WorkflowButton = 'workflow_button', } -export interface TitleBlockElement { +export interface AttachmentBlock { accessory?: Accessory; alt_text?: string; app_collaborators?: string[]; @@ -438,7 +451,7 @@ export interface FileElement { app_id?: string; app_name?: string; attachments?: any[]; - blocks?: TitleBlockElement[]; + blocks?: AttachmentBlock[]; bot_id?: string; canvas_template_mode?: string; cc?: Cc[]; @@ -519,6 +532,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -571,7 +585,7 @@ export interface FileElement { thumb_video_w?: number; timestamp?: number; title?: string; - title_blocks?: TitleBlockElement[]; + title_blocks?: AttachmentBlock[]; to?: Cc[]; transcription?: Transcription; update_notification?: number; @@ -641,11 +655,13 @@ export interface PurpleShares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -666,7 +682,7 @@ export interface MessageBlock { export interface Message { app_id?: string; attachments?: any[]; - blocks?: TitleBlockElement[]; + blocks?: AttachmentBlock[]; bot_id?: string; bot_link?: string; bot_profile?: BotProfile; @@ -861,6 +877,7 @@ export interface MessageFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -1038,54 +1055,12 @@ export interface Public { reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; ts?: string; } -export interface Pagination { - first?: number; - last?: number; - page?: number; - page_count?: number; - per_page?: number; - total_count?: number; -} - -export interface Paging { - count?: number; - page?: number; - pages?: number; - total?: number; -} - -export interface Messages { - matches?: MessagesMatch[]; - pagination?: Pagination; - paging?: Paging; - total?: number; -} - -export interface MessagesMatch { - attachments?: Attachment[]; - blocks?: MatchBlock[]; - channel?: Channel; - files?: FileElement[]; - iid?: string; - is_mpim?: boolean; - no_reactions?: boolean; - permalink?: string; - previous?: Previous; - previous_2?: Previous; - score?: number; - team?: string; - text?: string; - ts?: string; - type?: string; - user?: string; - username?: string; -} - -export interface MatchBlock { +export interface MatchTitleBlock { accessory?: Accessory; alt_text?: string; api_decoration_available?: boolean; @@ -1181,6 +1156,49 @@ export interface AppIconUrls { image_original?: string; } +export interface Pagination { + first?: number; + last?: number; + page?: number; + page_count?: number; + per_page?: number; + total_count?: number; +} + +export interface Paging { + count?: number; + page?: number; + pages?: number; + total?: number; +} + +export interface Messages { + matches?: MessagesMatch[]; + pagination?: Pagination; + paging?: Paging; + total?: number; +} + +export interface MessagesMatch { + attachments?: Attachment[]; + blocks?: MatchTitleBlock[]; + channel?: Channel; + files?: FileElement[]; + iid?: string; + is_mpim?: boolean; + no_reactions?: boolean; + permalink?: string; + previous?: Previous; + previous_2?: Previous; + score?: number; + team?: string; + text?: string; + ts?: string; + type?: string; + user?: string; + username?: string; +} + export interface Channel { id?: string; is_channel?: boolean; @@ -1201,7 +1219,7 @@ export interface Channel { export interface Previous { attachments?: Attachment[]; - blocks?: MatchBlock[]; + blocks?: MatchTitleBlock[]; iid?: string; permalink?: string; text?: string; diff --git a/packages/web-api/src/response/SearchFilesResponse.ts b/packages/web-api/src/response/SearchFilesResponse.ts index 9bc5a32d6..d9392d2ae 100644 --- a/packages/web-api/src/response/SearchFilesResponse.ts +++ b/packages/web-api/src/response/SearchFilesResponse.ts @@ -26,93 +26,106 @@ export interface Files { } export interface Match { - attachments?: Attachment[]; - bot_id?: string; - cc?: Cc[]; - channels?: string[]; - comments_count?: number; - converted_pdf?: string; - created?: number; - display_as_bot?: boolean; - edit_link?: string; - editable?: boolean; - editors?: string[]; - external_id?: string; - external_type?: string; - external_url?: string; - file_access?: string; - filetype?: string; - from?: Cc[]; - groups?: string[]; - has_more?: boolean; - has_more_shares?: boolean; - has_rich_preview?: boolean; - headers?: MatchHeaders; - id?: string; - image_exif_rotation?: number; - ims?: string[]; - 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; - name?: string; - non_owner_editable?: boolean; - original_attachment_count?: number; - original_h?: number; - original_w?: number; - permalink?: string; - permalink_public?: string; - plain_text?: string; - pretty_type?: string; - preview?: string; - preview_highlight?: string; - preview_is_truncated?: boolean; - preview_plain_text?: string; - public_url_shared?: boolean; - sent_to_self?: boolean; - shares?: MatchShares; - size?: number; - subject?: string; - thumb_1024?: string; - thumb_1024_h?: number; - thumb_1024_w?: number; - thumb_160?: string; - thumb_360?: string; - thumb_360_h?: number; - thumb_360_w?: number; - thumb_480?: string; - thumb_480_h?: number; - thumb_480_w?: number; - thumb_64?: string; - thumb_720?: string; - thumb_720_h?: number; - thumb_720_w?: number; - thumb_80?: string; - thumb_800?: string; - thumb_800_h?: number; - thumb_800_w?: number; - thumb_960?: string; - thumb_960_h?: number; - thumb_960_w?: number; - thumb_pdf?: string; - thumb_pdf_h?: number; - thumb_pdf_w?: number; - thumb_tiny?: string; - thumb_video?: string; - timestamp?: number; - title?: string; - to?: Cc[]; - updated?: number; - url_private?: string; - url_private_download?: string; - user?: string; - user_team?: string; - username?: string; + access?: string; + attachments?: Attachment[]; + bot_id?: string; + cc?: Cc[]; + channels?: string[]; + comments_count?: number; + converted_pdf?: string; + created?: number; + display_as_bot?: boolean; + dm_mpdm_users_with_file_access?: DmMpdmUsersWithFileAccess[]; + edit_link?: string; + editable?: boolean; + editors?: string[]; + editors_count?: number; + external_id?: string; + external_type?: string; + external_url?: string; + file_access?: string; + filetype?: string; + from?: Cc[]; + groups?: string[]; + has_more?: boolean; + has_more_shares?: boolean; + has_rich_preview?: boolean; + headers?: MatchHeaders; + id?: string; + image_exif_rotation?: number; + ims?: string[]; + is_channel_space?: boolean; + is_external?: boolean; + is_public?: boolean; + is_starred?: boolean; + last_editor?: string; + lines?: number; + lines_more?: number; + linked_channel_id?: string; + media_display_type?: string; + mimetype?: string; + mode?: string; + name?: string; + non_owner_editable?: boolean; + org_or_workspace_access?: string; + original_attachment_count?: number; + original_h?: number; + original_w?: number; + permalink?: string; + permalink_public?: string; + plain_text?: string; + pretty_type?: string; + preview?: string; + preview_highlight?: string; + preview_is_truncated?: boolean; + preview_plain_text?: string; + private_channels_with_file_access_count?: number; + public_url_shared?: boolean; + quip_thread_id?: string; + sent_to_self?: boolean; + shares?: MatchShares; + size?: number; + subject?: string; + team_pref_version_history_enabled?: boolean; + teams_shared_with?: string[]; + thumb_1024?: string; + thumb_1024_h?: number; + thumb_1024_w?: number; + thumb_160?: string; + thumb_360?: string; + thumb_360_h?: number; + thumb_360_w?: number; + thumb_480?: string; + thumb_480_h?: number; + thumb_480_w?: number; + thumb_64?: string; + thumb_720?: string; + thumb_720_h?: number; + thumb_720_w?: number; + thumb_80?: string; + thumb_800?: string; + thumb_800_h?: number; + thumb_800_w?: number; + thumb_960?: string; + thumb_960_h?: number; + thumb_960_w?: number; + thumb_pdf?: string; + thumb_pdf_h?: number; + thumb_pdf_w?: number; + thumb_tiny?: string; + thumb_video?: string; + timestamp?: number; + title?: string; + title_blocks?: TitleBlock[]; + to?: Cc[]; + update_notification?: number; + updated?: number; + url_private?: string; + url_private_download?: string; + url_static_preview?: string; + user?: string; + user_team?: string; + username?: string; } export interface Attachment { @@ -218,11 +231,11 @@ export interface Block { block_id?: string; bot_user_id?: string; button_label?: string; - description?: Subtitle | string; + description?: DescriptionElement | string; developer_trace_id?: string; elements?: Accessory[]; fallback?: string; - fields?: Subtitle[]; + fields?: DescriptionElement[]; function_trigger_id?: string; image_bytes?: number; image_height?: number; @@ -234,9 +247,9 @@ export interface Block { provider_name?: string; sales_home_workflow_app_type?: number; share_url?: string; - text?: Subtitle; + text?: DescriptionElement; thumbnail_url?: string; - title?: Subtitle | string; + title?: DescriptionElement | string; title_url?: string; trigger_subtype?: string; trigger_type?: string; @@ -278,10 +291,10 @@ export interface Accessory { offset?: number; option_groups?: AccessoryOptionGroup[]; options?: InitialOptionElement[]; - placeholder?: Subtitle; + placeholder?: DescriptionElement; response_url_enabled?: boolean; style?: string; - text?: Subtitle; + text?: DescriptionElement; timezone?: string; type?: string; url?: string; @@ -290,21 +303,21 @@ export interface Accessory { } export interface AccessoryConfirm { - confirm?: Subtitle; - deny?: Subtitle; + confirm?: DescriptionElement; + deny?: DescriptionElement; style?: string; - text?: Subtitle; - title?: Subtitle; + text?: DescriptionElement; + title?: DescriptionElement; } -export interface Subtitle { +export interface DescriptionElement { emoji?: boolean; text?: string; - type?: SubtitleType; + type?: DescriptionType; verbatim?: boolean; } -export enum SubtitleType { +export enum DescriptionType { Mrkdwn = 'mrkdwn', PlainText = 'plain_text', } @@ -369,14 +382,14 @@ export interface Filter { } export interface InitialOptionElement { - description?: Subtitle; - text?: Subtitle; + description?: DescriptionElement; + text?: DescriptionElement; url?: string; value?: string; } export interface AccessoryOptionGroup { - label?: Subtitle; + label?: DescriptionElement; options?: InitialOptionElement[]; } @@ -498,6 +511,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -620,11 +634,13 @@ export interface PurpleShares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -840,6 +856,7 @@ export interface MessageFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -998,8 +1015,8 @@ export interface AttachmentMetadata { export interface Preview { can_remove?: boolean; icon_url?: string; - subtitle?: Subtitle; - title?: Subtitle; + subtitle?: DescriptionElement; + title?: DescriptionElement; type?: string; } @@ -1017,10 +1034,107 @@ export interface Public { reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; ts?: string; } +export interface TitleBlock { + accessory?: Accessory; + alt_text?: string; + api_decoration_available?: boolean; + app_collaborators?: string[]; + app_id?: string; + author_name?: string; + block_id?: string; + bot_user_id?: string; + button_label?: string; + call?: Call; + call_id?: string; + description?: DescriptionElement; + developer_trace_id?: string; + dispatch_action?: boolean; + element?: Accessory; + elements?: Accessory[]; + external_id?: string; + fallback?: string; + fields?: DescriptionElement[]; + file?: MessageFile; + file_id?: string; + function_trigger_id?: string; + hint?: DescriptionElement; + image_bytes?: number; + image_height?: number; + image_url?: string; + image_width?: number; + is_workflow_app?: boolean; + label?: DescriptionElement; + optional?: boolean; + owning_team_id?: string; + provider_icon_url?: string; + provider_name?: string; + sales_home_workflow_app_type?: number; + share_url?: string; + source?: string; + text?: DescriptionElement; + thumbnail_url?: string; + title?: DescriptionElement; + title_url?: string; + trigger_subtype?: string; + trigger_type?: string; + type?: BlockType; + url?: string; + video_url?: string; + workflow_id?: string; +} + +export interface Call { + media_backend_type?: string; + v1?: V1; +} + +export interface V1 { + active_participants?: Participant[]; + all_participants?: Participant[]; + app_icon_urls?: AppIconUrls; + app_id?: string; + channels?: string[]; + created_by?: string; + date_end?: number; + date_start?: number; + desktop_app_join_url?: string; + display_id?: string; + has_ended?: boolean; + id?: string; + is_dm_call?: boolean; + join_url?: string; + name?: string; + was_accepted?: boolean; + was_missed?: boolean; + was_rejected?: boolean; +} + +export interface Participant { + avatar_url?: string; + display_name?: string; + external_id?: string; + slack_id?: string; +} + +export interface AppIconUrls { + image_1024?: string; + image_128?: string; + image_192?: string; + image_32?: string; + image_36?: string; + image_48?: string; + image_512?: string; + image_64?: string; + image_72?: string; + image_96?: string; + image_original?: string; +} + export interface Pagination { first?: number; last?: number; diff --git a/packages/web-api/src/response/SearchMessagesResponse.ts b/packages/web-api/src/response/SearchMessagesResponse.ts index c17b81291..4cf90e7b1 100644 --- a/packages/web-api/src/response/SearchMessagesResponse.ts +++ b/packages/web-api/src/response/SearchMessagesResponse.ts @@ -447,6 +447,7 @@ export interface FileElement { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; @@ -569,11 +570,13 @@ export interface PurpleShares { export interface Private { access?: string; channel_name?: string; + date_last_shared?: number; latest_reply?: string; reply_count?: number; reply_users?: string[]; reply_users_count?: number; share_user_id?: string; + source?: string; team_id?: string; thread_ts?: string; ts?: string; @@ -789,6 +792,7 @@ export interface MessageFile { source_team?: string; subject?: string; subtype?: string; + team_pref_version_history_enabled?: boolean; teams_shared_with?: any[]; template_conversion_ts?: number; template_description?: string; diff --git a/packages/web-api/src/response/TeamBillableInfoResponse.ts b/packages/web-api/src/response/TeamBillableInfoResponse.ts index 4464b4d95..505571f7e 100644 --- a/packages/web-api/src/response/TeamBillableInfoResponse.ts +++ b/packages/web-api/src/response/TeamBillableInfoResponse.ts @@ -10,13 +10,18 @@ import { WebAPICallResult } from '../WebClient'; export type TeamBillableInfoResponse = WebAPICallResult & { - billable_info?: { [key: string]: BillableInfo }; - error?: string; - needed?: string; - ok?: boolean; - provided?: string; + billable_info?: { [key: string]: BillableInfo }; + error?: string; + needed?: string; + ok?: boolean; + provided?: string; + response_metadata?: ResponseMetadata; }; export interface BillableInfo { billing_active?: boolean; } + +export interface ResponseMetadata { + next_cursor?: string; +} diff --git a/packages/web-api/src/response/TeamProfileGetResponse.ts b/packages/web-api/src/response/TeamProfileGetResponse.ts index fc3e0fdca..a7887b127 100644 --- a/packages/web-api/src/response/TeamProfileGetResponse.ts +++ b/packages/web-api/src/response/TeamProfileGetResponse.ts @@ -27,6 +27,7 @@ export interface Field { hint?: string; id?: string; is_hidden?: boolean; + is_inverse?: boolean; label?: string; options?: Options; ordering?: number; diff --git a/packages/web-api/src/response/index.ts b/packages/web-api/src/response/index.ts index d7d710d6c..5035d08a9 100644 --- a/packages/web-api/src/response/index.ts +++ b/packages/web-api/src/response/index.ts @@ -197,6 +197,8 @@ export { FilesRemoteUpdateResponse } from './FilesRemoteUpdateResponse'; export { FilesRevokePublicURLResponse } from './FilesRevokePublicURLResponse'; export { FilesSharedPublicURLResponse } from './FilesSharedPublicURLResponse'; export { FilesUploadResponse } from './FilesUploadResponse'; +export { FunctionsCompleteErrorResponse } from './FunctionsCompleteErrorResponse'; +export { FunctionsCompleteSuccessResponse } from './FunctionsCompleteSuccessResponse'; export { GroupsArchiveResponse } from './GroupsArchiveResponse'; export { GroupsCloseResponse } from './GroupsCloseResponse'; export { GroupsCreateResponse } from './GroupsCreateResponse';