New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing API methods #1222
Add missing API methods #1222
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,8 @@ import { WorkflowsUpdateStepResponse } from './response/WorkflowsUpdateStepRespo | |
import { AdminUsersSessionGetSettingsResponse } from './response/AdminUsersSessionGetSettingsResponse'; | ||
import { AdminUsersSessionSetSettingsResponse } from './response/AdminUsersSessionSetSettingsResponse'; | ||
import { AdminUsersSessionClearSettingsResponse } from './response/AdminUsersSessionClearSettingsResponse'; | ||
import { AdminAppsClearResolutionResponse } from './response/AdminAppsClearResolutionResponse'; | ||
import { AdminAppsUninstallResponse } from './response/AdminAppsUninstallResponse'; | ||
|
||
// NOTE: could create a named type alias like data types like `SlackUserID: string` | ||
|
||
|
@@ -221,11 +223,13 @@ export abstract class Methods extends EventEmitter<WebClientEvent> { | |
public abstract apiCall(method: string, options?: WebAPICallOptions): Promise<WebAPICallResult>; | ||
|
||
public readonly admin = { | ||
// TODO: admin.analytics.getFile | ||
apps: { | ||
approve: bindApiCall<AdminAppsApproveArguments, AdminAppsApproveResponse>(this, 'admin.apps.approve'), | ||
approved: { | ||
list: bindApiCall<AdminAppsApprovedListArguments, AdminAppsApprovedListResponse>(this, 'admin.apps.approved.list'), | ||
}, | ||
clearResolution: bindApiCall<AdminAppsClearResolutionArguments, AdminAppsClearResolutionResponse>(this, 'admin.apps.clearResolution'), | ||
requests: { | ||
list: bindApiCall<AdminAppsRequestsListArguments, AdminAppsRequestsListResponse>(this, 'admin.apps.requests.list'), | ||
}, | ||
|
@@ -234,6 +238,7 @@ export abstract class Methods extends EventEmitter<WebClientEvent> { | |
list: | ||
bindApiCall<AdminAppsRestrictedListArguments, AdminAppsRestrictedListResponse>(this, 'admin.apps.restricted.list'), | ||
}, | ||
uninstall: bindApiCall<AdminAppsUninstallArguments, AdminAppsUninstallResponse>(this, 'admin.apps.uninstall'), | ||
}, | ||
barriers: { | ||
create: bindApiCall<AdminBarriersCreateArguments, AdminBarriersCreateResponse>(this, 'admin.barriers.create'), | ||
|
@@ -412,24 +417,6 @@ export abstract class Methods extends EventEmitter<WebClientEvent> { | |
}, | ||
}; | ||
|
||
public readonly channels = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved these to the bottom - see also https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api |
||
archive: bindApiCall<ChannelsArchiveArguments, WebAPICallResult>(this, 'channels.archive'), | ||
create: bindApiCall<ChannelsCreateArguments, WebAPICallResult>(this, 'channels.create'), | ||
history: bindApiCall<ChannelsHistoryArguments, WebAPICallResult>(this, 'channels.history'), | ||
info: bindApiCall<ChannelsInfoArguments, WebAPICallResult>(this, 'channels.info'), | ||
invite: bindApiCall<ChannelsInviteArguments, WebAPICallResult>(this, 'channels.invite'), | ||
join: bindApiCall<ChannelsJoinArguments, WebAPICallResult>(this, 'channels.join'), | ||
kick: bindApiCall<ChannelsKickArguments, WebAPICallResult>(this, 'channels.kick'), | ||
leave: bindApiCall<ChannelsLeaveArguments, WebAPICallResult>(this, 'channels.leave'), | ||
list: bindApiCall<ChannelsListArguments, WebAPICallResult>(this, 'channels.list'), | ||
mark: bindApiCall<ChannelsMarkArguments, WebAPICallResult>(this, 'channels.mark'), | ||
rename: bindApiCall<ChannelsRenameArguments, WebAPICallResult>(this, 'channels.rename'), | ||
replies: bindApiCall<ChannelsRepliesArguments, WebAPICallResult>(this, 'channels.replies'), | ||
setPurpose: bindApiCall<ChannelsSetPurposeArguments, WebAPICallResult>(this, 'channels.setPurpose'), | ||
setTopic: bindApiCall<ChannelsSetTopicArguments, WebAPICallResult>(this, 'channels.setTopic'), | ||
unarchive: bindApiCall<ChannelsUnarchiveArguments, WebAPICallResult>(this, 'channels.unarchive'), | ||
}; | ||
|
||
public readonly chat = { | ||
delete: bindApiCall<ChatDeleteArguments, ChatDeleteResponse>(this, 'chat.delete'), | ||
deleteScheduledMessage: | ||
|
@@ -473,13 +460,6 @@ export abstract class Methods extends EventEmitter<WebClientEvent> { | |
this, 'conversations.unarchive'), | ||
}; | ||
|
||
public readonly views = { | ||
open: bindApiCall<ViewsOpenArguments, ViewsOpenResponse>(this, 'views.open'), | ||
publish: bindApiCall<ViewsPublishArguments, ViewsPublishResponse>(this, 'views.publish'), | ||
push: bindApiCall<ViewsPushArguments, ViewsPushResponse>(this, 'views.push'), | ||
update: bindApiCall<ViewsUpdateArguments, ViewsUpdateResponse>(this, 'views.update'), | ||
}; | ||
|
||
public readonly dialog = { | ||
open: bindApiCall<DialogOpenArguments, DialogOpenResponse>(this, 'dialog.open'), | ||
}; | ||
|
@@ -518,47 +498,10 @@ export abstract class Methods extends EventEmitter<WebClientEvent> { | |
}, | ||
}; | ||
|
||
public readonly groups = { | ||
archive: bindApiCall<GroupsArchiveArguments, WebAPICallResult>(this, 'groups.archive'), | ||
create: bindApiCall<GroupsCreateArguments, WebAPICallResult>(this, 'groups.create'), | ||
createChild: bindApiCall<GroupsCreateChildArguments, WebAPICallResult>(this, 'groups.createChild'), | ||
history: bindApiCall<GroupsHistoryArguments, WebAPICallResult>(this, 'groups.history'), | ||
info: bindApiCall<GroupsInfoArguments, WebAPICallResult>(this, 'groups.info'), | ||
invite: bindApiCall<GroupsInviteArguments, WebAPICallResult>(this, 'groups.invite'), | ||
kick: bindApiCall<GroupsKickArguments, WebAPICallResult>(this, 'groups.kick'), | ||
leave: bindApiCall<GroupsLeaveArguments, WebAPICallResult>(this, 'groups.leave'), | ||
list: bindApiCall<GroupsListArguments, WebAPICallResult>(this, 'groups.list'), | ||
mark: bindApiCall<GroupsMarkArguments, WebAPICallResult>(this, 'groups.mark'), | ||
open: bindApiCall<GroupsOpenArguments, WebAPICallResult>(this, 'groups.open'), | ||
rename: bindApiCall<GroupsRenameArguments, WebAPICallResult>(this, 'groups.rename'), | ||
replies: bindApiCall<GroupsRepliesArguments, WebAPICallResult>(this, 'groups.replies'), | ||
setPurpose: bindApiCall<GroupsSetPurposeArguments, WebAPICallResult>(this, 'groups.setPurpose'), | ||
setTopic: bindApiCall<GroupsSetTopicArguments, WebAPICallResult>(this, 'groups.setTopic'), | ||
unarchive: bindApiCall<GroupsUnarchiveArguments, WebAPICallResult>(this, 'groups.unarchive'), | ||
}; | ||
|
||
public readonly im = { | ||
close: bindApiCall<IMCloseArguments, WebAPICallResult>(this, 'im.close'), | ||
history: bindApiCall<IMHistoryArguments, WebAPICallResult>(this, 'im.history'), | ||
list: bindApiCall<IMListArguments, WebAPICallResult>(this, 'im.list'), | ||
mark: bindApiCall<IMMarkArguments, WebAPICallResult>(this, 'im.mark'), | ||
open: bindApiCall<IMOpenArguments, WebAPICallResult>(this, 'im.open'), | ||
replies: bindApiCall<IMRepliesArguments, WebAPICallResult>(this, 'im.replies'), | ||
}; | ||
|
||
public readonly migration = { | ||
exchange: bindApiCall<MigrationExchangeArguments, MigrationExchangeResponse>(this, 'migration.exchange'), | ||
}; | ||
|
||
public readonly mpim = { | ||
close: bindApiCall<MPIMCloseArguments, WebAPICallResult>(this, 'mpim.close'), | ||
history: bindApiCall<MPIMHistoryArguments, WebAPICallResult>(this, 'mpim.history'), | ||
list: bindApiCall<MPIMListArguments, WebAPICallResult>(this, 'mpim.list'), | ||
mark: bindApiCall<MPIMMarkArguments, WebAPICallResult>(this, 'mpim.mark'), | ||
open: bindApiCall<MPIMOpenArguments, WebAPICallResult>(this, 'mpim.open'), | ||
replies: bindApiCall<MPIMRepliesArguments, WebAPICallResult>(this, 'mpim.replies'), | ||
}; | ||
|
||
public readonly oauth = { | ||
access: bindApiCall<OAuthAccessArguments, OauthAccessResponse>(this, 'oauth.access'), | ||
v2: { | ||
|
@@ -645,12 +588,79 @@ export abstract class Methods extends EventEmitter<WebClientEvent> { | |
}, | ||
}; | ||
|
||
public readonly views = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved this one to make the list here alphabetical order |
||
open: bindApiCall<ViewsOpenArguments, ViewsOpenResponse>(this, 'views.open'), | ||
publish: bindApiCall<ViewsPublishArguments, ViewsPublishResponse>(this, 'views.publish'), | ||
push: bindApiCall<ViewsPushArguments, ViewsPushResponse>(this, 'views.push'), | ||
update: bindApiCall<ViewsUpdateArguments, ViewsUpdateResponse>(this, 'views.update'), | ||
}; | ||
|
||
public readonly workflows = { | ||
stepCompleted: bindApiCall<WorkflowsStepCompletedArguments, WorkflowsStepCompletedResponse>( | ||
this, 'workflows.stepCompleted'), | ||
stepFailed: bindApiCall<WorkflowsStepFailedArguments, WorkflowsStepFailedResponse>(this, 'workflows.stepFailed'), | ||
updateStep: bindApiCall<WorkflowsUpdateStepArguments, WorkflowsUpdateStepResponse>(this, 'workflows.updateStep'), | ||
}; | ||
|
||
// --------------------------------- | ||
// Deprecated methods | ||
// --------------------------------- | ||
|
||
public readonly channels = { | ||
archive: bindApiCall<ChannelsArchiveArguments, WebAPICallResult>(this, 'channels.archive'), | ||
create: bindApiCall<ChannelsCreateArguments, WebAPICallResult>(this, 'channels.create'), | ||
history: bindApiCall<ChannelsHistoryArguments, WebAPICallResult>(this, 'channels.history'), | ||
info: bindApiCall<ChannelsInfoArguments, WebAPICallResult>(this, 'channels.info'), | ||
invite: bindApiCall<ChannelsInviteArguments, WebAPICallResult>(this, 'channels.invite'), | ||
join: bindApiCall<ChannelsJoinArguments, WebAPICallResult>(this, 'channels.join'), | ||
kick: bindApiCall<ChannelsKickArguments, WebAPICallResult>(this, 'channels.kick'), | ||
leave: bindApiCall<ChannelsLeaveArguments, WebAPICallResult>(this, 'channels.leave'), | ||
list: bindApiCall<ChannelsListArguments, WebAPICallResult>(this, 'channels.list'), | ||
mark: bindApiCall<ChannelsMarkArguments, WebAPICallResult>(this, 'channels.mark'), | ||
rename: bindApiCall<ChannelsRenameArguments, WebAPICallResult>(this, 'channels.rename'), | ||
replies: bindApiCall<ChannelsRepliesArguments, WebAPICallResult>(this, 'channels.replies'), | ||
setPurpose: bindApiCall<ChannelsSetPurposeArguments, WebAPICallResult>(this, 'channels.setPurpose'), | ||
setTopic: bindApiCall<ChannelsSetTopicArguments, WebAPICallResult>(this, 'channels.setTopic'), | ||
unarchive: bindApiCall<ChannelsUnarchiveArguments, WebAPICallResult>(this, 'channels.unarchive'), | ||
}; | ||
|
||
public readonly groups = { | ||
archive: bindApiCall<GroupsArchiveArguments, WebAPICallResult>(this, 'groups.archive'), | ||
create: bindApiCall<GroupsCreateArguments, WebAPICallResult>(this, 'groups.create'), | ||
createChild: bindApiCall<GroupsCreateChildArguments, WebAPICallResult>(this, 'groups.createChild'), | ||
history: bindApiCall<GroupsHistoryArguments, WebAPICallResult>(this, 'groups.history'), | ||
info: bindApiCall<GroupsInfoArguments, WebAPICallResult>(this, 'groups.info'), | ||
invite: bindApiCall<GroupsInviteArguments, WebAPICallResult>(this, 'groups.invite'), | ||
kick: bindApiCall<GroupsKickArguments, WebAPICallResult>(this, 'groups.kick'), | ||
leave: bindApiCall<GroupsLeaveArguments, WebAPICallResult>(this, 'groups.leave'), | ||
list: bindApiCall<GroupsListArguments, WebAPICallResult>(this, 'groups.list'), | ||
mark: bindApiCall<GroupsMarkArguments, WebAPICallResult>(this, 'groups.mark'), | ||
open: bindApiCall<GroupsOpenArguments, WebAPICallResult>(this, 'groups.open'), | ||
rename: bindApiCall<GroupsRenameArguments, WebAPICallResult>(this, 'groups.rename'), | ||
replies: bindApiCall<GroupsRepliesArguments, WebAPICallResult>(this, 'groups.replies'), | ||
setPurpose: bindApiCall<GroupsSetPurposeArguments, WebAPICallResult>(this, 'groups.setPurpose'), | ||
setTopic: bindApiCall<GroupsSetTopicArguments, WebAPICallResult>(this, 'groups.setTopic'), | ||
unarchive: bindApiCall<GroupsUnarchiveArguments, WebAPICallResult>(this, 'groups.unarchive'), | ||
}; | ||
|
||
public readonly im = { | ||
close: bindApiCall<IMCloseArguments, WebAPICallResult>(this, 'im.close'), | ||
history: bindApiCall<IMHistoryArguments, WebAPICallResult>(this, 'im.history'), | ||
list: bindApiCall<IMListArguments, WebAPICallResult>(this, 'im.list'), | ||
mark: bindApiCall<IMMarkArguments, WebAPICallResult>(this, 'im.mark'), | ||
open: bindApiCall<IMOpenArguments, WebAPICallResult>(this, 'im.open'), | ||
replies: bindApiCall<IMRepliesArguments, WebAPICallResult>(this, 'im.replies'), | ||
}; | ||
|
||
public readonly mpim = { | ||
close: bindApiCall<MPIMCloseArguments, WebAPICallResult>(this, 'mpim.close'), | ||
history: bindApiCall<MPIMHistoryArguments, WebAPICallResult>(this, 'mpim.history'), | ||
list: bindApiCall<MPIMListArguments, WebAPICallResult>(this, 'mpim.list'), | ||
mark: bindApiCall<MPIMMarkArguments, WebAPICallResult>(this, 'mpim.mark'), | ||
open: bindApiCall<MPIMOpenArguments, WebAPICallResult>(this, 'mpim.open'), | ||
replies: bindApiCall<MPIMRepliesArguments, WebAPICallResult>(this, 'mpim.replies'), | ||
}; | ||
|
||
} | ||
|
||
/** | ||
|
@@ -718,6 +728,11 @@ export interface AdminAppsApprovedListArguments extends WebAPICallOptions, Token | |
team_id?: string; | ||
enterprise_id?: string; | ||
} | ||
export interface AdminAppsClearResolutionArguments extends WebAPICallOptions { | ||
app_id: string; | ||
enterprise_id?: string; | ||
team_id?: string; | ||
} | ||
cursorPaginationEnabledMethods.add('admin.apps.approved.list'); | ||
export interface AdminAppsRequestsListArguments extends WebAPICallOptions, TokenOverridable, CursorPaginationEnabled { | ||
team_id?: string; | ||
|
@@ -734,6 +749,11 @@ export interface AdminAppsRestrictedListArguments extends WebAPICallOptions, Tok | |
} | ||
cursorPaginationEnabledMethods.add('admin.apps.restricted.list'); | ||
|
||
export interface AdminAppsUninstallArguments extends WebAPICallOptions { | ||
app_id: string; | ||
enterprise_id?: string; | ||
team_ids?: string[]; | ||
} | ||
export interface AdminBarriersCreateArguments extends WebAPICallOptions, TokenOverridable { | ||
barriered_from_usergroup_ids: string[]; | ||
primary_usergroup_id: string; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* tslint:disable */ | ||
import { WebAPICallResult } from '../WebClient'; | ||
export type AdminAppsUninstallResponse = WebAPICallResult & { | ||
ok?: boolean; | ||
error?: string; | ||
needed?: string; | ||
provided?: string; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,5 @@ export interface Conversation { | |
is_pending_ext_shared?: boolean; | ||
connected_team_ids?: string[]; | ||
conversation_host_id?: string; | ||
channel_email_addresses?: string[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ran |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described at #1191 , this endpoint returns binary data. We will work on it separately.