Skip to content

Commit

Permalink
feat(web-api): add new Slack Connect APIs team.externalTeams.list a…
Browse files Browse the repository at this point in the history
…nd `users.discoverableContacts.lookup` (#1826)
  • Loading branch information
filmaj authored Jun 18, 2024
1 parent f3acb2f commit 4df9fb8
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 123 deletions.
250 changes: 134 additions & 116 deletions packages/web-api/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import { WebAPICallResult, WebClient, WebClientEvent } from './WebClient';
// Response types
import type {
AdminAnalyticsGetFileResponse,
AdminAppsActivitiesListResponse,
AdminAppsApproveResponse,
AdminAppsApprovedListResponse,
AdminAppsClearResolutionResponse,
AdminAppsConfigLookupResponse,
AdminAppsConfigSetResponse,
AdminAppsRequestsCancelResponse,
AdminAppsRequestsListResponse,
AdminAppsRestrictResponse,
AdminAppsRestrictedListResponse,
Expand All @@ -19,13 +23,15 @@ import type {
AdminBarriersUpdateResponse,
AdminConversationsArchiveResponse,
AdminConversationsConvertToPrivateResponse,
AdminConversationsConvertToPublicResponse,
AdminConversationsCreateResponse,
AdminConversationsDeleteResponse,
AdminConversationsDisconnectSharedResponse,
AdminConversationsEkmListOriginalConnectedChannelInfoResponse,
AdminConversationsGetConversationPrefsResponse,
AdminConversationsGetTeamsResponse,
AdminConversationsInviteResponse,
AdminConversationsLookupResponse,
AdminConversationsRenameResponse,
AdminConversationsRestrictAccessAddGroupResponse,
AdminConversationsRestrictAccessListGroupsResponse,
Expand All @@ -45,11 +51,17 @@ import type {
AdminEmojiListResponse,
AdminEmojiRemoveResponse,
AdminEmojiRenameResponse,
AdminFunctionsListResponse,
AdminFunctionsPermissionsLookupResponse,
AdminFunctionsPermissionsSetResponse,
AdminInviteRequestsApproveResponse,
AdminInviteRequestsApprovedListResponse,
AdminInviteRequestsDeniedListResponse,
AdminInviteRequestsDenyResponse,
AdminInviteRequestsListResponse,
AdminRolesAddAssignmentsResponse,
AdminRolesListAssignmentsResponse,
AdminRolesRemoveAssignmentsResponse,
AdminTeamsAdminsListResponse,
AdminTeamsCreateResponse,
AdminTeamsListResponse,
Expand Down Expand Up @@ -80,6 +92,11 @@ import type {
AdminUsersSetOwnerResponse,
AdminUsersSetRegularResponse,
AdminUsersUnsupportedVersionsExportResponse,
AdminWorkflowsCollaboratorsAddResponse,
AdminWorkflowsCollaboratorsRemoveResponse,
AdminWorkflowsPermissionsLookupResponse,
AdminWorkflowsSearchResponse,
AdminWorkflowsUnpublishResponse,
ApiTestResponse,
AppsConnectionsOpenResponse,
AppsEventAuthorizationsListResponse,
Expand All @@ -92,6 +109,10 @@ import type {
AuthRevokeResponse,
AuthTeamsListResponse,
AuthTestResponse,
BookmarksAddResponse,
BookmarksEditResponse,
BookmarksListResponse,
BookmarksRemoveResponse,
BotsInfoResponse,
CallsAddResponse,
CallsEndResponse,
Expand Down Expand Up @@ -192,6 +213,7 @@ import type {
TeamAccessLogsResponse,
TeamBillableInfoResponse,
TeamBillingInfoResponse,
TeamExternalTeamsListResponse,
TeamInfoResponse,
TeamIntegrationLogsResponse,
TeamPreferencesListResponse,
Expand All @@ -206,6 +228,7 @@ import type {
UsergroupsUsersUpdateResponse,
UsersConversationsResponse,
UsersDeletePhotoResponse,
UsersDiscoverableContactsLookupResponse,
UsersGetPresenceResponse,
UsersIdentityResponse,
UsersInfoResponse,
Expand All @@ -222,30 +245,104 @@ import type {
WorkflowsStepCompletedResponse,
WorkflowsStepFailedResponse,
WorkflowsUpdateStepResponse,
AdminAppsRequestsCancelResponse,
BookmarksAddResponse,
BookmarksEditResponse,
BookmarksListResponse,
BookmarksRemoveResponse,
AdminConversationsConvertToPublicResponse,
AdminConversationsLookupResponse,
AdminRolesAddAssignmentsResponse,
AdminRolesListAssignmentsResponse,
AdminRolesRemoveAssignmentsResponse,
AdminAppsActivitiesListResponse,
AdminFunctionsListResponse,
AdminFunctionsPermissionsLookupResponse,
AdminFunctionsPermissionsSetResponse,
AdminWorkflowsSearchResponse,
AdminWorkflowsUnpublishResponse,
AdminWorkflowsCollaboratorsAddResponse,
AdminWorkflowsCollaboratorsRemoveResponse,
AdminWorkflowsPermissionsLookupResponse,
AdminAppsConfigLookupResponse,
AdminAppsConfigSetResponse,
} from './types/response/index';
// Request types
import type {
AdminAnalyticsGetFileArguments,
AdminAppsActivitiesListArguments,
AdminAppsApproveArguments,
AdminAppsApprovedListArguments,
AdminAppsClearResolutionArguments,
AdminAppsConfigLookupArguments,
AdminAppsConfigSetArguments,
AdminAppsRequestsCancelArguments,
AdminAppsRequestsListArguments,
AdminAppsRestrictArguments,
AdminAppsRestrictedListArguments,
AdminAppsUninstallArguments,
AdminAuthPolicyAssignEntitiesArguments,
AdminAuthPolicyGetEntitiesArguments,
AdminAuthPolicyRemoveEntitiesArguments,
AdminBarriersCreateArguments,
AdminBarriersDeleteArguments,
AdminBarriersListArguments,
AdminBarriersUpdateArguments,
AdminConversationsArchiveArguments,
AdminConversationsBulkArchiveArguments,
AdminConversationsBulkDeleteArguments,
AdminConversationsBulkMoveArguments,
AdminConversationsConvertToPrivateArguments,
AdminConversationsConvertToPublicArguments,
AdminConversationsCreateArguments,
AdminConversationsDeleteArguments,
AdminConversationsDisconnectSharedArguments,
AdminConversationsEKMListOriginalConnectedChannelInfoArguments,
AdminConversationsGetConversationPrefsArguments,
AdminConversationsGetCustomRetentionArguments,
AdminConversationsGetTeamsArguments,
AdminConversationsInviteArguments,
AdminConversationsLookupArguments,
AdminConversationsRemoveCustomRetentionArguments,
AdminConversationsRenameArguments,
AdminConversationsRestrictAccessAddGroupArguments,
AdminConversationsRestrictAccessListGroupsArguments,
AdminConversationsRestrictAccessRemoveGroupArguments,
AdminConversationsSearchArguments,
AdminConversationsSetConversationPrefsArguments,
AdminConversationsSetCustomRetentionArguments,
AdminConversationsSetTeamsArguments,
AdminConversationsUnarchiveArguments,
AdminEmojiAddArguments,
AdminEmojiAddAliasArguments,
AdminEmojiListArguments,
AdminEmojiRemoveArguments,
AdminEmojiRenameArguments,
AdminFunctionsListArguments,
AdminFunctionsPermissionsLookupArguments,
AdminFunctionsPermissionsSetArguments,
AdminInviteRequestsApproveArguments,
AdminInviteRequestsApprovedListArguments,
AdminInviteRequestsDeniedListArguments,
AdminInviteRequestsDenyArguments,
AdminInviteRequestsListArguments,
AdminRolesAddAssignmentsArguments,
AdminRolesListAssignmentsArguments,
AdminRolesRemoveAssignmentsArguments,
AdminTeamsAdminsListArguments,
AdminTeamsCreateArguments,
AdminTeamsListArguments,
AdminTeamsOwnersListArguments,
AdminTeamsSettingsInfoArguments,
AdminTeamsSettingsSetDefaultChannelsArguments,
AdminTeamsSettingsSetDescriptionArguments,
AdminTeamsSettingsSetDiscoverabilityArguments,
AdminTeamsSettingsSetIconArguments,
AdminTeamsSettingsSetNameArguments,
AdminUsergroupsAddChannelsArguments,
AdminUsergroupsAddTeamsArguments,
AdminUsergroupsListChannelsArguments,
AdminUsergroupsRemoveChannelsArguments,
AdminUsersAssignArguments,
AdminUsersInviteArguments,
AdminUsersListArguments,
AdminUsersRemoveArguments,
AdminUsersSessionListArguments,
AdminUsersSessionClearSettingsArguments,
AdminUsersSessionGetSettingsArguments,
AdminUsersSessionInvalidateArguments,
AdminUsersSessionResetArguments,
AdminUsersSessionResetBulkArguments,
AdminUsersSessionSetSettingsArguments,
AdminUsersSetAdminArguments,
AdminUsersSetExpirationArguments,
AdminUsersSetOwnerArguments,
AdminUsersSetRegularArguments,
AdminUsersUnsupportedVersionsExportArguments,
AdminWorkflowsCollaboratorsAddArguments,
AdminWorkflowsCollaboratorsRemoveArguments,
AdminWorkflowsPermissionsLookupArguments,
AdminWorkflowsSearchArguments,
AdminWorkflowsUnpublishArguments,
WorkflowsStepCompletedArguments,
WorkflowsStepFailedArguments,
WorkflowsUpdateStepArguments,
Expand All @@ -254,6 +351,7 @@ import type {
ViewsPushArguments,
ViewsPublishArguments,
UsersConversationsArguments,
UsersDiscoverableContactsLookupArguments,
UsersInfoArguments,
UsersListArguments,
UsersIdentityArguments,
Expand All @@ -278,6 +376,7 @@ import type {
TeamAccessLogsArguments,
TeamBillableInfoArguments,
TeamBillingInfoArguments,
TeamExternalTeamsListArguments,
TeamInfoArguments,
TeamIntegrationLogsArguments,
TeamPreferencesListArguments,
Expand Down Expand Up @@ -392,101 +491,6 @@ import type {
AppsManifestValidateArguments,
AppsUninstallArguments,
APITestArguments,
AdminAnalyticsGetFileArguments,
AdminAppsActivitiesListArguments,
AdminAppsApproveArguments,
AdminAppsApprovedListArguments,
AdminAppsClearResolutionArguments,
AdminAppsConfigLookupArguments,
AdminAppsConfigSetArguments,
AdminAppsRequestsCancelArguments,
AdminAppsRequestsListArguments,
AdminAppsRestrictArguments,
AdminAppsRestrictedListArguments,
AdminAppsUninstallArguments,
AdminAuthPolicyAssignEntitiesArguments,
AdminAuthPolicyGetEntitiesArguments,
AdminAuthPolicyRemoveEntitiesArguments,
AdminBarriersCreateArguments,
AdminBarriersDeleteArguments,
AdminBarriersListArguments,
AdminBarriersUpdateArguments,
AdminConversationsArchiveArguments,
AdminConversationsBulkArchiveArguments,
AdminConversationsBulkDeleteArguments,
AdminConversationsBulkMoveArguments,
AdminConversationsConvertToPrivateArguments,
AdminConversationsConvertToPublicArguments,
AdminConversationsCreateArguments,
AdminConversationsDeleteArguments,
AdminConversationsDisconnectSharedArguments,
AdminConversationsEKMListOriginalConnectedChannelInfoArguments,
AdminConversationsGetConversationPrefsArguments,
AdminConversationsGetCustomRetentionArguments,
AdminConversationsGetTeamsArguments,
AdminConversationsInviteArguments,
AdminConversationsLookupArguments,
AdminConversationsRemoveCustomRetentionArguments,
AdminConversationsRenameArguments,
AdminConversationsRestrictAccessAddGroupArguments,
AdminConversationsRestrictAccessListGroupsArguments,
AdminConversationsRestrictAccessRemoveGroupArguments,
AdminConversationsSearchArguments,
AdminConversationsSetConversationPrefsArguments,
AdminConversationsSetCustomRetentionArguments,
AdminConversationsSetTeamsArguments,
AdminConversationsUnarchiveArguments,
AdminEmojiAddArguments,
AdminEmojiAddAliasArguments,
AdminEmojiListArguments,
AdminEmojiRemoveArguments,
AdminEmojiRenameArguments,
AdminFunctionsListArguments,
AdminFunctionsPermissionsLookupArguments,
AdminFunctionsPermissionsSetArguments,
AdminInviteRequestsApproveArguments,
AdminInviteRequestsApprovedListArguments,
AdminInviteRequestsDeniedListArguments,
AdminInviteRequestsDenyArguments,
AdminInviteRequestsListArguments,
AdminRolesAddAssignmentsArguments,
AdminRolesListAssignmentsArguments,
AdminRolesRemoveAssignmentsArguments,
AdminTeamsAdminsListArguments,
AdminTeamsCreateArguments,
AdminTeamsListArguments,
AdminTeamsOwnersListArguments,
AdminTeamsSettingsInfoArguments,
AdminTeamsSettingsSetDefaultChannelsArguments,
AdminTeamsSettingsSetDescriptionArguments,
AdminTeamsSettingsSetDiscoverabilityArguments,
AdminTeamsSettingsSetIconArguments,
AdminTeamsSettingsSetNameArguments,
AdminUsergroupsAddChannelsArguments,
AdminUsergroupsAddTeamsArguments,
AdminUsergroupsListChannelsArguments,
AdminUsergroupsRemoveChannelsArguments,
AdminUsersAssignArguments,
AdminUsersInviteArguments,
AdminUsersListArguments,
AdminUsersRemoveArguments,
AdminUsersSessionListArguments,
AdminUsersSessionClearSettingsArguments,
AdminUsersSessionGetSettingsArguments,
AdminUsersSessionInvalidateArguments,
AdminUsersSessionResetArguments,
AdminUsersSessionResetBulkArguments,
AdminUsersSessionSetSettingsArguments,
AdminUsersSetAdminArguments,
AdminUsersSetExpirationArguments,
AdminUsersSetOwnerArguments,
AdminUsersSetRegularArguments,
AdminUsersUnsupportedVersionsExportArguments,
AdminWorkflowsCollaboratorsAddArguments,
AdminWorkflowsCollaboratorsRemoveArguments,
AdminWorkflowsPermissionsLookupArguments,
AdminWorkflowsSearchArguments,
AdminWorkflowsUnpublishArguments,
} from './types/request/index';

/**
Expand Down Expand Up @@ -1928,6 +1932,13 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
*/
info: bindApiCall<TeamBillingInfoArguments, TeamBillingInfoResponse>(this, 'team.billing.info'),
},
externalTeams: {
/**
* @description Returns a list of all the external teams connected and details about the connection.
* @see {@link https://api.slack.com/methods/team.externalTeams.list `team.externalTeams.list` API reference}.
*/
lookup: bindApiCall<TeamExternalTeamsListArguments, TeamExternalTeamsListResponse>(this, 'team.externalTeams.list'),
},
/**
* @description Gets information about the current team.
* @see {@link https://api.slack.com/methods/team.info `team.info` API reference}.
Expand Down Expand Up @@ -2022,6 +2033,13 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
* @see {@link https://api.slack.com/methods/users.deletePhoto `users.deletePhoto` API reference}.
*/
deletePhoto: bindApiCall<UsersDeletePhotoArguments, UsersDeletePhotoResponse>(this, 'users.deletePhoto'),
discoverableContacts: {
/**
* @description Lookup an email address to see if someone is on Slack.
* @see {@link https://api.slack.com/methods/users.discoverableContacts.lookup `users.discoverableContacts.lookup` API reference}.
*/
lookup: bindApiCall<UsersDiscoverableContactsLookupArguments, UsersDiscoverableContactsLookupResponse>(this, 'users.discoverableContacts.lookup'),
},
/**
* @description Gets user presence information.
* @see {@link https://api.slack.com/methods/users.getPresence `users.getPresence` API reference}.
Expand Down
4 changes: 2 additions & 2 deletions packages/web-api/src/types/request/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type { WorkflowsStepCompletedArguments, WorkflowsStepFailedArguments, WorkflowsUpdateStepArguments } from './workflows';
export type { ViewsUpdateArguments, ViewsOpenArguments, ViewsPushArguments, ViewsPublishArguments } from './views';
export type { UsersConversationsArguments, UsersInfoArguments, UsersListArguments, UsersIdentityArguments, UsersSetPhotoArguments, UsersProfileGetArguments, UsersProfileSetArguments, UsersDeletePhotoArguments, UsersGetPresenceArguments, UsersSetPresenceArguments, UsersLookupByEmailArguments } from './users';
export type { UsersConversationsArguments, UsersDiscoverableContactsLookupArguments, UsersInfoArguments, UsersListArguments, UsersIdentityArguments, UsersSetPhotoArguments, UsersProfileGetArguments, UsersProfileSetArguments, UsersDeletePhotoArguments, UsersGetPresenceArguments, UsersSetPresenceArguments, UsersLookupByEmailArguments } from './users';
export type { ToolingTokensRotateArguments } from './tooling';
export type { SearchAllArguments, SearchFilesArguments, SearchMessagesArguments } from './search';
export type { UsergroupsCreateArguments, UsergroupsDisableArguments, UsergroupsEnableArguments, UsergroupsListArguments, UsergroupsUpdateArguments, UsergroupsUsersListArguments, UsergroupsUsersUpdateArguments } from './usergroups';
export type { TeamAccessLogsArguments, TeamBillableInfoArguments, TeamBillingInfoArguments, TeamInfoArguments, TeamIntegrationLogsArguments, TeamPreferencesListArguments, TeamProfileGetArguments } from './team';
export type { TeamAccessLogsArguments, TeamBillableInfoArguments, TeamBillingInfoArguments, TeamExternalTeamsListArguments, TeamInfoArguments, TeamIntegrationLogsArguments, TeamPreferencesListArguments, TeamProfileGetArguments } from './team';
export type { StarsAddRemoveArguments, StarsListArguments } from './stars';
export type { RTMConnectArguments, RTMStartArguments } from './rtm';
export type { RemindersAddArguments, RemindersInfoArguments, RemindersListArguments, RemindersDeleteArguments, RemindersCompleteArguments } from './reminders';
Expand Down
Loading

0 comments on commit 4df9fb8

Please sign in to comment.